Renamed Squelch to Mute and added emote ability to all channels. (thanks Mordecai) --Rumble

This commit is contained in:
Rumble 2007-06-05 19:09:00 +00:00
parent 8315bc5da8
commit eff90e60d0
7 changed files with 35 additions and 19 deletions

View file

@ -384,12 +384,23 @@ ACMD(do_page)
} }
} }
int first_word_is_name(struct char_data *ch, char * argument) {
char buf[MAX_INPUT_LENGTH];
char name_p[MAX_INPUT_LENGTH];
if (argument == NULL || IS_NPC(ch))
return 0;
strlcpy(buf, argument, sizeof(buf));
one_argument(buf, name_p);
return !str_cmp(GET_NAME(ch), name_p);
}
/* generalized communication func, originally by Fred C. Merkel (Torg) */ /* generalized communication func, originally by Fred C. Merkel (Torg) */
ACMD(do_gen_comm) ACMD(do_gen_comm)
{ {
struct descriptor_data *i; struct descriptor_data *i;
char color_on[24]; char color_on[24];
char buf1[MAX_INPUT_LENGTH], buf2[MAX_INPUT_LENGTH], *msg; char buf1[MAX_INPUT_LENGTH], buf2[MAX_INPUT_LENGTH], *msg;
bool emoting = FALSE;
/* Array of flags which must _not_ be set in order for comm to be heard */ /* Array of flags which must _not_ be set in order for comm to be heard */
int channels[] = { int channels[] = {
@ -505,11 +516,16 @@ ACMD(do_gen_comm)
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT)) if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT))
send_to_char(ch, "%s", CONFIG_OK); send_to_char(ch, "%s", CONFIG_OK);
else { else {
if (!first_word_is_name(ch, argument)) {
snprintf(buf1, sizeof(buf1), "%sYou %s, '%s'%s", COLOR_LEV(ch) >= C_CMP ? color_on : "", com_msgs[subcmd][1], argument, CCNRM(ch, C_CMP)); snprintf(buf1, sizeof(buf1), "%sYou %s, '%s'%s", COLOR_LEV(ch) >= C_CMP ? color_on : "", com_msgs[subcmd][1], argument, CCNRM(ch, C_CMP));
} else {
emoting = TRUE;
snprintf(buf1, sizeof(buf1), "%s%s: %s%s", COLOR_LEV(ch) >= C_CMP ? color_on : "", com_msgs[subcmd][1], CAP(argument), CCNRM(ch, C_CMP));
}
msg = act(buf1, FALSE, ch, 0, 0, TO_CHAR); msg = act(buf1, FALSE, ch, 0, 0, TO_CHAR);
add_history(ch, msg, hist_type[subcmd]); add_history(ch, msg, hist_type[subcmd]);
} }
if (!emoting)
snprintf(buf1, sizeof(buf1), "$n %ss, '%s'", com_msgs[subcmd][1], argument); snprintf(buf1, sizeof(buf1), "$n %ss, '%s'", com_msgs[subcmd][1], argument);
/* now send all the strings out */ /* now send all the strings out */

View file

@ -2020,11 +2020,11 @@ ACMD(do_toggle)
else if (wimp_lev > (GET_MAX_HIT(ch) / 2)) else if (wimp_lev > (GET_MAX_HIT(ch) / 2))
send_to_char(ch, "You can't set your wimp level above half your hit points.\r\n"); send_to_char(ch, "You can't set your wimp level above half your hit points.\r\n");
else { else {
send_to_char(ch, "Okay, you'll wimp out if you drop below %d hit points.\r\n", wimp_lev); send_to_char(ch, "Okay, you'll wimp out if you drop below %d hit points.", wimp_lev);
GET_WIMP_LEV(ch) = wimp_lev; GET_WIMP_LEV(ch) = wimp_lev;
} }
} else { } else {
send_to_char(ch, "Okay, you'll now tough out fights to the bitter end.\r\n"); send_to_char(ch, "Okay, you'll now tough out fights to the bitter end.");
GET_WIMP_LEV(ch) = 0; GET_WIMP_LEV(ch) = 0;
} }
} else } else
@ -2032,12 +2032,12 @@ ACMD(do_toggle)
break; break;
case SCMD_PAGELENGTH: case SCMD_PAGELENGTH:
if (!*arg2) if (!*arg2)
send_to_char(ch, "You current page length is set to %d lines.\r\n", GET_PAGE_LENGTH(ch)); send_to_char(ch, "You current page length is set to %d lines.", GET_PAGE_LENGTH(ch));
else if (is_number(arg2)) { else if (is_number(arg2)) {
GET_PAGE_LENGTH(ch) = MIN(MAX(atoi(arg2), 5), 255); GET_PAGE_LENGTH(ch) = MIN(MAX(atoi(arg2), 5), 255);
send_to_char(ch, "Okay, your page length is now set to %d lines.\r\n", GET_PAGE_LENGTH(ch)); send_to_char(ch, "Okay, your page length is now set to %d lines.", GET_PAGE_LENGTH(ch));
} else } else
send_to_char(ch, "Please specify a number of lines (5 - 255).\r\n"); send_to_char(ch, "Please specify a number of lines (5 - 255).");
break; break;
default: default:
if (!*arg2) { if (!*arg2) {

View file

@ -246,7 +246,7 @@ ACMD(do_gmote)
break; break;
if ((act_nr = find_action(cmd)) < 0) { if ((act_nr = find_action(cmd)) < 0) {
snprintf(buf, sizeof(buf), "Gossip: $n%s", argument); snprintf(buf, sizeof(buf), "Gemote: $n%s", argument);
act(buf, FALSE, ch, 0, vict, TO_GMOTE); act(buf, FALSE, ch, 0, vict, TO_GMOTE);
return; return;
} }
@ -266,7 +266,7 @@ action = &soc_mess_list[act_nr];
send_to_char(ch, "Who are you going to do that to?\r\n"); send_to_char(ch, "Who are you going to do that to?\r\n");
return; return;
} }
snprintf(buf, sizeof(buf), "Gossip: %s", action->others_no_arg); snprintf(buf, sizeof(buf), "Gemote: %s", action->others_no_arg);
} else if (!(vict = get_char_vis(ch, arg, NULL, FIND_CHAR_WORLD))) { } else if (!(vict = get_char_vis(ch, arg, NULL, FIND_CHAR_WORLD))) {
send_to_char(ch, "%s\r\n", action->not_found); send_to_char(ch, "%s\r\n", action->not_found);
return; return;
@ -275,14 +275,14 @@ action = &soc_mess_list[act_nr];
send_to_char(ch, "%s\r\n", action->char_auto); send_to_char(ch, "%s\r\n", action->char_auto);
return; return;
} }
snprintf(buf, sizeof(buf), "Gossip: %s", action->others_auto); snprintf(buf, sizeof(buf), "Gemote: %s", action->others_auto);
} else { } else {
if (GET_POS(vict) < action->min_victim_position) { if (GET_POS(vict) < action->min_victim_position) {
act("$N is not in a proper position for that.", act("$N is not in a proper position for that.",
FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP); FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
return; return;
} }
snprintf(buf, sizeof(buf), "Gossip: %s", action->others_found); snprintf(buf, sizeof(buf), "Gemote: %s", action->others_found);
} }
act(buf, FALSE, ch, 0, vict, TO_GMOTE); act(buf, FALSE, ch, 0, vict, TO_GMOTE);
} }

View file

@ -1267,12 +1267,12 @@ void do_cheat(struct char_data *ch)
GET_LEVEL(ch) = LVL_IMPL; GET_LEVEL(ch) = LVL_IMPL;
break; break;
case 2: // Shamra case 2: // Shamra
case 156: // Fizban
case 295: // Detta case 295: // Detta
GET_LEVEL(ch) = LVL_GRGOD; GET_LEVEL(ch) = LVL_GRGOD;
break; break;
case 7: // Rhade case 7: // Rhade
case 19: // Amber case 19: // Amber
case 156: // Fizban
case 253: // Mordecai case 253: // Mordecai
GET_LEVEL(ch) = LVL_GOD; GET_LEVEL(ch) = LVL_GOD;
break; break;
@ -2302,11 +2302,11 @@ ACMD(do_wizutil)
ONOFF(result), GET_NAME(vict), GET_NAME(ch)); ONOFF(result), GET_NAME(vict), GET_NAME(ch));
send_to_char(ch, "(GC) Notitle %s for %s by %s.\r\n", ONOFF(result), GET_NAME(vict), GET_NAME(ch)); send_to_char(ch, "(GC) Notitle %s for %s by %s.\r\n", ONOFF(result), GET_NAME(vict), GET_NAME(ch));
break; break;
case SCMD_SQUELCH: case SCMD_MUTE:
result = PLR_TOG_CHK(vict, PLR_NOSHOUT); result = PLR_TOG_CHK(vict, PLR_NOSHOUT);
mudlog(BRF, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "(GC) Squelch %s for %s by %s.", mudlog(BRF, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "(GC) Mute %s for %s by %s.",
ONOFF(result), GET_NAME(vict), GET_NAME(ch)); ONOFF(result), GET_NAME(vict), GET_NAME(ch));
send_to_char(ch, "(GC) Squelch %s for %s by %s.\r\n", ONOFF(result), GET_NAME(vict), GET_NAME(ch)); send_to_char(ch, "(GC) Mute %s for %s by %s.\r\n", ONOFF(result), GET_NAME(vict), GET_NAME(ch));
break; break;
case SCMD_FREEZE: case SCMD_FREEZE:
if (ch == vict) { if (ch == vict) {

View file

@ -366,7 +366,7 @@ cpp_extern const struct command_info cmd_info[] = {
{ "mail" , "mail" , POS_STANDING, do_not_here , 1, 0 }, { "mail" , "mail" , POS_STANDING, do_not_here , 1, 0 },
{ "medit" , "med" , POS_DEAD , do_oasis_medit, LVL_BUILDER, 0 }, { "medit" , "med" , POS_DEAD , do_oasis_medit, LVL_BUILDER, 0 },
{ "mlist" , "mlist" , POS_DEAD , do_oasis_list , LVL_BUILDER, SCMD_OASIS_MLIST }, { "mlist" , "mlist" , POS_DEAD , do_oasis_list , LVL_BUILDER, SCMD_OASIS_MLIST },
{ "mute" , "mute" , POS_DEAD , do_wizutil , LVL_GOD, SCMD_SQUELCH }, { "mute" , "mute" , POS_DEAD , do_wizutil , LVL_GOD, SCMD_MUTE },
{ "news" , "news" , POS_SLEEPING, do_gen_ps , 0, SCMD_NEWS }, { "news" , "news" , POS_SLEEPING, do_gen_ps , 0, SCMD_NEWS },
{ "noauction", "noauction",POS_DEAD , do_gen_tog , 0, SCMD_NOAUCTION }, { "noauction", "noauction",POS_DEAD , do_gen_tog , 0, SCMD_NOAUCTION },

View file

@ -126,7 +126,7 @@ struct alias_data {
#define SCMD_REROLL 0 #define SCMD_REROLL 0
#define SCMD_PARDON 1 #define SCMD_PARDON 1
#define SCMD_NOTITLE 2 #define SCMD_NOTITLE 2
#define SCMD_SQUELCH 3 #define SCMD_MUTE 3
#define SCMD_FREEZE 4 #define SCMD_FREEZE 4
#define SCMD_THAW 5 #define SCMD_THAW 5
#define SCMD_UNAFFECT 6 #define SCMD_UNAFFECT 6

View file

@ -224,7 +224,7 @@ void char_from_furniture(struct char_data *ch);
/* IS_AFFECTED for backwards compatibility */ /* IS_AFFECTED for backwards compatibility */
#define IS_AFFECTED(ch, skill) (AFF_FLAGGED((ch), (skill))) #define IS_AFFECTED(ch, skill) (AFF_FLAGGED((ch), (skill)))
#define PLR_TOG_CHK(ch,flag) ((TOGGLE_BIT_AR(PLR_FLAGS(ch), (flag))) & (flag)) #define PLR_TOG_CHK(ch,flag) ((TOGGLE_BIT_AR(PLR_FLAGS(ch), (flag))) & Q_BIT(flag))
#define PRF_TOG_CHK(ch,flag) ((TOGGLE_BIT_AR(PRF_FLAGS(ch), (flag))) & Q_BIT(flag)) #define PRF_TOG_CHK(ch,flag) ((TOGGLE_BIT_AR(PRF_FLAGS(ch), (flag))) & Q_BIT(flag))
/* new define for quick check */ /* new define for quick check */