using System; using UnityEngine; namespace Auralis { // Explicit support coordinates come from each world's Floor/Bank/Slab calls. // Quiet hubs, first tool lessons, actual doors and boss refuges stay unoccupied. public static class ChapterFourFivePopulation { public static void Build() { switch(GameSession.I.Save.Data.currentLevel) { case LevelCatalog.StarArchive: if(StarArchiveWorld.I)StarStair();break; case ArchiveMemoryWorld.LevelId: if(ArchiveMemoryWorld.I)Archive();break; case GlassGardenWorld.LevelId: if(GlassGardenWorld.I)Glass();break; case ObservatoryWorld.LevelId: if(ObservatoryWorld.I)Observatory();break; case NightRootsWorld.LevelId: if(NightRootsWorld.I)Night();break; case MistWorkshopWorld.LevelId: if(MistWorkshopWorld.I)Mist();break; case RiverWithoutBanksWorld.LevelId: if(RiverWithoutBanksWorld.I)River();break; case RootCathedralWorld.LevelId: if(RootCathedralWorld.I)Cathedral();break; } if(WorldBuilder.IsStarArchive||WorldBuilder.IsArchiveMemory||WorldBuilder.IsGlassGarden||WorldBuilder.IsObservatory)Chapter34CombatLayout.Create(); } static void StarStair() { Area A(int room)=>new(StarArchiveWorld.I.transform,"41",room,StarArchiveWorld.At, ()=>StarArchiveWorld.Area==room,()=>StarArchiveWorld.Complete); // First small bird is taught on a wide, already reached upper bank. // The same gallery flier now answers the broad lower approach after // a real moving arrival. Both jump treads and the flap lesson stay quiet. // The compulsory lower crossing now revisits the learned one-arrow // answer. It is separated from the optional paper patrol above, the // island's rest at 290, and the next stair doorway at 1427. A(2).Small("island-ink-reprise",LittleFoeKind.InkSailor,915,1080,880,1,false,1.15f); A(0).Hearts("arrival",375,485,742);A(0).Hearts("upper-way",1130,1220,382); A(1).Hearts("wind-bank",1150,1260,326);A(2).Hearts("island-path",615,765,880); A(2).Hearts("island-reprise-return",1120,1180,880); A(3).Hearts("first-rise",530,655,542);A(3).Hearts("last-rise",1210,1280,286); A(0).Hearts("side-balcony",310,415,477,true);A(4).Hearts("side-vista",1100,1240,403,true); A(0).Supply("first-wind",530,742,SupplyKind.WindFeather,4); A(2).Supply("stair-reserve",1215,880,SupplyKind.WindFeather,6); A(2).Supply("island-rest",290,880,SupplyKind.Potion,1); } static void Archive() { Area A(int room)=>new(ArchiveMemoryWorld.I.RoomRoot(room),"42",room,ArchiveMemoryWorld.At, ()=>ArchiveMemoryWorld.Area==room,()=>ArchiveMemoryWorld.Complete); // The following-build gallery passage owns the same crossing-flank // and crossing-ink release IDs on its actual fixed combat landings. A(0).Hearts("threshold",650,785,635);A(2).Hearts("morning",405,555,632); A(3).Hearts("reading-way",1030,1140,686);A(4).Hearts("crossing",455,560,710); A(5).Hearts("store-way",1060,1190,588);A(6).Hearts("evening",865,980,560); A(7).Hearts("joined",1010,1145,684); A(2).Hearts("side-balcony",1190,1290,320,true); A(7).Hearts("side-history",535,650,289,true); A(5).Supply("before-star-store",300,588,SupplyKind.Potion,1); A(5).Supply("store-wind",505,340,SupplyKind.WindFeather,5); } static void Glass() { Area A(int room)=>new(GlassGardenWorld.I.RoomRoot(room),"43",room,GlassGardenWorld.At, ()=>GlassGardenWorld.Area==room,()=>GlassGardenWorld.Complete); // All four authored star guards remain the chapter's identity. Only // the optional fork balcony gains a short, familiar paper encounter. A(2).Small("fork-ink",LittleFoeKind.InkSailor,345,460,342,2,true,1.2f); A(0).Hearts("threshold",565,690,563);A(0).Hearts("seed-return",1085,1185,302); A(1).Hearts("terrace-low",440,565,679);A(1).Hearts("terrace-return",1230,1350,451); A(2).Hearts("fork-low",850,970,676);A(3).Hearts("dome-way",1060,1195,633); A(0).Hearts("side-first-bloom",345,450,264,true); A(3).Hearts("side-memory",520,625,311,true); A(1).Supply("terrace-refuge",205,679,SupplyKind.Potion,1); A(2).Supply("fork-wind",215,676,SupplyKind.WindFeather,5); } static void Observatory() { Area A(int room)=>new(ObservatoryWorld.I.RoomRoot(room),"44",room,ObservatoryWorld.At, ()=>ObservatoryWorld.Area==room,()=>ObservatoryWorld.Complete); // The axes and upper exits are beyond these bounded encounters. // WestPassage owns the original west-watch and west-low-ink IDs on // actual upper banks, with a quiet landing before each encounter. // EastPassage owns the same east-flank actor ID on its original // left gallery, with a supported arrival before its first attack. // NorthPassage owns the original north-watch ID on its arrival bank, // with actual supported arrival grace; do not duplicate it here. // Keep the approach readable from its existing pickups. The groups // beside the axes now acknowledge the actual three-turn solution, // then lead towards each open return rather than paying in advance. A(1).Hearts("west-approach",370,465,854);A(1).Hearts("west-axis",1170,1240,385,ready:()=>ObservatoryWorld.AxisAligned(0)); A(2).Hearts("east-gallery",280,390,337);A(2).Hearts("east-axis",1090,1160,337,ready:()=>ObservatoryWorld.AxisAligned(1)); A(3).Hearts("north-middle",735,825,494);A(3).Hearts("north-axis",1260,1330,241,ready:()=>ObservatoryWorld.AxisAligned(2)); A(1).Hearts("side-west",535,625,578,true); A(2).Hearts("side-recovery",770,900,817,true); A(0).Supply("aster-reserve",1070,701,SupplyKind.Potion,1); A(0).Supply("axis-wind",1160,701,SupplyKind.WindFeather,5); } static void Night() { Area A(int room)=>new(NightRootsWorld.I.RoomRoot(room),"51",room,NightRootsWorld.At, ()=>NightRootsWorld.Area==room,()=>NightRootsWorld.Complete); var budget=NightRootsWorld.I.gameObject.AddComponent(); // Optional broad descent root; the next room's first reflection // lesson and Fenn's garden both remain completely free of enemies. A(0).MistCreature("first-sleep-flower",MistWorkshopSpecies.SleepFlower,925,492,925,492,budget); A(3).Small("fork-buds",LittleFoeKind.DuskBud,580,760,730,2,true); A(0).Hearts("descent-top",125,235,223);A(1).Hearts("bowl-return",1110,1250,574); // Follow the existing lower root after the real descent. Its painted // walkable profile is nearly level here (809..811 source pixels); // these pickups make the onward bowl doorway readable from below. A(0).Hearts("descent-way",1100,1210,810); A(2).Hearts("arch-way",755,880,710);A(3).Hearts("fork-way",805,925,730); A(4).Hearts("path-start",485,590,742);A(4).Hearts("path-finish",1290,1345,742); A(0).Hearts("side-flower",840,895,492,true); A(5).Hearts("side-fenn",350,450,382,true); A(2).Supply("arch-rest",275,710,SupplyKind.Potion,1); A(0).Supply("descent-wind",480,223,SupplyKind.WindFeather,5); } static void Mist() { Area A(int room)=>new(MistWorkshopWorld.I.RoomRoot(room),"52",room,MistWorkshopWorld.At, ()=>MistWorkshopWorld.Area==room,()=>MistWorkshopWorld.Complete); // A known small creature before the spinner court. The actual first // spinner stays alone; the existing loom mixed-budget owns its climax. A(0).Small("approach-buds",LittleFoeKind.DuskBud,930,1170,672,2,true); A(0).Hearts("approach",555,660,672);A(1).Hearts("spool-way",455,590,703); A(2).Hearts("vein-gate",1020,1140,734);A(3).Hearts("tension-low",390,485,731); A(3).Hearts("tension-high",1160,1260,390);A(4).Hearts("loom-return",1360,1420,728); A(5).Hearts("quiet-path",700,840,752); A(0).Hearts("side-spool",555,675,365,true);A(6).Hearts("side-cloak",755,860,251,true); A(2).Supply("before-night-veins",310,734,SupplyKind.Potion,1); A(4).Supply("before-loom",290,728,SupplyKind.Potion,1); A(2).Supply("night-vein-wind",1110,344,SupplyKind.WindFeather,5); } static void River() { Area A(int room)=>new(RiverWithoutBanksWorld.I.RoomRoot(room),"53",room,RiverWithoutBanksWorld.At, ()=>RiverWithoutBanksWorld.Area==room,()=>RiverWithoutBanksWorld.Complete); // First ride, wind landing and fragile steps stay free of enemies. // Revisit the one-arrow answer on the later fixed combat bank only // after its ray and warning seed have finished. Room 3 stays peaceful. A(2).Ray("wind-turn-ray",1010,1160,330); A(1).Small("upper-crossing-ink",LittleFoeKind.InkSailor,1126,1256,115,2,true,.85f, ()=>RiverPlatformPassage.I&&RiverPlatformPassage.I.CombatReady&& RiverPlatformPassage.I.CrossingRay&&RiverPlatformPassage.I.CrossingRay.Released); A(4).Small("upper-forecourt-ink",LittleFoeKind.InkSailor,775,845,205,2,true,.85f); A(0).Hearts("source-way",315,400,561);A(0).Hearts("middle-nest",865,970,478); A(1).Hearts("crossing-rise",700,825,290,airborne:true);A(2).Hearts("turn-nest",675,785,645); A(3).Hearts("quiet-nest",1120,1250,511);A(4).Hearts("cathedral-landing",1055,1150,365); A(0).Hearts("side-source",697,772,651,true);A(3).Hearts("side-warmth",1190,1305,832,true); A(0).Supply("before-first-wind",345,561,SupplyKind.WindFeather,6); A(1).Supply("before-long-crossing",325,418,SupplyKind.WindFeather,6); A(2).Supply("before-last-rise",875,645,SupplyKind.WindFeather,6); A(3).Supply("quiet-nest-potion",820,511,SupplyKind.Potion,1); } static void Cathedral() { Area A(int room)=>new(RootCathedralWorld.I.RoomRoot(room),"54",room,RootCathedralWorld.At, ()=>RootCathedralWorld.Area==room,()=>RootCathedralWorld.Complete); var budget=RootCathedralWorld.I.gameObject.AddComponent(); A(1).MistCreature("carry-spinner",MistWorkshopSpecies.MistSpinner,715,878,820,878,budget, ()=>!RootCathedralWorld.Arm(0)); A(1).Small("carry-buds",LittleFoeKind.DuskBud,165,280,378,2,true); A(2).MistCreature("turn-flower",MistWorkshopSpecies.SleepFlower,315,366,315,366,budget, ()=>!RootCathedralWorld.Arm(1)); // The existing open-arm hopper/flier combination is already the // last combat answer. Family, Velis' refuge and flight school stay safe. A(1).Hearts("carry-floor",465,580,878);A(1).Hearts("carry-arrival",965,1060,378); A(2).Hearts("turn-floor",405,530,823);A(2).Hearts("turn-return",1180,1300,823); A(3).Hearts("open-lower",355,420,488);A(3).Hearts("open-middle",835,900,370); A(1).Hearts("side-carry",520,600,378,true);A(3).Hearts("side-mural",1140,1235,816,true); A(0).Supply("velis-reserve",1250,717,SupplyKind.Potion,1); A(0).Supply("velis-wind",1295,717,SupplyKind.WindFeather,6); } sealed class Area { readonly Transform root;readonly string prefix;readonly int room; readonly Func at;readonly Func here,complete; public Area(Transform root,string chapter,int room,Func at,Func here,Func complete) {this.root=root;prefix="pop46-"+chapter+"-";this.room=room;this.at=at;this.here=here;this.complete=complete;} Vector2 P(float x,float y)=>at(room,x,y); bool Active()=>here()&&!complete(); public void Hearts(string id,float left,float right,float y,bool side=false,bool airborne=false,Func ready=null) =>CampaignPopulation.Hearts(root,prefix+id,P(left,y)+Vector2.up*.70f,P(right,y)+Vector2.up*.70f,3,side?3:2, ()=>here()&&(ready==null||ready()),airborne); public void Supply(string id,float x,float y,SupplyKind kind,int count) =>CampaignPopulation.Supply(root,prefix+id,P(x,y)+Vector2.up*.70f,kind,count,here); public void Bank(string id,EnemyKind kind,float left,float right,float y,float flight=0,Func ready=null) {if(!complete())CampaignPopulation.Bank(root,prefix+id,kind,P(left,y),P(right,y),flight,()=>Active()&&(ready==null||ready()));} public void Small(string id,LittleFoeKind kind,float left,float right,float y,int count,bool waves,float flight=0,Func ready=null) {if(complete())return;ChapterFourFiveLittleArt.Register();CampaignPopulation.SmallGroup(root,prefix+id,kind,P(left,y),P(right,y),count,waves,flight,()=>Active()&&(ready==null||ready()));} public void Beetle(string id,float left,float right,float y) { if(complete())return;var e=ArchiveMirrorBeetle.Create(prefix+id,root,P((left+right)*.5f,y),P(left,y).x,P(right,y).x,Active); Record(id,"MirrorBeetle",P(left,y),P(right,y),e); } public void Guard(string id,float x,float y) { if(complete())return;var e=GlassStarGuard.Create(prefix+id,root,P(x,y),Active); Record(id,"StarGuard",P(x,y),P(x,y),e); } public void MistCreature(string id,MistWorkshopSpecies kind,float x,float y,float barrierX,float barrierY,MistThreatBudget budget,Func ready=null) { if(complete()||ready!=null&&!ready())return; var e=MistWorkshopCreature.Create(prefix+id,kind,root,P(x,y),P(barrierX,barrierY),budget,()=>Active()&&(ready==null||ready())); Record(id,kind.ToString(),P(x,y),P(barrierX,barrierY),e); } public void Ray(string id,float left,float right,float y) { if(complete())return;var e=ArchivePatrol.Create(root,prefix+id,P(left,y),P(right,y),true);e.Available=Active; Record(id,"WindRay",P(left,y),P(right,y),e); } void Record(string id,string kind,Vector2 from,Vector2 to,UnityEngine.Object actor) =>CampaignPopulation.Placements.Add(new CampaignPopulation.Placement{Id=prefix+id,Kind=kind,From=from,To=to,Count=1,Available=Active,Actor=actor,Airborne=kind=="WindRay"}); } } }