mirror of
https://github.com/correl/mage.git
synced 2024-12-28 11:14:13 +00:00
[NEO] Implemented Simian Sling
This commit is contained in:
parent
dd775198ff
commit
526bb5283b
2 changed files with 128 additions and 0 deletions
127
Mage.Sets/src/mage/cards/s/SimianSling.java
Normal file
127
Mage.Sets/src/mage/cards/s/SimianSling.java
Normal file
|
@ -0,0 +1,127 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
|
||||
import mage.abilities.keyword.ReconfigureAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class SimianSling extends CardImpl {
|
||||
|
||||
public SimianSling(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{R}");
|
||||
|
||||
this.subtype.add(SubType.EQUIPMENT);
|
||||
this.subtype.add(SubType.MONKEY);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Equipped creature gets +1/+1.
|
||||
this.addAbility(new SimpleStaticAbility(new BoostEquippedEffect(1, 1)));
|
||||
|
||||
// Whenever Simian Sling or equipped creature becomes blocked, it deals 1 damage to defending player.
|
||||
this.addAbility(new SimianSlingTriggeredAbility());
|
||||
|
||||
// Reconfigure {2}
|
||||
this.addAbility(new ReconfigureAbility("{2}"));
|
||||
}
|
||||
|
||||
private SimianSling(final SimianSling card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SimianSling copy() {
|
||||
return new SimianSling(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SimianSlingTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
SimianSlingTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new SimianSlingEffect());
|
||||
}
|
||||
|
||||
private SimianSlingTriggeredAbility(final SimianSlingTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SimianSlingTriggeredAbility copy() {
|
||||
return new SimianSlingTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.CREATURE_BLOCKED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
UUID attacker;
|
||||
if (!event.getTargetId().equals(getSourceId())) {
|
||||
Permanent permanent = getSourcePermanentOrLKI(game);
|
||||
if (permanent != null && event.getTargetId().equals(permanent.getAttachedTo())) {
|
||||
attacker = permanent.getAttachedTo();
|
||||
} else {
|
||||
attacker = null;
|
||||
}
|
||||
} else {
|
||||
attacker = getSourceId();
|
||||
}
|
||||
if (attacker == null) {
|
||||
return false;
|
||||
}
|
||||
getEffects().setValue("attacker", attacker);
|
||||
getEffects().setTargetPointer(new FixedTarget(game.getCombat().getDefendingPlayerId(attacker, game)));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever Simian Sling or equipped creature becomes blocked, it deals 1 damage to defending player.";
|
||||
}
|
||||
}
|
||||
|
||||
class SimianSlingEffect extends OneShotEffect {
|
||||
|
||||
SimianSlingEffect() {
|
||||
super(Outcome.Benefit);
|
||||
}
|
||||
|
||||
private SimianSlingEffect(final SimianSlingEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SimianSlingEffect copy() {
|
||||
return new SimianSlingEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
UUID attacker = (UUID) getValue("attacker");
|
||||
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
return attacker != null
|
||||
&& player != null
|
||||
&& player.damage(1, attacker, source, game) > 0;
|
||||
}
|
||||
}
|
|
@ -196,6 +196,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Short Circuit", 78, Rarity.COMMON, mage.cards.s.ShortCircuit.class));
|
||||
cards.add(new SetCardInfo("Siba Trespassers", 77, Rarity.COMMON, mage.cards.s.SibaTrespassers.class));
|
||||
cards.add(new SetCardInfo("Silver-Fur Master", 236, Rarity.UNCOMMON, mage.cards.s.SilverFurMaster.class));
|
||||
cards.add(new SetCardInfo("Simian Sling", 163, Rarity.COMMON, mage.cards.s.SimianSling.class));
|
||||
cards.add(new SetCardInfo("Sky-Blessed Samurai", 37, Rarity.UNCOMMON, mage.cards.s.SkyBlessedSamurai.class));
|
||||
cards.add(new SetCardInfo("Skyswimmer Koi", 79, Rarity.COMMON, mage.cards.s.SkyswimmerKoi.class));
|
||||
cards.add(new SetCardInfo("Sokenzan Smelter", 164, Rarity.UNCOMMON, mage.cards.s.SokenzanSmelter.class));
|
||||
|
|
Loading…
Reference in a new issue