* Bronzehide Lion - Fixed that activated ability of enchanted form applied Indestructibility while on battlefield if activated instead of end of the turn.

* Tectonic Giant - Fixed that it also triggerd on activated abilities instead only for spells. 
(fixes #6397)
This commit is contained in:
LevelX2 2020-06-14 08:46:25 +02:00
parent dbd1981fcb
commit aaf1f7da7b
3 changed files with 20 additions and 23 deletions

View file

@ -4,7 +4,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.DiesTriggeredAbility; import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
@ -109,7 +108,7 @@ class BronzehideLionContinuousEffect extends ContinuousEffectImpl {
private final int zoneChangeCounter; private final int zoneChangeCounter;
private final Ability activatedAbility = new SimpleActivatedAbility(new GainAbilityAttachedEffect( private final Ability activatedAbility = new SimpleActivatedAbility(new GainAbilityAttachedEffect(
IndestructibleAbility.getInstance(), AttachmentType.AURA, Duration.WhileOnBattlefield IndestructibleAbility.getInstance(), AttachmentType.AURA, Duration.EndOfTurn
), new ManaCostsImpl("{G}{W}")); ), new ManaCostsImpl("{G}{W}"));
BronzehideLionContinuousEffect(int zoneChangeCounter) { BronzehideLionContinuousEffect(int zoneChangeCounter) {

View file

@ -1,6 +1,8 @@
package mage.cards.t; package mage.cards.t;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.Mode; import mage.abilities.Mode;
import mage.abilities.TriggeredAbilityImpl; import mage.abilities.TriggeredAbilityImpl;
@ -10,19 +12,16 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamagePlayersEffect; import mage.abilities.effects.common.DamagePlayersEffect;
import mage.cards.*; import mage.cards.*;
import mage.constants.*; import mage.constants.*;
import static mage.constants.Outcome.Benefit;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.stack.StackObject; import mage.game.stack.Spell;
import mage.players.Player; import mage.players.Player;
import mage.target.TargetCard; import mage.target.TargetCard;
import mage.target.common.TargetCardInExile; import mage.target.common.TargetCardInExile;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
import static mage.constants.Outcome.Benefit;
/** /**
* @author TheElk801 * @author TheElk801
*/ */
@ -75,12 +74,14 @@ class TectonicGiantTriggeredAbility extends TriggeredAbilityImpl {
case DECLARED_ATTACKERS: case DECLARED_ATTACKERS:
return game.getCombat().getAttackers().contains(this.getSourceId()); return game.getCombat().getAttackers().contains(this.getSourceId());
case TARGETED: case TARGETED:
StackObject sourceObject = game.getStack().getStackObject(event.getSourceId()); if (event.getTargetId().equals(getSourceId())) {
Player player = game.getPlayer(getControllerId()); MageObject mageObject = game.getObject(event.getSourceId());
return sourceObject != null Player player = game.getPlayer(getControllerId());
&& player != null return mageObject != null
&& player.hasOpponent(sourceObject.getControllerId(), game) && mageObject instanceof Spell
&& event.getTargetId().equals(getSourceId()); && player != null
&& player.hasOpponent(((Spell) mageObject).getControllerId(), game);
}
} }
return false; return false;
} }
@ -100,8 +101,8 @@ class TectonicGiantEffect extends OneShotEffect {
TectonicGiantEffect() { TectonicGiantEffect() {
super(Benefit); super(Benefit);
staticText = "exile the top two cards of your library. Choose one of them. " + staticText = "exile the top two cards of your library. Choose one of them. "
"Until the end of your next turn, you may play that card"; + "Until the end of your next turn, you may play that card";
} }
private TectonicGiantEffect(final TectonicGiantEffect effect) { private TectonicGiantEffect(final TectonicGiantEffect effect) {

View file

@ -1,5 +1,8 @@
package mage; package mage;
import java.io.Serializable;
import java.util.List;
import java.util.Set;
import mage.abilities.Abilities; import mage.abilities.Abilities;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCost;
@ -15,12 +18,6 @@ import mage.game.Game;
import mage.game.events.ZoneChangeEvent; import mage.game.events.ZoneChangeEvent;
import mage.util.SubTypeList; import mage.util.SubTypeList;
import java.io.Serializable;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
public interface MageObject extends MageItem, Serializable { public interface MageObject extends MageItem, Serializable {
String getName(); String getName();
@ -42,8 +39,8 @@ public interface MageObject extends MageItem, Serializable {
Set<SuperType> getSuperType(); Set<SuperType> getSuperType();
/** /**
* For cards: return basic abilities (without dynamic added) * For cards: return basic abilities (without dynamic added) For permanents:
* For permanents: return all abilities (dynamic ability inserts into permanent) * return all abilities (dynamic ability inserts into permanent)
*/ */
Abilities<Ability> getAbilities(); Abilities<Ability> getAbilities();