"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[614],{614:(e,o,t)=>{t.r(o),t.d(o,{default:()=>s});var i=t(96);const s={id:"underground_bunker",title:"Underground Military Bunker",type:"scene",async build(e,o,t){console.log("[UndergroundBunker] Building underground military bunker...");const s=new i.n(e,e.systems?.core||{});s.sceneBuilder=o,s.entityFactory=t,this.pressureLevel=100,this.oxygenLevel=100,this.startTime=null,s.createRoom("entrance_tunnel",{size:[25,4,12],lighting:"bunker",position:[0,0,0],buildFunction:n,objectives:[{id:"bunker_breach",name:"Bunker Infiltration",description:"Investigate abandoned military bunker",type:"simple",autoStart:!0,rewards:{experience:25}},{id:"find_access_codes",name:"Security Access Codes",description:"Locate blast door access codes",type:"simple",rewards:{experience:60,items:[{id:"blast_door_codes",quantity:1}]}}]}),s.createRoom("blast_door_chamber",{size:[16,6,20],lighting:"blast_chamber",position:[0,0,0],buildFunction:a,objectives:[{id:"unlock_blast_doors",name:"Blast Door Override",description:"Enter keypad combinations to unlock blast doors",type:"sequence",target:["keypad_alpha","keypad_beta","keypad_gamma","blast_door_release"],progress:0,rewards:{experience:100}}]}),s.createRoom("pressure_chamber",{size:[18,5,16],lighting:"pressure",position:[0,0,0],buildFunction:r,objectives:[{id:"equip_pressure_suit",name:"Pressure Equipment",description:"Acquire pressure suit and breathing apparatus",type:"counter",target:3,progress:0,rewards:{experience:80}},{id:"navigate_airlock",name:"Airlock Navigation",description:"Navigate sequential airlock system with timing",type:"sequence",target:["airlock_1","airlock_2","airlock_3"],progress:0,rewards:{experience:150,skillPoints:2}}]}),s.createRoom("command_vault",{size:[22,7,18],lighting:"command_vault",position:[0,0,0],buildFunction:c,objectives:[{id:"bunker_override",name:"Command Override",description:"Override bunker lockdown and restore systems",type:"sequence",target:["life_support","communication_array","defense_systems","emergency_protocols"],progress:0,rewards:{experience:250,skillPoints:5,items:[{id:"bunker_command_access",quantity:1}]}}]}),s.createDoor("entrance_tunnel","blast_door_chamber",{type:"keycard",item:"blast_door_codes"},{playerSpawnPosition:[0,0,8]}),s.createDoor("blast_door_chamber","pressure_chamber",{type:"objective",id:"unlock_blast_doors"},{playerSpawnPosition:[0,0,6]}),s.createDoor("pressure_chamber","command_vault",{type:"objective",id:"navigate_airlock"},{playerSpawnPosition:[0,0,7]});const l=await s.build(e,o,t);return l.multiRoom=s,l},onLoad(e,o){console.log("[UndergroundBunker] Bunker systems initializing - Environmental hazards detected");const t=e.root.findByTag("scene_root")[0];t&&t.multiRoom&&(t.multiRoom.onLoad(e,o),this.multiRoom=t.multiRoom,this.interactionHandler=t=>{this.handleBunkerInteraction(t,e,o)},this.multiRoom.setSceneInteractionHandler(this.interactionHandler),this.startTime=Date.now(),this.setupEnvironmentalSystems(e)),e.fire("ui:notification",{text:"BUNKER INFILTRATION: Environmental seals compromised - Pressure falling",type:"warning",duration:4e3})},setupEnvironmentalSystems(e){this.envInterval=setInterval(()=>{this.pressureLevel=Math.max(30,this.pressureLevel-1.5),this.oxygenLevel=Math.max(40,this.oxygenLevel-1),this.pressureLevel<=60&&e.fire("ui:notification",{text:`PRESSURE WARNING: ${this.pressureLevel}% - Seals failing`,type:"warning",duration:2e3})},8e3)},handleBunkerInteraction(e,o,t){console.log("[UndergroundBunker] Bunker interaction with:",e);const i=t.getSystem("objectivemanager");if("SecurityOffice"===e)i&&i.isObjectiveActive("bunker_breach")&&(i.completeObjective("bunker_breach"),i.startObjective("find_access_codes")),o.fire("ui:notification",{text:"ABANDONED: Security logs indicate emergency lockdown protocol activated",type:"info",duration:4e3});else if("CodeSafe"===e)i&&i.isObjectiveActive("find_access_codes")&&(this.multiRoom.addItem("blast_door_codes"),i.completeObjective("find_access_codes"),o.fire("ui:notification",{text:"Blast door access codes recovered - Heavy barriers can be unlocked",type:"success",duration:3e3}));else if(e.startsWith("Keypad_")){if("blast_door_chamber"===this.multiRoom.currentRoom&&i&&i.isObjectiveActive("unlock_blast_doors")){const t=e.split("_")[1],s={Alpha:"7734-DELTA",Beta:"2956-ECHO",Gamma:"1847-FOXTROT"};this.removeBlastDoor(t),o.fire("ui:notification",{text:`Keypad ${t} unlocked: ${s[t]}`,type:"success",duration:2500}),i.updateObjective("unlock_blast_doors",`keypad_${t.toLowerCase()}`)}}else if("BlastDoorRelease"===e){if("blast_door_chamber"===this.multiRoom.currentRoom&&i){const e=i.getObjective("unlock_blast_doors");e&&3===e.progress&&(this.removeBlastDoor("Master"),o.fire("ui:notification",{text:"BLAST DOORS UNSEALED: Pressure chamber access granted",type:"success",duration:4e3}),i.updateObjective("unlock_blast_doors","blast_door_release"))}}else if(["PressureSuit","BreathingApparatus","EnvironmentalScanner"].includes(e)){if("pressure_chamber"===this.multiRoom.currentRoom&&i&&i.isObjectiveActive("equip_pressure_suit")){const t={PressureSuit:"Environmental pressure suit",BreathingApparatus:"Oxygen breathing system",EnvironmentalScanner:"Atmospheric monitoring device"};o.fire("ui:notification",{text:`${t[e]} equipped`,type:"success",duration:2e3}),i.updateObjective("equip_pressure_suit"),i.getObjective("equip_pressure_suit").progress>=3&&i.startObjective("navigate_airlock")}}else if(e.startsWith("AirlockChamber_")){if("pressure_chamber"===this.multiRoom.currentRoom&&i&&i.isObjectiveActive("navigate_airlock")){const t=parseInt(e.split("_")[1]);this.activateAirlockSequence(t,o);const s=["airlock_1","airlock_2","airlock_3"];i.updateObjective("navigate_airlock",s[t-1])}}else if(["LifeSupportSystem","CommunicationArray","DefenseSystems","EmergencyProtocols"].includes(e)&&"command_vault"===this.multiRoom.currentRoom&&i&&i.isObjectiveActive("bunker_override")){const t={LifeSupportSystem:"life_support",CommunicationArray:"communication_array",DefenseSystems:"defense_systems",EmergencyProtocols:"emergency_protocols"}[e];o.fire("ui:notification",{text:`${t.replace("_"," ")} restored`,type:"success",duration:2e3}),i.updateObjective("bunker_override",t)}},removeBlastDoor(e){const o=this.app.root.findByName(`BlastDoor_${e}`);o&&(o.tween(o.getPosition()).to({x:o.getPosition().x,y:6,z:o.getPosition().z},2,pc.SineOut).start(),setTimeout(()=>{o.rigidbody&&(o.rigidbody.enabled=!1)},2e3))},activateAirlockSequence(e,o){o.fire("ui:notification",{text:`Airlock ${e} cycling - 10 seconds to pass through`,type:"warning",duration:2e3}),setTimeout(()=>{const o=this.app.root.findByName(`AirlockWall_${e}`);o&&o.rigidbody&&(o.rigidbody.enabled=!1)},1e3),setTimeout(()=>{const t=this.app.root.findByName(`AirlockWall_${e}`);t&&t.rigidbody&&(t.rigidbody.enabled=!0),o.fire("ui:notification",{text:`Airlock ${e} sealed`,type:"info",duration:1500})},1e4)},onUnload(e,o){console.log("[UndergroundBunker] Bunker systems shutting down..."),this.envInterval&&clearInterval(this.envInterval),this.multiRoom&&this.multiRoom.setSceneInteractionHandler(null),this.interactionHandler=null,this.multiRoom&&this.multiRoom.onUnload(e,o)}};async function n(e,o,t,i){console.log("[UndergroundBunker] Building entrance tunnel...");const s=t.create("SecurityOffice",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,1.5,1.5]},rigidbody:{type:"static"}},position:[-8,1.5,-4],scale:[4,3,3],tags:["interactive","office"]});if(s.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.3,.2),e.update(),s.model.meshInstances.forEach(o=>o.material=e)}e.addChild(s);const n=t.create("CodeSafe",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.8,1,.6]},rigidbody:{type:"static"}},position:[8,1,-3],scale:[1.6,2,1.2],tags:["interactive","safe"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.3,.3),e.metalness=.9,e.update(),n.model.meshInstances.forEach(o=>o.material=e)}i.addEntityToRoom(n,"entrance_tunnel"),[{name:"AbandonedDesk",pos:[-4,.5,0]},{name:"BrokenRadio",pos:[4,.8,2]},{name:"EmptyLockers",pos:[0,1.5,4]}].forEach(o=>{const i=t.create(o.name,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,1,1]}},position:o.pos,scale:[2,2,2],tags:["scenery"]});if(i.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.5,.4,.3),e.update(),i.model.meshInstances.forEach(o=>o.material=e)}e.addChild(i)});const a=t.createNPC("chief_anderson",{position:[-6,0,-2],displayName:"Chief Anderson (Recording)",dialogue:{greeting:"[AUDIO LOG] Day 1,247 of lockdown. Systems are failing. I'm sealing the blast doors.",topics:{codes:"Emergency codes are in the safe - Alpha, Beta, Gamma sequence required.",lockdown:"Pressure seals won't hold much longer. This place is becoming a tomb.",escape:"If anyone finds this... the airlock timing is critical. Don't get trapped."}}});i.addEntityToRoom(a,"entrance_tunnel"),[{pos:[0,3.5,0],color:new pc.Color(.8,.6,.4)},{pos:[-10,3.5,0],color:new pc.Color(.8,.6,.4)},{pos:[10,3.5,0],color:new pc.Color(.8,.6,.4)}].forEach((o,i)=>{const s=t.createLight("point",{color:o.color,intensity:1.5,range:8,position:o.pos});e.addChild(s)});const r=t.create("SpawnPoint",{position:[0,1,4],tags:["spawn"]});e.addChild(r)}async function a(e,o,t,i){console.log("[UndergroundBunker] Building blast door chamber with MECHANICAL BARRIERS..."),[{id:"Alpha",pos:[-6,1.5,-6],wallPos:[0,1.5,-8]},{id:"Beta",pos:[-3,1.5,-2],wallPos:[-6,1.5,-4]},{id:"Gamma",pos:[3,1.5,-2],wallPos:[6,1.5,-4]}].forEach(e=>{const o=t.create(`Keypad_${e.id}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.5,.8,.2]},rigidbody:{type:"static"}},position:e.pos,scale:[1,1.6,.4],tags:["interactive","keypad"]});if(o.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.2,.2),e.emissive=new pc.Color(.1,.3,.1),e.update(),o.model.meshInstances.forEach(o=>o.material=e)}i.addEntityToRoom(o,"blast_door_chamber");const s=t.create(`BlastDoor_${e.id}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,3,.5]},rigidbody:{type:"static"}},position:e.wallPos,scale:[4,6,1],tags:["blast_door","impassable"]});if(s.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.4,.4),e.metalness=.95,e.update(),s.model.meshInstances.forEach(o=>o.material=e)}i.addEntityToRoom(s,"blast_door_chamber")});const s=t.create("BlastDoorRelease",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:1,height:2},rigidbody:{type:"static"}},position:[0,1,4],scale:[2,2,2],tags:["interactive","release"]});if(s.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.6,.2,.2),e.emissive=new pc.Color(.3,.1,.1),e.update(),s.model.meshInstances.forEach(o=>o.material=e)}i.addEntityToRoom(s,"blast_door_chamber");const n=t.create("BlastDoor_Master",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[6,3,1]},rigidbody:{type:"static"}},position:[0,1.5,8],scale:[12,6,2],tags:["blast_door","impassable","master"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.3,.3),e.metalness=.98,e.update(),n.model.meshInstances.forEach(o=>o.material=e)}i.addEntityToRoom(n,"blast_door_chamber"),[{pos:[0,5.5,0],color:new pc.Color(.9,.9,.8)},{pos:[-6,4.5,0],color:new pc.Color(.9,.9,.8)},{pos:[6,4.5,0],color:new pc.Color(.9,.9,.8)}].forEach((o,i)=>{const s=t.createLight("point",{color:o.color,intensity:2,range:10,position:o.pos});e.addChild(s)})}async function r(e,o,t,i){console.log("[UndergroundBunker] Building pressure chamber with AIRLOCK BARRIERS..."),[t.create("PressureSuit",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,2,.5]},rigidbody:{type:"static"}},position:[-6,2,-6],scale:[2,4,1],tags:["interactive","equipment"]}),t.create("BreathingApparatus",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.6,height:1.5},rigidbody:{type:"static"}},position:[6,.75,-6],scale:[1.2,1.5,1.2],tags:["interactive","equipment"]}),t.create("EnvironmentalScanner",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.5,.3,.8]},rigidbody:{type:"static"}},position:[0,1,-6],scale:[1,.6,1.6],tags:["interactive","equipment"]})].forEach(e=>{if(e.model){const o=new pc.StandardMaterial;o.diffuse=new pc.Color(.2,.4,.6),o.metalness=.7,o.update(),e.model.meshInstances.forEach(e=>e.material=o)}i.addEntityToRoom(e,"pressure_chamber")}),[{id:1,pos:[-4,1.5,2],wallPos:[-4,1.5,4]},{id:2,pos:[0,1.5,2],wallPos:[0,1.5,4]},{id:3,pos:[4,1.5,2],wallPos:[4,1.5,4]}].forEach(e=>{const o=t.create(`AirlockChamber_${e.id}`,{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:1.5,height:3},rigidbody:{type:"static"}},position:e.pos,scale:[3,3,3],tags:["interactive","airlock"]});if(o.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.5,.3),e.emissive=new pc.Color(.1,.2,.1),e.update(),o.model.meshInstances.forEach(o=>o.material=e)}i.addEntityToRoom(o,"pressure_chamber");const s=t.create(`AirlockWall_${e.id}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,2.5,.3]},rigidbody:{type:"static"}},position:e.wallPos,scale:[2,5,.6],tags:["airlock_wall","timed_barrier"]});if(s.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.5,.5,.2),e.emissive=new pc.Color(.2,.2,.1),e.update(),s.model.meshInstances.forEach(o=>o.material=e)}i.addEntityToRoom(s,"pressure_chamber")}),[{pos:[0,4.5,0],color:new pc.Color(1,.9,.6)},{pos:[-6,4,0],color:new pc.Color(1,.9,.6)},{pos:[6,4,0],color:new pc.Color(1,.9,.6)}].forEach((o,i)=>{const s=t.createLight("point",{color:o.color,intensity:1.8,range:9,position:o.pos});e.addChild(s)})}async function c(e,o,t,i){console.log("[UndergroundBunker] Building command vault...");const s=t.create("LifeSupportSystem",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,2,1]},rigidbody:{type:"static"}},position:[-8,2,-6],scale:[4,4,2],tags:["interactive","system"]}),n=t.create("CommunicationArray",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:1.5,height:4},rigidbody:{type:"static"}},position:[8,2,-6],scale:[3,4,3],tags:["interactive","system"]}),a=t.create("DefenseSystems",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[3,1.5,2]},rigidbody:{type:"static"}},position:[-8,1.5,6],scale:[6,3,4],tags:["interactive","system"]}),r=t.create("EmergencyProtocols",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[4,3,1]},rigidbody:{type:"static"}},position:[8,3,6],scale:[8,6,2],tags:["interactive","system"]});[{obj:s,color:new pc.Color(.2,.6,.3)},{obj:n,color:new pc.Color(.6,.3,.2)},{obj:a,color:new pc.Color(.3,.2,.6)},{obj:r,color:new pc.Color(.6,.6,.2)}].forEach(e=>{if(e.obj.model){const o=new pc.StandardMaterial;o.diffuse=e.color,o.emissive=new pc.Color(.3*e.color.r,.3*e.color.g,.3*e.color.b),o.update(),e.obj.model.meshInstances.forEach(e=>e.material=o)}i.addEntityToRoom(e.obj,"command_vault")});const c=t.create("CommandConsole",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:2,height:1.5}},position:[0,.75,0],scale:[4,1.5,4],tags:["command"]});if(c.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.4,.5),e.metalness=.8,e.update(),c.model.meshInstances.forEach(o=>o.material=e)}e.addChild(c),[{pos:[0,6.5,0],color:new pc.Color(.9,.9,1)},{pos:[-8,5,0],color:new pc.Color(.9,.9,1)},{pos:[8,5,0],color:new pc.Color(.9,.9,1)}].forEach((o,i)=>{const s=t.createLight("point",{color:o.color,intensity:2.5,range:12,position:o.pos});e.addChild(s)})}}}]);