#!/bin/sh echo "This is a patchfile for PennMUSH 1.7.3p6." echo "Install it using 'patch < $0' in your pennmush directory." exit # Patch name: mojo-1.7.3p6-src.patch # Patch version: # Author's name: Nathan Baum # Author's email: s0009525@chelt.ac.uk # Version of PennMUSH: 1.7.3p6 # Date patch made: Tue Oct 31 12:31:22 GMT 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 patch adds a MOJO player toggle that must be set in # order to use WIZARD/ROYALTY/@power abilities. The toggle # doesn't affect control you have via zoning. # # If your MOJO toggle is unset, then you will be exactly like a # mortal except that you will be permitted to set your MOJO # toggle. Note that MOJO doesn't give you permissions, it merely # enables the permissions you already have. # # WIZARD or ROYALTY objects you own are affected by your # MOJO state. # # The &mojo, &omojo and &amojo attributes do the usual thing. # # For hardcoding, the TrueGod(), TrueWizard(), TrueRoyalty(), # and TrueHasprivs() macros are versions that ignore the # MOJO toggle - they are needed otherwise a priveleged player # who had hir MOJO turned off wouldn't have permission to # turn it back on. # *** vanilla/src/flags.c Wed Oct 18 19:20:47 2000 --- src/flags.c Wed Nov 1 16:09:32 2000 *************** *** 142,147 **** --- 141,149 ---- {"SUSPECT", 's', TYPE_PLAYER, PLAYER_SUSPECT, F_WIZARD | F_MDARK, F_WIZARD | F_MDARK}, {"PARANOID", 'p', TYPE_PLAYER, PLAYER_PARANOID, F_ANY, F_ANY}, + #ifdef MOJO_FLAG + {"MOJO", '!', TYPE_PLAYER, PLAYER_MOJO, F_ANY, F_ANY}, + #endif {"MONITOR", 'M', TYPE_THING, THING_LISTEN, F_ANY, F_ANY}, {"DESTROY_OK", 'd', TYPE_THING, THING_DEST_OK, F_ANY, F_ANY}, *************** *** 586,591 **** --- 594,608 ---- notify(player, T("You must @lock/zone before you can set a player ZONE")); return 0; } + + #ifdef MOJO_FLAG + if ((flagp->type == TYPE_PLAYER) && (flagp->flag == PLAYER_MOJO) && + !TrueHasprivs(player)) { + notify(player, T("Looks like Doctor Evil stole yours.")); + return 0; + } + #endif + if (myperms & F_ANY) return 1; if ((myperms & F_WIZARD) && !Wizard(player)) *************** *** 1085,1090 **** --- 1113,1125 ---- } if (((f->flag == QUIET) && (f->type == NOTYPE)) || (!AreQuiet(player, thing))) notify(player, T("Flag reset.")); + #ifdef MOJO_FLAG + if ((f->flag == PLAYER_MOJO) && (f->type = TYPE_PLAYER)) { + did_it(thing, thing, "MOJO", + "You feel the power of the Mojo ebbing away, leaving you weak.", + "OMOJO", NULL, "AMOJO", Location(thing)); + } + #endif } else { /* set the flag */ *************** *** 1143,1148 **** --- 1180,1192 ---- } if (((f->flag == QUIET) && (f->flag == NOTYPE)) || (!AreQuiet(player, thing))) notify(player, T("Flag set.")); + #ifdef MOJO_FLAG + if ((f->flag == PLAYER_MOJO) && (f->type = TYPE_PLAYER)) { + did_it(thing, thing, "MOJO", + "You feel the power of the Mojo coursing through you, making you powerful.", + "OMOJO", NULL, "AMOJO", Location(thing)); + } + #endif } } *** vanilla/src/predicat.c Wed Oct 18 19:20:48 2000 --- src/predicat.c Wed Nov 1 16:09:32 2000 *************** *** 304,314 **** { /* Wizard controls everything * owners control their stuff ! * something which is in the enterlock of a ZMO controls non-INHERIT * and non-player objects. * INHERIT checks between two objects are checked in the code for the * specific function in question (do_trigger, do_set, etc.) ! * Those who pass the enterlock of a ZoneMaster control his objects, * but not the ZoneMaster himself. */ --- 304,314 ---- { /* Wizard controls everything * owners control their stuff ! * something which is in the zonelock of a ZMO controls non-INHERIT * and non-player objects. * INHERIT checks between two objects are checked in the code for the * specific function in question (do_trigger, do_set, etc.) ! * Those who pass the zonelock of a ZoneMaster control his objects, * but not the ZoneMaster himself. */ *** vanilla/src/set.c Wed Oct 18 19:20:48 2000 --- src/set.c Wed Nov 1 16:09:32 2000 *************** *** 209,214 **** --- 209,218 ---- notify(player, T("You cannot @CHOWN/PRESERVE. Use normal @CHOWN.")); return; } + if (God(thing)) { + notify(player, T("God always owns himself.")); + return; + } /* chowns to the zone master don't count towards fees */ if (!ZMaster(newowner)) { if (!can_pay_fees(player, Pennies(thing))) /* not enough money or quota */ *** vanilla/hdrs/dbdefs.h Wed Oct 18 19:20:46 2000 --- hdrs/dbdefs.h Wed Nov 1 16:09:20 2000 *************** *** 127,132 **** --- 127,138 ---- #define Vacation(x) 0 #endif + #ifdef MOJO_FLAG + #define Mojo(x) (IS(Owner(x), TYPE_PLAYER, PLAYER_MOJO)) + #undef Powers(x) + #define Powers(x) (Mojo(x) ? db[(x)].powers : 0) + #endif + /* Flags that apply to players, and all their stuff, * so check the Owner() of the object. */ *************** *** 199,214 **** #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))) #define AreQuiet(x,y) (Quiet(x) || (Quiet(y) && (Owner(y) == x))) #define Mobile(x) (IsPlayer(x) || IsThing(x)) --- 211,241 ---- #define Verbose(x) (Flags(x) & VERBOSE) #define Visual(x) (Flags(x) & VISUAL) + #ifdef DEFAULT_FLAG + #define Default(x) (Flags(x) & DEFAULT) + #endif /* Non-mortal checks */ ! ! #define TrueGod(x) ((x) == GOD) ! #define TrueWizard(x) ((Flags(x) & WIZARD) || TrueGod(x)) #ifdef ROYALTY_FLAG ! #define TrueRoyalty(x) (Flags(x) & ROYALTY) #else /* ROYALTY_FLAG */ ! #define TrueRoyalty(x) (0) #endif /* ROYALTY_FLAG */ ! #define TrueHasprivs(x) (TrueRoyalty(x) || TrueWizard(x) || TrueGod(x) ) + #ifdef MOJO_FLAG + #define God(x) (Mojo(x) && TrueGod(x)) + #define Royalty(x) (Mojo(x) && TrueRoyalty(x)) + #define Wizard(x) (Mojo(x) && TrueWizard(x)) + #else + #define God(x) (TrueGod(x)) + #define Royalty(x) (TrueRoyaly(x)) + #define Wizard(x) (TrueWizard(x)) + #endif + + #define Hasprivs(x) (Royalty(x) || Wizard(x) || God(x) ) #define IsQuiet(x) (Quiet(x) || Quiet(Owner(x))) #define AreQuiet(x,y) (Quiet(x) || (Quiet(y) && (Owner(y) == x))) #define Mobile(x) (IsPlayer(x) || IsThing(x)) *** vanilla/hdrs/flags.h Wed Oct 18 19:20:46 2000 --- hdrs/flags.h Wed Nov 1 16:09:20 2000 *************** *** 138,145 **** #endif #define PLAYER_COLOR 0x80000 /* ANSI color ok */ #define PLAYER_FORCEWHITE 0x100000 /* Force ansi_white after output */ ! #define PLAYER_PARANOID 0x200000 /* Paranoid nospoof */ ! /*-------------------------------------------------------------------------- * Thing flags --- 139,148 ---- #endif #define PLAYER_COLOR 0x80000 /* ANSI color ok */ #define PLAYER_FORCEWHITE 0x100000 /* Force ansi_white after output */ ! #define PLAYER_PARANOID 0x200000 /* Paranoid nospoof */ ! #ifdef MOJO_FLAG ! #define PLAYER_MOJO 0x400000 /* Privs enabled */ ! #endif /*-------------------------------------------------------------------------- * Thing flags