mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Fix crash when assigning damage to defender
This commit is contained in:
@@ -171,7 +171,7 @@ public class ChooseGenericEffectAi extends SpellAbilityAi {
|
||||
loyalty = sp;
|
||||
}
|
||||
}
|
||||
if (sa.getParent().getTargetCard() != null && sa.getParent().getTargetCard().getType().isPlaneswalker()) {
|
||||
if (sa.getParent().getTargetCard() != null && sa.getParent().getTargetCard().isPlaneswalker()) {
|
||||
return loyalty;
|
||||
} else {
|
||||
return p1p1;
|
||||
|
||||
@@ -123,6 +123,8 @@ public class VAssignCombatDamage {
|
||||
if (panel instanceof CardPanel) {
|
||||
source = ((CardPanel)panel).getCard();
|
||||
}
|
||||
if (!damage.containsKey(source))
|
||||
source = null;
|
||||
|
||||
final FSkin.Colors brdrColor = VAssignCombatDamage.this.canAssignTo(source) ? FSkin.Colors.CLR_ACTIVE : FSkin.Colors.CLR_INACTIVE;
|
||||
panel.setBorder(new FSkin.LineSkinBorder(FSkin.getColor(brdrColor), 2));
|
||||
@@ -453,7 +455,7 @@ public class VAssignCombatDamage {
|
||||
}
|
||||
} else {
|
||||
lethalDamage = Math.max(0, card.getLethalDamage());
|
||||
if (card.getCurrentState().getType().isPlaneswalker()) {
|
||||
if (card.getCurrentState().isPlaneswalker()) {
|
||||
lethalDamage = Integer.valueOf(card.getCurrentState().getLoyalty());
|
||||
} else if (attackerHasDeathtouch) {
|
||||
lethalDamage = Math.min(lethalDamage, 1);
|
||||
|
||||
Reference in New Issue
Block a user