mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
remove card specific code in favor or reusable code.
This commit is contained in:
@@ -2622,7 +2622,7 @@ public class CombatUtil {
|
|||||||
|
|
||||||
Player phasingPlayer = c.getController();
|
Player phasingPlayer = c.getController();
|
||||||
// Finest Hour untaps the creature on the first combat phase
|
// Finest Hour untaps the creature on the first combat phase
|
||||||
if ((GameActionUtil.countFinestHours(phasingPlayer)>0) &&
|
if ((AllZoneUtil.getPlayerCardsInPlay(phasingPlayer, "Finest Hour").size() > 0) &&
|
||||||
AllZone.Phase.isFirstCombat()) {
|
AllZone.Phase.isFirstCombat()) {
|
||||||
// Untap the attacking creature
|
// Untap the attacking creature
|
||||||
Ability fhUntap = new Ability(c, "0") {
|
Ability fhUntap = new Ability(c, "0") {
|
||||||
@@ -2634,7 +2634,7 @@ public class CombatUtil {
|
|||||||
AllZone.Stack.add(fhUntap);
|
AllZone.Stack.add(fhUntap);
|
||||||
|
|
||||||
// If any Finest Hours, queue up a new combat phase
|
// If any Finest Hours, queue up a new combat phase
|
||||||
for (int ix = 0; ix < GameActionUtil.countFinestHours(phasingPlayer); ix++) {
|
for (int ix = 0; ix < AllZoneUtil.getPlayerCardsInPlay(phasingPlayer, "Finest Hour").size(); ix++) {
|
||||||
Ability fhAddCombat = new Ability(c, "0") {
|
Ability fhAddCombat = new Ability(c, "0") {
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
AllZone.Phase.addExtraCombat(crd.getController());
|
AllZone.Phase.addExtraCombat(crd.getController());
|
||||||
@@ -2644,7 +2644,7 @@ public class CombatUtil {
|
|||||||
AllZone.Stack.add(fhAddCombat);
|
AllZone.Stack.add(fhAddCombat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(GameActionUtil.isRafiqInPlay(phasingPlayer)) {
|
if(AllZoneUtil.isCardInPlay("Rafiq of the Many", phasingPlayer)) {
|
||||||
Ability ability2 = new Ability(c, "0") {
|
Ability ability2 = new Ability(c, "0") {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ import java.util.*;
|
|||||||
// it won't be surprised by Exalted
|
// it won't be surprised by Exalted
|
||||||
int humanExaltedBonus = countExaltedBonus(AllZone.HumanPlayer);
|
int humanExaltedBonus = countExaltedBonus(AllZone.HumanPlayer);
|
||||||
if (humanExaltedBonus > 0) {
|
if (humanExaltedBonus > 0) {
|
||||||
int nFinestHours = GameActionUtil.countFinestHours(AllZone.HumanPlayer);
|
int nFinestHours = AllZoneUtil.getPlayerCardsInPlay(AllZone.HumanPlayer, "Finest Hour").size();
|
||||||
|
|
||||||
if ( (blockersNeeded == 0 || nFinestHours > 0) && humanList.size() > 0) {
|
if ( (blockersNeeded == 0 || nFinestHours > 0) && humanList.size() > 0) {
|
||||||
//
|
//
|
||||||
@@ -112,7 +112,7 @@ import java.util.*;
|
|||||||
// For Finest Hour, one creature could attack and get the bonus TWICE
|
// For Finest Hour, one creature could attack and get the bonus TWICE
|
||||||
humanBaseAttack = humanBaseAttack + humanExaltedBonus;
|
humanBaseAttack = humanBaseAttack + humanExaltedBonus;
|
||||||
}
|
}
|
||||||
int totalExaltedAttack = GameActionUtil.isRafiqInPlay(AllZone.HumanPlayer) ?
|
int totalExaltedAttack = AllZoneUtil.isCardInPlay("Rafiq of the Many", AllZone.HumanPlayer) ?
|
||||||
2 * humanBaseAttack: humanBaseAttack;
|
2 * humanBaseAttack: humanBaseAttack;
|
||||||
if ((AllZone.ComputerPlayer.getLife() - 3) <= totalExaltedAttack) {
|
if ((AllZone.ComputerPlayer.getLife() - 3) <= totalExaltedAttack) {
|
||||||
// We will lose if there is an Exalted attack -- keep one blocker
|
// We will lose if there is an Exalted attack -- keep one blocker
|
||||||
@@ -180,9 +180,9 @@ import java.util.*;
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (combat.getAttackers().length == 0 && (countExaltedBonus(AllZone.ComputerPlayer) >= 3 ||
|
if (combat.getAttackers().length == 0 && (countExaltedBonus(AllZone.ComputerPlayer) >= 3 ||
|
||||||
GameActionUtil.isRafiqInPlay(AllZone.ComputerPlayer) ||
|
AllZoneUtil.isCardInPlay("Rafiq of the Many", AllZone.ComputerPlayer) ||
|
||||||
AllZoneUtil.getPlayerCardsInPlay(AllZone.ComputerPlayer, "Battlegrace Angel").size() >= 2 ||
|
AllZoneUtil.getPlayerCardsInPlay(AllZone.ComputerPlayer, "Battlegrace Angel").size() >= 2 ||
|
||||||
(GameActionUtil.countFinestHours(AllZone.ComputerPlayer)>=1) && AllZone.Phase.isFirstCombat())
|
(AllZoneUtil.getPlayerCardsInPlay(AllZone.ComputerPlayer, "Finest Hour").size()>=1) && AllZone.Phase.isFirstCombat())
|
||||||
&& !doAssault())
|
&& !doAssault())
|
||||||
{
|
{
|
||||||
int biggest = 0;
|
int biggest = 0;
|
||||||
|
|||||||
@@ -3919,32 +3919,6 @@ public class GameActionUtil {
|
|||||||
AllZone.GameInfo.setResolvedFirstStrikeDamageThisCombat(false);
|
AllZone.GameInfo.setResolvedFirstStrikeDamageThisCombat(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isRafiqInPlay(Player player) {
|
|
||||||
PlayerZone playerZone = AllZone.getZone(Constant.Zone.Play, player);
|
|
||||||
|
|
||||||
CardList cards = new CardList();
|
|
||||||
cards.addAll(playerZone.getCards());
|
|
||||||
|
|
||||||
cards = cards.getName("Rafiq of the Many");
|
|
||||||
|
|
||||||
if(cards.size() >= 1) // should only be 1, since Rafiq is Legendary
|
|
||||||
return true;
|
|
||||||
else return false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int countFinestHours(Player controller) {
|
|
||||||
PlayerZone playerZone = AllZone.getZone(Constant.Zone.Play, controller);
|
|
||||||
|
|
||||||
CardList cards = new CardList();
|
|
||||||
cards.addAll(playerZone.getCards());
|
|
||||||
|
|
||||||
cards = cards.getName("Finest Hour");
|
|
||||||
|
|
||||||
return cards.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static void executeAllyEffects(Card c) {
|
public static void executeAllyEffects(Card c) {
|
||||||
if(c.getName().equals("Kazandu Blademaster") || c.getName().equals("Makindi Shieldmate")
|
if(c.getName().equals("Kazandu Blademaster") || c.getName().equals("Makindi Shieldmate")
|
||||||
|| c.getName().equals("Nimana Sell-Sword") || c.getName().equals("Oran-Rief Survivalist")
|
|| c.getName().equals("Nimana Sell-Sword") || c.getName().equals("Oran-Rief Survivalist")
|
||||||
|
|||||||
Reference in New Issue
Block a user