-
Notifications
You must be signed in to change notification settings - Fork 806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MKM] Implement Judith, Carnage Connoisseur #11821
Merged
xenohedron
merged 1 commit into
magefree:master
from
DominionSpy:judith-carnage-connoisseur
Feb 21, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I'm pretty sure rules text generation can handle this without manually setting?)