コード例 #1
0
ファイル: SummerKnightAI.cs プロジェクト: ancientgods/SoG
 public static byte OtherSeasonKnightAttackDirection(WorldActor xTarget, Enemy xSender)
 {
     foreach (Enemy x in Program.GetTheGame().dixEnemyList.Values)
     {
         if (x != xSender && !x.bToBeDestroyed && x.xBaseStats.iHP > 0)
         {
             if (x.enType == EnemyCodex.EnemyTypes.SeasonKnight_Summer)
             {
                 if (x.xBehaviour.xPlayerLockedOnto == xTarget)
                 {
                     byte result = (x.xBehaviour as SummerKnightAI).byEngageDir;
                     return result;
                 }
             }
             else if (x.enType == EnemyCodex.EnemyTypes.SeasonKnight_Autumn)
             {
                 if (x.xBehaviour.xPlayerLockedOnto == xTarget)
                 {
                     byte result = (x.xBehaviour as AutumnKnightAI).byEngageDir;
                     return result;
                 }
             }
             else
             {
                 EnemyCodex.EnemyTypes arg_9B_0 = x.enType;
             }
         }
     }
     return 4;
 }
コード例 #2
0
ファイル: WinterMageAI.cs プロジェクト: ancientgods/SoG
 public void CastShield(WorldActor xAllyToShield)
 {
     int iShieldPieces = 5;
     SeasonChangeBagman xSeasonChangeBagman = null;
     if (Program.game.xEntityMaster.dbyxBagmen.ContainsKey(0))
     {
         xSeasonChangeBagman = (Program.game.xEntityMaster.dbyxBagmen[0] as SeasonChangeBagman);
     }
     for (int i = 0; i < iShieldPieces; i++)
     {
         float fOrbitOffset = 6.28318548f / (float)iShieldPieces * (float)i;
         float fRotationVelocity = 0.1f;
         float fDistanceFromCenter = 20f;
         _EnemySpells_SpinningShieldThings xShield = (_EnemySpells_SpinningShieldThings)Program.game._EntityMaster_AddSpellInstance(SpellCodex.SpellTypes._EnemySkill_SpinningShieldThing, xAllyToShield, Vector2.Zero, true, new float[]
         {
             fOrbitOffset,
             fRotationVelocity,
             fDistanceFromCenter
         });
         xShield.SetInfo(new SphereCollider(5f, Vector2.Zero, xShield.xTransform, 0f, xAllyToShield), 10, xAllyToShield);
         xShield.fOrbitOffset = fOrbitOffset;
         xShield.fRotationVelocity = fRotationVelocity;
         xShield.fDistanceFromCenter = fDistanceFromCenter;
         xShield.xAttackPhase.xStats.iBaseDamage = 30 + CAS.DifficultyModifier * 5 + CAS.DifficultySetting * 5;
         xShield.xAttackPhase.xStats.fStrengthVersusShields = 0.5f;
         if (xSeasonChangeBagman != null)
         {
             xSeasonChangeBagman.AddAffectedEntity(xShield);
         }
     }
 }
コード例 #3
0
 public static void RemoveBurnInstanceFromActor(WorldActor xActor)
 {
     foreach (ISpellInstance x in Program.game.xEntityMaster.dixActiveSpellInstances.Values)
     {
         if (x.enType == SpellCodex.SpellTypes._Magic_Fire_BurnControlInstance && (x as _Spells_BurnInstance).xBurningActor == xActor)
         {
             x.bToBeDestroyed = true;
         }
     }
 }
コード例 #4
0
 public override void Init(NetIncomingMessage msg, params float[] p_afInitFloats)
 {
     if (p_afInitFloats[0] == 0f)
     {
         ushort iID = (ushort)p_afInitFloats[1];
         if (!Program.game.dixEnemyList.ContainsKey(iID))
         {
             this.bToBeDestroyed = true;
             return;
         }
         this.xBurningActor = Program.game.dixEnemyList[iID];
     }
 }
コード例 #5
0
 public override void Init(NetIncomingMessage msg, params float[] p_afInitFloats)
 {
     if (p_afInitFloats[0] == 0f)
     {
         if (!Program.game.dixEnemyList.ContainsKey((ushort)p_afInitFloats[1]))
         {
             this.bToBeDestroyed = true;
             return;
         }
         this.xTravelingEntity = Program.game.dixEnemyList[(ushort)p_afInitFloats[1]];
         this.v2TravelDir = new Vector2(p_afInitFloats[2], p_afInitFloats[3]);
         this.iSlowDownAfter = (int)p_afInitFloats[4];
         this.fSpeed = p_afInitFloats[5];
         this.xTravelingEntity.xTransform.Both = new Vector2(p_afInitFloats[6], p_afInitFloats[7]);
         this.colMoveCollider.ibitLayers = Utility.CreateIntMask(new int[]
         {
             30,
             31
         });
         this.colMoveCollider.xMountTransform = this.xTravelingEntity.xTransform;
         Program.game.xCollisionMaster.RegisterGhostCollider(this.colMoveCollider);
     }
 }
コード例 #6
0
 public override void Update()
 {
     if (this.bDying)
     {
         return;
     }
     IEntity arg_0F_0 = this.xOwner;
     if (this.xOwner != null)
     {
         this.xRenderComponent.fAlpha = (this.xOwner as PlayerEntity).xRenderComponent.fAlpha;
     }
     this.xTransform.v2Pos += this.v2Direction * this.fVelocity;
     this.iExistTimer++;
     this.iSoundCooldown++;
     if (this.iExistTimer > 60 * this.iPowerLevel + this.iSpellLvl * 12)
     {
         this.iSwarmHealth--;
     }
     float fHealthPct = (float)this.iSwarmHealth / (float)this.iSwarmMaxHealth;
     if ((int)((1f - fHealthPct) * (float)this.lxInsectSwarm.Count) > this.iLostInsects)
     {
         if (this.lxInsectSwarm.Count - this.iLostInsects - 1 >= 0)
         {
             int iIndex = this.lxInsectSwarm.Count - this.iLostInsects - 1;
             if (iIndex < 0)
             {
                 iIndex = 0;
             }
             else if (iIndex >= this.lxInsectSwarm.Count)
             {
                 iIndex = this.lxInsectSwarm.Count - 1;
             }
             AmbientFollowInsect x = this.lxInsectSwarm[iIndex];
             x.xRenderComponent.fAlpha = 0f;
             _Effect_MovingAnimated xEfe;
             if (this.iPowerLevel < 3)
             {
                 xEfe = (Program.game._EffectMaster_AddEffect(new _Effect_MovingAnimated(x.xTransform.v2Pos, SortedAnimated.SortedAnimatedEffects._SpellEffects_Earth_InsectDeathLvl1, new Vector2(0f, 0.9f), 120)) as _Effect_MovingAnimated);
             }
             else
             {
                 xEfe = (Program.game._EffectMaster_AddEffect(new _Effect_MovingAnimated(x.xTransform.v2Pos, SortedAnimated.SortedAnimatedEffects._SpellEffects_Earth_InsectDeathLvl3, new Vector2(0f, 0.9f), 120)) as _Effect_MovingAnimated);
             }
             xEfe.xRenderComponent.fVirtualHeight = x.xRenderComponent.fVirtualHeight;
             xEfe.xRenderComponent.v2OffsetRenderPos = x.xRenderComponent.v2OffsetRenderPos;
             this.iLostInsects++;
         }
     }
     else if ((int)((1f - fHealthPct) * (float)this.lxInsectSwarm.Count) < this.iLostInsects && this.lxInsectSwarm.Count > this.iLostInsects && this.lxInsectSwarm.Count - this.iLostInsects - 1 >= 0)
     {
         int iIndex2 = this.lxInsectSwarm.Count - this.iLostInsects - 1;
         if (iIndex2 < 0)
         {
             iIndex2 = 0;
         }
         else if (iIndex2 >= this.lxInsectSwarm.Count)
         {
             iIndex2 = this.lxInsectSwarm.Count - 1;
         }
         AmbientFollowInsect x2 = this.lxInsectSwarm[iIndex2];
         x2.xRenderComponent.fAlpha = 1f;
         if (this.v2Direction.X >= 0f)
         {
             x2.xRenderComponent.SwitchAnimation(4);
         }
         else
         {
             x2.xRenderComponent.SwitchAnimation(5);
         }
         SortedAnimated efe = (SortedAnimated)Program.game._EffectMaster_AddEffect(new SortedAnimated(x2.xTransform.v2Pos + x2.xRenderComponent.v2OffsetRenderPos, SortedAnimated.SortedAnimatedEffects.WaterLeafRings));
         efe.xRenderComponent.AsAnimated().fAnimationTimeWarp = 2f;
         efe.xRenderComponent.fVirtualHeight = x2.xRenderComponent.fVirtualHeight + 10f;
         this.iLostInsects--;
     }
     if (this.iSwarmHealth <= 0 && CAS.NetworkRole != NetworkHelperInterface.NetworkRole.Client)
     {
         this.bToBeDestroyed = true;
         base.SendClientInstruction(1, new float[0]);
     }
     if ((this.iPowerLevel < 3 && this.lxInsectSwarm.Count < 12 && this.iExistTimer % 4 == 0) || (this.iPowerLevel == 3 && this.lxInsectSwarm.Count < 6 && this.iExistTimer % 8 == 0))
     {
         if (this.iPowerLevel == 1)
         {
             this.AddButter(DynamicEnvironmentCodex.ObjectTypes.AmbientFollowInsect_Level1, this.xLeader);
             this.AddButter(DynamicEnvironmentCodex.ObjectTypes.AmbientFollowInsect_Level1, this.xLeader);
         }
         else if (this.iPowerLevel == 2)
         {
             this.AddButter(DynamicEnvironmentCodex.ObjectTypes.AmbientFollowInsect_Level1, this.xLeader);
             this.AddButter(DynamicEnvironmentCodex.ObjectTypes.AmbientFollowInsect_Level1, this.xLeader);
         }
         else if (this.iPowerLevel == 3)
         {
             this.AddButter(DynamicEnvironmentCodex.ObjectTypes.AmbientFollowInsect_Level3, this.xLeader);
             this.AddButter(DynamicEnvironmentCodex.ObjectTypes.AmbientFollowInsect_Level3, this.xLeader);
         }
     }
     if (CAS.NetworkRole != NetworkHelperInterface.NetworkRole.Client)
     {
         if ((this.xOwner as PlayerEntity).Owner.xViewStats.bIsDead)
         {
             this.Kill();
             return;
         }
         if (!this.bBloodlust)
         {
             Enemy xClosest = Program.GetTheGame()._Enemies_GetClosestEnemyByDistanceToHitbox(this.xTransform.v2Pos, 20f, this.xCollisionComponent.xMovementCollider);
             if (xClosest != null)
             {
                 this.bBloodlust = true;
                 for (int i = 0; i < this.lxInsectSwarm.Count; i++)
                 {
                 }
             }
             if (this.iExistTimer > this.iCounterAtLastAttack + 60)
             {
                 if (this.v2Direction.Length() > 0.1f)
                 {
                     this.v2Direction *= 0.98f;
                 }
                 else
                 {
                     this.v2Direction = Vector2.Zero;
                     foreach (AmbientFollowInsect x3 in this.lxInsectSwarm)
                     {
                         x3.bStayPut = true;
                     }
                 }
                 if (this.v2Direction.Length() < 0.8f)
                 {
                     if (!this.bDeathSoundPlayed)
                     {
                         this.bDeathSoundPlayed = true;
                         Program.game.xSoundSystem.PlayCue("insects_dead", this.xTransform);
                         base.SendClientInstruction(2, new float[0]);
                     }
                     this.iSwarmHealth -= 5;
                     base.SendClientInstruction(0, new float[]
                     {
                         -5f
                     });
                 }
             }
             this.xTransform.v2ServerPos = this.xTransform.v2Pos;
             return;
         }
         Program.GetTheGame();
         bool bTakeChillPill = this.iExistTimer < 30 || this.bPassive || (this.xOwner.enEntityType == IEntity.EntityType.Player && (this.xOwner as PlayerEntity).enTargetable != PlayerEntity.Targetable.Full);
         bool bSlowDown = false;
         if (!bTakeChillPill && !this.bPassive && this.iExistTimer > this.iCounterAtLastSwitch + 60)
         {
             float fMaxTargetDistance = 150f;
             Enemy xClosest2 = Program.GetTheGame()._Enemies_GetClosestEnemyByDistanceToHitbox(this.xTransform.v2Pos, fMaxTargetDistance, this.xCollisionComponent.xMovementCollider);
             if (xClosest2 != null && xClosest2.enType != EnemyCodex.EnemyTypes.Chicken && !xClosest2.bDefeated)
             {
                 if (this.xOverrideTarget != xClosest2)
                 {
                     this.xOverrideTarget = xClosest2;
                     this.iHitsOnCurrentTarget = 0;
                     return;
                 }
                 this.v2Direction = Utility.Normalize(this.xOverrideTarget.xTransform.v2Pos - this.xTransform.v2Pos);
                 float fTargetDistance = Vector2.Distance(this.xOverrideTarget.xTransform.v2Pos, this.xTransform.v2Pos);
                 if (this.xOverrideTarget is Enemy && (this.xOverrideTarget as Enemy).xBaseStats.enSize == BaseStats.BodySize.Titan)
                 {
                     fTargetDistance = Vector2.Distance(this.xOverrideTarget.xCollisionComponent.GetClosestPositionToHitbox(this.xTransform.v2Pos), this.xTransform.v2Pos);
                     fTargetDistance /= 4f;
                 }
                 if (fTargetDistance < 5f)
                 {
                     bSlowDown = true;
                     this.iCounterAtLastAttack = this.iExistTimer;
                     if (this.iPowerLevel == 3 && this.iExistTimer % (16 + this.iLostInsects) == 16 + this.iLostInsects - 10)
                     {
                         if (this.lxInsectSwarm.Count - this.iLostInsects > 0)
                         {
                             for (int j = 0; j < 3; j++)
                             {
                                 int iRan = CAS.RandomInVisual.Next(this.lxInsectSwarm.Count - this.iLostInsects);
                                 if (this.lxInsectSwarm[iRan].xTransform.v2Pos.X < this.xOverrideTarget.xTransform.v2Pos.X)
                                 {
                                     this.lxInsectSwarm[iRan].xRenderComponent.SwitchAnimation(6);
                                 }
                                 else
                                 {
                                     this.lxInsectSwarm[iRan].xRenderComponent.SwitchAnimation(7);
                                 }
                             }
                         }
                         base.SendClientInstruction(4, new float[0]);
                     }
                     if (this.iExistTimer % (16 + this.iLostInsects) == 16 + this.iLostInsects - 1)
                     {
                         if (this.xOverrideTarget is Enemy)
                         {
                             int iATKToUse = (int)((float)this.iOwnerMATK * 0.17f) + CAS.RandomInLogic.Next((int)((float)this.iOwnerMATK * 0.05f));
                             if (this.iPowerLevel == 3)
                             {
                                 iATKToUse = (int)((float)this.iOwnerMATK * 0.225f) + CAS.RandomInLogic.Next((int)((float)this.iOwnerMATK * 0.1f));
                             }
                             if (this.xOwner is PlayerEntity)
                             {
                                 iATKToUse = AttackStats.ApplyMagicalBonusDamage((this.xOwner as PlayerEntity).Owner, this.xOverrideTarget.xBaseStats, iATKToUse);
                                 iATKToUse = AttackStats.ApplyEarthBonusDamage((this.xOwner as PlayerEntity).Owner, this.xOverrideTarget.xBaseStats, iATKToUse);
                             }
                             Program.game._Enemy_TakeArbitraryDamage(this.xOverrideTarget as Enemy, Program.game._AttackStats_CalculateDefenseReduction(iATKToUse, this.xOverrideTarget.xBaseStats, 0f, true), 0, this.xAttackPhaseEnemy);
                             Enemy xEnemy = this.xOverrideTarget as Enemy;
                             xEnemy.OnHitByAttack(new AttackCollisionData(false, this.xTransform.v2Pos), this.xAttackPhaseEnemy);
                             if (xEnemy.sOverrideName == "")
                             {
                                 (this.xOwner as PlayerEntity).Owner.xGUIStuff.xLastMonsterHit.Set(xEnemy.xEnemyDescription.sFullName, xEnemy);
                             }
                             else
                             {
                                 (this.xOwner as PlayerEntity).Owner.xGUIStuff.xLastMonsterHit.Set(xEnemy.sOverrideName, xEnemy);
                             }
                             if (!this.xOverrideTarget.xBaseStats.bSlowImmunity)
                             {
                                 this.xOverrideTarget.xBaseStats.AddPercentageMoveSpeedDeBuff(new BaseStats.BuffFloat(60, 0.8f - (float)this.iPowerLevel * 0.075f));
                             }
                         }
                         if (this.iSoundCooldown >= 100)
                         {
                             Program.game.xSoundSystem.PlayCue("insects_attack", this.xTransform);
                             base.SendClientInstruction(6, new float[0]);
                             this.iSoundCooldown = 0;
                         }
                         Program.game._EffectMaster_AddEffect(new SortedAnimated(this.xTransform.v2Pos + Utility.RandomizeVector2Direction(CAS.RandomInVisual), SortedAnimated.SortedAnimatedEffects._HitEffect_Pang1));
                         this.iHitsOnCurrentTarget++;
                         if (this.xOverrideTarget.xBaseStats.iHP <= 0)
                         {
                             int iMaxAllowedHealth = this.iSwarmMaxHealth;
                             if (this.iExistTimer > 180)
                             {
                                 iMaxAllowedHealth = (int)((float)this.iSwarmMaxHealth * (1f - (float)(this.iExistTimer - 180) / 600f));
                             }
                             if (iMaxAllowedHealth < 60)
                             {
                                 iMaxAllowedHealth = 60;
                             }
                             this.iCounterAtLastSwitch = this.iExistTimer;
                             int iAddHP = (int)((float)iMaxAllowedHealth * ((float)this.iHitsOnCurrentTarget / 6f));
                             if (this.iSwarmHealth + iAddHP > iMaxAllowedHealth)
                             {
                                 iAddHP = iMaxAllowedHealth - this.iSwarmHealth;
                             }
                             if (iAddHP > 0)
                             {
                                 this.iSwarmHealth += iAddHP;
                                 base.SendClientInstruction(0, new float[]
                                 {
                                     (float)iAddHP
                                 });
                             }
                         }
                     }
                     this.v2Direction *= 0.2f;
                     for (int k = 0; k < this.lxInsectSwarm.Count; k++)
                     {
                         this.lxInsectSwarm[k].fMaxSpeed = this.fVelocity * 1.5f;
                     }
                 }
                 else
                 {
                     this.v2Direction *= 3f;
                     for (int l = 0; l < this.lxInsectSwarm.Count; l++)
                     {
                         this.lxInsectSwarm[l].fMaxSpeed = this.fVelocity * 3f;
                     }
                 }
             }
         }
         if ((bTakeChillPill || this.xOverrideTarget == null) && this.iExistTimer > this.iCounterAtLastAttack + 60)
         {
             if (this.v2Direction.Length() > 0.2f)
             {
                 this.v2Direction *= 0.95f;
             }
             else
             {
                 this.v2Direction = Vector2.Zero;
             }
         }
         if (this.v2Direction != Vector2.Zero && (this.xOverrideTarget == null || Vector2.Distance(this.xTransform.v2Pos, this.xOverrideTarget.xTransform.v2Pos) > 10f))
         {
             byte bydir = Utility.ConvertV2DirectionToClosestByteDirection(this.v2Direction);
             foreach (AmbientFollowInsect x4 in this.lxInsectSwarm)
             {
                 if (x4.xRenderComponent.iActiveAnimation < 4)
                 {
                     x4.xRenderComponent.SwitchAnimation((ushort)bydir);
                 }
                 if (bSlowDown)
                 {
                     x4.bStayPut = true;
                 }
                 else
                 {
                     x4.bStayPut = false;
                 }
             }
         }
         this.xTransform.v2ServerPos = this.xTransform.v2Pos;
     }
 }
コード例 #7
0
ファイル: BlommaAI.cs プロジェクト: ancientgods/SoG
 public override void OnUpdate()
 {
     if (!this.bInited)
     {
         this.bInited = true;
         this.bAggro = true;
         if (Program.game.xStateMaster.enGameMode == StateMaster.GameModes.RogueLike)
         {
             this.Appear();
             if (CAS.RandomInLogic.Next(2) == 0)
             {
                 this.xOwner.xRenderComponent.SwitchAnimation(10, Animation.CancelOptions.IgnoreIfPlaying);
             }
             else
             {
                 this.xOwner.xRenderComponent.SwitchAnimation(11, Animation.CancelOptions.IgnoreIfPlaying);
             }
         }
     }
     this.iCounter++;
     this.iNextHardUpdate--;
     if (this.xOwner.xRenderComponent.GetCurrentAnimation().bIsMoveCancellable)
     {
         if (this.iNextHardUpdate <= 0)
         {
             this.iNextHardUpdate = 10;
             Game1 Lord = Program.GetTheGame();
             Random arg_BD_0 = Program.GetTheGame().randomInLogic;
             Rectangle arg_D2_0 = Program.GetTheGame().xLevelMaster.xCurrentLevel.recCurrentBounds;
             float fClosest = 50000f;
             WorldActor xClosestPlayer = null;
             if (this.bAggro)
             {
                 List<WorldActor> lx = Lord._Enemy_GetTargetList(this, true);
                 foreach (WorldActor xActor in lx)
                 {
                     float fDist = Vector2.Distance(xActor.xTransform.v2Pos, this.xOwner.xTransform.v2Pos);
                     if (fDist < this.fFurthestAllowedDistance && fDist < fClosest)
                     {
                         xClosestPlayer = xActor;
                         fClosest = fDist;
                     }
                 }
             }
             if (xClosestPlayer == null)
             {
                 this.xPlayerLockedOnto = null;
             }
             if (xClosestPlayer != null)
             {
                 this.xPlayerLockedOnto = (this.xLastPlayerLookat = xClosestPlayer);
                 this.iNextHardUpdate = 10;
                 if (!this.bAppeared)
                 {
                     this.Appear();
                     if (this.xPlayerLockedOnto.xTransform.v2Pos.X < this.xOwner.xTransform.v2Pos.X)
                     {
                         this.xOwner.xRenderComponent.SwitchAnimation(11, Animation.CancelOptions.IgnoreIfPlaying);
                     }
                     else
                     {
                         this.xOwner.xRenderComponent.SwitchAnimation(10, Animation.CancelOptions.IgnoreIfPlaying);
                     }
                 }
                 else
                 {
                     this.iNextHardUpdate = 160;
                     if (this.xPlayerLockedOnto.xTransform.v2Pos.X < this.xOwner.xTransform.v2Pos.X)
                     {
                         Program.GetTheGame()._Enemy_EnterAttackAnimation(this.xOwner, 15);
                     }
                     else
                     {
                         Program.GetTheGame()._Enemy_EnterAttackAnimation(this.xOwner, 14);
                     }
                 }
             }
         }
         else if (this.xLastPlayerLookat != null)
         {
             if (this.xLastPlayerLookat.xTransform.v2Pos.X < this.xOwner.xTransform.v2Pos.X && this.xOwner.xRenderComponent.iActiveAnimation == 6)
             {
                 this.xOwner.xRenderComponent.SwitchAnimation(22, Animation.CancelOptions.IgnoreIfPlaying);
             }
             else if (this.xLastPlayerLookat.xTransform.v2Pos.X > this.xOwner.xTransform.v2Pos.X && this.xOwner.xRenderComponent.iActiveAnimation == 7)
             {
                 this.xOwner.xRenderComponent.SwitchAnimation(23, Animation.CancelOptions.IgnoreIfPlaying);
             }
         }
     }
     this.xOwner.xTransform.v2ServerPos = this.xOwner.xTransform.v2Pos;
 }
コード例 #8
0
 public override void Update()
 {
     if (this.xChallengeBag.bOpened)
     {
         TransformComponent expr_22_cp_0 = this.xBulletHellMachine.xRenderComponent.xTransform;
         expr_22_cp_0.v2Pos.Y = expr_22_cp_0.v2Pos.Y - 1f;
     }
     if (Program.game.xCutsceneMaster.bInCutscene || !this.bActive || this.xChallengeBag.bOpened)
     {
         return;
     }
     if (this.bInStartup)
     {
         this.iBulletHellCounter++;
         if (this.iBulletHellCounter == 5)
         {
             this.xBulletHellMachine.xRenderComponent.AsAnimated().SwitchAnimation(1);
             return;
         }
         if (this.iBulletHellCounter == 48)
         {
             Program.game._EffectMaster_AddEffect(new SortedAnimated(this.xBulletHellMachine.xRenderComponent.xTransform.v2Pos, SortedAnimated.SortedAnimatedEffects._Unique_FlyingTemple_BulletHellMachine_LiftoffEffect));
             return;
         }
         if (this.iBulletHellCounter >= 49 && this.iBulletHellCounter <= 74)
         {
             TransformComponent expr_F1_cp_0 = this.xBulletHellMachine.xRenderComponent.xTransform;
             expr_F1_cp_0.v2Pos.Y = expr_F1_cp_0.v2Pos.Y - 4f;
             return;
         }
         if (this.iBulletHellCounter > 74)
         {
             this.bInStartup = false;
             this.iBulletHellCounter = 0;
         }
         return;
     }
     else
     {
         if (CAS.NetworkRole == NetworkHelperInterface.NetworkRole.Client)
         {
             return;
         }
         for (int i = 0; i < this.lxDelayedHomingPrefab.Count; i++)
         {
             RogueLikeBullethellControl.DelayedHomingPrefab x = this.lxDelayedHomingPrefab[i];
             if (this.iBulletHellCounter % x.iModLeft == x.iModRight)
             {
                 this.xBulletHellMachine.xRenderComponent.AsAnimated().SwitchAnimation(3, Animation.CancelOptions.RestartIfPlaying);
                 int iMod = x.iVariance;
                 bool bNullPlayer = x.bNewTarget;
                 if (bNullPlayer)
                 {
                     List<PlayerView> lxPleyrs = Program.game._Players_GetPlayersSortedByNumber();
                     for (int j = 0; j < lxPleyrs.Count; j++)
                     {
                         if (lxPleyrs[j].xViewStats.bIsDead || lxPleyrs[j].xEntity.enTargetable == PlayerEntity.Targetable.Untargetable)
                         {
                             lxPleyrs.RemoveAt(j--);
                         }
                     }
                     if (lxPleyrs.Count > 0)
                     {
                         this.xPlayerLockedOnto = lxPleyrs[this.rand.Next(lxPleyrs.Count)].xEntity;
                     }
                     else
                     {
                         this.xPlayerLockedOnto = null;
                     }
                 }
                 if (this.xPlayerLockedOnto != null)
                 {
                     this.FireDelayedHomingBullet((this.xPlayerLockedOnto as PlayerEntity).Owner, iMod, 2f - 0.5f * (float)iMod, 3f);
                 }
             }
         }
         for (int k = 0; k < this.lxMegaPrefabs.Count; k++)
         {
             RogueLikeBullethellControl.MegaPrefab x2 = this.lxMegaPrefabs[k];
             if (this.iBulletHellCounter % x2.iModLeft == x2.iModRight)
             {
                 this.xBulletHellMachine.xRenderComponent.AsAnimated().SwitchAnimation(3);
                 this.FireMegaBullet(x2.v2MoveDir, x2.fStartVelocity, x2.fAcceleration, x2.iSurviveTime);
             }
         }
         for (int l = 0; l < this.lxOrbitPrefabs.Count; l++)
         {
             RogueLikeBullethellControl.OrbitPrefab x3 = this.lxOrbitPrefabs[l];
             if (this.iBulletHellCounter % x3.iModLeft == x3.iModRight)
             {
                 this.xBulletHellMachine.xRenderComponent.AsAnimated().SwitchAnimation(3);
                 for (int m = 0; m <= 32; m += 2)
                 {
                     float fRot = (float)m / 32f * 6.28318548f;
                     this.FireOrbitBullet(x3.iRotationDirection, -3.14159274f + fRot + ((x3.fStartRot != 0f) ? ((float)this.iBulletHellCounter / x3.fStartRot) : 0f) * (float)x3.iRotationDirection, 0.0025f, 1f);
                 }
             }
         }
         for (int n = 0; n < this.lxMissilePrefab.Count; n++)
         {
             RogueLikeBullethellControl.MissilePrefab x4 = this.lxMissilePrefab[n];
             if (this.iBulletHellCounter % x4.iModLeft == x4.iModRight)
             {
                 this.FireRocket(new Vector2(320f, -100f), Vector2.Normalize(new Vector2((float)CAS.RandomInVisual.NextDouble() - 0.5f, -0.5f)));
             }
         }
         if (this.enChallengeID == RogueLikeMode.Room.ChallengeRooms.BulletHell01)
         {
             if (this.iPhaseChanges == 0)
             {
                 if (this.iBulletHellCounter == 0)
                 {
                     this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(100, 0, 1, 0f));
                     this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(100, 50, -1, 0f));
                 }
                 if (this.iBulletHellCounter == 300)
                 {
                     this.lxMegaPrefabs.Add(new RogueLikeBullethellControl.MegaPrefab(125, 0, new Vector2(-1f, 0f), 2f, 0.96f, 75));
                     this.lxMegaPrefabs.Add(new RogueLikeBullethellControl.MegaPrefab(125, 25, Vector2.Normalize(new Vector2(-0.5f, 0.5f)), 2f, 0.96f, 75));
                     this.lxMegaPrefabs.Add(new RogueLikeBullethellControl.MegaPrefab(125, 50, Vector2.Normalize(new Vector2(0f, 1f)), 2f, 0.96f, 75));
                     this.lxMegaPrefabs.Add(new RogueLikeBullethellControl.MegaPrefab(125, 75, Vector2.Normalize(new Vector2(0.5f, 0.5f)), 2f, 0.96f, 75));
                     this.lxMegaPrefabs.Add(new RogueLikeBullethellControl.MegaPrefab(125, 100, Vector2.Normalize(new Vector2(1f, 0f)), 2f, 0.96f, 75));
                 }
                 if (this.iBulletHellCounter == 600)
                 {
                     this.lxMegaPrefabs.Clear();
                 }
                 if (this.iBulletHellCounter == 800)
                 {
                     this.lxDelayedHomingPrefab.Add(new RogueLikeBullethellControl.DelayedHomingPrefab(140, 0, 0, true));
                     this.lxDelayedHomingPrefab.Add(new RogueLikeBullethellControl.DelayedHomingPrefab(140, 10, 1, false));
                     this.lxDelayedHomingPrefab.Add(new RogueLikeBullethellControl.DelayedHomingPrefab(140, 20, 2, false));
                 }
                 if (this.iBulletHellCounter == 1200)
                 {
                     this.lxMegaPrefabs.Add(new RogueLikeBullethellControl.MegaPrefab(150, 0, new Vector2(-1f, 0f), 2f, 0.96f, 50));
                     this.lxMegaPrefabs.Add(new RogueLikeBullethellControl.MegaPrefab(150, 50, Vector2.Normalize(new Vector2(0f, 1f)), 2f, 0.96f, 50));
                     this.lxMegaPrefabs.Add(new RogueLikeBullethellControl.MegaPrefab(150, 100, Vector2.Normalize(new Vector2(1f, 0f)), 2f, 0.96f, 50));
                 }
                 if (this.iBulletHellCounter == 1600)
                 {
                     this.lxMegaPrefabs.Clear();
                     this.lxDelayedHomingPrefab.Clear();
                     this.lxOrbitPrefabs.Clear();
                 }
             }
         }
         else if (this.enChallengeID == RogueLikeMode.Room.ChallengeRooms.BulletHell02)
         {
             if (this.iPhaseChanges == 0)
             {
                 if (this.iBulletHellCounter == 0)
                 {
                     this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(100, 0, 1, 0f));
                     this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(100, 10, 1, 0f));
                     this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(100, 20, 1, 0f));
                     this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(100, 30, 1, 0f));
                     this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(100, 40, 1, 0f));
                     this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(100, 50, 1, 0f));
                     this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(100, 60, 1, 0f));
                     this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(100, 70, 1, 0f));
                     this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(100, 80, 1, 0f));
                     this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(100, 90, 1, 0f));
                 }
                 if (this.iBulletHellCounter == 300)
                 {
                     this.lxMegaPrefabs.Add(new RogueLikeBullethellControl.MegaPrefab(125, 25, Vector2.Normalize(new Vector2(-0.5f, 0.5f)), 2f, 0.96f, 75));
                     this.lxMegaPrefabs.Add(new RogueLikeBullethellControl.MegaPrefab(125, 0, Vector2.Normalize(new Vector2(0.5f, 0.5f)), 2f, 0.96f, 75));
                     this.lxMegaPrefabs.Add(new RogueLikeBullethellControl.MegaPrefab(125, 75, Vector2.Normalize(new Vector2(-0.4f, 0.3f)), 2f, 0.96f, 75));
                     this.lxMegaPrefabs.Add(new RogueLikeBullethellControl.MegaPrefab(125, 100, Vector2.Normalize(new Vector2(0.7f, 0.3f)), 2f, 0.96f, 75));
                 }
                 if (this.iBulletHellCounter == 800)
                 {
                     this.lxMissilePrefab.Add(new RogueLikeBullethellControl.MissilePrefab(80, 0));
                     this.lxMissilePrefab.Add(new RogueLikeBullethellControl.MissilePrefab(80, 40));
                 }
                 if (this.iBulletHellCounter == 1200)
                 {
                     this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(100, 0, -1, 0f));
                     this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(100, 10, -1, 0f));
                     this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(100, 20, -1, 0f));
                     this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(100, 30, -1, 0f));
                     this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(100, 40, -1, 0f));
                     this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(100, 50, -1, 0f));
                     this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(100, 60, -1, 0f));
                     this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(100, 70, -1, 0f));
                     this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(100, 80, -1, 0f));
                     this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(100, 90, -1, 0f));
                 }
                 if (this.iBulletHellCounter == 1600)
                 {
                     this.lxMegaPrefabs.Clear();
                     this.lxDelayedHomingPrefab.Clear();
                     this.lxOrbitPrefabs.Clear();
                 }
             }
         }
         else if (this.enChallengeID == RogueLikeMode.Room.ChallengeRooms.BulletHell03 && this.iPhaseChanges == 0)
         {
             if (this.iBulletHellCounter == 0)
             {
                 this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(120, 0, 1, -30f));
                 this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(120, 10, 1, -30f));
                 this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(120, 20, 1, -30f));
                 this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(120, 30, 1, -30f));
                 this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(120, 40, 1, -30f));
                 this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(120, 50, 1, -30f));
                 this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(120, 60, 1, -30f));
             }
             if (this.iBulletHellCounter == 300)
             {
                 this.lxMegaPrefabs.Add(new RogueLikeBullethellControl.MegaPrefab(1200, 301, Vector2.Normalize(new Vector2(-1f, 0.5f)), 2f, 0.96f, 75));
                 this.lxMegaPrefabs.Add(new RogueLikeBullethellControl.MegaPrefab(1200, 401, Vector2.Normalize(new Vector2(-0.5f, 0.5f)), 2f, 0.96f, 75));
                 this.lxMegaPrefabs.Add(new RogueLikeBullethellControl.MegaPrefab(1200, 501, Vector2.Normalize(new Vector2(-0f, 0.5f)), 2f, 0.96f, 75));
                 this.lxMegaPrefabs.Add(new RogueLikeBullethellControl.MegaPrefab(1200, 601, Vector2.Normalize(new Vector2(0.5f, 0.5f)), 2f, 0.96f, 75));
                 this.lxMegaPrefabs.Add(new RogueLikeBullethellControl.MegaPrefab(1200, 701, Vector2.Normalize(new Vector2(1f, 0.5f)), 2f, 0.96f, 75));
             }
             if (this.iBulletHellCounter == 800)
             {
                 this.lxMegaPrefabs.Clear();
                 this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(120, 0, -1, 30f));
                 this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(120, 10, -1, 30f));
                 this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(120, 20, -1, 30f));
                 this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(120, 30, -1, 30f));
                 this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(120, 40, -1, 30f));
                 this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(120, 100, -1, 30f));
                 this.lxOrbitPrefabs.Add(new RogueLikeBullethellControl.OrbitPrefab(120, 110, -1, 30f));
             }
             int arg_D2E_0 = this.iBulletHellCounter;
             if (this.iBulletHellCounter == 1600)
             {
                 this.lxMegaPrefabs.Clear();
                 this.lxDelayedHomingPrefab.Clear();
                 this.lxOrbitPrefabs.Clear();
             }
         }
         this.iBulletHellCounter++;
         return;
     }
 }
コード例 #9
0
 public override void OnAttackHit(AttackCollisionData xAtColData, BaseStats xBaseStats)
 {
     if (xBaseStats != null)
     {
         this.bDidHitMonster = true;
     }
     if (xAtColData.bShielded && xBaseStats.iPerfectGuardBonus > 0)
     {
         Vector2 v2Normal = Utility.AnimationDirectionToVector2((int)(xBaseStats.xOwner as PlayerEntity).byAnimationDirection);
         (this.v2Direction - 2f * (Vector2.Dot(this.v2Direction, v2Normal) * v2Normal)).Normalize();
         this.xAttackPhasePlayer.lenLayers.Remove(Collider.ColliderLayers.Players);
         this.xAttackPhasePlayer.lenLayers.Remove(Collider.ColliderLayers.Neutrals);
         this.xAttackPhasePlayer.lenLayers.Add(Collider.ColliderLayers.Enemies);
         if (GameSessionData.iBaseDifficulty == 0)
         {
             this.xAttackPhasePlayer.xStats.iBaseDamage *= 5;
         }
         else
         {
             this.xAttackPhasePlayer.xStats.iBaseDamage *= 5;
         }
         if (xBaseStats.xOwner.enEntityType == IEntity.EntityType.Player && (xBaseStats.xOwner as PlayerEntity).Owner.xEquipment.lenActiveEquipmentEffects.Contains(EquipmentInfo.SpecialEffect._Unique_WispShield_BetterProjectileReflect))
         {
             this.xAttackPhasePlayer.xStats.iBaseDamage = (int)((float)this.xAttackPhasePlayer.xStats.iBaseDamage * 1.5f);
         }
         this.v2Direction *= -1f;
         Enemy xOldOwner = this.xOwner as Enemy;
         this.xOwner = xBaseStats.xOwner;
         this.iDestroyAt += 120;
         if (this.fVelocity < 2f)
         {
             this.fVelocity = 2f;
         }
         if (!xOldOwner.bToBeDestroyed)
         {
             this.xTargetActor = xOldOwner;
             return;
         }
         List<Enemy> lxEnemies = Program.GetTheGame()._Enemies_GetEnemiesByDistanceToHitbox(this.xTransform.v2Pos, 300f, false);
         lxEnemies.ShuffleList<Enemy>();
         bool bTargetFound = false;
         this.bReflected = true;
         using (List<Enemy>.Enumerator enumerator = lxEnemies.GetEnumerator())
         {
             if (enumerator.MoveNext())
             {
                 Enemy x = enumerator.Current;
                 this.xTargetActor = x;
                 bTargetFound = true;
             }
         }
         if (!bTargetFound)
         {
             this.bToBeDestroyed = true;
             return;
         }
     }
     else
     {
         this.bToBeDestroyed = true;
     }
 }
コード例 #10
0
ファイル: MarinoOneAI.cs プロジェクト: ancientgods/SoG
 public override void PlayerRemovedFromPlay(WorldActor xActor)
 {
     if (this.xPlayerLockedOnto == xActor)
     {
         this.xPlayerLockedOnto = null;
         if (CAS.NetworkRole == NetworkHelperInterface.NetworkRole.Server)
         {
             NetOutgoingMessage om = base.CreateMessage();
             om.Write(0);
             Program.game._EntityMaster_WriteActor(om, this.xPlayerLockedOnto);
             base.SendMessage(om);
         }
     }
 }
コード例 #11
0
ファイル: BirdieAI.cs プロジェクト: ancientgods/SoG
 public override void PlayerRemovedFromPlay(WorldActor xActor)
 {
     if (this.xPlayerLockedOnto == xActor)
     {
         if (this.enCurrentAction == BirdieAI.BirdieAction.InPeck)
         {
             this.enCurrentAction = BirdieAI.BirdieAction.ChillinSoon;
             this.iNextHardUpdate = 60;
             base.SendClientInstruction(4, new float[0]);
             if (this.xRCHead.iActiveAnimation < 100)
             {
                 this.SwitchHeadAnimation((ushort)(16 + this.xRCHead.GetCurrentAnimation().byAnimationDirection));
             }
             this.v2HeadMoveDir = Vector2.Normalize(new Vector2(-this.v2RelaxedHeadOffset.X, this.v2RelaxedHeadOffset.Y) - this.xRCHead.v2OffsetRenderPos) * 6f;
         }
         this.xPlayerLockedOnto = null;
     }
 }
コード例 #12
0
ファイル: TediBrawler.cs プロジェクト: ancientgods/SoG
 private byte OtherBrawlerBotAttackDirection(WorldActor xTarget)
 {
     foreach (Enemy x in Program.GetTheGame().dixEnemyList.Values)
     {
         if (x != this.xOwner && !x.bToBeDestroyed && x.xBaseStats.iHP > 0 && x.xBehaviour is TediBrawler && x.xBehaviour.xPlayerLockedOnto == xTarget)
         {
             return (x.xBehaviour as TediBrawler).byEngageDir;
         }
     }
     return 4;
 }
コード例 #13
0
 public override void Update()
 {
     if (this.bToBeDestroyed)
     {
         return;
     }
     if (this.iExistTimer % 7 == 0)
     {
         WorldActor xClosest = null;
         float fClosest = 100000f;
         foreach (Enemy xEn in Program.game.dixEnemyList.Values)
         {
             if (xEn != this.xPreviousHit && !xEn.bToBeDestroyed && xEn.xBaseStats.iHP > 0 && !xEn.bDefeated && (xEn.xCollisionComponent.lxHitboxColliders.Count <= 0 || (xEn.xCollisionComponent.IsGroupActive(CollisionComponent.ColliderGroup.Combat) && xEn.xCollisionComponent.lxHitboxColliders[0].ComparePrerequisites(this.xAttackPhaseEnemy.lxCurrentColliders[0]))) && !xEn.xBaseStats.bUntargetable)
             {
                 float fThis = Vector2.Distance(xEn.xTransform.v2Pos, this.xTransform.v2Pos);
                 if (fThis < this.fMaxDistance)
                 {
                     if (this.dxiHitEntities.ContainsKey(xEn))
                     {
                         if (this.iMaxHits < 4)
                         {
                             continue;
                         }
                         fThis += 50f;
                     }
                     if (fThis < fClosest && (this.iHits != 0 || this.IsWithinArc(Utility.Vector2ToRadians(Vector2.Normalize(xEn.xTransform.v2Pos - this.xTransform.v2Pos)))))
                     {
                         xClosest = xEn;
                         fClosest = fThis;
                     }
                 }
             }
         }
         if (xClosest != null)
         {
             if (this.dxiHitEntities.ContainsKey(xClosest))
             {
                 fClosest -= 50f;
             }
             this.xPreviousHit = xClosest;
             this.CreateEffect(this.xTransform.v2Pos, xClosest.xTransform.v2Pos);
             if (this.dxiHitEntities.ContainsKey(xClosest))
             {
                 this.dxiHitEntities[xClosest] = this.dxiHitEntities[xClosest] + 1;
             }
             else
             {
                 this.dxiHitEntities[xClosest] = 1;
             }
             if (xClosest.enEntityType == IEntity.EntityType.Enemy)
             {
                 this.xAttackPhaseEnemy.xStats.iBaseDamage = this.iFullDamage / this.dxiHitEntities[xClosest];
                 Program.game._Enemy_TakeArbitraryDamage(xClosest as Enemy, Program.game._AttackStats_CalculateDefenseReduction(this.xAttackPhaseEnemy.xStats.iBaseDamage, xClosest.xBaseStats, this.xAttackPhaseEnemy.xStats.fArmorPenetration, this.xAttackPhaseEnemy.xStats.bFlatArmorPenetration), 0, this.xAttackPhaseEnemy);
                 this.xAttackPhaseEnemy.lxHitEntities.Clear();
                 if (xClosest.enEntityType == IEntity.EntityType.Enemy)
                 {
                     (xClosest as Enemy).enHitEffectType = Enemy.HitEffectType.Electro;
                     (xClosest as Enemy).iHitEffect = 20;
                 }
             }
             this.fMaxDistance = this.fMaxBounceDistance;
             this.iHits++;
             this.iFullDamage = (int)((float)this.iFullDamage * this.fReductionPerHit);
             this.xTransform.v2Pos = xClosest.xTransform.v2Pos;
             if (this.iHits >= this.iMaxHits)
             {
                 this.bToBeDestroyed = true;
             }
         }
         else
         {
             this.bToBeDestroyed = true;
         }
     }
     this.iExistTimer++;
     this.xTransform.v2ServerPos = this.xTransform.v2Pos;
 }
コード例 #14
0
ファイル: VilyaTheFirst.cs プロジェクト: ancientgods/SoG
 public override void PlayerRemovedFromPlay(WorldActor xActor)
 {
     if (Program.GetTheGame().xNetworkInfo.enCurrentRole == NetworkHelperInterface.NetworkRole.Client)
     {
         return;
     }
     if (xActor == this.xPlayerLockedOnto)
     {
         this.xPlayerLockedOnto = null;
     }
 }
コード例 #15
0
ファイル: Trick_Original.cs プロジェクト: ancientgods/SoG
 public override void PlayerRemovedFromPlay(WorldActor xActor)
 {
     if (this.xPlayerLockedOnto == xActor)
     {
         this.xPlayerLockedOnto = null;
         this.enCurrentAction = Trick_Original.CurrentAction.WaitTo0;
         this.iCounter = -60;
     }
 }
コード例 #16
0
 public void SetInfo(Collider col, int iDamage, WorldActor xOrbitAround)
 {
     this.xAttackPhase = new AttackPhase(this);
     this.xAttackPhase.lxCurrentColliders.Add(col);
     this.xAttackPhase.xStats.iBaseDamage = iDamage;
     this.xAttackPhase.xStats.iBreakingPower = 1;
     this.xAttackPhase.xStats.fKnockBack = 20f;
     col.xAttackPhase = this.xAttackPhase;
     this.xAttackPhase.RegisterCurrent();
     this.xAttackPhase.lenLayers.Add(Collider.ColliderLayers.Players);
     this.xAttackPhase.lenLayers.Add(Collider.ColliderLayers.EnivonmentalHazards);
     this.xOrbitAroundThis = xOrbitAround;
     SphereCollider colHitbox = new SphereCollider(5f, new Vector2(0f, -2f), this.xTransform, 0f, this);
     colHitbox.xBaseStats = new BaseStats(this);
     this.xCollisionComponent.AddHitboxCollider(colHitbox, Collider.ColliderLayers.Enemies);
 }
コード例 #17
0
ファイル: GhostyAI.cs プロジェクト: ancientgods/SoG
 public override void OnUpdate()
 {
     if (this.xOwner.bToBeDestroyed)
     {
         return;
     }
     this.iLaughCounter--;
     if (this.iLaughCounter <= 0)
     {
         this.iLaughCounter = Program.GetTheGame().randomInLogic.Next(180) + 240;
         Program.GetTheGame().xSoundSystem.PlayCue("Ghost_Laugh", this.xOwner, false);
     }
     if (!this.bInited)
     {
         this.xOwner.xRenderComponent.SwitchAnimation((ushort)((byte)Program.GetTheGame().randomInLogic.Next(4)), Animation.CancelOptions.UseAnimationDefault);
         this.bInited = true;
     }
     int iLowestStealthDelay = 60;
     if (!this.bIsInvisible && this.iFadeCounter == 0 && (float)this.iLastOffensiveAction + MathHelper.Max((float)(240 - Program.GetTheGame()._Enemy_GetDifficultyModifier() * 40 - (this.bIsElite ? 100 : 0)), (float)iLowestStealthDelay) < (float)this.iCounter)
     {
         this.FadeOut();
     }
     Random knark = Program.GetTheGame().randomInLogic;
     this.UpdateFade();
     if (this.v2RandMoveDir != Vector2.Zero)
     {
         if (this.iHoldYourHorses > 0)
         {
             if (this.iHoldYourHorses % 40 == 0)
             {
                 this.v2WantDirection = new Vector2((float)knark.NextDouble() * 2f - 1f, (float)knark.NextDouble() * 2f - 1f);
                 this.v2WantDirection.Normalize();
             }
             this.v2RandMoveDir = Vector2.Lerp(this.v2RandMoveDir, this.v2WantDirection, 0.03f);
         }
         this.xOwner.xTransform.v2Pos += this.xOwner.xBaseStats.fMovementSpeed * this.v2RandMoveDir;
     }
     if (Utility.IsWithinRange((int)this.xOwner.xRenderComponent.iActiveAnimation, 8, 11))
     {
         this.iTimeInAttack++;
         if (this.iTimeInAttack > 24)
         {
             if (this.xOwner.byAnimationDirection == 1)
             {
                 if (this.v2TargetAttacked.xTransform.v2Pos.X < this.xOwner.xTransform.v2Pos.X)
                 {
                     this.xOwner.xRenderComponent.SwitchAnimation(14, Animation.CancelOptions.IgnoreIfPlaying);
                 }
                 else
                 {
                     this.xOwner.xRenderComponent.SwitchAnimation(12, Animation.CancelOptions.IgnoreIfPlaying);
                 }
             }
             else if (this.v2TargetAttacked.xTransform.v2Pos.X > this.xOwner.xTransform.v2Pos.X)
             {
                 this.xOwner.xRenderComponent.SwitchAnimation(15, Animation.CancelOptions.IgnoreIfPlaying);
             }
             else
             {
                 this.xOwner.xRenderComponent.SwitchAnimation(13, Animation.CancelOptions.IgnoreIfPlaying);
             }
             this.v2TargetAttacked = null;
             this.iHoldYourHorses = 120;
             this.fTargetDistance = 120f;
         }
     }
     this.iCounter++;
     this.iHoldYourHorses--;
     if (this.iHoldYourHorses == 0)
     {
         this.fTargetDistance = 62f;
     }
     this.iNextHardUpdate--;
     this.iWannaCircleBaby--;
     if (this.xOwner.xRenderComponent.GetCurrentAnimation().bIsMoveCancellable && this.iNextHardUpdate <= 0)
     {
         this.iNextHardUpdate = 10;
         Game1 Lord = Program.GetTheGame();
         Rectangle levelRec = Program.GetTheGame().xLevelMaster.xCurrentLevel.recCurrentBounds;
         float fClosest = 50000f;
         WorldActor xClosestPlayer = null;
         List<WorldActor> lx = Lord._Enemy_GetTargetList(this, true);
         foreach (WorldActor xPlayer in lx)
         {
             float fDist = Vector2.Distance(xPlayer.xTransform.v2Pos, this.xOwner.xTransform.v2Pos);
             if (fDist < this.fAggroDistance && fDist < fClosest)
             {
                 xClosestPlayer = xPlayer;
                 fClosest = fDist;
             }
         }
         if (xClosestPlayer == null)
         {
             this.xPlayerLockedOnto = null;
             this.iWannaCircleBaby = 0;
         }
         if (xClosestPlayer != null)
         {
             if (this.xPlayerLockedOnto == null)
             {
                 this.xPlayerLockedOnto = xClosestPlayer;
                 if (this.iWannaCircleBaby == 0)
                 {
                     this.iWannaCircleBaby = 60 + knark.Next(230);
                 }
                 this.fRotDir = 1;
                 if (knark.Next(2) == 0)
                 {
                     this.fRotDir = -1;
                 }
                 Vector2 v2Dirr = this.xPlayerLockedOnto.xTransform.v2Pos - this.xOwner.xTransform.v2Pos;
                 v2Dirr.Normalize();
                 this.fCurrentRotation = (float)Math.Atan2((double)v2Dirr.X, (double)(-(double)v2Dirr.Y));
             }
             bool bDidAttack = false;
             float fDistance = Vector2.Distance(this.xPlayerLockedOnto.xTransform.v2Pos, this.xOwner.xTransform.v2Pos);
             if (this.iWannaCircleBaby <= 0 && fDistance <= this.fFurthestAllowedDistance && fDistance >= this.fMinAttackDistance && this.bIsInvisible)
             {
                 if (MathHelper.Distance(this.xOwner.xTransform.v2Pos.Y, this.xPlayerLockedOnto.xTransform.v2Pos.Y) < 8f)
                 {
                     this.v2TargetAttacked = this.xPlayerLockedOnto;
                     if (this.xOwner.xTransform.v2Pos.X < this.xPlayerLockedOnto.xTransform.v2Pos.X)
                     {
                         this.xOwner.xRenderComponent.SwitchAnimation(5, Animation.CancelOptions.IgnoreIfPlaying);
                         this.iLastOffensiveAction = this.iCounter;
                         this.FadeIn();
                     }
                     else
                     {
                         this.xOwner.xRenderComponent.SwitchAnimation(7, Animation.CancelOptions.IgnoreIfPlaying);
                         this.iLastOffensiveAction = this.iCounter;
                         this.FadeIn();
                     }
                     bDidAttack = true;
                 }
                 this.v2RandMoveDir = Vector2.Zero;
                 this.iNextHardUpdate = 0;
             }
             if (!bDidAttack)
             {
                 this.fCurrentRotation += (float)this.fRotDir * 0.15f;
                 this.iNextHardUpdate = 5;
                 Vector2 v2Look = this.xPlayerLockedOnto.xTransform.v2Pos - this.xOwner.xTransform.v2Pos;
                 v2Look.Normalize();
                 byte lolKuk = Utility.ConvertV2DirectionToClosestByteDirection(v2Look);
                 this.xOwner.xRenderComponent.SwitchAnimation((ushort)lolKuk, Animation.CancelOptions.UseAnimationDefault);
                 float x = (float)Math.Cos((double)this.fCurrentRotation);
                 float y = (float)Math.Sin((double)this.fCurrentRotation);
                 this.v2TargetPos = this.xPlayerLockedOnto.xTransform.v2Pos + new Vector2(x * this.fTargetDistance, y * this.fTargetDistance);
                 this.v2RandMoveDir = this.v2TargetPos - this.xOwner.xTransform.v2Pos;
                 this.v2RandMoveDir.Normalize();
             }
         }
         else if (!levelRec.Contains((int)this.xOwner.xTransform.v2Pos.X, (int)this.xOwner.xTransform.v2Pos.Y))
         {
             this.iNextHardUpdate = 70 + knark.Next(40);
             this.v2RandMoveDir = new Vector2((float)levelRec.Center.X, (float)levelRec.Center.Y) - this.xOwner.xTransform.v2Pos;
             this.v2RandMoveDir.Normalize();
             byte lolKuk2 = Utility.ConvertV2DirectionToClosestByteDirection(this.v2RandMoveDir);
             this.xOwner.xRenderComponent.SwitchAnimation((ushort)lolKuk2, Animation.CancelOptions.UseAnimationDefault);
         }
         else if (knark.Next(20) == 1)
         {
             this.iNextHardUpdate = 45;
             this.v2RandMoveDir = new Vector2(-1f + (float)knark.NextDouble() * 2f, -1f + (float)knark.NextDouble() * 2f);
             this.v2RandMoveDir.Normalize();
             byte lolKuk3 = Utility.ConvertV2DirectionToClosestByteDirection(this.v2RandMoveDir);
             this.xOwner.xRenderComponent.SwitchAnimation((ushort)lolKuk3, Animation.CancelOptions.UseAnimationDefault);
         }
         else if (knark.Next(10) != 1)
         {
             this.iNextHardUpdate = 10;
             this.v2RandMoveDir = Vector2.Zero;
             this.xOwner.xRenderComponent.SwitchAnimation((ushort)this.xOwner.xRenderComponent.GetCurrentAnimation().byAnimationDirection, Animation.CancelOptions.UseAnimationDefault);
         }
     }
     this.xOwner.xTransform.v2ServerPos = this.xOwner.xTransform.v2Pos;
 }
コード例 #18
0
 public void SetOwner(WorldActor xOwner)
 {
     this.xPetOwner = xOwner;
 }
コード例 #19
0
ファイル: EnemyBehaviour.cs プロジェクト: ancientgods/SoG
 public virtual void PlayerRemovedFromPlay(WorldActor xActor)
 {
     if (this.xPlayerLockedOnto == xActor)
     {
         this.xPlayerLockedOnto = null;
     }
 }
コード例 #20
0
ファイル: TerrorweedAI.cs プロジェクト: ancientgods/SoG
 public override void OnUpdate()
 {
     Random knark = Program.GetTheGame().randomInLogic;
     if (!this.bInited)
     {
         this.bInited = true;
         this.bAggro = true;
         if (GameSessionData.iBaseDifficulty > 0)
         {
             this.fUnburrowDistance = 7f;
         }
         this.Disappear();
         if (knark.Next(2) == 0)
         {
             this.xOwner.xRenderComponent.SwitchAnimation(0, Animation.CancelOptions.IgnoreIfPlaying);
         }
         else
         {
             this.xOwner.xRenderComponent.SwitchAnimation(1, Animation.CancelOptions.IgnoreIfPlaying);
         }
     }
     if (this.xRootInstance != null)
     {
         if (this.xRootInstance.bToBeDestroyed)
         {
             if (this.xOwner.byAnimationDirection == 1)
             {
                 this.xOwner.xRenderComponent.SwitchAnimation(30, Animation.CancelOptions.IgnoreIfPlaying);
             }
             else
             {
                 this.xOwner.xRenderComponent.SwitchAnimation(31, Animation.CancelOptions.IgnoreIfPlaying);
             }
             this.xRootInstance = null;
         }
         return;
     }
     this.iCounter++;
     this.iNextHardUpdate--;
     if (this.iMeriGoRoundLogic == 5)
     {
         this.iAppearAtTarget--;
         Vector2 v2EffectPos = Vector2.Lerp(this.v2TargetToAppearAt, this.xOwner.xTransform.v2Pos, (float)this.iAppearAtTarget / (float)this.iDiveTime);
         this.AddDigEffect(v2EffectPos);
         if (this.iAppearAtTarget <= 0)
         {
             this.Appear();
             this.xOwner.xTransform.SetBoth(this.v2TargetToAppearAt);
             ushort iAdd = 0;
             if (this.xPlayerLockedOnto != null && this.xPlayerLockedOnto.xTransform.v2Pos.X < this.xOwner.xTransform.v2Pos.X)
             {
                 iAdd = 1;
             }
             Program.game._Enemy_EnterAttackAnimation(this.xOwner, (ushort)(10 + iAdd));
             this.iMeriGoRoundLogic = 2;
         }
     }
     else if (this.iMeriGoRoundLogic == 6 && this.iCounter % 5 == 0 && (this.xOwner.xRenderComponent.iActiveAnimation == 32 || this.xOwner.xRenderComponent.iActiveAnimation == 33))
     {
         Vector2 v2TryPos = Vector2.Zero;
         int iTries = 0;
         bool bValid = false;
         do
         {
             v2TryPos = this.xOwner.xTransform.v2Pos + new Vector2((float)(-150 + CAS.RandomInLogic.Next(300)), (float)(-100 + CAS.RandomInLogic.Next(200)));
             if (CAS.GameMode == StateMaster.GameModes.RogueLike)
             {
                 Rectangle bounds = Program.game.xGameSessionData.xRogueLikeSession.xCurrentRoom.recBounds;
                 v2TryPos = new Vector2((float)(bounds.Left + CAS.RandomInLogic.Next(bounds.Width)), (float)(bounds.Top + CAS.RandomInLogic.Next(bounds.Height)));
             }
             if (!Program.game._CollisionMaster_CheckVsStatic(v2TryPos, 8f, 1))
             {
                 bValid = true;
             }
             iTries++;
         }
         while (!bValid && iTries < 30);
         if (!bValid)
         {
             v2TryPos = this.xOwner.xTransform.v2Pos;
         }
         DamagingCrateArchetype x = Program.game._EntityMaster_AddDynamicEnvironment(DynamicEnvironmentCodex.ObjectTypes.DamagingThorn_Halloween_Delayed, v2TryPos) as DamagingCrateArchetype;
         x.SetDelay(30);
         x.xAttackPhase.xStats.iBaseDamage = 40;
         this.iThornsToSpawn--;
         if (this.iThornsToSpawn == 0)
         {
             this.iMeriGoRoundLogic = 2;
             this.xOwner.xRenderComponent.SwitchAnimation((ushort)(30 + ((this.xOwner.byAnimationDirection == 3) ? 1 : 0)));
             this.iNextHardUpdate = Math.Max(180 - CAS.DifficultyModifier * 10, 80);
             this.xOwner.xCollisionComponent.lxHitboxColliders[0].xLocalTransform.v2Pos.X = 0f;
         }
     }
     if (this.xOwner.xRenderComponent.GetCurrentAnimation().bIsMoveCancellable && this.iNextHardUpdate <= 0)
     {
         Game1 Lord = Program.GetTheGame();
         Rectangle arg_3CE_0 = Program.GetTheGame().xLevelMaster.xCurrentLevel.recCurrentBounds;
         float fClosest = 50000f;
         WorldActor xClosestPlayer = null;
         List<WorldActor> lx = Lord._Enemy_GetTargetList(this, true);
         if (this.bAggro)
         {
             foreach (WorldActor xActor in lx)
             {
                 float fDist = Vector2.Distance(xActor.xTransform.v2Pos, this.xOwner.xTransform.v2Pos);
                 if (fDist < this.fFurthestAllowedDistance && fDist < fClosest)
                 {
                     xClosestPlayer = xActor;
                     fClosest = fDist;
                 }
             }
         }
         if (xClosestPlayer == null)
         {
             this.xPlayerLockedOnto = null;
         }
         else
         {
             this.xPlayerLockedOnto = (this.xLastPlayerLookat = xClosestPlayer);
         }
         if (this.iMeriGoRoundLogic == 0)
         {
             if (this.iCounter > 60 && xClosestPlayer != null && fClosest < this.fActivationDistance)
             {
                 int iAdd2 = CAS.RandomInLogic.Next(2);
                 Program.game._Enemy_EnterAttackAnimation(this.xOwner, (ushort)(10 + iAdd2));
                 this.iMeriGoRoundLogic = 2;
             }
         }
         else if (this.iMeriGoRoundLogic == 1)
         {
             if (this.xPlayerLockedOnto == null)
             {
                 this.xOwner.xRenderComponent.SwitchAnimation(11, Animation.CancelOptions.IgnoreIfPlaying);
                 this.iMeriGoRoundLogic = 2;
             }
             else if (fClosest < this.fUnburrowDistance || this.iCounter > this.iCounterAtBury + 300 + lx.Count * 60)
             {
                 this.iMeriGoRoundLogic = 2;
                 if (this.xPlayerLockedOnto.xTransform.v2Pos.X < this.xOwner.xTransform.v2Pos.X)
                 {
                     Program.GetTheGame()._Enemy_EnterAttackAnimation(this.xOwner, 11);
                 }
                 else
                 {
                     Program.GetTheGame()._Enemy_EnterAttackAnimation(this.xOwner, 10);
                 }
             }
             else
             {
                 this.iNextHardUpdate = 4;
                 this.v2RandMoveDir = Vector2.Normalize(this.xPlayerLockedOnto.xTransform.v2Pos - this.xOwner.xTransform.v2Pos);
             }
         }
         else if (this.iMeriGoRoundLogic == 2)
         {
             this.iNextHardUpdate = 30;
             if (this.iCounterAtLastThornSpawn + 800 < this.iCounter)
             {
                 this.iMeriGoRoundLogic = 6;
                 this.xOwner.xRenderComponent.SwitchAnimation((ushort)(28 + ((this.xOwner.byAnimationDirection == 3) ? 1 : 0)));
                 this.iThornsToSpawn = 16 + CAS.DifficultyModifier * 3;
                 this.iCounterAtLastThornSpawn = this.iCounter;
                 return;
             }
             if (this.xLastPlayerLookat != null)
             {
                 if (this.xLastPlayerLookat.xTransform.v2Pos.X < this.xOwner.xTransform.v2Pos.X && this.xOwner.xRenderComponent.iActiveAnimation == 6)
                 {
                     this.xOwner.xRenderComponent.SwitchAnimation(22, Animation.CancelOptions.IgnoreIfPlaying);
                     return;
                 }
                 if (this.xLastPlayerLookat.xTransform.v2Pos.X > this.xOwner.xTransform.v2Pos.X && this.xOwner.xRenderComponent.iActiveAnimation == 7)
                 {
                     this.xOwner.xRenderComponent.SwitchAnimation(23, Animation.CancelOptions.IgnoreIfPlaying);
                     return;
                 }
             }
             if (this.xPlayerLockedOnto != null)
             {
                 if (fClosest < this.fAttackDistance && this.iCounterAtLastDive + 600 >= this.iCounter)
                 {
                     this.iNextHardUpdate = 160 - 25 * Program.GetTheGame().dixPlayers.Count - 10 * GameSessionData.iBaseDifficulty;
                     this.iCounterAtLastAgressiveAction = this.iCounter;
                     if (this.xPlayerLockedOnto.xTransform.v2Pos.X < this.xOwner.xTransform.v2Pos.X)
                     {
                         Program.GetTheGame()._Enemy_EnterAttackAnimation(this.xOwner, 15);
                     }
                     else
                     {
                         Program.GetTheGame()._Enemy_EnterAttackAnimation(this.xOwner, 14);
                     }
                 }
                 if (this.iCounterAtLastAgressiveAction + 300 < this.iCounter && (fClosest > this.fAttackDistance || this.iCounterAtLastDive + 600 < this.iCounter))
                 {
                     this.iCounterAtLastDive = this.iCounter;
                     List<Enemy> lxLol = Program.GetTheGame()._Enemies_GetEnemiesByTarget(this.xPlayerLockedOnto);
                     if (this.xPlayerLockedOnto.enEntityType != IEntity.EntityType.Player || lxLol.Count <= 1 || Program.GetTheGame().dixPlayers.Count < 2 || (Program.GetTheGame().dixPlayers.Count < 4 && knark.Next(2) == 0))
                     {
                         this.iMeriGoRoundLogic = 1;
                         this.iCounterAtBury = this.iCounter;
                         if (this.xOwner.byAnimationDirection == 1)
                         {
                             this.xOwner.xRenderComponent.SwitchAnimation(26, Animation.CancelOptions.IgnoreIfPlaying);
                         }
                         else
                         {
                             this.xOwner.xRenderComponent.SwitchAnimation(27, Animation.CancelOptions.IgnoreIfPlaying);
                         }
                     }
                     else
                     {
                         if (this.xOwner.byAnimationDirection == 1)
                         {
                             this.xOwner.xRenderComponent.SwitchAnimation(28, Animation.CancelOptions.IgnoreIfPlaying);
                         }
                         else
                         {
                             this.xOwner.xRenderComponent.SwitchAnimation(29, Animation.CancelOptions.IgnoreIfPlaying);
                         }
                         this.iNextHardUpdate = 120;
                     }
                 }
             }
         }
         else if (this.iMeriGoRoundLogic == 100)
         {
             this.iNextHardUpdate = 120;
             if (this.iSubMeri == 0)
             {
                 this.iSubMeri++;
                 this.xOwner.xRenderComponent.SwitchAnimation(7, Animation.CancelOptions.IgnoreIfPlaying);
             }
             else
             {
                 this.iSubMeri = 0;
                 this.xOwner.xRenderComponent.SwitchAnimation(29, Animation.CancelOptions.IgnoreIfPlaying);
             }
         }
     }
     this.xOwner.xTransform.v2ServerPos = this.xOwner.xTransform.v2Pos;
 }
コード例 #21
0
ファイル: PumpkinAI.cs プロジェクト: ancientgods/SoG
 public override void PlayerRemovedFromPlay(WorldActor xActor)
 {
     if (this.xPlayerLockedOnto == xActor)
     {
         this.xPlayerLockedOnto = null;
         this.iMeriGoRound = 0;
     }
 }
コード例 #22
0
ファイル: FreddyFirst_MK2.cs プロジェクト: ancientgods/SoG
 public override void PlayerRemovedFromPlay(WorldActor xActor)
 {
     if (this.xPlayerLockedOnto == xActor)
     {
         this.xPlayerLockedOnto = null;
         this.iPassiveAction = 0;
     }
 }
コード例 #23
0
ファイル: HalloweedAI.cs プロジェクト: ancientgods/SoG
 public override void OnUpdate()
 {
     Random knark = Program.GetTheGame().randomInLogic;
     if (!this.bInited)
     {
         this.bInited = true;
         this.bAggro = true;
         if (GameSessionData.iBaseDifficulty > 0)
         {
             this.fUnburrowDistance = 7f;
         }
         this.Disappear();
         if (knark.Next(2) == 0)
         {
             this.xOwner.xRenderComponent.SwitchAnimation(0, Animation.CancelOptions.IgnoreIfPlaying);
         }
         else
         {
             this.xOwner.xRenderComponent.SwitchAnimation(1, Animation.CancelOptions.IgnoreIfPlaying);
         }
     }
     if (this.xRootProjectile != null)
     {
         if (this.xRootProjectile.bToBeDestroyed)
         {
             if (this.xOwner.byAnimationDirection == 1)
             {
                 this.xOwner.xRenderComponent.SwitchAnimation(30, Animation.CancelOptions.IgnoreIfPlaying);
             }
             else
             {
                 this.xOwner.xRenderComponent.SwitchAnimation(31, Animation.CancelOptions.IgnoreIfPlaying);
             }
             this.xRootProjectile = null;
         }
         return;
     }
     this.iCounter++;
     this.iNextHardUpdate--;
     if (this.xOwner.xRenderComponent.iActiveAnimation == 4)
     {
         if (this.v2RandMoveDir != Vector2.Zero)
         {
             this.xOwner.xTransform.v2Pos += this.v2RandMoveDir * this.xOwner.xBaseStats.fMovementSpeed;
         }
         if (this.iCounter % (8 - GameSessionData.iBaseDifficulty) == 0)
         {
             this.AddDigEffect();
         }
         if (this.iCounter % 50 == 0)
         {
             Program.GetTheGame().xSoundSystem.PlayCue("Halloweed_Digging", this.xOwner, false);
         }
     }
     if (this.xOwner.xRenderComponent.GetCurrentAnimation().bIsMoveCancellable && this.iNextHardUpdate <= 0)
     {
         Game1 Lord = Program.GetTheGame();
         Rectangle arg_1B3_0 = Program.GetTheGame().xLevelMaster.xCurrentLevel.recCurrentBounds;
         float fClosest = 50000f;
         WorldActor xClosestPlayer = null;
         List<WorldActor> lx = Lord._Enemy_GetTargetList(this, true);
         if (this.bAggro)
         {
             foreach (WorldActor xActor in lx)
             {
                 float fDist = Vector2.Distance(xActor.xTransform.v2Pos, this.xOwner.xTransform.v2Pos);
                 if (fDist < this.fFurthestAllowedDistance && fDist < fClosest)
                 {
                     xClosestPlayer = xActor;
                     fClosest = fDist;
                 }
             }
         }
         if (xClosestPlayer == null)
         {
             this.xPlayerLockedOnto = null;
         }
         else
         {
             this.xPlayerLockedOnto = (this.xLastPlayerLookat = xClosestPlayer);
         }
         if (this.iMeriGoRoundLogic == 0)
         {
             if (this.iCounter > 60 && xClosestPlayer != null && fClosest < this.fActivationDistance)
             {
                 this.iNextHardUpdate = 10;
                 this.iCounterAtBury = this.iCounter;
                 if (this.xOwner.byAnimationDirection == 1)
                 {
                     this.xOwner.xRenderComponent.SwitchAnimation(3, Animation.CancelOptions.IgnoreIfPlaying);
                 }
                 else
                 {
                     this.xOwner.xRenderComponent.SwitchAnimation(2, Animation.CancelOptions.IgnoreIfPlaying);
                 }
                 this.iMeriGoRoundLogic = 1;
             }
         }
         else if (this.iMeriGoRoundLogic == 1)
         {
             if (this.xPlayerLockedOnto == null)
             {
                 this.xOwner.xRenderComponent.SwitchAnimation(11, Animation.CancelOptions.IgnoreIfPlaying);
                 this.iMeriGoRoundLogic = 2;
             }
             else if (fClosest < this.fUnburrowDistance || this.iCounter > this.iCounterAtBury + 300 + lx.Count * 60)
             {
                 this.iMeriGoRoundLogic = 2;
                 if (this.xPlayerLockedOnto.xTransform.v2Pos.X < this.xOwner.xTransform.v2Pos.X)
                 {
                     Program.GetTheGame()._Enemy_EnterAttackAnimation(this.xOwner, 11);
                 }
                 else
                 {
                     Program.GetTheGame()._Enemy_EnterAttackAnimation(this.xOwner, 10);
                 }
             }
             else
             {
                 this.iNextHardUpdate = 1;
                 this.v2RandMoveDir = Vector2.Normalize(this.xPlayerLockedOnto.xTransform.v2Pos - this.xOwner.xTransform.v2Pos);
             }
         }
         else if (this.iMeriGoRoundLogic == 2)
         {
             this.iNextHardUpdate = 30;
             if (this.xLastPlayerLookat != null)
             {
                 if (this.xLastPlayerLookat.xTransform.v2Pos.X < this.xOwner.xTransform.v2Pos.X && this.xOwner.xRenderComponent.iActiveAnimation == 6)
                 {
                     this.xOwner.xRenderComponent.SwitchAnimation(22, Animation.CancelOptions.IgnoreIfPlaying);
                     return;
                 }
                 if (this.xLastPlayerLookat.xTransform.v2Pos.X > this.xOwner.xTransform.v2Pos.X && this.xOwner.xRenderComponent.iActiveAnimation == 7)
                 {
                     this.xOwner.xRenderComponent.SwitchAnimation(23, Animation.CancelOptions.IgnoreIfPlaying);
                     return;
                 }
             }
             if (this.xPlayerLockedOnto != null)
             {
                 if (fClosest < this.fAttackDistance)
                 {
                     this.iNextHardUpdate = 160 - 25 * Program.GetTheGame().dixPlayers.Count - 10 * GameSessionData.iBaseDifficulty;
                     this.iCounterAtLastAgressiveAction = this.iCounter;
                     if (this.xPlayerLockedOnto.xTransform.v2Pos.X < this.xOwner.xTransform.v2Pos.X)
                     {
                         Program.GetTheGame()._Enemy_EnterAttackAnimation(this.xOwner, 15);
                     }
                     else
                     {
                         Program.GetTheGame()._Enemy_EnterAttackAnimation(this.xOwner, 14);
                     }
                 }
                 if (this.iCounterAtLastAgressiveAction + 300 < this.iCounter && fClosest > this.fAttackDistance)
                 {
                     List<Enemy> lxLol = Program.GetTheGame()._Enemies_GetEnemiesByTarget(this.xPlayerLockedOnto);
                     if (this.xPlayerLockedOnto.enEntityType != IEntity.EntityType.Player || lxLol.Count <= 1 || Program.GetTheGame()._Enemy_GetTargetList(this, true).Count < 2 || (Program.GetTheGame()._Enemy_GetTargetList(this, true).Count < 4 && knark.Next(2) == 0))
                     {
                         this.iMeriGoRoundLogic = 1;
                         this.iCounterAtBury = this.iCounter;
                         if (this.xOwner.byAnimationDirection == 1)
                         {
                             this.xOwner.xRenderComponent.SwitchAnimation(26, Animation.CancelOptions.IgnoreIfPlaying);
                         }
                         else
                         {
                             this.xOwner.xRenderComponent.SwitchAnimation(27, Animation.CancelOptions.IgnoreIfPlaying);
                         }
                     }
                     else
                     {
                         if (this.xOwner.byAnimationDirection == 1)
                         {
                             this.xOwner.xRenderComponent.SwitchAnimation(28, Animation.CancelOptions.IgnoreIfPlaying);
                         }
                         else
                         {
                             this.xOwner.xRenderComponent.SwitchAnimation(29, Animation.CancelOptions.IgnoreIfPlaying);
                         }
                         this.iNextHardUpdate = 120;
                     }
                 }
             }
         }
         else if (this.iMeriGoRoundLogic == 100)
         {
             this.iNextHardUpdate = 120;
             if (this.iSubMeri == 0)
             {
                 this.iSubMeri++;
                 this.xOwner.xRenderComponent.SwitchAnimation(7, Animation.CancelOptions.IgnoreIfPlaying);
             }
             else
             {
                 this.iSubMeri = 0;
                 this.xOwner.xRenderComponent.SwitchAnimation(29, Animation.CancelOptions.IgnoreIfPlaying);
             }
         }
     }
     this.xOwner.xTransform.v2ServerPos = this.xOwner.xTransform.v2Pos;
 }