mux/src/powers.h

Go to the documentation of this file.
00001 // powers.h -- Object powers.
00002 //
00003 // $Id: powers.h,v 1.7 2005/10/24 15:48:36 sdennis Exp $
00004 //
00005 
00006 #include "copyright.h"
00007 
00008 #ifndef __POWERS_H
00009 #define __POWERS_H
00010 
00011 #define POWER_EXT       0x1 /* Lives in extended powers word */
00012 
00013 /* First word of powers */
00014 #define POW_CHG_QUOTAS  0x00000001  /* May change and see quotas */
00015 #define POW_CHOWN_ANY   0x00000002  /* Can @chown anything or to anyone */
00016 #define POW_ANNOUNCE    0x00000004  /* May use @wall */
00017 #define POW_BOOT        0x00000008  /* May use @boot */
00018 #define POW_HALT        0x00000010  /* May @halt on other's objects */
00019 #define POW_CONTROL_ALL 0x00000020  /* I control everything */
00020 #define POW_WIZARD_WHO  0x00000040  /* See extra WHO information */
00021 #define POW_EXAM_ALL    0x00000080  /* I can examine everything */
00022 #define POW_FIND_UNFIND 0x00000100  /* Can find unfindable players */
00023 #define POW_FREE_MONEY  0x00000200  /* I have infinite money */
00024 #define POW_FREE_QUOTA  0x00000400  /* I have infinite quota */
00025 #define POW_HIDE        0x00000800  /* Can set themselves DARK */
00026 #define POW_IDLE        0x00001000  /* No idle limit */
00027 #define POW_SEARCH      0x00002000  /* Can @search anyone */
00028 #define POW_LONGFINGERS 0x00004000  /* Can get/whisper/etc from a distance */
00029 #define POW_PROG        0x00008000  /* Can use the @prog command */
00030 #define POW_SITEADMIN   0x00010000  // Can @shutdown and @restart.
00031 
00032 /* FREE: 0x00020000 - 0x00040000 */
00033 
00034 #define POW_COMM_ALL    0x00080000  /* Channel wiz */
00035 #define POW_SEE_QUEUE   0x00100000  /* Player can see the entire queue */
00036 #define POW_SEE_HIDDEN  0x00200000  /* Player can see hidden players on WHO list */
00037 #define POW_MONITOR     0x00400000  /* Player can set or clear MONITOR */
00038 #define POW_POLL        0x00800000  /* Player can set the doing poll */
00039 #define POW_NO_DESTROY  0x01000000  /* Cannot be destroyed */
00040 #define POW_GUEST       0x02000000  /* Player is a guest */
00041 #define POW_PASS_LOCKS  0x04000000  /* Player can pass any lock */
00042 #define POW_STAT_ANY    0x08000000  /* Can @stat anyone */
00043 #define POW_STEAL       0x10000000  /* Can give negative money */
00044 #define POW_TEL_ANYWHR  0x20000000  /* Teleport anywhere */
00045 #define POW_TEL_UNRST   0x40000000  /* Teleport anything */
00046 #define POW_UNKILLABLE  0x80000000  /* Can't be killed */
00047 
00048 /* Second word of powers */
00049 #define POW_BUILDER     0x00000001  /* Can build */
00050 #ifdef FIRANMUX
00051 #define POW_IMMUTABLE   0x00000002  /* Can not change */
00052 #endif
00053 
00054 /* ---------------------------------------------------------------------------
00055  * POWERENT: Information about object powers.
00056  */
00057 
00058 typedef struct power_entry {
00059     const char *powername;  /* Name of the flag */
00060     int powervalue; /* Which bit in the object is the flag */
00061     int powerpower; /* Ctrl flags for this power (recursive? :-) */
00062     int listperm;   /* Who sees this flag when set */
00063     bool (*handler)(dbref target, dbref player, POWER power, int fpowers, bool reset);    /* Handler for setting/clearing this flag */
00064 } POWERENT;
00065 
00066 typedef struct powerset {
00067     POWER   word1;
00068     POWER   word2;
00069 } POWERSET;
00070 
00071 extern void init_powertab(void);
00072 extern void display_powertab(dbref);
00073 extern void power_set(dbref, dbref, char *, int);
00074 extern char *powers_list(dbref executor, dbref thing);
00075 extern bool has_power(dbref, dbref, char *);
00076 extern void decompile_powers(dbref, dbref, char *);
00077 extern bool decode_power(dbref player, char *powername, POWERSET *pset);
00078 
00079 #define s_Guest(c)          s_Powers((c), Powers(c) | POW_GUEST)
00080 
00081 #define Quota(c)            (((Powers(c) & POW_CHG_QUOTAS) != 0) || Wizard(c))
00082 #define Chown_Any(c)        (((Powers(c) & POW_CHOWN_ANY) != 0) || Wizard(c))
00083 #define Announce(c)         (((Powers(c) & POW_ANNOUNCE) != 0) || Wizard(c))
00084 #define Can_Boot(c)         (((Powers(c) & POW_BOOT) != 0) || Wizard(c))
00085 #define Can_Halt(c)         (((Powers(c) & POW_HALT) != 0) || Wizard(c))
00086 #define Control_All(c)      (((Powers(c) & POW_CONTROL_ALL) != 0) || Wizard(c))
00087 #define Wizard_Who(c)       (((Powers(c) & POW_WIZARD_WHO) != 0) || WizRoy(c))
00088 #define See_All(c)          (((Powers(c) & POW_EXAM_ALL) != 0) || WizRoy(c))
00089 #define Find_Unfindable(c)  ((Powers(c) & POW_FIND_UNFIND) != 0)
00090 #define Free_Money(c)       (((Powers(c) & POW_FREE_MONEY) != 0) || Immortal(c))
00091 #define Free_Quota(c)       (((Powers(c) & POW_FREE_QUOTA) != 0) || Wizard(c))
00092 #define Can_Hide(c)         (((Powers(c) & POW_HIDE) != 0) || Wizard(c))
00093 #define Can_Idle(c)         (((Powers(c) & POW_IDLE) != 0) || Wizard(c))
00094 #define Search(c)           (((Powers(c) & POW_SEARCH) != 0) || WizRoy(c))
00095 #define Long_Fingers(c)     (((Powers(c) & POW_LONGFINGERS) != 0) || Wizard(c))
00096 #define Comm_All(c)         (((Powers(c) & POW_COMM_ALL) != 0) || Wizard(c))
00097 #define See_Queue(c)        (((Powers(c) & POW_SEE_QUEUE) != 0) || WizRoy(c))
00098 #define See_Hidden(c)       (((Powers(c) & POW_SEE_HIDDEN) != 0) || WizRoy(c))
00099 #define Can_Monitor(c)      (((Powers(c) & POW_MONITOR) != 0) || Wizard(c))
00100 #define Can_Poll(c)         (((Powers(c) & POW_POLL) != 0) || Wizard(c))
00101 #define No_Destroy(c)       (((Powers(c) & POW_NO_DESTROY) != 0) || Wizard(c))
00102 #define Guest(c)            ((Powers(c) & POW_GUEST) != 0)
00103 #define Stat_Any(c)         ((Powers(c) & POW_STAT_ANY) != 0)
00104 #define Steal(c)            (((Powers(c) & POW_STEAL) != 0) || Wizard(c))
00105 #define Tel_Anywhere(c)     (((Powers(c) & POW_TEL_ANYWHR) != 0) || Tel_Anything(c))
00106 #define Tel_Anything(c)     (((Powers(c) & POW_TEL_UNRST) != 0) || WizRoy(c))
00107 #define Unkillable(c)       (((Powers(c) & POW_UNKILLABLE) != 0) || Immortal(c))
00108 #define Prog(c)             (((Powers(c) & POW_PROG) != 0) || Wizard(c))
00109 #define Pass_Locks(c)       ((Powers(c) & POW_PASS_LOCKS) != 0)
00110 #define Builder(c)          (((Powers2(c) & POW_BUILDER) != 0) || WizRoy(c))
00111 #ifdef FIRANMUX
00112 #define Immutable(c)        ((Powers2(c) & POW_IMMUTABLE) != 0)
00113 #endif
00114 
00115 #define Can_SiteAdmin(c)    (((Powers(c) & POW_SITEADMIN) != 0) || Wizard(c))
00116 
00117 #endif /* POWERS_H */

Generated on Mon May 28 04:40:11 2007 for MUX by  doxygen 1.4.7