- Added Frostweb Spider ability and AEther Membrane ability.

This commit is contained in:
jendave
2011-08-06 03:02:18 +00:00
parent 5ce8ae9dc3
commit 387ab31e3b
15 changed files with 238 additions and 21 deletions

1
.gitattributes vendored
View File

@@ -174,6 +174,7 @@ src/forge/Input_Cleanup.java svneol=native#text/plain
src/forge/Input_CombatDamage.java svneol=native#text/plain
src/forge/Input_Draw.java svneol=native#text/plain
src/forge/Input_EOT.java svneol=native#text/plain
src/forge/Input_EndOfCombat.java -text svneol=native#text/plain
src/forge/Input_FirstStrikeDamage.java -text svneol=native#text/plain
src/forge/Input_Main.java svneol=native#text/plain
src/forge/Input_Mulligan.java svneol=native#text/plain

View File

@@ -18,6 +18,7 @@ forest.jpg http://resources.wizards.com/magic/cards/unh/en-us/card73946.jpg
forest1.jpg http://gatherer.wizards.com/handlers/image.ashx?type=card&multiverseid=2748
forest2.jpg http://gatherer.wizards.com/handlers/image.ashx?type=card&multiverseid=587
forest3.jpg http://gatherer.wizards.com/handlers/image.ashx?type=card&multiverseid=586
time_warp.jpg http://www.wizards.com/global/images/magic/general/time_warp.jpg
deadly_grub.jpg http://www.wizards.com/global/images/magic/general/deadly_grub.jpg
promised_kannushi.jpg http://www.wizards.com/global/images/magic/general/promised_kannushi.jpg
body_of_jukai.jpg http://www.wizards.com/global/images/magic/general/body_of_jukai.jpg
@@ -136,7 +137,7 @@ mortivore.jpg http://www.wizards.com/global/images/magic/general/m
dimir_cutpurse.jpg http://www.wizards.com/global/images/magic/general/dimir_cutpurse.jpg
molimo_maro_sorcerer.jpg http://www.wizards.com/global/images/magic/general/molimo_maro_sorcerer.jpg
maro.jpg http://www.wizards.com/global/images/magic/general/maro.jpg
multani_maro_sorcerer.jpg http://www.wizards.com/global/images/magic/general/multani_maro_sorcerer.jpg
multani_maro_sorcerer.jpg http://www.wizards.com/global/images/magic/general/multani_maro_morcerer.jpg
meddling_mage.jpg http://www.wizards.com/global/images/magic/general/meddling_mage.jpg
gravelgill_duo.jpg http://www.wizards.com/global/images/magic/general/gravelgill_duo.jpg
safehold_duo.jpg http://www.wizards.com/global/images/magic/general/safehold_duo.jpg

View File

@@ -1,3 +1,14 @@
Abomination
3 B B
Creature Horror
Whenever Abomination blocks or becomes blocked by a green or white creature, destroy that creature at end of combat.
2/6
Time Warp
3 U U
Sorcery
Target player takes an extra turn after this one.
Deadly Grub
2 B
Creature Insect
@@ -12339,10 +12350,10 @@ no text
Flying
Defender
Aether Membrane
AEther Membrane
1 R R
Creature Wall
(NOTE: "Whenever AEther Membrane blocks a creature, return that creature to its owner's hand at end of combat." not implemented.)
Whenever AEther Membrane blocks a creature, return that creature to its owner's hand at end of combat.
0/5
Defender
This creature can block as though it had flying.
@@ -13858,6 +13869,13 @@ Radiant, Archangel gets +1/+1 for each creature with flying in play.
Flying
Vigilance
Torii Watchward
4 W
Creature Spirit
(NOTE: "Soulshift" not implemented.)
3/3
Vigilance
Veteran Armorer
1 W
Creature Human Soldier
@@ -14197,7 +14215,7 @@ no text
Frostweb Spider
2 G
Snow Creature Spider
(NOTE: "Whenever Frostweb Spider blocks a creature with flying, put a +1/+1 counter on Frostweb Spider at end of combat." not implemented.)
Whenever Frostweb Spider blocks a creature with flying, put a +1/+1 counter on Frostweb Spider at end of combat.
1/3
This creature can block as though it had flying.

View File

@@ -17131,7 +17131,7 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase();
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if (cardName.equals("Time Stretch"))
else if (cardName.equals("Time Stretch") || cardName.equals("Time Warp"))
{
final SpellAbility spell = new Spell(card)
{
@@ -17139,6 +17139,7 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase();
public void resolve() {
AllZone.Phase.addExtraTurn(getTargetPlayer());
if (cardName.equals("Time Stretch"));
AllZone.Phase.addExtraTurn(getTargetPlayer());
}
};

View File

@@ -1535,6 +1535,121 @@ public class CombatUtil
a.untap();
}
if (b.getName().equals("Frostweb Spider") && (a.getKeyword().contains("Flying")) )
{
final Card spider = b;
final Ability ability = new Ability(b, "0")
{
public void resolve()
{
spider.addCounter(Counters.P1P1, 1);
}
};
ability.setStackDescription(spider + " - gets a +1/+1 counter.");
final Command atEOC = new Command()
{
private static final long serialVersionUID = 6617320324660612694L;
public void execute()
{
if (AllZone.GameAction.isCardInPlay(spider))
AllZone.Stack.add(ability);
}
};
AllZone.EndOfCombat.addAt(atEOC);
}//Frostweb Spider
else if (b.getName().equals("Abomination") &&
(CardUtil.getColors(a).contains(Constant.Color.White) || CardUtil.getColors(a).contains(Constant.Color.Green)) )
{
final Card attacker = a;
final Ability ability = new Ability(b, "0")
{
public void resolve()
{
if (AllZone.GameAction.isCardInPlay(attacker))
{
AllZone.GameAction.destroy(attacker);
}
}
};
ability.setStackDescription(b + " - destroy blocked green or white creature.");
final Command atEOC = new Command()
{
private static final long serialVersionUID = 5854485314766349980L;
public void execute()
{
AllZone.Stack.add(ability);
}
};
AllZone.EndOfCombat.addAt(atEOC);
}
if (a.getName().equals("Abomination") &&
(CardUtil.getColors(b).contains(Constant.Color.White) || CardUtil.getColors(b).contains(Constant.Color.Green)) )
{
final Card blocker = b;
final Ability ability = new Ability(a, "0")
{
public void resolve()
{
AllZone.GameAction.destroy(blocker);
}
};
ability.setStackDescription(b + " - destroy blocking green or white creature.");
final Command atEOC = new Command()
{
private static final long serialVersionUID = -9077416427198135373L;
public void execute()
{
if (AllZone.GameAction.isCardInPlay(blocker))
AllZone.Stack.add(ability);
}
};
AllZone.EndOfCombat.addAt(atEOC);
}
else if (b.getName().equals("AEther Membrane") )
{
final Card attacker = a;
final Ability ability = new Ability(b, "0")
{
public void resolve()
{
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, attacker.getOwner());
AllZone.GameAction.moveTo(hand, attacker);
}
};
ability.setStackDescription(b + " - return blocked creature to owner's hand.");
final Command atEOC = new Command()
{
private static final long serialVersionUID = 5263273480814811314L;
public void execute()
{
if (AllZone.GameAction.isCardInPlay(attacker))
AllZone.Stack.add(ability);
}
};
AllZone.EndOfCombat.addAt(atEOC);
}
a.setCreatureGotBlockedThisTurn(true);
}
}//Class CombatUtil

View File

@@ -9,6 +9,7 @@ public interface Computer
public void declare_attackers();
public void declare_blockers();//this is called after when the Human or Computer blocks
public void declare_blockers_after();//can play Instants and Abilities
public void end_of_combat();
public void main2();
public void end_of_turn();//end of Human's turn

View File

@@ -88,6 +88,11 @@ public class ComputerAI_Burn implements Computer {
AllZone.Phase.setNeedToNextPhase(true);
}
public void end_of_combat()
{
AllZone.Phase.setNeedToNextPhase(true);
}
//end of Human's turn
public void end_of_turn() {
//AllZone.Phase.nextPhase();

View File

@@ -127,6 +127,11 @@ public class ComputerAI_Burn2 implements Computer {
AllZone.Phase.setNeedToNextPhase(true);
}
public void end_of_combat()
{
AllZone.Phase.setNeedToNextPhase(true);
}
//end of Human's turn
public void end_of_turn() {
//AllZone.Phase.nextPhase();

View File

@@ -287,6 +287,11 @@ public class ComputerAI_General implements Computer {
AllZone.Phase.setNeedToNextPhase(true);
}
public void end_of_combat()
{
AllZone.Phase.setNeedToNextPhase(true);
}
//end of Human's turn
public void end_of_turn() {
//AllZone.Phase.nextPhase();

View File

@@ -122,6 +122,12 @@ public class ComputerAI_Rats2 implements Computer
}//getLibrary()
public void declare_blockers_after(){playInstantAndAbilities();}
public void end_of_combat()
{
AllZone.Phase.setNeedToNextPhase(true);
}
public void end_of_turn() {playInstantAndAbilities();}
private void playInstantAndAbilities()

View File

@@ -46,6 +46,12 @@ public class ComputerAI_Testing implements Computer
AllZone.Phase.setNeedToNextPhase(true);
}
public void end_of_combat()
{
AllZone.Phase.setNeedToNextPhase(true);
}
public void main2(){
//AllZone.Phase.nextPhase();
@@ -53,6 +59,7 @@ public class ComputerAI_Testing implements Computer
AllZone.Phase.setNeedToNextPhase(true);
}
//end of Human's turn
public void end_of_turn(){
//AllZone.Phase.nextPhase();

View File

@@ -68,7 +68,7 @@ public interface Constant {
public static final String Combat_Declare_Blockers_InstantAbility = "Declare Blockers - Play Instants and Abilities";
public static final String Combat_Damage = "Combat Damage";
public static final String Combat_FirstStrikeDamage = "First Strike Damage";
//public static final String End_Combat = "End of Combat";
public static final String End_Of_Combat = "End of Combat";
public static final String Main2 = "Main2";
public static final String At_End_Of_Turn = "At End of Turn";
public static final String End_Of_Turn = "End of Turn";

View File

@@ -141,6 +141,24 @@ package forge;
return null;
}
}
/*
else if (phase.equals(Constant.Phase.End_Of_Combat))
{
if (! skipPhase())
return new Input_EndOfCombat();
else
{
AllZone.Phase.setNeedToNextPhase(true);
}
return null;
}
*/
else if (phase.equals(Constant.Phase.End_Of_Combat))
{
AllZone.EndOfCombat.executeAt();
AllZone.Phase.setNeedToNextPhase(true);
return null;
}
else if(phase.equals(Constant.Phase.At_End_Of_Turn))
{
AllZone.EndOfTurn.executeAt();
@@ -158,7 +176,6 @@ package forge;
return new Input_EOT();
else
{
//AllZone.Phase.nextPhase();
//for debugging: System.out.println("need to nextPhase(InputControl.getInput(),phase.equals(End_Of_Turn)) = true");
AllZone.Phase.setNeedToNextPhase(true);

View File

@@ -0,0 +1,33 @@
package forge;
//currently not used
public class Input_EndOfCombat extends Input
{
private static final long serialVersionUID = 1144173890819650789L;
public void showMessage()
{
updateGUI();
ButtonUtil.enableOnlyOK();
//String phase = AllZone.Phase.getPhase(); // unused
//String player = AllZone.Phase.getActivePlayer(); // unused
AllZone.Display.showMessage("End of Combat - Play Instants and Abilities");
}
public void selectButtonOK()
{
updateGUI();
//AllZone.Phase.nextPhase();
//for debugging: System.out.println("need to nextPhase(Input_EOT.selectButtonOK) = true; note, this has not been tested, did it work?");
AllZone.Phase.setNeedToNextPhase(true);
}
public void selectCard(Card card, PlayerZone zone)
{
InputUtil.playInstantAbility(card, zone);
}//selectCard()
private void updateGUI()
{
AllZone.Computer_Play.updateObservers();
AllZone.Human_Play.updateObservers();
AllZone.Human_Hand.updateObservers();
}
}

View File

@@ -22,6 +22,7 @@ public class Phase extends MyObservable
{Constant.Player.Computer , Constant.Phase.Combat_Declare_Blockers_InstantAbility} ,
{Constant.Player.Human , Constant.Phase.Combat_FirstStrikeDamage} , //TODO: need to allow computer to have priority (play instants and abilities).
{Constant.Player.Human , Constant.Phase.Combat_Damage} ,
{Constant.Player.Human , Constant.Phase.End_Of_Combat} ,
{Constant.Player.Human , Constant.Phase.Main2} ,
{Constant.Player.Human , Constant.Phase.At_End_Of_Turn} ,
// {Constant.Player.Computer , Constant.Phase.End_Of_Turn} ,
@@ -40,6 +41,7 @@ public class Phase extends MyObservable
{Constant.Player.Human , Constant.Phase.Combat_Declare_Blockers_InstantAbility} ,
{Constant.Player.Human , Constant.Phase.Combat_FirstStrikeDamage} , //TODO: need to allow computer to have priority (play instants and abilities).
{Constant.Player.Human , Constant.Phase.Combat_Damage} ,
{Constant.Player.Human , Constant.Phase.End_Of_Combat} ,
{Constant.Player.Computer , Constant.Phase.Main2} ,
{Constant.Player.Computer , Constant.Phase.At_End_Of_Turn} ,
{Constant.Player.Human , Constant.Phase.End_Of_Turn} ,