mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- Added Fading keyword. Placed into postFactoryKeywords.
- Changed Blastoderm to use Fading keyword
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
Name:Blastoderm
|
||||
ManaCost:2 G G
|
||||
Types:Creature Beast
|
||||
Text:Fading 3
|
||||
Text:no text
|
||||
PT:5/5
|
||||
K:Shroud
|
||||
K:Fading:3
|
||||
SVar:Rarity:Common
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/blastoderm.jpg
|
||||
End
|
||||
|
||||
@@ -10419,6 +10419,21 @@ public class CardFactory implements NewConstants {
|
||||
|
||||
public Card postFactoryKeywords(Card card){
|
||||
// this function should handle any keywords that need to be added after a spell goes through the factory
|
||||
if(hasKeyword(card, "Fading") != -1) {
|
||||
int n = hasKeyword(card, "Fading");
|
||||
if(n != -1) {
|
||||
String parse = card.getKeyword().get(n).toString();
|
||||
card.removeIntrinsicKeyword(parse);
|
||||
|
||||
String k[] = parse.split(":");
|
||||
final int power = Integer.parseInt(k[1]);
|
||||
|
||||
|
||||
card.addComesIntoPlayCommand(CardFactoryUtil.fading(card, power));
|
||||
card.addSpellAbility(CardFactoryUtil.fading_desc(card, power));
|
||||
}
|
||||
}//Vanishing
|
||||
|
||||
if(hasKeyword(card, "Vanishing") != -1) {
|
||||
int n = hasKeyword(card, "Vanishing");
|
||||
if(n != -1) {
|
||||
|
||||
@@ -2176,6 +2176,44 @@ public class CardFactoryUtil {
|
||||
return addCounters;
|
||||
}
|
||||
|
||||
public static Command fading(final Card sourceCard, final int Power) {
|
||||
Command fade = new Command() {
|
||||
private static final long serialVersionUID = 431920157968451817L;
|
||||
public boolean firstTime = true;
|
||||
|
||||
public void execute() {
|
||||
|
||||
//testAndSet - only needed when comes into play.
|
||||
if(firstTime) {
|
||||
sourceCard.addCounter(Counters.FADE, Power);
|
||||
}
|
||||
firstTime = false;
|
||||
}
|
||||
};
|
||||
return fade;
|
||||
} // vanishing
|
||||
|
||||
public static SpellAbility fading_desc(final Card sourceCard, final int power) {
|
||||
final SpellAbility desc = new Ability_Hand(sourceCard, "0") {
|
||||
private static final long serialVersionUID = -4960704261761785512L;
|
||||
|
||||
@Override
|
||||
public boolean canPlay() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resolve() {}
|
||||
};
|
||||
// Be carefull changing this description cause it's crucial for ability to work (see GameActionUtil - vanishing for it)
|
||||
desc.setDescription("Fading "
|
||||
+ power
|
||||
+ " (This permanent enters the battlefield with "
|
||||
+ power
|
||||
+ " fade counters on it. At the beginning of your upkeep, remove a fade counter from it. If you can't, sacrifice it.)");
|
||||
return desc;
|
||||
}//vanish_desc()
|
||||
|
||||
public static Command vanishing(final Card sourceCard, final int Power) {
|
||||
Command age = new Command() {
|
||||
private static final long serialVersionUID = 431920157968451817L;
|
||||
|
||||
@@ -14799,27 +14799,6 @@ public class CardFactory_Creatures {
|
||||
card.addComesIntoPlayCommand(gain2Life);
|
||||
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if(cardName.equals("Blastoderm")) {
|
||||
Command fadeCounters = new Command() {
|
||||
private static final long serialVersionUID = -580691660706977218L;
|
||||
public boolean firstTime = true;
|
||||
|
||||
public void execute() {
|
||||
|
||||
//testAndSet - only needed when comes into play.
|
||||
if(firstTime) {
|
||||
card.addCounter(Counters.FADE, 3);
|
||||
}
|
||||
firstTime = false;
|
||||
}
|
||||
};
|
||||
|
||||
card.addComesIntoPlayCommand(fadeCounters);
|
||||
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if(cardName.equals("Godsire")) {
|
||||
|
||||
@@ -119,7 +119,7 @@ public class GameActionUtil {
|
||||
upkeep_Mycoloth();
|
||||
upkeep_Spore_Counters();
|
||||
upkeep_Vanishing();
|
||||
upkeep_Blastoderm();
|
||||
upkeep_Fading();
|
||||
upkeep_Masticore();
|
||||
upkeep_Eldrazi_Monument();
|
||||
upkeep_Blaze_Counters();
|
||||
@@ -7543,25 +7543,45 @@ public class GameActionUtil {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void upkeep_Fading() {
|
||||
|
||||
private static void upkeep_Blastoderm() {
|
||||
final String player = AllZone.Phase.getActivePlayer();
|
||||
PlayerZone playZone = AllZone.getZone(Constant.Zone.Play, player);
|
||||
CardList list = new CardList(playZone.getCards());
|
||||
list = list.getName("Blastoderm");
|
||||
list = list.filter(new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
SpellAbility[] sas = c.getSpellAbility();
|
||||
boolean isFading = false;
|
||||
for(SpellAbility sa:sas) {
|
||||
if(sa.toString().contains(
|
||||
"At the beginning of your upkeep, remove a fade counter from it. If you can't, sacrifice it.)")) //this is essentially ".getDescription()"
|
||||
isFading = true;
|
||||
}
|
||||
return isFading;
|
||||
}
|
||||
});
|
||||
if(list.size() > 0) {
|
||||
for(int i = 0; i < list.size(); i++) {
|
||||
Card card = list.get(i);
|
||||
if(card.getCounters(Counters.FADE) <= 0) {
|
||||
AllZone.GameAction.sacrifice(card);
|
||||
}
|
||||
card.setCounter(Counters.FADE, card.getCounters(Counters.FADE) - 1);
|
||||
final Card card = list.get(i);
|
||||
Ability ability = new Ability(card, "0") {
|
||||
@Override
|
||||
public void resolve() {
|
||||
int fadeCounters = card.getCounters(Counters.FADE);
|
||||
if (fadeCounters <= 0)
|
||||
AllZone.GameAction.sacrifice(card);
|
||||
else
|
||||
card.setCounter(Counters.FADE, fadeCounters - 1);
|
||||
}
|
||||
}; // ability
|
||||
ability.setStackDescription(card.getName()
|
||||
+ " - Fading - remove a fade counter from it. If you can't, sacrifice it.)");
|
||||
AllZone.Stack.add(ability);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static void upkeep_Defense_of_the_Heart() {
|
||||
final String player = AllZone.Phase.getActivePlayer();
|
||||
final String opponent = AllZone.GameAction.getOpponent(player);
|
||||
|
||||
Reference in New Issue
Block a user