Fix logic

This commit is contained in:
tool4EvEr
2023-02-24 14:17:25 +01:00
parent e9dfbf3c66
commit 2a88ac8402
4 changed files with 8 additions and 11 deletions

View File

@@ -14,7 +14,7 @@ public class GameLossAi extends SpellAbilityAi {
// Only one SA Lose the Game card right now, which is Door to Nothingness // Only one SA Lose the Game card right now, which is Door to Nothingness
if (sa.usesTargeting()) { if (sa.usesTargeting() && sa.canTarget(opp)) {
sa.resetTargets(); sa.resetTargets();
sa.getTargets().add(opp); sa.getTargets().add(opp);
return true; return true;
@@ -28,8 +28,6 @@ public class GameLossAi extends SpellAbilityAi {
Player loser = ai; Player loser = ai;
// Phage the Untouchable // Phage the Untouchable
// (Final Fortune would need to attach it's delayed trigger to a
// specific turn, which can't be done yet)
if (ai.getGame().getCombat() != null) { if (ai.getGame().getCombat() != null) {
loser = ai.getGame().getCombat().getDefenderPlayerByAttacker(sa.getHostCard()); loser = ai.getGame().getCombat().getDefenderPlayerByAttacker(sa.getHostCard());
} }
@@ -38,7 +36,7 @@ public class GameLossAi extends SpellAbilityAi {
return false; return false;
} }
if (sa.usesTargeting()) { if (sa.usesTargeting() && sa.canTarget(loser)) {
sa.resetTargets(); sa.resetTargets();
sa.getTargets().add(loser); sa.getTargets().add(loser);
} }

View File

@@ -43,7 +43,7 @@ public class RestartGameEffect extends SpellAbilityEffect {
// Avoid Psychic Surgery trigger in new game // Avoid Psychic Surgery trigger in new game
trigHandler.suppressMode(TriggerType.Shuffled); trigHandler.suppressMode(TriggerType.Shuffled);
game.getPhaseHandler().resetExtra(); game.getPhaseHandler().restart();
game.getPhaseHandler().setPlayerDeclaresAttackers(null); game.getPhaseHandler().setPlayerDeclaresAttackers(null);
game.getPhaseHandler().setPlayerDeclaresBlockers(null); game.getPhaseHandler().setPlayerDeclaresBlockers(null);
game.getUntap().clearCommands(); game.getUntap().clearCommands();
@@ -105,9 +105,7 @@ public class RestartGameEffect extends SpellAbilityEffect {
game.resetTurnOrder(); game.resetTurnOrder();
game.setAge(GameStage.RestartedByKarn); game.setAge(GameStage.RestartedByKarn);
// For the rare case that you get to resolve it during another players turn // For the rare case that you get to resolve it during another players turn
game.getPhaseHandler().setPlayerTurn(sa.getActivatingPlayer()); game.getPhaseHandler().setPlayerTurn(activator);
// Set turn number?
// The rest is handled by phaseHandler // The rest is handled by phaseHandler
} }

View File

@@ -825,9 +825,10 @@ public class PhaseHandler implements java.io.Serializable {
game.fireEvent(new GameEventCombatChanged()); game.fireEvent(new GameEventCombatChanged());
} }
public void resetExtra() { public void restart() {
extraPhases.clear(); extraPhases.clear();
extraTurns.clear(); extraTurns.clear();
turn = 0;
} }
private Player handleNextTurn() { private Player handleNextTurn() {

View File

@@ -4,8 +4,8 @@ Types:Legendary Creature Goblin Rebel
PT:2/2 PT:2/2
K:Trample K:Trample
K:Haste K:Haste
T:Mode$ Attacks | ValidCard$ Creature.equipped+Other | Execute$ TrigAttach | TriggerDescription$ Whenever an equipped creature you control other than CARDNAME attacks or dies, you may attach all Equipment attached to that creature to NICKNAME. T:Mode$ Attacks | ValidCard$ Creature.equipped+Other | Execute$ TrigAttach | TriggerZones$ Battlefield | TriggerDescription$ Whenever an equipped creature you control other than CARDNAME attacks or dies, you may attach all Equipment attached to that creature to NICKNAME.
T:Mode$ ChangesZone | ValidCard$ Creature.equipped+Other | Origin$ Battlefield | Destination$ Graveyard | Execute$ TrigAttach | OptionalDecider$ You | Secondary$ True | TriggerDescription$ Whenever an equipped creature you control other than CARDNAME attacks or dies, you may attach all Equipment attached to that creature to NICKNAME. T:Mode$ ChangesZone | ValidCard$ Creature.equipped+Other | Origin$ Battlefield | Destination$ Graveyard | Execute$ TrigAttach | TriggerZones$ Battlefield | OptionalDecider$ You | Secondary$ True | TriggerDescription$ Whenever an equipped creature you control other than CARDNAME attacks or dies, you may attach all Equipment attached to that creature to NICKNAME.
SVar:TrigAttach:DB$ Attach | Object$ AttachedTo TriggeredCard.Equipment | Defined$ Self SVar:TrigAttach:DB$ Attach | Object$ AttachedTo TriggeredCard.Equipment | Defined$ Self
DeckNeeds:Type$Equipment DeckNeeds:Type$Equipment
Oracle:Trample, haste\nWhenever an equipped creature you control other than Rhuk, Hexgold Nabber attacks or dies, you may attach all Equipment attached to that creature to Rhuk. Oracle:Trample, haste\nWhenever an equipped creature you control other than Rhuk, Hexgold Nabber attacks or dies, you may attach all Equipment attached to that creature to Rhuk.