diff --git a/.gitattributes b/.gitattributes index 6944e7c2259..fc99baa32ac 100644 --- a/.gitattributes +++ b/.gitattributes @@ -599,6 +599,7 @@ res/cardsfolder/b/basalt_monolith.txt svneol=native#text/plain res/cardsfolder/b/bash_to_bits.txt svneol=native#text/plain res/cardsfolder/b/basilisk_collar.txt svneol=native#text/plain res/cardsfolder/b/basking_rootwalla.txt svneol=native#text/plain +res/cardsfolder/b/bathe_in_light.txt -text res/cardsfolder/b/baton_of_courage.txt svneol=native#text/plain res/cardsfolder/b/battered_golem.txt svneol=native#text/plain res/cardsfolder/b/battering_craghorn.txt svneol=native#text/plain @@ -8797,6 +8798,7 @@ res/cardsfolder/w/wizard_replica.txt svneol=native#text/plain res/cardsfolder/w/wizards_school.txt svneol=native#text/plain res/cardsfolder/w/wizened_cenn.txt svneol=native#text/plain res/cardsfolder/w/woebearer.txt svneol=native#text/plain +res/cardsfolder/w/wojek_apothecary.txt -text res/cardsfolder/w/wojek_embermage.txt svneol=native#text/plain res/cardsfolder/w/wojek_siren.txt -text res/cardsfolder/w/wolf_skull_shaman.txt svneol=native#text/plain diff --git a/res/cardsfolder/b/bathe_in_light.txt b/res/cardsfolder/b/bathe_in_light.txt new file mode 100644 index 00000000000..04ec524f701 --- /dev/null +++ b/res/cardsfolder/b/bathe_in_light.txt @@ -0,0 +1,6 @@ +Name:Bathe in Light +ManaCost:1 W +Types:Instant +Text:no text +A:SP$Protection | Cost$ 1 W | ValidTgts$ Creature | TgtPrompt$ Choose target creature | Gains$ Choice | Choices$ AnyColor | Radiance$ True | SpellDescription$ Radiance - Choose a color. Target creature and each other creature that shares a color with it gain protection from the chosen color until end of turn. +End \ No newline at end of file diff --git a/res/cardsfolder/w/wojek_apothecary.txt b/res/cardsfolder/w/wojek_apothecary.txt new file mode 100644 index 00000000000..dc42a00e17d --- /dev/null +++ b/res/cardsfolder/w/wojek_apothecary.txt @@ -0,0 +1,7 @@ +Name:Wojek Apothecary +ManaCost:2 W W +Types:Creature Human Cleric +Text:no text +PT:1/1 +A:AB$PreventDamage | Cost$ T | ValidTgts$ Creature | TgtPrompt$ Choose target creature | Amount$ 1 | Radiance$ True | PreCostDesc$ Radiance - | SpellDescription$ Prevent the next 1 damage that would be dealt to target creature and each other creature that shares a color with it this turn. +End \ No newline at end of file diff --git a/src/main/java/forge/card/abilityFactory/AbilityFactory_DealDamage.java b/src/main/java/forge/card/abilityFactory/AbilityFactory_DealDamage.java index 90d304d2c05..08b535165c3 100644 --- a/src/main/java/forge/card/abilityFactory/AbilityFactory_DealDamage.java +++ b/src/main/java/forge/card/abilityFactory/AbilityFactory_DealDamage.java @@ -182,6 +182,16 @@ public class AbilityFactory_DealDamage { if (o instanceof Card || o instanceof Player) sb.append(o.toString()); } + + if(af.getMapParams().containsKey("Radiance")) { + sb.append(" and each other ").append(af.getMapParams().get("ValidTgts")).append(" that shares a color with "); + if(tgts.size() > 1) { + sb.append("them"); + } + else { + sb.append("it"); + } + } sb.append(". "); diff --git a/src/main/java/forge/card/abilityFactory/AbilityFactory_Destroy.java b/src/main/java/forge/card/abilityFactory/AbilityFactory_Destroy.java index d3e9e7f5b4b..868af1d4501 100644 --- a/src/main/java/forge/card/abilityFactory/AbilityFactory_Destroy.java +++ b/src/main/java/forge/card/abilityFactory/AbilityFactory_Destroy.java @@ -357,6 +357,16 @@ public class AbilityFactory_Destroy { if (it.hasNext()) sb.append(", "); } + + if(af.getMapParams().containsKey("Radiance")) { + sb.append(" and each other ").append(af.getMapParams().get("ValidTgts")).append(" that shares a color with "); + if(tgtCards.size() > 1) { + sb.append("them"); + } + else { + sb.append("it"); + } + } if (noRegen) { sb.append(". "); diff --git a/src/main/java/forge/card/abilityFactory/AbilityFactory_PreventDamage.java b/src/main/java/forge/card/abilityFactory/AbilityFactory_PreventDamage.java index 430f7482a41..74549b2168e 100644 --- a/src/main/java/forge/card/abilityFactory/AbilityFactory_PreventDamage.java +++ b/src/main/java/forge/card/abilityFactory/AbilityFactory_PreventDamage.java @@ -159,6 +159,16 @@ public class AbilityFactory_PreventDamage { else sb.append(tgtC); } else sb.append(o.toString()); } + + if(af.getMapParams().containsKey("Radiance") && sa.getTarget() != null) { + sb.append(" and each other ").append(af.getMapParams().get("ValidTgts")).append(" that shares a color with "); + if(tgts.size() > 1) { + sb.append("them"); + } + else { + sb.append("it"); + } + } sb.append(" this turn."); Ability_Sub abSub = sa.getSubAbility(); @@ -373,10 +383,28 @@ public class AbilityFactory_PreventDamage { int numDam = AbilityFactory.calculateAmount(af.getHostCard(), params.get("Amount"), sa); ArrayList tgts; + ArrayList untargetedCards = new ArrayList(); if (sa.getTarget() == null) tgts = AbilityFactory.getDefinedObjects(sa.getSourceCard(), params.get("Defined"), sa); else tgts = sa.getTarget().getTargets(); + + if(params.containsKey("Radiance") && sa.getTarget() != null) { + Card origin = null; + for(int i = 0; i< tgts.size();i++) + { + if(tgts.get(i) instanceof Card) { + origin = (Card)tgts.get(i); + break; + } + } + if(origin != null) //Can't radiate from a player + { + for(Card c : CardUtil.getRadiance(af.getHostCard(), origin, params.get("ValidTgts").split(","))) { + untargetedCards.add(c); + } + } + } boolean targeted = (af.getAbTgt() != null); @@ -394,5 +422,11 @@ public class AbilityFactory_PreventDamage { } } } + + for(Card c : untargetedCards) { + if(AllZoneUtil.isCardInPlay(c)) { + c.addPreventNextDamage(numDam); + } + } }//doResolve } diff --git a/src/main/java/forge/card/abilityFactory/AbilityFactory_Protection.java b/src/main/java/forge/card/abilityFactory/AbilityFactory_Protection.java index c9fca57faaf..f3814d6aa66 100644 --- a/src/main/java/forge/card/abilityFactory/AbilityFactory_Protection.java +++ b/src/main/java/forge/card/abilityFactory/AbilityFactory_Protection.java @@ -552,6 +552,16 @@ public final class AbilityFactory_Protection { sb.append(", "); } } + + if(af.getMapParams().containsKey("Radiance") && sa.getTarget() != null) { + sb.append(" and each other ").append(af.getMapParams().get("ValidTgts")).append(" that shares a color with "); + if(tgtCards.size() > 1) { + sb.append("them"); + } + else { + sb.append("it"); + } + } sb.append(" gain"); if (tgtCards.size() == 1) { @@ -624,6 +634,7 @@ public final class AbilityFactory_Protection { } ArrayList tgtCards; + ArrayList untargetedCards = new ArrayList(); Target tgt = af.getAbTgt(); if (tgt != null) { tgtCards = tgt.getTargetCards(); @@ -631,6 +642,12 @@ public final class AbilityFactory_Protection { else { tgtCards = AbilityFactory.getDefinedCards(host, params.get("Defined"), sa); } + + if(params.containsKey("Radiance") && tgt != null) { + for(Card c : CardUtil.getRadiance(af.getHostCard(), tgtCards.get(0), params.get("ValidTgts").split(","))) { + untargetedCards.add(c); + } + } int size = tgtCards.size(); for (int j = 0; j < size; j++) { @@ -670,6 +687,37 @@ public final class AbilityFactory_Protection { } } } + + for(final Card unTgtC : untargetedCards) { + // only pump things in play + if (!AllZoneUtil.isCardInPlay(unTgtC)) { + continue; + } + + for (String gain : gains) { + unTgtC.addExtrinsicKeyword("Protection from " + gain); + } + + if (!params.containsKey("Permanent")) { + // If not Permanent, remove protection at EOT + final Command untilEOT = new Command() { + private static final long serialVersionUID = 7682700789217703789L; + + public void execute() { + if (AllZoneUtil.isCardInPlay(unTgtC)) { + for (String gain : gains) { + unTgtC.removeExtrinsicKeyword("Protection from " + gain); + } + } + } + }; + if (params.containsKey("UntilEndOfCombat")) { + AllZone.getEndOfCombat().addUntil(untilEOT); + } else { + AllZone.getEndOfTurn().addUntil(untilEOT); + } + } + } } //protectResolve() private static ArrayList getProtectionList(final Card host, final HashMap params) { diff --git a/src/main/java/forge/card/abilityFactory/AbilityFactory_Pump.java b/src/main/java/forge/card/abilityFactory/AbilityFactory_Pump.java index 6f0d019411b..50b529e5f26 100644 --- a/src/main/java/forge/card/abilityFactory/AbilityFactory_Pump.java +++ b/src/main/java/forge/card/abilityFactory/AbilityFactory_Pump.java @@ -657,6 +657,16 @@ public class AbilityFactory_Pump { for (Card c : tgtCards) sb.append(c.getName()).append(" "); + + if(af.getMapParams().containsKey("Radiance")) { + sb.append(" and each other ").append(af.getMapParams().get("ValidTgts")).append(" that shares a color with "); + if(tgtCards.size() > 1) { + sb.append("them "); + } + else { + sb.append("it "); + } + } final int atk = getNumAttack(sa); final int def = getNumDefense(sa);