Implemented Juju Bubble

This commit is contained in:
Evan Kranzler 2018-06-03 20:24:35 -04:00
parent aad943cd2d
commit ba28ee3a06
2 changed files with 77 additions and 0 deletions

View file

@ -0,0 +1,76 @@
package mage.cards.j;
import java.util.UUID;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.abilities.keyword.CumulativeUpkeepAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
/**
*
* @author TheElk801
*/
public final class JujuBubble extends CardImpl {
public JujuBubble(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}");
// Cumulative upkeep {1}
this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{1}")));
// When you play a card, sacrifice Juju Bubble.
this.addAbility(new JujuBubbleTriggeredAbility());
// {2}: You gain 1 life.
this.addAbility(new SimpleActivatedAbility(new GainLifeEffect(1), new GenericManaCost(1)));
}
public JujuBubble(final JujuBubble card) {
super(card);
}
@Override
public JujuBubble copy() {
return new JujuBubble(this);
}
}
class JujuBubbleTriggeredAbility extends TriggeredAbilityImpl {
JujuBubbleTriggeredAbility() {
super(Zone.BATTLEFIELD, new SacrificeSourceEffect(), false);
}
JujuBubbleTriggeredAbility(final JujuBubbleTriggeredAbility ability) {
super(ability);
}
@Override
public JujuBubbleTriggeredAbility copy() {
return new JujuBubbleTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.SPELL_CAST || event.getType() == GameEvent.EventType.LAND_PLAYED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return event.getPlayerId().equals(this.getControllerId());
}
@Override
public String getRule() {
return "When you play a card, sacrifice {this}";
}
}

View file

@ -88,6 +88,7 @@ public final class Visions extends ExpansionSet {
cards.add(new SetCardInfo("Inspiration", 35, Rarity.COMMON, mage.cards.i.Inspiration.class));
cards.add(new SetCardInfo("Iron-Heart Chimera", 146, Rarity.UNCOMMON, mage.cards.i.IronHeartChimera.class));
cards.add(new SetCardInfo("Jamuraan Lion", 10, Rarity.COMMON, mage.cards.j.JamuraanLion.class));
cards.add(new SetCardInfo("Juju Bubble", 147, Rarity.UNCOMMON, mage.cards.j.JujuBubble.class));
cards.add(new SetCardInfo("Jungle Basin", 164, Rarity.UNCOMMON, mage.cards.j.JungleBasin.class));
cards.add(new SetCardInfo("Kaervek's Spite", 63, Rarity.RARE, mage.cards.k.KaerveksSpite.class));
cards.add(new SetCardInfo("Karoo", 165, Rarity.UNCOMMON, mage.cards.k.Karoo.class));