Skip to content

Commit

Permalink
add bankrupting to casino
Browse files Browse the repository at this point in the history
  • Loading branch information
AmonDeShir committed Jan 10, 2024
1 parent c8a7f1c commit 95e83de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/src/xyz/magicjourney/nebulaquest/dice/Dice.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected int debugRoll() {
}

public void roll(Consumer<Integer> callback) {
int result = 3;// this.random.nextInt(11) + 1;
int result = this.random.nextInt(11) + 1;
//int result = this.debugRoll();

if (this.isRolling) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import xyz.magicjourney.nebulaquest.entity.Entity;
import xyz.magicjourney.nebulaquest.player.Player;
import xyz.magicjourney.nebulaquest.ui.button.ActionButton;
import xyz.magicjourney.nebulaquest.ui.dialog.MessageBox;
import xyz.magicjourney.nebulaquest.ui.panel.InteractivePanel;
import xyz.magicjourney.nebulaquest.ui.panel.TourPanel;

Expand All @@ -21,7 +20,6 @@ public class CasinoInteractiveView extends DescriptionInteractiveView {
protected ActionButton bankruptButton;
protected ActionButton decrease;
protected ActionButton increase;
protected MessageBox bankruptConfirmation;
protected Label bet;
protected int betValue;
protected Player player;
Expand All @@ -35,7 +33,6 @@ public CasinoInteractiveView(AssetManager assets, InteractivePanel parent, TourP
this.oddButton = new ActionButton("Odds", true, assets);
this.evenButton = new ActionButton("Even", true, assets);
this.bankruptButton = new ActionButton("Bankrupt", false, assets);
this.bankruptConfirmation = new MessageBox("Unimplemented :(", assets);

this.betValue = 0;
this.bet = new Label("Your bet: " + this.betValue, this.skin, "small");
Expand Down Expand Up @@ -157,14 +154,12 @@ protected void rollCasinoDice(Player player, boolean even) {
};

protected Consumer<Runnable> handleBankruptClick = (unblock) -> {
this.bankruptConfirmation.show(this.getStage());

this.increase.setDisabled(true);
this.decrease.setDisabled(true);
this.oddButton.setDisabled(true);
this.evenButton.setDisabled(true);

this.tourPanel.unblockTurnButton();
this.player.bankrupt();
};

protected Consumer<Player> handlePlayerUpdate = (player) -> {
Expand Down

0 comments on commit 95e83de

Please sign in to comment.