mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
Implemented Hydroid Krasis
This commit is contained in:
parent
38b6f476e3
commit
f17871188c
2 changed files with 89 additions and 0 deletions
88
Mage.Sets/src/mage/cards/h/HydroidKrasis.java
Normal file
88
Mage.Sets/src/mage/cards/h/HydroidKrasis.java
Normal file
|
@ -0,0 +1,88 @@
|
|||
package mage.cards.h;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CastSourceTriggeredAbility;
|
||||
import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class HydroidKrasis extends CardImpl {
|
||||
|
||||
public HydroidKrasis(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{X}{G}{U}");
|
||||
|
||||
this.subtype.add(SubType.JELLYFISH);
|
||||
this.subtype.add(SubType.HYDRA);
|
||||
this.subtype.add(SubType.BEAST);
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(0);
|
||||
|
||||
// When you cast this spell, you gain half X life and draw half X cards. Round down each time.
|
||||
this.addAbility(new CastSourceTriggeredAbility(new HydroidKrasisEffect(), false));
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Trample
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
|
||||
// Hydroid Krasis enters the battlefield with X +1/+1 counters on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(
|
||||
new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance())
|
||||
));
|
||||
}
|
||||
|
||||
private HydroidKrasis(final HydroidKrasis card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HydroidKrasis copy() {
|
||||
return new HydroidKrasis(this);
|
||||
}
|
||||
}
|
||||
|
||||
class HydroidKrasisEffect extends OneShotEffect {
|
||||
|
||||
HydroidKrasisEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "you gain half X life and draw half X cards. Round down each time.";
|
||||
}
|
||||
|
||||
private HydroidKrasisEffect(final HydroidKrasisEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HydroidKrasisEffect copy() {
|
||||
return new HydroidKrasisEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
int halfCost = Math.floorDiv(source.getManaCostsToPay().getX(), 2);
|
||||
player.drawCards(halfCost, game);
|
||||
player.gainLife(halfCost, game, source);
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -50,6 +50,7 @@ public final class RavnicaAllegiance extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Gruul Locket", 234, Rarity.COMMON, mage.cards.g.GruulLocket.class));
|
||||
cards.add(new SetCardInfo("Gruul Spellbreaker", 179, Rarity.RARE, mage.cards.g.GruulSpellbreaker.class));
|
||||
cards.add(new SetCardInfo("Hallowed Fountain", 251, Rarity.RARE, mage.cards.h.HallowedFountain.class));
|
||||
cards.add(new SetCardInfo("Hydroid Krasis", 183, Rarity.MYTHIC, mage.cards.h.HydroidKrasis.class));
|
||||
cards.add(new SetCardInfo("Imperious Oligarch", 184, Rarity.COMMON, mage.cards.i.ImperiousOligarch.class));
|
||||
cards.add(new SetCardInfo("Incubation // Incongruity", 226, Rarity.UNCOMMON, mage.cards.i.IncubationIncongruity.class));
|
||||
cards.add(new SetCardInfo("Light Up the Stage", 107, Rarity.UNCOMMON, mage.cards.l.LightUpTheStage.class));
|
||||
|
|
Loading…
Reference in a new issue