Exemple #1
0
 public EnemyObj_LastBoss(PlayerObj target, PhysicsManager physicsManager, ProceduralLevelScreen levelToAttachTo, GameTypes.EnemyDifficulty difficulty)
     : base("PlayerIdle_Character", target, physicsManager, levelToAttachTo, difficulty)
 {
     foreach (GameObj current in this._objectList)
     {
         current.TextureColor = new Color(100, 100, 100);
     }
     this.Type = 29;
     this.m_damageShieldProjectiles = new List<ProjectileObj>();
     this._objectList[5].Visible = false;
     this._objectList[15].Visible = false;
     this._objectList[16].Visible = false;
     this._objectList[14].Visible = false;
     this._objectList[13].Visible = false;
     this._objectList[0].Visible = false;
     string text = (this._objectList[12] as IAnimateableObj).SpriteName;
     int startIndex = text.IndexOf("_") - 1;
     text = text.Remove(startIndex, 1);
     text = text.Replace("_", 7 + "_");
     this._objectList[12].ChangeSprite(text);
     base.PlayAnimation(true);
     this.m_delayObj = new BlankObj(0, 0);
     this.m_walkDownSoundFinalBoss = new FrameSoundObj(this, 3, new string[]
     {
         "FinalBoss_St2_Foot_01",
         "FinalBoss_St2_Foot_02",
         "FinalBoss_St2_Foot_03"
     });
     this.m_walkUpSoundFinalBoss = new FrameSoundObj(this, 6, new string[]
     {
         "FinalBoss_St2_Foot_04",
         "FinalBoss_St2_Foot_05"
     });
 }
Exemple #2
0
 public void Update(GameTime gameTime, PlayerObj player)
 {
     bool flag = false;
     if (this.Flip == SpriteEffects.None && player.X > base.X)
     {
         flag = true;
     }
     if (this.Flip != SpriteEffects.None && player.X < base.X)
     {
         flag = true;
     }
     if (player != null && CollisionMath.Intersects(player.TerrainBounds, new Rectangle(this.Bounds.X - 50, this.Bounds.Y, this.Bounds.Width + 100, this.Bounds.Height)) && flag && player.Flip != this.Flip && this.CanTalk)
     {
         this.m_talkIcon.Visible = true;
     }
     else
     {
         this.m_talkIcon.Visible = false;
     }
     if (this.Flip == SpriteEffects.None)
     {
         this.m_talkIcon.Position = new Vector2((float)this.Bounds.Left - this.m_talkIcon.AnchorX, (float)this.Bounds.Top - this.m_talkIcon.AnchorY + (float)Math.Sin((double)(Game.TotalGameTime * 20f)) * 2f);
         return;
     }
     this.m_talkIcon.Position = new Vector2((float)this.Bounds.Right + this.m_talkIcon.AnchorX, (float)this.Bounds.Top - this.m_talkIcon.AnchorY + (float)Math.Sin((double)(Game.TotalGameTime * 20f)) * 2f);
 }
 public EnemyObj_BallAndChain(PlayerObj target, PhysicsManager physicsManager, ProceduralLevelScreen levelToAttachTo, GameTypes.EnemyDifficulty difficulty)
     : base("EnemyFlailKnight_Character", target, physicsManager, levelToAttachTo, difficulty)
 {
     this.m_ballAndChain = new ProjectileObj("EnemyFlailKnightBall_Sprite");
     this.m_ballAndChain.IsWeighted = false;
     this.m_ballAndChain.CollidesWithTerrain = false;
     this.m_ballAndChain.IgnoreBoundsCheck = true;
     this.m_ballAndChain.OutlineWidth = 2;
     this.m_ballAndChain2 = (this.m_ballAndChain.Clone() as ProjectileObj);
     this.m_chain = new SpriteObj("EnemyFlailKnightLink_Sprite");
     this.m_chainLinksList = new List<Vector2>();
     this.m_chainLinks2List = new List<Vector2>();
     for (int i = 0; i < this.m_numChainLinks; i++)
     {
         this.m_chainLinksList.Add(default(Vector2));
     }
     for (int j = 0; j < this.m_numChainLinks / 2; j++)
     {
         this.m_chainLinks2List.Add(default(Vector2));
     }
     this.Type = 1;
     this.TintablePart = this._objectList[3];
     this.m_walkSound = new FrameSoundObj(this, this.m_target, 1, new string[]
     {
         "KnightWalk1",
         "KnightWalk2"
     });
     this.m_walkSound2 = new FrameSoundObj(this, this.m_target, 6, new string[]
     {
         "KnightWalk1",
         "KnightWalk2"
     });
 }
 public EnemyObj_EarthWizard(PlayerObj target, PhysicsManager physicsManager, ProceduralLevelScreen levelToAttachTo, GameTypes.EnemyDifficulty difficulty)
     : base("EnemyWizardIdle_Character", target, physicsManager, levelToAttachTo, difficulty)
 {
     base.PlayAnimation(true);
     this.TintablePart = this._objectList[0];
     this.Type = 5;
 }
 public EnemyObj_HomingTurret(PlayerObj target, PhysicsManager physicsManager, ProceduralLevelScreen levelToAttachTo, GameTypes.EnemyDifficulty difficulty)
     : base("EnemyHomingTurret_Character", target, physicsManager, levelToAttachTo, difficulty)
 {
     base.StopAnimation();
     base.ForceDraw = true;
     this.Type = 28;
     base.PlayAnimationOnRestart = false;
 }
Exemple #6
0
 public EnemyObj_Spark(PlayerObj target, PhysicsManager physicsManager, ProceduralLevelScreen levelToAttachTo, GameTypes.EnemyDifficulty difficulty)
     : base("EnemySpark_Character", target, physicsManager, levelToAttachTo, difficulty)
 {
     base.IsWeighted = false;
     base.ForceDraw = true;
     this.Type = 24;
     base.NonKillable = true;
 }
 public EnemyObj_SpikeTrap(PlayerObj target, PhysicsManager physicsManager, ProceduralLevelScreen levelToAttachTo, GameTypes.EnemyDifficulty difficulty)
     : base("EnemySpikeTrap_Character", target, physicsManager, levelToAttachTo, difficulty)
 {
     this.Type = 21;
     base.StopAnimation();
     base.PlayAnimationOnRestart = false;
     base.NonKillable = true;
 }
Exemple #8
0
 public EnemyObj_Blob(PlayerObj target, PhysicsManager physicsManager, ProceduralLevelScreen levelToAttachTo, GameTypes.EnemyDifficulty difficulty)
     : base("EnemyBlobIdle_Character", target, physicsManager, levelToAttachTo, difficulty)
 {
     this.MainBlob = true;
     this.TintablePart = this._objectList[0];
     base.PlayAnimation(true);
     this.m_invincibleCounter = 0.5f;
     this.Type = 2;
 }
Exemple #9
0
 public EnemyObj_Portrait(PlayerObj target, PhysicsManager physicsManager, ProceduralLevelScreen levelToAttachTo, GameTypes.EnemyDifficulty difficulty)
     : base("EnemyPortrait_Character", target, physicsManager, levelToAttachTo, difficulty)
 {
     this.Type = 32;
     string spriteName = "FramePicture" + CDGMath.RandomInt(1, 16) + "_Sprite";
     base.GetChildAt(0).ChangeSprite(spriteName);
     base.GetChildAt(0);
     base.DisableCollisionBoxRotations = false;
 }
Exemple #10
0
 public EnemyObj_Zombie(PlayerObj target, PhysicsManager physicsManager, ProceduralLevelScreen levelToAttachTo, GameTypes.EnemyDifficulty difficulty)
     : base("EnemyZombieLower_Character", target, physicsManager, levelToAttachTo, difficulty)
 {
     base.GoToFrame(base.TotalFrames);
     this.Lowered = true;
     base.ForceDraw = true;
     base.StopAnimation();
     this.Type = 20;
     base.PlayAnimationOnRestart = false;
 }
Exemple #11
0
 public EnemyObj_Mimic(PlayerObj target, PhysicsManager physicsManager, ProceduralLevelScreen levelToAttachTo, GameTypes.EnemyDifficulty difficulty)
     : base("EnemyMimicIdle_Character", target, physicsManager, levelToAttachTo, difficulty)
 {
     this.Type = 33;
     base.OutlineWidth = 0;
     this.m_closeSound = new FrameSoundObj(this, this.m_target, 1, new string[]
     {
         "Chest_Snap"
     });
 }
Exemple #12
0
 public EnemyObj_Turret(PlayerObj target, PhysicsManager physicsManager, ProceduralLevelScreen levelToAttachTo, GameTypes.EnemyDifficulty difficulty)
     : base("EnemyTurretFire_Character", target, physicsManager, levelToAttachTo, difficulty)
 {
     base.IsCollidable = false;
     base.ForceDraw = true;
     this.Type = 17;
     base.StopAnimation();
     base.PlayAnimationOnRestart = false;
     base.NonKillable = true;
 }
Exemple #13
0
 public EnemyObj_Wolf(PlayerObj target, PhysicsManager physicsManager, ProceduralLevelScreen levelToAttachTo, GameTypes.EnemyDifficulty difficulty)
     : base("EnemyWargIdle_Character", target, physicsManager, levelToAttachTo, difficulty)
 {
     this.Type = 19;
     this.m_startDelayCounter = this.m_startDelay;
     this.m_runFrameSound = new FrameSoundObj(this, 1, new string[]
     {
         "Wolf_Move01",
         "Wolf_Move02",
         "Wolf_Move03"
     });
 }
Exemple #14
0
 public FairyChestObj(PhysicsManager physicsManager)
     : base(physicsManager)
 {
     this.m_lockSprite = new SpriteObj("Chest4Unlock_Sprite");
     this.m_errorSprite = new SpriteObj("CancelIcon_Sprite");
     this.m_errorSprite.Visible = false;
     this.m_timerText = new TextObj(Game.JunicodeFont);
     this.m_timerText.FontSize = 18f;
     this.m_timerText.DropShadow = new Vector2(2f, 2f);
     this.m_timerText.Align = Types.TextAlign.Centre;
     this.m_player = Game.ScreenManager.Player;
 }
Exemple #15
0
 public EnemyObj_Eyeball(PlayerObj target, PhysicsManager physicsManager, ProceduralLevelScreen levelToAttachTo, GameTypes.EnemyDifficulty difficulty)
     : base("EnemyEyeballIdle_Character", target, physicsManager, levelToAttachTo, difficulty)
 {
     this.m_pupil = new SpriteObj("EnemyEyeballPupil_Sprite");
     this.AddChild(this.m_pupil);
     this.m_squishSound = new FrameSoundObj(this, this.m_target, 2, new string[]
     {
         "Eyeball_Prefire"
     });
     this.Type = 6;
     base.DisableCollisionBoxRotations = false;
 }
Exemple #16
0
 public EnemyObj_Ninja(PlayerObj target, PhysicsManager physicsManager, ProceduralLevelScreen levelToAttachTo, GameTypes.EnemyDifficulty difficulty)
     : base("EnemyNinjaIdle_Character", target, physicsManager, levelToAttachTo, difficulty)
 {
     this.Type = 13;
     this.m_smoke = new SpriteObj("NinjaSmoke_Sprite");
     this.m_smoke.AnimationDelay = 0.05f;
     this.m_log = new SpriteObj("Log_Sprite");
     this.m_smoke.Visible = false;
     this.m_smoke.Scale = new Vector2(5f, 5f);
     this.m_log.Visible = false;
     this.m_log.OutlineWidth = 2;
 }
Exemple #17
0
 public EnemyObj_Platform(PlayerObj target, PhysicsManager physicsManager, ProceduralLevelScreen levelToAttachTo, GameTypes.EnemyDifficulty difficulty)
     : base("EnemyPlatform_Character", target, physicsManager, levelToAttachTo, difficulty)
 {
     base.CollisionTypeTag = 1;
     this.Type = 27;
     base.CollidesBottom = false;
     base.CollidesLeft = false;
     base.CollidesRight = false;
     base.StopAnimation();
     base.PlayAnimationOnRestart = false;
     base.NonKillable = true;
     base.DisableCollisionBoxRotations = false;
 }
Exemple #18
0
 public override void Dispose()
 {
     if (!base.IsDisposed)
     {
         this.m_player = null;
         this.m_lockSprite.Dispose();
         this.m_lockSprite = null;
         this.m_errorSprite.Dispose();
         this.m_errorSprite = null;
         this.m_timerText.Dispose();
         this.m_timerText = null;
         base.Dispose();
     }
 }
 public EnemyObj_ShieldKnight(PlayerObj target, PhysicsManager physicsManager, ProceduralLevelScreen levelToAttachTo, GameTypes.EnemyDifficulty difficulty)
     : base("EnemyShieldKnightIdle_Character", target, physicsManager, levelToAttachTo, difficulty)
 {
     this.Type = 14;
     this.m_walkSound = new FrameSoundObj(this, this.m_target, 1, new string[]
     {
         "KnightWalk1",
         "KnightWalk2"
     });
     this.m_walkSound2 = new FrameSoundObj(this, this.m_target, 6, new string[]
     {
         "KnightWalk1",
         "KnightWalk2"
     });
 }
Exemple #20
0
 public override void Dispose()
 {
     if (!base.IsDisposed)
     {
         Console.WriteLine("Disposing Death Defied Screen");
         this.m_player = null;
         this.m_spotlight.Dispose();
         this.m_spotlight = null;
         this.m_title.Dispose();
         this.m_title = null;
         this.m_titlePlate.Dispose();
         this.m_titlePlate = null;
         base.Dispose();
     }
 }
Exemple #21
0
 public EnemyObj_Energon(PlayerObj target, PhysicsManager physicsManager, ProceduralLevelScreen levelToAttachTo, GameTypes.EnemyDifficulty difficulty)
     : base("EnemyEnergonIdle_Character", target, physicsManager, levelToAttachTo, difficulty)
 {
     this.Type = 23;
     this.m_shield = new SpriteObj("EnergonSwordShield_Sprite");
     this.m_shield.AnimationDelay = 0.1f;
     this.m_shield.PlayAnimation(true);
     this.m_shield.Opacity = 0.5f;
     this.m_shield.Scale = new Vector2(1.2f, 1.2f);
     this.m_projectilePool = new DS2DPool<EnergonProjectileObj>();
     for (int i = 0; i < (int)this.m_poolSize; i++)
     {
         EnergonProjectileObj energonProjectileObj = new EnergonProjectileObj("EnergonSwordProjectile_Sprite", this);
         energonProjectileObj.Visible = false;
         energonProjectileObj.CollidesWithTerrain = false;
         energonProjectileObj.PlayAnimation(true);
         energonProjectileObj.AnimationDelay = 0.05f;
         this.m_projectilePool.AddToPool(energonProjectileObj);
     }
 }
Exemple #22
0
 public EnemyObj(string spriteName, PlayerObj target, PhysicsManager physicsManager, ProceduralLevelScreen levelToAttachTo, GameTypes.EnemyDifficulty difficulty)
     : base(spriteName, physicsManager, levelToAttachTo)
 {
     base.DisableCollisionBoxRotations = true;
     this.Type = 0;
     base.CollisionTypeTag = 3;
     this.m_target = target;
     this.m_walkingLB = new LogicBlock();
     this.m_currentActiveLB = new LogicBlock();
     this.m_cooldownLB = new LogicBlock();
     this.logicBlocksToDispose = new List<LogicBlock>();
     this.m_resetSpriteName = spriteName;
     this.Difficulty = difficulty;
     this.ProjectileScale = new Vector2(1f, 1f);
     base.PlayAnimation(true);
     this.PlayAnimationOnRestart = true;
     base.OutlineWidth = 2;
     this.GivesLichHealth = true;
     this.DropsItem = true;
 }
Exemple #23
0
 public override void Dispose()
 {
     if (!base.IsDisposed)
     {
         Console.WriteLine("Disposing Game Over Screen");
         this.m_player = null;
         this.m_dialoguePlate.Dispose();
         this.m_dialoguePlate = null;
         this.m_continueText.Dispose();
         this.m_continueText = null;
         this.m_playerGhost.Dispose();
         this.m_playerGhost = null;
         this.m_spotlight.Dispose();
         this.m_spotlight = null;
         this.m_playerFallSound.Dispose();
         this.m_playerFallSound = null;
         this.m_playerSwordFallSound.Dispose();
         this.m_playerSwordFallSound = null;
         this.m_playerSwordSpinSound.Dispose();
         this.m_playerSwordSpinSound = null;
         this.m_objKilledPlayer = null;
         if (this.m_enemyList != null)
         {
             this.m_enemyList.Clear();
         }
         this.m_enemyList = null;
         if (this.m_enemyStoredPositions != null)
         {
             this.m_enemyStoredPositions.Clear();
         }
         this.m_enemyStoredPositions = null;
         this.m_playerFrame.Dispose();
         this.m_playerFrame = null;
         base.Dispose();
     }
 }
Exemple #24
0
 public virtual void OpenChest(ItemDropManager itemDropManager, PlayerObj player)
 {
     if (!this.IsOpen && !this.IsLocked)
     {
         SoundManager.Play3DSound(this, Game.ScreenManager.Player, "Chest_Open_Large");
         base.GoToFrame(2);
         if (this.IsEmpty)
         {
             return;
         }
         if (this.ChestType == 3)
         {
             GameUtil.UnlockAchievement("LOVE_OF_GOLD");
         }
         if (this.ForcedItemType == 0)
         {
             int num = CDGMath.RandomInt(1, 100);
             int num2 = 0;
             int[] array;
             if (this.ChestType == 1)
             {
                 array = GameEV.BRONZECHEST_ITEMDROP_CHANCE;
             }
             else if (this.ChestType == 2)
             {
                 array = GameEV.SILVERCHEST_ITEMDROP_CHANCE;
             }
             else
             {
                 array = GameEV.GOLDCHEST_ITEMDROP_CHANCE;
             }
             int num3 = 0;
             for (int i = 0; i < array.Length; i++)
             {
                 num3 += array[i];
                 if (num <= num3)
                 {
                     num2 = i;
                     break;
                 }
             }
             if (num2 == 0)
             {
                 this.GiveGold(itemDropManager, 0);
             }
             else if (num2 == 1)
             {
                 this.GiveStatDrop(itemDropManager, player, 1, 0);
             }
             else
             {
                 this.GivePrint(itemDropManager, player);
             }
         }
         else
         {
             switch (this.ForcedItemType)
             {
             case 1:
             case 10:
             case 11:
                 this.GiveGold(itemDropManager, (int)this.ForcedAmount);
                 break;
             case 4:
             case 5:
             case 6:
             case 7:
             case 8:
             case 9:
                 this.GiveStatDrop(itemDropManager, player, 1, this.ForcedItemType);
                 break;
             case 12:
             case 13:
                 this.GivePrint(itemDropManager, player);
                 break;
             case 14:
                 this.GiveStatDrop(itemDropManager, player, 3, 0);
                 break;
             case 15:
             case 16:
             case 17:
             case 18:
             case 19:
                 this.GiveStatDrop(itemDropManager, player, 1, this.ForcedItemType);
                 break;
             }
         }
         player.AttachedLevel.RefreshMapChestIcons();
     }
 }
Exemple #25
0
 public void GiveStatDrop(ItemDropManager manager, PlayerObj player, int numDrops, int statDropType)
 {
     int[] array = new int[numDrops];
     for (int i = 0; i < numDrops; i++)
     {
         if (statDropType == 0)
         {
             int num = CDGMath.RandomInt(1, 100);
             int num2 = 0;
             int j = 0;
             while (j < GameEV.STATDROP_CHANCE.Length)
             {
                 num2 += GameEV.STATDROP_CHANCE[j];
                 if (num <= num2)
                 {
                     if (j == 0)
                     {
                         array[i] = 4;
                         Game.PlayerStats.BonusStrength++;
                         break;
                     }
                     if (j == 1)
                     {
                         array[i] = 5;
                         Game.PlayerStats.BonusMagic++;
                         break;
                     }
                     if (j == 2)
                     {
                         array[i] = 6;
                         Game.PlayerStats.BonusDefense++;
                         break;
                     }
                     if (j == 3)
                     {
                         array[i] = 7;
                         Game.PlayerStats.BonusHealth++;
                         break;
                     }
                     if (j == 4)
                     {
                         array[i] = 8;
                         Game.PlayerStats.BonusMana++;
                         break;
                     }
                     array[i] = 9;
                     Game.PlayerStats.BonusWeight++;
                     break;
                 }
                 else
                 {
                     j++;
                 }
             }
         }
         else
         {
             switch (statDropType)
             {
             case 4:
                 Game.PlayerStats.BonusStrength++;
                 break;
             case 5:
                 Game.PlayerStats.BonusMagic++;
                 break;
             case 6:
                 Game.PlayerStats.BonusDefense++;
                 break;
             case 7:
                 Game.PlayerStats.BonusHealth++;
                 break;
             case 8:
                 Game.PlayerStats.BonusMana++;
                 break;
             case 9:
                 Game.PlayerStats.BonusWeight++;
                 break;
             }
             array[i] = statDropType;
         }
     }
     List<object> list = new List<object>();
     list.Add(new Vector2(base.X, base.Y - (float)this.Height / 2f));
     if (statDropType >= 15 && statDropType <= 19)
     {
         list.Add(7);
     }
     else if (numDrops <= 1)
     {
         list.Add(3);
     }
     else
     {
         list.Add(6);
     }
     list.Add(new Vector2((float)array[0], 0f));
     if (numDrops > 1)
     {
         list.Add(new Vector2((float)array[1], (float)array[2]));
     }
     player.AttachedLevel.UpdatePlayerHUD();
     (player.AttachedLevel.ScreenManager as RCScreenManager).DisplayScreen(12, true, list);
     player.RunGetItemAnimation();
 }
Exemple #26
0
 public void GivePrint(ItemDropManager manager, PlayerObj player)
 {
     if (Game.PlayerStats.TotalBlueprintsFound >= 75)
     {
         if (this.ChestType == 3)
         {
             this.GiveStatDrop(manager, player, 1, 0);
             return;
         }
         this.GiveGold(manager, 0);
         return;
     }
     else
     {
         List<byte[]> getBlueprintArray = Game.PlayerStats.GetBlueprintArray;
         List<Vector2> list = new List<Vector2>();
         int num = 0;
         foreach (byte[] current in getBlueprintArray)
         {
             int num2 = 0;
             byte[] array = current;
             for (int i = 0; i < array.Length; i++)
             {
                 if (array[i] == 0)
                 {
                     EquipmentData equipmentData = Game.EquipmentSystem.GetEquipmentData(num, num2);
                     if (this.Level >= (int)equipmentData.LevelRequirement && this.ChestType >= equipmentData.ChestColourRequirement)
                     {
                         list.Add(new Vector2((float)num, (float)num2));
                     }
                 }
                 num2++;
             }
             num++;
         }
         if (list.Count > 0)
         {
             Vector2 vector = list[CDGMath.RandomInt(0, list.Count - 1)];
             Game.PlayerStats.GetBlueprintArray[(int)vector.X][(int)vector.Y] = 1;
             List<object> list2 = new List<object>();
             list2.Add(new Vector2(base.X, base.Y - (float)this.Height / 2f));
             list2.Add(1);
             list2.Add(new Vector2(vector.X, vector.Y));
             (player.AttachedLevel.ScreenManager as RCScreenManager).DisplayScreen(12, true, list2);
             player.RunGetItemAnimation();
             Console.WriteLine(string.Concat(new object[]
             {
                 "Unlocked item index ",
                 vector.X,
                 " of type ",
                 vector.Y
             }));
             return;
         }
         this.GiveGold(manager, 0);
         return;
     }
 }
Exemple #27
0
 public void SetPlayer(PlayerObj player)
 {
     this.m_player = player;
 }
Exemple #28
0
 public EnemyTemplate(PlayerObj target, PhysicsManager physicsManager, ProceduralLevelScreen levelToAttachTo, GameTypes.EnemyDifficulty difficulty)
     : base("EnemySpriteNameGoesHere", target, physicsManager, levelToAttachTo, difficulty)
 {
 }
Exemple #29
0
 public void RunDisplacerEffect(RoomObj room, PlayerObj player)
 {
     int num = 2147483647;
     TerrainObj terrainObj = null;
     Vector2 value = Vector2.Zero;
     foreach (TerrainObj current in room.TerrainObjList)
     {
         value = Vector2.Zero;
         float num2 = 3.40282347E+38f;
         if (player.Flip == SpriteEffects.None)
         {
             if (current.X > base.X && current.Bounds.Top < this.Bounds.Bottom && current.Bounds.Bottom > this.Bounds.Top)
             {
                 if (current.Rotation < 0f)
                 {
                     value = CollisionMath.LineToLineIntersect(base.Position, new Vector2(base.X + 6600f, base.Y), CollisionMath.UpperLeftCorner(current.NonRotatedBounds, current.Rotation, Vector2.Zero), CollisionMath.UpperRightCorner(current.NonRotatedBounds, current.Rotation, Vector2.Zero));
                 }
                 else if (current.Rotation > 0f)
                 {
                     value = CollisionMath.LineToLineIntersect(base.Position, new Vector2(base.X + 6600f, base.Y), CollisionMath.LowerLeftCorner(current.NonRotatedBounds, current.Rotation, Vector2.Zero), CollisionMath.UpperLeftCorner(current.NonRotatedBounds, current.Rotation, Vector2.Zero));
                 }
                 if (value != Vector2.Zero)
                 {
                     num2 = value.X - base.X;
                 }
                 else
                 {
                     num2 = (float)(current.Bounds.Left - this.Bounds.Right);
                 }
             }
         }
         else if (current.X < base.X && current.Bounds.Top < this.Bounds.Bottom && current.Bounds.Bottom > this.Bounds.Top)
         {
             if (current.Rotation < 0f)
             {
                 value = CollisionMath.LineToLineIntersect(new Vector2(base.X - 6600f, base.Y), base.Position, CollisionMath.UpperRightCorner(current.NonRotatedBounds, current.Rotation, Vector2.Zero), CollisionMath.LowerRightCorner(current.NonRotatedBounds, current.Rotation, Vector2.Zero));
             }
             else if (current.Rotation > 0f)
             {
                 value = CollisionMath.LineToLineIntersect(new Vector2(base.X - 6600f, base.Y), base.Position, CollisionMath.UpperLeftCorner(current.NonRotatedBounds, current.Rotation, Vector2.Zero), CollisionMath.UpperRightCorner(current.NonRotatedBounds, current.Rotation, Vector2.Zero));
             }
             if (value != Vector2.Zero)
             {
                 num2 = base.X - value.X;
             }
             else
             {
                 num2 = (float)(this.Bounds.Left - current.Bounds.Right);
             }
         }
         if (num2 < (float)num)
         {
             num = (int)num2;
             terrainObj = current;
         }
     }
     if (terrainObj != null)
     {
         if (player.Flip == SpriteEffects.None)
         {
             if (terrainObj.Rotation == 0f)
             {
                 player.X += (float)num - (float)player.TerrainBounds.Width / 2f;
                 return;
             }
             player.X += (float)num - (float)player.Width / 2f;
             return;
         }
         else
         {
             if (terrainObj.Rotation == 0f)
             {
                 player.X -= (float)num - (float)player.TerrainBounds.Width / 2f;
                 return;
             }
             player.X -= (float)num - (float)player.Width / 2f;
         }
     }
 }
Exemple #30
0
 public override void Dispose()
 {
     if (!base.IsDisposed)
     {
         this.m_player = null;
         this.m_level = null;
         if (this.m_alphaMaskRT != null && !this.m_alphaMaskRT.IsDisposed)
         {
             this.m_alphaMaskRT.Dispose();
         }
         this.m_alphaMaskRT = null;
         if (this.m_mapScreenRT != null && !this.m_mapScreenRT.IsDisposed)
         {
             this.m_mapScreenRT.Dispose();
         }
         this.m_mapScreenRT = null;
         foreach (SpriteObj current in this.m_roomSpriteList)
         {
             current.Dispose();
         }
         this.m_roomSpriteList.Clear();
         this.m_roomSpriteList = null;
         foreach (SpriteObj current2 in this.m_doorSpriteList)
         {
             current2.Dispose();
         }
         this.m_doorSpriteList.Clear();
         this.m_doorSpriteList = null;
         foreach (SpriteObj current3 in this.m_iconSpriteList)
         {
             current3.Dispose();
         }
         this.m_iconSpriteList.Clear();
         this.m_iconSpriteList = null;
         this.m_addedRooms.Clear();
         this.m_addedRooms = null;
         this.m_roomSpritePosList.Clear();
         this.m_roomSpritePosList = null;
         this.m_doorSpritePosList.Clear();
         this.m_doorSpritePosList = null;
         this.m_iconSpritePosList.Clear();
         this.m_iconSpritePosList = null;
         this.m_playerSprite.Dispose();
         this.m_playerSprite = null;
         foreach (SpriteObj current4 in this.m_teleporterList)
         {
             current4.Dispose();
         }
         this.m_teleporterList.Clear();
         this.m_teleporterList = null;
         this.m_teleporterPosList.Clear();
         this.m_teleporterPosList = null;
         this.m_xOffsetTween = null;
         this.m_yOffsetTween = null;
         base.Dispose();
     }
 }