using System; namespace Auralis { public sealed class LevelDefinition { public readonly string Id,Title,ShortTitle,Resource; public readonly int Checkpoints; public LevelDefinition(string id,string title,string shortTitle,string resource,int checkpoints) {Id=id;Title=title;ShortTitle=shortTitle;Resource=resource;Checkpoints=checkpoints;} } public static class LevelCatalog { public const string Ascent="sonnenhain-ascent",Festival="windlantern-festival",WindSchool="wind-school",FirstThread="first-thread",CloudGardens="cloud-gardens",SleepingMill="sleeping-mill",Waterways="waterways",Scaffold="gardener-scaffold"; public const bool ScaffoldReleased=true; public const string RainGarden="rain-garden"; public const string Aqueduct="aqueduct-heart",Coast="bell-coast"; public const string BellWatch="bell-watch"; public const string WindFerry="wind-ferry",Belfry="seven-bells"; public const string StarArchive="star-archive"; public const string MistWorkshop="mist-spinner-workshop",RiverWithoutBanks="river-without-banks",RootCathedral="root-cathedral"; static readonly LevelDefinition mistWorkshop=new(MistWorkshop,"Die Werkstatt der Nebelspinner","Nebelwerkstatt","Levels/MistWorkshop",6); static readonly LevelDefinition riverWithoutBanks=new(RiverWithoutBanks,"Der Fluss ohne Ufer","Fluss ohne Ufer","Levels/RiverWithoutBanks",15); static readonly LevelDefinition rootCathedral=new(RootCathedral,"Die Wurzelkathedrale","Wurzelkathedrale","Levels/RootCathedral",8); public const string LastConnection="last-connection"; static readonly LevelDefinition lastConnection=new(LastConnection,"Die letzte Verbindung","Letzte Verbindung","Levels/LastConnection",12); public const string SecondsCity="city-between-seconds"; static readonly LevelDefinition secondsCity=new(SecondsCity,"Die Stadt zwischen den Sekunden","Stadt der Sekunden","Levels/SecondsCity",5); public const string CrownHeart="silent-crown-heart"; static readonly LevelDefinition crownHeart=new(CrownHeart,"Das Herz der Stillen Krone","Stille Krone","Levels/CrownHeart",6); public const string OpenSky="open-sky"; static readonly LevelDefinition openSky=new(OpenSky,"Der offene Himmel","Offener Himmel","Levels/OpenSky",3); public const string SleepingIslands="sleeping-islands"; static readonly LevelDefinition sleepingIslands=new(SleepingIslands,"Unter den schlafenden Inseln","Schlafende Inseln","Levels/SleepingIslands",7); public const string ArchiveMemory="archive-memory",GlassGarden="glass-garden",Observatory="blind-observatory"; static readonly LevelDefinition observatory=new(Observatory,"Das blinde Observatorium","Observatorium","Levels/Observatory",6); static readonly LevelDefinition glassGarden=new(GlassGarden,"Der Garten aus Glas","Glasgarten","Levels/GlassGarden",5); static readonly LevelDefinition archiveMemory=new(ArchiveMemory,"Die Räume, die sich erinnern","Erinnerungsräume","Levels/ArchiveMemory",5); static readonly LevelDefinition starArchive=new(StarArchive,"Die Treppe der Sternbilder","Sternentreppe","Levels/StarArchive",5); // Connected tower journey; human playtime and combat balance acceptance remain separate. static readonly LevelDefinition belfryDraft=new(Belfry,"Der Turm der sieben Glocken","Glockenturm","Levels/BelfryLowerHall",7); static readonly LevelDefinition ferryDraft=new(WindFerry,"Die schwebende Werft","Windfähre","Levels/FerryLanding",6); static readonly LevelDefinition watchDraft=new(BellWatch,"Die Glockenwache","Glockenwache","Levels/BellWatchCourt",3); static readonly LevelDefinition coastDraft=new(Coast,"Wind von der falschen Seite","Glockenküste","Levels/CoastApproach",4); // Connected development content; inclusion does not imply a final human combat/playtime acceptance. public const bool AqueductPlaytestIncluded=true; static readonly LevelDefinition aqueductDraft=new(Aqueduct,"Das Herz des Aquädukts","Herz des Aquädukts","Levels/AqueductHeart",4); // Connected campaign content, including inlet, three water paths, finale and side rooms. // This flag describes availability, not human playtime/balance acceptance. public const bool RainReleased=true; public const bool RainPlaytestIncluded=true; public static bool RainAvailable=>RainReleased||RainPlaytestIncluded||(GameSession.I&&GameSession.I.QA); static readonly LevelDefinition rainDraft=new(RainGarden,"Der Garten ohne Regen","Garten ohne Regen","Levels/RainGarden",8); public static bool ScaffoldAvailable=>ScaffoldReleased||(GameSession.I&&GameSession.I.QA); static readonly LevelDefinition scaffoldDraft=new(Scaffold,"Das Gerüst der Gärtner","Gärtnergerüst","Levels/GardenerScaffold",7); public static readonly LevelDefinition[] All={ new(Festival,"Das Fest der Windlaternen","Windlaternenfest","Levels/WindlanternFestival",4), new(FirstThread,"Der erste gerissene Faden","Erster Faden","Levels/FirstThread",5), new(CloudGardens,"Über den Wolkenbeeten","Wolkenbeete","Levels/CloudGardens",5), new(SleepingMill,"Die schlummernde Windmühle","Windmühle","Levels/SleepingMill",8), new(Waterways,"Die Wege des Wassers","Wasserwege","Levels/Waterways",5), scaffoldDraft, rainDraft, aqueductDraft, coastDraft, watchDraft, ferryDraft, belfryDraft, starArchive, archiveMemory, glassGarden, observatory, sleepingIslands,mistWorkshop,riverWithoutBanks,rootCathedral,openSky,secondsCity,lastConnection,crownHeart, new(Ascent,"Der Weg zur Windmühle","Sonnenhain","Levels/SonnenhainSlice",7), new(WindSchool,"Level 0 · Maras Übungsplatz","Maras Übungsplatz","Levels/WindSchool",1) }; public static LevelDefinition Find(string id)=>id==SleepingIslands?sleepingIslands:id==Observatory?observatory:id==GlassGarden?glassGarden:id==ArchiveMemory?archiveMemory:id==StarArchive?starArchive:id==Belfry?belfryDraft:id==WindFerry?ferryDraft:id==BellWatch?watchDraft:id==Coast?coastDraft:id==Aqueduct?aqueductDraft:id==RainGarden?rainDraft:id==Scaffold?scaffoldDraft:Array.Find(All,level=>level.Id==id); public static string StoryNumber(string id)=>id==LastConnection?"6-3":id==SecondsCity?"6-2":id==CrownHeart?"6-4":id==OpenSky?"6-1":id==MistWorkshop?"5-2":id==RiverWithoutBanks?"5-3":id==RootCathedral?"5-4":id==SleepingIslands?"5-1":id==Observatory?"4-4":id==GlassGarden?"4-3":id==ArchiveMemory?"4-2":id==StarArchive?"4-1":id==Belfry?"3-4":id==WindFerry?"3-3":id==BellWatch?"3-2":id==Coast?"3-1":id==Aqueduct?"2-4":id==RainGarden?"2-3":id==WindSchool?"0":id==Festival?"1-1":id==FirstThread?"1-2":id==CloudGardens?"1-3":id==SleepingMill?"1-4":id==Waterways?"2-1":id==Scaffold?"2-2":""; public static bool CoastEarned(SaveData data)=>data.resonance&&data.levels.Exists(p=>p.id==Aqueduct&&p.completed&&p.mechanisms.Contains(SerevaBoss.FreedKey)); public static bool BellWatchEarned(SaveData data)=>CoastEarned(data)&&data.levels.Exists(p=>p.id==Coast&&p.completed&&p.mechanisms.Contains(CoastBridge.CrossedKey)); public static bool WindFerryEarned(SaveData data)=>BellWatchEarned(data)&&data.levels.Exists(p=>p.id==BellWatch&&p.completed&&p.mechanisms.Contains(BellWatchTwinCourt.CompleteKey)); public static bool BelfryEarned(SaveData data)=>WindFerryEarned(data)&&data.levels.Exists(p=>p.id==WindFerry&&p.completed&&p.mechanisms.Contains(FerryTowerLanding.ArrivedKey)); public static bool StarArchiveEarned(SaveData data)=>BelfryEarned(data)&&data.windReading&&data.levels.Exists(p=>p.id==Belfry&&p.completed&&p.mechanisms.Contains(BelfryJourney.EndingKey)&&p.mechanisms.Contains(OrvoWindGift.PracticeKey)); public static bool ArchiveMemoryEarned(SaveData data)=>StarArchiveEarned(data)&&data.levels.Exists(p=>p.id==StarArchive&&p.completed&&p.mechanisms.Contains(StarArchiveWorld.CompleteKey)); public static bool GlassGardenEarned(SaveData data)=>ArchiveMemoryEarned(data)&&data.levels.Exists(p=>p.id==ArchiveMemory&&p.completed&&p.mechanisms.Contains(ArchiveMemoryWorld.CompleteKey)); public static bool ObservatoryEarned(SaveData data)=>GlassGardenEarned(data)&&data.levels.Exists(p=>p.id==GlassGarden&&p.completed&&p.mechanisms.Contains(GlassGardenWorld.CompleteKey)); public static bool SleepingIslandsEarned(SaveData data)=>ObservatoryEarned(data)&&data.mirrorWeave&&data.levels.Exists(p=>p.id==Observatory&&p.completed&&p.mechanisms.Contains(ObservatoryWorld.CompleteKey)&&p.mechanisms.Contains(AsterBoss.FreedKey)&&p.mechanisms.Contains(AsterMirrorGift.PracticeKey)); public static bool MistWorkshopEarned(SaveData data)=>SleepingIslandsEarned(data)&&data.levels.Exists(p=>p.id==SleepingIslands&&p.completed&&p.mechanisms.Contains(NightRootsWorld.CompleteKey)); public static bool RiverWithoutBanksEarned(SaveData data)=>MistWorkshopEarned(data)&&data.levels.Exists(p=>p.id==MistWorkshop&&p.completed&&p.mechanisms.Contains(MistWorkshopWorld.CompleteKey)&&p.mechanisms.Contains(MistWorkshopWorld.BowKey)); public static bool RootCathedralEarned(SaveData data)=>RiverWithoutBanksEarned(data)&&data.levels.Exists(p=>p.id==RiverWithoutBanks&&p.completed&&p.mechanisms.Contains("river-root-cathedral-reached")); public static bool OpenSkyEarned(SaveData data)=>RootCathedralEarned(data)&&data.flight&&data.levels.Exists(p=>p.id==RootCathedral&&p.completed&&p.mechanisms.Contains(RootCathedralWorld.CompleteKey)&&p.mechanisms.Contains(RootCathedralWorld.GiftKey)&&p.mechanisms.Contains(RootCathedralWorld.LessonKey)); public static bool SecondsCityEarned(SaveData data)=>OpenSkyEarned(data)&&data.levels.Exists(p=>p.id==OpenSky&&p.completed&&p.mechanisms.Contains(OpenSkyWorld.CompleteKey)); public static bool LastConnectionEarned(SaveData data)=>SecondsCityEarned(data)&&data.levels.Exists(p=>p.id==SecondsCity&&p.completed&&p.mechanisms.Contains(SecondsCityWorld.CompleteKey)); public static bool CrownHeartEarned(SaveData data)=>OpenSkyEarned(data)&&data.levels.Exists(p=>p.id==OpenSky&&p.completed&&p.mechanisms.Contains(OpenSkyWorld.CompleteKey))&&data.levels.Exists(p=>p.id=="city-between-seconds"&&p.completed&&p.mechanisms.Contains("seconds-city-reconnected"))&&data.levels.Exists(p=>p.id=="last-connection"&&p.completed&&p.mechanisms.Contains("last-connection-crown-open")); public static bool Reachable(SaveData data,string id) { if(id==LastConnection)return LastConnectionEarned(data); if(id==SecondsCity)return SecondsCityEarned(data); if(id==CrownHeart)return CrownHeartEarned(data); if(id==OpenSky)return OpenSkyEarned(data); if(id==MistWorkshop)return MistWorkshopEarned(data); if(id==RiverWithoutBanks)return RiverWithoutBanksEarned(data); if(id==RootCathedral)return RootCathedralEarned(data); if(id==SleepingIslands)return SleepingIslandsEarned(data); if(id==Observatory)return ObservatoryEarned(data); if(id==GlassGarden)return GlassGardenEarned(data); if(id==ArchiveMemory)return ArchiveMemoryEarned(data); if(id==StarArchive)return StarArchiveEarned(data); if(id==Belfry)return BelfryEarned(data); if(id==WindFerry)return WindFerryEarned(data); if(id==BellWatch)return BellWatchEarned(data); if(id==Coast)return CoastEarned(data); if(id==Aqueduct)return (AqueductPlaytestIncluded||(GameSession.I&&GameSession.I.QA))&&(data.currentLevel==id||data.levels.Exists(p=>p.id==RainGarden&&p.completed)||data.levels.Exists(p=>p.id==id)); if(id==RainGarden)return RainAvailable&&(data.currentLevel==id||data.levels.Exists(p=>p.id==Scaffold&&p.completed)||data.levels.Exists(p=>p.id==id)); if(id==Scaffold)return ScaffoldAvailable&&(data.currentLevel==id||data.levels.Exists(p=>p.id==Waterways&&p.completed)||data.levels.Exists(p=>p.id==id)); if(id==Festival||id==WindSchool||id==Ascent||data.currentLevel==id)return true; if(data.levels.Exists(p=>p.id==id))return true; string previous=id==Waterways?SleepingMill:id==SleepingMill?CloudGardens:id==CloudGardens?FirstThread:Festival; return data.levels.Exists(p=>p.id==previous&&p.completed); } } }