Exemplo n.º 1
0
    // Use this for initialization.
    void Start()
    {
        playerCamera = GameObject.Find("PlayerCamera").GetComponent <PlayerCameraMovement>();
        currentTurn  = TurnOwner.Player;

        //Get list of playable characters.
        if (pcList == null)
        {
            UpdatePCList();
        }
        currentPCIndex = 0;
        currentPC      = pcList[0];

        //Sets the first PC to active state.
        moveScript = currentPC.GetComponent <MoveToClickPoint>();
        moveScript.SetCharacterActive();

        //Grabs all the enemy units on the level.
        if (enemyList == null)
        {
            UpdateEnemyList();
        }
        currentEnemyIndex = 0;
        currentEnemy      = enemyList[currentEnemyIndex];

        // Set booleans to default values.
        currentEnemyDone = true;
        turnOver         = false;
    }
Exemplo n.º 2
0
 public void PassTurn()
 {
     if (ActiveTurn == TurnOwner.Player)
     {
         ActiveTurn = TurnOwner.AI;
     }
     else
     {
         ActiveTurn = TurnOwner.Player;
     }
 }
Exemplo n.º 3
0
    //Function to end player turn.
    public void EndPlayerTurn()
    {
        //Sets current character to inactive.
        moveScript.SetCharacterInactive();

        //Updates bool in Player Camera to false.
        playerCamera.IsPlayerTurn = false;

        //Sets current turn to enemy.
        currentTurn = TurnOwner.Enemy;
        turnOver    = false;

        //Starts the enemy turn. This is currently a test function.
        StartEnemyTurn();
    }
Exemplo n.º 4
0
    //Function to switch to player turn.
    public void StartPlayerTurn()
    {
        //Sets current turn to player
        currentTurn = TurnOwner.Player;

        //Updates bool in Player Camera to true.
        playerCamera.IsPlayerTurn = true;

        //Sets the current character to first character.
        // ** NEED TO CHANGE THIS TO CHECK FOR ALIVE CHARACTERS ONCE STAT SHEET IS DONE.
        currentPCIndex = 0;
        currentPC      = pcList[0];

        //Sets the first PC to active state.
        moveScript = currentPC.GetComponent <MoveToClickPoint>();
        moveScript.SetCharacterActive();

        //Function in player camera to snap to first index character.
        playerCamera.StartNewTurn();
    }
Exemplo n.º 5
0
    //Function to switch to player turn.
    public void StartPlayerTurn()
    {
        //Sets current turn to player
        currentTurn = TurnOwner.Player;

        //Updates bool in Player Camera to true.
        playerCamera.IsPlayerTurn = true;

        //Sets the current character to first character.
        // ** NEED TO CHANGE THIS TO CHECK FOR ALIVE CHARACTERS ONCE STAT SHEET IS DONE.
        currentPCIndex = 0;
        currentPC      = pcList[0];

        // Checks for death state.
        playerCharTemp = currentPC.GetComponent <CharacterTemplate>();

        while (playerCharTemp.isDead == true)
        {
            // ** BUG ** DEAD GUY STILL GETS SELECTED;
            // ** NEED TO CHECK LOSE CONDITION HERE **
            currentPCIndex++;
            if (currentPCIndex == pcList.Length)
            {
                currentPCIndex = 0;
            }
            currentPC      = pcList[currentPCIndex];
            playerCharTemp = currentPC.GetComponent <CharacterTemplate>();
        }


        //Sets the first PC to active state.
        moveScript = currentPC.GetComponent <MoveToClickPoint>();
        moveScript.SetCharacterActive();

        //Function in player camera to snap to first index character.
        playerCamera.StartNewTurn();
    }
Exemplo n.º 6
0
 private void OnTurnOwnerChanged(object sender, TurnOwner turnOwner)
 {
 }