1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-03 01:08:59 -09:00

Academy Elite, Aggravate, Agonizing Demise, Akki Underminer

removed custom effects
This commit is contained in:
Neil Gentleman 2016-10-16 15:48:13 -07:00
parent 51f0b551c8
commit 00951279ea
4 changed files with 11 additions and 166 deletions

View file

@ -30,24 +30,19 @@ package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount;
import mage.abilities.effects.EntersBattlefieldEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawDiscardControllerEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterInstantOrSorceryCard;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
@ -65,7 +60,9 @@ public class AcademyElite extends CardImpl {
// Academy Elite enters the battlefield with X +1/+1 counters on it, where X is the number of instant and
// sorcery cards in all graveyards.
this.addAbility(new EntersBattlefieldAbility(new AcademyEliteEffect1(), "with X +1/+1 counters on it, where X is the number of instant and sorcery cards in all graveyards"));
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(),
new CardsInAllGraveyardsCount(new FilterInstantOrSorceryCard()), false),
"with X +1/+1 counters on it, where X is the number of instant and sorcery cards in all graveyards"));
// {2}{U}, Remove a +1/+1 counter from Academy Elite: Draw a card, then discard a card.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawDiscardControllerEffect(1, 1, false), new ManaCostsImpl("{2}{U}"));
@ -83,38 +80,3 @@ public class AcademyElite extends CardImpl {
}
}
class AcademyEliteEffect1 extends OneShotEffect {
public AcademyEliteEffect1() {
super(Outcome.BoostCreature);
staticText = "{this} enters the battlefield with X +1/+1 counters on it, where X is the number of instant and sorcery cards in all graveyards";
}
public AcademyEliteEffect1(final AcademyEliteEffect1 effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanentEntering(source.getSourceId());
if (permanent != null) {
SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY);
if (spellAbility != null
&& spellAbility.getSourceId().equals(source.getSourceId())
&& permanent.getZoneChangeCounter(game) == spellAbility.getSourceObjectZoneChangeCounter()) {
CardsInAllGraveyardsCount instantsAndSorceries = new CardsInAllGraveyardsCount(new FilterInstantOrSorceryCard("instant or sorcery cards"));
int instantsAndSorceriesCount = instantsAndSorceries.calculate(game, source, this);
if (instantsAndSorceriesCount > 0) {
permanent.addCounters(CounterType.P1P1.createInstance(instantsAndSorceriesCount), game);
}
}
}
return true;
}
@Override
public AcademyEliteEffect1 copy() {
return new AcademyEliteEffect1(this);
}
}

View file

@ -27,21 +27,17 @@
*/
package mage.cards.a;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.RequirementEffect;
import mage.abilities.effects.common.DamageAllControlledTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPlayer;
import mage.watchers.common.DamagedByWatcher;
@ -56,7 +52,7 @@ public class Aggravate extends CardImpl {
// Aggravate deals 1 damage to each creature target player controls.
this.getSpellAbility().addEffect(new AggravateEffect());
this.getSpellAbility().addEffect(new DamageAllControlledTargetEffect(1, new FilterCreaturePermanent()));
this.getSpellAbility().addTarget(new TargetPlayer());
// Each creature dealt damage this way attacks this turn if able.
this.getSpellAbility().addEffect(new AggravateRequirementEffect());
@ -73,38 +69,6 @@ public class Aggravate extends CardImpl {
}
}
class AggravateEffect extends OneShotEffect {
public AggravateEffect() {
super(Outcome.Damage);
this.staticText = "{this} deals 1 damage to each creature target player controls";
}
public AggravateEffect(final AggravateEffect effect) {
super(effect);
}
@Override
public AggravateEffect copy() {
return new AggravateEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getFirstTarget());
if (player != null) {
FilterCreaturePermanent filter = new FilterCreaturePermanent();
filter.add(new ControllerIdPredicate(player.getId()));
List<Permanent> creatures = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game);
for (Permanent creature : creatures) {
creature.damage(1, source.getSourceId(), game, false, true);
}
return true;
}
return false;
}
}
class AggravateRequirementEffect extends RequirementEffect {
public AggravateRequirementEffect() {

View file

@ -29,22 +29,18 @@ package mage.cards.a;
import java.util.UUID;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.condition.common.KickedCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.dynamicvalue.common.TargetPermanentPowerCount;
import mage.abilities.effects.common.DamageTargetControllerEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.KickerAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
/**
@ -70,7 +66,7 @@ public class AgonizingDemise extends CardImpl {
//If Agonizing Demise was kicked, it deals damage equal to that creature's power to the creature's controller.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new AgonizingDemiseEffect(),
new DamageTargetControllerEffect(new TargetPermanentPowerCount()),
KickedCondition.getInstance(),
"If {this} was kicked, it deals damage equal to that creature's power to the creature's controller."));
@ -85,33 +81,3 @@ public class AgonizingDemise extends CardImpl {
return new AgonizingDemise(this);
}
}
class AgonizingDemiseEffect extends OneShotEffect {
public AgonizingDemiseEffect() {
super(Outcome.Damage);
}
public AgonizingDemiseEffect(final AgonizingDemiseEffect effect) {
super(effect);
}
@Override
public AgonizingDemiseEffect copy() {
return new AgonizingDemiseEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanentOrLKIBattlefield(this.getTargetPointer().getFirst(game, source));
if(permanent != null) {
Player controller = game.getPlayer(permanent.getControllerId());
if(controller != null) {
int amount = permanent.getPower().getValue();
controller.damage(amount, source.getSourceId(), game, false, true);
return true;
}
}
return false;
}
}

View file

@ -30,19 +30,12 @@ package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.effects.common.SacrificeEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
/**
*
@ -58,7 +51,7 @@ public class AkkiUnderminer extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(1);
this.addAbility(new AkkiUnderminerAbility());
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new SacrificeEffect(new FilterPermanent(), 1, "that player"), false, true));
}
public AkkiUnderminer (final AkkiUnderminer card) {
@ -71,43 +64,3 @@ public class AkkiUnderminer extends CardImpl {
}
}
class AkkiUnderminerAbility extends TriggeredAbilityImpl {
public AkkiUnderminerAbility() {
super(Zone.BATTLEFIELD, new SacrificeEffect(new FilterPermanent(), 1, ""));
}
public AkkiUnderminerAbility(final AkkiUnderminerAbility ability) {
super(ability);
}
@Override
public AkkiUnderminerAbility copy() {
return new AkkiUnderminerAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.DAMAGED_PLAYER;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
return true;
}
return false;
}
@Override
public String getRule() {
return "Whenever {this} deals combat damage to a player, that player sacrifices a permanent.";
}
}