mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
- small fixes to some "Curse" cards.
This commit is contained in:
parent
878d602b58
commit
e980240553
8 changed files with 33 additions and 38 deletions
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -29,10 +28,9 @@ import mage.target.targetpointer.FixedTarget;
|
||||||
public final class CurseOfPredation extends CardImpl {
|
public final class CurseOfPredation extends CardImpl {
|
||||||
|
|
||||||
public CurseOfPredation(UUID ownerId, CardSetInfo setInfo) {
|
public CurseOfPredation(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}");
|
||||||
this.subtype.add(SubType.AURA, SubType.CURSE);
|
this.subtype.add(SubType.AURA, SubType.CURSE);
|
||||||
|
|
||||||
|
|
||||||
// Enchant player
|
// Enchant player
|
||||||
TargetPlayer auraTarget = new TargetPlayer();
|
TargetPlayer auraTarget = new TargetPlayer();
|
||||||
this.getSpellAbility().addTarget(auraTarget);
|
this.getSpellAbility().addTarget(auraTarget);
|
||||||
|
@ -75,17 +73,11 @@ class CurseOfPredationTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
Player defender = game.getPlayer(event.getTargetId());
|
Player defender = game.getPlayer(event.getTargetId());
|
||||||
if (defender == null) {
|
|
||||||
Permanent planeswalker = game.getPermanent(event.getTargetId());
|
|
||||||
if (planeswalker != null) {
|
|
||||||
defender = game.getPlayer(planeswalker.getControllerId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (defender != null) {
|
if (defender != null) {
|
||||||
Permanent enchantment = game.getPermanent(this.getSourceId());
|
Permanent enchantment = game.getPermanent(this.getSourceId());
|
||||||
if (enchantment != null
|
if (enchantment != null
|
||||||
&& enchantment.isAttachedTo(defender.getId())) {
|
&& enchantment.isAttachedTo(defender.getId())) {
|
||||||
for (Effect effect: this.getEffects()) {
|
for (Effect effect : this.getEffects()) {
|
||||||
effect.setTargetPointer(new FixedTarget(event.getSourceId()));
|
effect.setTargetPointer(new FixedTarget(event.getSourceId()));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
@ -29,16 +28,16 @@ import java.util.UUID;
|
||||||
public final class CurseOfTheBloodyTome extends CardImpl {
|
public final class CurseOfTheBloodyTome extends CardImpl {
|
||||||
|
|
||||||
public CurseOfTheBloodyTome(UUID ownerId, CardSetInfo setInfo) {
|
public CurseOfTheBloodyTome(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);
|
this.subtype.add(SubType.AURA, SubType.CURSE);
|
||||||
|
|
||||||
|
|
||||||
// Enchant player
|
// Enchant player
|
||||||
TargetPlayer target = new TargetPlayer();
|
TargetPlayer target = new TargetPlayer();
|
||||||
this.getSpellAbility().addTarget(target);
|
this.getSpellAbility().addTarget(target);
|
||||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
|
this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
|
||||||
Ability ability = new EnchantAbility(target.getTargetName());
|
Ability ability = new EnchantAbility(target.getTargetName());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
// At the beginning of enchanted player's upkeep, that player puts the top two cards of their library into their graveyard.
|
// At the beginning of enchanted player's upkeep, that player puts the top two cards of their library into their graveyard.
|
||||||
this.addAbility(new CurseOfTheBloodyTomeAbility());
|
this.addAbility(new CurseOfTheBloodyTomeAbility());
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
@ -42,10 +41,13 @@ public final class CurseOfTheCabal extends CardImpl {
|
||||||
// Target player sacrifices half the permanents he or she controls, rounded down.
|
// Target player sacrifices half the permanents he or she controls, rounded down.
|
||||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||||
this.getSpellAbility().addEffect(new CurseOfTheCabalSacrificeEffect());
|
this.getSpellAbility().addEffect(new CurseOfTheCabalSacrificeEffect());
|
||||||
|
|
||||||
// Suspend 2-{2}{B}{B}
|
// Suspend 2-{2}{B}{B}
|
||||||
this.addAbility(new SuspendAbility(2, new ManaCostsImpl("{2}{B}{B}"), this));
|
this.addAbility(new SuspendAbility(2, new ManaCostsImpl("{2}{B}{B}"), this));
|
||||||
|
|
||||||
// At the beginning of each player's upkeep, if Curse of the Cabal is suspended, that player may sacrifice a permanent. If he or she does, put two time counters on Curse of the Cabal.
|
// At the beginning of each player's upkeep, if Curse of the Cabal is suspended, that player may sacrifice a permanent. If he or she does, put two time counters on Curse of the Cabal.
|
||||||
this.addAbility(new CurseOfTheCabalInterveningIfTriggeredAbility());
|
this.addAbility(new CurseOfTheCabalInterveningIfTriggeredAbility());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CurseOfTheCabal(final CurseOfTheCabal card) {
|
public CurseOfTheCabal(final CurseOfTheCabal card) {
|
||||||
|
@ -84,7 +86,8 @@ class CurseOfTheCabalSacrificeEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
Target target = new TargetControlledPermanent(amount, amount, StaticFilters.FILTER_CONTROLLED_PERMANENT, true);
|
Target target = new TargetControlledPermanent(amount, amount, StaticFilters.FILTER_CONTROLLED_PERMANENT, true);
|
||||||
if (target.canChoose(targetPlayer.getId(), game)) {
|
if (target.canChoose(targetPlayer.getId(), game)) {
|
||||||
while (!target.isChosen() && target.canChoose(targetPlayer.getId(), game) && targetPlayer.canRespond()) {
|
while (!target.isChosen()
|
||||||
|
&& target.canChoose(targetPlayer.getId(), game) && targetPlayer.canRespond()) {
|
||||||
targetPlayer.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
|
targetPlayer.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
|
||||||
}
|
}
|
||||||
//sacrifice all chosen (non null) permanents
|
//sacrifice all chosen (non null) permanents
|
||||||
|
@ -107,7 +110,9 @@ class CurseOfTheCabalInterveningIfTriggeredAbility extends ConditionalIntervenin
|
||||||
TargetController.ANY, false, true
|
TargetController.ANY, false, true
|
||||||
),
|
),
|
||||||
SuspendedCondition.instance,
|
SuspendedCondition.instance,
|
||||||
"At the beginning of each player's upkeep, if {this} is suspended, that player may sacrifice a permanent. If he or she does, put two time counters on {this}."
|
"At the beginning of each player's upkeep, if {this} is suspended, "
|
||||||
|
+ "that player may sacrifice a permanent. If he or she does, "
|
||||||
|
+ "put two time counters on {this}."
|
||||||
);
|
);
|
||||||
// controller has to sac a permanent
|
// controller has to sac a permanent
|
||||||
// counters aren't placed
|
// counters aren't placed
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
|
@ -29,7 +28,7 @@ import java.util.UUID;
|
||||||
public final class CurseOfTheForsaken extends CardImpl {
|
public final class CurseOfTheForsaken extends CardImpl {
|
||||||
|
|
||||||
public CurseOfTheForsaken(UUID ownerId, CardSetInfo setInfo) {
|
public CurseOfTheForsaken(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
|
||||||
this.subtype.add(SubType.AURA, SubType.CURSE);
|
this.subtype.add(SubType.AURA, SubType.CURSE);
|
||||||
|
|
||||||
// Enchant player
|
// Enchant player
|
||||||
|
@ -40,6 +39,7 @@ public final class CurseOfTheForsaken extends CardImpl {
|
||||||
|
|
||||||
// Whenever a creature attacks enchanted player, its controller gains 1 life.
|
// Whenever a creature attacks enchanted player, its controller gains 1 life.
|
||||||
this.addAbility(new CurseOfTheForsakenTriggeredAbility());
|
this.addAbility(new CurseOfTheForsakenTriggeredAbility());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CurseOfTheForsaken(final CurseOfTheForsaken card) {
|
public CurseOfTheForsaken(final CurseOfTheForsaken card) {
|
||||||
|
@ -74,12 +74,6 @@ class CurseOfTheForsakenTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
Player defender = game.getPlayer(event.getTargetId());
|
Player defender = game.getPlayer(event.getTargetId());
|
||||||
if (defender == null) {
|
|
||||||
Permanent planeswalker = game.getPermanent(event.getTargetId());
|
|
||||||
if (planeswalker != null) {
|
|
||||||
defender = game.getPlayer(planeswalker.getControllerId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (defender != null) {
|
if (defender != null) {
|
||||||
Permanent enchantment = game.getPermanent(this.getSourceId());
|
Permanent enchantment = game.getPermanent(this.getSourceId());
|
||||||
if (enchantment != null
|
if (enchantment != null
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
@ -29,8 +28,10 @@ public final class CurseOfTheSwine extends CardImpl {
|
||||||
|
|
||||||
// Exile X target creatures. For each creature exiled this way, its controller creates a 2/2 green Boar creature token.
|
// Exile X target creatures. For each creature exiled this way, its controller creates a 2/2 green Boar creature token.
|
||||||
this.getSpellAbility().addEffect(new CurseOfTheSwineEffect());
|
this.getSpellAbility().addEffect(new CurseOfTheSwineEffect());
|
||||||
|
|
||||||
// Correct number of targets will be set in adjustTargets
|
// Correct number of targets will be set in adjustTargets
|
||||||
this.getSpellAbility().setTargetAdjuster(CurseOfTheSwineAdjuster.instance);
|
this.getSpellAbility().setTargetAdjuster(CurseOfTheSwineAdjuster.instance);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CurseOfTheSwine(final CurseOfTheSwine card) {
|
public CurseOfTheSwine(final CurseOfTheSwine card) {
|
||||||
|
@ -57,7 +58,8 @@ class CurseOfTheSwineEffect extends OneShotEffect {
|
||||||
|
|
||||||
public CurseOfTheSwineEffect() {
|
public CurseOfTheSwineEffect() {
|
||||||
super(Outcome.Exile);
|
super(Outcome.Exile);
|
||||||
this.staticText = "Exile X target creatures. For each creature exiled this way, its controller creates a 2/2 green Boar creature token";
|
this.staticText = "Exile X target creatures. For each creature exiled this way, "
|
||||||
|
+ "its controller creates a 2/2 green Boar creature token";
|
||||||
}
|
}
|
||||||
|
|
||||||
public CurseOfTheSwineEffect(final CurseOfTheSwineEffect effect) {
|
public CurseOfTheSwineEffect(final CurseOfTheSwineEffect effect) {
|
||||||
|
@ -78,13 +80,15 @@ class CurseOfTheSwineEffect extends OneShotEffect {
|
||||||
Permanent creature = game.getPermanent(targetId);
|
Permanent creature = game.getPermanent(targetId);
|
||||||
if (creature != null) {
|
if (creature != null) {
|
||||||
if (controller.moveCards(creature, Zone.EXILED, source, game)) {
|
if (controller.moveCards(creature, Zone.EXILED, source, game)) {
|
||||||
playersWithTargets.put(creature.getControllerId(), playersWithTargets.getOrDefault(creature.getControllerId(), 0) + 1);
|
playersWithTargets.put(creature.getControllerId(),
|
||||||
|
playersWithTargets.getOrDefault(creature.getControllerId(), 0) + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CurseOfTheSwineBoarToken swineToken = new CurseOfTheSwineBoarToken();
|
CurseOfTheSwineBoarToken swineToken = new CurseOfTheSwineBoarToken();
|
||||||
for (Map.Entry<UUID, Integer> exiledByController : playersWithTargets.entrySet()) {
|
for (Map.Entry<UUID, Integer> exiledByController : playersWithTargets.entrySet()) {
|
||||||
swineToken.putOntoBattlefield(exiledByController.getValue(), game, source.getSourceId(), exiledByController.getKey());
|
swineToken.putOntoBattlefield(exiledByController.getValue(),
|
||||||
|
game, source.getSourceId(), exiledByController.getKey());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
@ -31,10 +30,9 @@ import java.util.UUID;
|
||||||
public final class CurseOfThirst extends CardImpl {
|
public final class CurseOfThirst extends CardImpl {
|
||||||
|
|
||||||
public CurseOfThirst(UUID ownerId, CardSetInfo setInfo) {
|
public CurseOfThirst(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{4}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{4}{B}");
|
||||||
this.subtype.add(SubType.AURA, SubType.CURSE);
|
this.subtype.add(SubType.AURA, SubType.CURSE);
|
||||||
|
|
||||||
|
|
||||||
// Enchant player
|
// Enchant player
|
||||||
TargetPlayer auraTarget = new TargetPlayer();
|
TargetPlayer auraTarget = new TargetPlayer();
|
||||||
this.getSpellAbility().addTarget(auraTarget);
|
this.getSpellAbility().addTarget(auraTarget);
|
||||||
|
@ -91,7 +89,8 @@ class CurseOfThirstAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRule() {
|
public String getRule() {
|
||||||
return "At the beginning of enchanted player's upkeep, Curse of Thirst deals damage to that player equal to the number of Curses attached to him or her.";
|
return "At the beginning of enchanted player's upkeep, Curse of Thirst "
|
||||||
|
+ "deals damage to that player equal to the number of Curses attached to him or her.";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -108,10 +107,11 @@ class CursesAttachedCount implements DynamicValue {
|
||||||
if (enchantment != null && enchantment.getAttachedTo() != null) {
|
if (enchantment != null && enchantment.getAttachedTo() != null) {
|
||||||
Player player = game.getPlayer(enchantment.getAttachedTo());
|
Player player = game.getPlayer(enchantment.getAttachedTo());
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
for (UUID attachmentId: player.getAttachments()) {
|
for (UUID attachmentId : player.getAttachments()) {
|
||||||
Permanent attachment = game.getPermanent(attachmentId);
|
Permanent attachment = game.getPermanent(attachmentId);
|
||||||
if (attachment != null && attachment.hasSubtype(SubType.CURSE, game))
|
if (attachment != null && attachment.hasSubtype(SubType.CURSE, game)) {
|
||||||
count++;
|
count++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -130,7 +129,8 @@ class CurseOfVengeancePlayerLosesTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRule() {
|
public String getRule() {
|
||||||
return "When enchanted player loses the game, you gain X life and draw X cards, where X is the number of spite counters on {this}";
|
return "When enchanted player loses the game, you gain X life and "
|
||||||
|
+ "draw X cards, where X is the number of spite counters on {this}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +138,8 @@ class CurseOfVengeanceDrawLifeEffect extends OneShotEffect {
|
||||||
|
|
||||||
public CurseOfVengeanceDrawLifeEffect() {
|
public CurseOfVengeanceDrawLifeEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.Benefit);
|
||||||
staticText = "you gain X life and draw X cards, where X is the number of spite counters on {this}";
|
staticText = "you gain X life and draw X cards, where X is the "
|
||||||
|
+ "number of spite counters on {this}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public CurseOfVengeanceDrawLifeEffect(final CurseOfVengeanceDrawLifeEffect effect) {
|
public CurseOfVengeanceDrawLifeEffect(final CurseOfVengeanceDrawLifeEffect effect) {
|
||||||
|
|
|
@ -129,7 +129,7 @@ class UrzasHotTubPredicate implements Predicate<MageObject> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean sharesWordWithName(String str) {
|
private boolean sharesWordWithName(String str) {
|
||||||
if (referenceName == null || referenceName == "") {
|
if (referenceName == null || referenceName.equals("")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
String[] arr = referenceName.split("\\s+");
|
String[] arr = referenceName.split("\\s+");
|
||||||
|
|
Loading…
Reference in a new issue