public override void Tick()
        {
            base.Tick();

            if (this.m_constructionTimer != null)
            {
                if (this.m_level.GetRemainingClockTowerBoostTime() > 0 &&
                    this.m_data.GetVillageType() == 1)
                {
                    this.m_constructionTimer.SetFastForward(this.m_constructionTimer.GetFastForward() + 4 * LogicDataTables.GetGlobals().GetClockTowerBoostMultiplier() - 4);
                }

                if (this.m_constructionTimer.GetRemainingSeconds(this.m_level.GetLogicTime()) <= 0)
                {
                    this.FinishConstruction(false);
                }
            }

            if (this.m_disarmed)
            {
                if (this.m_fadeTime >= 0)
                {
                    this.m_fadeTime = LogicMath.Min(this.m_fadeTime + 64, 1000);
                }
            }

            LogicTriggerComponent triggerComponent = this.GetTriggerComponent();

            if (triggerComponent.IsTriggered() && !this.m_disarmed && !this.m_upgrading)
            {
                LogicTrapData data = this.GetTrapData();

                if (this.m_numSpawns > 0)
                {
                    if (this.m_spawnInitDelay != 0)
                    {
                        this.m_spawnInitDelay -= 1;
                    }
                    else
                    {
                        this.SpawnUnit(1);
                        this.m_numSpawns     -= 1;
                        this.m_spawnInitDelay = this.GetTrapData().GetTimeBetweenSpawnsMS() / 64;
                    }
                }

                if (this.m_actionTime >= 0)
                {
                    this.m_actionTime += 64;
                }

                if (this.m_hitTime >= 0)
                {
                    this.m_hitTime += 64;
                }

                if (this.m_actionTime > data.GetActionFrame())
                {
                    this.m_hitTime    = data.GetHitDelayMS();
                    this.m_actionTime = -1;
                }
                else if (this.m_hitTime > data.GetHitDelayMS())
                {
                    if (data.GetSpell() != null)
                    {
                        LogicSpell spell = (LogicSpell)LogicGameObjectFactory.CreateGameObject(data.GetSpell(), this.m_level, this.m_villageType);

                        spell.SetUpgradeLevel(0);
                        spell.SetInitialPosition(this.GetMidX(), this.GetMidY());
                        spell.SetTeam(1);

                        this.GetGameObjectManager().AddGameObject(spell, -1);
                    }
                    else if (data.GetProjectile(this.m_upgLevel) != null)
                    {
                        this.CreateProjectile(data.GetProjectile(this.m_upgLevel));
                    }
                    else if (data.GetDamageMod() != 0)
                    {
                        this.m_level.AreaBoost(this.GetMidX(), this.GetMidY(), data.GetDamageRadius(this.m_upgLevel), -data.GetSpeedMod(), -data.GetSpeedMod(), data.GetDamageMod(),
                                               0, data.GetDurationMS() / 16, 0, false);
                    }
                    else if (data.GetEjectVictims())
                    {
                        if (data.GetThrowDistance() <= 0)
                        {
                            this.EjectCharacters();
                        }
                        else
                        {
                            this.ThrowCharacters();
                        }
                    }
                    else
                    {
                        bool defaultMode = true;

                        if (data.GetSpawnedCharAir() != null && data.GetSpawnedCharGround() != null || data.HasAlternativeMode())
                        {
                            int activeLayout = this.m_level.GetActiveLayout();

                            if (activeLayout <= 7)
                            {
                                defaultMode = this.m_useAirMode[activeLayout] ^ true;
                            }
                        }

                        this.m_level.AreaDamage(0, this.GetMidX(), this.GetMidY(), data.GetDamageRadius(this.m_upgLevel), data.GetDamage(this.m_upgLevel),
                                                data.GetPreferredTarget(),
                                                data.GetPreferredTargetDamageMod(), data.GetDamageEffect(), 1, null, defaultMode ? 1 : 0, 0, 100, true, false, 100, 0, this, 100,
                                                0);
                    }

                    this.m_hitTime   = 0;
                    this.m_hitCount += 1;

                    if (this.m_hitCount >= data.GetHitCount() && this.m_numSpawns == 0)
                    {
                        this.m_fadeTime       = 1;
                        this.m_hitTime        = -1;
                        this.m_disarmed       = true;
                        this.m_numSpawns      = data.GetNumSpawns(this.m_upgLevel);
                        this.m_spawnInitDelay = data.GetSpawnInitialDelayMS() / 64;
                    }
                }
            }
        }