mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Fixed Exalted and possibly other triggers with overwriting ability crashing the trigger checking code in getPossibleNonCombatDamage.
This commit is contained in:
@@ -1383,11 +1383,14 @@ public class ComputerUtil {
|
|||||||
if (c.isCreature() && c.isInZone(ZoneType.Battlefield) && CombatUtil.canAttack(c)) {
|
if (c.isCreature() && c.isInZone(ZoneType.Battlefield) && CombatUtil.canAttack(c)) {
|
||||||
for (final Trigger t : c.getTriggers()) {
|
for (final Trigger t : c.getTriggers()) {
|
||||||
if ("Attacks".equals(t.getParam("Mode")) && t.hasParam("Execute")) {
|
if ("Attacks".equals(t.getParam("Mode")) && t.hasParam("Execute")) {
|
||||||
SpellAbility trigSa = AbilityFactory.getAbility(c.getSVar(t.getParam("Execute")), c);
|
String exec = c.getSVar(t.getParam("Execute"));
|
||||||
if (trigSa != null && trigSa.getApi() == ApiType.LoseLife
|
if (!exec.isEmpty()) {
|
||||||
&& trigSa.getParamOrDefault("Defined", "").contains("Opponent")) {
|
SpellAbility trigSa = AbilityFactory.getAbility(exec, c);
|
||||||
trigSa.setHostCard(c);
|
if (trigSa != null && trigSa.getApi() == ApiType.LoseLife
|
||||||
damage += AbilityUtils.calculateAmount(trigSa.getHostCard(), trigSa.getParam("LifeAmount"), trigSa);
|
&& trigSa.getParamOrDefault("Defined", "").contains("Opponent")) {
|
||||||
|
trigSa.setHostCard(c);
|
||||||
|
damage += AbilityUtils.calculateAmount(trigSa.getHostCard(), trigSa.getParam("LifeAmount"), trigSa);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user