mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- Added Dead Ringers
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -3896,6 +3896,7 @@ forge-gui/res/cardsfolder/d/dead_gone.txt -text
|
||||
forge-gui/res/cardsfolder/d/dead_iron_sledge.txt svneol=native#text/plain
|
||||
forge-gui/res/cardsfolder/d/dead_reckoning.txt -text svneol=unset#text/plain
|
||||
forge-gui/res/cardsfolder/d/dead_reveler.txt -text
|
||||
forge-gui/res/cardsfolder/d/dead_ringers.txt -text
|
||||
forge-gui/res/cardsfolder/d/dead_weight.txt -text
|
||||
forge-gui/res/cardsfolder/d/deadapult.txt svneol=native#text/plain
|
||||
forge-gui/res/cardsfolder/d/deadbridge_chant.txt -text
|
||||
|
||||
@@ -24,12 +24,16 @@ import forge.game.ability.AbilityUtils;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.card.CardFactoryUtil;
|
||||
import forge.game.card.CardLists;
|
||||
import forge.game.card.CardUtil;
|
||||
import forge.game.phase.PhaseType;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.util.Expressions;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.google.common.collect.Iterables;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -153,6 +157,10 @@ public class SpellAbilityCondition extends SpellAbilityVariables {
|
||||
}
|
||||
}
|
||||
|
||||
if (params.containsKey("ConditionShareAllColors")) {
|
||||
this.setShareAllColors(params.get("ConditionShareAllColors"));
|
||||
}
|
||||
|
||||
if (params.containsKey("ConditionManaSpent")) {
|
||||
this.setManaSpent(params.get("ConditionManaSpent"));
|
||||
}
|
||||
@@ -209,6 +217,21 @@ public class SpellAbilityCondition extends SpellAbilityVariables {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getShareAllColors() != null) {
|
||||
List<Card> tgts = AbilityUtils.getDefinedCards(sa.getHostCard(), this.getShareAllColors(), sa);
|
||||
Card first = Iterables.getFirst(tgts, null);
|
||||
if (first == null) {
|
||||
return false;
|
||||
} else {
|
||||
byte firstColor = CardUtil.getColors(first).getColor();
|
||||
for (Card c : tgts) {
|
||||
if (CardUtil.getColors(c).getColor() != firstColor) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.isSorcerySpeed() && !activator.canCastSorcery()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ public class SpellAbilityVariables {
|
||||
this.metalcraft = sav.isThreshold();
|
||||
this.hellbent = sav.isHellbent();
|
||||
this.allTargetsLegal = sav.isAllTargetsLegal();
|
||||
this.shareAllColors = sav.getShareAllColors();
|
||||
this.prowlTypes = new ArrayList<String>(sav.getProwlTypes());
|
||||
this.isPresent = sav.getIsPresent();
|
||||
this.presentCompare = sav.getPresentCompare();
|
||||
@@ -187,6 +188,9 @@ public class SpellAbilityVariables {
|
||||
/** The life amount. */
|
||||
private String lifeAmount = "GE1";
|
||||
|
||||
/** The shareAllColors. */
|
||||
private String shareAllColors = null;
|
||||
|
||||
/** The mana spent. */
|
||||
private String manaSpent = "";
|
||||
|
||||
@@ -722,6 +726,14 @@ public class SpellAbilityVariables {
|
||||
return this.hellbent;
|
||||
}
|
||||
|
||||
public String getShareAllColors() {
|
||||
return shareAllColors;
|
||||
}
|
||||
|
||||
public void setShareAllColors(String shareAllColors) {
|
||||
this.shareAllColors = shareAllColors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if is pw ability.
|
||||
*
|
||||
|
||||
@@ -684,6 +684,7 @@ public class MagicStack /* extends MyObservable */ implements Iterable<SpellAbil
|
||||
private final boolean hasFizzled(final SpellAbility sa, final Card source, final boolean parentFizzled) {
|
||||
// Can't fizzle unless there are some targets
|
||||
boolean fizzle = false;
|
||||
boolean rememberTgt = sa.getRootAbility().hasParam("RememberOriginalTargets");
|
||||
|
||||
TargetRestrictions tgt = sa.getTargetRestrictions();
|
||||
if (tgt != null) {
|
||||
@@ -698,6 +699,9 @@ public class MagicStack /* extends MyObservable */ implements Iterable<SpellAbil
|
||||
final TargetChoices choices = sa.getTargets();
|
||||
for (final GameObject o : sa.getTargets().getTargets()) {
|
||||
boolean invalidTarget = false;
|
||||
if (rememberTgt) {
|
||||
source.addRemembered(o);
|
||||
}
|
||||
if (o instanceof Card) {
|
||||
final Card card = (Card) o;
|
||||
Card current = game.getCardState(card);
|
||||
@@ -730,6 +734,9 @@ public class MagicStack /* extends MyObservable */ implements Iterable<SpellAbil
|
||||
}
|
||||
|
||||
if (sa.getSubAbility() == null) {
|
||||
if (fizzle && rememberTgt) {
|
||||
source.clearRemembered();
|
||||
}
|
||||
return fizzle;
|
||||
}
|
||||
|
||||
|
||||
8
forge-gui/res/cardsfolder/d/dead_ringers.txt
Normal file
8
forge-gui/res/cardsfolder/d/dead_ringers.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
Name:Dead Ringers
|
||||
ManaCost:4 B
|
||||
Types:Sorcery
|
||||
A:SP$ Destroy | Cost$ 4 B | TargetMin$ 2 | TargetMax$ 2 | NoRegen$ True | ValidTgts$ Creature.nonBlack | TgtPrompt$ Select target nonblack creatures | RememberOriginalTargets$ True | SubAbility$ DBCleanup | ConditionShareAllColors$ DirectRemembered | SpellDescription$ Destroy two target nonblack creatures unless either one is a color the other isn't. They can't be regenerated.
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
SVar:RemAIDeck:True
|
||||
regenerated.SVar:Picture:http://www.wizards.com/global/images/magic/general/dead_ringers.jpg
|
||||
Oracle:Destroy two target nonblack creatures unless either one is a color the other isn't. They can't be regenerated.
|
||||
Reference in New Issue
Block a user