*Added Radiance parameter to AF_PreventDamage & AF_Protection.

*Added StackDescription handling of Radiance for all affected AFs (DealDamage,Destroy,PreventDamage,Protection & Pump)
*Added
	Bathe in Light
	Wojek Apothecary
This commit is contained in:
Hellfish
2011-09-22 11:42:11 +00:00
parent a72a258508
commit 44c5f1188d
8 changed files with 127 additions and 0 deletions

2
.gitattributes vendored
View File

@@ -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/bash_to_bits.txt svneol=native#text/plain
res/cardsfolder/b/basilisk_collar.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/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/baton_of_courage.txt svneol=native#text/plain
res/cardsfolder/b/battered_golem.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 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/wizards_school.txt svneol=native#text/plain
res/cardsfolder/w/wizened_cenn.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/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_embermage.txt svneol=native#text/plain
res/cardsfolder/w/wojek_siren.txt -text res/cardsfolder/w/wojek_siren.txt -text
res/cardsfolder/w/wolf_skull_shaman.txt svneol=native#text/plain res/cardsfolder/w/wolf_skull_shaman.txt svneol=native#text/plain

View File

@@ -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

View File

@@ -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

View File

@@ -182,6 +182,16 @@ public class AbilityFactory_DealDamage {
if (o instanceof Card || o instanceof Player) if (o instanceof Card || o instanceof Player)
sb.append(o.toString()); 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(". "); sb.append(". ");

View File

@@ -357,6 +357,16 @@ public class AbilityFactory_Destroy {
if (it.hasNext()) sb.append(", "); 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) { if (noRegen) {
sb.append(". "); sb.append(". ");

View File

@@ -159,6 +159,16 @@ public class AbilityFactory_PreventDamage {
else sb.append(tgtC); else sb.append(tgtC);
} else sb.append(o.toString()); } 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."); sb.append(" this turn.");
Ability_Sub abSub = sa.getSubAbility(); Ability_Sub abSub = sa.getSubAbility();
@@ -373,10 +383,28 @@ public class AbilityFactory_PreventDamage {
int numDam = AbilityFactory.calculateAmount(af.getHostCard(), params.get("Amount"), sa); int numDam = AbilityFactory.calculateAmount(af.getHostCard(), params.get("Amount"), sa);
ArrayList<Object> tgts; ArrayList<Object> tgts;
ArrayList<Card> untargetedCards = new ArrayList<Card>();
if (sa.getTarget() == null) if (sa.getTarget() == null)
tgts = AbilityFactory.getDefinedObjects(sa.getSourceCard(), params.get("Defined"), sa); tgts = AbilityFactory.getDefinedObjects(sa.getSourceCard(), params.get("Defined"), sa);
else else
tgts = sa.getTarget().getTargets(); 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); 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 }//doResolve
} }

View File

@@ -552,6 +552,16 @@ public final class AbilityFactory_Protection {
sb.append(", "); 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"); sb.append(" gain");
if (tgtCards.size() == 1) { if (tgtCards.size() == 1) {
@@ -624,6 +634,7 @@ public final class AbilityFactory_Protection {
} }
ArrayList<Card> tgtCards; ArrayList<Card> tgtCards;
ArrayList<Card> untargetedCards = new ArrayList<Card>();
Target tgt = af.getAbTgt(); Target tgt = af.getAbTgt();
if (tgt != null) { if (tgt != null) {
tgtCards = tgt.getTargetCards(); tgtCards = tgt.getTargetCards();
@@ -631,6 +642,12 @@ public final class AbilityFactory_Protection {
else { else {
tgtCards = AbilityFactory.getDefinedCards(host, params.get("Defined"), sa); 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(); int size = tgtCards.size();
for (int j = 0; j < size; j++) { 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() } //protectResolve()
private static ArrayList<String> getProtectionList(final Card host, final HashMap<String, String> params) { private static ArrayList<String> getProtectionList(final Card host, final HashMap<String, String> params) {

View File

@@ -657,6 +657,16 @@ public class AbilityFactory_Pump {
for (Card c : tgtCards) for (Card c : tgtCards)
sb.append(c.getName()).append(" "); 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 atk = getNumAttack(sa);
final int def = getNumDefense(sa); final int def = getNumDefense(sa);