using UnityEngine; namespace Auralis { // Each point uses the owning room's painted floor coordinates. Nothing is scattered // from the old level JSON: ferry controls, door arrivals and recovery landings stay free. public static class ChapterThreePopulation { public static void Build() { if(!WorldBuilder.IsCoast&&!WorldBuilder.IsBellWatch&&!WorldBuilder.IsWindFerry&&!WorldBuilder.IsBelfry)return; if(WorldBuilder.IsCoast)Coast(); else if(WorldBuilder.IsBellWatch)Watch(); else if(WorldBuilder.IsWindFerry)Shipyard(); else if(WorldBuilder.IsBelfry)Belfry(); Chapter34CombatLayout.Create(); } static bool CoastRoom(int room) { if(!WorldBuilder.IsCoast||!GameSession.I.Player)return false; if(room==3)return CoastWindNiche.Inside; if(CoastWindNiche.Inside)return false; float x=GameSession.I.Player.transform.position.x; return room==0?x<19:room==1?x>=19&&x<54.5f:CoastBridge.Inside; } static bool WatchRoom(int room)=>WorldBuilder.IsBellWatch&&GameSession.I.Player&&BellWatchJourney.Area==room; static bool FerryRoom(int room)=>WorldBuilder.IsWindFerry&&GameSession.I.Player&&ShipyardJourney.Area==room; static bool BelfryRoom(int room)=>WorldBuilder.IsBelfry&&GameSession.I.Player&&BelfryJourney.Area==room; static bool CoastUnsettled=>!BelfryJourney.CoastRestored; static void Hearts(Transform parent,string id,Vector2 left,Vector2 right,bool optional=false,System.Func available=null) =>CampaignPopulation.Hearts(parent,"pop46-"+id,left+Vector2.up*.72f,right+Vector2.up*.72f,3,optional?3:2,available); static void Stock(Transform parent,string id,Vector2 feet,SupplyKind kind,int count,System.Func available=null) =>CampaignPopulation.Supply(parent,"pop46-"+id,feet+Vector2.up*.78f,kind,count,available); static void Coast() { var entry=CoastApproach.I;var passage=CoastCrystalPassage.I;var bridge=CoastBridge.I;var niche=CoastWindNiche.I; if(!entry||!passage||!bridge||!niche)return; // The first wind gap, its landing and its return ladder come before the first pick. // Leave the optional doorway at x225 and all four crystal steps unobstructed. Hearts(entry.transform,"coast-before-wind",entry.At(370,493),entry.At(500,493),available:()=>CoastRoom(0)); Hearts(entry.transform,"coast-sheltered-bank",entry.At(1030,493),entry.At(1135,493),available:()=>CoastRoom(0)); Hearts(passage.transform,"coast-crystal-approach",passage.At(665,541),passage.At(775,541),available:()=>CoastRoom(1)); Hearts(passage.transform,"coast-upper-gallery",passage.At(1320,339),passage.At(1430,339),available:()=>CoastRoom(1)); Hearts(bridge.transform,"coast-middle-bank",bridge.At(750,420),bridge.At(850,420),available:()=>CoastRoom(2)); Hearts(bridge.transform,"coast-watch-approach",bridge.At(1260,435),bridge.At(1330,435),available:()=>CoastRoom(2)); Hearts(niche.transform,"coast-niche-upper",niche.At(740,334),niche.At(855,334),true,()=>CoastRoom(3)); Hearts(passage.transform,"coast-lower-alcove",passage.At(670,916),passage.At(795,916),true,()=>CoastRoom(1)); Stock(entry.transform,"coast-wind-reserve",entry.At(555,493),SupplyKind.WindFeather,10,()=>CoastRoom(0)); Stock(bridge.transform,"coast-bridge-reserve",bridge.At(245,435),SupplyKind.WindFeather,10,()=>CoastRoom(2)); Stock(passage.transform,"coast-crystal-medicine",passage.At(670,686),SupplyKind.Potion,1,()=>CoastRoom(1)); } static void Watch() { var first=BellWatchCourt.I;var terrace=BellWatchTerraces.I;var twin=BellWatchTwinCourt.I; if(!first||!terrace||!twin)return; // Real patrols are built by the regional court layout. Supplies // retain their original IDs and stay out of the bell strike arcs. Hearts(first.transform,"watch-first-cover",first.At(340,576),first.At(450,576),available:()=>WatchRoom(0)); Hearts(first.transform,"watch-first-exit",first.At(1275,576),first.At(1390,576),available:()=>WatchRoom(0)); Hearts(terrace.transform,"watch-stair-approach",terrace.At(160,587),terrace.At(275,587),available:()=>WatchRoom(1)); Hearts(twin.transform,"watch-pair-approach",twin.At(250,576),twin.At(365,576),available:()=>WatchRoom(2)); Hearts(twin.transform,"watch-onward-gallery",twin.At(910,288),twin.At(1020,288),available:()=>WatchRoom(2)); Hearts(first.transform,"watch-high-bypass",first.At(470,238),first.At(590,238),true,()=>WatchRoom(0)); Hearts(terrace.transform,"watch-quiet-loggia",terrace.At(850,288),terrace.At(985,288),true,()=>WatchRoom(1)); Stock(first.transform,"watch-high-wind-reserve",first.At(1050,238),SupplyKind.WindFeather,5,()=>WatchRoom(0)); // Above the two callers and away from the onward doorway / ladder. Stock(twin.transform,"watch-depot-medicine",twin.At(470,288),SupplyKind.Potion,1,()=>WatchRoom(2)); } static void Shipyard() { var landing=FerryLanding.I;var crane=FerryCraneYard.I;var walk=FerryPennantWalk.I;var bell=FerryWayBell.I;var tower=FerryTowerLanding.I; if(!landing||!crane||!walk||!bell||!tower)return; // A broad work bank after the boat landing, with the call bell and ladder outside. CampaignPopulation.SmallGroup(landing.transform,"pop46-shipyard-copper-workbank",LittleFoeKind.CopperPecker, landing.At(970,396),landing.At(1045,396),2,available:()=>FerryRoom(0)); // Preserve the actual old receipt/HP. The optional carried loop now // leads to this broad fixed gallery; neither a glide nor the first // pennant arrival can wake it before a real ride and quiet landing. var pennantFlier=CampaignPopulation.Bank(walk.transform,"pop46-shipyard-return-flier",EnemyKind.Flatterer, walk.At(1110,201),walk.At(1190,201),1.35f,()=>FerryRoom(2)&&CoastUnsettled&&walk.Passage.CombatReady); walk.Passage.BindFlier(pennantFlier); Hearts(landing.transform,"shipyard-first-workpath",landing.At(365,537),landing.At(460,537),available:()=>FerryRoom(0)); Hearts(landing.transform,"shipyard-upper-workbank",landing.At(980,396),landing.At(1060,396),available:()=>FerryRoom(0)); Hearts(crane.transform,"shipyard-crane-approach",crane.At(170,538),crane.At(300,538),available:()=>FerryRoom(1)); Hearts(walk.transform,"shipyard-observation-path",walk.At(450,552),walk.At(565,552),available:()=>FerryRoom(2)); Hearts(bell.transform,"shipyard-waybell-path",bell.At(650,494),bell.At(790,494),available:()=>FerryRoom(3)); Hearts(bell.transform,"shipyard-outer-return",bell.At(1220,550),bell.At(1290,550),available:()=>FerryRoom(4)); Hearts(tower.transform,"shipyard-tower-welcome",tower.At(380,540),tower.At(510,540),available:()=>FerryRoom(5)); Hearts(crane.transform,"shipyard-lower-cache",crane.At(760,776),crane.At(905,776),true,()=>FerryRoom(1)); Hearts(walk.transform,"shipyard-pennant-step",walk.At(705,274),walk.At(825,274),true,()=>FerryRoom(2)); Stock(landing.transform,"shipyard-first-wind-reserve",landing.At(495,537),SupplyKind.WindFeather,10,()=>FerryRoom(0)); Stock(crane.transform,"shipyard-crossing-reserve",crane.At(570,445),SupplyKind.WindFeather,10,()=>FerryRoom(1)); Stock(walk.transform,"shipyard-pennant-reserve",walk.At(465,201),SupplyKind.WindFeather,5,()=>FerryRoom(2)); Stock(crane.transform,"shipyard-quiet-medicine",crane.At(515,776),SupplyKind.Potion,1,()=>FerryRoom(1)); Stock(tower.transform,"shipyard-tower-medicine",tower.At(1330,490),SupplyKind.Potion,1,()=>FerryRoom(5)); } static void Belfry() { var hall=BelfryLowerHall.I;var side=BelfrySideGallery.I;var window=BelfryWindWindow.I;var roof=OrvoRoof.I; if(!hall||!side||!window||!roof)return; // Two finite, announced singles; the weight landing at x893 is free and the // rightmost bird stops two metres before the actual resonance stand at x1130. CampaignPopulation.SmallGroup(side.transform,"pop46-belfry-answer-copper",LittleFoeKind.CopperPecker, side.At(965,390),side.At(1035,390),2,true,available:()=>BelfryRoom(1)); Hearts(hall.transform,"belfry-first-bank",hall.At(270,730),hall.At(420,730),available:()=>BelfryRoom(0)); Hearts(hall.transform,"belfry-middle-bank",hall.At(815,597),hall.At(925,597),available:()=>BelfryRoom(0)); Hearts(side.transform,"belfry-second-left",side.At(555,390),side.At(675,390),available:()=>BelfryRoom(1)); Hearts(side.transform,"belfry-second-right",side.At(960,390),side.At(1040,390),available:()=>BelfryRoom(1)); Hearts(window.transform,"belfry-window-shelter",window.At(250,418),window.At(340,418),available:()=>BelfryRoom(2)); Hearts(window.transform,"belfry-last-bank",window.At(1305,368),window.At(1390,368),available:()=>BelfryRoom(2)); Hearts(hall.transform,"belfry-hearth-loop",hall.At(440,978),hall.At(585,978),true,()=>BelfryRoom(0)); Hearts(side.transform,"belfry-maintenance-loop",side.At(650,800),side.At(805,800),true,()=>BelfryRoom(1)); Stock(hall.transform,"belfry-first-thread-reserve",hall.At(190,730),SupplyKind.WindFeather,10,()=>BelfryRoom(0)); Stock(window.transform,"belfry-wind-window-reserve",window.At(350,418),SupplyKind.WindFeather,10,()=>BelfryRoom(2)); Stock(side.transform,"belfry-second-hearth-medicine",side.At(515,800),SupplyKind.Potion,1,()=>BelfryRoom(1)); // Supply remains outside the roof arena and outside its door-entry footprint. Stock(roof.transform,"belfry-roof-before-orvo",roof.AccessAt(600,898),SupplyKind.Potion,1,()=>BelfryRoom(2)); } } }