mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
various code simplifications in CardFactoryUtil.java
This commit is contained in:
@@ -2391,12 +2391,6 @@ public class CardFactoryUtil {
|
|||||||
Player cardController = c.getController();
|
Player cardController = c.getController();
|
||||||
Player oppController = cardController.getOpponent();
|
Player oppController = cardController.getOpponent();
|
||||||
|
|
||||||
PlayerZone myYard = AllZone.getZone(Constant.Zone.Graveyard, cardController);
|
|
||||||
PlayerZone opYard = AllZone.getZone(Constant.Zone.Graveyard, oppController);
|
|
||||||
|
|
||||||
PlayerZone myHand = AllZone.getZone(Constant.Zone.Hand, cardController);
|
|
||||||
PlayerZone opHand = AllZone.getZone(Constant.Zone.Hand, oppController);
|
|
||||||
|
|
||||||
final String[] l;
|
final String[] l;
|
||||||
l = s.split("/"); // separate the specification from any math
|
l = s.split("/"); // separate the specification from any math
|
||||||
final String m[] = {"none"};
|
final String m[] = {"none"};
|
||||||
@@ -2518,7 +2512,7 @@ public class CardFactoryUtil {
|
|||||||
// Count$Hellbent.<numHB>.<numNotHB>
|
// Count$Hellbent.<numHB>.<numNotHB>
|
||||||
if(sq[0].contains("Hellbent"))
|
if(sq[0].contains("Hellbent"))
|
||||||
{
|
{
|
||||||
if(myHand.size() <= 0)
|
if(cardController.hasHellbent())
|
||||||
return doXMath(Integer.parseInt(sq[1]), m, c); // Hellbent
|
return doXMath(Integer.parseInt(sq[1]), m, c); // Hellbent
|
||||||
else
|
else
|
||||||
return doXMath(Integer.parseInt(sq[2]), m, c); // not Hellbent
|
return doXMath(Integer.parseInt(sq[2]), m, c); // not Hellbent
|
||||||
@@ -2535,7 +2529,7 @@ public class CardFactoryUtil {
|
|||||||
|
|
||||||
if (sq[0].contains("Threshold"))
|
if (sq[0].contains("Threshold"))
|
||||||
{
|
{
|
||||||
if (myYard.size() >= 7)
|
if (cardController.hasThreshold())
|
||||||
return doXMath(Integer.parseInt(sq[1]), m, c); // Have Threshold
|
return doXMath(Integer.parseInt(sq[1]), m, c); // Have Threshold
|
||||||
else
|
else
|
||||||
return doXMath(Integer.parseInt(sq[2]), m, c); // not Threshold
|
return doXMath(Integer.parseInt(sq[2]), m, c); // not Threshold
|
||||||
@@ -2644,12 +2638,12 @@ public class CardFactoryUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(sq[0].contains("InOppYard")) if(OY == false) {
|
if(sq[0].contains("InOppYard")) if(OY == false) {
|
||||||
someCards.addAll(opYard.getCards());
|
someCards.addAll(AllZoneUtil.getPlayerGraveyard(oppController));
|
||||||
OY = true;
|
OY = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sq[0].contains("InOppHand")) if(OH == false) {
|
if(sq[0].contains("InOppHand")) if(OH == false) {
|
||||||
someCards.addAll(opHand.getCards());
|
someCards.addAll(AllZoneUtil.getPlayerHand(oppController));
|
||||||
OH = true;
|
OH = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2659,13 +2653,13 @@ public class CardFactoryUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(sq[0].contains("InAllYards")) {
|
if(sq[0].contains("InAllYards")) {
|
||||||
if(MY == false) someCards.addAll(myYard.getCards());
|
if(MY == false) someCards.addAll(AllZoneUtil.getPlayerGraveyard(cardController));
|
||||||
if(OY == false) someCards.addAll(opYard.getCards());
|
if(OY == false) someCards.addAll(AllZoneUtil.getPlayerGraveyard(oppController));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sq[0].contains("InAllHands")) {
|
if(sq[0].contains("InAllHands")) {
|
||||||
if(MH == false) someCards.addAll(myHand.getCards());
|
if(MH == false) someCards.addAll(AllZoneUtil.getPlayerHand(cardController));
|
||||||
if(OH == false) someCards.addAll(opHand.getCards());
|
if(OH == false) someCards.addAll(AllZoneUtil.getPlayerHand(oppController));
|
||||||
}
|
}
|
||||||
|
|
||||||
// filter lists based on the specified quality
|
// filter lists based on the specified quality
|
||||||
|
|||||||
Reference in New Issue
Block a user