@q @program asys-stdspells 1 999999 d i ( asys-stdspells v1.2 Jessy@FurryMUCK 6/00 INSTALLATION: asys-stdspells uses the standard Argo installation method. Port the program and set it Wizard. Type '+install asys-stdspells' USAGE: asys-stdspells may be freely ported. Please comment any changes. ) (2345678901234567890123456789012345678901234567890123456789012345678901) $def thisVersion "1.2" $define Tell me @ owner swap notify $enddef $define VerifyEvent caller #0 "@a/calls/eventloop" getprop dbcmp not if ">> This routine must be called from asys-eventmgr." me @ swap notify 0 exit then $enddef $include $lib/argo $include $lib/reflist lvar lib (* dbref of lib-Argo *) lvar namestr (* string: notify format with spell name *) lvar nonamestr (* string: notify format with no spell name *) lvar ourArg (* inital arg string, unmodified *) lvar ourAttackVal (* int: amount caster made roll by *) lvar ourBoolean (* int: misc flow control var *) lvar ourCreature (* string: name of a creature type *) lvar ourCom (* string: 'official' name of command *) lvar ourCounter (* misc. counter var *) lvar ourDataObj (* dbref: object holding system-wide data *) lvar ourDefenceVal (* int: amount defender made roll by *) lvar ourSpell (* string: spell we're casting *) lvar ourSubTarget (* string or dbref: carried object *) lvar ourString (* string: workspace var; prop of spell *) lvar ourTarget (* dbref: target of spell *) lvar scratch (* workspace var *) : DoInstall ( -- ) (* install program into Argo system *) caller program? not if (* confirm installation method *) ">> Programs must be installed via the " "+install" GetCommandName strcat " command." strcat Tell exit then prog "@a/version" getpropstr if ">> Reinstalling..." Tell else ">> Installing..." Tell then (* record 'official' name of prog; remove old links *) prog "@a/name" "asys-stdspells" setprop #0 "@a/prog_list/" prog name strcat prog setprop RecOldActions (* create and register command; set default props *) #0 "@a/calls/castanjin's cantrip" prog setprop #0 "@a/calls/castbeastfriend" prog setprop #0 "@a/calls/castbeastspeech" prog setprop #0 "@a/calls/castclearmind" prog setprop #0 "@a/calls/castclumsiness" prog setprop #0 "@a/calls/castconfusion" prog setprop #0 "@a/calls/castdeath" prog setprop #0 "@a/calls/castdeft knock" prog setprop #0 "@a/calls/castdestroy consitution" prog setprop #0 "@a/calls/castdestroy dexterity" prog setprop #0 "@a/calls/castdestroy intelligence" prog setprop #0 "@a/calls/castdestroy presence" prog setprop #0 "@a/calls/castdestroy strength" prog setprop #0 "@a/calls/castdoorjam" prog setprop #0 "@a/calls/castfire strike" prog setprop #0 "@a/calls/castflame storm" prog setprop #0 "@a/calls/castgone today" prog setprop #0 "@a/calls/castfecklessness" prog setprop #0 "@a/calls/castill being" prog setprop #0 "@a/calls/castinvisibility" prog setprop #0 "@a/calls/castlend constitution" prog setprop #0 "@a/calls/castlend dexterity" prog setprop #0 "@a/calls/castlend intelligence" prog setprop #0 "@a/calls/castlend presense" prog setprop #0 "@a/calls/castlend strength" prog setprop #0 "@a/calls/castmagesight" prog setprop #0 "@a/calls/castmine now" prog setprop #0 "@a/calls/castnimbleness" prog setprop #0 "@a/calls/castobscure" prog setprop #0 "@a/calls/castoops" prog setprop #0 "@a/calls/castover there" prog setprop #0 "@a/calls/castpreservation" prog setprop #0 "@a/calls/castresolve" prog setprop #0 "@a/calls/castresurrection" prog setprop #0 "@a/calls/castspark" prog setprop #0 "@a/calls/caststay there" prog setprop #0 "@a/calls/caststeal constitution" prog setprop #0 "@a/calls/caststeal dexterity" prog setprop #0 "@a/calls/caststeal intelligence" prog setprop #0 "@a/calls/caststeal presence" prog setprop #0 "@a/calls/caststeal strength" prog setprop #0 "@a/calls/caststrength" prog setprop #0 "@a/calls/castsummon bear" prog setprop #0 "@a/calls/castsummon falcon" prog setprop #0 "@a/calls/castsummon wolf" prog setprop #0 "@a/calls/castthe little death" prog setprop #0 "@a/calls/castwell being" prog setprop #0 "@a/calls/castweakness" prog setprop ">> Installed." Tell ; : DoUninstall (* uninstall program from Argo *) prog "@a/name" getpropstr if #0 "@a/prog_list/" prog "@a/name" getpropstr strcat getprop not if ">> " prog name strcat " is not currently installed." strcat Tell pid kill then else ">> " prog name strcat " is not currently installed." strcat Tell pid kill then ">> Please confirm: You wish to uninstall " prog name strcat "?" strcat Tell ReadYesNo not if ">> Aborted." Tell pid kill Then #0 "@a/calls/castanjin's cantrip" remove_prop #0 "@a/calls/castbeastfriend" remove_prop #0 "@a/calls/castbeastspeech" remove_prop #0 "@a/calls/castclearmind" remove_prop #0 "@a/calls/castclumsiness" remove_prop #0 "@a/calls/castconfusion" remove_prop #0 "@a/calls/castdeath" remove_prop #0 "@a/calls/castdeft knock" remove_prop #0 "@a/calls/castdestroy consitution" remove_prop #0 "@a/calls/castdestroy dexterity" remove_prop #0 "@a/calls/castdestroy intelligence" remove_prop #0 "@a/calls/castdestroy presence" remove_prop #0 "@a/calls/castdestroy strength" remove_prop #0 "@a/calls/castdoorjam" remove_prop #0 "@a/calls/castfire strike" remove_prop #0 "@a/calls/castflame storm" remove_prop #0 "@a/calls/castgone today" remove_prop #0 "@a/calls/castfecklessness" remove_prop #0 "@a/calls/castill being" remove_prop #0 "@a/calls/castinvisibility" remove_prop #0 "@a/calls/castlend constitution" remove_prop #0 "@a/calls/castlend dexterity" remove_prop #0 "@a/calls/castlend intelligence" remove_prop #0 "@a/calls/castlend presense" remove_prop #0 "@a/calls/castlend strength" remove_prop #0 "@a/calls/castmagesight" remove_prop #0 "@a/calls/castmine now" remove_prop #0 "@a/calls/castnimbleness" remove_prop #0 "@a/calls/castobscure" remove_prop #0 "@a/calls/castoops" remove_prop #0 "@a/calls/castover there" remove_prop #0 "@a/calls/castpreservation" remove_prop #0 "@a/calls/castresolve" remove_prop #0 "@a/calls/castresurrection" remove_prop #0 "@a/calls/castspark" remove_prop #0 "@a/calls/caststay there" remove_prop #0 "@a/calls/caststeal constitution" remove_prop #0 "@a/calls/caststeal dexterity" remove_prop #0 "@a/calls/caststeal intelligence" remove_prop #0 "@a/calls/caststeal presence" remove_prop #0 "@a/calls/caststeal strength" remove_prop #0 "@a/calls/caststrength" remove_prop #0 "@a/calls/castsummon bear" remove_prop #0 "@a/calls/castsummon falcon" remove_prop #0 "@a/calls/castsummon wolf" remove_prop #0 "@a/calls/castthe little death" remove_prop #0 "@a/calls/castwell being" remove_prop #0 "@a/calls/castweakness" remove_prop #0 "@a/comm_list/+control" over over getprop dup string? if "" "go to " subst #0 "@a/comm_list/" rot strcat over over getprop recycle remove_prop else recycle then remove_prop #0 "@a/prog_list/" prog "@a/name" getpropstr strcat remove_prop ">> Uninstalled. Please edit the online manual as appropriate." Tell ; : DoTargetLoop ( -- ) (* start an event loop for target if needed *) ourTarget @ thing? not ourTarget @ player? not and if exit then ourTarget @ "@a/eloop/pid" getprop dup if ispid? not if ourTarget @ "@a/eloop/quell_tell" "yes" setprop ourTarget @ "+wait" force ourTarget @ "@a/eloop/quell_tell" remove_prop then else ourTarget @ "@a/eloop/quell_tell" "yes" setprop ourTarget @ "+wait" force ourTarget @ "@a/eloop/quell_tell" remove_prop pop then ; : DoChecks ( -- i ) (* verify target, ability, materials, tools *) me @ "@a/eloop/target" getprop not if (* make sure target is ok *) ">> You don't have a valid target." VerTell me @ "@a/eloop/target" remove_prop 0 exit then me @ "@a/eloop/target" getprop ok? not if ">> You don't have a valid target." VerTell me @ "@a/eloop/target" remove_prop 0 exit then me @ "@a/eloop/target" getprop room? not if me @ "@a/eloop/target" getprop location me @ location dbcmp not me @ "@a/eloop/target" getprop location me @ dbcmp not and if ">> You don't have a valid target." VerTell me @ "@a/eloop/target" remove_prop 0 exit then then me @ "@a/eloop/target" getprop ourTarget ! (* make sure spell is ok *) me @ "@a/eloop/spell" getpropstr dup if ourSpell ! "@a/spells/$spell" ourSpell @ "$spell" subst ourString ! else ">> You do not have a Spell selected." VerTell 0 exit then (* check tools and materials *) "@a/spells/$spell/tools/" ourSpell @ "$spell" subst Tools? not if ">> You don't have the tools necessary for the $spell Spell." ourSpell @ "$spell" subst VerTell 0 exit then "@a/spells/$spell/materials/" ourSpell @ "$spell" subst Materials? not if ">> You don't have the materials necessary for the $spell Spell." ourSpell @ "$spell" subst VerTell 0 exit then 1 ; : DoCheckGuard ( -- i ) (* return true if ourTarget is guarded *) #0 "@a/calls/checkguard" getprop dup if ourTarget @ "#checkguard" rot call dup if (* asys-guard decides *) ">> $target is being guarded by $guard." ourTarget @ name ourTarget @ exit? if dup ";" instr if dup ";" instr 1 - strcut pop strip then then "$target" subst swap name "$guard" subst Tell 1 else pop 0 then else pop 0 then ; : DoBreakSomething ( -- ) (* break a required tool for ourSpell *) ourDataObj @ "@a/spells/$spell/tools/" me @ "@a/eloop/spell" getpropstr "$spell" subst nextprop dup if "" "@a/spells/$spell/tools/" me @ "@a/eloop/spell" getpropstr "$spell" subst subst scratch ! else pop exit then me @ contents begin dup while dup "@a/class/" scratch @ strcat getpropstr if dup "@a/broken" "yes" setprop break then next repeat pop ; : DoPresenceChecks ( -- i ) (* see if we need to made presence roll *) (* return false if concentration broken by attack or injury *) me @ "@a/eloop/attacked" getpropstr if PresenceRoll not if ">> $me's Spell fails." me @ name "$me" subst SpellTell "@a/spells/$spell/materials/" ourSpell @ "$spell" subst UseMaterials SetWait NukeStack 0 exit then then me @ "@a/eloop/injured" getpropstr if PresenceRoll if 1 else ">> $me's Spell fails." me @ name "$me" subst SpellTell "@a/spells/$spell/materials/" ourSpell @ "$spell" subst UseMaterials SetWait NukeStack 0 exit then else 1 then ; : DoCastRoll ( -- s ) (* roll for caster *) -999 ourAttackVal ! (* use materials *) "@a/spells/$spell/materials/" ourSpell @ "$spell" subst UseMaterials (* apply fatigue *) me @ "@a/stats/fat" over over getpropstr atoi ourDataObj @ "@a/spells/$spell/fat" ourSpell @ "$spell" subst getpropstr atoi + intostr setprop (* get ability *) me @ "@a/spells/$spell" ourSpell @ "$spell" subst GetModAbility me @ "@a/stats/" "spells/$spell" ourSpell @ "$spell" subst GetBase strcat GetModAbility + ourTarget @ GetMagResAdv - me @ "@a/eloop/genmod" getpropstr atoi + me @ "@a/spells/$spell" ourSpell @ "$spell" subst GetModAbility if 3 else 4 then 6 0 Dice over over - ourAttackVal ! dup 4 <= if me @ RollXPs then dup 4 <= if pop pop "critsucc" exit then dup 17 >= if pop pop "critfail" exit then >= if "normsucc" else "normfail" then ; : DoDefenceRoll ( -- i ) (* roll for target *) -998 ourDefenceVal ! ourDataObj @ "@a/spells/$spell/def" ourSpell @ "$spell" subst getpropstr dup if scratch ! else pop "normfail" exit then (* get ability *) ourTarget @ scratch @ GetModAbility dup if 3 else 4 then 6 0 Dice over over - ourDefenceVal ! dup 4 <= if ourTarget @ RollXPs then dup 4 <= if pop pop "critsucc" exit then dup 17 >= if pop pop "critfail" exit then >= if "normsucc" else "normfail" then ; : DoGetRandomTarget ( -- ) (* move user to an adjacent room *) NukeStack loc @ contents begin dup while dup "@a/version" getpropstr if dup "@a/combat" getpropstr if dup me @ dbcmp not if dup ourTarget @ dbcmp not if dup then then then then next repeat pop depth if depth random swap % 1 + pick begin depth 1 = not while swap pop repeat else #-1 then ; : DoMoveOneRoom ( -- ) (* move user to an adjacent room *) NukeStack me @ location exits begin dup while dup getlink if dup getlink room? if dup getlink me @ ourString @ getprop dbcmp not if dup getlink swap then then then next repeat pop depth if depth random swap % 1 + pick begin depth 1 = not while swap pop repeat dup if me @ swap moveto else pop me @ dup getlink moveto then else me @ dup getlink moveto exit then ; : DoAnjinsCantripCritSucc ( -- ) ourTarget @ "@a/stats/dam" over over getpropstr atoi random 4 % 1 + 2 * - intostr setprop ourTarget @ "@a/stats/dam" getpropstr atoi 0 <= if ourTarget @ "@a/stats/dam" remove_prop then ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoAnjinsCantripCritFail ( -- ) random 2 % if ourTarget @ else me @ then "@a/stats/dam" over over getpropstr atoi random 4 % 1 + + intostr setprop ">> $me casts $spell $target." ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoAnjinsCantripNormSucc ( -- ) ourTarget @ "@a/stats/dam" over over getpropstr atoi random 4 % 1 + - intostr setprop ourTarget @ "@a/stats/dam" getpropstr atoi 0 <= if ourTarget @ "@a/stats/dam" remove_prop then ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoAnjinsCantripNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoAnjinsCantrip ( -- ) VerifyEvent DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoAnjinsCantripCritSucc else dup "critfail" smatch if DoAnjinsCantripCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoAnjinsCantripNormFail else "critfail" smatch if DoAnjinsCantripNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoAnjinsCantripNormSucc else DoAnjinsCantripNormFail then then then else DoAnjinsCantripNormFail then then then SetWait NukeStack ; : DoBeastFriendCritSucc ( -- i ) ourTarget @ player? not if me @ "@a/eloop/controlling" ourTarget @ setprop ourTarget @ "@a/eloop/controlled" me @ REF-add #0 "@a/uncontrol" ourTarget REF-add me @ "@a/eloop/controlling_expires" getprop not if me @ "@a/spells/$spell" ourSpell @ "$spell" subst GetModAbility me @ "@a/skills/falon's lore" GetModAbility + random swap % 1 + 2 * 2 * ourDataObj @ "@a/sysparms/turn_length" getpropstr atoi + systime + systime me @ "@a/eloop/control_expires" rot setprop then then ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop 1 ; : DoBeastFriendCritFail ( -- i ) ">> $me casts $spell $target." ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ourTarget @ "$attack $me" me @ name "$me" subst "+attack" GetCommandName "$attack" subst force 0 ; : DoBeastFriendNormSucc ( -- i ) ourTarget @ player? not if me @ "@a/eloop/controlling" ourTarget @ setprop ourTarget @ "@a/eloop/controlled" me @ REF-add #0 "@a/uncontrol" ourTarget REF-add me @ "@a/eloop/controlling_expires" getprop not if me @ "@a/spells/$spell" ourSpell @ "$spell" subst GetModAbility me @ "@a/skills/falon's lore" GetModAbility + random swap % 1 + 2 * ourDataObj @ "@a/sysparms/turn_length" getpropstr atoi + systime + intostr me @ "@a/eloop/control_expires" rot setprop then then ">> $me casts $spell $target." SpellTell DoTargetLoop 1 ; : DoBeastFriendNormFail ( -- i ) ">> $me's attempt to cast $spell $targetfails." SpellTell 0 ; : DoBeastFriend ( -- i ) VerifyEvent DoChecks not if TellWait 0 exit then DoPresenceChecks not if 0 exit then DoCastRoll dup "critsucc" smatch if DoBeastFriendCritSucc else dup "critfail" smatch if DoBeastFriendCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoBeastFriendNormFail else "critfail" smatch if DoBeastFriendNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoBeastFriendNormSucc else DoBeastFriendNormFail then then then else DoBeastFriendNormFail then then then me @ "@a/eloop/target" remove_prop me @ "@a/eloop/act" "wait" setprop me @ "@a/eloop/acting" "waiting" setprop ; : DoBeastSpeechCritSucc ( -- i ) ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop 1 ; : DoBeastSpeechCritFail ( -- i ) ">> $me casts $spell $target." ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ourTarget @ "$attack $me" me @ name "$me" subst "+attack" GetCommandName "$attack" subst me @ name "$name" subst force 0 ; : DoBeastSpeechNormSucc ( -- i ) ">> $me casts $spell $target." SpellTell DoTargetLoop 1 ; : DoBeastSpeechNormFail ( -- i ) ">> $me's attempt to cast $spell $targetfails." SpellTell 0 ; : DoBeastSpeech ( -- i ) VerifyEvent DoChecks not if TellWait 0 exit then DoPresenceChecks not if 0 exit then DoCastRoll dup "critsucc" smatch if DoBeastSpeechCritSucc else dup "critfail" smatch if DoBeastSpeechCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoBeastSpeechNormFail else "critfail" smatch if DoBeastSpeechNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoBeastSpeechNormSucc else DoBeastSpeechNormFail then then then else DoBeastSpeechNormFail then then then me @ "@a/eloop/target" remove_prop me @ "@a/eloop/act" "wait" setprop me @ "@a/eloop/acting" "waiting" setprop ; : DoClearmindCritSucc ( -- ) ourTarget @ "@a/stats/int_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/nimbleness" GetModAbility 1 + + 1 swap 0 Dice 2 * + intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoClearmindCritFail ( -- ) me @ "@a/stats/int_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/nimbleness" GetModAbility 1 + + 1 swap 0 Dice - intostr setprop ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoClearmindNormSucc ( -- ) ourTarget @ "@a/stats/int_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/nimbleness" GetModAbility 1 + + 1 swap 0 Dice + intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoClearmindNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoClearmind ( -- ) (* run an attempt to cast nimbleness *) VerifyEvent (* check: called from eventmgr? *) (* make sure target, skill, tools, and materials are ok *) DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoClearmindCritSucc else dup "critfail" smatch if DoClearmindCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoClearmindNormFail else "critfail" smatch if DoClearmindNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoClearmindNormSucc else DoClearmindNormFail then then then else DoClearmindNormFail then then then SetWait NukeStack ; : DoClumsinessCritSucc ( -- ) ourTarget @ "@a/stats/dex_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/confusion" GetModAbility 1 + + 1 swap 0 Dice 2 * - intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoClumsinessCritFail ( -- ) me @ "@a/stats/dex_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/confusion" GetModAbility 1 + + 1 swap 0 Dice + intostr setprop ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoClumsinessNormSucc ( -- ) ourTarget @ "@a/stats/dex_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/confusion" GetModAbility 1 + + 1 swap 0 Dice - intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoClumsinessNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoClumsiness ( -- ) VerifyEvent DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoClumsinessCritSucc else dup "critfail" smatch if DoClumsinessCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoClumsinessNormFail else "critfail" smatch if DoClumsinessNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoClumsinessNormSucc else DoClumsinessNormFail then then then else DoClumsinessNormFail then then then SetWait NukeStack ; : DoConfusionCritSucc ( -- ) ourTarget @ "@a/stats/int_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/confusion" GetModAbility 1 + + 1 swap 0 Dice 2 * - intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoConfusionCritFail ( -- ) me @ "@a/stats/int_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/confusion" GetModAbility 1 + + 1 swap 0 Dice + intostr setprop ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoConfusionNormSucc ( -- ) ourTarget @ "@a/stats/int_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/confusion" GetModAbility 1 + + 1 swap 0 Dice - intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoConfusionNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoConfusion ( -- ) VerifyEvent DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoConfusionCritSucc else dup "critfail" smatch if DoConfusionCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoConfusionNormFail else "critfail" smatch if DoConfusionNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoConfusionNormSucc else DoConfusionNormFail then then then else DoConfusionNormFail then then then SetWait NukeStack ; : DoDeathCritSucc ( -- ) begin ourTarget @ "@a/status" getpropstr "dead" smatch not while ourTarget @ "@a/stats/dam" over over getpropstr atoi 1 + intostr setprop ourTarget @ CheckDeath repeat ourTarget @ name "'s body" strcat scratch ! loc @ contents begin dup while dup name scratch @ smatch if dup recycle break then next repeat ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ">> $target's body disintegrates." ourTarget @ name "$target" subst TellRoom ; : DoDeathCritFail ( -- ) ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell begin me @ "@a/status" getpropstr "dead" smatch not while me @ "@a/stats/dam" over over getpropstr atoi 1 + intostr setprop me @ CheckDeath repeat ; : DoDeathNormSucc ( -- ) begin ourTarget @ "@a/status" getpropstr "dead" smatch not while ourTarget @ "@a/stats/dam" over over getpropstr atoi 1 + intostr setprop ourTarget @ CheckDeath repeat ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoDeathNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoDeath ( -- ) VerifyEvent DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoDeathCritSucc else dup "critfail" smatch if DoDeathCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoDeathNormFail else "critfail" smatch if DoDeathNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoDeathNormSucc else DoDeathNormFail then then then else DoDeathNormFail then then then SetWait NukeStack ; : DoDeftKnockCritSucc ( -- ) ourTarget @ Relock (* record: we need to relock this *) (* asys-sysscan handles relocking *) #0 "@a/relock" ourTarget @ REF-add ourTarget @ "@a/relock_at" ourDataObj @ "@a/sysparms/turn_length" getpropstr atoi random me @ "@a/skills/mage" GetModAbility me @ "@a/spells/deft knock" GetModAbility + % 1 + * 2 * systime + setprop ourTarget @ "@a/lok" ourTarget @ "_/lok" getprop setprop ourTarget @ "@a/fl" ourTarget @ "_/fl" getprop setprop (* clear current lock *) ourTarget @ "_/lok" remove_prop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ">> $target's body disintegrates." ourTarget @ name "$target" subst TellRoom ; : DoDeftKnockCritFail ( -- ) DoBreakSomething ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ourString @ if ">> You broke your $object." ourString @ "$object" subst VerTell then ; : DoDeftKnockNormSucc ( -- ) ourTarget @ Relock (* record: we need to relock this *) (* asys-sysscan handles relocking *) #0 "@a/relock" ourTarget @ REF-add ourTarget @ "@a/relock_at" ourDataObj @ "@a/sysparms/turn_length" getpropstr atoi random me @ "@a/skills/mage" GetModAbility me @ "@a/spells/deft knock" GetModAbility + % 1 + * systime + setprop ourTarget @ "@a/lok" ourTarget @ "_/lok" getprop setprop ourTarget @ "@a/fl" ourTarget @ "_/fl" getprop setprop (* clear current lock *) ourTarget @ "_/lok" remove_prop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoDeftKnockNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoDeftKnock ( -- ) VerifyEvent ourTarget @ DoCheckGuard if ">> The exit is being guarded." Tell ">> You need to be able to touch it to use Deft Knock." Tell ">> Cannot cast." Tell TellWait NukeStack exit then DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoDeftKnockCritSucc else dup "critfail" smatch if DoDeftKnockCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoDeftKnockNormFail else "critfail" smatch if DoDeftKnockNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoDeftKnockNormSucc else DoDeftKnockNormFail then then then else DoDeftKnockNormFail then then then SetWait NukeStack ; : DoDestConCritSucc ( -- ) ourTarget @ "@a/stats/con" over over getpropstr atoi 2 - intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoDestConCritFail ( -- ) "" ourString ! random 3 % dup 0 = if ourTarget @ "@a/stats/con" over over getpropstr atoi 1 + intostr setprop else dup 1 = if me @ "@a/stats/con" over over getpropstr atoi 1 - intostr setprop else DoBreakSomething then then ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ourString @ if ">> You broke your $object." ourString @ "$object" subst VerTell then ; : DoDestConNormSucc ( -- ) ourTarget @ "@a/stats/con" over over getpropstr atoi 1 - intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoDestConNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoDestCon ( -- ) VerifyEvent DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoDestConCritSucc else dup "critfail" smatch if DoDestConCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoDestConNormFail else "critfail" smatch if DoDestConNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoDestConNormSucc else DoDestConNormFail then then then else DoDestConNormFail then then then SetWait NukeStack ; : DoDestDexCritSucc ( -- ) ourTarget @ "@a/stats/dex" over over getpropstr atoi 2 - intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoDestDexCritFail ( -- ) "" ourString ! random 3 % dup 0 = if ourTarget @ "@a/stats/dex" over over getpropstr atoi 1 + intostr setprop else dup 1 = if me @ "@a/stats/dex" over over getpropstr atoi 1 - intostr setprop else DoBreakSomething then then ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ourString @ if ">> You broke your $object." ourString @ "$object" subst VerTell then ; : DoDestDexNormSucc ( -- ) ourTarget @ "@a/stats/dex" over over getpropstr atoi 1 - intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoDestDexNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoDestDex ( -- ) VerifyEvent DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoDestDexCritSucc else dup "critfail" smatch if DoDestDexCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoDestDexNormFail else "critfail" smatch if DoDestDexNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoDestDexNormSucc else DoDestDexNormFail then then then else DoDestDexNormFail then then then SetWait NukeStack ; : DoDestIntCritSucc ( -- ) ourTarget @ "@a/stats/int" over over getpropstr atoi 2 - intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoDestIntCritFail ( -- ) "" ourString ! random 3 % dup 0 = if ourTarget @ "@a/stats/int" over over getpropstr atoi 1 + intostr setprop else dup 1 = if me @ "@a/stats/int" over over getpropstr atoi 1 - intostr setprop else DoBreakSomething then then ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ourString @ if ">> You broke your $object." ourString @ "$object" subst VerTell then ; : DoDestIntNormSucc ( -- ) ourTarget @ "@a/stats/int" over over getpropstr atoi 1 - intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoDestIntNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoDestInt ( -- ) VerifyEvent DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoDestIntCritSucc else dup "critfail" smatch if DoDestIntCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoDestIntNormFail else "critfail" smatch if DoDestIntNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoDestIntNormSucc else DoDestIntNormFail then then then else DoDestIntNormFail then then then SetWait NukeStack ; : DoDestPreCritSucc ( -- ) ourTarget @ "@a/stats/pre" over over getpropstr atoi 2 - intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoDestPreCritFail ( -- ) "" ourString ! random 3 % dup 0 = if ourTarget @ "@a/stats/pre" over over getpropstr atoi 1 + intostr setprop else dup 1 = if me @ "@a/stats/pre" over over getpropstr atoi 1 - intostr setprop else DoBreakSomething then then ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ourString @ if ">> You broke your $object." ourString @ "$object" subst VerTell then ; : DoDestPreNormSucc ( -- ) ourTarget @ "@a/stats/pre" over over getpropstr atoi 1 - intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoDestPreNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoDestPre ( -- ) VerifyEvent DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoDestPreCritSucc else dup "critfail" smatch if DoDestPreCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoDestPreNormFail else "critfail" smatch if DoDestPreNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoDestPreNormSucc else DoDestPreNormFail then then then else DoDestPreNormFail then then then SetWait NukeStack ; : DoDestStrCritSucc ( -- ) ourTarget @ "@a/stats/str" over over getpropstr atoi 2 - intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoDestStrCritFail ( -- ) "" ourString ! random 3 % dup 0 = if ourTarget @ "@a/stats/str" over over getpropstr atoi 1 + intostr setprop else dup 1 = if me @ "@a/stats/str" over over getpropstr atoi 1 - intostr setprop else DoBreakSomething then then ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ourString @ if ">> You broke your $object." ourString @ "$object" subst VerTell then ; : DoDestStrNormSucc ( -- ) ourTarget @ "@a/stats/str" over over getpropstr atoi 1 - intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoDestStrNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoDestStr ( -- ) VerifyEvent DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoDestStrCritSucc else dup "critfail" smatch if DoDestStrCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoDestStrNormFail else "critfail" smatch if DoDestStrNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoDestStrNormSucc else DoDestStrNormFail then then then else DoDestStrNormFail then then then SetWait NukeStack ; : DoDoorJamCritSucc ( -- ) ourTarget @ Relock (* record: we need to relock this *) (* asys-sysscan handles relocking *) #0 "@a/relock" ourTarget @ REF-add ourTarget @ "@a/relock_at" ourDataObj @ "@a/sysparms/turn_length" getpropstr atoi random me @ "@a/skills/mage" GetModAbility me @ "@a/spells/doorjam" GetModAbility + % 1 + * systime + setprop ourTarget @ "@a/lok" ourTarget @ "_/lok" getprop setprop ourTarget @ "@a/fl" ourTarget @ "_/fl" getprop setprop (* clear current lock *) ourTarget @ "_/lok" "me&!me" parselock setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoDoorJamCritFail ( -- ) ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell DoBreakSomething ourString @ if ">> You broke your $object." ourString @ "$object" subst VerTell then ; : DoDoorJamNormSucc ( -- ) ourTarget @ Relock (* record: we need to relock this *) (* asys-sysscan handles relocking *) #0 "@a/relock" ourTarget @ REF-add ourTarget @ "@a/relock_at" ourDataObj @ "@a/sysparms/turn_length" getpropstr atoi random me @ "@a/skills/mage" GetModAbility me @ "@a/spells/doorjam" GetModAbility + % 1 + * systime + setprop ourTarget @ "@a/lok" ourTarget @ "_/lok" getprop setprop ourTarget @ "@a/fl" ourTarget @ "_/fl" getprop setprop (* clear current lock *) ourTarget @ "_/lok" "me&!me" parselock setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoDoorJamNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoDoorJam ( -- ) VerifyEvent DoChecks not if TellWait exit then DoPresenceChecks not if exit then ourTarget @ DoCheckGuard if ">> The exit is being guarded." Tell ">> You need to be able to touch it to use Doorjam." Tell ">> Cannot cast." Tell TellWait NukeStack exit then DoCastRoll dup "critsucc" smatch if DoDoorJamCritSucc else dup "critfail" smatch if DoDoorJamCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoDoorJamNormFail else "critfail" smatch if DoDoorJamNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoDoorJamNormSucc else DoDoorJamNormFail then then then else DoDoorJamNormFail then then then SetWait NukeStack ; : DoFireStrikeCritSucc ( -- ) ourTarget @ "@a/eloop/attack" "yes" setprop random me @ "@a/skills/mage" GetModAbility me @ "@a/spells/fire strike" GetModAbility + % 1 + 1 4 0 Dice + (* apply mods for armor and shields *) ourTarget @ "@a/eloop/armor" getprop dup if ourDataObj @ "@a/objects/$armor/armor/type/conventional" 3 pick "@a/name" getpropstr "$armor" subst getpropstr if ourDataObj @ "@a/objects/$armor/armor/damred" rot "@a/name" getpropstr "$armor" subst getpropstr atoi - else pop then else pop then ourTarget @ "@a/eloop/shield" getprop dup if ourDataObj @ "@a/objects/$armor/armor/type/conventional" 3 pick "@a/name" getpropstr "$armor" subst getpropstr if ourDataObj @ "@a/objects/$armor/armor/damred" rot "@a/name" getpropstr "$armor" subst getpropstr atoi - else pop then else pop then dup 0 < if pop 0 then dup if ourTarget @ "@a/eloop/injured" "yes" setprop ourTarget @ "@a/stats/dam" over over getpropstr atoi 4 rotate + intostr setprop then ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ourTarget @ CheckDeath ; : DoFireStrikeCritFail ( -- ) random me @ "@a/skills/mage" GetModAbility me @ "@a/skills/lore of kregor" GetModAbility + % 1 + (* apply mods for armor and shields *) me @ "@a/eloop/armor" getprop dup if ourDataObj @ "@a/objects/$armor/armor/type/conventional" 3 pick "@a/name" getpropstr "$armor" subst getpropstr if ourDataObj @ "@a/objects/$armor/armor/damred" rot "@a/name" getpropstr "$armor" subst getpropstr atoi - else pop then else pop then me @ "@a/eloop/shield" getprop dup if ourDataObj @ "@a/objects/$armor/armor/type/conventional" 3 pick "@a/name" getpropstr "$armor" subst getpropstr if ourDataObj @ "@a/objects/$armor/armor/damred" rot "@a/name" getpropstr "$armor" subst getpropstr atoi - else pop then else pop then dup 0 < if pop 0 then dup if me @ "@a/eloop/injured" "yes" setprop me @ "@a/stats/dam" over over getpropstr atoi rot + intostr setprop then ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell me @ CheckDeath ; : DoFireStrikeNormSucc ( -- ) ourTarget @ "@a/eloop/attack" "yes" setprop random me @ "@a/skills/mage" GetModAbility me @ "@a/skills/lore of kregor" GetModAbility + % 1 + (* apply mods for armor and shields *) ourTarget @ "@a/eloop/armor" getprop dup if ourDataObj @ "@a/objects/$armor/armor/type/conventional" 3 pick "@a/name" getpropstr "$armor" subst getpropstr if ourDataObj @ "@a/objects/$armor/armor/damred" rot "@a/name" getpropstr "$armor" subst getpropstr atoi - else pop then else pop then ourTarget @ "@a/eloop/shield" getprop dup if ourDataObj @ "@a/objects/$armor/armor/type/conventional" 3 pick "@a/name" getpropstr "$armor" subst getpropstr if ourDataObj @ "@a/objects/$armor/armor/damred" rot "@a/name" getpropstr "$armor" subst getpropstr atoi - else pop then else pop then dup 0 < if pop 0 then dup if ourTarget @ "@a/eloop/injured" "yes" setprop ourTarget @ "@a/stats/dam" over over getpropstr atoi 4 rotate + intostr setprop then ">> $me casts $spell $target." SpellTell DoTargetLoop ourTarget @ CheckDeath ; : DoFireStrikeNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoFireStrike ( -- ) VerifyEvent DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoFireStrikeCritSucc else dup "critfail" smatch if DoFireStrikeCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoFireStrikeNormFail else "critfail" smatch if DoFireStrikeNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoFireStrikeNormSucc else DoFireStrikeNormFail then then then else DoFireStrikeNormFail then then then SetWait NukeStack ; : DoFlameStormCritSucc ( -- ) ">> $me casts $spell. [CRITICAL SUCCESS]" SpellTell DoTargetLoop loc @ contents scratch ! begin scratch @ while scratch @ me @ dbcmp if scratch @ next scratch ! continue then scratch @ "@a/version" getpropstr not if scratch @ next scratch ! continue then scratch @ "@a/combat" getpropstr not if scratch @ next scratch ! continue then random 1 3 0 Dice me @ "@a/skills/lore of kregor" GetModAbility + % 1 + 1 4 0 Dice + (* apply mods for armor and shields *) scratch @ "@a/eloop/armor" getprop dup if ourDataObj @ "@a/objects/$armor/armor/type/conventional" 3 pick "@a/name" getpropstr "$armor" subst getpropstr if ourDataObj @ "@a/objects/$armor/armor/damred" rot "@a/name" getpropstr "$armor" subst getpropstr atoi - else pop then else pop then scratch @ "@a/eloop/shield" getprop dup if ourDataObj @ "@a/objects/$armor/armor/type/conventional" 3 pick "@a/name" getpropstr "$armor" subst getpropstr if ourDataObj @ "@a/objects/$armor/armor/damred" rot "@a/name" getpropstr "$armor" subst getpropstr atoi - else pop then else pop then dup 0 < if pop 0 then dup if scratch @ "@a/eloop/injured" "yes" setprop scratch @ "@a/stats/dam" over over getpropstr atoi 4 rotate + intostr setprop then scratch @ CheckDeath NukeStack scratch @ next scratch ! repeat ; : DoFlameStormCritFail ( -- ) random me @ "@a/skills/mage" GetModAbility me @ "@a/skills/lore of kregor" GetModAbility + % 1 + (* apply mods for armor and shields *) me @ "@a/eloop/armor" getprop dup if ourDataObj @ "@a/objects/$armor/armor/type/conventional" 3 pick "@a/name" getpropstr "$armor" subst getpropstr if ourDataObj @ "@a/objects/$armor/armor/damred" rot "@a/name" getpropstr "$armor" subst getpropstr atoi - else pop then else pop then me @ "@a/eloop/shield" getprop dup if ourDataObj @ "@a/objects/$armor/armor/type/conventional" 3 pick "@a/name" getpropstr "$armor" subst getpropstr if ourDataObj @ "@a/objects/$armor/armor/damred" rot "@a/name" getpropstr "$armor" subst getpropstr atoi - else pop then else pop then dup 0 < if pop 0 then dup if me @ "@a/eloop/injured" "yes" setprop me @ "@a/stats/dam" over over getpropstr atoi 4 rotate + intostr setprop then ">> $me's attempt to cast $spell fails. [CRITICAL FAILURE]" SpellTell me @ CheckDeath ; : DoFlameStormNormSucc ( -- ) ">> $me casts $spell." SpellTell DoTargetLoop loc @ contents scratch ! begin scratch @ while scratch @ me @ dbcmp if scratch @ next scratch ! continue then scratch @ "@a/version" getpropstr not if scratch @ next scratch ! continue then scratch @ "@a/combat" getpropstr not if scratch @ next scratch ! continue then random 1 3 0 Dice me @ "@a/skills/lore of kregor" GetModAbility + % 1 + (* apply mods for armor and shields *) scratch @ "@a/eloop/armor" getprop dup if ourDataObj @ "@a/objects/$armor/armor/type/conventional" 3 pick "@a/name" getpropstr "$armor" subst getpropstr if ourDataObj @ "@a/objects/$armor/armor/damred" rot "@a/name" getpropstr "$armor" subst getpropstr atoi - else pop then else pop then scratch @ "@a/eloop/shield" getprop dup if ourDataObj @ "@a/objects/$armor/armor/type/conventional" 3 pick "@a/name" getpropstr "$armor" subst getpropstr if ourDataObj @ "@a/objects/$armor/armor/damred" rot "@a/name" getpropstr "$armor" subst getpropstr atoi - else pop then else pop then dup 0 < if pop 0 then dup if scratch @ "@a/eloop/injured" "yes" setprop scratch @ "@a/stats/dam" over over getpropstr atoi 4 rotate + intostr setprop then scratch @ CheckDeath NukeStack scratch @ next scratch ! repeat ; : DoFlameStormNormFail ( -- ) ">> $me's attempt to cast $spell fails." SpellTell ; : DoFlameStorm ( -- ) VerifyEvent DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoFlameStormCritSucc else dup "critfail" smatch if DoFlameStormCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoFlameStormNormFail else "critfail" smatch if DoFlameStormNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoFlameStormNormSucc else DoFlameStormNormFail then then then else DoFlameStormNormFail then then then SetWait NukeStack ; : DoGoneTodayCritSucc ( -- ) ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ">> $me vanishes!" me @ name "$me" subst TellRoom "@a/temp/" me @ intostr strcat ourString ! me @ ourString @ me @ location setprop DoMoveOneRoom me @ ourString @ remove_prop ; : DoGoneTodayCritFail ( -- ) DoBreakSomething ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoGoneTodayNormSucc ( -- ) ">> $me casts $spell $target." SpellTell DoTargetLoop ">> $me vanishes!" me @ name "$me" subst TellRoom "@a/temp/" me @ intostr strcat ourString ! me @ ourString @ me @ location setprop DoMoveOneRoom me @ ourString @ remove_prop ; : DoGoneTodayNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoGoneToday ( -- ) VerifyEvent DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoGoneTodayCritSucc else dup "critfail" smatch if DoGoneTodayCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoGoneTodayNormFail else "critfail" smatch if DoGoneTodayNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoGoneTodayNormSucc else DoGoneTodayNormFail then then then else DoGoneTodayNormFail then then then SetWait NukeStack ; : DoFecklessCritSucc ( -- ) ourTarget @ "@a/stats/pre_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/fecklessness" GetModAbility 1 + + 1 swap 0 Dice 2 * - intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoFecklessCritFail ( -- ) me @ "@a/stats/pre_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/fecklessness" GetModAbility 1 + + 1 swap 0 Dice + intostr setprop ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoFecklessNormSucc ( -- ) ourTarget @ "@a/stats/pre_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/fecklessness" GetModAbility 1 + + 1 swap 0 Dice - intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoFecklessNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoFeckless ( -- ) VerifyEvent DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoFecklessCritSucc else dup "critfail" smatch if DoFecklessCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoFecklessNormFail else "critfail" smatch if DoFecklessNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoFecklessNormSucc else DoFecklessNormFail then then then else DoFecklessNormFail then then then SetWait NukeStack ; : DoIllBeingCritSucc ( -- ) ourTarget @ "@a/stats/con_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/fecklessness" GetModAbility 1 + + 1 swap 0 Dice 2 * - intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoIllBeingCritFail ( -- ) me @ "@a/stats/con_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/fecklessness" GetModAbility 1 + + 1 swap 0 Dice + intostr setprop ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoIllBeingNormSucc ( -- ) ourTarget @ "@a/stats/con_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/fecklessness" GetModAbility 1 + + 1 swap 0 Dice - intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoIllBeingNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoIllBeing ( -- ) VerifyEvent DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoIllBeingCritSucc else dup "critfail" smatch if DoIllBeingCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoIllBeingNormFail else "critfail" smatch if DoIllBeingNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoIllBeingNormSucc else DoIllBeingNormFail then then then else DoIllBeingNormFail then then then SetWait NukeStack ; : DoInvisibilityCritSucc ( -- ) ourTarget @ "@a/reveal_at" ourDataObj @ "@a/sysparms/turn_length" getpropstr atoi random me @ "@a/skills/mage" GetModAbility me @ "@a/skills/olan's lore" GetModAbility + % 1 + 2 * 2 * * systime + setprop #0 "@a/reveal" ourTarget @ REF-add ourDataObj @ "@a/sysparms/use_dark" getpropstr "yes" smatch if ourTarget @ "D" set then ourTarget @ "@a/invisible" ourAttackVal @ intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoInvisibilityCritFail ( -- ) DoBreakSomething ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoInvisibilityNormSucc ( -- ) ourTarget @ "@a/reveal_at" ourDataObj @ "@a/sysparms/turn_length" getpropstr atoi random me @ "@a/skills/mage" GetModAbility me @ "@a/skills/olan's lore" GetModAbility + % 1 + 2 * * systime + setprop #0 "@a/reveal" ourTarget @ REF-add ourDataObj @ "@a/sysparms/use_dark" getpropstr "yes" smatch if ourTarget @ "D" set then ourTarget @ "@a/invisible" ourAttackVal @ intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoInvisibilityNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoInvisibility ( -- ) VerifyEvent DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoInvisibilityCritSucc else dup "critfail" smatch if DoInvisibilityCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoInvisibilityNormFail else "critfail" smatch if DoInvisibilityNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoInvisibilityNormSucc else DoInvisibilityNormFail then then then else DoInvisibilityNormFail then then then SetWait NukeStack ; : DoLendConCritSucc ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/lend constitution" GetModAbility + % 1 + scratch ! me @ "@a/stats/con_mod" over over getpropstr atoi scratch @ - intostr setprop ourTarget @ "@a/stats/con_mod" over over getpropstr atoi scratch @ 2 * 2 * + intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoLendConCritFail ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/lend constitution" GetModAbility + % 1 + scratch ! me @ "@a/stats/con_mod" over over getpropstr atoi scratch @ - intostr setprop ourTarget @ "@a/stats/con_mod" over over getpropstr atoi scratch @ 2 * - intostr setprop ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoLendConNormSucc ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/lend constitution" GetModAbility + % 1 + scratch ! me @ "@a/stats/con_mod" over over getpropstr atoi scratch @ - intostr setprop ourTarget @ "@a/stats/con_mod" over over getpropstr atoi scratch @ 2 * + intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoLendConNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoLendCon ( -- ) VerifyEvent DoChecks not if TellWait exit then ourTarget @ me @ dbcmp if ">> Sorry, you can't cast this spell against yourself." VerTell SetWait NukeStack exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoLendConCritSucc else dup "critfail" smatch if DoLendConCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoLendConNormFail else "critfail" smatch if DoLendConNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoLendConNormSucc else DoLendConNormFail then then then else DoLendConNormFail then then then SetWait NukeStack ; : DoLendDexCritSucc ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/lend dexterity" GetModAbility + % 1 + scratch ! me @ "@a/stats/dex_mod" over over getpropstr atoi scratch @ - intostr setprop ourTarget @ "@a/stats/dex_mod" over over getpropstr atoi scratch @ 2 * 2 * + intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoLendDexCritFail ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/lend dexterity" GetModAbility + % 1 + scratch ! me @ "@a/stats/dex_mod" over over getpropstr atoi scratch @ - intostr setprop ourTarget @ "@a/stats/dex_mod" over over getpropstr atoi scratch @ 2 * - intostr setprop ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoLendDexNormSucc ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/lend dexterity" GetModAbility + % 1 + scratch ! me @ "@a/stats/dex_mod" over over getpropstr atoi scratch @ - intostr setprop ourTarget @ "@a/stats/dex_mod" over over getpropstr atoi scratch @ 2 * + intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoLendDexNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoLendDex ( -- ) VerifyEvent DoChecks not if TellWait exit then ourTarget @ me @ dbcmp if ">> Sorry, you can't cast this spell against yourself." VerTell SetWait NukeStack exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoLendDexCritSucc else dup "critfail" smatch if DoLendDexCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoLendDexNormFail else "critfail" smatch if DoLendDexNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoLendDexNormSucc else DoLendDexNormFail then then then else DoLendDexNormFail then then then SetWait NukeStack ; : DoLendIntCritSucc ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/lend intelligence" GetModAbility + % 1 + scratch ! me @ "@a/stats/int_mod" over over getpropstr atoi scratch @ - intostr setprop ourTarget @ "@a/stats/int_mod" over over getpropstr atoi scratch @ 2 * 2 * + intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoLendIntCritFail ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/lend intelligence" GetModAbility + % 1 + scratch ! me @ "@a/stats/int_mod" over over getpropstr atoi scratch @ - intostr setprop ourTarget @ "@a/stats/int_mod" over over getpropstr atoi scratch @ 2 * - intostr setprop ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoLendIntNormSucc ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/lend constitution" GetModAbility + % 1 + scratch ! me @ "@a/stats/int_mod" over over getpropstr atoi scratch @ - intostr setprop ourTarget @ "@a/stats/int_mod" over over getpropstr atoi scratch @ 2 * + intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoLendIntNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoLendInt ( -- ) VerifyEvent DoChecks not if TellWait exit then ourTarget @ me @ dbcmp if ">> Sorry, you can't cast this spell against yourself." VerTell SetWait NukeStack exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoLendIntCritSucc else dup "critfail" smatch if DoLendIntCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoLendIntNormFail else "critfail" smatch if DoLendIntNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoLendIntNormSucc else DoLendIntNormFail then then then else DoLendIntNormFail then then then SetWait NukeStack ; : DoLendPreCritSucc ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/lend presence" GetModAbility + % 1 + scratch ! me @ "@a/stats/pre_mod" over over getpropstr atoi scratch @ - intostr setprop ourTarget @ "@a/stats/pre_mod" over over getpropstr atoi scratch @ 2 * 2 * + intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoLendPreCritFail ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/lend presence" GetModAbility + % 1 + scratch ! me @ "@a/stats/pre_mod" over over getpropstr atoi scratch @ - intostr setprop ourTarget @ "@a/stats/pre_mod" over over getpropstr atoi scratch @ 2 * - intostr setprop ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoLendPreNormSucc ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/lend presence" GetModAbility + % 1 + scratch ! me @ "@a/stats/pre_mod" over over getpropstr atoi scratch @ - intostr setprop ourTarget @ "@a/stats/pre_mod" over over getpropstr atoi scratch @ 2 * + intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoLendPreNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoLendPre ( -- ) VerifyEvent DoChecks not if TellWait exit then ourTarget @ me @ dbcmp if ">> Sorry, you can't cast this spell against yourself." VerTell SetWait NukeStack exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoLendPreCritSucc else dup "critfail" smatch if DoLendPreCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoLendPreNormFail else "critfail" smatch if DoLendPreNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoLendPreNormSucc else DoLendPreNormFail then then then else DoLendPreNormFail then then then SetWait NukeStack ; : DoLendStrCritSucc ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/lend strength" GetModAbility + % 1 + scratch ! me @ "@a/stats/str_mod" over over getpropstr atoi scratch @ - intostr setprop ourTarget @ "@a/stats/str_mod" over over getpropstr atoi scratch @ 2 * 2 * + intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoLendStrCritFail ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/lend strength" GetModAbility + % 1 + scratch ! me @ "@a/stats/str_mod" over over getpropstr atoi scratch @ - intostr setprop ourTarget @ "@a/stats/str_mod" over over getpropstr atoi scratch @ 2 * - intostr setprop ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoLendStrNormSucc ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/lend strength" GetModAbility + % 1 + scratch ! me @ "@a/stats/str_mod" over over getpropstr atoi scratch @ - intostr setprop ourTarget @ "@a/stats/str_mod" over over getpropstr atoi scratch @ 2 * + intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoLendStrNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoLendStr ( -- ) VerifyEvent DoChecks not if TellWait exit then ourTarget @ me @ dbcmp if ">> Sorry, you can't cast this spell against yourself." VerTell SetWait NukeStack exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoLendStrCritSucc else dup "critfail" smatch if DoLendStrCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoLendStrNormFail else "critfail" smatch if DoLendStrNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoLendStrNormSucc else DoLendStrNormFail then then then else DoLendStrNormFail then then then SetWait NukeStack ; : DoLittleDeathCritSucc ( -- ) random me @ "@a/skills/mage" GetModAbility me @ "@a/skills/pon's lore" GetModAbility + % 1 + 2 * 86400 * systime + ourTarget @ "@a/revive_after" rot setprop #0 "@a/revive" ourTarget @ REF-add ourTarget @ "@a/status" "dead" setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoLittleDeathCritFail ( -- ) ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell random 2 % if begin ourTarget @ "@a/status" getpropstr "dead" smatch not while ourTarget @ "@a/stats/dam" over over getpropstr atoi 1 + intostr setprop ourTarget @ CheckDeath repeat else begin me @ "@a/status" getpropstr "dead" smatch not while me @ "@a/stats/dam" over over getpropstr atoi 1 + intostr setprop me @ CheckDeath repeat then ; : DoLittleDeathNormSucc ( -- ) random me @ "@a/skills/mage" GetModAbility me @ "@a/skills/pon's lore" GetModAbility + % 1 + 86400 * systime + ourTarget @ "@a/revive_after" rot setprop #0 "@a/revive" ourTarget @ REF-add ourTarget @ "@a/status" "dead" setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoLittleDeathNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoLittleDeath ( -- ) VerifyEvent DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoLittleDeathCritSucc else dup "critfail" smatch if DoLittleDeathCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoLittleDeathNormFail else "critfail" smatch if DoLittleDeathNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoLittleDeathNormSucc else DoLittleDeathNormFail then then then else DoLittleDeathNormFail then then then SetWait NukeStack ; : DoMageSightCritSucc ( -- ) ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ourTarget @ contents begin dup while dup me @ dbcmp if next continue then dup "@a/hidden" getpropstr if ">> You find $name." over name "$name" subst VerTell dup "!D" set dup "@a/hidden" remove_prop 1 ourBoolean ! then dup "@a/invisible" getpropstr if ">> You find $name, which was invisible." over name "$name" subst VerTell dup "!D" set dup "@a/invisible" remove_prop 1 ourBoolean ! then next repeat pop ourBoolean @ not if ">> You don't find anything notworthy." VerTell then ; : DoMageSightCritFail ( -- ) ">> $me's attempt to cast $spell $targetsucceeds. [CRITICAL SUCCESS]" SpellTell ">> You don't find anything notworty." VerTell (* lie to player *) ; : DoMageSightNormSucc ( -- ) ">> $me casts $spell $target." SpellTell DoTargetLoop ourTarget @ contents begin dup while dup me @ dbcmp if next continue then dup "@a/hidden" getpropstr if ">> You find $name." over name "$name" subst VerTell dup "!D" set dup "@a/hidden" remove_prop 1 ourBoolean ! then dup "@a/invisible" getpropstr dup if atoi ourAttackVal @ <= if ">> You find $name, which was invisible." over name "$name" subst VerTell dup "!D" set dup "@a/invisible" remove_prop 1 ourBoolean ! then else pop then next repeat pop ourBoolean @ not if ">> You don't find anything notworthy." VerTell then ; : DoMageSightNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoMageSight ( -- ) VerifyEvent DoChecks not if TellWait exit then ourTarget @ me @ dbcmp if ">> Sorry, you can't cast this spell against yourself." VerTell SetWait NukeStack exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoMageSightCritSucc else dup "critfail" smatch if DoMageSightCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoMageSightNormFail else "critfail" smatch if DoMageSightNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoMageSightNormSucc else DoMageSightNormFail then then then else DoMageSightNormFail then then then SetWait NukeStack ; : DoMineNowCritSucc ( -- ) ourSubTarget @ "@a/eloop/return_to" ourTarget @ setprop ourSubTarget @ "@a/eloop/return_at" random me @ "@a/skills/mage" GetModAbility me @ "@a/skills/lore of maggi" GetModAbility + % 1 + 2 * ourDataObj @ "@a/sysparms/turn_length" getpropstr atoi * systime + setprop #0 "@a/return" ourSubTarget @ REF-add ourSubTarget @ me @ moveto ">> $me casts $spell $target's $subtarget. [CRITICAL SUCCESS]" ourSubTarget @ name "$subtarget" subst SpellTell DoTargetLoop ; : DoMineNowCritFail ( -- ) DoBreakSomething ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoMineNowNormSucc ( -- ) ourSubTarget @ "@a/eloop/return_to" ourTarget @ setprop ourSubTarget @ "@a/eloop/return_at" random me @ "@a/skills/mage" GetModAbility me @ "@a/skills/lore of maggi" GetModAbility + % 1 + ourDataObj @ "@a/sysparms/turn_length" getpropstr atoi * systime + setprop #0 "@a/return" ourSubTarget @ REF-add ourSubTarget @ me @ moveto ">> $me casts $spell $target's $subtarget." ourSubTarget @ name "$subtarget" subst SpellTell DoTargetLoop ; : DoMineNowNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoMineNow ( -- ) VerifyEvent me @ "@a/eloop/subtarget" getprop dup not if ">> Syntax: +cast minenow vs 's " VerTell NukeStack SetWait exit then DoChecks not if TellWait exit then DoPresenceChecks not if exit then me @ "@a/eloop/subtarget" getprop dup if ourString ! else ">> Syntax: +cast minenow vs 's " VerTell NukeStack SetWait exit then ourTarget @ contents begin dup while dup name ourString @ stringpfx if dup ourSubTarget ! break then next repeat pop ourSubTarget @ not if ">> I don't see $target carring that." ourTarget @ name "$target" subst Tell VerTell SetWait NukeStack exit then ourSubTarget @ "@a/class/armor" getpropstr if ">> Sorry, this Spell can't be used against armor." VerTell SetWait NukeStack exit then me @ "@a/eloop/genmod" ourSubTarget @ GetMagResAdv -1 * intostr setprop DoCastRoll dup "critsucc" smatch if DoMineNowCritSucc else dup "critfail" smatch if DoMineNowCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoMineNowNormFail else "critfail" smatch if DoMineNowNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoMineNowNormSucc else DoMineNowNormFail then then then else DoMineNowNormFail then then then me @ "@a/eloop/genmod" remove_prop SetWait NukeStack ; : DoNimblenessCritSucc ( -- ) ourTarget @ "@a/stats/dex_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/nimbleness" GetModAbility 1 + + 1 swap 0 Dice 2 * + intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoNimblenessCritFail ( -- ) me @ "@a/stats/dex_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/nimbleness" GetModAbility 1 + + 1 swap 0 Dice - intostr setprop ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoNimblenessNormSucc ( -- ) ourTarget @ "@a/stats/dex_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/nimbleness" GetModAbility 1 + + 1 swap 0 Dice + intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoNimblenessNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoNimbleness ( -- ) (* run an attempt to cast nimbleness *) VerifyEvent (* check: called from eventmgr? *) (* make sure target, skill, tools, and materials are ok *) DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoNimblenessCritSucc else dup "critfail" smatch if DoNimblenessCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoNimblenessNormFail else "critfail" smatch if DoNimblenessNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoNimblenessNormSucc else DoNimblenessNormFail then then then else DoNimblenessNormFail then then then SetWait NukeStack ; : DoObscureCritSucc ( -- ) ourTarget @ player? if ourTarget @ "@a/reveal_at" ourDataObj @ "@a/sysparms/turn_length" getpropstr atoi random me @ "@a/skills/mage" GetModAbility me @ "@a/skills/olan's lore" GetModAbility + % 1 + 2 * * systime + setprop then ourDataObj @ "@a/sysparms/use_dark" getpropstr "yes" smatch if ourTarget @ "D" set then ourTarget @ "@a/hidden" ourAttackVal @ intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoObscureCritFail ( -- ) DoBreakSomething ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoObscureNormSucc ( -- ) ourTarget @ player? if ourTarget @ "@a/reveal_at" ourDataObj @ "@a/sysparms/turn_length" getpropstr atoi random me @ "@a/skills/mage" GetModAbility me @ "@a/skills/olan's lore" GetModAbility + % 1 + * systime + setprop then ourDataObj @ "@a/sysparms/use_dark" getpropstr "yes" smatch if ourTarget @ "D" set then ourTarget @ "@a/hidden" ourAttackVal @ intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoObscureNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoObscure ( -- ) VerifyEvent DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoObscureCritSucc else dup "critfail" smatch if DoObscureCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoObscureNormFail else "critfail" smatch if DoObscureNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoObscureNormSucc else DoObscureNormFail then then then else DoObscureNormFail then then then SetWait NukeStack ; : DoOopsCritSucc ( -- ) ourSubTarget @ ourTarget @ location moveto ">> $me casts $spell $target's $subtarget. [CRITICAL SUCCESS]" ourSubTarget @ name "$subtarget" subst SpellTell DoTargetLoop ; : DoOopsCritFail ( -- ) DoBreakSomething ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoOopsNormSucc ( -- ) ourSubTarget @ ourTarget @ location moveto ">> $me casts $spell $target's $subtarget." ourSubTarget @ name "$subtarget" subst SpellTell DoTargetLoop ; : DoOopsNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoOops ( -- ) VerifyEvent me @ "@a/eloop/subtarget" getprop dup if ourString ! else ">> Syntax: +cast minenow 's " VerTell NukeStack SetWait exit then DoChecks not if TellWait exit then DoPresenceChecks not if exit then me @ "@a/eloop/subtarget" getpropstr scratch ! ourTarget @ contents begin dup while dup name scratch @ stringpfx if dup ourSubTarget ! break then next repeat pop ourSubTarget @ not if ">> I don't see $target carring that." ourTarget @ name "$target" subst VerTell SetWait NukeStack exit then ourSubTarget @ "@a/class/armor" getpropstr if ">> Sorry, this Spell can't be used against armor." VerTell SetWait NukeStack exit then me @ "@a/eloop/genmod" ourSubTarget @ GetMagResAdv -1 * intostr setprop DoCastRoll dup "critsucc" smatch if DoOopsCritSucc else dup "critfail" smatch if DoOopsCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoOopsNormFail else "critfail" smatch if DoOopsNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoOopsNormSucc else DoOopsNormFail then then then else DoOopsNormFail then then then me @ "@a/eloop/genmod" remove_prop SetWait NukeStack ; : DoOverThereCritSucc ( -- ) ourTarget @ "@a/eloop/target" DoGetRandomTarget dup if setprop else pop remove_prop then ">> $me casts $spell $target's $subtarget. [CRITICAL SUCCESS]" ourSubTarget @ name "$subtarget" subst SpellTell DoTargetLoop ; : DoOverThereCritFail ( -- ) DoBreakSomething ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoOverThereNormSucc ( -- ) ourTarget @ "@a/eloop/target" DoGetRandomTarget dup if setprop else pop remove_prop then ">> $me casts $spell $target's $subtarget." ourSubTarget @ name "$subtarget" subst SpellTell DoTargetLoop ; : DoOverThereNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoOverThere ( -- ) VerifyEvent DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoOverThereCritSucc else dup "critfail" smatch if DoOverThereCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoOverThereNormFail else "critfail" smatch if DoOverThereNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoOverThereNormSucc else DoOverThereNormFail then then then else DoOverThereNormFail then then then me @ "@a/eloop/genmod" remove_prop SetWait NukeStack ; : DoPreserveCritSucc ( -- ) ourTarget @ "@a/rec_after" remove_prop ">> $me casts $spell $target's $subtarget. [CRITICAL SUCCESS]" ourSubTarget @ name "$subtarget" subst SpellTell DoTargetLoop ; : DoPreserveCritFail ( -- ) DoBreakSomething ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoPreserveNormSucc ( -- ) ourTarget @ "@a/rec_after" remove_prop ">> $me casts $spell $target's $subtarget." ourSubTarget @ name "$subtarget" subst SpellTell DoTargetLoop ; : DoPreserveNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoPreserve ( -- ) VerifyEvent DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoPreserveCritSucc else dup "critfail" smatch if DoPreserveCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoPreserveNormFail else "critfail" smatch if DoPreserveNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoPreserveNormSucc else DoPreserveNormFail then then then else DoPreserveNormFail then then then me @ "@a/eloop/genmod" remove_prop SetWait NukeStack ; : DoResolveCritSucc ( -- ) ourTarget @ "@a/stats/pre_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/resolve" GetModAbility 1 + + 1 swap 0 Dice 2 * + intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoResolveCritFail ( -- ) me @ "@a/stats/pre_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/resolve" GetModAbility 1 + + 1 swap 0 Dice - intostr setprop ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoResolveNormSucc ( -- ) ourTarget @ "@a/stats/pre_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/resolve" GetModAbility 1 + + 1 swap 0 Dice + intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoResolveNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoResolve ( -- ) VerifyEvent (* check: called from eventmgr? *) (* make sure target, skill, tools, and materials are ok *) DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoResolveCritSucc else dup "critfail" smatch if DoResolveCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoResolveNormFail else "critfail" smatch if DoResolveNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoResolveNormSucc else DoResolveNormFail then then then else DoResolveNormFail then then then SetWait NukeStack ; : DoResurrectCritSucc ( -- ) ourTarget @ scratch ! ourTarget @ "@a/owner" getprop ourTarget ! ourTarget @ "@a/stats/con" over over getpropstr atoi random 2 % - intostr setprop ourTarget @ "@a/status" "approved" setprop ourTarget @ "@a/stats/dam" random ourTarget @ "@a/stats/con" getpropstr atoi % 2 * intostr setprop ourTarget @ location loc @ dbcmp not if ourTarget @ loc @ moveto then scratch @ ok? if scratch @ recycle then ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoResurrectCritFail ( -- ) DoBreakSomething ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoResurrectNormSucc ( -- ) ourTarget @ scratch ! ourTarget @ "@a/owner" getprop ourTarget ! ourTarget @ "@a/stats/str" over over getpropstr atoi random 3 % - intostr setprop ourTarget @ "@a/stats/con" over over getpropstr atoi random 3 % - intostr setprop ourTarget @ "@a/stats/dex" over over getpropstr atoi random 3 % - intostr setprop ourTarget @ "@a/stats/int" over over getpropstr atoi random 3 % - intostr setprop ourTarget @ "@a/stats/pre" over over getpropstr atoi random 3 % - intostr setprop ourTarget @ "@a/status" "approved" setprop ourTarget @ "@a/stats/dam" random ourTarget @ "@a/stats/con" getpropstr atoi % 2 * intostr setprop ourTarget @ location loc @ dbcmp not if ourTarget @ loc @ moveto then scratch @ ok? if scratch @ recycle then ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoResurrectNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoResurrect ( -- ) VerifyEvent (* check: called from eventmgr? *) (* make sure target, skill, tools, and materials are ok *) DoChecks not if TellWait exit then ourTarget @ "@a/class/dead body" getpropstr not if ">> That's not a valid target for Resurrection." VerTell SetWait NukeStack exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoResurrectCritSucc else dup "critfail" smatch if DoResurrectCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoResurrectNormFail else "critfail" smatch if DoResurrectNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoResurrectNormSucc else DoResurrectNormFail then then then else DoResurrectNormFail then then then SetWait NukeStack ; : DoSparkCritSucc ( -- ) ourTarget @ "@a/eloop/attack" "yes" setprop 1 3 0 Dice 2 * (* apply mods for armor and shields *) ourTarget @ "@a/eloop/armor" getprop dup if ourDataObj @ "@a/objects/$armor/armor/type/conventional" 3 pick "@a/name" getpropstr "$armor" subst getpropstr if ourDataObj @ "@a/objects/$armor/armor/damred" rot "@a/name" getpropstr "$armor" subst getpropstr atoi - else pop then else pop then ourTarget @ "@a/eloop/shield" getprop dup if ourDataObj @ "@a/objects/$armor/armor/type/conventional" 3 pick "@a/name" getpropstr "$armor" subst getpropstr if ourDataObj @ "@a/objects/$armor/armor/damred" rot "@a/name" getpropstr "$armor" subst getpropstr atoi - else pop then else pop then dup 0 < if pop 0 then dup if ourTarget @ "@a/eloop/injured" "yes" setprop ourTarget @ "@a/stats/dam" over over getpropstr atoi rot + intostr setprop then ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ourTarget @ CheckDeath ; : DoSparkCritFail ( -- ) 1 3 0 Dice (* apply mods for armor and shields *) me @ "@a/eloop/armor" getprop dup if ourDataObj @ "@a/objects/$armor/armor/type/conventional" 3 pick "@a/name" getpropstr "$armor" subst getpropstr if ourDataObj @ "@a/objects/$armor/armor/damred" rot "@a/name" getpropstr "$armor" subst getpropstr atoi - else pop then else pop then me @ "@a/eloop/shield" getprop dup if ourDataObj @ "@a/objects/$armor/armor/type/conventional" 3 pick "@a/name" getpropstr "$armor" subst getpropstr if ourDataObj @ "@a/objects/$armor/armor/damred" rot "@a/name" getpropstr "$armor" subst getpropstr atoi - else pop then else pop then dup 0 < if pop 0 then dup if me @ "@a/eloop/injured" "yes" setprop me @ "@a/stats/dam" over over getpropstr atoi rot + intostr setprop then ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell me @ CheckDeath ; : DoSparkNormSucc ( -- ) ourTarget @ "@a/eloop/attack" "yes" setprop 1 3 0 Dice (* apply mods for armor and shields *) ourTarget @ "@a/eloop/armor" getprop dup if ourDataObj @ "@a/objects/$armor/armor/type/conventional" 3 pick "@a/name" getpropstr "$armor" subst getpropstr if ourDataObj @ "@a/objects/$armor/armor/damred" rot "@a/name" getpropstr "$armor" subst getpropstr atoi - else pop then else pop then ourTarget @ "@a/eloop/shield" getprop dup if ourDataObj @ "@a/objects/$armor/armor/type/conventional" 3 pick "@a/name" getpropstr "$armor" subst getpropstr if ourDataObj @ "@a/objects/$armor/armor/damred" rot "@a/name" getpropstr "$armor" subst getpropstr atoi - else pop then else pop then dup 0 < if pop 0 then dup if ourTarget @ "@a/eloop/injured" "yes" setprop ourTarget @ "@a/stats/dam" over over getpropstr atoi 4 rotate + intostr setprop then ">> $me casts $spell $target." SpellTell DoTargetLoop ourTarget @ CheckDeath ; : DoSparkNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoSpark ( -- ) VerifyEvent DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoSparkCritSucc else dup "critfail" smatch if DoSparkCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoSparkNormFail else "critfail" smatch if DoSparkNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoSparkNormSucc else DoSparkNormFail then then then else DoSparkNormFail then then then SetWait NukeStack ; : DoStayThereCritSucc ( -- ) ourTarget @ "@a/eloop/return_at" remove_prop ourTarget @ "@a/eloop/return_to" remove_prop #0 "@a/return" ourTarget @ REF-delete ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoStayThereCritFail ( -- ) DoBreakSomething ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoStayThereNormSucc ( -- ) ourTarget @ "@a/eloop/return_at" remove_prop ourTarget @ "@a/eloop/return_to" remove_prop #0 "@a/return" ourTarget @ REF-delete ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoStayThereNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoStayThere ( -- ) VerifyEvent (* check: called from eventmgr? *) (* make sure target, skill, tools, and materials are ok *) DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoStayThereCritSucc else dup "critfail" smatch if DoStayThereCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoStayThereNormFail else "critfail" smatch if DoStayThereNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoStayThereNormSucc else DoStayThereNormFail then then then else DoStayThereNormFail then then then SetWait NukeStack ; : DoStealConCritSucc ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/steal constitution" GetModAbility + % 1 + scratch ! me @ "@a/stats/con_mod" over over getpropstr atoi scratch @ 2 * + intostr setprop ourTarget @ "@a/stats/con_mod" over over getpropstr atoi scratch @ 2 * - intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoStealConCritFail ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/steal constitution" GetModAbility + % 1 + scratch ! me @ "@a/stats/con_mod" over over getpropstr atoi scratch @ - intostr setprop ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoStealConNormSucc ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/steal constitution" GetModAbility + % 1 + scratch ! me @ "@a/stats/con_mod" over over getpropstr atoi scratch @ + intostr setprop ourTarget @ "@a/stats/con_mod" over over getpropstr atoi scratch @ 2 * - intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoStealConNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoStealCon ( -- ) VerifyEvent DoChecks not if TellWait exit then ourTarget @ me @ dbcmp if ">> Sorry, you can't cast this spell against yourself." VerTell SetWait NukeStack exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoStealConCritSucc else dup "critfail" smatch if DoStealConCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoStealConNormFail else "critfail" smatch if DoStealConNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoStealConNormSucc else DoStealConNormFail then then then else DoStealConNormFail then then then SetWait NukeStack ; : DoStealDexCritSucc ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/steal constitution" GetModAbility + % 1 + scratch ! me @ "@a/stats/dex_mod" over over getpropstr atoi scratch @ 2 * + intostr setprop ourTarget @ "@a/stats/dex_mod" over over getpropstr atoi scratch @ 2 * - intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoStealDexCritFail ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/steal constitution" GetModAbility + % 1 + scratch ! me @ "@a/stats/dex_mod" over over getpropstr atoi scratch @ - intostr setprop ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoStealDexNormSucc ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/steal constitution" GetModAbility + % 1 + scratch ! me @ "@a/stats/dex_mod" over over getpropstr atoi scratch @ + intostr setprop ourTarget @ "@a/stats/dex_mod" over over getpropstr atoi scratch @ 2 * - intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoStealDexNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoStealDex ( -- ) VerifyEvent DoChecks not if TellWait exit then ourTarget @ me @ dbcmp if ">> Sorry, you can't cast this spell against yourself." VerTell SetWait NukeStack exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoStealDexCritSucc else dup "critfail" smatch if DoStealDexCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoStealDexNormFail else "critfail" smatch if DoStealDexNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoStealDexNormSucc else DoStealDexNormFail then then then else DoStealDexNormFail then then then SetWait NukeStack ; : DoStealIntCritSucc ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/steal constitution" GetModAbility + % 1 + scratch ! me @ "@a/stats/int_mod" over over getpropstr atoi scratch @ 2 * + intostr setprop ourTarget @ "@a/stats/int_mod" over over getpropstr atoi scratch @ 2 * - intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoStealIntCritFail ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/steal constitution" GetModAbility + % 1 + scratch ! me @ "@a/stats/int_mod" over over getpropstr atoi scratch @ - intostr setprop ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoStealIntNormSucc ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/steal constitution" GetModAbility + % 1 + scratch ! me @ "@a/stats/int_mod" over over getpropstr atoi scratch @ + intostr setprop ourTarget @ "@a/stats/int_mod" over over getpropstr atoi scratch @ 2 * - intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoStealIntNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoStealInt ( -- ) VerifyEvent DoChecks not if TellWait exit then ourTarget @ me @ dbcmp if ">> Sorry, you can't cast this spell against yourself." VerTell SetWait NukeStack exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoStealIntCritSucc else dup "critfail" smatch if DoStealIntCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoStealIntNormFail else "critfail" smatch if DoStealIntNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoStealIntNormSucc else DoStealIntNormFail then then then else DoStealIntNormFail then then then SetWait NukeStack ; : DoStealPreCritSucc ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/steal constitution" GetModAbility + % 1 + scratch ! me @ "@a/stats/pre_mod" over over getpropstr atoi scratch @ 2 * + intostr setprop ourTarget @ "@a/stats/pre_mod" over over getpropstr atoi scratch @ 2 * - intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoStealPreCritFail ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/steal constitution" GetModAbility + % 1 + scratch ! me @ "@a/stats/pre_mod" over over getpropstr atoi scratch @ - intostr setprop ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoStealPreNormSucc ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/steal constitution" GetModAbility + % 1 + scratch ! me @ "@a/stats/pre_mod" over over getpropstr atoi scratch @ + intostr setprop ourTarget @ "@a/stats/pre_mod" over over getpropstr atoi scratch @ 2 * - intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoStealPreNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoStealPre ( -- ) VerifyEvent DoChecks not if TellWait exit then ourTarget @ me @ dbcmp if ">> Sorry, you can't cast this spell against yourself." VerTell SetWait NukeStack exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoStealPreCritSucc else dup "critfail" smatch if DoStealPreCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoStealPreNormFail else "critfail" smatch if DoStealPreNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoStealPreNormSucc else DoStealPreNormFail then then then else DoStealPreNormFail then then then SetWait NukeStack ; : DoStealStrCritSucc ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/steal constitution" GetModAbility + % 1 + scratch ! me @ "@a/stats/str_mod" over over getpropstr atoi scratch @ 2 * + intostr setprop ourTarget @ "@a/stats/str_mod" over over getpropstr atoi scratch @ 2 * - intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoStealStrCritFail ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/steal constitution" GetModAbility + % 1 + scratch ! me @ "@a/stats/str_mod" over over getpropstr atoi scratch @ - intostr setprop ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoStealStrNormSucc ( -- ) random me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/steal constitution" GetModAbility + % 1 + scratch ! me @ "@a/stats/str_mod" over over getpropstr atoi scratch @ + intostr setprop ourTarget @ "@a/stats/str_mod" over over getpropstr atoi scratch @ 2 * - intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoStealStrNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoStealStr ( -- ) VerifyEvent DoChecks not if TellWait exit then ourTarget @ me @ dbcmp if ">> Sorry, you can't cast this spell against yourself." VerTell SetWait NukeStack exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoStealStrCritSucc else dup "critfail" smatch if DoStealStrCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoStealStrNormFail else "critfail" smatch if DoStealStrNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoStealStrNormSucc else DoStealStrNormFail then then then else DoStealStrNormFail then then then SetWait NukeStack ; : DoStrengthCritSucc ( -- ) ourTarget @ "@a/stats/str_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/strength" GetModAbility 1 + + 1 swap 0 Dice 2 * + intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoStrengthCritFail ( -- ) me @ "@a/stats/str_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/strength" GetModAbility 1 + + 1 swap 0 Dice - intostr setprop ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoStrengthNormSucc ( -- ) ourTarget @ "@a/stats/str_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/strength" GetModAbility 1 + + 1 swap 0 Dice + intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoStrengthNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoStrength ( -- ) (* run an attempt to cast strength *) VerifyEvent (* check: called from eventmgr? *) (* make sure target, skill, tools, and materials are ok *) DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoStrengthCritSucc else dup "critfail" smatch if DoStrengthCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoStrengthNormFail else "critfail" smatch if DoStrengthNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoStrengthNormSucc else DoStrengthNormFail then then then else DoStrengthNormFail then then then SetWait NukeStack ; : DoSummonCritSucc ( -- ) ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ourCreature @ CreateCreature ourTarget ! ourTarget @ not if ">> ERROR: Cannot create creature." Tell ">> Please contact a staff member." Tell TellWait NukeStack exit then me @ "@a/eloop/target" ourTarget @ setprop me @ "@a/eloop/spell" "BeastFriend" setprop ">> $me casts $spell $target." SpellTell DoTargetLoop random me @ "@a/skills/mage" GetModAbility me @ "@a/skills/falon's lore" GetModAbility + me @ "@a/spells/summon $creature" ourCreature @ "$creature" subst GetModAbility + % 1 + 2 * 2 * ourDataObj @ "@a/sysparms/turn_length" getpropstr atoi * systime + ourTarget @ "@a/rec_after" rot setprop #0 "@a/recycle" ourTarget @ REF-add me @ "@a/eloop/target" ourTarget @ setprop me @ "@a/eloop/spell" "BeastSpeech" setprop DoBeastSpeech ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoSummonCritFail ( -- ) ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ourCreature @ CreateCreature ourTarget ! ourTarget @ not if ">> ERROR: Cannot create creature." Tell ">> Please contact a staff member." Tell TellWait NukeStack exit then ourTarget @ "$attack $me" me @ name "$me" subst "+attack" GetCommandName "$attack" subst force ; : DoSummonNormSucc ( -- ) ">> $me casts $spell $target." SpellTell DoTargetLoop ourCreature @ CreateCreature ourTarget ! ourTarget @ not if ">> ERROR: Cannot create creature." Tell ">> Please contact a staff member." Tell TellWait NukeStack exit then me @ "@a/eloop/target" ourTarget @ setprop me @ "@a/eloop/spell" "BeastFriend" setprop DoBeastFriend if random me @ "@a/skills/mage" GetModAbility me @ "@a/skills/falon's lore" GetModAbility + me @ "@a/spells/summon $creature" ourCreature @ "$creature" subst GetModAbility + % 1 + 2 * ourDataObj @ "@a/sysparms/turn_length" getpropstr atoi * systime + ourTarget @ "@a/rec_after" rot setprop #0 "@a/recycle" ourTarget @ REF-add else ">> The $creature vanishes." ourCreature @ tolower "$creature" subst TellRoom ourTarget @ recycle SetWait NukeStack exit then me @ "@a/eloop/target" ourTarget @ setprop me @ "@a/eloop/spell" "BeastSpeech" setprop DoBeastSpeech ; : DoSummonNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoSummon ( -- ) VerifyEvent (* check: called from eventmgr? *) me @ "@a/eloop/act" getpropstr dup if "" "castsummon " subst strip ourCreature ! else ">> ERROR: Unable to determine your spell or action." Tell ">> Please contact a staff member." Tell TellWait NukeStack exit then ourDataObj @ "@a/creatures/$creature/" ourCreature @ "$creature" subst nextprop not if ">> '$creaure' is not a valid creature type in this realm." ourCreature @ CapAll "$creature" subst Tell ">> Cannot summon." Tell TellWait NukeStack exit then (* make sure target, skill, tools, and materials are ok *) DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoSummonCritSucc else dup "critfail" smatch if DoSummonCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoSummonNormFail else "critfail" smatch if DoSummonNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoSummonNormSucc else DoSummonNormFail then then then else DoSummonNormFail then then then SetWait NukeStack ; : DoWeaknessCritSucc ( -- ) ourTarget @ "@a/stats/str_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/weakness" GetModAbility 1 + + 1 swap 0 Dice 2 * - intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoWeaknessCritFail ( -- ) me @ "@a/stats/str_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/weakness" GetModAbility 1 + + 1 swap 0 Dice + intostr setprop ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoWeaknessNormSucc ( -- ) ourTarget @ "@a/stats/str_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/weakness" GetModAbility 1 + + 1 swap 0 Dice - intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoWeaknessNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoWeakness ( -- ) VerifyEvent DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoWeaknessCritSucc else dup "critfail" smatch if DoWeaknessCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoWeaknessNormFail else "critfail" smatch if DoWeaknessNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoWeaknessNormSucc else DoWeaknessNormFail then then then else DoWeaknessNormFail then then then SetWait NukeStack ; : DoWellBeingCritSucc ( -- ) ourTarget @ "@a/stats/con_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/well being" GetModAbility 1 + + 1 swap 0 Dice 2 * + intostr setprop ">> $me casts $spell $target. [CRITICAL SUCCESS]" SpellTell DoTargetLoop ; : DoWellBeingCritFail ( -- ) me @ "@a/stats/con_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/well being" GetModAbility 1 + + 1 swap 0 Dice - intostr setprop ">> $me's attempt to cast $spell $targetfails. [CRITICAL FAILURE]" SpellTell ; : DoWellBeingNormSucc ( -- ) ourTarget @ "@a/stats/con_mod" over over getpropstr atoi me @ "@a/skills/pon's lore" GetModAbility me @ "@a/spells/well being" GetModAbility 1 + + 1 swap 0 Dice + intostr setprop ">> $me casts $spell $target." SpellTell DoTargetLoop ; : DoWellBeingNormFail ( -- ) ">> $me's attempt to cast $spell $targetfails." SpellTell ; : DoWellBeing ( -- ) (* run an attempt to cast strength *) VerifyEvent (* check: called from eventmgr? *) (* make sure target, skill, tools, and materials are ok *) DoChecks not if TellWait exit then DoPresenceChecks not if exit then DoCastRoll dup "critsucc" smatch if DoWellBeingCritSucc else dup "critfail" smatch if DoWellBeingCritFail else "normsucc" smatch if DoDefenceRoll dup "critsucc" smatch if DoWellBeingNormFail else "critfail" smatch if DoWellBeingNormSucc else ourAttackVal @ ourDefenceVal @ >= if DoWellBeingNormSucc else DoWellBeingNormFail then then then else DoWellBeingNormFail then then then SetWait NukeStack ; : main "me" match me ! (* initialize *) "$lib/argo" match lib ! GetDataObj ourDataObj ! strip ourArg ! trig "@a/name" getpropstr ourCom ! Update me @ ArgoPermCheck Disabled? ourArg @ if ourArg @ "#" stringpfx if "#castanjin's cantrip" ourArg @ smatch if DoAnjinsCantrip else "#castbeastfriend" ourArg @ smatch if DoBeastFriend else "#castbeastspeech" ourArg @ smatch if DoBeastSpeech else "#castclearmind" ourArg @ smatch if DoClearmind else "#castclumsiness" ourArg @ smatch if DoClumsiness else "#castconfusion" ourArg @ smatch if DoConfusion else "#castdeath" ourArg @ smatch if DoDeath else "#castdeft knock" ourArg @ smatch if DoDeftKnock else "#castdestroy consitution" ourArg @ smatch if DoDestCon else "#castdestroy dexterity" ourArg @ smatch if DoDestDex else "#castdestroy intelligence" ourArg @ smatch if DoDestInt else "#castdestroy presence" ourArg @ smatch if DoDestPre else "#castdestroy strength" ourArg @ smatch if DoDestStr else "#castdoorjam" ourArg @ smatch if DoDoorJam else "#castfire strike" ourArg @ smatch if DoFireStrike else "#castflame storm" ourArg @ smatch if DoFlameStorm else "#castgone today" ourArg @ smatch if DoGoneToday else "#castfecklessness" ourArg @ smatch if DoFeckless else "#castill being" ourArg @ smatch if DoIllBeing else "#castinvisibility" ourArg @ smatch if DoInvisibility else "#castlend constitution" ourArg @ smatch if DoLendCon else "#castlend dexterity" ourArg @ smatch if DoLendDex else "#castlend intelligence" ourArg @ smatch if DoLendInt else "#castlend presense" ourArg @ smatch if DoLendPre else "#castlend strength" ourArg @ smatch if DoLendStr else "#castmagesight" ourArg @ smatch if DoMageSight else "#castmine now" ourArg @ smatch if DoMineNow else "#castnimbleness" ourArg @ smatch if DoNimbleness else "#castobscure" ourArg @ smatch if DoObscure else "#castoops" ourArg @ smatch if DoOops else "#castover there" ourArg @ smatch if DoOverThere else "#castpreservation" ourArg @ smatch if DoPreserve else "#castresolve" ourArg @ smatch if DoResolve else "#castresurrection" ourArg @ smatch if DoResurrect else "#castspark" ourArg @ smatch if DoSpark else "#caststay there" ourArg @ smatch if DoStayThere else "#caststeal constitution" ourArg @ smatch if DoStealCon else "#caststeal dexterity" ourArg @ smatch if DoStealDex else "#caststeal intelligence" ourArg @ smatch if DoStealInt else "#caststeal presence" ourArg @ smatch if DoStealPre else "#caststeal strength" ourArg @ smatch if DoStealStr else "#caststrength" ourArg @ smatch if DoStrength else "#castthe little death" ourArg @ smatch if DoLittleDeath else "#castwell being" ourArg @ smatch if DoWellBeing else "#castweakness" ourArg @ smatch if DoWeakness else "#install" ourArg @ stringpfx if DoInstall else "#uninstall" ourArg @ stringpfx if DoUninstall else ourArg @ "#castsummon " stringpfx if DoSummon else ">> #Argument not understood." Tell then then then then then then then then then then then then then then then then then then then then then then then then then then then then then then then then then then then then then then then then then then then then then then then then exit then then ; . c q @set asys-stdspells=W @set asys-stdspells=L