@program RCSsheet.muf 1 1000 d i $include $lib/alynna $include $lib/rcs lvar param lvar stats1 lvar stats2 : translatestats ( s -- s ) case "AGI" smatch when "Agility" end "APP" smatch when "Appearance" end "BLD" smatch when "Build" end "CRE" smatch when "Creativity" end "FIT" smatch when "Fitness" end "INF" smatch when "Influence" end "KNO" smatch when "Knowledge" end "PER" smatch when "Perception" end "PSY" smatch when "Psyche" end "WIL" smatch when "Willpower" end "STR" smatch when "Strength" end "HEA" smatch when "Health" end "STA" smatch when "Stamina" end "UD" smatch when "Unarmed Damage" end "AD" smatch when "Armed Damage" end "SS" smatch when "System Shock" end endcase ; : makearrays ( -- ) { "AGI" "APP" "BLD" "CRE" "FIT" "INF" "KNO" "PER" "PSY" "WIL" } array_make stats1 ! { "STR" "HEA" "STA" "UD" "AD" "SS" } array_make stats2 ! ; : dumpstats ( d -- ) var target var item var value var count var linestore target ! makearrays ( stats1 ) -1 count ! "" linestore ! stats1 @ foreach item ! pop target @ "stat/" item @ strcat getrcs value ! count @ 1 + count ! linestore @ str "^YELLOW^[^CYAN^" value @ tostr 2 rj "^YELLOW^]^GREEN^ " item @ tostr translatestats dup strlen 2 > if capitalize else toupper then 11 lj "^NORMAL^" cat strcat linestore ! count @ 5 % 4 = if linestore @ tellme "" linestore ! then repeat count @ 5 % 4 < if linestore @ tellme "" linestore ! then "Extended stats" header tellme ( stats2 ) -1 count ! "" linestore ! stats2 @ foreach item ! pop target @ "stat/" item @ strcat getrcs value ! count @ 1 + count ! linestore @ str "^YELLOW^[^CYAN^" value @ tostr 2 rj "^YELLOW^]^GREEN^ " item @ tostr translatestats dup strlen 2 > if capitalize else toupper then 21 lj "^NORMAL^" cat strcat linestore ! count @ 3 % 2 = if linestore @ tellme "" linestore ! then repeat count @ 3 % 2 < if linestore @ tellme "" linestore ! then "Skills" header tellme ( Skills ) -1 count ! "" linestore ! target @ "/~rcs/skill/" array_get_propvals foreach value ! item ! count @ 1 + count ! linestore @ str "^YELLOW^[^CYAN^" value @ tostr 2 rj "^YELLOW^]^GREEN^ " item @ tostr dup strlen 2 > if capitalize else toupper then 15 lj "^NORMAL^" cat strcat linestore ! count @ 4 % 3 = if linestore @ tellme "" linestore ! then repeat count @ 4 % 3 < if linestore @ tellme "" linestore ! then ; : main var target param ! param @ not if me @ target ! else param @ resolve target ! then target @ int 0 < if "Unknown or ambiguous target." "RCSSheet" pretty tellme exit then me @ target @ controls not if me @ staff? not if "Permission to view sheet denied." "RCSSheet" pretty tellme exit then then me @ target @ controls if target @ unparseobj else target @ then header tellme target @ dumpstats "RCS sheet v1.0" footer tellme ; . c q