- Added Rain of Gore

This commit is contained in:
swordshine
2013-04-08 05:13:24 +00:00
parent e9c61b6fcd
commit 1b71f3a409
5 changed files with 24 additions and 1 deletions

1
.gitattributes vendored
View File

@@ -8295,6 +8295,7 @@ res/cardsfolder/r/rain_of_blades.txt svneol=native#text/plain
res/cardsfolder/r/rain_of_daggers.txt -text
res/cardsfolder/r/rain_of_embers.txt svneol=native#text/plain
res/cardsfolder/r/rain_of_filth.txt -text svneol=unset#text/plain
res/cardsfolder/r/rain_of_gore.txt -text
res/cardsfolder/r/rain_of_rust.txt svneol=native#text/plain
res/cardsfolder/r/rain_of_salt.txt svneol=native#text/plain
res/cardsfolder/r/rain_of_tears.txt svneol=native#text/plain

View File

@@ -0,0 +1,10 @@
Name:Rain of Gore
ManaCost:B R
Types:Enchantment
R:Event$ GainLife | ActiveZones$ Battlefield | ValidSource$ Card | SourceController$ True | ReplaceWith$ RLoseLife | Description$ If a spell or ability would cause its controller to gain life, that player loses that much life instead.
SVar:RLoseLife:AB$ LoseLife | Cost$ 0 | LifeAmount$ X | Defined$ ReplacedPlayer | References$ X
SVar:X:ReplaceCount$LifeGained
SVar:RemRandomDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/rain_of_gore.jpg
Oracle:If a spell or ability would cause its controller to gain life, that player loses that much life instead.
SetInfo:DIS Rare

View File

@@ -206,7 +206,7 @@ public class ChooseTypeEffect extends SpellAbilityEffect {
for (Card c : lands) {
for (String t : c.getType()) {
if (!invalidTypes.contains(t)
&& CardType.isALandType(t)) {
&& CardType.getLandTypes().contains(t)) {
choice = t;
break;
}

View File

@@ -51,6 +51,16 @@ public class ReplaceGainLife extends ReplacementEffect {
return false;
}
}
if (this.getMapParams().containsKey("ValidSource")) {
if (!matchesValid(runParams.get("Source"), this.getMapParams().get("ValidSource").split(","), this.getHostCard())) {
return false;
}
}
if ("True".equals(this.getMapParams().get("SourceController"))) {
if (runParams.get("Source") == null || !runParams.get("Affected").equals(((Card)runParams.get("Source")).getController())) {
return false;
}
}
return true;
}
@@ -73,6 +83,7 @@ public class ReplaceGainLife extends ReplacementEffect {
@Override
public void setReplacingObjects(Map<String, Object> runParams, SpellAbility sa) {
sa.setReplacingObject("LifeGained", runParams.get("LifeGained"));
sa.setReplacingObject("Player", runParams.get("Affected"));
}
}

View File

@@ -441,6 +441,7 @@ public abstract class Player extends GameEntity implements Comparable<Player> {
repParams.put("Event", "GainLife");
repParams.put("Affected", this);
repParams.put("LifeGained", toGain);
repParams.put("Source", source);
if (game.getReplacementHandler().run(repParams) != ReplacementResult.NotReplaced) {
return false;
}