private void NextAct() { if (characters[0].Count > 0 && characters[1].Count > 0) { if (_characterTurnIndex < characters[_actTurn].Count - 1) { _characterTurnIndex++; } else { NextTurn(); _characterTurnIndex = 0; Debug.Log("Turn " + _actTurn); } switch (_actTurn) { case 0: _uiController.ToggleActionState(true); _uiController.BuildSpellList(GetCurrentCharacter().Spells); break; case 1: StartCoroutine(PerformAct()); _uiController.ToggleActionState(false); break; } } else { Debug.Log("Battle is over!"); } }
void NextAct() { if (characters[0].Count > 0 && characters[1].Count > 0) { if (characterTurnIndex < characters[actTurn].Count - 1) { characterTurnIndex++; } else { NextTurn(); characterTurnIndex = 0; Debug.Log("Turn: " + actTurn); } switch (actTurn) { case 0: uiController.ToggleActionState(true); uiController.BuildSpellList(GetCurrentCharacter().spells); break; case 1: StartCoroutine(PerformAct()); uiController.ToggleActionState(false); //do ui stuff && act break; } } else { Debug.Log("Battle Over!"); } }
private void NextAct() { //check if there are still players on both sides if (characters[0].Count > 0 && characters[1].Count > 0) { //compare turn index to the actTurn; checks if there are more players to act if (turnIndex < characters[actTurn].Count - 1) { //increase turn index turnIndex++; } else { //if all players on one side have gone, go to next turn; NextTurn(); //reset index turnIndex = 0; //log turns Debug.Log("turn: " + actTurn); } //if the player turn let them fight switch (actTurn) { case 0: //UI interface //turn on UI for player to interact uiController.ToggleActionState(true); uiController.BuildSpellList(GetCurrentCharacter().spells); break; case 1: //calling delay before player act starts StartCoroutine(PerformAct()); uiController.ToggleActionState(false); //UI interface and act break; } } else { //end battle Debug.Log("Battle over!"); } }
private void NextAction() { Debug.LogFormat("Next action started Char:{0}/{1}", battleTurnIndex, characterTurnIndex); if (characters[0].Count > 0 && characters[1].Count > 0) { if (characterTurnIndex < characters[battleTurnIndex].Count - 1) { characterTurnIndex++; } else { NextTurn(); characterTurnIndex = 0; } if (this.GetCurrentCharacter().isDefending) { this.GetCurrentCharacter().isDefending = false; this.GetCurrentCharacter().defPower = this.GetCurrentCharacter().defOrigin; this.battleLog.Log("Defense has reverted to normal for " + this.GetCurrentCharacter().characterName); } switch (battleTurnIndex) { case 0: Debug.Log("Characters turn: " + BattleController.Instance.GetCurrentCharacter().characterName + " - " + battleTurnIndex + "/" + characterTurnIndex); uiController.ToggleActionState(true); uiController.BuildSpellList(GetCurrentCharacter().spells); break; case 1: Debug.Log("Enemy turn: " + BattleController.Instance.GetCurrentCharacter().characterName + " - " + battleTurnIndex + "/" + characterTurnIndex); uiController.ToggleActionState(false); StartCoroutine(PerformAction()); break; } } else { Debug.Log("Battle over!"); } }
public void NextAct() { if (characters[0].Count > 0 && characters[1].Count > 0) { //Debug.Log(characters[0].Count + characters[1].Count +"count"); if (characterTurnIndex < characters[actTurn].Count - 1) { //Debug.Log(characterTurnIndex +"ti"); characterTurnIndex++; } else { NextTurn(); characterTurnIndex = 0; Debug.Log("turn: " + actTurn); } switch (actTurn) { case 0: uIController.ToggleActionState(true); // do ui stuff; turns on our buttons so we can act uIController.BuildSpellList(GetCurrentCharacter().spells); break; case 1: StartCoroutine(PerformAct()); // special execution method for coroutine uIController.ToggleActionState(false); // do ui stuff and act ; turns off our buttons so we can't act during enemy team break; } } else { Debug.Log("Battle over!"); } }