[WOC] Implement Gylwain, Casting Director

This commit is contained in:
theelk801 2023-08-18 15:26:38 -04:00
parent ea513386fb
commit 8753c94488
4 changed files with 59 additions and 5 deletions

View file

@ -0,0 +1,53 @@
package mage.cards.g;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.EntersBattlefieldThisOrAnotherTriggeredAbility;
import mage.abilities.effects.common.CreateRoleAttachedTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.StaticFilters;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class GylwainCastingDirector extends CardImpl {
public GylwainCastingDirector(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}{W}");
this.supertype.add(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.BARD);
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// Whenever Gylwain, Casting Director or another nontoken creature enters the battlefield under your control, choose one --
// * Create a Royal Role token attached to that creature.
Ability ability = new EntersBattlefieldThisOrAnotherTriggeredAbility(
new CreateRoleAttachedTargetEffect(RoleType.ROYAL),
StaticFilters.FILTER_CREATURE_NON_TOKEN,
false, SetTargetPointer.PERMANENT, true
);
// * Create a Sorcerer Role token attached to that creature.
ability.addMode(new Mode(new CreateRoleAttachedTargetEffect(RoleType.SORCERER)));
// * Create a Monster Role token attached to that creature.
ability.addMode(new Mode(new CreateRoleAttachedTargetEffect(RoleType.MONSTER)));
this.addAbility(ability);
}
private GylwainCastingDirector(final GylwainCastingDirector card) {
super(card);
}
@Override
public GylwainCastingDirector copy() {
return new GylwainCastingDirector(this);
}
}

View file

@ -20,6 +20,7 @@ public final class WildsOfEldraineCommander extends ExpansionSet {
this.hasBasicLands = false;
cards.add(new SetCardInfo("Ellivere of the Wild Court", 2, Rarity.MYTHIC, mage.cards.e.EllivereOfTheWildCourt.class));
cards.add(new SetCardInfo("Gylwain, Casting Director", 4, Rarity.MYTHIC, mage.cards.g.GylwainCastingDirector.class));
cards.add(new SetCardInfo("Tegwyll, Duke of Splendor", 1, Rarity.MYTHIC, mage.cards.t.TegwyllDukeOfSplendor.class));
}
}

View file

@ -81,14 +81,14 @@ public class EntersBattlefieldAllTriggeredAbility extends TriggeredAbilityImpl {
if (!filter.match(permanent, getControllerId(), this, game)) {
return false;
}
this.getEffects().setValue("permanentEnteringBattlefield", permanent);
this.getEffects().setValue("permanentEnteringControllerId", permanent.getControllerId());
this.getAllEffects().setValue("permanentEnteringBattlefield", permanent);
this.getAllEffects().setValue("permanentEnteringControllerId", permanent.getControllerId());
switch (setTargetPointer) {
case PLAYER:
this.getEffects().setTargetPointer(new FixedTarget(permanent.getControllerId()));
this.getAllEffects().setTargetPointer(new FixedTarget(permanent.getControllerId()));
break;
case PERMANENT:
this.getEffects().setTargetPointer(new FixedTarget(permanent, game));
this.getAllEffects().setTargetPointer(new FixedTarget(permanent, game));
break;
default:
}

View file

@ -46,6 +46,6 @@ public class CreateRoleAttachedTargetEffect extends OneShotEffect {
return staticText;
}
return "create a " + roleType.getName() + " Role token attached to " +
getTargetPointer().describeTargets(mode.getTargets(), "it");
getTargetPointer().describeTargets(mode.getTargets(), "that creature");
}
}