mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
[TMT] Implement Party Dude (#14286)
This commit is contained in:
parent
cd88a4058b
commit
37b8e09200
2 changed files with 116 additions and 0 deletions
115
Mage.Sets/src/mage/cards/p/PartyDude.java
Normal file
115
Mage.Sets/src/mage/cards/p/PartyDude.java
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
package mage.cards.p;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterArtifactPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.token.FoodToken;
|
||||
import mage.target.common.TargetAttackingCreature;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.PutIntoGraveFromBattlefieldAllTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
|
||||
import mage.abilities.effects.common.CreateTokenAllEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.GainClassAbilitySourceEffect;
|
||||
import mage.abilities.keyword.ClassLevelAbility;
|
||||
import mage.abilities.keyword.ClassReminderAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author muz
|
||||
*/
|
||||
public final class PartyDude extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterArtifactPermanent("an artifact an opponent controls");
|
||||
|
||||
static {
|
||||
filter.add(TargetController.OPPONENT.getControllerPredicate());
|
||||
}
|
||||
|
||||
public PartyDude(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{G}");
|
||||
|
||||
this.subtype.add(SubType.CLASS);
|
||||
|
||||
// (Gain the next level as a sorcery to add its ability.)
|
||||
this.addAbility(new ClassReminderAbility());
|
||||
|
||||
// When this Class enters, each player creates a Food token.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenAllEffect(new FoodToken(), TargetController.EACH_PLAYER)));
|
||||
|
||||
// {1}{G}: Level 2
|
||||
this.addAbility(new ClassLevelAbility(2, "{1}{G}"));
|
||||
|
||||
// Whenever an artifact an opponent controls is put into a graveyard from the battlefield, draw a card.
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
new GainClassAbilitySourceEffect(
|
||||
new PutIntoGraveFromBattlefieldAllTriggeredAbility(
|
||||
new DrawCardSourceControllerEffect(1), false, filter, false
|
||||
), 2
|
||||
)
|
||||
));
|
||||
|
||||
// {4}{G}: Level 3
|
||||
this.addAbility(new ClassLevelAbility(3, "{4}{G}"));
|
||||
|
||||
// Whenever one or more of your opponents are attacked, up to one target attacking creature gets +X/+X until end of turn, where X is the number of cards in your hand.
|
||||
Ability ability = new PartyDudeTriggeredAbility();
|
||||
ability.addTarget(new TargetAttackingCreature(0, 1));
|
||||
this.addAbility(new SimpleStaticAbility(new GainClassAbilitySourceEffect(ability, 3)));
|
||||
}
|
||||
|
||||
private PartyDude(final PartyDude card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PartyDude copy() {
|
||||
return new PartyDude(this);
|
||||
}
|
||||
}
|
||||
|
||||
class PartyDudeTriggeredAbility extends TriggeredAbilityImpl {
|
||||
PartyDudeTriggeredAbility() {
|
||||
super(
|
||||
Zone.BATTLEFIELD,
|
||||
new BoostTargetEffect(CardsInControllerHandCount.ANY, CardsInControllerHandCount.ANY)
|
||||
.setText("up to one target attacking creature gets +X/+X until end of turn, where X is the number of cards in your hand"),
|
||||
false
|
||||
);
|
||||
this.setTriggerPhrase("Whenever one or more of your opponents are attacked, ");
|
||||
}
|
||||
|
||||
private PartyDudeTriggeredAbility(final PartyDudeTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PartyDudeTriggeredAbility copy() {
|
||||
return new PartyDudeTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.DEFENDER_ATTACKED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (!game.getOpponents(this.getControllerId()).contains(event.getTargetId())) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -63,6 +63,7 @@ public final class TeenageMutantNinjaTurtles extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Mutagen Man, Living Ooze", 124, Rarity.RARE, mage.cards.m.MutagenManLivingOoze.class));
|
||||
cards.add(new SetCardInfo("North Wind Avatar", 162, Rarity.MYTHIC, mage.cards.n.NorthWindAvatar.class));
|
||||
cards.add(new SetCardInfo("Northampton Farm", 188, Rarity.RARE, mage.cards.n.NorthamptonFarm.class));
|
||||
cards.add(new SetCardInfo("Party Dude", 128, Rarity.RARE, mage.cards.p.PartyDude.class));
|
||||
cards.add(new SetCardInfo("Plains", 253, Rarity.LAND, mage.cards.basiclands.Plains.class, FULL_ART_BFZ_VARIOUS));
|
||||
cards.add(new SetCardInfo("Plains", 310, Rarity.LAND, mage.cards.basiclands.Plains.class, FULL_ART_BFZ_VARIOUS));
|
||||
cards.add(new SetCardInfo("Prehistoric Pet", 22, Rarity.RARE, mage.cards.p.PrehistoricPet.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue