grenade #135

Parent #255Owner #361Flags read, fertileSource hellcore/hellcore.db

Aliases: grenade

23 verbs · 61 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
pull activate lightthis none nonerxd#1351
_explodethis none thisrxd#13524
_pullthis none thisrxd#13531
timethis none thisrxd#1351
affect_creaturethis none thisrxd#13567
fall leapnone on top of/on/onto/upon thisrxd#13518
burn_upthis none thisrxd#1353
_breakthis none thisrxd#1352
is_junkablethis none thisrxd#1354
movetothis none thisrxd#13536
grenade nadeany with/using thisrxd#13518
detect_difficultythis none thisrxd#1353
receives_full_blastthis none thisrxd#13513
hear_event_arrivethis none thisrxd#1358
hear_event_movethis none thisrxd#1358
thrown_atthis none thisrxd#1355
blast_severitythis none thisrxd#13520
can_globthis none thisrxd#1351
on_failed_breakdownthis none thisrxd#13510
on_munchthis none thisrxd#1358
stashthis none nonerxd#1355
explode_atthis none thisrxd#1352
tree_tagthis none thisrxd#1356

Properties

PropertyDefinerFlagsOwnerValue
time#135rc#3615
damage#135rc#361{{#277, 5, 10}, {#280, 1, 8}, {#279, 1, 8}}
explode_in_hand_msg#135rc#361"%DN looks dumbfounded as %dt goes off in %p hand."
explode_in_room_msg#135rc#361""
explode_msg#135rc#361"~1b[31m~1b[1m *** B O O M ***~1b[0m"
pull_msg#135rc#361"%DN pulls the pin on %p %t."
explode_task#135r#3610
thrower#135r#361#-1
blast_decal#135rc#361#-1
noise_msg#135rc#361"You hear a %vol explosion from %dir."
noise_volume#135rc#3618
no_decal#135rc#361{}
faller#135rc#361#-1
difficulty#135rc#3610
target#135rc#361#-1
explode_near_msg#135rc#361"%DT explodes near %dl!"
target_cover#135r#3610
awarers#135rc#361{}
volatility#135rc#3610
detect_difficulty#135rc#3610
cause_explosion#135rc#3611
proximity_damage_multiplier#135rc#3612.0
break_msg#255rc#361<clear>
repair_difficulty#255rc#361-999
junk_on_break#255rc#361<clear>
rename_on_break#255rc#361""
smashable#255rc#361<clear>
repairable#255rc#361<clear>
armor#255rc#361<clear>
held_break_msg#255rc#361<clear>
oheld_break_msg#255rc#361<clear>
handed#5rc#361<clear>
wield_msg#5rc#361<clear>
unwield_msg#5rc#361<clear>
size#5rc#361<clear>
look_place_msg#5rc#361<clear>
value#5rc#361<clear>
get_msg#5rc#361<clear>
drop_msg#5rc#361<clear>
get_fail_msg#5rc#361<clear>
junk_ok#5rc#3611
floats#5rc#361<clear>
long_name_msg#5rc#361<clear>
article#5rc#361<clear>
setup_list#5rc#361<clear>
health#5rc#361<clear>
health_max#5rc#361<clear>
min_skill#5rc#361<clear>
skill#5rc#361#1864
recipe_for#5rc#361<clear>
carried_msg#5rc#361<clear>
aliases#1rc#361{"grenade"}
description#1rc#361<clear>
object_size#1r#29{20418, 1298433816}
hidden_verbs#1rc#361<clear>
phelp_msg#1rc#361<clear>
weight#1rc#361300
owner_verbs#1rc#361<clear>
plural_name#1rc#361<clear>
client_image#1rc#361<clear>
listening#1rc#361<clear>

Ancestry

Ancestors (nearest first): #255 generic smashable thing#5 generic thing#1 root

Children: none

Call graph

calls n135_0 #135:pull n92_2 #92:queue_action n135_0->n92_2 n1_30 #1:name n135_0->n1_30 n135_1 #135:_explode n1_46 #1:room n135_1->n1_46 n20_34 #20:pronoun_sub n135_1->n20_34 n135_21 #135:explode_at n135_1->n135_21 n103_2 #103:junk n135_1->n103_2 n247_0 #247:at n135_21->n247_0 n135_2 #135:_pull n135_2->n135_1 n135_2->n1_46 n135_2->n20_34 n135_3 #135:time n135_2->n135_3 n135_4 #135:affect_creature n135_12 #135:receives_full_blast n135_4->n135_12 n135_12->n135_12 n135_5 #135:fall n135_5->n1_46 n107_43 #107:tell n135_5->n107_43 n1_31 #1:dname n135_5->n1_31 n1_66 #1:announce_action_text n135_5->n1_66 n6_169 #6:dnamec n135_5->n6_169 n135_6 #135:burn_up n135_6->n135_1 n135_6->n1_46 n1_39 #1:dnamec n135_6->n1_39 n135_9 #135:moveto n135_6->n135_9 n135_9->n135_1 n1_13 #1:moveto n135_9->n1_13 n135_11 #135:detect_difficulty n135_9->n135_11 n135_7 #135:_break n135_7->n135_1 n135_8 #135:is_junkable n5_22 #5:is_junkable n135_8->n5_22 n135_10 #135:grenade n135_10->n92_2 n135_10->n135_2 n135_10->n107_43 n135_10->n1_31 n107_0 #107:_wield n135_10->n107_0 n103_47 #103:valid n135_10->n103_47 n5_9 #5:iname n135_10->n5_9 n135_13 #135:hear_event_arrive n135_13->n135_11 n135_15 #135:thrown_at n5_25 #5:thrown_at n135_15->n5_25 n135_16 #135:blast_severity n135_16->n1_46 n135_16->n135_12 n135_17 #135:can_glob n5_21 #5:can_glob n135_17->n5_21 n135_18 #135:on_failed_breakdown n135_18->n135_1 n135_19 #135:on_munch n135_19->n103_2 n135_20 #135:stash n135_20->n107_43 n5_20 #5:stash n135_20->n5_20 n135_22 #135:tree_tag n5_18 #5:tree_tag n135_22->n5_18 n20_5 #20:from_list n135_22->n20_5

Source

pull activate light

Spec this none noneFlags rxdOwner #361Definer #135

Referenced by

none

Source

1player:queue_action($actions.verb, {this, "_pull", {player}}, 1, "pull " + this:name());

_explode

Spec this none thisFlags rxdOwner #361Definer #135

Referenced by

Source

1if (!valid(where = is_a(this.location, $creature) ? this:room() | this.location))
2return;
3endif
4if (valid(this.target) && (this.target.location != where))
5this.target = #-1;
6endif
7if (is_a(this.location, $living))
8msg = this.explode_in_hand_msg;
9elseif (valid(this.target) && ((this.target_cover == (!(!(this.target in where.covering)))) && this.explode_near_msg))
10msg = this.explode_near_msg;
11else
12msg = this.explode_in_room_msg;
13endif
14decal = this.blast_decal;
15for nd in (this.no_decal)
16if (is_a(where, nd))
17decal = #-1;
18endif
19endfor
20where:announce_all($su:ps(msg, this.location, this, this.target));
21if (this.cause_explosion)
22this:explode_at(decal);
23endif
24$rpg:junk(this);

_pull

Spec this none thisFlags rxdOwner #361Definer #135

Referenced by

Source

1who = args[1];
2if (who:_wield(this))
3if (task_valid(this.explode_task))
4who:tell("It's already active!");
5else
6if (who:area() == #94696)
7check = 2;
8else
9check = $skills.bombs:check(who, this.difficulty + 2);
10endif
11if (check < 0)
12time = random(4) - 1;
13else
14time = this:time();
15endif
16fork task_id (time)
17if (gamevalid(this))
18this:_explode(who);
19endif
20endfork
21this.explode_task = task_id;
22who:aat($su:ps(this.pull_msg, player, this));
23this.thrower = who;
24if (this.is_crime)
25this:room():broadcast_event(1, $actions.pull, who, {this});
26this:room():broadcast_event(1, $actions.fight, this.thrower, {$player});
27endif
28endif
29else
30who:tell("You need to be holding it to do that.");
31endif

time

Spec this none thisFlags rxdOwner #361Definer #135

Referenced by

Source

1return this.time;

affect_creature

Spec this none thisFlags rxdOwner #361Definer #135

Referenced by

none

Source

1"Copied from testnade (#156795):affect_creature by Socrates (#290421) Fri Jan  9 19:08:31 2009 CST";
2who = args[1];
3where = args[2];
4if (!who:grenade_can_affect(this, where))
5return;
6endif
7if (valid(this.thrower))
8if (is_a(this.thrower, $player) && is_a(who, $player))
9who:_pvp_record({this.thrower}, this.name);
10endif
11if (((!is_a(who, $player)) && (who.location != this.thrower.location)) && (this.thrower.location == #44969.location))
12#44969:add_win(this.thrower);
13endif
14endif
15mod = -3;
16amount_multiplier = 1.0;
17if (is_a(where, $outdoor_room))
18mod = mod + 3;
19endif
20if ((is_a(where, $room) && (who in where.covering)) && (this.target != who))
21mod = mod + 3;
22endif
23if (this.faller || (this.location == who))
24amount_multiplier = amount_multiplier + 4.0;
25else
26"Very low damage if grenade is blowing at a target in cover and this is not the target OR if we are and have left cover.";
27if (!this:receives_full_blast(who))
28mod = mod + 3;
29amount_multiplier = amount_multiplier * 0.5;
30"Simulate that it's put in a nook or something.";
31if (valid(this.target) && this.target_cover)
32amount_multiplier = amount_multiplier * 0.25;
33endif
34endif
35endif
36mod = max($skills.dodge:check(who, mod), 0);
37if (mod > 0)
38who:tell("You manage to shield yourself from some of the blast...");
39endif
40for d in (this.damage)
41amount = d[2] + (((d[3] - d[2]) > 0) ? random(d[3] - d[2]) | 0);
42amount = toint(tofloat(amount) * amount_multiplier);
43if ((mod > 0) && (!(d[1] in {#308, #1326})))
44amount = amount - min(amount / 2, random(max(1, mod)));
45endif
46who:take_damage(d[1], amount, $bodypart);
47if ((this.location == who.location) && (random(100) <= (toint((tofloat(amount) / tofloat(who.health_max)) * 100.0) - (who.health_max / 5))))
48check = #113:check(who, -5, 1);
49if ((check <= 0) && (who.movable_by_explosion == 1))
50if (is_a(this.location, $room) && this.location.exits)
51direction = this.location.exits[random($)];
52location = direction.otherside.location;
53if (is_a(direction, $door) && (direction.open == 0))
54return;
55elseif (is_a(direction, #18385))
56return;
57elseif (direction.passable == 0)
58return;
59endif
60who:moveto(location);
61location:announce_all(who:name(), " comes sailing in.");
62this.location:announce_all(who:name(), " is blown ", direction.name, " by the explosion!");
63location:fall_into(who, this.location, 20);
64endif
65endif
66endif
67endfor

fall leap

Spec none on top of/on/onto/upon thisFlags rxdOwner #361Definer #135

Referenced by

none

Source

1if (this.location != this:room())
2if (g = player.location:occupants($grenade))
3g[$]:fall();
4return;
5endif
6player:tell("You can't fall on a grenade until it's actually on the ground, Einstein.");
7return;
8endif
9if (valid(this.faller) && this.faller:is_in(this.location))
10if (this.faller == player)
11player:Tell("You're already lying on it.  Make your peace with your god...");
12else
13player:tell(this.faller:dnamec(), " is already lying on ", this:dname(), "!");
14endif
15return;
16endif
17this.faller = player;
18player:aat(player:dnamec(), " leaps heroically onto ", this:dname(), ", covering it with ", player.pp, " body!");

burn_up

Spec this none thisFlags rxdOwner #361Definer #135

Referenced by

none

Source

1this:room():announce_all(this:dnamec(), " sparks and bounces in the flames.  It's clearly about to blow...");
2this:moveto(this:room());
3this:_explode();

_break

Spec this none thisFlags rxdOwner #361Definer #135

Referenced by

none

Source

1this.thrower = is_a(player, $living) ? player | #-1;
2this:_explode();

is_junkable

Spec this none thisFlags rxdOwner #361Definer #135

Referenced by

none

Source

1if (task_valid(this.explode_task))
2return 0;
3endif
4return pass(@args);

moveto

Spec this none thisFlags rxdOwner #361Definer #135

Referenced by

Source

1"Copied from testnade (#156795):moveto by Socrates (#290421) Fri Jan  9 19:08:49 2009 CST";
2"Copied from grenade (#1573):moveto by Gilmore (#98) Fri Jan  9 10:22:26 2009 CST";
3o = this.location;
4r = pass(@args);
5"Picking up a lit grenade is dangerous.";
6if ((this.volatility == 2) || (task_valid(this.explode_task) && (this.volatility == 1)))
7if (!is_a(o, #2801))
8if (is_a(this.location, $creature))
9check = $skills.bombs:check(this.location, this.difficulty + 2);
10if (check < 0)
11fork (0)
12`this:_explode() ! ANY => 0';
13endfork
14endif
15endif
16endif
17endif
18"This is so if you drop it, you will be the primary target of the blast.";
19if (is_a(this.location, $creature))
20this.target = this.location;
21this.awarers = {};
22elseif (valid(this.target) && (this.target.location == this.location))
23this.target_cover = this.target in this.target.location.covering;
24elseif (is_a(this.location, $room))
25this.target = #-1;
26this.awarers = {};
27for who in (this.location:occupants($living))
28if ($skills.senses:check(who, this:detect_difficulty(), 1) > 0)
29this.awarers = {who, @this.awarers};
30endif
31endfor
32else
33this.target = #-1;
34this.awarers = {};
35endif
36return r;

grenade nade

Spec any with/using thisFlags rxdOwner #29Definer #135

Referenced by

none

Source

1"Activate and throw the grenade in the specified direction.";
2target = dobj;
3if (!valid(target))
4player:tell("What's a '", dobjstr, "'?");
5elseif (this.location != player)
6player:tell("You're not carrying ", this:dname(), ".");
7elseif (target == player)
8player:tell("Really? I don't think you are serious.");
9elseif ((target.location == player.location) && ((is_a(target, $exit) && target.passable) || is_a(target, $living)))
10if (player:_wield(this))
11this:_pull(player);
12if ($rpg:valid(this))
13player:queue_action($actions.throw, {this, target}, 0, "throw " + this.name);
14endif
15endif
16else
17player:tell("You can't throw ", this:iname(), " to ", dobj:dname(), ".");
18endif

detect_difficulty

Spec this none thisFlags rxdOwner #361Definer #135

Referenced by

Source

1"Copied from testnade (#156795):detect_difficulty by Socrates (#290421) Fri Jan  9 19:08:08 2009 CST";
2":detect_difficulty() => Return the modifier to the senses check for noticing this grenade.";
3return this.detect_difficulty;

receives_full_blast

Spec this none thisFlags rxdOwner #361Definer #135

Referenced by

Source

1":receives_full_blast(who, [checked]) => Return true if who is at the blast, either because he's the target, fighting the target or because he's not aware of it.";
2who = args[1];
3checked = (length(args) >= 2) ? args[2] | {};
4for other in (who.fighting)
5if (is_a(other, $living))
6if (((other in checked) || this:receives_full_blast(other, setadd(checked, who))) && (!is_a(other:weapon(), #284)))
7return 1;
8endif
9endif
10endfor
11unaware = !(who in this.awarers);
12being_flushed_out = (this.target == who) && (this.target_cover == (!(!(who in who.location.covering))));
13return (unaware || being_flushed_out) && (who != this.thrower);

hear_event_arrive

Spec this none thisFlags rxdOwner #361Definer #135

Referenced by

none

Source

1"Copied from testnade (#156795):hear_event_arrive by Socrates (#290421) Fri Jan  9 19:08:26 2009 CST";
2"Copied from generic mine (#35898):hear_event_arrive by Jed (#45097) Fri Jan  9 14:55:17 2009 CST";
3who = args[3];
4if (is_a(who, $living))
5if ($skills.senses:check(who, this:detect_difficulty(), 1) > 0)
6this.awarers = setadd(this.awarers, who);
7endif
8endif

hear_event_move

Spec this none thisFlags rxdOwner #361Definer #135

Referenced by

none

Source

1"Copied from testnade (#156795):hear_event_move by Socrates (#290421) Fri Jan  9 19:08:44 2009 CST";
2{is_start, action, who, cwords} = args;
3if (!is_start)
4if (who == this.target)
5this.target = #-1;
6endif
7this.awarers = setremove(this.awarers, who);
8endif

thrown_at

Spec this none thisFlags rxdOwner #361Definer #135

Referenced by

none

Source

1"Copied from testnade (#156795):thrown_at by Socrates (#290421) Fri Jan  9 19:08:54 2009 CST";
2{target, thrower} = args;
3this.target = target;
4this.awarers = target:room():contents($living);
5pass(@args);

blast_severity

Spec this none thisFlags rxdOwner #361Definer #135

Referenced by

none

Source

1":blast_severity(who) => Return the blast severity as a two element list:  a modifier to a dodge roll and a floating point multiplier for damage.";
2who = args[1];
3where = this:room();
4mod = -3;
5damage_multiplier = 1.0;
6if (valid(this.faller) && (this.faller != who))
7return {0, 0.0};
8endif
9if ((this.faller == who) || (this.location == who))
10damage_multiplier = damage_multiplier + `this.proximity_damage_multiplier ! E_PROPNF => 2.0';
11elseif (!this:receives_full_blast(who))
12mod = mod + 3;
13damage_multiplier = damage_multiplier * 0.5;
14"Simulate that it's put in a nook or something.";
15if (valid(this.target) && this.target_cover)
16damage_multiplier = damage_multiplier * 0.5;
17mod = mod + 3;
18endif
19endif
20return {mod, damage_multiplier};

can_glob

Spec this none thisFlags rxdOwner #361Definer #135

Referenced by

none

Source

1return pass(@args) && (!this.explode_task);

on_failed_breakdown

Spec this none thisFlags rxdOwner #361Definer #135

Referenced by

none

Source

1{who, check} = args;
2if (check < -3)
3who:tell("Oh... shit.");
4fork (0)
5if (is_a(this, $grenade))
6this.thrower = who;
7this:_explode();
8endif
9endfork
10endif

on_munch

Spec this none thisFlags rxdOwner #361Definer #135

Referenced by

none

Source

1who = args[1];
2if (task_valid(this.explode_task))
3suspend(2);
4who:aat(who:name() + " looks rather ill.");
5suspend(1);
6who:take_damage($damages.explosion, 100, #304);
7endif
8$rpg:junk(this);

stash

Spec this none noneFlags rxdOwner #361Definer #135

Referenced by

none

Source

1if (task_valid(this.explode_task))
2player:tell("Fuck you.");
3else
4pass(@args);
5endif

explode_at

Spec this none thisFlags rxdOwner #361Definer #135

Referenced by

Source

1{decal} = args;
2$explosion:at(this.location, this.damage, this.thrower, this.explode_msg, this.noise_msg, this.noise_volume, decal, `this.max_depth ! E_PROPNF => 0', {this, "blast_severity"});

tree_tag

Spec this none thisFlags rxdOwner #361Definer #135

Referenced by

none

Source

1r = pass(@args);
2r = tostr(r, " ", $ansi.bold_on, $ansi.red, this.difficulty, $ansi.reset);
3if (this != $grenade)
4r = tostr(r, " ", $su:from_list(verbs(this), ","));
5endif
6return r;