mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
various minor improvements/cleanups in GameActionUtil.java
This commit is contained in:
@@ -12016,48 +12016,6 @@ public class GameActionUtil {
|
|||||||
}// execute()
|
}// execute()
|
||||||
}; //Goblin Assault
|
}; //Goblin Assault
|
||||||
|
|
||||||
/*
|
|
||||||
public static Command Mobilization = new Command() {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 2005579284163773044L;
|
|
||||||
|
|
||||||
CardList gloriousAnthemList = new CardList();
|
|
||||||
|
|
||||||
public void execute() {
|
|
||||||
/*
|
|
||||||
String keyword = "Vigilance";
|
|
||||||
|
|
||||||
CardList list = gloriousAnthemList;
|
|
||||||
Card c;
|
|
||||||
// reset all cards in list - aka "old" cards
|
|
||||||
for(int i = 0; i < list.size(); i++) {
|
|
||||||
c = list.get(i);
|
|
||||||
c.removeExtrinsicKeyword(keyword);
|
|
||||||
}
|
|
||||||
|
|
||||||
list.clear();
|
|
||||||
PlayerZone[] zone = getZone("Mobilization");
|
|
||||||
|
|
||||||
for(int outer = 0; outer < zone.length; outer++) {
|
|
||||||
CardList creature = new CardList();
|
|
||||||
creature.addAll(AllZone.Human_Play.getCards());
|
|
||||||
creature.addAll(AllZone.Computer_Play.getCards());
|
|
||||||
creature = creature.getType("Soldier");
|
|
||||||
|
|
||||||
for(int i = 0; i < creature.size(); i++) {
|
|
||||||
c = creature.get(i);
|
|
||||||
if(!c.getKeyword().contains(keyword)) {
|
|
||||||
c.addExtrinsicKeyword(keyword);
|
|
||||||
gloriousAnthemList.add(c);
|
|
||||||
}
|
|
||||||
}// for inner
|
|
||||||
}// for outer
|
|
||||||
|
|
||||||
}// execute()
|
|
||||||
|
|
||||||
}; //mobilization
|
|
||||||
*/
|
|
||||||
|
|
||||||
public static Command That_Which_Was_Taken = new Command() {
|
public static Command That_Which_Was_Taken = new Command() {
|
||||||
private static final long serialVersionUID = -4142514935709694293L;
|
private static final long serialVersionUID = -4142514935709694293L;
|
||||||
|
|
||||||
@@ -13825,10 +13783,6 @@ public class GameActionUtil {
|
|||||||
|
|
||||||
public void execute()
|
public void execute()
|
||||||
{
|
{
|
||||||
/* CardList list = new CardList();
|
|
||||||
list.addAll(AllZone.Human_Play.getCards());
|
|
||||||
list.addAll(AllZone.Computer_Play.getCards());
|
|
||||||
list = list.getName("Nirkana Cutthroat"); */
|
|
||||||
CardList list = AllZoneUtil.getCardsInPlay("Nirkana Cutthroat");
|
CardList list = AllZoneUtil.getCardsInPlay("Nirkana Cutthroat");
|
||||||
|
|
||||||
for (Card c:list)
|
for (Card c:list)
|
||||||
@@ -14032,10 +13986,7 @@ public class GameActionUtil {
|
|||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
// get all creatures
|
// get all creatures
|
||||||
CardList list = new CardList();
|
CardList list = AllZoneUtil.getCardsInPlay("Korlash, Heir to Blackblade");
|
||||||
list.addAll(AllZone.Human_Play.getCards());
|
|
||||||
list.addAll(AllZone.Computer_Play.getCards());
|
|
||||||
list = list.getName("Korlash, Heir to Blackblade");
|
|
||||||
|
|
||||||
for(int i = 0; i < list.size(); i++) {
|
for(int i = 0; i < list.size(); i++) {
|
||||||
Card c = list.get(i);
|
Card c = list.get(i);
|
||||||
@@ -14045,10 +13996,7 @@ public class GameActionUtil {
|
|||||||
}// execute()
|
}// execute()
|
||||||
|
|
||||||
private int countSwamps(Card c) {
|
private int countSwamps(Card c) {
|
||||||
PlayerZone play = AllZone.getZone(
|
CardList swamps = AllZoneUtil.getPlayerTypeInPlay(c.getController(), "Swamp");
|
||||||
Constant.Zone.Play, c.getController());
|
|
||||||
CardList swamps = new CardList(play.getCards());
|
|
||||||
swamps = swamps.getType("Swamp");
|
|
||||||
return swamps.size();
|
return swamps.size();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -14291,10 +14239,7 @@ public class GameActionUtil {
|
|||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
// get all creatures
|
// get all creatures
|
||||||
CardList list = new CardList();
|
CardList list = AllZoneUtil.getCardsInPlay("Gaea's Avenger");
|
||||||
list.addAll(AllZone.Human_Play.getCards());
|
|
||||||
list.addAll(AllZone.Computer_Play.getCards());
|
|
||||||
list = list.getName("Gaea's Avenger");
|
|
||||||
|
|
||||||
for(int i = 0; i < list.size(); i++) {
|
for(int i = 0; i < list.size(); i++) {
|
||||||
Card c = list.get(i);
|
Card c = list.get(i);
|
||||||
@@ -14316,27 +14261,14 @@ public class GameActionUtil {
|
|||||||
private static final long serialVersionUID = 1987554325573387864L;
|
private static final long serialVersionUID = 1987554325573387864L;
|
||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
// get all creatures
|
CardList list = AllZoneUtil.getCardsInPlay("People of the Woods");
|
||||||
CardList list = new CardList();
|
|
||||||
list.addAll(AllZone.Human_Play.getCards());
|
|
||||||
list.addAll(AllZone.Computer_Play.getCards());
|
|
||||||
list = list.getName("People of the Woods");
|
|
||||||
|
|
||||||
for(int i = 0; i < list.size(); i++) {
|
for(int i = 0; i < list.size(); i++) {
|
||||||
Card c = list.get(i);
|
Card c = list.get(i);
|
||||||
c.setBaseAttack(1);
|
c.setBaseAttack(1);
|
||||||
c.setBaseDefense(countForests(c));
|
c.setBaseDefense(AllZoneUtil.getPlayerTypeInPlay(c.getController(), "Forest").size());
|
||||||
}
|
}
|
||||||
|
|
||||||
}// execute()
|
}// execute()
|
||||||
|
|
||||||
private int countForests(Card c) {
|
|
||||||
PlayerZone play = AllZone.getZone(
|
|
||||||
Constant.Zone.Play, c.getController());
|
|
||||||
CardList forests = new CardList(play.getCards());
|
|
||||||
forests = forests.getType("Forest");
|
|
||||||
return forests.size();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public static Command Old_Man_of_the_Sea = new Command() {
|
public static Command Old_Man_of_the_Sea = new Command() {
|
||||||
@@ -14481,10 +14413,7 @@ public class GameActionUtil {
|
|||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
// get all creatures
|
// get all creatures
|
||||||
CardList list = new CardList();
|
CardList list = AllZoneUtil.getCardsInPlay("Kird Ape");
|
||||||
list.addAll(AllZone.Human_Play.getCards());
|
|
||||||
list.addAll(AllZone.Computer_Play.getCards());
|
|
||||||
list = list.getName("Kird Ape");
|
|
||||||
|
|
||||||
for(int i = 0; i < list.size(); i++) {
|
for(int i = 0; i < list.size(); i++) {
|
||||||
Card c = list.get(i);
|
Card c = list.get(i);
|
||||||
@@ -14499,14 +14428,8 @@ public class GameActionUtil {
|
|||||||
}// execute()
|
}// execute()
|
||||||
|
|
||||||
private boolean hasForest(Card c) {
|
private boolean hasForest(Card c) {
|
||||||
PlayerZone play = AllZone.getZone(
|
CardList forests = AllZoneUtil.getPlayerTypeInPlay(c.getController(), "Forest");
|
||||||
Constant.Zone.Play, c.getController());
|
if(forests.size() > 0) return true;
|
||||||
|
|
||||||
CardList land = new CardList();
|
|
||||||
land.addAll(play.getCards());
|
|
||||||
|
|
||||||
land = land.getType("Forest");
|
|
||||||
if(land.size() > 0) return true;
|
|
||||||
else return false;
|
else return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -18716,7 +18639,7 @@ public class GameActionUtil {
|
|||||||
}
|
}
|
||||||
old.clear();
|
old.clear();
|
||||||
|
|
||||||
CardList list = getCard("Giant Tortoise");
|
CardList list = AllZoneUtil.getCardsInPlay("Giant Tortoise");
|
||||||
for(int i = 0; i < list.size(); i++) {
|
for(int i = 0; i < list.size(); i++) {
|
||||||
c = list.get(i);
|
c = list.get(i);
|
||||||
// only add boost if card is untapped
|
// only add boost if card is untapped
|
||||||
@@ -18726,17 +18649,8 @@ public class GameActionUtil {
|
|||||||
}
|
}
|
||||||
}// for
|
}// for
|
||||||
}// execute()
|
}// execute()
|
||||||
|
|
||||||
CardList getCard(String name) {
|
|
||||||
CardList list = new CardList();
|
|
||||||
list.addAll(AllZone.Human_Play.getCards());
|
|
||||||
list.addAll(AllZone.Computer_Play.getCards());
|
|
||||||
list = list.getName(name);
|
|
||||||
return list;
|
|
||||||
}// getCard()
|
|
||||||
}; // Giant_Tortoise
|
}; // Giant_Tortoise
|
||||||
|
|
||||||
|
|
||||||
public static Command Radiant_Archangel = new Command() {
|
public static Command Radiant_Archangel = new Command() {
|
||||||
private static final long serialVersionUID = -7086544305058527889L;
|
private static final long serialVersionUID = -7086544305058527889L;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user