mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Better fix for manapool payment
This commit is contained in:
@@ -25,7 +25,10 @@ import com.google.common.base.Function;
|
|||||||
|
|
||||||
import forge.game.player.PlayerView;
|
import forge.game.player.PlayerView;
|
||||||
import forge.game.zone.ZoneType;
|
import forge.game.zone.ZoneType;
|
||||||
|
import forge.gamemodes.match.input.Input;
|
||||||
|
import forge.gamemodes.match.input.InputPayMana;
|
||||||
import forge.gui.framework.ICDoc;
|
import forge.gui.framework.ICDoc;
|
||||||
|
import forge.player.PlayerControllerHuman;
|
||||||
import forge.screens.match.CMatchUI;
|
import forge.screens.match.CMatchUI;
|
||||||
import forge.screens.match.ZoneAction;
|
import forge.screens.match.ZoneAction;
|
||||||
import forge.screens.match.views.VField;
|
import forge.screens.match.views.VField;
|
||||||
@@ -69,10 +72,14 @@ public class CField implements ICDoc {
|
|||||||
|
|
||||||
final Function<Byte, Boolean> manaAction = new Function<Byte, Boolean>() {
|
final Function<Byte, Boolean> manaAction = new Function<Byte, Boolean>() {
|
||||||
@Override public final Boolean apply(final Byte colorCode) {
|
@Override public final Boolean apply(final Byte colorCode) {
|
||||||
if (player.getHasPriority()) {
|
if (matchUI.getGameController() instanceof PlayerControllerHuman) {
|
||||||
final int oldMana = player.getMana(colorCode);
|
final PlayerControllerHuman controller = (PlayerControllerHuman) matchUI.getGameController();
|
||||||
matchUI.getGameController().useMana(colorCode.byteValue());
|
final Input ipm = controller.getInputQueue().getInput();
|
||||||
return Boolean.valueOf(oldMana != player.getMana(colorCode));
|
if (ipm instanceof InputPayMana && ipm.getOwner().equals(player)) {
|
||||||
|
final int oldMana = player.getMana(colorCode);
|
||||||
|
controller.useMana(colorCode.byteValue());
|
||||||
|
return Boolean.valueOf(oldMana != player.getMana(colorCode));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Boolean.FALSE;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2170,8 +2170,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
|||||||
public IDevModeCheats cheat() {
|
public IDevModeCheats cheat() {
|
||||||
if (cheats == null) {
|
if (cheats == null) {
|
||||||
cheats = new DevModeCheats();
|
cheats = new DevModeCheats();
|
||||||
// TODO: In Network game, inform other players that this player is
|
// TODO: In Network game, inform other players that this player is cheating
|
||||||
// cheating
|
|
||||||
}
|
}
|
||||||
return cheats;
|
return cheats;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user