mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Implemented Shark Typhoon
This commit is contained in:
parent
28659043ca
commit
7e86626f1d
3 changed files with 146 additions and 0 deletions
114
Mage.Sets/src/mage/cards/s/SharkTyphoon.java
Normal file
114
Mage.Sets/src/mage/cards/s/SharkTyphoon.java
Normal file
|
@ -0,0 +1,114 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.common.ZoneChangeTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.CyclingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.token.SharkToken;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.game.stack.StackObject;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class SharkTyphoon extends CardImpl {
|
||||
|
||||
public SharkTyphoon(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{5}{U}");
|
||||
|
||||
// Whenever you cast a noncreature spell, create an X/X blue Shark creature token with flying, where X is that spell's converted mana cost.
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(
|
||||
new SharkTyphoonCastEffect(), StaticFilters.FILTER_SPELL_A_NON_CREATURE, true
|
||||
));
|
||||
|
||||
// Cycling {X}{1}{U}
|
||||
this.addAbility(new CyclingAbility(new ManaCostsImpl("{X}{1}{U}")));
|
||||
|
||||
// When you cycle Shark Typhoon, create an X/X blue Shark creature token with flying.
|
||||
this.addAbility(new SharkTyphoonTriggeredAbility());
|
||||
}
|
||||
|
||||
private SharkTyphoon(final SharkTyphoon card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SharkTyphoon copy() {
|
||||
return new SharkTyphoon(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SharkTyphoonCastEffect extends OneShotEffect {
|
||||
|
||||
SharkTyphoonCastEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "create an X/X blue Shark creature token with flying, where X is that spell's converted mana cost";
|
||||
}
|
||||
|
||||
private SharkTyphoonCastEffect(final SharkTyphoonCastEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SharkTyphoonCastEffect copy() {
|
||||
return new SharkTyphoonCastEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Spell spell = game.getSpell(targetPointer.getFirst(game, source));
|
||||
int xValue = 0;
|
||||
if (spell != null) {
|
||||
xValue = spell.getConvertedManaCost();
|
||||
}
|
||||
return new SharkToken(xValue).putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
|
||||
}
|
||||
}
|
||||
|
||||
class SharkTyphoonTriggeredAbility extends ZoneChangeTriggeredAbility {
|
||||
|
||||
SharkTyphoonTriggeredAbility() {
|
||||
super(Zone.ALL, null, "When you cycle {this}, ", false);
|
||||
}
|
||||
|
||||
private SharkTyphoonTriggeredAbility(SharkTyphoonTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ACTIVATED_ABILITY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (!event.getSourceId().equals(this.getSourceId())) {
|
||||
return false;
|
||||
}
|
||||
StackObject object = game.getStack().getStackObject(event.getSourceId());
|
||||
if (object == null || !(object.getStackAbility() instanceof CyclingAbility)) {
|
||||
return false;
|
||||
}
|
||||
this.getEffects().clear();
|
||||
this.addEffect(new CreateTokenEffect(new SharkToken(object.getManaCost().getX())));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SharkTyphoonTriggeredAbility copy() {
|
||||
return new SharkTyphoonTriggeredAbility(this);
|
||||
}
|
||||
}
|
|
@ -259,6 +259,7 @@ public final class IkoriaLairOfBehemoths extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Scoured Barrens", 254, Rarity.COMMON, mage.cards.s.ScouredBarrens.class));
|
||||
cards.add(new SetCardInfo("Sea-Dasher Octopus", 66, Rarity.RARE, mage.cards.s.SeaDasherOctopus.class));
|
||||
cards.add(new SetCardInfo("Serrated Scorpion", 99, Rarity.COMMON, mage.cards.s.SerratedScorpion.class));
|
||||
cards.add(new SetCardInfo("Shark Typhoon", 67, Rarity.RARE, mage.cards.s.SharkTyphoon.class));
|
||||
cards.add(new SetCardInfo("Shredded Sails", 136, Rarity.COMMON, mage.cards.s.ShreddedSails.class));
|
||||
cards.add(new SetCardInfo("Skull Prophet", 206, Rarity.UNCOMMON, mage.cards.s.SkullProphet.class));
|
||||
cards.add(new SetCardInfo("Skycat Sovereign", 207, Rarity.RARE, mage.cards.s.SkycatSovereign.class));
|
||||
|
|
31
Mage/src/main/java/mage/game/permanent/token/SharkToken.java
Normal file
31
Mage/src/main/java/mage/game/permanent/token/SharkToken.java
Normal file
|
@ -0,0 +1,31 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class SharkToken extends TokenImpl {
|
||||
|
||||
public SharkToken(int xValue) {
|
||||
super("Shark", "X/X blue Shark creature token with flying");
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setBlue(true);
|
||||
subtype.add(SubType.SHARK);
|
||||
power = new MageInt(xValue);
|
||||
toughness = new MageInt(xValue);
|
||||
addAbility(FlyingAbility.getInstance());
|
||||
}
|
||||
|
||||
private SharkToken(final SharkToken token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SharkToken copy() {
|
||||
return new SharkToken(this);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue