1) fixed EndOfCombat.executeUntil() never being called

2) added a parameter to CardFactoryUtil.revertManland() for original cost
3) added Jade Statue (from original base Alpha)
This commit is contained in:
jendave
2011-08-06 07:17:58 +00:00
parent 99c2ef50bc
commit 29101769b4
8 changed files with 98 additions and 18 deletions

1
.gitattributes vendored
View File

@@ -1801,6 +1801,7 @@ res/cardsfolder/jackal_pup.txt -text svneol=native#text/plain
res/cardsfolder/jackalope_herd.txt -text svneol=native#text/plain res/cardsfolder/jackalope_herd.txt -text svneol=native#text/plain
res/cardsfolder/jacques_le_vert.txt -text svneol=native#text/plain res/cardsfolder/jacques_le_vert.txt -text svneol=native#text/plain
res/cardsfolder/jade_leech.txt -text svneol=native#text/plain res/cardsfolder/jade_leech.txt -text svneol=native#text/plain
res/cardsfolder/jade_statue.txt -text svneol=native#text/plain
res/cardsfolder/jagwasp_swarm.txt -text svneol=native#text/plain res/cardsfolder/jagwasp_swarm.txt -text svneol=native#text/plain
res/cardsfolder/jalum_tome.txt -text svneol=native#text/plain res/cardsfolder/jalum_tome.txt -text svneol=native#text/plain
res/cardsfolder/jamuraan_lion.txt -text svneol=native#text/plain res/cardsfolder/jamuraan_lion.txt -text svneol=native#text/plain

View File

@@ -0,0 +1,8 @@
Name:Jade Statue
ManaCost:4
Types:Artifact
Text:2: Jade Statue becomes a 3/6 Golem artifact creature until end of combat. Activate this ability only during combat.
K:SVar:RemAIDeck:True
K:SVar:Rarity:Rare
K:SVar:Picture:http://www.wizards.com/global/images/magic/general/jade_statue.jpg
End

View File

@@ -10106,6 +10106,61 @@ public class CardFactory implements NewConstants {
card.addSpellAbility(ability); card.addSpellAbility(ability);
}//*************** END ************ END ************************** }//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Jade Statue")) {
/*
* 2: Jade Statue becomes a 3/6 Golem artifact creature until
* end of combat. Activate this ability only during combat.
*/
final Command untilEOC = new Command() {
private static final long serialVersionUID = -8432597117196682284L;
public void execute() {
Card c = card;
String[] types = { "Creature", "Golem" };
String[] keywords = { };
CardFactoryUtil.revertManland(c, types, keywords, "4");
}
};
final SpellAbility a1 = new Ability(card, "2") {
@Override
public boolean canPlayAI() {
return false;
}
@Override
public boolean canPlay() {
return Phase.canPlayDuringCombat();
}
@Override
public void resolve() {
Card c = card;
String[] types = { "Creature", "Golem" };
String[] keywords = { };
CardFactoryUtil.activateManland(c, 3, 6, types, keywords, "4");
AllZone.EndOfCombat.addUntil(untilEOC);
}
};//SpellAbility
//card.clearSpellKeepManaAbility();
card.addSpellAbility(a1);
a1.setStackDescription(card + " becomes a 3/6 Golem creature until End of Combat");
Command paid1 = new Command() {
private static final long serialVersionUID = 1531378274457977155L;
public void execute() {
AllZone.Stack.add(a1);
}
};
a1.setBeforePayMana(new Input_PayManaCost_Ability(a1.getManaCost(), paid1));
}//*************** END ************ END **************************
// Cards with Cycling abilities // Cards with Cycling abilities
// -1 means keyword "Cycling" not found // -1 means keyword "Cycling" not found

View File

@@ -4428,7 +4428,7 @@ public class CardFactoryUtil {
} }
public static void revertManland(Card c, String[] removeTypes, String[] removeKeywords) { public static void revertManland(Card c, String[] removeTypes, String[] removeKeywords, String cost) {
c.setBaseAttack(0); c.setBaseAttack(0);
c.setBaseDefense(0); c.setBaseDefense(0);
for(String r : removeTypes) for(String r : removeTypes)
@@ -4437,7 +4437,7 @@ public class CardFactoryUtil {
for(String k : removeKeywords) for(String k : removeKeywords)
c.removeIntrinsicKeyword(k); c.removeIntrinsicKeyword(k);
c.setManaCost(""); c.setManaCost(cost);
c.unEquipAllCards(); c.unEquipAllCards();
} }

View File

@@ -520,7 +520,7 @@ class CardFactory_Lands {
Card c = card; Card c = card;
String[] types = { "Creature", "Faerie" }; String[] types = { "Creature", "Faerie" };
String[] keywords = { "Flying" }; String[] keywords = { "Flying" };
CardFactoryUtil.revertManland(c, types, keywords); CardFactoryUtil.revertManland(c, types, keywords, "");
} }
}; };
@@ -577,7 +577,7 @@ class CardFactory_Lands {
String[] types = { "Creature", "Soldier" }; String[] types = { "Creature", "Soldier" };
String[] keywords = { }; String[] keywords = { };
CardFactoryUtil.revertManland(c, types, keywords); CardFactoryUtil.revertManland(c, types, keywords, "");
} }
}; };
@@ -633,7 +633,7 @@ class CardFactory_Lands {
String[] removeTypes = { "Creature", "Ape" }; String[] removeTypes = { "Creature", "Ape" };
String[] removeKeywords = { "Trample" }; String[] removeKeywords = { "Trample" };
CardFactoryUtil.revertManland(c, removeTypes, removeKeywords); CardFactoryUtil.revertManland(c, removeTypes, removeKeywords, "");
} }
}; };
@@ -687,7 +687,7 @@ class CardFactory_Lands {
Card c = card; Card c = card;
String[] types = { "Artifact", "Creature", "Blinkmoth" }; String[] types = { "Artifact", "Creature", "Blinkmoth" };
String[] keywords = { "Flying" }; String[] keywords = { "Flying" };
CardFactoryUtil.revertManland(c, types, keywords); CardFactoryUtil.revertManland(c, types, keywords, "");
} }
}; };
@@ -854,7 +854,7 @@ class CardFactory_Lands {
String[] types = { "Artifact", "Creature", "Assembly-Worker" }; String[] types = { "Artifact", "Creature", "Assembly-Worker" };
String[] keywords = { }; String[] keywords = { };
CardFactoryUtil.revertManland(c, types, keywords); CardFactoryUtil.revertManland(c, types, keywords, "");
} }
}; };
@@ -2264,7 +2264,7 @@ class CardFactory_Lands {
String[] types = { "Creature" }; String[] types = { "Creature" };
String[] keywords = { "Changeling" }; String[] keywords = { "Changeling" };
CardFactoryUtil.revertManland(c, types, keywords); CardFactoryUtil.revertManland(c, types, keywords, "");
} }
}; };
@@ -2340,7 +2340,7 @@ class CardFactory_Lands {
Card c = card; Card c = card;
String[] types = { "Creature", "Skeleton" }; String[] types = { "Creature", "Skeleton" };
String[] keywords = { }; String[] keywords = { };
CardFactoryUtil.revertManland(c, types, keywords); CardFactoryUtil.revertManland(c, types, keywords, "");
c.removeSpellAbility(a2); c.removeSpellAbility(a2);
} }
}; };
@@ -2950,7 +2950,7 @@ class CardFactory_Lands {
String[] types = { "Creature", "Zombie", "Plant" }; String[] types = { "Creature", "Zombie", "Plant" };
String[] keywords = { }; String[] keywords = { };
CardFactoryUtil.revertManland(c, types, keywords); CardFactoryUtil.revertManland(c, types, keywords, "");
} }
}; };
@@ -2998,7 +2998,7 @@ class CardFactory_Lands {
String[] types = { "Creature", "Warrior" }; String[] types = { "Creature", "Warrior" };
String[] keywords = { "First Strike" }; String[] keywords = { "First Strike" };
CardFactoryUtil.revertManland(c, types, keywords); CardFactoryUtil.revertManland(c, types, keywords, "");
} }
}; };
@@ -3097,7 +3097,7 @@ class CardFactory_Lands {
Card c = card; Card c = card;
String[] types = { "Creature", "Elemental" }; String[] types = { "Creature", "Elemental" };
String[] keywords = { "Vigilance", "Flying" }; String[] keywords = { "Vigilance", "Flying" };
CardFactoryUtil.revertManland(c, types, keywords); CardFactoryUtil.revertManland(c, types, keywords, "");
} }
}; };
@@ -3188,7 +3188,7 @@ class CardFactory_Lands {
Card c = card; Card c = card;
String[] types = { "Creature", "Elemental" }; String[] types = { "Creature", "Elemental" };
String[] keywords = { }; String[] keywords = { };
CardFactoryUtil.revertManland(c, types, keywords); CardFactoryUtil.revertManland(c, types, keywords, "");
c.removeSpellAbility(X_ability); c.removeSpellAbility(X_ability);
} }
}; };
@@ -3241,7 +3241,7 @@ class CardFactory_Lands {
Card c = card; Card c = card;
String[] types = { "Creature", "Elemental" }; String[] types = { "Creature", "Elemental" };
String[] keywords = { "Reach" }; String[] keywords = { "Reach" };
CardFactoryUtil.revertManland(c, types, keywords); CardFactoryUtil.revertManland(c, types, keywords, "");
} }
}; };
@@ -3280,7 +3280,7 @@ class CardFactory_Lands {
Card c = card; Card c = card;
String[] types = { "Creature", "Elemental" }; String[] types = { "Creature", "Elemental" };
String[] keywords = { "Unblockable" }; String[] keywords = { "Unblockable" };
CardFactoryUtil.revertManland(c, types, keywords); CardFactoryUtil.revertManland(c, types, keywords, "");
} }
}; };
@@ -3319,7 +3319,7 @@ class CardFactory_Lands {
String[] types = { "Creature", "Elemental"}; String[] types = { "Creature", "Elemental"};
String[] keywords = { "Whenever this creature attacks, put a +1/+1 counter on it." }; String[] keywords = { "Whenever this creature attacks, put a +1/+1 counter on it." };
CardFactoryUtil.revertManland(c, types, keywords); CardFactoryUtil.revertManland(c, types, keywords, "");
} }
}; };
@@ -3361,7 +3361,7 @@ class CardFactory_Lands {
String[] types = { "Artifact", "Creature", "Golem"}; String[] types = { "Artifact", "Creature", "Golem"};
String[] keywords = { }; String[] keywords = { };
CardFactoryUtil.revertManland(c, types, keywords); CardFactoryUtil.revertManland(c, types, keywords, "");
} }
}; };

View File

@@ -1,7 +1,7 @@
package forge; package forge;
//import java.util.*; //import java.util.*;
//handles "until end of turn" and "at end of turn" commands from cards //handles "until end of combat" and "at end of combat" commands from cards
public class EndOfCombat implements java.io.Serializable public class EndOfCombat implements java.io.Serializable
{ {

View File

@@ -198,6 +198,7 @@ public class InputControl extends MyObservable implements java.io.Serializable {
} }
*/ */
else if(phase.equals(Constant.Phase.End_Of_Combat)) { else if(phase.equals(Constant.Phase.End_Of_Combat)) {
AllZone.EndOfCombat.executeUntil();
AllZone.EndOfCombat.executeAt(); AllZone.EndOfCombat.executeAt();
AllZone.Phase.setNeedToNextPhase(true); AllZone.Phase.setNeedToNextPhase(true);
appliedExaltedEffects = false; appliedExaltedEffects = false;

View File

@@ -440,4 +440,19 @@ public class Phase extends MyObservable
return ((AllZone.Phase.getPhase().equals(Constant.Phase.Main2) || (AllZone.Phase.getPhase().equals(Constant.Phase.Main1)) return ((AllZone.Phase.getPhase().equals(Constant.Phase.Main2) || (AllZone.Phase.getPhase().equals(Constant.Phase.Main1))
&& AllZone.GameAction.isPlayerTurn(player)) && AllZone.Stack.size() == 0); && AllZone.GameAction.isPlayerTurn(player)) && AllZone.Stack.size() == 0);
} }
public static boolean canPlayDuringCombat() {
String phase = AllZone.Phase.getPhase();
ArrayList<String> validPhases = new ArrayList<String>();
validPhases.add(Constant.Phase.Combat_Before_Declare_Attackers_InstantAbility);
validPhases.add(Constant.Phase.Combat_Declare_Attackers);
validPhases.add(Constant.Phase.Combat_Declare_Attackers_InstantAbility);
validPhases.add(Constant.Phase.Combat_Declare_Blockers);
validPhases.add(Constant.Phase.Combat_Declare_Blockers_InstantAbility);
validPhases.add(Constant.Phase.Combat_After_Declare_Blockers);
validPhases.add(Constant.Phase.Combat_FirstStrikeDamage);
validPhases.add(Constant.Phase.Combat_Damage);
return validPhases.contains(phase);
}
} }