mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Fix effects that have a player attack a certain GameEntity (like Gideon Jura, Taunt).
This commit is contained in:
@@ -46,11 +46,14 @@ public class MustAttackEffect extends SpellAbilityEffect {
|
||||
|
||||
for (final Player p : tgtPlayers) {
|
||||
if ((tgt == null) || p.canBeTargetedBy(sa)) {
|
||||
GameEntity entity;
|
||||
if (sa.getParam("Defender").equals("Self")) {
|
||||
final String defender = sa.getParam("Defender");
|
||||
final GameEntity entity;
|
||||
if (defender.equals("Self")) {
|
||||
entity = sa.getHostCard();
|
||||
} else if (defender.equals("You")) {
|
||||
entity = sa.getActivatingPlayer();
|
||||
} else {
|
||||
entity = p.getOpponent();
|
||||
throw new RuntimeException("Illegal defender " + defender + " for MustAttackEffect in card " + sa.getHostCard());
|
||||
}
|
||||
// System.out.println("Setting mustAttackEntity to: "+entity);
|
||||
p.setMustAttackEntity(entity);
|
||||
|
||||
@@ -734,6 +734,10 @@ public class CombatUtil {
|
||||
final int cntAttackers = combat.getAttackers().size();
|
||||
final Game game = c.getGame();
|
||||
|
||||
if (c.getController().getMustAttackEntity() != def) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cntAttackers > 0) {
|
||||
for (final Card card : game.getCardsIn(ZoneType.Battlefield)) {
|
||||
for (final String keyword : card.getKeyword()) {
|
||||
|
||||
Reference in New Issue
Block a user