示例#1
0
    // Start is called before the first frame update
    void Start()
    {
        currHP  = maxHP;
        hpState = healthState.DefaultState;

        currentStateManager = GameObject.Find("StateMachine").GetComponent <StateManager>();
    }
示例#2
0
 //Subtract HP
 public void DecreaseHP(float hpLoss)
 {
     hpState = healthState.LosingHP;
     currHP -= (hpLoss + (currentStateManager.waveCount * 5)); /** Increase damage loss with each wave. By default,
                                                                * this should mean that enemy and player both loss 30 HP on wave 1,
                                                                * with an additional 5 HP added as the game goes on (I am projecting a
                                                                * 50 HP loss by wave 5**/
 }
示例#3
0
 private void writePaper()
 {
     if (haveLetter != letterList.HaveWritten)
     {
         if (Input.GetKey(KeyCode.E) && (haveLetter == letterList.Have || haveLetter == letterList.IsWriting) && onDoor == false)
         {
             Health = healthState.Paper;
             MasterAudio.PlaySound("paper_in");
             MasterAudio.PlaySound("writting");
             haveLetter = letterList.IsWriting;
             levMan.writtenPaper += LevelManager.TUNING.writingSpeed;
             paper.alpha = 1f;
             papertxt.color = papertxt.initColor;
             papertxt.text = levMan.realWrittenPaper + "%";
             paper.transform.parent.rotation = Quaternion.Euler(new Vector3(0f, 0f, 0f));
         }
         else if (Input.GetKeyUp(KeyCode.E) && (haveLetter == letterList.Have || haveLetter == letterList.IsWriting) && onDoor == false)
         {
             Health = healthState.Alive;
             MasterAudio.StopAllOfSound("writting");
             MasterAudio.PlaySound("paper_out");
             paper.alpha = 0f;
             papertxt.color = Color.clear;
             paper.transform.parent.rotation = Quaternion.Euler(new Vector3(0f, 0f, 0f));
         }
     }
     if (levMan.writtenPaper > 100 && haveLetter != letterList.Sent)
     {
         MasterAudio.StopAllOfSound("writting");
         Health = healthState.Alive;
         haveLetter = letterList.HaveWritten;
         paper.alpha = 0f;
         papertxt.color = Color.clear;
     }
 }
示例#4
0
 private void Respawn()
 {
     Health = healthState.Alive;
     foodState = 3;
     sleepState = 3;
     haveLetter = letterList.DontHave;
     transform.position = initpos;
     InvokeRepeating("consumeFood", LevelManager.TUNING.delaySecConsumeFood, LevelManager.TUNING.everySecConsumeFood);
     InvokeRepeating("consumeSleep", LevelManager.TUNING.delaySecConsumeSleep, LevelManager.TUNING.everySecConsumeSleep);
 }
示例#5
0
 private void GameStart()
 {
     Health = healthState.Cutscene;
     haveLetter = letterList.DontHave;
 }
示例#6
0
 private void GameOver()
 {
     print (LevelManager.CAUSEDEATH);
     Health = healthState.Dead;
     if (LevelManager.CAUSEDEATH == LevelManager.DeathList.Dracula)
     {
         PlayAnim("die");
     }
     CancelInvoke("Foots");
     CancelInvoke("consumeFood");
     CancelInvoke("consumeSleep");
 }
示例#7
0
 //Add HP
 public void IncreaseHP(float hpGain)
 {
     hpState = healthState.GainingHP;
     currHP += hpGain;
 }