diff --git a/res/cards.txt b/res/cards.txt index 5ef96758da0..b36295ca51c 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,10 @@ +Perimeter Captain +W +Creature Human Soldier +Whenever a creature you control with defender blocks, you may gain 2 life. +0/4 +Defender + Sejiri Merfolk 1 U Creature Merfolk Soldier diff --git a/res/gui/display_layout.xml b/res/gui/display_layout.xml index e7a99bc4d89..edc0904de3d 100644 --- a/res/gui/display_layout.xml +++ b/res/gui/display_layout.xml @@ -1,12 +1,12 @@ - + 0 0 - 1280 - 707 + 1440 + 827 @@ -17,7 +17,7 @@ 0 0 276 - 707 + 827 @@ -28,7 +28,7 @@ 0 0 276 - 135 + 151 @@ -47,7 +47,7 @@ 0 - 135 + 151 276 10 @@ -62,9 +62,9 @@ 0 - 145 + 161 276 - 132 + 166 @@ -83,7 +83,7 @@ 0 - 277 + 327 276 10 @@ -98,9 +98,9 @@ 0 - 287 + 337 276 - 107 + 125 @@ -119,7 +119,7 @@ 0 - 394 + 462 276 10 @@ -134,9 +134,9 @@ 0 - 404 + 472 276 - 141 + 159 @@ -155,7 +155,7 @@ 0 - 545 + 631 276 10 @@ -170,9 +170,9 @@ 0 - 555 + 641 276 - 152 + 186 @@ -205,7 +205,7 @@ 276 0 10 - 707 + 827 @@ -219,8 +219,8 @@ 286 0 - 747 - 707 + 803 + 827 @@ -230,8 +230,8 @@ 286 0 - 747 - 124 + 803 + 148 @@ -250,8 +250,8 @@ 286 - 124 - 747 + 148 + 803 10 @@ -265,9 +265,9 @@ 286 - 134 - 747 - 121 + 158 + 803 + 145 @@ -286,8 +286,8 @@ 286 - 255 - 747 + 303 + 803 10 @@ -301,9 +301,9 @@ 286 - 265 - 747 - 162 + 313 + 803 + 174 @@ -322,8 +322,8 @@ 286 - 427 - 747 + 487 + 803 10 @@ -337,9 +337,9 @@ 286 - 437 - 747 - 122 + 497 + 803 + 158 @@ -358,8 +358,8 @@ 286 - 559 - 747 + 655 + 803 10 @@ -373,9 +373,9 @@ 286 - 569 - 747 - 138 + 665 + 803 + 162 @@ -408,10 +408,10 @@ - 1033 + 1089 0 10 - 707 + 827 @@ -423,10 +423,10 @@ - 1043 + 1099 0 - 237 - 707 + 341 + 827 @@ -434,10 +434,10 @@ - 1043 + 1099 0 - 237 - 368 + 341 + 360 @@ -455,9 +455,9 @@ - 1043 - 368 - 237 + 1099 + 360 + 341 10 @@ -470,10 +470,10 @@ - 1043 - 378 - 237 - 329 + 1099 + 370 + 341 + 457 diff --git a/res/pics_link/card-pictures_other.txt b/res/pics_link/card-pictures_other.txt index b56bfc446a9..9374a9ce59d 100644 --- a/res/pics_link/card-pictures_other.txt +++ b/res/pics_link/card-pictures_other.txt @@ -39,4 +39,20 @@ snow_covered_swamp1.jpg http://[server]/CS/Snow-Covered%20Swamp.full.jpg snow_covered_swamp2.jpg http://[server]/IA/Snow-Covered%20Swamp.full.jpg snow_covered_swamp3.jpg http://[server]/IA/Snow-Covered%20Swamp.full.jpg _____.jpg http://[server]/UNH/_____.full.jpg +snow_covered_forest1.jpg http://[server]/CS/Snow-Covered%20Forest.full.jpg +snow_covered_forest2.jpg http://[server]/CS/Snow-Covered%20Forest.full.jpg +snow_covered_forest3.jpg http://[server]/CS/Snow-Covered%20Forest.full.jpg +snow_covered_island1.jpg http://[server]/CS/Snow-Covered%20Island.full.jpg +snow_covered_island2.jpg http://[server]/CS/Snow-Covered%20Island.full.jpg +snow_covered_island3.jpg http://[server]/CS/Snow-Covered%20Island.full.jpg +snow_covered_mountain1.jpg http://[server]/CS/Snow-Covered%20Mountain.full.jpg +snow_covered_mountain2.jpg http://[server]/CS/Snow-Covered%20Mountain.full.jpg +snow_covered_mountain3.jpg http://[server]/CS/Snow-Covered%20Mountain.full.jpg +snow_covered_plains1.jpg http://[server]/CS/Snow-Covered%20Plains.full.jpg +snow_covered_plains2.jpg http://[server]/CS/Snow-Covered%20Plains.full.jpg +snow_covered_plains3.jpg http://[server]/CS/Snow-Covered%20Plains.full.jpg +snow_covered_swamp1.jpg http://[server]/CS/Snow-Covered%20Swamp.full.jpg +snow_covered_swamp2.jpg http://[server]/CS/Snow-Covered%20Swamp.full.jpg +snow_covered_swamp3.jpg http://[server]/CS/Snow-Covered%20Swamp.full.jpg +snow_devil.jpg http://[server]/IA/Snow%20Devil.full.jpg 1996_world_champion.jpg http://[server]/PR/1996%20World%20Champion.full.jpg diff --git a/res/quest/questData b/res/quest/questData index d102644935b..f59b05313b5 100644 Binary files a/res/quest/questData and b/res/quest/questData differ diff --git a/src/forge/CardFactoryUtil.java b/src/forge/CardFactoryUtil.java index 82eaba888a7..0db81365d32 100644 --- a/src/forge/CardFactoryUtil.java +++ b/src/forge/CardFactoryUtil.java @@ -3122,6 +3122,8 @@ public class CardFactoryUtil { c.unEquipAllCards(); } */ + + //may return null static public Card getRandomCard(CardList list) { if(list.size() == 0) return null; diff --git a/src/forge/CombatUtil.java b/src/forge/CombatUtil.java index d4cd9791629..52b9fc9883b 100644 --- a/src/forge/CombatUtil.java +++ b/src/forge/CombatUtil.java @@ -1449,64 +1449,87 @@ public class CombatUtil { } - static void checkDeclareBlockers(Card c) { + static void checkDeclareBlockers(CardList cl) { if(AllZone.Phase.getPhase().equals(Constant.Phase.Combat_After_Declare_Blockers)) { - if(c.getName().equals("Jedit Ojanen of Efrava") && !c.getCreatureBlockedThisTurn()) { - Card card = new Card(); - - card.setOwner(c.getController()); - card.setController(c.getController()); - - card.setName("Cat Warrior"); - card.setImageName("G 2 2 Cat Warrior"); - card.setManaCost("G"); - card.setToken(true); - card.addIntrinsicKeyword("Forestwalk"); - - card.addType("Creature"); - card.addType("Cat"); - card.addType("Warrior"); - card.setBaseAttack(2); - card.setBaseDefense(2); - - PlayerZone play = AllZone.getZone(Constant.Zone.Play, c.getController()); - play.add(card); - - //(anger) : - GameActionUtil.executeCardStateEffects(); - - c.setCreatureBlockedThisTurn(true); - - - }//Jedit - else if(c.getName().equals("Shield Sphere") && !c.getCreatureBlockedThisTurn()) { - //int toughness = c.getNetDefense(); - //c.setDefense(toughness-1); - c.addCounter(Counters.P0M1, 1); - - c.setCreatureBlockedThisTurn(true); - - //ability2.setStackDescription(c.getName() + " blocks and gets a 0/-1 counter."); - //AllZone.Stack.add(ability2); - - }//Shield Sphere + for (Card c:cl) + { + if (c.getKeyword().contains("Defender") && !c.getCreatureBlockedThisTurn()) + { + final Card crd = c; + CardList pcs = CardFactoryUtil.getCards("Perimeter Captain", c.getController()); + for (int i = 0; i < pcs.size();i++) + { + Ability ability = new Ability(pcs.get(i), "0") + { + public void resolve() + { + AllZone.GameAction.addLife(crd.getController(), 2); + } + }; + ability.setStackDescription(pcs.get(i) + " - " + c.getController() + " gains 2 life."); + + if (c.getController().equals(Constant.Player.Human)) { + String[] choices = {"Yes", "No"}; + Object q = null; + q = AllZone.Display.getChoiceOptional("Gain 2 life from Perimeter Captain?", choices); + if (q != null) + if (q.equals("Yes")) + AllZone.Stack.add(ability); + } + else + AllZone.Stack.add(ability); + } + } + + if(c.getName().equals("Jedit Ojanen of Efrava") && !c.getCreatureBlockedThisTurn()) { + Card card = new Card(); + + card.setOwner(c.getController()); + card.setController(c.getController()); + + card.setName("Cat Warrior"); + card.setImageName("G 2 2 Cat Warrior"); + card.setManaCost("G"); + card.setToken(true); + card.addIntrinsicKeyword("Forestwalk"); + + card.addType("Creature"); + card.addType("Cat"); + card.addType("Warrior"); + card.setBaseAttack(2); + card.setBaseDefense(2); + + PlayerZone play = AllZone.getZone(Constant.Zone.Play, c.getController()); + play.add(card); + + //(anger) : + GameActionUtil.executeCardStateEffects(); + }//Jedit + else if(c.getName().equals("Shield Sphere") && !c.getCreatureBlockedThisTurn()) { + //int toughness = c.getNetDefense(); + //c.setDefense(toughness-1); + c.addCounter(Counters.P0M1, 1); + //ability2.setStackDescription(c.getName() + " blocks and gets a 0/-1 counter."); + //AllZone.Stack.add(ability2); + + }//Shield Sphere + + else if(c.getName().equals("Meglonoth") && !c.getCreatureBlockedThisTurn()) { + PlayerLife oppLife = AllZone.GameAction.getPlayerLife(AllZone.GameAction.getOpponent(c.getController())); + oppLife.subtractLife(c.getNetAttack()); + + //ability2.setStackDescription(c.getName() + " blocks and deals damage equal to its power to attacking player."); + //AllZone.Stack.add(ability2); + + }//Shield Sphere + c.setCreatureBlockedThisTurn(true); + }//for - else if(c.getName().equals("Meglonoth") && !c.getCreatureBlockedThisTurn()) { - PlayerLife oppLife = AllZone.GameAction.getPlayerLife(AllZone.GameAction.getOpponent(c.getController())); - oppLife.subtractLife(c.getNetAttack()); - - - c.setCreatureBlockedThisTurn(true); - - //ability2.setStackDescription(c.getName() + " blocks and deals damage equal to its power to attacking player."); - //AllZone.Stack.add(ability2); - - }//Shield Sphere - - }//if Phase == declare blockers + }//if Phase == after declare blockers }//checkDeclareBlockers + public static void checkBlockedAttackers(Card a, Card b) { //System.out.println(a.getName() + " got blocked by " + b.getName()); diff --git a/src/forge/ComputerAI_General.java b/src/forge/ComputerAI_General.java index 00b0536d153..4d12d933e54 100644 --- a/src/forge/ComputerAI_General.java +++ b/src/forge/ComputerAI_General.java @@ -291,6 +291,12 @@ public class ComputerAI_General implements Computer { CardList list = new CardList(); list.addAll(AllZone.Combat.getAllBlockers().toArray()); list.addAll(AllZone.pwCombat.getAllBlockers().toArray()); + list = list.filter(new CardListFilter(){ + public boolean addCard(Card c) + { + return !c.getCreatureBlockedThisTurn(); + } + }); CardList attList = new CardList(); attList.addAll(AllZone.Combat.getAttackers()); @@ -298,8 +304,7 @@ public class ComputerAI_General implements Computer { CardList pwAttList = new CardList(); pwAttList.addAll(AllZone.pwCombat.getAttackers()); - for(Card c:list) - CombatUtil.checkDeclareBlockers(c); + CombatUtil.checkDeclareBlockers(list); for (Card a:attList){ CardList blockList = AllZone.Combat.getBlockers(a);