mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
Reimplement Oathkeeper, Takeno's Daisho
This commit is contained in:
parent
4321f0363e
commit
adff5d13d8
1 changed files with 18 additions and 24 deletions
|
|
@ -6,7 +6,7 @@ import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.condition.Condition;
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlAttachedEffect;
|
import mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlAttachedEffect;
|
||||||
|
|
@ -26,12 +26,6 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
public final class OathkeeperTakenosDaisho extends CardImpl {
|
public final class OathkeeperTakenosDaisho extends CardImpl {
|
||||||
|
|
||||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("it's a Samurai card");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(SubType.SAMURAI.getPredicate());
|
|
||||||
}
|
|
||||||
|
|
||||||
public OathkeeperTakenosDaisho(UUID ownerId, CardSetInfo setInfo) {
|
public OathkeeperTakenosDaisho(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||||
this.supertype.add(SuperType.LEGENDARY);
|
this.supertype.add(SuperType.LEGENDARY);
|
||||||
|
|
@ -41,13 +35,14 @@ public final class OathkeeperTakenosDaisho extends CardImpl {
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(3, 1, Duration.WhileOnBattlefield)));
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(3, 1, Duration.WhileOnBattlefield)));
|
||||||
|
|
||||||
// Whenever equipped creature dies, return that card to the battlefield under your control if it's a Samurai card.
|
// Whenever equipped creature dies, return that card to the battlefield under your control if it's a Samurai card.
|
||||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
this.addAbility(new DiesAttachedTriggeredAbility(new ConditionalOneShotEffect(
|
||||||
new DiesAttachedTriggeredAbility(new ReturnToBattlefieldUnderYourControlAttachedEffect(), "equipped creature", false),
|
new ReturnToBattlefieldUnderYourControlAttachedEffect(),
|
||||||
new OathkeeperEquippedMatchesFilterCondition(filter),
|
OathkeeperEquippedSamuraiCondition.instance,
|
||||||
""));
|
"return that card to the battlefield under your control if it's a Samurai card"
|
||||||
|
), "equipped creature"));
|
||||||
|
|
||||||
// When Oathkeeper, Takeno's Daisho is put into a graveyard from the battlefield, exile equipped creature.
|
// When Oathkeeper, Takeno's Daisho is put into a graveyard from the battlefield, exile equipped creature.
|
||||||
this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new ExileEquippedEffect()));
|
this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new OathkeeperExileEquippedEffect()));
|
||||||
|
|
||||||
// Equip {2}
|
// Equip {2}
|
||||||
this.addAbility(new EquipAbility(Outcome.BoostCreature, new ManaCostsImpl<>("{2}"), false));
|
this.addAbility(new EquipAbility(Outcome.BoostCreature, new ManaCostsImpl<>("{2}"), false));
|
||||||
|
|
@ -63,20 +58,20 @@ public final class OathkeeperTakenosDaisho extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ExileEquippedEffect extends OneShotEffect {
|
class OathkeeperExileEquippedEffect extends OneShotEffect {
|
||||||
|
|
||||||
public ExileEquippedEffect() {
|
public OathkeeperExileEquippedEffect() {
|
||||||
super(Outcome.Exile);
|
super(Outcome.Exile);
|
||||||
staticText = "exile equipped creature";
|
staticText = "exile equipped creature";
|
||||||
}
|
}
|
||||||
|
|
||||||
public ExileEquippedEffect(final ExileEquippedEffect effect) {
|
public OathkeeperExileEquippedEffect(final OathkeeperExileEquippedEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ExileEquippedEffect copy() {
|
public OathkeeperExileEquippedEffect copy() {
|
||||||
return new ExileEquippedEffect(this);
|
return new OathkeeperExileEquippedEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -90,15 +85,15 @@ class ExileEquippedEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class OathkeeperEquippedMatchesFilterCondition implements Condition {
|
enum OathkeeperEquippedSamuraiCondition implements Condition {
|
||||||
|
instance;
|
||||||
|
|
||||||
private FilterCreaturePermanent filter;
|
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("it's a Samurai card");
|
||||||
|
|
||||||
public OathkeeperEquippedMatchesFilterCondition(FilterCreaturePermanent filter) {
|
static {
|
||||||
this.filter = filter;
|
filter.add(SubType.SAMURAI.getPredicate());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -122,9 +117,8 @@ class OathkeeperEquippedMatchesFilterCondition implements Condition {
|
||||||
}
|
}
|
||||||
if (attachedTo != null) {
|
if (attachedTo != null) {
|
||||||
return filter.match(attachedTo, attachedTo.getControllerId(), source, game);
|
return filter.match(attachedTo, attachedTo.getControllerId(), source, game);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue