( Pokemon RPsystem ) $include $lib/rp $include $lib/rps2 $include $lib/puppet $include $lib/bits $include $lib/alynna $include $lib/pokedex $include $muf/cron $include $lib/txp ( $include $lib/rps ) $pubdef : $def INFORM "PokeRP" pretty tellme $def AVATAR #21 $def MAXVOTES me @ staff? if 256 else 3 then $def ATMAX? target @ "/@rp/xp" getprop toint 100000 > $def DEBUG? #0 "debug?" getprop $def PARANOIA? #0 "paranoia?" getprop $def VERBOSE? dup "_prefs/verbose" getprop swap staff? and $def dlev4 dup 0.01 + 100.0 >= if 0.01 + toint intostr 4 rj else tofloat 1 fchop 4 rj then $def CONDVEC 250 $def puppy { $def kitty }cat $def growthfactor dup "growth" getstatfloat 100.0 + 100.0 / swap wild? if 0.1 + then * $def wc AVATAR { "wc #" 4 rotate }cat force ( *** BEGIN New section for stackable conditions *** ) $define CONDSTATS { "Frozen" "Burned" "Sleeping" "Poisoned" "Paralyzed" "Undefined_5" "Undefined_6" "Fainted" "Undefined_8" "Undefined_9" "Fail" "Undefined_B" "Undefined_C" "Undefined_D" "Undefined_E" "Charmed" "Flinched" "Trapped" "Combo" "Leech" "Confused" "Undefined_M" "Undefined_N" "Undefined_P" "Undefined_Q" "Drunk" "AIDS" "Stoned" "Flying" "Underground" "PokeVirus" "Invincible" }array $enddef $define CONDSTATS2 { "Freeze" "Burn" "Sleep" "Poison" "Paralyze" "Undefined_6" "Undefined_7" "Faint" "Undefined_8" "Undefined_9" "Fail" "Undefined_B" "Undefined_C" "Undefined_D" "Undefined_E" "Charmed" "Flinch" "Trap" "Combo" "Leech" "Confusion" "Undefined_M" "Undefined_N" "Undefined_P" "Undefined_Q" "Drunk" "AIDS" "Stoned" "Flying" "Underground" "PokeVirus" "Invincible" }array $enddef $pubdef STATUS_HEALTHY -1 $pubdef STATUS_FREEZE 0 $pubdef STATUS_BURN 1 $pubdef STATUS_SLEEP 2 $pubdef STATUS_POISON 3 $pubdef STATUS_PARALYZE 4 $pubdef STATUS_FAINTED 7 $def STATUS_FAINTED 7 $pubdef COND_CHARM 15 $pubdef COND_FLINCH 16 $pubdef COND_TRAP 17 $pubdef COND_COMBO 18 $pubdef COND_LEECH 19 $pubdef COND_CONFUSED 20 $pubdef COND_FLYING 28 $libdef ICIdletime $pubdef COND_UNDERGROUND 29 $pubdef COND_POKERUS 30 $pubdef COND_INVINCIBLE 31 ( *** END condition stacking *** ) ( $def RESTRICT_POKEMON 1 ) ( $def SEPERATELY_EVOLVED_HUMANS 1 ) $ifndef SEPERATELY_EVOLVED_HUMANS $def HUMANMON 999 $endif var param var target var stat var value var dicestore var dicestore4 : vitstats var total "Vitamin statistics for " me @ name strcat "Vitamins" pretty tellme { "Max-HP: ^cyan^" me @ "s/sv/Max-HP" getstatint dup total @ + total ! "^white^/^yellow^" "@rp/vitmax" getdex "^normal^" }cat "Vitamins" pretty tellme { "Attack: ^cyan^" me @ "s/sv/attack" getstatint dup total @ + total ! "^white^/^yellow^" "@rp/vitmax" getdex "^normal^" }cat "Vitamins" pretty tellme { "Defense: ^cyan^" me @ "s/sv/defense" getstatint dup total @ + total ! "^white^/^yellow^" "@rp/vitmax" getdex "^normal^" }cat "Vitamins" pretty tellme { "Special: ^cyan^" me @ "s/sv/special" getstatint dup total @ + total ! "^white^/^yellow^" "@rp/vitmax" getdex "^normal^" }cat "Vitamins" pretty tellme { "Spec-Def: ^cyan^" me @ "s/sv/Special-Def" getstatint dup total @ + total ! "^white^/^yellow^" "@rp/vitmax" getdex "^normal^" }cat "Vitamins" pretty tellme { "Speed: ^cyan^" me @ "s/sv/speed" getstatint dup total @ + total ! "^white^/^yellow^" "@rp/vitmax" getdex "^normal^" }cat "Vitamins" pretty tellme "=================" "Vitamins" pretty tellme { "Total: ^green^" total @ "^white^/^red^" "@rp/totalvitmax" getdex "^normal^" }cat "Vitamins" pretty tellme ; $libdef numrealplayers : numrealplayers[ dbref:loca -- i ] var playerarray var num var size var player loca @ contents_array online_array array_intersect dup playerarray ! if begin playerarray @ 0 array_getitem dup player ! player? if player @ "~status" getpropstr "*ic" smatch if player @ location "ICTime" getstat toint dup not if pop 900 then player @ idletime > else 0 then if player @ "@pc/aka" array_get_reflist playerarray @ array_diff playerarray ! num @ ++ num ! else then then playerarray @ 0 array_getitem player @ = if playerarray @ 0 array_delitem playerarray ! then playerarray @ not until else 0 num ! then num @ ; PUBLIC numrealplayers : ICIdletime[ dbref:target -- b ] var timefactor target @ dup location "ICTime" getstat toint dup not if pop 900 then timefactor ! target @ location numrealplayers dup 3 > if 3 - 40 * timefactor @ swap - timefactor @ then systime target @ "ICtime/1" getstat - timefactor @ < target @ "ICtime/diff" getstat timefactor @ 5 * 6 / timefactor @ 90 - > if timefactor @ 5 * 6 / else timefactor @ 90 - then < and if 1 else 0 then ; $libdef related? : related? (d d -- i) var! target var! player var result target @ "@rp/p/" array_get_propvals foreach swap pop player @ = if 1 result ! then repeat player @ "@rp/p/" array_get_propvals foreach swap pop target @ = if 1 result ! then repeat result @ ; PUBLIC related? $libdef character? : character? ( d -- i ) dup player? swap dup "X" flag? swap dup "Z" flag? swap -3 rotate and swap "@rp/npc?" getstat or or ; PUBLIC character? : iam ( d -- s ) "pokemon" getstatstr ; PUBLIC iam $libdef iam $libdef mon? : mon? ( d -- i ) dup "pokemorph" getstat toint 0 = swap iam toint and ; PUBLIC mon? $libdef morph? : morph? ( d -- i ) dup "pokemorph" getstat toint 1 = swap iam toint and ; PUBLIC morph? $libdef wild? : wild? ( d -- i ) "wild" getstat if 1 else 0 then ; PUBLIC wild? $libdef meta? : meta? ( d -- i ) $ifdef SEPERATELY_EVOLVED_HUMANS dup "pokemorph" getstat toint 2 = swap iam toint and $else pop 0 $endif ; PUBLIC meta? $libdef human? : human? ( d -- i ) $ifdef SEPERATELY_EVOLVED_HUMANS dup "pokemorph" getstat toint 3 = swap iam toint not and $else dup "pokemorph" getstat toint 1 = swap iam toint HUMANMON = and $endif ; PUBLIC human? $libdef mtype : mtype ( i -- s ) $ifdef SEPERATELY_EVOLVED_HUMANS $def NUMMORPHS 4 { "Pokemon" "Pokemorph" "Metahuman" "Human" } array_make swap array_getitem $else $def NUMMORPHS 2 { "Pokemon" "Pokemorph" } array_make swap array_getitem $endif ; : pokegender[ ref:target -- str:genderid ] target @ "gender" getstat dup not if pop target @ "sex" getprop dup not if pop "unknown" then then case "M*" smatch when "male" end "F*" smatch when "female" end "H*" smatch when "hermaphrodite" end "G*" smatch when "gendershifter" end "N*" smatch when "neuter" end default pop "unknown" end endcase ; PUBLIC pokegender $libdef pokegender $pubdef pokesex pokegender 1 strcut pop $def pokesex pokegender 1 strcut pop $libdef pokenumber : pokenumber[ ref/str/int:target -- str:pokenumber ] target @ dbref? if target @ iam exit then target @ int? if "000" target @ intostr strcat dup strlen 3 - strcut swap pop exit then target @ string? if { "/pokemon/" target @ "/name" }cat getdex if target @ exit then { "/pokemon/byName/" target @ }cat getdex dup if exit else pop then then "0" ; PUBLIC pokenumber $libdef poketype : poketype[ ref/str/int:target -- str:pokenumber ] target @ dbref? if target @ "override/type" getstat dup not if pop target @ "ts/type" getstat dup not if pop { "/pokemon/" target @ iam "/type" }cat getdex then dup not if pop "" then exit else exit then else exit then target @ int? if "000" target @ intostr strcat dup strlen 3 - strcut swap pop target ! then target @ string? if { "/pokemon/" target @ "/type" }cat getdex dup not if pop { "/pokemon/" { "/pokemon/byName/" target @ }cat getdex "/type" }cat getdex dup not if pop else exit then else exit then then "" ; PUBLIC poketype $libdef getallstatus : getallstatus[ ref:target -- int:bitplane ] target @ "status" getstat ; PUBLIC getallstatus $libdef setstatus : setstatus[ ref:target int:statbit -- ] statbit @ -1 = if target @ "status" 0 setstat exit then statbit @ 0 7 .. if target @ "status" over over getstat 255 bitsreset setstat then target @ "status" over over getstat statbit @ bitset setstat ; PUBLIC setstatus $libdef clearstatus : clearstatus[ ref:target int:statbit -- ] target @ "status" over over getstat statbit @ bitreset setstat ; PUBLIC clearstatus $libdef getstatus : getstatus[ ref:target int:statbit -- ] statbit @ -1 = if target @ "status" getstat 256 % not if 1 else 0 then exit then target @ "status" getstat statbit @ bitget ; PUBLIC getstatus $libdef status_resolve : status_resolve[ str:lookup -- int:result ] lookup @ "Healthy" smatch if -1 exit then CONDSTATS var! tmpA tmpA @ lookup @ array_matchval array_explode not if CONDSTATS2 var! tmpA tmpA @ lookup @ array_matchval array_explode not if -2 else pop then else pop then ; PUBLIC status_resolve $libdef status_str : status_str[ int:lookup -- str:result ] lookup @ -1 = if "Healthy" exit then CONDSTATS var! tmpA tmpA @ lookup @ [] ; PUBLIC status_str $libdef status_str2 : status_str2[ int:lookup -- str:result ] lookup @ -1 = if "Healthy" exit then CONDSTATS2 var! tmpA tmpA @ lookup @ [] ; PUBLIC status_str2 $libdef getstatuslist : getstatuslist[ int:bitplane -- str:statuses ] CONDSTATS var! tmpA { 0 31 1 for var! num bitplane @ num @ bitget if tmpA @ num @ [] then repeat }array ; PUBLIC getstatuslist $libdef getstatuslist : getstatuslist2[ int:bitplane -- str:statuses ] CONDSTATS var! tmpA { 0 31 1 for var! num bitplane @ num @ bitget if tmpA @ num @ [] then repeat }array ; PUBLIC getstatuslist2 : ansi_strcut ( s i -- s1 s2 ) swap dup strlen ( i s i ) swap dup ( i i s s ) 0 unparse_ansi 1 unparse_ansi 2 unparse_ansi 3 unparse_ansi strlen ( i i s i ) 3 pick swap - rot pop ( i s i ) rot ( s i i ) + ( s i ) strcut ; : ansi_strlen ( s -- i ) 0 unparse_ansi 1 unparse_ansi 2 unparse_ansi 3 unparse_ansi strlen ; : genkai[ d:target -- f:result ] target @ "genkai" getstatint case not when 625.0 end 1 = when 999.0 end 2 = when 1500.0 end 3 = when 2500.0 end 4 = when 9999.9 end 5 = when 99999.9 end default pop 625.0 end endcase ; PUBLIC genkai $libdef genkai : xpspent ( d -- i ) var target var xpspentf var stat var value target ! 0.0 xpspentf ! target @ character? if target @ "@rp/a/" array_get_propvals foreach value ! stat ! value @ target @ genkai > if target @ "a/" stat @ strcat target @ genkai setstat stat @ " is at max!" strcat "PokeSystem" pretty tellme then target @ "gymleader" getstat target @ "gymmon" getstat or not if target @ "gym" getstat value @ target @ "xp" getstat tofloat 4 / dup 100 < if pop 100 then > and if target @ "a/" stat @ strcat target @ "xp" getstat tofloat 4 / dup 100 < if pop 100 then toint tofloat setstat stat @ " is at max!" strcat "PokeSystem" pretty tellme then target @ "gym" getstat not value @ target @ "xp" getstat tofloat 6 / dup 100 < if pop 100 then > and if target @ "a/" stat @ strcat target @ "xp" getstat tofloat 6 / dup 100 < if pop 100 then toint tofloat setstat stat @ " is at max!" strcat "PokeSystem" pretty tellme then then repeat target @ "@rp/e/" array_get_propvals foreach value ! stat ! value @ target @ "ee/" stat @ strcat getstat dup not if pop 64.0 then > if target @ "e/" stat @ strcat target @ "ee/" stat @ strcat getstat dup not if pop 64.0 then setstat stat @ " is at max!" strcat "PokeSystem" pretty tellme then repeat target @ "@rp/m/" array_get_propvals foreach value ! stat ! value @ 99.00 > if target @ "m/" stat @ strcat 99.00 setstat stat @ " is at max!" strcat "PokeSystem" pretty tellme then repeat target @ "@rp/p/" array_get_propvals foreach value ! stat ! value @ character? not if target @ "p/" stat @ strcat 0 setstat then repeat target @ "@rp/q/" array_get_propvals foreach value ! stat ! value @ character? not if target @ "q/" stat @ strcat 0 setstat then repeat target @ "@rp/s/" array_get_propvals foreach value ! stat ! value @ target @ genkai > if target @ "s/" stat @ strcat target @ genkai setstat stat @ " is at max!" strcat "PokeSystem" pretty tellme then repeat target @ "@rp/t/" array_get_propvals foreach value ! stat ! value @ 256.00 > if target @ "t/" stat @ strcat 256.00 setstat stat @ " cannot go any higher!" strcat "PokeSystem" pretty tellhere then repeat target @ "@rp/t/" array_get_propvals foreach value ! stat ! value @ -512.0 < if target @ "t/" stat @ strcat -512.0 setstat stat @ " cannot go any lower!" strcat "PokeSystem" pretty tellme then repeat then target @ "@rp/a/" array_get_propvals foreach value ! stat ! value @ xpspentf @ + xpspentf ! repeat target @ "@rp/e/" array_get_propvals foreach value ! stat ! value @ xpspentf @ + xpspentf ! repeat ( target @ "@rp/i/" array_get_propvals foreach value ! stat ! value @ xpspentf @ + xpspentf ! repeat ) target @ "xpspent" xpspentf @ setstat xpspentf @ ; PUBLIC xpspent $libdef xpspent : nd6 ( i/f -- i ) var temp var neg dup 0 < if 1 neg ! else 0 neg ! then dup float? if int then abs temp ! temp @ not if 0 exit then 0 begin temp @ while random 6 % 1 + + temp @ 1 - temp ! repeat neg @ if 0 swap - then ; PUBLIC nd6 $libdef nd6 : nd4 ( i/f -- i ) var temp var neg dup 0 < if 1 neg ! else 0 neg ! then dup float? if int then abs temp ! temp @ not if 0 exit then 0 begin temp @ while random 4 % 1 + + temp @ 1 - temp ! repeat neg @ if 0 swap - then ; PUBLIC nd4 $libdef nd4 : nd5 ( i/f -- i ) var temp var neg dup 0 < if 1 neg ! else 0 neg ! then dup float? if int then abs temp ! temp @ not if 0 exit then 0 begin temp @ while random 5 % 1 + + temp @ 1 - temp ! repeat neg @ if 0 swap - then ; PUBLIC nd5 $libdef nd5 : nd3 ( i/f -- i ) var temp var neg dup 0 < if 1 neg ! else 0 neg ! then dup float? if int then abs temp ! temp @ not if 0 exit then 0 begin temp @ while random 3 % 1 + + temp @ 1 - temp ! repeat neg @ if 0 swap - then ; PUBLIC nd3 $libdef nd3 : successlevel ( i/f -- s ) toint dup 5 <= if pop "Unskilled" exit then dup 10 <= if pop "Barely touched" exit then dup 15 <= if pop "Glancing" exit then dup 25 <= if pop "Beginner" exit then dup 35 <= if pop "Novice" exit then dup 45 <= if pop "Average" exit then dup 60 <= if pop "Notable" exit then dup 80 <= if pop "Above-average" exit then dup 100 <= if pop "Skilled" exit then dup 150 <= if pop "Gifted" exit then dup 200 <= if pop "Reknown" exit then dup 300 <= if pop "Heroic" exit then dup 450 <= if pop "Master" exit then dup 700 <= if pop "Legendary" exit then dup 1000 <= if pop "Unbelievable" exit then dup 1500 <= if pop "Ultimate" exit then 2000 > if pop "Godlike (Please contact staff)" exit then ; PUBLIC successlevel $libdef successlevel $libdef fmt76 : fmt76 ( s -- s ) "|" swap strcat " " dup strcat dup strcat dup strcat strcat 77 ansi_strcut pop "|" strcat ; PUBLIC fmt76 $libdef fmt76 : level ( i/f -- f ) var technic tofloat technic ! technic @ 0 >= if technic @ sqrt else 0 technic @ fabs sqrt - then ; PUBLIC level $libdef level : level2xp ( i/f -- f ) var technic tofloat technic ! (L 1) (technic @ 1.0 < if 1.0 exit then) technic @ 0 >= if technic @ dup * else 0 technic @ fabs dup * - then ; PUBLIC level2xp $libdef level2xp : maxhp ( d -- i ) var target target ! target @ "override/maxhp" getstatint dup if exit else pop then target @ "Max-HP" getplainstat toint target @ "t/Max-HP" getstatint + target @ exit? target @ "@rp/npc?" getprop not and if pop 250 then target @ room? target @ "@rp/npc?" getprop not and if pop 999 then target @ program? target @ "@rp/npc?" getprop not and if pop 999 then target @ thing? target @ character? not and if pop 500 then ; PUBLIC maxhp $libdef maxhp : isfainted? ( d -- i ) var target target ! target @ "hp" getstatint 0 <= if target @ "hp" 0 setstat target @ exit? target @ "@rp/npc?" getprop not and if target @ "hp" target @ maxhp setstat { target @ " has fainted!!!" }cat "PokeBattle" pretty tellhere then target @ room? target @ "@rp/npc?" getprop not and if target @ "hp" target @ maxhp setstat { target @ " has fainted!!!" }cat "PokeBattle" pretty tellhere then target @ program? target @ "@rp/npc?" getprop not and if target @ "hp" target @ maxhp setstat { target @ " has fainted!!!" }cat "PokeBattle" pretty tellhere then target @ thing? target @ character? not and if target @ "hp" target @ maxhp setstat { target @ " has fainted!!!" }cat "PokeBattle" pretty tellhere then target @ STATUS_FAINTED setstatus 1 exit then 0 ; PUBLIC isfainted? $libdef isfainted? : adjusthp ( d i -- ) var target var amount amount ! target ! target @ "hp" over over getstat amount @ + dup target @ maxhp > if pop target @ maxhp then setstat ; PUBLIC adjusthp $libdef adjusthp : attackok? ( d s -- i ) var target var tlev var ttype var item item ! target ! target @ "xp" getstatint level tlev ! target @ "pokemorph" getstatint ttype ! ttype @ case 0 = when item @ "/attacks/mExcept/Pokemon" getdex "{" swap "}" strcat strcat smatch if 1 exit then end 1 = when item @ "/attacks/mExcept/Pokemorph" getdex "{" swap "}" strcat strcat smatch if 1 exit then end $ifdef SEPERATELY_EVOLVED_HUMANS 2 = when item @ "/attacks/mExcept/Metahuman" getdex "{" swap "}" strcat strcat smatch if 1 exit then end 3 = when item @ "/attacks/mExcept/Human" getdex "{" swap "}" strcat strcat smatch if 1 exit then end $endif endcase { "/pokemon/" target @ iam "/attacks/" item @ }cat getdex if tlev @ { "/pokemon/" target @ iam "/attacks/" item @ }cat getdex toint >= if 1 else 0 then else 0 then ; PUBLIC attackok? $libdef attackok? : tmhmok? ( d s -- i ) var target var item var ttype item ! target ! { "/pokemon/" target @ iam "/tmhm" }cat getdex if item @ { "{" "/pokemon/" target @ iam "/tmhm" item @ }cat getdex "|" ":" subst "}" smatch if 1 else 0 then else 0 then ; PUBLIC tmhmok? $libdef tmhmok? : itemok? ( s -- i ) var target var item var ttype item ! { "/pokemon/" item @ "/desc" }cat getdex if 1 else 0 then ; PUBLIC itemok? $libdef itemok? : cost ( d s -- f ) getstatfloat level toint dup 100 = if 0 else 2.0 swap 1.0 + pow then ; PUBLIC cost $libdef cost ( *** BEGIN statmod stuff *** ) $pubdef HPS 0 $pubdef ATT 1 $pubdef DEF 2 $pubdef SPD 3 $pubdef ACC 3 $pubdef SPC 4 $pubdef SDF 5 $def HPS 0 $def ATT 1 $def DEF 2 $def SPD 3 $def SPC 4 $def SDF 5 : checkevo[ s:race1 s:race2 -- i ] race1 @ toint race2 @ toint = if 1 else race1 @ toint race2 @ toint > if race2 @ race1 @ race2 ! race1 ! then { "pokemon/" race1 @ "/evolution" }cat getdex dup if "pokemon/byname/" swap strcat getdex race2 @ checkevo else pop 0 then then ; $libdef growthbonus : growthbonus[ d:target -- f ] $def += dup @ rot + swap ! var bonus var flag ( Badges ) target @ "@rp/b" array_get_propvals array_count 2 * bonus += ( Gym bonus ) target @ "gymleader" getstat target @ "gymcohead" getstat or if 11 bonus += else target @ "gym" getstat if 7 bonus += then then ( Pure-blood ditto ) target @ "pokemon" getstat toint 132 = target @ "truetype" getstat toint 132 = or target @ "c/father" getstatstr "ditto" smatch and target @ "c/mother" getstatstr "ditto" smatch and if 10 bonus += ( Commented to remove Pureblood bonus else ( Pure-blood ) target @ "pokemon" getstat dup target @ "c/father" getstatstr "pokemon/byname/" swap strcat getdex checkevo swap target @ "c/mother" getstatstr "pokemon/byname/" swap strcat getdex checkevo and if 6 bonus += then ) then ( training pokemon ) 0 target @ "@rp/p" array_get_propvals foreach swap pop .puppet? not if 1 + then repeat dup 3 > if pop 10 bonus += else 0 > if 8 bonus += then then ( 'mon trained by a 'morph) target @ "pokemorph" getstat not if target @ "@rp/q" array_get_propvals foreach swap pop "pokemorph" getstat flag @ not and if 10 bonus += 1 flag ! then repeat else ( 'morph trained by either a morph or mon ) target @ "@rp/q" array_get_propvals array_count if 8 bonus += then then ( 'mon trained by a 'mon) target @ "pokemorph" getstat not flag @ not and if target @ "@rp/q" array_get_propvals foreach swap pop "pokemorph" getstat not flag @ not and if 9 bonus += 1 flag ! then repeat then bonus @ ; PUBLIC growthbonus : st[ str/int:input -- str/int:output ] input @ string? if input @ case "HP" smatch when 0 end "HPS" smatch when 0 end "ATT" smatch when 1 end "DEF" smatch when 2 end "SPD" smatch when 3 end "SPC" smatch when 4 end "SDF" smatch when 5 end default pop -1 end endcase exit then input @ int? if input @ case 0 = when "max-hp" end 1 = when "attack" end 2 = when "defense" end 3 = when "speed" end 4 = when "special" end 5 = when "special-def" end default pop "" end endcase exit then "" ; PUBLIC st $libdef st : basal[ ref/str/int:target int:stat -- int:value ] target @ pokenumber var! num { "/pokemon/" num @ "/base" }cat getdex "/" explode_array stat @ [] toint ; PUBLIC basal $libdef basal : ceil[ ref/str/int:target int:stat -- int:value ] target @ pokenumber var! num { "/pokemon/" num @ "/max" }cat getdex "/" explode_array stat @ [] toint ; PUBLIC ceil $libdef ceil : perlev[ ref/str/int:target int:stat -- int:value ] target @ pokenumber var! num { "/pokemon/" num @ "/max" }cat getdex "/" explode_array stat @ [] toint { "/pokemon/" num @ "/base" }cat getdex "/" explode_array stat @ [] toint - 99.0 / ; PUBLIC perlev $libdef perlev : statraise[ ref:target int:stat -- int:value ] target @ pokenumber var! num num @ "0" smatch if 0.0 exit then num @ stat @ perlev target @ "c/" stat @ st strcat getstat + target @ growthbonus 100.0 / ++ * ; PUBLIC statraise $libdef statraise : currentstat[ ref:target int:stat -- int:value ] target @ pokenumber var! num num @ "0" smatch if 0.0 exit then target @ "s/" stat @ st strcat getstat ; PUBLIC currentstat $libdef currentstat : atlev[ ref/str/int:target int:stat int:lev -- int:value ] target @ stat @ basal target @ stat @ perlev lev @ -- * + ; PUBLIC atlev $libdef atlev : pokepower[ ref/str/int:target -- int:value ] target @ pokenumber var! num 0 { "/pokemon/" num @ "/max" }cat getdex "/" explode_array foreach swap pop atoi + repeat 0 { "/pokemon/" num @ "/base" }cat getdex "/" explode_array foreach swap pop atoi + repeat - 99.0 / ; PUBLIC pokepower $libdef pokepower : pokerarity[ ref/str/int:target -- int:value ] target @ pokenumber var! num { "/pokemon/" num @ "/rarity" }cat getdex tofloat ; PUBLIC pokerarity $libdef pokerarity : pokeevocost[ ref/str/int:target -- int:value ] target @ pokenumber var! num { "/pokemon/" num @ "/evolvesfrom" }cat getdex dup var! num2 if num2 @ pokenumber num2 ! num2 @ pokepower num2 @ pokerarity + 4.0 / { "/pokemon/" num2 @ "/evolvesfrom" }cat getdex dup var! num3 if num3 @ pokenumber num3 ! num3 @ pokepower num3 @ pokerarity + 4.0 / + then else 0 then ; PUBLIC pokeevocost $libdef pokeevocost : pokecost[ ref/str/int:target -- int:value ] target @ pokenumber var! num num @ pokepower num @ pokerarity num @ pokeevocost + + ; PUBLIC pokecost $libdef pokecost ( *** END statmod stuff *** ) : init param @ me @ name smatch if me @ "/@rp/" remove_prop { me @ " reset their sheet using " command @ " " param @ "!" }cat wc "Thy sheet hath been cleared." INFORM me @ "xp" 100 setstat me @ "lastlevel" 10 setstat me @ dup player? if "yen" 5000 setstat else "yen" 0 setstat then me @ "votes" 25 setstat "At chargen: 25 votes, 100xp, 5000 yen, 33hp to start, do +pokechooser next." INFORM else { "To reset your sheet, use " command @ " " }cat INFORM then ; : init-partial "System/reset-disabled" getdex if "+resetting is no longer allowed." INFORM exit then param @ me @ name smatch if { me @ " reset their XP and freebie based stats using " command @ " " param @ "!" }cat wc me @ "/@rp/a/" remove_prop me @ "/@rp/assimilation/" remove_prop me @ "/@rp/e/" remove_prop me @ "/@rp/s/" remove_prop me @ "freebieinit" getstat 2 = if me @ "xp" over over getstat me @ "freebies/XP" getstat 100.0 * - setstat then me @ "freebies" 0 setstat me @ "freebieinit" 0 setstat me @ "validatedat" 0 setstat me @ "validatedby" 0 setstat me @ "validated?" 0 setstat me @ "lastlevel" 10 setstat "Cleared all XP and freebie related stats, do +pokechooser next." INFORM else { "To wipe yer skills, use " command @ " " }cat INFORM then ; : rpset me @ "W" flag? if param @ "=" explode pop dup match dup ok? not if pop resolve dup character? not if pop "Invalid target" "RPset" pretty tellme exit then else swap pop then target ! stat ! value ! command @ "+rp" stringcmp not if target @ stat @ value @ toint dup value ! setstat then command @ "+rpi" stringcmp not if target @ stat @ value @ toint dup value ! setstat then command @ "+rps" stringcmp not if target @ stat @ value @ tostr dup value ! setstat then command @ "+rpf" stringcmp not if target @ stat @ value @ tofloat dup value ! setstat then command @ "+rpd" stringcmp not if target @ stat @ value @ todbref dup value ! setstat then command @ "+rpo" stringcmp not if target @ stat @ value @ todbref dup value ! setstat then { "[rpset] " me @ " set RP stat [" stat @ "] on " target @ " to: " value @ }cat dup tellme prog swap prog "/logs" getpropval 1 + dup prog swap "/logs" swap setprop intostr "/logs/" swap strcat swap setprop else "Must be a W to use." "RPset" pretty tellme AVATAR { "wc " me @ " tried to +rpset without a W bit!" }cat force then ; : qtystr dup -1 = if pop "PERM" exit then tostr ; : sheet var pokemon var target2 var key param @ "" stringcmp not if me @ target ! else param @ resolve target ! then target @ #-1 dbcmp if { "Target " param @ " not found." }cat "Pokedex" pretty tellme exit then target @ #-2 dbcmp if { "Target " param @ " matched more than once, be more specific." }cat "Pokedex" pretty tellme exit then target @ "pokemon" getstat pokemon ! command @ "{+xp|+votes|+points}" smatch if target @ levelhandler pop then me @ target @ = me @ staff? or me @ target @ related? or key ! { "Pokedex scan of " target @ name }cat header tellme target @ xpspent pop pokemon @ if { " Pokemon[^GREEN^" { "pokemon/" pokemon @ "/name" }cat getdex 14 lj "^NORMAL^] " " Type[^CYAN^" { "pokemon/" pokemon @ "/type" }cat getdex 14 lj "^NORMAL^] " " Morphology[^CYAN^" target @ "pokemorph" getstat mtype 9 lj "^NORMAL^] " }cat fmt76 tellme then { " HP[^GREEN^" target @ "hp" getstatint tostr 4 rj "/" target @ maxhp tostr 4 rj "^NORMAL^] " " XP[^CYAN^" target @ "xp" getstatfloat 2 fchop 9 rj "^NORMAL^] " " XPFree[^CYAN^" target @ "xp" getstatfloat target @ "xpspent" getstatfloat - 2 fchop 9 rj "^NORMAL^] " " Yen[^YELLOW^" target @ "yen" getstatfloat 2 fchop 12 rj "^NORMAL^]" }cat fmt76 tellme { " Puppets[^CYAN^" target @ puppet_count tostr 2 rj "/" target @ puppet.limit tostr 2 rj "^NORMAL^] " " TXP[^CYAN^" target @ GetTXP_Total 2 fchop 9 rj "^NORMAL^] " " TXPFree[^CYAN^" target @ GetTXP_Avail 2 fchop 9 rj "^NORMAL^] " " ^RED^Wild^NORMAL^[" target @ wild? if "Yes" else "No " then "] " " Valid[^GRAY^" target @ "validated?" getstatint if "Yes" else "No " then "^NORMAL^]" }cat fmt76 tellme { " Votes[^GREEN^" target @ "votes" getstatint tostr 2 rj "/25^NORMAL^] " "Genkai[^CYAN^" target @ "genkai" getstatint tostr 1 rj "^NORMAL^] " "Lv[^CYAN^" target @ "xp" getstatint level dup target @ "lastlevel" getstatint < if pop target @ "lastlevel" getstatint then 2 fchop 7 rj "^NORMAL^] " "Gym[" target @ "gymleader" getstat dup if "^YELLOW^" swap else pop target @ "gymcohead" getstat dup if "^CYAN^" swap else pop target @ "gym" getstat dup if "^GRAY^" swap else pop "None" then then then 9 lj "^NORMAL^] " "Sex[" target @ pokegender 14 lj "]" }cat fmt76 tellme { " " "^RED^Cool ^CYAN^[^WHITE^" target @ "c/Cool" getstat tostr 1 lj "^CYAN^] " "^BLUE^Beauty ^CYAN^[^WHITE^" target @ "c/Beauty" getstat tostr 1 lj "^CYAN^] " "^PURPLE^Cute ^CYAN^[^WHITE^" target @ "c/Cute" getstat tostr 1 lj "^CYAN^] " "^GREEN^Smart ^CYAN^[^WHITE^" target @ "c/Smart" getstat tostr 1 lj "^CYAN^] " "^YELLOW^Tough ^CYAN^[^WHITE^" target @ "c/Tough" getstat tostr 1 lj "^CYAN^]^NORMAL^" }cat fmt76 tellme { " Growth: ^RED^HPS^NORMAL^[" target @ HPS statraise 1 round ftostrc 3 rj "] " "^GREEN^ATT^NORMAL^[" target @ ATT statraise 1 round ftostrc 3 rj "] " "^YELLOW^DEF^NORMAL^[" target @ DEF statraise 1 round ftostrc 3 rj "] " "^CYAN^SPC^NORMAL^[" target @ SPC statraise 1 round ftostrc 3 rj "] " "^PURPLE^SDF^NORMAL^[" target @ SDF statraise 1 round ftostrc 3 rj "] " "^BLUE^SPD^NORMAL^[" target @ SPD statraise 1 round ftostrc 3 rj "]" }cat fmt76 tellme { " Statuses: [" target @ getallstatus getstatuslist array_commas dup not if pop " " then dup "{Statuses}" smatch not if dup strlen 58 swap - else 63 then lj "]" }cat fmt76 tellme command @ "{+xp|+votes|+points}" smatch if me @ staff? if { " Sheet last validated by [^GREEN^" target @ "validatedby" getstat "^NORMAL^] on [^CYAN^" target @ "validatedat" getstatint "%X %x" swap timefmt "^NORMAL^] " }cat fmt76 tellme then "Pokedex" footer tellme exit then ( Stats ) key @ if command @ "{+attacks}" smatch not if "Stat modifiers" header tellme "|^UNDERLINE^Stat |T| SP |Lev.^NORMAL^| |^UNDERLINE^Stat |T| SP |Lev.^NORMAL^|" tellme { { "Attack" "Defense" "Max-HP" "Special" "Special-Def" "Speed" }array foreach swap pop dup stat ! target @ swap getplainstat value ! { "|" stat @ dup "/" rinstr strcut swap pop 24 lj (ability) "| " "|" value @ toint tostr 4 rj (XP in that pool) "|" value @ toint level dlev4 "|" (current level) }cat over string? not if " " strcat else strcat tellme then repeat target @ "@rp/t/" array_get_propvals foreach value ! stat ! { "|" stat @ dup "/" rinstr strcut swap pop 24 lj (ability) "|*" "|" value @ toint tostr 4 rj (XP in that pool) "|" value @ toint level dlev4 "|" (current level) }cat over string? not if " " strcat else strcat tellme then repeat dup string? if " |" strcat tellme then pop then ( abilities ) target @ "@rp/a/" nextprop "" stringcmp if "Attacks" header tellme "|^UNDERLINE^Ability |PP| XP |Next|Lev.^NORMAL^| |^UNDERLINE^Ability |PP| XP |Next|Lev.^NORMAL^|" tellme #-2 target @ "@rp/a/" array_get_propvals foreach value ! stat ! { "|" stat @ capitalize dup "/" rinstr strcut swap pop 18 lj (ability) "|" target @ { "a/" stat @ "/pp" }cat getstatint tostr 2 rj (XP in that pool) "|" value @ toint tostr 4 rj (XP in that pool) "|" value @ level int 1 + level2xp value @ - toint intostr 4 rj (XP to next level) "|" value @ toint level dlev4 "|" (current level) }cat over string? not if " " strcat else strcat tellme then repeat dup string? if " |" strcat tellme then pop then target @ "@rp/l/" nextprop "" stringcmp if "Skills" header tellme "|^UNDERLINE^Skill | XP^NORMAL^| |^UNDERLINE^Skill | XP^NORMAL^|" tellme #-2 { { target @ "@rp/l/" array_get_propvals foreach over over var! value2 var! stat2 target @ "@rp/l/" stat2 @ strcat propdir? if target @ "@rp/l/" stat2 @ strcat array_get_propvals foreach swap stat2 @ "/" rot strcat strcat swap repeat then repeat }dict foreach value ! stat ! { "|" stat @ capitalize 32 lj (ability) "|" value @ tostr 3 rj "|" (current level) }cat over string? not if " " strcat else strcat tellme then repeat dup string? if " |" strcat tellme then pop then ( Equipment ) command @ "{+attacks}" smatch not if target @ "@rp/e/" nextprop "" stringcmp if "Equipment" header tellme "|^UNDERLINE^Equipment | XP |Lev.^NORMAL^| |^UNDERLINE^Equipment | XP |Lev.|^NORMAL^" tellme #-2 target @ "@rp/e/" array_get_propvals foreach value ! stat ! { "|" stat @ capitalize dup "/" rinstr strcut swap pop 26 lj (ability) "|" value @ toint tostr 4 rj (XP in that pool) "|" value @ toint level dlev4 "|" (current level) }cat over string? not if " " strcat else strcat tellme then repeat dup string? if " |" strcat tellme then pop then then then ( Training ) command @ "{+attacks}" smatch not if target @ "@rp/i/" nextprop "" stringcmp if "Training" header tellme "|^UNDERLINE^Pokemon | XP |Lev.^NORMAL^| |^UNDERLINE^Pokemon | XP |Lev.^NORMAL^|" tellme #-2 target @ "@rp/i/" array_get_propvals foreach value ! stat ! { "|" stat @ capitalize dup "/" rinstr strcut swap pop 26 lj (ability) "|" value @ toint tostr 4 rj (XP in that pool) "|" value @ toint level dlev4 "|" (current level) }cat over string? not if " " strcat else strcat tellme then repeat dup string? if " |" strcat tellme then pop then then ( Pokemon ) command @ "{+attacks}" smatch not if target @ "@rp/p/" nextprop "" stringcmp if "Pokemon" header tellme "|^UNDERLINE^Name |Species |Lev.^NORMAL^| |^UNDERLINE^Name |Species |Lev.^NORMAL^|" tellme #-2 target @ "@rp/p/" array_get_propvals foreach value ! stat ! { "|" stat @ dup "/" rinstr strcut swap pop 18 lj (Pokemon name) "|" { "/pokemon/" value @ iam "/name" }cat getdex 12 lj (Pokemon species) "|" value @ "xp" getstatint level dup value @ "lastlevel" getstatint < if pop value @ "lastlevel" getstatint then dlev4 "|" (Pokemon level) }cat over string? not if " " strcat else strcat tellme then repeat dup string? if " |" strcat tellme then pop then ( Trainers ) target @ "@rp/q/" nextprop "" stringcmp if "Trainers" header tellme "|^UNDERLINE^Name |Inv.|Species |Lv.^NORMAL^| |^UNDERLINE^Name |Inv.|Species |Lv.^NORMAL^|" tellme #-2 target @ "@rp/q/" array_get_propvals foreach value ! stat ! { "|" stat @ dup "/" rinstr strcut swap pop 15 lj (Pokemon name) "|" value @ { "i/" target @ name }cat getstat toint intostr 4 rj (Pokemon investment) "|" { "/pokemon/" value @ iam "/name" }cat getdex 10 lj (Pokemon species) "|" value @ "xp" getstatint level dup value @ "lastlevel" getstatint < if pop value @ "lastlevel" getstatint then dlev4 "|" (Pokemon level) }cat over string? not if " " strcat else strcat tellme then repeat dup string? if " |" strcat tellme then pop then ( Badges ) target @ "@rp/b/" nextprop "" stringcmp if "Badges" header tellme "|^UNDERLINE^Badge |Type ^NORMAL^| |^UNDERLINE^Name |Type ^NORMAL^|" tellme #-2 target @ "@rp/b/" array_get_propvals foreach value ! stat ! { "|" stat @ capitalize dup "/" rinstr strcut swap pop 22 lj (Badge name) "|" value @ capitalize 13 lj "|" (Badge type) }cat over string? not if " " strcat else strcat tellme then repeat dup string? if " |" strcat tellme then pop then key @ if ( Materials ) target @ "@rp/m/" nextprop "" stringcmp if "Items" header tellme "|^UNDERLINE^Materials |Qty.^NORMAL^| |^UNDERLINE^Materials |Qty.^NORMAL^|" tellme #-2 target @ "@rp/m/" array_get_propvals foreach value ! stat ! { "|" stat @ capitalize dup "/" rinstr strcut swap pop 31 lj (ability) "|" value @ qtystr 4 rj "|" (XP in that pool) }cat over string? not if " " strcat else strcat tellme then repeat dup string? if " |" strcat tellme then pop then ( Key items ) target @ "@rp/k/" nextprop "" stringcmp if "Key items" header tellme "|^UNDERLINE^Key item |Type ^NORMAL^| |^UNDERLINE^Key item |Type ^NORMAL^|" tellme #-2 target @ "@rp/k/" array_get_propvals foreach value ! stat ! { "|" stat @ capitalize dup "/" rinstr strcut swap pop 23 lj (ability) "|" value @ capitalize 12 lj "|" (XP in that pool) }cat over string? not if " " strcat else strcat tellme then repeat dup string? if " |" strcat tellme then pop then then then { "Pokedex" }cat footer tellme ; : buy var spent var total var unspent var xp command @ "+buy" stringcmp not if me @ "validated?" getstatint if "You can only +buy skills like this while unvalidated. Please use +train." "Buy" pretty tellme exit else param @ "=" explode 2 = not if "+buy =" "Buy" pretty tellme exit else stat ! tofloat value ! me @ stat @ attackok? not me @ { "a/" stat @ }cat getstatint not and if "This attack is not yet available to you." "Buy" pretty tellme exit then me @ "xp" getstatfloat total ! me @ "xpspent" getstatfloat spent ! total @ spent @ - unspent ! me @ "a/" stat @ strcat getstatfloat xp ! ( value @ unspent @ > if { "You dont have enough XP to put in that pool. Value:[" value @ "] Unspent:[" unspent @ "] Needed:[" value @ unspent @ - "]" }cat "Buy" pretty tellme exit then value @ 0 xp @ - < if { "You dont have enough XP in that pool to take out. Value:[" value @ "] In pool:[" xp @ "] Over by:[" 0 xp @ - value @ - "]" }cat "Buy" pretty tellme exit then ) me @ "a/" stat @ strcat xp @ value @ + setstat me @ xpspent pop me @ "xpspent" getstatfloat spent ! me @ "a/" stat @ strcat getstatfloat xp ! total @ spent @ - unspent ! { stat @ " was adjusted by " value @ 2 fchop "xp. Current:[" xp @ 2 fchop "] Level:[" xp @ level 2 fchop "] XP left:[" unspent @ 2 fchop "]" }cat "Buy" pretty tellme then then then command @ "+buyequip" stringcmp not if param @ "=" explode 2 = not if "+buyequip =" "Buy" pretty tellme exit else stat ! toint value ! me @ { "e/" stat @ }cat getstatint not if "You must equip an item before you can improve upon it." "BuyEquip" pretty tellme exit then me @ "xp" getstatfloat total ! me @ "xpspent" getstatfloat spent ! total @ spent @ - unspent ! me @ "e/" stat @ strcat getstatfloat xp ! value @ unspent @ > if { "You dont have enough XP to put into that equipment. Value:[" value @ 2 fchop "] Unspent:[" unspent @ 2 fchop "] Needed:[" value @ unspent @ - 2 fchop "]" }cat "BuyEquip" pretty tellme exit then value @ 0 xp @ - < if { "You dont have enough XP in that equipment to take out. Value:[" value @ 2 fchop "] In pool:[" xp @ 2 fchop "] Over by:[" 0 xp @ - value @ - 2 fchop "]" }cat "BuyEquip" pretty tellme exit then me @ "e/" stat @ strcat xp @ value @ + setstat me @ xpspent pop me @ "xpspent" getstatfloat spent ! me @ "e/" stat @ strcat getstatfloat xp ! total @ spent @ - unspent ! { stat @ " was adjusted by " value @ 2 fchop "xp. Current:[" xp @ 2 fchop "] Level:[" xp @ level 2 fchop "] XP left:[" unspent @ 2 fchop "]" }cat "BuyEquip" pretty tellme then then ; : train var spent var total var unspent var xp me @ "validated?" getstatint not if "You can only +learn skills while validated. Please use +buy." "Learn" pretty tellme exit else me @ "k/substitute" getstat if "Substitutes may not train others!" "Learn" pretty tellme exit then param @ "=" explode 2 = not if "+learn =" "Learn" pretty tellme exit else stat ! tofloat value ! me @ stat @ attackok? not me @ { "a/" stat @ }cat getstatint not and if "This attack is not yet available to you." "Buy" pretty tellme exit then me @ "xp" getstatfloat total ! me @ "xpspent" getstatfloat spent ! total @ spent @ - unspent ! me @ "a/" stat @ strcat getstatfloat xp ! value @ unspent @ > if { "You dont have enough XP to put in that pool. Value:[" value @ 2 fchop "] Unspent:[" unspent @ 2 fchop "] Needed:[" value @ unspent @ - 2 fchop "]" }cat "Learn" pretty tellme exit then value @ 0 < if { "You cannot take XP out of a pool while validated. Value:[" value @ 2 fchop "]" }cat "Learn" pretty tellme exit then me @ "a/" stat @ strcat xp @ value @ + setstat me @ xpspent pop me @ "xpspent" getstatfloat spent ! me @ "a/" stat @ strcat getstatfloat xp ! total @ spent @ - unspent ! { stat @ " was increased by " value @ 2 fchop "xp. Current:[" xp @ 2 fchop "] Level:[" xp @ level 2 fchop "] XP left:[" unspent @ 2 fchop "]" }cat "Learned" pretty tellme then then ; : poketrain var tmp param @ "=" explode 2 = not if "+pokemon/train =" "Poketrain" pretty tellme exit then target ! tofloat value ! target @ resolve target ! target @ int 0 < if { "Unknown or ambiguous target." }cat "Poketrain" pretty tellme exit then me @ "validated?" getstat target @ "validated?" getstat and not if "You may not train while invalidated!" "PokeTrain" pretty tellme AVATAR { "!wc #CHEATER: " me @ unparseobj " attempted to invalidly train " target @ unparseobj "!" }cat force exit then value @ 0 < if "You cannot take XP from your pokemon." "Poketrain" pretty tellme exit then me @ { "p/" target @ name }cat getstat not if "You must own the pokemon you want to train." "PokeTrain" pretty tellme exit then me @ .puppet? if "Puppets may not train anyone!" "PokeTrain" pretty tellme exit then target @ .puppet? if "You may only train puppets!" "PokeTrain" Pretty tellme exit then me @ GetTXP_Avail value @ > if me @ "i/" target @ name strcat getstatfloat value @ + me @ "i/" target @ name strcat rot setstat target @ "xp" getstatfloat value @ + target @ swap "xp" swap setstat { me @ " trains " target @ " for " value @ 2 fchop " XP." }cat "Poketrain" pretty tellhere { me @ " trains " target @ " for " value @ 2 fchop " XP." }cat "Poketrain" pretty target @ swap ansi_notify else { "You dont have enough XP! Value:[" value @ "]." }cat "$" pretty tellme then ; : spend var tmp command @ "+pay" stringcmp not if param @ "=" explode 2 = not if "+pay =" "$" pretty tellme exit else target ! tofloat value ! target @ resolve target ! target @ int 0 < if { "Unknown or ambiguous target." }cat "$" pretty tellme exit then value @ 0 < if "You cannot give someone negative yen." "$" pretty tellme exit then me @ target @ alt? if { "You cannot give money to your alt [" target @ "]! You lost the $" value @ 2 fchop " in the attempt and staff has been notified." }cat "Pay" pretty tellme AVATAR { "wc #CHEATER/PAYALT: " me @ unparseobj " -> " target @ unparseobj ": (" value @ 6 fchop ") - The yen was confiscated." }cat force exit then me @ owner target @ dbcmp me @ target @ dbcmp not and if { "You cant take your puppet's money, cheater. [" target @ "]! You lost the $" value @ 2 fchop " in the attempt and staff has been notified." }cat "Pay" pretty target @ swap ansi_notify me @ "yen" over over getstat value @ - setstat AVATAR { "wc #CHEATER/GETPUPPETMONEY: " me @ unparseobj " -> " target @ unparseobj ": (" value @ 6 fchop ") - The yen was confiscated." }cat force exit then target @ #-2 dbcmp if { "Target " param @ " matched more than once, be more specific." }cat "$" pretty tellme exit then me @ "yen" getstatfloat value @ >= if me @ "yen" getstatfloat value @ - me @ swap "yen" swap setstat target @ "yen" getstatfloat value @ + target @ swap "yen" swap setstat { me @ " gives $" value @ 2 fchop " to " target @ "." }cat "$" pretty tellhere { me @ " gives $" value @ 2 fchop " to " target @ "." }cat "$" pretty target @ swap ansi_notify else { "You dont have enough yen! Value:[" value @ "]." }cat "$" pretty tellme then then then command @ "+give" stringcmp not if param @ "=" explode 2 = if pop pop param @ "=1" strcat param ! then param @ "=" explode 3 = not if "+give =[=]" "Give" pretty tellme exit else target ! stat ! toint value ! target @ resolve target ! target @ int 0 < if { "Unknown or ambiguous target." }cat "Give" pretty tellme exit then value @ 0 < if "You cannot give someone a negative amount of an item." "Give" pretty tellme exit then me @ target @ alt? if { "You cannot give items your alt " target @ ", cheater. You lost the " stat @ " in the attempt and staff has been notified." }cat "Pay" pretty tellme me @ "m/" stat @ strcat over over getstat value @ - setstat AVATAR { "wc #CHEATER/GIVEALT: " me @ unparseobj " -> " target @ unparseobj ": (" stat @ "/" value @ ") - The items were confiscated." }cat force exit then me @ owner target @ dbcmp me @ target @ dbcmp not and if { "You cant take your puppet's items, cheater. [" target @ "]! You lost the $" value @ 2 fchop " in the attempt and staff has been notified." }cat "Pay" pretty target @ swap ansi_notify me @ "m/" stat @ strcat over over getstat value @ - setstat AVATAR { "wc #CHEATER/GETPUPPETITEMS: " me @ unparseobj " -> " target @ unparseobj ": (" stat @ "/" value @ ") - The items were confiscated." }cat force exit then me @ "m/" stat @ strcat getstatint value @ >= if me @ "m/" stat @ strcat getstatint value @ - me @ swap "m/" stat @ strcat swap setstat target @ "m/" stat @ strcat getstatint value @ + target @ swap "m/" stat @ strcat swap setstat { me @ " gives " value @ " " stat @ "(s) to " target @ "." }cat "Give" pretty tellhere else { "You dont have enough " stat @ " to give! Value:[" value @ "]." }cat "Give" pretty tellme then then then command @ "+use" stringcmp not if param @ not if "+use [=]" "Use" pretty tellme exit then param @ "=" explode tmp ! tmp @ 1 = if stat ! me @ target ! then tmp @ 2 = if stat ! target ! target @ resolve target ! target @ int 0 < if { "Unknown or ambiguous target." }cat "Use" pretty tellme exit then then me @ target @ alt? if { "You cannot use items on your alt " target @ ", cheater. The item " stat @ " had no effect,and staff has been notified." }cat "Pay" pretty tellme me @ "m/" stat @ strcat over over getstat 1 - setstat AVATAR { "wc #CHEATER/USEALT: " me @ unparseobj " -> " target @ unparseobj ": (" stat @ ") - The item had no effect." }cat force exit then me @ owner target @ dbcmp me @ target @ dbcmp not and if { "Your puppets cant use items on you, cheater. [" target @ "]! The item " stat @ " had no effect and staff has been notified." }cat "Pay" pretty target @ swap ansi_notify me @ "m/" stat @ strcat over over getstat 1 - setstat AVATAR { "wc #CHEATER/USEPUPPETITEMS: " me @ unparseobj " -> " target @ unparseobj ": (" stat @ ") - The item had no effect." }cat force exit then { "item/" stat @ "/limit" }cat getdex dup if 0 swap tostr ":" explode array_make foreach swap pop { "pokemon/byname/" rot }cat getdex toint target @ "pokemon" getstat toint swap matchmon if 1 break then repeat else pop 1 then not if { target @ " may not use this item!" }cat "Item" pretty tellme exit then me @ "m/" stat @ strcat getstatint dup 1 >= swap -1 = or if me @ "m/" stat @ strcat getstatint dup -1 = not if target @ stat @ itemhandler if me @ swap "m/" stat @ strcat swap -- setstat then then { target @ me @ dbcmp if me @ " uses an item: [^CYAN^" stat @ "^NORMAL^]." }cat "Use" pretty tellhere else me @ " uses an item: [^CYAN^" stat @ "^NORMAL^] on [" target @ "]." }cat "Use" pretty tellhere then me @ "ts/lastitem" stat @ setstat else { "You dont have any ^CYAN^" stat @ "^NORMAL^ to use!" }cat "Use" pretty tellme then then command @ "+spendhp" stringcmp not if param @ "=" explode 1 = not if "+spendhp " "HP" pretty tellme exit else toint value ! value @ 0 < if { me @ " has healed themselves. Value:[" value @ "] HP:[" me @ "hp" getstatint "]" }cat "Heal" pretty tellhere AVATAR { "wc " me @ " has healed themselves. Value:[" value @ "] HP:[" me @ "hp" getstatint "]" }cat force then me @ "hp" getstatint value @ >= if me @ "hp" getstatint value @ - me @ swap "hp" swap setstat { me @ " adjustes their Health Points by [" value @ "]." }cat "SpendHP" pretty tellhere else me @ "hp" getstatint value @ - me @ swap "hp" swap setstat { me @ " has adjusted their HP below zero, and is in KO status. Value:[" value @ "] HP:[" me @ "hp" getstatint "]" }cat "SpendHP" pretty tellhere AVATAR { "wc " me @ " has adjusted their HP below zero, and is in KO status. Value:[" value @ "] HP:[" me @ "hp" getstatint "]" }cat force then then then ; : validate param @ "" stringcmp not if "me" target ! else param @ target ! then target @ resolve target ! target @ int 0 < if { "Unknown or ambiguous target." }cat "Validate" pretty tellme exit then target @ player? me @ staff? not and if "Only staff may validate players." "Validate" pretty tellme exit then target @ "freebieinit" getstat 2 = not if "Player did not +finish." "Validate" pretty tellme exit then target @ thing? if me @ staff? not if me @ target @ controls not if "You can only validate your own puppets." "Validate" pretty tellme exit then then then command @ "+validate" stringcmp not if target @ "@/ftl" getprop target @ .puppet? or not if "They have not agreed to the AUP^Normal^" "Validate" pretty tellme exit then { "pokemon/" target @ "pokemon" getstat "/restricted" }cat getdex me @ "W" flag? not and if "Staff may not validate restricted pokemon types" "Validate" pretty tellme exit then "^Red^Have you checked the @wl for this character?^Normal^" "Validate" pretty tellme read "y*" smatch not if "Please check @wl for this character" "Validate" pretty tellme exit then target @ "validated?" 1 setstat target @ "validatedby" me @ setstat target @ "validatedat" systime setstat target @ { me @ " has validated your sheet. RP on!" }cat "RPStaff" pretty ansi_notify AVATAR { "wc " me @ " has validated " target @ "'s sheet." }cat force { me @ " has validated " target @ "'s sheet." }cat "Validation" pretty 1 array_make #4350 "_Staff" array_get_reflist array_ansi_notify { "You have validated " target @ "'s sheet." }cat INFORM then command @ "+invalidate" stringcmp not if target @ "validated?" 0 setstat AVATAR { "wc " me @ " has invalidated " target @ "'s sheet." }cat force { me @ " has invalidated " target @ "'s sheet." }cat "Validation" pretty 1 array_make #4350 "_Staff" array_get_reflist array_ansi_notify { "You have unvalidated " target @ "'s sheet." }cat INFORM then ; : voteadj ( d f -- f ) var target var votes var adj votes ! target ! me @ player? if 1.0 target @ "voteq" getstat tofloat 1 10 limit / adj ! else 0.75 then votes @ adj @ * ; : vote var temp var newvalue me @ "G" flag? if { "Guests cant vote." }cat "Vote" pretty tellme then param @ "=" explode temp ! temp @ 0 <= temp @ 3 > or if "+vote =<0..3>" "vote" pretty tellme exit then temp @ 1 = if resolve target ! 1.0 value ! ( Moeru changed pmatch to match... ) else resolve target ! tofloat value ! ( and probably broke it ) then target @ #-1 dbcmp if { "Target " param @ " not found." }cat "Pokedex" pretty tellme exit then target @ #-2 dbcmp if { "Target " param @ " matched more than once, be more specific." }cat "Vote" pretty tellme exit then me @ target @ alt? if { "You cannot vote for your alt [" target @ "]! You lost " value @ 6 fchop "xp for trying, and staff has been notified." }cat "Vote" pretty tellme me @ "xp" over over getstat value @ fabs - setstat AVATAR { "wc #CHEATER/VOTEALT: " me @ unparseobj " -> " target @ unparseobj ": (" value @ fabs 6 fchop ") - XP was deducted." }cat force exit then me @ owner target @ dbcmp me @ target @ dbcmp not and if { "Your puppet [" me @ "] cant vote for you [" target @ "], cheater. You (not your puppet) lost " value @ 6 fchop "xp for trying, and staff has been notified." }cat "Vote" pretty target @ swap ansi_notify target @ "xp" over over getstat value @ - setstat AVATAR { "wc #CHEATER/PUPPETVOTEOWNER: " me @ unparseobj " -> " target @ unparseobj ": (" value @ 6 fchop ") - XP was deducted." }cat force exit then me @ "@rp/votedfor" target @ reflist_find if { "You can only vote for someone once every WorldHeart tick. Sorry." "Vote" pretty tellme ( paranoia? if AVATAR { "wc #CHEATER/VOTEBLITZ: " me @ unparseobj " -> " target @ unparseobj ": (" value @ ")" }cat force then ) exit then atmax? if "That person is already at max XP!" "Vote" pretty tellme exit then (Added for 100000XP cap) target @ me @ dbcmp if { "You cannot vote for yourself, foo!" }cat "Vote" pretty tellme exit then target @ owner me @ dbcmp if { "You cannot vote for your puppet, foo!" }cat "Vote" pretty tellme exit then ( puppet exception added by Moeru ) value @ 0 <= if me @ "W" flag? not if 1.0 value ! then then value @ MAXVOTES > if MAXVOTES value ! then me @ staff? me @ "votes" getstatfloat value @ >= or not if { "You don't have enough votes! Target:[" target @ "] Value:[" value @ "]." }cat "Vote" pretty tellme exit then me @ staff? not if me @ "votes" getstatfloat value @ - me @ "votes" rot setstat then value @ 3.0 > value @ 0.0 < or paranoia? and if AVATAR { "wc #WIZ/SpecialVote: " me @ unparseobj " -> " target @ unparseobj ": (" value @ ")" }cat force then target @ value @ voteadj target @ owner growthfactor newvalue ! target @ owner "xp" getstatfloat newvalue @ + target @ owner "xp" rot setstat me @ player? if target @ "voteq" over over getstat ++ 1 10 limit setstat then target @ "lastvote" systime setstat { "You vote for " target @ owner " with " value @ 1 = if value @ 2 fchop " vote" else value @ 2 fchop " votes" then "." }cat "Vote" pretty tellme target @ owner dup "staff" power? if { "You gained " newvalue @ 2 fchop "xp from " value @ 2 fchop " vote(s) by " me @ "." }cat "Vote" pretty ansi_notify else "You got a vote!" "Vote" pretty ansi_notify then me @ "@rp/votedfor" target @ reflist_add target @ owner levelhandler pop paranoia? if value @ 3.0 > not if AVATAR { "wc #Player/MultiVote: " me @ " -> " target @ ": (" value @ ")" }cat force then (VOID ADDITION <- Notification of votes higher than 1) then ; : voteall var value var newvalue var votearray param @ if toint value ! else 1 value ! then value @ 0 <= if me @ "W" flag? not if 1.0 value ! then then value @ MAXVOTES > if MAXVOTES value ! then paranoia? if AVATAR { "wc #" me @ name " has just used +voteall at " loc @ name " for " value @ " vote(s)" }cat force then me @ location contents_array foreach target ! pop target @ character? if target @ awake? target @ "validated?" getstatint and if atmax? if continue then target @ owner idletime 900 <= target @ "~Status" getprop "*IC" smatch and if target @ owner me @ dbcmp not if me @ target @ alt? not if me @ "@rp/votedfor" target @ reflist_find not if votearray @ dup if target @ swap array_appenditem votearray ! else pop { target @ }array votearray ! then then then then then then then repeat votearray @ if votearray @ array_count value @ * me @ "votes" getstatint > if "You don't have enough votes to vote for everyone!" "Vote" pretty tellme exit then votearray @ foreach target ! pop target @ value @ voteadj target @ growthfactor newvalue ! me @ "votes" getstatfloat value @ - me @ "votes" rot setstat target @ owner "xp" getstatfloat newvalue @ + target @ owner "xp" rot setstat me @ player? if target @ "voteq" over over getstat ++ 1 10 limit setstat then target @ "lastvote" systime setstat { "You vote for " target @ owner " with " value @ 1 = if value @ 2 fchop " vote" else value @ 2 fchop " votes" then "." }cat "Vote" pretty tellme target @ owner dup "staff" power? if { "You gained " newvalue @ 2 fchop "xp from " value @ 2 fchop " vote(s) by " me @ "." }cat "Vote" pretty ansi_notify else "You got a vote!" "Vote" pretty ansi_notify then me @ "@rp/votedfor" target @ reflist_add target @ owner levelhandler pop repeat then ; : pokemon me @ "c/speciesmorph" getstat me @ "ts/evolve" getstat or me @ "origpokemon" "132" smatch or not if "Only ditto and dittokin can use this command." "Assimilate" pretty tellme exit then param @ not if "+pokemon " "Assimilate" pretty tellme exit then { "pokemon/" param @ "/name" }cat getdex not if { "pokemon/byname/" param @ }cat getdex param ! then param @ not if "Couldn't find that pokemon, by name or number." "Assimilate" pretty tellme exit then me @ "assimilation/" param @ strcat getstat not if "You dont know how to change to that pokemon species." "Assimilate" pretty tellme exit then me @ "pokemon" param @ setstat { "You are now " param @ " (" { "/pokemon/" param @ "/name" }cat getdex ")" }cat "Pokemon" pretty tellme me @ "species" { { "/pokemon/" param @ "/name" }cat getdex me @ morph? if "-morph" then }cat setprop paranoia? if AVATAR { "wc # " me @ " has used the +pokemon command to turn into a " { "pokemon/" param @ "/name" }cat getdex }cat force then ; $libdef pokemorph : pokemorph me @ wild? if { "^RED^Wild pokemon cannot become pokemorphs!" }tell exit then me @ "c/speciesmorph" getstat me @ "c/metamorph" getstat or me @ "origpokemon" getstatint 132 = or not if "Only ditto and dittokin and werepokemon can use this command." "Metamorph" pretty tellme exit then me @ "pokemorph" over over getstat toint ++ NUMMORPHS % setstat { "Pokemon morphology: " me @ "pokemorph" getstat mtype }cat "Pokemorph" pretty tellme me @ "pokemorph" getstat toint not if me @ "POKEMON" set else me @ "!POKEMON" set then me @ "species" { { "/pokemon/" me @ iam "/name" }cat getdex me @ morph? if "-morph" then }cat setprop paranoia? if AVATAR { "wc # " me @ " has used the +pokemorph command" }cat force then ; PUBLIC pokemorph : pokegender+ var newgender me @ "c/speciesmorph" getstat me @ "c/gendermorph" getstat or me @ "origpokemon" getstatint 132 = or not if "Only dittos, dittokin and gendershifters can use this command." "SexChange" pretty tellme exit then me @ "gender" getstat "male" smatch if "female" newgender ! then me @ "gender" getstat "female" smatch if me @ "c/hermaphrodite" getstat if "hermaphrodite" newgender ! else "neuter" newgender ! then then me @ "gender" getstat "hermaphrodite" smatch if "neuter" newgender ! then me @ "gender" getstat "neuter" smatch if "male" newgender ! then me @ "gender" newgender @ setstat me @ "sex" newgender @ setprop { "Pokemon gender: " me @ "gender" getstat }cat "Pokegender" pretty tellme paranoia? if AVATAR { "wc # " me @ " has used the +pokegender command" }cat force then ; : install prog "_defs/fmt76" "\"$lib/rps\" match \"fmt76\" call" setprop prog "_defs/cost" "\"$lib/rps\" match \"cost\" call" setprop prog "_defs/level" "\"$lib/rps\" match \"level\" call" setprop prog "_defs/level2xp" "\"$lib/rps\" match \"level2xp\" call" setprop prog "_defs/maxhp" "\"$lib/rps\" match \"maxhp\" call" setprop prog "_defs/nd6" "\"$lib/rps\" match \"nd6\" call" setprop prog "_defs/nd4" "\"$lib/rps\" match \"nd4\" call" setprop prog "_defs/successlevel" "\"$lib/rps\" match \"successlevel\" call" setprop prog "_defs/idletime" "\"$lib/rps\" match \"idletime\" call" setprop prog "_defs/iam" "\"$lib/rps\" match \"iam\" call" setprop prog "_defs/attackok?" "\"$lib/rps\" match \"attackok?\" call" setprop prog "_defs/tmhmok?" "\"$lib/rps\" match \"tmhmok?\" call" setprop prog "_defs/itemok?" "\"$lib/rps\" match \"itemok?\" call" setprop prog "_defs/adjusthp" "\"$lib/rps\" match \"adjusthp\" call" setprop prog "_defs/isfainted?" "\"$lib/rps\" match \"isfainted?\" call" setprop "PokeRPSystem v1.1" header tellhere "The Windows 3.1 of RP systems." "DESCRIPTION" pretty tellhere "$lib/rp $lib/alynna BOY LINK_OK AUTOSTART" "REQUIRES" pretty tellhere "fmt76 cost level level2xp maxhp nd6 nd4 successlevel idletime" "INCLUDES" pretty tellhere "iam attackok? tmhmok? itemok? isfainted? adjusthp" "INCLUDES" pretty tellhere "+init;+chargen +sheet;sheet +buy;buyequip +train;+learn +roll;+check" "INSTALLS" pretty tellhere "+pay;+spendhp;+give;+use +validate;+invalidate +rp;+rpi;+rps;+rpf;+rpd" "INSTALLS" pretty tellhere "+vote;+voteall +xp;+votes;+points +sl +pokemon" "INSTALLS" pretty tellhere "+store;+store/buy;+store/sell;+store/trash" "INSTALLS" pretty tellhere "fmt76 cost level level2xp" "TESTABLE" pretty tellhere "Alynna's MUFInstaller" footer tellhere ; : sysheart var target var gained var factor var playercount var room var value var yenvalue background online_array foreach target ! pop target @ "debug_on" getprop prog "debug_on" getprop or if debug_on then target @ location numrealplayers dup playercount ! dup 0.5 pow .6 * swap 6.5 - 0.3 pow 0.3 * error? if pop clear else + then target @ "gym" getstat if 2.5 + else 1.5 + then factor ! target @ "validated?" getstatint if ( Got to be validated ) target @ "lifecycle" getstatint 1 + target @ "lifecycle" rot setstat target @ owner ICIdletime if target @ "~status" getpropstr "{OOC|IDLE|IDL}" smatch not if ( And not OOC ) ( Always degenerate while IC, whether people are around or not ) target @ location name "*OOC*" smatch not ( if not in OOC location ) ( Maybe lose a bit of condition stats ) random 10000 % CONDVEC < if debug? if AVATAR { "!wc #DEBUG: " target @ unparseobj " lost 1 COOL" }cat force then target @ "c/Cool" over over getstat -- 0 9 limit setstat then random 10000 % CONDVEC < if debug? if AVATAR { "!wc #DEBUG: " target @ unparseobj " lost 1 BEAUTY" }cat force then target @ "c/Beauty" over over getstat -- 0 9 limit setstat then random 10000 % CONDVEC < if debug? if AVATAR { "!wc #DEBUG: " target @ unparseobj " lost 1 CUTE" }cat force then target @ "c/Cute" over over getstat -- 0 9 limit setstat then random 10000 % CONDVEC < if debug? if AVATAR { "!wc #DEBUG: " target @ unparseobj " lost 1 SMART" }cat force then target @ "c/Smart" over over getstat -- 0 9 limit setstat then random 10000 % CONDVEC < if debug? if AVATAR { "!wc #DEBUG: " target @ unparseobj " lost 1 TOUGH" }cat force then target @ "c/Tough" over over getstat -- 0 9 limit setstat then playercount @ 3 >= target @ location "@rp/zone" envpropstr swap pop "{BATTLE|PvP|PUBLIC|PrP}" smatch playercount @ 2 >= and or if ( and more than me here ) ( IC and active section ) ( Earn Refresh points and gain more XP ) atmax? if 0 gained ! else target @ "xp" getstatfloat playercount @ 2 >= if factor @ target @ growthfactor else 0.0 then target @ location "@rp/zone" envpropstr swap pop case "PvP" smatch when target @ "~status" getpropstr "IIC" smatch if 1.5 * then end "BATTLE" smatch when target @ "~status" getpropstr "IIC" smatch if 1.2 * then end "PUBLIC" smatch when target @ "~status" getpropstr "IC" smatch if 1.2 * then end "PrP" smatch when 1.0 * end "SEX_OK" smatch when 0.8 * end "OOC" smatch when 0 * end "CLOSED" smatch when 0 * end default pop end endcase target @ location "@rp/open" envprop swap pop dup if tofloat * else pop then dup gained ! + target @ "xp" rot setstat target @ verbose? if target @ { "Roleplaying XP gained: " gained @ 2 fchop }cat "WorldHeart" pretty ansi_notify then then ( get Yen ) ( systime target @ "@/logintime" getprop toint - 100.0 / dup 250.00 > if pop 250.00 then gained ! ) target @ wild? not if target @ "s/resources" getstat 10.0 * 100.0 5000.0 limit gained ! target @ location "@rp/yengain" envpropstr pop dup dup room ! if "@rp/yengain" getprop dup tofloat yenvalue ! 0 <= if room @ "@rp/yengain" 1 setprop 1 yenvalue ! then yenvalue @ 2 > if room @ "@rp/yengain" 2 setprop 2 yenvalue ! then else 1 yenvalue ! then gained @ yenvalue @ * gained ! (apply room multiplier to yen gain) target @ "yen" over over getstat gained @ + setstat debug? if AVATAR { "wc #DEBUG: " target @ unparseobj ": " gained @ " -> " target @ "yen" getstat }cat force then target @ verbose? if target @ { "Yen earned: " gained @ 2 fchop }cat "WorldHeart" pretty ansi_notify then then ( Regain HP ) ( target @ "hp" getstatint target @ maxhp < if target @ stathandler pop target @ "Regeneration" getstatint level 1 + toint gained ! target @ "hp" getstatint gained @ + dup target @ maxhp > if pop target @ maxhp then target @ "hp" rot setstat target @ verbose? if target @ { "You gained " gained @ "hp, from natural regeneration." }cat "WorldHeart" pretty ansi_notify then then ) then then then ( All validated section ) ( Clear voted list ) target @ "@rp/votedfor" 0 setprop ( Remove a voteq ) target @ "voteq" over over getstat -- 1 10 limit setstat target @ verbose? if target @ { "VotedFor cleared, VoteQ reduced by 1 .. (" target @ "voteq" getstat dup ";" swap 1.0 swap / 2 fchop ")" }cat "WorldHeart" pretty ansi_notify then ( Regenerate votes ) target @ "votes" getstatfloat 2 playercount @ tofloat dup not if pop 1 then / dup 1 > if pop 1 then + dup 25 > if pop 25.0 then target @ "votes" rot setstat then ( Regenerate puppet votes and voteq ) target @ nextowned dup { }array var! puppetlist if begin var! puppet puppet @ .puppet? if puppet @ puppetlist @ array_appenditem puppetlist ! then puppet @ nextowned dup while repeat puppetlist @ dup if foreach target ! pop ( Clear voted list ) target @ "@rp/votedfor" 0 setprop ( Remove a voteq ) target @ "voteq" over over getstat -- 1 10 limit setstat target @ verbose? if target @ { "VotedFor cleared, VoteQ reduced by 1 .. (" target @ "voteq" getstat dup ";" swap 1.0 swap / 2 fchop ")" }cat "WorldHeart" pretty ansi_notify then ( Regenerate votes ) target @ "votes" getstatfloat 2 playercount @ tofloat dup not if pop 1 then / dup 1 > if pop 1 then + dup 25 > if pop 25.0 then target @ "votes" rot setstat repeat else pop then else pop then ( Tell them if they gained a level. ) target @ levelhandler pop debug_off repeat ; : compare me @ location ; : inflict param @ not if "+inflict [=]" inform then param @ "=" split dup not if pop me @ else resolve then var! target var! status target @ int 0 < if "Unknown or foul, soulless reference." inform exit then status @ status_resolve dup var! statnum -2 = not if target @ statnum @ getstatus if target @ statnum @ clearstatus { me @ " removed the " statnum @ status_str " status on " target @ "!" }cat "Status" pretty tellhere else target @ statnum @ setstatus target @ { "statusfactor/" statnum @ }cat random 4 % 2 + setstat { me @ " inflicted the " statnum @ status_str " status on " target @ "!" }cat "Status" pretty tellhere then else "Unknown status or condition." inform then ; : digivolve var target var species me @ mlevel 5 < if "^RED^Permission denied." tellme exit then param @ not if "+evolve [=]" inform exit then param @ "=" instr not if "" var! species param @ resolve target ! else param @ "=" split pokenumber species ! resolve target ! then target @ int 0 < if "You specify unknown person!" inform exit then species @ "0" smatch if "You specify unrecognized pokemons!" inform exit then species @ not if { "/pokemon/" target @ iam "/evolution" }cat getdex pokenumber species ! then species @ "0" smatch if "Pokemon no recognize evolution! Glonous history and cultual?" inform exit then { "Are sure you want evolve " target @ " to " { "/pokemon/" species @ "/name" }cat getdex "? (y/N)" }tell read "Y*" smatch not if { "You stopped evolve at very last moment!" }tell exit then { target @ " evolves to " { "/pokemon/" species @ "/name" }cat getdex "!!!" }cat "Evolve" pretty var! tmp target @ "pokemon" species @ setstat target @ "assimilation/" species @ tostr strcat "1" setstat (Set the orginal species of the target to the new species. Fixes the TM/Evolve Bug) target @ "origpokemon" species @ setstat target @ "tx/trueform" species @ setstat me @ location target @ location dbcmp not if me @ tmp @ ansi_notify then target @ location #-1 tmp @ ansi_notify_except { tmp @ 1 unparse_ansi " [Being done by " me @ "]" }cat wc ; : assimilator me @ "assimilator" ; $libdef cityparent : cityparent[ dbref:room -- dbref ] room @ #-1 = not if room @ "open" getstat if room @ else room @ location cityparent then else 0 then ; PUBLIC cityparent $libdef open? : open? (dbref -- i) var room room ! room @ #-1 = not if room @ "open" getstat if room @ "open" getstat else room @ location open? then else 0 then ; PUBLIC open? : clearpayday me @ location "ts/payday" 0 setstat "Payday" "Payday is reset!" pretty tellme ; : main param ! debug? if AVATAR { "wc # " me @ " has used the " command @ " command with param " param @ }cat force then param @ mufcron? if sysheart exit then me @ "$lib/rps" match "_/lok" checklock if "$lib/rps" match "_/fl" getprop "RPSystem" pretty tellme exit then ( Sysheart: Initialize the system heart ) command @ "{+sysheart}" smatch me @ "W3" flag? me @ "W4" flag? or me @ "W5" flag? or and if sysheart exit then ( Install: First time use setup ) command @ "+BASICRPSystem/install" smatch if install exit then ( Init: Clear an invalidated sheet, and set it up for chargen ) command @ "{+init|+chargen}" smatch if init exit then ( Wipe: Wipe all your information, but keep your XP ) command @ "{+reset}" smatch if init-partial exit then ( Pokemon: Specify your pokemon type ) command @ "{+pokemon}" smatch if pokemon exit then ( Pokemorph: Toggles your pokemorph setting ) command @ "{+pokemorph}" smatch if pokemorph exit then ( Pokemon: Specify your pokemon type ) command @ "{+pokegender}" smatch if pokegender+ exit then ( Sheet: Display my sheet, or someone elses sheet ) command @ "{+sheet|sheet|+dex|+pokedex|+attacks}" smatch if sheet exit then ( Buy: Adjust skills while chargenning or invalidated ) command @ "{+buy|+buyequip}" smatch if buy exit then ( Train: Adjust skills while validated ) command @ "{+train|+learn}" smatch if train exit then ( PokeTrain: Give XP to someone ) command @ "{+pokemon/train}" smatch if poketrain exit then ( Compare: Compare the last two rolls to the pokemon database ) command @ "{+compare|+cmp}" smatch if compare exit then ( Spend: Give yen or spend HP ) command @ "{+pay|+spendhp|+give|+use}" smatch if spend exit then ( Validate: (Staff only) Mark a sheet valid or invalid ) command @ "{+validate|+invalidate}" smatch if validate exit then ( RPSet: (Staff only) Set an RPStat manually ) command @ "{+rp|+rpi|+rps|+rpf|+rpd|+rpo}" smatch if rpset exit then ( Vote: Give a player 1-3 xp ) command @ "{+vote}" smatch if vote exit then ( Vote all, give every player in the room 1-3xp ) command @ "{+voteall}" smatch if voteall exit then ( XPShow: Show sheet summary ) command @ "{+xp|+votes|+points}" smatch if sheet exit then ( Inflict: inflicts a status ) ( Check the level of a player ) command @ "{+levelcheck}" smatch if match levelhandler exit then command @ "{+inflict}" smatch if inflict exit then ( Evolve pokemon ) command @ "{+evolve}" smatch if digivolve exit then (Wipe Payda) command @ "{+payday/wipe}" smatch if clearpayday exit then ( Vitamin stats ) command @ "{+vitstats}" smatch if vitstats exit then ( Store: Buy/Sell items in a store ) command @ "{+store|+store/buy|+store/sell|+store/trash}" smatch if me @ wild? not if pokestore exit else { "^RED^Wild pokemon cannot shop at a store! You'll need a trainer to get things for you." }tell then then ( Pokemon/X: Own or disown pokemon ) command @ "{+pokemon/owner|+pokemon/disown|+pokemon/leave|+pokemon/trade}" smatch if me @ wild? if command @ "{+pokemon/owner|+pokemon/leave}" smatch if systime me @ "lastcaptured" getstat 86400 + < if { "^RED^You cannot leave or change your current owner yet! Time till you can: ^YELLOW^" me @ "lastcaptured" getstat 86400 + systime - timex }tell else pokeown exit then else { "^RED^A wild pokemon can't do that!" }tell then else pokeown exit then then ( Pokemon: Heal pokemon at the pokemon center ) command @ "{+pokemon/heal}" smatch if pokeheal exit then ( Pokemon: Heal pokemon at the pokemon center ) command @ "{+pokemon/train}" smatch if poketrain exit then ( Roll: Roll one of the abilities you have ) command @ "{+roll|+check}" smatch if pokebattle exit then ( testing section ) command @ "+rps/cost" smatch if { me @ param @ cost }cat "COST" pretty tellme exit then command @ "+rps/fmt76" smatch if { param @ .debug-on fmt76 .debug-off }cat tellme exit then command @ "+rps/level" smatch if { param @ tofloat level }cat tellme exit then command @ "+rps/level2xp" smatch if { param @ tofloat level2xp }cat tellme exit then command @ "+rps/idletime" smatch if { param @ pmatch owner idletime }cat tellme exit then ( "owner" added by Moeru to make it work with puppets ) command @ "+sl" smatch if { param @ toint successlevel }cat "Success Level" pretty tellme exit then ;