Skip to content

Commit

Permalink
Remove the bleed-over-time effect from clawed attacks
Browse files Browse the repository at this point in the history
And from acid and Zin's recite - it dealt mostly insignificant damage while
creating a bunch of message spam. Bleeding still exists as an immediate
cosmetic effect on taking damage.
  • Loading branch information
Chris Campbell committed Jul 26, 2015
1 parent dc655b2 commit 9532fc8
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 144 deletions.
23 changes: 2 additions & 21 deletions crawl-ref/source/attack.cc
Expand Up @@ -49,8 +49,7 @@ attack::attack(actor *attk, actor *defn, actor *blame)
perceived_attack(false), obvious_effect(false), to_hit(0),
damage_done(0), special_damage(0), aux_damage(0), min_delay(0),
final_attack_delay(0), special_damage_flavour(BEAM_NONE),
stab_attempt(false), stab_bonus(0), apply_bleeding(false),
ev_margin(0), weapon(nullptr),
stab_attempt(false), stab_bonus(0), ev_margin(0), weapon(nullptr),
damage_brand(SPWPN_NORMAL), wpn_skill(SK_UNARMED_COMBAT),
shield(nullptr), art_props(0), unrand_entry(nullptr),
attacker_to_hit_penalty(0), attack_verb("bug"), verb_degree(),
Expand Down Expand Up @@ -103,21 +102,6 @@ bool attack::handle_phase_damaged()
{
if (damage_done)
player_exercise_combat_skills();

if (defender->alive())
{
// Actually apply the bleeding effect, this can come from an
// aux claw or a main hand claw attack and up to now has not
// actually happened.
const int degree = you.has_usable_claws();
if (apply_bleeding && defender->can_bleed()
&& degree > 0 && damage_done > 0)
{
defender->as_monster()->bleed(attacker,
3 + roll_dice(degree, 3),
degree);
}
}
}
else
{
Expand Down Expand Up @@ -1343,12 +1327,9 @@ int attack::calc_base_unarmed_damage()

int damage = get_form()->get_base_unarmed_damage();

// Claw damage only applies for bare hands.
if (you.has_usable_claws())
{
// Claw damage only applies for bare hands.
damage += you.has_claws(false) * 2;
apply_bleeding = true;
}

if (you.form_uses_xl())
damage += you.experience_level;
Expand Down
2 changes: 0 additions & 2 deletions crawl-ref/source/attack.h
Expand Up @@ -43,8 +43,6 @@ class attack
bool stab_attempt;
int stab_bonus;

bool apply_bleeding;

// Fetched/Calculated from the attacker, stored to save execution time
int ev_margin;

Expand Down
2 changes: 2 additions & 0 deletions crawl-ref/source/enum.h
Expand Up @@ -1880,7 +1880,9 @@ enum enchant_type
ENCH_SILENCE,
ENCH_AWAKEN_FOREST,
ENCH_EXPLODING,
#if TAG_MAJOR_VERSION == 34
ENCH_BLEED,
#endif
ENCH_PORTAL_TIMER,
ENCH_SEVERED,
ENCH_ANTIMAGIC,
Expand Down
71 changes: 23 additions & 48 deletions crawl-ref/source/godabil.cc
Expand Up @@ -608,7 +608,6 @@ enum zin_eff
ZIN_DAZE,
ZIN_CONFUSE,
ZIN_PARALYSE,
ZIN_BLEED,
ZIN_SMITE,
ZIN_BLIND,
ZIN_SILVER_CORONA,
Expand Down Expand Up @@ -720,7 +719,7 @@ bool zin_recite_to_single_monster(const coord_def& where)
if (check < 5)
{
if (coinflip())
effect = ZIN_BLEED;
effect = ZIN_CONFUSE;
else
effect = ZIN_SMITE;
}
Expand Down Expand Up @@ -756,8 +755,8 @@ bool zin_recite_to_single_monster(const coord_def& where)
if (check < 5)
{
// nastier -- fallthrough if immune
if (coinflip() && mon->can_bleed())
effect = ZIN_BLEED;
if (coinflip() && mon->res_rotting() <= 1)
effect = ZIN_ROT;
else
effect = ZIN_SMITE;
}
Expand Down Expand Up @@ -785,15 +784,15 @@ bool zin_recite_to_single_monster(const coord_def& where)
// immune, of course.
if (check < 5)
{
if (coinflip() && mon->can_bleed())
effect = ZIN_BLEED;
if (coinflip() && mon->res_rotting() <= 1)
effect = ZIN_ROT;
else
effect = ZIN_SMITE;
}
else if (check < 10)
{
if (coinflip() && mon->res_rotting() <= 1)
effect = ZIN_ROT;
if (coinflip())
effect = ZIN_SMITE;
else
effect = ZIN_SILVER_CORONA;
}
Expand Down Expand Up @@ -880,42 +879,6 @@ bool zin_recite_to_single_monster(const coord_def& where)
}
break;

case ZIN_BLEED:
if (mon->can_bleed()
&& mon->add_ench(mon_enchant(ENCH_BLEED, degree, &you,
(degree + random2(spellpower)) * BASELINE_DELAY)))
{
mon->add_ench(mon_enchant(ENCH_SICK, degree, &you,
(degree + random2(spellpower)) * BASELINE_DELAY));
switch (prayertype)
{
case RECITE_HERETIC:
if (minor)
simple_monster_message(mon, "'s eyes and ears begin to bleed.");
else
{
mprf("%s bleeds profusely from %s eyes and ears.",
mon->name(DESC_THE).c_str(),
mon->pronoun(PRONOUN_POSSESSIVE).c_str());
}
break;
case RECITE_CHAOTIC:
simple_monster_message(mon,
minor ? "'s chaotic flesh is covered in bleeding sores."
: "'s chaotic flesh erupts into weeping sores!");
break;
case RECITE_IMPURE:
simple_monster_message(mon,
minor ? "'s impure flesh is covered in bleeding sores."
: "'s impure flesh erupts into weeping sores!");
break;
default:
die("bad recite bleed");
}
affected = true;
}
break;

case ZIN_SMITE:
if (minor)
simple_monster_message(mon, " is smitten by the wrath of Zin.");
Expand Down Expand Up @@ -1020,15 +983,27 @@ bool zin_recite_to_single_monster(const coord_def& where)
break;

case ZIN_ROT:
ASSERT(prayertype == RECITE_IMPURE);
if (mon->res_rotting() <= 1
&& mon->rot(&you, 1 + roll_dice(2, degree), true))
{
mon->add_ench(mon_enchant(ENCH_SICK, degree, &you,
(degree + random2(spellpower)) * BASELINE_DELAY));
simple_monster_message(mon,
minor ? "'s impure flesh rots away."
: "'s impure flesh sloughs off!");
switch (prayertype)
{
case RECITE_CHAOTIC:
simple_monster_message(mon,
minor ? "'s chaotic flesh is covered in bleeding sores."
: "'s chaotic flesh erupts into weeping sores!");
break;
case RECITE_IMPURE:
simple_monster_message(mon,
minor ? "'s impure flesh rots away."
: "'s impure flesh sloughs off!");
break;

default:
die("bad recite rot");
}
affected = true;
}
break;
Expand Down
15 changes: 2 additions & 13 deletions crawl-ref/source/melee_attack.cc
Expand Up @@ -1327,19 +1327,8 @@ bool melee_attack::player_aux_apply(unarmed_attack_type atk)
aux_damage = inflict_damage(aux_damage, BEAM_MISSILE);
damage_done = aux_damage;

switch (atk)
{
case UNAT_PUNCH:
apply_bleeding = true;
break;

case UNAT_CONSTRICT:
attacker->start_constricting(*defender);
break;

default:
break;
}
if (atk == UNAT_CONSTRICT)
attacker->start_constricting(*defender);

if (damage_done > 0 || atk == UNAT_CONSTRICT)
{
Expand Down
30 changes: 4 additions & 26 deletions crawl-ref/source/mon-ench.cc
Expand Up @@ -825,11 +825,6 @@ void monster::remove_enchantment_effect(const mon_enchant &me, bool quiet)
forest_message(pos(), "The forest calms down.");
break;

case ENCH_BLEED:
if (!quiet)
simple_monster_message(this, " is no longer bleeding.");
break;

case ENCH_WITHDRAWN:
if (!quiet)
simple_monster_message(this, " emerges from its shell.");
Expand Down Expand Up @@ -1894,26 +1889,6 @@ void monster::apply_enchantment(const mon_enchant &me)
}
break;

case ENCH_BLEED:
{
// 3, 6, 9% of current hp
int dam = div_rand_round(random2((1 + hit_points)*(me.degree * 3)),100);

// location, montype, damage (1 hp = 5% chance), spatter, smell_alert
bleed_onto_floor(pos(), type, 20, false, true);

if (dam < hit_points)
{
hurt(me.agent(), dam);

dprf("hit_points: %d ; bleed damage: %d ; degree: %d",
hit_points, dam, me.degree);
}

decay_enchantment(en, true);
break;
}

// This is like Corona, but if silver harms them, it has sticky
// flame levels of damage.
case ENCH_SILVER_CORONA:
Expand Down Expand Up @@ -2232,7 +2207,10 @@ static const char *enchant_names[] =
"slouch",
#endif
"swift", "tide",
"insane", "silenced", "awaken_forest", "exploding", "bleeding",
"insane", "silenced", "awaken_forest", "exploding",
#if TAG_MAJOR_VERSION == 34
"bleeding",
#endif
"tethered", "severed", "antimagic",
#if TAG_MAJOR_VERSION == 34
"fading_away", "preparing_resurrect",
Expand Down
6 changes: 0 additions & 6 deletions crawl-ref/source/mon-info.cc
Expand Up @@ -120,8 +120,6 @@ static monster_info_flags ench_to_mb(const monster& mons, enchant_type ench)
return MB_FEAR_INSPIRING;
case ENCH_WITHDRAWN:
return MB_WITHDRAWN;
case ENCH_BLEED:
return MB_BLEEDING;
case ENCH_DAZED:
return MB_DAZED;
case ENCH_MUTE:
Expand Down Expand Up @@ -1307,8 +1305,6 @@ static string _verbose_info0(const monster_info& mi)
return "wandering";
if (mi.is(MB_BURNING))
return "burning";
if (mi.is(MB_BLEEDING))
return "bleeding";
if (mi.is(MB_INVISIBLE))
return "invisible";

Expand Down Expand Up @@ -1507,8 +1503,6 @@ vector<string> monster_info::attributes() const
v.emplace_back("radiating silence");
if (is(MB_PARALYSED))
v.emplace_back("paralysed");
if (is(MB_BLEEDING))
v.emplace_back("bleeding");
if (is(MB_REPEL_MSL))
v.emplace_back("repelling missiles");
if (is(MB_DEFLECT_MSL))
Expand Down
2 changes: 2 additions & 0 deletions crawl-ref/source/mon-info.h
Expand Up @@ -47,7 +47,9 @@ enum monster_info_flags
MB_SHAPESHIFTER,
MB_CHAOTIC,
MB_SUBMERGED,
#if TAG_MAJOR_VERSION == 34
MB_BLEEDING,
#endif
MB_DEFLECT_MSL,
#if TAG_MAJOR_VERSION == 34
MB_PREP_RESURRECT,
Expand Down
27 changes: 1 addition & 26 deletions crawl-ref/source/monster.cc
Expand Up @@ -4516,25 +4516,13 @@ void monster::corrode_equipment(const char* corrosion_source, int degree)
}

/**
* Attempts to either apply corrosion to a monster or make it bleed from acid
* damage.
* Attempts to apply corrosion to a monster.
*/
void monster::splash_with_acid(const actor* evildoer, int /*acid_strength*/,
bool /*allow_corrosion*/, const char* /*hurt_msg*/)
{
if (!one_chance_in(3))
corrode_equipment();
else if (!one_chance_in(3) && can_bleed() && !res_acid())
{
add_ench(mon_enchant(ENCH_BLEED, 3, evildoer, (5 + random2(5))*10));

if (you.can_see(*this))
{
mprf("%s writhes in agony as %s flesh is eaten away!",
name(DESC_THE).c_str(),
pronoun(PRONOUN_POSSESSIVE).c_str());
}
}
}

int monster::hurt(const actor *agent, int amount, beam_type flavour,
Expand Down Expand Up @@ -5166,19 +5154,6 @@ bool monster::sicken(int amount)
return true;
}

bool monster::bleed(const actor* agent, int amount, int degree)
{
if (!has_ench(ENCH_BLEED) && you.can_see(*this))
{
mprf("%s begins to bleed from %s wounds!", name(DESC_THE).c_str(),
pronoun(PRONOUN_POSSESSIVE).c_str());
}

add_ench(mon_enchant(ENCH_BLEED, degree, agent, amount * BASELINE_DELAY));

return true;
}

// Recalculate movement speed.
void monster::calc_speed()
{
Expand Down
1 change: 0 additions & 1 deletion crawl-ref/source/monster.h
Expand Up @@ -465,7 +465,6 @@ class monster : public actor

bool poison(actor *agent, int amount = 1, bool force = false);
bool sicken(int strength);
bool bleed(const actor *agent, int amount, int degree);
void paralyse(actor *, int str, string source = "");
void petrify(actor *, bool force = false);
bool fully_petrify(actor *foe, bool quiet = false);
Expand Down
2 changes: 1 addition & 1 deletion crawl-ref/source/timed_effects.cc
Expand Up @@ -1320,7 +1320,7 @@ void monster::timeout_enchantments(int levels)
case ENCH_PARALYSIS: case ENCH_PETRIFYING:
case ENCH_PETRIFIED: case ENCH_SWIFT: case ENCH_BATTLE_FRENZY:
case ENCH_SILENCE: case ENCH_LOWERED_MR:
case ENCH_SOUL_RIPE: case ENCH_BLEED: case ENCH_ANTIMAGIC:
case ENCH_SOUL_RIPE: case ENCH_ANTIMAGIC:
case ENCH_FEAR_INSPIRING: case ENCH_REGENERATION: case ENCH_RAISED_MR:
case ENCH_MIRROR_DAMAGE: case ENCH_STONESKIN: case ENCH_LIQUEFYING:
case ENCH_SILVER_CORONA: case ENCH_DAZED: case ENCH_FAKE_ABJURATION:
Expand Down

0 comments on commit 9532fc8

Please sign in to comment.