[BOK] reworked implementation of Shirei, Shizo's Caretaker and added test

This commit is contained in:
Evan Kranzler 2022-02-24 17:25:17 -05:00
parent 2a00609918
commit 3cbfe4d623
13 changed files with 140 additions and 176 deletions

View file

@ -1,11 +1,9 @@
package mage.abilities.condition.common;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.game.Game;
/**
* As long as the sourceId permanent is
* on the battlefield, the condition is true.
@ -13,18 +11,15 @@ import mage.game.Game;
* @author LevelX2
*/
public enum SourceOnBattlefieldCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
return (game.getPermanent(source.getSourceId()) != null);
return source.getSourcePermanentIfItStillExists(game) != null;
}
@Override
public String toString() {
return "if {this} is on the battlefield";
}
}