public void ActuallyGoOut()
    {
        int rand = Mathf.FloorToInt(Random.Range(0, 5));

        switch (rand)
        {
        case 0:
            controller.Log("Did this always take so long?");
            break;

        case 1:
            controller.Log("Nice weather we're having today...");
            break;

        case 2:
            controller.Log("Vito shows no sign of yielding.");
            break;

        case 3:
            controller.Log("Vito waddles after a passing dog before reaching the end of his leash and going back to his business.");
            break;

        default:
            controller.Log("Vito's eyes meet yours, it's awkward.");
            break;
        }

        if (Blackboard.GetGoOut() > 25)
        {
            Blackboard.DeltaGoOut(-25);
        }
        else
        {
            Blackboard.SetGoOut(0);
        }

        Task.current.Succeed();
    }
Exemple #2
0
    // Update is called once per frame
    void Update()
    {
        if (day != Clock.getDays())
        {
            ShuffleHours();
            day = Clock.getDays();
        }

        if (Blackboard.GetLonely() >= Blackboard.LLCut)
        {
            isLonely = true;
        }
        else
        {
            isLonely = false;
        }

        if (Blackboard.GetHungry() >= Blackboard.HCut)
        {
            isHungry = true;
        }
        else
        {
            isHungry = false;
        }

        if (Blackboard.GetTired() >= Blackboard.SCut)
        {
            isTired = true;
        }
        else
        {
            isTired = false;
        }

        if (Blackboard.GetGoOut() >= Blackboard.GOCut)
        {
            isGoOut = true;
        }
        else
        {
            isGoOut = false;
        }

        if (Blackboard.HeardNoise)
        {
            isAlerted = true;
        }

        if (Blackboard.GetLonely() >= Blackboard.PCut)
        {
            isPlayful = true;
        }

        TUpTime = getTime();
        HUpTime = getTime();
        LUpTime = getTime();
        GUpTime = getTime();

        //Debug.Log("TCurr: " + TCurrTime + " TUp: " + TUpTime + " -: " + (TCurrTime - TUpTime) + " c: " + calcStep(16));
        if (TUpTime - TCurrTime >= calcStep(16))
        {
            TCurrTime += calcStep(16);
            Blackboard.DeltaTired(1);
        }

        if (HUpTime - HCurrTime >= calcStep(6))
        {
            HCurrTime += calcStep(6);
            Blackboard.DeltaHungry(1);
        }

        if (LUpTime - LCurrTime >= calcStep(8))
        {
            LCurrTime += calcStep(8);
            Blackboard.DeltaLonely(1);
        }

        if (GUpTime - GCurrTime >= calcStep(7))
        {
            GCurrTime += calcStep(7);
            Blackboard.DeltaGoOut(1);
        }
    }