mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
*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:
@@ -6201,6 +6201,15 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
|
||||
public final void setHaunting(final Card c) {
|
||||
haunting = c;
|
||||
}
|
||||
|
||||
public final int getDamageDoneThisTurn() {
|
||||
int sum = 0;
|
||||
for(Card c : dealtDamageToThisTurn.keySet()) {
|
||||
sum += dealtDamageToThisTurn.get(c);
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
} //end Card class
|
||||
|
||||
@@ -603,8 +603,25 @@ public class AbilityFactory_DealDamage {
|
||||
tgts = AbilityFactory.getDefinedObjects(saMe.getSourceCard(), params.get("Defined"), saMe);
|
||||
else
|
||||
tgts = saMe.getTarget().getTargets();
|
||||
|
||||
|
||||
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);
|
||||
|
||||
@@ -2930,6 +2930,10 @@ public class CardFactoryUtil {
|
||||
if (sq[0].equals("StormCount")) {
|
||||
return doXMath(Phase.getStormCount() - 1, m, c);
|
||||
}
|
||||
|
||||
if(sq[0].equals("DamageDoneThisTurn")) {
|
||||
return doXMath(c.getDamageDoneThisTurn(), m, c);
|
||||
}
|
||||
|
||||
CardList someCards = new CardList();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user