mirror of
https://github.com/correl/mage.git
synced 2024-11-22 03:00:11 +00:00
Reimplement Cabal Executioner
This commit is contained in:
parent
e626d8be5d
commit
1e1eb30e5a
1 changed files with 5 additions and 50 deletions
|
@ -1,27 +1,20 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.SacrificeEffect;
|
||||
import mage.abilities.keyword.MorphAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.DamagedPlayerEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
* @author xenohedron
|
||||
*/
|
||||
public final class CabalExecutioner extends CardImpl {
|
||||
|
||||
|
@ -33,7 +26,7 @@ public final class CabalExecutioner extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// Whenever Cabal Executioner deals combat damage to a player, that player sacrifices a creature.
|
||||
this.addAbility(new CabalExecutionerAbility());
|
||||
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_A_CREATURE, 1, "that player"), false, true));
|
||||
|
||||
// Morph {3}{B}{B}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{3}{B}{B}")));
|
||||
|
@ -48,41 +41,3 @@ public final class CabalExecutioner extends CardImpl {
|
|||
return new CabalExecutioner(this);
|
||||
}
|
||||
}
|
||||
|
||||
class CabalExecutionerAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public CabalExecutionerAbility() {
|
||||
super(Zone.BATTLEFIELD, new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, ""));
|
||||
}
|
||||
|
||||
public CabalExecutionerAbility(final CabalExecutionerAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CabalExecutionerAbility copy() {
|
||||
return new CabalExecutionerAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.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 creature.";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue