mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
Fixed CantCastMoreThanOneSpellEffect.
This commit is contained in:
parent
2c93d3fc1a
commit
76402133ab
1 changed files with 6 additions and 1 deletions
|
@ -28,6 +28,7 @@
|
|||
|
||||
package mage.abilities.effects.common.continious;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
|
@ -70,6 +71,10 @@ public class CantCastMoreThanOneSpellEffect extends ReplacementEffectImpl<CantCa
|
|||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null) {
|
||||
game.informPlayers(mageObject + ": You can't cast more than one spell each turn.");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -93,7 +98,7 @@ public class CantCastMoreThanOneSpellEffect extends ReplacementEffectImpl<CantCa
|
|||
return false;
|
||||
}
|
||||
}
|
||||
CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get("CastSpellLastTurnWatcher", event.getPlayerId());
|
||||
CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get("CastSpellLastTurnWatcher");
|
||||
if (watcher != null && watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(event.getPlayerId())> 0) {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue