Skip to content

Commit

Permalink
Tarox Bladewing, Chameleon Colossus: remove custom effect
Browse files Browse the repository at this point in the history
now using the same template as Yew Spirit, Feral Animist
  • Loading branch information
nigelzor committed Nov 9, 2015
1 parent a0ed2c2 commit 7830dc1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 73 deletions.
41 changes: 4 additions & 37 deletions Mage.Sets/src/mage/sets/futuresight/TaroxBladewing.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,15 @@

import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.abilityword.GrandeurAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.SubLayer;
import mage.game.Game;
import mage.game.permanent.Permanent;

/**
*
Expand All @@ -66,7 +61,8 @@ public TaroxBladewing(UUID ownerId) {
this.addAbility(HasteAbility.getInstance());

// Grandeur - Discard another card named Tarox Bladewing: Tarox Bladewing gets +X/+X until end of turn, where X is its power.
this.addAbility(new GrandeurAbility(new TaroxBladewingEffect(), "Tarox Bladewing"));
SourcePermanentPowerCount x = new SourcePermanentPowerCount();
this.addAbility(new GrandeurAbility(new BoostSourceEffect(x, x, Duration.EndOfTurn, true), "Tarox Bladewing"));
}

public TaroxBladewing(final TaroxBladewing card) {
Expand All @@ -78,32 +74,3 @@ public TaroxBladewing copy() {
return new TaroxBladewing(this);
}
}

class TaroxBladewingEffect extends ContinuousEffectImpl {

TaroxBladewingEffect() {
super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature);
staticText = "{this} gets +X/+X until end of turn, where X is its power";
}

TaroxBladewingEffect(final TaroxBladewingEffect effect) {
super(effect);
}

@Override
public TaroxBladewingEffect copy() {
return new TaroxBladewingEffect(this);
}

@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
int power = permanent.getPower().getValue();
permanent.addPower(power);
permanent.addToughness(power);
return true;
}
return false;
}
}
41 changes: 5 additions & 36 deletions Mage.Sets/src/mage/sets/morningtide/ChameleonColossus.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,22 @@
package mage.sets.morningtide;

import java.util.UUID;

import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.keyword.ChangelingAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;

/**
*
Expand Down Expand Up @@ -76,7 +72,8 @@ public ChameleonColossus(UUID ownerId) {
this.addAbility(new ProtectionAbility(filter));

// {2}{G}{G}: Chameleon Colossus gets +X/+X until end of turn, where X is its power.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ChameleonColossusEffect(), new ManaCostsImpl("{2}{G}{G}")));
SourcePermanentPowerCount x = new SourcePermanentPowerCount();
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(x, x, Duration.EndOfTurn, true), new ManaCostsImpl("{2}{G}{G}")));
}

public ChameleonColossus(final ChameleonColossus card) {
Expand All @@ -88,31 +85,3 @@ public ChameleonColossus copy() {
return new ChameleonColossus(this);
}
}

class ChameleonColossusEffect extends ContinuousEffectImpl {
public ChameleonColossusEffect() {
super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature);
staticText = "{this} gets +X/+X until end of turn, where X is its power";
}

public ChameleonColossusEffect(final ChameleonColossusEffect effect) {
super(effect);
}

@Override
public ChameleonColossusEffect copy() {
return new ChameleonColossusEffect(this);
}

@Override
public boolean apply(Game game, Ability source) {
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (sourcePermanent != null) {
int power = sourcePermanent.getPower().getValue();
sourcePermanent.addPower(power);
sourcePermanent.addToughness(power);
return true;
}
return false;
}
}

0 comments on commit 7830dc1

Please sign in to comment.