void MarkAvailableItemLocations() { preservedRoomStates = new LookupDictionairy <Roomkey, MinimapRoomState>(r => r.RoomKey); var visableAreas = (List <EMinimapEraType>)Dynamic._availableEras; foreach (var itemLocation in GetAvailableItemLocations()) { var roomKey = new Roomkey(itemLocation.Key.LevelId, itemLocation.Key.RoomId); //somehow they keys dont match if we use itemLocation.Key directly if (preservedRoomStates.Contains(roomKey)) { continue; } var room = GetRoom(roomKey); MakeSureEraIsVisable(visableAreas, room); preservedRoomStates.Add(new MinimapRoomState(roomKey, room)); foreach (var block in room.Blocks.Values) { if (block.IsSolidWall) { continue; } block.IsKnown = true; block.IsVisited = true; if (block.IsTransition || block.IsCheckpoint || block.IsBoss) { block.IsTransition = false; block.IsCheckpoint = false; block.RoomColor = EMinimapRoomColor.Yellow; } else { block.RoomColor = EMinimapRoomColor.Orange; } } } }
static RoomTrigger() { RoomTriggers.Add(new RoomTrigger(0, 3, (level, itemLocation, seedOptions) => { if (seedOptions.StartWithJewelryBox) { level.AsDynamic().UnlockRelic(EInventoryRelicType.JewelryBox); } if (seedOptions.StartWithMeyef) { level.GameSave.AddItem(level, new ItemIdentifier(EInventoryFamiliarType.Meyef)); level.GameSave.Inventory.EquippedFamiliar = EInventoryFamiliarType.Meyef; var luniasObject = level.MainHero.AsDynamic(); var familiarManager = ((object)luniasObject._familiarManager).AsDynamic(); familiarManager.ChangeFamiliar(EInventoryFamiliarType.Meyef); familiarManager.AddFamiliarPoofAnimation(); } if (seedOptions.StartWithTalaria) { level.AsDynamic().UnlockRelic(EInventoryRelicType.Dash); } })); RoomTriggers.Add(new RoomTrigger(1, 0, (level, itemLocation, seedOptions) => { if (!seedOptions.Inverted || level.GameSave.GetSaveBool("TSRandomizerHasTeleportedPlayer")) { return; } level.GameSave.SetValue("TSRandomizerHasTeleportedPlayer", true); level.RequestChangeLevel(new LevelChangeRequest { LevelID = 3, RoomID = 6 }); //Refugee Camp })); RoomTriggers.Add(new RoomTrigger(1, 5, (level, itemLocation, seedOptions) => { if (itemLocation.IsPickedUp || !level.GameSave.GetSaveBool("IsBossDead_RoboKitty")) { return; } SpawnItemDropPickup(level, itemLocation.ItemInfo, 200, 208); })); RoomTriggers.Add(new RoomTrigger(5, 5, (level, itemLocation, seedOptions) => { if (itemLocation.IsPickedUp || !level.GameSave.HasCutsceneBeenTriggered("Keep0_Demons0")) { return; } SpawnItemDropPickup(level, itemLocation.ItemInfo, 200, 208); })); RoomTriggers.Add(new RoomTrigger(11, 1, (level, itemLocation, seedOptions) => { if (itemLocation.IsPickedUp || !level.GameSave.HasRelic(EInventoryRelicType.Dash)) { return; } SpawnItemDropPickup(level, itemLocation.ItemInfo, 280, 191); })); RoomTriggers.Add(new RoomTrigger(11, 39, (level, itemLocation, seedOptions) => { if (itemLocation.IsPickedUp || !level.GameSave.HasOrb(EInventoryOrbType.Eye) || !level.GameSave.GetSaveBool("11_LabPower")) { return; } SpawnItemDropPickup(level, itemLocation.ItemInfo, 200, 176); })); RoomTriggers.Add(new RoomTrigger(11, 21, (level, itemLocation, seedOptions) => { if (!itemLocation.IsPickedUp && level.GameSave.HasRelic(EInventoryRelicType.ScienceKeycardA) && level.GameSave.GetSaveBool("IsBossDead_Shapeshift")) { SpawnItemDropPickup(level, itemLocation.ItemInfo, 200, 208); } if (!seedOptions.Inverted && level.GameSave.HasCutsceneBeenTriggered("Alt3_Teleport")) { CreateSimpelOneWayWarp(level, 16, 12); } })); RoomTriggers.Add(new RoomTrigger(11, 26, (level, itemLocation, seedOptions) => { if (itemLocation.IsPickedUp || !level.GameSave.HasRelic(EInventoryRelicType.TimespinnerGear1)) { return; } SpawnTreasureChest(level, true, 136, 192); })); RoomTriggers.Add(new RoomTrigger(2, 52, (level, itemLocation, seedOptions) => { if (itemLocation.IsPickedUp || !level.GameSave.HasRelic(EInventoryRelicType.TimespinnerGear2)) { return; } SpawnTreasureChest(level, true, 104, 192); })); RoomTriggers.Add(new RoomTrigger(9, 13, (level, itemLocation, seedOptions) => { if (itemLocation.IsPickedUp || !level.GameSave.HasRelic(EInventoryRelicType.TimespinnerGear3)) { return; } SpawnTreasureChest(level, false, 296, 176); })); RoomTriggers.Add(new RoomTrigger(3, 6, (level, itemLocation, seedOptions) => { if (seedOptions.Inverted || level.GameSave.HasRelic(EInventoryRelicType.PyramidsKey)) { return; } CreateSimpelOneWayWarp(level, 2, 54); })); RoomTriggers.Add(new RoomTrigger(2, 54, (level, itemLocation, seedOptions) => { if (seedOptions.Inverted || level.GameSave.HasRelic(EInventoryRelicType.PyramidsKey) || !level.GameSave.DataKeyBools.ContainsKey("HasUsedCityTS")) { return; } CreateSimpelOneWayWarp(level, 3, 6); })); RoomTriggers.Add(new RoomTrigger(7, 30, (level, itemLocation, seedOptions) => { if (!level.GameSave.HasRelic(EInventoryRelicType.PyramidsKey)) { return; } SpawnTreasureChest(level, false, 296, 176); })); RoomTriggers.Add(new RoomTrigger(3, 0, (level, itemLocation, seedOptions) => { if (itemLocation.IsPickedUp || level.GameSave.DataKeyBools.ContainsKey("HasUsedCityTS") || !level.GameSave.HasCutsceneBeenTriggered("Forest3_Haristel") || ((Dictionary <int, NPCBase>)level.AsDynamic()._npcs).Values.Any(npc => npc.GetType() == NelisteNpcType)) { return; } SpawnNeliste(level); })); /*RoomTriggers.Add(new RoomTrigger(12, 11, (level, itemLocation, seedOptions) => //Remove Daddy's pedistal if you havent killed him yet * { * if (level.GameSave.DataKeyBools.ContainsKey("IsEndingABCleared")) return; * * ((Dictionary<int, GameEvent>)level.AsDynamic()._levelEvents).Values * .FirstOrDefault(obj => obj.GetType() == PedistalType) * ?.SilentKill(); * }));*/ RoomTriggers.Add(new RoomTrigger(8, 6, (level, itemLocation, seedOptions) => { if (!seedOptions.GassMaw) { return; } FillRoomWithGass(level); })); RoomTriggers.Add(new RoomTrigger(8, 7, (level, itemLocation, seedOptions) => { if (!seedOptions.GassMaw) { return; } FillRoomWithGass(level); })); RoomTriggers.Add(new RoomTrigger(8, 13, (level, itemLocation, seedOptions) => { if (!seedOptions.GassMaw) { return; } FillRoomWithGass(level); })); RoomTriggers.Add(new RoomTrigger(8, 21, (level, itemLocation, seedOptions) => { if (!seedOptions.GassMaw) { return; } FillRoomWithGass(level); })); RoomTriggers.Add(new RoomTrigger(8, 33, (level, itemLocation, seedOptions) => { if (!seedOptions.GassMaw) { return; } FillRoomWithGass(level); })); }