"A dump of #259 on Sun Dec 17 13:34:24 1995 PST @create #7680 named generic monster:generic monster,monster @prop #259."locations" {} rc ;;#259.("locations") = {"head", "chest", "abdomen", "left arm", "right arm", "left leg", "right leg"} @prop #259."istaff" 0 rc @prop #259."ifire" 0 rc @prop #259."islow" 0 rc @prop #259."ikat" 0 rc @prop #259."itime" 0 rc @prop #259."ilife" 0 rc @prop #259."iheal" 0 rc @prop #259."doll" #26264 r @prop #259."alive" 1 r @prop #259."ifirebolt" 0 rc @prop #259."imagic" 0 rc @prop #259."ifree_will" 0 rc @prop #259."idagger" 0 rc @prop #259."iknives" 0 rc @prop #259."iscim" 0 rc @prop #259."body" #-1 r @prop #259."ikat2" 0 rc @prop #259."ikat1" 0 rc @prop #259."animal" 0 rc @prop #259."ishock" 0 rc @prop #259."idodge" 0 rc @prop #259."iteeth" 0 rc @prop #259."islowness" 10 rc @prop #259."iact" 0 rc @prop #259."itenta" 0 rc @prop #259."iswim" 0 rc @prop #259."iclimb" 0 rc @prop #259."iwclim" 0 rc @prop #259."iclaw" 0 rc @prop #259."inatweap" 0 rc @prop #259."cemetery" #1131 rc @prop #259."irap" 0 rc @prop #259."iapp" 7 rc @prop #259."ipcn" 10 rc @prop #259."iemp" 1 rc @prop #259."iint" 7 rc @prop #259."idex" 10 rc @prop #259."ithrow" 0 rc @prop #259."ifurn" 0 rc @prop #259."gestate" 1000 rc @prop #259."die_words" 0 rc @prop #259."nat_prot" 0 rc @prop #259."iwil" 10 rc @prop #259."isize" 10 rc @prop #259."ikites" 0 rc @prop #259."ishield" 0 rc @prop #259."ibrswd" 0 rc @prop #259."iohswd" 0 rc @prop #259."itclub" 0 rc @prop #259."ithhft" 0 rc @prop #259."imelee" 0 rc @prop #259."iagl" 10 rc @prop #259."iend" 10 rc @prop #259."istr" 10 rc @prop #259."mine" {} r @prop #259."dead" 0 r @prop #259."mine_quality" 100 rc @prop #259."corpse_msg" "A stinking pile of flesh and bone meal. Worms crawl in and out of the hollow orbits of %p naked skull, squirming in the goo that was once %p mind." rc @prop #259."imagic_effects" {} rc ;;#259.("imagic_effects") = {#259} @prop #259."magic_resist" 0 rc @prop #259."generic_equipment" {} r @prop #259."special_equipment" {} r ;;#259.("seek_failed_msg") = "%n bounces off a topographical barrier." ;;#259.("home2") = #175 ;;#259.("home") = #175 ;;#259.("brief") = 1 ;;#259.("simulating") = 0 ;;#259.("key") = 0 ;;#259.("aliases") = {"generic monster", "monster"} ;;#259.("object_size") = {36209, 819192221} @verb #259:"act" this none this @program #259:act if ($local.rpg:trust() && this.alive) doll = $local.rpg:get_doll(this); if ((typeof(doll.aggressor) == LIST) && (doll.aggressor != {})) return doll:hit_aggressor(); else return this:procrastinate(); endif endif . @verb #259:"acceptable" this none this @program #259:acceptable return (args[1] in this.mine) || ((caller_perms() in $local.rpg.gms) && $object_utils:isa(args[1], $local.rpg.thing)); . @verb #259:"duty" this none none rxd @program #259:duty "Duty the monster."; "- check objects in minelist, returning unique ones and replacing others."; "- set condition of all weapons in the minelist."; "- wield any weapons and/or armour in the minelist."; "- dispose of the corpse (if any)."; "- send the monster to its home."; if (!$local.rpg:trusted((c = callers()) ? caller_perms() | player)) player:tell("I can't do that ... resurrections are tricky things."); return E_PERM; elseif (!$recycler:valid(doll = this.doll)) return E_NONE; endif this.alive = 1; doll.inj = doll.ins = doll.fat = 0; doll.aggressor = doll.wielding = doll.wearing = {}; this:check_mine(); this:prime_mine(); this:equip_mine(); this:rot_corpse(); this:go_home(); if (!c) player:tell($string_utils:nn(this), " on duty in ", $string_utils:nn(this.loc ation), "."); endif "Quinn 27-SEP-93 1859: Hacked to account for clear-properties in the re-assignment of values to a replacement object; cleaned the code up a little."; "Quinn 30-NOV-93 0540: Added :check_mine, :equip_mine, and :go_home."; "Quinn 01-DEC-93 0256: Added :prime_mine and :rot_corpse."; "Quinn 02-DEC-93 0306: Added message if !callers()."; . @verb #259:"birth" this none none rx @program #259:birth ":birth() -- Make it live."; "If already alive, reset stats to intitial state."; rpg = $local.rpg; if (!rpg:trusted((c = callers()) ? caller_perms() | player)) return E_PERM; elseif (!(this.owner in rpg.gms)) return E_NACC; endif this:cancel_rebirth(); this.doll = doll = rpg:create_pc(this); doll.free_will = 0; mama = rpg.doll; "The following loop requires !d for quick property check."; for att in (setremove(properties(mama), "character")) if ((n = this.("i" + att)) != E_PROPNF) doll.(att) = n; else clear_property(doll, att); endif endfor this:duty(); if (!c) player:tell($string_utils:nn(this), " has been reset with ", $string_utils:nn(doll), " as its doll."); endif return doll; "Quinn 11-OCT-95 1150: Made verb !d, removed $object_util:has_property() check in att reset loop."; . @verb #259:"look_self" this none this @program #259:look_self pass(@args); if (!this.animal) this:tell_contents(this:contents()); this:look_health(); this:look_gear(); else this:look_health(); endif "DR 04-AUG-94 -- Change in order to make NPCs look more like players."; . @verb #259:"die(old)" this none this rx @program #259:die(old) ":die([killer]) -- KILL THE BEAST"; "- fork a task to rebirth"; "- remove monster from aggressors list of all in vacinity"; "- clear monster's doll's wielding, wearing and aggressor lists"; "- announce the death to the corpse location"; "- deposit remains (corpse, loot, burial)"; rpg = $local.rpg; if (!rpg:trusted(caller_perms())) return E_PERM; elseif ((!this.alive) && (this.location == this.cemetery)) return E_NONE; endif this.alive = 0; if ((this.gestate > 0) && (!$code_utils:task_valid(this.rebirth_task))) fork rt (this.gestate) this:birth(); endfork this.rebirth_task = rt; endif for who in (this.location:contents()) if (valid(doll = rpg:get_doll(who))) doll.aggressor = setremove(doll.aggressor, this); endif endfor doll = rpg:get_doll(this); doll.wielding = doll.wearing = doll.aggressor = {}; killer = args ? args[1] | $nothing; this:deposit_remains(killer); this:announce_death(killer); this:moveto(this.cemetery); . @verb #259:"armour" this none this @program #259:armour ":armour(penetration, hit-location[, attacker, weapon-used, damage])"; doll = $local.rpg:get_doll(this); pen = args[1]; return (this.nat_prot * pen) + doll:protection(@args); . @verb #259:"abort" this none none rxd @program #259:abort "abort -- Kill the monster's doll."; rpg = $local.rpg; cp = caller_perms(); who = (player != cp) ? rpg:trusted(cp) ? player | cp | player; if (((who != this.owner) || (!(who in rpg.gms))) && (!rpg:is_grandmaster(who))) return E_PERM; endif if (valid(doll = rpg:get_doll(this))) rpg.recycler:_recycle(doll); who:tell($string_utils:nn(this), " is no longer alive."); else who:tell($string_utils:nn(this), " is not alive."); endif this.doll = $nothing; . @verb #259:"recycle" this none this @program #259:recycle "Abort a rebirth and recalculate list of monsters."; if ((caller != this) && (!$perm_utils:controls(caller_perms(), this))) return E_PERM; endif this:abort(); fork (0) rpg = $local.rpg; rpg.vacuum.monsters = $object_utils:descendants(rpg.monster); endfork return pass(@args); . @verb #259:"moveto" this none this @program #259:moveto these = {}; what = this; while (what != #259) these = listappend(these, what.owner); what = parent(what); endwhile return $local.rpg:trust(@these) ? pass(@args) | E_PERM; . @verb #259:"procrastinate" this none this @program #259:procrastinate if ($local.rpg:trust() && valid(doll = $local.rpg:get_doll(this))) doll:set_att("act", 0); endif . @verb #259:"look_gear" this none this @program #259:look_gear if (!this.animal) $local.rpg:look_gear(this, @args); endif . @verb #259:"look_health" this none this @program #259:look_health $local.rpg:look_health(this, @args); . @verb #259:"initialize" this none this @program #259:initialize ":initialize() -- Update the monster population in ~vacuum."; if ((caller != this) && (!$perm_utils:controls(caller_perms(), this))) return E_PERM; endif rpg = $local.rpg; if (this.owner in rpg.gms) fork (0) rpg.vacuum.monsters = $object_utils:descendants(rpg.monster); endfork endif "this.rebirth_task = 0;"; return pass(@args); . @verb #259:"cancel_rebirth(old)" this none this rx @program #259:cancel_rebirth(old) ":cancel_rebirth() -- Kill this monster's rebirth task."; if (!$local.rpg:trusted(caller_perms())) return E_PERM; endif rt = this.rebirth_task; return (rt == task_id()) ? E_NONE | kill_task(rt); . @verb #259:"notify_attack notify_aggression notify_death notify_arrival notify_exit notify_hit notify_miss notify_dodge notify_parry" this none this @program #259:notify_attack ":notify_attack(OBJ attacker, OBJ defender[, OBJ weapon])"; "-- Whenever someone is attacked."; ":notify_aggression(OBJ attacker, OBJ defender[, OBJ weapon])"; "-- The first time someone is attacked."; ":notify_death(OBJ victim[, OBJ killer])"; "-- When someone is killed."; ""; ":notify_arrival(OBJ who, OBJ exit)"; ":notify_exit(OBJ who, OBJ exit)"; "-- When someone enters or leaves the room. If they teleported, `exit' will be $nothing."; ""; ":notify_payment(OBJ from, NUM amount, STR denomination, NUM worth)"; "-- When someone gives money to your monster. `worth' is the unit worth of the given denomination. Multiple that value by `amount' to get the full worth of the transaction."; ""; "notify_hit(OBJ attacker, OBJ defender[, OBJ weapon])"; "notify_miss(OBJ attacker, OBJ defender[, OBJ weapon])"; "notify_dodge(OBJ attacker, OBJ defender[, OBJ weapon])"; "notify_parry(OBJ attacker, OBJ defender[, OBJ weapon])"; "notify this monster that one of the above has occurred."; return; . @verb #259:"location" this none this @program #259:location return this.location; . @verb #259:"set_mine(old)" this none this @program #259:set_mine(old) ":set_mine(LIST objects)"; "Set the RPG equipment this monster will be dutied with."; if (!((caller == this) || this:is_controllable_by(caller_perms()))) return E_PERM; elseif ((mine = args[1]) == this.mine) "simple redundancy check"; return mine; endif rpg = $local.rpg; sweeper = rpg.vacuum; for old in (this.mine) sweeper.protected = setremove(sweeper.protected, old); endfor "Protect Grand_Master-owned objects in minelist from sweeping."; for new in (mine) if (new.owner == rpg.owner) sweeper.protected = setadd(sweeper.protected, new); endif endfor return this.mine = mine; "Quinn 30-NOV-93 0522: Only protect GM-owned gear, since that's all we can recycle anyway."; . @verb #259:"sub_mine" this none this @program #259:sub_mine "HACKED by Quinn (a little too late) 22-APR-93. No longer needs wizperms."; if ((caller_perms() == #259.owner) && (p = args[1] in (mine = this.mine))) this:set_mine(listset(mine, args[2], p)); endif . @verb #259:"is_controllable_by" this none this @program #259:is_controllable_by ":is_controllable_by(caller_perms())"; return $perm_utils:controls(p = args[1], this) || $local.rpg:is_grandmaster(p); . @verb #259:"tell_contents" this none this @program #259:tell_contents ":tell_contents(list)"; "Called from :look_self()"; c = args[1]; if (valid($local.rpg:get_doll(this))) "These things have already been shown by 'look_gear'"; stuff = $local.rpg:get_doll(this):wielding(); for each_thing in (stuff) c = setremove(c, each_thing); endfor stuff = $local.rpg:get_doll(this):get_att("wearing"); for each_thing in (stuff) c = setremove(c, each_thing); endfor endif if (c) longear = {}; gear = {}; width = player:linelen(); half = width / 2; player:tell("Carrying:"); for thing in (c) cx = tostr(" ", thing:title()); if (length(cx) > half) longear = {@longear, cx}; else gear = {@gear, cx}; endif endfor player:tell_lines($string_utils:columnize(gear, 2, width)); player:tell_lines(longear); endif . @verb #259:"get_body_area_name" this none this rx @program #259:get_body_area_name ":get_body_area_name(OBJ body_area)"; if ((names = this.locations) == $local.rpg.monster.locations) return E_NONE; elseif (i = args[1] in this.doll.body_areas) return names[i]; else return E_NONE; endif . @verb #259:"go_home" this none this @program #259:go_home ":go_home() -- Send the monster home."; "If the home's an exit, :move it through. Else just move it into the room."; if (!$local.rpg:trusted(caller_perms())) return E_PERM; elseif (!valid(home = this.home)) this.owner:tell(this.name, " (", this, " ) is homeless."); elseif ($object_utils:isa(home, $exit)) home:move(this); else this:moveto(home); endif . @verb #259:"duty(old)" this none none rxd @program #259:duty(old) "Duty the monster."; "- check objects in minelist, returning unique ones and replacing others."; "- wield any weapons and/or armour in the minelist."; "- return the corpse (if any) to $nothing."; "- send the monster to its home."; addb = $local.rpg; if (!addb:trust()) player:tell("I can't do that ... resurrections are tricky things."); return E_PERM; elseif ((doll = addb:get_doll(this)) == $nothing) return E_NONE; endif doll.inj = doll.ins = doll.fat = 0; doll.aggressor = {}; doll.wielding = doll.wearing = {}; mine = this.mine; hands = doll.hands; weapon = addb.weapon; armour = addb.armour; hand_and_a_half = addb.hand_and_a_half; for foobar in (mine) if (!$recycler:valid(foo = foobar)) this:set_mine(setremove(this.mine, foobar)); elseif (((((loc = foo.location) != foo.owner) && (loc != this)) && addb.vacuum:in_use(foo, this)) && (!addb.vacuum:unique(foo))) new = addb.recycler:_create(foomama = parent(foo)); new.name = foo.name; for q in (setremove($object_utils:owned_properties(foo), "title")) if ((new.(q) = foo.(q)) == foomama.(q)) clear_property(new, q); endif endfor this:sub_mine(foo, new); foo = new; elseif (valid(loc)) loc:tell("The ", foo.name, " you took from ", this.name, " disappears."); endif foo:moveto(this); anc = $object_utils:ancestors(foo); if (hand_and_a_half in anc) foo:one(); endif if ((weapon in anc) && (hands >= foo.hands)) hands = hands - foo.hands; doll.wielding = listappend(doll.wielding, foo); elseif (armour in anc) doll.wearing = listappend(doll.wearing, foo); endif addb:time_stop(); endfor for foo in (doll.wielding) if ((hands > 0) && $object_utils:isa(foo, hand_and_a_half)) hands = hands - 1; foo:two(); endif endfor if (valid(this.body)) this.body:moveto($nothing); endif this.alive = 1; if (valid(this.home)) if ($object_utils:has_verb(this.home, "move")) this.home:move(this); else this:moveto(this.home); endif else this.owner:tell(this.name, " (", this, " ) is homeless."); endif "Quinn 27-SEP-93 1859: Hacked to account for clear-properties in the re-assignment of values to a replacement object; cleaned the code up a little."; . @verb #259:"check_mine(old)" this none this rx @program #259:check_mine(old) ":check_mine()"; "Loop through the monster's mine list, removing all invalid objects, recovering all recoverable objects, and replacing insignificant others not on the monster's person."; if (!$local.rpg:trusted(caller_perms())) return E_PERM; endif rpg = $local.rpg; sweeper = rpg.vacuum; mine = {}; for foo in (this.mine) if (!$recycler:valid(foo)) "...oops..."; elseif (((((loc = foo.location) != foo.owner) && (loc != this)) && sweeper:in_use(foo, this)) && (!sweeper:unique(foo))) new = rpg.recycler:_create(mama = parent(foo)); if (valid(new)) new.name = foo.name; for q in (setremove($object_utils:owned_properties(foo), "title")) if ((new.(q) = foo.(q)) == mama.(q)) clear_property(new, q); endif endfor mine = {@mine, new}; endif else loc:tell("The ", foo.name, " you took from ", this.name, " disappears."); mine = {@mine, foo}; endif rpg:time_stop(); endfor return this:set_mine(mine); "Quinn 30-NOV-93 0516: Added."; "Profane 16-MAR-95 12:40EST - Added validity check for newly created thangs."; . @verb #259:"equip_mine" this none this @program #259:equip_mine ":equip_mine()"; "Loop through the monster's mine list, wearing and wielding what it can."; rpg = $local.rpg; if (!rpg:trusted(caller_perms())) return E_PERM; endif doll = this.doll; hands = doll.hands; weapon = rpg.weapon; armour = rpg.armour; hand_and_a_half = rpg.hand_and_a_half; for foo in (this.mine) if (foo.location != this) foo:moveto(this); endif anc = $object_utils:ancestors(foo); if (hand_and_a_half in anc) foo:((hands == 1) ? "one" | "two")(); endif if ((weapon in anc) && (hands >= foo.hands)) hands = hands - foo.hands; doll.wielding = listappend(doll.wielding, foo); elseif (armour in anc) doll.wearing = listappend(doll.wearing, foo); endif rpg:time_stop(); endfor "Quinn 30-NOV-93 0516: Added."; . @verb #259:"prime_mine" this none this rx @program #259:prime_mine ":prime_mine()"; "Prepare this monster's equipment to be readied. Right now, this just means setting the `condition' of everything to `mine_quality'."; qual = this.mine_quality; for foo in (this.mine) if (((typeof(old = foo.condition) == NUM) && (old != qual)) && (!foo.unique)) foo.condition = qual; endif endfor "Quinn 01-DEC-93 0244: Added."; . @verb #259:"rot_corpse" this none this rx @program #259:rot_corpse ":rot_corpse() -- Rot this monster's corpse, if it exists and is a child of $local.rpg.corpse."; rpg = $local.rpg; if (!rpg:trusted(caller_perms())) return E_PERM; endif body = this.body; if (!body.is_corpse) this:set_body(valid(body) ? 1 | #-1); return E_NONE; else body:rot(); this:set_body($recycler:valid(body) ? body | 1); endif "Quinn 01-DEC-93 0244: Added."; "Quinn 03-DEC-93 0114: Added :set_body call so you get a corpse more than just once."; "StarDancer 16-DEC-95 added 'nother :set_body call so's a swept corpse 'll get put back too."; . @verb #259:"announce_death" this none this @program #259:announce_death ":announce_death([killer])"; "Announce the die words of this beast to its location."; "Sub %N for dead monster and %D for killer (if given)."; if (!(msg = this.die_words)) return; endif killer = args ? args[1] | $nothing; where = this.location; msg = $string_utils:pronoun_sub(msg, this, this, where, killer); for line in ((typeof(msg) == LIST) ? msg | {msg}) $local.rpg:rpg_announce_all_but(where, {this}, line); endfor . @verb #259:"corpse_msg" this none this @program #259:corpse_msg ":corpse_msg()"; "-> What this monster's spawn of generic corpse should look like."; return $string_utils:pronoun_sub(this.corpse_msg, this); . @verb #259:"get_corpse" this none this rx @program #259:get_corpse ":get_corpse([killer])"; "Get a corpse for this monster, dependant on the value of `body'."; "If body == #x and #x is valid and a child of $local.rpg.corpse, use that custom corpse."; "If body == 1 (or any true value), create a new corpse and describe it as `corpse_msg'."; "If a corpse is found, return {#corpse}. Else, return false."; "`killer' is who killed the beast. Provided for future customization."; rpg = $local.rpg; if (!rpg:trusted(caller_perms())) return E_PERM; endif body = this.body; mama_corpse = rpg.corpse; if (body.is_corpse) body.time_of_death = time(); return {body}; elseif (!body) return E_NONE; elseif (typeof(body = rpg.recycler:_create(mama_corpse)) != OBJ) return E_QUOTA; endif body:set_name(name = "corpse of " + this.name); body:set_aliases({name, "corpse", this.name}); body:set_description(this:corpse_msg()); body.victim = this; body.time_of_death = time(); body.encumbrance = this.isize * 10; return {this.body = body}; . @verb #259:"deposit_remains" this none this @program #259:deposit_remains ":deposit_remains([killer])"; "If a corpse exists; get it, move all our loot inside it, and move it to this location."; "If no corpse; move this loot to this location."; "`killer' is who killed the beast, passed for the benefit of :deposit_loot."; if (!$local.rpg:trusted(caller_perms())) return E_PERM; elseif (!(corpse = this:get_corpse())) return this:deposit_loot(this.location, @args); endif corpse = corpse[1]; corpse:moveto(this.location); return this:deposit_loot(corpse, @args); . @verb #259:"deposit_loot" this none this rx @program #259:deposit_loot ":deposit_loot([location[, killer]])"; "Move all equipment (except those with a false .:keep_at_death) to the given location, which defaults to the monster's location."; "`killer' is who killed the beast. Provided for special occasions where, for example, you may want to deprive a dishonorable killer of the post-mortem prize. Similiarly passed to :keep_at_death."; if (!$local.rpg:trusted(caller_perms())) return E_PERM; endif where = args ? args[1] | this.location; killer = (length(args) > 1) ? args[2] | $nothing; for loot in (this:contents()) if (!loot:keep_at_death(killer)) loot:moveto(where); endif endfor . @verb #259:"die(old)(old)" this none this rx @program #259:die(old)(old) ":die([who-killed-me])"; addb = $local.rpg; if (!addb:trusted(caller_perms())) return E_PERM; elseif ((!this.alive) && (this.location == this.cemetery)) "Let it fall through if the beastie isn't in its cemetery. Q/27-OCT-93"; return E_NONE; endif "...added rebirth_task property 30-MAR-93 (quinn)..."; this.alive = 0; if ((this.gestate > 0) && (!$code_utils:task_valid(this.rebirth_task))) fork rt (this.gestate) this:birth(); endfork this.rebirth_task = rt; endif whoby = args ? args[1] | $nothing; if (typeof(msg = this.die_words) == STR) this.location:announce_all_but({this}, msg); elseif (typeof(msg) == LIST) for foo in (msg) this.location:announce_all_but({this}, foo); endfor endif doll = addb:get_doll(this); "Removed the animal checks in favour of .keep_at_death."; for foo in (this.contents) if (!foo:keep_at_death(whoby)) foo:moveto(this.location); endif endfor doll.wielding = doll.wearing = doll.aggressor = {}; this:moveto(this.cemetery); if (valid(body = this.body)) body:moveto(this.location); endif for foo in ({@doll.aggressor, @this.location:contents() || {}}) if (valid(them = addb:get_doll(foo))) them.aggressor = setremove(them.aggressor, this); endif endfor . @verb #259:"set_body set_corpse" this none this rx @program #259:set_body ":set_body(OBJ corpse)"; "Set the corpse to be deposited when this creature dies."; "#xxxxx -- If a caller-controlled kid of $local.rpg.corpse, use that object."; "1 -- Create a generic corpse described as this.corpse_msg."; "Any other False -- No corpse."; rpg = $local.rpg; cp = caller_perms(); if ((caller != this) && (!this:is_controllable_by(cp))) return E_PERM; elseif (typeof(corpse = args[1]) != OBJ) return this.body = !(!corpse); elseif (!corpse.is_corpse) return E_INVARG; elseif (corpse.owner != cp) return E_NACC; else return this.body = corpse; endif . @verb #259:"birth(old)" this none none rxd @program #259:birth(old) #19845:tell($string_utils:nn(this)); for line in (callers()) #19845:tell(" ", $string_utils:print(line)); endfor if ($local.rpg:trust() && (this.owner in $local.rpg.gms)) this:cancel_rebirth(); this.doll = doll = $local.rpg:create_pc(this); doll.free_will = 0; for attnam in (setremove(setremove(properties(#74), "last_action"), "character")) doll.(attnam) = $object_utils:has_property(this, "i" + attnam) ? this.("i" + attnam) | #74.(attnam); endfor this:duty(); if (!callers()) player:tell(this.name, " (", this, ") has been reset with ", doll, " as its doll."); endif return doll; else return E_PERM; endif . @verb #259:"description" this none this @program #259:description "Copied from Almost Human Bastard (#6475):description by Quinn (#19845) Wed Mar 16 16:55:06 1994 PST"; "Runs the description through pronoun_sub."; return $string_utils:pronoun_sub(this.description, this, this, this.location, player); . @verb #259:"enterfunc exitfunc" this none this rx @program #259:enterfunc "Copied from Almost Human Bastard (#6475):enterfunc by Quinn (#19845) Wed Mar 16 17:11:59 1994 PST"; "Just so pass(@args) doesn't return E_VERBNF on descendants."; return pass(@args); . @verb #259:"magic_effect" this none this @program #259:magic_effect return args[2].character.magic_resist; . @verb #259:"die" this none this rx @program #259:die ":die([killer]) -- KILL THE BEAST"; "- schedule a task to rebirth"; "- remove monster from aggressors list of all in vicinity"; "- clear monster's doll's wielding, wearing and aggressor lists"; "- announce the death to the corpse location"; "- deposit remains (corpse, loot, burial)"; rpg = $local.rpg; if (!rpg:trusted(caller_perms())) return E_PERM; elseif ((!this.alive) && (this.location == this.cemetery)) return E_NONE; endif this.alive = 0; if (this.gestate > 0) $local.rpg.clock:add_death(this); endif for who in (this.location:contents()) if (valid(doll = rpg:get_doll(who))) doll.aggressor = setremove(doll.aggressor, this); endif endfor doll = this.doll; doll.wielding = doll.wearing = doll.aggressor = {}; for item in (doll.claimed_objects) "Remove claim data from objects."; rpg:time_stop(3); if (valid(item) && $object_utils:isa(item, #517)) item.claimed_by = $nothing; endif endfor doll.claimed_objects = {}; killer = args ? args[1] | $nothing; this:deposit_remains(killer); this:announce_death(killer); this:moveto(this.cemetery); "Profane 17-MAR-95 13:28 -- Added (Well, changed from old :die() to use new resurrection queue)"; "Slither 29-JUN-95 00:16 -- Added erasing of claimed objects."; . @verb #259:"cancel_rebirth" this none this rx @program #259:cancel_rebirth ":cancel_rebirth() -- Kill this monster's rebirth task."; if (!$local.rpg:trusted(caller_perms())) return E_PERM; endif $local.rpg.clock:remove_death(this); "Profane 17-MAR-95 13:30EST - Changed from old :cancel_rebirth to use new resurrection queue"; . @verb #259:"check_mine(old)(old)" this none this rx @program #259:check_mine(old)(old) ":check_mine()"; "Loop through the monster's mine list, removing all invalid objects, recovering all recoverable objects, and replacing insignificant others not on the monster's person."; if (!$local.rpg:trusted(caller_perms())) return E_PERM; endif rpg = $local.rpg; sweeper = rpg.vacuum; mine = {}; for foo in (this.mine) if (!$recycler:valid(foo)) "...oops..."; elseif (((((loc = foo.location) != foo.owner) && (loc != this)) && sweeper:in_use(foo, this)) && (!sweeper:unique(foo))) new = rpg.recycler:_create(mama = parent(foo)); if (valid(new)) new.name = foo.name; for q in (setremove($object_utils:owned_properties(foo), "title")) if ((new.(q) = foo.(q)) == mama.(q)) clear_property(new, q); endif endfor mine = {@mine, new}; endif else loc:tell("The ", foo.name, " you took from ", this.name, " disappears."); mine = {@mine, foo}; endif rpg:time_stop(); endfor return this:set_mine(mine); "Quinn 30-NOV-93 0516: Added."; "Profane 16-MAR-95 12:40EST - Added validity check for newly created thangs."; . @verb #259:"set_generic_equipment" this none this @program #259:set_generic_equipment ":set_generic_equipment(LIST objects)"; "Set the generic equipment list to a list of objects"; "Each object should be a RPG generic"; "Returns a list of created objects."; if (!((caller == this) || this:is_controllable_by(caller_perms()))) return E_PERM; endif newequip = args[1]; "Rampant paranoia. But even paranoids get E_TYPE errors."; if (typeof(newequip) != LIST) return E_INVARG; endif for item in (newequip) if (typeof(item) != OBJ) return E_INVARG; endif "Seven's a nice number"; $command_utils:suspend_if_needed(7); endfor this.generic_equipment = newequip; return newequip; "5/28/95 Slither -- first version"; . @verb #259:"make_generic_equipment" this none this @program #259:make_generic_equipment ":make_generic_equipment()"; "Creates clones of generic items based upon the contents of"; "this.generic_equipment. The items are moved into this, and"; "the list of created items is returned."; "See the comments in :set_generic_equipment for the data format"; if (!$local.rpg:trusted(caller_perms())) return E_PERM; endif ad = $local.rpg; recycler = ad.recycler; stuff = {}; for parent in (this.generic_equipment) if ($recycler:valid(parent)) new = recycler:_create(parent); if (valid(new)) new.name = parent.name; new:moveto(this); stuff = {@stuff, new}; endif endif $command_utils:suspend_if_needed(6); endfor return stuff; "5/28/95 Slither -- first version"; . @verb #259:"set_special_equipment" this none this @program #259:set_special_equipment ":set_special_equipment(LIST objects)"; "Set the special equipment list to a list of objects"; if (!((caller == this) || this:is_controllable_by(caller_perms()))) return E_PERM; endif newequip = args[1]; "make sure its really a list of objects."; if (typeof(newequip) != LIST) return E_INVARG; endif for item in (newequip) if (typeof(item) != OBJ) return E_INVARG; endif $command_utils:suspend_if_needed(5); endfor this.special_equipment = newequip; return newequip; "5/28/95 Slither -- first version"; . @verb #259:"make_special_equipment" this none this rx @program #259:make_special_equipment ":make_special_equipment()"; "Prepares the special equipment that the monster needs, based upon"; "the content's of the monster's .special_equipment property."; "This amounts to making sure that the equipment exists, and moving"; "it to the monster if necessary."; "The verb returns a list of the special equipment that was successfully gotten."; if (!$local.rpg:trusted(caller_perms())) return E_PERM; endif stuff = {}; rpg = $local.rpg; for item in (this.special_equipment) if ($recycler:valid(item)) "Good, still exists"; loc = item.location; if ((loc != this) && (!children(item))) "Stupid thing has escaped!"; item:moveto(this); if (item.location == this) loc:tell(((("The " + item.name) + " taken from ") + this.name) + " disappears."); endif elseif (children(item) && (item.owner == rpg.owner)) item = rpg.recycler:_create(item); item:moveto(this); endif if (item.location == this) stuff = {@stuff, item}; endif endif $command_utils:suspend_if_needed(5); endfor return stuff; "5/28/95 Slither -- first version"; "Made the verb !d in case the obj's original location's #-1. - StarDancer 10/20/95"; "StarDancer 11-DEC-95 added test ta make sure the item's not a generic"; . @verb #259:"set_mine" this none this @program #259:set_mine ":set_mine(LIST objects)"; "Set the RPG equipment this monster will be dutied with."; "In its present form mainly for compatibility with old code."; if (!((caller == this) || this:is_controllable_by(caller_perms()))) return E_PERM; endif return this.mine = args[1]; "5/28/95 Slither -- rewrote entirely"; . @verb #259:"check_mine" this none this rx @program #259:check_mine ":check_mine()"; "Construct the monster's mine list from its components."; "Basically, mainly here for compatibility with old code."; "Returns new mine list."; if (!$local.rpg:trusted(caller_perms())) return E_PERM; endif mine = {@this:make_generic_equipment(), @this:make_special_equipment()}; return this:set_mine(mine); "5/28/95 Slither -- rewrote entirely."; "StarDancer 21-NOV-95 -- put :make_special after :make_generic."; . @verb #259:"birth(d)" this none none rxd @program #259:birth(d) ":birth() -- Make it live."; "If already alive, reset stats to intitial state."; rpg = $local.rpg; if (!rpg:trusted((c = callers()) ? caller_perms() | player)) return E_PERM; elseif (!(this.owner in rpg.gms)) return E_NACC; endif this:cancel_rebirth(); this.doll = doll = rpg:create_pc(this); doll.free_will = 0; mama = rpg.doll; for att in (setremove(properties(mama), "character")) if ($object_utils:has_property(this, "i" + att)) doll.(att) = this.("i" + att); else clear_property(doll, att); endif endfor this:duty(); if (!c) player:tell($string_utils:nn(this), " has been reset with ", $string_utils:nn(doll), " as its doll."); endif return doll; . "***finished***