: TestSpellCaster // ( ... comparisonResult [-1 0 1] Me B W:Type A W:Type W:T:SpellCaster = IF W:T:SpellCaster = IF 0 ELSE 1 THEN ELSE W:T:SpellCaster = IF -1 ELSE 0 THEN THEN ; 1 SP+- : TestCasting // ( .. comparison result) A casting target comes first He B C:State A C:State C:S:Casting = IF C:S:Casting = IF 0 ELSE 1 THEN ELSE C:S:Casting = IF -1 ELSE 0 THEN THEN ; 1 SP+- : THINK // Return int ( minus ) // Any attack using a SpellCaster item takes precedence over any attack // not using a SpellCaster item. TestSpellCaster ?DUP IF EXIT THEN // Neither (or both) attacks us a SpellCaster item. So we proceed. // // Any attack against a character who is casting takes precedence over // a non-casting character. TestCasting ?DUP IF EXIT THEN // Neither target (or both) were casting. // // The actions are equal in precedence. 0 ; 1 SP+-