@program newdotest.muf 1 1000 d i $include $ansihack $include $lib/rp $include $lib/alynna $def RPS #4183 lvar tmp1 lvar target lvar lev lvar atype lvar dmg lvar stat1 lvar stat2 : attack ( i -- ) atype ! atype @ 1 = if me @ "dexterity" getstatint me @ "brawl" getstatint target @ "" stringcmp if target @ toint else 0 then + + stat1 ! stat1 @ 5d5 + 20 - stat2 ! str me @ " rolls dex+brawl" target @ "" stringcmp if " (^GREEN^+" target @ "^ ^ modifier) = " else " = " then "^GREEN^" stat2 @ "^ ^" cat "Brawl" pretty tellhere then atype @ 2 = if me @ "dexterity" getstatint me @ "melee" getstatint target @ "" stringcmp if target @ toint else 0 then + + stat1 ! stat1 @ 5d5 + 20 - stat2 ! str me @ " rolls dex+melee" target @ "" stringcmp if " (^GREEN^+" target @ "^ ^ modifier) = " else " = " then "^GREEN^" stat2 @ "^ ^" cat "Melee" pretty tellhere then atype @ 4 = if me @ "dexterity" getstatint me @ "ranged" getstatint target @ "" stringcmp if target @ toint else 0 then + + stat1 ! stat1 @ 5d5 + 20 - stat2 ! str me @ " rolls dex+brawl" target @ "" stringcmp if " (^GREEN^+" target @ "^ ^ modifier) = " else " = " then "^GREEN^" stat2 @ "^ ^" cat "Ranged" pretty tellhere then atype @ 8 = if me @ "dexterity" getstatint me @ "firearms" getstatint target @ "" stringcmp if target @ toint else 0 then + + stat1 ! stat1 @ 5d5 + 20 - stat2 ! str me @ " rolls dex+firearms" target @ "" stringcmp if " (^GREEN^+" target @ "^ ^ modifier) = " else " = " then "^GREEN^" stat2 @ "^ ^" cat "Firearms" pretty tellhere then ; : damage ( i -- ) atype ! atype @ 1 = if me @ "strength" getstatint me @ "brawl" getstatint target @ "" stringcmp if target @ toint else 0 then + + stat1 ! stat1 @ 5d5 + 20 - stat2 ! stat2 @ random 20 % 80 + * atype @ * dmg ! str me @ " rolls str+brawl" target @ "" stringcmp if " (^GREEN^+" target @ "^ ^ modifier) = " else " = " then "^GREEN^" dmg @ "^ ^ damage. (^GREEN^" stat1 @ "/" stat2 @ "^ ^)" cat "Brawl" pretty tellhere then atype @ 2 = if me @ "strength" getstatint me @ "melee" getstatint target @ "" stringcmp if target @ toint else 0 then + + stat1 ! stat1 @ 5d5 + 20 - stat2 ! stat2 @ random 20 % 80 + * atype @ * dmg ! str me @ " rolls str+melee" target @ "" stringcmp if " (^GREEN^+" target @ "^ ^ modifier) = " else " = " then "^GREEN^" dmg @ "^ ^ damage. (^GREEN^" stat1 @ "/" stat2 @ "^ ^)" cat "Melee" pretty tellhere then atype @ 4 = if me @ "strength" getstatint me @ "ranged" getstatint target @ "" stringcmp if target @ toint else 0 then + + stat1 ! stat1 @ 5d5 + 20 - stat2 ! stat2 @ random 20 % 80 + * atype @ * dmg ! str me @ " rolls str+brawl" target @ "" stringcmp if " (^GREEN^+" target @ "^ ^ modifier) = " else " = " then "^GREEN^" dmg @ "^ ^ damage. (^GREEN^" stat1 @ "/" stat2 @ "^ ^)" cat "Ranged" pretty tellhere then atype @ 8 = if me @ "dexterity" getstatint me @ "firearms" getstatint target @ "" stringcmp if target @ toint else 0 then + + stat1 ! stat1 @ 5d5 + 20 - stat2 ! stat2 @ random 20 % 80 + * atype @ * dmg ! str me @ " rolls dex+firearms" target @ "" stringcmp if " (^GREEN^+" target @ "^ ^ modifier) = " else " = " then "^GREEN^" dmg @ "^ ^ damage. (^GREEN^" stat1 @ "/" stat2 @ "^ ^)" cat "Firearms" pretty tellhere then ; : cast RPS str "/talents/" target @ "/MP" cat getpropval if me @ "MP" getstatint RPS str "/talents/" target @ "/MP" cat getpropval > if "Inadequate MP for cast." "Cast" pretty tellme else "Spellcasting" header tellhere me @ "MP" getstatint RPS str "/talents/" target @ "/MP" cat getpropval - me @ swap "MP" swap setstat str then ; : do ; : main "=" explode tmp1 ! tmp1 @ 0 = if "" target ! "" lev ! then tmp1 @ 1 = if target ! "" lev ! then tmp1 @ 2 = if target ! lev ! then tmp1 @ 2 > if "Too many parameters." "RP" pretty tellme exit then command @ "+brawl" stringcmp not if 1 attack exit then command @ "+melee" stringcmp not if 2 attack exit then command @ "+ranged" stringcmp not if 4 attack exit then command @ "+shoot" stringcmp not if 8 attack exit then command @ "+dbrawl" stringcmp not if 1 damage exit then command @ "+dmelee" stringcmp not if 2 damage exit then command @ "+dranged" stringcmp not if 4 damage exit then command @ "+dshoot" stringcmp not if 8 damage exit then command @ "+cast" stringcmp not if cast exit then command @ "+use" stringcmp not if cast exit then command @ "+do" stringcmp not if do exit then ; . c q