*Added initial Radiance parameter to AF_DealDamage.

*Converted Wojek Embermage to script.
*Converted Cleansing Beam to Radiance parameter.
*Fixed one of the Haunt triggers, previously it would bug the AIs ETB trigger evaluation.
*Added Count$DamageDoneThisTurn
*Added Brightflame
This commit is contained in:
Hellfish
2011-09-21 14:19:09 +00:00
parent 920f8fc593
commit 98aefb5a6b
8 changed files with 45 additions and 63 deletions

1
.gitattributes vendored
View File

@@ -964,6 +964,7 @@ res/cardsfolder/b/briarhorn.txt svneol=native#text/plain
res/cardsfolder/b/briarknit_kami.txt svneol=native#text/plain
res/cardsfolder/b/bribery.txt svneol=native#text/plain
res/cardsfolder/b/bridge_from_below.txt svneol=native#text/plain
res/cardsfolder/b/brightflame.txt -text
res/cardsfolder/b/brighthearth_banneret.txt svneol=native#text/plain
res/cardsfolder/b/brightstone_ritual.txt svneol=native#text/plain
res/cardsfolder/b/brilliant_halo.txt svneol=native#text/plain

View File

@@ -0,0 +1,9 @@
Name:Brightflame
ManaCost:X R R W W
Types:Sorcery
Text:no text
A:SP$DealDamage | Cost$ X R R W W | ValidTgts$ Creature | Radiance$ True | NumDmg$ X | SubAbility$ DBGainLife | SpellDescription$ Radiance - Brightflame deals X damage to target creature and each other creature that shares a color with it. You gain life equal to the damage dealt this way.
SVar:DBGainLife:DB$GainLife | Defined$ You | LifeAmount$ Y
SVar:X:Count$xPaid
SVar:Y:Count$DamageDoneThisTurn
End

View File

@@ -2,9 +2,7 @@ Name:Cleansing Beam
ManaCost:4 R
Types:Instant
Text:no text
A:SP$ DealDamage | Cost$ 4 R | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumDmg$ 2 | SubAbility$ SVar=DBDamageAll | RememberTargets$ True | ForgetOtherTargets$ True | SpellDescription$ Radiance - CARDNAME deals 2 damage to target creature and each other creature that shares a color with it.
SVar:DBDamageAll:DB$DamageAll | NumDmg$ 2 | ValidCards$ Remembered.Creature+Other+SharesColorWith | SubAbility$ DBCleanup
SVar:DBCleanup:DB$Cleanup | ClearRemembered$ True
A:SP$ DealDamage | Cost$ 4 R | ValidTgts$ Creature | Radiance$ True | TgtPrompt$ Select target creature | NumDmg$ 2 | SpellDescription$ Radiance - CARDNAME deals 2 damage to target creature and each other creature that shares a color with it.
SVar:RemAIDeck:True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/cleansing_beam.jpg

View File

@@ -3,6 +3,7 @@ ManaCost:3 R
Types:Creature Human Wizard
Text:no text
PT:1/2
A:AB$DealDamage | Cost$ T | ValidTgts$ Creature | Radiance$ True | PreCostDesc$ Radiance - | NumDmg$ 1 | SpellDescription$ CARDNAME deals 1 damage to target creature and each other creature that shares a color with it.
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/wojek_embermage.jpg
SetInfo:RAV|Uncommon|http://magiccards.info/scans/en/rav/152.jpg

View File

@@ -6203,4 +6203,13 @@ public class Card extends GameEntity implements Comparable<Card> {
haunting = c;
}
public final int getDamageDoneThisTurn() {
int sum = 0;
for(Card c : dealtDamageToThisTurn.keySet()) {
sum += dealtDamageToThisTurn.get(c);
}
return sum;
}
} //end Card class

View File

@@ -606,6 +606,23 @@ public class AbilityFactory_DealDamage {
boolean targeted = (AF.getAbTgt() != null);
if(params.containsKey("Radiance") && targeted) {
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(","))) {
tgts.add(c);
}
}
}
ArrayList<Card> definedSources = AbilityFactory.getDefinedCards(saMe.getSourceCard(), params.get("DamageSource"), saMe);
Card source = definedSources.get(0);

View File

@@ -2931,6 +2931,10 @@ public class CardFactoryUtil {
return doXMath(Phase.getStormCount() - 1, m, c);
}
if(sq[0].equals("DamageDoneThisTurn")) {
return doXMath(c.getDamageDoneThisTurn(), m, c);
}
CardList someCards = new CardList();
// Complex counting methods
@@ -4791,7 +4795,7 @@ public class CardFactoryUtil {
card.getKeyword().remove(hauntPos);
//First, create trigger that runs when the haunter dies (if it's a creature)
//First, create trigger that runs when the haunter goes to the graveyard
Trigger haunterDies = forge.card.trigger.TriggerHandler.parseTrigger("Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Static$ True | Secondary$ True | TriggerDescription$ Blank", card, true);
final Ability haunterDies_Work = new Ability(card,"0") {
@@ -4871,7 +4875,7 @@ public class CardFactoryUtil {
Trigger haunterETB = forge.card.trigger.TriggerHandler.parseTrigger("Mode$ ChangesZone | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ " + hauntSVarName + " | Secondary$ True | TriggerDescription$ " + hauntDescription, card, true);
//Fourth, create a trigger that removes the haunting status if the haunter leaves the exile
Trigger haunterUnExiled = forge.card.trigger.TriggerHandler.parseTrigger("Mode$ ChangesZone | Origin$ Exile | ValidCard$ Card.Self | Static$ True | Secondary$ True | TriggerDescription$ Blank", card, true);
Trigger haunterUnExiled = forge.card.trigger.TriggerHandler.parseTrigger("Mode$ ChangesZone | Origin$ Exile | Destination$ Any | ValidCard$ Card.Self | Static$ True | Secondary$ True | TriggerDescription$ Blank", card, true);
Ability haunterUnExiled_Work = new Ability(card,"0") {
@Override

View File

@@ -686,63 +686,6 @@ public class CardFactory_Creatures {
card.addComesIntoPlayCommand(comesIntoPlay);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if (cardName.equals("Wojek Embermage")) {
Cost abCost = new Cost("T", cardName, true);
Target tgt = new Target(card, "TgtC");
final Ability_Activated ability = new Ability_Activated(card, abCost, tgt) {
private static final long serialVersionUID = -1208482961653326721L;
@Override
public boolean canPlayAI() {
return (CardFactoryUtil.AI_getHumanCreature(1, card, true).size() != 0)
&& (AllZone.getPhase().getPhase().equals(Constant.Phase.Main2));
}
@Override
public void chooseTargetAI() {
CardList list = CardFactoryUtil.AI_getHumanCreature(1, card, true);
list.shuffle();
setTargetCard(list.get(0));
}
@Override
public void resolve() {
if (AllZoneUtil.isCardInPlay(getTargetCard())
&& CardFactoryUtil.canTarget(card, getTargetCard())) {
CardList list = getRadiance(getTargetCard());
for (int i = 0; i < list.size(); i++) {
list.get(i).addDamage(1, card);
}
}
}//resolve()
//parameter Card c, is included in CardList
//no multi-colored cards
CardList getRadiance(Card c) {
if (CardUtil.getColors(c).contains(Constant.Color.Colorless)) {
CardList list = new CardList();
list.add(c);
return list;
}
CardList sameColor = new CardList();
CardList list = AllZoneUtil.getCreaturesInPlay();
for (int i = 0; i < list.size(); i++)
if (list.get(i).sharesColorWith(c)) sameColor.add(list.get(i));
return sameColor;
}
};//SpellAbility
card.addSpellAbility(ability);
ability.setDescription("Radiance - " + abCost + cardName + " deals 1 damage to target creature and each other creature that shares a color with it.");
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if (cardName.equals("Adarkar Valkyrie")) {
//tap ability - no cost - target creature - EOT