: say ( s -- ) me @ swap notify ; : break_string ( s i -- s ) "(" over 1 + intostr strcat ")" strcat rot dup rot instr 1 - strcut pop "(" rot intostr strcat ")" strcat swap dup rot instr 2 + strcut swap pop ; : get_stat ( s -- s ) dup string? not if pop "" exit then dup number? if break_string exit then dup "zone" instr if pop 8 break_string exit then dup "food" instr if pop 1 break_string exit then dup "water" instr if pop 2 break_string exit then dup "hp" instr if pop 3 break_string exit then dup "skill" instr if pop 4 break_string exit then dup "kills" instr if pop 5 break_string exit then dup "fails" instr if pop 6 break_string exit then dup "strength" instr if pop 7 break_string exit then pop pop "" exit ; : stat_string ( d -- s ) loc @ ".statloc" getpropstr atoi dbref ".p" rot intostr strcat getpropstr ; : rpad ( s i -- s ) " " swap strcut pop over strlen strcut swap pop swap strcat ; : pad ( s i -- s ) " " swap strcut pop over strlen strcut swap pop strcat ; : do_status ( s -- ) me @ wizard? not if pop me @ else .pmatch then dup not if pop "> Unknown player -- stat failed." say 0 exit then "> Player: [%p]" over name "%p" subst say "> Zone: (%z)" over stat_string 8 break_string "%z" subst say "> Vitals:" say "> Food=%1, Water=%2, Vitality=%3, Skill=%4." 1 4 1 for 3 pick stat_string over break_string 3 rpad "%" rot intostr strcat subst loop say "> Wins=%5, Fails=%6, Strength=%7." 5 7 1 for 3 pick stat_string over break_string 3 rpad "%" rot intostr strcat subst loop say ; : do_reset ( s -- ) .pmatch dup not if pop "> Unknown player -- reset failed." say 0 exit then loc @ ".statloc" getpropstr atoi dbref ".p" 3 pick intostr strcat "(1)10(2)10(3)%hp(4)%sk(5)0(6)0(7)%st(8)0,0(9)" 4 pick "@level" getpropstr atoi 25 * intostr "%hp" subst 4 pick "@level" getpropstr "%sk" subst 4 rotate "@level" getpropstr atoi 10 * intostr "%st" subst 0 addprop "> Game settings initialized -- reset successful." say 1 ; : do_look : do_move exit ; : main ( s -- ) tolower trigger @ name tolower dup "st" 2 strncmp not if pop do_status exit then dup "re" 2 strncmp not if pop do_reset exit then dup "look" instr not if pop do_look exit then dup "north" instr not if pop pop do_move exit then ;