Skip to content

Commit

Permalink
Fix half/double damage calculation from non piercing attacks
Browse files Browse the repository at this point in the history
  • Loading branch information
edo9300 committed Dec 10, 2023
1 parent 39e4ab2 commit b931f3e
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3799,15 +3799,16 @@ void field::calculate_battle_damage(effect** pdamchange, card** preason_card, ui
pduel->lua->add_param<LuaParam::CARD>(core.attacker);
val = peff->get_value(1);
}
if(val == 0) {
dam_value = 0;
break;
} else if(val > 0)
dam_value = static_cast<int32_t>(val);
else if(val == DOUBLE_DAMAGE)
if(val == DOUBLE_DAMAGE) {
double_dam = true;
else if(val == HALF_DAMAGE)
} else if(val == HALF_DAMAGE) {
half_dam = true;
} else if(val > 0) {
dam_value = static_cast<int32_t>(val);
} else if(val == 0) {
dam_value = 0;
break;
}
}
if(double_dam && half_dam) {
double_dam = false;
Expand Down Expand Up @@ -3922,15 +3923,16 @@ void field::calculate_battle_damage(effect** pdamchange, card** preason_card, ui
pduel->lua->add_param<LuaParam::CARD>(reason_card);
val = peff->get_value(1);
}
if(val == 0) {
dam_value = 0;
break;
} else if(val > 0)
dam_value = static_cast<int32_t>(val);
else if(val == DOUBLE_DAMAGE)
if(val == DOUBLE_DAMAGE) {
double_dam = true;
else if(val == HALF_DAMAGE)
} else if(val == HALF_DAMAGE) {
half_dam = true;
} else if(val > 0) {
dam_value = static_cast<int32_t>(val);
} else if(val == 0) {
dam_value = 0;
break;
}
}
if(double_dam && half_dam) {
double_dam = false;
Expand Down

0 comments on commit b931f3e

Please sign in to comment.