mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 21:02:08 -08:00
[NEO] Implemented Ninja's Kunai
This commit is contained in:
parent
40e80f59a0
commit
0efa845bad
2 changed files with 99 additions and 0 deletions
98
Mage.Sets/src/mage/cards/n/NinjasKunai.java
Normal file
98
Mage.Sets/src/mage/cards/n/NinjasKunai.java
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
package mage.cards.n;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.common.SacrificeAttachmentCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityWithAttachmentEffect;
|
||||
import mage.abilities.keyword.EquipAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetAnyTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class NinjasKunai extends CardImpl {
|
||||
|
||||
public NinjasKunai(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}");
|
||||
|
||||
this.subtype.add(SubType.EQUIPMENT);
|
||||
|
||||
// Equipped creature has "{1}, {T}, Sacrifice Ninja's Kunai: Ninja's Kunai deals 3 damage to any target."
|
||||
this.addAbility(new SimpleStaticAbility(new GainAbilityWithAttachmentEffect(
|
||||
"equipped creature has \"{1}, {T}, Sacrifice {this}: {this} deals 2 damage to any target.\"",
|
||||
new NinjasKunaiEffect(), new TargetAnyTarget(), new SacrificeAttachmentCost(), new GenericManaCost(1), new TapSourceCost()
|
||||
)));
|
||||
|
||||
// Equip {1}
|
||||
this.addAbility(new EquipAbility(1));
|
||||
}
|
||||
|
||||
private NinjasKunai(final NinjasKunai card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NinjasKunai copy() {
|
||||
return new NinjasKunai(this);
|
||||
}
|
||||
}
|
||||
|
||||
class NinjasKunaiEffect extends OneShotEffect {
|
||||
|
||||
NinjasKunaiEffect() {
|
||||
super(Outcome.Benefit);
|
||||
}
|
||||
|
||||
private NinjasKunaiEffect(final NinjasKunaiEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NinjasKunaiEffect copy() {
|
||||
return new NinjasKunaiEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Object object = getValue("attachedPermanent");
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (!(object instanceof Permanent) || player == null) {
|
||||
return false;
|
||||
}
|
||||
Permanent permanent = (Permanent) object;
|
||||
Permanent targetedPermanent = game.getPermanent(source.getFirstTarget());
|
||||
if (targetedPermanent == null) {
|
||||
Player targetedPlayer = game.getPlayer(source.getFirstTarget());
|
||||
if (targetedPlayer != null) {
|
||||
targetedPlayer.damage(3, permanent.getId(), source, game);
|
||||
}
|
||||
} else {
|
||||
targetedPermanent.damage(3, permanent.getId(), source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
String name = "Ninja's Kunai";
|
||||
Object object = getValue("attachedPermanent");
|
||||
if (object instanceof Permanent) {
|
||||
name = ((Permanent) object).getName();
|
||||
}
|
||||
return name + "deals 3 damage to target any target.";
|
||||
}
|
||||
}
|
||||
|
|
@ -146,6 +146,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Nezumi Bladeblesser", 115, Rarity.COMMON, mage.cards.n.NezumiBladeblesser.class));
|
||||
cards.add(new SetCardInfo("Nezumi Prowler", 116, Rarity.UNCOMMON, mage.cards.n.NezumiProwler.class));
|
||||
cards.add(new SetCardInfo("Nezumi Road Captain", 117, Rarity.COMMON, mage.cards.n.NezumiRoadCaptain.class));
|
||||
cards.add(new SetCardInfo("Ninja's Kunai", 252, Rarity.COMMON, mage.cards.n.NinjasKunai.class));
|
||||
cards.add(new SetCardInfo("Norika Yamazaki, the Poet", 31, Rarity.UNCOMMON, mage.cards.n.NorikaYamazakiThePoet.class));
|
||||
cards.add(new SetCardInfo("Okiba Reckoner Raid", 117, Rarity.COMMON, mage.cards.o.OkibaReckonerRaid.class));
|
||||
cards.add(new SetCardInfo("Oni-Cult Anvil", 230, Rarity.UNCOMMON, mage.cards.o.OniCultAnvil.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue