mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
* Fixed that player turn counter was not reset if game was reset (e.g. Karn Liberated).
This commit is contained in:
parent
8e56d06121
commit
e93cd580dd
2 changed files with 7 additions and 1 deletions
|
@ -85,7 +85,7 @@ class CantCastSerraAvengerEffect extends ReplacementEffectImpl<CantCastSerraAven
|
|||
|
||||
public CantCastSerraAvengerEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Detriment);
|
||||
staticText = "You can't cast Serra Avenger during your first, second, or third turns of the game";
|
||||
staticText = "You can't cast {this} during your first, second, or third turns of the game";
|
||||
}
|
||||
|
||||
public CantCastSerraAvengerEffect(final CantCastSerraAvengerEffect effect) {
|
||||
|
@ -115,6 +115,7 @@ class CantCastSerraAvengerEffect extends ReplacementEffectImpl<CantCastSerraAven
|
|||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == EventType.CAST_SPELL && event.getSourceId().equals(source.getSourceId())) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
// it can be cast on other players turn 1 - 3 if some effect let allow you to do this
|
||||
if (controller != null && controller.getTurns() <= 3 && game.getActivePlayerId().equals(source.getControllerId())) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -336,6 +336,10 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Cast e.g. from Karn Liberated to restart the current game
|
||||
* @param game
|
||||
*/
|
||||
@Override
|
||||
public void init(Game game) {
|
||||
init(game, false);
|
||||
|
@ -359,6 +363,7 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
|
|||
this.timerTimeout = false;
|
||||
this.idleTimeout = false;
|
||||
|
||||
this.turns = 0;
|
||||
this.passed = false;
|
||||
this.passedTurn = false;
|
||||
this.passedAllTurns = false;
|
||||
|
|
Loading…
Reference in a new issue