Example #1
0
 protected override void Start()
 {
     base.Start();
     FirecampGroupsManager.Get().OnCreateFirecamp(this);
     this.m_FireLevel = 1f;
     this.SetupEffects();
     if (this.m_IgniteOnStart)
     {
         this.Ignite();
     }
     if (this.m_Freezed)
     {
         ItemSlot[] cookingSlots = this.m_CookingSlots;
         for (int i = 0; i < cookingSlots.Length; i++)
         {
             cookingSlots[i].gameObject.SetActive(false);
         }
         this.m_WoodSlot.gameObject.SetActive(false);
         this.m_Light.gameObject.SetActive(true);
         for (int j = 0; j < this.m_Particles.Count; j++)
         {
             this.m_Particles[j].gameObject.SetActive(true);
         }
         if (this.m_FireAnim)
         {
             this.m_FireAnim.SetActive(true);
         }
         base.enabled = false;
         base.Invoke("Freeze", 2f);
     }
 }
Example #2
0
    public void Update()
    {
        if (EnemyAISpawnManager.Get().m_TimeToNextSpawnWave > 0f)
        {
            this.m_BurningFactor = 0f;
            return;
        }
        bool flag = false;

        using (List <IFireObject> .Enumerator enumerator = this.m_Firecamps.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                if (enumerator.Current.IsBurning())
                {
                    flag = true;
                    break;
                }
            }
        }
        if (flag)
        {
            this.m_BurningFactor += Time.deltaTime * FirecampGroupsManager.Get().m_BurningFactorIncreaseSpeed[(int)DifficultySettings.ActivePreset.m_BaseDifficulty];
        }
        else
        {
            this.m_BurningFactor -= Time.deltaTime * FirecampGroupsManager.Get().m_BurningFactorDecreaseSpeed[(int)DifficultySettings.ActivePreset.m_BaseDifficulty];
        }
        this.m_BurningFactor = Mathf.Clamp01(this.m_BurningFactor);
    }
 private void Update()
 {
     if (!DifficultySettings.ActivePreset.m_Tribes)
     {
         return;
     }
     if (ScenarioManager.Get().IsDreamOrPreDream())
     {
         return;
     }
     if (DifficultySettings.ActivePreset.m_Tribes)
     {
         this.UpdateCampGroups();
     }
     if (this.m_ScenarioBlock)
     {
         return;
     }
     if (this.m_ActiveGroup && this.m_ActiveGroup.IsWave())
     {
         FirecampGroupsManager.Get().ResetBurningFactors();
     }
     if (DifficultySettings.ActivePreset.m_Tribes)
     {
         this.UpdateGroupMembersCount();
         this.UpdateGroups(this.m_PatrolGroups);
         this.UpdateGroups(this.m_Groups);
         this.UpdateWaves();
     }
     if (DifficultySettings.ActivePreset.m_Predators)
     {
         this.UpdatePredators();
     }
 }
Example #4
0
 protected override void OnDestroy()
 {
     base.OnDestroy();
     if (FirecampGroupsManager.Get())
     {
         FirecampGroupsManager.Get().OnDestroyFirecamp(this);
     }
     base.UnregisterConstantUpdateItem();
 }
Example #5
0
 protected override void Start()
 {
     base.Start();
     if (this.m_State == CharcoalFurnace.State.None)
     {
         this.SetState(CharcoalFurnace.State.WaitingForWood, false);
     }
     FirecampGroupsManager.Get().OnCreateFirecamp(this);
 }
Example #6
0
 protected override void OnDisable()
 {
     base.OnDisable();
     Construction.s_EnabledConstructions.Remove(this);
     if (FirecampGroupsManager.Get() != null)
     {
         FirecampGroupsManager.Get().OnDestroyConstruction(this);
     }
 }
Example #7
0
 protected override void Start()
 {
     base.Start();
     if (this.m_State == Forge.State.None)
     {
         this.SetState(Forge.State.WaitingForItem);
     }
     HUDProcess.Get().RegisterProcess(this, "forge_charcoal", this, true);
     FirecampGroupsManager.Get().OnCreateFirecamp(this);
 }
        private void UpdateWaves()
        {
            if (!DifficultySettings.ActivePreset.m_Tribes)
            {
                return;
            }
            this.m_TimeToNextSpawnWave -= Time.deltaTime;
            if (this.m_TimeToNextSpawnWave < 0f)
            {
                this.m_TimeToNextSpawnWave = 0f;
            }
            else if (this.m_TimeToNextSpawnWave > 0f)
            {
                return;
            }
            if (this.m_ActivePredator)
            {
                return;
            }
            FirecampGroup groupToAttack = FirecampGroupsManager.Get().GetGroupToAttack();

            if (groupToAttack != null)
            {
                if (this.m_ActiveGroup)
                {
                    this.m_ActiveGroup.StartWave(groupToAttack);
                }
                else if (this.m_ActiveCampGroup)
                {
                    this.m_ActiveCampGroup.StartWave(groupToAttack);
                }
                else
                {
                    this.SpawnWave(UnityEngine.Random.Range(1, this.GetCurrentGroupMembersCount() + 1), false, groupToAttack);
                }
                FirecampGroupsManager.Get().ResetBurningFactors();
                this.m_TimeToNextSpawnWave = this.m_WaveSpawnCooldown[(int)DifficultySettings.ActivePreset.m_BaseDifficulty];
            }
        }
        public void UnblockSpawn()
        {
            this.m_ScenarioBlock = false;
            switch (DifficultySettings.ActivePreset.m_BaseDifficulty)
            {
            case GameDifficulty.Easy:
                this.m_TimeToNextSpawnGroup    = 1560f;
                this.m_TimeToNextSpawnPredator = 2100f;
                break;

            case GameDifficulty.Normal:
                this.m_TimeToNextSpawnGroup    = 900f;
                this.m_TimeToNextSpawnPredator = 900f;
                break;

            case GameDifficulty.Hard:
                this.m_TimeToNextSpawnGroup    = 600f;
                this.m_TimeToNextSpawnPredator = 600f;
                break;
            }
            this.m_TimeToNextSpawnWave = this.m_StartWaveSpawnCooldown[(int)DifficultySettings.ActivePreset.m_BaseDifficulty];
            FirecampGroupsManager.Get().ResetBurningFactors();
        }
Example #10
0
 protected override void OnEnable()
 {
     base.OnEnable();
     Construction.s_EnabledConstructions.Add(this);
     FirecampGroupsManager.Get().OnCreateConstruction(this);
 }
        private void ParseScript()
        {
            ScriptParser scriptParser = new ScriptParser();

            scriptParser.Parse("EnemySpawnData.txt", true);
            for (int i = 0; i < scriptParser.GetKeysCount(); i++)
            {
                Key key = scriptParser.GetKey(i);
                if (key.GetName() == "MinGroupMembersCount")
                {
                    this.m_MinGroupMembersCount = key.GetVariable(0).IValue;
                }
                else if (key.GetName() == "MaxGroupMembersCount")
                {
                    this.m_MaxGroupMembersCount = key.GetVariable(0).IValue;
                }
                else if (key.GetName() == "IncreaseGroupMembersInterval")
                {
                    this.m_IncreaseGroupMembersInterval = key.GetVariable(0).FValue;
                }
                else if (key.GetName() == "MaxActivationDistance")
                {
                    this.m_MaxActivationDistance = key.GetVariable(0).FValue;
                }
                else if (key.GetName() == "MinActivationDistance")
                {
                    this.m_MinActivationDistance = key.GetVariable(0).FValue;
                }
                else if (key.GetName() == "GroupSpawnCooldown")
                {
                    this.m_GroupSpawnCooldown = key.GetVariable(0).FValue;
                }
                else if (key.GetName() == "PredatorSpawnCooldown")
                {
                    this.m_PredatorSpawnCooldown = key.GetVariable(0).FValue;
                }
                else if (key.GetName() == "BurningFactorIncreaseSpeed")
                {
                    FirecampGroupsManager.Get().m_BurningFactorIncreaseSpeed[0] = key.GetVariable(0).FValue;
                    FirecampGroupsManager.Get().m_BurningFactorIncreaseSpeed[1] = key.GetVariable(1).FValue;
                    FirecampGroupsManager.Get().m_BurningFactorIncreaseSpeed[2] = key.GetVariable(2).FValue;
                }
                else if (key.GetName() == "BurningFactorDecreaseSpeed")
                {
                    FirecampGroupsManager.Get().m_BurningFactorDecreaseSpeed[0] = key.GetVariable(0).FValue;
                    FirecampGroupsManager.Get().m_BurningFactorDecreaseSpeed[1] = key.GetVariable(1).FValue;
                    FirecampGroupsManager.Get().m_BurningFactorDecreaseSpeed[2] = key.GetVariable(2).FValue;
                }
                else if (key.GetName() == "WaveSpawnCooldown")
                {
                    this.m_WaveSpawnCooldown[0] = key.GetVariable(0).FValue;
                    this.m_WaveSpawnCooldown[1] = key.GetVariable(1).FValue;
                    this.m_WaveSpawnCooldown[2] = key.GetVariable(2).FValue;
                }
                else if (key.GetName() == "StartWaveSpawnCooldown")
                {
                    this.m_StartWaveSpawnCooldown[0] = key.GetVariable(0).FValue;
                    this.m_StartWaveSpawnCooldown[1] = key.GetVariable(1).FValue;
                    this.m_StartWaveSpawnCooldown[2] = key.GetVariable(2).FValue;
                }
            }
        }