protected override void Update(uint dt)
        {
            BuffNode next;

            for (BuffNode buffNode = this.buffNodeList.Head; buffNode != null; buffNode = next)
            {
                next = buffNode.Next;
                buffNode.BuffComp.UpdateBuffs(dt);
            }
            for (TroopNode troopNode = this.troopNodeList.Head; troopNode != null; troopNode = troopNode.Next)
            {
                this.troopAttackController.UpdateTroop((SmartEntity)troopNode.Entity);
            }
            this.specialAttackController.UpdateSpecialAttacks();
            for (TurretNode turretNode = this.turretNodeList.Head; turretNode != null; turretNode = turretNode.Next)
            {
                this.turretAttackController.UpdateTurret((SmartEntity)turretNode.Entity);
            }
        }
Exemple #2
0
        protected override void Update(uint dt)
        {
            this.HandleDeferredUserInuput();
            this.battleController.UpdateBattleTime(dt);
            if (this.audioResetDeltaAccumulator >= this.audioResetDeltaMax)
            {
                this.audioManager.ResetBattleAudioFlags();
                this.audioResetDeltaAccumulator = 0u;
            }
            else
            {
                this.audioResetDeltaAccumulator += dt;
            }
            int num = 0;

            for (BuildingNode buildingNode = this.buildingNodeList.Head; buildingNode != null; buildingNode = buildingNode.Next)
            {
                num += this.battleController.GetHealth(buildingNode.BuildingComp.BuildingType.Type, buildingNode.HealthComp);
            }
            bool flag = true;

            for (TroopNode troopNode = this.troopNodeList.Head; troopNode != null; troopNode = troopNode.Next)
            {
                if (troopNode.TeamComp.TeamType == TeamType.Attacker && !troopNode.HealthComp.IsDead() && !troopNode.TroopComp.TroopType.IsHealer)
                {
                    flag = false;
                    break;
                }
            }
            if (flag && this.specialAttackController.HasUnexpendedSpecialAttacks())
            {
                flag = false;
            }
            this.battleController.UpdateCurrentHealth(num);
            if (flag)
            {
                this.battleController.OnAllTroopsDead();
            }
            TeamType type = (!this.battleController.GetCurrentBattle().IsRaidDefense()) ? TeamType.Attacker : TeamType.Defender;

            this.squadTroopAttackController.UpdateSquadTroopSpawnQueue(type);
        }