mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
[MID] Implemented Falkenrath Perforator
This commit is contained in:
parent
8b9c77e129
commit
937271f066
3 changed files with 52 additions and 16 deletions
40
Mage.Sets/src/mage/cards/f/FalkenrathPerforator.java
Normal file
40
Mage.Sets/src/mage/cards/f/FalkenrathPerforator.java
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
package mage.cards.f;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SetTargetPointer;
|
||||
import mage.constants.SubType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class FalkenrathPerforator extends CardImpl {
|
||||
|
||||
public FalkenrathPerforator(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
|
||||
|
||||
this.subtype.add(SubType.VAMPIRE);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Whenever Falkenrath Perforator attacks, it deals 1 damage to defending player.
|
||||
this.addAbility(new AttacksTriggeredAbility(new DamageTargetEffect(
|
||||
1, true, "defending player", "it"
|
||||
), false, null, SetTargetPointer.PLAYER));
|
||||
}
|
||||
|
||||
private FalkenrathPerforator(final FalkenrathPerforator card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FalkenrathPerforator copy() {
|
||||
return new FalkenrathPerforator(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -62,6 +62,7 @@ public final class InnistradMidnightHunt extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Dissipate", 49, Rarity.UNCOMMON, mage.cards.d.Dissipate.class));
|
||||
cards.add(new SetCardInfo("Embodiment of Flame", 141, Rarity.UNCOMMON, mage.cards.e.EmbodimentOfFlame.class));
|
||||
cards.add(new SetCardInfo("Faithful Mending", 221, Rarity.UNCOMMON, mage.cards.f.FaithfulMending.class));
|
||||
cards.add(new SetCardInfo("Falkenrath Perforator", 136, Rarity.COMMON, mage.cards.f.FalkenrathPerforator.class));
|
||||
cards.add(new SetCardInfo("Famished Foragers", 138, Rarity.COMMON, mage.cards.f.FamishedForagers.class));
|
||||
cards.add(new SetCardInfo("Festival Crasher", 140, Rarity.COMMON, mage.cards.f.FestivalCrasher.class));
|
||||
cards.add(new SetCardInfo("Flame Channeler", 141, Rarity.UNCOMMON, mage.cards.f.FlameChanneler.class));
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ import java.util.UUID;
|
|||
*/
|
||||
public class AttacksTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
protected SetTargetPointer setTargetPointer;
|
||||
protected String text;
|
||||
protected final String text;
|
||||
protected final SetTargetPointer setTargetPointer;
|
||||
|
||||
public AttacksTriggeredAbility(Effect effect) {
|
||||
this(effect, false);
|
||||
|
|
@ -49,21 +49,16 @@ public class AttacksTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (game.getCombat().getAttackers().contains(this.getSourceId())) {
|
||||
switch (setTargetPointer) {
|
||||
case PLAYER:
|
||||
UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(getSourceId(), game);
|
||||
if (defendingPlayerId != null) {
|
||||
for (Effect effect : getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(defendingPlayerId));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
return true;
|
||||
if (!game.getCombat().getAttackers().contains(this.getSourceId())) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
if (setTargetPointer == SetTargetPointer.PLAYER) {
|
||||
UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(getSourceId(), game);
|
||||
if (defendingPlayerId != null) {
|
||||
getEffects().setTargetPointer(new FixedTarget(defendingPlayerId));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue