# # Patch name: stunned-flag.174p7 # Patch version: 1.0 stable # Author's name: Amy Patricia Brown # Author's email: Amy@excelsior.federalsigma.dhs.org # Version of PennMUSH: 1.7.4 patchlevel 7 # Date patch made: 01 AUGUST 2001 # Author is willing to support (yes/no): yes # Patch format: diff # # # This is a contributed PennMUSH patch. Its use is subject to the # same restrictions found in PennMUSH's hdrs/copyrite.h file. # # No warranty is given for this patch. It is not necessarily going # to work on your system, with any version of PennMUSH other than # the one above, etc. # # If the author given above was willing to support the patch, you # should write to the author if you have any questions or problems. Do # *NOT* send email messages to Javelin or any PennMUSH mailing list about # this patch! # # Below this line is the author's description of the patch, # followed by the patch itself. If the patch is in context diff # format, you'll probably apply it by typing: patch < patchfile # in your top-level MUSH directory, unless instructed otherwise # below. # This patch adds a new player toggle STUNNED, and a new command restriction "nostunned" that can be used in restrict.cnf to restrict commands (like movement, speech, etc.) to those who are stunned/unconscious/annoying to wizards, etc. *** src/command.c~ Tue Jul 10 15:29:18 2001 --- src/command.c Wed Aug 1 11:06:46 2001 *************** *** 1063,1068 **** --- 1063,1069 ---- * wizard can only be used by wizards * god can only be used by god * noplayer can't be used by players, just objects/rooms/exits + * nostun can't be used by stunned players - Amy@CityScape * Return 1 on success, 0 on failure. */ int *************** *** 1078,1083 **** --- 1079,1086 ---- return 0; if (!strcasecmp(restriction, "nobody")) { command->type |= CMD_T_DISABLED; + } else if (string_prefix(restriction, "nostun")) { + command->type |= CMD_T_NOSTUNNED; } else if (string_prefix(restriction, "nogag")) { command->type |= CMD_T_NOGAGGED; } else if (string_prefix(restriction, "nofix")) { *************** *** 1269,1274 **** --- 1272,1281 ---- /* If disabled, return silently */ if (cmd->type & CMD_T_DISABLED) return 0; + if ((cmd->type & CMD_T_NOSTUNNED) && Stunned(player)) { + notify(player, T("You cannot do that while stunned.")); + return 0; + } if ((cmd->type & CMD_T_NOGAGGED) && Gagged(player)) { notify(player, T("You cannot do that while gagged.")); return 0; *** src/flags.c~ Wed Aug 1 11:14:46 2001 --- src/flags.c Wed Aug 1 11:26:52 2001 *************** *** 144,150 **** {"PARANOID", 'p', TYPE_PLAYER, PLAYER_PARANOID, F_ANY, F_ANY}, {"ADMIN", '+', TYPE_PLAYER, PLAYER_ADMIN, F_WIZARD, F_WIZARD}, {"IC", '~', TYPE_PLAYER, PLAYER_IC, F_WIZARD, F_WIZARD}, ! {"STUNNED", "&", TYPE_PLAYER, PLAYER_STUNNED, F_WIZARD, F_WIZARD}, {"MONITOR", 'M', TYPE_THING, THING_LISTEN, F_ANY, F_ANY}, {"DESTROY_OK", 'd', TYPE_THING, THING_DEST_OK, F_ANY, F_ANY}, --- 144,150 ---- {"PARANOID", 'p', TYPE_PLAYER, PLAYER_PARANOID, F_ANY, F_ANY}, {"ADMIN", '+', TYPE_PLAYER, PLAYER_ADMIN, F_WIZARD, F_WIZARD}, {"IC", '~', TYPE_PLAYER, PLAYER_IC, F_WIZARD, F_WIZARD}, ! {"STUNNED", '&', TYPE_PLAYER, PLAYER_STUNNED, F_WIZARD, F_WIZARD}, {"MONITOR", 'M', TYPE_THING, THING_LISTEN, F_ANY, F_ANY}, {"DESTROY_OK", 'd', TYPE_THING, THING_DEST_OK, F_ANY, F_ANY}, *** hdrs/dbdefs.h~ Wed Aug 1 10:41:59 2001 --- hdrs/dbdefs.h Wed Aug 1 11:37:40 2001 *************** *** 138,144 **** #define Gagged(x) (Toggles(Owner(x)) & PLAYER_GAGGED) /* 0x80 */ /* Stunned sourcehack - 1 AUG 2001 by Amy@CityScape */ ! #define Stunned(x) (toggles(Owner(x)) & PLAYER_STUNNED) /* End of Hack*/ #define ShowAnsi(x) (Toggles(Owner(x)) & PLAYER_ANSI) /* 0x400 */ --- 138,144 ---- #define Gagged(x) (Toggles(Owner(x)) & PLAYER_GAGGED) /* 0x80 */ /* Stunned sourcehack - 1 AUG 2001 by Amy@CityScape */ ! #define Stunned(x) (Toggles(Owner(x)) & PLAYER_STUNNED) /* End of Hack*/ #define ShowAnsi(x) (Toggles(Owner(x)) & PLAYER_ANSI) /* 0x400 */ *** hdrs/flags.h~ Wed Aug 1 11:12:14 2001 --- hdrs/flags.h Wed Aug 1 11:20:38 2001 *************** *** 141,147 **** #define PLAYER_PARANOID 0x200000 /* Paranoid nospoof */ ! #define PLAYER_STUNNED 0x2000000 /* CS - Stunned Flag */ /*-------------------------------------------------------------------------- * Thing flags */ --- 141,147 ---- #define PLAYER_PARANOID 0x200000 /* Paranoid nospoof */ ! #define PLAYER_STUNNED 0x4000000 /* CS - Stunned Flag */ /*-------------------------------------------------------------------------- * Thing flags */