diff --git a/src/damage.hpp b/src/damage.hpp index 87e095ad..b4a0f9e4 100644 --- a/src/damage.hpp +++ b/src/damage.hpp @@ -21,6 +21,8 @@ enum class eDamageType { COLD = 5, UNDEAD = 6, DEMON = 7, + // Acid is treated as magic damage but needs a value to prevent it using a zap explosion + ACID = -1, // Keep these two last SPECIAL = 8, // Completely unblockable damage from assassination skill MARKED = 10, diff --git a/src/game/boe.combat.cpp b/src/game/boe.combat.cpp index e03f0432..4c13bc9f 100644 --- a/src/game/boe.combat.cpp +++ b/src/game/boe.combat.cpp @@ -2512,7 +2512,7 @@ void do_monster_turn() { printed_acid = true; } r1 = get_ran(cur_monst->status[eStatus::ACID],1,6); - damage_monst(*cur_monst, 6,r1, eDamageType::MAGIC); + damage_monst(*cur_monst, 6,r1, eDamageType::ACID); cur_monst->status[eStatus::ACID]--; } @@ -2728,6 +2728,7 @@ void monster_attack(short who_att,iLiving* target) { case eDamageType::MARKED: break; // Invalid case eDamageType::FIRE: add_string_to_buf(" Burning touch!"); break; case eDamageType::COLD: add_string_to_buf(" Freezing touch!"); break; + case eDamageType::ACID: add_string_to_buf(" Acid touch!"); break; case eDamageType::MAGIC: add_string_to_buf(" Shocking touch!"); break; case eDamageType::SPECIAL: case eDamageType::UNBLOCKABLE: add_string_to_buf(" Eerie touch!"); break; @@ -4417,7 +4418,7 @@ void handle_acid() { if(pc.main_status == eMainStatus::ALIVE) if(pc.status[eStatus::ACID] > 0) { r1 = get_ran(pc.status[eStatus::ACID],1,6); - damage_pc(pc,r1,eDamageType::MAGIC,eRace::UNKNOWN); + damage_pc(pc,r1,eDamageType::ACID,eRace::UNKNOWN); move_to_zero(pc.status[eStatus::ACID]); } if(!is_combat()) diff --git a/src/game/boe.party.cpp b/src/game/boe.party.cpp index 4d6c451d..c1e1ce0a 100644 --- a/src/game/boe.party.cpp +++ b/src/game/boe.party.cpp @@ -2348,6 +2348,12 @@ short damage_pc(cPlayer& which_pc,short how_much,eDamageType damage_type,eRace t // but -1 is the new value for "use default" sound_type = get_sound_type(damage_type, sound_type); + int boom_type = boom_gr[damage_type]; + + // Acid doesn't actually have its own damage type in classic BoE + if(damage_type == eDamageType::ACID) + damage_type = eDamageType::MAGIC; + // armor if(damage_type == eDamageType::WEAPON || damage_type == eDamageType::UNDEAD || damage_type == eDamageType::DEMON) { how_much -= minmax(-5,5,which_pc.status[eStatus::BLESS_CURSE]); @@ -2471,10 +2477,10 @@ short damage_pc(cPlayer& which_pc,short how_much,eDamageType damage_type,eRace t add_string_to_buf(" " + which_pc.name + " takes " + std::to_string(how_much) + '.'); if(damage_type != eDamageType::MARKED) { if(is_combat()) - boom_space(which_pc.combat_pos,overall_mode,boom_gr[damage_type],how_much,sound_type); + boom_space(which_pc.combat_pos,overall_mode,boom_type,how_much,sound_type); else if(is_town()) - boom_space(univ.party.town_loc,overall_mode,boom_gr[damage_type],how_much,sound_type); - else boom_space(univ.party.town_loc,100,boom_gr[damage_type],how_much,sound_type); + boom_space(univ.party.town_loc,overall_mode,boom_type,how_much,sound_type); + else boom_space(univ.party.town_loc,100,boom_type,how_much,sound_type); } // TODO: When outdoors it flushed only key events, not mouse events. Why? flushingInput = true; diff --git a/src/game/boe.specials.cpp b/src/game/boe.specials.cpp index 8601b7e9..71e48cdc 100644 --- a/src/game/boe.specials.cpp +++ b/src/game/boe.specials.cpp @@ -61,6 +61,7 @@ std::map boom_gr = { {eDamageType::FIRE, 0}, {eDamageType::POISON, 2}, {eDamageType::MAGIC, 1}, + {eDamageType::ACID, 3}, // TODO add an acid graphic {eDamageType::UNBLOCKABLE, 5}, {eDamageType::COLD, 4}, {eDamageType::UNDEAD, 3}, @@ -1430,6 +1431,8 @@ short get_sound_type(eDamageType dam_type, short forced_sound_type) { sound_type = 0; if(dam_type == eDamageType::FIRE || dam_type == eDamageType::UNBLOCKABLE) sound_type = 5; + else if(dam_type == eDamageType::ACID) + sound_type = 8; else if(dam_type == eDamageType::COLD) sound_type = 7; else if(dam_type == eDamageType::MAGIC) @@ -1464,6 +1467,12 @@ short damage_monst(cCreature& victim, short who_hit, short how_much, eDamageType // but -1 is the new value for "use default" sound_type = get_sound_type(dam_type, sound_type); + int boom_type = boom_gr[dam_type]; + + // Acid doesn't actually have its own damage type in classic BoE + if(dam_type == eDamageType::ACID) + dam_type = eDamageType::MAGIC; + if(dam_type < eDamageType::SPECIAL) { how_much = percent(how_much, victim.resist[dam_type]); } @@ -1555,10 +1564,10 @@ short damage_monst(cCreature& victim, short who_hit, short how_much, eDamageType if(dam_type != eDamageType::MARKED) { if(party_can_see_monst(univ.get_target_i(victim) - 100)) { - boom_space(victim.cur_loc,100,boom_gr[dam_type],how_much,sound_type); + boom_space(victim.cur_loc,100,boom_type,how_much,sound_type); } else { - boom_space(victim.cur_loc,overall_mode, boom_gr[dam_type],how_much,sound_type); + boom_space(victim.cur_loc,overall_mode, boom_type,how_much,sound_type); } }