generic monster #107
Aliases: generic monster, monster
32 verbs · 51 properties · 1 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
g*et t*ake | this none none | rxd | #107 | 12 |
capture cuff | this none none | rd | #107 | 10 |
release uncuff lose | this none none | rxd | #107 | 22 |
_leash | this none this | rxd | #107 | 20 |
@com*bat @str*ength @int*elligence @dex*terity @hea*lth | this is any | rd | #107 | 26 |
tell_contents | this none this | rxd | #107 | 22 |
eat consume | this none none | rd | #107 | 7 |
rot_away | this none this | rxd | #107 | 12 |
tell | this none this | rxd | #107 | 18 |
take_health | this none this | rxd | #107 | 4 |
armor | this none this | rxd | #107 | 7 |
damage | this none this | rxd | #107 | 17 |
to_hit | this none this | rxd | #107 | 10 |
to_defend | this none this | rxd | #107 | 7 |
title | this none this | rxd | #107 | 13 |
wander | none none none | rxd | #107 | 72 |
look_self | this none this | rxd | #107 | 23 |
reached_limit | this none this | rxd | #107 | 1 |
_capture | this none this | rxd | #107 | 8 |
_release | this none this | rxd | #107 | 6 |
birth | this none this | rxd | #107 | 19 |
dump_goodies | this none this | rxd | #107 | 35 |
die | this none this | rxd | #107 | 28 |
pass_out | this none this | rxd | #107 | 19 |
freeze | this none this | rxd | #107 | 11 |
take_hit | this none this | rxd | #107 | 24 |
plan_next_move | this none this | rxd | #107 | 16 |
@start @stop | this none none | rd | #107 | 38 |
init_for_core | this none this | rxd | #107 | 6 |
_loot | this none this | rxd | #107 | 14 |
roll_against | this none this | rxd | #107 | 29 |
loot rob pilfer roll search strip | this none none | rxd | #107 | 1 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
home | #107 | rc | #36 | #62 |
grave | #107 | rc | #36 | #62 |
rot_time | #107 | rc | #36 | 121 |
gestate | #107 | rc | #36 | 900 |
birth_msg | #107 | rc | #36 | "A %n sprouts from the earth." |
weapon_types | #107 | rc | #36 | {} |
wander_task | #107 | r | #36 | 0 |
wait_seconds | #107 | rc | #36 | 480 |
terrain_only | #107 | rc | #36 | 0 |
enemy | #107 | r | #36 | #-1 |
hostility | #107 | rc | #36 | 1 |
death_msg | #107 | rc | #36 | "%N %<falls> limply to the ground." |
alert | #107 | r | #36 | 1 |
mobile | #107 | r | #36 | 1 |
alive | #107 | r | #36 | 1 |
wielded | #107 | rc | #36 | #111 |
natural_def | #107 | rc | #36 | 0 |
greedy | #107 | rc | #36 | 0 |
edible | #107 | rc | #36 | 0 |
wander_ok | #107 | r | #36 | 1 |
my_tell | #107 | rwc | #36 | 0 |
following | #107 | r | #36 | #-1 |
followed_by | #107 | r | #36 | #-1 |
countdown_til_stop | #107 | r | #36 | 10 |
stats | #107 | r | #36 | {{"Strength", "Dexterity", "Intelligence", "Health"}, {10.0, 10.0, 3.0, 10.0}} |
stats_current | #107 | r | #36 | {{"Strength", "Dexterity", "Intelligence", "Health"}, {10.0, 10.0, 3.0, 10.0}} |
skills | #107 | r | #36 | {{"combat"}, {0.0}} |
money | #107 | r | #36 | {} |
gender | #94 | rc | #36 | <clear> |
pqc | #94 | rc | #36 | <clear> |
pq | #94 | rc | #36 | <clear> |
ppc | #94 | rc | #36 | <clear> |
pp | #94 | rc | #36 | <clear> |
prc | #94 | rc | #36 | <clear> |
pr | #94 | rc | #36 | <clear> |
poc | #94 | rc | #36 | <clear> |
po | #94 | rc | #36 | <clear> |
psc | #94 | rc | #36 | <clear> |
ps | #94 | rc | #36 | <clear> |
value_base | #102 | r | #2 | <clear> |
damage_base | #102 | r | #2 | 0.5 |
x_loc | #102 | r | #36 | <clear> |
y_loc | #102 | r | #36 | <clear> |
ansi_title | #102 | r | #36 | <clear> |
obvious | #102 | r | #36 | <clear> |
build_help | #102 | rc | #36 | list of 44{"-------------------------", " PROPS TO @SET", "----------------", "________________room numbers", "home place to be reborn", "grave place where the corpse goes", "", "_______________time in seconds", "rot_time time til corpse dissolves", "gestate time spent in grave", "wait_seconds time between wandering", "", "_______________messages", "birth_msg \"A %n sprouts from the earth.\"", "death_msg \"%N %<falls> limply to the ground.\" ", "", "_______________1 or 0", "greedy looks for goodies", "edible corpse is consumable", "terrain_only will not wander outside terrains ", "", "_______________0 through n", "natural_def 0 = bites", " 1 = claws", " 2 = punches", "hostility 0 = avoids attack", " 1 = returns attack", " 2-6 = initiates attack, the higher, the more hostile", "", "_______________list of objects ", "weapon_types possible weapons it may possess", " (these are the fertile parents)", "", " VERBS", "----------------", "@start/@stop <monster> <= wandering", "@gender <monster> is <male/female/neuter> ", "", "@com*bat \\", "@str*ength \\", "@int*elligence > <monster> is <number>", "@dex*terity /", "@hea*lth /", "-------------------------"} |
key | #1 | c | #36 | 0 |
aliases | #1 | rc | #36 | {"generic monster", "monster"} |
description | #1 | rc | #36 | <clear> |
object_size | #1 | r | #36 | {35943, -1090650497} |
html | #1 | rc | #36 | <clear> |
Ancestry
Ancestors (nearest first): #94 Generic Gendered Object → #102 subthing → #1 Root Class
Children: #136 replicating monster
Call graph
Showing 48 of 58 verbs; 10 not shown.
Source
g*et t*ake
Referenced by
none
Source
1if (player != this.owner) 2if ((((!this.alert) || (!this.mobile)) && (c = $set_utils:intersection(player:contents(), children($cuffs)))) && (player in c[1].trustees)) 3c[1]:_cuff(this); 4elseif ((this.alert && this.alive) && this.mobile) 5player:tell(this:titlec(), " cautiously dodges your advance."); 6this.location:announce_all_but({this, player}, tostr(this:titlec(), " cautiously avoids ", player:title(), ".")); 7else 8player:tell("Why not try searching ", this:title(), " instead?"); 9endif 10else 11$command_utils:do_huh(verb, args); 12endif
capture cuff
Referenced by
none
Source
1if ((((!this.alert) || (!this.mobile)) && (c = $set_utils:intersection(player:contents(), children($cuffs)))) && c[1]:ok_to_use()) 2c[1]:_cuff(this); 3elseif (((((player.stats_current[2][1] > (this.stats_current[2][1] * 1.2)) || (player.stats_current[2][2] > (this.stats_current[2][2] * 1.2))) || (player.stats_current[2][4] > (this.stats_current[2][4] * 2.0))) && (c = $set_utils:intersection(player:contents(), children($cuffs)))) && (player in c[1].trustees)) 4c[1]:_cuff(this); 5elseif ((this.alert && this.alive) && this.mobile) 6player:tell(this:titlec(), " cautiously dodges your advance."); 7this.location:announce(this:titlec(), " cautiously avoids ", player:title(), "."); 8else 9player:tell("Why not try searching ", this:title(), " instead?"); 10endif
release uncuff lose
Referenced by
none
Source
1if (verb == "lose") 2if (this == player.followed_by) 3$you:say_action("%N %<attempts> to evade all followers."); 4return player:dump_followers(); 5else 6return player:tell(this:titlec(), " is only casually following you, if at all."); 7endif 8endif 9"Cuffs"; 10if ((c = $set_utils:intersection(this:contents(), children($cuffs))) && c[1]:ok_to_use()) 11return c[1]:_uncuff(this); 12elseif (c != {}) 13return player:tell("Only an authorized person can release ", this.po, "."); 14endif 15"Mental"; 16if (this.following == player) 17this:_release(); 18elseif (valid(this.following)) 19player:tell("Only the person who captured ", this:title(), " can release ", this.po, "."); 20else 21player:tell(this:titlec(), " is not a prisoner."); 22endif
_leash
Referenced by
- #107:_leash line 16:
this:_leash - #107:_capture line 8:
this:_leash
Source
1if ((valid(this.following) && this.following.alert) && this.following.alive) 2suspend(1); 3if (((valid(this.following) && (this.following.location != this.location)) && $object_utils:isa(this.following.location, $room)) && (!$object_utils:isa(this.following.location, $editor))) 4this.location:announce_all_but({this}, this:titlec(), " follows ", this.following:title(), " out."); 5this:moveto(this.following.location); 6this.location:announce_all_but({this}, this:titlec(), " is being led by ", this.following:title(), "."); 7elseif ((valid(this.following) && $object_utils:isa(this.following.location, $terrain)) && (!this.following.location:match_loc(this.following, this))) 8this.location:announce_all_but({this, this.following}, this:titlec(), " follows."); 9this.x_loc = this.following.x_loc; 10this.y_loc = this.following.y_loc; 11this:tell("You follow."); 12this.following:tell(this:titlec(), " follows."); 13this.location:announce_all_but({this, this.following}, this:titlec(), " follows in shackles."); 14endif 15fork (4) 16this:_leash(); 17endfork 18else 19this:_release(); 20endif
@com*bat @str*ength @int*elligence @dex*terity @hea*lth
Referenced by
none
Source
1if ((player != this.owner) && (!player.programmer)) 2return player:tell("Permission denied."); 3elseif (!(toint(iobjstr) > 0)) 4try 5number = (tofloat(iobjstr) > 0.1) ? 1.0 | E_INVARG; 6except v (ANY) 7return player:tell("You must use a valid number greater than 0.1"); 8endtry 9endif 10number = tofloat(iobjstr); 11if (verb in {"@str", "@strength"}) 12this.stats[2][1] = number; 13this.stats_current[2][1] = number; 14elseif (verb in {"@int", "@intelligence"}) 15this.stats[2][3] = number; 16this.stats_current[2][3] = number; 17elseif (verb in {"@dex", "@dexterity"}) 18this.stats[2][2] = number; 19this.stats_current[2][2] = number; 20elseif (verb in {"@hea", "@health"}) 21this.stats[2][4] = number; 22this.stats_current[2][4] = number; 23else 24this.skills[2][1] = number; 25endif 26player:tell("Set.");
tell_contents
Referenced by
- #107:look_self line 23:
this:tell_contents
Source
1c = args[1]; 2if (c) 3au = $ansi_utils; 4longear = {}; 5gear = {}; 6width = player:linelen(); 7half = width / 2; 8player:tell("Carrying:"); 9for thing in (c) 10cx = tostr(" ", thing:title(), " (", thing, ")"); 11if ($object_utils:has_property(player, "wielded")) 12cx = (this.wielded == thing) ? tostr(cx, " (ready)") | cx; 13endif 14if (valid(au) ? au:length(cx) | (length(cx) > half)) 15longear = {@longear, cx}; 16else 17gear = {@gear, cx}; 18endif 19endfor 20player:tell_lines($string_utils:columnize(gear, 2, width)); 21player:tell_lines(longear); 22endif
eat consume
Referenced by
none
Source
1if (this.alive) 2player:tell($string_utils:pronoun_sub("You'll have to kill %o first.", this)); 3elseif (!this.edible) 4player:tell("You can't eat that!"); 5else 6$you:say_action(tostr("%N %<", verb, "s> some of ", this:title(), ".")); 7endif
rot_away
Referenced by
- #107:die line 25:
this:rot_away
Source
1"wiz perms"; 2this.location:announce_all("The corpse of ", this:title(), " dissolves quickly."); 3this:dump_goodies(1); 4move(this, this.grave); 5this.location:announce_all_but({this}, this:titlec(), " has arrived."); 6if (this.gestate > 120) 7$scheduler:schedule(this.gestate, this, "birth"); 8else 9fork (this.gestate) 10this:birth(); 11endfork 12endif
tell
Referenced by
- #107:_leash line 11:
this:tell
Source
1if ((((player in connected_players()) && (player != this.owner)) && (this.hostility > 1)) && (!this.my_tell)) 2fork (2) 3if (((`this.alive ! E_PROPNF => 0' && this.alert) && this.mobile) && (player.location == this.location)) 4this.enemy = player; 5if ((this.stats_current[2][4] > (this.stats[2][4] * 0.1)) && (random(6) < this.hostility)) 6stun = (this.wielded.can_stun || this.wielded.can_paralyse) ? 1 | 0; 7this.my_tell = 1; 8this.location:do_attack(tostr(this), tostr(this.enemy), this:damage(), stun); 9this.my_tell = 0; 10endif 11endif 12endfork 13endif 14if ((((player in connected_players()) && this.wander_ok) && (!this.countdown_til_stop)) && (!$scheduler:valid_task(call_function("tonum", this.wander_task)))) 15this.countdown_til_stop = random(10) + 10; 16this:plan_next_move(); 17endif 18pass(@args);
take_health
Referenced by
none
Source
1"USAGE: beneficiary:take_health(healing points)"; 2this.stats_current[2][4] = this.stats_current[2][4] + tofloat(args[1]); 3this.stats_current[2][4] = (this.stats_current[2][4] > this.stats[2][4]) ? this.stats[2][4] | this.stats_current[2][4]; 4return this.stats_current[2][4];
armor
Referenced by
- #107:take_hit line 18:
this:armor
Source
1armor = 0.0; 2for x in (this:contents()) 3if ($object_utils:has_property(x, "armor") && x.wornness) 4armor = armor + x:shield_rating(); 5endif 6endfor 7return armor;
damage
Referenced by
- #107:tell line 8:
this:damage - #107:take_hit line 10:
this:damage
Source
1"USAGE: assailant:damage()"; 2"Returns wielded weapon damage, modified by strength."; 3"If missle weapon is used, returns just weapon damage."; 4"Damage will vary up or down from the base by a 25% margin."; 5"If there are additional combat skills affecting damage, this is the verb to hack."; 6if (this.wielded.shoots) 7damage = this.wielded.projectile_dam; 8else 9damage = this.wielded.damage_base + ((this.stats_current[2][1] - 10.0) / 3.142); 10endif 11moddam = random(5); 12if ((moddam = 1) && (!args)) 13damage = damage - (damage * 0.25); 14elseif ((moddam = 5) && (!args)) 15damage = damage + (damage * 0.25); 16endif 17return (damage > 0.0) ? damage | 0.1;
to_hit
Referenced by
- #107:roll_against line 13:
this:to_hit
Source
1"If missle weapon, returns dexterity, modified by basic combat skill"; 2"If not, returns average strength & dexterity, modified by combat skill"; 3"If there are additional skills affecting striking accuracy, this is the verb to hack."; 4combat = "combat" in this.skills[1]; 5if (this.wielded.shoots) 6attack = this.stats_current[2][2] + sqrt(this.skills[2][combat]); 7else 8attack = ((this.stats_current[2][2] + this.stats_current[2][1]) / 2.0) + sqrt(this.skills[2][combat]); 9endif 10return (attack > 0.0) ? attack | 0.1;
to_defend
Referenced by
- #107:roll_against line 16:
this:to_defend
Source
1"Returns dexterity, modified by basic combat skill."; 2"Compared to to_hit(), combat skill has only half the effect."; 3"If there are additional skills (or armor) affecting defense, this is the verb to hack."; 4combat = "combat" in this.skills[1]; 5dex = (!(this.alert && this.mobile)) ? 0.1 | this.stats_current[2][2]; 6defense = dex + (sqrt(this.skills[2][combat]) / 2.0); 7return (defense > 0.0) ? defense | 0.1;
title
Referenced by
- #107:g*et line 8:
this:title - #107:capture line 9:
this:title - #107:release line 19:
this:title - #107:eat line 6:
this:title - #107:rot_away line 2:
this:title - #136:rot_away line 3:
this:title
Source
1title = this.name; 2blurb = ""; 3if (!this.alive) 4blurb = "dead"; 5elseif (!this.alert) 6blurb = "unconscious"; 7elseif (!this.mobile) 8blurb = "immobilized"; 9elseif ((this.stats_current[2][4] / (this.stats[2][4] + 0.0001)) < 0.75) 10blurb = "injured"; 11endif 12title = blurb ? tostr(title, "(", blurb, ")") | title; 13return title;
wander
Referenced by
- #107:take_hit line 12:
this:wander - #107:plan_next_move line 4:
this:wander
Source
1"Finds and takes a random exit. If you want to repeat this act, you need to call the verb from within a timed loop, but 2 seconds is the minimum delay before wandering."; 2"If this.terrain_only is true, it will stay in a terrain and never take a real exit."; 3"If this.greedy is true, it will look around for something to grab instead. If nothing is found, it will wander."; 4suspend(1); 5if (`(((!this.alert) || (!this.mobile)) || (!this.alive)) || (!this.wander_ok) ! ANY => "CAUGHT DURING A RECYCLE"') 6return; 7elseif (this.greedy) 8for treasure in (this.location:contents()) 9if ($thing in $object_utils:ancestors(treasure)) 10treasure:moveto(this); 11if (treasure.location == this) 12this.location:announce_all($string_utils:pronoun_sub(tostr(this:titlec(), " %<grabs> ", treasure:title(), "."), this)); 13return; 14endif 15endif 16endfor 17endif 18if ($object_utils:isa(this.location, $room) && (!$object_utils:isa(this.location, $terrain))) 19real = ((rlen = length(rexits = this.location:obvious_exits())) && (rexit = rexits[random(rlen)]):is_unlocked_for(this)) ? 1 | 0; 20if ($object_utils:isa(this.location, $veroom)) 21virtual = ((vlen = length(vexits = this.location.virtual_exits)) && (vexit = vexits[random(vlen)])) ? 1 | 0; 22else 23virtual = 0; 24endif 25if (real && virtual) 26if (random(2) == 2) 27rexit:move(this); 28elseif (this.location:exit_unlocked_for(vexit, this)) 29this.location:match_exit(vexit[1][1]); 30this.location:move(this); 31endif 32elseif (real) 33rexit:move(this); 34elseif (virtual) 35this.location:match_exit(vexit[1][1]); 36this.location:move(this); 37else 38"No way out. Go home."; 39try 40this:moveto(this.home); 41except v (ANY) 42this:moveto($dead_zone); 43endtry 44endif 45elseif ($object_utils:isa(this.location, $terrain)) 46if (!this.terrain_only) 47real = (((rlen = length(rexits = this.location:obvious_exits())) && (rexit = rexits[random(rlen)]):is_unlocked_for(this)) && this.location:match_loc(rexit, this)) ? 1 | 0; 48if (real) 49return rexit:move(this); 50endif 51endif 52for t in (this.location.compass) 53way = this.location.compass[random($)]; 54target = this.location:loc_way(way, this.x_loc, this.y_loc); 55if (target != {0, 0}) 56if (way == "u") 57wayfrom = "below"; 58elseif (way == "d") 59wayfrom = "above"; 60elseif (w = way in $list_utils:slice(this.location.strip_pairs)) 61wayfrom = this.location.strip_pairs[w][2]; 62elseif (w = way in $list_utils:slice(this.location.strip_pairs, 2)) 63wayfrom = this.location.strip_pairs[w][1]; 64endif 65way = this.location:parse_dir(way, "long"); 66wayfrom = this.location:parse_dir(wayfrom, "long"); 67this.location:announce_all($string_utils:pronoun_sub(tostr(this.location.relocate_msg, way, "."), this)); 68this.location:set_object_loc(this, target[1], target[2]); 69return this.location:announce_all($string_utils:pronoun_sub(tostr(this.location.loc_arrive_msg, wayfrom, "."), this)); 70endif 71endfor 72endif
look_self
Referenced by
none
Source
1desc = this:description(); 2if (desc) 3player:tell_lines(desc); 4else 5player:Tell("You see nothing special."); 6endif 7health = this.stats_current[2][4] / (this.stats[2][4] + 0.0001); 8if (!this.alive) 9player:tell($gender_utils:pronoun_sub("%{:He} %{!is} dead.", this)); 10elseif (!this.alert) 11player:tell($gender_utils:pronoun_sub("%{:He} %{!is} unconscious.", this)); 12elseif (!this.mobile) 13player:tell($gender_utils:pronoun_sub("%{:He} %{!is} immobilized.", this)); 14elseif (health < 0.75) 15if (health < 0.25) 16player:tell($gender_utils:pronoun_sub("%{:He} %{!is} obviously in very poor health.", this)); 17else 18player:tell($gender_utils:pronoun_sub("%{:He} %{!is} obviously in poor health.", this)); 19endif 20else 21player:tell($gender_utils:pronoun_sub("%{:He} %{!is} awake and %{!looks} alert.", this)); 22endif 23this:tell_contents(this.contents);
reached_limit
Referenced by
none
Source
1return (length(this:contents()) >= toint(1.5 * this.stats_current[2][1])) ? 1 | 0;
_capture
Referenced by
none
Source
1"WIZ OWNED"; 2"This is if called by handcuffs or mental control verbs."; 3this.following = player; 4player.followed_by = this; 5if ($scheduler:kill_task(this.wander_task)) 6this.wander_task = 0; 7endif 8this:_leash();
_release
Referenced by
- #107:release line 17:
this:_release - #107:_leash line 19:
this:_release
Source
1"WIZ OWNED...to be called from handcuffs or mental control verbs."; 2if (valid(this.following)) 3$you:say_action("%N %<releases> %d."); 4this.wander_task = (0 || (!$scheduler:valid_task(call_function("tonum", this.wander_task)))) ? $scheduler:schedule_every(this.wait_seconds, this, "wander") | this.wander_task; 5player:dump_followers(); 6endif
birth
Referenced by
- #107:rot_away line 10:
this:birth - #136:rot_away line 12:
this:birth
Source
1"wiz-owned"; 2this.alive = 1; 3this.alert = 1; 4this.mobile = 1; 5this.stats_current = this.stats; 6paw = this.wielded; 7this.wielded = (this.weapon_types != {}) ? this.weapon_types[random($)] | paw; 8this.wielded = (this.wielded.f && (!(this.wielded in {$hand, $claw, $teeth}))) ? this.wielded:replicate() | paw; 9this.wielded = valid(this.wielded) ? this.wielded | paw; 10if (this.wielded != paw) 11this.wielded:moveto(this); 12endif 13try 14this:moveto(this.home); 15except v (ANY) 16this:moveto($dead_zone); 17endtry 18this.location:announce_all($string_utils:pronoun_sub(this.birth_msg, this)); 19return;
dump_goodies
Referenced by
- #107:rot_away line 3:
this:dump_goodies - #107:_loot line 5:
this:dump_goodies - #136:rot_away line 4:
this:dump_goodies
Source
1"USAGE: dump_goodies(1 or 0) => moves contents of this to this location."; 2" if 1 is the argument, money is dumped, too"; 3"wiz-owned"; 4if (valid(this.location)) 5if (this.natural_def) 6this.wielded = (this.natural_def == 2) ? $hand | $claw; 7else 8this.wielded = $teeth; 9endif 10for x in (this.contents) 11try 12if (($object_utils:has_callable_verb(x, "recycle_at_death") && (!((this.alive && this.alert) && this.mobile))) && x.recycle_at_death) 13x:recycle_at_death(); 14else 15x:moveto(this.location); 16endif 17if ($object_utils:has_property(x, "x_loc")) 18x.x_loc = this.x_loc; 19x.y_loc = this.y_loc; 20endif 21except v (ANY) 22"it won't move"; 23endtry 24endfor 25"Move money to this location"; 26if ((this.money != {}) && args[1]) 27money = $recycler:_create($death_purse, $default_holder); 28$building_utils:set_names(money, tostr(this.name, "'s cash purse,cash purse,cash,purse,money")); 29money.money = this.money; 30this.money = {}; 31money:moveto(this.location); 32money.x_loc = this.x_loc; 33money.y_loc = this.y_loc; 34endif 35endif
die
Referenced by
- #107:take_hit line 21:
this:die
Source
1"resets props, moves monster to afterlife."; 2"wiz-owned"; 3who = (length(callers()) < 2) ? player | callers()[2][3]; 4trustees = {this.owner}; 5for x in ($object_utils:ancestors(this)) 6trustees = setadd(trustees, x.owner); 7endfor 8for x in ($object_utils:ancestors(this.location)) 9trustees = setadd(trustees, x.owner); 10endfor 11if ((!(who in trustees)) && (!who.wizard)) 12"Bogus killer"; 13return; 14elseif ((!this.alive) && this.alert) 15"already dead"; 16return this:pass_out(); 17endif 18this.alert = 0; 19this.alive = 0; 20this.location:announce_all_but({this}, $string_utils:pronoun_sub(this.death_msg, this)); 21if (this.rot_time > 120) 22$scheduler:schedule(this.rot_time, this, "rot_away"); 23else 24fork (this.rot_time) 25this:rot_away(); 26endfork 27endif 28this.stats_current = {{"Strength", "Dexterity", "Intelligence", "Health"}, {0.0, 0.0, 0.0, 0.0}};
pass_out
Referenced by
- #107:die line 16:
this:pass_out
Source
1"Bye-bye land for 60 seconds"; 2if (this.alert) 3if ((player.wielded == $hand) || (player:damage(1) < 4.0)) 4this.location:announce_all_but({this}, $string_utils:pronoun_sub("%N %<becomes> dazed.", this)); 5timeout = 15; 6wakeup = "%N %<regains> focus."; 7else 8this.location:announce_all_but({this}, $string_utils:pronoun_sub("%N %<falls> unconscious.", this)); 9timeout = 60; 10wakeup = "%N %<awakens> from unconsciousness."; 11endif 12this.alert = 0; 13fork (timeout) 14if (this.alive || (this.location == $dead_zone)) 15this.alert = 1; 16this.location:announce_all_but({this}, $string_utils:pronoun_sub(wakeup, this)); 17endif 18endfork 19endif
freeze
Referenced by
none
Source
1"Paralysis for 60 seconds"; 2if (this.mobile) 3this.location:announce_all_but({this}, $string_utils:pronoun_sub("%N %<becomes> immobilized.", this)); 4this.mobile = 0; 5fork (60) 6this.mobile = 1; 7if (this:alive()) 8this.location:announce_all_but({this}, $string_utils:pronoun_sub("%N %<regains> mobility.", this)); 9endif 10endfork 11endif
take_hit
Referenced by
none
Source
1"USAGE: victim:take_hit(damage[, attacker])"; 2" wiz-owned to prevent permission problems"; 3damage = tofloat(args[1]); 4this.enemy = ((length(args) > 1) && valid(args[2])) ? args[2] | this.enemy; 5fork (1) 6this.my_tell = 1; 7if ((this.alive && this.alert) && this.mobile) 8if (this.hostility && (this.stats_current[2][4] > (this.stats[2][4] * 0.333))) 9stun = (this.wielded.can_stun || this.wielded.can_paralyse) ? 1 | 0; 10`this.location:do_attack(tostr(this), tostr(this.enemy), this:damage(), stun) ! ANY => "invalid enemy or bad location"'; 11else 12this:wander(); 13endif 14endif 15this.my_tell = 0; 16endfork 17if (((caller == this.location) || (caller == this.owner)) || (caller == this)) 18damage = ((x = damage - this:armor()) > 0.1) ? x | 0.1; 19this.stats_current[2][4] = this.stats_current[2][4] - damage; 20if (this.stats_current[2][4] < 0.0) 21this:die(); 22endif 23endif 24return this.stats_current[2][4];
plan_next_move
Referenced by
- #107:tell line 16:
this:plan_next_move - #107:@start line 33:
this:plan_next_move
Source
1"wiz perms - Chance of monster getting recycled during this verb, so 'try' is used."; 2try 3if (this.wander_ok && this.countdown_til_stop) 4this:wander(); 5this.wander_task = $scheduler:schedule(this.wait_seconds, this, "plan_next_move"); 6this.countdown_til_stop = this.countdown_til_stop - 1; 7endif 8except v (ANY) 9return #2:tell(v, " on ", this); 10endtry 11fork (1) 12`this.wander_ok = 0 ! ANY => "must be dead"'; 13endfork 14fork (3) 15`this.wander_ok = 1 ! ANY => "must be dead"'; 16endfork
@start @stop
Referenced by
none
Source
1"wiz-owned to allow scheduling"; 2if ((!player.programmer) && (!(player == this.owner))) 3return; 4endif 5if (this.wander_task) 6if (verb == "@start") 7player:tell(this:titlec(), " is already wandering."); 8elseif ($scheduler:valid_task(call_function("tonum", this.wander_task))) 9$scheduler:kill_task(this.wander_task); 10this.wander_task = 0; 11this.wander_ok = 0; 12player:tell(this:titlec(), " has stopped wandering."); 13fork (3) 14"double-check"; 15this.wander_ok = 0; 16endfork 17else 18player:tell("Invalid wander task. Resetting wander_task to 0. ", this:titlec(), " can resume wandering at any time."); 19this.wander_task = 0; 20this.wander_ok = 0; 21endif 22else 23if (this.wielded in {$teeth, $claw, $hand, $nothing}) 24if (this.natural_def) 25this.wielded = (this.natural_def == 2) ? $hand | $claw; 26else 27this.wielded = $teeth; 28endif 29endif 30if (verb == "@start") 31this.countdown_til_stop = random(10) + 10; 32this.wander_ok = 1; 33this:plan_next_move(); 34player:tell(this:titlec(), " is now wandering every ", this.wait_seconds, " seconds. \"@stop ", this, ", then \"@set ", this, ".wait_seconds to <seconds>\" to change the rate."); 35else 36player:tell(this:titlec(), " was not wandering."); 37endif 38endif
init_for_core
Referenced by
- #136:init_for_core line 13:
pass(
Source
1if (caller_perms().wizard) 2this.wielded = $claw; 3this.home = $player_start; 4this.grave = (this == $replicating_monster) ? $breeder | $player_start; 5pass(@args); 6endif
_loot
Referenced by
- #107:loot line 1:
this:_loot
Source
1"USAGE: loot/rob/pilfer/roll/search/strip <monster> => if monster is knocked out, moves monster.contents to the room."; 2"wiz-owned"; 3if (player.location == this.location) 4if ((!this.alert) || (!this.mobile)) 5this:dump_goodies(1); 6$you:say_action("%N %<searches> %d for valuable goods."); 7this.location:tell_contents(setremove(this.location:contents(), player), this.location.ctype); 8else 9player:tell(this:titlec(), " cautiously dodges your advance."); 10this.location:announce_all_but({this, player}, tostr(this:titlec(), " cautiously avoids ", player:title(), ".")); 11endif 12else 13player:tell("There is no \"", dobjstr, "\" here."); 14endif
roll_against
Referenced by
none
Source
1"USAGE: roll_against(StatOrSkillName or nothing) => Tests for successful action attempt."; 2" => 0=failure, 1=success, 2=total success"; 3"supports: strength, dexterity, intelligence, health, attack, defense, combat"; 4name = `args[1] ! E_RANGE => ""'; 5if (!name) 6level = 10.5; 7sk = 0; 8elseif (i = name in this.stats[1]) 9level = this.stats[2][i]; 10sk = 0; 11elseif (name in {"combat", "attack"}) 12sk = "combat" in this.skills[1]; 13level = this:to_hit(); 14elseif (name == "defense") 15sk = "combat" in this.skills[1]; 16level = this:to_defend(); 17else 18level = 10.5; 19sk = 0; 20endif 21roll = tofloat((random(6) + random(6)) + random(6)); 22if ((roll < 5.0) || (roll < (level - 10.0))) 23hit = 2; 24elseif ((roll < level) && (roll < 16.0)) 25hit = 1; 26else 27hit = 0; 28endif 29return hit;
loot rob pilfer roll search strip
Referenced by
none
Source
1this:_loot();