00001
00002
00003
00004
00005
00006 #include "copyright.h"
00007
00008 #ifndef __POWERS_H
00009 #define __POWERS_H
00010
00011 #define POWER_EXT 0x1
00012
00013
00014 #define POW_CHG_QUOTAS 0x00000001
00015 #define POW_CHOWN_ANY 0x00000002
00016 #define POW_ANNOUNCE 0x00000004
00017 #define POW_BOOT 0x00000008
00018 #define POW_HALT 0x00000010
00019 #define POW_CONTROL_ALL 0x00000020
00020 #define POW_WIZARD_WHO 0x00000040
00021 #define POW_EXAM_ALL 0x00000080
00022 #define POW_FIND_UNFIND 0x00000100
00023 #define POW_FREE_MONEY 0x00000200
00024 #define POW_FREE_QUOTA 0x00000400
00025 #define POW_HIDE 0x00000800
00026 #define POW_IDLE 0x00001000
00027 #define POW_SEARCH 0x00002000
00028 #define POW_LONGFINGERS 0x00004000
00029 #define POW_PROG 0x00008000
00030 #define POW_SITEADMIN 0x00010000 // Can @shutdown and @restart.
00031
00032
00033
00034 #define POW_COMM_ALL 0x00080000
00035 #define POW_SEE_QUEUE 0x00100000
00036 #define POW_SEE_HIDDEN 0x00200000
00037 #define POW_MONITOR 0x00400000
00038 #define POW_POLL 0x00800000
00039 #define POW_NO_DESTROY 0x01000000
00040 #define POW_GUEST 0x02000000
00041 #define POW_PASS_LOCKS 0x04000000
00042 #define POW_STAT_ANY 0x08000000
00043 #define POW_STEAL 0x10000000
00044 #define POW_TEL_ANYWHR 0x20000000
00045 #define POW_TEL_UNRST 0x40000000
00046 #define POW_UNKILLABLE 0x80000000
00047
00048
00049 #define POW_BUILDER 0x00000001
00050 #ifdef FIRANMUX
00051 #define POW_IMMUTABLE 0x00000002
00052 #endif
00053
00054
00055
00056
00057
00058 typedef struct power_entry {
00059 const char *powername;
00060 int powervalue;
00061 int powerpower;
00062 int listperm;
00063 bool (*handler)(dbref target, dbref player, POWER power, int fpowers, bool reset);
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