Merge pull request #4796 from spjspj/master

Fix for Planes  (Incorrectly appending continuous effects)
This commit is contained in:
spjspj 2018-04-19 18:10:54 +10:00 committed by GitHub
commit 447c01e1a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 62 additions and 10 deletions

View file

@ -110,12 +110,15 @@ class DrawCardsActivePlayerEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
if (game.getState().getCurrentPlane() != null) {
if (!game.getState().getCurrentPlane().getName().equalsIgnoreCase("Plane - Academy at Tolaria West")) {
Plane cPlane = game.getState().getCurrentPlane();
if (cPlane == null) {
return false;
}
if (cPlane != null) {
if (!cPlane.getName().equalsIgnoreCase("Plane - Academy at Tolaria West")) {
return false;
}
}
Player player = game.getPlayer(game.getActivePlayerId());
if (player != null) {
player.drawCards(amount.calculate(game, source, this), game);
@ -129,7 +132,6 @@ class DrawCardsActivePlayerEffect extends OneShotEffect {
sb.append("draw ").append(CardUtil.numberToText(amount.toString())).append(" cards");
staticText = sb.toString();
}
}
enum HellbentAPCondition implements Condition {

View file

@ -103,6 +103,16 @@ class AstralArenaAttackRestrictionEffect extends RestrictionEffect {
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
Plane cPlane = game.getState().getCurrentPlane();
if (cPlane == null) {
return false;
}
if (cPlane != null) {
if (!cPlane.getName().equalsIgnoreCase("Plane - Astral Arena")) {
return false;
}
}
return true;
}
@ -130,6 +140,15 @@ class AstralArenaBlockRestrictionEffect extends RestrictionEffect {
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
Plane cPlane = game.getState().getCurrentPlane();
if (cPlane == null) {
return false;
}
if (cPlane != null) {
if (!cPlane.getName().equalsIgnoreCase("Plane - Astral Arena")) {
return false;
}
}
return true;
}

View file

@ -122,8 +122,12 @@ class EdgeOfMalacolEffect extends ContinuousRuleModifyingEffectImpl {
public boolean applies(GameEvent event, Ability source, Game game) {
// Prevent untap event of creatures of target player
if (game.getTurn().getStepType() == PhaseStep.UNTAP) {
if (game.getState().getCurrentPlane() != null) {
if (!game.getState().getCurrentPlane().getName().equalsIgnoreCase("Plane - Edge of Malacol")) {
Plane cPlane = game.getState().getCurrentPlane();
if (cPlane == null) {
return false;
}
if (cPlane != null) {
if (!cPlane.getName().equalsIgnoreCase("Plane - Edge of Malacol")) {
return false;
}
}

View file

@ -103,6 +103,15 @@ class FieldsOfSummerEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Plane cPlane = game.getState().getCurrentPlane();
if (cPlane == null) {
return false;
}
if (cPlane != null) {
if (!cPlane.getName().equalsIgnoreCase("Plane - Fields of Summer")) {
return false;
}
}
Player controller = game.getPlayer(source.getControllerId());
Player owner = game.getPlayer(this.getTargetPointer().getFirst(game, source));
if (owner != null && owner.canRespond() && owner.chooseUse(Outcome.Benefit, "Gain 2 life?", source, game)) {

View file

@ -117,8 +117,12 @@ class HedronFieldsOfAgadeemRestrictionEffect extends RestrictionEffect {
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (game.getState().getCurrentPlane() != null) {
if (!game.getState().getCurrentPlane().getName().equalsIgnoreCase("Plane - Hedron Fields of Agadeem")) {
Plane cPlane = game.getState().getCurrentPlane();
if (cPlane == null) {
return false;
}
if (cPlane != null) {
if (!cPlane.getName().equalsIgnoreCase("Plane - Hedron Fields of Agadeem")) {
return false;
}
}

View file

@ -109,8 +109,12 @@ class TheEonFogSkipUntapStepEffect extends ContinuousRuleModifyingEffectImpl {
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (game.getState().getCurrentPlane() != null) {
if (!game.getState().getCurrentPlane().getName().equalsIgnoreCase("Plane - The Eon Fog")) {
Plane cPlane = game.getState().getCurrentPlane();
if (cPlane == null) {
return false;
}
if (cPlane != null) {
if (!cPlane.getName().equalsIgnoreCase("Plane - The Eon Fog")) {
return false;
}
}

View file

@ -118,6 +118,16 @@ class UndercityReachesTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Plane cPlane = game.getState().getCurrentPlane();
if (cPlane == null) {
return false;
}
if (cPlane != null) {
if (!cPlane.getName().equalsIgnoreCase("Plane - Undercity Reaches")) {
return false;
}
}
if (((DamagedPlayerEvent) event).isCombatDamage()) {
Permanent creature = game.getPermanent(event.getSourceId());
if (creature != null) {