grenade #135
Aliases: grenade
23 verbs · 61 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
pull activate light | this none none | rxd | #135 | 1 |
_explode | this none this | rxd | #135 | 24 |
_pull | this none this | rxd | #135 | 31 |
time | this none this | rxd | #135 | 1 |
affect_creature | this none this | rxd | #135 | 67 |
fall leap | none on top of/on/onto/upon this | rxd | #135 | 18 |
burn_up | this none this | rxd | #135 | 3 |
_break | this none this | rxd | #135 | 2 |
is_junkable | this none this | rxd | #135 | 4 |
moveto | this none this | rxd | #135 | 36 |
grenade nade | any with/using this | rxd | #135 | 18 |
detect_difficulty | this none this | rxd | #135 | 3 |
receives_full_blast | this none this | rxd | #135 | 13 |
hear_event_arrive | this none this | rxd | #135 | 8 |
hear_event_move | this none this | rxd | #135 | 8 |
thrown_at | this none this | rxd | #135 | 5 |
blast_severity | this none this | rxd | #135 | 20 |
can_glob | this none this | rxd | #135 | 1 |
on_failed_breakdown | this none this | rxd | #135 | 10 |
on_munch | this none this | rxd | #135 | 8 |
stash | this none none | rxd | #135 | 5 |
explode_at | this none this | rxd | #135 | 2 |
tree_tag | this none this | rxd | #135 | 6 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
time | #135 | rc | #361 | 5 |
damage | #135 | rc | #361 | {{#277, 5, 10}, {#280, 1, 8}, {#279, 1, 8}} |
explode_in_hand_msg | #135 | rc | #361 | "%DN looks dumbfounded as %dt goes off in %p hand." |
explode_in_room_msg | #135 | rc | #361 | "" |
explode_msg | #135 | rc | #361 | "~1b[31m~1b[1m *** B O O M ***~1b[0m" |
pull_msg | #135 | rc | #361 | "%DN pulls the pin on %p %t." |
explode_task | #135 | r | #361 | 0 |
thrower | #135 | r | #361 | #-1 |
blast_decal | #135 | rc | #361 | #-1 |
noise_msg | #135 | rc | #361 | "You hear a %vol explosion from %dir." |
noise_volume | #135 | rc | #361 | 8 |
no_decal | #135 | rc | #361 | {} |
faller | #135 | rc | #361 | #-1 |
difficulty | #135 | rc | #361 | 0 |
target | #135 | rc | #361 | #-1 |
explode_near_msg | #135 | rc | #361 | "%DT explodes near %dl!" |
target_cover | #135 | r | #361 | 0 |
awarers | #135 | rc | #361 | {} |
volatility | #135 | rc | #361 | 0 |
detect_difficulty | #135 | rc | #361 | 0 |
cause_explosion | #135 | rc | #361 | 1 |
proximity_damage_multiplier | #135 | rc | #361 | 2.0 |
break_msg | #255 | rc | #361 | <clear> |
repair_difficulty | #255 | rc | #361 | -999 |
junk_on_break | #255 | rc | #361 | <clear> |
rename_on_break | #255 | rc | #361 | "" |
smashable | #255 | rc | #361 | <clear> |
repairable | #255 | rc | #361 | <clear> |
armor | #255 | rc | #361 | <clear> |
held_break_msg | #255 | rc | #361 | <clear> |
oheld_break_msg | #255 | rc | #361 | <clear> |
handed | #5 | rc | #361 | <clear> |
wield_msg | #5 | rc | #361 | <clear> |
unwield_msg | #5 | rc | #361 | <clear> |
size | #5 | rc | #361 | <clear> |
look_place_msg | #5 | rc | #361 | <clear> |
value | #5 | rc | #361 | <clear> |
get_msg | #5 | rc | #361 | <clear> |
drop_msg | #5 | rc | #361 | <clear> |
get_fail_msg | #5 | rc | #361 | <clear> |
junk_ok | #5 | rc | #361 | 1 |
floats | #5 | rc | #361 | <clear> |
long_name_msg | #5 | rc | #361 | <clear> |
article | #5 | rc | #361 | <clear> |
setup_list | #5 | rc | #361 | <clear> |
health | #5 | rc | #361 | <clear> |
health_max | #5 | rc | #361 | <clear> |
min_skill | #5 | rc | #361 | <clear> |
skill | #5 | rc | #361 | #1864 |
recipe_for | #5 | rc | #361 | <clear> |
carried_msg | #5 | rc | #361 | <clear> |
aliases | #1 | rc | #361 | {"grenade"} |
description | #1 | rc | #361 | <clear> |
object_size | #1 | r | #29 | {20418, 1298433816} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | <clear> |
weight | #1 | rc | #361 | 300 |
owner_verbs | #1 | rc | #361 | <clear> |
plural_name | #1 | rc | #361 | <clear> |
client_image | #1 | rc | #361 | <clear> |
listening | #1 | rc | #361 | <clear> |
Ancestry
Ancestors (nearest first): #255 generic smashable thing → #5 generic thing → #1 root
Children: none
Call graph
Source
pull activate light
Referenced by
none
Source
1player:queue_action($actions.verb, {this, "_pull", {player}}, 1, "pull " + this:name());
_explode
Referenced by
- #135:_pull line 18:
this:_explode - #135:burn_up line 3:
this:_explode - #135:_break line 2:
this:_explode - #135:moveto line 12:
this:_explode - #135:on_failed_breakdown line 7:
this:_explode
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
Referenced by
- #135:grenade line 11:
this:_pull
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
Referenced by
- #135:_pull line 14:
this:time
Source
1return this.time;
affect_creature
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
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
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
Referenced by
none
Source
1this.thrower = is_a(player, $living) ? player | #-1; 2this:_explode();
is_junkable
Referenced by
none
Source
1if (task_valid(this.explode_task)) 2return 0; 3endif 4return pass(@args);
moveto
Referenced by
- #135:burn_up line 2:
this:moveto
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
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
Referenced by
- #135:moveto line 28:
this:detect_difficulty - #135:hear_event_arrive line 5:
this:detect_difficulty
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
Referenced by
- #135:affect_creature line 27:
this:receives_full_blast - #135:receives_full_blast line 6:
this:receives_full_blast - #135:blast_severity line 11:
this:receives_full_blast
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
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
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
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
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
Referenced by
none
Source
1return pass(@args) && (!this.explode_task);
on_failed_breakdown
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
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
Referenced by
none
Source
1if (task_valid(this.explode_task)) 2player:tell("Fuck you."); 3else 4pass(@args); 5endif
explode_at
Referenced by
- #135:_explode line 22:
this:explode_at
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
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;