kwabs22
commited on
Commit
Β·
8dcf070
1
Parent(s):
c4a7e91
puzzle scene and label fix attempts
Browse files- 205.bundle.js +1 -1
- 260.bundle.js +1 -1
- 364.bundle.js +1 -1
- 386.bundle.js +1 -1
- 420.bundle.js +1 -1
- 433.bundle.js +1 -0
- 565.bundle.js +1 -0
- 614.bundle.js +1 -1
- 713.bundle.js +1 -1
- 942.bundle.js +1 -1
- 96.bundle.js +1 -1
- 99.bundle.js +1 -1
- assets/data/catalog.json +58 -0
- bundle.js +0 -0
205.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[205],{205:(e,t,i)=>{i.r(t),i.d(t,{default:()=>o});var a=i(96);const o={id:"medical_complex",title:"Medical Complex",type:"scene",async build(e,t,i){console.log("[MedicalComplex] Building medical complex...");const o=new a.n(e,e.systems?.core||{});o.sceneBuilder=t,o.entityFactory=i,o.createRoom("reception",{size:[15,3,12],lighting:"bright",position:[0,0,0],buildFunction:n,objectives:[{id:"reception_arrival",name:"Medical Complex Arrival",description:"Check in at the reception desk",type:"simple",autoStart:!0,rewards:{experience:20}},{id:"get_keycard",name:"Obtain Access Card",description:"Find the emergency keycard in the reception desk",type:"simple",rewards:{experience:30,items:[{id:"emergency_keycard",quantity:1}]}}]}),o.createRoom("emergency_ward",{size:[20,4,15],lighting:"clinical",position:[0,0,0],buildFunction:s,objectives:[{id:"assess_patients",name:"Patient Assessment",description:"Examine all patients in the emergency ward",type:"counter",target:6,progress:0,rewards:{experience:80},nextObjective:"collect_medical_data"},{id:"collect_medical_data",name:"Collect Medical Data",description:"Gather patient information for surgery prep",type:"simple",prerequisites:["assess_patients"],rewards:{experience:50,items:[{id:"patient_data",quantity:1}]}}]}),o.createRoom("surgery_suite",{size:[12,4,10],lighting:"surgical",position:[0,0,0],buildFunction:r,objectives:[{id:"prepare_surgery",name:"Surgical Preparation",description:"Set up surgical equipment and verify patient data",type:"simple",rewards:{experience:100}},{id:"complete_procedure",name:"Emergency Surgery",description:"Perform the life-saving surgical procedure",type:"simple",prerequisites:["prepare_surgery"],rewards:{experience:200,skillPoints:2,items:[{id:"surgical_certificate",quantity:1}]}}]}),o.createDoor("reception","emergency_ward",{type:"objective",id:"get_keycard"},{playerSpawnPosition:[0,0,6]}),o.createDoor("emergency_ward","surgery_suite",{type:"objective",id:"collect_medical_data"},{playerSpawnPosition:[0,0,4]}),o.createDoor("surgery_suite","reception",{type:"none"},{playerSpawnPosition:[0,0,5]});const c=await o.build(e,t,i);return c.multiRoom=o,c},onLoad(e,t){console.log("[MedicalComplex] Complex loaded");const i=e.root.findByTag("scene_root")[0];i&&i.multiRoom&&(i.multiRoom.onLoad(e,t),this.multiRoom=i.multiRoom,this.interactionHandler=i=>{this.handleComplexInteraction(i,e,t)},this.multiRoom.setSceneInteractionHandler(this.interactionHandler)),e.fire("ui:notification",{text:"Welcome to the Medical Complex - Multiple Emergency Situations Detected",type:"warning",duration:5e3})},handleComplexInteraction(e,t,i){console.log(`[MedicalComplex] Interaction with: ${e}`);const a=i.getSystem("objectivemanager");if("ReceptionDesk"===e){if(console.log("[MedicalComplex] Reception desk interaction - objManager:",!!a),a){const e=a.isObjectiveActive("reception_arrival");console.log("[MedicalComplex] reception_arrival active:",e),e&&(a.completeObjective("reception_arrival"),a.startObjective("get_keycard"),console.log("[MedicalComplex] Completed reception_arrival, started get_keycard"))}t.fire("ui:notification",{text:"Reception: Multiple critical patients need immediate attention!",type:"warning",duration:4e3})}else if("KeycardDrawer"===e)a&&a.isObjectiveActive("get_keycard")?(this.multiRoom.addItem("emergency_keycard"),a.completeObjective("get_keycard"),t.fire("ui:notification",{text:"Emergency keycard acquired - Access to emergency ward granted",type:"success",duration:3e3})):a&&a.isComplete("get_keycard")&&t.fire("ui:notification",{text:"Keycard already obtained - Focus on current medical objectives",type:"info",duration:2e3});else if(e.startsWith("Patient_")){if("emergency_ward"===this.multiRoom.currentRoom&&a&&a.isObjectiveActive("assess_patients")&&(this.assessedPatients||(this.assessedPatients=new Set),!this.assessedPatients.has(e))){this.assessedPatients.add(e);const i=e.split("_")[1],o=["Critical - requires immediate surgery","Stable - monitoring required","Minor injuries - treatment scheduled","Serious - needs specialist consultation","Emergency - prep for surgery","Recovering - post-op care needed"];t.fire("ui:notification",{text:`Patient ${parseInt(i)+1}: ${o[parseInt(i)]}`,type:"info",duration:3e3}),a.updateObjective("assess_patients",this.assessedPatients.size),console.log(`[MedicalComplex] Assessed patient ${e}, total: ${this.assessedPatients.size}/6`)}}else"MedicalWorkstation"===e?a&&a.isComplete("assess_patients")&&a.isObjectiveActive("collect_medical_data")?(a.completeObjective("collect_medical_data"),this.multiRoom.addItem("patient_data"),t.fire("ui:notification",{text:"Medical data compiled - Surgery suite access granted",type:"success",duration:3e3})):a&&a.isComplete("collect_medical_data")&&t.fire("ui:notification",{text:"Medical data already compiled",type:"info",duration:2e3}):"SurgicalTable"===e?"surgery_suite"===this.multiRoom.currentRoom&&a&&(a.isObjectiveActive("prepare_surgery")?(a.completeObjective("prepare_surgery"),a.startObjective("complete_procedure"),t.fire("ui:notification",{text:"Surgical table prepared - Beginning emergency procedure...",type:"info",duration:3e3})):a.isObjectiveActive("complete_procedure")?(a.completeObjective("complete_procedure"),t.fire("ui:notification",{text:"SURGERY SUCCESSFUL! Lives saved through expert medical intervention!",type:"success",duration:6e3}),setTimeout(()=>{t.fire("ui:notification",{text:"MEDICAL COMPLEX COMPLETED! All objectives achieved - Excellence in emergency medical response!",type:"success",duration:8e3})},3e3)):a&&a.isComplete("complete_procedure")&&t.fire("ui:notification",{text:"Emergency surgery completed successfully - All medical objectives achieved",type:"info",duration:3e3})):"receptionist_sara"===e?t.fire("ui:notification",{text:'Receptionist Sara: "Emergency keycard is in my desk drawer - help our medical team!"',type:"info",duration:4e3}):"doctor_martinez"===e?t.fire("ui:notification",{text:'Dr. Martinez: "Six critical patients need assessment. Check each bed carefully."',type:"info",duration:4e3}):"surgeon_chen"===e&&t.fire("ui:notification",{text:'Chief Surgeon Chen: "Prep the surgical table - we have a life to save!"',type:"info",duration:4e3})},onUnload(e,t){console.log("[MedicalComplex] Cleaning up complex..."),this.multiRoom&&this.multiRoom.setSceneInteractionHandler(null),this.interactionHandler=null,this.multiRoom&&this.multiRoom.onUnload(e,t)}};async function n(e,t,i,a){console.log("[MedicalComplex] Building reception room...");const o=i.create("ReceptionDesk",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,.5,1]},rigidbody:{type:"static"}},position:[0,.5,-4],scale:[4,1,2],tags:["interactive","reception"]});if(o.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.8,.9,1),e.update(),o.model.meshInstances.forEach(t=>t.material=e)}e.addChild(o);const n=i.create("KeycardDrawer",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.3,.2,.2]},rigidbody:{type:"static"}},position:[1.5,.8,-3.5],scale:[.6,.4,.4],tags:["interactive","drawer"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.7,.7,.7),e.emissive=new pc.Color(.1,.3,.1),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}a.sceneRoot.addChild(n);const s=i.createNPC("receptionist_sara",{position:[-1,0,-3],displayName:"Receptionist Sara",dialogue:{greeting:"Medical emergency! We need immediate assistance with multiple critical patients!",topics:{emergency:"Six patients arrived from a major accident. Ward access requires emergency keycard.",keycard:"Emergency keycard is in my desk drawer - take it and help our medical team!",patients:"Dr. Martinez is overwhelmed in the emergency ward. Please assist with patient assessment."}}});e.addChild(s),[[3,0,2],[3,0,0],[3,0,-2]].forEach((t,a)=>{const o=i.create(`Chair_${a}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.4,.4,.4]}},position:t,scale:[.8,.8,.8],tags:["furniture"]});if(o.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.5,.6,.8),e.update(),o.model.meshInstances.forEach(t=>t.material=e)}e.addChild(o)});const r=i.createLight("point",{color:new pc.Color(1,1,1),intensity:2,range:12,position:[0,2.5,0]});e.addChild(r)}async function s(e,t,i,a){console.log("[MedicalComplex] Building emergency ward..."),[[-7,.5,-5],[-7,.5,0],[-7,.5,5],[7,.5,-5],[7,.5,0],[7,.5,5]].forEach((e,t)=>{const o=i.create(`Patient_${t}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.2,.4,2]},rigidbody:{type:"static"}},position:e,scale:[2.4,.8,4],tags:["interactive","patient_bed"]});if(o.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.95,.95,.95),e.emissive=t<3?new pc.Color(.3,.1,.1):new pc.Color(.1,.3,.1),e.emissiveIntensity=.2,e.update(),o.model.meshInstances.forEach(t=>t.material=e)}a.sceneRoot.addChild(o)});const o=i.create("MedicalWorkstation",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.5,1,.5]},rigidbody:{type:"static"}},position:[0,1,6],scale:[3,2,1],tags:["interactive","workstation"]});if(o.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.5,.8),e.emissive=new pc.Color(.1,.2,.3),e.update(),o.model.meshInstances.forEach(t=>t.material=e)}a.sceneRoot.addChild(o);const n=i.createNPC("doctor_martinez",{position:[0,0,3],displayName:"Dr. Martinez",dialogue:{greeting:"Thank you for coming! We have a mass casualty situation here.",topics:{patients:"Six patients, varying conditions. I need you to assess each one systematically.",priority:"Check the beds - some patients need immediate surgery, others can wait.",data:"Once you've assessed everyone, compile the data at the workstation."}}});e.addChild(n),[{pos:[-5,3,0],color:new pc.Color(1,1,1)},{pos:[5,3,0],color:new pc.Color(1,1,1)},{pos:[0,3,6],color:new pc.Color(.9,.9,1)}].forEach((t,a)=>{const o=i.createLight("point",{color:t.color,intensity:1.5,range:8,position:t.pos});e.addChild(o)})}async function r(e,t,i,a){console.log("[MedicalComplex] Building surgery suite...");const o=i.create("SurgicalTable",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,.5,2]},rigidbody:{type:"static"}},position:[0,.5,0],scale:[2,1,4],tags:["interactive","surgical_table"]});if(o.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.9,.9,.9),e.metalness=.8,e.update(),o.model.meshInstances.forEach(t=>t.material=e)}a.sceneRoot.addChild(o),[[-3,0,-2],[3,0,-2],[-3,0,2],[3,0,2]].forEach((t,a)=>{const o=i.create(`SurgicalEquipment_${a}`,{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.3,height:1.5}},position:t,scale:[.6,1.5,.6],tags:["medical_equipment"]});if(o.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.8,.8,.8),e.metalness=.9,e.update(),o.model.meshInstances.forEach(t=>t.material=e)}e.addChild(o)});const n=i.createLight("spot",{color:new pc.Color(1,1,1),intensity:3,range:8,innerConeAngle:20,outerConeAngle:30,position:[0,3.5,0],rotation:[90,0,0]});e.addChild(n);const s=i.createNPC("surgeon_chen",{position:[-2,0,0],displayName:"Chief Surgeon Chen",dialogue:{greeting:"Excellent timing! We have a critical patient requiring immediate surgery.",topics:{procedure:"Life-threatening internal injuries. Prep the table and verify patient data.",equipment:"All surgical instruments are sterile and ready. Let's save a life.",success:"Outstanding work! Your quick response saved multiple lives today."}}});e.addChild(s)}}}]);
|
|
|
|
| 1 |
+
"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[205],{205:(e,t,i)=>{i.r(t),i.d(t,{default:()=>o});var a=i(96);const o={id:"medical_complex",title:"Medical Complex",type:"scene",async build(e,t,i){console.log("[MedicalComplex] Building medical complex...");const o=new a.n(e,e.systems?.core||{});o.sceneBuilder=t,o.entityFactory=i,o.createRoom("reception",{size:[15,3,12],lighting:"bright",position:[0,0,0],buildFunction:n,objectives:[{id:"reception_arrival",name:"Medical Complex Arrival",description:"Check in at the reception desk",type:"simple",autoStart:!0,rewards:{experience:20}},{id:"get_keycard",name:"Obtain Access Card",description:"Find the emergency keycard in the reception desk",type:"simple",rewards:{experience:30,items:[{id:"emergency_keycard",quantity:1}]}}]}),o.createRoom("emergency_ward",{size:[20,4,15],lighting:"clinical",position:[0,0,0],buildFunction:s,objectives:[{id:"assess_patients",name:"Patient Assessment",description:"Examine all patients in the emergency ward",type:"counter",target:6,progress:0,rewards:{experience:80},nextObjective:"collect_medical_data"},{id:"collect_medical_data",name:"Collect Medical Data",description:"Gather patient information for surgery prep",type:"simple",prerequisites:["assess_patients"],rewards:{experience:50,items:[{id:"patient_data",quantity:1}]}}]}),o.createRoom("surgery_suite",{size:[12,4,10],lighting:"surgical",position:[0,0,0],buildFunction:r,objectives:[{id:"prepare_surgery",name:"Surgical Preparation",description:"Set up surgical equipment and verify patient data",type:"simple",rewards:{experience:100}},{id:"complete_procedure",name:"Emergency Surgery",description:"Perform the life-saving surgical procedure",type:"simple",prerequisites:["prepare_surgery"],rewards:{experience:200,skillPoints:2,items:[{id:"surgical_certificate",quantity:1}]}}]}),o.createDoor("reception","emergency_ward",{type:"objective",id:"get_keycard"},{playerSpawnPosition:[0,0,6]}),o.createDoor("emergency_ward","surgery_suite",{type:"objective",id:"collect_medical_data"},{playerSpawnPosition:[0,0,4]}),o.createDoor("surgery_suite","reception",{type:"none"},{playerSpawnPosition:[0,0,5]});const c=await o.build(e,t,i);return c.multiRoom=o,c},onLoad(e,t){console.log("[MedicalComplex] Complex loaded");const i=e.root.findByTag("scene_root")[0];i&&i.multiRoom&&(i.multiRoom.onLoad(e,t),this.multiRoom=i.multiRoom,this.interactionHandler=i=>{this.handleComplexInteraction(i,e,t)},this.multiRoom.setSceneInteractionHandler(this.interactionHandler)),e.fire("ui:notification",{text:"Welcome to the Medical Complex - Multiple Emergency Situations Detected",type:"warning",duration:5e3})},handleComplexInteraction(e,t,i){console.log(`[MedicalComplex] Interaction with: ${e}`);const a=i.getSystem("objectivemanager");if("ReceptionDesk"===e){if(console.log("[MedicalComplex] Reception desk interaction - objManager:",!!a),a){const e=a.isObjectiveActive("reception_arrival");console.log("[MedicalComplex] reception_arrival active:",e),e&&(a.completeObjective("reception_arrival"),a.startObjective("get_keycard"),console.log("[MedicalComplex] Completed reception_arrival, started get_keycard"))}t.fire("ui:notification",{text:"Reception: Multiple critical patients need immediate attention!",type:"warning",duration:4e3})}else if("KeycardDrawer"===e)a&&a.isObjectiveActive("get_keycard")?(this.multiRoom.addItem("emergency_keycard"),a.completeObjective("get_keycard"),t.fire("ui:notification",{text:"Emergency keycard acquired - Access to emergency ward granted",type:"success",duration:3e3})):a&&a.isComplete("get_keycard")&&t.fire("ui:notification",{text:"Keycard already obtained - Focus on current medical objectives",type:"info",duration:2e3});else if(e.startsWith("Patient_")){if("emergency_ward"===this.multiRoom.currentRoom&&a&&a.isObjectiveActive("assess_patients")&&(this.assessedPatients||(this.assessedPatients=new Set),!this.assessedPatients.has(e))){this.assessedPatients.add(e);const i=e.split("_")[1],o=["Critical - requires immediate surgery","Stable - monitoring required","Minor injuries - treatment scheduled","Serious - needs specialist consultation","Emergency - prep for surgery","Recovering - post-op care needed"];t.fire("ui:notification",{text:`Patient ${parseInt(i)+1}: ${o[parseInt(i)]}`,type:"info",duration:3e3}),a.updateObjective("assess_patients",this.assessedPatients.size),console.log(`[MedicalComplex] Assessed patient ${e}, total: ${this.assessedPatients.size}/6`)}}else"MedicalWorkstation"===e?a&&a.isComplete("assess_patients")&&a.isObjectiveActive("collect_medical_data")?(a.completeObjective("collect_medical_data"),this.multiRoom.addItem("patient_data"),t.fire("ui:notification",{text:"Medical data compiled - Surgery suite access granted",type:"success",duration:3e3})):a&&a.isComplete("collect_medical_data")&&t.fire("ui:notification",{text:"Medical data already compiled",type:"info",duration:2e3}):"SurgicalTable"===e?"surgery_suite"===this.multiRoom.currentRoom&&a&&(a.isObjectiveActive("prepare_surgery")?(a.completeObjective("prepare_surgery"),a.startObjective("complete_procedure"),t.fire("ui:notification",{text:"Surgical table prepared - Beginning emergency procedure...",type:"info",duration:3e3})):a.isObjectiveActive("complete_procedure")?(a.completeObjective("complete_procedure"),t.fire("ui:notification",{text:"SURGERY SUCCESSFUL! Lives saved through expert medical intervention!",type:"success",duration:6e3}),setTimeout(()=>{t.fire("ui:notification",{text:"MEDICAL COMPLEX COMPLETED! All objectives achieved - Excellence in emergency medical response!",type:"success",duration:8e3})},3e3)):a&&a.isComplete("complete_procedure")&&t.fire("ui:notification",{text:"Emergency surgery completed successfully - All medical objectives achieved",type:"info",duration:3e3})):"receptionist_sara"===e?t.fire("ui:notification",{text:'Receptionist Sara: "Emergency keycard is in my desk drawer - help our medical team!"',type:"info",duration:4e3}):"doctor_martinez"===e?t.fire("ui:notification",{text:'Dr. Martinez: "Six critical patients need assessment. Check each bed carefully."',type:"info",duration:4e3}):"surgeon_chen"===e&&t.fire("ui:notification",{text:'Chief Surgeon Chen: "Prep the surgical table - we have a life to save!"',type:"info",duration:4e3})},onUnload(e,t){console.log("[MedicalComplex] Cleaning up complex..."),this.multiRoom&&this.multiRoom.setSceneInteractionHandler(null),this.interactionHandler=null,this.multiRoom&&this.multiRoom.onUnload(e,t)}};async function n(e,t,i,a){console.log("[MedicalComplex] Building reception room...");const o=i.create("ReceptionDesk",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,.5,1]},rigidbody:{type:"static"}},position:[0,.5,-4],scale:[4,1,2],tags:["interactive","reception"]});if(o.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.8,.9,1),e.update(),o.model.meshInstances.forEach(t=>t.material=e)}e.addChild(o);const n=i.create("KeycardDrawer",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.3,.2,.2]},rigidbody:{type:"static"}},position:[1.5,.8,-3.5],scale:[.6,.4,.4],tags:["interactive","drawer"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.7,.7,.7),e.emissive=new pc.Color(.1,.3,.1),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}a.addEntityToRoom(n,"reception");const s=i.createNPC("receptionist_sara",{position:[-1,0,-3],displayName:"Receptionist Sara",dialogue:{greeting:"Medical emergency! We need immediate assistance with multiple critical patients!",topics:{emergency:"Six patients arrived from a major accident. Ward access requires emergency keycard.",keycard:"Emergency keycard is in my desk drawer - take it and help our medical team!",patients:"Dr. Martinez is overwhelmed in the emergency ward. Please assist with patient assessment."}}});e.addChild(s),[[3,0,2],[3,0,0],[3,0,-2]].forEach((t,a)=>{const o=i.create(`Chair_${a}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.4,.4,.4]}},position:t,scale:[.8,.8,.8],tags:["furniture"]});if(o.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.5,.6,.8),e.update(),o.model.meshInstances.forEach(t=>t.material=e)}e.addChild(o)});const r=i.createLight("point",{color:new pc.Color(1,1,1),intensity:2,range:12,position:[0,2.5,0]});e.addChild(r)}async function s(e,t,i,a){console.log("[MedicalComplex] Building emergency ward..."),[[-7,.5,-5],[-7,.5,0],[-7,.5,5],[7,.5,-5],[7,.5,0],[7,.5,5]].forEach((e,t)=>{const o=i.create(`Patient_${t}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.2,.4,2]},rigidbody:{type:"static"}},position:e,scale:[2.4,.8,4],tags:["interactive","patient_bed"]});if(o.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.95,.95,.95),e.emissive=t<3?new pc.Color(.3,.1,.1):new pc.Color(.1,.3,.1),e.emissiveIntensity=.2,e.update(),o.model.meshInstances.forEach(t=>t.material=e)}a.addEntityToRoom(o,"emergency_ward")});const o=i.create("MedicalWorkstation",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.5,1,.5]},rigidbody:{type:"static"}},position:[0,1,6],scale:[3,2,1],tags:["interactive","workstation"]});if(o.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.5,.8),e.emissive=new pc.Color(.1,.2,.3),e.update(),o.model.meshInstances.forEach(t=>t.material=e)}a.addEntityToRoom(o,"emergency_ward");const n=i.createNPC("doctor_martinez",{position:[0,0,3],displayName:"Dr. Martinez",dialogue:{greeting:"Thank you for coming! We have a mass casualty situation here.",topics:{patients:"Six patients, varying conditions. I need you to assess each one systematically.",priority:"Check the beds - some patients need immediate surgery, others can wait.",data:"Once you've assessed everyone, compile the data at the workstation."}}});e.addChild(n),[{pos:[-5,3,0],color:new pc.Color(1,1,1)},{pos:[5,3,0],color:new pc.Color(1,1,1)},{pos:[0,3,6],color:new pc.Color(.9,.9,1)}].forEach((t,a)=>{const o=i.createLight("point",{color:t.color,intensity:1.5,range:8,position:t.pos});e.addChild(o)})}async function r(e,t,i,a){console.log("[MedicalComplex] Building surgery suite...");const o=i.create("SurgicalTable",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,.5,2]},rigidbody:{type:"static"}},position:[0,.5,0],scale:[2,1,4],tags:["interactive","surgical_table"]});if(o.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.9,.9,.9),e.metalness=.8,e.update(),o.model.meshInstances.forEach(t=>t.material=e)}a.addEntityToRoom(o,"surgery_suite"),[[-3,0,-2],[3,0,-2],[-3,0,2],[3,0,2]].forEach((t,a)=>{const o=i.create(`SurgicalEquipment_${a}`,{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.3,height:1.5}},position:t,scale:[.6,1.5,.6],tags:["medical_equipment"]});if(o.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.8,.8,.8),e.metalness=.9,e.update(),o.model.meshInstances.forEach(t=>t.material=e)}e.addChild(o)});const n=i.createLight("spot",{color:new pc.Color(1,1,1),intensity:3,range:8,innerConeAngle:20,outerConeAngle:30,position:[0,3.5,0],rotation:[90,0,0]});e.addChild(n);const s=i.createNPC("surgeon_chen",{position:[-2,0,0],displayName:"Chief Surgeon Chen",dialogue:{greeting:"Excellent timing! We have a critical patient requiring immediate surgery.",topics:{procedure:"Life-threatening internal injuries. Prep the table and verify patient data.",equipment:"All surgical instruments are sterile and ready. Let's save a life.",success:"Outstanding work! Your quick response saved multiple lives today."}}});e.addChild(s)}}}]);
|
260.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[260],{260:(e,t,i)=>{i.r(t),i.d(t,{default:()=>n});var o=i(96);const n={id:"research_facility",title:"Research Facility",type:"scene",async build(e,t,i){console.log("[ResearchFacility] Building research facility...");const n=new o.n(e,e.systems?.core||{});n.sceneBuilder=t,n.entityFactory=i,this.contaminationTimer=6e5,this.startTime=null,n.createRoom("decontamination",{size:[14,4,10],lighting:"clinical",position:[0,0,0],buildFunction:a,objectives:[{id:"facility_breach",name:"Containment Breach",description:"Respond to biological containment failure",type:"simple",autoStart:!0,rewards:{experience:25}},{id:"get_lab_access",name:"Laboratory Access",description:"Obtain research lab keycard from emergency locker",type:"simple",rewards:{experience:40,items:[{id:"research_keycard",quantity:1}]}}]}),n.createRoom("main_laboratory",{size:[25,5,20],lighting:"research",position:[0,0,0],buildFunction:c,objectives:[{id:"specimen_analysis",name:"Specimen Analysis",description:"Analyze all contaminated specimen containers",type:"counter",target:8,progress:0,rewards:{experience:80},nextObjective:"synthesize_antidote"},{id:"synthesize_antidote",name:"Emergency Antidote",description:"Create antidote using research equipment",type:"simple",prerequisites:["specimen_analysis"],rewards:{experience:100,skillPoints:2,items:[{id:"antidote_sample",quantity:1}]}}]}),n.createRoom("containment_vault",{size:[18,6,15],lighting:"emergency",position:[0,0,0],buildFunction:s,objectives:[{id:"secure_outbreak",name:"Outbreak Containment",description:"Activate emergency containment protocol",type:"sequence",target:["bio_scanner","containment_field","emergency_seal"],progress:0,rewards:{experience:150,skillPoints:3}}]}),n.createRoom("data_archive",{size:[16,4,12],lighting:"archive",position:[0,0,0],buildFunction:r,objectives:[{id:"data_recovery",name:"Critical Data Recovery",description:"Download research data before facility lockdown",type:"simple",rewards:{experience:120,skillPoints:2,items:[{id:"research_data",quantity:1}]}}]}),n.createDoor("decontamination","main_laboratory",{type:"keycard",item:"research_keycard"},{playerSpawnPosition:[-10,0,0]}),n.createDoor("main_laboratory","containment_vault",{type:"objective",id:"specimen_analysis"},{playerSpawnPosition:[0,0,6]}),n.createDoor("main_laboratory","data_archive",{type:"objective",id:"synthesize_antidote"},{playerSpawnPosition:[6,0,0]});const l=await n.build(e,t,i);return l.multiRoom=n,l},onLoad(e,t){console.log("[ResearchFacility] Containment breach protocols active");const i=e.root.findByTag("scene_root")[0];i&&i.multiRoom&&(i.multiRoom.onLoad(e,t),this.multiRoom=i.multiRoom,this.analyzedSpecimens=new Set,this.startTime=Date.now(),this.setupContaminationTimer(e),this.interactionHandler=i=>{this.handleResearchInteraction(i,e,t)},this.multiRoom.setSceneInteractionHandler(this.interactionHandler)),e.fire("ui:notification",{text:"BIOHAZARD ALERT: Containment failure - Decontamination protocols active",type:"error",duration:5e3})},setupContaminationTimer(e){this.timerInterval=setInterval(()=>{if(!this.startTime)return;const t=Date.now()-this.startTime,i=Math.max(0,this.contaminationTimer-t),o=Math.floor(i/6e4),n=Math.floor(i%6e4/1e3);i>0?e.fire("ui:notification",{text:`Containment Timer: ${o}:${n.toString().padStart(2,"0")} until facility lockdown`,type:"warning",duration:1e3}):this.onContaminationSpread(e)},15e3)},onContaminationSpread(e){clearInterval(this.timerInterval),e.fire("ui:notification",{text:"FACILITY LOCKDOWN: Contamination has spread beyond containment!",type:"error",duration:8e3})},handleResearchInteraction(e,t,i){console.log("[ResearchFacility] Interaction triggered with:",e);const o=i.getSystem("objectivemanager");if("EmergencyAlert"===e)o&&o.isObjectiveActive("facility_breach")&&(o.completeObjective("facility_breach"),o.startObjective("get_lab_access")),t.fire("ui:notification",{text:"BREACH CONFIRMED: Multiple containment failures in Research Wing",type:"error",duration:4e3});else if("KeycardLocker"===e)o&&o.isObjectiveActive("get_lab_access")&&(this.multiRoom.addItem("research_keycard"),o.completeObjective("get_lab_access"),t.fire("ui:notification",{text:"Research keycard obtained - Laboratory access granted",type:"success",duration:3e3}));else if(e.startsWith("Specimen_")){if("main_laboratory"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("specimen_analysis")){const i=parseInt(e.split("_")[1]);if(!this.analyzedSpecimens.has(e)){this.analyzedSpecimens.add(e);const n=["Class-A pathogen detected","Viral mutation identified","Cellular breakdown observed","Toxic compound isolated","Bacterial resistance confirmed","Enzyme inhibition noted","DNA corruption detected","Critical pathogen strain found"];t.fire("ui:notification",{text:`Analysis ${i+1}: ${n[i]}`,type:"warning",duration:3e3}),o.updateObjective("specimen_analysis",this.analyzedSpecimens.size),console.log(`[ResearchFacility] Analyzed specimen ${e}, total: ${this.analyzedSpecimens.size}/8`)}}}else if("SynthesisEquipment"===e)o&&o.isComplete("specimen_analysis")&&o.isObjectiveActive("synthesize_antidote")?(this.multiRoom.addItem("antidote_sample"),o.completeObjective("synthesize_antidote"),t.fire("ui:notification",{text:"ANTIDOTE SYNTHESIZED: Emergency treatment ready for deployment",type:"success",duration:4e3})):o&&o.isComplete("synthesize_antidote")&&t.fire("ui:notification",{text:"Antidote already synthesized - Focus on containment protocols",type:"info",duration:2e3});else if(["BioScanner","ContainmentField","EmergencySeal"].includes(e)){if("containment_vault"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("secure_outbreak")){const i={BioScanner:"bio_scanner",ContainmentField:"containment_field",EmergencySeal:"emergency_seal"}[e];t.fire("ui:notification",{text:`${i.replace("_"," ")} activated`,type:"info",duration:2e3}),o.updateObjective("secure_outbreak",i)}}else"DataTerminal"===e&&"data_archive"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("data_recovery")&&(this.multiRoom.addItem("research_data"),o.completeObjective("data_recovery"),t.fire("ui:notification",{text:"Critical research data downloaded - Facility knowledge preserved",type:"success",duration:4e3}))},onUnload(e,t){console.log("[ResearchFacility] Decontamination sequence initiated..."),this.timerInterval&&clearInterval(this.timerInterval),this.multiRoom&&this.multiRoom.setSceneInteractionHandler(null),this.interactionHandler=null,this.multiRoom&&this.multiRoom.onUnload(e,t)}};async function a(e,t,i,o){console.log("[ResearchFacility] Building decontamination chamber...");const n=i.create("EmergencyAlert",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,1,.2]},rigidbody:{type:"static"}},position:[0,2,-4],scale:[2,2,.4],tags:["interactive","alert"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.8,.2,.2),e.emissive=new pc.Color(.4,.1,.1),e.emissiveIntensity=.8,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n);const a=i.create("KeycardLocker",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.4,.8,.3]},rigidbody:{type:"static"}},position:[4,1.5,-3],scale:[.8,1.6,.6],tags:["interactive","locker"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.4,.6),e.emissive=new pc.Color(.1,.2,.3),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(a),[[-3,1.5,0],[0,1.5,0],[3,1.5,0]].forEach((t,o)=>{const n=i.create(`DeconShower_${o}`,{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.5,height:3}},position:t,scale:[1,3,1],tags:["decon_equipment"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.8,.8,.9),e.metalness=.7,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n)});const c=i.createNPC("safety_officer_chen",{position:[-2,0,-2],displayName:"Safety Officer Chen",dialogue:{greeting:"Emergency protocols are in effect! We have a major containment breach in the research wing.",topics:{breach:"Multiple specimens have been compromised - this could be catastrophic.",keycard:"Emergency access codes are in the wall locker - you'll need them for the lab.",timer:"We have limited time before the contamination spreads beyond containment."}}});o.sceneRoot.addChild(c),[{pos:[0,3.5,0],color:new pc.Color(.9,.9,1)},{pos:[-3,3.5,0],color:new pc.Color(.9,.9,1)},{pos:[3,3.5,0],color:new pc.Color(.9,.9,1)}].forEach((t,o)=>{const n=i.createLight("point",{color:t.color,intensity:2,range:8,position:t.pos});e.addChild(n)})}async function c(e,t,i,o){console.log("[ResearchFacility] Building main laboratory..."),[[-10,1,-8],[-4,1,-8],[4,1,-8],[10,1,-8],[-10,1,8],[-4,1,8],[4,1,8],[10,1,8]].forEach((e,t)=>{const n=i.create(`Specimen_${t}`,{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.6,height:1.5},rigidbody:{type:"static"}},position:e,scale:[1.2,1.5,1.2],tags:["interactive","specimen"]});if(n.model){const e=new pc.StandardMaterial,i=t%2==0;e.diffuse=i?new pc.Color(.6,.8,.2):new pc.Color(.2,.6,.8),e.emissive=i?new pc.Color(.2,.3,.05):new pc.Color(.05,.2,.3),e.emissiveIntensity=.4,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(n)});const n=i.create("SynthesisEquipment",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,1.5,1.5]},rigidbody:{type:"static"}},position:[0,1.5,0],scale:[4,3,3],tags:["interactive","equipment"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.4,.5),e.emissive=new pc.Color(.1,.3,.4),e.metalness=.6,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(n),[[-8,.5,-4],[8,.5,-4],[-8,.5,4],[8,.5,4]].forEach((t,o)=>{const n=i.create(`ResearchBench_${o}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[3,.5,1]}},position:t,scale:[6,1,2],tags:["equipment"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.7,.7,.8),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n)});const a=i.createNPC("dr_martinez",{position:[6,0,0],displayName:"Dr. Martinez",dialogue:{greeting:"Thank goodness you're here! The specimens are showing unprecedented mutation rates.",topics:{analysis:"We need to analyze every contaminated specimen to understand the pathogen.",antidote:"Once we have the full analysis, we can synthesize a broad-spectrum antidote.",containment:"The vault systems are failing - we need that antidote before total containment loss."}}});o.sceneRoot.addChild(a),[{pos:[0,4.5,0],color:new pc.Color(.9,.95,1)},{pos:[-8,4.5,0],color:new pc.Color(.9,.95,1)},{pos:[8,4.5,0],color:new pc.Color(.9,.95,1)}].forEach((t,o)=>{const n=i.createLight("point",{color:t.color,intensity:2.2,range:12,position:t.pos});e.addChild(n)})}async function s(e,t,i,o){console.log("[ResearchFacility] Building containment vault...");const n=i.create("BioScanner",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.8,height:2},rigidbody:{type:"static"}},position:[-6,1,-4],scale:[1.6,2,1.6],tags:["interactive","scanner"]}),a=i.create("ContainmentField",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,2,.5]},rigidbody:{type:"static"}},position:[0,2,-4],scale:[2,4,1],tags:["interactive","field_generator"]}),c=i.create("EmergencySeal",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.5,1,.3]},rigidbody:{type:"static"}},position:[6,1,-4],scale:[3,2,.6],tags:["interactive","seal_control"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.7,.3),e.emissive=new pc.Color(.1,.3,.15),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.3,.8),e.emissive=new pc.Color(.15,.15,.4),e.emissiveIntensity=.6,e.update(),a.model.meshInstances.forEach(t=>t.material=e)}if(c.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.8,.3,.2),e.emissive=new pc.Color(.4,.15,.1),e.update(),c.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(n),o.sceneRoot.addChild(a),o.sceneRoot.addChild(c),[[-6,1.5,4],[-2,1.5,4],[2,1.5,4],[6,1.5,4]].forEach((t,o)=>{const n=i.create(`ContainmentCell_${o}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.5,1.5,1.5]}},position:t,scale:[3,3,3],tags:["containment"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.4,.4),e.emissive=new pc.Color(.2,.1,.1),e.emissiveIntensity=.3,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n)}),[{pos:[0,5.5,0],color:new pc.Color(1,.4,.4)},{pos:[-6,4.5,0],color:new pc.Color(1,.4,.4)},{pos:[6,4.5,0],color:new pc.Color(1,.4,.4)}].forEach((t,o)=>{const n=i.createLight("point",{color:t.color,intensity:1.8,range:10,position:t.pos});e.addChild(n)})}async function r(e,t,i,o){console.log("[ResearchFacility] Building data archive...");const n=i.create("DataTerminal",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,1.5,1]},rigidbody:{type:"static"}},position:[0,1.5,-4],scale:[4,3,2],tags:["interactive","terminal"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.3,.4),e.emissive=new pc.Color(.1,.2,.3),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(n),[[-6,1.5,0],[6,1.5,0],[-6,1.5,4],[6,1.5,4]].forEach((t,o)=>{const n=i.create(`ServerRack_${o}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,1.5,.5]}},position:t,scale:[2,3,1],tags:["server"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.15,.15,.15),e.emissive=new pc.Color(.05,.15,.1),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n)});const a=i.createLight("point",{color:new pc.Color(.6,.8,1),intensity:1.5,range:12,position:[0,3.5,0]});e.addChild(a)}}}]);
|
|
|
|
| 1 |
+
"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[260],{260:(e,t,i)=>{i.r(t),i.d(t,{default:()=>n});var o=i(96);const n={id:"research_facility",title:"Research Facility",type:"scene",async build(e,t,i){console.log("[ResearchFacility] Building research facility...");const n=new o.n(e,e.systems?.core||{});n.sceneBuilder=t,n.entityFactory=i,this.contaminationTimer=6e5,this.startTime=null,n.createRoom("decontamination",{size:[14,4,10],lighting:"clinical",position:[0,0,0],buildFunction:a,objectives:[{id:"facility_breach",name:"Containment Breach",description:"Respond to biological containment failure",type:"simple",autoStart:!0,rewards:{experience:25}},{id:"get_lab_access",name:"Laboratory Access",description:"Obtain research lab keycard from emergency locker",type:"simple",rewards:{experience:40,items:[{id:"research_keycard",quantity:1}]}}]}),n.createRoom("main_laboratory",{size:[25,5,20],lighting:"research",position:[0,0,0],buildFunction:c,objectives:[{id:"specimen_analysis",name:"Specimen Analysis",description:"Analyze all contaminated specimen containers",type:"counter",target:8,progress:0,rewards:{experience:80},nextObjective:"synthesize_antidote"},{id:"synthesize_antidote",name:"Emergency Antidote",description:"Create antidote using research equipment",type:"simple",prerequisites:["specimen_analysis"],rewards:{experience:100,skillPoints:2,items:[{id:"antidote_sample",quantity:1}]}}]}),n.createRoom("containment_vault",{size:[18,6,15],lighting:"emergency",position:[0,0,0],buildFunction:s,objectives:[{id:"secure_outbreak",name:"Outbreak Containment",description:"Activate emergency containment protocol",type:"sequence",target:["bio_scanner","containment_field","emergency_seal"],progress:0,rewards:{experience:150,skillPoints:3}}]}),n.createRoom("data_archive",{size:[16,4,12],lighting:"archive",position:[0,0,0],buildFunction:r,objectives:[{id:"data_recovery",name:"Critical Data Recovery",description:"Download research data before facility lockdown",type:"simple",rewards:{experience:120,skillPoints:2,items:[{id:"research_data",quantity:1}]}}]}),n.createDoor("decontamination","main_laboratory",{type:"keycard",item:"research_keycard"},{playerSpawnPosition:[-10,0,0]}),n.createDoor("main_laboratory","containment_vault",{type:"objective",id:"specimen_analysis"},{playerSpawnPosition:[0,0,6]}),n.createDoor("main_laboratory","data_archive",{type:"objective",id:"synthesize_antidote"},{playerSpawnPosition:[6,0,0]}),n.createDoor("containment_vault","data_archive",{type:"objective",id:"secure_outbreak"},{playerSpawnPosition:[0,0,-6]});const l=await n.build(e,t,i);return l.multiRoom=n,l},onLoad(e,t){console.log("[ResearchFacility] Containment breach protocols active");const i=e.root.findByTag("scene_root")[0];i&&i.multiRoom&&(i.multiRoom.onLoad(e,t),this.multiRoom=i.multiRoom,this.analyzedSpecimens=new Set,this.startTime=Date.now(),this.setupContaminationTimer(e),this.interactionHandler=i=>{this.handleResearchInteraction(i,e,t)},this.multiRoom.setSceneInteractionHandler(this.interactionHandler)),e.fire("ui:notification",{text:"BIOHAZARD ALERT: Containment failure - Decontamination protocols active",type:"error",duration:5e3})},setupContaminationTimer(e){this.timerInterval=setInterval(()=>{if(!this.startTime)return;const t=Date.now()-this.startTime,i=Math.max(0,this.contaminationTimer-t),o=Math.floor(i/6e4),n=Math.floor(i%6e4/1e3);i>0?e.fire("ui:notification",{text:`Containment Timer: ${o}:${n.toString().padStart(2,"0")} until facility lockdown`,type:"warning",duration:1e3}):this.onContaminationSpread(e)},15e3)},onContaminationSpread(e){clearInterval(this.timerInterval),e.fire("ui:notification",{text:"FACILITY LOCKDOWN: Contamination has spread beyond containment!",type:"error",duration:8e3})},handleResearchInteraction(e,t,i){console.log("[ResearchFacility] Interaction triggered with:",e);const o=i.getSystem("objectivemanager");if("EmergencyAlert"===e)o&&o.isObjectiveActive("facility_breach")&&(o.completeObjective("facility_breach"),o.startObjective("get_lab_access")),t.fire("ui:notification",{text:"BREACH CONFIRMED: Multiple containment failures in Research Wing",type:"error",duration:4e3});else if("KeycardLocker"===e)o&&o.isObjectiveActive("get_lab_access")&&(this.multiRoom.addItem("research_keycard"),o.completeObjective("get_lab_access"),t.fire("ui:notification",{text:"Research keycard obtained - Laboratory access granted",type:"success",duration:3e3}));else if(e.startsWith("Specimen_")){if("main_laboratory"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("specimen_analysis")){const i=parseInt(e.split("_")[1]);if(!this.analyzedSpecimens.has(e)){this.analyzedSpecimens.add(e);const n=["Class-A pathogen detected","Viral mutation identified","Cellular breakdown observed","Toxic compound isolated","Bacterial resistance confirmed","Enzyme inhibition noted","DNA corruption detected","Critical pathogen strain found"];t.fire("ui:notification",{text:`Analysis ${i+1}: ${n[i]}`,type:"warning",duration:3e3}),o.updateObjective("specimen_analysis",this.analyzedSpecimens.size),console.log(`[ResearchFacility] Analyzed specimen ${e}, total: ${this.analyzedSpecimens.size}/8`)}}}else if("SynthesisEquipment"===e)o&&o.isComplete("specimen_analysis")&&o.isObjectiveActive("synthesize_antidote")?(this.multiRoom.addItem("antidote_sample"),o.completeObjective("synthesize_antidote"),t.fire("ui:notification",{text:"ANTIDOTE SYNTHESIZED: Emergency treatment ready for deployment",type:"success",duration:4e3})):o&&o.isComplete("synthesize_antidote")&&t.fire("ui:notification",{text:"Antidote already synthesized - Focus on containment protocols",type:"info",duration:2e3});else if(["BioScanner","ContainmentField","EmergencySeal"].includes(e)){if("containment_vault"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("secure_outbreak")){const i={BioScanner:"bio_scanner",ContainmentField:"containment_field",EmergencySeal:"emergency_seal"}[e];t.fire("ui:notification",{text:`${i.replace("_"," ")} activated`,type:"info",duration:2e3}),o.updateObjective("secure_outbreak",i)}}else"DataTerminal"===e&&"data_archive"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("data_recovery")&&(this.multiRoom.addItem("research_data"),o.completeObjective("data_recovery"),t.fire("ui:notification",{text:"Critical research data downloaded - Facility knowledge preserved",type:"success",duration:4e3}))},onUnload(e,t){console.log("[ResearchFacility] Decontamination sequence initiated..."),this.timerInterval&&clearInterval(this.timerInterval),this.multiRoom&&this.multiRoom.setSceneInteractionHandler(null),this.interactionHandler=null,this.multiRoom&&this.multiRoom.onUnload(e,t)}};async function a(e,t,i,o){console.log("[ResearchFacility] Building decontamination chamber...");const n=i.create("EmergencyAlert",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,1,.2]},rigidbody:{type:"static"}},position:[0,2,-4],scale:[2,2,.4],tags:["interactive","alert"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.8,.2,.2),e.emissive=new pc.Color(.4,.1,.1),e.emissiveIntensity=.8,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n);const a=i.create("KeycardLocker",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.4,.8,.3]},rigidbody:{type:"static"}},position:[4,1.5,-3],scale:[.8,1.6,.6],tags:["interactive","locker"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.4,.6),e.emissive=new pc.Color(.1,.2,.3),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}o.addEntityToRoom(a,"decontamination"),[[-3,1.5,0],[0,1.5,0],[3,1.5,0]].forEach((t,o)=>{const n=i.create(`DeconShower_${o}`,{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.5,height:3}},position:t,scale:[1,3,1],tags:["decon_equipment"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.8,.8,.9),e.metalness=.7,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n)});const c=i.createNPC("safety_officer_chen",{position:[-2,0,-2],displayName:"Safety Officer Chen",dialogue:{greeting:"Emergency protocols are in effect! We have a major containment breach in the research wing.",topics:{breach:"Multiple specimens have been compromised - this could be catastrophic.",keycard:"Emergency access codes are in the wall locker - you'll need them for the lab.",timer:"We have limited time before the contamination spreads beyond containment."}}});o.addEntityToRoom(c,"decontamination"),[{pos:[0,3.5,0],color:new pc.Color(.9,.9,1)},{pos:[-3,3.5,0],color:new pc.Color(.9,.9,1)},{pos:[3,3.5,0],color:new pc.Color(.9,.9,1)}].forEach((t,o)=>{const n=i.createLight("point",{color:t.color,intensity:2,range:8,position:t.pos});e.addChild(n)})}async function c(e,t,i,o){console.log("[ResearchFacility] Building main laboratory..."),[[-10,1,-8],[-4,1,-8],[4,1,-8],[10,1,-8],[-10,1,8],[-4,1,8],[4,1,8],[10,1,8]].forEach((e,t)=>{const n=i.create(`Specimen_${t}`,{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.6,height:1.5},rigidbody:{type:"static"}},position:e,scale:[1.2,1.5,1.2],tags:["interactive","specimen"]});if(n.model){const e=new pc.StandardMaterial,i=t%2==0;e.diffuse=i?new pc.Color(.6,.8,.2):new pc.Color(.2,.6,.8),e.emissive=i?new pc.Color(.2,.3,.05):new pc.Color(.05,.2,.3),e.emissiveIntensity=.4,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}o.addEntityToRoom(n,"main_laboratory")});const n=i.create("SynthesisEquipment",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,1.5,1.5]},rigidbody:{type:"static"}},position:[0,1.5,0],scale:[4,3,3],tags:["interactive","equipment"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.4,.5),e.emissive=new pc.Color(.1,.3,.4),e.metalness=.6,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}o.addEntityToRoom(n,"main_laboratory"),[[-8,.5,-4],[8,.5,-4],[-8,.5,4],[8,.5,4]].forEach((t,o)=>{const n=i.create(`ResearchBench_${o}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[3,.5,1]}},position:t,scale:[6,1,2],tags:["equipment"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.7,.7,.8),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n)});const a=i.createNPC("dr_martinez",{position:[6,0,0],displayName:"Dr. Martinez",dialogue:{greeting:"Thank goodness you're here! The specimens are showing unprecedented mutation rates.",topics:{analysis:"We need to analyze every contaminated specimen to understand the pathogen.",antidote:"Once we have the full analysis, we can synthesize a broad-spectrum antidote.",containment:"The vault systems are failing - we need that antidote before total containment loss."}}});o.addEntityToRoom(a,"main_laboratory"),[{pos:[0,4.5,0],color:new pc.Color(.9,.95,1)},{pos:[-8,4.5,0],color:new pc.Color(.9,.95,1)},{pos:[8,4.5,0],color:new pc.Color(.9,.95,1)}].forEach((t,o)=>{const n=i.createLight("point",{color:t.color,intensity:2.2,range:12,position:t.pos});e.addChild(n)})}async function s(e,t,i,o){console.log("[ResearchFacility] Building containment vault...");const n=i.create("BioScanner",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.8,height:2},rigidbody:{type:"static"}},position:[-6,1,-4],scale:[1.6,2,1.6],tags:["interactive","scanner"]}),a=i.create("ContainmentField",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,2,.5]},rigidbody:{type:"static"}},position:[0,2,-4],scale:[2,4,1],tags:["interactive","field_generator"]}),c=i.create("EmergencySeal",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.5,1,.3]},rigidbody:{type:"static"}},position:[6,1,-4],scale:[3,2,.6],tags:["interactive","seal_control"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.7,.3),e.emissive=new pc.Color(.1,.3,.15),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.3,.8),e.emissive=new pc.Color(.15,.15,.4),e.emissiveIntensity=.6,e.update(),a.model.meshInstances.forEach(t=>t.material=e)}if(c.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.8,.3,.2),e.emissive=new pc.Color(.4,.15,.1),e.update(),c.model.meshInstances.forEach(t=>t.material=e)}o.addEntityToRoom(n,"containment_vault"),o.addEntityToRoom(a,"containment_vault"),o.addEntityToRoom(c,"containment_vault"),[[-6,1.5,4],[-2,1.5,4],[2,1.5,4],[6,1.5,4]].forEach((t,o)=>{const n=i.create(`ContainmentCell_${o}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.5,1.5,1.5]}},position:t,scale:[3,3,3],tags:["containment"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.4,.4),e.emissive=new pc.Color(.2,.1,.1),e.emissiveIntensity=.3,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n)}),[{pos:[0,5.5,0],color:new pc.Color(1,.4,.4)},{pos:[-6,4.5,0],color:new pc.Color(1,.4,.4)},{pos:[6,4.5,0],color:new pc.Color(1,.4,.4)}].forEach((t,o)=>{const n=i.createLight("point",{color:t.color,intensity:1.8,range:10,position:t.pos});e.addChild(n)})}async function r(e,t,i,o){console.log("[ResearchFacility] Building data archive...");const n=i.create("DataTerminal",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,1.5,1]},rigidbody:{type:"static"}},position:[0,1.5,-4],scale:[4,3,2],tags:["interactive","terminal"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.3,.4),e.emissive=new pc.Color(.1,.2,.3),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}o.addEntityToRoom(n,"data_archive"),[[-6,1.5,0],[6,1.5,0],[-6,1.5,4],[6,1.5,4]].forEach((t,o)=>{const n=i.create(`ServerRack_${o}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,1.5,.5]}},position:t,scale:[2,3,1],tags:["server"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.15,.15,.15),e.emissive=new pc.Color(.05,.15,.1),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n)});const a=i.createLight("point",{color:new pc.Color(.6,.8,1),intensity:1.5,range:12,position:[0,3.5,0]});e.addChild(a)}}}]);
|
364.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[364],{364:(e,t,o)=>{o.r(t),o.d(t,{default:()=>r});var i=o(96);const r={id:"security_complex",title:"Security Complex",type:"scene",async build(e,t,o){console.log("[SecurityComplex] Building security complex...");const r=new i.n(e,e.systems?.core||{});r.sceneBuilder=t,r.entityFactory=o,this.timeLimit=3e5,this.startTime=null,r.createRoom("security_office",{size:[15,3.5,12],lighting:"dim",position:[0,0,0],buildFunction:c,objectives:[{id:"security_breach",name:"Security Breach Response",description:"Investigate the security breach alert",type:"simple",autoStart:!0,rewards:{experience:30}},{id:"get_desk_keycard",name:"Emergency Access",description:"Find the emergency keycard in the security desk",type:"simple",rewards:{experience:40,items:[{id:"desk_keycard",quantity:1}]}}]}),r.createRoom("main_corridor",{size:[40,4,8],lighting:"corridor",position:[0,0,0],buildFunction:n,objectives:[{id:"patrol_corridor",name:"Security Patrol",description:"Check all access points in the corridor",type:"counter",target:6,progress:0,rewards:{experience:60},nextObjective:"find_emergency_key"},{id:"find_emergency_key",name:"Emergency Key Location",description:"Locate the emergency access key",type:"simple",prerequisites:["patrol_corridor"],rewards:{experience:50,items:[{id:"emergency_key",quantity:1}]}}]}),r.createRoom("camera_control",{size:[12,3,10],lighting:"control_room",position:[0,0,0],buildFunction:s,objectives:[{id:"security_clearance",name:"Security Clearance",description:"Obtain elevated security permissions",type:"simple",autoStart:!0,rewards:{experience:80,items:[{id:"security_clearance",quantity:1}]}}]}),r.createRoom("basement_storage",{size:[16,3,14],lighting:"storage",position:[0,0,0],buildFunction:a,objectives:[{id:"storage_search",name:"Storage Investigation",description:"Search storage crates for evidence",type:"counter",target:8,progress:0,rewards:{experience:90}}]}),r.createRoom("server_room",{size:[10,3,12],lighting:"server_room",position:[0,0,0],buildFunction:l,objectives:[{id:"access_mainframe",name:"Mainframe Access",description:"Access the master security terminal",type:"simple",rewards:{experience:150,skillPoints:3,items:[{id:"security_override",quantity:1}]}},{id:"lockdown_protocol",name:"Emergency Lockdown",description:"Execute facility-wide security lockdown",type:"sequence",target:["control_room_key","storage_access_key","master_override"],progress:0,rewards:{experience:200,skillPoints:5}}]}),r.createDoor("security_office","main_corridor",{type:"objective",id:"get_desk_keycard"},{playerSpawnPosition:[-15,0,0]}),r.createDoor("main_corridor","camera_control",{type:"objective",id:"find_emergency_key"},{playerSpawnPosition:[0,0,4]}),r.createDoor("main_corridor","basement_storage",{type:"objective",id:"find_emergency_key"},{playerSpawnPosition:[0,0,6]}),r.createDoor("camera_control","server_room",{type:"objective",id:"security_clearance"},{playerSpawnPosition:[0,0,5]}),r.createDoor("server_room","basement_storage",{type:"none"},{playerSpawnPosition:[6,0,0]});const d=await r.build(e,t,o);return d.multiRoom=r,d},onLoad(e,t){console.log("[SecurityComplex] Security protocols activated");const o=e.root.findByTag("scene_root")[0];o&&o.multiRoom&&(o.multiRoom.onLoad(e,t),this.multiRoom=o.multiRoom,this.startTime=Date.now(),this.setupTimer(e),this.interactionHandler=o=>{this.handleSecurityInteraction(o,e,t)},this.multiRoom.setSceneInteractionHandler(this.interactionHandler)),e.fire("ui:notification",{text:"SECURITY ALERT: Unauthorized access detected - 5 minute response window",type:"error",duration:6e3})},setupTimer(e){this.timerInterval=setInterval(()=>{if(!this.startTime)return;const t=Date.now()-this.startTime,o=Math.max(0,this.timeLimit-t),i=Math.floor(o/6e4),r=Math.floor(o%6e4/1e3);o>0?e.fire("ui:notification",{text:`Security Response Timer: ${i}:${r.toString().padStart(2,"0")}`,type:"warning",duration:1e3}):this.onTimeExpired(e)},1e4)},onTimeExpired(e){clearInterval(this.timerInterval),e.fire("ui:notification",{text:"TIME EXPIRED: Security lockdown failed - Facility compromised!",type:"error",duration:8e3})},handleSecurityInteraction(e,t,o){console.log("[SecurityComplex] Interaction triggered with:",e);const i=o.getSystem("objectivemanager");if("SecurityDesk"===e)i&&i.isObjectiveActive("security_breach")&&(i.completeObjective("security_breach"),i.startObjective("get_desk_keycard")),t.fire("ui:notification",{text:"ALERT: Multiple breach points detected across facility",type:"error",duration:4e3});else if("DeskDrawer"===e)i&&i.isObjectiveActive("get_desk_keycard")&&(this.multiRoom.addItem("desk_keycard"),i.completeObjective("get_desk_keycard"),t.fire("ui:notification",{text:"Emergency keycard obtained - Corridor access granted",type:"success",duration:3e3}));else if(e.startsWith("AccessPoint_")){if("main_corridor"===this.multiRoom.currentRoom&&i&&i.isObjectiveActive("patrol_corridor")){const o=parseInt(e.split("_")[1]),r=["COMPROMISED","SECURE","BREACH ATTEMPT","OFFLINE","TAMPERED","CRITICAL"];t.fire("ui:notification",{text:`Access Point ${o+1}: ${r[o]}`,type:o%2==0?"error":"warning",duration:2e3}),i.updateObjective("patrol_corridor")}}else if("EmergencyKeyCabinet"===e)i&&i.isComplete("patrol_corridor")&&i.isObjectiveActive("find_emergency_key")&&(this.multiRoom.addItem("emergency_key"),i.completeObjective("find_emergency_key"),t.fire("ui:notification",{text:"Emergency access key acquired - Basement storage unlocked",type:"success",duration:3e3}));else if("MasterControlTerminal"===e)"camera_control"===this.multiRoom.currentRoom&&i&&i.isObjectiveActive("security_clearance")&&(this.multiRoom.addItem("security_clearance"),i.completeObjective("security_clearance"),t.fire("ui:notification",{text:"Security clearance obtained - Server room access granted",type:"success",duration:3e3}));else if(e.startsWith("StorageCrate_")){if("basement_storage"===this.multiRoom.currentRoom&&i&&i.isObjectiveActive("storage_search")){const o=parseInt(e.split("_")[1]),r=["Suspicious electronic devices","Unauthorized access cards","Data storage devices","Communication equipment","Security bypass tools","Encrypted documents","Network infiltration gear","Master override codes"];t.fire("ui:notification",{text:`Evidence found: ${r[o]}`,type:"info",duration:3e3}),i.updateObjective("storage_search")}}else if("MainframeTerminal"===e)"server_room"===this.multiRoom.currentRoom&&i&&i.isObjectiveActive("access_mainframe")&&(this.multiRoom.addItem("security_override"),i.completeObjective("access_mainframe"),i.startObjective("lockdown_protocol"),t.fire("ui:notification",{text:"MAINFRAME ACCESS GRANTED - Initiating emergency protocols",type:"success",duration:4e3}));else if(["ControlRoomKey","StorageAccessKey","MasterOverride"].includes(e)){if("server_room"===this.multiRoom.currentRoom&&i&&i.isObjectiveActive("lockdown_protocol")){const o={ControlRoomKey:"control_room_key",StorageAccessKey:"storage_access_key",MasterOverride:"master_override"}[e];t.fire("ui:notification",{text:`${o.replace("_"," ")} activated`,type:"success",duration:2e3}),i.updateObjective("lockdown_protocol",o)}}else"security_chief_williams"===e&&t.fire("ui:notification",{text:'Security Chief Williams: "Multiple breach points detected! Check the desk for emergency keycard!"',type:"error",duration:4e3})},onUnload(e,t){console.log("[SecurityComplex] Security systems shutting down..."),this.timerInterval&&clearInterval(this.timerInterval),this.multiRoom&&this.multiRoom.setSceneInteractionHandler(null),this.interactionHandler=null,this.multiRoom&&this.multiRoom.onUnload(e,t)}};async function c(e,t,o,i){console.log("[SecurityComplex] Building security office...");const r=o.create("SecurityDesk",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,.5,1]},rigidbody:{type:"static"}},position:[0,.5,-4],scale:[4,1,2],tags:["interactive","desk"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.3,.4),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}e.addChild(r);const c=o.create("DeskDrawer",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.3,.2,.2]},rigidbody:{type:"static"}},position:[1.5,1.2,-3.5],scale:[.6,.4,.4],tags:["interactive","drawer"]});if(c.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.4,.4),e.emissive=new pc.Color(.1,.1,.2),e.update(),c.model.meshInstances.forEach(t=>t.material=e)}i.sceneRoot.addChild(c),console.log("[SecurityComplex] Created drawer:",c.name,"Position:",c.getPosition(),"Tags:",Array.from(c.tags._list||[])),[[-3,1.2,-3.5],[0,1.2,-3.5],[3,1.2,-3.5]].forEach((t,i)=>{const r=o.create(`SecurityMonitor_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.8,.5,.1]}},position:t,scale:[1.6,1,.2],tags:["monitor"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.1,.1,.1),e.emissive=new pc.Color(.1,.3,.1),e.emissiveIntensity=.5,e.update(),r.model.meshInstances.forEach(t=>t.material=e)}e.addChild(r)});const n=o.createNPC("security_chief_williams",{position:[-2,0,-2],displayName:"Security Chief Williams",dialogue:{greeting:"Code Red situation! We've got multiple security breaches across the facility.",topics:{breach:"Someone's systematically compromising our access points. We need immediate action.",keycard:"Emergency protocols are active - get the keycard from my desk drawer.",corridor:"Start with the main corridor - check every access point for signs of tampering."}}});e.addChild(n),console.log("[SecurityComplex] Created NPC:",n.name,"Position:",n.getPosition(),"Tags:",Array.from(n.tags._list||[]));const s=o.createLight("point",{color:new pc.Color(.6,.6,.8),intensity:1.5,range:10,position:[0,3,0]});e.addChild(s)}async function n(e,t,o,i){console.log("[SecurityComplex] Building main corridor..."),[[-18,1.5,3],[-10,1.5,3],[-2,1.5,3],[2,1.5,3],[10,1.5,3],[18,1.5,3]].forEach((e,t)=>{const r=o.create(`AccessPoint_${t}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.5,1,.2]},rigidbody:{type:"static"}},position:e,scale:[1,2,.4],tags:["interactive","access_point"]});if(r.model){const e=new pc.StandardMaterial,o=t%2==0;e.diffuse=o?new pc.Color(.6,.2,.2):new pc.Color(.2,.6,.2),e.emissive=o?new pc.Color(.2,.05,.05):new pc.Color(.05,.2,.05),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}i.sceneRoot.addChild(r)});const r=o.create("EmergencyKeyCabinet",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.5,1,.3]},rigidbody:{type:"static"}},position:[0,1,-3],scale:[1,2,.6],tags:["interactive","key_cabinet"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.7,.7,.2),e.emissive=new pc.Color(.2,.2,.05),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}i.sceneRoot.addChild(r),[[-15,3.5,0],[-5,3.5,0],[5,3.5,0],[15,3.5,0]].forEach((t,i)=>{const r=o.create(`SecurityCamera_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.3,.2,.3]}},position:t,scale:[.6,.4,.6],tags:["camera"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.2,.2),e.emissive=new pc.Color(.1,.05,.05),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}e.addChild(r)}),[{pos:[-15,3.5,0],color:new pc.Color(.8,.8,.9)},{pos:[-5,3.5,0],color:new pc.Color(.8,.8,.9)},{pos:[5,3.5,0],color:new pc.Color(.8,.8,.9)},{pos:[15,3.5,0],color:new pc.Color(.8,.8,.9)}].forEach((t,i)=>{const r=o.createLight("point",{color:t.color,intensity:1.2,range:8,position:t.pos});e.addChild(r)})}async function s(e,t,o,i){console.log("[SecurityComplex] Building camera control room...");const r=o.create("MasterControlTerminal",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,1,1]},rigidbody:{type:"static"}},position:[0,1,0],scale:[4,2,2],tags:["interactive","terminal"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.3,.4),e.emissive=new pc.Color(.1,.2,.3),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}i.sceneRoot.addChild(r),[[-4,2,-3],[0,2,-3],[4,2,-3]].forEach((t,i)=>{const r=o.create(`CameraDisplay_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,.8,.1]}},position:t,scale:[2,1.6,.2],tags:["display"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.1,.1,.1),e.emissive=new pc.Color(.2,.3,.2),e.emissiveIntensity=.3,e.update(),r.model.meshInstances.forEach(t=>t.material=e)}e.addChild(r)});const c=o.createLight("point",{color:new pc.Color(.6,.8,1),intensity:2,range:10,position:[0,2.5,0]});e.addChild(c)}async function a(e,t,o,i){console.log("[SecurityComplex] Building basement storage..."),[[-6,.5,-5],[-2,.5,-5],[2,.5,-5],[6,.5,-5],[-6,.5,5],[-2,.5,5],[2,.5,5],[6,.5,5]].forEach((e,t)=>{const r=o.create(`StorageCrate_${t}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.8,.8,.8]},rigidbody:{type:"static"}},position:e,scale:[1.6,1.6,1.6],tags:["interactive","crate"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.6,.4,.2),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}i.sceneRoot.addChild(r)});const r=o.createLight("point",{color:new pc.Color(.7,.6,.5),intensity:1,range:12,position:[0,2.5,0]});e.addChild(r)}async function l(e,t,o,i){console.log("[SecurityComplex] Building server room..."),[[-3,1,-4],[3,1,-4],[-3,1,0],[3,1,0],[-3,1,4],[3,1,4]].forEach((t,i)=>{const r=o.create(`ServerRack_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.8,1.5,.4]}},position:t,scale:[1.6,3,.8],tags:["server"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.2,.2),e.emissive=new pc.Color(.05,.1,.05),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}e.addChild(r)});const r=o.create("MainframeTerminal",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.5,1,.5]},rigidbody:{type:"static"}},position:[0,1,5],scale:[3,2,1],tags:["interactive","mainframe"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.1,.3,.5),e.emissive=new pc.Color(.05,.15,.25),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}i.sceneRoot.addChild(r),[{name:"ControlRoomKey",pos:[-2,1,2],color:new pc.Color(.4,.2,.2)},{name:"StorageAccessKey",pos:[2,1,2],color:new pc.Color(.2,.4,.2)},{name:"MasterOverride",pos:[0,1,-2],color:new pc.Color(.2,.2,.4)}].forEach((e,t)=>{const r=o.create(e.name,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.5,.8,.3]},rigidbody:{type:"static"}},position:e.pos,scale:[1,1.6,.6],tags:["interactive","lockdown_terminal"]});if(r.model){const t=new pc.StandardMaterial;t.diffuse=e.color,t.emissive=new pc.Color(.3*e.color.r,.3*e.color.g,.3*e.color.b),t.update(),r.model.meshInstances.forEach(e=>e.material=t)}i.sceneRoot.addChild(r)});const c=o.createLight("point",{color:new pc.Color(.6,.7,1),intensity:1.8,range:10,position:[0,2.5,0]});e.addChild(c)}}}]);
|
|
|
|
| 1 |
+
"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[364],{364:(e,t,o)=>{o.r(t),o.d(t,{default:()=>r});var i=o(96);const r={id:"security_complex",title:"Security Complex",type:"scene",async build(e,t,o){console.log("[SecurityComplex] Building security complex...");const r=new i.n(e,e.systems?.core||{});r.sceneBuilder=t,r.entityFactory=o,this.timeLimit=3e5,this.startTime=null,r.createRoom("security_office",{size:[15,3.5,12],lighting:"dim",position:[0,0,0],buildFunction:c,objectives:[{id:"security_breach",name:"Security Breach Response",description:"Investigate the security breach alert",type:"simple",autoStart:!0,rewards:{experience:30}},{id:"get_desk_keycard",name:"Emergency Access",description:"Find the emergency keycard in the security desk",type:"simple",rewards:{experience:40,items:[{id:"desk_keycard",quantity:1}]}}]}),r.createRoom("main_corridor",{size:[40,4,8],lighting:"corridor",position:[0,0,0],buildFunction:s,objectives:[{id:"patrol_corridor",name:"Security Patrol",description:"Check all access points in the corridor",type:"counter",target:6,progress:0,rewards:{experience:60},nextObjective:"find_emergency_key"},{id:"find_emergency_key",name:"Emergency Key Location",description:"Locate the emergency access key",type:"simple",prerequisites:["patrol_corridor"],rewards:{experience:50,items:[{id:"emergency_key",quantity:1}]}}]}),r.createRoom("camera_control",{size:[12,3,10],lighting:"control_room",position:[0,0,0],buildFunction:a,objectives:[{id:"security_clearance",name:"Security Clearance",description:"Obtain elevated security permissions",type:"simple",autoStart:!0,rewards:{experience:80,items:[{id:"security_clearance",quantity:1}]}}]}),r.createRoom("basement_storage",{size:[16,3,14],lighting:"storage",position:[0,0,0],buildFunction:n,objectives:[{id:"storage_search",name:"Storage Investigation",description:"Search storage crates for evidence",type:"counter",target:8,progress:0,rewards:{experience:90}}]}),r.createRoom("server_room",{size:[10,3,12],lighting:"server_room",position:[0,0,0],buildFunction:l,objectives:[{id:"access_mainframe",name:"Mainframe Access",description:"Access the master security terminal",type:"simple",rewards:{experience:150,skillPoints:3,items:[{id:"security_override",quantity:1}]}},{id:"lockdown_protocol",name:"Emergency Lockdown",description:"Execute facility-wide security lockdown",type:"sequence",target:["control_room_key","storage_access_key","master_override"],progress:0,rewards:{experience:200,skillPoints:5}}]}),r.createDoor("security_office","main_corridor",{type:"objective",id:"get_desk_keycard"},{playerSpawnPosition:[-15,0,0]}),r.createDoor("main_corridor","camera_control",{type:"objective",id:"find_emergency_key"},{playerSpawnPosition:[0,0,4]}),r.createDoor("main_corridor","basement_storage",{type:"objective",id:"find_emergency_key"},{playerSpawnPosition:[0,0,6]}),r.createDoor("camera_control","basement_storage",{type:"objective",id:"security_clearance"},{playerSpawnPosition:[0,0,6]}),r.createDoor("camera_control","server_room",{type:"objective",id:"security_clearance"},{playerSpawnPosition:[0,0,5]}),r.createDoor("server_room","basement_storage",{type:"none"},{playerSpawnPosition:[6,0,0]});const d=await r.build(e,t,o);return d.multiRoom=r,d},onLoad(e,t){console.log("[SecurityComplex] Security protocols activated");const o=e.root.findByTag("scene_root")[0];o&&o.multiRoom&&(o.multiRoom.onLoad(e,t),this.multiRoom=o.multiRoom,this.startTime=Date.now(),this.setupTimer(e),this.interactionHandler=o=>{this.handleSecurityInteraction(o,e,t)},this.multiRoom.setSceneInteractionHandler(this.interactionHandler),this.accessPointsChecked=new Set,this.cratesSearched=new Set,this.roomChangeHandler=e=>{console.log(`[SecurityComplex] Room changed to: ${e.roomId}`);const o=t.getSystem("objectivemanager");o&&"main_corridor"===e.roomId&&(o.isObjectiveActive("patrol_corridor")||o.isComplete("patrol_corridor")||(console.log("[SecurityComplex] Auto-starting patrol_corridor on room entry"),o.startObjective("patrol_corridor")))},e.on("room:changed",this.roomChangeHandler,this)),e.fire("ui:notification",{text:"SECURITY ALERT: Unauthorized access detected - 5 minute response window",type:"error",duration:6e3})},setupTimer(e){this.timerInterval=setInterval(()=>{if(!this.startTime)return;const t=Date.now()-this.startTime,o=Math.max(0,this.timeLimit-t),i=Math.floor(o/6e4),r=Math.floor(o%6e4/1e3);o>0?e.fire("ui:notification",{text:`Security Response Timer: ${i}:${r.toString().padStart(2,"0")}`,type:"warning",duration:1e3}):this.onTimeExpired(e)},1e4)},onTimeExpired(e){clearInterval(this.timerInterval),e.fire("ui:notification",{text:"TIME EXPIRED: Security lockdown failed - Facility compromised!",type:"error",duration:8e3})},handleSecurityInteraction(e,t,o){console.log("[SecurityComplex] Interaction triggered with:",e);const i=o.getSystem("objectivemanager");if("SecurityDesk"===e)i&&i.isObjectiveActive("security_breach")&&(i.completeObjective("security_breach"),i.startObjective("get_desk_keycard")),t.fire("ui:notification",{text:"ALERT: Multiple breach points detected across facility",type:"error",duration:4e3});else if("DeskDrawer"===e)i&&i.isObjectiveActive("get_desk_keycard")&&(this.multiRoom.addItem("desk_keycard"),i.completeObjective("get_desk_keycard"),t.fire("ui:notification",{text:"Emergency keycard obtained - Corridor access granted",type:"success",duration:3e3}));else if(e.startsWith("AccessPoint_")){const o=this.multiRoom.currentRoom;if(console.log(`[SecurityComplex] AccessPoint interaction in room: ${o}`),"main_corridor"===o&&i)if(i.isObjectiveActive("patrol_corridor")||i.isComplete("patrol_corridor")||(console.log("[SecurityComplex] Auto-starting patrol_corridor objective"),i.startObjective("patrol_corridor")),i.isObjectiveActive("patrol_corridor")){const o=parseInt(e.split("_")[1]);if(this.accessPointsChecked.has(o))t.fire("ui:notification",{text:`Access Point ${o+1}: Already checked`,type:"info",duration:1500});else{this.accessPointsChecked.add(o);const e=["COMPROMISED","SECURE","BREACH ATTEMPT","OFFLINE","TAMPERED","CRITICAL"];t.fire("ui:notification",{text:`Access Point ${o+1}: ${e[o]} (${this.accessPointsChecked.size}/6)`,type:o%2==0?"error":"warning",duration:2e3}),i.updateObjective("patrol_corridor",this.accessPointsChecked.size),console.log(`[SecurityComplex] Updated patrol_corridor: ${this.accessPointsChecked.size}/6 access points`)}}else console.warn("[SecurityComplex] patrol_corridor objective not active when accessing point")}else if("EmergencyKeyCabinet"===e)i&&i.isComplete("patrol_corridor")&&i.isObjectiveActive("find_emergency_key")&&(this.multiRoom.addItem("emergency_key"),i.completeObjective("find_emergency_key"),t.fire("ui:notification",{text:"Emergency access key acquired - Basement storage unlocked",type:"success",duration:3e3}));else if("MasterControlTerminal"===e)"camera_control"===this.multiRoom.currentRoom&&i&&i.isObjectiveActive("security_clearance")&&(this.multiRoom.addItem("security_clearance"),i.completeObjective("security_clearance"),t.fire("ui:notification",{text:"Security clearance obtained - Server room access granted",type:"success",duration:3e3}));else if(e.startsWith("StorageCrate_")){if("basement_storage"===this.multiRoom.currentRoom&&i&&i.isObjectiveActive("storage_search")){const o=parseInt(e.split("_")[1]);if(this.cratesSearched.has(o))t.fire("ui:notification",{text:`Crate ${o+1}: Already searched`,type:"info",duration:1500});else{this.cratesSearched.add(o);const e=["Suspicious electronic devices","Unauthorized access cards","Data storage devices","Communication equipment","Security bypass tools","Encrypted documents","Network infiltration gear","Master override codes"];t.fire("ui:notification",{text:`Evidence found: ${e[o]} (${this.cratesSearched.size}/8)`,type:"info",duration:3e3}),i.updateObjective("storage_search",this.cratesSearched.size),console.log(`[SecurityComplex] Updated storage_search: ${this.cratesSearched.size}/8 crates`)}}}else if("MainframeTerminal"===e)"server_room"===this.multiRoom.currentRoom&&i&&i.isObjectiveActive("access_mainframe")&&(this.multiRoom.addItem("security_override"),i.completeObjective("access_mainframe"),i.startObjective("lockdown_protocol"),t.fire("ui:notification",{text:"MAINFRAME ACCESS GRANTED - Initiating emergency protocols",type:"success",duration:4e3}));else if(["ControlRoomKey","StorageAccessKey","MasterOverride"].includes(e)){if("server_room"===this.multiRoom.currentRoom&&i&&i.isObjectiveActive("lockdown_protocol")){const o={ControlRoomKey:"control_room_key",StorageAccessKey:"storage_access_key",MasterOverride:"master_override"}[e];t.fire("ui:notification",{text:`${o.replace("_"," ")} activated`,type:"success",duration:2e3}),i.updateObjective("lockdown_protocol",o)}}else"security_chief_williams"===e&&t.fire("ui:notification",{text:'Security Chief Williams: "Multiple breach points detected! Check the desk for emergency keycard!"',type:"error",duration:4e3})},onUnload(e,t){console.log("[SecurityComplex] Security systems shutting down..."),this.timerInterval&&clearInterval(this.timerInterval),this.roomChangeHandler&&(e.off("room:changed",this.roomChangeHandler,this),this.roomChangeHandler=null),this.multiRoom&&this.multiRoom.setSceneInteractionHandler(null),this.interactionHandler=null,this.multiRoom&&this.multiRoom.onUnload(e,t)}};async function c(e,t,o,i){console.log("[SecurityComplex] Building security office...");const r=o.create("SecurityDesk",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,.5,1]},rigidbody:{type:"static"}},position:[0,.5,-4],scale:[4,1,2],tags:["interactive","desk"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.3,.4),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}e.addChild(r);const c=o.create("DeskDrawer",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.3,.2,.2]},rigidbody:{type:"static"}},position:[1.5,1.2,-3.5],scale:[.6,.4,.4],tags:["interactive","drawer"]});if(c.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.4,.4),e.emissive=new pc.Color(.1,.1,.2),e.update(),c.model.meshInstances.forEach(t=>t.material=e)}i.addEntityToRoom(c,"security_office"),console.log("[SecurityComplex] Created drawer:",c.name,"Position:",c.getPosition(),"Tags:",Array.from(c.tags._list||[])),[[-3,1.2,-3.5],[0,1.2,-3.5],[3,1.2,-3.5]].forEach((t,i)=>{const r=o.create(`SecurityMonitor_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.8,.5,.1]}},position:t,scale:[1.6,1,.2],tags:["monitor"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.1,.1,.1),e.emissive=new pc.Color(.1,.3,.1),e.emissiveIntensity=.5,e.update(),r.model.meshInstances.forEach(t=>t.material=e)}e.addChild(r)});const s=o.createNPC("security_chief_williams",{position:[-2,0,-2],displayName:"Security Chief Williams",dialogue:{greeting:"Code Red situation! We've got multiple security breaches across the facility.",topics:{breach:"Someone's systematically compromising our access points. We need immediate action.",keycard:"Emergency protocols are active - get the keycard from my desk drawer.",corridor:"Start with the main corridor - check every access point for signs of tampering."}}});e.addChild(s),console.log("[SecurityComplex] Created NPC:",s.name,"Position:",s.getPosition(),"Tags:",Array.from(s.tags._list||[]));const a=o.createLight("point",{color:new pc.Color(.6,.6,.8),intensity:1.5,range:10,position:[0,3,0]});e.addChild(a)}async function s(e,t,o,i){console.log("[SecurityComplex] Building main corridor..."),[[-18,1.5,3],[-10,1.5,3],[-2,1.5,3],[2,1.5,3],[10,1.5,3],[18,1.5,3]].forEach((e,t)=>{const r=o.create(`AccessPoint_${t}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.5,1,.2]},rigidbody:{type:"static"}},position:e,scale:[1,2,.4],tags:["interactive","access_point"]});if(r.model){const e=new pc.StandardMaterial,o=t%2==0;e.diffuse=o?new pc.Color(.6,.2,.2):new pc.Color(.2,.6,.2),e.emissive=o?new pc.Color(.2,.05,.05):new pc.Color(.05,.2,.05),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}i.addEntityToRoom(r,"main_corridor")});const r=o.create("EmergencyKeyCabinet",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.5,1,.3]},rigidbody:{type:"static"}},position:[0,1,-3],scale:[1,2,.6],tags:["interactive","key_cabinet"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.7,.7,.2),e.emissive=new pc.Color(.2,.2,.05),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}i.addEntityToRoom(r,"main_corridor"),[[-15,3.5,0],[-5,3.5,0],[5,3.5,0],[15,3.5,0]].forEach((t,i)=>{const r=o.create(`SecurityCamera_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.3,.2,.3]}},position:t,scale:[.6,.4,.6],tags:["camera"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.2,.2),e.emissive=new pc.Color(.1,.05,.05),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}e.addChild(r)}),[{pos:[-15,3.5,0],color:new pc.Color(.8,.8,.9)},{pos:[-5,3.5,0],color:new pc.Color(.8,.8,.9)},{pos:[5,3.5,0],color:new pc.Color(.8,.8,.9)},{pos:[15,3.5,0],color:new pc.Color(.8,.8,.9)}].forEach((t,i)=>{const r=o.createLight("point",{color:t.color,intensity:1.2,range:8,position:t.pos});e.addChild(r)})}async function a(e,t,o,i){console.log("[SecurityComplex] Building camera control room...");const r=o.create("MasterControlTerminal",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,1,1]},rigidbody:{type:"static"}},position:[0,1,0],scale:[4,2,2],tags:["interactive","terminal"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.3,.4),e.emissive=new pc.Color(.1,.2,.3),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}i.addEntityToRoom(r,"camera_control"),[[-4,2,-3],[0,2,-3],[4,2,-3]].forEach((t,i)=>{const r=o.create(`CameraDisplay_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,.8,.1]}},position:t,scale:[2,1.6,.2],tags:["display"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.1,.1,.1),e.emissive=new pc.Color(.2,.3,.2),e.emissiveIntensity=.3,e.update(),r.model.meshInstances.forEach(t=>t.material=e)}e.addChild(r)});const c=o.createLight("point",{color:new pc.Color(.6,.8,1),intensity:2,range:10,position:[0,2.5,0]});e.addChild(c)}async function n(e,t,o,i){console.log("[SecurityComplex] Building basement storage..."),[[-6,.5,-5],[-2,.5,-5],[2,.5,-5],[6,.5,-5],[-6,.5,5],[-2,.5,5],[2,.5,5],[6,.5,5]].forEach((e,t)=>{const r=o.create(`StorageCrate_${t}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.8,.8,.8]},rigidbody:{type:"static"}},position:e,scale:[1.6,1.6,1.6],tags:["interactive","crate"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.6,.4,.2),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}i.addEntityToRoom(r,"basement_storage")});const r=o.createLight("point",{color:new pc.Color(.7,.6,.5),intensity:1,range:12,position:[0,2.5,0]});e.addChild(r)}async function l(e,t,o,i){console.log("[SecurityComplex] Building server room..."),[[-3,1,-4],[3,1,-4],[-3,1,0],[3,1,0],[-3,1,4],[3,1,4]].forEach((t,i)=>{const r=o.create(`ServerRack_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.8,1.5,.4]}},position:t,scale:[1.6,3,.8],tags:["server"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.2,.2),e.emissive=new pc.Color(.05,.1,.05),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}e.addChild(r)});const r=o.create("MainframeTerminal",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.5,1,.5]},rigidbody:{type:"static"}},position:[0,1,5],scale:[3,2,1],tags:["interactive","mainframe"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.1,.3,.5),e.emissive=new pc.Color(.05,.15,.25),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}i.addEntityToRoom(r,"server_room"),[{name:"ControlRoomKey",pos:[-2,1,2],color:new pc.Color(.4,.2,.2)},{name:"StorageAccessKey",pos:[2,1,2],color:new pc.Color(.2,.4,.2)},{name:"MasterOverride",pos:[0,1,-2],color:new pc.Color(.2,.2,.4)}].forEach((e,t)=>{const r=o.create(e.name,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.5,.8,.3]},rigidbody:{type:"static"}},position:e.pos,scale:[1,1.6,.6],tags:["interactive","lockdown_terminal"]});if(r.model){const t=new pc.StandardMaterial;t.diffuse=e.color,t.emissive=new pc.Color(.3*e.color.r,.3*e.color.g,.3*e.color.b),t.update(),r.model.meshInstances.forEach(e=>e.material=t)}i.addEntityToRoom(r,"server_room")});const c=o.createLight("point",{color:new pc.Color(.6,.7,1),intensity:1.8,range:10,position:[0,2.5,0]});e.addChild(c)}}}]);
|
386.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[386],{386:(e,t,i)=>{i.r(t),i.d(t,{default:()=>n});var o=i(96);const n={id:"industrial_facility",title:"Industrial Facility",type:"scene",async build(e,t,i){console.log("[IndustrialFacility] Building industrial facility...");const n=new o.n(e,e.systems?.core||{});n.sceneBuilder=t,n.entityFactory=i,n.createRoom("entry_hall",{size:[18,5,14],lighting:"industrial",position:[0,0,0],buildFunction:a,objectives:[{id:"facility_entry",name:"Facility Access",description:"Report to the security checkpoint",type:"simple",autoStart:!0,rewards:{experience:25}},{id:"get_facility_badge",name:"Obtain Access Badge",description:"Get security clearance from the checkpoint",type:"simple",rewards:{experience:40,items:[{id:"facility_badge",quantity:1}]}}]}),n.createRoom("control_room",{size:[16,4,12],lighting:"control_room",position:[0,0,0],buildFunction:r,objectives:[{id:"monitor_systems",name:"System Monitoring",description:"Check all facility monitoring stations",type:"counter",target:4,progress:0,rewards:{experience:60},nextObjective:"diagnose_problem"},{id:"diagnose_problem",name:"System Diagnosis",description:"Identify the generator malfunction",type:"simple",prerequisites:["monitor_systems"],rewards:{experience:80,skillPoints:1}}]}),n.createRoom("generator_bay",{size:[25,6,20],lighting:"emergency",position:[0,0,0],buildFunction:s,objectives:[{id:"repair_generator",name:"Generator Repair",description:"Restore primary power systems",type:"sequence",target:["cooling_system","electrical_panel","main_generator"],progress:0,rewards:{experience:120,skillPoints:2}}]}),n.createRoom("maintenance_tunnel",{size:[30,3,8],lighting:"dim",position:[0,0,0],buildFunction:c,objectives:[{id:"emergency_sequence",name:"Emergency Protocol",description:"Execute the facility emergency sequence",type:"sequence",target:["valve_1","valve_2","emergency_release"],progress:0,rewards:{experience:150,skillPoints:3,items:[{id:"facility_override_key",quantity:1}]}}]}),n.createDoor("entry_hall","control_room",{type:"none"},{playerSpawnPosition:[0,0,5]}),n.createDoor("control_room","generator_bay",{type:"none"},{playerSpawnPosition:[0,0,8]}),n.createDoor("generator_bay","maintenance_tunnel",{type:"none"},{playerSpawnPosition:[0,0,3]});const l=await n.build(e,t,i);return l.multiRoom=n,l},onLoad(e,t){console.log("[IndustrialFacility] Facility systems online");const i=e.root.findByTag("scene_root")[0];i&&i.multiRoom&&(i.multiRoom.onLoad(e,t),this.multiRoom=i.multiRoom,this.interactionHandler=i=>{this.handleFacilityInteraction(i,e,t)},this.multiRoom.setSceneInteractionHandler(this.interactionHandler)),e.fire("ui:notification",{text:"Industrial Facility - Critical Systems Failure Detected",type:"error",duration:4e3})},handleFacilityInteraction(e,t,i){const o=i.getSystem("objectivemanager");if("SecurityCheckpoint"===e)o&&o.isObjectiveActive("facility_entry")&&(o.completeObjective("facility_entry"),o.startObjective("get_facility_badge")),t.fire("ui:notification",{text:"Security: Emergency protocols active - Generator failure imminent!",type:"warning",duration:4e3});else if("BadgeDispenser"===e)o&&o.isObjectiveActive("get_facility_badge")&&(this.multiRoom.addItem("facility_badge"),o.completeObjective("get_facility_badge"),t.fire("ui:notification",{text:"Access badge obtained - Control room access granted",type:"success",duration:3e3}));else if(e.startsWith("MonitorStation_")){if("control_room"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("monitor_systems")){const i=parseInt(e.split("_")[1]),n=["PRIMARY GENERATOR: Critical temperature warning","COOLING SYSTEM: Pump failure detected","ELECTRICAL GRID: Power fluctuations increasing","BACKUP SYSTEMS: Manual activation required"];t.fire("ui:notification",{text:n[i],type:"warning",duration:3e3}),o.updateObjective("monitor_systems")}}else if("DiagnosticConsole"===e)o&&o.isComplete("monitor_systems")&&o.isObjectiveActive("diagnose_problem")&&(o.completeObjective("diagnose_problem"),t.fire("ui:notification",{text:"DIAGNOSIS: Generator cooling failure - Manual repair required",type:"error",duration:4e3}));else if(["CoolingSystem","ElectricalPanel","MainGenerator"].includes(e)){if("generator_bay"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("repair_generator")){const i={CoolingSystem:"cooling_system",ElectricalPanel:"electrical_panel",MainGenerator:"main_generator"}[e];t.fire("ui:notification",{text:`${i.replace("_"," ")} repaired`,type:"success",duration:2e3}),o.updateObjective("repair_generator",i)}}else if(["Valve1","Valve2","EmergencyRelease"].includes(e)){if("maintenance_tunnel"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("emergency_sequence")){const i={Valve1:"valve_1",Valve2:"valve_2",EmergencyRelease:"emergency_release"}[e];t.fire("ui:notification",{text:`${i.replace("_"," ")} activated`,type:"info",duration:2e3}),o.updateObjective("emergency_sequence",i)}}else"guard_rodriguez"===e?t.fire("ui:notification",{text:'Guard Rodriguez: "Emergency protocols active - get your badge from the dispenser!"',type:"info",duration:4e3}):"engineer_johnson"===e&&t.fire("ui:notification",{text:'Chief Engineer Johnson: "Generator failure imminent! Check all monitoring stations!"',type:"warning",duration:4e3})},onUnload(e,t){console.log("[IndustrialFacility] Facility shutdown sequence initiated..."),this.multiRoom&&this.multiRoom.setSceneInteractionHandler(null),this.interactionHandler=null,this.multiRoom&&this.multiRoom.onUnload(e,t)}};async function a(e,t,i,o){console.log("[IndustrialFacility] Building entry hall...");const n=i.create("SecurityCheckpoint",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,1,1]},rigidbody:{type:"static"}},position:[0,1,-5],scale:[4,2,2],tags:["interactive","security"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.2,.3),e.emissive=new pc.Color(.1,.1,.2),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n);const a=i.create("BadgeDispenser",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.3,.5,.2]},rigidbody:{type:"static"}},position:[2,1,-4],scale:[.6,1,.4],tags:["interactive","dispenser"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.3,.3),e.emissive=new pc.Color(.1,.2,.1),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(a);const r=i.createNPC("guard_rodriguez",{position:[-2,0,-4],displayName:"Security Guard Rodriguez",dialogue:{greeting:"Emergency situation! Main generator is failing - we need immediate assistance.",topics:{emergency:"Power grid instability detected. Control room access requires clearance.",badge:"Get your facility badge from the dispenser - you'll need it for restricted areas.",generator:"Engineering team is overwhelmed. We need someone with technical skills."}}});e.addChild(r);const s=i.create("SafetyEquipment",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,1,.5]}},position:[6,1,0],scale:[2,2,1],tags:["equipment"]});if(s.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.8,.6,.2),e.update(),s.model.meshInstances.forEach(t=>t.material=e)}e.addChild(s),[{pos:[0,4,0],color:new pc.Color(.9,.9,.8)},{pos:[-6,4,0],color:new pc.Color(.9,.9,.8)},{pos:[6,4,0],color:new pc.Color(.9,.9,.8)}].forEach((t,o)=>{const n=i.createLight("point",{color:t.color,intensity:1.8,range:10,position:t.pos});e.addChild(n)})}async function r(e,t,i,o){console.log("[IndustrialFacility] Building control room..."),[[-6,1,-4],[6,1,-4],[-6,1,4],[6,1,4]].forEach((e,t)=>{const n=i.create(`MonitorStation_${t}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,1,.5]},rigidbody:{type:"static"}},position:e,scale:[2,2,1],tags:["interactive","monitor"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.1,.2,.3),e.emissive=new pc.Color(.1,.3,.5),e.emissiveIntensity=.5,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(n)});const n=i.create("DiagnosticConsole",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,1,1]},rigidbody:{type:"static"}},position:[0,1,0],scale:[4,2,2],tags:["interactive","console"]});if(console.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.3,.4),e.emissive=new pc.Color(.2,.4,.6),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(n);const a=i.createNPC("engineer_johnson",{position:[0,0,3],displayName:"Chief Engineer Johnson",dialogue:{greeting:"Thank goodness you're here! Our monitoring systems are going crazy.",topics:{systems:"Check all four monitoring stations - we need a complete status report.",generator:"Primary generator is overheating. Cooling system failure imminent.",diagnosis:"Use the central console once you've gathered all the data."}}});e.addChild(a);const r=i.createLight("point",{color:new pc.Color(.7,.8,1),intensity:2,range:12,position:[0,3,0]});e.addChild(r)}async function s(e,t,i,o){console.log("[IndustrialFacility] Building generator bay...");const n=i.create("MainGenerator",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:3,height:4},rigidbody:{type:"static"}},position:[0,2,0],scale:[6,4,6],tags:["interactive","generator"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.5,.5,.5),e.emissive=new pc.Color(.3,.1,.1),e.emissiveIntensity=.3,e.metalness=.8,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(n);const a=i.create("CoolingSystem",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,2,1]},rigidbody:{type:"static"}},position:[-8,2,0],scale:[4,4,2],tags:["interactive","cooling"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.5,.7),e.emissive=new pc.Color(.1,.2,.3),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(a);const r=i.create("ElectricalPanel",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,2,.2]},rigidbody:{type:"static"}},position:[8,2,-6],scale:[2,4,.4],tags:["interactive","panel"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.4,.4),e.emissive=new pc.Color(.2,.2,.1),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(r),[{pos:[0,5,0],color:new pc.Color(1,.3,.3)},{pos:[-8,4,0],color:new pc.Color(1,.3,.3)},{pos:[8,4,0],color:new pc.Color(1,.3,.3)}].forEach((t,o)=>{const n=i.createLight("point",{color:t.color,intensity:1.5,range:8,position:t.pos});e.addChild(n)})}async function c(e,t,i,o){console.log("[IndustrialFacility] Building maintenance tunnel...");const n=i.create("Valve1",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.5,height:.3},rigidbody:{type:"static"}},position:[-10,1.5,0],scale:[1,.6,1],tags:["interactive","valve"]}),a=i.create("Valve2",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.5,height:.3},rigidbody:{type:"static"}},position:[0,1.5,0],scale:[1,.6,1],tags:["interactive","valve"]}),r=i.create("EmergencyRelease",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.5,.5,.3]},rigidbody:{type:"static"}},position:[10,1.5,0],scale:[1,1,.6],tags:["interactive","release"]});if([n,a].forEach(e=>{if(e.model){const t=new pc.StandardMaterial;t.diffuse=new pc.Color(.6,.3,.1),t.metalness=.9,t.update(),e.model.meshInstances.forEach(e=>e.material=t)}o.sceneRoot.addChild(e)}),r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.8,.2,.2),e.emissive=new pc.Color(.2,.05,.05),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(r),[[-12,2.5,0],[-8,2.5,0],[-4,2.5,0],[4,2.5,0],[8,2.5,0],[12,2.5,0]].forEach((t,o)=>{const n=i.create(`Pipe_${o}`,{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.2,height:.5}},position:t,rotation:[0,0,90],scale:[.4,1,.4],tags:["pipe"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.4,.4),e.metalness=.8,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n)}),[{pos:[-10,2.8,0],color:new pc.Color(.8,.8,.6)},{pos:[0,2.8,0],color:new pc.Color(.8,.8,.6)},{pos:[10,2.8,0],color:new pc.Color(.8,.8,.6)}].forEach((t,o)=>{const n=i.createLight("point",{color:t.color,intensity:1,range:6,position:t.pos});e.addChild(n)})}}}]);
|
|
|
|
| 1 |
+
"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[386],{386:(e,t,i)=>{i.r(t),i.d(t,{default:()=>n});var o=i(96);const n={id:"industrial_facility",title:"Industrial Facility",type:"scene",async build(e,t,i){console.log("[IndustrialFacility] Building industrial facility...");const n=new o.n(e,e.systems?.core||{});n.sceneBuilder=t,n.entityFactory=i,n.createRoom("entry_hall",{size:[18,5,14],lighting:"industrial",position:[0,0,0],buildFunction:a,objectives:[{id:"facility_entry",name:"Facility Access",description:"Report to the security checkpoint",type:"simple",autoStart:!0,rewards:{experience:25}},{id:"get_facility_badge",name:"Obtain Access Badge",description:"Get security clearance from the checkpoint",type:"simple",rewards:{experience:40,items:[{id:"facility_badge",quantity:1}]}}]}),n.createRoom("control_room",{size:[16,4,12],lighting:"control_room",position:[0,0,0],buildFunction:r,objectives:[{id:"monitor_systems",name:"System Monitoring",description:"Check all facility monitoring stations",type:"counter",target:4,progress:0,rewards:{experience:60},nextObjective:"diagnose_problem"},{id:"diagnose_problem",name:"System Diagnosis",description:"Identify the generator malfunction",type:"simple",prerequisites:["monitor_systems"],rewards:{experience:80,skillPoints:1}}]}),n.createRoom("generator_bay",{size:[25,6,20],lighting:"emergency",position:[0,0,0],buildFunction:s,objectives:[{id:"repair_generator",name:"Generator Repair",description:"Restore primary power systems",type:"sequence",target:["cooling_system","electrical_panel","main_generator"],progress:0,rewards:{experience:120,skillPoints:2}}]}),n.createRoom("maintenance_tunnel",{size:[30,3,8],lighting:"dim",position:[0,0,0],buildFunction:c,objectives:[{id:"emergency_sequence",name:"Emergency Protocol",description:"Execute the facility emergency sequence",type:"sequence",target:["valve_1","valve_2","emergency_release"],progress:0,rewards:{experience:150,skillPoints:3,items:[{id:"facility_override_key",quantity:1}]}}]}),n.createDoor("entry_hall","control_room",{type:"none"},{playerSpawnPosition:[0,0,5]}),n.createDoor("control_room","generator_bay",{type:"none"},{playerSpawnPosition:[0,0,8]}),n.createDoor("generator_bay","maintenance_tunnel",{type:"none"},{playerSpawnPosition:[0,0,3]});const l=await n.build(e,t,i);return l.multiRoom=n,l},onLoad(e,t){console.log("[IndustrialFacility] Facility systems online");const i=e.root.findByTag("scene_root")[0];i&&i.multiRoom&&(i.multiRoom.onLoad(e,t),this.multiRoom=i.multiRoom,this.interactionHandler=i=>{this.handleFacilityInteraction(i,e,t)},this.multiRoom.setSceneInteractionHandler(this.interactionHandler)),e.fire("ui:notification",{text:"Industrial Facility - Critical Systems Failure Detected",type:"error",duration:4e3})},handleFacilityInteraction(e,t,i){const o=i.getSystem("objectivemanager");if("SecurityCheckpoint"===e)o&&o.isObjectiveActive("facility_entry")&&(o.completeObjective("facility_entry"),o.startObjective("get_facility_badge")),t.fire("ui:notification",{text:"Security: Emergency protocols active - Generator failure imminent!",type:"warning",duration:4e3});else if("BadgeDispenser"===e)o&&o.isObjectiveActive("get_facility_badge")&&(this.multiRoom.addItem("facility_badge"),o.completeObjective("get_facility_badge"),t.fire("ui:notification",{text:"Access badge obtained - Control room access granted",type:"success",duration:3e3}));else if(e.startsWith("MonitorStation_")){if("control_room"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("monitor_systems")){const i=parseInt(e.split("_")[1]),n=["PRIMARY GENERATOR: Critical temperature warning","COOLING SYSTEM: Pump failure detected","ELECTRICAL GRID: Power fluctuations increasing","BACKUP SYSTEMS: Manual activation required"];t.fire("ui:notification",{text:n[i],type:"warning",duration:3e3}),o.updateObjective("monitor_systems")}}else if("DiagnosticConsole"===e)o&&o.isComplete("monitor_systems")&&o.isObjectiveActive("diagnose_problem")&&(o.completeObjective("diagnose_problem"),t.fire("ui:notification",{text:"DIAGNOSIS: Generator cooling failure - Manual repair required",type:"error",duration:4e3}));else if(["CoolingSystem","ElectricalPanel","MainGenerator"].includes(e)){if("generator_bay"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("repair_generator")){const i={CoolingSystem:"cooling_system",ElectricalPanel:"electrical_panel",MainGenerator:"main_generator"}[e];t.fire("ui:notification",{text:`${i.replace("_"," ")} repaired`,type:"success",duration:2e3}),o.updateObjective("repair_generator",i)}}else if(["Valve1","Valve2","EmergencyRelease"].includes(e)){if("maintenance_tunnel"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("emergency_sequence")){const i={Valve1:"valve_1",Valve2:"valve_2",EmergencyRelease:"emergency_release"}[e];t.fire("ui:notification",{text:`${i.replace("_"," ")} activated`,type:"info",duration:2e3}),o.updateObjective("emergency_sequence",i)}}else"guard_rodriguez"===e?t.fire("ui:notification",{text:'Guard Rodriguez: "Emergency protocols active - get your badge from the dispenser!"',type:"info",duration:4e3}):"engineer_johnson"===e&&t.fire("ui:notification",{text:'Chief Engineer Johnson: "Generator failure imminent! Check all monitoring stations!"',type:"warning",duration:4e3})},onUnload(e,t){console.log("[IndustrialFacility] Facility shutdown sequence initiated..."),this.multiRoom&&this.multiRoom.setSceneInteractionHandler(null),this.interactionHandler=null,this.multiRoom&&this.multiRoom.onUnload(e,t)}};async function a(e,t,i,o){console.log("[IndustrialFacility] Building entry hall...");const n=i.create("SecurityCheckpoint",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,1,1]},rigidbody:{type:"static"}},position:[0,1,-5],scale:[4,2,2],tags:["interactive","security"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.2,.3),e.emissive=new pc.Color(.1,.1,.2),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n);const a=i.create("BadgeDispenser",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.3,.5,.2]},rigidbody:{type:"static"}},position:[2,1,-4],scale:[.6,1,.4],tags:["interactive","dispenser"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.3,.3),e.emissive=new pc.Color(.1,.2,.1),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}o.addEntityToRoom(a,"entry_hall");const r=i.createNPC("guard_rodriguez",{position:[-2,0,-4],displayName:"Security Guard Rodriguez",dialogue:{greeting:"Emergency situation! Main generator is failing - we need immediate assistance.",topics:{emergency:"Power grid instability detected. Control room access requires clearance.",badge:"Get your facility badge from the dispenser - you'll need it for restricted areas.",generator:"Engineering team is overwhelmed. We need someone with technical skills."}}});e.addChild(r);const s=i.create("SafetyEquipment",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,1,.5]}},position:[6,1,0],scale:[2,2,1],tags:["equipment"]});if(s.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.8,.6,.2),e.update(),s.model.meshInstances.forEach(t=>t.material=e)}e.addChild(s),[{pos:[0,4,0],color:new pc.Color(.9,.9,.8)},{pos:[-6,4,0],color:new pc.Color(.9,.9,.8)},{pos:[6,4,0],color:new pc.Color(.9,.9,.8)}].forEach((t,o)=>{const n=i.createLight("point",{color:t.color,intensity:1.8,range:10,position:t.pos});e.addChild(n)})}async function r(e,t,i,o){console.log("[IndustrialFacility] Building control room..."),[[-6,1,-4],[6,1,-4],[-6,1,4],[6,1,4]].forEach((e,t)=>{const n=i.create(`MonitorStation_${t}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,1,.5]},rigidbody:{type:"static"}},position:e,scale:[2,2,1],tags:["interactive","monitor"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.1,.2,.3),e.emissive=new pc.Color(.1,.3,.5),e.emissiveIntensity=.5,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}o.addEntityToRoom(n,"control_room")});const n=i.create("DiagnosticConsole",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,1,1]},rigidbody:{type:"static"}},position:[0,1,0],scale:[4,2,2],tags:["interactive","console"]});if(console.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.3,.4),e.emissive=new pc.Color(.2,.4,.6),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}o.addEntityToRoom(n,"control_room");const a=i.createNPC("engineer_johnson",{position:[0,0,3],displayName:"Chief Engineer Johnson",dialogue:{greeting:"Thank goodness you're here! Our monitoring systems are going crazy.",topics:{systems:"Check all four monitoring stations - we need a complete status report.",generator:"Primary generator is overheating. Cooling system failure imminent.",diagnosis:"Use the central console once you've gathered all the data."}}});e.addChild(a);const r=i.createLight("point",{color:new pc.Color(.7,.8,1),intensity:2,range:12,position:[0,3,0]});e.addChild(r)}async function s(e,t,i,o){console.log("[IndustrialFacility] Building generator bay...");const n=i.create("MainGenerator",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:3,height:4},rigidbody:{type:"static"}},position:[0,2,0],scale:[6,4,6],tags:["interactive","generator"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.5,.5,.5),e.emissive=new pc.Color(.3,.1,.1),e.emissiveIntensity=.3,e.metalness=.8,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}o.addEntityToRoom(n,"generator_bay");const a=i.create("CoolingSystem",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,2,1]},rigidbody:{type:"static"}},position:[-8,2,0],scale:[4,4,2],tags:["interactive","cooling"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.5,.7),e.emissive=new pc.Color(.1,.2,.3),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}o.addEntityToRoom(a,"generator_bay");const r=i.create("ElectricalPanel",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,2,.2]},rigidbody:{type:"static"}},position:[8,2,-6],scale:[2,4,.4],tags:["interactive","panel"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.4,.4),e.emissive=new pc.Color(.2,.2,.1),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}o.addEntityToRoom(r,"generator_bay"),[{pos:[0,5,0],color:new pc.Color(1,.3,.3)},{pos:[-8,4,0],color:new pc.Color(1,.3,.3)},{pos:[8,4,0],color:new pc.Color(1,.3,.3)}].forEach((t,o)=>{const n=i.createLight("point",{color:t.color,intensity:1.5,range:8,position:t.pos});e.addChild(n)})}async function c(e,t,i,o){console.log("[IndustrialFacility] Building maintenance tunnel...");const n=i.create("Valve1",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.5,height:.3},rigidbody:{type:"static"}},position:[-10,1.5,0],scale:[1,.6,1],tags:["interactive","valve"]}),a=i.create("Valve2",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.5,height:.3},rigidbody:{type:"static"}},position:[0,1.5,0],scale:[1,.6,1],tags:["interactive","valve"]}),r=i.create("EmergencyRelease",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.5,.5,.3]},rigidbody:{type:"static"}},position:[10,1.5,0],scale:[1,1,.6],tags:["interactive","release"]});if([n,a].forEach(e=>{if(e.model){const t=new pc.StandardMaterial;t.diffuse=new pc.Color(.6,.3,.1),t.metalness=.9,t.update(),e.model.meshInstances.forEach(e=>e.material=t)}o.addEntityToRoom(e,"maintenance_tunnel")}),r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.8,.2,.2),e.emissive=new pc.Color(.2,.05,.05),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}o.addEntityToRoom(r,"maintenance_tunnel"),[[-12,2.5,0],[-8,2.5,0],[-4,2.5,0],[4,2.5,0],[8,2.5,0],[12,2.5,0]].forEach((t,o)=>{const n=i.create(`Pipe_${o}`,{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.2,height:.5}},position:t,rotation:[0,0,90],scale:[.4,1,.4],tags:["pipe"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.4,.4),e.metalness=.8,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n)}),[{pos:[-10,2.8,0],color:new pc.Color(.8,.8,.6)},{pos:[0,2.8,0],color:new pc.Color(.8,.8,.6)},{pos:[10,2.8,0],color:new pc.Color(.8,.8,.6)}].forEach((t,o)=>{const n=i.createLight("point",{color:t.color,intensity:1,range:6,position:t.pos});e.addChild(n)})}}}]);
|
420.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[420],{420:(e,t,i)=>{i.r(t),i.d(t,{default:()=>n});var o=i(96);const n={id:"quantum_lab",title:"Quantum Research Laboratory",type:"scene",async build(e,t,i){console.log("[QuantumLab] Building quantum research laboratory...");const n=new o.n(e,e.systems?.core||{});n.sceneBuilder=t,n.entityFactory=i,this.powerLevel=100,this.startTime=null,n.createRoom("entrance_chamber",{size:[18,5,14],lighting:"quantum",position:[0,0,0],buildFunction:a,objectives:[{id:"quantum_breach",name:"Quantum Containment Breach",description:"Investigate quantum field containment failure",type:"simple",autoStart:!0,rewards:{experience:30}},{id:"power_analysis",name:"Power Grid Analysis",description:"Analyze quantum power distribution systems",type:"simple",rewards:{experience:50,items:[{id:"power_diagnostics",quantity:1}]}}]}),n.createRoom("laser_grid_hall",{size:[30,6,12],lighting:"laser_grid",position:[0,0,0],buildFunction:s,objectives:[{id:"disable_security_grid",name:"Security Grid Deactivation",description:"Disable laser security grid in correct sequence",type:"sequence",target:["laser_node_1","laser_node_2","laser_node_3","master_grid"],progress:0,rewards:{experience:120}}]}),n.createRoom("containment_lab",{size:[25,7,20],lighting:"containment",position:[0,0,0],buildFunction:r,objectives:[{id:"stabilize_experiments",name:"Quantum Stabilization",description:"Stabilize failing quantum containment fields",type:"counter",target:6,progress:0,rewards:{experience:150,skillPoints:3}}]}),n.createRoom("power_core",{size:[20,8,16],lighting:"power_core",position:[0,0,0],buildFunction:c,objectives:[{id:"electromagnetic_override",name:"Electromagnetic Override",description:"Override quantum field generators to restore containment",type:"sequence",target:["field_generator_1","field_generator_2","quantum_core","containment_matrix"],progress:0,rewards:{experience:250,skillPoints:5,items:[{id:"quantum_stabilizer",quantity:1}]}}]}),n.createDoor("entrance_chamber","laser_grid_hall",{type:"keycard",item:"power_diagnostics"},{playerSpawnPosition:[-12,0,0]}),n.createDoor("laser_grid_hall","containment_lab",{type:"objective",id:"disable_security_grid"},{playerSpawnPosition:[0,0,8]}),n.createDoor("containment_lab","power_core",{type:"objective",id:"stabilize_experiments"},{playerSpawnPosition:[0,0,6]});const l=await n.build(e,t,i);return l.multiRoom=n,l},onLoad(e,t){console.log("[QuantumLab] Quantum field generators online - Power fluctuations detected");const i=e.root.findByTag("scene_root")[0];i&&i.multiRoom&&(i.multiRoom.onLoad(e,t),this.multiRoom=i.multiRoom,this.interactionHandler=i=>{this.handleQuantumInteraction(i,e,t)},this.multiRoom.setSceneInteractionHandler(this.interactionHandler),this.startTime=Date.now(),this.setupPowerSystem(e)),e.fire("ui:notification",{text:"QUANTUM BREACH: Containment field destabilization detected",type:"error",duration:4e3})},setupPowerSystem(e){this.powerInterval=setInterval(()=>{this.powerLevel=Math.max(20,this.powerLevel-2),this.powerLevel<=50&&e.fire("ui:notification",{text:`POWER CRITICAL: ${this.powerLevel}% - Barriers destabilizing`,type:"warning",duration:2e3})},1e4)},handleQuantumInteraction(e,t,i){console.log("[QuantumLab] Quantum interaction with:",e);const o=i.getSystem("objectivemanager");if("PowerDiagnostic"===e)o&&o.isObjectiveActive("quantum_breach")&&(o.completeObjective("quantum_breach"),o.startObjective("power_analysis")),t.fire("ui:notification",{text:"ANALYSIS: Quantum field resonance cascade detected",type:"warning",duration:4e3});else if("PowerGridAnalyzer"===e)o&&o.isObjectiveActive("power_analysis")&&(this.multiRoom.addItem("power_diagnostics"),o.completeObjective("power_analysis"),t.fire("ui:notification",{text:"Power diagnostics complete - Laser grid access enabled",type:"success",duration:3e3}));else if(e.startsWith("LaserNode_")){if("laser_grid_hall"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("disable_security_grid")){const i=parseInt(e.split("_")[2]),n=["laser_node_1","laser_node_2","laser_node_3"];this.createEnergyWall(i,!1),t.fire("ui:notification",{text:`Laser Node ${i+1} deactivated - Energy barrier offline`,type:"success",duration:2500}),o.updateObjective("disable_security_grid",n[i])}}else if("MasterGridControl"===e){if("laser_grid_hall"===this.multiRoom.currentRoom&&o){const e=o.getObjective("disable_security_grid");e&&3===e.progress&&(this.createEnergyWall("master",!1),t.fire("ui:notification",{text:"LASER GRID OFFLINE: Containment lab access granted",type:"success",duration:4e3}),o.updateObjective("disable_security_grid","master_grid"))}}else if(e.startsWith("ContainmentField_")){if("containment_lab"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("stabilize_experiments")){const i=parseInt(e.split("_")[2]),n=["Quantum entanglement matrix","Particle acceleration chamber","Dimensional fold generator","Temporal flux capacitor","Dark matter containment","Quantum foam stabilizer"];t.fire("ui:notification",{text:`${n[i]} stabilized`,type:"success",duration:2e3}),o.updateObjective("stabilize_experiments")}}else if(["FieldGenerator1","FieldGenerator2","QuantumCore","ContainmentMatrix"].includes(e)&&"power_core"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("electromagnetic_override")){const i={FieldGenerator1:"field_generator_1",FieldGenerator2:"field_generator_2",QuantumCore:"quantum_core",ContainmentMatrix:"containment_matrix"}[e];t.fire("ui:notification",{text:`${i.replace("_"," ")} synchronized`,type:"success",duration:2e3}),o.updateObjective("electromagnetic_override",i)}},createEnergyWall(e,t=!0){const i={0:[-8,1.5,0],1:[0,1.5,0],2:[8,1.5,0],master:[0,1.5,-5]}[e];if(!i)return;const o=this.app.root.findByName(`EnergyWall_${e}`);if(t){if(!o){const t=this.multiRoom.entityFactory.create(`EnergyWall_${e}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.2,3,4]},rigidbody:{type:"static"}},position:i,scale:[.4,6,8],tags:["energy_wall","impassable"]});if(t.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(1,.2,.2),e.emissive=new pc.Color(.8,.1,.1),e.emissiveIntensity=1,e.opacity=.7,e.blendType=pc.BLEND_NORMAL,e.update(),t.model.meshInstances.forEach(t=>t.material=e)}this.multiRoom.sceneRoot.addChild(t)}}else o&&o.destroy()},onUnload(e,t){console.log("[QuantumLab] Quantum systems shutting down..."),this.powerInterval&&clearInterval(this.powerInterval),this.multiRoom&&this.multiRoom.setSceneInteractionHandler(null),this.interactionHandler=null,this.multiRoom&&this.multiRoom.onUnload(e,t)}};async function a(e,t,i,o){console.log("[QuantumLab] Building entrance chamber...");const n=i.create("PowerDiagnostic",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.5,1,.8]},rigidbody:{type:"static"}},position:[0,1,-5],scale:[3,2,1.6],tags:["interactive","diagnostic"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.3,.6),e.emissive=new pc.Color(.1,.2,.4),e.emissiveIntensity=.6,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n);const a=i.create("PowerGridAnalyzer",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:1,height:2.5},rigidbody:{type:"static"}},position:[6,1.25,-2],scale:[2,2.5,2],tags:["interactive","analyzer"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.1,.5,.3),e.emissive=new pc.Color(.05,.3,.2),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(a);const s=i.createNPC("dr_quantum",{position:[-3,0,-3],displayName:"Dr. Helena Quantum",dialogue:{greeting:"The quantum containment fields are destabilizing! We're losing power across all systems.",topics:{breach:"Something triggered a cascade failure - all our experiments are going critical.",laser:"The security grid is still active - you'll need to disable each node in sequence.",power:"Power diagnostics will show you the system status - start there first."}}});o.sceneRoot.addChild(s),[{pos:[0,4.5,0],color:new pc.Color(.8,.9,1)},{pos:[-6,4.5,0],color:new pc.Color(.8,.9,1)},{pos:[6,4.5,0],color:new pc.Color(.8,.9,1)}].forEach((t,o)=>{const n=i.createLight("point",{color:t.color,intensity:2,range:10,position:t.pos});e.addChild(n)});const r=i.create("SpawnPoint",{position:[0,1,3],tags:["spawn"]});e.addChild(r)}async function s(e,t,i,o){console.log("[QuantumLab] Building laser grid hall with IMPASSABLE BARRIERS..."),[[-8,1.5,-4],[0,1.5,-4],[8,1.5,-4]].forEach((e,t)=>{const n=i.create(`LaserNode_${t}`,{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.8,height:2},rigidbody:{type:"static"}},position:e,scale:[1.6,2,1.6],tags:["interactive","laser_node"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(1,.3,.3),e.emissive=new pc.Color(.8,.2,.2),e.emissiveIntensity=.8,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(n);const a=i.create(`EnergyWall_${t}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.2,3,4]},rigidbody:{type:"static"}},position:[e[0],1.5,0],scale:[.4,6,8],tags:["energy_wall","impassable"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(1,.2,.2),e.emissive=new pc.Color(.8,.1,.1),e.emissiveIntensity=1,e.opacity=.7,e.blendType=pc.BLEND_NORMAL,e.update(),a.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(a)});const n=i.create("MasterGridControl",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,1.5,1]},rigidbody:{type:"static"}},position:[0,1.5,4],scale:[4,3,2],tags:["interactive","master_control"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.6,.2,.8),e.emissive=new pc.Color(.4,.1,.6),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(n);const a=i.create("EnergyWall_master",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[12,3,.2]},rigidbody:{type:"static"}},position:[0,1.5,-5],scale:[24,6,.4],tags:["energy_wall","impassable","master_wall"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(1,.1,.1),e.emissive=new pc.Color(1,.05,.05),e.emissiveIntensity=1.2,e.opacity=.8,e.blendType=pc.BLEND_NORMAL,e.update(),a.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(a),[{pos:[0,5.5,0],color:new pc.Color(1,.3,.3)},{pos:[-12,5,0],color:new pc.Color(1,.3,.3)},{pos:[12,5,0],color:new pc.Color(1,.3,.3)}].forEach((t,o)=>{const n=i.createLight("point",{color:t.color,intensity:2.2,range:15,position:t.pos});e.addChild(n)})}async function r(e,t,i,o){console.log("[QuantumLab] Building containment laboratory..."),[[-8,1.5,-6],[0,1.5,-6],[8,1.5,-6],[-8,1.5,6],[0,1.5,6],[8,1.5,6]].forEach((e,t)=>{const n=i.create(`ContainmentField_${t}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,2.5,2]},rigidbody:{type:"static"}},position:e,scale:[4,5,4],tags:["interactive","containment"]});if(n.model){const e=new pc.StandardMaterial,i=[new pc.Color(.8,.2,.8),new pc.Color(.2,.8,.8),new pc.Color(.8,.8,.2),new pc.Color(.2,.8,.2),new pc.Color(.8,.2,.2),new pc.Color(.2,.2,.8)];e.diffuse=i[t],e.emissive=new pc.Color(.5*i[t].r,.5*i[t].g,.5*i[t].b),e.emissiveIntensity=.8,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(n)}),[{pos:[0,6.5,0],color:new pc.Color(.9,.8,1)},{pos:[-8,5.5,0],color:new pc.Color(.8,.9,1)},{pos:[8,5.5,0],color:new pc.Color(1,.8,.9)}].forEach((t,o)=>{const n=i.createLight("point",{color:t.color,intensity:2.5,range:12,position:t.pos});e.addChild(n)})}async function c(e,t,i,o){console.log("[QuantumLab] Building power core chamber...");const n=i.create("FieldGenerator1",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:2,height:4},rigidbody:{type:"static"}},position:[-6,2,-6],scale:[4,4,4],tags:["interactive","generator"]}),a=i.create("FieldGenerator2",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:2,height:4},rigidbody:{type:"static"}},position:[6,2,-6],scale:[4,4,4],tags:["interactive","generator"]}),s=i.create("QuantumCore",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:3,height:6},rigidbody:{type:"static"}},position:[0,3,0],scale:[6,6,6],tags:["interactive","core"]}),r=i.create("ContainmentMatrix",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[4,2,2]},rigidbody:{type:"static"}},position:[0,2,6],scale:[8,4,4],tags:["interactive","matrix"]});if([n,a].forEach(e=>{if(e.model){const t=new pc.StandardMaterial;t.diffuse=new pc.Color(.3,.6,.9),t.emissive=new pc.Color(.1,.3,.5),t.metalness=.8,t.update(),e.model.meshInstances.forEach(e=>e.material=t)}o.sceneRoot.addChild(e)}),s.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.9,.3,.9),e.emissive=new pc.Color(.6,.2,.6),e.emissiveIntensity=1,e.update(),s.model.meshInstances.forEach(t=>t.material=e)}if(o.sceneRoot.addChild(s),r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.8,.3),e.emissive=new pc.Color(.1,.5,.2),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(r);const c=i.createLight("point",{color:new pc.Color(.9,.7,1),intensity:3,range:15,position:[0,7.5,0]});e.addChild(c)}}}]);
|
|
|
|
| 1 |
+
"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[420],{420:(e,t,i)=>{i.r(t),i.d(t,{default:()=>n});var o=i(96);const n={id:"quantum_lab",title:"Quantum Research Laboratory",type:"scene",async build(e,t,i){console.log("[QuantumLab] Building quantum research laboratory...");const n=new o.n(e,e.systems?.core||{});n.sceneBuilder=t,n.entityFactory=i,this.powerLevel=100,this.startTime=null,n.createRoom("entrance_chamber",{size:[18,5,14],lighting:"quantum",position:[0,0,0],buildFunction:a,objectives:[{id:"quantum_breach",name:"Quantum Containment Breach",description:"Investigate quantum field containment failure",type:"simple",autoStart:!0,rewards:{experience:30}},{id:"power_analysis",name:"Power Grid Analysis",description:"Analyze quantum power distribution systems",type:"simple",rewards:{experience:50,items:[{id:"power_diagnostics",quantity:1}]}}]}),n.createRoom("laser_grid_hall",{size:[30,6,12],lighting:"laser_grid",position:[0,0,0],buildFunction:r,objectives:[{id:"disable_security_grid",name:"Security Grid Deactivation",description:"Disable laser security grid in correct sequence",type:"sequence",target:["laser_node_1","laser_node_2","laser_node_3","master_grid"],progress:0,rewards:{experience:120}}]}),n.createRoom("containment_lab",{size:[25,7,20],lighting:"containment",position:[0,0,0],buildFunction:s,objectives:[{id:"stabilize_experiments",name:"Quantum Stabilization",description:"Stabilize failing quantum containment fields",type:"counter",target:6,progress:0,rewards:{experience:150,skillPoints:3}}]}),n.createRoom("power_core",{size:[20,8,16],lighting:"power_core",position:[0,0,0],buildFunction:c,objectives:[{id:"electromagnetic_override",name:"Electromagnetic Override",description:"Override quantum field generators to restore containment",type:"sequence",target:["field_generator_1","field_generator_2","quantum_core","containment_matrix"],progress:0,rewards:{experience:250,skillPoints:5,items:[{id:"quantum_stabilizer",quantity:1}]}}]}),n.createDoor("entrance_chamber","laser_grid_hall",{type:"keycard",item:"power_diagnostics"},{playerSpawnPosition:[-12,0,0]}),n.createDoor("laser_grid_hall","containment_lab",{type:"objective",id:"disable_security_grid"},{playerSpawnPosition:[0,0,8]}),n.createDoor("containment_lab","power_core",{type:"objective",id:"stabilize_experiments"},{playerSpawnPosition:[0,0,6]});const l=await n.build(e,t,i);return l.multiRoom=n,l},onLoad(e,t){console.log("[QuantumLab] Quantum field generators online - Power fluctuations detected");const i=e.root.findByTag("scene_root")[0];i&&i.multiRoom&&(i.multiRoom.onLoad(e,t),this.multiRoom=i.multiRoom,this.interactionHandler=i=>{this.handleQuantumInteraction(i,e,t)},this.multiRoom.setSceneInteractionHandler(this.interactionHandler),this.startTime=Date.now(),this.setupPowerSystem(e)),e.fire("ui:notification",{text:"QUANTUM BREACH: Containment field destabilization detected",type:"error",duration:4e3})},setupPowerSystem(e){this.powerInterval=setInterval(()=>{this.powerLevel=Math.max(20,this.powerLevel-2),this.powerLevel<=50&&e.fire("ui:notification",{text:`POWER CRITICAL: ${this.powerLevel}% - Barriers destabilizing`,type:"warning",duration:2e3})},1e4)},handleQuantumInteraction(e,t,i){console.log("[QuantumLab] Quantum interaction with:",e);const o=i.getSystem("objectivemanager");if("PowerDiagnostic"===e)o&&o.isObjectiveActive("quantum_breach")&&(o.completeObjective("quantum_breach"),o.startObjective("power_analysis")),t.fire("ui:notification",{text:"ANALYSIS: Quantum field resonance cascade detected",type:"warning",duration:4e3});else if("PowerGridAnalyzer"===e)o&&o.isObjectiveActive("power_analysis")&&(this.multiRoom.addItem("power_diagnostics"),o.completeObjective("power_analysis"),t.fire("ui:notification",{text:"Power diagnostics complete - Laser grid access enabled",type:"success",duration:3e3}));else if(e.startsWith("LaserNode_")){if("laser_grid_hall"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("disable_security_grid")){const i=parseInt(e.split("_")[2]),n=["laser_node_1","laser_node_2","laser_node_3"];this.createEnergyWall(i,!1),t.fire("ui:notification",{text:`Laser Node ${i+1} deactivated - Energy barrier offline`,type:"success",duration:2500}),o.updateObjective("disable_security_grid",n[i])}}else if("MasterGridControl"===e){if("laser_grid_hall"===this.multiRoom.currentRoom&&o){const e=o.getObjective("disable_security_grid");e&&3===e.progress&&(this.createEnergyWall("master",!1),t.fire("ui:notification",{text:"LASER GRID OFFLINE: Containment lab access granted",type:"success",duration:4e3}),o.updateObjective("disable_security_grid","master_grid"))}}else if(e.startsWith("ContainmentField_")){if("containment_lab"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("stabilize_experiments")){const i=parseInt(e.split("_")[2]),n=["Quantum entanglement matrix","Particle acceleration chamber","Dimensional fold generator","Temporal flux capacitor","Dark matter containment","Quantum foam stabilizer"];t.fire("ui:notification",{text:`${n[i]} stabilized`,type:"success",duration:2e3}),o.updateObjective("stabilize_experiments")}}else if(["FieldGenerator1","FieldGenerator2","QuantumCore","ContainmentMatrix"].includes(e)&&"power_core"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("electromagnetic_override")){const i={FieldGenerator1:"field_generator_1",FieldGenerator2:"field_generator_2",QuantumCore:"quantum_core",ContainmentMatrix:"containment_matrix"}[e];t.fire("ui:notification",{text:`${i.replace("_"," ")} synchronized`,type:"success",duration:2e3}),o.updateObjective("electromagnetic_override",i)}},createEnergyWall(e,t=!0){const i={0:[-8,1.5,0],1:[0,1.5,0],2:[8,1.5,0],master:[0,1.5,-5]}[e];if(!i)return;const o=this.app.root.findByName(`EnergyWall_${e}`);if(t){if(!o){const t=this.multiRoom.entityFactory.create(`EnergyWall_${e}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.2,3,4]},rigidbody:{type:"static"}},position:i,scale:[.4,6,8],tags:["energy_wall","impassable"]});if(t.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(1,.2,.2),e.emissive=new pc.Color(.8,.1,.1),e.emissiveIntensity=1,e.opacity=.7,e.blendType=pc.BLEND_NORMAL,e.update(),t.model.meshInstances.forEach(t=>t.material=e)}multiRoom.addEntityToRoom(t,this.multiRoom.currentRoom)}}else o&&o.destroy()},onUnload(e,t){console.log("[QuantumLab] Quantum systems shutting down..."),this.powerInterval&&clearInterval(this.powerInterval),this.multiRoom&&this.multiRoom.setSceneInteractionHandler(null),this.interactionHandler=null,this.multiRoom&&this.multiRoom.onUnload(e,t)}};async function a(e,t,i,o){console.log("[QuantumLab] Building entrance chamber...");const n=i.create("PowerDiagnostic",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.5,1,.8]},rigidbody:{type:"static"}},position:[0,1,-5],scale:[3,2,1.6],tags:["interactive","diagnostic"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.3,.6),e.emissive=new pc.Color(.1,.2,.4),e.emissiveIntensity=.6,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n);const a=i.create("PowerGridAnalyzer",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:1,height:2.5},rigidbody:{type:"static"}},position:[6,1.25,-2],scale:[2,2.5,2],tags:["interactive","analyzer"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.1,.5,.3),e.emissive=new pc.Color(.05,.3,.2),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}o.addEntityToRoom(a,"entrance_chamber");const r=i.createNPC("dr_quantum",{position:[-3,0,-3],displayName:"Dr. Helena Quantum",dialogue:{greeting:"The quantum containment fields are destabilizing! We're losing power across all systems.",topics:{breach:"Something triggered a cascade failure - all our experiments are going critical.",laser:"The security grid is still active - you'll need to disable each node in sequence.",power:"Power diagnostics will show you the system status - start there first."}}});o.addEntityToRoom(r,"entrance_chamber"),[{pos:[0,4.5,0],color:new pc.Color(.8,.9,1)},{pos:[-6,4.5,0],color:new pc.Color(.8,.9,1)},{pos:[6,4.5,0],color:new pc.Color(.8,.9,1)}].forEach((t,o)=>{const n=i.createLight("point",{color:t.color,intensity:2,range:10,position:t.pos});e.addChild(n)});const s=i.create("SpawnPoint",{position:[0,1,3],tags:["spawn"]});e.addChild(s)}async function r(e,t,i,o){console.log("[QuantumLab] Building laser grid hall with IMPASSABLE BARRIERS..."),[[-8,1.5,-4],[0,1.5,-4],[8,1.5,-4]].forEach((e,t)=>{const n=i.create(`LaserNode_${t}`,{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.8,height:2},rigidbody:{type:"static"}},position:e,scale:[1.6,2,1.6],tags:["interactive","laser_node"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(1,.3,.3),e.emissive=new pc.Color(.8,.2,.2),e.emissiveIntensity=.8,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}o.addEntityToRoom(n,"laser_grid_hall");const a=i.create(`EnergyWall_${t}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.2,3,4]},rigidbody:{type:"static"}},position:[e[0],1.5,0],scale:[.4,6,8],tags:["energy_wall","impassable"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(1,.2,.2),e.emissive=new pc.Color(.8,.1,.1),e.emissiveIntensity=1,e.opacity=.7,e.blendType=pc.BLEND_NORMAL,e.update(),a.model.meshInstances.forEach(t=>t.material=e)}o.addEntityToRoom(a,"laser_grid_hall")});const n=i.create("MasterGridControl",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,1.5,1]},rigidbody:{type:"static"}},position:[0,1.5,4],scale:[4,3,2],tags:["interactive","master_control"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.6,.2,.8),e.emissive=new pc.Color(.4,.1,.6),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}o.addEntityToRoom(n,"laser_grid_hall");const a=i.create("EnergyWall_master",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[12,3,.2]},rigidbody:{type:"static"}},position:[0,1.5,-5],scale:[24,6,.4],tags:["energy_wall","impassable","master_wall"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(1,.1,.1),e.emissive=new pc.Color(1,.05,.05),e.emissiveIntensity=1.2,e.opacity=.8,e.blendType=pc.BLEND_NORMAL,e.update(),a.model.meshInstances.forEach(t=>t.material=e)}o.addEntityToRoom(a,"laser_grid_hall"),[{pos:[0,5.5,0],color:new pc.Color(1,.3,.3)},{pos:[-12,5,0],color:new pc.Color(1,.3,.3)},{pos:[12,5,0],color:new pc.Color(1,.3,.3)}].forEach((t,o)=>{const n=i.createLight("point",{color:t.color,intensity:2.2,range:15,position:t.pos});e.addChild(n)})}async function s(e,t,i,o){console.log("[QuantumLab] Building containment laboratory..."),[[-8,1.5,-6],[0,1.5,-6],[8,1.5,-6],[-8,1.5,6],[0,1.5,6],[8,1.5,6]].forEach((e,t)=>{const n=i.create(`ContainmentField_${t}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,2.5,2]},rigidbody:{type:"static"}},position:e,scale:[4,5,4],tags:["interactive","containment"]});if(n.model){const e=new pc.StandardMaterial,i=[new pc.Color(.8,.2,.8),new pc.Color(.2,.8,.8),new pc.Color(.8,.8,.2),new pc.Color(.2,.8,.2),new pc.Color(.8,.2,.2),new pc.Color(.2,.2,.8)];e.diffuse=i[t],e.emissive=new pc.Color(.5*i[t].r,.5*i[t].g,.5*i[t].b),e.emissiveIntensity=.8,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}o.addEntityToRoom(n,"containment_lab")}),[{pos:[0,6.5,0],color:new pc.Color(.9,.8,1)},{pos:[-8,5.5,0],color:new pc.Color(.8,.9,1)},{pos:[8,5.5,0],color:new pc.Color(1,.8,.9)}].forEach((t,o)=>{const n=i.createLight("point",{color:t.color,intensity:2.5,range:12,position:t.pos});e.addChild(n)})}async function c(e,t,i,o){console.log("[QuantumLab] Building power core chamber...");const n=i.create("FieldGenerator1",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:2,height:4},rigidbody:{type:"static"}},position:[-6,2,-6],scale:[4,4,4],tags:["interactive","generator"]}),a=i.create("FieldGenerator2",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:2,height:4},rigidbody:{type:"static"}},position:[6,2,-6],scale:[4,4,4],tags:["interactive","generator"]}),r=i.create("QuantumCore",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:3,height:6},rigidbody:{type:"static"}},position:[0,3,0],scale:[6,6,6],tags:["interactive","core"]}),s=i.create("ContainmentMatrix",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[4,2,2]},rigidbody:{type:"static"}},position:[0,2,6],scale:[8,4,4],tags:["interactive","matrix"]});if([n,a].forEach(e=>{if(e.model){const t=new pc.StandardMaterial;t.diffuse=new pc.Color(.3,.6,.9),t.emissive=new pc.Color(.1,.3,.5),t.metalness=.8,t.update(),e.model.meshInstances.forEach(e=>e.material=t)}o.addEntityToRoom(e,"power_core")}),r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.9,.3,.9),e.emissive=new pc.Color(.6,.2,.6),e.emissiveIntensity=1,e.update(),r.model.meshInstances.forEach(t=>t.material=e)}if(o.addEntityToRoom(r,"power_core"),s.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.8,.3),e.emissive=new pc.Color(.1,.5,.2),e.update(),s.model.meshInstances.forEach(t=>t.material=e)}o.addEntityToRoom(s,"power_core");const c=i.createLight("point",{color:new pc.Color(.9,.7,1),intensity:3,range:15,position:[0,7.5,0]});e.addChild(c)}}}]);
|
433.bundle.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[433],{433:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});class o{constructor(e){this.bounds=e.bounds||{width:10,height:10,depth:10},this.capacity=e.capacity||1/0,this.rules=e.rules||[],this.currentState=new Map,this.history=[],this.onStateChange=null,this.containerPosition={x:this.bounds.width/2,y:this.bounds.height/2,z:this.bounds.depth/2}}canAccommodate(e,t){const i=this.checkBounds(e,t),o=this.checkCapacity(e),s=this.checkRules(e,t);return i||(console.log(`[SharedSpace] Bounds check failed for ${e.id} at`,t),console.log("[SharedSpace] Container bounds:",this.bounds,"Container position:",this.containerPosition)),o||console.log(`[SharedSpace] Capacity check failed for ${e.id}`),s||console.log(`[SharedSpace] Rules check failed for ${e.id} at`,t),i&&o&&s}checkBounds(e,t){const i={minX:t.x-e.size.x/2,maxX:t.x+e.size.x/2,minY:t.y-e.size.y/2,maxY:t.y+e.size.y/2,minZ:t.z-e.size.z/2,maxZ:t.z+e.size.z/2},o={minX:this.containerPosition.x-this.bounds.width/2,maxX:this.containerPosition.x+this.bounds.width/2,minY:this.containerPosition.y-this.bounds.height/2,maxY:this.containerPosition.y+this.bounds.height/2,minZ:this.containerPosition.z-this.bounds.depth/2,maxZ:this.containerPosition.z+this.bounds.depth/2},s=i.minX>=o.minX&&i.maxX<=o.maxX&&i.minY>=o.minY&&i.maxY<=o.maxY&&i.minZ>=o.minZ&&i.maxZ<=o.maxZ;return console.log(`[SharedSpace] Bounds check for ${e.id}:`),console.log(" Object bounds:",i),console.log(" Container bounds:",o),console.log(" Result:",s),s}checkCapacity(e){return this.getCurrentVolume()+e.size.x*e.size.y*e.size.z<=this.capacity}checkRules(e,t){for(const i of this.rules)if(!this.applyRule(i,e,t))return!1;return!0}applyRule(e,t,i){switch(e){case"no_overlap":return this.checkNoOverlap(t,i);case"gravity_simulation":return this.checkGravitySupport(t,i);default:return!0}}checkNoOverlap(e,t){const i=this.getObjectBounds(e,t);for(const[e,t]of this.currentState){const e=this.getObjectBounds(t.object,t.position);if(this.boundsOverlap(i,e))return!1}return!0}checkGravitySupport(e,t){if(t.y<=e.size.y/2+.1)return!0;const i=t.y-e.size.y/2-.1;for(const[o,s]of this.currentState){const o=s.object,n=s.position,a=n.y+o.size.y/2;if(Math.abs(a-i)<.2&&this.horizontalOverlap(e,t,o,n))return!0}return!1}horizontalOverlap(e,t,i,o){const s=t.x-e.size.x/2,n=t.x+e.size.x/2,a=t.z-e.size.z/2,c=t.z+e.size.z/2,r=o.x-i.size.x/2,l=o.x+i.size.x/2,d=o.z-i.size.z/2,p=o.z+i.size.z/2;return!(n<r||s>l||c<d||a>p)}getObjectBounds(e,t){return{minX:t.x-e.size.x/2,maxX:t.x+e.size.x/2,minY:t.y-e.size.y/2,maxY:t.y+e.size.y/2,minZ:t.z-e.size.z/2,maxZ:t.z+e.size.z/2}}boundsOverlap(e,t){return!(e.maxX<t.minX||e.minX>t.maxX||e.maxY<t.minY||e.minY>t.maxY||e.maxZ<t.minZ||e.minZ>t.maxZ)}addObject(e,t){return!!this.canAccommodate(e,t)&&(this.currentState.set(e.id,{object:e,position:t,timestamp:Date.now()}),this.updateSpace(),!0)}removeObject(e){const t=this.currentState.delete(e);return t&&this.updateSpace(),t}updateSpace(){this.history.push({state:new Map(this.currentState),timestamp:Date.now()}),this.onStateChange&&this.onStateChange(this.currentState)}getCurrentVolume(){let e=0;for(const[t,i]of this.currentState){const t=i.object;e+=t.size.x*t.size.y*t.size.z}return e}getUtilization(){return this.getCurrentVolume()/this.capacity}}class s{constructor(e,t){this.id=e,this.size=t.size||{x:1,y:1,z:1},this.weight=t.weight||1,this.constraints=t.constraints||[],this.interactions=t.interactions||[],this.state="available",this.entity=null,this.material=t.material||null,this.color=t.color||new pc.Color(.5,.5,.5)}interactsWith(e,t){return this.interactions.some(i=>i.applies(e,t))}createEntity(e,t){if(this.entity=t.create(this.id,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[this.size.x/2,this.size.y/2,this.size.z/2]},rigidbody:{type:"static"}},scale:[this.size.x,this.size.y,this.size.z],tags:["puzzle_object","interactive"]}),this.entity.model){const e=new pc.StandardMaterial;e.diffuse=this.color,e.update(),this.entity.model.meshInstances.forEach(t=>t.material=e)}return this.entity}}class n{constructor(e){this.space=new o(e.space),this.objects=e.objects.map(e=>new s(e.id,e)),this.objectives=e.objectives||[],this.currentScore=0,this.isComplete=!1,this.draggedObject=null,this.app=null,this.space.onStateChange=e=>{this.evaluateObjectives(),this.calculateScore()}}initialize(e,t,i){this.app=e,this.parentEntity=i,this.createSpaceVisualization(t),this.objects.forEach(i=>{i.createEntity(e,t),i.entity&&(this.parentEntity.addChild(i.entity),this.setupObjectInteraction(i))}),this.arrangeInitialObjects()}createSpaceVisualization(e){if(this.containerEntity=e.create("puzzle_container",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[this.space.bounds.width/2,this.space.bounds.height/2,this.space.bounds.depth/2]}},scale:[this.space.bounds.width,this.space.bounds.height,this.space.bounds.depth],position:[this.space.bounds.width/2,this.space.bounds.height/2,this.space.bounds.depth/2],tags:["puzzle_container"]}),this.containerEntity.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.3,.4),e.opacity=.3,e.blendType=pc.BLEND_NORMAL,e.update(),this.containerEntity.model.meshInstances.forEach(t=>t.material=e)}this.parentEntity.addChild(this.containerEntity),this.createPlacementGrid(e)}createPlacementGrid(e){const t=.5,i=this.containerEntity.getPosition(),o=this.space.bounds,s=Math.floor(o.width/t)+1;for(let n=0;n<s;n++){const s=n*t-o.width/2,a=e.create(`grid_line_x_${n}`,{components:{model:{type:"box"}},scale:[.05,.05,o.depth],position:[i.x+s,i.y-o.height/2+.02,i.z],tags:["grid_indicator"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.8,.9,.8),e.opacity=.6,e.blendType=pc.BLEND_NORMAL,e.update(),a.model.meshInstances.forEach(t=>t.material=e)}this.parentEntity.addChild(a)}const n=Math.floor(o.depth/t)+1;for(let s=0;s<n;s++){const n=s*t-o.depth/2,a=e.create(`grid_line_z_${s}`,{components:{model:{type:"box"}},scale:[o.width,.05,.05],position:[i.x,i.y-o.height/2+.02,i.z+n],tags:["grid_indicator"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.8,.9,.8),e.opacity=.6,e.blendType=pc.BLEND_NORMAL,e.update(),a.model.meshInstances.forEach(t=>t.material=e)}this.parentEntity.addChild(a)}}arrangeInitialObjects(){const e=this.space.bounds.height;let t=this.objects.length/2*-3;this.objects.forEach((i,o)=>{if(i.entity){const o=e+2;i.entity.setPosition(t,o,-this.space.bounds.depth-2),t+=3}})}setupObjectInteraction(e){e.entity&&(e.entity.puzzle=this,e.entity.puzzleObject=e,this.app.systems.interaction&&e.entity.addComponent("interaction",{onInteract:()=>this.startDrag(e.id)}))}startDrag(e){const t=this.objects.find(t=>t.id===e);t&&"available"===t.state&&(this.draggedObject=t,t.state="dragging",this.app.fire&&this.app.fire("puzzle:drag_start",{object:t}))}updateDrag(e){if(!this.draggedObject||!this.draggedObject.entity)return;this.draggedObject.entity.setPosition(e.x,e.y,e.z);const t=this.space.canAccommodate(this.draggedObject,e);this.showValidityFeedback(t)}completeDrop(e){if(!this.draggedObject)return console.log("[SharedSpacePuzzle] completeDrop called but no draggedObject"),!1;console.log(`[SharedSpacePuzzle] Attempting to place ${this.draggedObject.id} at`,e);const t=this.attemptPlacement(this.draggedObject.id,e);if(console.log("[SharedSpacePuzzle] Placement result:",t),t)this.draggedObject.state="placed",console.log(`[SharedSpacePuzzle] Firing placement_success event for ${this.draggedObject.id}`),this.app.fire&&this.app.fire("puzzle:placement_success",{object:this.draggedObject,position:e});else{if(this.draggedObject.state="available",this.draggedObject.entity&&this.draggedObject.entity.model&&this.draggedObject.entity.model.meshInstances){const e=this.draggedObject.entity.model.meshInstances[0].material;e.emissive=new pc.Color(0,0,0),e.opacity=1,e.blendType=pc.BLEND_NONE,e.update()}this.app.fire&&this.app.fire("puzzle:placement_failed",{object:this.draggedObject,position:e})}return this.draggedObject=null,t}showValidityFeedback(e){if(this.draggedObject&&this.draggedObject.entity)try{if(this.draggedObject.entity.model&&this.draggedObject.entity.model.meshInstances){const t=this.draggedObject.entity.model.meshInstances[0].material;e?(t.emissive=new pc.Color(0,.5,0),t.opacity=.8):(t.emissive=new pc.Color(.5,0,0),t.opacity=.8),t.blendType=pc.BLEND_NORMAL,t.update(),console.log(`[SharedSpace] Visual feedback: ${e?"VALID":"INVALID"} placement for ${this.draggedObject.id}`)}}catch(e){console.error("[SharedSpace] Error updating visual feedback:",e)}}attemptPlacement(e,t){const i=this.objects.find(t=>t.id===e);if(!i)return!1;if(this.space.addObject(i,t)){if(i.entity&&(i.entity.setPosition(t.x,t.y,t.z),i.entity.model&&i.entity.model.meshInstances)){const e=i.entity.model.meshInstances[0].material;e.emissive=new pc.Color(0,0,0),e.opacity=1,e.blendType=pc.BLEND_NONE,e.update()}return!0}return!1}evaluateObjectives(){this.objectives.forEach(e=>{switch(e.type){case"fit_all_items":e.completed=this.space.currentState.size===this.objects.length;break;case"efficiency":const t=this.space.getUtilization();e.completed=t>=e.target,e.progress=t}}),this.isComplete=this.objectives.every(e=>e.completed),this.isComplete&&this.app.fire&&this.app.fire("puzzle:completed",{puzzle:this})}calculateScore(){this.currentScore=0,this.currentScore+=10*this.space.currentState.size;const e=this.space.getUtilization();return this.currentScore+=Math.floor(100*e),this.currentScore}getStatus(){return{placedObjects:this.space.currentState.size,totalObjects:this.objects.length,utilization:this.space.getUtilization(),score:this.currentScore,isComplete:this.isComplete,objectives:this.objectives.map(e=>({type:e.type,description:e.description,completed:e.completed,progress:e.progress}))}}}const a={id:"puzzle_test",title:"Shared Space Puzzle Test",type:"scene",async build(e,t,i){console.log("[PuzzleTestScene] Building puzzle test scene...");const o=i.create("puzzle_test_root",{position:[0,0,0],tags:["scene_root"]}),s={space:{bounds:{width:6,height:4,depth:4},capacity:96,rules:["no_overlap","gravity_simulation"]},objects:[{id:"book_red",size:{x:2,y:.3,z:1.5},weight:1,color:new pc.Color(.8,.2,.2)},{id:"book_blue",size:{x:2,y:.3,z:1.5},weight:1,color:new pc.Color(.2,.2,.8)},{id:"laptop",size:{x:3,y:.2,z:2},weight:2,color:new pc.Color(.3,.3,.3)},{id:"box_small",size:{x:1.5,y:1.5,z:1.5},weight:1,color:new pc.Color(.6,.4,.2)},{id:"cylinder_tool",size:{x:.8,y:2,z:.8},weight:1,color:new pc.Color(.5,.7,.3)},{id:"flat_panel",size:{x:3,y:.1,z:2.5},weight:1,color:new pc.Color(.7,.7,.2)}],objectives:[{type:"fit_all_items",description:"Pack all items in the container",completed:!1},{type:"efficiency",target:.7,description:"Use at least 70% of container space",completed:!1,progress:0}]};this.puzzle=new n(s),this.puzzle.initialize(e,i,o);const a=i.create("instruction_panel",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[3,1,.1]}},position:[0,3,-8],scale:[6,2,.2],tags:["instruction_panel"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.1,.1,.2),e.emissive=new pc.Color(.05,.05,.1),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}o.addChild(a);const c=i.create("progress_display",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,.5,.1]}},position:[8,2,0],scale:[4,1,.2],tags:["progress_display"]});if(c.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.3,.2),e.update(),c.model.meshInstances.forEach(t=>t.material=e)}o.addChild(c);const r=i.create("drag_mode_indicator",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,.4,.1]}},position:[8,.5,0],scale:[4,.8,.2],tags:["drag_mode_indicator"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.1,.2,.4),e.emissive=new pc.Color(.05,.1,.2),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}o.addChild(r);const l=i.create("reset_button",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,.5,.5]},rigidbody:{type:"static"}},position:[-8,1,0],scale:[2,1,1],tags:["interactive","reset_button"]});if(l.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.6,.2,.2),e.emissive=new pc.Color(.2,.05,.05),e.update(),l.model.meshInstances.forEach(t=>t.material=e)}o.addChild(l);const d=i.createLight("point",{color:new pc.Color(1,1,1),intensity:2,range:20,position:[0,8,0]});o.addChild(d);const p=i.createLight("point",{color:new pc.Color(.8,.9,1),intensity:.8,range:15,position:[10,5,10]});return o.addChild(p),o},objectives:[{id:"puzzle_tutorial",name:"Puzzle Tutorial",description:"Drag objects to the container floor. Objects must align with the bottom grid to be valid. Use SPACE to change drag modes.",type:"simple",autoStart:!0,rewards:{experience:10}},{id:"place_all_items",name:"Pack All Items",description:"Fit all 6 objects into the container",type:"counter",target:6,progress:0,prerequisites:["puzzle_tutorial"],rewards:{experience:50}},{id:"achieve_efficiency",name:"Efficient Packing",description:"Achieve at least 70% space utilization",type:"simple",prerequisites:["place_all_items"],rewards:{experience:100,skillPoints:1}}],onLoad(e,t){console.log("[PuzzleTestScene] Puzzle test scene loaded");const i=t.getSystem("objectivemanager");console.log("[PuzzleTestScene] onLoad - ObjectManager:",i),console.log("[PuzzleTestScene] onLoad - ObjectManager type:",typeof i),console.log("[PuzzleTestScene] onLoad - Has defineObjective method:",i&&"function"==typeof i.defineObjective),i&&"function"==typeof i.defineObjective&&(i.clearAllObjectives(),this.objectives.forEach(e=>{i.defineObjective(e.id,e)}),i.startObjective("puzzle_tutorial"));const o=e.root.findByTag("scene_root")[0];o&&this.puzzle&&(e.interactionController&&(console.log("[PuzzleTestScene] Temporarily disabling default interaction controller"),e.off("update",e.interactionController.update,e.interactionController),this.defaultInteractionDisabled=!0),this.setupDragDropMechanics(e),this.interactionHandler=i=>{this.handleInteraction(i,e,t)},o.multiRoom&&o.multiRoom.setSceneInteractionHandler(this.interactionHandler),this.setupPuzzleEvents(e,t),e.fire("ui:notification",{text:"Drag objects to container floor! Must align with bottom grid. Press SPACE to change drag mode.",type:"info",duration:5e3}))},setupDragDropMechanics(e){this.app=e,this.isDragging=!1,this.draggedEntity=null,this.dragOffset=new pc.Vec3,this.dragPlaneNormal=null,this.dragPlanePoint=null,this.dragMode="XZ",this.camera=e.root.findByName("Camera")||e.root.findByTag("camera")[0]||e.root.findByTag("main_camera")[0],console.log("[PuzzleTestScene] Setting up drag drop mechanics, camera found:",!!this.camera),e.keyboard&&e.keyboard.on(pc.EVENT_KEYDOWN,e=>{e.key===pc.KEY_SPACE&&this.toggleDragMode()}),e.mouse&&(e.mouse.on(pc.EVENT_MOUSEDOWN,t=>{t.button===pc.MOUSEBUTTON_LEFT&&(console.log("[PuzzleTestScene] Mouse down at:",t.x,t.y),this.startDragFromInput(t.x,t.y,e))}),e.mouse.on(pc.EVENT_MOUSEMOVE,t=>{this.isDragging&&this.updateDragFromInput(t.x,t.y,e)}),e.mouse.on(pc.EVENT_MOUSEUP,t=>{t.button===pc.MOUSEBUTTON_LEFT&&this.isDragging&&this.endDragFromInput(e)})),e.touch&&(e.touch.on(pc.EVENT_TOUCHSTART,t=>{if(1===t.touches.length){const i=t.touches[0];console.log("[PuzzleTestScene] Touch start at:",i.x,i.y),this.startDragFromInput(i.x,i.y,e),t.event.preventDefault()}}),e.touch.on(pc.EVENT_TOUCHMOVE,t=>{if(this.isDragging&&1===t.touches.length){const i=t.touches[0];this.updateDragFromInput(i.x,i.y,e),t.event.preventDefault()}}),e.touch.on(pc.EVENT_TOUCHEND,t=>{this.isDragging&&(this.endDragFromInput(e),t.event.preventDefault())})),this.showDragModeIndicator()},toggleDragMode(){"XZ"===this.dragMode?this.dragMode="XY":"XY"===this.dragMode?this.dragMode="YZ":this.dragMode="XZ",console.log(`[PuzzleTestScene] Drag mode switched to: ${this.dragMode} plane`),this.showDragModeIndicator()},showDragModeIndicator(){let e,t;switch(this.dragMode){case"XZ":e="HORIZONTAL DRAG",t="Move objects left/right and forward/back";break;case"XY":e="VERTICAL DRAG (Front View)",t="Move objects up/down and left/right";break;case"YZ":e="VERTICAL DRAG (Side View)",t="Move objects up/down and forward/back";break;default:e="UNKNOWN MODE",t="Unknown drag mode"}this.app&&this.app.fire&&this.app.fire("ui:notification",{text:`${e}: ${t}`,type:"info",duration:2500}),this.updateModeIndicator(this.dragMode,this.app),this.app&&this.app.fire&&this.app.fire("puzzle:mode_change",{mode:this.dragMode})},showBriefingInstructions(){const e=["π― PUZZLE OBJECTIVE: Pack all 6 objects into the container","","π¦ PLACEMENT RULES:","β’ Objects must align with the bottom grid to be valid","β’ Objects cannot overlap or float above the container floor","β’ Use the grid lines as visual guides for positioning","","πΉοΈ DRAG CONTROLS:","β’ SPACE - Cycle through drag modes:"," - Horizontal: Move left/right and forward/back"," - Vertical (Front): Move up/down and left/right"," - Vertical (Side): Move up/down and forward/back","","π‘ TIPS:","β’ Try different drag modes to position objects precisely","β’ Look for the green grid indicator showing valid placement area","β’ Objects will change color during dragging to show validity"].join("\n");this.app&&this.app.fire&&this.app.fire("ui:notification",{text:e,type:"info",duration:8e3})},updateModeIndicator(e,t){const i=t.root.findByTag("drag_mode_indicator")[0];if(i&&i.model&&i.model.meshInstances){const t=i.model.meshInstances[0].material;switch(e){case"XZ":t.diffuse=new pc.Color(.2,.4,.1),t.emissive=new pc.Color(.1,.2,.05);break;case"XY":t.diffuse=new pc.Color(.1,.2,.4),t.emissive=new pc.Color(.05,.1,.2);break;case"YZ":t.diffuse=new pc.Color(.4,.2,.1),t.emissive=new pc.Color(.2,.1,.05)}t.update()}},startDragFromInput(e,t,i){try{const o=this.camera;if(!o||!o.camera)return void console.warn("[PuzzleTestScene] No camera available for raycast");console.log("[PuzzleTestScene] Starting drag from input:",e,t);const s=o.camera.screenToWorld(e,t,o.camera.nearClip),n=o.camera.screenToWorld(e,t,o.camera.farClip);if(!s||!n||void 0===s.x||void 0===n.x)return void console.error("[PuzzleTestScene] Invalid screenToWorld results:",{ray:s,rayEnd:n});const a=(new pc.Vec3).copy(n).sub(s);if(!a||void 0===a.x||void 0===a.y||void 0===a.z)return void console.error("[PuzzleTestScene] Invalid ray vector before normalization:",a);const c=a.length();if(0===c||!isFinite(c))return void console.error("[PuzzleTestScene] Zero or invalid length ray vector:",a,"length:",c);const r=a.normalize();if(!(r&&void 0!==r.x&&void 0!==r.y&&void 0!==r.z&&isFinite(r.x)&&isFinite(r.y)&&isFinite(r.z)))return void console.error("[PuzzleTestScene] Invalid ray direction after normalization:",r);console.log("[PuzzleTestScene] Ray:",s,"Dir:",r);const l=this.raycastForPuzzleObject(s,r,i);console.log("[PuzzleTestScene] Hit entity:",l?.name,"has puzzleObject:",!!l?.puzzleObject),l&&l.puzzleObject&&this.startDragEntity(l,s,r)}catch(e){console.error("[PuzzleTestScene] Error in startDragFromInput:",e)}},raycastForPuzzleObject(e,t,i){try{if(i.systems.rigidbody&&i.systems.rigidbody.raycastFirst&&"undefined"!=typeof Ammo)try{const o=e.clone().add(t.clone().scale(100)),s=i.systems.rigidbody.raycastFirst(e,o);if(s&&s.entity&&s.entity.tags.has("puzzle_object"))return console.log("[PuzzleTestScene] Physics raycast hit:",s.entity.name),s.entity}catch(e){console.warn("[PuzzleTestScene] Physics raycast failed, using manual method:",e.message)}let o=null,s=1/0;const n=i.root.findByTag("puzzle_object");return console.log("[PuzzleTestScene] Found",n.length,"puzzle objects for manual raycast"),n.forEach(i=>{try{const n=i.getPosition(),a=i.getLocalScale(),c=.8*Math.max(a.x,a.y,a.z),r=n.clone().sub(e).dot(t);if(r>0){const a=e.clone().add(t.clone().scale(r)),l=n.distance(a);console.log("[PuzzleTestScene] Testing entity:",i.name,"distance to ray:",l.toFixed(2),"radius:",c.toFixed(2)),l<=c&&r<s&&(s=r,o=i,console.log("[PuzzleTestScene] New closest entity:",i.name))}}catch(e){console.warn("[PuzzleTestScene] Error processing entity:",i.name,e)}}),o}catch(e){return console.error("[PuzzleTestScene] Error in raycastForPuzzleObject:",e),null}},startDragEntity(e,t,i){try{if(!e.puzzleObject)return;if(!(t&&i&&void 0!==t.x&&void 0!==t.y&&void 0!==t.z&&void 0!==i.x&&void 0!==i.y&&void 0!==i.z&&isFinite(t.x)&&isFinite(t.y)&&isFinite(t.z)&&isFinite(i.x)&&isFinite(i.y)&&isFinite(i.z)))return void console.error("[PuzzleTestScene] Invalid ray parameters for drag:",{rayStart:t,rayDir:i});this.isDragging=!0,this.draggedEntity=e;const o=e.getPosition();if(!o||void 0===o.x)return console.error("[PuzzleTestScene] Invalid object position for drag:",o),this.isDragging=!1,void(this.draggedEntity=null);let s;switch(this.dragMode){case"XZ":default:s=new pc.Vec3(0,1,0);break;case"XY":s=new pc.Vec3(0,0,1);break;case"YZ":s=new pc.Vec3(1,0,0)}const n=o.clone(),a=new pc.Vec3;let c=!1;try{const e=(new pc.Vec3).copy(n).sub(t),o=i.dot(s);if(Math.abs(o)>1e-4){const n=e.dot(s)/o;a.copy(t).add(i.clone().scale(n)),c=!0}else console.warn("[PuzzleTestScene] Ray parallel to plane, cannot intersect"),c=!1}catch(e){console.error("[PuzzleTestScene] Manual plane intersection error:",e),c=!1}c&&void 0!==a.x?(this.dragOffset.copy(o).sub(a),this.dragPlaneNormal=s.clone(),this.dragPlanePoint=n.clone()):(console.warn("[PuzzleTestScene] Plane intersection failed, using zero offset"),this.dragOffset.set(0,0,0),this.dragPlaneNormal=s.clone(),this.dragPlanePoint=o.clone()),this.puzzle.startDrag(e.puzzleObject.id)}catch(e){console.error("[PuzzleTestScene] Error in startDragEntity:",e),this.isDragging=!1,this.draggedEntity=null}},updateDragFromInput(e,t,i){try{if(!this.isDragging||!this.draggedEntity||!this.camera)return;const i=this.camera;if(!i.camera)return;const o=i.camera.screenToWorld(e,t,i.camera.nearClip),s=i.camera.screenToWorld(e,t,i.camera.farClip);if(!o||!s||void 0===o.x||void 0===s.x)return void console.warn("[PuzzleTestScene] Invalid screenToWorld results in drag update:",{ray:o,rayEnd:s});const n=(new pc.Vec3).copy(s).sub(o).normalize();if(!n||void 0===n.x||0===n.length())return void console.warn("[PuzzleTestScene] Invalid ray direction in drag update:",n);const a=new pc.Vec3;let c=!1;try{if(this.dragPlaneNormal&&this.dragPlanePoint&&o&&n){const e=(new pc.Vec3).copy(this.dragPlanePoint).sub(o),t=n.dot(this.dragPlaneNormal);if(Math.abs(t)>1e-4){const i=e.dot(this.dragPlaneNormal)/t;a.copy(o).add(n.clone().scale(i)),c=!0}}}catch(e){console.error("[PuzzleTestScene] Manual plane intersection error in updateDrag:",e),c=!1}if(c&&void 0!==a.x){const e=a.add(this.dragOffset);this.puzzle.updateDrag(e)}}catch(e){console.error("[PuzzleTestScene] Error in updateDragFromInput:",e)}},endDragFromInput(e){try{if(!this.isDragging||!this.draggedEntity)return;const e=this.draggedEntity.getPosition();this.puzzle.completeDrop(e),this.isDragging=!1,this.draggedEntity=null}catch(e){console.error("[PuzzleTestScene] Error in endDragFromInput:",e)}},returnToOriginalPosition(){if(!this.draggedEntity)return;const e=this.draggedEntity.puzzleObject,t=this.puzzle.objects.findIndex(t=>t.id===e.id),i=this.puzzle.objects.length/2*-3+3*t;this.draggedEntity.setPosition(i,0,-this.puzzle.space.bounds.depth-3)},setupPuzzleEvents(e,t){const i=t.getSystem("objectivemanager");e.on("ui:request_instructions",()=>{this.showBriefingInstructions()}),e.on("puzzle:placement_success",o=>{const s=this.puzzle.getStatus();console.log("[PuzzleTestScene] Placement success! Status:",s),console.log("[PuzzleTestScene] ObjectManager exists:",!!i),console.log("[PuzzleTestScene] ObjectManager type:",typeof i),console.log("[PuzzleTestScene] ObjectManager methods:",i?Object.keys(i):"null"),console.log("[PuzzleTestScene] Has defineObjective method:",i&&"function"==typeof i.defineObjective),e.fire("ui:notification",{text:`Placed ${o.object.id}! Progress: ${s.placedObjects}/${s.totalObjects}`,type:"success",duration:2e3}),i&&1===s.placedObjects&&i.isObjectiveActive("puzzle_tutorial")&&(console.log("[PuzzleTestScene] Completing tutorial objective"),i.completeObjective("puzzle_tutorial"),i.startObjective("place_all_items")),i&&i.isObjectiveActive("place_all_items")&&(console.log("[PuzzleTestScene] Updating place_all_items objective with progress:",s.placedObjects),i.updateObjective("place_all_items",s.placedObjects)),i&&s.placedObjects===s.totalObjects&&i.isComplete("place_all_items")&&(console.log("[PuzzleTestScene] Starting efficiency objective"),i.startObjective("achieve_efficiency"),this.checkEfficiencyObjective(e,t,s)),this.updateProgressDisplay(e,s)}),e.on("puzzle:placement_failed",t=>{e.fire("ui:notification",{text:`Cannot place ${t.object.id} here!`,type:"error",duration:2e3})}),e.on("puzzle:completed",i=>{const o=this.puzzle.getStatus();e.fire("ui:notification",{text:`Puzzle Complete! Score: ${o.score} - Efficiency: ${Math.round(100*o.utilization)}%`,type:"success",duration:5e3}),this.checkEfficiencyObjective(e,t,o)})},checkEfficiencyObjective(e,t,i){const o=t.getSystem("objectivemanager");o&&o.isObjectiveActive("achieve_efficiency")&&i.utilization>=.7&&(o.completeObjective("achieve_efficiency"),e.fire("ui:notification",{text:`Excellent! ${Math.round(100*i.utilization)}% efficiency achieved!`,type:"success",duration:4e3}))},updateProgressDisplay(e,t){const i=e.root.findByTag("progress_display")[0];if(i&&i.model){const e=i.model.meshInstances[0].material,o=t.placedObjects/t.totalObjects;e.diffuse=new pc.Color(.2+.3*o,.3+.4*o,.2),t.isComplete&&(e.emissive=new pc.Color(.1,.3,.1)),e.update()}},handleInteraction(e,t,i){console.log("[PuzzleTestScene] Interaction with:",e),"reset_button"===e&&this.resetPuzzle(t)},resetPuzzle(e){this.puzzle&&(this.puzzle.space.currentState.clear(),this.puzzle.objects.forEach(e=>{if(e.state="available",e.entity){const t=e.entity.model.meshInstances[0].material;t.emissive=new pc.Color(0,0,0),t.update()}}),this.puzzle.arrangeInitialObjects(),this.puzzle.objectives.forEach(e=>{e.completed=!1,e.progress=0}),this.puzzle.isComplete=!1,this.puzzle.currentScore=0,e.fire("ui:notification",{text:"Puzzle reset! Try again.",type:"info",duration:2e3}),this.updateProgressDisplay(e,this.puzzle.getStatus()))},onUnload(e,t){console.log("[PuzzleTestScene] Cleaning up puzzle test scene..."),e.mouse&&(e.mouse.off(pc.EVENT_MOUSEDOWN),e.mouse.off(pc.EVENT_MOUSEMOVE),e.mouse.off(pc.EVENT_MOUSEUP)),e.touch&&(e.touch.off(pc.EVENT_TOUCHSTART),e.touch.off(pc.EVENT_TOUCHMOVE),e.touch.off(pc.EVENT_TOUCHEND)),e.keyboard&&e.keyboard.off(pc.EVENT_KEYDOWN),e.off("puzzle:placement_success"),e.off("puzzle:placement_failed"),e.off("puzzle:completed"),e.off("ui:request_instructions"),this.defaultInteractionDisabled&&e.interactionController&&(console.log("[PuzzleTestScene] Re-enabling default interaction controller"),e.on("update",e.interactionController.update,e.interactionController),this.defaultInteractionDisabled=!1),this.interactionHandler=null,this.puzzle=null}}}}]);
|
565.bundle.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[565],{565:(e,i,t)=>{t.r(i),t.d(i,{default:()=>n});class r{constructor(e){this.app=e,this.spinners=[],this.oscillators=[],this.drivers=[],this.textureCache=new Map,this.app.on("update",e=>this.updateAnimations(e))}build(e,i){const t=new pc.Entity(e.name||"ProceduralObject");return i.addChild(t),this.buildNode(e,t),t}buildNode(e,i){if(!e)return null;const t=(e.op||e.type||"prim").toLowerCase();if("group"===t){const t=new pc.Entity(e.name||"group");return i.addChild(t),this.applyTransform(t,e),(e.children||[]).forEach(e=>this.buildNode(e,t)),e.spin&&this.addSpinner(t,e.spin),t}if("mirror"===t){const t=(e.axis||"x").toLowerCase(),r=new pc.Entity(e.name||`mirror_${t}`);i.addChild(r),(e.children||[]).forEach(e=>this.buildNode(e,r));const o=r.clone();r.parent.addChild(o);const n=new pc.Vec3(1,1,1);return"x"===t&&(n.x=-1),"y"===t&&(n.y=-1),"z"===t&&(n.z=-1),o.setLocalScale(n),r}if("radial"===t){const t=e.count||4,r=e.radius||1,o=e.phase||0,n=(e.axis||"y").toLowerCase(),a=new pc.Entity(e.name||`radial_${n}`);i.addChild(a),e.center&&a.setLocalPosition(this.vec3(e.center));for(let i=0;i<t;i++){const l=new pc.Entity(`r_${i}`);a.addChild(l);const s=360/t*i+o;"x"===n?l.setLocalEulerAngles(s,0,0):"y"===n?l.setLocalEulerAngles(0,s,0):l.setLocalEulerAngles(0,0,s);const c=new pc.Entity(`o_${i}`);l.addChild(c),"z"===n?c.setLocalPosition(r,0,0):c.setLocalPosition(0,0,r),(e.children||[]).forEach(e=>this.buildNode(e,c))}return e.spin&&this.addSpinner(a,e.spin),a}if("corners"===t){const t=e.dx||1,r=e.dz||1,o=new pc.Entity(e.name||"corners");i.addChild(o),e.center&&o.setLocalPosition(this.vec3(e.center));const n=[[t,0,r],[t,0,-r],[-t,0,r],[-t,0,-r]];for(let i=0;i<n.length;i++){const t=new pc.Entity(`c_${i}`);o.addChild(t),t.setLocalPosition(n[i][0],n[i][1],n[i][2]),(e.children||[]).forEach(e=>this.buildNode(e,t))}return e.spin&&this.addSpinner(o,e.spin),o}const r=new pc.Entity(e.name||"part"),o=(e.primitive||"box").toLowerCase();return r.addComponent("render",{type:o}),this.applyTransform(r,e),r.render.material=this.makeMaterial(e),i.addChild(r),e.spin&&this.addSpinner(r,e.spin),r}applyTransform(e,i){i.pos&&e.setLocalPosition(this.vec3(i.pos)),i.rot&&e.setLocalEulerAngles(this.vec3(i.rot)),i.scl&&e.setLocalScale(this.vec3(i.scl))}vec3(e){return new pc.Vec3(e[0]||0,e[1]||0,e[2]||0)}color(e){return new pc.Color(e[0]||1,e[1]||1,e[2]||1)}makeMaterial(e){const i=new pc.StandardMaterial;if(e&&e.color){const t=this.color(e.color);i.diffuse=t.clone(),i.emissive=t.clone(),i.emissiveIntensity=.35}else i.diffuse=new pc.Color(.75,.75,.78),i.emissive=new pc.Color(.75,.75,.78),i.emissiveIntensity=.35;return i.useMetalness=!1,i.shadingModel=pc.SPECULAR_BLINN,i.roughness=1,i.update(),i}addSpinner(e,i){const t=i.rpm||24,r=new pc.Vec3(i.axis?.[0]||0,i.axis?.[1]||1,i.axis?.[2]||0);this.spinners.push({entity:e,rpm:t,axis:r})}updateAnimations(e){for(let i=0;i<this.spinners.length;i++){const t=this.spinners[i];if(t.entity&&!t.entity.destroyed){const i=6*t.rpm*e;t.entity.rotate(t.axis.x*i,t.axis.y*i,t.axis.z*i)}}for(let i=0;i<this.oscillators.length;i++){const t=this.oscillators[i];if(t.entity&&!t.entity.destroyed){t.t+=e;const i=t.base+Math.sin(2*t.t*Math.PI*t.speed+t.phase)*t.amp,r=t.entity.getLocalEulerAngles();"x"===t.axis&&t.entity.setLocalEulerAngles(i,r.y,r.z),"y"===t.axis&&t.entity.setLocalEulerAngles(r.x,i,r.z),"z"===t.axis&&t.entity.setLocalEulerAngles(r.x,r.y,i)}}for(let i=0;i<this.drivers.length;i++)try{this.drivers[i](e)}catch(e){console.warn("Driver error:",e)}}addOscillator(e,i,t,r,o=0,n=0){this.oscillators.push({entity:e,axis:i,amp:t,speed:r,base:o,phase:n,t:0})}addDriver(e){this.drivers.push(e)}cleanup(){this.spinners.length=0,this.oscillators.length=0,this.drivers.length=0,this.textureCache.clear()}createTexture(e){if(!this.app.graphicsDevice)return console.warn("[ProceduralBuilder] Graphics device not available for texture creation"),null;const i=document.createElement("canvas");i.width=128,i.height=128,e(i.getContext("2d"),i.width,i.height);const t=new pc.Texture(this.app.graphicsDevice,{width:i.width,height:i.height,format:pc.PIXELFORMAT_R8_G8_B8_A8});return t.setSource(i),t}applyMaterialPreset(e,i){if(!e||!e.render)return;const t=new pc.StandardMaterial;switch(i){case"wood":const e=this.getWoodTexture();e&&(t.diffuseMap=e,t.emissiveMap=e),t.roughness=.85,t.useMetalness=!0,t.metalness=.05;break;case"metal":const i=this.getMetalTexture();i&&(t.diffuseMap=i,t.emissiveMap=i),t.roughness=.35,t.useMetalness=!0,t.metalness=.8;break;case"plastic":const r=this.getPlasticTexture();r&&(t.diffuseMap=r,t.emissiveMap=r),t.roughness=.6,t.useMetalness=!0,t.metalness=.2}t.emissive=new pc.Color(1,1,1),t.update(),e.render.material=t}getWoodTexture(){if(!this.textureCache.has("wood")){const e=this.createTexture((e,i,t)=>{e.fillStyle="#7a5533",e.fillRect(0,0,i,t);for(let r=0;r<10;r++)e.fillStyle=r%2?"#6d4b2d":"#805a38",e.fillRect(0,r*(t/10),i,t/20);e.globalAlpha=.15,e.fillStyle="#000";for(let r=0;r<24;r++)e.beginPath(),e.arc(13*r%i,29*r%t,6+7*r%5,0,2*Math.PI),e.fill();e.globalAlpha=1});e&&this.textureCache.set("wood",e)}return this.textureCache.get("wood")||null}getMetalTexture(){if(!this.textureCache.has("metal")){const e=this.createTexture((e,i,t)=>{const r=e.createLinearGradient(0,0,i,t);r.addColorStop(0,"#d7dbe0"),r.addColorStop(.5,"#aeb6bf"),r.addColorStop(1,"#e3e6ea"),e.fillStyle=r,e.fillRect(0,0,i,t),e.globalAlpha=.15,e.fillStyle="#fff";for(let r=0;r<40;r++)e.fillRect(11*r%i,23*r%t,2,2);e.globalAlpha=1});e&&this.textureCache.set("metal",e)}return this.textureCache.get("metal")||null}getPlasticTexture(){if(!this.textureCache.has("plastic")){const e=this.createTexture((e,i,t)=>{e.fillStyle="#2a3b58",e.fillRect(0,0,i,t),e.globalAlpha=.25,e.fillStyle="#3f567f";for(let r=0;r<80;r++)e.fillRect(17*r%i,13*r%t,3,3);e.globalAlpha=1});e&&this.textureCache.set("plastic",e)}return this.textureCache.get("plastic")||null}}const o={windmill:{op:"group",name:"Windmill",children:[{type:"prim",primitive:"cylinder",name:"Tower",pos:[0,3,0],scl:[1.2,6,1.2],color:[.85,.85,.82]},{type:"prim",primitive:"cone",name:"Cap",pos:[0,6.8,0],scl:[1.4,1.1,1.4],color:[.6,.6,.6]},{op:"group",name:"Hub",pos:[0,6.4,1],children:[{type:"prim",primitive:"sphere",scl:[.35,.35,.35],color:[.4,.4,.45]},{op:"radial",name:"Blades",count:4,radius:.2,axis:"z",children:[{type:"prim",primitive:"box",name:"Blade",pos:[1.5,0,0],scl:[3,.2,.1],color:[.9,.9,.9]}]}],spin:{rpm:12,axis:[0,0,1]}}]},ferrisWheel:{op:"group",name:"FerrisWheel",children:[{type:"prim",primitive:"box",name:"StandL",pos:[-2,1,0],scl:[.3,2,.3],color:[.4,.42,.45]},{type:"prim",primitive:"box",name:"StandR",pos:[2,1,0],scl:[.3,2,.3],color:[.4,.42,.45]},{op:"group",name:"Wheel",pos:[0,2.2,0],rot:[0,0,0],children:[{op:"radial",name:"RimSegs",count:20,radius:2,axis:"x",children:[{type:"prim",primitive:"box",name:"RimSeg",pos:[0,0,0],scl:[.1,.15,.4],color:[.8,.2,.2]}]},{op:"radial",name:"Spokes",count:8,radius:0,axis:"x",children:[{type:"prim",primitive:"box",name:"Spoke",pos:[0,1,0],scl:[.05,2,.05],color:[.7,.7,.75]}]},{op:"radial",name:"Cabins",count:8,radius:2,axis:"x",children:[{type:"prim",primitive:"box",name:"Cabin",pos:[0,-.4,0],scl:[.3,.4,.5],color:[.1,.4,.85]}]},{type:"prim",primitive:"cylinder",name:"Hub",pos:[0,0,0],rot:[0,0,90],scl:[.2,.3,.2],color:[.3,.3,.35]}],spin:{rpm:2,axis:[1,0,0]}}]},workbench:{op:"group",name:"Workbench",children:[{type:"prim",primitive:"box",name:"Top",pos:[0,1,0],scl:[2,.12,1],color:[.7,.55,.4]},{op:"corners",name:"Legs",dx:.9,dz:.45,children:[{type:"prim",primitive:"cylinder",pos:[0,.47,0],scl:[.12,.94,.12],color:[.4,.3,.2]}]}]},industrialFan:{op:"group",name:"IndustrialFan",children:[{type:"prim",primitive:"cylinder",name:"Base",pos:[0,.4,0],scl:[.4,.1,.4],color:[.25,.25,.28]},{type:"prim",primitive:"cylinder",name:"Pole",pos:[0,1.2,0],scl:[.05,.8,.05],color:[.3,.3,.34]},{op:"group",name:"Head",pos:[0,1.9,0],children:[{type:"prim",primitive:"sphere",name:"Hub",scl:[.18,.18,.18],color:[.6,.6,.65]},{op:"radial",name:"FanBlades",count:5,radius:.15,axis:"z",children:[{type:"prim",primitive:"box",name:"Blade",pos:[.9,0,0],scl:[1.8,.05,.18],color:[.9,.9,.95]}]}],spin:{rpm:15,axis:[0,0,1]}}]},toolRack:{op:"group",name:"ToolRack",children:[{type:"prim",primitive:"box",name:"Frame",pos:[0,1,0],scl:[.1,2,1.5],color:[.3,.3,.3]},{op:"radial",name:"Tools",count:8,radius:.6,axis:"y",center:[0,1,0],children:[{type:"prim",primitive:"cylinder",name:"Tool",pos:[0,0,.3],scl:[.05,.8,.05],color:[.8,.6,.2]}]}]}},n={id:"kitbash_gallery",title:"Kitbash Gallery",type:"scene",async build(e,i,t){console.log("[KitbashGallery] Building procedural object gallery...");const o=i.createRoom({size:[30,6,20],lighting:"bright",position:[0,0,0]});o.name="KitbashGallery";const n=new r(e);return this.proceduralBuilder=n,this.createGalleryDisplays(o,n,t),this.createInfoPanels(o,t),this.addGalleryLighting(o,t),console.log("[KitbashGallery] Gallery construction complete"),o},createGalleryDisplays(e,i,t){[{recipe:"windmill",position:[-8,0,-5],label:"Windmill\nRadial Blades + Spin"},{recipe:"ferrisWheel",position:[0,0,-5],label:"Ferris Wheel\nComplex Radial + Animation"},{recipe:"industrialFan",position:[8,0,-5],label:"Industrial Fan\nSpinner System"},{recipe:"workbench",position:[-8,0,2],label:"Workbench\nCorners Operation"},{recipe:"toolRack",position:[0,0,2],label:"Tool Rack\nRadial Tool Array"},{recipe:"hydraulicLift",position:[8,0,2],label:"Hydraulic Lift\nMirror + Group Operations"},{recipe:"serverRack",position:[-8,0,8],label:"Server Rack\nStacked Components"},{recipe:"assemblyLine",position:[0,0,8],label:"Assembly Line\nLinear Arrangement"},{recipe:"controlPanel",position:[8,0,8],label:"Control Panel\nInterface Elements"}].forEach((r,n)=>{const a=this.createDisplayPlatform(e,t,r.position,n);let l=o[r.recipe];if(l||(l=this.getCustomRecipe(r.recipe)),l){const e=i.build(l,a);e.addComponent("collision",{type:"box",halfExtents:[2,2,2]}),e.tags.add("interactive"),e.tags.add("procedural_object"),console.log(`[KitbashGallery] Created ${r.recipe} at ${r.position}`)}this.createLabel(a,t,r.label,[0,3,0])})},createDisplayPlatform(e,i,t,r){const o=i.create(`Platform_${r}`,{components:{render:{type:"cylinder"},collision:{type:"cylinder",radius:2,height:.2}},position:[t[0],t[1]-.1,t[2]],scale:[2,.2,2],tags:["platform"]}),n=new pc.StandardMaterial;return n.diffuse=new pc.Color(.8,.8,.9),n.emissive=new pc.Color(.1,.1,.15),n.emissiveIntensity=.2,n.metalness=.3,n.roughness=.7,n.update(),o.render.material=n,e.addChild(o),o},createInfoPanels(e,i){const t=i.create("InfoPanel",{components:{render:{type:"plane"}},position:[0,4,-8],rotation:[0,0,0],scale:[6,2,1],tags:["info_panel"]});this.createInfoMaterial(t,"PROCEDURAL KITBASH GALLERY","Explore complex 3D objects built from simple operations:\nβ’ Group: Container hierarchy\nβ’ Mirror: Symmetric copies\nβ’ Radial: Circular arrangements\nβ’ Corners: 4-point placement\nβ’ Spinning animations and materials"),e.addChild(t);const r=i.create("ControlsPanel",{components:{render:{type:"plane"}},position:[0,2,-8],rotation:[0,0,0],scale:[4,1,1],tags:["controls_panel"]});this.createInfoMaterial(r,"CONTROLS","F - Inspect procedural object details\nWASD - Move around gallery\nMouse - Look around"),e.addChild(r)},createLabel(e,i,t,r){const o=i.create("Label",{components:{render:{type:"plane"}},position:r,rotation:[-15,0,0],scale:[2,1,1],tags:["label"]});return this.createInfoMaterial(o,"",t,"#000","#fff"),e.addChild(o),o},createInfoMaterial(e,i,t,r="#1a1a2e",o="#00ff88"){const n=new pc.StandardMaterial;try{const a=document.createElement("canvas");a.width=512,a.height=256;const l=a.getContext("2d");l.fillStyle=r,l.fillRect(0,0,a.width,a.height),i&&(l.fillStyle=o,l.font="bold 24px Arial, sans-serif",l.textAlign="center",l.fillText(i,a.width/2,40)),l.fillStyle=o,l.font="16px Arial, sans-serif",l.textAlign="center";const s=t.split("\\n"),c=i?80:40,p=20;s.forEach((e,i)=>{l.fillText(e,a.width/2,c+i*p)});let d=null;if(e&&e.element&&e.element.app&&(d=e.element.app.graphicsDevice),!d&&window.app&&(d=window.app.graphicsDevice),d){const e=new pc.Texture(d,{width:a.width,height:a.height,format:pc.PIXELFORMAT_R8_G8_B8_A8});e.setSource(a),n.diffuseMap=e,n.emissiveMap=e,n.emissive=new pc.Color(1,1,1),n.emissiveIntensity=.8}else console.warn("[KitbashGallery] Graphics device not available, using simple material"),n.diffuse=new pc.Color(.1,.1,.2),n.emissive=new pc.Color(0,1,.5),n.emissiveIntensity=.5}catch(e){console.warn("[KitbashGallery] Error creating info material:",e),n.diffuse=new pc.Color(.1,.1,.2),n.emissive=new pc.Color(0,1,.5),n.emissiveIntensity=.5}n.cull=pc.CULLFACE_NONE,n.update(),e.render.material=n},addGalleryLighting(e,i){for(let t=0;t<3;t++)for(let r=0;r<3;r++){const o=i.create(`SpotLight_${t}_${r}`,{components:{light:{type:"spot",color:new pc.Color(1,1,.9),intensity:1.2,range:15,innerConeAngle:20,outerConeAngle:35,castShadows:!1}},position:[8*t-8,5,6.5*r-5],rotation:[60,0,0],tags:["gallery_light"]});e.addChild(o)}},getCustomRecipe:e=>({hydraulicLift:{op:"group",name:"HydraulicLift",children:[{type:"prim",primitive:"box",name:"Base",pos:[0,.2,0],scl:[2,.4,1.5],color:[.3,.3,.35]},{op:"mirror",axis:"x",children:[{type:"prim",primitive:"cylinder",name:"Piston",pos:[.8,1.5,0],scl:[.15,3,.15],color:[.8,.8,.85]}]},{type:"prim",primitive:"box",name:"Platform",pos:[0,2.8,0],scl:[2,.2,1.5],color:[.7,.7,.75]}]},serverRack:{op:"group",name:"ServerRack",children:[{type:"prim",primitive:"box",name:"Frame",pos:[0,1,0],scl:[1,2,.6],color:[.1,.1,.12]},{op:"group",name:"Servers",children:Array.from({length:8},(e,i)=>({type:"prim",primitive:"box",name:`Server_${i}`,pos:[0,.3+.2*i,.25],scl:[.9,.08,.4],color:[.2,.2,.25]}))}]},assemblyLine:{op:"group",name:"AssemblyLine",children:[{type:"prim",primitive:"box",name:"ConveyorBelt",pos:[0,.8,0],scl:[6,.1,1],color:[.2,.2,.2]},{op:"group",name:"Supports",children:Array.from({length:4},(e,i)=>({type:"prim",primitive:"cylinder",name:`Support_${i}`,pos:[1.67*i-2.5,.4,0],scl:[.08,.8,.08],color:[.4,.4,.45]}))},{op:"radial",name:"RollerDrum",count:12,radius:.3,axis:"x",center:[2.5,.8,0],children:[{type:"prim",primitive:"cylinder",name:"Roller",pos:[0,0,.25],scl:[.02,.02,.5],color:[.6,.6,.65]}],spin:{rpm:10,axis:[1,0,0]}}]},controlPanel:{op:"group",name:"ControlPanel",children:[{type:"prim",primitive:"box",name:"MainPanel",pos:[0,1.2,0],scl:[2,1.5,.2],color:[.15,.15,.18]},{op:"radial",name:"ButtonArray",count:12,radius:.4,axis:"z",center:[0,1.2,.15],children:[{type:"prim",primitive:"cylinder",name:"Button",scl:[.05,.05,.05],color:[.8,.2,.2]}]},{type:"prim",primitive:"box",name:"Screen",pos:[0,1.5,.12],scl:[.8,.4,.02],color:[.1,.3,.1]},{type:"prim",primitive:"cylinder",name:"Base",pos:[0,.3,0],scl:[.8,.6,.8],color:[.25,.25,.28]}]}}[e]||null),onLoad(e,i){this.setupGalleryInteractions(e,i),e.fire("ui:notification",{text:"Welcome to the Procedural Kitbash Gallery! Press F to inspect objects.",type:"info",duration:4e3}),console.log("[KitbashGallery] Gallery loaded and ready for exploration")},setupGalleryInteractions(e,i){this.interactionHandler=i=>{const t=e.root.findByName(i);t&&t.tags.has("procedural_object")?this.showObjectDetails(e,t):e.fire("ui:notification",{text:`Inspected: ${i}`,type:"info",duration:2e3})},e.on("interaction:triggered",this.interactionHandler)},showObjectDetails(e,i){let t=0;const r=e=>{e.render&&t++,e.children.forEach(e=>r(e))};r(i);let o="Static object";if(this.proceduralBuilder){const e=this.proceduralBuilder.spinners.filter(e=>e.entity===i||this.isChildOf(e.entity,i)).length;e>0&&(o=`${e} spinning component(s)`)}e.fire("ui:notification",{text:`${i.name}: ${t} components, ${o}`,type:"success",duration:3e3}),console.log("[KitbashGallery] Object details:",{name:i.name,components:t,position:i.getPosition().toString(),children:i.children.length})},isChildOf(e,i){let t=e.parent;for(;t;){if(t===i)return!0;t=t.parent}return!1},onUnload(e,i){console.log("[KitbashGallery] Cleaning up gallery..."),this.interactionHandler&&(e.off("interaction:triggered",this.interactionHandler),this.interactionHandler=null),this.proceduralBuilder&&(this.proceduralBuilder.cleanup(),this.proceduralBuilder=null)}}}}]);
|
614.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
"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.sceneRoot.addChild(n),[{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.sceneRoot.addChild(a),[{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.sceneRoot.addChild(o);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.sceneRoot.addChild(s)});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.sceneRoot.addChild(s);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.sceneRoot.addChild(n),[{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.sceneRoot.addChild(e)}),[{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.sceneRoot.addChild(o);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.sceneRoot.addChild(s)}),[{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.sceneRoot.addChild(e.obj)});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)})}}}]);
|
|
|
|
| 1 |
+
"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)})}}}]);
|
713.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[713],{713:(e,t,o)=>{o.r(t),o.d(t,{default:()=>n});var i=o(96);const n={id:"data_center",title:"Corporate Data Center",type:"scene",async build(e,t,o){console.log("[DataCenter] Building corporate data center...");const n=new i.n(e,e.systems?.core||{});n.sceneBuilder=t,n.entityFactory=o,this.securityLevel="HIGH",this.detectionTimer=null,n.createRoom("reception_lobby",{size:[20,4,16],lighting:"corporate",position:[0,0,0],buildFunction:a,objectives:[{id:"infiltration_start",name:"Corporate Infiltration",description:"Gain access to the corporate data systems",type:"simple",autoStart:!0,rewards:{experience:30}},{id:"social_engineer",name:"Social Engineering",description:"Obtain security credentials from reception",type:"simple",rewards:{experience:50,items:[{id:"temp_badge",quantity:1}]}}]}),n.createRoom("technical_floor",{size:[35,5,25],lighting:"technical",position:[0,0,0],buildFunction:s,objectives:[{id:"network_mapping",name:"Network Reconnaissance",description:"Map the internal network infrastructure",type:"counter",target:6,progress:0,rewards:{experience:80},nextObjective:"bypass_firewall"},{id:"bypass_firewall",name:"Firewall Bypass",description:"Exploit network vulnerabilities to gain system access",type:"simple",prerequisites:["network_mapping"],rewards:{experience:120,skillPoints:2,items:[{id:"network_access",quantity:1}]}}]}),n.createRoom("server_core",{size:[30,8,20],lighting:"server_room",position:[0,0,0],buildFunction:c,objectives:[{id:"data_extraction",name:"Corporate Espionage",description:"Extract sensitive corporate intelligence",type:"sequence",target:["database_access","encryption_bypass","data_download"],progress:0,rewards:{experience:200,skillPoints:4}}]}),n.createRoom("executive_vault",{size:[18,6,14],lighting:"vault",position:[0,0,0],buildFunction:r,objectives:[{id:"executive_files",name:"Executive Intelligence",description:"Access the most classified corporate documents",type:"simple",rewards:{experience:300,skillPoints:5,items:[{id:"classified_docs",quantity:1}]}}]}),n.createDoor("reception_lobby","technical_floor",{type:"keycard",item:"temp_badge"},{playerSpawnPosition:[-12,0,0]}),n.createDoor("technical_floor","server_core",{type:"objective",id:"bypass_firewall"},{playerSpawnPosition:[0,0,8]}),n.createDoor("server_core","executive_vault",{type:"objective",id:"data_extraction"},{playerSpawnPosition:[0,0,5]});const l=await n.build(e,t,o);return l.multiRoom=n,l},onLoad(e,t){console.log("[DataCenter] Corporate systems online - Security Level: HIGH");const o=e.root.findByTag("scene_root")[0];o&&o.multiRoom&&(o.multiRoom.onLoad(e,t),this.multiRoom=o.multiRoom,this.interactionHandler=o=>{this.handleDataCenterInteraction(o,e,t)},this.multiRoom.setSceneInteractionHandler(this.interactionHandler)),e.fire("ui:notification",{text:"INFILTRATION ACTIVE: Corporate espionage mission commenced",type:"info",duration:4e3})},handleDataCenterInteraction(e,t,o){console.log("[DataCenter] Interaction triggered with:",e);const i=o.getSystem("objectivemanager");if("ReceptionDesk"===e)i&&i.isObjectiveActive("infiltration_start")&&(i.completeObjective("infiltration_start"),i.startObjective("social_engineer")),t.fire("ui:notification",{text:'Receptionist: "Welcome to SecureCorp! Are you here for the IT consultation?"',type:"info",duration:4e3});else if("BadgePrinter"===e)i&&i.isObjectiveActive("social_engineer")&&(this.multiRoom.addItem("temp_badge"),i.completeObjective("social_engineer"),t.fire("ui:notification",{text:"Temporary security badge obtained - Technical floor access granted",type:"success",duration:3e3}));else if(e.startsWith("NetworkTerminal_")){if("technical_floor"===this.multiRoom.currentRoom&&i&&i.isObjectiveActive("network_mapping")){const o=parseInt(e.split("_")[1]),n=["Database cluster: 10.0.1.0/24","Executive subnet: 192.168.100.0/24","DMZ services: 172.16.0.0/16","Backup systems: 10.0.2.0/24","Security monitoring: 192.168.200.0/24","Administrative tools: 10.0.3.0/24"];t.fire("ui:notification",{text:`Network scan: ${n[o]}`,type:"info",duration:2500}),i.updateObjective("network_mapping")}}else if("FirewallConsole"===e)i&&i.isComplete("network_mapping")&&i.isObjectiveActive("bypass_firewall")&&(this.multiRoom.addItem("network_access"),i.completeObjective("bypass_firewall"),i.startObjective("data_extraction"),t.fire("ui:notification",{text:"FIREWALL COMPROMISED: Full network access obtained",type:"success",duration:4e3}));else if(["DatabaseServer","EncryptionModule","DownloadTerminal"].includes(e)){if("server_core"===this.multiRoom.currentRoom&&i&&i.isObjectiveActive("data_extraction")){const o={DatabaseServer:"database_access",EncryptionModule:"encryption_bypass",DownloadTerminal:"data_download"}[e],n={database_access:"Database access established",encryption_bypass:"Encryption protocols bypassed",data_download:"Corporate data extraction complete"};t.fire("ui:notification",{text:n[o],type:"success",duration:2500}),i.updateObjective("data_extraction",o)}}else"ExecutiveTerminal"===e&&"executive_vault"===this.multiRoom.currentRoom&&i&&i.isObjectiveActive("executive_files")&&(this.multiRoom.addItem("classified_docs"),i.completeObjective("executive_files"),t.fire("ui:notification",{text:"MISSION COMPLETE: Highest level corporate intelligence acquired",type:"success",duration:5e3}))},onUnload(e,t){console.log("[DataCenter] Disconnecting from corporate systems..."),this.multiRoom&&this.multiRoom.setSceneInteractionHandler(null),this.interactionHandler=null,this.multiRoom&&this.multiRoom.onUnload(e,t)}};async function a(e,t,o,i){console.log("[DataCenter] Building reception lobby...");const n=o.create("ReceptionDesk",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[3,.8,1.5]},rigidbody:{type:"static"}},position:[0,.8,-6],scale:[6,1.6,3],tags:["interactive","reception"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.6,.4,.2),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n);const a=o.create("BadgePrinter",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.4,.3,.3]},rigidbody:{type:"static"}},position:[2,1.6,-5.5],scale:[.8,.6,.6],tags:["interactive","printer"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.2,.2),e.emissive=new pc.Color(0,.1,0),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}i.sceneRoot.addChild(a),[[-6,.5,0],[-3,.5,0],[3,.5,0],[6,.5,0]].forEach((t,i)=>{const n=o.create(`CorporateChair_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.8,.8,.8]}},position:t,scale:[1.6,1.6,1.6],tags:["furniture"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.3,.4),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n)});const s=o.createNPC("receptionist_jenny",{position:[0,0,-5],displayName:"Jenny (Receptionist)",dialogue:{greeting:"Hi there! Welcome to SecureCorp Technologies. How can I help you today?",topics:{consultation:"Oh yes, the IT consultation! Let me print you a temporary access badge.",building:"Our technical teams work on the second floor - you'll need a badge for elevator access.",security:"Don't worry about security - our systems are state of the art. Completely impenetrable!"}}});i.sceneRoot.addChild(s),[{pos:[0,3.5,0],color:new pc.Color(.9,.9,.85)},{pos:[-8,3.5,0],color:new pc.Color(.9,.9,.85)},{pos:[8,3.5,0],color:new pc.Color(.9,.9,.85)}].forEach((t,i)=>{const n=o.createLight("point",{color:t.color,intensity:1.8,range:10,position:t.pos});e.addChild(n)})}async function s(e,t,o,i){console.log("[DataCenter] Building technical floor..."),[[-14,1,-10],[-7,1,-10],[7,1,-10],[14,1,-10],[-10,1,10],[10,1,10]].forEach((e,t)=>{const n=o.create(`NetworkTerminal_${t}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,1,.5]},rigidbody:{type:"static"}},position:e,scale:[2,2,1],tags:["interactive","terminal"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.1,.1,.1),e.emissive=new pc.Color(0,.2,.1),e.emissiveIntensity=.5,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}i.sceneRoot.addChild(n)});const n=o.create("FirewallConsole",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,1.5,1]},rigidbody:{type:"static"}},position:[0,1.5,0],scale:[4,3,2],tags:["interactive","firewall"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.1,.1),e.emissive=new pc.Color(.4,.1,.1),e.emissiveIntensity=.6,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}i.sceneRoot.addChild(n),[[-10,1.5,-5],[-10,1.5,5],[10,1.5,-5],[10,1.5,5]].forEach((t,i)=>{const n=o.create(`NetworkRack_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,1.5,.5]}},position:t,scale:[2,3,1],tags:["equipment"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.2,.2),e.emissive=new pc.Color(.1,.1,.05),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n)});const a=o.createNPC("it_admin_david",{position:[5,0,-3],displayName:"David (IT Admin)",dialogue:{greeting:"Hey, you must be the new security consultant. Pretty impressive setup we have here.",topics:{network:"Our network spans multiple subnets - enterprise grade security throughout.",firewall:"That red console is our main firewall management system. Only senior admins have access.",servers:"The real magic happens in the server core - that's where all our critical data lives."}}});i.sceneRoot.addChild(a),[{pos:[0,4.5,0],color:new pc.Color(.8,.9,1)},{pos:[-12,4.5,0],color:new pc.Color(.8,.9,1)},{pos:[12,4.5,0],color:new pc.Color(.8,.9,1)}].forEach((t,i)=>{const n=o.createLight("point",{color:t.color,intensity:2,range:12,position:t.pos});e.addChild(n)})}async function c(e,t,o,i){console.log("[DataCenter] Building server core...");const n=o.create("DatabaseServer",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,2.5,1]},rigidbody:{type:"static"}},position:[-8,2.5,0],scale:[4,5,2],tags:["interactive","database"]}),a=o.create("EncryptionModule",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.5,2,1]},rigidbody:{type:"static"}},position:[0,2,0],scale:[3,4,2],tags:["interactive","encryption"]}),s=o.create("DownloadTerminal",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,1.5,.8]},rigidbody:{type:"static"}},position:[8,1.5,0],scale:[4,3,1.6],tags:["interactive","download"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.4,.6),e.emissive=new pc.Color(.1,.2,.3),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.6,.3,.1),e.emissive=new pc.Color(.3,.15,.05),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}if(s.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.1,.5,.2),e.emissive=new pc.Color(.05,.25,.1),e.update(),s.model.meshInstances.forEach(t=>t.material=e)}i.sceneRoot.addChild(n),i.sceneRoot.addChild(a),i.sceneRoot.addChild(s),[[-12,2,-8],[-4,2,-8],[4,2,-8],[12,2,-8],[-12,2,8],[-4,2,8],[4,2,8],[12,2,8]].forEach((t,i)=>{const n=o.create(`ServerArray_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,2,1]}},position:t,scale:[4,4,2],tags:["server"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.1,.1,.1),e.emissive=new pc.Color(.05,.1,.05),e.emissiveIntensity=.3,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n)}),[{pos:[0,7.5,0],color:new pc.Color(.6,.8,1)},{pos:[-10,6,0],color:new pc.Color(.6,.8,1)},{pos:[10,6,0],color:new pc.Color(.6,.8,1)}].forEach((t,i)=>{const n=o.createLight("point",{color:t.color,intensity:2.2,range:15,position:t.pos});e.addChild(n)})}async function r(e,t,o,i){console.log("[DataCenter] Building executive vault...");const n=o.create("ExecutiveTerminal",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2.5,2,1.5]},rigidbody:{type:"static"}},position:[0,2,-5],scale:[5,4,3],tags:["interactive","executive"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.2,.6),e.emissive=new pc.Color(.2,.1,.3),e.emissiveIntensity=.7,e.metalness=.8,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}i.sceneRoot.addChild(n),[[-6,1.5,0],[6,1.5,0],[-6,1.5,4],[6,1.5,4]].forEach((t,i)=>{const n=o.create(`SecureStorage_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.5,1.5,1]}},position:t,scale:[3,3,2],tags:["storage"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.6,.6,.7),e.metalness=.9,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n)}),[{pos:[0,5.5,0],color:new pc.Color(1,.9,.7)},{pos:[-6,4.5,0],color:new pc.Color(1,.9,.7)},{pos:[6,4.5,0],color:new pc.Color(1,.9,.7)}].forEach((t,i)=>{const n=o.createLight("point",{color:t.color,intensity:1.8,range:10,position:t.pos});e.addChild(n)})}}}]);
|
|
|
|
| 1 |
+
"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[713],{713:(e,t,o)=>{o.r(t),o.d(t,{default:()=>n});var i=o(96);const n={id:"data_center",title:"Corporate Data Center",type:"scene",async build(e,t,o){console.log("[DataCenter] Building corporate data center...");const n=new i.n(e,e.systems?.core||{});n.sceneBuilder=t,n.entityFactory=o,this.securityLevel="HIGH",this.detectionTimer=null,n.createRoom("reception_lobby",{size:[20,4,16],lighting:"corporate",position:[0,0,0],buildFunction:a,objectives:[{id:"infiltration_start",name:"Corporate Infiltration",description:"Gain access to the corporate data systems",type:"simple",autoStart:!0,rewards:{experience:30}},{id:"social_engineer",name:"Social Engineering",description:"Obtain security credentials from reception",type:"simple",rewards:{experience:50,items:[{id:"temp_badge",quantity:1}]}}]}),n.createRoom("technical_floor",{size:[35,5,25],lighting:"technical",position:[0,0,0],buildFunction:s,objectives:[{id:"network_mapping",name:"Network Reconnaissance",description:"Map the internal network infrastructure",type:"counter",target:6,progress:0,rewards:{experience:80},nextObjective:"bypass_firewall"},{id:"bypass_firewall",name:"Firewall Bypass",description:"Exploit network vulnerabilities to gain system access",type:"simple",prerequisites:["network_mapping"],rewards:{experience:120,skillPoints:2,items:[{id:"network_access",quantity:1}]}}]}),n.createRoom("server_core",{size:[30,8,20],lighting:"server_room",position:[0,0,0],buildFunction:r,objectives:[{id:"data_extraction",name:"Corporate Espionage",description:"Extract sensitive corporate intelligence",type:"sequence",target:["database_access","encryption_bypass","data_download"],progress:0,rewards:{experience:200,skillPoints:4}}]}),n.createRoom("executive_vault",{size:[18,6,14],lighting:"vault",position:[0,0,0],buildFunction:c,objectives:[{id:"executive_files",name:"Executive Intelligence",description:"Access the most classified corporate documents",type:"simple",rewards:{experience:300,skillPoints:5,items:[{id:"classified_docs",quantity:1}]}}]}),n.createDoor("reception_lobby","technical_floor",{type:"keycard",item:"temp_badge"},{playerSpawnPosition:[-12,0,0]}),n.createDoor("technical_floor","server_core",{type:"objective",id:"bypass_firewall"},{playerSpawnPosition:[0,0,8]}),n.createDoor("server_core","executive_vault",{type:"objective",id:"data_extraction"},{playerSpawnPosition:[0,0,5]});const l=await n.build(e,t,o);return l.multiRoom=n,l},onLoad(e,t){console.log("[DataCenter] Corporate systems online - Security Level: HIGH");const o=e.root.findByTag("scene_root")[0];o&&o.multiRoom&&(o.multiRoom.onLoad(e,t),this.multiRoom=o.multiRoom,this.interactionHandler=o=>{this.handleDataCenterInteraction(o,e,t)},this.multiRoom.setSceneInteractionHandler(this.interactionHandler)),e.fire("ui:notification",{text:"INFILTRATION ACTIVE: Corporate espionage mission commenced",type:"info",duration:4e3})},handleDataCenterInteraction(e,t,o){console.log("[DataCenter] Interaction triggered with:",e);const i=o.getSystem("objectivemanager");if("ReceptionDesk"===e)i&&i.isObjectiveActive("infiltration_start")&&(i.completeObjective("infiltration_start"),i.startObjective("social_engineer")),t.fire("ui:notification",{text:'Receptionist: "Welcome to SecureCorp! Are you here for the IT consultation?"',type:"info",duration:4e3});else if("BadgePrinter"===e)i&&i.isObjectiveActive("social_engineer")&&(this.multiRoom.addItem("temp_badge"),i.completeObjective("social_engineer"),t.fire("ui:notification",{text:"Temporary security badge obtained - Technical floor access granted",type:"success",duration:3e3}));else if(e.startsWith("NetworkTerminal_")){if("technical_floor"===this.multiRoom.currentRoom&&i&&i.isObjectiveActive("network_mapping")){const o=parseInt(e.split("_")[1]),n=["Database cluster: 10.0.1.0/24","Executive subnet: 192.168.100.0/24","DMZ services: 172.16.0.0/16","Backup systems: 10.0.2.0/24","Security monitoring: 192.168.200.0/24","Administrative tools: 10.0.3.0/24"];t.fire("ui:notification",{text:`Network scan: ${n[o]}`,type:"info",duration:2500}),i.updateObjective("network_mapping")}}else if("FirewallConsole"===e)i&&i.isComplete("network_mapping")&&i.isObjectiveActive("bypass_firewall")&&(this.multiRoom.addItem("network_access"),i.completeObjective("bypass_firewall"),i.startObjective("data_extraction"),t.fire("ui:notification",{text:"FIREWALL COMPROMISED: Full network access obtained",type:"success",duration:4e3}));else if(["DatabaseServer","EncryptionModule","DownloadTerminal"].includes(e)){if("server_core"===this.multiRoom.currentRoom&&i&&i.isObjectiveActive("data_extraction")){const o={DatabaseServer:"database_access",EncryptionModule:"encryption_bypass",DownloadTerminal:"data_download"}[e],n={database_access:"Database access established",encryption_bypass:"Encryption protocols bypassed",data_download:"Corporate data extraction complete"};t.fire("ui:notification",{text:n[o],type:"success",duration:2500}),i.updateObjective("data_extraction",o)}}else"ExecutiveTerminal"===e&&"executive_vault"===this.multiRoom.currentRoom&&i&&i.isObjectiveActive("executive_files")&&(this.multiRoom.addItem("classified_docs"),i.completeObjective("executive_files"),t.fire("ui:notification",{text:"MISSION COMPLETE: Highest level corporate intelligence acquired",type:"success",duration:5e3}))},onUnload(e,t){console.log("[DataCenter] Disconnecting from corporate systems..."),this.multiRoom&&this.multiRoom.setSceneInteractionHandler(null),this.interactionHandler=null,this.multiRoom&&this.multiRoom.onUnload(e,t)}};async function a(e,t,o,i){console.log("[DataCenter] Building reception lobby...");const n=o.create("ReceptionDesk",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[3,.8,1.5]},rigidbody:{type:"static"}},position:[0,.8,-6],scale:[6,1.6,3],tags:["interactive","reception"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.6,.4,.2),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n);const a=o.create("BadgePrinter",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.4,.3,.3]},rigidbody:{type:"static"}},position:[2,1.6,-5.5],scale:[.8,.6,.6],tags:["interactive","printer"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.2,.2),e.emissive=new pc.Color(0,.1,0),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}i.addEntityToRoom(a,"reception_lobby"),[[-6,.5,0],[-3,.5,0],[3,.5,0],[6,.5,0]].forEach((t,i)=>{const n=o.create(`CorporateChair_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.8,.8,.8]}},position:t,scale:[1.6,1.6,1.6],tags:["furniture"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.3,.4),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n)});const s=o.createNPC("receptionist_jenny",{position:[0,0,-5],displayName:"Jenny (Receptionist)",dialogue:{greeting:"Hi there! Welcome to SecureCorp Technologies. How can I help you today?",topics:{consultation:"Oh yes, the IT consultation! Let me print you a temporary access badge.",building:"Our technical teams work on the second floor - you'll need a badge for elevator access.",security:"Don't worry about security - our systems are state of the art. Completely impenetrable!"}}});i.addEntityToRoom(s,"reception_lobby"),[{pos:[0,3.5,0],color:new pc.Color(.9,.9,.85)},{pos:[-8,3.5,0],color:new pc.Color(.9,.9,.85)},{pos:[8,3.5,0],color:new pc.Color(.9,.9,.85)}].forEach((t,i)=>{const n=o.createLight("point",{color:t.color,intensity:1.8,range:10,position:t.pos});e.addChild(n)})}async function s(e,t,o,i){console.log("[DataCenter] Building technical floor..."),[[-14,1,-10],[-7,1,-10],[7,1,-10],[14,1,-10],[-10,1,10],[10,1,10]].forEach((e,t)=>{const n=o.create(`NetworkTerminal_${t}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,1,.5]},rigidbody:{type:"static"}},position:e,scale:[2,2,1],tags:["interactive","terminal"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.1,.1,.1),e.emissive=new pc.Color(0,.2,.1),e.emissiveIntensity=.5,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}i.addEntityToRoom(n,"technical_floor")});const n=o.create("FirewallConsole",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,1.5,1]},rigidbody:{type:"static"}},position:[0,1.5,0],scale:[4,3,2],tags:["interactive","firewall"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.1,.1),e.emissive=new pc.Color(.4,.1,.1),e.emissiveIntensity=.6,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}i.addEntityToRoom(n,"technical_floor"),[[-10,1.5,-5],[-10,1.5,5],[10,1.5,-5],[10,1.5,5]].forEach((t,i)=>{const n=o.create(`NetworkRack_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,1.5,.5]}},position:t,scale:[2,3,1],tags:["equipment"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.2,.2),e.emissive=new pc.Color(.1,.1,.05),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n)});const a=o.createNPC("it_admin_david",{position:[5,0,-3],displayName:"David (IT Admin)",dialogue:{greeting:"Hey, you must be the new security consultant. Pretty impressive setup we have here.",topics:{network:"Our network spans multiple subnets - enterprise grade security throughout.",firewall:"That red console is our main firewall management system. Only senior admins have access.",servers:"The real magic happens in the server core - that's where all our critical data lives."}}});i.addEntityToRoom(a,"technical_floor"),[{pos:[0,4.5,0],color:new pc.Color(.8,.9,1)},{pos:[-12,4.5,0],color:new pc.Color(.8,.9,1)},{pos:[12,4.5,0],color:new pc.Color(.8,.9,1)}].forEach((t,i)=>{const n=o.createLight("point",{color:t.color,intensity:2,range:12,position:t.pos});e.addChild(n)})}async function r(e,t,o,i){console.log("[DataCenter] Building server core...");const n=o.create("DatabaseServer",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,2.5,1]},rigidbody:{type:"static"}},position:[-8,2.5,0],scale:[4,5,2],tags:["interactive","database"]}),a=o.create("EncryptionModule",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.5,2,1]},rigidbody:{type:"static"}},position:[0,2,0],scale:[3,4,2],tags:["interactive","encryption"]}),s=o.create("DownloadTerminal",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,1.5,.8]},rigidbody:{type:"static"}},position:[8,1.5,0],scale:[4,3,1.6],tags:["interactive","download"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.4,.6),e.emissive=new pc.Color(.1,.2,.3),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.6,.3,.1),e.emissive=new pc.Color(.3,.15,.05),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}if(s.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.1,.5,.2),e.emissive=new pc.Color(.05,.25,.1),e.update(),s.model.meshInstances.forEach(t=>t.material=e)}i.addEntityToRoom(n,"server_core"),i.addEntityToRoom(a,"server_core"),i.addEntityToRoom(s,"server_core"),[[-12,2,-8],[-4,2,-8],[4,2,-8],[12,2,-8],[-12,2,8],[-4,2,8],[4,2,8],[12,2,8]].forEach((t,i)=>{const n=o.create(`ServerArray_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,2,1]}},position:t,scale:[4,4,2],tags:["server"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.1,.1,.1),e.emissive=new pc.Color(.05,.1,.05),e.emissiveIntensity=.3,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n)}),[{pos:[0,7.5,0],color:new pc.Color(.6,.8,1)},{pos:[-10,6,0],color:new pc.Color(.6,.8,1)},{pos:[10,6,0],color:new pc.Color(.6,.8,1)}].forEach((t,i)=>{const n=o.createLight("point",{color:t.color,intensity:2.2,range:15,position:t.pos});e.addChild(n)})}async function c(e,t,o,i){console.log("[DataCenter] Building executive vault...");const n=o.create("ExecutiveTerminal",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2.5,2,1.5]},rigidbody:{type:"static"}},position:[0,2,-5],scale:[5,4,3],tags:["interactive","executive"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.2,.6),e.emissive=new pc.Color(.2,.1,.3),e.emissiveIntensity=.7,e.metalness=.8,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}i.addEntityToRoom(n,"executive_vault"),[[-6,1.5,0],[6,1.5,0],[-6,1.5,4],[6,1.5,4]].forEach((t,i)=>{const n=o.create(`SecureStorage_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.5,1.5,1]}},position:t,scale:[3,3,2],tags:["storage"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.6,.6,.7),e.metalness=.9,e.update(),n.model.meshInstances.forEach(t=>t.material=e)}e.addChild(n)}),[{pos:[0,5.5,0],color:new pc.Color(1,.9,.7)},{pos:[-6,4.5,0],color:new pc.Color(1,.9,.7)},{pos:[6,4.5,0],color:new pc.Color(1,.9,.7)}].forEach((t,i)=>{const n=o.createLight("point",{color:t.color,intensity:1.8,range:10,position:t.pos});e.addChild(n)})}}}]);
|
942.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[942],{942:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});var o=i(96);const a={id:"military_compound",title:"Military Compound",type:"scene",async build(e,t,i){console.log("[MilitaryCompound] Building military compound...");const a=new o.n(e,e.systems?.core||{});a.sceneBuilder=t,a.entityFactory=i,this.alertLevel="GREEN",this.infiltrationTimer=9e5,this.startTime=null,a.createRoom("perimeter_gate",{size:[22,4,18],lighting:"military",position:[0,0,0],buildFunction:n,objectives:[{id:"compound_entry",name:"Perimeter Breach",description:"Infiltrate the military compound perimeter",type:"simple",autoStart:!0,rewards:{experience:35}},{id:"get_patrol_schedule",name:"Intelligence Gathering",description:"Obtain guard patrol schedules from checkpoint",type:"simple",rewards:{experience:60,items:[{id:"patrol_intel",quantity:1}]}}]}),a.createRoom("barracks_complex",{size:[35,5,28],lighting:"barracks",position:[0,0,0],buildFunction:s,objectives:[{id:"equipment_acquisition",name:"Equipment Procurement",description:"Acquire military equipment from supply areas",type:"counter",target:5,progress:0,rewards:{experience:100},nextObjective:"disable_communications"},{id:"disable_communications",name:"Communication Blackout",description:"Sabotage compound communication systems",type:"simple",prerequisites:["equipment_acquisition"],rewards:{experience:150,skillPoints:3,items:[{id:"sabotage_kit",quantity:1}]}}]}),a.createRoom("command_center",{size:[25,6,20],lighting:"command",position:[0,0,0],buildFunction:r,objectives:[{id:"tactical_override",name:"Command Override",description:"Override tactical command systems",type:"sequence",target:["radar_disable","defense_grid","command_codes"],progress:0,rewards:{experience:200,skillPoints:4}}]}),a.createRoom("weapon_vault",{size:[20,7,16],lighting:"vault",position:[0,0,0],buildFunction:c,objectives:[{id:"secure_weapons",name:"Weapons Acquisition",description:"Secure advanced military hardware",type:"simple",rewards:{experience:300,skillPoints:5,items:[{id:"military_hardware",quantity:1}]}}]}),a.createDoor("perimeter_gate","barracks_complex",{type:"keycard",item:"patrol_intel"},{playerSpawnPosition:[-15,0,0]}),a.createDoor("barracks_complex","command_center",{type:"objective",id:"disable_communications"},{playerSpawnPosition:[0,0,8]}),a.createDoor("command_center","weapon_vault",{type:"objective",id:"tactical_override"},{playerSpawnPosition:[0,0,6]});const l=await a.build(e,t,i);return l.multiRoom=a,l},onLoad(e,t){console.log("[MilitaryCompound] Military systems online - Alert Level: GREEN");const i=e.root.findByTag("scene_root")[0];i&&i.multiRoom&&(i.multiRoom.onLoad(e,t),this.multiRoom=i.multiRoom,this.startTime=Date.now(),this.setupAlertSystem(e),this.interactionHandler=i=>{this.handleMilitaryInteraction(i,e,t)},this.multiRoom.setSceneInteractionHandler(this.interactionHandler)),e.fire("ui:notification",{text:"INFILTRATION COMMENCED: Military compound breach - Maintain stealth",type:"warning",duration:4e3})},setupAlertSystem(e){this.alertInterval=setInterval(()=>{if(!this.startTime)return;const t=Date.now()-this.startTime,i=Math.max(0,this.infiltrationTimer-t);t>6e5&&"GREEN"===this.alertLevel?(this.alertLevel="YELLOW",e.fire("ui:notification",{text:"ALERT LEVEL: YELLOW - Increased security patrols detected",type:"warning",duration:4e3})):t>72e4&&"YELLOW"===this.alertLevel?(this.alertLevel="ORANGE",e.fire("ui:notification",{text:"ALERT LEVEL: ORANGE - Security lockdown protocols initiated",type:"error",duration:4e3})):i<=0&&"RED"!==this.alertLevel&&(this.alertLevel="RED",this.onFullAlert(e))},3e4)},onFullAlert(e){clearInterval(this.alertInterval),e.fire("ui:notification",{text:"ALERT LEVEL: RED - Full compound lockdown! Mission compromised!",type:"error",duration:8e3})},handleMilitaryInteraction(e,t,i){console.log("[MilitaryCompound] Interaction triggered with:",e);const o=i.getSystem("objectivemanager");if("SecurityCheckpoint"===e)o&&o.isObjectiveActive("compound_entry")&&(o.completeObjective("compound_entry"),o.startObjective("get_patrol_schedule")),t.fire("ui:notification",{text:"Guard post detected - Searching for intelligence",type:"info",duration:3e3});else if("GuardStation"===e)o&&o.isObjectiveActive("get_patrol_schedule")&&(this.multiRoom.addItem("patrol_intel"),o.completeObjective("get_patrol_schedule"),t.fire("ui:notification",{text:"Patrol schedules acquired - Compound access intelligence obtained",type:"success",duration:3e3}));else if(e.startsWith("EquipmentCache_")){if("barracks_complex"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("equipment_acquisition")){const i=parseInt(e.split("_")[1]),a=["Night vision goggles","Combat radio","Tactical vest","Electronic lock picks","Explosive charges"];t.fire("ui:notification",{text:`Equipment acquired: ${a[i]}`,type:"success",duration:2500}),o.updateObjective("equipment_acquisition")}}else if("CommunicationHub"===e)o&&o.isComplete("equipment_acquisition")&&o.isObjectiveActive("disable_communications")&&(this.multiRoom.addItem("sabotage_kit"),o.completeObjective("disable_communications"),o.startObjective("tactical_override"),t.fire("ui:notification",{text:"COMMUNICATIONS DISABLED: Compound is isolated from external support",type:"success",duration:4e3}));else if(["RadarSystem","DefenseGrid","CommandTerminal"].includes(e)){if("command_center"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("tactical_override")){const i={RadarSystem:"radar_disable",DefenseGrid:"defense_grid",CommandTerminal:"command_codes"}[e],a={radar_disable:"RADAR SYSTEMS DISABLED",defense_grid:"DEFENSE GRID COMPROMISED",command_codes:"COMMAND CODES EXTRACTED"};t.fire("ui:notification",{text:a[i],type:"success",duration:2500}),o.updateObjective("tactical_override",i)}}else"WeaponVault"===e&&"weapon_vault"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("secure_weapons")&&(this.multiRoom.addItem("military_hardware"),o.completeObjective("secure_weapons"),t.fire("ui:notification",{text:"MISSION SUCCESS: Advanced military hardware secured",type:"success",duration:5e3}))},onUnload(e,t){console.log("[MilitaryCompound] Military systems shutting down..."),this.alertInterval&&clearInterval(this.alertInterval),this.multiRoom&&this.multiRoom.setSceneInteractionHandler(null),this.interactionHandler=null,this.multiRoom&&this.multiRoom.onUnload(e,t)}};async function n(e,t,i,o){console.log("[MilitaryCompound] Building perimeter gate...");const a=i.create("SecurityCheckpoint",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,1,1.5]},rigidbody:{type:"static"}},position:[0,1,-7],scale:[4,2,3],tags:["interactive","checkpoint"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.4,.2),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}e.addChild(a);const n=i.create("GuardStation",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,1.5,.8]},rigidbody:{type:"static"}},position:[4,1.5,-6],scale:[2,3,1.6],tags:["interactive","guard_post"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.4,.3),e.emissive=new pc.Color(.1,.2,.1),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(n),[[-8,1.5,0],[-4,1.5,0],[4,1.5,0],[8,1.5,0],[-8,1.5,6],[8,1.5,6]].forEach((t,o)=>{const a=i.create(`PerimeterFence_${o}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,1.5,.1]}},position:t,scale:[4,3,.2],tags:["obstacle"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.3,.3),e.metalness=.8,e.update(),a.model.meshInstances.forEach(t=>t.material=e)}e.addChild(a)});const s=i.createNPC("sergeant_harris",{position:[-2,0,-5],displayName:"Sergeant Harris",dialogue:{greeting:"Hold it right there! This is a restricted military facility.",topics:{patrol:"Standard protocol - all guard stations maintain updated patrol schedules.",security:"Perimeter is secure, but we've had reports of unusual activity lately.",compound:"Beyond this gate is classified - you don't have clearance for that area."}}});o.sceneRoot.addChild(s),[{pos:[0,3.5,0],color:new pc.Color(1,1,.9)},{pos:[-8,3.5,0],color:new pc.Color(1,1,.9)},{pos:[8,3.5,0],color:new pc.Color(1,1,.9)}].forEach((t,o)=>{const a=i.createLight("point",{color:t.color,intensity:2,range:10,position:t.pos});e.addChild(a)})}async function s(e,t,i,o){console.log("[MilitaryCompound] Building barracks complex..."),[[-12,.8,-10],[-6,.8,-10],[6,.8,-10],[12,.8,-10],[0,.8,10]].forEach((e,t)=>{const a=i.create(`EquipmentCache_${t}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.2,.8,.8]},rigidbody:{type:"static"}},position:e,scale:[2.4,1.6,1.6],tags:["interactive","equipment"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.3,.2),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(a)});const a=i.create("CommunicationHub",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:1.5,height:4},rigidbody:{type:"static"}},position:[0,2,0],scale:[3,4,3],tags:["interactive","communications"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.2,.3),e.emissive=new pc.Color(.1,.1,.2),e.emissiveIntensity=.5,e.update(),a.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(a),[[-10,1.5,8],[10,1.5,8],[-10,1.5,-8],[10,1.5,-8]].forEach((t,o)=>{const a=i.create(`Barracks_${o}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[4,1.5,3]}},position:t,scale:[8,3,6],tags:["building"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.5,.4,.3),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}e.addChild(a)});const n=i.createNPC("supply_officer_jones",{position:[8,0,0],displayName:"Supply Officer Jones",dialogue:{greeting:"Equipment inventory is running smoothly. Everything accounted for.",topics:{equipment:"We keep tactical gear distributed across multiple cache points for security.",communications:"That comm tower handles all external contact - vital for operations.",security:"Standard procedure - equipment audits every 6 hours to prevent theft."}}});o.sceneRoot.addChild(n),[{pos:[0,4.5,0],color:new pc.Color(.9,.9,.8)},{pos:[-12,4,0],color:new pc.Color(.9,.9,.8)},{pos:[12,4,0],color:new pc.Color(.9,.9,.8)}].forEach((t,o)=>{const a=i.createLight("point",{color:t.color,intensity:1.8,range:12,position:t.pos});e.addChild(a)})}async function r(e,t,i,o){console.log("[MilitaryCompound] Building command center...");const a=i.create("RadarSystem",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:2,height:3},rigidbody:{type:"static"}},position:[-8,1.5,-6],scale:[4,3,4],tags:["interactive","radar"]}),n=i.create("DefenseGrid",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,2.5,1]},rigidbody:{type:"static"}},position:[0,2.5,-6],scale:[4,5,2],tags:["interactive","defense"]}),s=i.create("CommandTerminal",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[3,1.5,1.5]},rigidbody:{type:"static"}},position:[8,1.5,-6],scale:[6,3,3],tags:["interactive","command"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.6,.3),e.emissive=new pc.Color(.1,.3,.15),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.6,.3,.2),e.emissive=new pc.Color(.3,.15,.1),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}if(s.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.3,.6),e.emissive=new pc.Color(.15,.15,.3),e.emissiveIntensity=.6,e.update(),s.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(a),o.sceneRoot.addChild(n),o.sceneRoot.addChild(s),[[-8,.8,4],[-4,.8,4],[4,.8,4],[8,.8,4]].forEach((t,o)=>{const a=i.create(`Workstation_${o}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,.8,1]}},position:t,scale:[4,1.6,2],tags:["equipment"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.3,.3),e.emissive=new pc.Color(.1,.1,.15),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}e.addChild(a)});const r=i.createNPC("commander_stone",{position:[0,0,2],displayName:"Commander Stone",dialogue:{greeting:"This is a restricted command center! How did you get past security?",topics:{radar:"Our radar array monitors all airspace within a 50-mile radius.",defense:"Defense grid controls automated perimeter weapons systems.",command:"Command terminal has access to all compound tactical systems."}}});o.sceneRoot.addChild(r),[{pos:[0,5.5,0],color:new pc.Color(.7,.8,1)},{pos:[-8,4.5,0],color:new pc.Color(.7,.8,1)},{pos:[8,4.5,0],color:new pc.Color(.7,.8,1)}].forEach((t,o)=>{const a=i.createLight("point",{color:t.color,intensity:2.2,range:12,position:t.pos});e.addChild(a)})}async function c(e,t,i,o){console.log("[MilitaryCompound] Building weapon vault...");const a=i.create("WeaponVault",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[3,3,2]},rigidbody:{type:"static"}},position:[0,3,-6],scale:[6,6,4],tags:["interactive","vault"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.4,.5),e.emissive=new pc.Color(.2,.2,.3),e.metalness=.9,e.update(),a.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(a),[[-6,2,0],[6,2,0],[-6,2,4],[6,2,4]].forEach((t,o)=>{const a=i.create(`WeaponRack_${o}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.5,2,.5]}},position:t,scale:[3,4,1],tags:["storage"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.5,.5,.6),e.metalness=.8,e.update(),a.model.meshInstances.forEach(t=>t.material=e)}e.addChild(a)}),[{pos:[0,6.5,0],color:new pc.Color(1,.8,.8)},{pos:[-6,5,0],color:new pc.Color(1,.8,.8)},{pos:[6,5,0],color:new pc.Color(1,.8,.8)}].forEach((t,o)=>{const a=i.createLight("point",{color:t.color,intensity:2,range:12,position:t.pos});e.addChild(a)})}}}]);
|
|
|
|
| 1 |
+
"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[942],{942:(e,t,o)=>{o.r(t),o.d(t,{default:()=>a});var i=o(96);const a={id:"military_compound",title:"Military Compound",type:"scene",async build(e,t,o){console.log("[MilitaryCompound] Building military compound...");const a=new i.n(e,e.systems?.core||{});a.sceneBuilder=t,a.entityFactory=o,this.alertLevel="GREEN",this.infiltrationTimer=9e5,this.startTime=null,a.createRoom("perimeter_gate",{size:[22,4,18],lighting:"military",position:[0,0,0],buildFunction:n,objectives:[{id:"compound_entry",name:"Perimeter Breach",description:"Infiltrate the military compound perimeter",type:"simple",autoStart:!0,rewards:{experience:35}},{id:"get_patrol_schedule",name:"Intelligence Gathering",description:"Obtain guard patrol schedules from checkpoint",type:"simple",rewards:{experience:60,items:[{id:"patrol_intel",quantity:1}]}}]}),a.createRoom("barracks_complex",{size:[35,5,28],lighting:"barracks",position:[0,0,0],buildFunction:s,objectives:[{id:"equipment_acquisition",name:"Equipment Procurement",description:"Acquire military equipment from supply areas",type:"counter",target:5,progress:0,rewards:{experience:100},nextObjective:"disable_communications"},{id:"disable_communications",name:"Communication Blackout",description:"Sabotage compound communication systems",type:"simple",prerequisites:["equipment_acquisition"],rewards:{experience:150,skillPoints:3,items:[{id:"sabotage_kit",quantity:1}]}}]}),a.createRoom("command_center",{size:[25,6,20],lighting:"command",position:[0,0,0],buildFunction:r,objectives:[{id:"tactical_override",name:"Command Override",description:"Override tactical command systems",type:"sequence",target:["radar_disable","defense_grid","command_codes"],progress:0,rewards:{experience:200,skillPoints:4}}]}),a.createRoom("weapon_vault",{size:[20,7,16],lighting:"vault",position:[0,0,0],buildFunction:c,objectives:[{id:"secure_weapons",name:"Weapons Acquisition",description:"Secure advanced military hardware",type:"simple",rewards:{experience:300,skillPoints:5,items:[{id:"military_hardware",quantity:1}]}}]}),a.createDoor("perimeter_gate","barracks_complex",{type:"keycard",item:"patrol_intel"},{playerSpawnPosition:[-15,0,0]}),a.createDoor("barracks_complex","command_center",{type:"objective",id:"disable_communications"},{playerSpawnPosition:[0,0,8]}),a.createDoor("command_center","weapon_vault",{type:"objective",id:"tactical_override"},{playerSpawnPosition:[0,0,6]});const l=await a.build(e,t,o);return l.multiRoom=a,l},onLoad(e,t){console.log("[MilitaryCompound] Military systems online - Alert Level: GREEN");const o=e.root.findByTag("scene_root")[0];o&&o.multiRoom&&(o.multiRoom.onLoad(e,t),this.multiRoom=o.multiRoom,this.startTime=Date.now(),this.setupAlertSystem(e),this.interactionHandler=o=>{this.handleMilitaryInteraction(o,e,t)},this.multiRoom.setSceneInteractionHandler(this.interactionHandler)),e.fire("ui:notification",{text:"INFILTRATION COMMENCED: Military compound breach - Maintain stealth",type:"warning",duration:4e3})},setupAlertSystem(e){this.alertInterval=setInterval(()=>{if(!this.startTime)return;const t=Date.now()-this.startTime,o=Math.max(0,this.infiltrationTimer-t);t>6e5&&"GREEN"===this.alertLevel?(this.alertLevel="YELLOW",e.fire("ui:notification",{text:"ALERT LEVEL: YELLOW - Increased security patrols detected",type:"warning",duration:4e3})):t>72e4&&"YELLOW"===this.alertLevel?(this.alertLevel="ORANGE",e.fire("ui:notification",{text:"ALERT LEVEL: ORANGE - Security lockdown protocols initiated",type:"error",duration:4e3})):o<=0&&"RED"!==this.alertLevel&&(this.alertLevel="RED",this.onFullAlert(e))},3e4)},onFullAlert(e){clearInterval(this.alertInterval),e.fire("ui:notification",{text:"ALERT LEVEL: RED - Full compound lockdown! Mission compromised!",type:"error",duration:8e3})},handleMilitaryInteraction(e,t,o){console.log("[MilitaryCompound] Interaction triggered with:",e);const i=o.getSystem("objectivemanager");if("SecurityCheckpoint"===e)i&&i.isObjectiveActive("compound_entry")&&(i.completeObjective("compound_entry"),i.startObjective("get_patrol_schedule")),t.fire("ui:notification",{text:"Guard post detected - Searching for intelligence",type:"info",duration:3e3});else if("GuardStation"===e)i&&i.isObjectiveActive("get_patrol_schedule")&&(this.multiRoom.addItem("patrol_intel"),i.completeObjective("get_patrol_schedule"),t.fire("ui:notification",{text:"Patrol schedules acquired - Compound access intelligence obtained",type:"success",duration:3e3}));else if(e.startsWith("EquipmentCache_")){if("barracks_complex"===this.multiRoom.currentRoom&&i&&i.isObjectiveActive("equipment_acquisition")){const o=parseInt(e.split("_")[1]),a=["Night vision goggles","Combat radio","Tactical vest","Electronic lock picks","Explosive charges"];t.fire("ui:notification",{text:`Equipment acquired: ${a[o]}`,type:"success",duration:2500}),i.updateObjective("equipment_acquisition")}}else if("CommunicationHub"===e)i&&i.isComplete("equipment_acquisition")&&i.isObjectiveActive("disable_communications")&&(this.multiRoom.addItem("sabotage_kit"),i.completeObjective("disable_communications"),i.startObjective("tactical_override"),t.fire("ui:notification",{text:"COMMUNICATIONS DISABLED: Compound is isolated from external support",type:"success",duration:4e3}));else if(["RadarSystem","DefenseGrid","CommandTerminal"].includes(e)){if("command_center"===this.multiRoom.currentRoom&&i&&i.isObjectiveActive("tactical_override")){const o={RadarSystem:"radar_disable",DefenseGrid:"defense_grid",CommandTerminal:"command_codes"}[e],a={radar_disable:"RADAR SYSTEMS DISABLED",defense_grid:"DEFENSE GRID COMPROMISED",command_codes:"COMMAND CODES EXTRACTED"};t.fire("ui:notification",{text:a[o],type:"success",duration:2500}),i.updateObjective("tactical_override",o)}}else"WeaponVault"===e&&"weapon_vault"===this.multiRoom.currentRoom&&i&&i.isObjectiveActive("secure_weapons")&&(this.multiRoom.addItem("military_hardware"),i.completeObjective("secure_weapons"),t.fire("ui:notification",{text:"MISSION SUCCESS: Advanced military hardware secured",type:"success",duration:5e3}))},onUnload(e,t){console.log("[MilitaryCompound] Military systems shutting down..."),this.alertInterval&&clearInterval(this.alertInterval),this.multiRoom&&this.multiRoom.setSceneInteractionHandler(null),this.interactionHandler=null,this.multiRoom&&this.multiRoom.onUnload(e,t)}};async function n(e,t,o,i){console.log("[MilitaryCompound] Building perimeter gate...");const a=o.create("SecurityCheckpoint",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,1,1.5]},rigidbody:{type:"static"}},position:[0,1,-7],scale:[4,2,3],tags:["interactive","checkpoint"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.4,.2),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}e.addChild(a);const n=o.create("GuardStation",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,1.5,.8]},rigidbody:{type:"static"}},position:[4,1.5,-6],scale:[2,3,1.6],tags:["interactive","guard_post"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.4,.3),e.emissive=new pc.Color(.1,.2,.1),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}i.addEntityToRoom(n,"perimeter_gate"),[[-8,1.5,0],[-4,1.5,0],[4,1.5,0],[8,1.5,0],[-8,1.5,6],[8,1.5,6]].forEach((t,i)=>{const a=o.create(`PerimeterFence_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,1.5,.1]}},position:t,scale:[4,3,.2],tags:["obstacle"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.3,.3),e.metalness=.8,e.update(),a.model.meshInstances.forEach(t=>t.material=e)}e.addChild(a)});const s=o.createNPC("sergeant_harris",{position:[-2,0,-5],displayName:"Sergeant Harris",dialogue:{greeting:"Hold it right there! This is a restricted military facility.",topics:{patrol:"Standard protocol - all guard stations maintain updated patrol schedules.",security:"Perimeter is secure, but we've had reports of unusual activity lately.",compound:"Beyond this gate is classified - you don't have clearance for that area."}}});i.addEntityToRoom(s,"perimeter_gate"),[{pos:[0,3.5,0],color:new pc.Color(1,1,.9)},{pos:[-8,3.5,0],color:new pc.Color(1,1,.9)},{pos:[8,3.5,0],color:new pc.Color(1,1,.9)}].forEach((t,i)=>{const a=o.createLight("point",{color:t.color,intensity:2,range:10,position:t.pos});e.addChild(a)})}async function s(e,t,o,i){console.log("[MilitaryCompound] Building barracks complex..."),[[-12,.8,-10],[-6,.8,-10],[6,.8,-10],[12,.8,-10],[0,.8,10]].forEach((e,t)=>{const a=o.create(`EquipmentCache_${t}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.2,.8,.8]},rigidbody:{type:"static"}},position:e,scale:[2.4,1.6,1.6],tags:["interactive","equipment"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.3,.2),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}i.addEntityToRoom(a,"barracks_complex")});const a=o.create("CommunicationHub",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:1.5,height:4},rigidbody:{type:"static"}},position:[0,2,0],scale:[3,4,3],tags:["interactive","communications"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.2,.3),e.emissive=new pc.Color(.1,.1,.2),e.emissiveIntensity=.5,e.update(),a.model.meshInstances.forEach(t=>t.material=e)}i.addEntityToRoom(a,"barracks_complex"),[[-10,1.5,8],[10,1.5,8],[-10,1.5,-8],[10,1.5,-8]].forEach((t,i)=>{const a=o.create(`Barracks_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[4,1.5,3]}},position:t,scale:[8,3,6],tags:["building"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.5,.4,.3),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}e.addChild(a)});const n=o.createNPC("supply_officer_jones",{position:[8,0,0],displayName:"Supply Officer Jones",dialogue:{greeting:"Equipment inventory is running smoothly. Everything accounted for.",topics:{equipment:"We keep tactical gear distributed across multiple cache points for security.",communications:"That comm tower handles all external contact - vital for operations.",security:"Standard procedure - equipment audits every 6 hours to prevent theft."}}});i.addEntityToRoom(n,"barracks_complex"),[{pos:[0,4.5,0],color:new pc.Color(.9,.9,.8)},{pos:[-12,4,0],color:new pc.Color(.9,.9,.8)},{pos:[12,4,0],color:new pc.Color(.9,.9,.8)}].forEach((t,i)=>{const a=o.createLight("point",{color:t.color,intensity:1.8,range:12,position:t.pos});e.addChild(a)})}async function r(e,t,o,i){console.log("[MilitaryCompound] Building command center...");const a=o.create("RadarSystem",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:2,height:3},rigidbody:{type:"static"}},position:[-8,1.5,-6],scale:[4,3,4],tags:["interactive","radar"]}),n=o.create("DefenseGrid",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,2.5,1]},rigidbody:{type:"static"}},position:[0,2.5,-6],scale:[4,5,2],tags:["interactive","defense"]}),s=o.create("CommandTerminal",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[3,1.5,1.5]},rigidbody:{type:"static"}},position:[8,1.5,-6],scale:[6,3,3],tags:["interactive","command"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.6,.3),e.emissive=new pc.Color(.1,.3,.15),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.6,.3,.2),e.emissive=new pc.Color(.3,.15,.1),e.update(),n.model.meshInstances.forEach(t=>t.material=e)}if(s.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.3,.6),e.emissive=new pc.Color(.15,.15,.3),e.emissiveIntensity=.6,e.update(),s.model.meshInstances.forEach(t=>t.material=e)}i.addEntityToRoom(a,"command_center"),i.addEntityToRoom(n,"command_center"),i.addEntityToRoom(s,"command_center"),[[-8,.8,4],[-4,.8,4],[4,.8,4],[8,.8,4]].forEach((t,i)=>{const a=o.create(`Workstation_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,.8,1]}},position:t,scale:[4,1.6,2],tags:["equipment"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.3,.3),e.emissive=new pc.Color(.1,.1,.15),e.update(),a.model.meshInstances.forEach(t=>t.material=e)}e.addChild(a)});const r=o.createNPC("commander_stone",{position:[0,0,2],displayName:"Commander Stone",dialogue:{greeting:"This is a restricted command center! How did you get past security?",topics:{radar:"Our radar array monitors all airspace within a 50-mile radius.",defense:"Defense grid controls automated perimeter weapons systems.",command:"Command terminal has access to all compound tactical systems."}}});i.addEntityToRoom(r,"command_center"),[{pos:[0,5.5,0],color:new pc.Color(.7,.8,1)},{pos:[-8,4.5,0],color:new pc.Color(.7,.8,1)},{pos:[8,4.5,0],color:new pc.Color(.7,.8,1)}].forEach((t,i)=>{const a=o.createLight("point",{color:t.color,intensity:2.2,range:12,position:t.pos});e.addChild(a)})}async function c(e,t,o,i){console.log("[MilitaryCompound] Building weapon vault...");const a=o.create("WeaponVault",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[3,3,2]},rigidbody:{type:"static"}},position:[0,3,-6],scale:[6,6,4],tags:["interactive","vault"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.4,.5),e.emissive=new pc.Color(.2,.2,.3),e.metalness=.9,e.update(),a.model.meshInstances.forEach(t=>t.material=e)}i.addEntityToRoom(a,"weapon_vault"),[[-6,2,0],[6,2,0],[-6,2,4],[6,2,4]].forEach((t,i)=>{const a=o.create(`WeaponRack_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.5,2,.5]}},position:t,scale:[3,4,1],tags:["storage"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.5,.5,.6),e.metalness=.8,e.update(),a.model.meshInstances.forEach(t=>t.material=e)}e.addChild(a)}),[{pos:[0,6.5,0],color:new pc.Color(1,.8,.8)},{pos:[-6,5,0],color:new pc.Color(1,.8,.8)},{pos:[6,5,0],color:new pc.Color(1,.8,.8)}].forEach((t,i)=>{const a=o.createLight("point",{color:t.color,intensity:2,range:12,position:t.pos});e.addChild(a)})}}}]);
|
96.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[96],{96:(t,e,o)=>{o.d(e,{n:()=>r});class i{constructor(t,e){this.app=t,this.id=e.id,this.state="locked",this.requirement=e.requirement||{type:"none"},this.fromRoom=e.fromRoom,this.toRoom=e.toRoom,this.animation=e.animation||"slide",this.entity=null,this.playerSpawnPosition=e.playerSpawnPosition||[0,0,0],this.onTransition=e.onTransition||null}createEntity(t,e,o=[0,0,0]){return this.entity=t.create(this.id,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.1,1.5,1]},rigidbody:{type:"kinematic"}},position:e,rotation:o,scale:[.2,3,2],tags:["door","interactive"]}),this.entity.name=this.id,this.updateDoorAppearance(),this.entity}updateDoorAppearance(){if(!this.entity||!this.entity.model)return;const t=new pc.StandardMaterial;switch(this.state){case"locked":t.diffuse=new pc.Color(.7,.3,.3),t.emissive=new pc.Color(.2,0,0);break;case"unlocked":case"open":t.diffuse=new pc.Color(.3,.7,.3),t.emissive=new pc.Color(0,.2,0);break;default:t.diffuse=new pc.Color(.5,.5,.5)}t.metalness=.8,t.update(),this.entity.model.meshInstances.forEach(e=>e.material=t)}canUnlock(t){if(!this.requirement||!t)return!0;switch(this.requirement.type){case"keycard":return t.inventory?.has(this.requirement.item)||!1;case"objective":try{const e=t.core?.getSystem("objectivemanager");return e?.isComplete(this.requirement.id)||!1}catch(t){return console.warn(`[DoorEntity] Error checking objective: ${t.message}`),!1}case"skill":return t.skills?.hasLevel?.(this.requirement.skill,this.requirement.level||1)||!1;case"sequence":return this.checkInteractionSequence(t.lastInteractions);case"none":return!0;default:return!1}}checkInteractionSequence(t){if(!this.requirement.sequence||!t)return!1;const e=this.requirement.sequence,o=t.slice(-e.length);return e.every((t,e)=>o[e]===t)}async unlock(t){if(!t)return console.error("[DoorEntity] No gameState provided to unlock()"),!1;if(!this.canUnlock(t)){const e=this.getUnlockFailureReason(t);return this.app.fire("ui:notification",{text:`Door locked: ${e}`,type:"warning",duration:3e3}),!1}return this.state="opening",this.updateDoorAppearance(),await this.playAnimation("open"),this.state="open",this.updateDoorAppearance(),this.app.fire("ui:notification",{text:`Access granted to ${this.toRoom.replace("_"," ")}`,type:"success",duration:2e3}),!0}getUnlockFailureReason(t){switch(this.requirement.type){case"keycard":return`Requires ${this.requirement.item.replace("_"," ")}`;case"objective":return`Complete "${this.requirement.id}" first`;case"skill":return`Requires ${this.requirement.skill} level ${this.requirement.level}`;case"sequence":return"Requires specific interaction sequence";default:return"Unknown requirement"}}async playAnimation(t){if(!this.entity)return;const e=this.entity.getLocalPosition().clone(),o=this.entity.getLocalScale().clone(),i=this.entity.getLocalEulerAngles().clone();let n,s;switch(this.createDoorEffects(t),this.animation){case"slide":n="open"===t?new pc.Vec3(e.x,e.y+3.2,e.z):new pc.Vec3(e.x,e.y-3.2,e.z),s=i.clone();break;case"swing":n=e.clone(),s="open"===t?new pc.Vec3(i.x,i.y+90,i.z):new pc.Vec3(i.x,i.y-90,i.z);break;default:n=e.clone(),s=i.clone()}return new Promise(r=>{const a=Date.now(),c=()=>{const l=Date.now()-a;let m=Math.min(l/1500,1);m=1-Math.pow(1-m,3);const h=new pc.Vec3;h.lerp(e,n,m),this.entity.setLocalPosition(h);const d=new pc.Vec3;if(d.lerp(i,s,m),this.entity.setLocalEulerAngles(d),"iris"===this.animation){const e="open"===t?1-.8*m:.2+.8*m;this.entity.setLocalScale(o.x*e,o.y,o.z*e)}if(m>.8){const t=(m-.8)/.2,e=.05*Math.sin(t*Math.PI*3)*(1-t);h.y+=e,this.entity.setLocalPosition(h)}m>=1?r():requestAnimationFrame(c)};c()})}createDoorEffects(t){this.playDoorSound(t),this.createLightFlash(),"slide"===this.animation&&this.createScreenShake()}playDoorSound(t){this.app.fire("audio:play",{sound:"open"===t?"door_open":"door_close",volume:.3,pitch:"slide"===this.animation?.8:1})}createLightFlash(){if(!this.entity)return;const t=new pc.Entity("door_flash");t.addComponent("light",{type:"point",color:new pc.Color(1,1,.8),intensity:2,range:8,castShadows:!1});const e=this.entity.getPosition();t.setPosition(e.x,e.y+1,e.z+1),this.entity.parent.addChild(t);let o=2;const i=()=>{o*=.9,t.light&&(t.light.intensity=o),o>.1?requestAnimationFrame(i):t.destroy()};setTimeout(i,100)}createScreenShake(){this.app.fire("camera:shake",{intensity:.5,duration:300})}async close(){"locked"!==this.state&&"closing"!==this.state&&(this.state="closing",await this.playAnimation("close"),this.state="locked",this.updateDoorAppearance())}async onInteract(t){"locked"===this.state?await this.unlock(t)&&this.onTransition&&setTimeout(()=>{this.onTransition(this.toRoom,this.playerSpawnPosition)},1e3):"open"===this.state&&this.onTransition&&this.onTransition(this.toRoom,this.playerSpawnPosition)}}class n{constructor(t,e){this.app=t,this.multiRoom=e,this.element=null,this.roomElements=new Map,this.doorElements=new Map,this.playerDot=null,this.scale=.15,this.init()}init(){this.element=document.createElement("div"),this.element.id="mini-map",this.element.style.cssText="\n position: fixed;\n bottom: 20px;\n right: 20px;\n width: 220px;\n height: 160px;\n background: rgba(0, 0, 0, 0.8);\n border: 2px solid #00ff88;\n border-radius: 8px;\n padding: 10px;\n z-index: 900;\n font-family: 'Courier New', monospace;\n color: #00ff88;\n box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);\n ";const t=document.createElement("div");t.textContent="FACILITY MAP",t.style.cssText="\n font-size: 10px;\n font-weight: bold;\n text-align: center;\n margin-bottom: 8px;\n color: #00ff88;\n border-bottom: 1px solid #00ff88;\n padding-bottom: 4px;\n ",this.element.appendChild(t),this.mapContainer=document.createElement("div"),this.mapContainer.style.cssText="\n position: relative;\n width: 200px;\n height: 120px;\n background: rgba(0, 20, 10, 0.5);\n border: 1px solid #004422;\n border-radius: 4px;\n overflow: hidden;\n ",this.element.appendChild(this.mapContainer),document.body.appendChild(this.element),this.buildMap(),this.app.on("room:changed",this.onRoomChanged,this)}buildMap(){if(!this.multiRoom||!this.multiRoom.rooms)return;const t=this.calculateRoomLayout();for(const[e,o]of this.multiRoom.rooms)this.createRoomElement(e,o,t[e]);for(const[e,o]of this.multiRoom.doors)this.createDoorElement(e,o,t);this.createPlayerDot(),this.updateCurrentRoom()}calculateRoomLayout(){const t={},e=Array.from(this.multiRoom.rooms.keys());return e.includes("reception")&&e.includes("emergency_ward")?(t.reception={x:30,y:60},t.emergency_ward={x:100,y:60},t.surgery_suite={x:170,y:60}):e.includes("entry_hall")&&e.includes("control_room")?(t.entry_hall={x:30,y:80},t.control_room={x:100,y:80},t.generator_bay={x:100,y:40},t.maintenance_tunnel={x:170,y:40}):e.includes("security_office")&&e.includes("main_corridor")?(t.security_office={x:30,y:90},t.main_corridor={x:100,y:90},t.camera_control={x:100,y:60},t.basement_storage={x:170,y:90},t.server_room={x:170,y:60}):e.forEach((e,o)=>{t[e]={x:30+50*o,y:60}}),t}createRoomElement(t,e,o){if(!o)return;const i=document.createElement("div");i.className="minimap-room",i.id=`minimap-${t}`,i.style.cssText=`\n position: absolute;\n left: ${o.x-15}px;\n top: ${o.y-10}px;\n width: 30px;\n height: 20px;\n border: 1px solid #006644;\n background: rgba(0, 100, 50, 0.3);\n border-radius: 3px;\n cursor: pointer;\n transition: all 0.3s ease;\n `;const n=document.createElement("div");n.textContent=t.replace("_"," ").substring(0,4).toUpperCase(),n.style.cssText="\n font-size: 7px;\n text-align: center;\n line-height: 20px;\n color: #00ff88;\n pointer-events: none;\n ",i.appendChild(n),i.onclick=()=>this.onRoomClick(t),this.mapContainer.appendChild(i),this.roomElements.set(t,i)}createDoorElement(t,e,o){const i=o[e.fromRoom],n=o[e.toRoom];if(!i||!n)return;const s=document.createElement("div");s.className="minimap-door",s.id=`minimap-${t}`;const r=(i.x+n.x)/2,a=(i.y+n.y)/2,c=180*Math.atan2(n.y-i.y,n.x-i.x)/Math.PI,l=Math.sqrt(Math.pow(n.x-i.x,2)+Math.pow(n.y-i.y,2))-30;s.style.cssText=`\n position: absolute;\n left: ${r-l/2}px;\n top: ${a-1}px;\n width: ${l}px;\n height: 2px;\n background: #ff6600;\n transform: rotate(${c}deg);\n transform-origin: center;\n transition: all 0.3s ease;\n `;const m=document.createElement("div");m.style.cssText="\n position: absolute;\n left: 50%;\n top: -4px;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: #ff3333;\n transform: translateX(-50%);\n transition: background 0.3s ease;\n ",s.appendChild(m),this.mapContainer.appendChild(s),this.doorElements.set(t,{element:s,status:m,door:e})}createPlayerDot(){this.playerDot=document.createElement("div"),this.playerDot.style.cssText="\n position: absolute;\n width: 6px;\n height: 6px;\n background: #00ffff;\n border-radius: 50%;\n box-shadow: 0 0 8px #00ffff;\n transition: all 0.5s ease;\n z-index: 10;\n ",this.mapContainer.appendChild(this.playerDot)}updateCurrentRoom(){this.multiRoom.currentRoom&&(this.roomElements.forEach((t,e)=>{e===this.multiRoom.currentRoom?(t.style.background="rgba(0, 255, 136, 0.6)",t.style.borderColor="#00ff88",t.style.boxShadow="0 0 10px rgba(0, 255, 136, 0.5)",t.getBoundingClientRect(),this.mapContainer.getBoundingClientRect(),this.playerDot.style.left=t.offsetLeft+15-3+"px",this.playerDot.style.top=t.offsetTop+10-3+"px"):(t.style.background="rgba(0, 100, 50, 0.3)",t.style.borderColor="#006644",t.style.boxShadow="none")}),this.updateDoorStates())}updateDoorStates(){this.doorElements.forEach((t,e)=>{try{const{element:e,status:o,door:i}=t,n=!(!i.canUnlock||!this.multiRoom.gameState)&&i.canUnlock(this.multiRoom.gameState);"open"===i.state?(o.style.background="#00ff00",e.style.background="#00ff88"):n?(o.style.background="#ffff00",e.style.background="#ffaa00"):(o.style.background="#ff3333",e.style.background="#ff6600")}catch(t){console.warn(`[MiniMap] Error updating door state ${e}:`,t.message)}})}onRoomChanged(t){this.updateCurrentRoom()}onRoomClick(t){const e=this.multiRoom.currentRoom;if(t!==e){for(const[o,i]of this.multiRoom.doors)if(i.fromRoom===e&&i.toRoom===t)return void(i.canUnlock(this.multiRoom.gameState)?this.app.fire("ui:notification",{text:`Navigate to ${t.replace("_"," ")}`,type:"info",duration:2e3}):this.app.fire("ui:notification",{text:`${t.replace("_"," ")} is locked`,type:"warning",duration:2e3}));this.app.fire("ui:notification",{text:`No direct access to ${t.replace("_"," ")}`,type:"warning",duration:2e3})}}show(){this.element&&(this.element.style.display="block")}hide(){this.element&&(this.element.style.display="none")}destroy(){this.element&&(document.body.removeChild(this.element),this.element=null),this.app.off("room:changed",this.onRoomChanged,this),this.roomElements.clear(),this.doorElements.clear()}}class s{constructor(t,e){this.app=t,this.multiRoom=e,this.doorItems=new Map,this.setupDoorItems()}setupDoorItems(){this.itemConfigs={keycard:{model:"card",color:"#00ff88",emissive:"#004422",animation:"glow",scale:[.1,.05,.15],hoverOffset:.3,description:"Access Card Required"},objective:{model:"screen",color:"#ff8800",emissive:"#442200",animation:"pulse",scale:[.2,.3,.05],hoverOffset:.2,description:"Objective Completion Required"},skill:{model:"tool",color:"#8800ff",emissive:"#220044",animation:"rotate",scale:[.15,.15,.15],hoverOffset:.25,description:"Skill Level Required"},sequence:{model:"complex",color:"#ff0088",emissive:"#440022",animation:"complex",scale:[.12,.2,.12],hoverOffset:.4,description:"Sequence Completion Required"},none:{model:"simple",color:"#888888",emissive:"#222222",animation:"none",scale:[.08,.08,.08],hoverOffset:.1,description:"Access Granted"}}}createDoorItem(t,e,o){const i=this.itemConfigs[t.requirement?.type||"none"];if(!i)return null;const n=o.create(`${t.id}_item`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.1,.1,.1]}},position:[e[0]+.3,e[1]+1.5,e[2]],scale:i.scale,tags:["door_item","interactive"]});return this.applyDoorItemMaterial(n,i,t),this.addFloatingAnimation(n,i),this.doorItems.set(t.id,{entity:n,config:i,door:t,basePosition:n.getPosition().clone()}),n}applyDoorItemMaterial(t,e,o){if(!t.model)return;const i=new pc.StandardMaterial;i.diffuse=(new pc.Color).fromString(e.color),i.emissive=(new pc.Color).fromString(e.emissive),i.metalness=.7,i.shininess=80,"open"===o.state?(i.emissive=new pc.Color(.1,.8,.1),i.diffuse=new pc.Color(.3,1,.3)):o.canUnlock&&o.canUnlock(this.multiRoom.gameState)&&(i.emissive=(new pc.Color).fromString(e.emissive).mulScalar(2)),i.update(),t.model.meshInstances.forEach(t=>t.material=i)}addFloatingAnimation(t,e){const o=Date.now(),i=t.getPosition().clone();switch(e.animation){case"glow":this.addGlowAnimation(t,o);break;case"pulse":this.addPulseAnimation(t,o);break;case"rotate":this.addRotateAnimation(t,o);break;case"complex":this.addComplexAnimation(t,o);break;default:this.addFloatAnimation(t,i,e.hoverOffset)}}addFloatAnimation(t,e,o){const i=()=>{if(!t||!t.enabled)return;const n=.001*Date.now(),s=e.clone();s.y+=Math.sin(2*n)*o,t.setPosition(s),requestAnimationFrame(i)};i()}addGlowAnimation(t,e){const o=t.getPosition().clone(),i=()=>{if(!t||!t.enabled)return;const n=.001*(Date.now()-e),s=o.clone();s.y+=.2*Math.sin(1.5*n),t.setPosition(s);const r=1+.1*Math.sin(3*n),a=t.getLocalScale();t.setLocalScale(a.x*r,a.y*r,a.z*r),requestAnimationFrame(i)};i()}addPulseAnimation(t,e){const o=t.getPosition().clone(),i=t.getLocalScale().clone(),n=()=>{if(!t||!t.enabled)return;const s=.001*(Date.now()-e),r=1+.2*Math.sin(4*s);t.setLocalScale(i.x*r,i.y*r,i.z*r);const a=o.clone();a.y+=.15*Math.sin(2*s),t.setPosition(a),requestAnimationFrame(n)};n()}addRotateAnimation(t,e){const o=t.getPosition().clone(),i=()=>{if(!t||!t.enabled)return;const n=.001*(Date.now()-e);t.setEulerAngles(0,45*n,0);const s=o.clone();s.y+=.25*Math.sin(1.8*n),t.setPosition(s),requestAnimationFrame(i)};i()}addComplexAnimation(t,e){const o=t.getPosition().clone(),i=t.getLocalScale().clone(),n=()=>{if(!t||!t.enabled)return;const s=.001*(Date.now()-e),r=o.clone();r.y+=.3*Math.sin(2*s),r.x+=.1*Math.sin(1.5*s),r.z+=.1*Math.cos(1.2*s),t.setPosition(r),t.setEulerAngles(15*Math.sin(s),30*s,10*Math.cos(1.5*s));const a=1+.15*Math.sin(3*s);t.setLocalScale(i.x*a,i.y*a,i.z*a),requestAnimationFrame(n)};n()}updateDoorItemState(t){const e=this.doorItems.get(t);if(!e)return;const{entity:o,config:i,door:n}=e;this.applyDoorItemMaterial(o,i,n);try{n.canUnlock&&this.multiRoom.gameState&&n.canUnlock(this.multiRoom.gameState)?this.showInteractionPrompt(o,i.description):this.hideInteractionPrompt(o)}catch(e){console.warn(`[DoorItems] Error updating door item ${t}:`,e.message)}}showInteractionPrompt(t,e){let o=t.findByName("interaction_prompt");o||(o=new pc.Entity("interaction_prompt"),o.addComponent("element",{type:pc.ELEMENTTYPE_TEXT,text:`[F] ${e}`,fontSize:12,color:new pc.Color(1,1,1),outlineColor:new pc.Color(0,0,0),outlineThickness:.3,fontAsset:null,autoWidth:!0,autoHeight:!0,pivot:[.5,.5],anchor:[.5,.5]}),o.setLocalPosition(0,.8,0),o.setLocalEulerAngles(0,0,0),t.addChild(o));const i=this.app.root.findByTag("MainCamera")[0];i&&o.lookAt(i.getPosition())}hideInteractionPrompt(t){const e=t.findByName("interaction_prompt");e&&e.destroy()}onDoorInteraction(t){const e=this.doorItems.get(t);if(!e)return;const{entity:o,door:i,config:n}=e;this.playInteractionEffect(o),"locked"!==i.state||i.canUnlock(this.multiRoom.gameState)||this.showRequirementMessage(i,n)}playInteractionEffect(t){const e=t.getLocalScale().clone(),o=e.clone().mulScalar(1.3);t.setLocalScale(o),setTimeout(()=>{t&&t.enabled&&t.setLocalScale(e)},200)}showRequirementMessage(t,e){let o=e.description;switch(t.requirement?.type){case"keycard":o=`Requires: ${t.requirement.item.replace("_"," ")}`;break;case"objective":o=`Complete: ${t.requirement.id.replace("_"," ")}`;break;case"skill":o=`Requires: ${t.requirement.skill} level ${t.requirement.level}`;break;case"sequence":o="Complete interaction sequence first"}this.app.fire("ui:notification",{text:o,type:"warning",duration:3e3})}updateAllDoorItems(){this.doorItems.forEach((t,e)=>{this.updateDoorItemState(e)})}cleanup(){this.doorItems.forEach(t=>{t.entity&&t.entity.destroy()}),this.doorItems.clear()}}class r{constructor(t,e){this.app=t,this.core=e,this.rooms=new Map,this.doors=new Map,this.currentRoom=null,this.sceneRoot=null,this.miniMap=null,this.doorItems=null,this.gameState={inventory:new Set,lastInteractions:[],skills:new Map,core:e},this.gameState.skills.hasLevel=(t,e)=>(this.gameState.skills.get(t)||0)>=e,this.onDoorInteract=this.onDoorInteract.bind(this),this.transitionToRoom=this.transitionToRoom.bind(this)}async build(t,e,o){if(this.sceneRoot=o.create("MultiRoomRoot",{position:[0,0,0],tags:["scene_root"]}),this.rooms.size>0){const t=this.rooms.keys().next().value;this.currentRoom=t,await this.buildRoom(t,e,o),this.activateRoom(this.rooms.get(t))}return this.doorItems=new s(t,this),this.sceneRoot}deactivateRoom(t){console.log(`[MultiRoom] Deactivating room: ${t.entity.name}`),t.entity.enabled=!1,t.active=!1,this.disableEntityAndChildren(t.entity),setTimeout(()=>{this.enforceEntityVisibility(t.entity,!1)},0)}disableEntityAndChildren(t){t.enabled=!1,t.children.forEach(t=>{this.disableEntityAndChildren(t)})}enforceEntityVisibility(t,e){t.enabled=e,t.render&&(t.render.enabled=e),t.model&&(t.model.enabled=e),t.children.forEach(t=>{this.enforceEntityVisibility(t,e)})}activateRoom(t){console.log(`[MultiRoom] Activating room: ${t.entity.name}`),t.entity.enabled=!0,t.active=!0,this.enforceEntityVisibility(t.entity,!0)}createRoom(t,e){const o={id:t,entity:null,lighting:e.lighting||"normal",size:e.size||[20,4,15],position:e.position||[0,0,0],active:!1,buildFunction:e.buildFunction||null,npcs:e.npcs||[],interactables:e.interactables||[],objectives:e.objectives||[]};return this.rooms.set(t,o),o}createDoor(t,e,o,n={}){const s=`${t}_to_${e}`,r=new i(this.app,{id:s,fromRoom:t,toRoom:e,requirement:o,animation:n.animation||"slide",playerSpawnPosition:n.playerSpawnPosition||[0,0,5],onTransition:this.transitionToRoom});return this.doors.set(s,r),r}async buildRoom(t,e,o){const i=this.rooms.get(t);if(!i||i.entity)return;console.log(`[MultiRoom] Building room: ${t}`);const n=e.createRoom({size:i.size,position:i.position,lighting:i.lighting});n.name=`${t}_Room`,i.entity=n,i.buildFunction&&await i.buildFunction(n,e,o,this);for(const[e,s]of this.doors)if(s.fromRoom===t){const e=this.getDoorPosition(t,s.toRoom,i.size),r=s.createEntity(o,e);if(n.addChild(r),r.doorInstance=s,this.doorItems){const t=this.doorItems.createDoorItem(s,e,o);t&&n.addChild(t)}}return n.enabled=t===this.currentRoom,this.sceneRoot.addChild(n),n}getDoorPosition(t,e,o){const[i,n,s]=o;return[.3*i,.5*n,.35*s]}async transitionToRoom(t,e){if(!this.rooms.has(t))return console.error(`[MultiRoom] Room ${t} not found`),!1;if(t===this.currentRoom)return console.log(`[MultiRoom] Already in room ${t}`),!0;console.log(`[MultiRoom] Transitioning from ${this.currentRoom} to ${t}`),this.app.fire("ui:notification",{text:`Entering ${t.replace("_"," ")}...`,type:"info",duration:2e3});try{const o=this.rooms.get(t);if(!o.entity){if(!this.sceneBuilder||!this.entityFactory)return console.error("[MultiRoom] Missing sceneBuilder or entityFactory for room building"),!1;await this.buildRoom(t,this.sceneBuilder,this.entityFactory)}if(this.currentRoom){const t=this.rooms.get(this.currentRoom);t.entity&&this.deactivateRoom(t)}this.activateRoom(o),this.currentRoom=t;const i=this.app.root.findByTag("player")[0];return i&&e&&i.setPosition(e),this.updateRoomObjectives(t),this.app.fire("room:changed",{roomId:t,playerPosition:e,roomConfig:o}),console.log(`[MultiRoom] Successfully transitioned to ${t}`),!0}catch(e){return console.error(`[MultiRoom] Error transitioning to room ${t}:`,e),!1}}updateRoomObjectives(t){const e=this.rooms.get(t);if(!e||!e.objectives)return;const o=this.core.getSystem("objectivemanager");o&&(console.log(`[MultiRoom] Updating objectives for room: ${t}`),e.objectives.forEach(t=>{o.objectives.has(t.id)||(o.defineObjective(t.id,t),console.log(`[MultiRoom] Defined objective: ${t.id}`)),t.prerequisites&&0!==t.prerequisites.length?!t.prerequisites.every(t=>o.isComplete(t))||o.isObjectiveActive(t.id)||o.isComplete(t.id)||(o.startObjective(t.id),console.log(`[MultiRoom] Started prerequisite objective: ${t.id}`)):o.isObjectiveActive(t.id)||o.isComplete(t.id)||(o.startObjective(t.id),console.log(`[MultiRoom] Started room objective: ${t.id}`))}))}addItem(t){this.gameState.inventory.add(t);const e=this.core?this.core.getSystem("inventorymanager"):null;e?e.pickupItem(t,1):this.app.fire("ui:notification",{text:`Acquired: ${t.replace("_"," ")}`,type:"success"}),this.doorItems&&this.doorItems.updateAllDoorItems()}hasItem(t){if(this.gameState.inventory.has(t))return!0;const e=this.core?this.core.getSystem("inventorymanager"):null;return!!e&&e.hasItem(t)}recordInteraction(t){this.gameState.lastInteractions.push(t),this.gameState.lastInteractions.length>10&&this.gameState.lastInteractions.shift()}onDoorInteract(t){for(const[e,o]of this.doors)if(e===t||o.entity&&o.entity.name===t)return void o.onInteract(this.gameState);console.warn(`[MultiRoom] Door not found: ${t}`)}setupInteractions(t,e){this.interactionHandler=t=>{if(this.recordInteraction(t),t.includes("_to_")){if(this.onDoorInteract(t),this.doorItems){const e=Array.from(this.doors.values()).find(e=>e.id===t);e&&this.doorItems.onDoorInteraction(e.id)}}else this.handleRoomInteraction(t)},this.npcInteractionHandler=t=>{console.log(`[MultiRoom] NPC interaction with ${t}`),this.recordInteraction(t),this.sceneInteractionHandler?this.sceneInteractionHandler(t):console.log(`[MultiRoom] No scene interaction handler registered for NPC: ${t}`)},t.on("interaction:triggered",this.interactionHandler),t.on("npc:interact",this.npcInteractionHandler)}handleRoomInteraction(t){console.log(`[MultiRoom] Room interaction: ${t} in room ${this.currentRoom}`),this.sceneInteractionHandler?(console.log("[MultiRoom] Calling scene interaction handler"),this.sceneInteractionHandler(t)):console.log("[MultiRoom] No scene interaction handler registered")}setSceneInteractionHandler(t){this.sceneInteractionHandler=t}syncWithGlobalInventory(t){const e=t?t.getSystem("inventorymanager"):null;if(e){for(const[t,o]of e.items.entries())o&&o.id&&this.gameState.inventory.add(o.id);console.log(`[MultiRoom] Synced ${this.gameState.inventory.size} items from global inventory`)}else console.warn("[MultiRoom] No InventoryManager available for sync")}onLoad(t,e){this.setupInteractions(t,e),this.app=t,this.core=e,this.gameState&&e&&(this.gameState.core=e),this.syncWithGlobalInventory(e),this.setupObjectives(t,e),this.miniMap=new n(t,this),setTimeout(()=>{t.fire("ui:notification",{text:`Multi-room scene loaded: ${this.currentRoom}. All interactions available.`,type:"info",duration:3e3})},500),console.log(`[MultiRoom] Multi-room scene loaded, starting in ${this.currentRoom}`),console.log("[MultiRoom] GameState inventory:",this.gameState.inventory.size,"items"),setTimeout(()=>{const t=this.sceneRoot.find(t=>t.tags&&t.tags.has("interactive"));console.log(`[MultiRoom] Found ${t.length} interactive items:`),t.forEach(t=>{console.log(` - ${t.name}: enabled=${t.enabled}, position=${t.getPosition().toString()}`)})},1e3)}setupObjectives(t,e){const o=e.getSystem("objectivemanager");if(!o)return void console.warn("[MultiRoom] ObjectiveManager not available");console.log("[MultiRoom] Setting up objectives for multi-room scene"),o.clearAllObjectives();const i=[];for(const[t,e]of this.rooms)e.objectives&&Array.isArray(e.objectives)&&(console.log(`[MultiRoom] Found ${e.objectives.length} objectives in room ${t}`),i.push(...e.objectives));i.forEach(t=>{o.defineObjective(t.id,t),console.log(`[MultiRoom] Registered objective: ${t.id} - ${t.name}`)}),i.forEach(t=>{t.autoStart&&(o.startObjective(t.id),console.log(`[MultiRoom] Auto-started objective: ${t.id}`))}),this.currentRoom&&(console.log(`[MultiRoom] Starting objectives for initial room: ${this.currentRoom}`),this.updateRoomObjectives(this.currentRoom)),console.log(`[MultiRoom] Objective setup complete - ${i.length} objectives registered`)}onUnload(t,e){console.log("[MultiRoom] Cleaning up multi-room scene..."),this.interactionHandler&&(t.off("interaction:triggered",this.interactionHandler),this.interactionHandler=null),this.npcInteractionHandler&&(t.off("npc:interact",this.npcInteractionHandler),this.npcInteractionHandler=null),this.miniMap&&(this.miniMap.destroy(),this.miniMap=null),this.doorItems&&(this.doorItems.cleanup(),this.doorItems=null);for(const[t,e]of this.rooms)e.entity&&e.entity.findByTag("npc").forEach(t=>{t.cleanupLabel&&t.cleanupLabel()}),e.active=!1;this.gameState.inventory.clear(),this.gameState.lastInteractions=[],this.gameState.skills.clear(),this.currentRoom=null}}}}]);
|
|
|
|
| 1 |
+
"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[96],{96:(t,e,o)=>{o.d(e,{n:()=>r});class i{constructor(t,e){this.app=t,this.id=e.id,this.state="locked",this.requirement=e.requirement||{type:"none"},this.fromRoom=e.fromRoom,this.toRoom=e.toRoom,this.animation=e.animation||"slide",this.entity=null,this.playerSpawnPosition=e.playerSpawnPosition||[0,0,0],this.onTransition=e.onTransition||null}createEntity(t,e,o=[0,0,0]){return this.entity=t.create(this.id,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.1,1.5,1]},rigidbody:{type:"kinematic"}},position:e,rotation:o,scale:[.2,3,2],tags:["door","interactive"]}),this.entity.name=this.id,this.updateDoorAppearance(),this.entity}updateDoorAppearance(){if(!this.entity||!this.entity.model)return;const t=new pc.StandardMaterial;switch(this.state){case"locked":t.diffuse=new pc.Color(.7,.3,.3),t.emissive=new pc.Color(.2,0,0);break;case"unlocked":case"open":t.diffuse=new pc.Color(.3,.7,.3),t.emissive=new pc.Color(0,.2,0);break;default:t.diffuse=new pc.Color(.5,.5,.5)}t.metalness=.8,t.update(),this.entity.model.meshInstances.forEach(e=>e.material=t)}canUnlock(t){if(!this.requirement||!t)return!0;switch(this.requirement.type){case"keycard":return t.inventory?.has(this.requirement.item)||!1;case"objective":try{const e=t.core?.getSystem("objectivemanager");return e?.isComplete(this.requirement.id)||!1}catch(t){return console.warn(`[DoorEntity] Error checking objective: ${t.message}`),!1}case"skill":return t.skills?.hasLevel?.(this.requirement.skill,this.requirement.level||1)||!1;case"sequence":return this.checkInteractionSequence(t.lastInteractions);case"none":return!0;default:return!1}}checkInteractionSequence(t){if(!this.requirement.sequence||!t)return!1;const e=this.requirement.sequence,o=t.slice(-e.length);return e.every((t,e)=>o[e]===t)}async unlock(t){if(!t)return console.error("[DoorEntity] No gameState provided to unlock()"),!1;if(!this.canUnlock(t)){const e=this.getUnlockFailureReason(t);return this.app.fire("ui:notification",{text:`Door locked: ${e}`,type:"warning",duration:3e3}),!1}return this.state="opening",this.updateDoorAppearance(),await this.playAnimation("open"),this.state="open",this.updateDoorAppearance(),this.app.fire("ui:notification",{text:`Access granted to ${this.toRoom.replace("_"," ")}`,type:"success",duration:2e3}),!0}getUnlockFailureReason(t){switch(this.requirement.type){case"keycard":return`Requires ${this.requirement.item.replace("_"," ")}`;case"objective":return`Complete "${this.requirement.id}" first`;case"skill":return`Requires ${this.requirement.skill} level ${this.requirement.level}`;case"sequence":return"Requires specific interaction sequence";default:return"Unknown requirement"}}async playAnimation(t){if(!this.entity)return;const e=this.entity.getLocalPosition().clone(),o=this.entity.getLocalScale().clone(),i=this.entity.getLocalEulerAngles().clone();let n,s;switch(this.createDoorEffects(t),this.animation){case"slide":n="open"===t?new pc.Vec3(e.x,e.y+3.2,e.z):new pc.Vec3(e.x,e.y-3.2,e.z),s=i.clone();break;case"swing":n=e.clone(),s="open"===t?new pc.Vec3(i.x,i.y+90,i.z):new pc.Vec3(i.x,i.y-90,i.z);break;default:n=e.clone(),s=i.clone()}return new Promise(r=>{const a=Date.now(),c=()=>{const l=Date.now()-a;let m=Math.min(l/1500,1);m=1-Math.pow(1-m,3);const h=new pc.Vec3;h.lerp(e,n,m),this.entity.setLocalPosition(h);const d=new pc.Vec3;if(d.lerp(i,s,m),this.entity.setLocalEulerAngles(d),"iris"===this.animation){const e="open"===t?1-.8*m:.2+.8*m;this.entity.setLocalScale(o.x*e,o.y,o.z*e)}if(m>.8){const t=(m-.8)/.2,e=.05*Math.sin(t*Math.PI*3)*(1-t);h.y+=e,this.entity.setLocalPosition(h)}m>=1?r():requestAnimationFrame(c)};c()})}createDoorEffects(t){this.playDoorSound(t),this.createLightFlash(),"slide"===this.animation&&this.createScreenShake()}playDoorSound(t){this.app.fire("audio:play",{sound:"open"===t?"door_open":"door_close",volume:.3,pitch:"slide"===this.animation?.8:1})}createLightFlash(){if(!this.entity)return;const t=new pc.Entity("door_flash");t.addComponent("light",{type:"point",color:new pc.Color(1,1,.8),intensity:2,range:8,castShadows:!1});const e=this.entity.getPosition();t.setPosition(e.x,e.y+1,e.z+1),this.entity.parent.addChild(t);let o=2;const i=()=>{o*=.9,t.light&&(t.light.intensity=o),o>.1?requestAnimationFrame(i):t.destroy()};setTimeout(i,100)}createScreenShake(){this.app.fire("camera:shake",{intensity:.5,duration:300})}async close(){"locked"!==this.state&&"closing"!==this.state&&(this.state="closing",await this.playAnimation("close"),this.state="locked",this.updateDoorAppearance())}async onInteract(t){"locked"===this.state?await this.unlock(t)&&this.onTransition&&setTimeout(()=>{this.onTransition(this.toRoom,this.playerSpawnPosition)},1e3):"open"===this.state&&this.onTransition&&this.onTransition(this.toRoom,this.playerSpawnPosition)}}class n{constructor(t,e){this.app=t,this.multiRoom=e,this.element=null,this.roomElements=new Map,this.doorElements=new Map,this.playerDot=null,this.scale=.15,this.init()}init(){this.element=document.createElement("div"),this.element.id="mini-map",this.element.style.cssText="\n position: fixed;\n bottom: 20px;\n right: 20px;\n width: 220px;\n height: 160px;\n background: rgba(0, 0, 0, 0.8);\n border: 2px solid #00ff88;\n border-radius: 8px;\n padding: 10px;\n z-index: 900;\n font-family: 'Courier New', monospace;\n color: #00ff88;\n box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);\n ";const t=document.createElement("div");t.textContent="FACILITY MAP",t.style.cssText="\n font-size: 10px;\n font-weight: bold;\n text-align: center;\n margin-bottom: 8px;\n color: #00ff88;\n border-bottom: 1px solid #00ff88;\n padding-bottom: 4px;\n ",this.element.appendChild(t),this.mapContainer=document.createElement("div"),this.mapContainer.style.cssText="\n position: relative;\n width: 200px;\n height: 120px;\n background: rgba(0, 20, 10, 0.5);\n border: 1px solid #004422;\n border-radius: 4px;\n overflow: hidden;\n ",this.element.appendChild(this.mapContainer),document.body.appendChild(this.element),this.buildMap(),this.app.on("room:changed",this.onRoomChanged,this)}buildMap(){if(!this.multiRoom||!this.multiRoom.rooms)return;const t=this.calculateRoomLayout();for(const[e,o]of this.multiRoom.rooms)this.createRoomElement(e,o,t[e]);for(const[e,o]of this.multiRoom.doors)this.createDoorElement(e,o,t);this.createPlayerDot(),this.updateCurrentRoom()}calculateRoomLayout(){const t={},e=Array.from(this.multiRoom.rooms.keys());return e.includes("reception")&&e.includes("emergency_ward")?(t.reception={x:30,y:60},t.emergency_ward={x:100,y:60},t.surgery_suite={x:170,y:60}):e.includes("entry_hall")&&e.includes("control_room")?(t.entry_hall={x:30,y:80},t.control_room={x:100,y:80},t.generator_bay={x:100,y:40},t.maintenance_tunnel={x:170,y:40}):e.includes("security_office")&&e.includes("main_corridor")?(t.security_office={x:30,y:90},t.main_corridor={x:100,y:90},t.camera_control={x:100,y:60},t.basement_storage={x:170,y:90},t.server_room={x:170,y:60}):e.forEach((e,o)=>{t[e]={x:30+50*o,y:60}}),t}createRoomElement(t,e,o){if(!o)return;const i=document.createElement("div");i.className="minimap-room",i.id=`minimap-${t}`,i.style.cssText=`\n position: absolute;\n left: ${o.x-15}px;\n top: ${o.y-10}px;\n width: 30px;\n height: 20px;\n border: 1px solid #006644;\n background: rgba(0, 100, 50, 0.3);\n border-radius: 3px;\n cursor: pointer;\n transition: all 0.3s ease;\n `;const n=document.createElement("div");n.textContent=t.replace("_"," ").substring(0,4).toUpperCase(),n.style.cssText="\n font-size: 7px;\n text-align: center;\n line-height: 20px;\n color: #00ff88;\n pointer-events: none;\n ",i.appendChild(n),i.onclick=()=>this.onRoomClick(t),this.mapContainer.appendChild(i),this.roomElements.set(t,i)}createDoorElement(t,e,o){const i=o[e.fromRoom],n=o[e.toRoom];if(!i||!n)return;const s=document.createElement("div");s.className="minimap-door",s.id=`minimap-${t}`;const r=(i.x+n.x)/2,a=(i.y+n.y)/2,c=180*Math.atan2(n.y-i.y,n.x-i.x)/Math.PI,l=Math.sqrt(Math.pow(n.x-i.x,2)+Math.pow(n.y-i.y,2))-30;s.style.cssText=`\n position: absolute;\n left: ${r-l/2}px;\n top: ${a-1}px;\n width: ${l}px;\n height: 2px;\n background: #ff6600;\n transform: rotate(${c}deg);\n transform-origin: center;\n transition: all 0.3s ease;\n `;const m=document.createElement("div");m.style.cssText="\n position: absolute;\n left: 50%;\n top: -4px;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: #ff3333;\n transform: translateX(-50%);\n transition: background 0.3s ease;\n ",s.appendChild(m),this.mapContainer.appendChild(s),this.doorElements.set(t,{element:s,status:m,door:e})}createPlayerDot(){this.playerDot=document.createElement("div"),this.playerDot.style.cssText="\n position: absolute;\n width: 6px;\n height: 6px;\n background: #00ffff;\n border-radius: 50%;\n box-shadow: 0 0 8px #00ffff;\n transition: all 0.5s ease;\n z-index: 10;\n ",this.mapContainer.appendChild(this.playerDot)}updateCurrentRoom(){this.multiRoom.currentRoom&&(this.roomElements.forEach((t,e)=>{e===this.multiRoom.currentRoom?(t.style.background="rgba(0, 255, 136, 0.6)",t.style.borderColor="#00ff88",t.style.boxShadow="0 0 10px rgba(0, 255, 136, 0.5)",t.getBoundingClientRect(),this.mapContainer.getBoundingClientRect(),this.playerDot.style.left=t.offsetLeft+15-3+"px",this.playerDot.style.top=t.offsetTop+10-3+"px"):(t.style.background="rgba(0, 100, 50, 0.3)",t.style.borderColor="#006644",t.style.boxShadow="none")}),this.updateDoorStates())}updateDoorStates(){this.doorElements.forEach((t,e)=>{try{const{element:e,status:o,door:i}=t,n=!(!i.canUnlock||!this.multiRoom.gameState)&&i.canUnlock(this.multiRoom.gameState);"open"===i.state?(o.style.background="#00ff00",e.style.background="#00ff88"):n?(o.style.background="#ffff00",e.style.background="#ffaa00"):(o.style.background="#ff3333",e.style.background="#ff6600")}catch(t){console.warn(`[MiniMap] Error updating door state ${e}:`,t.message)}})}onRoomChanged(t){this.updateCurrentRoom()}onRoomClick(t){const e=this.multiRoom.currentRoom;if(t!==e){for(const[o,i]of this.multiRoom.doors)if(i.fromRoom===e&&i.toRoom===t)return void(i.canUnlock(this.multiRoom.gameState)?this.app.fire("ui:notification",{text:`Navigate to ${t.replace("_"," ")}`,type:"info",duration:2e3}):this.app.fire("ui:notification",{text:`${t.replace("_"," ")} is locked`,type:"warning",duration:2e3}));this.app.fire("ui:notification",{text:`No direct access to ${t.replace("_"," ")}`,type:"warning",duration:2e3})}}show(){this.element&&(this.element.style.display="block")}hide(){this.element&&(this.element.style.display="none")}destroy(){this.element&&(document.body.removeChild(this.element),this.element=null),this.app.off("room:changed",this.onRoomChanged,this),this.roomElements.clear(),this.doorElements.clear()}}class s{constructor(t,e){this.app=t,this.multiRoom=e,this.doorItems=new Map,this.setupDoorItems()}setupDoorItems(){this.itemConfigs={keycard:{model:"card",color:"#00ff88",emissive:"#004422",animation:"glow",scale:[.1,.05,.15],hoverOffset:.3,description:"Access Card Required"},objective:{model:"screen",color:"#ff8800",emissive:"#442200",animation:"pulse",scale:[.2,.3,.05],hoverOffset:.2,description:"Objective Completion Required"},skill:{model:"tool",color:"#8800ff",emissive:"#220044",animation:"rotate",scale:[.15,.15,.15],hoverOffset:.25,description:"Skill Level Required"},sequence:{model:"complex",color:"#ff0088",emissive:"#440022",animation:"complex",scale:[.12,.2,.12],hoverOffset:.4,description:"Sequence Completion Required"},none:{model:"simple",color:"#888888",emissive:"#222222",animation:"none",scale:[.08,.08,.08],hoverOffset:.1,description:"Access Granted"}}}createDoorItem(t,e,o){const i=this.itemConfigs[t.requirement?.type||"none"];if(!i)return null;const n=o.create(`${t.id}_item`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.1,.1,.1]}},position:[e[0]+.3,e[1]+1.5,e[2]],scale:i.scale,tags:["door_item","interactive"]});return this.applyDoorItemMaterial(n,i,t),this.addFloatingAnimation(n,i),this.doorItems.set(t.id,{entity:n,config:i,door:t,basePosition:n.getPosition().clone()}),n}applyDoorItemMaterial(t,e,o){if(!t.model)return;const i=new pc.StandardMaterial;i.diffuse=(new pc.Color).fromString(e.color),i.emissive=(new pc.Color).fromString(e.emissive),i.metalness=.7,i.shininess=80,"open"===o.state?(i.emissive=new pc.Color(.1,.8,.1),i.diffuse=new pc.Color(.3,1,.3)):o.canUnlock&&o.canUnlock(this.multiRoom.gameState)&&(i.emissive=(new pc.Color).fromString(e.emissive).mulScalar(2)),i.update(),t.model.meshInstances.forEach(t=>t.material=i)}addFloatingAnimation(t,e){const o=Date.now(),i=t.getPosition().clone();switch(e.animation){case"glow":this.addGlowAnimation(t,o);break;case"pulse":this.addPulseAnimation(t,o);break;case"rotate":this.addRotateAnimation(t,o);break;case"complex":this.addComplexAnimation(t,o);break;default:this.addFloatAnimation(t,i,e.hoverOffset)}}addFloatAnimation(t,e,o){const i=()=>{if(!t||!t.enabled)return;const n=.001*Date.now(),s=e.clone();s.y+=Math.sin(2*n)*o,t.setPosition(s),requestAnimationFrame(i)};i()}addGlowAnimation(t,e){const o=t.getPosition().clone(),i=()=>{if(!t||!t.enabled)return;const n=.001*(Date.now()-e),s=o.clone();s.y+=.2*Math.sin(1.5*n),t.setPosition(s);const r=1+.1*Math.sin(3*n),a=t.getLocalScale();t.setLocalScale(a.x*r,a.y*r,a.z*r),requestAnimationFrame(i)};i()}addPulseAnimation(t,e){const o=t.getPosition().clone(),i=t.getLocalScale().clone(),n=()=>{if(!t||!t.enabled)return;const s=.001*(Date.now()-e),r=1+.2*Math.sin(4*s);t.setLocalScale(i.x*r,i.y*r,i.z*r);const a=o.clone();a.y+=.15*Math.sin(2*s),t.setPosition(a),requestAnimationFrame(n)};n()}addRotateAnimation(t,e){const o=t.getPosition().clone(),i=()=>{if(!t||!t.enabled)return;const n=.001*(Date.now()-e);t.setEulerAngles(0,45*n,0);const s=o.clone();s.y+=.25*Math.sin(1.8*n),t.setPosition(s),requestAnimationFrame(i)};i()}addComplexAnimation(t,e){const o=t.getPosition().clone(),i=t.getLocalScale().clone(),n=()=>{if(!t||!t.enabled)return;const s=.001*(Date.now()-e),r=o.clone();r.y+=.3*Math.sin(2*s),r.x+=.1*Math.sin(1.5*s),r.z+=.1*Math.cos(1.2*s),t.setPosition(r),t.setEulerAngles(15*Math.sin(s),30*s,10*Math.cos(1.5*s));const a=1+.15*Math.sin(3*s);t.setLocalScale(i.x*a,i.y*a,i.z*a),requestAnimationFrame(n)};n()}updateDoorItemState(t){const e=this.doorItems.get(t);if(!e)return;const{entity:o,config:i,door:n}=e;this.applyDoorItemMaterial(o,i,n);try{n.canUnlock&&this.multiRoom.gameState&&n.canUnlock(this.multiRoom.gameState)?this.showInteractionPrompt(o,i.description):this.hideInteractionPrompt(o)}catch(e){console.warn(`[DoorItems] Error updating door item ${t}:`,e.message)}}showInteractionPrompt(t,e){let o=t.findByName("interaction_prompt");o||(o=new pc.Entity("interaction_prompt"),o.addComponent("element",{type:pc.ELEMENTTYPE_TEXT,text:`[F] ${e}`,fontSize:12,color:new pc.Color(1,1,1),outlineColor:new pc.Color(0,0,0),outlineThickness:.3,fontAsset:null,autoWidth:!0,autoHeight:!0,pivot:[.5,.5],anchor:[.5,.5]}),o.setLocalPosition(0,.8,0),o.setLocalEulerAngles(0,0,0),t.addChild(o));const i=this.app.root.findByTag("MainCamera")[0];i&&o.lookAt(i.getPosition())}hideInteractionPrompt(t){const e=t.findByName("interaction_prompt");e&&e.destroy()}onDoorInteraction(t){const e=this.doorItems.get(t);if(!e)return;const{entity:o,door:i,config:n}=e;this.playInteractionEffect(o),"locked"!==i.state||i.canUnlock(this.multiRoom.gameState)||this.showRequirementMessage(i,n)}playInteractionEffect(t){const e=t.getLocalScale().clone(),o=e.clone().mulScalar(1.3);t.setLocalScale(o),setTimeout(()=>{t&&t.enabled&&t.setLocalScale(e)},200)}showRequirementMessage(t,e){let o=e.description;switch(t.requirement?.type){case"keycard":o=`Requires: ${t.requirement.item.replace("_"," ")}`;break;case"objective":o=`Complete: ${t.requirement.id.replace("_"," ")}`;break;case"skill":o=`Requires: ${t.requirement.skill} level ${t.requirement.level}`;break;case"sequence":o="Complete interaction sequence first"}this.app.fire("ui:notification",{text:o,type:"warning",duration:3e3})}updateAllDoorItems(){this.doorItems.forEach((t,e)=>{this.updateDoorItemState(e)})}cleanup(){this.doorItems.forEach(t=>{t.entity&&t.entity.destroy()}),this.doorItems.clear()}}class r{constructor(t,e){this.app=t,this.core=e,this.rooms=new Map,this.doors=new Map,this.roomEntities=new Map,this.currentRoom=null,this.sceneRoot=null,this.miniMap=null,this.doorItems=null,this.gameState={inventory:new Set,lastInteractions:[],skills:new Map,core:e},this.gameState.skills.hasLevel=(t,e)=>(this.gameState.skills.get(t)||0)>=e,this.onDoorInteract=this.onDoorInteract.bind(this),this.transitionToRoom=this.transitionToRoom.bind(this)}async build(t,e,o){if(this.sceneBuilder=e,this.entityFactory=o,this.sceneRoot=o.create("MultiRoomRoot",{position:[0,0,0],tags:["scene_root"]}),this.rooms.size>0){const t=this.rooms.keys().next().value;this.currentRoom=t,await this.buildRoom(t,e,o),this.activateRoom(this.rooms.get(t))}return this.doorItems=new s(t,this),this.sceneRoot}deactivateRoom(t){console.log(`[MultiRoom] Deactivating room: ${t.entity.name}`);for(const[e,o]of this.doors)if(o.fromRoom===t.id&&o.entity&&("open"===o.state||"opening"===o.state)){if(o.state="locked",o.updateDoorAppearance(),o.entity){const e=this.getDoorPosition(o.fromRoom,o.toRoom,t.size);o.entity.setLocalPosition(e),o.entity.setLocalRotation(0,0,0),o.entity.setLocalScale(.2,3,2)}console.log(`[MultiRoom] Reset door ${e} state and position`)}t.entity.enabled=!1,t.active=!1,this.disableEntityAndChildren(t.entity),setTimeout(()=>{this.enforceEntityVisibility(t.entity,!1)},0)}disableEntityAndChildren(t){t.enabled=!1,t.children.forEach(t=>{this.disableEntityAndChildren(t)})}enforceEntityVisibility(t,e){t.enabled=e,t.render&&(t.render.enabled=e),t.model&&(t.model.enabled=e),t.children.forEach(t=>{this.enforceEntityVisibility(t,e)})}activateRoom(t){console.log(`[MultiRoom] Activating room: ${t.entity.name}`),t.entity.enabled=!0,t.active=!0,this.enforceEntityVisibility(t.entity,!0)}createRoom(t,e){const o={id:t,entity:null,lighting:e.lighting||"normal",size:e.size||[20,4,15],position:e.position||[0,0,0],active:!1,buildFunction:e.buildFunction||null,npcs:e.npcs||[],interactables:e.interactables||[],objectives:e.objectives||[]};return this.rooms.set(t,o),o}createDoor(t,e,o,n={}){const s=`${t}_to_${e}`,r=new i(this.app,{id:s,fromRoom:t,toRoom:e,requirement:o,animation:n.animation||"slide",playerSpawnPosition:n.playerSpawnPosition||[0,0,5],onTransition:this.transitionToRoom});this.doors.set(s,r);const a=this.rooms.get(t);if(a&&a.entity&&this.entityFactory){const o=this.getDoorPosition(t,e,a.size),i=r.createEntity(this.entityFactory,o);if(a.entity.addChild(i),i.doorInstance=r,this.doorItems){const t=this.doorItems.createDoorItem(r,o,this.entityFactory);t&&a.entity.addChild(t)}console.log(`[MultiRoom] Added door ${s} to existing room ${t}`)}return r}async buildRoom(t,e,o){const i=this.rooms.get(t);if(!i||i.entity)return;console.log(`[MultiRoom] Building room: ${t}`);const n=e.createRoom({size:i.size,position:i.position,lighting:i.lighting});n.name=`${t}_Room`,i.entity=n,i.buildFunction&&await i.buildFunction(n,e,o,this);for(const[e,s]of this.doors)if(s.fromRoom===t){const e=this.getDoorPosition(t,s.toRoom,i.size),r=s.createEntity(o,e);if(n.addChild(r),r.doorInstance=s,this.doorItems){const t=this.doorItems.createDoorItem(s,e,o);t&&n.addChild(t)}}return n.enabled=t===this.currentRoom,this.sceneRoot.addChild(n),n}getDoorPosition(t,e,o){const[i,n,s]=o;return[.3*i,.5*n,.35*s]}addEntityToRoom(t,e){this.roomEntities.has(e)||this.roomEntities.set(e,new Set),this.roomEntities.get(e).add(t),this.sceneRoot.addChild(t),t.enabled=e===this.currentRoom,console.log(`[MultiRoom] Added entity ${t.name} to room ${e}, enabled: ${t.enabled}`)}updateEntityVisibilityForRoom(t){console.log(`[MultiRoom] Updating entity visibility for room: ${t}`);for(const[e,o]of this.roomEntities)e!==t&&o.forEach(t=>{t.enabled=!1,this.enforceEntityVisibility(t,!1)});this.roomEntities.has(t)&&this.roomEntities.get(t).forEach(t=>{t.enabled=!0,this.enforceEntityVisibility(t,!0)})}async transitionToRoom(t,e){if(!this.rooms.has(t))return console.error(`[MultiRoom] Room ${t} not found`),!1;if(t===this.currentRoom)return console.log(`[MultiRoom] Already in room ${t}`),!0;console.log(`[MultiRoom] Transitioning from ${this.currentRoom} to ${t}`),this.app.fire("ui:notification",{text:`Entering ${t.replace("_"," ")}...`,type:"info",duration:2e3});try{const o=this.rooms.get(t);if(!o.entity){if(!this.sceneBuilder||!this.entityFactory)return console.error("[MultiRoom] Missing sceneBuilder or entityFactory for room building"),!1;await this.buildRoom(t,this.sceneBuilder,this.entityFactory)}if(this.currentRoom){const t=this.rooms.get(this.currentRoom);t.entity&&this.deactivateRoom(t)}this.activateRoom(o),this.currentRoom=t,this.updateEntityVisibilityForRoom(t);const i=this.app.root.findByTag("player")[0];return i&&e&&i.setPosition(e),this.updateRoomObjectives(t),this.app.fire("room:changed",{roomId:t,playerPosition:e,roomConfig:o}),console.log(`[MultiRoom] Successfully transitioned to ${t}`),!0}catch(e){return console.error(`[MultiRoom] Error transitioning to room ${t}:`,e),!1}}updateRoomObjectives(t){const e=this.rooms.get(t);if(!e||!e.objectives)return void console.log(`[MultiRoom] No objectives found for room: ${t}`);const o=this.core.getSystem("objectivemanager");o?(console.log(`[MultiRoom] Updating objectives for room: ${t} (${e.objectives.length} objectives)`),e.objectives.forEach(t=>{console.log(`[MultiRoom] Processing objective: ${t.id} (type: ${t.type})`),o.objectives.has(t.id)||(o.defineObjective(t.id,t),console.log(`[MultiRoom] Defined objective: ${t.id}`)),t.prerequisites&&0!==t.prerequisites.length?(console.log(`[MultiRoom] Checking prerequisites for ${t.id}: ${t.prerequisites}`),!t.prerequisites.every(t=>{const e=o.isComplete(t);return console.log(`[MultiRoom] Prerequisite ${t} complete: ${e}`),e})||o.isObjectiveActive(t.id)||o.isComplete(t.id)?console.log(`[MultiRoom] Prerequisites not met for ${t.id} or objective already active/complete`):(console.log(`[MultiRoom] Starting prerequisite objective: ${t.id}`),o.startObjective(t.id),console.log(`[MultiRoom] Successfully started prerequisite objective: ${t.id}`))):o.isObjectiveActive(t.id)||o.isComplete(t.id)?console.log(`[MultiRoom] Objective ${t.id} already active or completed: active=${o.isObjectiveActive(t.id)}, complete=${o.isComplete(t.id)}`):(console.log(`[MultiRoom] Starting room objective: ${t.id} (no prerequisites)`),o.startObjective(t.id),console.log(`[MultiRoom] Successfully started room objective: ${t.id}`))})):console.warn(`[MultiRoom] ObjectiveManager not available for room: ${t}`)}addItem(t){this.gameState.inventory.add(t);const e=this.core?this.core.getSystem("inventorymanager"):null;e?e.pickupItem(t,1):this.app.fire("ui:notification",{text:`Acquired: ${t.replace("_"," ")}`,type:"success"}),this.doorItems&&this.doorItems.updateAllDoorItems()}hasItem(t){if(this.gameState.inventory.has(t))return!0;const e=this.core?this.core.getSystem("inventorymanager"):null;return!!e&&e.hasItem(t)}recordInteraction(t){this.gameState.lastInteractions.push(t),this.gameState.lastInteractions.length>10&&this.gameState.lastInteractions.shift()}onDoorInteract(t){for(const[e,o]of this.doors)if(e===t||o.entity&&o.entity.name===t)return void o.onInteract(this.gameState);console.warn(`[MultiRoom] Door not found: ${t}`)}setupInteractions(t,e){this.interactionHandler=t=>{if(this.recordInteraction(t),t.includes("_to_")){if(this.onDoorInteract(t),this.doorItems){const e=Array.from(this.doors.values()).find(e=>e.id===t);e&&this.doorItems.onDoorInteraction(e.id)}}else this.handleRoomInteraction(t)},this.npcInteractionHandler=t=>{console.log(`[MultiRoom] NPC interaction with ${t}`),this.recordInteraction(t),this.sceneInteractionHandler?this.sceneInteractionHandler(t):console.log(`[MultiRoom] No scene interaction handler registered for NPC: ${t}`)},t.on("interaction:triggered",this.interactionHandler),t.on("npc:interact",this.npcInteractionHandler)}handleRoomInteraction(t){console.log(`[MultiRoom] Room interaction: ${t} in room ${this.currentRoom}`),this.sceneInteractionHandler?(console.log("[MultiRoom] Calling scene interaction handler"),this.sceneInteractionHandler(t)):console.log("[MultiRoom] No scene interaction handler registered")}setSceneInteractionHandler(t){this.sceneInteractionHandler=t}syncWithGlobalInventory(t){const e=t?t.getSystem("inventorymanager"):null;if(e){for(const[t,o]of e.items.entries())o&&o.id&&this.gameState.inventory.add(o.id);console.log(`[MultiRoom] Synced ${this.gameState.inventory.size} items from global inventory`)}else console.warn("[MultiRoom] No InventoryManager available for sync")}onLoad(t,e){this.setupInteractions(t,e),this.app=t,this.core=e,this.gameState&&e&&(this.gameState.core=e),this.syncWithGlobalInventory(e),this.setupObjectives(t,e),this.miniMap=new n(t,this),setTimeout(()=>{t.fire("ui:notification",{text:`Multi-room scene loaded: ${this.currentRoom}. All interactions available.`,type:"info",duration:3e3})},500),console.log(`[MultiRoom] Multi-room scene loaded, starting in ${this.currentRoom}`),console.log("[MultiRoom] GameState inventory:",this.gameState.inventory.size,"items"),setTimeout(()=>{const t=this.sceneRoot.find(t=>t.tags&&t.tags.has("interactive"));console.log(`[MultiRoom] Found ${t.length} interactive items:`),t.forEach(t=>{console.log(` - ${t.name}: enabled=${t.enabled}, position=${t.getPosition().toString()}`)})},1e3)}setupObjectives(t,e){const o=e.getSystem("objectivemanager");if(!o)return void console.warn("[MultiRoom] ObjectiveManager not available");console.log("[MultiRoom] Setting up objectives for multi-room scene"),o.clearAllObjectives();const i=[];for(const[t,e]of this.rooms)e.objectives&&Array.isArray(e.objectives)&&(console.log(`[MultiRoom] Found ${e.objectives.length} objectives in room ${t}`),i.push(...e.objectives));i.forEach(t=>{o.defineObjective(t.id,t),console.log(`[MultiRoom] Registered objective: ${t.id} - ${t.name}`)}),i.forEach(t=>{t.autoStart&&(o.startObjective(t.id),console.log(`[MultiRoom] Auto-started objective: ${t.id}`))}),this.currentRoom&&(console.log(`[MultiRoom] Starting objectives for initial room: ${this.currentRoom}`),this.updateRoomObjectives(this.currentRoom)),console.log(`[MultiRoom] Objective setup complete - ${i.length} objectives registered`)}onUnload(t,e){console.log("[MultiRoom] Cleaning up multi-room scene..."),this.interactionHandler&&(t.off("interaction:triggered",this.interactionHandler),this.interactionHandler=null),this.npcInteractionHandler&&(t.off("npc:interact",this.npcInteractionHandler),this.npcInteractionHandler=null),this.miniMap&&(this.miniMap.destroy(),this.miniMap=null),this.doorItems&&(this.doorItems.cleanup(),this.doorItems=null);for(const[t,e]of this.roomEntities)e.forEach(t=>{t&&t.destroy&&t.destroy()});this.roomEntities.clear();for(const[t,e]of this.rooms)e.entity&&e.entity.findByTag("npc").forEach(t=>{t.cleanupLabel&&t.cleanupLabel()}),e.active=!1;this.gameState.inventory.clear(),this.gameState.lastInteractions=[],this.gameState.skills.clear(),this.currentRoom=null}}}}]);
|
99.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[99],{99:(e,t,i)=>{i.r(t),i.d(t,{default:()=>r});var o=i(96);const r={id:"ancient_temple",title:"Ancient Temple of Elements",type:"scene",async build(e,t,i){console.log("[AncientTemple] Building ancient temple of elements...");const r=new o.n(e,e.systems?.core||{});r.sceneBuilder=t,r.entityFactory=i,this.curseLevel=0,this.ritualProgress={},this.startTime=null,r.createRoom("temple_entrance",{size:[20,6,16],lighting:"ancient",position:[0,0,0],buildFunction:n,objectives:[{id:"temple_discovery",name:"Ancient Discovery",description:"Investigate the mysterious ancient temple",type:"simple",autoStart:!0,rewards:{experience:30}},{id:"decipher_symbols",name:"Symbol Translation",description:"Decipher the ancient symbol sequence",type:"sequence",target:["symbol_earth","symbol_water","symbol_fire","symbol_air"],progress:0,rewards:{experience:80,items:[{id:"symbol_knowledge",quantity:1}]}}]}),r.createRoom("elemental_chamber",{size:[25,8,20],lighting:"elemental",position:[0,0,0],buildFunction:a,objectives:[{id:"collect_artifacts",name:"Elemental Artifacts",description:"Collect the four elemental artifacts",type:"counter",target:4,progress:0,rewards:{experience:120},nextObjective:"activate_barriers"},{id:"activate_barriers",name:"Elemental Barriers",description:"Use artifacts to activate elemental barrier sequence",type:"sequence",target:["earth_barrier","water_barrier","fire_barrier","air_barrier"],progress:0,prerequisites:["collect_artifacts"],rewards:{experience:180,skillPoints:3}}]}),r.createRoom("ritual_chamber",{size:[22,10,18],lighting:"ritual",position:[0,0,0],buildFunction:s,objectives:[{id:"coordinate_ritual",name:"Synchronized Ritual",description:"Perform coordinated actions at ritual stations within time limit",type:"sequence",target:["ritual_north","ritual_east","ritual_south","ritual_west","ritual_center"],progress:0,rewards:{experience:250,skillPoints:4}}]}),r.createRoom("inner_sanctum",{size:[18,12,14],lighting:"sanctum",position:[0,0,0],buildFunction:c,objectives:[{id:"ancient_guardian",name:"Guardian Challenge",description:"Face the ancient guardian and claim the temple's power",type:"simple",rewards:{experience:400,skillPoints:6,items:[{id:"temple_heart",quantity:1}]}}]}),r.createDoor("temple_entrance","elemental_chamber",{type:"keycard",item:"symbol_knowledge"},{playerSpawnPosition:[0,0,8]}),r.createDoor("elemental_chamber","ritual_chamber",{type:"objective",id:"activate_barriers"},{playerSpawnPosition:[0,0,7]}),r.createDoor("ritual_chamber","inner_sanctum",{type:"objective",id:"coordinate_ritual"},{playerSpawnPosition:[0,0,5]});const l=await r.build(e,t,i);return l.multiRoom=r,l},onLoad(e,t){console.log("[AncientTemple] Ancient temple awakening - Mystical energies detected");const i=e.root.findByTag("scene_root")[0];i&&i.multiRoom&&(i.multiRoom.onLoad(e,t),this.multiRoom=i.multiRoom,this.interactionHandler=i=>{this.handleTempleInteraction(i,e,t)},this.multiRoom.setSceneInteractionHandler(this.interactionHandler),this.ritualProgress={coordinatedActions:[],lastActionTime:0,timeWindow:3e4},this.startTime=Date.now(),this.setupMysticalSystems(e)),e.fire("ui:notification",{text:"ANCIENT POWER: Temple awakens to your presence - Proceed with reverence",type:"info",duration:4e3})},setupMysticalSystems(e){this.mysticalInterval=setInterval(()=>{this.curseLevel=Math.min(100,this.curseLevel+2),this.curseLevel>=60&&e.fire("ui:notification",{text:`ANCIENT CURSE: ${this.curseLevel}% - The temple's power grows restless`,type:"warning",duration:2e3})},15e3)},handleTempleInteraction(e,t,i){console.log("[AncientTemple] Ancient interaction with:",e);const o=i.getSystem("objectivemanager");if("AncientInscription"===e)o&&o.isObjectiveActive("temple_discovery")&&(o.completeObjective("temple_discovery"),o.startObjective("decipher_symbols")),t.fire("ui:notification",{text:'INSCRIPTION: "Only those who understand the elemental sequence may proceed"',type:"info",duration:5e3});else if(e.startsWith("Symbol_")){if("temple_entrance"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("decipher_symbols")){const i=e.split("_")[1];["earth","water","fire","air"][o.getObjective("decipher_symbols").progress]===i?(this.removeStoneBarrier(i),t.fire("ui:notification",{text:`${i.toUpperCase()} symbol activated - Ancient barrier recedes`,type:"success",duration:3e3}),o.updateObjective("decipher_symbols",`symbol_${i}`)):(this.curseLevel+=10,t.fire("ui:notification",{text:"CURSE PENALTY: Wrong symbol sequence! Ancient wrath increases",type:"error",duration:3e3}))}}else if(e.startsWith("Artifact_")){if("elemental_chamber"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("collect_artifacts")){const i=e.split("_")[1];t.fire("ui:notification",{text:`${i} artifact claimed - Elemental power flows through you`,type:"success",duration:2500}),o.updateObjective("collect_artifacts"),o.getObjective("collect_artifacts").progress>=4&&o.startObjective("activate_barriers")}}else if(e.startsWith("BarrierAltar_")){if("elemental_chamber"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("activate_barriers")){const i=e.split("_")[1];this.toggleElementalBarrier(i,!1),t.fire("ui:notification",{text:`${i.toUpperCase()} barrier dispelled - Path cleared`,type:"success",duration:2500}),o.updateObjective("activate_barriers",`${i}_barrier`)}}else if(e.startsWith("RitualStation_")){if("ritual_chamber"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("coordinate_ritual")){const i=e.split("_")[1],r=Date.now();r-this.ritualProgress.lastActionTime>this.ritualProgress.timeWindow&&(this.ritualProgress.coordinatedActions=[]),this.ritualProgress.coordinatedActions.push(i),this.ritualProgress.lastActionTime=r;const n=["north","east","south","west","center"],a=this.ritualProgress.coordinatedActions.length-1;n[a]===i?(t.fire("ui:notification",{text:`Ritual ${i.toUpperCase()} activated - ${5-a-1} steps remain`,type:"success",duration:2e3}),o.updateObjective("coordinate_ritual",`ritual_${i}`)):(this.ritualProgress.coordinatedActions=[],this.curseLevel+=15,t.fire("ui:notification",{text:"RITUAL FAILED: Wrong sequence! Ancient spirits are displeased",type:"error",duration:3e3}))}}else"AncientGuardian"===e&&"inner_sanctum"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("ancient_guardian")&&(this.multiRoom.addItem("temple_heart"),o.completeObjective("ancient_guardian"),t.fire("ui:notification",{text:"TEMPLE MASTERED: You have proven worthy - The ancient power is yours",type:"success",duration:6e3}))},removeStoneBarrier(e){const t=this.app.root.findByName(`StoneBarrier_${e}`);t&&(t.tween(t.getPosition()).to({x:t.getPosition().x,y:-2,z:t.getPosition().z},3,pc.SineOut).start(),setTimeout(()=>{t.rigidbody&&(t.rigidbody.enabled=!1)},3e3))},toggleElementalBarrier(e,t=!0){const i={earth:[-8,1.5,0],water:[8,1.5,0],fire:[0,1.5,-8],air:[0,1.5,8]}[e],o=this.app.root.findByName(`ElementalBarrier_${e}`);if(t&&!o){const t=this.multiRoom.entityFactory.create(`ElementalBarrier_${e}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.3,4,6]},rigidbody:{type:"static"}},position:i,scale:[.6,8,12],tags:["elemental_barrier","impassable"]});if(t.model){const i={earth:new pc.Color(.6,.4,.2),water:new pc.Color(.2,.4,.8),fire:new pc.Color(.8,.3,.2),air:new pc.Color(.8,.8,.9)},o=new pc.StandardMaterial;o.diffuse=i[e],o.emissive=new pc.Color(.6*i[e].r,.6*i[e].g,.6*i[e].b),o.emissiveIntensity=1.2,o.opacity=.8,o.blendType=pc.BLEND_NORMAL,o.update(),t.model.meshInstances.forEach(e=>e.material=o)}this.multiRoom.sceneRoot.addChild(t)}else!t&&o&&o.destroy()},onUnload(e,t){console.log("[AncientTemple] Ancient powers returning to slumber..."),this.mysticalInterval&&clearInterval(this.mysticalInterval),this.multiRoom&&this.multiRoom.setSceneInteractionHandler(null),this.interactionHandler=null,this.multiRoom&&this.multiRoom.onUnload(e,t)}};async function n(e,t,i,o){console.log("[AncientTemple] Building temple entrance...");const r=i.create("AncientInscription",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[3,2,.5]},rigidbody:{type:"static"}},position:[0,2,-6],scale:[6,4,1],tags:["interactive","inscription"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.6,.5,.3),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}e.addChild(r),[{element:"earth",pos:[-6,1,-2],barrierPos:[0,1.5,-6]},{element:"water",pos:[-2,1,2],barrierPos:[-6,1.5,0]},{element:"fire",pos:[2,1,2],barrierPos:[6,1.5,0]},{element:"air",pos:[6,1,-2],barrierPos:[0,1.5,6]}].forEach(e=>{const t=i.create(`Symbol_${e.element}`,{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.8,height:1.5},rigidbody:{type:"static"}},position:e.pos,scale:[1.6,1.5,1.6],tags:["interactive","symbol"]});if(t.model){const i={earth:new pc.Color(.6,.4,.2),water:new pc.Color(.2,.4,.8),fire:new pc.Color(.8,.3,.2),air:new pc.Color(.8,.8,.9)},o=new pc.StandardMaterial;o.diffuse=i[e.element],o.emissive=new pc.Color(.4*i[e.element].r,.4*i[e.element].g,.4*i[e.element].b),o.update(),t.model.meshInstances.forEach(e=>e.material=o)}o.sceneRoot.addChild(t);const r=i.create(`StoneBarrier_${e.element}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[3,3,.8]},rigidbody:{type:"static"}},position:e.barrierPos,scale:[6,6,1.6],tags:["stone_barrier","impassable"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.5,.5,.4),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(r)});const n=i.createNPC("keeper_spirit",{position:[0,0,0],displayName:"Ancient Temple Keeper",dialogue:{greeting:"Mortal... you dare disturb our eternal rest? Prove your understanding of the elements.",topics:{elements:"Earth grounds, Water flows, Fire burns, Air lifts - this is the order of creation.",sequence:"Only those who activate the symbols in correct sequence may pass the stone barriers.",curse:"Each mistake strengthens the ancient curse - tread carefully, seeker."}}});o.sceneRoot.addChild(n),[{pos:[0,5.5,0],color:new pc.Color(1,.8,.6)},{pos:[-6,4.5,0],color:new pc.Color(1,.8,.6)},{pos:[6,4.5,0],color:new pc.Color(1,.8,.6)}].forEach((t,o)=>{const r=i.createLight("point",{color:t.color,intensity:1.8,range:9,position:t.pos});e.addChild(r)});const a=i.create("SpawnPoint",{position:[0,1,5],tags:["spawn"]});e.addChild(a)}async function a(e,t,i,o){console.log("[AncientTemple] Building elemental chamber with ELEMENTAL BARRIERS..."),[{element:"earth",pos:[-10,1,-8],altarPos:[-8,1.5,0]},{element:"water",pos:[10,1,-8],altarPos:[8,1.5,0]},{element:"fire",pos:[-10,1,8],altarPos:[0,1.5,-8]},{element:"air",pos:[10,1,8],altarPos:[0,1.5,8]}].forEach(e=>{const t=i.create(`Artifact_${e.element}`,{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.6,height:2},rigidbody:{type:"static"}},position:e.pos,scale:[1.2,2,1.2],tags:["interactive","artifact"]}),r={earth:new pc.Color(.6,.4,.2),water:new pc.Color(.2,.4,.8),fire:new pc.Color(.8,.3,.2),air:new pc.Color(.8,.8,.9)};if(t.model){const i=new pc.StandardMaterial;i.diffuse=r[e.element],i.emissive=new pc.Color(.8*r[e.element].r,.8*r[e.element].g,.8*r[e.element].b),i.emissiveIntensity=1,i.update(),t.model.meshInstances.forEach(e=>e.material=i)}o.sceneRoot.addChild(t);const n=i.create(`BarrierAltar_${e.element}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.5,1,1]},rigidbody:{type:"static"}},position:e.altarPos,scale:[3,2,2],tags:["interactive","altar"]});if(n.model){const t=new pc.StandardMaterial;t.diffuse=r[e.element],t.emissive=new pc.Color(.5*r[e.element].r,.5*r[e.element].g,.5*r[e.element].b),t.update(),n.model.meshInstances.forEach(e=>e.material=t)}o.sceneRoot.addChild(n);const a=i.create(`ElementalBarrier_${e.element}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.3,4,6]},rigidbody:{type:"static"}},position:e.altarPos,scale:[.6,8,12],tags:["elemental_barrier","impassable"]});if(a.model){const t=new pc.StandardMaterial;t.diffuse=r[e.element],t.emissive=new pc.Color(.6*r[e.element].r,.6*r[e.element].g,.6*r[e.element].b),t.emissiveIntensity=1.2,t.opacity=.8,t.blendType=pc.BLEND_NORMAL,t.update(),a.model.meshInstances.forEach(e=>e.material=t)}o.sceneRoot.addChild(a)}),[{pos:[0,7.5,0],color:new pc.Color(.9,.8,1)},{pos:[-10,6,0],color:new pc.Color(1,.6,.4)},{pos:[10,6,0],color:new pc.Color(.4,.6,1)}].forEach((t,o)=>{const r=i.createLight("point",{color:t.color,intensity:2.2,range:12,position:t.pos});e.addChild(r)})}async function s(e,t,i,o){console.log("[AncientTemple] Building ritual chamber with TIMED COORDINATION..."),[{direction:"north",pos:[0,1,-7]},{direction:"east",pos:[7,1,0]},{direction:"south",pos:[0,1,7]},{direction:"west",pos:[-7,1,0]},{direction:"center",pos:[0,1,0]}].forEach(e=>{const t=i.create(`RitualStation_${e.direction}`,{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:1.2,height:2.5},rigidbody:{type:"static"}},position:e.pos,scale:[2.4,2.5,2.4],tags:["interactive","ritual"]});if(t.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.3,.6),e.emissive=new pc.Color(.2,.15,.4),e.emissiveIntensity=.8,e.update(),t.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(t)});const r=i.create("RitualCircle",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:9,height:.1}},position:[0,.05,0],scale:[18,.1,18],tags:["ritual_circle"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.2,.4),e.emissive=new pc.Color(.2,.1,.3),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}e.addChild(r),[{pos:[0,9.5,0],color:new pc.Color(.8,.6,1)},{pos:[-7,7,0],color:new pc.Color(.8,.6,1)},{pos:[7,7,0],color:new pc.Color(.8,.6,1)},{pos:[0,7,-7],color:new pc.Color(.8,.6,1)},{pos:[0,7,7],color:new pc.Color(.8,.6,1)}].forEach((t,o)=>{const r=i.createLight("point",{color:t.color,intensity:2,range:8,position:t.pos});e.addChild(r)})}async function c(e,t,i,o){console.log("[AncientTemple] Building inner sanctum...");const r=i.create("AncientGuardian",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:2,height:5},rigidbody:{type:"static"}},position:[0,2.5,0],scale:[4,5,4],tags:["interactive","guardian"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.8,.7,.3),e.emissive=new pc.Color(.6,.5,.2),e.emissiveIntensity=1.5,e.metalness=.8,e.update(),r.model.meshInstances.forEach(t=>t.material=e)}o.sceneRoot.addChild(r),[[-6,1,-4],[6,1,-4],[-6,1,4],[6,1,4]].forEach((t,o)=>{const r=i.create(`Treasure_${o}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.8,.6,.6]}},position:t,scale:[1.6,1.2,1.2],tags:["treasure"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.8,.6,.2),e.emissive=new pc.Color(.4,.3,.1),e.metalness=.9,e.update(),r.model.meshInstances.forEach(t=>t.material=e)}e.addChild(r)});const n=i.createLight("point",{color:new pc.Color(1,.9,.6),intensity:3,range:15,position:[0,11.5,0]});e.addChild(n)}}}]);
|
|
|
|
| 1 |
+
"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[99],{99:(e,t,i)=>{i.r(t),i.d(t,{default:()=>r});var o=i(96);const r={id:"ancient_temple",title:"Ancient Temple of Elements",type:"scene",async build(e,t,i){console.log("[AncientTemple] Building ancient temple of elements...");const r=new o.n(e,e.systems?.core||{});r.sceneBuilder=t,r.entityFactory=i,this.curseLevel=0,this.ritualProgress={},this.startTime=null,r.createRoom("temple_entrance",{size:[20,6,16],lighting:"ancient",position:[0,0,0],buildFunction:n,objectives:[{id:"temple_discovery",name:"Ancient Discovery",description:"Investigate the mysterious ancient temple",type:"simple",autoStart:!0,rewards:{experience:30}},{id:"decipher_symbols",name:"Symbol Translation",description:"Decipher the ancient symbol sequence",type:"sequence",target:["symbol_earth","symbol_water","symbol_fire","symbol_air"],progress:0,rewards:{experience:80,items:[{id:"symbol_knowledge",quantity:1}]}}]}),r.createRoom("elemental_chamber",{size:[25,8,20],lighting:"elemental",position:[0,0,0],buildFunction:a,objectives:[{id:"collect_artifacts",name:"Elemental Artifacts",description:"Collect the four elemental artifacts",type:"counter",target:4,progress:0,rewards:{experience:120},nextObjective:"activate_barriers"},{id:"activate_barriers",name:"Elemental Barriers",description:"Use artifacts to activate elemental barrier sequence",type:"sequence",target:["earth_barrier","water_barrier","fire_barrier","air_barrier"],progress:0,prerequisites:["collect_artifacts"],rewards:{experience:180,skillPoints:3}}]}),r.createRoom("ritual_chamber",{size:[22,10,18],lighting:"ritual",position:[0,0,0],buildFunction:s,objectives:[{id:"coordinate_ritual",name:"Synchronized Ritual",description:"Perform coordinated actions at ritual stations within time limit",type:"sequence",target:["ritual_north","ritual_east","ritual_south","ritual_west","ritual_center"],progress:0,rewards:{experience:250,skillPoints:4}}]}),r.createRoom("inner_sanctum",{size:[18,12,14],lighting:"sanctum",position:[0,0,0],buildFunction:c,objectives:[{id:"ancient_guardian",name:"Guardian Challenge",description:"Face the ancient guardian and claim the temple's power",type:"simple",rewards:{experience:400,skillPoints:6,items:[{id:"temple_heart",quantity:1}]}}]}),r.createDoor("temple_entrance","elemental_chamber",{type:"keycard",item:"symbol_knowledge"},{playerSpawnPosition:[0,0,8]}),r.createDoor("elemental_chamber","ritual_chamber",{type:"objective",id:"activate_barriers"},{playerSpawnPosition:[0,0,7]}),r.createDoor("ritual_chamber","inner_sanctum",{type:"objective",id:"coordinate_ritual"},{playerSpawnPosition:[0,0,5]});const l=await r.build(e,t,i);return l.multiRoom=r,l},onLoad(e,t){console.log("[AncientTemple] Ancient temple awakening - Mystical energies detected");const i=e.root.findByTag("scene_root")[0];i&&i.multiRoom&&(i.multiRoom.onLoad(e,t),this.multiRoom=i.multiRoom,this.interactionHandler=i=>{this.handleTempleInteraction(i,e,t)},this.multiRoom.setSceneInteractionHandler(this.interactionHandler),this.ritualProgress={coordinatedActions:[],lastActionTime:0,timeWindow:3e4},this.startTime=Date.now(),this.setupMysticalSystems(e)),e.fire("ui:notification",{text:"ANCIENT POWER: Temple awakens to your presence - Proceed with reverence",type:"info",duration:4e3})},setupMysticalSystems(e){this.mysticalInterval=setInterval(()=>{this.curseLevel=Math.min(100,this.curseLevel+2),this.curseLevel>=60&&e.fire("ui:notification",{text:`ANCIENT CURSE: ${this.curseLevel}% - The temple's power grows restless`,type:"warning",duration:2e3})},15e3)},handleTempleInteraction(e,t,i){console.log("[AncientTemple] Ancient interaction with:",e);const o=i.getSystem("objectivemanager");if("AncientInscription"===e)o&&o.isObjectiveActive("temple_discovery")&&(o.completeObjective("temple_discovery"),o.startObjective("decipher_symbols")),t.fire("ui:notification",{text:'INSCRIPTION: "Only those who understand the elemental sequence may proceed"',type:"info",duration:5e3});else if(e.startsWith("Symbol_")){if("temple_entrance"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("decipher_symbols")){const i=e.split("_")[1];["earth","water","fire","air"][o.getObjective("decipher_symbols").progress]===i?(this.removeStoneBarrier(i),t.fire("ui:notification",{text:`${i.toUpperCase()} symbol activated - Ancient barrier recedes`,type:"success",duration:3e3}),o.updateObjective("decipher_symbols",`symbol_${i}`)):(this.curseLevel+=10,t.fire("ui:notification",{text:"CURSE PENALTY: Wrong symbol sequence! Ancient wrath increases",type:"error",duration:3e3}))}}else if(e.startsWith("Artifact_")){if("elemental_chamber"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("collect_artifacts")){const i=e.split("_")[1];t.fire("ui:notification",{text:`${i} artifact claimed - Elemental power flows through you`,type:"success",duration:2500}),o.updateObjective("collect_artifacts"),o.getObjective("collect_artifacts").progress>=4&&o.startObjective("activate_barriers")}}else if(e.startsWith("BarrierAltar_")){if("elemental_chamber"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("activate_barriers")){const i=e.split("_")[1];this.toggleElementalBarrier(i,!1),t.fire("ui:notification",{text:`${i.toUpperCase()} barrier dispelled - Path cleared`,type:"success",duration:2500}),o.updateObjective("activate_barriers",`${i}_barrier`)}}else if(e.startsWith("RitualStation_")){if("ritual_chamber"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("coordinate_ritual")){const i=e.split("_")[1],r=Date.now();r-this.ritualProgress.lastActionTime>this.ritualProgress.timeWindow&&(this.ritualProgress.coordinatedActions=[]),this.ritualProgress.coordinatedActions.push(i),this.ritualProgress.lastActionTime=r;const n=["north","east","south","west","center"],a=this.ritualProgress.coordinatedActions.length-1;n[a]===i?(t.fire("ui:notification",{text:`Ritual ${i.toUpperCase()} activated - ${5-a-1} steps remain`,type:"success",duration:2e3}),o.updateObjective("coordinate_ritual",`ritual_${i}`)):(this.ritualProgress.coordinatedActions=[],this.curseLevel+=15,t.fire("ui:notification",{text:"RITUAL FAILED: Wrong sequence! Ancient spirits are displeased",type:"error",duration:3e3}))}}else"AncientGuardian"===e&&"inner_sanctum"===this.multiRoom.currentRoom&&o&&o.isObjectiveActive("ancient_guardian")&&(this.multiRoom.addItem("temple_heart"),o.completeObjective("ancient_guardian"),t.fire("ui:notification",{text:"TEMPLE MASTERED: You have proven worthy - The ancient power is yours",type:"success",duration:6e3}))},removeStoneBarrier(e){const t=this.app.root.findByName(`StoneBarrier_${e}`);t&&(t.tween(t.getPosition()).to({x:t.getPosition().x,y:-2,z:t.getPosition().z},3,pc.SineOut).start(),setTimeout(()=>{t.rigidbody&&(t.rigidbody.enabled=!1)},3e3))},toggleElementalBarrier(e,t=!0){const i={earth:[-8,1.5,0],water:[8,1.5,0],fire:[0,1.5,-8],air:[0,1.5,8]}[e],o=this.app.root.findByName(`ElementalBarrier_${e}`);if(t&&!o){const t=this.multiRoom.entityFactory.create(`ElementalBarrier_${e}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.3,4,6]},rigidbody:{type:"static"}},position:i,scale:[.6,8,12],tags:["elemental_barrier","impassable"]});if(t.model){const i={earth:new pc.Color(.6,.4,.2),water:new pc.Color(.2,.4,.8),fire:new pc.Color(.8,.3,.2),air:new pc.Color(.8,.8,.9)},o=new pc.StandardMaterial;o.diffuse=i[e],o.emissive=new pc.Color(.6*i[e].r,.6*i[e].g,.6*i[e].b),o.emissiveIntensity=1.2,o.opacity=.8,o.blendType=pc.BLEND_NORMAL,o.update(),t.model.meshInstances.forEach(e=>e.material=o)}multiRoom.addEntityToRoom(t,this.multiRoom.currentRoom)}else!t&&o&&o.destroy()},onUnload(e,t){console.log("[AncientTemple] Ancient powers returning to slumber..."),this.mysticalInterval&&clearInterval(this.mysticalInterval),this.multiRoom&&this.multiRoom.setSceneInteractionHandler(null),this.interactionHandler=null,this.multiRoom&&this.multiRoom.onUnload(e,t)}};async function n(e,t,i,o){console.log("[AncientTemple] Building temple entrance...");const r=i.create("AncientInscription",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[3,2,.5]},rigidbody:{type:"static"}},position:[0,2,-6],scale:[6,4,1],tags:["interactive","inscription"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.6,.5,.3),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}e.addChild(r),[{element:"earth",pos:[-6,1,-2],barrierPos:[0,1.5,-6]},{element:"water",pos:[-2,1,2],barrierPos:[-6,1.5,0]},{element:"fire",pos:[2,1,2],barrierPos:[6,1.5,0]},{element:"air",pos:[6,1,-2],barrierPos:[0,1.5,6]}].forEach(e=>{const t=i.create(`Symbol_${e.element}`,{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.8,height:1.5},rigidbody:{type:"static"}},position:e.pos,scale:[1.6,1.5,1.6],tags:["interactive","symbol"]});if(t.model){const i={earth:new pc.Color(.6,.4,.2),water:new pc.Color(.2,.4,.8),fire:new pc.Color(.8,.3,.2),air:new pc.Color(.8,.8,.9)},o=new pc.StandardMaterial;o.diffuse=i[e.element],o.emissive=new pc.Color(.4*i[e.element].r,.4*i[e.element].g,.4*i[e.element].b),o.update(),t.model.meshInstances.forEach(e=>e.material=o)}o.addEntityToRoom(t,"temple_entrance");const r=i.create(`StoneBarrier_${e.element}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[3,3,.8]},rigidbody:{type:"static"}},position:e.barrierPos,scale:[6,6,1.6],tags:["stone_barrier","impassable"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.5,.5,.4),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}o.addEntityToRoom(r,"temple_entrance")});const n=i.createNPC("keeper_spirit",{position:[0,0,0],displayName:"Ancient Temple Keeper",dialogue:{greeting:"Mortal... you dare disturb our eternal rest? Prove your understanding of the elements.",topics:{elements:"Earth grounds, Water flows, Fire burns, Air lifts - this is the order of creation.",sequence:"Only those who activate the symbols in correct sequence may pass the stone barriers.",curse:"Each mistake strengthens the ancient curse - tread carefully, seeker."}}});o.addEntityToRoom(n,"temple_entrance"),[{pos:[0,5.5,0],color:new pc.Color(1,.8,.6)},{pos:[-6,4.5,0],color:new pc.Color(1,.8,.6)},{pos:[6,4.5,0],color:new pc.Color(1,.8,.6)}].forEach((t,o)=>{const r=i.createLight("point",{color:t.color,intensity:1.8,range:9,position:t.pos});e.addChild(r)});const a=i.create("SpawnPoint",{position:[0,1,5],tags:["spawn"]});e.addChild(a)}async function a(e,t,i,o){console.log("[AncientTemple] Building elemental chamber with ELEMENTAL BARRIERS..."),[{element:"earth",pos:[-10,1,-8],altarPos:[-8,1.5,0]},{element:"water",pos:[10,1,-8],altarPos:[8,1.5,0]},{element:"fire",pos:[-10,1,8],altarPos:[0,1.5,-8]},{element:"air",pos:[10,1,8],altarPos:[0,1.5,8]}].forEach(e=>{const t=i.create(`Artifact_${e.element}`,{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.6,height:2},rigidbody:{type:"static"}},position:e.pos,scale:[1.2,2,1.2],tags:["interactive","artifact"]}),r={earth:new pc.Color(.6,.4,.2),water:new pc.Color(.2,.4,.8),fire:new pc.Color(.8,.3,.2),air:new pc.Color(.8,.8,.9)};if(t.model){const i=new pc.StandardMaterial;i.diffuse=r[e.element],i.emissive=new pc.Color(.8*r[e.element].r,.8*r[e.element].g,.8*r[e.element].b),i.emissiveIntensity=1,i.update(),t.model.meshInstances.forEach(e=>e.material=i)}o.addEntityToRoom(t,"elemental_chamber");const n=i.create(`BarrierAltar_${e.element}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.5,1,1]},rigidbody:{type:"static"}},position:e.altarPos,scale:[3,2,2],tags:["interactive","altar"]});if(n.model){const t=new pc.StandardMaterial;t.diffuse=r[e.element],t.emissive=new pc.Color(.5*r[e.element].r,.5*r[e.element].g,.5*r[e.element].b),t.update(),n.model.meshInstances.forEach(e=>e.material=t)}o.addEntityToRoom(n,"elemental_chamber");const a=i.create(`ElementalBarrier_${e.element}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.3,4,6]},rigidbody:{type:"static"}},position:e.altarPos,scale:[.6,8,12],tags:["elemental_barrier","impassable"]});if(a.model){const t=new pc.StandardMaterial;t.diffuse=r[e.element],t.emissive=new pc.Color(.6*r[e.element].r,.6*r[e.element].g,.6*r[e.element].b),t.emissiveIntensity=1.2,t.opacity=.8,t.blendType=pc.BLEND_NORMAL,t.update(),a.model.meshInstances.forEach(e=>e.material=t)}o.addEntityToRoom(a,"elemental_chamber")}),[{pos:[0,7.5,0],color:new pc.Color(.9,.8,1)},{pos:[-10,6,0],color:new pc.Color(1,.6,.4)},{pos:[10,6,0],color:new pc.Color(.4,.6,1)}].forEach((t,o)=>{const r=i.createLight("point",{color:t.color,intensity:2.2,range:12,position:t.pos});e.addChild(r)})}async function s(e,t,i,o){console.log("[AncientTemple] Building ritual chamber with TIMED COORDINATION..."),[{direction:"north",pos:[0,1,-7]},{direction:"east",pos:[7,1,0]},{direction:"south",pos:[0,1,7]},{direction:"west",pos:[-7,1,0]},{direction:"center",pos:[0,1,0]}].forEach(e=>{const t=i.create(`RitualStation_${e.direction}`,{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:1.2,height:2.5},rigidbody:{type:"static"}},position:e.pos,scale:[2.4,2.5,2.4],tags:["interactive","ritual"]});if(t.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.3,.6),e.emissive=new pc.Color(.2,.15,.4),e.emissiveIntensity=.8,e.update(),t.model.meshInstances.forEach(t=>t.material=e)}o.addEntityToRoom(t,"ritual_chamber")});const r=i.create("RitualCircle",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:9,height:.1}},position:[0,.05,0],scale:[18,.1,18],tags:["ritual_circle"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.2,.4),e.emissive=new pc.Color(.2,.1,.3),e.update(),r.model.meshInstances.forEach(t=>t.material=e)}e.addChild(r),[{pos:[0,9.5,0],color:new pc.Color(.8,.6,1)},{pos:[-7,7,0],color:new pc.Color(.8,.6,1)},{pos:[7,7,0],color:new pc.Color(.8,.6,1)},{pos:[0,7,-7],color:new pc.Color(.8,.6,1)},{pos:[0,7,7],color:new pc.Color(.8,.6,1)}].forEach((t,o)=>{const r=i.createLight("point",{color:t.color,intensity:2,range:8,position:t.pos});e.addChild(r)})}async function c(e,t,i,o){console.log("[AncientTemple] Building inner sanctum...");const r=i.create("AncientGuardian",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:2,height:5},rigidbody:{type:"static"}},position:[0,2.5,0],scale:[4,5,4],tags:["interactive","guardian"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.8,.7,.3),e.emissive=new pc.Color(.6,.5,.2),e.emissiveIntensity=1.5,e.metalness=.8,e.update(),r.model.meshInstances.forEach(t=>t.material=e)}o.addEntityToRoom(r,"inner_sanctum"),[[-6,1,-4],[6,1,-4],[-6,1,4],[6,1,4]].forEach((t,o)=>{const r=i.create(`Treasure_${o}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.8,.6,.6]}},position:t,scale:[1.6,1.2,1.2],tags:["treasure"]});if(r.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.8,.6,.2),e.emissive=new pc.Color(.4,.3,.1),e.metalness=.9,e.update(),r.model.meshInstances.forEach(t=>t.material=e)}e.addChild(r)});const n=i.createLight("point",{color:new pc.Color(1,.9,.6),intensity:3,range:15,position:[0,11.5,0]});e.addChild(n)}}}]);
|
assets/data/catalog.json
CHANGED
|
@@ -428,6 +428,64 @@
|
|
| 428 |
"Ritual coordination requires precise timing - actions must be synchronized"
|
| 429 |
]
|
| 430 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 431 |
}
|
| 432 |
]
|
| 433 |
}
|
|
|
|
| 428 |
"Ritual coordination requires precise timing - actions must be synchronized"
|
| 429 |
]
|
| 430 |
}
|
| 431 |
+
},
|
| 432 |
+
{
|
| 433 |
+
"id": 15,
|
| 434 |
+
"title": "15 - Puzzle Test: Shared Space Puzzles",
|
| 435 |
+
"description": "Interactive puzzle testing environment with box packing mechanics",
|
| 436 |
+
"type": "scene",
|
| 437 |
+
"preview": "puzzle_test_preview.jpg",
|
| 438 |
+
"script": "PuzzleTestScene",
|
| 439 |
+
"briefing": {
|
| 440 |
+
"setting": "Testing environment for shared space puzzle mechanics",
|
| 441 |
+
"role": "Puzzle solver experimenting with spatial reasoning",
|
| 442 |
+
"objectives": [
|
| 443 |
+
"Drag and drop objects into the container",
|
| 444 |
+
"Pack all items efficiently within space constraints",
|
| 445 |
+
"Achieve at least 70% space utilization for completion"
|
| 446 |
+
],
|
| 447 |
+
"controls": [
|
| 448 |
+
"Mouse - Click and drag objects to move them",
|
| 449 |
+
"F - Use reset button to restart puzzle",
|
| 450 |
+
"Watch for visual feedback on valid/invalid placements"
|
| 451 |
+
],
|
| 452 |
+
"tips": [
|
| 453 |
+
"Green glow indicates valid placement positions",
|
| 454 |
+
"Red glow shows invalid placement areas",
|
| 455 |
+
"Objects follow gravity simulation - place support items first",
|
| 456 |
+
"Progress display updates as you place items"
|
| 457 |
+
]
|
| 458 |
+
}
|
| 459 |
+
},
|
| 460 |
+
{
|
| 461 |
+
"id": 16,
|
| 462 |
+
"title": "16 - Kitbash Gallery: Procedural 3D Objects",
|
| 463 |
+
"description": "Showcase gallery of complex procedural 3D objects built from simple operations",
|
| 464 |
+
"type": "scene",
|
| 465 |
+
"preview": "kitbash_gallery_preview.jpg",
|
| 466 |
+
"script": "KitbashGallery",
|
| 467 |
+
"briefing": {
|
| 468 |
+
"setting": "Modern gallery space showcasing procedural 3D modeling techniques and complex animated objects",
|
| 469 |
+
"role": "Gallery visitor exploring procedural object construction",
|
| 470 |
+
"objectives": [
|
| 471 |
+
"Explore the gallery and inspect all 9 procedural object displays",
|
| 472 |
+
"Learn about different procedural operations: Group, Mirror, Radial, Corners",
|
| 473 |
+
"Observe spinning animations and material systems in action",
|
| 474 |
+
"Understand kitbash methodology: collect β reuse β combine β tweak β repeat"
|
| 475 |
+
],
|
| 476 |
+
"controls": [
|
| 477 |
+
"F - Inspect procedural objects for detailed construction information",
|
| 478 |
+
"WASD - Navigate around the gallery space",
|
| 479 |
+
"Mouse - Look around and examine objects from different angles"
|
| 480 |
+
],
|
| 481 |
+
"tips": [
|
| 482 |
+
"Each object demonstrates different procedural modeling techniques",
|
| 483 |
+
"Windmill and Ferris Wheel showcase complex radial arrangements",
|
| 484 |
+
"Hydraulic Lift demonstrates mirror operations for symmetry",
|
| 485 |
+
"Server Rack and Assembly Line show industrial procedural design",
|
| 486 |
+
"Objects with spinning parts demonstrate animation integration"
|
| 487 |
+
]
|
| 488 |
+
}
|
| 489 |
}
|
| 490 |
]
|
| 491 |
}
|
bundle.js
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|