This commit is contained in:
Jeff 2019-04-29 16:42:36 -05:00
parent 9cab9bc429
commit 6f150b4fe0

View file

@ -7,20 +7,18 @@ import mage.abilities.common.GodEternalDiesTriggeredAbility;
import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.DeathtouchAbility; import mage.abilities.keyword.DeathtouchAbility;
import mage.abilities.keyword.VigilanceAbility; import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.*;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
import java.util.UUID; import java.util.UUID;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.filter.common.FilterControlledCreaturePermanent;
/** /**
* @author TheElk801 * @author TheElk801
@ -58,16 +56,12 @@ public final class GodEternalRhonas extends CardImpl {
class GodEternalRhonasEffect extends OneShotEffect { class GodEternalRhonasEffect extends OneShotEffect {
private static final FilterPermanent filter = new FilterControlledCreaturePermanent(); private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();
static {
filter.add(AnotherPredicate.instance);
}
GodEternalRhonasEffect() { GodEternalRhonasEffect() {
super(Outcome.Benefit); super(Outcome.Benefit);
staticText = "double the power of each other creature you control until end of turn. " + staticText = "double the power of each other creature you control until end of turn. "
"Those creatures gain vigilance until end of turn."; + "Those creatures gain vigilance until end of turn.";
} }
private GodEternalRhonasEffect(final GodEternalRhonasEffect effect) { private GodEternalRhonasEffect(final GodEternalRhonasEffect effect) {
@ -81,8 +75,11 @@ class GodEternalRhonasEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { Permanent godEternalRhonas = game.getPermanent(source.getSourceId());
if (permanent == null) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
if (permanent == null
|| godEternalRhonas != null
&& permanent == godEternalRhonas) {
continue; continue;
} }
ContinuousEffect effect = new BoostTargetEffect( ContinuousEffect effect = new BoostTargetEffect(
@ -91,11 +88,14 @@ class GodEternalRhonasEffect extends OneShotEffect {
); );
effect.setTargetPointer(new FixedTarget(permanent, game)); effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source); game.addEffect(effect, source);
}
game.addEffect(new GainAbilityControlledEffect( ContinuousEffect effect2 = new GainAbilityTargetEffect(
VigilanceAbility.getInstance(), VigilanceAbility.getInstance(),
Duration.EndOfTurn, filter Duration.EndOfTurn
), source); );
effect2.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect2, source);
}
return true; return true;
} }
} }