Example #1
0
    // Update is called once per frame
    public void Update(float deltaTime)
    {
        NeedActions.CallFunctionsWithNeed(luaUpdate, this, deltaTime);
        if (luaOnly)
        {
            return;
        }

        Amount += growthRate * deltaTime;
        if (character != null && character.CurrTile.GetGasPressure("O2") < 0.15)
        {
            Amount += (addedInVacuum - (addedInVacuum * (character.CurrTile.GetGasPressure("O2") * 5))) * deltaTime;
        }

        if (Amount > 75 && character.MyJob.IsNeed == false)
        {
            Debug.ULogChannel("Need", character.name + " needs " + Name);
            character.AbandonJob(false);
        }

        if (Amount == 100 && character.MyJob.Critical == false && CompleteOnFail)
        {
            Debug.ULogChannel("Need", character.name + " failed their " + Name + " need.");
            character.AbandonJob(false);
        }

        if (Amount == 100)
        {
            // FIXME: Insert need fail damage code here.
        }
    }
Example #2
0
    // Update is called once per frame
    public void Update(float deltaTime)
    {
        NeedActions.CallFunctionsWithNeed(luaUpdate, this, deltaTime);
        if (luaOnly)
        {
            return;
        }

        Amount += growthRate * deltaTime;

        if (character != null && character.CurrTile.GetGasPressure("O2") < 0.15)
        {
            Amount += (addedInVacuum - (addedInVacuum * (character.CurrTile.GetGasPressure("O2") * 5))) * deltaTime;
        }

        if (Amount == 100)
        {
            // FIXME: Insert need fail damage code here.
        }
    }