Secret of Bloodbending and support (#9129)

This commit is contained in:
tool4ever
2025-11-10 13:18:53 +01:00
committed by GitHub
parent c9a5fe9135
commit 3db276f323
8 changed files with 27 additions and 13 deletions

View File

@@ -75,11 +75,13 @@ public class Game {
private List<Card> activePlanes = null;
public final Phase cleanup;
public final Phase endOfCombat;
public final Phase endOfTurn;
public final Untap untap;
public final Phase upkeep;
public final Phase beginOfCombat;
public final Phase endOfCombat;
public final Phase endOfTurn;
public final Phase cleanup;
// to execute commands for "current" phase each time state based action is checked
public final List<GameCommand> sbaCheckedCommandList;
public final MagicStack stack;
@@ -363,9 +365,10 @@ public class Game {
untap = new Untap(this);
upkeep = new Phase(PhaseType.UPKEEP);
cleanup = new Phase(PhaseType.CLEANUP);
beginOfCombat = new Phase(PhaseType.COMBAT_BEGIN);
endOfCombat = new Phase(PhaseType.COMBAT_END);
endOfTurn = new Phase(PhaseType.END_OF_TURN);
cleanup = new Phase(PhaseType.CLEANUP);
sbaCheckedCommandList = new ArrayList<>();
@@ -428,6 +431,9 @@ public class Game {
public final Phase getUpkeep() {
return upkeep;
}
public final Phase getBeginOfCombat() {
return beginOfCombat;
}
public final Phase getEndOfCombat() {
return endOfCombat;
}

View File

@@ -2,7 +2,6 @@ package forge.game.ability.effects;
import java.util.List;
import forge.GameCommand;
import forge.game.Game;
import forge.game.ability.AbilityUtils;
import forge.game.ability.SpellAbilityEffect;
@@ -28,10 +27,11 @@ public class ControlPlayerEffect extends SpellAbilityEffect {
public void resolve(SpellAbility sa) {
final Player controller = AbilityUtils.getDefinedPlayers(sa.getHostCard(), sa.getParam("Controller"), sa).get(0);
final Game game = controller.getGame();
final boolean combat = sa.hasParam("Combat");
for (final Player pTarget: getTargetPlayers(sa)) {
// before next untap gain control
game.getCleanup().addUntil(pTarget, (GameCommand) () -> {
(combat ? game.getBeginOfCombat() : game.getCleanup()).addUntil(pTarget, () -> {
// CR 800.4b
if (!controller.isInGame()) {
return;
@@ -41,7 +41,7 @@ public class ControlPlayerEffect extends SpellAbilityEffect {
pTarget.addController(ts, controller);
// after following cleanup release control
game.getCleanup().addUntil((GameCommand) () -> pTarget.removeController(ts));
(combat ? game.getEndOfCombat() : game.getCleanup()).addUntil(() -> pTarget.removeController(ts));
});
}
}

View File

@@ -297,6 +297,7 @@ public class PhaseHandler implements java.io.Serializable {
case COMBAT_BEGIN:
nCombatsThisTurn++;
combat = new Combat(playerTurn);
game.getBeginOfCombat().executeUntil(playerTurn);
//PhaseUtil.verifyCombat();
break;
@@ -756,7 +757,6 @@ public class PhaseHandler implements java.io.Serializable {
}
}
}
// fire blockers declared trigger
final Map<AbilityKey, Object> bdRunParams = AbilityKey.newMap();
bdRunParams.put(AbilityKey.Blockers, declaredBlockers);
bdRunParams.put(AbilityKey.Attackers, blockedAttackers);
@@ -768,7 +768,6 @@ public class PhaseHandler implements java.io.Serializable {
continue;
}
// Run triggers
final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put(AbilityKey.Blocker, c1);
runParams.put(AbilityKey.Attackers, combat.getAttackersBlockedBy(c1));

View File

@@ -428,7 +428,7 @@ public class MagicStack /* extends MyObservable */ implements Iterable<SpellAbil
game.getTriggerHandler().runTrigger(TriggerType.AbilityCast, runParams, true);
}
if (sp.getPayCosts() != null && sp.getMaxWaterbend() != null) {
if (sp.getMaxWaterbend() != null) {
activator.triggerElementalBend(TriggerType.Waterbend);
}