mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Merge branch 'fixes' into 'master'
RestartGame tweak + AI NPE from card changes See merge request core-developers/forge!6409
This commit is contained in:
@@ -183,7 +183,10 @@ public class CountersPutOrRemoveAi extends SpellAbilityAi {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean doTriggerAINoCost(Player ai, SpellAbility sa, boolean mandatory) {
|
protected boolean doTriggerAINoCost(Player ai, SpellAbility sa, boolean mandatory) {
|
||||||
return doTgt(ai, sa, true);
|
if (sa.usesTargeting()) {
|
||||||
|
return doTgt(ai, sa, mandatory);
|
||||||
|
}
|
||||||
|
return mandatory;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -510,7 +510,7 @@ public class GameAction {
|
|||||||
|
|
||||||
if (mergedCards != null) {
|
if (mergedCards != null) {
|
||||||
// Move components of merged permanent here
|
// Move components of merged permanent here
|
||||||
// Also handle 721.3e and 903.9a
|
// Also handle 723.3e and 903.9a
|
||||||
boolean wasToken = c.isToken();
|
boolean wasToken = c.isToken();
|
||||||
if (commanderEffect != null) {
|
if (commanderEffect != null) {
|
||||||
for (final ReplacementEffect re : commanderEffect.getReplacementEffects()) {
|
for (final ReplacementEffect re : commanderEffect.getReplacementEffects()) {
|
||||||
@@ -524,7 +524,7 @@ public class GameAction {
|
|||||||
if (card.isRealCommander()) {
|
if (card.isRealCommander()) {
|
||||||
card.setMoveToCommandZone(true);
|
card.setMoveToCommandZone(true);
|
||||||
}
|
}
|
||||||
// 721.3e & 903.9a
|
// 723.3e & 903.9a
|
||||||
if (wasToken && !card.isRealToken() || card.isRealCommander()) {
|
if (wasToken && !card.isRealToken() || card.isRealCommander()) {
|
||||||
Map<AbilityKey, Object> repParams = AbilityKey.mapFromAffected(card);
|
Map<AbilityKey, Object> repParams = AbilityKey.mapFromAffected(card);
|
||||||
repParams.put(AbilityKey.CardLKI, card);
|
repParams.put(AbilityKey.CardLKI, card);
|
||||||
|
|||||||
@@ -167,8 +167,7 @@ public class PlayEffect extends SpellAbilityEffect {
|
|||||||
// so it gets added to stack
|
// so it gets added to stack
|
||||||
card.setCopiedPermanent(card);
|
card.setCopiedPermanent(card);
|
||||||
card.setToken(true);
|
card.setToken(true);
|
||||||
tgtCards = new CardCollection();
|
tgtCards = new CardCollection(card);
|
||||||
tgtCards.add(card);
|
|
||||||
} else {
|
} else {
|
||||||
tgtCards = new CardCollection();
|
tgtCards = new CardCollection();
|
||||||
// filter only cards that didn't changed zones
|
// filter only cards that didn't changed zones
|
||||||
@@ -217,7 +216,6 @@ public class PlayEffect extends SpellAbilityEffect {
|
|||||||
boolean singleOption = tgtCards.size() == 1 && amount == 1 && optional;
|
boolean singleOption = tgtCards.size() == 1 && amount == 1 && optional;
|
||||||
Map<String, Object> params = hasTotalCMCLimit ? new HashMap<>() : null;
|
Map<String, Object> params = hasTotalCMCLimit ? new HashMap<>() : null;
|
||||||
|
|
||||||
|
|
||||||
Map<AbilityKey, Object> moveParams = AbilityKey.newMap();
|
Map<AbilityKey, Object> moveParams = AbilityKey.newMap();
|
||||||
moveParams.put(AbilityKey.LastStateBattlefield, sa.getLastStateBattlefield());
|
moveParams.put(AbilityKey.LastStateBattlefield, sa.getLastStateBattlefield());
|
||||||
moveParams.put(AbilityKey.LastStateGraveyard, sa.getLastStateGraveyard());
|
moveParams.put(AbilityKey.LastStateGraveyard, sa.getLastStateGraveyard());
|
||||||
@@ -425,7 +423,6 @@ public class PlayEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
} // end resolve
|
} // end resolve
|
||||||
|
|
||||||
|
|
||||||
protected void addReplaceGraveyardEffect(Card c, SpellAbility sa, String zone, Map<AbilityKey, Object> moveParams) {
|
protected void addReplaceGraveyardEffect(Card c, SpellAbility sa, String zone, Map<AbilityKey, Object> moveParams) {
|
||||||
final Card hostCard = sa.getHostCard();
|
final Card hostCard = sa.getHostCard();
|
||||||
final Game game = hostCard.getGame();
|
final Game game = hostCard.getGame();
|
||||||
|
|||||||
@@ -103,8 +103,8 @@ public class RestartGameEffect extends SpellAbilityEffect {
|
|||||||
|
|
||||||
game.resetTurnOrder();
|
game.resetTurnOrder();
|
||||||
game.setAge(GameStage.RestartedByKarn);
|
game.setAge(GameStage.RestartedByKarn);
|
||||||
// Do not need this because ability will resolve only during that player's turn
|
// For the rare case that you get to resolve it during another players turn
|
||||||
//game.getPhaseHandler().setPlayerTurn(sa.getActivatingPlayer());
|
game.getPhaseHandler().setPlayerTurn(sa.getActivatingPlayer());
|
||||||
|
|
||||||
// Set turn number?
|
// Set turn number?
|
||||||
|
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ public class PhaseHandler implements java.io.Serializable {
|
|||||||
public final Player getPlayerTurn() {
|
public final Player getPlayerTurn() {
|
||||||
return playerTurn;
|
return playerTurn;
|
||||||
}
|
}
|
||||||
private final void setPlayerTurn(final Player playerTurn0) {
|
public final void setPlayerTurn(final Player playerTurn0) {
|
||||||
if (playerTurn == playerTurn0) { return; }
|
if (playerTurn == playerTurn0) { return; }
|
||||||
playerTurn = playerTurn0;
|
playerTurn = playerTurn0;
|
||||||
game.updatePlayerTurnForView();
|
game.updatePlayerTurnForView();
|
||||||
|
|||||||
Reference in New Issue
Block a user