Skip to content

Commit

Permalink
Update unavailable choice test
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrofab committed Oct 30, 2023
1 parent 580eaf0 commit 10b2364
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ public void unavailableChoicesCannotGetSelected(TestContext ctx) {
player.setHealth(10f);
Blabber.startDialogue(player, new Identifier("babblings:mountain_king"));
((DialogueScreenHandler) player.currentScreenHandler).makeChoice(player, 1);
GameTestUtil.assertTrue("dialogue should be at state bargain", player.currentScreenHandler instanceof DialogueScreenHandler handler && handler.getCurrentStateKey().equals("bargain"));
((DialogueScreenHandler) player.currentScreenHandler).makeChoice(player, 0);
GameTestUtil.assertTrue("unavailable choice 0 should be ignored", player.currentScreenHandler instanceof DialogueScreenHandler handler && handler.getCurrentStateKey().equals("bargain"));
((DialogueScreenHandler) player.currentScreenHandler).makeChoice(player, 2);
GameTestUtil.assertTrue("dialogue should end", player.currentScreenHandler == player.playerScreenHandler);
GameTestUtil.assertTrue("dialogue should be at state friendship", player.currentScreenHandler instanceof DialogueScreenHandler handler && handler.getCurrentStateKey().equals("friendship"));
ctx.complete();
}
}

0 comments on commit 10b2364

Please sign in to comment.