generic monster #107

Parent #94Owner #36Flags read, fertileSource RPG Core/rpgcore-patched.db

Aliases: generic monster, monster

32 verbs · 51 properties · 1 children

Verbs

VerbSpecFlagsDefinerLines
g*et t*akethis none nonerxd#10712
capture cuffthis none nonerd#10710
release uncuff losethis none nonerxd#10722
_leashthis none thisrxd#10720
@com*bat @str*ength @int*elligence @dex*terity @hea*lththis is anyrd#10726
tell_contentsthis none thisrxd#10722
eat consumethis none nonerd#1077
rot_awaythis none thisrxd#10712
tellthis none thisrxd#10718
take_healththis none thisrxd#1074
armorthis none thisrxd#1077
damagethis none thisrxd#10717
to_hitthis none thisrxd#10710
to_defendthis none thisrxd#1077
titlethis none thisrxd#10713
wandernone none nonerxd#10772
look_selfthis none thisrxd#10723
reached_limitthis none thisrxd#1071
_capturethis none thisrxd#1078
_releasethis none thisrxd#1076
birththis none thisrxd#10719
dump_goodiesthis none thisrxd#10735
diethis none thisrxd#10728
pass_outthis none thisrxd#10719
freezethis none thisrxd#10711
take_hitthis none thisrxd#10724
plan_next_movethis none thisrxd#10716
@start @stopthis none nonerd#10738
init_for_corethis none thisrxd#1076
_lootthis none thisrxd#10714
roll_againstthis none thisrxd#10729
loot rob pilfer roll search stripthis none nonerxd#1071

Properties

PropertyDefinerFlagsOwnerValue
home#107rc#36#62
grave#107rc#36#62
rot_time#107rc#36121
gestate#107rc#36900
birth_msg#107rc#36"A %n sprouts from the earth."
weapon_types#107rc#36{}
wander_task#107r#360
wait_seconds#107rc#36480
terrain_only#107rc#360
enemy#107r#36#-1
hostility#107rc#361
death_msg#107rc#36"%N %<falls> limply to the ground."
alert#107r#361
mobile#107r#361
alive#107r#361
wielded#107rc#36#111
natural_def#107rc#360
greedy#107rc#360
edible#107rc#360
wander_ok#107r#361
my_tell#107rwc#360
following#107r#36#-1
followed_by#107r#36#-1
countdown_til_stop#107r#3610
stats#107r#36{{"Strength", "Dexterity", "Intelligence", "Health"}, {10.0, 10.0, 3.0, 10.0}}
stats_current#107r#36{{"Strength", "Dexterity", "Intelligence", "Health"}, {10.0, 10.0, 3.0, 10.0}}
skills#107r#36{{"combat"}, {0.0}}
money#107r#36{}
gender#94rc#36<clear>
pqc#94rc#36<clear>
pq#94rc#36<clear>
ppc#94rc#36<clear>
pp#94rc#36<clear>
prc#94rc#36<clear>
pr#94rc#36<clear>
poc#94rc#36<clear>
po#94rc#36<clear>
psc#94rc#36<clear>
ps#94rc#36<clear>
value_base#102r#2<clear>
damage_base#102r#20.5
x_loc#102r#36<clear>
y_loc#102r#36<clear>
ansi_title#102r#36<clear>
obvious#102r#36<clear>
build_help#102rc#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#1c#360
aliases#1rc#36{"generic monster", "monster"}
description#1rc#36<clear>
object_size#1r#36{35943, -1090650497}
html#1rc#36<clear>

Ancestry

Ancestors (nearest first): #94 Generic Gendered Object#102 subthing#1 Root Class

Children: #136 replicating monster

Call graph

calls n107_0 #107:g*et n27_1 #27:intersection n107_0->n27_1 n1_29 #1:contents n107_0->n1_29 n6_18 #6:tell n107_0->n6_18 n1_4 #1:titlec n107_0->n1_4 n102_4 #102:title n107_0->n102_4 n107_14 #107:title n107_0->n107_14 n56_11 #56:do_huh n107_0->n56_11 n107_1 #107:capture n107_1->n27_1 n107_1->n1_29 n107_1->n6_18 n107_1->n1_4 n107_1->n102_4 n107_1->n107_14 n107_2 #107:release n107_2->n27_1 n107_2->n1_29 n107_2->n6_18 n107_2->n1_4 n107_2->n107_14 n35_1 #35:say_action n107_2->n35_1 n107_19 #107:_release n107_2->n107_19 n107_19->n35_1 n99_17 #99:schedule n107_19->n99_17 n99_4 #99:valid_task n107_19->n99_4 n107_3 #107:_leash n107_3->n1_4 n107_3->n107_19 n107_3->n107_3 n52_5 #52:isa n107_3->n52_5 n1_15 #1:moveto n107_3->n1_15 n107_8 #107:tell n107_3->n107_8 n107_11 #107:damage n107_8->n107_11 n107_8->n99_4 n107_26 #107:plan_next_move n107_8->n107_26 n1_12 #1:tell n107_8->n1_12 n107_4 #107:@com*bat n107_4->n6_18 n107_5 #107:tell_contents n107_5->n6_18 n6_13 #6:linelen n107_5->n6_13 n52_0 #52:has_property n107_5->n52_0 n32_0 #32:length n107_5->n32_0 n6_79 #6:tell_lines n107_5->n6_79 n20_4 #20:columnize n107_5->n20_4 n107_6 #107:eat n107_6->n6_18 n107_6->n107_14 n107_6->n35_1 n20_34 #20:pronoun_sub n107_6->n20_34 n107_7 #107:rot_away n107_7->n1_4 n107_7->n107_14 n107_21 #107:dump_goodies n107_7->n107_21 n107_7->n99_17 n107_20 #107:birth n107_7->n107_20 n107_21->n52_0 n52_3 #52:has_callable_verb n107_21->n52_3 n63_2 #63:_create n107_21->n63_2 n21_1 #21:set_names n107_21->n21_1 n107_20->n1_15 n107_20->n20_34 n107_26->n99_17 n107_15 #107:wander n107_26->n107_15 n107_10 #107:armor n107_10->n1_29 n107_10->n52_0 n107_15->n1_4 n107_15->n52_5 n107_15->n1_15 n107_15->n20_34 n52_6 #52:ancestors n107_15->n52_6 n55_16 #55:slice n107_15->n55_16 n107_16 #107:look_self n107_16->n6_18 n107_16->n107_5 n107_16->n6_79 n1_9 #1:description n107_16->n1_9 n41_7 #41:pronoun_sub n107_16->n41_7 n107_17 #107:reached_limit n107_17->n1_29 n107_18 #107:_capture n107_18->n107_3 n107_22 #107:die n107_22->n20_34 n107_22->n107_7 n107_22->n99_17 n107_22->n52_6 n107_23 #107:pass_out n107_22->n107_23 n107_23->n20_34 n107_24 #107:freeze n107_24->n20_34

Showing 48 of 58 verbs; 10 not shown.

Source

g*et t*ake

Spec this none noneFlags rxdOwner #36Definer #107

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

Spec this none noneFlags rdOwner #36Definer #107

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

Spec this none noneFlags rxdOwner #36Definer #107

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

Spec this none thisFlags rxdOwner #36Definer #107

Referenced by

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

Spec this is anyFlags rdOwner #36Definer #107

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

Spec this none thisFlags rxdOwner #36Definer #107

Referenced by

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

Spec this none noneFlags rdOwner #36Definer #107

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

Spec this none thisFlags rxdOwner #2Definer #107

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #107

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #107

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

Spec this none thisFlags rxdOwner #36Definer #107

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #107

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #107

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #107

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #107

Referenced by

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

Spec none none noneFlags rxdOwner #36Definer #107

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #107

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

Spec this none thisFlags rxdOwner #36Definer #107

Referenced by

none

Source

1return (length(this:contents()) >= toint(1.5 * this.stats_current[2][1])) ? 1 | 0;

_capture

Spec this none thisFlags rxdOwner #2Definer #107

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

Spec this none thisFlags rxdOwner #2Definer #107

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #107

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #107

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #107

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #107

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #107

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

Spec this none thisFlags rxdOwner #2Definer #107

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

Spec this none thisFlags rxdOwner #2Definer #107

Referenced by

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

Spec this none noneFlags rdOwner #2Definer #107

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

Spec this none thisFlags rxdOwner #2Definer #107

Referenced by

Source

1if (caller_perms().wizard)
2this.wielded = $claw;
3this.home = $player_start;
4this.grave = (this == $replicating_monster) ? $breeder | $player_start;
5pass(@args);
6endif

_loot

Spec this none thisFlags rxdOwner #2Definer #107

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #107

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

Spec this none noneFlags rxdOwner #2Definer #107

Referenced by

none

Source

1this:_loot();