@program fmlrps-revised-core.muf 1 10000 d i $include $lib/rp $include $lib/alynna $include $muf/cron lvar param lvar itype lvar iname $def TRUE 1 $def YES 1 $def FALSE 0 $def NO 1 $def RPSYS "$rpsystem" match $def FORCEWIZ #390 $def DEBUGMODE 1 $def tm dup "FMLRPS" pretty tellme DEBUGMODE not if pop else FORCEWIZ { "wi : " }cat rot strcat force then $def th dup "FMLRPS" pretty tellhere DEBUGMODE not if pop else FORCEWIZ { "wi : " }cat rot strcat force then $def smatch_array ", " explode_array "|" array_join "{" swap "}" strcat strcat $def ADDITEM ", " swap strcat strcat $def l swap dup not if pop "" then tostr swap lj $def r swap dup not if pop "" then tostr swap rj $def stou "_" " " subst $def utos "_" " " subst $def eTYPE me @ "_prefs/fmlrps/entry-type" getprop dup string? not if pop "" then $def eNAME me @ "_prefs/fmlrps/entry-name" getprop dup string? not if pop "" then $def eTARGET "/" etype "/" ename "/" strcat strcat strcat strcat $def ayb RPSYS { "/" itype @ "/" iname @ "/" } array_make "" array_join $def rpinfo-chopper dup "/" instr 1 = if 1 strcut swap pop then dup "/" rinstr over strlen = if dup "/" rinstr 1 - strcut pop then $def neg 0 swap - $libdef nd10 : nd10 ( i -- a i ) var! n var die { }array die ! 0 1 n @ 1 for pop random 10 % 1 + dup die @ array_appenditem die ! + repeat die @ swap ; PUBLIC nd10 : dbg ( i -- ) var items items ! var itemarr DEBUGMODE if { } array_make itemarr ! 1 items @ 1 for pick itemarr @ array_vals ++ array_make itemarr ! repeat FORCEWIZ { "wi Items found on stack: " itemarr @ "; " array_join }cat force then ; $libdef wrap78 : wrap78 ( s -- a ) var wrapme var curstr capitalize wrapme ! { begin wrapme @ ansi_strlen 78 <= if wrapme @ break then wrapme @ 78 ansi_strcut pop " " rsplit pop curstr ! wrapme @ curstr @ ansi_strlen ansi_strcut swap pop wrapme ! curstr @ repeat } array_make ; PUBLIC wrap78 $libdef wrap74 : wrap74 ( s -- a ) var wrapme var curstr capitalize wrapme ! { begin wrapme @ strlen 74 <= if { wrapme @ " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " }cat 74 strcut pop { "| " rot " |" }cat break then wrapme @ 74 strcut pop " " rsplit pop curstr ! wrapme @ curstr @ strlen strcut swap pop wrapme ! { "| " { curstr @ " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "}cat 74 strcut pop " |" }cat repeat } array_make ; PUBLIC wrap74 $libdef find-prop-in $pubdef find-prop "" find-prop-in $pubdef find-nameprop "/name" strcat "" find-prop-in pop "" "/name" subst $pubdef find-nameprop-in swap "/name" strcat swap find-prop-in pop "" "/name" subst $def find-prop "" find-prop-in $def find-nameprop "/name" strcat "" find-prop-in pop "" "/name" subst $def find-nameprop-in swap "/name" strcat swap find-prop-in pop "" "/name" subst : find-prop-in ( s s -- s x ) var item var value var value2 var search var section section ! search ! RPSYS { section @ "/" search @ }cat getprop if { section @ "/" search @ }cat RPSYS over getprop exit then RPSYS section @ "/" strcat array_get_propdirs foreach value ! pop RPSYS { section @ "/" value @ "/" search @ }cat getprop if { section @ "/" value @ "/" search @ }cat RPSYS over getprop exit then RPSYS { section @ "/" value @ "/" }cat array_get_propdirs foreach value2 ! pop RPSYS { section @ "/" value @ "/" value2 @ "/" search @ }cat getprop if { section @ "/" value @ "/" value2 @ "/" search @ }cat RPSYS over getprop exit then repeat repeat "" 0 ; PUBLIC find-prop-in $libdef find-propdir-in $pubdef find-propdir "" find-propdir-in $def find-propdir "" find-propdir-in : find-propdir-in ( s s -- s ) var item var value var value2 var search var section section ! search ! RPSYS { section @ "/" search @ "/" }cat propdir? if { section @ "/" search @ capitalize }cat exit then RPSYS { section @ "/" }cat array_get_propdirs foreach value ! pop RPSYS { section @ "/" value @ "/" search @ "/" }cat propdir? if { section @ "/" value @ capitalize "/" search @ capitalize }cat exit then RPSYS { section @ "/" value @ "/" }cat array_get_propdirs foreach value2 ! pop RPSYS { section @ "/" value @ "/" value2 @ "/" search @ "/" }cat propdir? if { section @ "/" value @ capitalize "/" value2 @ capitalize "/" search @ capitalize }cat exit then repeat repeat "" ; PUBLIC find-propdir-in $libdef find-stat : find-stat ( d s -- s ? ) var! search var! target var item var value var value2 target @ search @ getstat if search @ target @ search @ getstat exit then target @ "/@rp/" array_get_propdirs foreach value ! pop target @ { value @ "/" search @ }cat getstat if { value @ "/" search @ }cat target @ over getstat exit then RPSYS { "/@rp/" value @ "/" }cat array_get_propdirs foreach value2 ! pop target @ { value @ "/" value2 @ "/" search @ }cat getstat if { value @ "/" value2 @ "/" search @ }cat target @ over getstat exit then repeat repeat "" 0 ; PUBLIC find-stat : showindex var count var linestore var item var function param @ function ! ( dump an index ) str "RPinfo item type: " function @ cat header tellme -1 count ! "" linestore ! RPSYS function @ array_get_propdirs foreach item ! item @ "_*" smatch not if count @ 1 + count ! linestore @ str RPSYS function @ "/" item @ strcat strcat array_get_propdirs array_count if "^CYAN^" else "^YELLOW^" then item @ tostr capitalize 19 lj "^NORMAL^" cat strcat linestore ! count @ 4 % 3 = if linestore @ tellme "" linestore ! then then repeat count @ 4 % 3 < if linestore @ tellme "" linestore ! then str "FMLRPS RPinfo v1.0 by Alynna" cat footer tellme ; : rpinfo var item var value var value2 var count var linestore var function var propdirmatch var section param ! command @ "+rpinfo" smatch if "" section ! else { command @ "" "+" subst }cat section ! then param @ not if section @ not if "/" param ! showindex exit else section @ param ! showindex exit then then "" itype ! "" iname ! param @ section @ find-nameprop-in dup if rpinfo-chopper "/" split iname ! itype ! else pop param @ section @ find-propdir-in dup if rpinfo-chopper param ! showindex exit else "Couldn't find that item." "RPinfo" pretty tellme exit then then str iname @ capitalize " (" itype @ capitalize ")" cat header tellme ayb "desc" strcat getpropstr wrap74 atellme str "Other information" cat header tellme ayb array_get_propvals foreach value ! item ! item @ "_*" smatch not item @ "{desc|name}" smatch not and if str "^YELLOW^" item @ capitalize 16 lj "^GREEN^" value @ cat tellme then repeat ayb array_get_propdirs array_count 0 > if "Subitems" header tellme param @ function ! -1 count ! "" linestore ! ayb array_get_propdirs foreach item ! item @ "_*" smatch not if count @ 1 + count ! linestore @ str "^GREEN^" item @ tostr capitalize 19 lj "^NORMAL^" cat strcat linestore ! count @ 4 % 3 = if linestore @ tellme "" linestore ! then then repeat count @ 4 % 3 < if linestore @ tellme "" linestore ! then then str "FMLRPS RPinfo v1.0 by Alynna" cat footer tellme ; : entry var item var value param ! command @ tolower case ".type" smatch when me @ "_prefs/fmlrps/entry-type" param @ setprop str "Target:^YELLOW^ " eTARGET "^NORMAL^" cat "Data" pretty tellhere end ".name" smatch when me @ "_prefs/fmlrps/entry-name" param @ setprop RPSYS eTARGET "name" strcat param @ dup "/" instr if "/" rsplit swap pop then setprop str "Target:^YELLOW^ " eTARGET "^NORMAL^, name prop set" cat "Data" pretty tellhere end ".desc" smatch when param @ " " split value ! item ! RPSYS eTARGET "desc" strcat value @ setprop str "^GREEN^Property set, ^YELLOW^" eTARGET "desc:^CYAN^" value @ cat "Data" pretty tellhere end ".set" smatch when param @ " " split value ! item ! RPSYS eTARGET item @ strcat value @ setprop str "^GREEN^Property set, ^YELLOW^" eTARGET item @ ":^CYAN^" value @ cat "Data" pretty tellhere end endcase ; ( "Current Class, Previous Classes, Essence, CP, CP Spent, Body (C/T), Mind (C/T), Spirit (C/T), Body HP (C/T), Mind HP (C/T), Spirit HP (C/T), Skills (and Rank), Abilities (and Rank), Gil, Expenses, Gear (and Rank)" ) $libdef rpstat : rpstat ( s -- x ) var dir var item dir ! RPSYS "/" array_get_propdirs foreach item ! pop RPSYS { "/" item @ "/" dir @ }cat getprop dup if exit else pop then repeat 0 ; PUBLIC rpstat : fc ( s s:color -- s ) var color color ! { "[^" color @ "^" }cat "[" subst "^NORMAL^]" "]" subst ; $libdef valid? : valid? "valid" getstatstr "yes" smatch ; PUBLIC valid? $libdef employed? : employed? "employed" getstatstr "yes" smatch ; PUBLIC employed? $libdef body : body "body" getstat toint ; PUBLIC body $libdef mind : mind "mind" getstat toint ; PUBLIC mind $libdef spirit : spirit "spirit" getstat toint ; PUBLIC spirit $libdef bmax : bmax var! target target @ body 3 * target @ "ability/defence" getstat toint target @ body * + ; PUBLIC bmax $libdef mmax : mmax var! target target @ mind 3 * target @ "ability/defence" getstat toint target @ mind * + ; PUBLIC mmax $libdef smax : smax var! target target @ spirit 3 * target @ "ability/defence" getstat toint target @ spirit * + ; PUBLIC smax $libdef bhp : bhp "bhp" getstat toint ; PUBLIC bhp $libdef mhp : mhp "mhp" getstat toint ; PUBLIC mhp $libdef shp : shp "shp" getstat toint ; PUBLIC shp $libdef essence : essence "essence" getstat toint ; PUBLIC essence $libdef cp : cp "cp" getstat tofloat ; PUBLIC cp $libdef cpspent : cpspent "cpspent" getstat tofloat ; PUBLIC cpspent $libdef cpavail : cpavail dup cp swap cpspent - ; PUBLIC cpavail $libdef adjustcp : adjustcp var! value var! target target @ "cpspent" over over getstat value @ + setstat ; PUBLIC adjustcp $libdef gp : gp "gp" getstat tofloat ; PUBLIC gp $libdef adjustgp : adjustgp var! value var! target target @ "gp" over over getstat tofloat value @ + setstat ; PUBLIC adjustgp $libdef expenses : expenses "expenses" getstat tofloat ; PUBLIC expenses $libdef class : class "class" getstat tostr ; PUBLIC class $libdef prevclasses : prevclasses "prevclasses" getstat tostr ; PUBLIC prevclasses $libdef income : income ( d -- f ) var! target var item var value 0.0 var! total target @ "/@rp/resource/" array_get_propvals foreach value ! item ! target @ employed? if target @ { "resource/" item @ "/type" }cat getstat tostr "income" smatch if total @ value @ tofloat + total ! then then target @ { "resource/" item @ "/type" }cat getstat tostr "income" smatch not if total @ value @ tofloat + total ! then repeat total @ ; PUBLIC income $def gil gp $pubdef gil gp $def adjustgil adjustgp $pubdef adjustgil adjustgp $libdef essmax : essmax ( d -- i ) var target target ! target @ "body" getstat toint target @ "mind" getstat toint + target @ "spirit" getstat toint + ; PUBLIC essmax : nstatbar ( i i -- s ) var cur var max max ! cur ! { "[" cur @ if 1 cur @ toint 1 for pop "*" repeat then max @ if 1 max @ toint cur @ toint - 1 for pop " " repeat then "]" }cat ; : abilityhandler var! value2 var! item2 var! item var! target item @ case "break" smatch when { "|`-" item2 @ capitalize 28 l "|" value2 @ 1 l "|" { item @ "/" item2 @ "/type" }cat rpstat 12 l "|" target @ { "ability/" item @ "/" item2 @ "/focus" }cat getstat 30 l "|" }cat tellme end "sorcery" smatch when { "|`-" item2 @ capitalize 28 l "|" value2 @ 1 l "|" { item @ "/" item2 @ "/type" }cat rpstat 12 l "|" target @ { "ability/" item @ "/" item2 @ "/focus" }cat getstat 30 l "|" }cat tellme end "equip" smatch when { "|`-" item2 @ capitalize 28 l "|" value2 @ 1 l "|" { item @ "/" item2 @ "/type" }cat rpstat 12 l "|" target @ { "ability/" item @ "/" item2 @ "/focus" }cat getstat 30 l "|" }cat tellme end "dark sword" smatch when { "|`-" item2 @ capitalize 28 l "|" value2 @ 1 l "|" { item @ "/" item2 @ "/type" }cat rpstat 12 l { "| Difficulty:" { item @ "/" item2 @ "/difficulty" }cat rpstat }cat 31 l "|" }cat tellme end "sing" smatch when { "|`-" item2 @ capitalize 28 l "|" value2 @ 1 l "|" { item @ "/" item2 @ "/type" }cat rpstat 12 l { "| Difficulty:" { item @ "/" item2 @ "/difficulty" }cat rpstat " Actions:" { item @ "/" item2 @ "/actions" }cat rpstat }cat 31 l "|" }cat tellme end "craft" smatch when { "|`-" item2 @ capitalize 28 l "|" value2 @ 1 l "|" { item @ "/" item2 @ "/type" }cat rpstat 12 l "|" target @ { "ability/" item @ "/" item2 @ "/focus" }cat getstat 31 l "|" }cat tellme end "draw out" smatch when { "|`-" item2 @ capitalize 28 l "|" value2 @ 1 l "|" { item @ "/" item2 @ "/type" }cat rpstat 12 l { "| Area:" { item @ "/" item2 @ "/area" }cat rpstat " Rating:" { item @ "/" item2 @ "/actions" }cat rpstat }cat 31 l "|" }cat tellme end "magic sword" smatch when { "|`-" item2 @ capitalize 28 l "|" value2 @ 1 l "|" { item @ "/" item2 @ "/type" }cat rpstat 12 l { "| Area:" { item @ "/" item2 @ "/essence" }cat rpstat " Rating:" { item @ "/" item2 @ "/rating" }cat rpstat }cat 31 l "|" }cat tellme end "guts" smatch when { "|`-" item2 @ capitalize 28 l "|" value2 @ 1 l "|" { item @ "/" item2 @ "/type" }cat rpstat 12 l { "| Essence:" { item @ "/" item2 @ "/essence" }cat rpstat }cat 31 l "|" }cat tellme end "holy sword" smatch when { "|`-" item2 @ capitalize 28 l "|" value2 @ 1 l "|" { item @ "/" item2 @ "/type" }cat rpstat 12 l { "| Area:" { item @ "/" item2 @ "/essence" }cat rpstat " Rating:" { item @ "/" item2 @ "/rating" }cat rpstat }cat 31 l "|" }cat tellme end "talk" smatch when { "|`-" item2 @ capitalize 28 l "|" value2 @ 1 l "|" { item @ "/" item2 @ "/type" }cat rpstat 12 l "|" target @ { "ability/" item @ "/" item2 @ "/focus" }cat getstat 31 l "|" }cat tellme end "punch art" smatch when { "|`-" item2 @ capitalize 28 l "|" value2 @ 1 l "|" { item @ "/" item2 @ "/type" }cat rpstat 12 l { "| Difficulty:" { item @ "/" item2 @ "/difficulty" }cat rpstat }cat 31 l "|" }cat tellme end "dance" smatch when { "|`-" item2 @ capitalize 28 l "|" value2 @ 1 l "|" { item @ "/" item2 @ "/type" }cat rpstat 12 l { "| Actions:" { item @ "/" item2 @ "/actions" }cat rpstat " Cost:" { item @ "/" item2 @ "/cost" }cat rpstat " Difficulty:" { item @ "/" item2 @ "/difficulty" }cat rpstat }cat 31 l "|" }cat tellme end endcase ; : sheet var target var item var value var item2 var value2 var focus param @ not if me @ target ! else param @ resolve target ! then target @ int 0 < if str "Unresolvable or ambiguous reference." cat "FMLRPS" pretty tellme exit then ( Sheet header ) str target @ me @ "W" flag? if unparseobj else name then cat header tellme ( (------------------------------78 columns-----------------------------------) Class: [ ] Attr RK HP Essence: 07/09 [******* ] Body 3 06/06 [******] CP: [0000/0000] Gil: [0.00000000] Mind 3 06/06 [******] Expenses: [0.00000000] Spirit 3 06/06 [******] Previous Classes: [ ] ( ------------------------------78 columns-----------------------------------) ) { "| Class: [" target @ class 27 l "] Attr RK HP" "YELLOW" fc }cat 66 lj { "Valid: " target @ valid? if "^GREEN^Yes^NORMAL^" else "^RED^No ^NORMAL^" then }cat " |" strcat strcat tellme { { "| Essence: " target @ essence 2 r "/" target @ essmax 2 l " " target @ essence target @ essmax nstatbar }cat 38 l "GRAY" fc " " "^RED^Body " target @ body 2 r " " target @ bhp 2 r "/" target @ bmax 2 l target @ bhp 1 17 limit target @ bmax 1 17 limit nstatbar "^NORMAL^" }cat 77 l "|" strcat tellme { { "| CP: [" target @ cpavail ftostrc "/" target @ cp "] " }cat 20 l "CYAN" fc { "Gil: [" target @ gil 3 round ftostrc "] " }cat 18 l "YELLOW" fc " " "^GREEN^Mind " target @ mind 2 r " " target @ mhp 2 r "/" target @ mmax 2 l target @ mhp 1 17 limit target @ mmax 1 17 limit nstatbar "^NORMAL^" }cat 77 l "|" strcat tellme { { "| Income: [" target @ income 3 round 2 fchop "]" }cat 25 lj "GREEN" fc " " { "Job? [" target @ employed? if "^GREEN^Yes^NORMAL^] " else "^RED^No ^NORMAL^] " then }cat "^BLUE^Spirit " target @ spirit 2 r " " target @ shp 2 r "/" target @ smax 2 l target @ shp 1 17 limit target @ smax 1 17 limit nstatbar "^NORMAL^" }cat 77 l "|" strcat tellme { "| Previous Classes: [^YELLOW^" target @ prevclasses "^NORMAL^]" }cat 77 l "|" strcat tellme target @ "@rp/skill" propdir? if "Skills" header tellme "|^UNDERLINE^Skill |R|Dice|Focii ^NORMAL^|" tellme target @ "@rp/skill" array_get_propvals foreach value ! item ! { "|" item @ capitalize 20 l "|" value @ 1 l "|" value @ 1 l "d10" "|" target @ { "skill/" item @ "/focus" }cat getstat 48 l "|" }cat tellme repeat then target @ "@rp/ability" propdir? if "Abilities" header tellme "|^UNDERLINE^Ability |R|Type | ^NORMAL^|" tellme target @ "@rp/ability" array_get_propvals foreach value ! item ! { "|" item @ capitalize 30 l "|" value @ 1 l "|" { item @ "/type" }cat rpstat 12 l "|" target @ { "ability/" item @ "/focus" }cat getstat 30 l "|" }cat tellme target @ { "@rp/ability/" item @ "/" }cat array_get_propvals "focus" array_delitem focus ! focus @ array_count if focus @ foreach value2 ! item2 ! target @ item @ item2 @ value2 @ abilityhandler repeat then repeat target @ "@rp/ability" array_get_propdirs foreach dup value ! item ! pop target @ "@rp/ability/" value @ strcat getprop not if { "|" value @ capitalize 30 l "|+" "|" { item @ "/type" }cat rpstat 12 l "|" target @ { "ability/" item @ "/focus" }cat getstat 30 l "|" }cat tellme target @ { "@rp/ability/" item @ "/" }cat array_get_propvals "focus" array_delitem focus ! focus @ array_count if focus @ foreach value2 ! item2 ! target @ item @ item2 @ value2 @ abilityhandler repeat then then repeat then target @ "@rp/spell" propdir? if "Spell" header tellme "|^UNDERLINE^Spell |R|T|A|Type |Area |Target ^NORMAL^|" tellme target @ "@rp/spell" array_get_propvals foreach value ! item ! { "|" item @ capitalize 20 l "|" value @ 1 l "|" { item @ "/time" }cat rpstat 1 l "|" { item @ "/rating" }cat rpstat 1 l "|" { item @ "/type" }cat rpstat 12 l "|" { item @ "/area" }cat rpstat 12 l "|" { item @ "/target" }cat rpstat 23 l "|" }cat tellme repeat then target @ "@rp/item" propdir? if "Items" header tellme "|^UNDERLINE^Item |Q|Qty|Desc ^NORMAL^|" tellme target @ "@rp/item/" array_get_propdirs foreach item ! pop target @ { "@rp/item/" item @ "/" }cat array_get_propvals foreach value ! item2 ! { "|" item @ capitalize 20 l "|" item2 @ 1 l "|" value @ 3 l "|" { item @ "/desc" }cat "items" find-prop-in swap pop 49 l "|" }cat tellme repeat repeat then target @ "@rp/gear" propdir? if "Equipment" header tellme "|^UNDERLINE^Equipment |Qty|DV|Type |Stats ^NORMAL^|" tellme target @ "@rp/gear" array_get_propvals foreach value ! item ! { "|" item @ capitalize 20 l "|" value @ 3 l "|" { item @ "/DV" }cat "equipment" find-prop-in swap pop 2 l "|" { item @ "/type" }cat "equipment" find-prop-in swap pop 10 l "|" { { RPSYS item @ find-propdir array_get_propvals foreach value2 ! item2 ! item2 @ "{DV|type|name|cost}" smatch not if item2 @ ":" value2 @ strcat strcat then repeat } array_make " " array_join }cat 37 l "|" }cat tellme repeat then target @ "@rp/resource" propdir? if "Resources" header tellme "|^UNDERLINE^Resources |Value |Type |Debt |To | ^NORMAL^|" tellme target @ "@rp/resource" array_get_propvals foreach value ! item ! { "|" item @ capitalize 20 l "|" value @ 2 fchop 10 r "|" target @ { "resource/" item @ "/type" }cat getstat 12 l "|" target @ { "resource/" item @ "/debt" }cat getstat 10 l "|" target @ { "resource/" item @ "/to" }cat getstat dup dbref? if name else pop "" then 12 l "| |" }cat tellme repeat then "FMLRPS 2.0 sheet by Alynna" footer tellme ; : init param @ "{body|mind|spirit}" smatch not if "use +init {body|mind|spirit}" "FMLRPS" pretty tellme exit then FORCEWIZ { "@set #" me @ int "=/@rp:" }cat force FORCEWIZ { "wi " me @ " just cleared their sheet using " command @ " " param @ "." }cat force me @ "cp" 100.0 setstat "Sheet cleared, 100cp given." "FMLRPS" pretty tellme me @ "body" 2 setstat me @ "mind" 2 setstat me @ "spirit" 2 setstat me @ param @ over over getstat ++ setstat me @ "bhp" me @ bmax setstat me @ "mhp" me @ mmax setstat me @ "shp" me @ smax setstat "First time init of body, mind and spirit set to MAX." tm me @ "essence" me @ essmax setstat "First time init essence set to MAX." tm me @ "gp" 500 setstat "" param ! sheet "Giving you 500GP and sending you on your way. Choose a class next." tm ; : buyattr var value var cost param @ "{body|mind|spirit}" smatch not if { command @ " " }cat tm exit then me @ param @ getstat ++ value ! value @ 6 > if { param @ capitalize " is at max." }cat tm exit then me @ { "rank/" value @ "/attr-cost" }cat rpstat tofloat cost ! cost @ me @ cpavail > if { "Insufficient CP, you have " me @ cpavail ", you need " cost @ "." }cat tm exit then me @ param @ over over getstat ++ setstat me @ cost @ adjustcp param @ case "body" smatch when me @ "bhp" me @ bmax setstat end "mind" smatch when me @ "mhp" me @ mmax setstat end "spirit" smatch when me @ "shp" me @ smax setstat end endcase { param @ capitalize " raised to " me @ param @ getstat " for " cost @ "cp, " me @ cpavail "cp remaining." }cat tm ; : buyclass ( -- ) var item var value var tmp var cost var bonus var got-tshirt var mad-skillz RPSYS { "class/" param @ "/name" }cat getprop not if { "'" param @ capitalize "' is not a valid class." }cat tm exit then { param @ "/cost" }cat rpstat tofloat cost ! { param @ "/preferred" }cat rpstat tmp ! { param @ "/type" }cat rpstat case "standard" smatch when ( not preffered class gets cost * 2 ) 2 mad-skillz ! tmp @ "None" smatch if 1 mad-skillz ! then tmp @ not if 1 mad-skillz ! then me @ prevclasses ", " explode_array foreach swap pop stou tmp @ smatch_array stou smatch if 1 mad-skillz ! then repeat me @ class stou tmp @ smatch_array stou smatch if 1 mad-skillz ! then cost @ mad-skillz @ * cost ! end ( Reduced cost per preferred class ) "Mixed" smatch when { param @ "/bonus" }cat rpstat tofloat bonus ! me @ prevclasses ", " explode_array foreach swap pop stou tmp @ smatch_array stou smatch if cost @ bonus @ + cost ! then repeat me @ class stou tmp @ smatch_array stou smatch if cost @ bonus @ + cost ! then end ( Requires preferred class ) "Special" smatch when inf cost ! me @ prevclasses ", " explode_array foreach swap pop stou tmp @ smatch_array stou smatch if { param @ "/cost" }cat rpstat tofloat cost ! then repeat me @ class stou tmp @ smatch_array stou smatch if { param @ "/cost" }cat rpstat tofloat cost ! then cost @ inf = if "You do not have one of the required classes." tm exit then end endcase cost @ me @ cpavail > if { "Insufficient CP, you have " me @ cpavail ", you need " cost @ "." }cat tm exit then me @ param @ over over getstat ++ setstat me @ cost @ adjustcp { param @ capitalize " class bought, for " cost @ "cp, " me @ cpavail "cp remaining." }cat tm ( preffered class doesnt get skills again ) 0 got-tshirt ! param @ me @ prevclasses smatch_array smatch if 1 got-tshirt ! then ( Hand out abilities ) got-tshirt @ not if { param @ "/abilities" }cat rpstat ", " explode_array foreach item ! pop me @ { "ability/" item @ }cat over over getstat ++ 1 6 limit setstat { "Ability (" item @ ") was increased to " me @ { "ability/" item @ }cat getstat }cat tm repeat then me @ "resource/" param @ strcat over over getstat { param @ "/income" }cat rpstat tofloat + setstat me @ { "resource/" param @ "/type" }cat "Income" setstat { "Your resources rose by " { param @ "/income" }cat rpstat "." }cat tm me @ "class" getstat if me @ "prevclasses" getstat dup if ", " strcat else pop "" then me @ "class" getstat strcat me @ "prevclasses" rot setstat then me @ "class" param @ capitalize setstat ; $libdef abilitycost : abilitycost ( d s -- f ) var! ability var! target var cost var tshirt var tmp RPSYS { "ability/" ability @ "/name" }cat getprop not if 0.0 exit then 5 cost ! { ability @ "/cost" }cat rpstat tofloat dup if cost ! else pop then "trained" tshirt ! target @ prevclasses ", " explode_array foreach tmp ! pop ability @ stou { tmp @ "/abilities" }cat rpstat tostr smatch_array stou smatch if "outclass" tshirt ! then repeat ability @ stou { target @ class "/abilities" }cat rpstat tostr smatch_array stou smatch if "inclass" tshirt ! then tshirt @ case "inclass" smatch when cost @ 1 * cost ! end "outclass" smatch when cost @ 2 * cost ! end "trained" smatch when cost @ 3 * cost ! end endcase cost @ ; PUBLIC abilitycost $libdef abilityaccost : abilityaccost ( d s -- s ) var! ability var! target var cost var tshirt var tmp RPSYS { "ability/" ability @ "/name" }cat getprop not if "Not an ability" exit then "trained" tshirt ! target @ prevclasses ", " explode_array foreach tmp ! pop ability @ stou { tmp @ "/abilities" }cat rpstat tostr smatch_array stou smatch if "outclass" tshirt ! then repeat ability @ stou { target @ class "/abilities" }cat rpstat tostr smatch_array stou smatch if "inclass" tshirt ! then tshirt @ case "inclass" smatch when "in your class (x1)" end "outclass" smatch when "out of your class (x2)" end "trained" smatch when "trained (x3)" end endcase ; PUBLIC abilityaccost : buyability var item var value var tmp var cost var got-tshirt RPSYS { "ability/" param @ "/name" }cat getprop not if { "'" param @ capitalize "' is not a valid ability." }cat tm exit then me @ param @ abilitycost cost ! cost @ me @ cpavail > if { "Insufficient CP, you have " me @ cpavail ", you need " cost @ "." }cat tm exit then me @ { "ability/" param @ }cat getstat toint 6 >= if { "Your ability (" param @ capitalize ") is already at MAX." }cat tm exit then me @ { "ability/" param @ }cat over over getstat ++ 1 6 limit setstat me @ cost @ adjustcp { param @ capitalize " raised to " me @ "ability/" param @ strcat getstat " for " cost @ "cp, " me @ cpavail "cp remaining." " Ability was " me @ param @ abilityaccost "." }cat tm ; $libdef spellcost : spellcost ( d s -- f ) var! ability var! target var cost var tshirt var tmp RPSYS { "spell/" ability @ "/name" }cat getprop not if 0.0 exit then 5 cost ! { ability @ "/cost" }cat rpstat tofloat dup if cost ! else pop then "trained" tshirt ! target @ prevclasses ", " explode_array foreach tmp ! pop { "sorcery/" { ability @ "/type" }cat rpstat }cat stou { tmp @ "/abilities" }cat rpstat tostr smatch_array stou smatch if "outclass" tshirt ! then repeat { "sorcery/" { ability @ "/type" }cat rpstat }cat stou { target @ class "/abilities" }cat rpstat tostr smatch_array stou smatch if "inclass" tshirt ! then tshirt @ case "inclass" smatch when cost @ 1 * cost ! end "outclass" smatch when cost @ 2 * cost ! end "trained" smatch when cost @ 3 * cost ! end endcase cost @ ; PUBLIC spellcost $libdef spellaccost : spellaccost ( d s -- s ) var! ability var! target var cost var tshirt var tmp RPSYS { "spell/" ability @ "/name" }cat getprop not if "Not an ability" exit then "trained" tshirt ! target @ prevclasses ", " explode_array foreach tmp ! pop { "sorcery/" { ability @ "/type" }cat rpstat }cat stou { tmp @ "/abilities" }cat rpstat tostr smatch_array stou smatch if "outclass" tshirt ! then repeat { "sorcery/" { ability @ "/type" }cat rpstat }cat stou { target @ class "/abilities" }cat rpstat tostr smatch_array stou smatch if "inclass" tshirt ! then tshirt @ case "inclass" smatch when "in your class (x1)" end "outclass" smatch when "out of your class (x2)" end "trained" smatch when "trained (x3)" end endcase ; PUBLIC spellaccost : buyspell var item var value var tmp var cost var got-tshirt var srcrating var dstrating var type RPSYS { "spell/" param @ "/name" }cat getprop not if { "'" param @ capitalize "' is not a valid spell." }cat tm exit then me @ param @ spellcost cost ! cost @ me @ cpavail > if { "Insufficient CP, you have " me @ cpavail ", you need " cost @ "." }cat tm exit then me @ { "spell/" param @ }cat getstat toint 6 >= if { "Your spell (" param @ capitalize ") is already at MAX." }cat tm exit then { param @ "/type" }cat rpstat 1 dbg type ! { param @ "/rating" }cat rpstat toint 1 dbg srcrating ! me @ { "ability/sorcery/" type @ }cat getstat toint 1 dbg dstrating ! srcrating @ dstrating @ > if { "Insufficient ranks in sorcery type " type @ ", you have " dstrating @ ", you need " srcrating @ "." }cat tm exit then me @ { "spell/" param @ }cat over over getstat ++ 1 6 limit setstat me @ cost @ adjustcp { param @ capitalize " raised to " me @ "spell/" param @ strcat getstat " for " cost @ "cp, " me @ cpavail "cp remaining." " Spell was " me @ param @ spellaccost "." }cat tm ; : freeskill me @ valid? if "No freebie adjusting while validated." tm exit then param @ "=" split toint var! amount var! skill 0 var! cnt1 0 var! cnt2 var tgt RPSYS { "skill/" skill @ "/name" }cat getprop not if { "'" skill @ capitalize "' is not a valid skill." }cat tm exit then me @ "/@rp/skill/" array_get_propdirs foreach tgt ! pop me @ { "skill/" tgt @ "/freebie" }cat getstat toint case 1 = when cnt1 ++ end 2 = when cnt2 ++ end endcase repeat amount @ 0 2 limit amount ! amount @ 1 = cnt1 @ 3 = and amount @ 2 = cnt2 @ 3 = and or if { "You already have 3 skills amounting to " amount @ "." }cat tm exit then me @ { "skill/" skill @ }cat getstat toint me @ { "skill/" skill @ "/freebie" }cat getstat toint = not if { "You cant alter this stat after you spend CP into it." }cat tm exit then me @ { "skill/" skill @ }cat amount @ setstat me @ { "skill/" skill @ "/freebie" }cat amount @ setstat { "You added " amount @ " to " skill @ " with your freebies." }cat tm 0 cnt1 ! 0 cnt2 ! me @ "/@rp/skill/" array_get_propdirs foreach tgt ! pop me @ { "skill/" tgt @ "/freebie" }cat getstat toint case 1 = when cnt1 ++ end 2 = when cnt2 ++ end endcase repeat { 3 cnt1 @ - " 1pt skills and " 3 cnt2 @ - " 2pt skills are left." }cat tm ; : buyskill param @ var! skill var subskill var cost var focii var cur RPSYS { "skill/" skill @ "/" rsplit pop "/name" }cat getprop not if { "'" skill @ capitalize "' is not a valid skill." }cat tm exit then me @ { "skill/" skill @ }cat getstat toint cur ! cur @ 6 >= if { "Your skill (" param @ capitalize ") is already at MAX." }cat tm exit then me @ { "rank/" cur @ ++ "/skill-cost" }cat rpstat tofloat cost ! skill @ "/" instr if skill @ "/" split subskill ! skill ! me @ { "skill/" skill @ "/focus" }cat getstat tostr dup "0" smatch if pop "" then focii ! focii @ if subskill @ stou focii @ smatch_array stou smatch if { "You already have (" subskill @ ") as a subskill of (" skill @ ")." }cat tm exit then 10 cost ! me @ { "skill/" skill @ "/focus" }cat over over getstat ", " subskill @ capitalize strcat strcat setstat me @ cost @ adjustcp { "'" param @ capitalize "' subskill added for " cost @ "cp, " me @ cpavail "cp remaining." }cat tm else 0 cost ! me @ { "skill/" skill @ "/focus" }cat subskill @ capitalize setstat me @ cost @ adjustcp { "'" param @ capitalize "' subskill added for " cost @ "cp, " me @ cpavail "cp remaining." }cat tm then else me @ { "skill/" skill @ }cat over over getstat ++ setstat me @ cost @ adjustcp { "'" param @ capitalize "' skill raised to " me @ { "skill/" skill @ }cat getstat " for " cost @ "cp, " me @ cpavail "cp remaining." }cat tm then ; : buyequip me @ valid? if "You're validated. Go find an IC store." tm exit then param @ not if "+buyequip " tm exit then param @ var! equip var cost var fullequip var realname { equip @ "/cost" }cat "equipment" find-prop-in tofloat cost ! "" "/cost" subst fullequip ! fullequip @ not if { "I dont have any '" equip @ capitalize "' in stock." }cat tm exit then cost @ me @ gp > if { "Put that down! You don't have enough GP! (Required: " cost @ ")" }cat tm exit then RPSYS { fullequip @ "/name" }cat getprop realname ! me @ { "gear/" realname @ }cat over over getstat ++ setstat me @ cost @ neg adjustgp { "The store owner takes your " cost @ "gp and gives you your " realname @ "." }cat tm ; : buyitem me @ valid? if "You're validated. Go find an IC store." tm exit then param @ not if "+buyitem =" tm exit then param @ "=" split toint 1 6 limit var! quality var! equip var cost var fullequip var realname { equip @ "/name" }cat "items" find-prop-in tofloat cost ! "" "/name" subst fullequip ! fullequip @ not if { "I dont have any '" equip @ capitalize "' in stock." }cat tm exit then ( ((10-Difficulty)+Required)*5*Rank of Item) 10 RPSYS { fullequip @ "/difficulty" }cat getprop toint - RPSYS { fullequip @ "/required" }cat getprop toint + 5 * quality @ * cost ! cost @ me @ gp > if { "Put that down! You don't have enough GP! (Required: " cost @ ")" }cat tm exit then RPSYS { fullequip @ "/name" }cat getprop realname ! me @ { "item/" realname @ "/" quality @ }cat over over getstat ++ setstat me @ cost @ neg adjustgp { "The store owner takes your " cost @ "gp and gives you your " realname @ " " quality @ "." }cat tm ; : prove var result var result-prop me @ param @ find-stat result ! result-prop ! result @ if { me @ " has a stat ^YELLOW^" result-prop @ "^NORMAL^ with a value of ^GREEN^" result @ "^NORMAL^." }cat th else { me @ " does ^RED^not^NORMAL^ have a stat called " param @ }cat th then ; : roll var value var item var ndie var stats var curstat var fullstat var statval var curdie var curtot var grandt var modifier 0 ndie ! 0 modifier ! param @ not if { command @ " ++..." }cat tm exit then param @ "+" explode_array stats ! stats @ foreach curstat ! pop me @ curstat @ find-stat swap pop ndie @ + ndie ! repeat ndie @ 1 12 limit ndie ! stats @ foreach curstat ! pop curstat @ toint if curstat @ toint modifier @ + modifier ! then repeat { me @ " rolls " { stats @ foreach curstat ! pop me @ curstat @ find-stat swap pop statval ! { "^YELLOW^" curstat @ "^NORMAL^(^GREEN^" statval @ "^NORMAL^)" }cat repeat }array "+" array_join " = " ndie @ "d10 = " ndie @ nd10 curtot ! curdie ! "(^CYAN^" curdie @ " " array_join "^NORMAL^) = ^GREEN^" curtot @ "^NORMAL^" modifier @ if " + " modifier @ " = ^PURPLE^" modifier @ curtot @ + "^NORMAL^" then }cat th ; : gp-give param @ "=" split tofloat var! amount resolve var! target param @ not if "+gp/give =" tm exit then target @ toint 0 < if "Invalid or insoulable reference." tm exit then amount @ 0.0 <= if "You must specify a positive amount of gil." tm exit then amount @ 0.0 me @ gp limit amount ! target @ amount @ adjustgp me @ 0 amount @ - adjustgp { me @ " just gave ^GREEN^" amount @ "^YELLOW^gp^NORMAL^ to " target @ }cat th ; : gp-spend param @ tofloat var! amount param @ not if "+gp/spend " tm exit then amount @ 0.0 <= if "You must specify a positive amount of gil." tm exit then amount @ 0.0 me @ gp limit amount ! me @ 0.0 amount @ - adjustgp { me @ " just spent ^RED^" amount @ "^YELLOW^gp^NORMAL^ (Expended)" }cat th ; : gear-give param @ not if "+gear/give =" tm exit then param @ "=" split var! gear resolve var! target target @ toint 0 < if "Invalid or insoulable reference." tm exit then me @ { "gear/" gear @ }cat getstat not if "You dont have any of that to give." tm exit then me @ { "gear/" gear @ }cat over over getstat -- setstat target @ { "gear/" gear @ }cat over over getstat ++ setstat { me @ " just gave ^GREEN^" gear @ capitalize "^NORMAL^ to ^YELLOW^" target @ "^NORMAL^." }cat th ; : gear-spend param @ not if "+gear/spend " tm exit then param @ var! gear me @ { "gear/" gear @ }cat getstat not if "You dont have any of that to spend." tm exit then me @ { "gear/" gear @ }cat over over getstat -- setstat { me @ " just used one of their ^GREEN^" gear @ capitalize "^NORMAL^." }cat th ; : item-give param @ not if "+give =" tm exit then param @ "=" split var! gear resolve var! target target @ toint 0 < if "Invalid or insoulable reference." tm exit then me @ { "item/" gear @ }cat getstat not if "You dont have any of that to give." tm exit then me @ { "item/" gear @ }cat over over getstat -- setstat target @ { "item/" gear @ }cat over over getstat ++ setstat { me @ " just gave ^GREEN^" gear @ capitalize "^NORMAL^ to ^YELLOW^" target @ "^NORMAL^." }cat th ; : item-spend param @ not if "+use " tm exit then param @ var! gear me @ { "item/" gear @ }cat getstat not if "You dont have any of that to spend." tm exit then me @ { "item/" gear @ }cat over over getstat -- setstat { me @ " just used one of their ^GREEN^" gear @ capitalize "^NORMAL^." }cat th ; : vote var target param @ not if "+vote " tm exit then param @ resolve target ! target @ int 0 < if "You already voted for them since their last refresh." tm exit then target @ me @ dbcmp if "*SLAP* Don't vote for yourself!" tm exit then target @ "@rp/vote/by" me @ reflist_find if "You already voted for them since their last refresh." tm exit then me @ "@rp/vote/for" target @ reflist_add target @ "@rp/vote/by" me @ reflist_add target @ { "^YELLOW^" me @ "^NORMAL^ just voted for you." }cat "FMLRPS" pretty ansi_notify me @ { "You just voted for ^YELLOW^" target @ "^NORMAL^." }cat "FMLRPS" pretty ansi_notify ; : vote-all var target me @ location contents_array foreach target ! pop target @ "~status" getpropstr "OOC" smatch not if target @ me @ dbcmp not if target @ "@rp/vote/by" me @ reflist_find not if target @ name param ! vote then then then repeat ; : status param @ not if "me" param ! then param @ resolve var! target target @ toint 0 < if "Invalid or insoulable reference." tm exit then { "Status of " me @ }cat header tellme { "| Class: [" target @ class 27 l "] Attr RK HP" "YELLOW" fc }cat 66 lj { "Valid: " target @ valid? if "^GREEN^Yes^NORMAL^" else "^RED^No ^NORMAL^" then }cat " |" strcat strcat tellme { { "| Essence: " target @ essence 2 r "/" target @ essmax 2 l " " target @ essence target @ essmax nstatbar }cat 38 l "GRAY" fc " " "^RED^Body " target @ body 2 r " " target @ bhp 2 r "/" target @ bmax 2 l target @ bhp 1 17 limit target @ bmax 1 17 limit nstatbar "^NORMAL^" }cat 77 l "|" strcat tellme { { "| CP: [" target @ cpavail ftostrc "/" target @ cp "] " }cat 20 l "CYAN" fc { "Gil: [" target @ gil 3 round ftostrc "] " }cat 18 l "YELLOW" fc " " "^GREEN^Mind " target @ mind 2 r " " target @ mhp 2 r "/" target @ mmax 2 l target @ mhp 1 17 limit target @ mmax 1 17 limit statbar "^NORMAL^" }cat 77 l "|" strcat tellme { { "| Income: [" target @ income 2 fchop "]" }cat 25 lj "GREEN" fc " " { "Job? [" target @ employed? if "^GREEN^Yes^NORMAL^] " else "^RED^No ^NORMAL^] " then }cat "^BLUE^Spirit " target @ spirit 2 r " " target @ shp 2 r "/" target @ smax 2 l target @ shp 1 17 limit target @ smax 1 17 limit nstatbar "^NORMAL^" }cat 77 l "|" strcat tellme { "| Previous Classes: [^YELLOW^" target @ prevclasses "^NORMAL^]" }cat 77 l "|" strcat tellme { "Last validated on [" target @ "valid/at" getstat "%X %x" swap timefmt "] by " target @ "valid/by" getstat }cat wrap74 atellme { "Last invalidated on [" target @ "valid/!at" getstat "%X %x" swap timefmt "] by " target @ "valid/!by" getstat }cat wrap74 atellme { "People who voted for you: " target @ "@rp/vote/by" array_get_reflist foreach swap pop "; " repeat }cat wrap74 atellme { "People who you voted for: " target @ "@rp/vote/for" array_get_reflist foreach swap pop "; " repeat }cat wrap74 atellme "FMLRPS Status by Alynna" footer tellme ; : validation me @ "W" flag? not if { "^RED^" "noperm_mesg" sysparm "^NORMAL^" }cat tellme exit then param @ resolve var! target target @ toint 0 < if "Invalid or insoulable reference." tm exit then command @ "+validate" smatch if target @ "valid" "Yes" setstat target @ "valid/at" systime setstat target @ "valid/by" me @ setstat target @ { me @ " has ^GREEN^validated^NORMAL^ your sheet. You may now go IC." }cat "FMLRPS" pretty ansi_notify me @ { "You have ^GREEN^validated^NORMAL^ " target @ "'s sheet." }cat "FMLRPS" pretty ansi_notify FORCEWIZ { "wc " me @ " has ^GREEN^validated^NORMAL^ " target @ "'s sheet." }cat force then command @ "+invalidate" smatch if target @ "valid" "No" setstat target @ "valid/!at" systime setstat target @ "valid/!by" me @ setstat target @ { me @ " has ^RED^invalidated^NORMAL^ your sheet. You may NOT go IC." }cat "FMLRPS" pretty ansi_notify me @ { "You have ^RED^invalidated^NORMAL^ " target @ "'s sheet." }cat "FMLRPS" pretty ansi_notify FORCEWIZ { "wc " me @ " has ^RED^invalidated^NORMAL^ " target @ "'s sheet." }cat force then ; : sysheart-reset var target me @ #7 dbcmp not if { "^RED^Permission DAMN DENIED!!!^NORMAL^" }cat tellme exit then #-1 "*" "P" find_array foreach target ! pop target @ "@rp/heart/dotbeats" 0 setprop target @ "@rp/heart/refreshes" 0 setprop target @ "@rp/heart/weekly" 0 setprop target @ "@rp/heart/monthly" 0 setprop target @ "@rp/heart/yearly" 0 setprop repeat FORCEWIZ { "@wall ![!] Danger Will Robinson! " me @ " has issued the +sysheart/reset command with proper permissions and TIME is being reset. Aging data for all characters has been deleted. I hope there was a good reason for this. --Alynna" }cat force ; : sysheart var target var dotbeats var votes var resource command @ "*sysheart*" smatch if me @ mlevel 8 >= not if { "^RED^" "noperm_mesg" sysparm "^NORMAL^" }cat tellme exit then then ( vote processing ) ( A person gets 5 CP per Month. At the beginning of the month. ) ( A person gets 2 CP per week. At the beginning of the week. ) ( A person gets 1 CP per 24 hours logged in. If they were voted for. For every 5 votes they have, they get +5 CP ) ( A person can only vote for someone once per 24 hour 'refresh' ) online_array foreach target ! pop me @ player? not if target @ "heart/dotbeats" over over getstat ++ dup dotbeats ! setstat then ( Essence regen ) target @ essence target @ essmax < if target @ "essence" over over getstat toint target @ spirit + 1 target @ essmax limit setstat target @ { "You've got essence! (" target @ spirit " regained)" }cat "FMLRPS" pretty ansi_notify then target @ essence target @ essmax > if target @ "essence" over over getstat toint 1 target @ essmax limit setstat then ( BHP, MHP, SHP regen ) systime target @ "heart/daily" getstat 86400 * < if target @ bhp target @ bmax < if target @ "bhp" over over getstat toint target @ body 1 target @ bmax setstat target @ { "You've got body! (" target @ body " regained)" }cat "FMLRPS" pretty ansi_notify then target @ mhp target @ mmax < if target @ "mhp" over over getstat toint target @ mind 1 target @ mmax setstat target @ { "You've got mind! (" target @ mind " regained)" }cat "FMLRPS" pretty ansi_notify then target @ shp target @ smax < if target @ "shp" over over getstat toint target @ spirit 1 target @ smax setstat target @ { "You've got spirit! (" target @ spirit " regained)" }cat "FMLRPS" pretty ansi_notify then target @ "heart/daily" systime setstat then dotbeats @ target @ "heart/refreshes" getstat 24 * > me @ player? or if me @ player? if target @ { "FMLRPS ... Begin 24 hour refresh cycle, forced by " me @ }cat header ansi_notify else target @ "FMLRPS ... Begin 24 hour refresh cycle" header ansi_notify then ( Votes ) target @ "@rp/vote/by" array_get_reflist array_count votes ! votes @ if target @ "cp" over over getstat votes @ 5 / toint 5 * 1 + + setstat target @ { "You get " votes @ 5 / toint 5 * 1 + "cp from refresh and votes." }cat ansi_notify target @ "vote/for" 0 setstat target @ "vote/by" 0 setstat else target @ "vote/for" 0 setstat target @ "vote/by" 0 setstat target @ { "No votes since last refresh, 0cp earned." }cat ansi_notify then ( Other time GP ) systime target @ "heart/weekly" getstat 86400 7 * < if target @ { "You get 2 cp from weekly refresh." }cat ansi_notify target @ "cp" over over getstat 2 + setstat target @ "heart/weekly" systime setstat then systime target @ "heart/monthly" getstat 86400 30 * < if target @ { "You get 5 cp from monthly refresh." }cat ansi_notify target @ "cp" over over getstat 5 + setstat target @ "heart/monthly" systime setstat then systime target @ "heart/yearly" getstat 86400 365 * < if target @ { "Happy birthday!" }cat ansi_notify target @ "cp" over over getstat 10 + setstat target @ "heart/yearly" systime setstat then ( Resources ) target @ income tofloat resource ! resource @ if resource @ 0.0 > if target @ { "You earn " resource @ 2 fchop "gp from your resources." }cat ansi_notify target @ resource @ adjustgp else target @ { "You lose " resource @ fabs 2 fchop "gp from your resources." }cat ansi_notify target @ resource @ adjustgp then then ( Increment refreshes ) me @ player? not if target @ "heart/refreshes" over over getstat ++ setstat then target @ "End FMLRPS refresh cycle" footer ansi_notify then repeat ; : adjuster var stat var max param @ toint var! amount param @ not if { command @ " - positive values reduce amounts, negative values increase them." }cat tm exit then command @ case "+bhp" smatch when "bhp" stat ! me @ bmax max ! end "+mhp" smatch when "mhp" stat ! me @ mmax max ! end "+shp" smatch when "shp" stat ! me @ smax max ! end "+ess" smatch when "essence" stat ! me @ essmax max ! end endcase me @ stat @ over over getstat 0 amount @ - + 0 max @ limit setstat { me @ " expends " amount @ " " stat @ "." }cat th ; : main param ! param @ mufcron? if sysheart exit then command @ tolower case "{.type|.name|.desc|.set}" smatch when entry end "*rpinfo" smatch when rpinfo exit end "{+ability|+equipment|+items|+class|+skill|+spell}" smatch when rpinfo end "*sheet" smatch when sheet exit end "*init" smatch when init exit end "*buyattr" smatch when buyattr exit end "*buyclass" smatch when buyclass exit end "*buyability" smatch when buyability exit end "*buyspell" smatch when buyspell exit end "*buyequip" smatch when buyequip exit end "*buyitem" smatch when buyitem exit end "*freeskill" smatch when freeskill exit end "*buyskill" smatch when buyskill exit end "*prove" smatch when prove exit end "*gp/give" smatch when gp-give exit end "*gp/spend" smatch when gp-spend exit end "*gear/give" smatch when gear-give exit end "*gear/spend" smatch when gear-spend exit end "*give" smatch when item-give exit end "*use" smatch when item-spend exit end "*vote/all" smatch when vote-all exit end "*vote" smatch when vote exit end "*status" smatch when status exit end "*roll" smatch when roll exit end "{+bhp|+mhp|+shp|+ess}" smatch when adjuster exit end "{+validate|+invalidate}" smatch when validation exit end "{+sysheart}" smatch when sysheart exit end "{+sysheart/reset}" smatch when sysheart-reset exit end endcase ; . c q @name sheet=sheet;+sheet;.type;.name;.desc;.set;+rpinfo;+init;+buyattr;+buyclass;+buyability;+buyspell;+freeskill;+buyskill;+buyequip;+buyitem;+prove;+gp/give;+gp/spend;+vote;+vote/all;+status;+validate;+invalidate;+roll;+bhp;+mhp;+shp;+ess;+sysheart;+sysheart/reset;+gear/give;+gear/spend;+give;+use;+ability;+equipment;+items;+class;+skill;+spell