@program #4167 1 1000 d i $def HR "^blue^>^yellow^------------------------------------------------------------------------ --^blue^<^ ^" .tell $def notify ansi_notify $def notify_exclude ansi_notify_exclude $include #2123 $include $lib/rp $include $lib/alynna lvar toggle lvar repeater lvar current lvar target lvar parameters lvar s1 lvar user : time2long dup S1 ! 60 > not if "less than a minute" else S1 @ 60 / 60 > not if S1 @ 60 / dup 1 > if " minutes" else " minute" then swap intostr swap strcat else S1 @ 60 / 60 / 24 > not if S1 @ 60 / 60 / dup 1 > if " hours" else " hour" then swap intostr swap strcat ", " strcat S1 @ 60 / begin 60 - dup 60 < until dup 1 > if " minutes" else " minute" then swap intostr swap strcat strcat else S1 @ 60 / 60 / 24 / dup 1 > if " days" else " day" then swap intostr swap strcat ", " strcat S1 @ 60 / 60 / begin 24 - dup 24 < until dup 1 > if " hours" else " hour" then swap intostr swap strcat ", " strcat S1 @ 60 / begin 24 60 * - dup 24 60 * < until begin 60 - dup 60 < until dup 1 > if " minutes" else " minute" then swap intostr swap strcat strcat strcat then then then ; : mdisp ( -- ) HR "Mentor: ^green^" 12 left user @ "Mentor" getstatint dup not if pop "None" else dbref name then 25 center strcat "^ ^ Student: ^green^" 12 left strcat user @ "Mentored" getstatint dup not if pop "None" else dbref name then 25 center strcat .tell "Subject:^Green^ " 11 left user @ "mentor" getstatint dup not if pop "None" else dbref dup "Mentorjob" getstatstr dup "0" SMATCH not if swap pop user @ "Learnstart" getstatint systime swap - 2.5 * int time2long "/" swap strcat strcat else pop "Job" getstatstr then then 26 center strcat "^ ^ Teaching:^green^ " 12 left strcat user @ "Mentorjob" getstatstr user @ "mentored" getstatint dup not if pop user @ "Plearnstart" getstatint else dbref "Learnstart" getstatint then dup if systime swap - 2.5 * int time2long "/" swap strcat strcat else pop then dup "0" smatch if pop user @ "Job" getstatstr then 25 center strcat .tell HR ; lvar n lvar x1 lvar x2 : xp-display ( -- ) strip dup me @ mlevel 3 > and if pmatch user ! else pop me @ user ! then user @ ok? not if "Invalid target" .tell exit then user @ "xpinit?" getstatstr not if "Initializing XP, you have 7 votes to start" .tell user @ "votes" 7 setstat user @ "xpinit?" "yes" setstat then mdisp str "Votes:" user @ "votes" getstatfloat 1 fchop 10 right strcat " | Received:" strcat user @ "votedfor" getstatint intostr 10 right strcat " | XP: " strcat user @ "XP" getstatfloat user @ "XPspent" getstatfloat - 2 fchop 10 center " | Growth: " strcat user @ "Growth" getstatfloat 100 + 2 fchop "%" cat .tell "Voted For Today: " user @ "voted" getstatstr strcat .tell "Voted by: " 1 repeater ! " " target ! begin repeater @ dbref current ! current @ player? if current @ "voted" getstatstr user @ name " " swap strcat instring if current @ name " " target @ strcat strcat target ! then then repeater @ 1 + repeater ! repeater @ dbref dbtop dbcmp until target @ strcat .tell HR ; : vote ( s -- ) var alter? me @ player? not if "Only players can vote!" .tell exit then "=" explode parameters ! parameters @ 1 = not if "Incorrect Syntax, +vote (someone's name)" .tell exit then .pmatch dup player? not if "You can only vote for players, sorry" .tell pop exit then target ! 0 toggle ! me @ target @ dbcmp if "You can't vote for yourself!" .tell exit then me @ target @ alt? if "That appears to be an alt of yours, if this is a mistake, ask Nuku to fix it" .tell exit then me @ "met/" target @ int intostr strcat getstatint systime swap - 21600 > if "You haven't been with this person in over six hours. You're suppose to vote for people as they RP well, not because you like them or think they're 'swell', thanks!" .tell exit then me @ "voted" getstatstr target @ name instring if "It seems you voted this person already since your refresh, are you sure?" .tell read "y" instring not if "Aborted" .tell exit then then me @ "votes" getstatfloat dup 1 < if pop "You don't have a vote to give, sorry" .tell exit then me @ "voted" getstatstr " " strcat target @ name strcat me @ swap "voted" swap setstat 1 - me @ swap "votes" swap setstat target @ "XP" getstatint 100 * target @ "Growth" getstatfloat 100 + / 44 / int target @ "votedfor" getstatint 1 + target @ "votedfor" rot setstat target @ "votedfor" getstatint dup 1 > if 2.0 / then dup sqrt swap 1 - sqrt - target @ "Growth" getstatfloat 100.0 + * 100.0 / dup target @ "Dedicated?" getstatint dup target @ "@rp/lifepath" getprop and if dup 2 = if pop 2 / dup target @ "Lifepool" getstatfloat + else dup 1 = if pop dup 0.25 * target @ "Lifepool" getstatfloat + swap 0.75 * swap else pop dup 0.75 * target @ "Lifepool" getstatfloat + swap 0.25 * swap then then target @ "Lifepool" rot setstat target @ "XP Deposited in Life Path XP pool(" target @ "Dedicated?" getstatint 25 * intostr "%)" strcat strcat "Lifepath" pretty ansi_notify else pop then target @ "XP" getstatfloat + target @ "XP" rot setstat target @ "XP" getstatint 100 * target @ "Growth" getstatfloat 100 + / 44 / int < if #21 str "Gauntlet " target @ "species" getpropstr " " target @ "Class" getstatstr " gained a level!" cat pop pop then "Vote given!" .tell str "VOTE: " me @ unparseobj " -> " target @ unparseobj cat log_status target @ "You received a vote from " me @ name strcat "! Use +xp to see your current total" strcat notify ; lvar cur lvar max : voteall ( -- ) me @ location contents cur ! begin cur @ player? if cur @ awake? if cur @ me @ dbcmp not if cur @ name vote then then then cur @ next dup ok? if cur ! 0 else pop 1 then until ; : mentormenu ( -- ) me @ user ! mdisp "Would you like to A) Stop being mentored. or B) Mentor someone new. or C) Specify a Basic/Special Skill to teach or D) Stop mentoring. Type any other letter to abort." .tell read dup "A" instring if me @ "mentor" getstatint dup not if pop "You aren't being mentored" .tell exit then dbref "mentored" 0 setstat me @ "mentor" 0 setstat me @ "Learnstart" 0 setstat "Done." .tell exit then dup "C" instring if "What Skill/Special? And we really don't care if you specify a non-existant ability, it won't do anything" .tell read me @ "mentorjob" rot setstat me @ "Mentored" getstatint dup not if pop me @ "PLearnstart" systime setstat else dbref "Learnstart" systime setstat then then dup "D" instring if me @ "mentored" getstatint dup not if pop "You aren't mentoring" .tell exit then dbref "mentor" 0 setstat me @ "mentored" 0 setstat "Done." .tell exit then "B" instring if "Who do you want to mentor?" .tell read .pmatch dup player? not over me @ dbcmp or if "Invalid target." .tell exit then target ! me @ "mentored" getstatint dup if dbref "mentor" 0 setstat me @ "mentored" 0 setstat else pop then target @ "Mentor" getstatint if "That person is already being mentored!" .tell exit then me @ "Mentored" target @ int setstat me @ "Mentored" getstatint dbref "Learnstart" systime setstat target @ "Mentor" me @ int setstat "Done." .tell then mdisp ; : main ( -- ) command @ "+mentor" smatch ( enter mentoring menu ) if mentormenu exit then command @ "+xp" smatch ( Check current number of votes and XP ) if xp-display exit then command @ "+vote" smatch ( Give others XP ) if vote exit then command @ "+vote/all" smatch ( Give others XP ) if voteall exit then command @ "+dedicate" smatch if me @ "Dedicated?" getstatint 3 = if me @ "Dedicated?" 0 setstat "You stop concentrating on your life path" "Lifepath" pretty .tell else me @ "Dedicated?" getstatint 1 + me @ "Dedicated?" rot setstat "Your dedication level is now " me @ "Dedicated?" getstatint 25 * intostr strcat "%" strcat .tell then exit then ; . c q