mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 12:49:39 -08:00
* Curse cards - fixed that it triggers on planeswalker attack only (#5566);
This commit is contained in:
parent
c6f0239bcd
commit
e285b2770d
6 changed files with 110 additions and 32 deletions
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -24,13 +23,12 @@ import mage.target.targetpointer.FixedTarget;
|
|||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class CurseOfChaos extends CardImpl {
|
||||
|
||||
public CurseOfChaos(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}");
|
||||
this.subtype.add(SubType.AURA, SubType.CURSE);
|
||||
|
||||
|
||||
|
|
@ -74,9 +72,9 @@ class CurseOfChaosTriggeredAbility extends TriggeredAbilityImpl {
|
|||
Permanent enchantment = game.getPermanent(this.getSourceId());
|
||||
if (enchantment != null
|
||||
&& enchantment.getAttachedTo() != null
|
||||
&& game.getCombat().getPlayerDefenders(game).contains(enchantment.getAttachedTo())) {
|
||||
for (Effect effect: this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackingPlayerId()));
|
||||
&& game.getCombat().getPlayerDefenders(game, false).contains(enchantment.getAttachedTo())) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackingPlayerId()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -115,7 +113,7 @@ class CurseOfChaosEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player attacker = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
||||
if (attacker != null) {
|
||||
if (!attacker.getHand().isEmpty() && attacker.chooseUse(outcome, "Discard a card and draw a card?", source, game)){
|
||||
if (!attacker.getHand().isEmpty() && attacker.chooseUse(outcome, "Discard a card and draw a card?", source, game)) {
|
||||
attacker.discard(1, false, source, game);
|
||||
attacker.drawCards(1, game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -23,13 +22,12 @@ import mage.target.TargetPlayer;
|
|||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class CurseOfInertia extends CardImpl {
|
||||
|
||||
public CurseOfInertia(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}");
|
||||
this.subtype.add(SubType.AURA, SubType.CURSE);
|
||||
|
||||
|
||||
|
|
@ -59,7 +57,7 @@ class CurseOfInertiaTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public CurseOfInertiaTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new CurseOfInertiaTapOrUntapTargetEffect(), false);
|
||||
}
|
||||
|
||||
|
||||
public CurseOfInertiaTriggeredAbility(final CurseOfInertiaTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
|
@ -74,7 +72,7 @@ class CurseOfInertiaTriggeredAbility extends TriggeredAbilityImpl {
|
|||
Permanent enchantment = game.getPermanent(this.getSourceId());
|
||||
if (enchantment != null
|
||||
&& enchantment.getAttachedTo() != null
|
||||
&& game.getCombat().getPlayerDefenders(game).contains(enchantment.getAttachedTo())) {
|
||||
&& game.getCombat().getPlayerDefenders(game, false).contains(enchantment.getAttachedTo())) {
|
||||
TargetPermanent target = new TargetPermanent();
|
||||
target.setTargetController(game.getCombat().getAttackingPlayerId());
|
||||
addTarget(target);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -27,7 +26,6 @@ import mage.target.targetpointer.FixedTarget;
|
|||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class CurseOfShallowGraves extends CardImpl {
|
||||
|
|
@ -80,7 +78,7 @@ class CurseOfShallowTriggeredAbility extends TriggeredAbilityImpl {
|
|||
Permanent enchantment = game.getPermanent(this.getSourceId());
|
||||
if (enchantment != null
|
||||
&& enchantment.getAttachedTo() != null
|
||||
&& game.getCombat().getPlayerDefenders(game).contains(enchantment.getAttachedTo())) {
|
||||
&& game.getCombat().getPlayerDefenders(game, false).contains(enchantment.getAttachedTo())) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackingPlayerId()));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue