# Patch name: MORTAL flag # Patch version: 1.0 # Author's name: David Cheatham # Author's email: david@mush.cx # Version of PennMUSH: 1.7.3p9 # Date patch made: Tue Dec 5 21:02:26 EST 2000 # Author is willing to support (yes/no): yes # Patch format: Context # # # 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 is basically an example of how to add a flag. # The flag it adds, while fun, is really not that # useful and is a bit of a security hole. And yes, # even God is affected by it. it's possible for wizards # to set God GAGGED and @force him if he's MORTAL, and for # people to @tel him, wizards, and roy out of their rooms # if they're MORTAL. # # They also lose all special powers they normally have. # It actually is an interesting patch for testing, but # the semantics are all wrong, they can be MORTAL and # own wizard objects. # # But it really is just an example of how you can make a # large change in the behavior of Penn just by changing # a few macros. Note most of the patch is supporting the # new flag, only three lines were changed and one added to # actually make it *do* everything it does. # # And it shows how to add a flag, of course. # *** /home/david/pennmush/pennmush/src/flags.c Thu Nov 23 10:08:52 2000 --- src/flags.c Tue Dec 5 20:37:32 2000 *************** *** 142,147 **** --- 142,148 ---- {"SUSPECT", 's', TYPE_PLAYER, PLAYER_SUSPECT, F_WIZARD | F_MDARK, F_WIZARD | F_MDARK}, {"PARANOID", 'p', TYPE_PLAYER, PLAYER_PARANOID, F_ANY, F_ANY}, + {"MORTAL", 'T', TYPE_PLAYER, PLAYER_MORTAL, F_ANY, F_ANY}, {"MONITOR", 'M', TYPE_THING, THING_LISTEN, F_ANY, F_ANY}, {"DESTROY_OK", 'd', TYPE_THING, THING_DEST_OK, F_ANY, F_ANY}, *************** *** 313,318 **** --- 314,323 ---- {"PARAN", "PARANOID"}, {"PARA", "PARANOID"}, {"PAR", "PARANOID"}, + {"MORTAL", "MORTAL"}, + {"MORTA", "MORTAL"}, + {"MORT", "MORTAL"}, + {"MOR", "MORTAL"}, {"ZON", "ZONE"}, {"ZO", "ZONE"}, {"Z", "ZONE"}, *** /home/david/pennmush/pennmush/hdrs/dbdefs.h Thu Nov 23 10:08:51 2000 --- hdrs/dbdefs.h Tue Dec 5 20:56:24 2000 *************** *** 199,212 **** #define Verbose(x) (Flags(x) & VERBOSE) #define Visual(x) (Flags(x) & VISUAL) /* Non-mortal checks */ ! #define God(x) ((x) == GOD) #ifdef ROYALTY_FLAG ! #define Royalty(x) (Flags(x) & ROYALTY) #else /* ROYALTY_FLAG */ #define Royalty(x) 0 #endif /* ROYALTY_FLAG */ ! #define Wizard(x) ((Flags(x) & WIZARD) || God(x)) #define Hasprivs(x) (Royalty(x) || Wizard(x) || God(x) ) #define IsQuiet(x) (Quiet(x) || Quiet(Owner(x))) --- 199,213 ---- #define Verbose(x) (Flags(x) & VERBOSE) #define Visual(x) (Flags(x) & VISUAL) + #define Mortal(x) (IS(x, TYPE_PLAYER, PLAYER_MORTAL)) /* Non-mortal checks */ ! #define God(x) (((x) == GOD) && !Mortal(x)) #ifdef ROYALTY_FLAG ! #define Royalty(x) ((Flags(x) & ROYALTY) && !Mortal(x)) #else /* ROYALTY_FLAG */ #define Royalty(x) 0 #endif /* ROYALTY_FLAG */ ! #define Wizard(x) (((Flags(x) & WIZARD) || God(x)) && !Mortal(x)) #define Hasprivs(x) (Royalty(x) || Wizard(x) || God(x) ) #define IsQuiet(x) (Quiet(x) || Quiet(Owner(x))) *** /home/david/pennmush/pennmush/hdrs/flags.h Thu Nov 23 10:08:51 2000 --- hdrs/flags.h Tue Dec 5 20:31:30 2000 *************** *** 139,144 **** --- 139,145 ---- #define PLAYER_COLOR 0x80000 /* ANSI color ok */ #define PLAYER_FORCEWHITE 0x100000 /* Force ansi_white after output */ #define PLAYER_PARANOID 0x200000 /* Paranoid nospoof */ + #define PLAYER_MORTAL 0x400000 /* Has no special privs at all */ /*--------------------------------------------------------------------------