mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
* Fixed a bug of CastOnlyDuringPhaseStepSourceEffect that allowed players to cast spells in not allowed phases/steps (e.g. Chaotic Strike and Aleatory).
This commit is contained in:
parent
7b326685c1
commit
43460c1256
2 changed files with 36 additions and 4 deletions
|
|
@ -47,12 +47,15 @@ public class CastOnlyDuringPhaseStepSourceEffect extends ContinuousRuleModifying
|
|||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
// has to return true, if the spell cannot be cast in the current phase / step
|
||||
if (event.getSourceId().equals(source.getSourceId())) {
|
||||
return (turnPhase == null || !game.getPhase().getType().equals(turnPhase))
|
||||
&& (phaseStep == null || !game.getTurn().getStepType().equals(phaseStep))
|
||||
&& (condition == null || !condition.apply(game, source));
|
||||
if ((turnPhase != null && !game.getPhase().getType().equals(turnPhase))
|
||||
|| (phaseStep != null && !game.getTurn().getStepType().equals(phaseStep))
|
||||
|| (condition != null && !condition.apply(game, source))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return false; // casr not prevented by this effect
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue