mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
Merge branch 'pir' into 'master'
Fix AssignGroup skipping triggers See merge request core-developers/forge!5469
This commit is contained in:
@@ -62,13 +62,16 @@ public class AssignGroupEffect extends SpellAbilityEffect {
|
|||||||
// is that in Player order?
|
// is that in Player order?
|
||||||
Collection<GameObject> l = result.get(s);
|
Collection<GameObject> l = result.get(s);
|
||||||
|
|
||||||
|
// no player assigned for this choice
|
||||||
|
if (l.isEmpty()) continue;
|
||||||
|
|
||||||
host.addRemembered(l);
|
host.addRemembered(l);
|
||||||
AbilityUtils.resolve(s);
|
AbilityUtils.resolve(s);
|
||||||
host.removeRemembered(l);
|
host.removeRemembered(l);
|
||||||
|
|
||||||
// this will refresh continuous abilities for players and permanents.
|
// this will refresh continuous abilities for players and permanents.
|
||||||
game.getAction().checkStaticAbilities();
|
game.getAction().checkStaticAbilities();
|
||||||
game.getTriggerHandler().resetActiveTriggers(false);
|
game.getTriggerHandler().resetActiveTriggers();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public class SacrificeEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Expand Sacrifice keyword here depending on what we need out of it.
|
// Expand Sacrifice keyword here depending on what we need out of it.
|
||||||
final String num = sa.hasParam("Amount") ? sa.getParam("Amount") : "1";
|
final String num = sa.getParamOrDefault("Amount", "1");
|
||||||
final int amount = AbilityUtils.calculateAmount(card, num, sa);
|
final int amount = AbilityUtils.calculateAmount(card, num, sa);
|
||||||
final List<Player> tgts = getTargetPlayers(sa);
|
final List<Player> tgts = getTargetPlayers(sa);
|
||||||
final boolean devour = sa.hasParam("Devour");
|
final boolean devour = sa.hasParam("Devour");
|
||||||
|
|||||||
@@ -81,11 +81,11 @@ public class CombatUtil {
|
|||||||
|
|
||||||
public static boolean validateAttackers(final Combat combat) {
|
public static boolean validateAttackers(final Combat combat) {
|
||||||
final AttackConstraints constraints = combat.getAttackConstraints();
|
final AttackConstraints constraints = combat.getAttackConstraints();
|
||||||
final Pair<Map<Card, GameEntity>, Integer> bestAttack = constraints.getLegalAttackers();
|
|
||||||
final int myViolations = constraints.countViolations(combat.getAttackersAndDefenders());
|
final int myViolations = constraints.countViolations(combat.getAttackersAndDefenders());
|
||||||
if (myViolations == -1) {
|
if (myViolations == -1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
final Pair<Map<Card, GameEntity>, Integer> bestAttack = constraints.getLegalAttackers();
|
||||||
return myViolations <= bestAttack.getRight().intValue();
|
return myViolations <= bestAttack.getRight().intValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user