game: try to avoid increasing monster's health disproportionately

This commit is contained in:
ALONSO Laurent
2021-12-28 09:41:36 +01:00
committed by Celtic Minstrel
parent bb32d635d8
commit ba08e03be0

View File

@@ -1454,7 +1454,7 @@ short damage_monst(cCreature& victim, short who_hit, short how_much, eDamageType
// Absorb damage? // Absorb damage?
if((dam_type == eDamageType::FIRE || dam_type == eDamageType::MAGIC || dam_type == eDamageType::COLD) if((dam_type == eDamageType::FIRE || dam_type == eDamageType::MAGIC || dam_type == eDamageType::COLD)
&& victim.abil[eMonstAbil::ABSORB_SPELLS].active && get_ran(1,1,1000) <= victim.abil[eMonstAbil::ABSORB_SPELLS].special.extra1) { && victim.abil[eMonstAbil::ABSORB_SPELLS].active && get_ran(1,1,1000) <= victim.abil[eMonstAbil::ABSORB_SPELLS].special.extra1) {
if(32767 - victim.health < how_much) if(32767 - int(victim.health) < how_much)
victim.health = 32767; victim.health = 32767;
else victim.health += how_much; else victim.health += how_much;
ASB(" Magic absorbed."); ASB(" Magic absorbed.");