public override void Update()
 {
     this.iExistTimer++;
     if (this.iExistTimer % 30 == 0)
     {
         base.SendClientInstruction(1, new float[]
         {
             (float)this.iExistTimer
         });
     }
     this.xTransform.v2Pos += this.v2Direction * this.fVelocity;
     this.xTransform.v2ServerPos = this.xTransform.v2Pos;
     Program.game.sErrorOutputAddon = "Staht! ";
     this.xTrailEffect.RegisterPAA(this.xTransform.v2Pos, 0);
     this.xTrailEffect.Update();
     if (this.iStartup > 0)
     {
         this.iCounter++;
         if (this.iCounter < 60 && this.fVelocity < this.fFastVelocity)
         {
             this.fVelocity += 0.1f;
         }
         float fCurDir = Utility.Vector2ToRadiansReverse(this.v2Direction);
         float fTurnSpeed = 0.2f;
         fCurDir += fTurnSpeed;
         this.v2Direction = Utility.RadiansToVector2(fCurDir);
         this.iStartup--;
         if (this.iStartup == 0)
         {
             this.iCounter = 0;
             this.enState = _EnemySpells_CrowSwarm_OBSOLETE.State.FlyingFromTarget;
             this.iInAttackFlightCounter = this.iHurtBoxDelay;
         }
         return;
     }
     if (this.enState == _EnemySpells_CrowSwarm_OBSOLETE.State.FlyingToTarget || this.enState == _EnemySpells_CrowSwarm_OBSOLETE.State.FlyingFromTarget)
     {
         Program.game.sErrorOutputAddon = "Attaka! ";
         this.iInAttackFlightCounter++;
         if (CAS.NetworkRole != NetworkHelperInterface.NetworkRole.Client && !this.bToDie && this.iInAttackFlightCounter > this.iHurtBoxDelay && this.lxAttackPhases.Count < this.iAttackPhases && this.iInAttackFlightCounter - this.iHurtBoxDelay >= this.lxAttackPhases.Count)
         {
             AttackPhase xAPA = new AttackPhase(this);
             SphereCollider col = new SphereCollider(this.fAttackPhaseRadius, new Vector2(0f, 8f), new TransformComponent(Vector2.Zero), 0f, this);
             col.xAttackPhase = xAPA;
             col.bIsLarge = false;
             xAPA.lxCurrentColliders.Add(col);
             xAPA.xOwner = this;
             AttackStats xStat = new AttackStats();
             xStat.fKnockBack = 0f;
             xStat.iBreakingPower = -1;
             xStat.iBaseDamage = 5;
             xStat.bDontTriggerPlayerInvincibility = true;
             xStat.bFlatArmorPenetration = true;
             xAPA.lenLayers.Add(Collider.ColliderLayers.Players);
             xAPA.lenLayers.Add(Collider.ColliderLayers.Neutrals);
             xAPA.xStats = xStat;
             xAPA.RegisterCurrent();
             this.lxAttackPhases.Add(xAPA);
         }
     }
     if (CAS.NetworkRole != NetworkHelperInterface.NetworkRole.Client)
     {
         for (int i = 0; i < this.lxAttackPhases.Count; i++)
         {
             this.lxAttackPhases[i].lxCurrentColliders[0].xLocalTransform.v2Pos = this.xTrailEffect.GetRegisteredDelay(this.iHurtBoxDelay + (i + this.iRemovedPhases) * this.iDelayBetweenPhases);
         }
     }
     Program.game.sErrorOutputAddon = "Adastaff! ";
     if (this.enState == _EnemySpells_CrowSwarm_OBSOLETE.State.FlyingToTarget)
     {
         if (this.fVelocity < this.fFastVelocity)
         {
             this.fVelocity += 0.5f;
         }
         else
         {
             this.fVelocity = this.fFastVelocity;
         }
         if (Vector2.Distance(this.v2Target, this.xTransform.v2Pos) < this.fVelocity * 2f)
         {
             this.enState = _EnemySpells_CrowSwarm_OBSOLETE.State.FlyingFromTarget;
             this.iCounter = 0;
         }
     }
     else if (this.enState == _EnemySpells_CrowSwarm_OBSOLETE.State.FlyingFromTarget)
     {
         this.iCounter++;
         if (this.iCounter > this.iRubberBand && !this.bToDie)
         {
             this.enState = _EnemySpells_CrowSwarm_OBSOLETE.State.RecalibratingAim;
             this.v2Target = this.v2Origin + 50f * Utility.RandomizeVector2Direction(this.localRand);
             this.iCounter = 0;
             this.iInAttackFlightCounter = 0;
         }
         if (this.bToDie)
         {
             if (this.iCounter == this.iRubberBand + 60)
             {
                 this.xTrailEffect.FadeOut();
             }
             if (this.iCounter == this.iRubberBand + 120)
             {
                 this.xTrailEffect.Destroy();
             }
         }
     }
     else if (this.enState == _EnemySpells_CrowSwarm_OBSOLETE.State.RecalibratingAim)
     {
         Program.game.sErrorOutputAddon = "Recalibrata! ";
         Vector2 v2WantDir = (this.v2Target - this.xTransform.v2Pos).SafeNormalized();
         float fWantDir = Utility.Vector2ToRadiansReverse(v2WantDir);
         float fCurDir2 = Utility.Vector2ToRadiansReverse(this.v2Direction);
         float fWantDirModified = fWantDir;
         if (fWantDirModified < 0f)
         {
             fWantDirModified += 6.28318548f;
         }
         float fCurDirModified = fCurDir2;
         if (fCurDirModified < 0f)
         {
             fCurDirModified += 6.28318548f;
         }
         this.iCounter++;
         if (CAS.NetworkRole != NetworkHelperInterface.NetworkRole.Client && this.lxAttackPhases.Count > 0 && this.iCounter > this.iHurtBoxDelay)
         {
             int iMos = this.iCounter - this.iHurtBoxDelay;
             if (this.iAttackPhases - iMos / this.iDelayBetweenPhases - 1 < this.lxAttackPhases.Count)
             {
                 this.lxAttackPhases[0].UnregisterCurrent();
                 this.lxAttackPhases.RemoveAt(0);
                 this.iRemovedPhases++;
             }
         }
         float fTurnSpeed2 = 0.035f;
         if (this.iCounter > 120)
         {
             fTurnSpeed2 += (float)(this.iCounter - 120) / 300f;
         }
         bool bFound = false;
         float fTurnDistance = MathHelper.Distance(fWantDirModified, fCurDirModified);
         if (fTurnDistance <= fTurnSpeed2)
         {
             bFound = true;
             fCurDir2 = fWantDir;
         }
         else
         {
             fCurDir2 += fTurnSpeed2;
             if (fCurDir2 > 3.14159274f)
             {
                 fCurDir2 -= 6.28318548f;
             }
         }
         this.v2Direction = Utility.RadiansToVector2(fCurDir2);
         if (fTurnDistance > 0.7853982f)
         {
             this.fVelocity -= 0.1f;
         }
         else
         {
             this.fVelocity += 0.2f;
         }
         if (this.fVelocity < 2f)
         {
             this.fVelocity = 2f;
         }
         else if (this.fVelocity > this.fFastVelocity)
         {
             this.fVelocity = this.fFastVelocity;
         }
         if (bFound)
         {
             this.v2Direction = v2WantDir;
             this.enState = _EnemySpells_CrowSwarm_OBSOLETE.State.FlyingToTarget;
             this.iRemovedPhases = 0;
             for (int j = 0; j < this.lxAttackPhases.Count; j++)
             {
                 this.lxAttackPhases[j].UnregisterCurrent();
                 this.lxAttackPhases.RemoveAt(j--);
             }
         }
     }
     Program.game.sErrorOutputAddon = "End! ";
 }