public void AddAllIcons(List <RoomObj> roomList) { foreach (var current in roomList) { if (!AddedRoomsList.Contains(current)) { if (current.Name != "Bonus") { using (var enumerator2 = current.GameObjList.GetEnumerator()) { while (enumerator2.MoveNext()) { var current2 = enumerator2.Current; var chestObj = current2 as ChestObj; if (chestObj != null) { SpriteObj spriteObj; if (chestObj.IsOpen) { spriteObj = new SpriteObj("MapChestUnlocked_Sprite"); } else if (chestObj is FairyChestObj) { spriteObj = new SpriteObj("MapFairyChestIcon_Sprite"); if ((chestObj as FairyChestObj).ConditionType == 10) { spriteObj.Opacity = 0.2f; } } else { spriteObj = new SpriteObj("MapLockedChestIcon_Sprite"); } m_iconSpriteList.Add(spriteObj); spriteObj.AnimationDelay = 0.0333333351f; spriteObj.PlayAnimation(); spriteObj.ForceDraw = true; spriteObj.Position = new Vector2(current2.X / m_spriteScale.X - 8f, current2.Y / m_spriteScale.Y - 12f); if (current.IsReversed) { spriteObj.X -= current2.Width / m_spriteScale.X; } m_iconSpritePosList.Add(spriteObj.Position); } } continue; } } if (current.Name == "Bonus") { var spriteObj2 = new SpriteObj("MapBonusIcon_Sprite"); spriteObj2.PlayAnimation(); spriteObj2.AnimationDelay = 0.0333333351f; spriteObj2.ForceDraw = true; spriteObj2.Position = new Vector2((current.X + current.Width / 2f) / m_spriteScale.X - spriteObj2.Width / 2 - 1f, (current.Y + current.Height / 2f) / m_spriteScale.Y - spriteObj2.Height / 2 - 2f); m_iconSpriteList.Add(spriteObj2); m_iconSpritePosList.Add(spriteObj2.Position); } } } }
public void AddRoom(RoomObj room) { if (!AddedRoomsList.Contains(room) && room.Width / 1320 < 5) { var spriteObj = new SpriteObj(string.Concat("MapRoom", room.Width / 1320, "x", room.Height / 720, "_Sprite")); spriteObj.Position = new Vector2(room.X / m_spriteScale.X, room.Y / m_spriteScale.Y); spriteObj.Scale = new Vector2((spriteObj.Width - 3f) / spriteObj.Width, (spriteObj.Height - 3f) / spriteObj.Height); spriteObj.ForceDraw = true; spriteObj.TextureColor = room.TextureColor; m_roomSpriteList.Add(spriteObj); m_roomSpritePosList.Add(spriteObj.Position); foreach (var current in room.DoorList) { if (!(room.Name == "CastleEntrance") || !(current.DoorPosition == "Left")) { var flag = false; var spriteObj2 = new SpriteObj("MapDoor_Sprite"); spriteObj2.ForceDraw = true; string doorPosition; if ((doorPosition = current.DoorPosition) != null) { if (!(doorPosition == "Left")) { if (!(doorPosition == "Right")) { if (!(doorPosition == "Bottom")) { if (doorPosition == "Top") { spriteObj2.Rotation = -90f; spriteObj2.Position = new Vector2(current.X / m_spriteScale.X, current.Y / m_spriteScale.Y + 2f); flag = true; } } else { spriteObj2.Rotation = -90f; spriteObj2.Position = new Vector2(current.X / m_spriteScale.X, (current.Y + current.Height) / m_spriteScale.Y + 2f); flag = true; } } else { spriteObj2.Position = new Vector2(room.Bounds.Right / m_spriteScale.X - 5f, current.Y / m_spriteScale.Y - 2f); flag = true; } } else { spriteObj2.Position = new Vector2(room.Bounds.Left / m_spriteScale.X - spriteObj2.Width + 2f, current.Y / m_spriteScale.Y - 2f); flag = true; } } if (flag) { m_doorSpritePosList.Add(spriteObj2.Position); m_doorSpriteList.Add(spriteObj2); } } } if (room.Name != "Bonus" && Game.PlayerStats.Class != 13) { foreach (var current2 in room.GameObjList) { var chestObj = current2 as ChestObj; if (chestObj != null) { SpriteObj spriteObj3; if (chestObj.IsOpen) { spriteObj3 = new SpriteObj("MapChestUnlocked_Sprite"); } else if (chestObj is FairyChestObj) { spriteObj3 = new SpriteObj("MapFairyChestIcon_Sprite"); if ((chestObj as FairyChestObj).ConditionType == 10) { spriteObj3.Opacity = 0.2f; } } else { spriteObj3 = new SpriteObj("MapLockedChestIcon_Sprite"); } m_iconSpriteList.Add(spriteObj3); spriteObj3.AnimationDelay = 0.0333333351f; spriteObj3.PlayAnimation(); spriteObj3.ForceDraw = true; spriteObj3.Position = new Vector2(current2.X / m_spriteScale.X - 8f, current2.Y / m_spriteScale.Y - 12f); if (room.IsReversed) { spriteObj3.X -= current2.Width / m_spriteScale.X; } m_iconSpritePosList.Add(spriteObj3.Position); } } } if (room.Name == "EntranceBoss") { var spriteObj4 = new SpriteObj("MapBossIcon_Sprite"); spriteObj4.AnimationDelay = 0.0333333351f; spriteObj4.ForceDraw = true; spriteObj4.PlayAnimation(); spriteObj4.Position = new Vector2( (room.X + room.Width / 2f) / m_spriteScale.X - spriteObj4.Width / 2 - 1f, (room.Y + room.Height / 2f) / m_spriteScale.Y - spriteObj4.Height / 2 - 2f); m_iconSpriteList.Add(spriteObj4); m_iconSpritePosList.Add(spriteObj4.Position); m_teleporterList.Add(spriteObj4); m_teleporterPosList.Add(spriteObj4.Position); } else if (room.Name == "Linker") { var spriteObj5 = new SpriteObj("MapTeleporterIcon_Sprite"); spriteObj5.AnimationDelay = 0.0333333351f; spriteObj5.ForceDraw = true; spriteObj5.PlayAnimation(); spriteObj5.Position = new Vector2( (room.X + room.Width / 2f) / m_spriteScale.X - spriteObj5.Width / 2 - 1f, (room.Y + room.Height / 2f) / m_spriteScale.Y - spriteObj5.Height / 2 - 2f); m_iconSpriteList.Add(spriteObj5); m_iconSpritePosList.Add(spriteObj5.Position); m_teleporterList.Add(spriteObj5); m_teleporterPosList.Add(spriteObj5.Position); } else if (room.Name == "CastleEntrance") { var spriteObj6 = new SpriteObj("MapTeleporterIcon_Sprite"); spriteObj6.AnimationDelay = 0.0333333351f; spriteObj6.ForceDraw = true; spriteObj6.PlayAnimation(); spriteObj6.Position = new Vector2( (room.X + room.Width / 2f) / m_spriteScale.X - spriteObj6.Width / 2 - 1f, (room.Y + room.Height / 2f) / m_spriteScale.Y - spriteObj6.Height / 2 - 2f); m_iconSpriteList.Add(spriteObj6); m_iconSpritePosList.Add(spriteObj6.Position); m_teleporterList.Add(spriteObj6); m_teleporterPosList.Add(spriteObj6.Position); } if (Game.PlayerStats.Class != 13 && room.Name == "Bonus") { var spriteObj7 = new SpriteObj("MapBonusIcon_Sprite"); spriteObj7.PlayAnimation(); spriteObj7.AnimationDelay = 0.0333333351f; spriteObj7.ForceDraw = true; spriteObj7.Position = new Vector2( (room.X + room.Width / 2f) / m_spriteScale.X - spriteObj7.Width / 2 - 1f, (room.Y + room.Height / 2f) / m_spriteScale.Y - spriteObj7.Height / 2 - 2f); m_iconSpriteList.Add(spriteObj7); m_iconSpritePosList.Add(spriteObj7.Position); } AddedRoomsList.Add(room); } }