add purely cosmetic damage type for acid

the original source code had calls to animate acid
with the blood graphic and a specific acid SFX,
which makes more sense than a zap graphic and sound.

This change makes acid look and sound distinct from
magic damage, although mechanically it's still
magic damage.
This commit is contained in:
2025-05-07 17:06:55 -05:00
parent ea8296157f
commit e3fadf727f
4 changed files with 25 additions and 7 deletions

View File

@@ -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,

View File

@@ -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())

View File

@@ -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;

View File

@@ -61,6 +61,7 @@ std::map<eDamageType,int> 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);
}
}