$include $lib/rp $include $lib/alynna $def AVATAR "*Furryfaire" match lvar param lvar cmode lvar mainmenu lvar dependencies $def }yerf }cat "FFa2.Chargen" pretty tellme $def }oyerf }cat "FFa2.Chargen" pretty tellhere $def LINE "------------------------------------------------------------------------------" tellme $def CHAR_SHEETLOCKED -1 $def CHAR_NEWBIE 0 $def CHAR_IN_CHARGEN 4 $def CHAR_IN_CHARGEN_PC 8 $def CHAR_WAITING_APPROVAL 16 $def CHAR_APPROVED 256 $def yip me @ swap getstatstr dup not if pop "^RED^Not set^NORMAL^" then $define FASTCOLOR "^CYAN^(^GREEN^" "(" subst "^CYAN^)^YELLOW^" ")" subst "^PURPLE^: ^GREEN^" ": " subst $enddef $def READ_SHOOTS_BLANKS READ_WANTS_BLANKS $def PARANOIA prog "?" flag? : qmorph[ arr:input -- arr:output ] { input @ foreach swap pop "^YELLOW^" swap strcat "^CYAN^[^GREEN^" "[" subst "^CYAN^]^YELLOW^" "]" subst repeat }array ; : }bonus.old ( d:target { stilted array -- ) "Bonus" }rpinfo dup not if pop 0 exit then mklist var! x var! target x @ foreach swap pop " " split 1 strcut atoi var! value var! op var! stat op @ case "+" instr when target @ "@/" stat @ strcat over over getraw value @ + setstat end "-" instr when target @ "@/" stat @ strcat over over getraw value @ - setstat end "*" instr when target @ "m/" stat @ strcat over over getraw value @ * setstat end "/" instr when target @ "m/" stat @ strcat over over getraw value @ / setstat end endcase target @ { "^GREEN^Bonus added to " stat @ capitalize " " op @ " " value @ " to " target @ "@/" stat @ strcat getraw "." }cat ansi_notify repeat ; : }-bonus.old ( d:target { stilted array -- ) "Bonus" }rpinfo dup not if pop 0 exit then mklist var! x var! target x @ foreach swap pop " " split 1 strcut atoi var! value var! op var! stat op @ case "+" instr when target @ "@/" stat @ strcat over over getraw value @ - setstat end "-" instr when target @ "@/" stat @ strcat over over getraw value @ + setstat end "*" instr when target @ "m/" stat @ strcat over over getraw value @ / setstat end "/" instr when target @ "m/" stat @ strcat over over getraw value @ * setstat end endcase target @ { "^RED^Bonus removed from " stat @ capitalize " " op @ " " value @ " to " target @ "@/" stat @ getraw "." }cat ansi_notify repeat ; ( Obsolete, use }fn+ and }fn- methods ) : }bonus }array pop pop ; SAFECALL }bonus $libdef }bonus : }-bonus }array pop pop ; SAFECALL }-bonus $libdef }-bonus : }fn+ ( d:target { ... ) }array "/" array_join var! x var! target { x @ "/@@" }rpinfo var! static { x @ "/@!" }rpinfo var! dynamic static @ if static @ ", " explode_array foreach var! y pop y @ ":" split var! muf var! prop1 target @ "@/" prop1 @ strcat over over getraw muf @ tofloat + setstat repeat then dynamic @ if dynamic @ ", " explode_array foreach var! y pop y @ ":" split var! muf var! prop1 target @ "!/" prop1 @ strcat over over getraw dup if { swap " " muf @ }cat else pop muf @ then setstat repeat then ; : }fn- ( d:target { ... ) }array "/" array_join var! x var! target { x @ "/@@" }rpinfo var! static { x @ "/@!" }rpinfo var! dynamic static @ if static @ ", " explode_array foreach var! y pop y @ ":" split var! muf var! prop1 target @ "@/" prop1 @ strcat over over getraw muf @ tofloat - setstat repeat then dynamic @ if dynamic @ ", " explode_array foreach var! y pop y @ ":" split var! muf var! prop1 target @ "!/" prop1 @ strcat over over getraw dup if "" muf @ subst strip else pop "" then setstat repeat then ; : cgstage var curdp me @ "step" getstat not if me @ "step" "1" setstat then cmode @ case CHAR_SHEETLOCKED = when { "Your sheet has been locked. You cannot edit any of your stats." }yerf exit end CHAR_NEWBIE = when { "New character detected." }yerf me @ "@/+dp" getprop if me @ "@/+dp" getprop curdp ! me @ "dp" curdp @ setstat else me @ "dp" getstat dup curdp ! not if me @ "dp" { "System" "Chargen" "Start.DP" }rpinfo atoi dup curdp ! setstat then then { "Starting you with " curdp @ " Discretionary Points. " }yerf me @ "character_mode" CHAR_IN_CHARGEN setstat me @ "start_chargen" systime setstat CHAR_IN_CHARGEN cmode ! end CHAR_IN_CHARGEN = when { "Continuing where you left off in chargen." }yerf end CHAR_WAITING_APPROVAL = when { "Your character is awaiting approval. You cannot change anything on your sheet at this time." }yerf end CHAR_APPROVED = when { "Access granted for approved PC. Entering DP spending mode." }yerf end default pop { "What the heck? You have unknown character mode " cmode @ "! Call " prog owner "." }yerf exit end endcase ; ( ****************************** Attribute handlers **************************************** ) : cg.attrs READ_SHOOTS_BLANKS 0 var! mutex { 3 2 1 1 }array var! attrvals "Attributes" header tellme { "^RED^" { "Physical: " me @ mphysical }cat 19 lj "^GREEN^" { "Mental: " me @ mmental }cat 19 lj "^CYAN^" { "Spiritual: " me @ mspiritual }cat 19 lj "^YELLOW^" { "Social: " me @ msocial }cat 19 lj }tell { "You can now choose 4 attributes at 3, 2, 1 and 1, depending on your choice." }tell { "Please enter PHY, MEN, SPI and SOC below in the order you want." }tell { "For example, 'SPI MEN SOC PHY' will give you: " }tell { " 3 in Spiritual, 2 in Mental, 1 in Social, and 1 in Physical." }tell { "You may also enter ^RED^0^ ^ to clear your attributes, or ^RED^Q^ ^ to leave without changes. " }tell LINE { "What's your choice:" }tell begin read var! murr murr @ case "0" smatch when me @ "m/Physical" 0 setstat me @ "m/Mental" 0 setstat me @ "m/Spiritual" 0 setstat me @ "m/Social" 0 setstat { "Your attributes were cleared." }yerf 1 Mutex ! end "Q*" smatch when 1 Mutex ! end default pop 1 mutex ! murr @ " " explode_array var! tmp tmp @ array_count 4 = not if { "You need to specify all four stats at once in order." }yerf else 0 3 1 for var! tmp2 tmp @ tmp2 @ [] case "PHY" smatch when me @ "m/Physical" attrvals @ tmp2 @ [] setstat { "^RED^" "Your Physical attribute was set to " attrvals @ tmp2 @ [] "." }yerf end "MEN" smatch when me @ "m/Mental" attrvals @ tmp2 @ [] setstat { "^GREEN^" "Your Mental attribute was set to " attrvals @ tmp2 @ [] "." }yerf end "SPI" smatch when me @ "m/Spiritual" attrvals @ tmp2 @ [] setstat { "^CYAN^" "Your Spiritual attribute was set to " attrvals @ tmp2 @ [] "." }yerf end "SOC" smatch when me @ "m/Social" attrvals @ tmp2 @ [] setstat { "^YELLOW^" "Your Social attribute was set to " attrvals @ tmp2 @ [] "." }yerf end default pop { "I couldn't understand what you wanted to set! Try again. [" tmp @ tmp2 @ [] "]" }yerf 0 mutex ! end endcase repeat then end endcase mutex @ until me @ "Physical" resetstat me @ "Mental" resetstat me @ "Spiritual" resetstat me @ "Social" resetstat READ_SHOOTS_BLANKS ; SAFECALL cg.attrs : cg.finish READ_SHOOTS_BLANKS me @ "@/aup" getprop not if { "^RED^You must agree to the AUP before submitting a sheet. Leave chargen, and enter '@aup'." }tell exit then { "^YELLOW^Once you select this option, you will not be able to do anything else with your sheet until it is approved!" }yerf { "Are you ready to submit your character? (y/N)" }yerf read "y*" smatch if me @ "character_mode" CHAR_WAITING_APPROVAL setstat me @ "waiting_since" systime setstat CHAR_WAITING_APPROVAL cmode ! AVATAR { "+bbpost 9/" me @ " (" "%x %X" systime timefmt ")=" me @ " submitted their character for approval at " "%C %X" systime timefmt "." }cat force { "^GREEN^Your sheet has just been submitted for approval by the wizards." }yerf else { "Aborted." }yerf then READ_SHOOTS_BLANKS ; SAFECALL cg.finish : cg.skills READ_SHOOTS_BLANKS 0 var! mutex { 3 2 2 1 1 }array var! skillvals "Skills" enumType var! skills "Skills" header tellme { skills @ foreach var! value var! item { "[" item @ ++ tostr 2 rj "] " value @ }cat repeat }array 4 wrap_items_fixed qmorph atellme LINE { "You can now choose 5 skills at 3, 2, 2, 1 and 1, depending on your choice." }tell { "Please enter the numbers of the skills below in the order you want." }tell { "Example: 1 7 2 13 4 " }tell { "Note, do NOT choose languages here, as this menu won't let you choose WHICH language." }tell { "To buy additional languages, switch chargen into PC mode with . then re-enter this menu." }tell { "You may also enter ^RED^0^ ^ to clear your skills, or ^RED^Q^ ^ to leave without changes. " }tell LINE { "What's your choice:" }tell begin read var! murr murr @ case "0" smatch when me @ "/@rp/s/" remove_prop { "Your skillz were cleared." }yerf 1 Mutex ! end "Q*" smatch when 1 Mutex ! end default pop murr @ " " explode_array var! tmp tmp @ array_count 5 = not if { "^RED^You need to specify 5 different skills. Try again." }yerf else 1 mutex ! me @ "/@rp/s/" remove_prop 0 4 1 for var! tmp2 skills @ tmp @ tmp2 @ [] toint -- [] not if { "^RED^Selection #" tmp2 @ ++ " was invalid. Try it again." }yerf 0 mutex ! else me @ "s/" skills @ tmp @ tmp2 @ [] toint -- [] strcat skillvals @ tmp2 @ [] setstat { "^GREEN^Your skill in ^CYAN^" skills @ tmp @ tmp2 @ [] toint -- [] "^GREEN^ was set to ^YELLOW^" skillvals @ tmp2 @ [] "^GREEN^." }yerf me @ { "Skills" skills @ tmp @ tmp2 @ [] toint -- [] }bonus then repeat then end endcase mutex @ until READ_SHOOTS_BLANKS ; SAFECALL cg.skills : cg.aspects READ_SHOOTS_BLANKS 0 var! mutex { 3 2 2 1 1 }array var! aspectvals "system/aspect/tables" enumType var! aspects "Aspects" header tellme aspects @ foreach var! value var! item { { item @ ++ tostr 2 rj ") " value @ }cat 20 lj FASTCOLOR "^YELLOW^[^GREEN^" me @ "as/" value @ strcat getstatint tostr 1 lj "^YELLOW^]^CYAN^ " { "aspects" value @ "desc" }rpinfo }cat tellme repeat LINE { "You can now choose 5 aspects at 3, 2, 2, 1 and 1, depending on your choice." }tell { "Please enter the numbers of the aspects below in the order you want." }tell { "Example: 1 5 3 4 2" }tell { "You may also enter ^RED^0^ ^ to clear your aspects, or ^RED^Q^ ^ to leave without changes. " }tell LINE { "What's your choice:" }tell begin read var! murr murr @ case "0" smatch when me @ "/@rp/as/" remove_prop { "Your aspects were cleared." }yerf 1 Mutex ! end "Q*" smatch when 1 Mutex ! end default pop murr @ " " explode_array var! tmp tmp @ array_count 5 = not if { "^RED^You need to specify 5 different aspects. Try again." }yerf else 1 mutex ! me @ "/@rp/as/" remove_prop 0 4 1 for var! tmp2 aspects @ tmp @ tmp2 @ [] toint -- [] not if { "^RED^Selection #" tmp2 @ ++ " was invalid. Try it again." }yerf 0 mutex ! else me @ "as/" aspects @ tmp @ tmp2 @ [] toint -- [] strcat aspectvals @ tmp2 @ [] setstat { "^GREEN^Your aspect in ^CYAN^" aspects @ tmp @ tmp2 @ [] toint -- [] "^GREEN^ was set to ^YELLOW^" aspectvals @ tmp2 @ [] "^GREEN^." }yerf me @ { "System/aspect/tables" aspects @ tmp @ tmp2 @ [] toint -- [] }bonus then repeat then end endcase mutex @ until READ_SHOOTS_BLANKS ; SAFECALL cg.aspects : new.allegiances me @ "Allegiances" getstat if { "^RED^You have already selected your allegiances. To reselect, you'll have to commit seppuku. (Clear your sheet)." }yerf exit then { "System/Allegiance" enumType foreach swap pop var! cur1 cur1 @ "System/Allegiance" cur1 @ strcat enumType foreach swap pop var! cur2 { cur1 @ " (" cur2 @ ")" }cat repeat repeat }array var! allegiances "You pledge allegiance to the flag of ..." header tellme allegiances @ foreach var! value var! item { item @ ++ ") " value @ }cat FASTCOLOR tellme repeat LINE { "Select allegiences by number, up to 5, seperated by spaces. Enter 0 to be alone." }tell read var! murr me @ "Allegiances" murr @ "0" smatch not if { murr @ " " explode_array foreach var! cur pop allegiances @ cur @ toint -- [] repeat }array dup not if pop "None" else ", " array_join then else "None" then dup var! x setstat { "We pity the following fools: " x @ }yerf ; : new.faith me @ "Faith" getstat if { "^RED^You have already selected your faith. To reselect, you'll have to become a heretic. (Clear your sheet)." }yerf exit then { "System/Faith" enumType foreach swap pop var! cur1 cur1 @ "System/Faith" cur1 @ strcat enumType foreach swap pop var! cur2 { cur1 @ " (" cur2 @ ")" }cat repeat repeat }array var! faith "You give your heart over to the pantheon of ..." header tellme faith @ foreach var! value var! item { item @ ++ ") " value @ }cat FASTCOLOR tellme repeat LINE { "Select your faith by number, ONE only (lest the other gods get angry). Or select 0 to be an athiest." }tell read var! murr me @ "Faith" faith @ murr @ toint -- [] dup not if pop "None" then dup var! x setstat { "You have given your heart over to the holy pantheon of: " x @ }yerf ; : cg.nation READ_SHOOTS_BLANKS 0 var! mutex var tmp var cur var bonusstat var bonusamt me @ "Nationality" getstat if { "^RED^You have already selected your nation. To reselect, you have to start over (Clear your sheet)." }yerf exit then { "Nations" enumType foreach swap pop var! cur1 cur1 @ "Nations/" cur1 @ strcat enumType foreach swap pop var! cur2 { cur1 @ " (" cur2 @ ")" }cat repeat repeat }array var! nations "Nations of Furryfaire" header tellme nations @ foreach var! value var! item { item @ ++ ") " value @ }cat FASTCOLOR tellme repeat LINE { "Select a nation by number. To quit, select Q." }tell begin read var! murr murr @ case "0" smatch when me @ "Nationality" 0 setstat { "Your nationality was cleared." }yerf 1 Mutex ! end "Q*" smatch when 1 Mutex ! end default pop me @ "Nationality" getstat dup tmp ! if { "Nations" tmp @ todir "Attribute" }rpinfo if { "Removing bonuses from your old nation ^CYAN^" tmp @ "^ ^..." }yerf { "Nations" tmp @ todir "Attribute" }rpinfo ", " explode_array foreach swap pop cur ! cur @ "*" instr 1 = if me @ "~/shire-bonus-stat" getstat bonusstat ! 1 bonusamt ! else cur @ " " split swap toint bonusamt ! bonusstat ! then me @ "@/m/" bonusstat @ strcat over over getstat bonusamt @ - setstat { bonusstat @ " -" bonusamt @ }yerf repeat then then me @ "Nationality" nations @ murr @ toint -- [] dup tmp ! setstat { "Nations" tmp @ todir "Attribute" }rpinfo if { "Adding bonuses from your new nation ^CYAN^" tmp @ "^ ^..." }yerf me @ { "Nations" tmp @ todir }bonus { "Nations" tmp @ todir "Attribute" }rpinfo ", " explode_array foreach swap pop cur ! cur @ "*" instr 1 = if { "Which stat do you want to add your +1 attribute to (Physical, Mental, Spiritual or Social)? Please do not abbreviate." }yerf read bonusstat ! 1 bonusamt ! me @ "~/shire-bonus-stat" bonusstat @ setstat else cur @ " " split swap toint bonusamt ! bonusstat ! then me @ "@/m/" bonusstat @ strcat over over getstat bonusamt @ + setstat { bonusstat @ " +" bonusamt @ }yerf repeat then { "Adding languages ..." }yerf { "Nations" tmp @ todir "Languages" }rpinfo mklist var! tmp2 tmp2 @ array_count 2 >= if begin { "Pick a language, " tmp2 @ array_commas " are your choices, you get one: " }yerf read dup var! tmp3 tmp2 @ emerge if me @ "@/s/Linguistics" over over getstat ++ setstat me @ "@/s/Linguistics/" tmp3 @ "(US)" strcat strcat 1 setstat { "You learned the language ^GREEN^" tmp3 @ "^ ^!" }yerf break else { "^RED^That's just a bunch of nonsense!" }yerf then repeat else me @ "la/" tmp2 @ mkstr strcat 1 setstat { "You learned the language ^GREEN^" tmp2 @ mkstr "^ ^!" }yerf then { "Your nationality was set to ^GREEN^" me @ "Nationality" getstat "^NORMAL^." }yerf new.faith ( Convert to Joshuite or die ... ) new.allegiances 1 Mutex ! end endcase mutex @ until READ_SHOOTS_BLANKS ; SAFECALL cg.nation : powerResolve[ s:powah -- s:resolve ] RPSYSTEM "/Powers/" array_get_propdirs foreach var! dir1 pop { "Powers" dir1 @ powah @ "Name" }rpstat if { dir1 @ "/" powah @ capitalize }cat exit then repeat "" ; : addRace[ d:target s:race -- ] var bonusstat var bonusamt var cost ( Dont add if I already have it ) target @ "Races" getstatstr mklist race @ emerge if { "No, you already have this race." }yerf exit then ( Find out what the cost of taking this race will be ) target @ "races" getstat if 30 else 40 then cost ! { "Nations" target @ "Nationality" getstatstr todir "Race" }rpinfo "*" instr if cost @ 10 - cost ! else { "Nations" target @ "Nationality" getstatstr todir "Race" }rpinfo race @ chopallsub emerge if cost @ 10 - cost ! then { "Nations" target @ "Nationality" getstatstr todir "Race" }rpinfo race @ chopallmain emerge if cost @ 10 - cost ! then then { "Your chosen race ^CYAN^" race @ "^ ^ costs ^GREEN^" cost @ "^ ^DP." }yerf ( Die if not enough DP ) target @ DP cost @ < if { "^RED^Not enough DP, you have " target @ DP ", you need " cost @ "." }yerf exit then ( Spend the DP ) target @ cost @ spendDP if { "Danger Will Robinson! I failed to spend the DP!" }yerf exit then ( Add everything this race gets to stats.. ) ( First attributes ) { "Race" race @ todir "Attributes" }rpinfo dup if mklist foreach swap pop " " split toint bonusamt ! bonusstat ! { race @ capitalize ": Adding +" bonusamt @ " to " bonusstat @ "..." }yerf target @ "m/" bonusstat @ strcat over over getstat bonusamt @ + setstat repeat else pop then ( Now powers ) { "Race" race @ todir "Powers" }rpinfo dup if mklist foreach swap pop "/" split swap pop bonusstat ! 1 bonusamt ! { race @ capitalize ": Adding +" bonusamt @ " to " bonusstat @ "..." }yerf me @ { "Powers" bonusstat @ }bonus me @ { "Powers" bonusstat @ powerResolve }fn+ target @ "p/" bonusstat @ todir strcat over over getstat bonusamt @ + setstat bonusstat @ "* (*)" smatch if target @ "p/" bonusstat @ chopsub strcat over over getstat bonusamt @ + setstat then bonusstat @ "*/*" smatch if target @ "p/" bonusstat @ chopsub strcat over over getstat bonusamt @ + setstat then repeat else pop then ( Now immunities ) { "Race" race @ todir "Immunity" }rpinfo dup if mklist foreach swap pop bonusstat ! 1 bonusamt ! { race @ capitalize ": Adding immunity " bonusamt @ " to " bonusstat @ "..." }yerf target @ "p/Immunity" over over getstat bonusamt @ + setstat target @ "p/Immunity/" bonusstat @ strcat over over getstat bonusamt @ + setstat repeat else pop then ( Now merits ) RPSYSTEM { "Race/" race @ todir "/" }cat array_get_propdirs dup if foreach var! merits pop me @ "mer/" merits @ strcat 1 setstat { "^GREEN^" race @ capitalize ": Adding merit " merits @ "..." }yerf repeat else pop then ( Attempt inheritance ) race @ "* (*)" smatch if race @ todir "/" split pop var! race2 ( First attributes ) { "Race" race2 @ "Attributes" }rpinfo dup if mklist foreach swap pop " " split toint bonusamt ! bonusstat ! { race2 @ capitalize ": Adding +" bonusamt @ " to " bonusstat @ " (inherited)..." }yerf target @ "m/" bonusstat @ strcat over over getstat bonusamt @ + setstat repeat else pop then ( Now powers ) { "Race" race2 @ "Powers" }rpinfo dup if mklist foreach swap pop "/" split swap pop bonusstat ! 1 bonusamt ! { race2 @ capitalize ": Adding +" bonusamt @ " to " bonusstat @ " (inherited)..." }yerf me @ { "Powers" bonusstat @ }bonus me @ { "Powers" bonusstat @ powerResolve }fn+ target @ "p/" bonusstat @ todir strcat over over getstat bonusamt @ + setstat bonusstat @ "* (*)" smatch if target @ "p/" bonusstat @ chopsub strcat over over getstat bonusamt @ + setstat then repeat else pop then then target @ { "Race" race @ todir }bonus { "Finished adding race bonuses." }yerf ( add this race to my profile ) target @ "races" getstat not if target @ "races" race @ setstat else target @ "races" over over getstatstr mklist race @ mklist array_union mkstr setstat then { "Finished adding race!" }yerf ; : delRace[ d:target s:race -- ] var bonusstat var bonusamt var cost ( Dont add if I already have it ) target @ "Races" getstatstr mklist race @ emerge not if { "I cant remove races you dont have!" }yerf exit then ( Find out what the cost of taking this race will be ) target @ "races" getstat if 30 else 40 then cost ! { "Nations" target @ "Nationality" getstatstr todir "Race" }rpinfo "*" instr if cost @ 10 - cost ! else { "Nations" target @ "Nationality" getstatstr todir "Race" }rpinfo race @ chopallsub emerge if cost @ 10 - cost ! then { "Nations" target @ "Nationality" getstatstr todir "Race" }rpinfo race @ chopallmain emerge if cost @ 10 - cost ! then then { "Your chosen race ^CYAN^" race @ "^ ^ costs ^GREEN^" cost @ "^ ^DP." }yerf ( Spend the DP ) target @ 0 cost @ - spendDP if { "Danger Will Robinson! I failed to spend the DP!" }yerf exit then ( Remove everything this race gets to stats.. ) ( First attributes ) { "Race" race @ todir "Attributes" }rpinfo dup if mklist foreach swap pop " " split toint bonusamt ! bonusstat ! { race @ capitalize ": Removing +" bonusamt @ " from " bonusstat @ "..." }yerf me @ "m/" bonusstat @ strcat over over getstat bonusamt @ - setstat repeat else pop then ( Now powers ) { "Race" race @ todir "Powers" }rpinfo dup if mklist foreach swap pop "/" split swap pop bonusstat ! 1 bonusamt ! { race @ capitalize ": Removing +" bonusamt @ " from " bonusstat @ "..." }yerf me @ { "Powers" bonusstat @ }-bonus me @ { "Powers" bonusstat @ powerResolve }fn- me @ "p/" bonusstat @ todir strcat over over getstat bonusamt @ - setstat bonusstat @ "* (*)" smatch if target @ "p/" bonusstat @ chopsub strcat over over getstat bonusamt @ - setstat then bonusstat @ "*/*" smatch if target @ "p/" bonusstat @ chopsub strcat over over getstat bonusamt @ - setstat then repeat else pop then ( Attempt inheritance ) race @ "* (*)" smatch if race @ todir "/" split pop var! race2 ( First attributes ) { "Race" race2 @ "Attributes" }rpinfo dup if mklist foreach swap pop " " split toint bonusamt ! bonusstat ! { race2 @ capitalize ": Removing +" bonusamt @ " to " bonusstat @ " (inherited)..." }yerf me @ "m/" bonusstat @ strcat over over getstat bonusamt @ - setstat repeat else pop then ( Now powers ) { "Race" race2 @ "Powers" }rpinfo dup if mklist foreach swap pop "/" split swap pop bonusstat ! 1 bonusamt ! { race2 @ capitalize ": Removing +" bonusamt @ " to " bonusstat @ " (inherited)..." }yerf me @ { "Powers" bonusstat @ }bonus me @ { "Powers" bonusstat @ powerResolve }fn- me @ "p/" bonusstat @ todir strcat over over getstat bonusamt @ - setstat bonusstat @ "* (*)" smatch if target @ "p/" bonusstat @ chopsub strcat over over getstat bonusamt @ - setstat then repeat else pop then ( Now immunities ) { "Race" race2 @ todir "Immunities" }rpinfo dup if mklist foreach swap pop bonusstat ! 1 bonusamt ! { race @ capitalize ": Removing +" bonusamt @ " to " bonusstat @ "..." }yerf target @ "p/Immunity" over over getstat bonusamt @ - setstat target @ "p/Immunity/" bonusstat @ strcat over over getstat bonusamt @ - setstat repeat else pop then ( Now merits ) RPSYSTEM { "Race/" race @ todir "/" }cat array_get_propdirs dup if foreach var! merits pop me @ "mer/" merits @ strcat 0 setstat { "^RED^" race @ capitalize ": Removing merit " merits @ "..." }yerf repeat else pop then then target @ { "Race" race @ todir }-bonus { "Finished removing race bonuses." }yerf target @ "Races" over over getstatstr mklist race @ mklist swap array_diff mkstr setstat { "Finished removing race!" }yerf ; : cg.races READ_SHOOTS_BLANKS 0 var! mutex var tmp begin mutex @ not if { "Race" enumType foreach swap pop var! cur1 "Race/" cur1 @ strcat enumType foreach swap pop var! cur2 { cur1 @ " (" cur2 @ ")" }cat repeat repeat }array var! Races "Races of Furryfaire" header tellme Races @ foreach var! value var! item { item @ ++ ") " value @ me @ "races" getstatstr value @ emerge if "^Purple^ [Active]^ ^" then }cat FASTCOLOR tellme repeat LINE then 1 mutex ! { "^RED^You cannot remove a race without starting over, so choose carefully!" }yerf { "Enter the number of a race to add, ^CYAN^L^ ^ to relist, or ^RED^Q^ ^ to quit." }yerf read var! murr murr @ "Q" smatch not if murr @ "L" smatch if 0 mutex ! else murr @ toint var! yerf races @ yerf @ -- [] dup not if pop { "^RED^I dont know what kind of people yer talking about." }yerf else tmp ! me @ "races" getstatstr tmp @ emerge if { "Enter the number of a race to add, ^CYAN^L^ ^ to relist, or ^RED^Q^ ^ to quit." }yerf else { "^YELLOW^Are you sure you want to buy the race ^GREEN^" tmp @ "^YELLOW^?" }yerf read "Y*" smatch if me @ tmp @ addRace then then then then else 2 mutex ! then 2 mutex @ = until READ_SHOOTS_BLANKS ; SAFECALL cg.races : cg.size READ_SHOOTS_BLANKS var cost var point "Size" header tellme { "^YELLOW^Size: " me @ "m/size" getstat }tell LINE { "Enter a new size (-6 to 6), Or press ^RED^Q^ ^ to quit:" }yerf read dup var! opt case "{-6|-5|-4|-3|-2|-1|0|1|+1|2|+2|3|+3|4|+4|5|+5|6|+6}" smatch when opt @ toint var! x me @ msize abs 2 > if me @ me @ msize abs 2 - 0 swap - spend pop then x @ abs 2 <= if me @ "m/size" x @ toint setstat { "Your size trait has been set to ^GREEN^" x @ "^ ^." }yerf else me @ x @ abs 2 - spend not if me @ "m/size" x @ toint setstat { "Your size trait has been set to ^GREEN^" x @ "^ ^." }yerf else { "^RED^Failed to change size (Cannot afford that)^ ^." }yerf then then end "Q*" smatch when end default pop { "^RED^Invalid option: " opt @ }yerf end endcase READ_SHOOTS_BLANKS ; SAFECALL cg.size : resource-cg me @ mresources var! res res @ ++ var! cost res @ 30 >= if { "^RED^>>> We think you already have enough money." }yerf exit then me @ cost @ spend not if res ++ me @ "m/Resources" res @ setstat { "^GREEN^>>> You bought a point of resources for " cost @ "DP. Your resources is now " res @ "." }yerf else { "^RED^>>> You cannot afford to raise resources (ironic isn't it..) You need " cost @ "DP." }yerf then ; SAFECALL resource-cg : getAllPowers[ -- a:powahs ] { RPSYSTEM "/Powers/" array_get_propdirs foreach var! dir1 pop RPSYSTEM "/Powers/" dir1 @ strcat array_get_propdirs foreach var! dir2 pop { dir1 @ "/" dir2 @ }cat repeat repeat }array ; : findpowercost[ d:target s:mypower -- i:cost ] target @ "races" getstatstr var! myraces { "Powers" mypower @ "Races" }rpinfo var! sysraces myraces @ not if 50 exit then sysraces @ "All" smatch if 10 exit then sysraces @ myraces @ chopallmain emerge if 10 else 30 then ; : specifics var special var remove { getAllPowers foreach var! item pop { "Powers" item @ "Specific" }rpinfo if item @ chopmain then repeat }array special ! begin "Power specific levels" header tellme { special @ foreach item ! pop me @ { "p/" item @ }cat getraw not me @ { "@/p/" item @ }cat getraw not and if continue then { item @ " " { me @ { "/@rp/p/" item @ "/" }cat array_get_propvals array_explode pop me @ { "/@rp/@/p/" item @ "/" }cat array_get_propvals array_explode pop }dict var! tmp "[" tmp @ array_count "/" me @ item @ gtype me @ { "/@rp/@/p/" item @ "/" }cat array_get_propvals array_count + "]: ^CYAN^" tmp @ array_keys array_make array_commas }cat repeat }array qmorph atellme LINE { "Please enter new power specifics, make sure to be careful as you cannot remove them once entered." }yerf { "Please enter them in the format /, seperated by commas if more than one." }yerf cmode @ CHAR_IN_CHARGEN = if { "You can use -/ to remove a specific power item." }yerf then { "Or type ^RED^Q^ ^ to quit ... " }yerf read dup "Q" smatch not if "," ", " subst "," explode_array foreach var! murr pop ( validation phase ) cmode @ CHAR_IN_CHARGEN = murr @ "-*" smatch and if 1 remove ! murr @ 1 strcut murr ! pop else 0 remove ! then murr @ "*/*" smatch not if { "^RED^The power specific " murr @ " is not in the format /." }yerf continue then { "Powers" murr @ chopsub powerResolve "Specific" }rpinfo not if { "^RED^Either the power " murr @ chopsub " does not exist or it does not support specific items." }yerf continue then me @ "/@rp/p/" murr @ chopsub "/" strcat strcat array_get_propvals array_count me @ "/@rp/@/p/" murr @ chopsub "/" strcat strcat array_get_propvals array_count + me @ murr @ chopsub gtype me @ { "/@rp/@/p/" item @ "/" }cat array_get_propvals array_count + >= if { "^RED^You are at the limit of the number of the power specifics you can place in '" murr @ chopsub ", You must increase your growth." }yerf continue then ( Ready for action ) murr @ "/" split var! subskill var! skill remove @ not if me @ { "p/" skill @ "/" subskill @ }cat 1 setstat { "^GREEN^You gain the specific power " subskill @ " of the power " skill @ "." }yerf else me @ { "p/" skill @ "/" subskill @ }cat 0 setstat { "^RED^You lose the specific power " subskill @ " of the power " skill @ "." }yerf then repeat else break then repeat ; SAFECALL specifics : powers READ_SHOOTS_BLANKS "Powers you can take" header tellme { getAllPowers foreach var! item pop me @ "p/" item @ chopmain strcat getstat if continue then { item @ chopmain " [" me @ item @ findpowercost "]" }cat repeat }array 3 wrap_items_fixed qmorph atellme begin "Powers you have" header tellme { me @ "/@rp/p/" array_get_propvals foreach toint var! value var! item { item @ value @ toint 1 > if " [" value @ "]" then }cat repeat }array 3 wrap_items_fixed qmorph atellme LINE { "Enter the name of a power to add (or raise by one point), seperate multiple entries with ','" }yerf cmode @ CHAR_IN_CHARGEN = if { "To remove a power (or a point in a power), enter the name with a - sign (like -Unaging)" }yerf then { "Or enter ^RED^Q^ ^ to quit: " }yerf read "," ", " subst "," explode_array foreach var! murr pop murr @ "Q" smatch not if murr @ "-*" smatch not if murr @ powerResolve not if { "^RED^Invalid power specified: " murr @ }yerf continue then murr @ powerResolve murr ! me @ "p/" murr @ chopmain strcat getstatint if { "^RED^You can't get any more of that." }yerf continue then { "powers" murr @ "level" }rpinfo "inf" smatch not if me @ "p/" murr @ chopmain strcat getstat { "powers" murr @ "level" }rpinfo toint 1 10 limit { me @ "races" getstatstr dup if mklist else 0 array_make then foreach var! tmp pop { "race" tmp @ todir "powers" }rpinfo dup if mklist array_vals pop then repeat }array murr @ 1 array_make array_intersect array_count + dup var! x < not if { "^RED^" murr @ capitalize " capped at " x @ "." }yerf continue then then me @ me @ murr @ findpowercost spend not if me @ "p/" murr @ chopmain capitalize strcat over over getstat ++ setstat { "^GREEN^" murr @ chopmain capitalize " power bought for ^CYAN^" me @ murr @ findpowercost "^GREEN^DP." }yerf me @ { "Powers" murr @ }bonus me @ { "Powers" murr @ }fn+ else { "^RED^Could not afford " murr @ chopmain capitalize " you have " me @ DP ", you need " me @ murr @ findpowercost "." }yerf then else cmode @ CHAR_IN_CHARGEN = not if { "^RED^Unable to remove points after chargen." }yerf else murr @ 1 strcut swap pop murr ! murr @ powerResolve not if { "^RED^Invalid power specified: " murr @ }yerf else murr @ powerResolve murr ! me @ "p/" murr @ chopmain strcat getrawint not if { "^RED^You can't remove what you dont have." }yerf continue then me @ 0 me @ murr @ findpowercost - spend pop me @ "p/" murr @ chopmain capitalize strcat over over getraw -- setstat { "^GREEN^" murr @ chopmain capitalize " power removed for ^CYAN^" me @ murr @ findpowercost "^GREEN^DP." }yerf me @ { "Powers" murr @ }-bonus me @ { "Powers" murr @ }fn- then then then then repeat murr @ "Q" smatch until READ_SHOOTS_BLANKS ; SAFECALL powers : getallTalents[ -- a:talents ] { RPSYSTEM "/talents/" array_get_propdirs foreach var! dir pop dir @ RPSYSTEM "/talents/" dir @ "/" strcat strcat array_get_propdirs foreach swap pop "/" strcat strcat repeat repeat }array ; : talentmatch[ s:talent -- s:talented ] RPSYSTEM "/talents/" array_get_propdirs foreach var! dir pop { "talents" dir @ talent @ "name" }rpinfo if dir @ "/" talent @ strcat strcat exit then repeat "" ; : findtalentcost[ d:target s:mytalent -- i:cost ] var duh ( Validate talents ) ( Psychic talents requries psionics ) mytalent @ talentmatch "Psychic/*" smatch if target @ "psi/1" getstat not if -1 exit then then ( Natural talents requries CHAR_IN_CHARGEN ) mytalent @ talentmatch "Natural/*" smatch if cmode @ CHAR_IN_CHARGEN = not if -1 exit then then ( Sorcerous talents requries sorcery ) mytalent @ talentmatch "Sorcerous/*" smatch if target @ "/@rp/mag/" array_get_propvals array_count not if -1 exit then then ( Belief talents requires a religious order ) 0 duh ! mytalent @ talentmatch "Belief/*" smatch if target @ "/@rp/or/" array_get_propvals foreach pop var! court { "Orders" court @ "Status" }rpinfo "Religious" emerge if 1 duh ! then repeat duh @ not if -1 exit then then ( If we got this far, final cost time ) ( Grrrr Tashiro, this is so complex. Why do you have to do things so complex? ) { ( target @ "/@rp/ta/" array_get_propvals array_explode pop ) target @ "/@rp/@/ta/" array_get_propvals array_explode pop }dict var! talented talented @ array_count case 0 = when ( The first one is always free ) 0 exit end 1 2 .. when ( second and third are free only if they are unique ) { talented @ foreach pop talentmatch chopsub repeat mytalent @ talentmatch chopsub }array 1 array_nunion array_count talented @ array_count ++ = if 0 exit then end endcase target @ "races" getstat not if 1 else 3 then ; : findtalentcost-[ d:target s:mytalent -- i:mycost ] target @ "ta/" mytalent @ strcat getraw if 1 else target @ "@/ta/" mytalent @ strcat getraw if 0 else -1 then then target @ "races" getstat if 3 * then ; : talents READ_SHOOTS_BLANKS begin "Talents you can take" header tellme { RPSYSTEM "/talents/" array_get_propdirs foreach var! dir pop RPSYSTEM "/talents/" dir @ strcat array_get_propdirs foreach var! item pop me @ item @ findtalentcost dup 0 < if pop continue then var! cost { item @ " [" cost @ "]" }cat repeat repeat }array 3 wrap_items_fixed qmorph atellme begin "Talents you have" header tellme { { me @ "/@rp/ta/" array_get_propvals array_explode pop me @ "/@rp/@/ta/" array_get_propvals array_explode pop }dict foreach toint var! value var! item { item @ value @ toint 1 > if " [" value @ "]" then }cat repeat }array 3 wrap_items_fixed qmorph atellme LINE { "Enter the name of a talent to add (or raise by one point), seperate multiple entries with ','" }yerf cmode @ CHAR_IN_CHARGEN = if { "To remove a talent (or a point in a talent), enter the name with a - sign (like -Unaging)" }yerf then { "^GREEN^L^ ^ to relist, or enter ^RED^Q^ ^ to quit: " }yerf read "," ", " subst "," explode_array foreach var! murr pop murr @ "[LQ]" smatch not if murr @ "-*" smatch not if me @ "ta/" murr @ strcat getstat if { "^RED^" murr @ capitalize " can only be taken once." }tell continue then { "talents" murr @ talentmatch "Name" }rpstat not if { "^RED^Invalid talent specified: " murr @ }yerf else me @ "/@rp/ta/" array_get_propvals array_count me @ growth >= me @ murr @ findtalentcost and if { "^RED^Insufficient growth to buy more talents." }yerf else me @ murr @ findtalentcost dup var! mycost 0 >= if me @ mycost @ spend not if mycost @ if me @ "ta/" murr @ capitalize strcat over over getstat ++ setstat else me @ "@/ta/" murr @ capitalize strcat over over getraw ++ setstat then { "^GREEN^" murr @ capitalize " talent bought for ^CYAN^" mycost @ "^GREEN^DP." }yerf me @ { "Talents" murr @ }bonus me @ { "Talents" murr @ talentmatch }fn+ else { "^RED^Could not afford " murr @ capitalize " you have " me @ DP ", you need " mycost @ "." }yerf then else { "^RED^You have not met the requisites to buying the talent." }yerf then then then else cmode @ CHAR_IN_CHARGEN = not if { "^RED^Unable to remove points after chargen." }yerf else murr @ 1 strcut swap pop murr ! me @ murr @ findtalentcost- -1 = if { "^RED^Invalid talent specified: " murr @ }yerf else me @ 0 me @ murr @ findtalentcost- dup var! mycost - spend pop me @ "ta/" murr @ capitalize strcat 0 setstat me @ "@/ta/" murr @ capitalize strcat 0 setstat { "^GREEN^" murr @ capitalize " talent removed for ^CYAN^" mycost @ "^GREEN^DP." }yerf me @ { "Talents" murr @ }-bonus me @ { "Talents" murr @ talentmatch }fn- then then then then repeat murr @ "[LQ]" smatch until murr @ "L" smatch not until READ_SHOOTS_BLANKS ; SAFECALL talents : findschoolcost[ d:target s:mytalent -- i:cost ] target @ "/@rp/sch/" array_get_propvals array_count 5 * 5 + ; : findschoolcost-[ d:target s:mytalent -- i:cost ] target @ "/@rp/sch/" array_get_propvals array_count -- 5 * 5 + ; : schools READ_SHOOTS_BLANKS me @ "/@rp/mag/" array_get_propvals array_count not if { ">>> Before you can take any additional schools, you must know a form of sorcery." }yerf exit then "Schools you can take" header tellme { RPSYSTEM "System/Schools" array_get_propdirs foreach var! item pop me @ "sch/" item @ strcat getstat if continue then { item @ " [" me @ item @ findschoolcost "]" }cat repeat }array 3 wrap_items_fixed qmorph atellme begin "Schools you have" header tellme { me @ "/@rp/sch/" array_get_propvals foreach toint var! value var! item { item @ value @ toint 1 > if " [" value @ "]" then }cat repeat }array 3 wrap_items_fixed qmorph atellme LINE { "Enter the name of a school to add (or raise by one point), seperate multiple entries with ','" }yerf cmode @ CHAR_IN_CHARGEN = if { "To remove a school, enter the name with a - sign" }yerf then { "Or enter ^RED^Q^ ^ to quit: " }yerf read "," ", " subst "," explode_array foreach var! murr pop murr @ "Q" smatch not if murr @ "-*" smatch not if me @ "sch/" murr @ strcat getstat if { "^RED^" murr @ capitalize " can only be taken once." }tell continue then { "System/Schools" murr @ "Name" }rpinfo not if { "^RED^Invalid school specified: " murr @ }yerf else me @ murr @ findschoolcost dup var! mycost 0 >= if me @ mycost @ spend not if me @ "sch/" murr @ capitalize strcat over over getstat ++ setstat { "^GREEN^" murr @ capitalize " school bought for ^CYAN^" mycost @ "^GREEN^DP." }yerf me @ { "System/Schools" murr @ }bonus else { "^RED^Could not afford " murr @ capitalize " you have " me @ DP ", you need " mycost @ "." }yerf then else { "^RED^At the maximum number of schools." }yerf then then else cmode @ CHAR_IN_CHARGEN = not if { "^RED^Unable to remove points after chargen." }yerf else murr @ 1 strcut swap pop murr ! { "System/Schools" murr @ "Name" }rpstat not if { "^RED^Invalid school specified: " murr @ }yerf else me @ 0 me @ murr @ findschoolcost- dup var! mycost - spend pop me @ "sch/" murr @ capitalize strcat over over getstat -- setstat { "^GREEN^" murr @ capitalize " school removed for ^CYAN^" mycost @ "^GREEN^DP." }yerf me @ { "System/Schools" murr @ }-bonus then then then then repeat murr @ "Q" smatch until READ_SHOOTS_BLANKS ; SAFECALL schools : effectcount[ d:target -- i:effects ] target @ "/@rp/mag/" array_get_propvals target @ "/@rp/ta/Personal Effects" getprop or if target @ "/@rp/mag/" array_get_propvals array_count target @ growth + else 0 then ; : effectlist[ d:target -- a:effects ] { target @ "/@rp/mag/Path of the Wild" getprop target @ "/@rp/ta/Personal Effects" getprop or if 1 else 0 then var! wild RPSYSTEM "/sorcery/" array_get_propdirs foreach var! dir pop { "Sorcery" dir @ "Effects" }rpinfo dup "none" smatch if pop continue then dup "any" smatch if pop continue then dup not if pop continue then wild @ not if target @ "mag/" dir @ strcat getstat not if pop continue then then "," ", " subst "," explode_array array_vals pop repeat }array ; : effect.cantake?[ d:target s:effect -- i:cantake? ] effect @ "_" " " subst { "{" target @ effectlist "|" array_join "_" " " subst "}" }cat smatch if 1 else 0 then ; : effects READ_SHOOTS_BLANKS me @ effectcount not if { ">>> Before you can take any additional effects, you must know a school or take 'personal effects' talent yo." }yerf exit then "Effects you can take" header tellme { me @ effectlist foreach var! item pop me @ "eff/" item @ strcat getstat if continue then item @ repeat }array 4 wrap_items_fixed qmorph atellme begin "Effects you have" header tellme { me @ "/@rp/eff/" array_get_propvals foreach toint var! value var! item { item @ value @ toint 1 > if " [" value @ "]" then }cat repeat }array 4 wrap_items_fixed qmorph atellme LINE { "You can take a total of " me @ effectcount " effects." }yerf { "Enter the name of an effect to add, seperate multiple entries with ','" }yerf cmode @ CHAR_IN_CHARGEN = if { "To remove an effect, enter the name with a - sign" }yerf then { "Or enter ^RED^Q^ ^ to quit: " }yerf read "," ", " subst "," explode_array foreach var! murr pop murr @ "Q" smatch not if murr @ "-*" smatch not if me @ "/@rp/eff/" array_get_propvals array_count me @ effectcount >= if { ">>> You currently do not qualify for any more effects." }yerf continue then me @ "eff/" murr @ strcat getstat if { "^RED^" murr @ capitalize " can only be taken once." }tell continue then me @ murr @ effect.cantake? not if { "^RED^You could not take that effect: " murr @ }yerf else me @ "eff/" murr @ capitalize strcat over over getstat ++ setstat { "^GREEN^" murr @ capitalize " effect added." }yerf then else cmode @ CHAR_IN_CHARGEN = not if { "^RED^Unable to remove points after chargen." }yerf else me @ "eff/" murr @ strcat getstat not if { "^RED^" murr @ capitalize " is not on your sheet." }tell continue then me @ murr @ effect.cantake? if { "^RED^You could not remove that effect: " murr @ }yerf else me @ "eff/" murr @ capitalize strcat over over getstat -- setstat { "^GREEN^" murr @ capitalize " effect removed." }yerf then then then then repeat murr @ "Q" smatch until READ_SHOOTS_BLANKS ; SAFECALL effects : findmagiccost[ d:target s:mymagic -- i:cost ] 60 { target @ "races" getstatstr mklist foreach swap pop todir var! mystuff { "Race" mystuff @ "Sorcery" }rpinfo mklist array_vals pop repeat }array mkstr var! approved mymagic @ approved @ emerge if 20 - then target @ "nationality" getstatstr var! mystuff { "Nations" mystuff @ "Sorcery" }rpinfo var! approved mymagic @ approved @ emerge if 20 - then target @ "ab/Consubstantial Weave" getstat if target @ growth 5 * - then ; : magics READ_SHOOTS_BLANKS "Sorcery you can take" header tellme { RPSYSTEM "/Sorcery/" array_get_propdirs foreach var! item pop me @ "mag/" item @ strcat getstat if continue then { item @ " [" me @ item @ findmagiccost "]" }cat repeat }array 2 wrap_items_fixed qmorph atellme begin "Sorcery you have" header tellme { me @ "/@rp/mag/" array_get_propvals foreach toint var! value var! item { item @ value @ toint 1 > if " [" value @ "]" then }cat repeat }array 2 wrap_items_fixed qmorph atellme LINE { "Enter the name of a sorcery to add (or raise by one point), seperate multiple entries with ','" }yerf cmode @ CHAR_IN_CHARGEN = if { "To remove a sorcery (or a point in a sorcery), enter the name with a - sign (like -Aria)" }yerf then { "Or enter ^RED^Q^ ^ to quit: " }yerf read "," ", " subst "," explode_array foreach var! murr pop murr @ "Q" smatch not if murr @ "-*" smatch not if { "Sorcery" murr @ "Desc" }rpstat not if { "^RED^Invalid sorcery specified: " murr @ }yerf else me @ "mag/" murr @ strcat getstat if { "^RED^" murr @ capitalize " can only be taken once." }tell continue then me @ me @ murr @ findmagiccost spend not if me @ "mag/" murr @ capitalize strcat over over getstat ++ setstat { "^GREEN^" murr @ capitalize " magic bought for ^CYAN^" me @ murr @ findmagiccost "^GREEN^DP." }yerf { "Sorcery" murr @ "School" }rpstat dup var! school "None" smatch not if me @ "sch/" school @ capitalize strcat over over getstat ++ setstat { "^GREEN^" murr @ capitalize " school taught: " school @ }yerf then me @ { "Sorcery" murr @ }bonus else { "^RED^Could not afford " murr @ capitalize " you have " me @ DP ", you need " me @ murr @ findmagiccost "." }yerf then then else cmode @ CHAR_IN_CHARGEN = not if { "^RED^Unable to remove points after chargen." }yerf else murr @ 1 strcut swap pop murr ! { "Sorcery" murr @ "Desc" }rpstat not if { "^RED^Invalid magic specified: " murr @ }yerf else me @ "mag/" murr @ strcat getstat 0 > if me @ 0 me @ murr @ findmagiccost - spend pop me @ "mag/" murr @ capitalize strcat over over getstat -- setstat { "^GREEN^" murr @ capitalize " magic removed for ^CYAN^" me @ murr @ findmagiccost "^GREEN^DP." }yerf { "Sorcery" murr @ "School" }rpstat dup var! school "None" smatch not if me @ "sch/" school @ capitalize strcat over over getstat -- setstat { "^GREEN^" murr @ capitalize " school forgotten." }yerf then me @ { "Sorcery" murr @ }-bonus else { "^RED^Cannot remove points in chargen that you do not have." }yerf then then then then then repeat murr @ "Q" smatch until READ_SHOOTS_BLANKS ; SAFECALL magics : findskillcost[ d:target s:myskill -- i:cost ] target @ "s/" myskill @ strcat getrawint ++ "Skill" getCostDP ; : specialties var special var remove { RPSYSTEM "/Skills/" array_get_propdirs foreach var! item pop { "Skills" item @ "Specialties" }rpinfo if item @ then repeat }array special ! begin "Specialty levels" header tellme { special @ foreach item ! pop { item @ " " { me @ { "/@rp/s/" item @ "/" }cat array_get_propvals array_explode pop me @ { "/@rp/@/s/" item @ "/" }cat array_get_propvals array_explode pop }dict var! tmp "[" tmp @ array_count "/" me @ "s/" item @ strcat getstat "]: ^CYAN^" tmp @ array_keys array_make array_commas }cat repeat }array qmorph atellme LINE { "Please enter new specialties, make sure to be careful as you cannot remove them once entered." }yerf { "Please enter them in the format /, seperated by commas if more than one." }yerf cmode @ CHAR_IN_CHARGEN = if { "You can use -/ to remove a skill." }yerf then { "Or type ^RED^Q^ ^ to quit ... " }yerf read dup "Q" smatch not if "," ", " subst "," explode_array foreach var! murr pop ( validation phase ) cmode @ CHAR_IN_CHARGEN = murr @ "-*" smatch and if 1 remove ! murr @ 1 strcut murr ! pop else 0 remove ! then murr @ "*/*" smatch not if { "^RED^The specialty " murr @ " is not in the format /." }yerf continue then { "skills" murr @ chopsub "specialties" }rpinfo not if { "^RED^Either the skill " murr @ chopsub " does not exist or it does not support specialties." }yerf continue then me @ "/@rp/s/" murr @ chopsub "/" strcat strcat array_get_propvals array_count me @ "/@rp/@/s/" murr @ chopsub "/" strcat strcat array_get_propvals array_count + me @ "s/" murr @ chopsub strcat getstat >= if { "^RED^You are at the limit of the number of the specialties you can place in '" murr @ chopsub ", buy more points in it." }yerf continue then ( Ready for action ) murr @ "/" split var! subskill var! skill ( Linguistics is handled special, if there is already a point in it, it gets promoted. ) skill @ "Linguistics" smatch if subskill @ "_" " " subst { "{" RPSYSTEM "/Skills/Linguistics/Languages/" array_get_propdirs "|" array_join "}" }cat "_" " " subst smatch not if { "^RED^I do not recognize that language, and I know them all. Here is a list of languages you can take:" }yerf "Languages" header tellme RPSYSTEM "/Skills/Linguistics/Languages/" array_get_propdirs 4 wrap_items_fixed atellme LINE continue then subskill @ "(US)" strcat subskill ! me @ "s/Linguistics/" subskill @ strcat getstat if subskill @ "(RW)" "(US)" subst subskill ! then then remove @ not if me @ { "s/" skill @ "/" subskill @ }cat 1 setstat { "^GREEN^You learn the specialty " subskill @ " of your skill " skill @ "." }yerf else me @ { "s/" skill @ "/" subskill @ }cat 0 setstat { "^RED^You forget the specialty " subskill @ " of your skill " skill @ "." }yerf then repeat else break then repeat ; SAFECALL specialties : pc.skills READ_SHOOTS_BLANKS var tmp var tmp2 "Skills you can take" header tellme { RPSYSTEM "/skills/" array_get_propdirs foreach var! item pop { item @ " [" me @ item @ findskillcost "]" }cat repeat }array 3 wrap_items_fixed qmorph atellme begin "Skills you have" header tellme { me @ "/@rp/s/" array_get_propvals foreach toint var! value var! item { item @ value @ toint 1 > if " [" value @ "]" then }cat repeat }array 3 wrap_items_fixed qmorph atellme LINE { "Enter the name of a skill to add (or raise by one point), seperate multiple entries with ','" }yerf { "Or enter ^RED^Q^ ^ to quit: " }yerf read "," ", " subst "," explode_array foreach var! murr pop murr @ "Q" smatch not if { "Skills" murr @ "Name" }rpstat not if { "^RED^Invalid skill specified: " murr @ }yerf else me @ "s/" murr @ strcat getraw inf >= if { "^RED^" murr @ capitalize " capped at infinity." }yerf else me @ "s/" murr @ strcat getraw ++ me @ swap genkai not if { "^RED^Insufficient growth level to raise " murr @ capitalize "." }yerf else me @ me @ murr @ findskillcost dup tmp ! spend not if me @ "s/" murr @ capitalize strcat over over getraw ++ setstat { "^GREEN^" murr @ capitalize " skill bought to ^GREEN^" me @ "s/" murr @ strcat getraw "^NORMAL^ for ^CYAN^" tmp @ "^GREEN^DP." }yerf me @ { "Skills" murr @ }bonus else { "^RED^Could not afford " murr @ capitalize " you have " me @ DP ", you need " me @ murr @ findskillcost "." }yerf then then then then then repeat murr @ "Q" smatch until READ_SHOOTS_BLANKS ; SAFECALL pc.skills : findaspectcost[ d:target s:myskill -- i:cost ] target @ "as/" myskill @ strcat getstatint ++ "Aspect" getCostDP ; : pc.aspects READ_SHOOTS_BLANKS var tmp var tmp2 "Aspects you can take" header tellme { RPSYSTEM "system/aspect/tables" array_get_propdirs foreach var! item pop { item @ " [" me @ item @ findaspectcost "]" }cat repeat }array 5 wrap_items_fixed qmorph atellme begin "Aspects you have" header tellme { me @ "/@rp/as/" array_get_propvals foreach toint var! value var! item { item @ value @ toint 1 > if " [" value @ "]" then }cat repeat }array 5 wrap_items_fixed qmorph atellme LINE { "Enter the name of an aspect to add (or raise by one point), seperate multiple entries with ','" }yerf { "Or enter ^RED^Q^ ^ to quit: " }yerf read "," ", " subst "," explode_array foreach var! murr pop murr @ "Q" smatch not if { "system/aspect/tables" murr @ "Desc" }rpstat not if { "^RED^Invalid aspect specified: " murr @ }yerf else me @ "as/" murr @ strcat getstat 10 >= if { "^RED^" murr @ capitalize " capped at 10." }yerf else me @ "as/" murr @ strcat getstat ++ me @ swap genkai not if { "^RED^Insufficient power to raise " murr @ capitalize "." }yerf else me @ me @ murr @ findaspectcost dup tmp ! spend not if me @ "as/" murr @ capitalize strcat over over getstat ++ setstat { "^GREEN^" murr @ capitalize " aspect bought to ^GREEN^" me @ "as/" murr @ strcat getstat "^NORMAL^ for ^CYAN^" tmp @ "^GREEN^DP." }yerf me @ { "system/aspect/tables" murr @ }bonus else { "^RED^Could not afford " murr @ capitalize " you have " me @ DP ", you need " me @ murr @ findaspectcost "." }yerf then then then then then repeat murr @ "Q" smatch until READ_SHOOTS_BLANKS ; SAFECALL pc.aspects : findattrcost[ d:target s:myattr -- i:cost ] target @ "m/" myattr @ strcat getrawint ++ "Attr" getCostDP ; : pc.attrs READ_SHOOTS_BLANKS begin "Attributes" header tellme { "^RED^" { "Physical: " me @ mphysical " (" me @ "Physical" findattrcost ")" }cat 19 lj "^GREEN^" { "Mental: " me @ mmental " (" me @ "Mental" findattrcost ")" }cat 19 lj "^CYAN^" { "Spiritual: " me @ mspiritual " (" me @ "Spiritual" findattrcost ")" }cat 19 lj "^YELLOW^" { "Social: " me @ msocial " (" me @ "SOCIAL" findattrcost ")" }cat 19 lj }tell LINE { "Enter PHY MEN SPI or SOC to raise an attribute by 1 (seperate multiple purchases with spaces)" }yerf { "Or enter ^RED^Q^ ^ to quit: " }yerf read "Physical" "PHY" subst "Mental" "MEN" subst "Spiritual" "SPI" subst "Social" "SOC" subst "Physical" "phy" subst "Mental" "men" subst "Spiritual" "spi" subst "Social" "soc" subst " " explode_array foreach var! murr pop murr @ "Q" smatch not if murr @ "{Physical|Mental|Spiritual|Social}" smatch not if { "^RED^Invalid attribute specified: " murr @ }yerf else me @ "m/" murr @ strcat getraw inf >= if { "^RED^" murr @ capitalize " capped at infinity." }yerf else me @ "m/" murr @ strcat getraw ++ me @ swap genkai not if { "^RED^Insufficient growth level to raise " murr @ capitalize "." }yerf else me @ me @ murr @ findattrcost dup var! tmp spend not if me @ "m/" murr @ capitalize strcat over over getraw ++ setstat { "^GREEN^" murr @ capitalize " attribute bought to ^GREEN^" me @ "m/" murr @ strcat getraw "^NORMAL^ for ^CYAN^" tmp @ "^GREEN^DP." }yerf else { "^RED^Could not afford " murr @ capitalize " you have " me @ DP ", you need " tmp @ "." }yerf then then then then then repeat murr @ "Q" smatch until READ_SHOOTS_BLANKS ; SAFECALL pc.attrs : giftCost[ d:target -- i:cost ] target @ "ab/Psionic Training" getstat if 5 target @ magic-formula - exit then 5 ; : expandVaus[ s:gift -- s:type/gift ] RPSYSTEM "/Psionics/" array_get_propdirs foreach swap pop var! cur { "Psionics" cur @ gift @ "Desc" }rpinfo if { cur @ "/" gift @ }cat then repeat "" ; : psiCheck[ d:target s:gift -- i:canIhaveIt? ] { me @ "psi/1" getstat dup not if pop then me @ "psi/2" getstat dup not if pop then }array var! x x @ array_count not if 0 exit then gift @ chopsub { "{" x @ "|" array_join "}" }cat smatch not if 0 exit then { "Psionics" gift @ "Requirement" }rpinfo " " split toint var! value var! attr target @ "$lib/rp" match "m" attr @ strcat call value @ >= if 1 else 0 then { "Psionics" gift @ chopsub "Attribute" }rpinfo attr ! target @ "$lib/rp" match "m" attr @ strcat call value @ >= if 1 else 0 then target @ "$lib/rp" match "m" attr @ strcat call target @ "psi/gifts/" gift @ "/" split swap pop strcat getstat > if 1 else 0 then target @ "psi/gifts/" gift @ chopmain strcat getstat not if 1 else 0 then and and and ; : psionics READ_SHOOTS_BLANKS var tmp var tmp2 var tmp3 begin 60 var! psicost me @ "ab/Psionic Training" getstat if psicost @ 10 - psicost ! then "Psionics" header tellme { "1) Select primary psionics form (Cost: " psicost @ "DP): ^GREEN^" me @ "Psi/1" getstatstr }cat FASTCOLOR tellme { "2) Select secondary psionics form (Cost: " psicost @ 20 - "DP): ^CYAN^" me @ "Psi/2" getstatstr }cat FASTCOLOR tellme "Gifts you can take" header tellme { RPSYSTEM "/Psionics/" array_get_propdirs foreach swap pop var! cur RPSYSTEM "/Psionics/" cur @ strcat array_get_propdirs foreach var! item pop me @ { cur @ "/" item @ }cat psiCheck if item @ then repeat repeat }array 3 wrap_items_fixed qmorph atellme begin 0 var! mutex { RPSYSTEM "/Psionics/" array_get_propdirs foreach swap pop var! cur RPSYSTEM "/Psionics/" cur @ strcat array_get_propdirs foreach var! item pop me @ { cur @ "/" item @ }cat psiCheck if item @ then repeat repeat }array var! allowedGifts "Gifts you have" header tellme { me @ "/@rp/psi/gifts/" array_get_propvals foreach toint var! value var! item { item @ value @ toint 1 > if " [" value @ "]" then }cat repeat }array 3 wrap_items_fixed qmorph atellme LINE { "Multiple options can be seperated by commas." }yerf cmode @ CHAR_IN_CHARGEN = if { "Use -1, -2 or -gift to remove a form of psionics." }yerf then { "Enter: 1, 2, a name of a gift to buy, ^GREEN^L^ ^ to relist or ^RED^Q^ ^ to quit: " }yerf read dup var! murr "," ", " subst "," explode_array foreach var! opt pop opt @ case "[12]" smatch when { "Psionics types: " RPSYSTEM "/Psionics/" array_get_propdirs array_commas }yerf opt @ "1" smatch if { "^GREEN^Please select one to be your primary psionics: " }yerf read tmp ! tmp @ { "{" RPSYSTEM "/Psionics/" array_get_propdirs "|" array_join "}" }cat smatch not if { "My goodness, I dont know what your talking about!" }yerf else { "Nations" me @ "Nationality" getstatstr todir "Psionics" }rpinfo tmp @ emerge if psicost @ 20 - psicost ! then me @ psicost @ spend if { "^RED^You couldnt afford it, you needed " psicost @ "DP, you have " me @ DP "DP." }yerf else me @ "psi/1" tmp @ capitalize setstat { "^GREEN^You got into " tmp @ capitalize " psionics for " psicost @ "DP." }yerf me @ { "Psionics" tmp @ }bonus 1 mutex ! then then else me @ "psi/1" getstat not if { "^RED^You must choose a primary psionics first." }yerf exit then { "^CYAN^Please select one to be your secondary psionics: " }yerf read tmp ! tmp @ { "{" RPSYSTEM "/Psionics/" array_get_propdirs "|" array_join "}" }cat smatch not if { "My goodness, I dont know what your talking about!" }yerf else { "Nations" me @ "Nationality" getstatstr todir "Psionics" }rpinfo tmp @ emerge if psicost @ 20 - psicost ! then me @ psicost @ 20 - spend if { "^RED^You couldnt afford it, you needed " psicost @ 20 - "DP, you have " me @ DP "DP." }yerf else me @ "psi/2" tmp @ capitalize setstat { "^CYAN^You got into " tmp @ capitalize " psionics for " psicost @ 20 - "DP." }yerf me @ { "Psionics" tmp @ }bonus 1 mutex ! then then then end "{-1|-2}" smatch when cmode @ CHAR_IN_CHARGEN = if opt @ "1" smatch if me @ "psi/1" getstat if me @ "psi/1" 0 setstat me @ 0 psicost @ - spend pop { "^GREEN^Your primary psionics was removed." }yerf me @ { "Psionics" tmp @ }-bonus then else me @ "psi/2" getstat if me @ "psi/2" 0 setstat me @ 0 psicost @ 20 - - spend pop { "^GREEN^Your secondary psionics was removed." }yerf me @ { "Psionics" tmp @ }-bonus then then then end "-[^12]*" smatch when cmode @ CHAR_IN_CHARGEN = if opt @ 1 strcut swap pop opt ! me @ "psi/gifts/" opt @ strcat getstat if me @ "@rp/psi/gifts" array_get_propvals array_count 4 >= if 4 else 0 then tmp ! opt @ "Savant" smatch if me @ "@rp/psi/Savant" array_get_propvals array_keys array_make tmp2 ! "Skills" header tellme tmp2 @ 4 wrap_items_fixed atellme LINE { "Please enter a skill in which to remove to your Savant profile: " }yerf read tmp3 ! tmp3 @ tmp2 @ emerge if me @ "psi/Savant/" tmp3 @ strcat over over getstat -- setstat { "^GREEN^Removed." }yerf me @ 0 tmp @ - spend pop me @ "psi/Gifts/" opt @ capitalize strcat over over getstat -- setstat { "^GREEN^You removed the gift ^YELLOW^" opt @ capitalize "^GREEN^ for ^CYAN^" tmp @ "DP^GREEN^." }yerf me @ { "Psionics" opt @ expandVaus }-bonus else { "^RED^Unown skill." }yerf then else me @ 0 tmp @ - spend pop me @ "psi/Gifts/" opt @ capitalize strcat over over getstat -- setstat { "^GREEN^You removed the gift ^YELLOW^" opt @ capitalize "^GREEN^ for ^CYAN^" tmp @ "DP^GREEN^." }yerf me @ { "Psionics" opt @ expandVaus }-bonus then else { "^RED^I couldnt find that gift to remove." }yerf then then end "[LQ]" smatch when 1 mutex ! end default pop allowedGifts @ opt @ emerge if me @ giftcost tmp ! me @ tmp @ spend if { "^RED^You couldn't afford it, you needed " tmp @ "DP, you have " me @ xp "DP." }yerf else opt @ "Savant" smatch if RPSYSTEM "/Skills/" array_get_propdirs tmp2 ! "Skills" header tellme tmp2 @ 4 wrap_items_fixed atellme LINE { "Please enter a skill in which to add to your Savant profile: " }yerf read tmp3 ! tmp3 @ tmp2 @ emerge if me @ "psi/savant/" tmp3 @ strcat over over getstat ++ setstat { "^GREEN^Added." }yerf me @ "psi/Gifts/" opt @ capitalize strcat over over getstat ++ setstat { "^GREEN^You bought the gift ^YELLOW^" opt @ capitalize "^GREEN^ for ^CYAN^" tmp @ "DP^GREEN^." }yerf me @ { "Psionics" opt @ expandVaus }bonus else { "^RED^Unown skill." }yerf then else me @ "psi/Gifts/" opt @ capitalize strcat over over getstat ++ setstat { "^GREEN^You bought the gift ^YELLOW^" opt @ capitalize "^GREEN^ for ^CYAN^" tmp @ "DP^GREEN^." }yerf me @ { "Psionics" opt @ expandVaus }bonus then then else { "^RED^I didn't recognize that as a gift you could take..." }yerf then end endcase repeat mutex @ until murr @ "Q" smatch until READ_SHOOTS_BLANKS ; SAFECALL psionics : getUsableOrders[ -- a:orders ] { RPSYSTEM "/Orders/" array_get_propdirs foreach var! tmp pop { "Orders" tmp @ "order" }rpinfo RPSYSTEM { "Orders/" tmp @ "/" }cat array_get_propdirs array_count or if { "Orders" tmp @ "_delist" }rpinfo not if tmp @ then then repeat }array ; : orders var value var item var tmp READ_SHOOTS_BLANKS getUsableOrders var! myOrders "Orders" header tellme { myOrders @ foreach value ! item ! { item @ ++ tostr 2 rj ") " value @ { "Orders" value @ "Order" }rpinfo if " (" { "Orders" value @ "Order" }rpinfo ")" then }cat FASTCOLOR repeat }array atellme LINE { "Which order do you want? Enter a single number." }yerf { "Remember that taking 2 or more orders requires staff approval." }yerf { "This option will exit after your attempt to select a new order: " }yerf read atoi -- var! murr murr @ 0 myOrders @ array_count -- .. not if { "^RED^Invalid order." }yerf else me @ 10 spend if { "^RED^Unable to afford it." }yerf else myOrders @ murr @ [] var! cur me @ "or/" cur @ strcat getstat if { "^RED^" cur @ capitalize " can only be taken once." }tell else me @ "or/" cur @ strcat over over getstat ++ setstat { "Orders" cur @ "Skills" }rpinfo dup not if pop { "Orders" { "Orders" cur @ "Order" }rpinfo "Skills" }rpinfo then mklist var! newSkills begin { "You get to pick one of the following skills: " newskills @ array_commas }yerf { "Please select one of the above, and you will get a free point in it." }yerf read var! nskill nskill @ "_" " " subst { "{" newskills @ "|" array_join "}" }cat "_" " " subst smatch if nskill @ "Resources" smatch if me @ "@/m/Resources" over over getstat ++ setstat { "^GREEN^" nskill @ " +1" }yerf break else me @ "@/s/" nskill @ strcat over over getstat ++ setstat { "^GREEN^" nskill @ " +1" }yerf break then else { "^RED^Not a valid choice, durrrrh..." }yerf then repeat me @ { "Orders" cur @ }bonus then then then READ_SHOOTS_BLANKS ; SAFECALL orders : getValidAbilities[ d:target -- a:abilities ] { me @ "/@rp/or/" array_get_propvals foreach pop var! cur RPSYSTEM "/Orders/" cur @ strcat array_get_propdirs array_count if RPSYSTEM "/Orders/" cur @ strcat array_get_propdirs array_vals pop else RPSYSTEM "/Orders/" { "Orders" cur @ "Order" }rpinfo strcat array_get_propdirs array_vals pop then repeat }array ; : expandVaus2[ s:ability -- s:order/ability ] RPSYSTEM "/Orders/" array_get_propdirs foreach swap pop var! cur { "Orders" cur @ ability @ "Desc" }rpinfo if { cur @ "/" ability @ }cat then repeat "" ; : abilities READ_SHOOTS_BLANKS var tmp var tmp2 me @ getValidAbilities var! sysAbilities "Abilities you can take" header tellme sysAbilities @ 3 wrap_items_fixed qmorph atellme begin "Abilities you have" header tellme { me @ "/@rp/ab/" array_get_propvals foreach toint var! value var! item { item @ value @ toint 1 > if " [" value @ "]" then }cat repeat }array 3 wrap_items_fixed qmorph atellme LINE { "Enter the name of an ability to add, seperate multiple entries with ','" }yerf { "Each one costs 5DP. Or ... enter ^RED^Q^ ^ to quit: " }yerf read "," ", " subst "," explode_array foreach var! murr pop murr @ "Q" smatch not if murr @ sysAbilities @ emerge not if { "^RED^Invalid skill specified: " murr @ }yerf else me @ "ab/" murr @ strcat getstat if { "^RED^" murr @ capitalize " can only be taken once." }tell continue then me @ 5 spend not if me @ "ab/" murr @ capitalize strcat over over getstat ++ setstat { "^GREEN^" murr @ capitalize " ability bought for ^CYAN^5^GREEN^DP." }yerf me @ { "Orders" murr @ expandVaus2 }bonus else { "^RED^Could not afford " murr @ capitalize " you have " me @ DP ", you need 5DP." }yerf then then then repeat murr @ "Q" smatch until READ_SHOOTS_BLANKS ; SAFECALL abilities : cg.reset READ_SHOOTS_BLANKS { "^RED^Are you sure you want to reset your sheet and everything? Type YES in all caps to continue." }yerf read "YES" strcmp not if { "Your sheet is going byebye..." }yerf paranoia if AVATAR { "!wc #" me @ " just reset their sheet." }cat force then me @ "/@rp/" remove_prop { "It's dead, Jim." }yerf { "Hard restarting chargen.." }yerf me @ "chargen" force pid kill else { "You abort the spell at the last moment. Whew." }yerf then READ_SHOOTS_BLANKS ; SAFECALL cg.reset : rpinfo command @ var! x "+rpinfo" command ! { "Enter a term to search for: " }yerf read #1029 call x @ command ! ; SAFECALL rpinfo : MainMenu.create $def MENU_CHARGEN 1 $def MENU_PC 2 $def MENU_ANY 3 $def MENU_COMMON 4 $def STEPS "123456789ABCDEFGZ" { "1" { "nation" "Nations" MENU_CHARGEN }array "2" { "races" "Races" MENU_CHARGEN }array "3" { "attrs" "Attributes" MENU_ANY }array "4" { "skills" "Skills" MENU_ANY }array "5" { "specialties" "Specialties" MENU_COMMON }array "6" { "size" "Size" MENU_CHARGEN }array "7" { "resource-cg" "Resources" MENU_COMMON }array "8" { "orders" "Orders" MENU_COMMON }array "9" { "abilities" "Abilities" MENU_COMMON }array "A" { "psionics" "Psionics" MENU_COMMON }array "B" { "magics" "Sorcery" MENU_COMMON }array "C" { "schools" "Schools" MENU_COMMON }array "D" { "effects" "Effects" MENU_COMMON }array "E" { "talents" "Talents" MENU_COMMON }array "F" { "powers" "Powers" MENU_COMMON }array "G" { "specifics" "Specifics" MENU_COMMON }array "R" { "rpinfo" "RPInfo" MENU_COMMON }array "S" { "sheet" "Display sheet" MENU_COMMON }array "X" { "reset" "Reset sheet" MENU_CHARGEN }array "Z" { "finish" "Finish chargen" MENU_CHARGEN }array }dict mainMenu ! ; : nextStep[ str:curStep -- ] cmode @ 16 < if me @ "step" getstat var! myStep STEPS curstep @ instr STEPS mystep @ instr >= if me @ "step" STEPS STEPS curstep @ instr ++ 1 midstr dup not if pop "Z" then setstat then then ; : dependencies[ d:target s:step -- a:yip ] target @ "/@rp/Chargen/Steps/" array_get_propvals array_keys array_make var! stepz { "System/Chargen/Dependencies" step @ }rpstat dup if " " explode_array var! depends stepz @ depends @ array_diff else array_make then ; : restrictions[ d:target s:step -- a:yip ] target @ "/@rp/Chargen/Steps/" array_get_propvals array_keys array_make var! stepz { "System/Chargen/Restrictions" step @ }rpstat dup if " " explode_array var! restricts restricts @ stepz @ array_intersect else array_make then ; : dependency?[ str:step -- int:yip ] me @ step @ restrictions if -1 exit then me @ step @ dependencies not if 1 exit then 0 ; : MainMenu.display[ str:item -- ] mainMenu @ item @ [] var! tmp tmp @ 0 [] var! section tmp @ 1 [] var! sectionName tmp @ 2 [] var! sectionType { cmode @ CHAR_IN_CHARGEN = if sectionType @ MENU_CHARGEN = sectionType @ MENU_ANY = sectionType @ MENU_COMMON = or or if item @ dependency? 0 > if { item @ me @ "step" getstat smatch if "^PURPLE^" else "^GREEN^" then { item @ ") " }cat 3 lj "^CYAN^)^YELLOW^" ")" subst { sectionName @ ":" }cat 15 lj " ^NORMAL^" }cat else { item @ dependency? not if "^RED^" else "^BLUE^" then { item @ ") " }cat 3 lj { sectionName @ ":" }cat 15 lj " ^NORMAL^" }cat then else { "^GLOOM^" { item @ ") " }cat 3 lj { sectionName @ ":" }cat 15 lj " ^NORMAL^" }cat then else sectionType @ MENU_PC = sectionType @ MENU_ANY = sectionType @ MENU_COMMON = or or if cmode @ CHAR_IN_CHARGEN_PC = if item @ dependency? 0 > if { item @ me @ "step" getstat smatch if "^PURPLE^" else "^GREEN^" then { item @ ") " }cat 3 lj "^CYAN^)^YELLOW^" ")" subst { sectionName @ ":" }cat 15 lj " ^NORMAL^" }cat else { item @ dependency? not if "^RED^" else "^BLUE^" then { item @ ") " }cat 3 lj { sectionName @ ":" }cat 15 lj " ^NORMAL^" }cat then else { "^GREEN^" { item @ ") " }cat 3 lj "^CYAN^)^YELLOW^" ")" subst { sectionName @ ":" }cat 15 lj " ^NORMAL^" }cat then else { "^GLOOM^" { item @ ") " }cat 3 lj { sectionName @ ":" }cat 15 lj " ^NORMAL^" }cat then then "^YELLOW^" section @ case "nation" smatch when { "Nationality" yip "; Faith: " "Faith" yip "; Allegiances: " "Allegiances" yip }cat end "attrs" smatch when { "^RED^" { "Physical: " me @ mphysical }cat 15 lj "^GREEN^" { "Mental: " me @ mmental }cat 15 lj "^CYAN^" { "Spiritual: " me @ mspiritual }cat 15 lj "^YELLOW^" { "Social: " me @ msocial }cat 15 lj }cat end "size" smatch when "m/size" yip end "skills" smatch when "See your sheet." end "sheet" smatch when "Display what is currently on your sheet so far." end "powers" smatch when "See your sheet." end "magics" smatch when "See your sheet." end "schools" smatch when "See your sheet." end "effects" smatch when "See your sheet." end "talents" smatch when "See your sheet." end "specifics" smatch when "See your sheet." end "resource-cg" smatch when "m/resources" yip end "psionics" smatch when { "^GREEN^Primary: " me @ "psi/1" getstatstr "^NORMAL^; ^CYAN^Secondary: " me @ "psi/2" getstatstr }cat end "aspects" smatch when { "^GREEN^" "Area: " me @ "as/area" getstatstr "; " "Effect: " me @ "as/effect" getstatstr "; " "Range: " me @ "as/range" getstatstr "; " "Target: " me @ "as/target" getstatstr "; " "Time: " me @ "as/time" getstatstr }cat end "orders" smatch when { "^PURPLE^" me @ "@rp/or" array_get_propvals array_keys array_make array_commas }cat end "abilities" smatch when "See your sheet." end "specialties" smatch when "See your sheet." end "rpinfo" smatch when "Get more information about practically anything!" end "spells" smatch when "Run the spell-maker (also +spell/make outside this proggie)" end "races" smatch when "Races" yip end "finish" smatch when "Submit your character for approval." end "reset" smatch when "Delete your sheet and start over." end endcase }tell ; : sheet "" #1162 call ; SAFECALL sheet : spells "$muf/spellmaker" match int 0 < if { "^RED^I couldn't find a spellmaking program! Maybe it's not done yet." }tell else "$muf/spellmaker" match call then ; SAFECALL spells $def BBOARD #52 $def BBLOC "/@Boards/Num/9/Msgs/" : removeRequest[ d:target -- ] target @ name var! myname BBOARD BBLOC array_get_propdirs foreach swap pop var! tmp BBOARD { BBLOC tmp @ "/Subject" }cat getprop dup not if pop "" then myname @ "*" strcat smatch if AVATAR { "+bbdelete 9/" tmp @ }cat force then repeat ; : approve param @ not if { "Format: @approve [=]" }yerf exit then param @ "=" split var! note pmatch var! target target @ int 0 < if { "Who the heck is that?" }yerf exit then target @ "character_mode" 256 setstat { "^GREEN^You have just *approved* " target @ " sheet!" note @ if " (" note @ ")" then }yerf target @ { "^GREEN^Your character sheet has just been *approved* by " me @ "!" note @ if " (" note @ ")" then }cat "FFa2RPS.Chargen" pretty ansi_notify paranoia if AVATAR { "!wc #" target @ "'s character sheet has just been *approved* by " me @ "." note @ if " (" note @ ")" then }cat force then AVATAR { "p #mail " target @ "=Your character sheet has been *approved* by " me @ " as of " "%C %X" systime timefmt "." note @ if " (" note @ ")" then }cat force AVATAR { "@wln " target @ "=SYSTEM: " target @ "'s character sheet was *approved* by " me @ " as of " "%C %X" systime timefmt "." note @ if " (" note @ ")" then }cat force target @ "approvedby" me @ setstat target @ "approvedat" systime setstat target @ "@/+dp" 0 setprop target @ removeRequest ; : disapprove param @ not if { "Format: @disapprove [=]" }yerf exit then param @ "=" split var! note pmatch var! target target @ int 0 < if { "Who the heck is that?" }yerf exit then target @ "character_mode" 4 setstat { "^RED^You have just *disapproved* " target @ " sheet!" note @ if " (" note @ ")" then }yerf target @ { "^RED^Your character sheet has been *disapproved* by " me @ "... your character has been reverted to chargen status." note @ if " (" note @ ")" then }cat "FFa2RPS.Chargen" pretty ansi_notify paranoia if AVATAR { "!wc #" target @ "'s character sheet has been *disapproved* by " me @ "." note @ if " (" note @ ")" then }cat force then AVATAR { "p #mail " target @ "=Your character sheet has been *disapproved* by " me @ " as of " "%C %X" systime timefmt "." note @ if " (" note @ ")" then }cat force AVATAR { "@wln " target @ "=SYSTEM: " target @ "'s character sheet was *disapproved* by " me @ " as of " "%C %X" systime timefmt "." note @ if " (" note @ ")" then }cat force target @ "disapprovedby" me @ setstat target @ "disapprovedat" systime setstat target @ removeRequest ; : main READ_SHOOTS_BLANKS var murr param ! me @ mlevel 5 >= if command @ "@approve" smatch if approve exit then command @ "@disapprove" smatch if disapprove exit then then MainMenu.Create me @ "character_mode" getstat cmode ! cgstage begin { "FFa2RPS Character Developer, editing " me @ unparseobj }cat header tellme mainmenu @ foreach pop var! item item @ MainMenu.Display repeat cmode @ 16 < if { "^GREEN^.) Toggle Chargen and PC mode (Currently " cmode @ CHAR_IN_CHARGEN = if "^GREEN^Chargen" else "^YELLOW^PC" then ")" }cat FASTCOLOR tellme else { "^GLOOM^.) Toggle Chargen and PC mode (Currently " cmode @ CHAR_IN_CHARGEN = if "^GREEN^Chargen" else "^YELLOW^PC" then ")" }cat FASTCOLOR tellme then { "^GREEN^Q) Quit chargen" FASTCOLOR }tell LINE { "^GREEN^" me @ dp 1 fchop " DP remaining to spend, ^PURPLE^" me @ power " total power (spent DP)" }tell LINE cmode @ CHAR_IN_CHARGEN = if { "Press ENTER alone to enter the highlighted step." }yerf else { "Press ENTER alone to leave the character editor." }yerf then { "Please select an option or press ^RED^Q^NORMAL^ to quit:" }yerf read murr ! murr @ not if cmode @ CHAR_IN_CHARGEN = if me @ "step" getstat murr ! else "Q" murr ! then then cmode @ CHAR_IN_CHARGEN = cmode @ CHAR_IN_CHARGEN_PC = or if murr @ dependency? 0 = if { { "^RED^There are steps you must do first before selecting this option. Please complete the following step(s): " { me @ murr @ dependencies foreach swap pop mainmenu @ swap [] 1 [] repeat }array array_commas }yerf continue then murr @ dependency? -1 = if { { "^BLUE^This step is now restricted because you completed the following step(s): " { me @ murr @ restrictions foreach swap pop mainmenu @ swap [] 1 [] repeat }array array_commas }yerf continue then then murr @ "{Q|.}" smatch not if mainMenu @ murr @ [] var! opt opt @ not if { "That was an invalid selection, try again." }yerf else opt @ 0 [] var! section opt @ 2 [] MENU_COMMON = if prog section @ call me @ "chargen/steps/" murr @ strcat 1 setstat else cmode @ CHAR_IN_CHARGEN = if opt @ 2 [] MENU_CHARGEN = opt @ 2 [] MENU_ANY = or if prog "cg." section @ strcat call me @ "chargen/steps/" murr @ strcat 1 setstat else { "^RED^This option is not valid during chargen (and thus, grayed out). Please try again." }yerf then else opt @ 2 [] MENU_PC = opt @ 2 [] MENU_ANY = or if prog "pc." section @ strcat call me @ "chargen/steps/" murr @ strcat 1 setstat else { "^RED^This option is not valid after chargen (and thus, grayed out). Please try again." }yerf then then then then then murr @ "." smatch cmode @ 16 < and if cmode @ CHAR_IN_CHARGEN = if CHAR_IN_CHARGEN_PC cmode ! { "^GREEN^Now in Chargen mode." }tell else CHAR_IN_CHARGEN cmode ! { "^GREEN^Now in Player Character mode." }tell then else murr @ nextstep then murr @ "Q" smatch until { "Ja ne!" }yerf READ_SHOOTS_BLANKS ;