mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 05:09:16 -08:00
[ZNR] Implemented Attended Healer
This commit is contained in:
parent
0c9b7f76eb
commit
9cf96bd391
3 changed files with 140 additions and 0 deletions
111
Mage.Sets/src/mage/cards/a/AttendedHealer.java
Normal file
111
Mage.Sets/src/mage/cards/a/AttendedHealer.java
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.keyword.LifelinkAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.permanent.AnotherPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.token.CatToken3;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class AttendedHealer extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent(SubType.CLERIC, "another target Cleric");
|
||||
|
||||
static {
|
||||
filter.add(AnotherPredicate.instance);
|
||||
}
|
||||
|
||||
public AttendedHealer(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}");
|
||||
|
||||
this.subtype.add(SubType.KOR);
|
||||
this.subtype.add(SubType.CLERIC);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Whenever you gain life for the first time each turn, create a 1/1 white Cat creature token.
|
||||
this.addAbility(new AttendedHealerTriggeredAbility());
|
||||
|
||||
// {2}{W}: Another target Cleric gains lifelink until end of turn.
|
||||
Ability ability = new SimpleActivatedAbility(new GainAbilityTargetEffect(
|
||||
LifelinkAbility.getInstance(), Duration.EndOfTurn
|
||||
), new ManaCostsImpl<>("{2}{W}"));
|
||||
ability.addTarget(new TargetPermanent(filter));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private AttendedHealer(final AttendedHealer card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttendedHealer copy() {
|
||||
return new AttendedHealer(this);
|
||||
}
|
||||
}
|
||||
|
||||
class AttendedHealerTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
private boolean triggeredOnce = false;
|
||||
|
||||
AttendedHealerTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new CreateTokenEffect(new CatToken3()), false);
|
||||
}
|
||||
|
||||
private AttendedHealerTriggeredAbility(final AttendedHealerTriggeredAbility ability) {
|
||||
super(ability);
|
||||
this.triggeredOnce = ability.triggeredOnce;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.GAINED_LIFE
|
||||
|| event.getType() == GameEvent.EventType.END_PHASE_POST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.END_PHASE_POST) {
|
||||
triggeredOnce = false;
|
||||
return false;
|
||||
}
|
||||
if (event.getType() != GameEvent.EventType.GAINED_LIFE
|
||||
|| !event.getPlayerId().equals(getControllerId())) {
|
||||
return false;
|
||||
}
|
||||
if (triggeredOnce) {
|
||||
return false;
|
||||
}
|
||||
triggeredOnce = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "When you gain life for the first time each turn, create a 1/1 white Cat creature token.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttendedHealerTriggeredAbility copy() {
|
||||
return new AttendedHealerTriggeredAbility(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -99,6 +99,7 @@ public final class ZendikarRising extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Archpriest of Iona", 5, Rarity.RARE, mage.cards.a.ArchpriestOfIona.class));
|
||||
cards.add(new SetCardInfo("Ardent Electromancer", 135, Rarity.COMMON, mage.cards.a.ArdentElectromancer.class));
|
||||
cards.add(new SetCardInfo("Ashaya, Soul of the Wild", 179, Rarity.MYTHIC, mage.cards.a.AshayaSoulOfTheWild.class));
|
||||
cards.add(new SetCardInfo("Attended Healer", 6, Rarity.UNCOMMON, mage.cards.a.AttendedHealer.class));
|
||||
cards.add(new SetCardInfo("Bala Ged Recovery", 180, Rarity.UNCOMMON, mage.cards.b.BalaGedRecovery.class));
|
||||
cards.add(new SetCardInfo("Bala Ged Sanctuary", 180, Rarity.UNCOMMON, mage.cards.b.BalaGedSanctuary.class));
|
||||
cards.add(new SetCardInfo("Blackbloom Bog", 91, Rarity.UNCOMMON, mage.cards.b.BlackbloomBog.class));
|
||||
|
|
|
|||
28
Mage/src/main/java/mage/game/permanent/token/CatToken3.java
Normal file
28
Mage/src/main/java/mage/game/permanent/token/CatToken3.java
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class CatToken3 extends TokenImpl {
|
||||
|
||||
public CatToken3() {
|
||||
super("Cat", "1/1 white Cat creature token");
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setWhite(true);
|
||||
subtype.add(SubType.CAT);
|
||||
power = new MageInt(1);
|
||||
toughness = new MageInt(1);
|
||||
}
|
||||
|
||||
private CatToken3(final CatToken3 token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public CatToken3 copy() {
|
||||
return new CatToken3(this);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue