Ejemplo n.º 1
0
 public void LaserActive()
 {
     //Debug.Log("Laser");
     if (jumpState)
     {
         JumpActive();
     }
     else if (shieldState)
     {
         ShieldActive();
     }
     else if (rocketState)
     {
         RocketsActive();
     }
     //Debug.Log(abilityUsed);
     if (turnManager.playerTurn && weaponState && !abilityUsed && turnManager.combatActive || laserState)
     {
         //When this function is called, it checks the current state of the laser abilty then switches to the other state and applies the necessary updates
         if (laserState)
         {
             laserState    = false; //the laser state was true, so set it false
             abilityActive = laserState;
             //player.GetComponent<MovementController>().abilityActive = laserState; //set the abilityActive variable in the MovementController equal to the laser state
             mapManager.UpdateHighlight(laserRange, player.GetComponent <MovementController>().playerCellPosition, laserState); //call the method that will update the map display to disable the range display
         }
         else
         {
             laserState    = true; //the laser state was false, so set it true
             abilityActive = laserState;
             //player.GetComponent<MovementController>().abilityActive = laserState; //set the abilityActive variable in the MovementController equal to the laser state
             mapManager.UpdateHighlight(laserRange, player.GetComponent <MovementController>().playerCellPosition, laserState); //call the method that will update the map display to enable the range display
         }
     }
     else if (!turnManager.combatActive)
     {
         //mapManager.ClearHighlighting();
         laserState    = false; //the laser state was true, so set it false
         abilityActive = laserState;
         //player.GetComponent<MovementController>().abilityActive = laserState; //set the abilityActive variable in the MovementController equal to the laser state
         mapManager.UpdateHighlight(laserRange, player.GetComponent <MovementController>().playerCellPosition, laserState); //call the method that will update the map display to disable the range display
     }
     if (mapManager.saveName == "TutorialFile" && weaponState)
     {
         tutorialManager.ExplainLaser();
     }
 }