@program #3564 1 1000 d i $include $lib/alynna $include $lib/gary'smufutils-strings $include $lib/gary'smufutils-lists $include $lib/gary'smufutils-misc $include $lib/rp $include $muf/rp/utils $include $muf/rp/boxutils $include $muf/Scrp/registry $def VERSION prog "_version" getpropstr $def ERROR "Try '" command @ strcat " #help' for help." strcat sctell exit $define .tell .ansi_tell $enddef lvar target lvar hidecheck $def RPS "$RPSYSTEM" match : linetell (s --) (tell's a string as a list of lines.) 71 line_split begin swap 71 centre LINE " " strcat swap strcat LINE strcat .tell 1 - dup not until pop ; : makeFloat (?--i) dup string? if dup "." instring if strtof else atoi then then dup float? not if float then ; : floatStr (? -- s) makeFloat "%4.2f" fmtstring 7 right ; : FishNext (??) (Gets the next item from an Element_list) dup 1 element_list_get swap 1 element_list_delete swap ; : splitJobs (d s -- s s) (Takes an object and a list of jobs, returns two lists - one of what jobs they have with jp in, one of what jobs don't) "" swap "" swap "|" explode (Object ListOf2+ ListOfNotgot In..I1 I) begin swap over 4 + pick over RPutils.getJobJP if (Put in list 1!) over 3 + rotate swap element_list_add over 2 + -1 * rotate else (Put in list 2!) over 2 + rotate swap element_list_add over 1 + -1 * rotate then 1 - dup not until pop rot pop ; : makeJobItem (s -- s) (Special call just to get a job item) dup target @ "job" getstatstr over stringcmp not if "^GREEN^>^CYAN^" swap strcat "^GREEN^<" strcat then 12 left TEXTCOLOR swap strcat OPENITEM strcat target @ 3 pick RPutils.getJobLevel intostr 2 right strcat CLOSEITEM strcat "^GREEN^" strcat target @ 3 pick RPutils.getJobJP target @ 4 pick RPutils.getJobSpentJP - floatstr hidecheck @ if pop "???.??" then 7 right strcat "^FOREST^/^GREEN^" strcat target @ 3 pick RPutils.getJobJP floatstr hidecheck @ if pop "???.??" then 7 right strcat swap pop ; : convertNumber (i -- s) (Converts a number 1 to 10 into a secret string!) "^GREEN^>>" swap (String number) dup 8 < if swap pop "^FOREST^|>" swap then dup 6 < if swap pop "||" swap then dup 4 < if swap pop "^CRIMSON^<|" swap then dup 2 < if swap pop "^RED^<<" swap then pop ; : makeItem (s i -- s) (Makes an item of that length) 4 - over dup "/" rinstr if dup "/" rinstr strcut swap pop then swap left capital TEXTCOLOR swap strcat OPENITEM strcat swap target @ swap getstatint hideCheck @ if convertNumber else intostr then 2 right strcat CLOSEITEM strcat ; : doSection (s --) 0 swap (Have we shown anything?) 0 swap (Units Used) "" swap (Line) "" (Start) (ShowSomething? UnitsUsed LineSoFar ItemType Next) begin over swap Rputils.nextItem dup "" stringcmp not not while dup (Need to check if we need special/! for a special) 3 pick "special" stringcmp not if "special/" swap strcat then target @ swap getstatint if dup 3 pick "special" stringcmp not if "special/" swap strcat then 23 makeitem (ShowSomething? UnitsUsed LineSoFar ItemType Next NextPart) (Set shownSomething) 6 rotate pop 1 -6 rotate 5 pick 0 = if (Need to increase UnitsUsed and stick to LineSoFar) 4 rotate swap strcat (ShowSomething? UnitsUsed ItemType Next LineSoFar) 4 rotate 1 + -4 rotate -3 rotate else 5 pick 1 = if (ShowSomething? UnitsUsed LineSoFar ItemType Next NextPart) (Need to stick the strings together with a space between and do 1 + ) 5 rotate 1 + -5 rotate 4 rotate " " strcat swap strcat -3 rotate else (ShowSomething? UnitsUsed LineSoFar ItemType Next NextPart) 5 rotate pop 0 -5 rotate (Need to stick the strings together with a space between. Tell the string. Store a blank string. And set UnitsUsed to 0 again.) 4 rotate " " strcat swap strcat linetell "" -3 rotate then then then repeat pop pop (ShowSomething? UnitsUsed LineSoFar) rot if (Show last bit if needed) swap if 71 left LINE " " strcat swap strcat LINE strcat .tell then else pop pop (Show nothing!) " -- Nothing! -- " linetell then ; : basicSheet (Draws a basic sheet, target should be set) LINECOLOR ".__" strcat OPENITEM strcat "Sheet V" strcat VERSION strcat CLOSEITEM strcat LINECOLOR strcat "________________________________________________________." strcat .tell (Header - Who/what is this?) target @ name ", the " strcat target @ "sex" getpropstr dup "" stringcmp not if pop "genderless" then strcat " " strcat target @ "species" getpropstr dup "" stringcmp not if pop "undefined" then strcat linetell target @ "%n" getpropstr dup "" stringcmp not not if " (AKA " swap strcat "~&R" strcat TEXTCOLOR strcat ")" strcat linetell then target @ owner me @ dbcmp me @ RPlib.staff? or if target @ "faction" getstatstr "factions/" swap strcat RPS swap getpropstr dup "none" stringcmp not not if "Part of \"" swap strcat "\"" strcat linetell else pop then then FOOTER .tell (First information line) "HP" OPENITEM strcat "^BRED^" strcat target @ "hp" getstatint intostr 5 right "/" strcat target @ RPlib.getMaxHP intostr 5 right strcat 27 left target @ "hp" getstat target @ Rplib.getMaxHP swap 100 * swap / (Bar %) dup rot swap intostr 3 right strcat "%" strcat swap 31 * 100 / dup 0 < if pop 0 then ansi_strcut "^BBLUE^" swap strcat strcat strcat "^BBLACK^" strcat CLOSEITEM strcat " Rank" strcat OPENITEM strcat target @ "rank" getstatstr "rank/" swap strcat RPS swap getpropstr 16 centre strcat CLOSEITEM strcat " Meta?" strcat OPENITEM strcat target @ "magery" getstat 5 > if "Yes" else "No" then hidecheck @ if pop "???" then 3 left strcat CLOSEITEM strcat linetell (Second information line) "MP" OPENITEM strcat "^BBLUE^" strcat target @ "MP" getstatint intostr 5 right "/" strcat target @ RPlib.getMaxMP intostr 5 right strcat 27 left target @ "mp" getstat target @ RPlib.getMaxMP swap 100 * swap / (Bar %) dup rot swap intostr 3 right strcat "%" strcat swap 31 * 100 / dup 0 < if pop 0 then ansi_strcut "~&--0" swap strcat strcat strcat "^BBLACK^" strcat CLOSEITEM strcat " Align" strcat OPENITEM strcat target @ "align" getstatstr "align/" swap strcat RPS swap getpropstr 15 centre strcat CLOSEITEM strcat " Mage?" strcat OPENITEM strcat target @ "mage?" getstat if "Yes" else "No" then hidecheck @ if pop "???" then 3 left strcat CLOSEITEM strcat linetell (Third information line) "TP" OPENITEM strcat "^BGREEN^" strcat "^YELLOW^" strcat target @ "TP" getstatint intostr 5 right "/" strcat target @ RPlib.getMaxTP intostr 5 right strcat 27 left target @ "TP" getstat target @ RPlib.getMaxTP swap 100 * swap / (Bar %) dup rot swap intostr 3 right strcat "%" strcat swap 31 * 100 / dup 0 < if pop 0 then ansi_strcut "~&--0" swap strcat strcat strcat "^BBLACK^" strcat CLOSEITEM strcat " Growth" strcat OPENITEM strcat target @ "growth" getstatint 100 + intostr 3 right "%" strcat hidecheck @ if pop "???" then strcat CLOSEITEM strcat " Gil" strcat OPENITEM strcat target @ "gil" getstatfloat 2 fchop 8 right strcat CLOSEITEM strcat 70 left LINE " " strcat swap strcat LINE strcat .tell (ATTRIBUTES. Stored on my registery) "attribute" doSection hideCheck @ me @ "special/peek" getstatint not AND not if (STOP HERE IF HIDING!) "Job Status" divider .tell .tell target @ Rputils.getjobs target @ swap splitJobs swap dup "" stringcmp not not if 0 "" (List UnitsUsed Line) begin 3 pick element_list_length while rot fishNext swap -4 rotate makeJobItem (List UnitsUsed Line Next) 3 pick 0 = if strcat swap 1 + swap else (OLD - 3 a line) ( 3 pick 1 = if " " swap strcat strcat swap 1 + swap else) ( " " swap strcat strcat linetell pop 0 "") ( then) (New!) " ^VIOLET^-^PURPLE^|^VIOLET^- " swap strcat strcat linetell pop 0 "" then repeat rot pop (UnitsUsed Line) over if 69 left LINE " " strcat swap strcat LINE strcat .tell pop else pop pop then else "No jobs!" linetell then FOOTER .tell "|" english_list "Available jobs: " swap strcat linetell (Skills. Stored under default on RPS) "Basic Skills" divider .tell .tell "skill" doSection (Magic Talents. Only sane way of doing this is via the propdir on the target) "Magic Talents" divider .tell .tell "special" doSection then LINECOLOR "|___________________________________________________" strcat OPENITEM strcat "Try 'sheet #help'" strcat CLOSEITEM strcat LINECOLOR strcat "__|" strcat .tell ; : main ("Sheet Call. Who=" me @ nn strcat "/What=" strcat command @ strcat "/With=" strcat over strcat prog owner swap notify) dup "" stringcmp not if pop "me" then dup "#help" stringcmp not if "SC2 Sheet1" .tell "Simply use:" .tell " sheet" .tell "To see your own sheet, or:" .tell " sheet " .tell "To see someone elses." .tell "In the case of viewing someone elses, you will not be shown detail unless you are a member of staff, however you will be shown a shorthand on their stats:" .tell " ^GREEN^>> ^WHITE^=^GREEN^ Great values." .tell " ^FOREST^|> ^WHITE^=^FOREST^ Good values." .tell " || = Moderate values." .tell " ^CRIMSON^<| ^WHITE^= ^CRIMSON^Bad values." .tell " ^RED^<< ^WHITE^= ^RED^Terrible values." .tell "Finally, if you have the special 'peek', you can see all of someones skills/specials too in this manner." .tell exit then verboseSmartMatch dup ok? if target ! target @ me @ dbcmp target @ owner me @ dbcmp OR if 0 hidecheck ! basicSheet else me @ rplib.staff? if "NOTE : You can view this sheet because of being staff." .tell 0 hidecheck ! basicSheet else me @ "special/peek" getstatint if "NOTE : You can view this sheet because of having peek." .tell 1 hidecheck ! basicSheet else 1 hidecheck ! basicSheet then then then then ; . c q