diff options
author | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-11-02 12:13:36 -0600 |
---|---|---|
committer | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-11-02 12:14:28 -0600 |
commit | df0f714647e9a25113dff05df58f501a3714f108 (patch) | |
tree | cc18239176399a8cce1f6e82da1c9fe7efae1d09 /crawl-ref/source/mon-act.cc | |
parent | 5605a2f60222aed0a04c9728dfa5455373d41c20 (diff) | |
download | crawl-ref-df0f714647e9a25113dff05df58f501a3714f108.tar.gz crawl-ref-df0f714647e9a25113dff05df58f501a3714f108.zip |
Revert "Merge a few bits of Eino's chaotic_experiment branch that make sense"
This reverts commit d50bd43ba9936c27f4f90ecd324d14cb52c9f381.
Diffstat (limited to 'crawl-ref/source/mon-act.cc')
-rw-r--r-- | crawl-ref/source/mon-act.cc | 40 |
1 files changed, 14 insertions, 26 deletions
diff --git a/crawl-ref/source/mon-act.cc b/crawl-ref/source/mon-act.cc index 4a67c4d57c..42ead2a820 100644 --- a/crawl-ref/source/mon-act.cc +++ b/crawl-ref/source/mon-act.cc @@ -2172,14 +2172,13 @@ static bool _monster_eat_item(monsters *monster, bool nearby) if (mons_friendly(monster) && you.religion != GOD_JIYVA) return (false); - int hps_changed = 0; + int hps_gained = 0; int max_eat = roll_dice(1, 10); int eaten = 0; bool eaten_net = false; - bool death_ooze_ate_good = false; for (stack_iterator si(monster->pos()); - si && eaten < max_eat && hps_changed < 50; ++si) + si && eaten < max_eat && hps_gained < 50; ++si) { if (!is_item_jelly_edible(*si)) continue; @@ -2192,15 +2191,11 @@ static bool _monster_eat_item(monsters *monster, bool nearby) int quant = si->quantity; - death_ooze_ate_good = (monster->type == MONS_DEATH_OOZE - && (get_weapon_brand(*si) == SPWPN_HOLY_WRATH - || get_ammo_brand(*si) == SPMSL_SILVER)); - if (si->base_type != OBJ_GOLD) { quant = std::min(quant, max_eat - eaten); - hps_changed += (quant * item_mass(*si)) / 20 + quant; + hps_gained += (quant * item_mass(*si)) / 20 + quant; eaten += quant; if (mons_is_caught(monster) @@ -2218,7 +2213,7 @@ static bool _monster_eat_item(monsters *monster, bool nearby) if (quant > 500) quant = 500 + roll_dice(2, (quant - 500) / 2); - hps_changed += quant / 10 + 1; + hps_gained += quant / 10 + 1; eaten++; } @@ -2288,19 +2283,14 @@ static bool _monster_eat_item(monsters *monster, bool nearby) if (eaten > 0) { - hps_changed = std::max(hps_changed, 1); - hps_changed = std::min(hps_changed, 50); + hps_gained = std::max(hps_gained, 1); + hps_gained = std::min(hps_gained, 50); - if (death_ooze_ate_good) - monster->hurt(NULL, hps_changed, BEAM_NONE, false); - else - { - // This is done manually instead of using heal_monster(), - // because that function doesn't work quite this way. - bwr - monster->hit_points += hps_changed; - monster->max_hit_points = std::max(monster->hit_points, - monster->max_hit_points); - } + // This is done manually instead of using heal_monster(), + // because that function doesn't work quite this way. -- bwr + monster->hit_points += hps_gained; + monster->max_hit_points = std::max(monster->hit_points, + monster->max_hit_points); if (player_can_hear(monster->pos())) { @@ -2308,12 +2298,10 @@ static bool _monster_eat_item(monsters *monster, bool nearby) nearby ? "" : " distant"); } - if (death_ooze_ate_good) - simple_monster_message(monster, " twists violently!"); - else if (eaten_net) + if (eaten_net) simple_monster_message(monster, " devours the net!"); - else - _jelly_divide(monster); + + _jelly_divide(monster); } return (eaten > 0); |