Example #1
0
 private bool IsBSCondition(BSCondition cond, float val)
 {
     if (cond == BSCondition.Fat)
     {
         return(val > this.m_PlayerConditionModule.GetNutritionFat() / this.m_PlayerConditionModule.GetMaxNutritionFat());
     }
     if (cond == BSCondition.Carbo)
     {
         return(val > this.m_PlayerConditionModule.GetNutritionCarbo() / this.m_PlayerConditionModule.GetMaxNutritionCarbo());
     }
     if (cond == BSCondition.Proteins)
     {
         return(val > this.m_PlayerConditionModule.GetNutritionProtein() / this.m_PlayerConditionModule.GetMaxNutritionProtein());
     }
     if (cond == BSCondition.Infected)
     {
         return(this.m_PlayerInjuryModule.GetNumWoundsOfState(InjuryState.Infected) > 0);
     }
     if (cond == BSCondition.Bleeding)
     {
         return(this.m_PlayerInjuryModule.GetNumWoundsOfState(InjuryState.Bleeding) > 0);
     }
     if (cond == BSCondition.Cut)
     {
         return(this.m_PlayerInjuryModule.GetNumWoundsOfType(InjuryType.Laceration) > 0 || this.m_PlayerInjuryModule.GetNumWoundsOfType(InjuryType.LacerationCat) > 0);
     }
     if (cond == BSCondition.FoodPoison)
     {
         return(this.m_PlayerDiseasesModule.GetDisease(ConsumeEffect.FoodPoisoning).m_Level > 0);
     }
     if (cond == BSCondition.Sanity)
     {
         return(val > (float)this.m_PlayerSanityModule.m_Sanity);
     }
     if (cond == BSCondition.Poison)
     {
         return(this.m_PlayerInjuryModule.GetNumWoundsOfType(InjuryType.SnakeBite) > 0 || this.m_PlayerInjuryModule.GetNumWoundsOfType(InjuryType.VenomBite) > 0);
     }
     if (cond == BSCondition.Hydration)
     {
         return(val > this.m_PlayerConditionModule.GetHydration() / this.m_PlayerConditionModule.GetMaxHydration());
     }
     if (cond == BSCondition.Fever)
     {
         return(this.m_PlayerDiseasesModule.GetDisease(ConsumeEffect.Fever).m_Level > 0);
     }
     if (cond == BSCondition.HasFire)
     {
         ItemsManager.Get().IsAnyFirecampBurning();
     }
     return(false);
 }
Example #2
0
    private void ParseParametersScript()
    {
        ScriptParser scriptParser = new ScriptParser();

        scriptParser.Parse("Balance/BalanceParameters.txt", true);
        for (int i = 0; i < scriptParser.GetKeysCount(); i++)
        {
            Key key = scriptParser.GetKey(i);
            if (key.GetName() == "HPWeight")
            {
                this.m_HPWeight = key.GetVariable(0).FValue;
            }
            else if (key.GetName() == "HydrationWeight")
            {
                this.m_HydrationWeight = key.GetVariable(0).FValue;
            }
            else if (key.GetName() == "EnergyWeight")
            {
                this.m_EnergyWeight = key.GetVariable(0).FValue;
            }
            else if (key.GetName() == "ProteinsWeight")
            {
                this.m_ProteinsWeight = key.GetVariable(0).FValue;
            }
            else if (key.GetName() == "FatWeight")
            {
                this.m_FatWeight = key.GetVariable(0).FValue;
            }
            else if (key.GetName() == "CarbsWeight")
            {
                this.m_CarbsWeight = key.GetVariable(0).FValue;
            }
            else if (key.GetName() == "HaveItemWeight")
            {
                this.m_HaveItemWeight = key.GetVariable(0).FValue;
            }
            else if (key.GetName() == "HaveFireWeight")
            {
                this.m_HaveFireWeight = key.GetVariable(0).FValue;
            }
            else if (key.GetName() == "SanityWeight")
            {
                this.m_SanityWeight = key.GetVariable(0).FValue;
            }
            else if (key.GetName() == "InfectedWoundWeight")
            {
                this.m_InfectedWoundWeight = key.GetVariable(0).FValue;
            }
            else if (key.GetName() == "SnakeBiteLvlWeight")
            {
                this.m_SnakeBiteLvlWeight = key.GetVariable(0).FValue;
            }
            else if (key.GetName() == "FoodPoisonLvlWeight")
            {
                this.m_FoodPoisonLvlWeight = key.GetVariable(0).FValue;
            }
            else if (key.GetName() == "BleedingWeight")
            {
                this.m_BleedingWeight = key.GetVariable(0).FValue;
            }
            else if (key.GetName() == "CutWoundWeight")
            {
                this.m_CutWoundWeight = key.GetVariable(0).FValue;
            }
            else if (key.GetName() == "InsectWoundWeight")
            {
                this.m_InsectWoundWeight = key.GetVariable(0).FValue;
            }
            else if (key.GetName() == "MaxNumGroupPriority")
            {
                if (!this.m_Groups.ContainsKey(key.GetVariable(0).SValue))
                {
                    DebugUtils.Assert("Can't find group - " + key.GetVariable(0).SValue, true, DebugUtils.AssertType.Info);
                }
                else
                {
                    this.m_Groups[key.GetVariable(0).SValue] = key.GetVariable(1).IValue;
                }
            }
            else if (key.GetName() == "BalanceSpawnerCooldown")
            {
                BalanceSystem.s_BalanceSpawnerCooldown = key.GetVariable(0).FValue;
            }
            else if (key.GetName() == "BalanceSpawnerCheckCooldown")
            {
                BalanceSystem.s_BalanceSpawnerCheckCooldown = key.GetVariable(0).FValue;
            }
            else if (key.GetName() == "HumanAIStaticCooldown")
            {
                this.m_HumanAIStaticCooldown = key.GetVariable(0).FValue;
            }
            else if (key.GetName() == "HumanAIWaveCooldown")
            {
                this.m_HumanAIWaveCooldown = key.GetVariable(0).FValue;
            }
            else if (key.GetName() == "MinHumanAISpawnCount")
            {
                this.m_MinHumanAISpawnCount = key.GetVariable(0).IValue;
            }
            else if (key.GetName() == "MaxHumanAISpawnCount")
            {
                this.m_MaxHumanAISpawnCount = key.GetVariable(0).IValue;
            }
            else if (key.GetName() == "IncreaseHumanAISpawnCountInterval")
            {
                this.m_IncreaseHumanAISpawnCountInterval = key.GetVariable(0).FValue;
            }
            else if (key.GetName() == "JaguarCooldown")
            {
                this.m_JaguarCooldown = key.GetVariable(0).FValue;
            }
            else if (key.GetName() == "BSConditionCooldown")
            {
                BSCondition key2   = (BSCondition)Enum.Parse(typeof(BSCondition), key.GetVariable(0).SValue);
                float       fvalue = key.GetVariable(1).FValue;
                this.m_BSConditionCooldown.Add((int)key2, fvalue);
                this.m_BSConditionNextTime.Add((int)key2, float.MinValue);
            }
        }
    }