示例#1
0
    public void TakeDamage(Nurse nurse)
    {
        nursePosBeforeHit = nurse.position;

        if (nurse.isDefusing)
        {
            MessageSystem.instance.Print("Mine defused at " + nursePosBeforeHit.Convert());
            GameManager.instance.bf.Demine(nursePosBeforeHit);
            nurse.isDefusing = false;
            MessageSystem.instance.Print("Defuse buff is lost");

            return;
        }

        if (nurse.toughness > 0)
        {
            nurse.toughness--;
            GameManager.instance.NurseStepsOnMineWithToughness();
            GameManager.instance.bf.Demine(nursePosBeforeHit);
            MessageSystem.instance.Print("Ouch!");
        }
        else
        {
            MessageSystem.instance.Print("Sorry team :(");
            GameManager.instance.NurseStepsOnMine();
            nurse.MoveNurseBackToTrench();
            GameManager.instance.bf.Demine(nursePosBeforeHit);
            GameLoop.instance.DeselectTheCurrentNurse();
        }
        Debug.Log("E");
        Instantiate(explosion, explosePosition);
    }