Gwen's Changeling Globals object
This is a revison of standard changeling code. Includes +flook, +fdesc, +fpose, +fpooc, +enchant, and +freehold.
Commands:
@aconnect,
@chown,
@cpattr,
@create,
@describe,
@dolist,
@link,
@lock,
@pemit,
@set,
@startup,
@switch,
@unlock,
@wait,
@wipe.
Instructions
Copy and paste the below code into a compatible MUSH or MUX.
MUSHCode for Gwen's Changeling Globals object
@@ The base code for this object is from Denver by Night's fae code.
@@ +flook, +fpose, +fpooc, and the +fdesc commands.
@@
@@ The @aconnect and @Startup were written by me, as was the +Freehold command.
@@ +enchant was re-written to the point that it's significantly my code.
@@
@@ The freehold command has two options, +freehold/q or +freehold/b.
@@ +freehold/b will reduce temp Banality by 1.
@@ +freehold/q will increase temp Glamour by 1.
@@ A location is a freehold if it has the "freehold" attribute (&freehold here=1)
@@ A location will give out Glamour if it has a "glamleft" attribute (works like the
@@ node code for mages on the mage global object).
@@
@@ This object was @decompiled from a PennMUSH game, and works with Didi-Style chargen.
@@
@@ The @startup command DOESN'T QUITE work, yet. The @aconnect command does. Both are meant to work
@@ together to eliminate the enchantment from non-fae when 24 IC hours is up.
@@ I'll update this object when I get it all working, and if I add any other commands to the
@@ fae sphere.
@@
@@
@create Changeling Global Object <CGO>
@link Changeling Global Object <CGO> = #185
@set Changeling Global Object <CGO> = WIZARD
@ACONNECT Changeling Global Object <CGO>=@switch/first strmatch(get(%#/GLAMRUZ),enchanted)=0,,{@switch/first gte(sub(convtime(vtime()),convtime(get(%#/LASTGLAM))),86400)=0,,{@wipe %#/GLAMRUZ; @wipe %#/LASTGLAM; @dolist [iter(lcon(%L),[switch(hasattr(##,GLAMRUZ),1,##)])]=@Pemit ##=%[Fae-Sight%] %N's Glamour fades, as %s is no longer Enchanted.; @pemit %#=CODE: The world returns to being dull and normal. Soon your memories of the Faerie Realm will be nothing more than dream and mist.}
@set Changeling Global Object <CGO>/ACONNECT=no_command prefixmatch
&CREDITS Changeling Global Object <CGO>=Basic fae globals (+banality, +flook, +fpose, +fpooc, +fdesc, +enchant) from Fae globals originally @ Denver by Night. +Freehold, @startup, and @aconnect commands completely written by Gwen Morse (with minor help from the Softcode mailing list). +enchant significantly rewritten by Gwen. Cleanup and organization of other commands by Gwen (http://www.geocities.com/goldmooneachna/mush.html).
&DO_BANALITY Changeling Global Object <CGO>=$+banality *:@switch [or(isstaff(%#),strmatch([get(%#/race)],changeling),strmatch([get(%#/class)],*kinain*))]=1,{@switch [nearby(%#,[num(*%0)])]=0,{@pemit %#=You must be in the same room in order to sense someone's banality.},1,{@pemit %#=You sense that [name(*%0)]'s banality level is [switch([get(*%0/ban)],1,so amazingly low that you wonder if they're real.,2,incredibly low.,3,very low.,4,fairly low.,5,low.,6,slightly lower than average.,7,average.,8,high.,9,very high.,10,so high it depresses you simply to be around them.,not set. Please contact the Fae Wiz with the person's name so it can be set.)] [switch(isstaff(%#),1,%([get(*%0/ban)]%))]}},0,{@pemit %#=Huh? \(Type "help" for help.\)}
&DO_ENCHANT Changeling Global Object <CGO>=$+enchant *:[setq(0,secure(*%0))];@switch/first 0=[strmatch(get(%#/race),changeling)],{@pemit %#=CODE:Huh? \(Type "help" for help.\)},[pmatch(%q0)],{@pemit %#=CODE: '%q0' is not a player.},[gt(get(%#/glam),0)],{@pemit %#=CODE: You don't have enough Glamour to Enchant someone!},[not(strmatch(get(%q0/race),changeling))],{@pemit %#=CODE: You can't Enchant a fellow changeling!},[not(strmatch(get(%q0/GLAMRUZ),enchanted))],{@pemit %#=CODE: You can't Enchant someone whose already been Enchanted.},[nearby(%#,num(%q0))],{@pemit %#=You must be in the same room in order to Enchant [name(%q0)].},{&GLAMRUZ [num(%q0)]=Enchanted; &LASTGLAM [num(%q0)]=[vtime()]; @dolist [iter(lcon(%L),[switch(hasattr(##,GLAMRUZ),1,##)])]={@Pemit ##=%[Fae-Sight%] %N's glamour wraps around [name(%q0)], Enchanting [obj(%q0)].}; @pemit %q0=CODE: The world swirls around you for a moment and suddenly seems a little bit brighter.%ROOC: You have just been Enchanted. Page a staffer for further details.; &glam %#=[sub([get(%#/glam)],1)]}
&DO_FDESC-HERE Changeling Global Object <CGO>=$+fdesc/here:@switch [or([match(owner(loc(%#)),%#)],[isstaff(%#)])]=0,{@pemit %#=You do not own that room.},{@unlock %l/describe; @cpattr %l/DESCRIBE=%l/DESC_BACKUP; @describe %l=%%r%[switch(%[gt(words(get(%%#/GLAMRUZ)),0)%],1,%[u(FAE-DESC)%],%[u(BANAL-DESC)%])%]%%r; @chown %l/describe=me; @lock %l/describe=me; @pemit %#=Your room is set to use the Fae Desc code.}
&DO_FDESC-OBJ Changeling Global Object <CGO>=$+fdesc/obj *:@unlock %0/DESCRIBE;@switch [match(owner(%0),%#)]=0,{@pemit %#=You do not own that object or it is not a valid dbref #.},{@cpattr %0/DESCRIBE=%0/DESC_BACKUP; @describe %0=%%r%[switch(%[gt(words(get(%%#/GLAMRUZ)),0)%],1,%[u(FAE-DESC)%],%[u(BANAL-DESC)%])%]%%r;&GLAMRUZ %0=Fae; @chown %0/DESCRIBE=me; @lock %0/DESCRIBE=me;@pemit %#=Your [name(%0)] is set to use the Fae Desc code.}
&DO_FDESC-SETUP Changeling Global Object <CGO>=$+fdesc/setup:@unlock %#/DESCRIBE;@cpattr %#/DESCRIBE=%#/DESC_BACKUP;@describe %#=%%r%[switch(%[gt(words(get(%%#/GLAMRUZ)),0)%],1,%[u(FAE-DESC)%],%[u(BANAL-DESC)%])%]%%r;&GLAMRUZ %#=Fae;@chown %#/DESCRIBE=me;@lock %#/DESCRIBE=me;@pemit %#=You are set to use the Fae Desc code.
&DO_FLOOK Changeling Global Object <CGO>=$+flook *:setq(0,locate(%#,%0,cehimn));@switch [or(isstaff(%#),hasattr(%#,GLAMRUZ))][not(strmatch(%q0,#-1))]=0*,{@pemit %#=Huh? \(Type "help" for help.\) },11,{@pemit %#=You squint your eyes and look at [name(%q0)]:%r[switch([hasattr(%q0,fae_desc)],1,[get_eval(%q0/fae_desc)],[get_eval(%q0/desc)])]},{@pemit %#=I don't see that here.}
&DO_FPOOC Changeling Global Object <CGO>=$+fpooc ?*:@switch [or(isstaff(%#),hasattr(%#,GLAMRUZ))]=1,{@dolist [iter(lcon(%L),[switch(or(hasattr(##,GLAMRUZ),isstaff(##)),1,##)])]=@Pemit ##=%[*OOC* Fae-Sight%] [switch(%0,:,%N %1,;,%N%1,!,%1,%N says "%0%1")]},0,{@pemit %#=Huh? \(Type "help" for help.\)}
&DO_FPOSE Changeling Global Object <CGO>=$+fpose ?*:@switch [or(isstaff(%#),hasattr(%#,GLAMRUZ))]=1,{@dolist [iter(lcon(%L),[switch(or(hasattr(##,GLAMRUZ),isstaff(##)),1,##)])]=@Pemit ##=%[Fae-Sight%] [switch(%0,:,%N %1,;,%N%1,!,%1,%N says "%0%1")]},0,{@pemit %#=Huh? \(Type "help" for help.\)}
&DO_FREEHOLD Changeling Global Object <CGO>=$+freehold/?:@switch/first [strmatch(get(%#/race),changeling)][hasattr(%l,Freehold)][or(strmatch(%0,g),strmatch(%0,b))][not(hasattr(%l,freehold_%#))][strmatch(%0,b)][strmatch(%0,g)]=0*,{@pemit %#=Huh? \(Type "help" for help.\)},10*,{@pemit %#=CODE: This place isn't a Freehold, you can't do that here.},110*,{@pemit %#=CODE: You used incorrect syntax. The command is '+freehold/b' to reduce your temporary Banality by one, or, '+freehold/g' to gain a point of temporary Glamour.},1110*,{@pemit %#=CODE: You're already using the +freehold command. Please wait for time to pass.},111110,{@switch/first [gte(get(%#/banp),1)]=0,{@pemit %#=CODE: You can't reduce your temporary Banality at this time. You can still try '+freehold/g' to increase your temporary Glamour.},1,{&freehold_%# %l=1; @pemit %#=CODE: You settle down to rest in the warmth of the Freehold Balefire. If you stay in this room for one RL hour, you will reduce your temporary Banality by one point. You can disconnect to allow that time to pass.; @wait 2=@switch/first hasttr(%l,freehold_%#)=0,{@pemit %#=CODE: You left the Freehold before a RL hour was completed. You retain all your temporary Banality.},{@pemit %#=CODE: You successfully reduce your temporary Banality by one point.; &banp %#=[max(0,sub(get(%#/BANP),1))]; @wipe %l/Freehold_%#}}},111101,{@switch/first [and(gte(get(%l/GLAMLEFT),1),lte(get(%#/glamp),9))]=0,{@pemit %#=CODE: You can't increase your temporary Glamour at this time. You can still try '+freehold/b' to reduce your temporary Banality.},1,{&freehold_%# %l=1; @pemit %#=CODE: You settle down to rest in the warmth of the Freehold Balefire. If you stay in this room for one RL hour, you will increase your temporary Glamour by one point. You can disconnect to allow that time to pass.; @wait 2=@switch/first hasattr(%l,freehold_%#)=0,{@pemit %#=CODE: You left the Freehold before a RL hour was completed. You do not increase your temporary Glamour.},{@pemit %#=CODE: You successfully increase your temporary Glamour by one point.;[setq(0,add(get(%#/GLAMP),1))]; &glamp %#=[switch(gt(%q0,10),0,%q0,10)]; &glamleft %l=[sub(get(%l/GLAMLEFT),1)]; @wipe %l/Freehold_%#}}},{@pemit %#=CODE: Error! The +freehold command is malfunctioning. Please contact Code Staff.}}
@STARTUP Changeling Global Object <CGO>=@dolist lwho()={[setq(0,num(##))]; @switch/first 0=strmatch(get(%q0/GLAMRUZ),enchanted),,gte(sub(convtime(vtime()),convtime(get(%q0/LASTGLAM))),86400),,{@wipe %q0/GLAMRUZ; @wipe %q0/LASTGLAM; @pemit %q0=CODE: The world returns to being dull and normal. Soon your memories of the Faerie Realm will be nothing more than dream and mist.; @dolist [iter(lcon(loc(%q0)),[switch(hasattr(##,GLAMRUZ),1,##)])]=@Pemit ##=%[Fae-Sight%] [name(%q0)]'s Glamour fades and [subj(%q0)] is no longer Enchanted.}
@set Changeling Global Object <CGO>/STARTUP=no_command prefixmatch
@@ +flook, +fpose, +fpooc, and the +fdesc commands.
@@
@@ The @aconnect and @Startup were written by me, as was the +Freehold command.
@@ +enchant was re-written to the point that it's significantly my code.
@@
@@ The freehold command has two options, +freehold/q or +freehold/b.
@@ +freehold/b will reduce temp Banality by 1.
@@ +freehold/q will increase temp Glamour by 1.
@@ A location is a freehold if it has the "freehold" attribute (&freehold here=1)
@@ A location will give out Glamour if it has a "glamleft" attribute (works like the
@@ node code for mages on the mage global object).
@@
@@ This object was @decompiled from a PennMUSH game, and works with Didi-Style chargen.
@@
@@ The @startup command DOESN'T QUITE work, yet. The @aconnect command does. Both are meant to work
@@ together to eliminate the enchantment from non-fae when 24 IC hours is up.
@@ I'll update this object when I get it all working, and if I add any other commands to the
@@ fae sphere.
@@
@@
@create Changeling Global Object <CGO>
@link Changeling Global Object <CGO> = #185
@set Changeling Global Object <CGO> = WIZARD
@ACONNECT Changeling Global Object <CGO>=@switch/first strmatch(get(%#/GLAMRUZ),enchanted)=0,,{@switch/first gte(sub(convtime(vtime()),convtime(get(%#/LASTGLAM))),86400)=0,,{@wipe %#/GLAMRUZ; @wipe %#/LASTGLAM; @dolist [iter(lcon(%L),[switch(hasattr(##,GLAMRUZ),1,##)])]=@Pemit ##=%[Fae-Sight%] %N's Glamour fades, as %s is no longer Enchanted.; @pemit %#=CODE: The world returns to being dull and normal. Soon your memories of the Faerie Realm will be nothing more than dream and mist.}
@set Changeling Global Object <CGO>/ACONNECT=no_command prefixmatch
&CREDITS Changeling Global Object <CGO>=Basic fae globals (+banality, +flook, +fpose, +fpooc, +fdesc, +enchant) from Fae globals originally @ Denver by Night. +Freehold, @startup, and @aconnect commands completely written by Gwen Morse (with minor help from the Softcode mailing list). +enchant significantly rewritten by Gwen. Cleanup and organization of other commands by Gwen (http://www.geocities.com/goldmooneachna/mush.html).
&DO_BANALITY Changeling Global Object <CGO>=$+banality *:@switch [or(isstaff(%#),strmatch([get(%#/race)],changeling),strmatch([get(%#/class)],*kinain*))]=1,{@switch [nearby(%#,[num(*%0)])]=0,{@pemit %#=You must be in the same room in order to sense someone's banality.},1,{@pemit %#=You sense that [name(*%0)]'s banality level is [switch([get(*%0/ban)],1,so amazingly low that you wonder if they're real.,2,incredibly low.,3,very low.,4,fairly low.,5,low.,6,slightly lower than average.,7,average.,8,high.,9,very high.,10,so high it depresses you simply to be around them.,not set. Please contact the Fae Wiz with the person's name so it can be set.)] [switch(isstaff(%#),1,%([get(*%0/ban)]%))]}},0,{@pemit %#=Huh? \(Type "help" for help.\)}
&DO_ENCHANT Changeling Global Object <CGO>=$+enchant *:[setq(0,secure(*%0))];@switch/first 0=[strmatch(get(%#/race),changeling)],{@pemit %#=CODE:Huh? \(Type "help" for help.\)},[pmatch(%q0)],{@pemit %#=CODE: '%q0' is not a player.},[gt(get(%#/glam),0)],{@pemit %#=CODE: You don't have enough Glamour to Enchant someone!},[not(strmatch(get(%q0/race),changeling))],{@pemit %#=CODE: You can't Enchant a fellow changeling!},[not(strmatch(get(%q0/GLAMRUZ),enchanted))],{@pemit %#=CODE: You can't Enchant someone whose already been Enchanted.},[nearby(%#,num(%q0))],{@pemit %#=You must be in the same room in order to Enchant [name(%q0)].},{&GLAMRUZ [num(%q0)]=Enchanted; &LASTGLAM [num(%q0)]=[vtime()]; @dolist [iter(lcon(%L),[switch(hasattr(##,GLAMRUZ),1,##)])]={@Pemit ##=%[Fae-Sight%] %N's glamour wraps around [name(%q0)], Enchanting [obj(%q0)].}; @pemit %q0=CODE: The world swirls around you for a moment and suddenly seems a little bit brighter.%ROOC: You have just been Enchanted. Page a staffer for further details.; &glam %#=[sub([get(%#/glam)],1)]}
&DO_FDESC-HERE Changeling Global Object <CGO>=$+fdesc/here:@switch [or([match(owner(loc(%#)),%#)],[isstaff(%#)])]=0,{@pemit %#=You do not own that room.},{@unlock %l/describe; @cpattr %l/DESCRIBE=%l/DESC_BACKUP; @describe %l=%%r%[switch(%[gt(words(get(%%#/GLAMRUZ)),0)%],1,%[u(FAE-DESC)%],%[u(BANAL-DESC)%])%]%%r; @chown %l/describe=me; @lock %l/describe=me; @pemit %#=Your room is set to use the Fae Desc code.}
&DO_FDESC-OBJ Changeling Global Object <CGO>=$+fdesc/obj *:@unlock %0/DESCRIBE;@switch [match(owner(%0),%#)]=0,{@pemit %#=You do not own that object or it is not a valid dbref #.},{@cpattr %0/DESCRIBE=%0/DESC_BACKUP; @describe %0=%%r%[switch(%[gt(words(get(%%#/GLAMRUZ)),0)%],1,%[u(FAE-DESC)%],%[u(BANAL-DESC)%])%]%%r;&GLAMRUZ %0=Fae; @chown %0/DESCRIBE=me; @lock %0/DESCRIBE=me;@pemit %#=Your [name(%0)] is set to use the Fae Desc code.}
&DO_FDESC-SETUP Changeling Global Object <CGO>=$+fdesc/setup:@unlock %#/DESCRIBE;@cpattr %#/DESCRIBE=%#/DESC_BACKUP;@describe %#=%%r%[switch(%[gt(words(get(%%#/GLAMRUZ)),0)%],1,%[u(FAE-DESC)%],%[u(BANAL-DESC)%])%]%%r;&GLAMRUZ %#=Fae;@chown %#/DESCRIBE=me;@lock %#/DESCRIBE=me;@pemit %#=You are set to use the Fae Desc code.
&DO_FLOOK Changeling Global Object <CGO>=$+flook *:setq(0,locate(%#,%0,cehimn));@switch [or(isstaff(%#),hasattr(%#,GLAMRUZ))][not(strmatch(%q0,#-1))]=0*,{@pemit %#=Huh? \(Type "help" for help.\) },11,{@pemit %#=You squint your eyes and look at [name(%q0)]:%r[switch([hasattr(%q0,fae_desc)],1,[get_eval(%q0/fae_desc)],[get_eval(%q0/desc)])]},{@pemit %#=I don't see that here.}
&DO_FPOOC Changeling Global Object <CGO>=$+fpooc ?*:@switch [or(isstaff(%#),hasattr(%#,GLAMRUZ))]=1,{@dolist [iter(lcon(%L),[switch(or(hasattr(##,GLAMRUZ),isstaff(##)),1,##)])]=@Pemit ##=%[*OOC* Fae-Sight%] [switch(%0,:,%N %1,;,%N%1,!,%1,%N says "%0%1")]},0,{@pemit %#=Huh? \(Type "help" for help.\)}
&DO_FPOSE Changeling Global Object <CGO>=$+fpose ?*:@switch [or(isstaff(%#),hasattr(%#,GLAMRUZ))]=1,{@dolist [iter(lcon(%L),[switch(or(hasattr(##,GLAMRUZ),isstaff(##)),1,##)])]=@Pemit ##=%[Fae-Sight%] [switch(%0,:,%N %1,;,%N%1,!,%1,%N says "%0%1")]},0,{@pemit %#=Huh? \(Type "help" for help.\)}
&DO_FREEHOLD Changeling Global Object <CGO>=$+freehold/?:@switch/first [strmatch(get(%#/race),changeling)][hasattr(%l,Freehold)][or(strmatch(%0,g),strmatch(%0,b))][not(hasattr(%l,freehold_%#))][strmatch(%0,b)][strmatch(%0,g)]=0*,{@pemit %#=Huh? \(Type "help" for help.\)},10*,{@pemit %#=CODE: This place isn't a Freehold, you can't do that here.},110*,{@pemit %#=CODE: You used incorrect syntax. The command is '+freehold/b' to reduce your temporary Banality by one, or, '+freehold/g' to gain a point of temporary Glamour.},1110*,{@pemit %#=CODE: You're already using the +freehold command. Please wait for time to pass.},111110,{@switch/first [gte(get(%#/banp),1)]=0,{@pemit %#=CODE: You can't reduce your temporary Banality at this time. You can still try '+freehold/g' to increase your temporary Glamour.},1,{&freehold_%# %l=1; @pemit %#=CODE: You settle down to rest in the warmth of the Freehold Balefire. If you stay in this room for one RL hour, you will reduce your temporary Banality by one point. You can disconnect to allow that time to pass.; @wait 2=@switch/first hasttr(%l,freehold_%#)=0,{@pemit %#=CODE: You left the Freehold before a RL hour was completed. You retain all your temporary Banality.},{@pemit %#=CODE: You successfully reduce your temporary Banality by one point.; &banp %#=[max(0,sub(get(%#/BANP),1))]; @wipe %l/Freehold_%#}}},111101,{@switch/first [and(gte(get(%l/GLAMLEFT),1),lte(get(%#/glamp),9))]=0,{@pemit %#=CODE: You can't increase your temporary Glamour at this time. You can still try '+freehold/b' to reduce your temporary Banality.},1,{&freehold_%# %l=1; @pemit %#=CODE: You settle down to rest in the warmth of the Freehold Balefire. If you stay in this room for one RL hour, you will increase your temporary Glamour by one point. You can disconnect to allow that time to pass.; @wait 2=@switch/first hasattr(%l,freehold_%#)=0,{@pemit %#=CODE: You left the Freehold before a RL hour was completed. You do not increase your temporary Glamour.},{@pemit %#=CODE: You successfully increase your temporary Glamour by one point.;[setq(0,add(get(%#/GLAMP),1))]; &glamp %#=[switch(gt(%q0,10),0,%q0,10)]; &glamleft %l=[sub(get(%l/GLAMLEFT),1)]; @wipe %l/Freehold_%#}}},{@pemit %#=CODE: Error! The +freehold command is malfunctioning. Please contact Code Staff.}}
@STARTUP Changeling Global Object <CGO>=@dolist lwho()={[setq(0,num(##))]; @switch/first 0=strmatch(get(%q0/GLAMRUZ),enchanted),,gte(sub(convtime(vtime()),convtime(get(%q0/LASTGLAM))),86400),,{@wipe %q0/GLAMRUZ; @wipe %q0/LASTGLAM; @pemit %q0=CODE: The world returns to being dull and normal. Soon your memories of the Faerie Realm will be nothing more than dream and mist.; @dolist [iter(lcon(loc(%q0)),[switch(hasattr(##,GLAMRUZ),1,##)])]=@Pemit ##=%[Fae-Sight%] [name(%q0)]'s Glamour fades and [subj(%q0)] is no longer Enchanted.}
@set Changeling Global Object <CGO>/STARTUP=no_command prefixmatch