示例#1
0
 private void ChangeAction(SeasonHydraAI.Action enChangeTo)
 {
     this.enCurrentAction = enChangeTo;
     this.sSubAction = "";
 }
示例#2
0
 public override void OnUpdate()
 {
     if (this.xOwner.bToBeDestroyed || !this.bActive)
     {
         return;
     }
     bool bOffSeason = (this.xOwner.enType == EnemyCodex.EnemyTypes.SeasonHydra_Winter && RenderMaster.enCurrentPass != RenderMaster.PlayfieldRenderPass.Season_Winter) || (this.xOwner.enType == EnemyCodex.EnemyTypes.SeasonHydra_Autumn && RenderMaster.enCurrentPass != RenderMaster.PlayfieldRenderPass.Season_Fall) || (this.xOwner.enType == EnemyCodex.EnemyTypes.SeasonHydra_Summer && RenderMaster.enCurrentPass != RenderMaster.PlayfieldRenderPass.Season_Summer);
     int iDeadHeads = 0;
     if (this.xHydraBagman != null)
     {
         iDeadHeads = this.xHydraBagman.GetDeadHeads();
     }
     this.iCounter++;
     this.iExistCounter++;
     this.iTimeInSeason++;
     this.iNextHardUpdate--;
     if (this.iCannotBreathFor > 0)
     {
         this.iCannotBreathFor--;
     }
     if (this.iEvolveCounter > 0)
     {
         float fWhiteGrade = 1f;
         int iFrame = this.iEvolveCounter / 4;
         if (iFrame == 1 && !bOffSeason)
         {
             SortedAnimated xEfe = (SortedAnimated)Program.game._EffectMaster_AddEffect(new SortedAnimated(Vector2.Zero, SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_SeasonHydra_EvolveEffect));
             xEfe.xRenderComponent.xTransform = this.xOwner.xTransform;
             this.iTimeInSeason = 0;
             this.iBreathsDone = 0;
             this.iLastOrbLightAt = 0;
         }
         if (this.iEvolveCounter == 4)
         {
             float fPassedTicks = this.xOwner.xRenderComponent.fPassedTicks;
             if (!bOffSeason)
             {
                 this.xOwner.xRenderComponent.SwitchAnimation((ushort)(this.xOwner.xRenderComponent.iActiveAnimation - 100));
                 this.xOwner.xRenderComponent.fPassedTicks = fPassedTicks;
                 this.xOwner.xRenderComponent.Update();
             }
             else
             {
                 this.xOwner.xRenderComponent.SwitchAnimation((ushort)(this.xOwner.xRenderComponent.iActiveAnimation + 100));
                 this.xOwner.xRenderComponent.fPassedTicks = fPassedTicks;
                 this.xOwner.xRenderComponent.Update();
             }
         }
         if (iFrame == 5)
         {
             fWhiteGrade = 0.5f;
         }
         if (!bOffSeason)
         {
             this.xOwner.xRenderComponent.SetEffect(Program.game.dsxEffects["FlashWhite"], 10);
             this.xOwner.xRenderComponent.dsfFloatShaderParameters["WhiteGrade"] = fWhiteGrade;
             this.xOwner.xRenderComponent.cColor = new Color(255, 255, 207);
         }
         this.iEvolveCounter++;
         if (this.iEvolveCounter == 6)
         {
             this.iEvolveCounter = 0;
             this.xOwner.xRenderComponent.ClearEffect();
             this.xOwner.xRenderComponent.cColor = Color.White;
         }
     }
     if (!bOffSeason && this.iTimeInSeason >= 1200 && this.iTimeInSeason >= this.iLastOrbLightAt + 900 && this.iEvolveCounter == 0 && this.enCurrentAction == SeasonHydraAI.Action.Chillin)
     {
         if (this.xHydraBagman != null)
         {
             this.xHydraBagman.LightOrbs();
         }
         this.iLastOrbLightAt = this.iTimeInSeason;
     }
     if (this.xPlayerLockedOnto == null)
     {
         this.xPlayerLockedOnto = CAS.LocalPlayer.xEntity;
     }
     Vector2 v2PretendHeadPos = this.xOwner.xTransform.v2Pos;
     if (this.xOwner.xRenderComponent.iActiveAnimation >= 27 && this.xOwner.xRenderComponent.iActiveAnimation <= 30)
     {
         v2PretendHeadPos.Y -= 13f;
     }
     else if (this.xOwner.xRenderComponent.iActiveAnimation >= 31 && this.xOwner.xRenderComponent.iActiveAnimation <= 32)
     {
         if (this.xOwner.xRenderComponent.GetCurrentAnimation().iRenderedFrame == 7)
         {
             v2PretendHeadPos.Y -= 9f;
         }
         else if (this.xOwner.xRenderComponent.GetCurrentAnimation().iRenderedFrame == 8)
         {
             v2PretendHeadPos.Y -= 5f;
         }
         else if (this.xOwner.xRenderComponent.GetCurrentAnimation().iRenderedFrame == 9)
         {
             v2PretendHeadPos.Y -= 2f;
         }
     }
     for (int i = 0; i < this.lxBalls.Count; i++)
     {
         this.lxBalls[i].Update();
         if (i > 0)
         {
             this.lxBalls[i].xRC.fVirtualHeight = this.lxBalls[0].xRC.xTransform.v2Pos.Y - this.lxBalls[i].xRC.xTransform.v2Pos.Y + (float)i;
         }
         if (this.lxBalls[i].xRC.xTransform.v2Pos.Y >= this.v2RootPosition.Y + 10f)
         {
             this.lxBalls[i].xRC.fVirtualHeight = (float)(-(float)(this.lxBalls.Count - i));
         }
         else if (this.lxBalls[i].xRC.xTransform.v2Pos.Y >= this.v2RootPosition.Y)
         {
             this.lxBalls[i].xRC.fVirtualHeight = (float)(-(float)(this.lxBalls.Count - i) * 4);
         }
     }
     this.xOwner.xRenderComponent.fVirtualHeight = this.lxBalls[0].xRC.xTransform.v2Pos.Y - v2PretendHeadPos.Y + (float)this.lxBalls.Count + 10f;
     if (this.xOwner.xTransform.v2Pos.Y > this.v2RootPosition.Y)
     {
         this.xOwner.xRenderComponent.fVirtualHeight = 0f;
     }
     bool bLockedHead = false;
     for (int j = 1; j < this.lxBalls.Count; j++)
     {
         float fGradePerMos = (float)j / (float)this.lxBalls.Count;
         this.lxBalls[j].xRC.xTransform.v2Pos = Vector2.Lerp(this.v2RootPosition, v2PretendHeadPos, fGradePerMos);
     }
     for (int k = 0; k < this.lxBalls.Count; k++)
     {
         float fGrade = (float)k / (float)this.lxBalls.Count;
         fGrade *= 6.28318548f;
         float fCount = (float)((this.iExistCounter + (int)this.v2RootPosition.X) % 90) / 90f;
         fGrade += 6.28318548f * fCount;
         float fSin = (float)Math.Sin((double)fGrade);
         this.lxBalls[k].xRC.v2OffsetRenderPos.X = fSin * 6f * this.fWiggleGrade;
         if (this.iNeckPostHeadbuttWobbleCycle > 0)
         {
             int iDelay = (this.lxBalls.Count - k) * 15;
             int iMiniCycle = 160;
             if (this.iNeckPostHeadbuttWobbleCycle >= iDelay && this.iNeckPostHeadbuttWobbleCycle <= iDelay + iMiniCycle)
             {
                 float fWubGrade = (float)(this.iNeckPostHeadbuttWobbleCycle - iDelay) / (float)iMiniCycle;
                 fWubGrade = Utility.Float_PauseInMiddleFrang(fWubGrade);
                 fWubGrade = (float)Math.Sin((double)(fWubGrade * 3.14159274f));
                 float fWubHeight = (float)(k * 6 + 3);
                 this.lxBalls[k].xRC.v2OffsetRenderPos.Y = -fWubHeight * fWubGrade;
             }
             this.iNeckPostHeadbuttWobbleCycle++;
         }
     }
     if (!bLockedHead)
     {
         float fGrade2 = 1f;
         fGrade2 *= 6.28318548f;
         float fCount2 = (float)((this.iExistCounter + (int)this.v2RootPosition.X) % 90) / 90f;
         fGrade2 += 6.28318548f * fCount2;
         float fSin2 = (float)Math.Sin((double)fGrade2);
         this.xOwner.xRenderComponent.v2OffsetRenderPos.X = fSin2 * 6f * this.fWiggleGrade;
     }
     if (this.bTurningAllowed)
     {
         if (this.iDirection == 1 && this.iTurning == 0 && this.xPlayerLockedOnto.xTransform.v2Pos.X < this.xOwner.xTransform.v2Pos.X - 20f)
         {
             this.iTurning = -1;
             this.iTurnCounter = 0;
         }
         else if (this.iDirection == -1 && this.iTurning == 0 && this.xPlayerLockedOnto.xTransform.v2Pos.X > this.xOwner.xTransform.v2Pos.X + 20f)
         {
             this.iTurning = 1;
             this.iTurnCounter = 0;
         }
     }
     if (this.enCurrentAction != SeasonHydraAI.Action.NormalAttack && Utility.IsWithinRange((int)this.lxBalls[this.lxBalls.Count - 1].xRC.iActiveAnimation, 4, 7))
     {
         byte byAttackAdd;
         if (this.v2AttackDirection.X > 0.2f)
         {
             byAttackAdd = 0;
         }
         else if (this.v2AttackDirection.X < -0.2f)
         {
             byAttackAdd = 3;
         }
         else if (this.v2AttackDirection.X < -0f)
         {
             byAttackAdd = 2;
         }
         else
         {
             byAttackAdd = 1;
         }
         for (int l = 0; l < this.lxBalls.Count; l++)
         {
             if (this.xOwner.xTransform.v2Pos.Y + (float)(7 * l) < this.v2RootPosition.Y)
             {
                 this.lxBalls[l].xRC.SwitchAnimation((ushort)(byAttackAdd + 8));
             }
         }
     }
     if (this.iTurning != 0 && this.iTurning != 0)
     {
         int iFramesPerStep = 2;
         int iIndex = this.iTurnCounter / iFramesPerStep;
         if (this.iTurnCounter % iFramesPerStep == 0)
         {
             if (iIndex < this.lxBalls.Count)
             {
                 this.lxBalls[iIndex].xRC.SwitchAnimation((this.iTurning == 1) ? (ushort)2 : (ushort)3, Animation.CancelOptions.IgnoreIfPlaying);
             }
             else
             {
                 int plus4 = (this.enCurrentAction == SeasonHydraAI.Action.PrepareForAttack) ? 4 : 0;
                 ushort iAnimation = (ushort)((this.iTurning == 1) ? (2 + plus4) : (3 + plus4));
                 if (bOffSeason)
                 {
                     iAnimation += 100;
                 }
                 this.xOwner.xRenderComponent.SwitchAnimation(iAnimation, Animation.CancelOptions.IgnoreIfPlaying);
             }
             int iTurnCompleted = iFramesPerStep * this.lxBalls.Count;
             if (this.iTurnCounter == iTurnCompleted)
             {
                 this.iTurning = 0;
                 this.iDirection *= -1;
             }
         }
         this.iTurnCounter++;
     }
     if (this.bGonnaDie)
     {
         Vector2 v2Dir = Utility.Normalize(this.v2RootPosition - this.xOwner.xTransform.v2Pos);
         float fDeathTwitchGrade = 1f - (float)this.iCounter / 30f;
         if (fDeathTwitchGrade > 0f)
         {
             this.xOwner.xTransform.v2Pos += v2Dir * 2f * fDeathTwitchGrade;
         }
         if (this.iCounter == 60)
         {
             this.xOwner.xRenderComponent.Unregister();
             Program.game._EffectMaster_AddEffect(new SortedAnimated(this.xOwner.xTransform.v2Pos, SortedAnimated.SortedAnimatedEffects.ExplosionBombA));
         }
         if (this.iCounter > 60 && this.iCounter % 10 == 0)
         {
             int iIndex2 = (this.iCounter - 70) / 10;
             iIndex2 = this.lxBalls.Count - iIndex2 - 1;
             if (iIndex2 >= 0)
             {
                 this.lxBalls[iIndex2].xRC.Unregister();
                 Program.game._EffectMaster_AddEffect(new SortedAnimated(this.lxBalls[iIndex2].xRC.xTransform.v2Pos, SortedAnimated.SortedAnimatedEffects.ExplosionBombA)).xRenderComponent.fVirtualHeight = 120f;
                 Program.game.xSoundSystem.PlayCue("Puzzle_reset_poof", this.lxBalls[iIndex2].xRC.xTransform.v2Pos);
                 return;
             }
             this.xOwner.bToBeDestroyed = true;
             this.xHydraBagman.ReportHeadDeath(this);
         }
         return;
     }
     if (this.lxBalls[0].xRC.fAlpha != 0f && this.iExistCounter % 40 == 0)
     {
         IEffect efe = Program.game._EffectMaster_AddEffect(new SortedAnimated(this.v2RootPosition + new Vector2(0f, 8f), SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_SeasonHydra_WaterRingBeneath));
         efe.xRenderComponent.v2OffsetRenderPos = this.lxBalls[0].xRC.v2OffsetRenderPos;
     }
     if (this.enCurrentAction == SeasonHydraAI.Action.Chillin)
     {
         int iMosos = 0;
         if (this.xOwner.enType == EnemyCodex.EnemyTypes.SeasonHydra_Autumn)
         {
             iMosos = 20;
         }
         if (this.xOwner.enType == EnemyCodex.EnemyTypes.SeasonHydra_Summer)
         {
             iMosos = 40;
         }
         iMosos /= iDeadHeads + 1;
         if (this.iExistCounter % (100 / (iDeadHeads + 1)) != iMosos)
         {
             return;
         }
         int iMos = 3;
         iMos -= iDeadHeads;
         bool bDoAnything = CAS.RandomInLogic.Next(iMos) == 0;
         if (this.iExistCounter - this.iLastActionAt > 300)
         {
             bDoAnything = true;
         }
         if (Program.game.xStateMaster.enPlayingState == StateMaster.GameplayStates.GameOverScreen)
         {
             bDoAnything = false;
         }
         if (bDoAnything)
         {
             bool bNormalAttack = true;
             if (!bOffSeason)
             {
                 int iAdd = 0;
                 int iMasaka = 320;
                 if (this.xOwner.enType == EnemyCodex.EnemyTypes.SeasonHydra_Autumn)
                 {
                     iMasaka = 240;
                 }
                 else if (this.xOwner.enType == EnemyCodex.EnemyTypes.SeasonHydra_Summer)
                 {
                     iMasaka = 400;
                 }
                 if (iDeadHeads < 2)
                 {
                     iMasaka -= this.iTimeInSeason / Math.Max(5, 20 - CAS.DifficultyModifier - iDeadHeads * 5);
                 }
                 if (this.iExistCounter - this.iLastBreathAt > iMasaka * 2)
                 {
                     iAdd++;
                 }
                 if (this.iExistCounter - this.iLastBreathAt > iMasaka * 3)
                 {
                     iAdd++;
                 }
                 bNormalAttack = (CAS.RandomInLogic.Next(3) > iAdd);
             }
             if (iDeadHeads == 2 && this.xOwner.enType == EnemyCodex.EnemyTypes.SeasonHydra_Summer && this.iBreathsDone >= ((CAS.DifficultySetting > 0) ? 6 : 4))
             {
                 bNormalAttack = true;
             }
             if (this.xOwner.enType == EnemyCodex.EnemyTypes.SeasonHydra_Autumn && !bOffSeason && bNormalAttack)
             {
                 bNormalAttack = (CAS.RandomInLogic.Next(3) != 0);
             }
             if (!bOffSeason)
             {
                 int iTimeBeforeBreaths = 400 - CAS.DifficultySetting * 60;
                 if (this.iTimeInSeason >= iTimeBeforeBreaths)
                 {
                     if (this.xOwner.enType == EnemyCodex.EnemyTypes.SeasonHydra_Autumn && this.iBreathsDone < 3)
                     {
                         bNormalAttack = false;
                     }
                     else if (this.xOwner.enType == EnemyCodex.EnemyTypes.SeasonHydra_Summer && this.iBreathsDone < ((CAS.DifficultySetting > 0) ? 2 : 1))
                     {
                         bNormalAttack = false;
                     }
                     else if (this.xOwner.enType == EnemyCodex.EnemyTypes.SeasonHydra_Winter && this.iBreathsDone < 2)
                     {
                         bNormalAttack = false;
                     }
                 }
                 else
                 {
                     bNormalAttack = true;
                 }
             }
             if (this.iCannotBreathFor > 0)
             {
                 bNormalAttack = true;
             }
             if (bNormalAttack && this.xHydraBagman != null && this.xHydraBagman.SomeoneIsHeadbutting())
             {
                 return;
             }
             this.iLastActionAt = this.iExistCounter;
             if (bNormalAttack)
             {
                 this.bInHeadbutt = true;
                 this.ChangeAction(SeasonHydraAI.Action.PrepareForAttack);
                 ushort iAnimation2 = (this.iDirection == 1) ? (ushort)4 : (ushort)5;
                 if (bOffSeason)
                 {
                     iAnimation2 += 100;
                 }
                 this.xOwner.xRenderComponent.SwitchAnimation(iAnimation2);
                 this.iCounter = 0;
                 return;
             }
             EnemyCodex.EnemyTypes arg_F0B_0 = this.xOwner.enType;
             this.iLastBreathAt = this.iExistCounter;
             this.iBreathsDone++;
             if (this.xOwner.enType == EnemyCodex.EnemyTypes.SeasonHydra_Summer)
             {
                 this.ChangeAction(SeasonHydraAI.Action.BreathAttack_Prepare);
                 this.xOwner.xRenderComponent.SwitchAnimation((this.iDirection == 1) ? (ushort)12 : (ushort)13);
                 this.iCounter = 0;
                 return;
             }
             if (this.xOwner.enType == EnemyCodex.EnemyTypes.SeasonHydra_Autumn)
             {
                 this.ChangeAction(SeasonHydraAI.Action.BreathAttack_Prepare);
                 this.xOwner.xRenderComponent.SwitchAnimation((this.iDirection == 1) ? (ushort)25 : (ushort)26);
                 this.iCounter = 0;
                 this.bTurningAllowed = false;
                 return;
             }
             if (this.xOwner.enType == EnemyCodex.EnemyTypes.SeasonHydra_Winter)
             {
                 this.ChangeAction(SeasonHydraAI.Action.BreathAttack_Prepare);
                 this.xOwner.xRenderComponent.SwitchAnimation(12);
                 if (this.iBreathsDone % 2 == 0)
                 {
                     this.v2IceBreathTarget = new Vector2(508f, 220f);
                 }
                 else
                 {
                     this.v2IceBreathTarget = new Vector2(555f, 220f);
                 }
                 this.v2IceBreathDirection = new Vector2(0f, 1f);
                 this.iCounter = 0;
                 return;
             }
         }
     }
     if (this.enCurrentAction == SeasonHydraAI.Action.PrepareForAttack)
     {
         int iPrepareDone = 60;
         float fPrepareDistance = 30f;
         float fProgress = (float)this.iCounter / (float)iPrepareDone;
         if (fProgress > 1f)
         {
             fProgress = 1f;
         }
         else
         {
             this.fWiggleGrade = 1f - fProgress;
         }
         Vector2 v2Direction = Utility.Normalize(this.xPlayerLockedOnto.xTransform.v2Pos - this.v2HeadRoot);
         Vector2 v2DistanceFromRoot = v2Direction * fProgress * fPrepareDistance;
         this.xOwner.xTransform.v2Pos = this.v2HeadRoot - v2DistanceFromRoot;
         if (this.iCounter == iPrepareDone + 30)
         {
             this.iCounter = 0;
             this.ChangeAction(SeasonHydraAI.Action.NormalAttack);
             this.v2AttackDirection = v2Direction;
             this.v2AttackSourcePosition = this.xOwner.xTransform.v2Pos;
             this.bTurningAllowed = false;
             ushort iAnimation3 = (this.iDirection == 1) ? (ushort)8 : (ushort)9;
             if (bOffSeason)
             {
                 iAnimation3 += 100;
             }
             this.xOwner.xRenderComponent.SwitchAnimation(iAnimation3);
             byte byAttackAdd2;
             if (this.v2AttackDirection.X > 0.2f)
             {
                 byAttackAdd2 = 0;
             }
             else if (this.v2AttackDirection.X < -0.2f)
             {
                 byAttackAdd2 = 3;
             }
             else if (this.v2AttackDirection.X < -0f)
             {
                 byAttackAdd2 = 2;
             }
             else
             {
                 byAttackAdd2 = 1;
             }
             for (int m = 0; m < this.lxBalls.Count; m++)
             {
                 this.lxBalls[m].xRC.SwitchAnimation((ushort)(byAttackAdd2 + 4));
             }
             if (this.xHeadbuttAP == null)
             {
                 this.xHeadbuttAP = new AttackPhase(this.xOwner);
                 this.xHeadbuttAP.lenLayers.Add(Collider.ColliderLayers.Players);
                 this.xHeadbuttAP.lenLayers.Add(Collider.ColliderLayers.DynamicEnvironment);
                 this.xHeadbuttAP.lenLayers.Add(Collider.ColliderLayers.Neutrals);
                 SphereCollider col = new SphereCollider(18f, new Vector2(0f, 0f), this.xOwner.xTransform, 10000f, this.xOwner);
                 this.xHeadbuttAP.lxCurrentColliders.Add(col);
                 col.xAttackPhase = this.xHeadbuttAP;
                 this.xHeadbuttAP.xStats.bRememberHitEntities = true;
                 this.xHeadbuttAP.xStats.iBreakingPower = 9;
                 this.xHeadbuttAP.xStats.fKnockBack = 35f;
                 this.xHeadbuttAP.xStats.v2SideKnockbackOverride = this.v2AttackDirection * 0.7f;
                 this.xHeadbuttAP.xStats.iBaseDamage = 50 + this.xOwner.xBaseStats.iBaseATK + Program.game._Enemy_GetDifficultyModifier() * 4;
                 this.xHeadbuttAP.xStats.enShieldCrush = AttackStats.ShieldCrush.AllButPerfectGuard;
                 this.xHeadbuttAP.xStats.enAttackElement = AttackStats.Element.Neutral;
                 this.xHeadbuttAP.xStats.enAttackType = AttackStats.Type.Physical;
                 this.xHeadbuttAP.xStats.bKnockBackOwner = false;
                 this.xHeadbuttAP.xStats.sAttackHandle = "HydraHeadbutt";
                 this.xHeadbuttAP.RegisterCurrent();
                 this.xHeadbuttAP.lxCurrentColliders[0].ibitLayers = this.xOwner.xCollisionComponent.ibitCurrentColliderLayer;
             }
         }
     }
     else if (this.enCurrentAction == SeasonHydraAI.Action.NormalAttack)
     {
         this.xOwner.xCollisionComponent.ActivateGroup(CollisionComponent.ColliderGroup.Combat);
         this.xOwner.xBaseStats.bUntargetable = false;
         float fAttackSpeed = 9f + (float)CAS.DifficultySetting;
         this.xOwner.xTransform.v2Pos += this.v2AttackDirection * fAttackSpeed;
         if (this.iExistCounter % 2 == 0 && this.iCounter < 20)
         {
             Program.game._EffectMaster_AddEffect(new VFX_GenericGhostImage(this.xOwner.xTransform.v2Pos, this.xOwner.xRenderComponent));
         }
         if (Program.game._CollisionMaster_CheckVsStatic(this.xOwner.xTransform.v2Pos, 20f, Utility.CreateIntMask(new int[]
         {
             5
         })))
         {
             if (this.xHeadbuttAP != null)
             {
                 this.xHeadbuttAP.UnregisterCurrent();
                 this.xHeadbuttAP = null;
             }
             this.iNeckPostHeadbuttWobbleCycle = 1;
             Program.game.xCamera.SetShake(30);
             this.iCounter = 0;
             this.ChangeAction(SeasonHydraAI.Action.AttackToStun);
             ushort iAnimation4 = (this.iDirection == 1) ? (ushort)10 : (ushort)11;
             if (bOffSeason)
             {
                 iAnimation4 += 100;
             }
             this.xOwner.xRenderComponent.SwitchAnimation(iAnimation4);
             Vector2 v2BounceBackTarget = this.xOwner.xTransform.v2Pos - this.v2AttackDirection * 60f;
             if (v2BounceBackTarget.X < 168f)
             {
                 this.v2AttackDirection = Utility.Normalize(this.xOwner.xTransform.v2Pos - new Vector2(175f, 253f));
             }
             else if (v2BounceBackTarget.X > 472f)
             {
                 this.v2AttackDirection = Utility.Normalize(this.xOwner.xTransform.v2Pos - new Vector2(470f, 253f));
             }
             Random knark = Program.GetTheGame().randomInVisual;
             SortedAnimated.SortedAnimatedEffects enEffectType = SortedAnimated.SortedAnimatedEffects.Leaf_Tumbling_AboveSorted;
             if (this.xOwner.enType == EnemyCodex.EnemyTypes.SeasonHydra_Winter)
             {
                 enEffectType = SortedAnimated.SortedAnimatedEffects._EnemyEffects_Winter_SnowFlakeA;
             }
             for (int n = 0; n < 40; n++)
             {
                 float fRotDir = 0.7853982f * (float)n + (float)knark.NextDouble() * 0.7853982f;
                 if (n % 2 == 0)
                 {
                     fRotDir = Utility.Vector2ToRadiansReverse(-this.v2AttackDirection);
                     fRotDir += -1.57079637f + (float)CAS.RandomInLogic.NextDouble() * 3.14159274f;
                 }
                 if (this.xOwner.enType == EnemyCodex.EnemyTypes.SeasonHydra_Autumn)
                 {
                     int iETyp = CAS.RandomInVisual.Next(3);
                     if (iETyp == 0)
                     {
                         enEffectType = SortedAnimated.SortedAnimatedEffects._GUIEffects_SeasonChange_AutumnLeafOrange;
                     }
                     else if (iETyp == 1)
                     {
                         enEffectType = SortedAnimated.SortedAnimatedEffects._GUIEffects_SeasonChange_AutumnLeafRed;
                     }
                     else
                     {
                         enEffectType = SortedAnimated.SortedAnimatedEffects._GUIEffects_SeasonChange_AutumnLeafYellow;
                     }
                 }
                 Vector2 v2Dir2 = Utility.RadiansToVector2(fRotDir);
                 float fModO = (float)knark.NextDouble();
                 _Effect_MovingAnimated eff = Program.GetTheGame()._EffectMaster_AddEffect(new _Effect_MovingAnimated(this.xOwner.xTransform.v2Pos, enEffectType, v2Dir2 * (1.5f + (float)Program.GetTheGame().randomInVisual.NextDouble() * 2f), 40 + (int)(5f * fModO), 25, 0.975f)) as _Effect_MovingAnimated;
                 (eff.xRenderComponent as AnimatedRenderComponent).fAnimationTimeWarp = 1.3f;
                 eff.fRotationMod = (float)knark.NextDouble() * 0.5f - 0.25f;
             }
         }
     }
     else if (this.enCurrentAction == SeasonHydraAI.Action.AttackToStun)
     {
         int iStunDuration = 250 - CAS.DifficultySetting * 40;
         if (iDeadHeads == 1)
         {
             iStunDuration = (int)((float)iStunDuration * 0.9f);
         }
         else if (iDeadHeads == 2)
         {
             iStunDuration = (int)((float)iStunDuration * 0.8f);
         }
         float fBounceSpeed = 5f;
         if (this.iCounter < 30)
         {
             float fGrade3 = 1f - (float)this.iCounter / 30f;
             this.xOwner.xTransform.v2Pos += fBounceSpeed * -this.v2AttackDirection * fGrade3;
         }
         int iModMod = CAS.DifficultyModifier + iDeadHeads * 10;
         if (this.iCounter == Math.Min(130 - CAS.DifficultySetting * 15 - iModMod * 5, iStunDuration - 60))
         {
             this.bInHeadbutt = false;
         }
         if (this.iCounter == iStunDuration - 60)
         {
             ushort iAnimation5 = (this.iDirection == 1) ? (ushort)22 : (ushort)23;
             if (bOffSeason)
             {
                 iAnimation5 += 100;
             }
             this.xOwner.xRenderComponent.SwitchAnimation(iAnimation5);
             this.bInHeadbutt = false;
         }
         if (this.iCounter >= iStunDuration)
         {
             this.ChangeAction(SeasonHydraAI.Action.StunToNormal);
             this.iCounter = 0;
         }
     }
     else if (this.enCurrentAction == SeasonHydraAI.Action.StunToNormal)
     {
         if (this.sSubAction == "Recover")
         {
             this.fWiggleGrade = (float)this.iCounter / 30f;
             if (this.iCounter > 30)
             {
                 this.enCurrentAction = SeasonHydraAI.Action.Chillin;
                 this.iCounter = 0;
                 this.ChangeAction(SeasonHydraAI.Action.Chillin);
             }
         }
         else
         {
             Vector2 v2MosDir = Utility.Normalize(this.v2HeadRoot - this.xOwner.xTransform.v2Pos);
             float fSpeed = 3f;
             if (Vector2.Distance(this.xOwner.xTransform.v2Pos, this.v2HeadRoot) < fSpeed)
             {
                 this.xOwner.xTransform.v2Pos = this.v2HeadRoot;
                 this.sSubAction = "Recover";
                 this.iCounter = 0;
                 this.bTurningAllowed = true;
                 this.xOwner.xCollisionComponent.DeactivateGroup(CollisionComponent.ColliderGroup.Combat);
                 this.xOwner.xBaseStats.bUntargetable = true;
             }
             else
             {
                 this.xOwner.xTransform.v2Pos += v2MosDir * fSpeed;
             }
         }
     }
     if (this.xOwner.enType == EnemyCodex.EnemyTypes.SeasonHydra_Summer)
     {
         if (this.enCurrentAction == SeasonHydraAI.Action.BreathAttack_Prepare)
         {
             int iPrepareDone2 = 20;
             float fPrepareDistance2 = 10f;
             float fProgress2 = (float)this.iCounter / (float)iPrepareDone2;
             if (fProgress2 > 1f)
             {
                 fProgress2 = 1f;
             }
             else
             {
                 this.fWiggleGrade = 1f - fProgress2;
             }
             Vector2 v2Direction2 = Utility.Normalize(this.xPlayerLockedOnto.xTransform.v2Pos - this.v2HeadRoot);
             Vector2 v2DistanceFromRoot2 = v2Direction2 * fProgress2 * fPrepareDistance2;
             this.xOwner.xTransform.v2Pos = this.v2HeadRoot - v2DistanceFromRoot2;
             if (this.iCounter == iPrepareDone2 + 30)
             {
                 this.iCounter = 0;
                 this.ChangeAction(SeasonHydraAI.Action.BreathAttack_During);
                 this.v2AttackDirection = v2Direction2;
                 this.v2AttackSourcePosition = this.xOwner.xTransform.v2Pos;
                 this.bTurningAllowed = false;
             }
         }
         else if (this.enCurrentAction == SeasonHydraAI.Action.BreathAttack_During)
         {
             float fBreathDistanceFromRoot = 30f;
             if (this.iCounter == 10 && this.sSubAction != "Breath")
             {
                 this.xOwner.xRenderComponent.SwitchAnimation((this.xOwner.byAnimationDirection == 1) ? (ushort)16 : (ushort)17);
             }
             if (this.sSubAction == "Breath")
             {
                 int iDelay2 = 4;
                 int iDuration = 120;
                 if (this.iCounter % iDelay2 == 1)
                 {
                     float fSpeed2 = 6f;
                     Vector2 v2Target = this.xPlayerLockedOnto.xTransform.v2Pos - Utility.Normalize(this.xPlayerLockedOnto.xTransform.v2Pos - this.xOwner.xTransform.v2Pos) * 4f;
                     _EnemySpells_SummerHydraFire xMos = (_EnemySpells_SummerHydraFire)Program.game._EntityMaster_AddSpellInstance(SpellCodex.SpellTypes._EnemySkill_SummerHydraFire, this.xOwner, this.xOwner.xTransform.v2Pos, true, new float[]
                     {
                         v2Target.X,
                         v2Target.Y,
                         fSpeed2
                     });
                     xMos.fSpeed = fSpeed2;
                     xMos.v2Target = v2Target;
                     xMos.xRenderComponent.fAlpha = 0f;
                     xMos.xAttackPhase.xStats.iBaseDamage = 40;
                 }
                 Vector2 v2DirToTarget = Utility.Normalize(this.xPlayerLockedOnto.xTransform.v2Pos - this.xOwner.xTransform.v2Pos);
                 this.xOwner.xTransform.v2Pos = this.v2HeadRoot + v2DirToTarget * fBreathDistanceFromRoot;
                 this.SpawnFlameBreathEffect(this.xPlayerLockedOnto.xTransform.v2Pos);
                 if (v2DirToTarget.X >= 0.35f)
                 {
                     this.xOwner.xRenderComponent.SwitchAnimation(18);
                     this.iDirection = 1;
                 }
                 else if (v2DirToTarget.X >= -0.35f)
                 {
                     this.xOwner.xRenderComponent.SwitchAnimation(24);
                     this.iDirection = 1;
                 }
                 else
                 {
                     this.xOwner.xRenderComponent.SwitchAnimation(19);
                     this.iDirection = -1;
                 }
                 if (this.iCounter >= iDuration)
                 {
                     this.ChangeAction(SeasonHydraAI.Action.StunToNormal);
                     this.iCounter = 0;
                     this.xOwner.xRenderComponent.SwitchAnimation((this.iDirection == 1) ? (ushort)20 : (ushort)21);
                 }
             }
             else
             {
                 float fAttackSpeed2 = 3f;
                 this.xOwner.xTransform.v2Pos += this.v2AttackDirection * fAttackSpeed2;
                 if (Vector2.Distance(this.xOwner.xTransform.v2Pos, this.v2HeadRoot) > fBreathDistanceFromRoot - fAttackSpeed2)
                 {
                     this.sSubAction = "Breath";
                     this.iCounter = 0;
                 }
             }
         }
     }
     else if (this.xOwner.enType == EnemyCodex.EnemyTypes.SeasonHydra_Winter)
     {
         if (this.enCurrentAction == SeasonHydraAI.Action.BreathAttack_Prepare)
         {
             int iPrepareDone3 = 20;
             float fPrepareDistance3 = 10f;
             float fProgress3 = (float)this.iCounter / (float)iPrepareDone3;
             if (fProgress3 > 1f)
             {
                 fProgress3 = 1f;
             }
             else
             {
                 this.fWiggleGrade = 1f - fProgress3;
             }
             Vector2 v2Direction3 = Utility.Normalize(this.v2IceBreathTarget - this.v2HeadRoot);
             Vector2 v2DistanceFromRoot3 = v2Direction3 * fProgress3 * fPrepareDistance3;
             this.xOwner.xTransform.v2Pos = this.v2HeadRoot - v2DistanceFromRoot3;
             if (this.iCounter == iPrepareDone3 + 30)
             {
                 this.iCounter = 0;
                 this.ChangeAction(SeasonHydraAI.Action.BreathAttack_During);
                 this.v2AttackDirection = v2Direction3;
                 this.v2AttackSourcePosition = this.xOwner.xTransform.v2Pos;
                 this.bTurningAllowed = false;
             }
         }
         else if (this.enCurrentAction == SeasonHydraAI.Action.BreathAttack_During)
         {
             float fBreathDistanceFromRoot2 = 30f;
             if (this.iCounter == 10 && this.sSubAction != "Breath")
             {
                 this.xOwner.xRenderComponent.SwitchAnimation((this.xOwner.byAnimationDirection == 1) ? (ushort)16 : (ushort)17);
             }
             if (this.sSubAction == "Breath")
             {
                 int iDelay3 = 4;
                 Vector2 v2AdjustedTarget = this.v2IceBreathTarget;
                 if (this.iCounter % iDelay3 == 1 && CAS.NetworkRole != NetworkHelperInterface.NetworkRole.Client)
                 {
                     float fSpeed3 = 100f;
                     Vector2 v2Target2 = v2AdjustedTarget;
                     ushort expr_1E5B = DynamicEnvironment.iIDPool;
                     DynamicEnvironment.iIDPool = (ushort)(expr_1E5B + 1);
                     ushort iReservedID = expr_1E5B;
                     _EnemySpells_WinterHydraBreath xMos2 = (_EnemySpells_WinterHydraBreath)Program.game._EntityMaster_AddSpellInstance(SpellCodex.SpellTypes._EnemySkill_WinterHydraFrost, this.xOwner, this.xOwner.xTransform.v2Pos, true, new float[]
                     {
                         v2Target2.X,
                         v2Target2.Y,
                         fSpeed3,
                         (float)iReservedID
                     });
                     xMos2.fSpeed = fSpeed3;
                     xMos2.v2Target = v2Target2;
                     xMos2.iReservedID = iReservedID;
                     xMos2.xRenderComponent.fAlpha = 0f;
                     xMos2.xAttackPhase.xStats.iBaseDamage = 40;
                 }
                 Vector2 v2DirToTarget2 = Utility.Normalize(v2AdjustedTarget - this.xOwner.xTransform.v2Pos);
                 int arg_1F25_0 = this.iCounter % 2;
                 if (this.xBeamEffect == null)
                 {
                     this.xBeamEffect = (Program.GetTheGame()._EffectMaster_AddEffect(new Effect_Beam(this.xOwner, null, this.xOwner.xRenderComponent.fVirtualHeight, 6f, "Sprites/Monster/Bosses/Season Hydra/Winter/Beam/")) as Effect_Beam);
                     this.xBeamEffect.v2OverrideTarget = this.v2IceBreathTarget;
                     this.xBeamGroundEffect = (SortedAnimated)Program.game._EffectMaster_AddEffect(new SortedAnimated(Vector2.Zero, SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_SeasonHydra_WinterFrostBreath_BeamFloorEffect));
                     this.xBeamGroundEffect.xTransform.v2Pos = this.v2IceBreathTarget + new Vector2(0f, 4f);
                 }
                 this.xBeamEffect.v2OverrideSource = this.xOwner.xTransform.v2Pos;
                 this.xBeamEffect.v2OverrideTarget = v2AdjustedTarget;
                 this.xBeamGroundEffect.xTransform.v2Pos = v2AdjustedTarget + new Vector2(0f, 4f);
                 Vector2 v2ModDir = Utility.RandomizeVector2Direction(CAS.RandomInVisual);
                 _Effect_MovingAnimated ef = (_Effect_MovingAnimated)Program.game._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2AdjustedTarget, SortedAnimated.SortedAnimatedEffects._EnemyEffects_Winter_SnowFlakeA, v2ModDir * 0.5f, 30, 15, new Vector2(0.99f, 0.99f)));
                 ef.xRenderComponent.fAlpha = 1f;
                 ef.xRenderComponent.fVirtualHeight = -20f;
                 if (v2DirToTarget2.X >= 0.35f)
                 {
                     this.xOwner.xRenderComponent.SwitchAnimation(18);
                     this.iDirection = 1;
                     Effect_Beam expr_20B5_cp_0 = this.xBeamEffect;
                     expr_20B5_cp_0.v2OverrideSource.X = expr_20B5_cp_0.v2OverrideSource.X + 10f;
                     Effect_Beam expr_20D1_cp_0 = this.xBeamEffect;
                     expr_20D1_cp_0.v2OverrideSource.Y = expr_20D1_cp_0.v2OverrideSource.Y + 4f;
                 }
                 else if (v2DirToTarget2.X >= -0.35f)
                 {
                     this.xOwner.xRenderComponent.SwitchAnimation(24);
                     this.iDirection = 1;
                 }
                 else
                 {
                     this.xOwner.xRenderComponent.SwitchAnimation(19);
                     this.iDirection = -1;
                     Effect_Beam expr_2131_cp_0 = this.xBeamEffect;
                     expr_2131_cp_0.v2OverrideSource.X = expr_2131_cp_0.v2OverrideSource.X - 10f;
                     Effect_Beam expr_214D_cp_0 = this.xBeamEffect;
                     expr_214D_cp_0.v2OverrideSource.Y = expr_214D_cp_0.v2OverrideSource.Y + 4f;
                 }
                 this.xOwner.xTransform.v2Pos = this.v2HeadRoot + v2DirToTarget2 * fBreathDistanceFromRoot2;
                 bool bFinish = false;
                 float fTurnSpeed = 3f;
                 if (this.iIceBreathPart == 0)
                 {
                     this.v2IceBreathTarget += this.v2IceBreathDirection * fTurnSpeed;
                     if (this.iBreathsDone % 2 == 0)
                     {
                         if (this.v2IceBreathTarget.Y > 257f)
                         {
                             this.iIceBreathPart++;
                         }
                     }
                     else if (this.v2IceBreathTarget.Y > 300f)
                     {
                         this.iIceBreathPart++;
                     }
                 }
                 else if (this.iIceBreathPart >= 1)
                 {
                     this.v2IceBreathTarget += this.v2IceBreathDirection * fTurnSpeed;
                     Vector2 v2Target3 = Vector2.Zero;
                     if (this.iBreathsDone % 2 == 0)
                     {
                         if (this.iIceBreathPart == 1)
                         {
                             v2Target3 = new Vector2(425f, 307f);
                         }
                         else if (this.iIceBreathPart == 2)
                         {
                             v2Target3 = new Vector2(352f, 263f);
                         }
                         else if (this.iIceBreathPart == 3)
                         {
                             v2Target3 = new Vector2(285f, 312f);
                         }
                         else if (this.iIceBreathPart == 4)
                         {
                             v2Target3 = new Vector2(220f, 264f);
                         }
                         else if (this.iIceBreathPart == 5)
                         {
                             v2Target3 = new Vector2(146f, 311f);
                         }
                         else if (this.iIceBreathPart == 6)
                         {
                             v2Target3 = new Vector2(90f, 312f);
                         }
                         else if (this.iIceBreathPart == 7)
                         {
                             v2Target3 = new Vector2(84f, 225f);
                         }
                     }
                     else if (this.iIceBreathPart == 1)
                     {
                         v2Target3 = new Vector2(491f, 314f);
                     }
                     else if (this.iIceBreathPart == 2)
                     {
                         v2Target3 = new Vector2(425f, 264f);
                     }
                     else if (this.iIceBreathPart == 3)
                     {
                         v2Target3 = new Vector2(353f, 308f);
                     }
                     else if (this.iIceBreathPart == 4)
                     {
                         v2Target3 = new Vector2(286f, 264f);
                     }
                     else if (this.iIceBreathPart == 5)
                     {
                         v2Target3 = new Vector2(218f, 309f);
                     }
                     else if (this.iIceBreathPart == 6)
                     {
                         v2Target3 = new Vector2(144f, 261f);
                     }
                     else if (this.iIceBreathPart == 7)
                     {
                         v2Target3 = new Vector2(145f, 225f);
                     }
                     this.v2IceBreathDirection = Vector2.Lerp(this.v2IceBreathDirection, Utility.Normalize(v2Target3 - this.v2IceBreathTarget), 0.1f);
                     if (this.iIceBreathPart <= 6)
                     {
                         if (this.v2IceBreathTarget.X <= v2Target3.X)
                         {
                             this.iIceBreathPart++;
                         }
                     }
                     else if (this.v2IceBreathTarget.Y <= v2Target3.Y)
                     {
                         bFinish = true;
                     }
                 }
                 if (bFinish)
                 {
                     this.ChangeAction(SeasonHydraAI.Action.StunToNormal);
                     this.iCounter = 0;
                     this.xOwner.xRenderComponent.SwitchAnimation((this.iDirection == 1) ? (ushort)20 : (ushort)21);
                     this.xBeamEffect.Fade();
                     this.xBeamEffect = null;
                     this.xBeamGroundEffect.bToBeDestroyed = true;
                     this.xBeamGroundEffect = null;
                 }
             }
             else
             {
                 float fAttackSpeed3 = 3f;
                 this.xOwner.xTransform.v2Pos += this.v2AttackDirection * fAttackSpeed3;
                 if (Vector2.Distance(this.xOwner.xTransform.v2Pos, this.v2HeadRoot) > fBreathDistanceFromRoot2 - fAttackSpeed3)
                 {
                     this.sSubAction = "Breath";
                     this.iCounter = 0;
                     this.v2IceBreathDirection = new Vector2(0f, 1f);
                     this.iIceBreathPart = 0;
                 }
             }
         }
     }
     else if (this.xOwner.enType == EnemyCodex.EnemyTypes.SeasonHydra_Autumn)
     {
         if (this.enCurrentAction == SeasonHydraAI.Action.BreathAttack_Prepare)
         {
             int iPrepareDone4 = 20;
             float fPrepareDistance4 = 10f;
             float fProgress4 = (float)this.iCounter / (float)iPrepareDone4;
             if (fProgress4 > 1f)
             {
                 fProgress4 = 1f;
             }
             else
             {
                 this.fWiggleGrade = 1f - fProgress4;
             }
             Vector2 v2Direction4 = Utility.Normalize(this.xPlayerLockedOnto.xTransform.v2Pos - this.v2HeadRoot);
             Vector2 v2DistanceFromRoot4 = v2Direction4 * fProgress4 * fPrepareDistance4;
             this.xOwner.xTransform.v2Pos = this.v2HeadRoot - v2DistanceFromRoot4;
             if (this.iCounter == iPrepareDone4 + 10)
             {
                 this.iCounter = 0;
                 this.ChangeAction(SeasonHydraAI.Action.BreathAttack_During);
                 this.v2AttackDirection = v2Direction4;
                 this.v2AttackSourcePosition = this.xOwner.xTransform.v2Pos;
                 this.bTurningAllowed = false;
             }
         }
         else if (this.enCurrentAction == SeasonHydraAI.Action.BreathAttack_During)
         {
             float fBreathDistanceFromRoot3 = 30f;
             if (this.sSubAction == "Breath")
             {
                 if (this.iCounter == 4)
                 {
                     float fVelocity = 1.4f + (float)GameSessionData.iBaseDifficulty * 0.25f;
                     Vector2 v2Offset = new Vector2(8f, 4f);
                     if (this.xOwner.byAnimationDirection == 3)
                     {
                         v2Offset.X *= -1f;
                     }
                     Vector2 v2Dir3 = Utility.Normalize(this.xPlayerLockedOnto.xTransform.v2Pos - this.xOwner.xTransform.v2Pos);
                     _EnemySpells_AutumnHydraHomingShot xInst = (_EnemySpells_AutumnHydraHomingShot)Program.GetTheGame()._EntityMaster_AddSpellInstance(SpellCodex.SpellTypes._EnemySkill_AutumnHydraShot, this.xOwner, this.xOwner.xTransform.v2Pos + v2Offset, true, new float[]
                     {
                         fVelocity
                     });
                     xInst.xOwner = this.xOwner;
                     xInst.fVelocity = fVelocity;
                     xInst.v2Direction = v2Dir3;
                     xInst.xAttackPhasePlayer.lenLayers.Add(Collider.ColliderLayers.Neutrals);
                     xInst.xAttackPhasePlayer.xStats.fKnockBack = 10f;
                     xInst.xAttackPhasePlayer.xStats.iBaseDamage = this.xOwner.xBaseStats.iATK;
                     xInst.xAttackPhasePlayer.xStats.enAttackElement = AttackStats.Element.Neutral;
                     xInst.xAttackPhasePlayer.xStats.enAttackType = AttackStats.Type.Physical;
                     xInst.xAttackPhasePlayer.RegisterCurrent();
                     xInst.iDestroyAt = 300 + Program.GetTheGame()._Enemy_GetDifficultyModifier() * 15;
                     xInst.xRenderComponent.fVirtualHeight += this.xOwner.xRenderComponent.fVirtualHeight;
                     xInst.xRenderComponent.SwitchAnimation(0, Animation.CancelOptions.IgnoreIfPlaying);
                     xInst.xTargetActor = this.xPlayerLockedOnto;
                     this.xHydraBagman.xSeasonChangeBagman.AddAffectedEntity(xInst);
                 }
                 if (this.iCounter == 20)
                 {
                     this.ChangeAction(SeasonHydraAI.Action.StunToNormal);
                     this.iCounter = 0;
                 }
             }
             else
             {
                 float fAttackSpeed4 = 3f;
                 this.xOwner.xTransform.v2Pos += this.v2AttackDirection * fAttackSpeed4;
                 if (Vector2.Distance(this.xOwner.xTransform.v2Pos, this.v2HeadRoot) > fBreathDistanceFromRoot3 - fAttackSpeed4)
                 {
                     this.sSubAction = "Breath";
                     this.iCounter = 0;
                 }
             }
         }
     }
     if (this.enCurrentAction == SeasonHydraAI.Action.SpawnStart)
     {
         if (this.sSubAction == "Done")
         {
             this.fWiggleGrade = (float)this.iCounter / 30f;
             if (this.iCounter == 30)
             {
                 this.xOwner.xRenderComponent.SwitchAnimation(31);
                 this.enCurrentAction = SeasonHydraAI.Action.Chillin;
                 this.bTurningAllowed = true;
                 this.iCounter = 0;
                 return;
             }
         }
         else
         {
             if (this.sSubAction == "Going")
             {
                 if (this.xOwner.xRenderComponent.v2OffsetRenderPos.Y > 0f)
                 {
                     AnimatedRenderComponent expr_2942_cp_0 = this.xOwner.xRenderComponent;
                     expr_2942_cp_0.v2OffsetRenderPos.Y = expr_2942_cp_0.v2OffsetRenderPos.Y - 4f;
                     for (int i2 = 0; i2 < this.lxBalls.Count; i2++)
                     {
                         this.lxBalls[i2].xRC.v2OffsetRenderPos = this.xOwner.xRenderComponent.v2OffsetRenderPos;
                     }
                 }
                 else
                 {
                     this.sSubAction = "Done";
                     this.iCounter = 0;
                     (this.xOwner as Boss).EnterBattle();
                 }
                 float fDist = Vector2.Distance(this.v2RootPosition, this.xOwner.xTransform.v2Pos + this.xOwner.xRenderComponent.v2OffsetRenderPos);
                 int iMos2 = 0;
                 int i3 = this.lxBalls.Count - 1;
                 while (i3 >= 0)
                 {
                     iMos2++;
                     if (this.lxBalls[i3].xRC.fAlpha != 1f)
                     {
                         if (fDist > (float)(iMos2 * 13))
                         {
                             this.lxBalls[i3].xRC.fAlpha = 1f;
                             return;
                         }
                         return;
                     }
                     else
                     {
                         i3--;
                     }
                 }
                 return;
             }
             if (this.sSubAction == "AlmostGo")
             {
                 if (this.iCounter == 4)
                 {
                     Program.game._EffectMaster_AddEffect(new SortedAnimated(this.v2RootPosition + new Vector2(0f, 4f), SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_SeasonHydra_HeadAppearWaterFront));
                 }
                 if (this.iCounter == 80)
                 {
                     this.sSubAction = "Going";
                     this.iCounter = 0;
                     this.fWiggleGrade = 0f;
                     Program.game._EffectMaster_AddEffect(new SortedAnimated(this.v2RootPosition + new Vector2(0f, 4f), SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_SeasonHydra_HeadAppearWaterBack));
                     this.xOwner.xRenderComponent.SwitchAnimation(27);
                     this.xOwner.xRenderComponent.fAlpha = 1f;
                     return;
                 }
             }
             else
             {
                 if (this.iCounter < 0)
                 {
                     return;
                 }
                 if (this.iCounter % 30 == 0)
                 {
                     Program.game._EffectMaster_AddEffect(new SortedAnimated(this.v2RootPosition + new Vector2(0f, 4f) + Utility.RandomizeVector2Direction(CAS.RandomInVisual) * 23f * (float)CAS.RandomInVisual.NextDouble(), SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_SeasonHydra_PreAppearBubbleSmall));
                 }
                 if (this.iCounter > 60 && this.iCounter % 14 == 3)
                 {
                     Program.game._EffectMaster_AddEffect(new SortedAnimated(this.v2RootPosition + new Vector2(0f, 4f) + Utility.RandomizeVector2Direction(CAS.RandomInVisual) * 23f * (float)CAS.RandomInVisual.NextDouble(), SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_SeasonHydra_PreAppearBubbleBig));
                 }
                 if (this.iCounter > 80 && this.iCounter % 8 == 5)
                 {
                     Program.game._EffectMaster_AddEffect(new SortedAnimated(this.v2RootPosition + new Vector2(0f, 4f) + Utility.RandomizeVector2Direction(CAS.RandomInVisual) * 23f * (float)CAS.RandomInVisual.NextDouble(), SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_SeasonHydra_PreAppearBubbleSmall));
                 }
                 if (this.iCounter == 110)
                 {
                     this.sSubAction = "AlmostGo";
                     this.iCounter = 0;
                 }
             }
         }
     }
 }
示例#3
0
 public void Underwater(int iDelay = 0)
 {
     this.iCounter = -iDelay;
     this.xOwner.xRenderComponent.fAlpha = 0f;
     for (int i = 0; i < this.lxBalls.Count; i++)
     {
         this.lxBalls[i].xRC.fAlpha = 0f;
     }
     this.xOwner.xRenderComponent.v2OffsetRenderPos = new Vector2(0f, 86f);
     this.bTurningAllowed = false;
     this.enCurrentAction = SeasonHydraAI.Action.SpawnStart;
 }