// Use this for initialization void Start() { #region attemptAtStateMachine //PlayerAIs = new AIUnitScript[numberOfPlayers]; //PlayerAIs[0] = null; //for (int i = 1; i < numberOfPlayers; i++) //{ // PlayerAIs[1] = new AIUnitScript_UtilityAI(); //} #endregion goodness = -Mathf.Infinity; enemyHealth = 150f; overrideGoodness = false; defenceTurnCounter = 0; shortestSquareResult = 0; currentTurnState = TurnsState.PlayerTurn; currentState = States.WaitingForTurn; rows = new List <int>(); columns = new List <int>(); movementActivated = false; pathBegun = true; aiTurn = false; endTurnTrue = false; instance = this; }
private void DoEndTurn() { if (hexes != null) { foreach (HexScript hex in hexes) { GameObject tempHexNeighbour_go = GameObject.Find("Hex_" + hex.C + "_" + hex.R); if (hex.movementCost == 1) { tempHexNeighbour_go.transform.gameObject.GetComponentInChildren <MeshRenderer>().material.color = selectedHexesOriginalColor; } } } shortestSquareResult = 0; endTurnTrue = false; endTurnDelay = 0; selectedHex = null; rows = new List <int>(); columns = new List <int>(); movementActivated = false; pathBegun = true; aiTurn = false; noCharacter = false; turnNumber++; currentState = States.WaitingForTurn; if (currentTurnState == TurnsState.EnemyTurn_1 && MapGeneratorScript.instance.aiUnits.Count > 1) { currentTurnState = TurnsState.EnemyTurn_2; currentState = States.Stalling; aiTurn = true; endTurnTrue = false; } else if (currentTurnState == TurnsState.EnemyTurn_2 && MapGeneratorScript.instance.aiUnits.Count > 2) { currentTurnState = TurnsState.EnemyTurn_3; currentState = States.Stalling; aiTurn = true; endTurnTrue = false; } else { currentTurnState = TurnsState.PlayerTurn; } }
public void ChangingTurnState() { //if (selectedAIUnit != null) //{ // if (turnNumber > 0 && selectedAIUnit.HitPoints > 10) // { // selectedAIUnit.HitPoints -= 33; // enemyHealth = selectedAIUnit.HitPoints; // } // else // { // enemyHealth = selectedAIUnit.HitPoints; // } //} currentTurnState = TurnsState.EnemyTurn_1; currentState = States.Stalling; aiTurn = true; endTurnTrue = false; }
public void ChangingTurnState() { currentTurnState = TurnsState.EnemyTurn_1; }
// Use this for initialization void Start() { currentTurnState = TurnsState.PlayerTurn_1; instance = this; }