$include $lib/alynna $def LIMIT me @ mlevel 5 >= if 100 else 50 then lvar param : count-puppets ( d -- i ) "*" "XZ" find_array array_count ; : puppet-kill var target var puppet var action param @ match target ! param @ not if "Cant match this." "@puppet" pretty tellme exit then target @ "_puppet/action" getprop action ! target @ "_puppet/puppet" getprop puppet ! { "Recycling action " action @ unparseobj "..." }cat "@puppet" pretty tellme action @ recycle { "Recycling puppet " puppet @ unparseobj "..." }cat "@puppet" pretty tellme puppet @ recycle { "Your puppet is dead." }cat "@puppet" pretty tellme ; : puppet-set var target var puppet var action var sex var species var tdesc var tmp ( basic sanity ) param @ not if "Format: @puppet/set ===" "@puppet" pretty tellme exit then ( extract parameters ) param @ "=" explode tmp ! tmp @ case 2 = when target ! sex ! 0 species ! 0 tdesc ! end 3 = when target ! sex ! species ! 0 tdesc ! end 4 = when target ! sex ! species ! tdesc ! end default "Format: @puppet/set =[[=]=]" "@puppet" pretty tellme exit end endcase target @ match target ! param @ not if "Cant match this." "@puppet" pretty tellme exit then target @ "_puppet/action" getprop action ! target @ "_puppet/puppet" getprop puppet ! sex @ if puppet @ "/sex" sex @ setprop then species @ if puppet @ "/species" species @ setprop then tdesc @ if puppet @ "_/de" tdesc @ setprop then { "Sex, species & description set for " puppet @ unparseobj "." }cat "@puppet" pretty tellme ; : puppet-make var target var target-name var action var action-name var tmp ( Got to have parameters ) param @ not if "Format: @puppet =" "@puppet" pretty tellme exit then ( In fact, got to have 2 ) param @ "=" explode tmp ! tmp @ 2 = not if "Format: @puppet =" "@puppet" pretty tellme exit then ( Store essential data ) target-name ! action-name ! ( Limit the number of puppets one can make ) me @ count-puppets LIMIT >= if "We think you have enough already." "@puppet" pretty tellme exit then ( Make a puppet ) me @ target-name @ newobject target ! { "Created puppet " target @ unparseobj "..." }cat "@puppet" pretty tellme ( Chown the puppet ) target @ me @ setown { "Changed owner of puppet " target @ unparseobj " to " me @ unparseobj "..." }cat "@puppet" pretty tellme ( set the target Z ) target @ "Z" set { "Set puppet " target @ unparseobj " ZOMBIE..." }cat "@puppet" pretty tellme ( Make the action ) me @ action-name @ newexit action ! { "Created action " action @ unparseobj "..." }cat "@puppet" pretty tellme ( Chown the action ) action @ me @ setown { "Changed owner of action " action @ unparseobj " to " me @ unparseobj "..." }cat "@puppet" pretty tellme ( Link it to $nothing ) action @ #-4 setlink { "Linked action " action @ unparseobj " to NIL..." }cat "@puppet" pretty tellme ( Set the succ of the action to use the puppet .. ) action @ { "{null:{force:#" target @ int ",{&arg}}}" }cat setsucc { "Set success message on " action @ unparseobj " to puppet control string..." }cat "@puppet" pretty tellme ( @flock the puppet to the action ) target @ "/@/flk" { "#" action @ int }cat parselock setprop { "Force-locked puppet " target @ unparseobj " to action " action @ unparseobj "..." }cat "@puppet" pretty tellme ( Register action and puppet for easy manipulation. ) target @ "_puppet/action" action @ setprop target @ "_puppet/puppet" target @ setprop action @ "_puppet/action" action @ setprop action @ "_puppet/puppet" target @ setprop { "Registered puppet " target @ unparseobj " and action " action @ unparseobj "..." }cat "@puppet" pretty tellme ( Done! ) { "Puppet created. You can now use ^GREEN^" action-name @ " ^NORMAL^ to control your puppet " target @ unparseobj "." }cat "@puppet" pretty tellme { "You currently have " me @ count-puppets " out of an allowed " LIMIT " puppets." }cat "@puppet" pretty tellme { "NOTE: Before you can use this, you need to execute the command below to activate it:" }cat "@puppet" pretty tellme { "@set #" target @ int "=X" }cat "@puppet" pretty tellme ; : puppetify var target var target-name var action var action-name var tmp ( Got to have parameters ) param @ not if "Format: @puppetify =" "@puppet" pretty tellme exit then ( In fact, got to have 2 ) param @ "=" explode tmp ! tmp @ 2 = not if "Format: @puppetify =" "@puppet" pretty tellme exit then param @ match target ! param @ not if "Cant match this." "@puppet" pretty tellme exit then ( Store essential data ) target-name ! action-name ! target-name @ match target ! target @ not if "Cant match this." "@puppet" pretty tellme exit then ( Limit the number of puppets one can make ) me @ count-puppets LIMIT >= if "We think you have enough already." "@puppet" pretty tellme exit then ( Make a puppet ) { "Targeted beast " target @ unparseobj "..." }cat "@puppet" pretty tellme ( Chown the puppet ) target @ me @ setown { "Changed owner of puppet " target @ unparseobj " to " me @ unparseobj "..." }cat "@puppet" pretty tellme ( set the target Z ) target @ "Z" set { "Set puppet " target @ unparseobj " ZOMBIE..." }cat "@puppet" pretty tellme ( Make the action ) me @ action-name @ newexit action ! { "Created action " action @ unparseobj "..." }cat "@puppet" pretty tellme ( Chown the action ) action @ me @ setown { "Changed owner of action " action @ unparseobj " to " me @ unparseobj "..." }cat "@puppet" pretty tellme ( Link it to $nothing ) action @ #-3 setlink { "Linked action " action @ unparseobj " to NIL..." }cat "@puppet" pretty tellme ( Set the succ of the action to use the puppet .. ) action @ { "{null:{force:#" target @ int ",{&arg}}}" }cat setsucc { "Set success message on " action @ unparseobj " to puppet control string..." }cat "@puppet" pretty tellme ( @flock the puppet to the action ) target @ "/@/flk" { "#" action @ int }cat parselock setprop { "Force-locked puppet " target @ unparseobj " to action " action @ unparseobj "..." }cat "@puppet" pretty tellme ( Register action and puppet for easy manipulation. ) target @ "_puppet/action" action @ setprop target @ "_puppet/puppet" target @ setprop action @ "_puppet/action" action @ setprop action @ "_puppet/puppet" target @ setprop { "Registered puppet " target @ unparseobj " and action " action @ unparseobj "..." }cat "@puppet" pretty tellme ( Done! ) { "Puppet created. You can now use ^GREEN^" action-name @ " ^NORMAL^ to control your puppet " target @ unparseobj "." }cat "@puppet" pretty tellme { "You currently have " me @ count-puppets " out of an allowed " LIMIT " puppets." }cat "@puppet" pretty tellme { "NOTE: Before you can use this, you need to execute the command below to activate it:" }cat "@puppet" pretty tellme { "@set #" target @ int "=X" }cat "@puppet" pretty tellme ; : puppet-help { "@puppet by Alynna" " " "Usage:" " @puppet =" " Make a puppet named and control it with action " " @puppetify =" " Turn an object into a puppet and control it with action " " @puppet/set =[[=]=]" " Set the puppets sex, species, and description" " @puppet/kill " " Completely destroy the puppet" " " { "You currently have " me @ count-puppets " out of an allowed " LIMIT " puppets." }cat } array_make atellme ; : main param ! command @ tolower case "{@puppet}" smatch when puppet-make end "{@puppetify}" smatch when puppetify end "{@puppet/kill}" smatch when puppet-kill end "{@puppet/set}" smatch when puppet-set end default puppet-help end endcase ;