Skip to content

Commit

Permalink
Make the chainsaw lajatang possibly hurt you when pulled from your ha…
Browse files Browse the repository at this point in the history
…nds.
  • Loading branch information
ianestrachan committed Dec 6, 2013
1 parent c4cfd15 commit 6e33cdf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion data/json/items/tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,7 @@
"volume": 30,
"bashing": 4,
"cutting": 140,
"flags" : ["CHOP", "MESSY"],
"flags" : ["CHOP", "MESSY", "HURT_WHEN_PULLED"],
"to_hit": -5,
"max_charges": 800,
"initial_charges": 0,
Expand Down
16 changes: 12 additions & 4 deletions src/melee.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1248,16 +1248,24 @@ std::string player::melee_special_effects(game *g, monster *z, player *p, bool c
}
if (!unarmed_attack() && cutting_penalty > dice(str_cur * 2, 20) &&
!z->is_hallucination()) {
if (you)
if (you) {
dump << string_format(_("Your %s gets stuck in %s, pulling it our of your hands!"), weapon.tname().c_str(), target.c_str());
}
if(weapon.has_flag("HURT_WHEN_PULLED") && one_in(3)) {
//Sharp objects that injure wielder when pulled from hands (so cutting damage only)
dump << std::endl << string_format(_("You are hurt by the %s being pulled from your hands!"), weapon.tname().c_str());
p->hit(g, bp_hands, random_side(bp_hands), 0, (weapon.damage_cut() / 2));
}
if (mon) {
if (weapon.has_flag("SPEAR") || weapon.has_flag("STAB"))
if (weapon.has_flag("SPEAR") || weapon.has_flag("STAB")) {
z->speed *= .7;
else
} else {
z->speed *= .85;
}
z->add_item(remove_weapon());
} else
} else {
g->m.add_item_or_charges(posx, posy, remove_weapon());
}
} else {
if (mon && (cut_dam >= z->hp || stab_dam >= z->hp)) {
cutting_penalty /= 2;
Expand Down

0 comments on commit 6e33cdf

Please sign in to comment.