public void enterCombat(BeginTurnAs whoseTurn) {
   world.model.uiSelections.isInCombat = true;
   resetCombatState();
   combatTurnListeners.onCombatStarted();
   if (whoseTurn == BeginTurnAs.player) newPlayerTurn(true);
   else if (whoseTurn == BeginTurnAs.monsters) beginMonsterTurn(true);
   else continueTurn();
 }
 private void newPlayerTurn(boolean isFirstRound) {
   if (canExitCombat()) {
     exitCombat(true);
     return;
   }
   controllers.actorStatsController.setActorMaxAP(world.model.player);
   if (!isFirstRound) controllers.gameRoundController.onNewPlayerRound();
   world.model.uiSelections.isPlayersCombatTurn = true;
   combatTurnListeners.onNewPlayerTurn();
 }
 public void exitCombat(boolean pickupLootBags) {
   setCombatSelection(null, null);
   world.model.uiSelections.isInCombat = false;
   combatTurnListeners.onCombatEnded();
   world.model.uiSelections.selectedPosition = null;
   world.model.uiSelections.selectedMonster = null;
   controllers.gameRoundController.resetRoundTimers();
   if (pickupLootBags && totalExpThisFight > 0) {
     controllers.itemController.lootMonsterBags(killedMonsterBags, totalExpThisFight);
   } else {
     controllers.gameRoundController.resume();
   }
   resetCombatState();
 }
  private void attackWithCurrentMonster() {
    controllers.actorStatsController.useAPs(
        currentActiveMonster, currentActiveMonster.getAttackCost());

    combatTurnListeners.onMonsterIsAttacking(currentActiveMonster);
    AttackResult attack = monsterAttacks(currentActiveMonster);
    this.lastAttackResult = attack;

    if (attack.isHit) {
      combatActionListeners.onMonsterAttackSuccess(currentActiveMonster, attack);
      startAttackEffect(attack, world.model.player.position, this, CALLBACK_MONSTERATTACK);
    } else {
      combatActionListeners.onMonsterAttackMissed(currentActiveMonster, attack);
      startMissedEffect(attack, world.model.player.position, this, CALLBACK_MONSTERATTACK);
    }
  }