-
Notifications
You must be signed in to change notification settings - Fork 785
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MKM] Implement Judith, Carnage Connoisseur
- Loading branch information
1 parent
e264457
commit 5284e4b
Showing
3 changed files
with
131 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
package mage.cards.j; | ||
|
||
import java.util.UUID; | ||
import mage.MageInt; | ||
import mage.abilities.Ability; | ||
import mage.abilities.Mode; | ||
import mage.abilities.common.SpellCastControllerTriggeredAbility; | ||
import mage.abilities.effects.ContinuousEffectImpl; | ||
import mage.abilities.effects.common.CreateTokenEffect; | ||
import mage.abilities.keyword.DeathtouchAbility; | ||
import mage.abilities.keyword.LifelinkAbility; | ||
import mage.cards.Card; | ||
import mage.constants.Duration; | ||
import mage.constants.Layer; | ||
import mage.constants.Outcome; | ||
import mage.constants.SetTargetPointer; | ||
import mage.constants.SubLayer; | ||
import mage.constants.SubType; | ||
import mage.constants.SuperType; | ||
import mage.cards.CardImpl; | ||
import mage.cards.CardSetInfo; | ||
import mage.constants.CardType; | ||
import mage.filter.StaticFilters; | ||
import mage.game.Game; | ||
import mage.game.permanent.token.ImpToken; | ||
import mage.game.stack.Spell; | ||
|
||
/** | ||
* | ||
* @author DominionSpy | ||
*/ | ||
public final class JudithCarnageConnoisseur extends CardImpl { | ||
|
||
public JudithCarnageConnoisseur(UUID ownerId, CardSetInfo setInfo) { | ||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{R}"); | ||
|
||
this.supertype.add(SuperType.LEGENDARY); | ||
this.subtype.add(SubType.HUMAN); | ||
this.subtype.add(SubType.SHAMAN); | ||
this.power = new MageInt(3); | ||
this.toughness = new MageInt(4); | ||
|
||
// Whenever you cast an instant or sorcery spell, choose one -- | ||
// * That spell gains deathtouch and lifelink. | ||
Ability ability = new SpellCastControllerTriggeredAbility( | ||
new JudithCarnageConnoisseurEffect(), | ||
StaticFilters.FILTER_SPELL_INSTANT_OR_SORCERY, | ||
false, SetTargetPointer.SPELL); | ||
|
||
// * Create a 2/2 red Imp creature token with "When this creature dies, it deals 2 damage to each opponent." | ||
Mode mode = new Mode(new CreateTokenEffect(new ImpToken())); | ||
ability.addMode(mode); | ||
this.addAbility(ability); | ||
} | ||
|
||
private JudithCarnageConnoisseur(final JudithCarnageConnoisseur card) { | ||
super(card); | ||
} | ||
|
||
@Override | ||
public JudithCarnageConnoisseur copy() { | ||
return new JudithCarnageConnoisseur(this); | ||
} | ||
} | ||
|
||
class JudithCarnageConnoisseurEffect extends ContinuousEffectImpl { | ||
|
||
JudithCarnageConnoisseurEffect() { | ||
super(Duration.Custom, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); | ||
staticText = "That spell gains deathtouch and lifelink"; | ||
} | ||
|
||
private JudithCarnageConnoisseurEffect(final JudithCarnageConnoisseurEffect effect) { | ||
super(effect); | ||
} | ||
|
||
@Override | ||
public JudithCarnageConnoisseurEffect copy() { | ||
return new JudithCarnageConnoisseurEffect(this); | ||
} | ||
|
||
@Override | ||
public boolean apply(Game game, Ability source) { | ||
Spell spell = game.getSpell(getTargetPointer().getFirst(game, source)); | ||
if (spell == null) { | ||
return false; | ||
} | ||
|
||
Card card = spell.getCard(); | ||
game.getState().addOtherAbility(card, DeathtouchAbility.getInstance()); | ||
game.getState().addOtherAbility(card, LifelinkAbility.getInstance()); | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
Mage/src/main/java/mage/game/permanent/token/ImpToken.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package mage.game.permanent.token; | ||
|
||
import mage.MageInt; | ||
import mage.abilities.Ability; | ||
import mage.abilities.common.DiesSourceTriggeredAbility; | ||
import mage.abilities.effects.Effect; | ||
import mage.abilities.effects.common.DamagePlayersEffect; | ||
import mage.constants.CardType; | ||
import mage.constants.SubType; | ||
import mage.constants.TargetController; | ||
|
||
public final class ImpToken extends TokenImpl { | ||
|
||
public ImpToken() { | ||
super("Imp Token", "2/2 red Imp creature token with \"When this creature dies, it deals 2 damage to each opponent.\""); | ||
cardType.add(CardType.CREATURE); | ||
subtype.add(SubType.IMP); | ||
color.setRed(true); | ||
power = new MageInt(2); | ||
toughness = new MageInt(2); | ||
|
||
// When this creature dies, it deals 2 damage to each opponent. | ||
Effect effect = new DamagePlayersEffect(2, TargetController.OPPONENT); | ||
effect.setText("it deals 2 damage to each opponent"); | ||
Ability ability = new DiesSourceTriggeredAbility(effect); | ||
this.addAbility(ability); | ||
} | ||
|
||
private ImpToken(final ImpToken token) { | ||
super(token); | ||
} | ||
|
||
public ImpToken copy() { | ||
return new ImpToken(this); | ||
} | ||
} |