mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Merge pull request #4796 from spjspj/master
Fix for Planes (Incorrectly appending continuous effects)
This commit is contained in:
commit
447c01e1a6
7 changed files with 62 additions and 10 deletions
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue