R GetObtainedRequirements(R obtainedRequirements) { var reachableLocations = GetReachableLocations(obtainedRequirements) .Where(l => l.ItemInfo != null) .ToArray(); var unlockedRequirements = reachableLocations .Where(l => !(l.ItemInfo is PogRessiveItemInfo)) .Select(l => l.ItemInfo.Unlocks) .Aggregate(R.None, (current, unlock) => current | unlock); var progressiveItemsPerType = reachableLocations .Where(l => l.ItemInfo is PogRessiveItemInfo) .GroupBy(l => l.ItemInfo as PogRessiveItemInfo); foreach (var progressiveItemsType in progressiveItemsPerType) { var progressiveItem = progressiveItemsType.Key; var clone = progressiveItem.Clone(); for (var i = 0; i < progressiveItemsType.Count(); i++) { unlockedRequirements |= clone.Unlocks; clone.Next(); } } return(unlockedRequirements); }
public void SetTeleporterPickupAction(R requirement) { var selectedGate = PresentTeleporterGates .Union(PastTeleporterGates) .First(g => g.Gate == requirement); var unlockingSpecification = unlockingSpecifications[new ItemIdentifier(EInventoryRelicType.PyramidsKey)]; unlockingSpecification.OnPickup = level => UnlockRoom(level, selectedGate.LevelId, selectedGate.RoomId); unlockingSpecification.Unlocks = selectedGate.Gate; }
protected void PlaceGassMaskInALegalSpot(Random random) { var levelIdsToAvoid = new List <int>(3) { 1 }; R minimalMawRequirements = R.None; if (!SeedOptions.Inverted) { minimalMawRequirements |= R.GateAccessToPast; //for non inverted seeds we dont know pyramid keys are required as it can be a classic past seed /*var isWatermaskRequiredForMaw = UnlockingMap.PyramidKeysUnlock != R.GateMaw * && UnlockingMap.PyramidKeysUnlock != R.GateCavesOfBanishment; * * if (isWatermaskRequiredForMaw) * minimalMawRequirements |= R.Swimming;*/ levelIdsToAvoid.Add(2); //library if (UnlockingMap.PyramidKeysUnlock != R.GateSealedCaves) { levelIdsToAvoid.Add(9); //xarion skelleton } } else { minimalMawRequirements |= R.Swimming; minimalMawRequirements |= UnlockingMap.PyramidKeysUnlock; } var gassMaskLocation = ItemLocations .Where(l => !l.IsUsed && !levelIdsToAvoid.Contains(l.Key.LevelId) && l.Gate.CanBeOpenedWith(minimalMawRequirements)) .SelectRandom(random); PutItemAtLocation(ItemInfoProvider.Get(EInventoryRelicType.AirMask), gassMaskLocation); }
public UnlockingSpecification(ItemIdentifier item, R unlocks, R?additionalUnlocks = null) { Item = item; Unlocks = unlocks; AdditionalUnlocks = additionalUnlocks ?? R.None; }
public IEnumerable <ItemIdentifier> AllItemThatUnlockProgression(R requirement) => unlockingSpecifications .Where(s => s.AllUnlocks.Contains(requirement)) .Select(s => s.Item);
void SetupGates() { OculusRift = (seedOptions.RequireEyeOrbRing) ? R.OculusRift : R.None; MawGassMask = (seedOptions.GassMaw) ? R.GassMask : R.None; AccessToLakeDesolation = (!seedOptions.Inverted) ? (Gate)R.None : R.GateLakeDesolation | R.GateKittyBoss | R.GateLeftLibrary | R.GateSealedCaves | (R.GateSealedSirensCave & R.CardE) | (R.GateMilitairyGate & ((R.CardC & R.CardE) | R.CardB)); LowerLakeDesolationBridge = AccessToLakeDesolation & (R.TimeStop | R.ForwardDash | R.GateKittyBoss | R.GateLeftLibrary); AccessToPast = (seedOptions.Inverted) ? (Gate)R.None : ( //libraryTimespinner R.TimespinnerWheel & R.TimespinnerSpindle //activateLibraryTimespinner & (LowerLakeDesolationBridge & R.CardD) //midLibrary ) | R.GateLakeSirineLeft | R.GateAccessToPast | R.GateLakeSirineRight | R.GateRoyalTowers | R.GateCastleRamparts | R.GateCastleKeep | (MawGassMask & (R.GateCavesOfBanishment | R.GateMaw)); MultipleSmallJumpsOfNpc = (Gate)(R.TimespinnerWheel | R.UpwardDash); DoubleJumpOfNpc = (R.DoubleJump & R.TimespinnerWheel) | R.UpwardDash; ForwardDashDoubleJump = (R.ForwardDash & R.DoubleJump) | R.UpwardDash; //past LeftSideForestCaves = (AccessToPast & (R.TimespinnerWheel | R.ForwardDash | R.DoubleJump)) | R.GateLakeSirineRight | R.GateLakeSirineLeft; UpperLakeSirine = (LeftSideForestCaves & (R.TimeStop | R.Swimming)) | R.GateLakeSirineLeft; LowerlakeSirine = (LeftSideForestCaves | R.GateLakeSirineLeft) & R.Swimming; LowerCavesOfBanishment = LowerlakeSirine | R.GateCavesOfBanishment | (R.GateMaw & R.DoubleJump); UpperCavesOfBanishment = AccessToPast; CastleRamparts = AccessToPast; CastleKeep = CastleRamparts; RoyalTower = (CastleKeep & R.DoubleJump) | R.GateRoyalTowers; MidRoyalTower = RoyalTower & (MultipleSmallJumpsOfNpc | ForwardDashDoubleJump); UpperRoyalTower = MidRoyalTower & R.DoubleJump; KillMaw = (LowerlakeSirine | R.GateCavesOfBanishment | R.GateMaw) & MawGassMask; var killTwins = CastleKeep & R.TimeStop; var killAelana = UpperRoyalTower; //future UpperLakeDesolation = AccessToLakeDesolation & UpperLakeSirine & R.AntiWeed; LeftLibrary = UpperLakeDesolation | LowerLakeDesolationBridge | R.GateLeftLibrary | R.GateKittyBoss | (R.GateSealedSirensCave & R.CardE) | (R.GateMilitairyGate & (R.CardB | (R.CardC & R.CardE))); UpperLeftLibrary = LeftLibrary & (R.DoubleJump | R.ForwardDash); MidLibrary = (LeftLibrary & R.CardD) | (R.GateSealedSirensCave & R.CardE) | (R.GateMilitairyGate & (R.CardB | (R.CardC & R.CardE))); UpperRightSideLibrary = (MidLibrary & (R.CardC | (R.CardB & R.CardE))) | ((R.GateMilitairyGate | R.GateSealedSirensCave) & R.CardE); RightSideLibraryElevator = R.CardE & ((MidLibrary & (R.CardC | R.CardB)) | R.GateMilitairyGate | R.GateSealedSirensCave); LowerRightSideLibrary = (MidLibrary & R.CardB) | RightSideLibraryElevator | R.GateMilitairyGate | (R.GateSealedSirensCave & R.CardE); SealedCavesLeft = (AccessToLakeDesolation & R.DoubleJump) | R.GateSealedCaves; SealedCavesLower = SealedCavesLeft & R.CardA; SealedCavesSirens = (MidLibrary & R.CardB & R.CardE) | R.GateSealedSirensCave; MilitairyFortress = LowerRightSideLibrary & KillMaw & killTwins & killAelana; MilitairyFortressHangar = MilitairyFortress; RightSideMilitairyFortressHangar = MilitairyFortressHangar & R.DoubleJump; TheLab = MilitairyFortressHangar & R.CardB; TheLabPoweredOff = TheLab & DoubleJumpOfNpc; UpperLab = TheLabPoweredOff & ForwardDashDoubleJump; EmperorsTower = UpperLab; //pyramid LeftPyramid = UpperLab & ( R.TimespinnerWheel & R.TimespinnerSpindle & R.TimespinnerPiece1 & R.TimespinnerPiece2 & R.TimespinnerPiece3); Nightmare = LeftPyramid & R.UpwardDash; }
bool CanCompleteGame(R obtainedRequirements) { return(Nightmare.CanBeOpenedWith(obtainedRequirements)); }
public IEnumerable <ItemLocation> GetReachableLocations(R obtainedRequirements) { return(this.Where(l => l.Gate.CanBeOpenedWith(obtainedRequirements))); }
ItemLocation[] GetReachableProgressionItemLocatioins(R obtainedRequirements) { return(GetReachableLocations(obtainedRequirements) .Where(l => l.ItemInfo != null && l.ItemInfo.Unlocks != R.None) .ToArray()); }