mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Merge branch 'master' into net_decks
This commit is contained in:
@@ -184,11 +184,11 @@ public abstract class AbstractGuiGame implements IGuiGame, IMayViewCards {
|
||||
if (!hasLocalPlayers()) {
|
||||
return true; //if not in game, card can be shown
|
||||
}
|
||||
if(GuiBase.getInterface().isLibgdxPort()){
|
||||
if(gameView != null && gameView.isGameOver()) {
|
||||
if (GuiBase.getInterface().isLibgdxPort()){
|
||||
if (gameView != null && gameView.isGameOver()) {
|
||||
return true;
|
||||
}
|
||||
if(spectator!=null) { //workaround fix!! this is needed on above code or it will
|
||||
if (spectator!=null) { //workaround fix!! this is needed on above code or it will
|
||||
for (Map.Entry<PlayerView, IGameController> e : gameControllers.entrySet()) {
|
||||
if (e.getValue().equals(spectator)) {
|
||||
gameControllers.remove(e.getKey());
|
||||
@@ -197,7 +197,7 @@ public abstract class AbstractGuiGame implements IGuiGame, IMayViewCards {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
try{
|
||||
try {
|
||||
if (getGameController().mayLookAtAllCards()) { // when it bugged here, the game thinks the spectator (null)
|
||||
return true; // is the humancontroller here (maybe because there is an existing game thread???)
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class InputSelectEntitiesFromList<T extends GameEntity> extends InputSele
|
||||
public InputSelectEntitiesFromList(final PlayerControllerHuman controller, final int min, final int max, final FCollectionView<T> validChoices0, final SpellAbility sa0) {
|
||||
super(controller, Math.min(min, validChoices0.size()), Math.min(max, validChoices0.size()), sa0);
|
||||
validChoices = validChoices0;
|
||||
if (min > validChoices.size()) { // pfps does this really do anything useful??
|
||||
if (min > validChoices.size()) { // pfps does this really do anything useful??
|
||||
System.out.println(String.format("Trying to choose at least %d things from a list with only %d things!", min, validChoices.size()));
|
||||
}
|
||||
ArrayList<CardView> vCards = new ArrayList<>();
|
||||
|
||||
@@ -1096,6 +1096,10 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
c = AbilityUtils.calculateAmount(source, amount, ability);
|
||||
}
|
||||
|
||||
if (c != null && c == 0) {
|
||||
return PaymentDecision.number(0);
|
||||
}
|
||||
|
||||
if (sameType) {
|
||||
final CardCollection list2 = typeList;
|
||||
typeList = CardLists.filter(typeList, new Predicate<Card>() {
|
||||
@@ -1109,9 +1113,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (c == 0) {
|
||||
return PaymentDecision.number(0);
|
||||
}
|
||||
|
||||
final CardCollection tapped = new CardCollection();
|
||||
while (c > 0) {
|
||||
final InputSelectCardsFromList inp = new InputSelectCardsFromList(controller, 1, 1, typeList, ability);
|
||||
|
||||
@@ -105,7 +105,6 @@ public class HumanPlay {
|
||||
|
||||
sa = AbilityUtils.addSpliceEffects(sa);
|
||||
|
||||
// System.out.println("Playing:" + sa.getDescription() + " of " + sa.getHostCard() + " new = " + newAbility);
|
||||
final HumanPlaySpellAbility req = new HumanPlaySpellAbility(controller, sa);
|
||||
if (!req.playAbility(true, false, false)) {
|
||||
if (flippedToCast && !castFaceDown) {
|
||||
|
||||
@@ -487,7 +487,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
|
||||
private boolean useSelectCardsInput(final FCollectionView<? extends GameEntity> sourceList) {
|
||||
// can't use InputSelect from GUI thread (e.g., DevMode Tutor)
|
||||
if ( FThreads.isGuiThread() ) { return false; }
|
||||
if (FThreads.isGuiThread()) { return false; }
|
||||
|
||||
// if UI_SELECT_FROM_CARD_DISPLAYS not set use InputSelect only for battlefield and player hand
|
||||
// if UI_SELECT_FROM_CARD_DISPLAYS set and using desktop GUI use InputSelect for any zone that can be shown
|
||||
@@ -2431,7 +2431,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
if (subtract) {
|
||||
card.subtractCounter(counter, count);
|
||||
} else {
|
||||
card.addCounter(counter, count, card.getController(), false, null);
|
||||
card.addCounter(counter, count, card.getController(), null, false, null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user