"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[826],{826:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});const o={name:"Mobile Tavern Scene",description:"A mobile-optimized tavern with strategic camera angles for touch interaction",async build(e,t,a){console.log("[MobileTavernScene] Building mobile-optimized tavern...");const o=a.create("MobileTavernRoot",{position:[0,0,0],tags:["scene_root"]}),i=t.createRoom({size:[18,4,14],position:[0,0,0],lighting:"warm"});i.name="MobileTavernRoom",o.addChild(i);const n=a.createLight("point",{color:new pc.Color(1,.8,.4),intensity:3,range:12,position:[0,3,0]});i.addChild(n);const s=a.createLight("point",{color:new pc.Color(1,.6,.2),intensity:2.5,range:8,position:[-6,2.5,0]});i.addChild(s),this.createBarZone(i,a),this.createSeatingZone(i,a),this.createPerformanceZone(i,a),this.createQuestZone(i,a);const r=a.create("SpawnPoint",{position:[0,0,6],tags:["spawn"]});return o.addChild(r),console.log("[MobileTavernScene] Mobile tavern built successfully"),o},createBarZone(e,t){const a=t.create("BarCounter",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2.5,.5,.75]},rigidbody:{type:"static"}},position:[-5,.5,0],scale:[5,1,1.5],tags:["furniture","bar","interactive"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.5,.3,.1),e.emissive=new pc.Color(.1,.05,0),e.update(),a.model.material=e}e.addChild(a);const o=t.createNPC("bartender_grim",{position:[-4,0,0],displayName:"Grim the Bartender",dialogue:{greeting:"Welcome to the Rusty Tankard! What can I get you?",topics:{drink:"Our special today is Dragon's Breath Ale. Burns on the way down!",rumors:"Strange things happening at the old generator station...",quest:"Talk to the patron in the corner. He's been asking for help."}}});o.tags.add("bartender"),o.tags.add("mobile_optimized"),e.addChild(o),[[-6,.3,1],[-5,.3,1],[-4,.3,1]].forEach((a,o)=>{const i=t.create(`BarStool_${o}`,{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.3,height:.6},rigidbody:{type:"static"}},position:a,scale:[.6,.6,.6],tags:["furniture","stool"]});if(i.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.2,.1),e.update(),i.model.material=e}e.addChild(i)});const i=t.create("BeerTap",{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.2,height:.8},rigidbody:{type:"static"}},position:[-5.5,1.2,-.3],scale:[.4,.8,.4],tags:["interactive","beer_tap"]});if(i.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.7,.6,.3),e.emissive=new pc.Color(.1,.1,0),e.update(),i.model.material=e}e.addChild(i)},createSeatingZone(e,t){[{pos:[3,0,-3],name:"Table_Main",occupant:"patron_mysterious"},{pos:[2,0,3],name:"Table_Side",occupant:null},{pos:[-2,0,3],name:"Table_Corner",occupant:null}].forEach((a,o)=>{const i=t.create(a.name,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.8,.4,.8]},rigidbody:{type:"static"}},position:[a.pos[0],.4,a.pos[2]],scale:[1.6,.8,1.6],tags:["furniture","table","interactive"]});if(i.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.5,.3,.2),e.update(),i.model.material=e}if(e.addChild(i),[[a.pos[0]+1.2,.3,a.pos[2]],[a.pos[0]-1.2,.3,a.pos[2]],[a.pos[0],.3,a.pos[2]+1.2],[a.pos[0],.3,a.pos[2]-1.2]].forEach((a,i)=>{const n=t.create(`Chair_${o}_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.3,.4,.3]},rigidbody:{type:"static"}},position:a,scale:[.6,.8,.6],tags:["furniture","chair"]});if(n.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.25,.15),e.update(),n.model.material=e}e.addChild(n)}),a.occupant){const o=t.createNPC(a.occupant,{position:[a.pos[0],0,a.pos[2]-1.5],displayName:"Mysterious Patron",dialogue:{greeting:"You look capable... I might have a job for you.",topics:{job:"The medical bay needs supplies delivered. Dangerous work.",payment:"100 gold pieces, plus whatever you find along the way.",accept:"Excellent! Head to the medical bay when you're ready."}}});o.tags.add("quest_giver"),o.tags.add("mobile_optimized"),e.addChild(o)}})},createPerformanceZone(e,t){const a=t.create("Stage",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.5,.1,1.5]},rigidbody:{type:"static"}},position:[0,.1,-5],scale:[3,.2,3],tags:["furniture","stage"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.6,.4,.2),e.emissive=new pc.Color(.05,.03,.01),e.update(),a.model.material=e}e.addChild(a);const o=t.createNPC("bard_melody",{position:[0,.2,-5],displayName:"Melody the Bard",dialogue:{greeting:"♪ Welcome, traveler! Care to hear a song? ♪",topics:{song:"♪ The generator failed one night... ♪",tip:"A coin for your humble bard?",news:"I heard the nightshift at the station is cursed!"}}});o.tags.add("bard"),o.tags.add("mobile_optimized"),e.addChild(o);const i=t.createLight("spot",{color:new pc.Color(1,.9,.6),intensity:2,range:8,position:[0,3,-3],innerConeAngle:20,outerConeAngle:40});i.lookAt(new pc.Vec3(0,.2,-5)),e.addChild(i)},createQuestZone(e,t){const a=t.create("QuestBoard",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,1.2,.1]},rigidbody:{type:"static"}},position:[7,2.4,0],scale:[2,2.4,.2],tags:["interactive","quest_board","mobile_optimized"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.6,.4,.2),e.emissive=new pc.Color(.1,.05,0),e.update(),a.model.material=e}e.addChild(a);const o=t.createLight("spot",{color:new pc.Color(1,1,.8),intensity:1.5,range:6,position:[6,3.5,2],innerConeAngle:30,outerConeAngle:50});o.lookAt(new pc.Vec3(7,2.4,0)),e.addChild(o),[[6.5,3,.15],[7.5,3,.15],[7,2,.15]].forEach((a,o)=>{const i=t.create(`Notice_${o}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.2,.3,.02]},rigidbody:{type:"static"}},position:a,scale:[.4,.6,.04],tags:["decoration","notice"]});if(i.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.9,.9,.8),e.update(),i.model.material=e}e.addChild(i)})},objectives:[{id:"mobile_tavern_entry",name:"Welcome to the Mobile Tavern",description:"Look around using camera angles",type:"simple",autoStart:!0,rewards:{experience:15}},{id:"explore_camera_angles",name:"Explore Different Views",description:"Use swipe or arrow buttons to view all 4 camera angles",type:"counter",target:4,progress:0,rewards:{experience:30}},{id:"mobile_npc_interactions",name:"Touch to Interact",description:"Touch to talk to all NPCs in the tavern",type:"counter",target:3,progress:0,prerequisites:["explore_camera_angles"],rewards:{experience:50,gold:20}},{id:"mobile_quest_board",name:"Check the Quest Board",description:"Touch the quest board to see available missions",type:"simple",rewards:{experience:25}}],state:{anglesViewed:new Set,npcsInteracted:new Set,questBoardAccessed:!1,currentCameraAngle:0},onLoad(e,t){console.log("[MobileTavernScene] Mobile tavern loaded, setting up mobile-optimized objectives...");const a=t.getSystem("objectivemanager");a&&(a.clearAllObjectives(),this.objectives.forEach(e=>{a.defineObjective(e.id,e)}),a.startObjective("mobile_tavern_entry"),a.startObjective("explore_camera_angles")),this.setupMobileInteractions(e,t),e.fire("ui:notification",{text:"Welcome to the Mobile Tavern! Swipe or use arrows to change camera angles, tap to interact.",type:"info",duration:6e3})},setupMobileInteractions(e,t){const a=t.getSystem("objectivemanager"),o=e=>{this.state.anglesViewed.add(e.index),this.state.currentCameraAngle=e.index,a&&a.isObjectiveActive("explore_camera_angles")&&(a.updateObjective("explore_camera_angles",this.state.anglesViewed.size),this.state.anglesViewed.size>=4&&(a.completeObjective("explore_camera_angles"),a.startObjective("mobile_npc_interactions"),a.startObjective("mobile_quest_board")))};e.on("camera:angleChanged",o),this.angleChangeHandler=o;const i=t=>{console.log(`[MobileTavernScene] Mobile NPC interaction: ${t}`),this.state.npcsInteracted.has(t)||(this.state.npcsInteracted.add(t),e.fire("ui:notification",{text:`Talked to ${t.replace("_"," ")}`,type:"success",duration:2e3}),a&&a.isObjectiveActive("mobile_npc_interactions")&&(a.updateObjective("mobile_npc_interactions",this.state.npcsInteracted.size),this.state.npcsInteracted.size>=3&&a.completeObjective("mobile_npc_interactions")))};e.on("npc:interact",i),this.npcHandler=i;const n=t=>{"QuestBoard"!==t||this.state.questBoardAccessed||(this.state.questBoardAccessed=!0,e.fire("ui:notification",{text:"Mobile Quest Board:\n• Touch-Optimized Missions\n• Swipe-Friendly Objectives\n• Mobile Rewards",type:"info",duration:4e3}),a&&a.completeObjective("mobile_quest_board"))};e.on("interaction:triggered",n),this.interactHandler=n},onUnload(e,t){console.log("[MobileTavernScene] Cleaning up mobile tavern scene..."),this.angleChangeHandler&&(e.off("camera:angleChanged",this.angleChangeHandler),this.angleChangeHandler=null),this.npcHandler&&(e.off("npc:interact",this.npcHandler),this.npcHandler=null),this.interactHandler&&(e.off("interaction:triggered",this.interactHandler),this.interactHandler=null),e.root.findByTag("npc").forEach(e=>{e.cleanupLabel&&e.cleanupLabel()}),this.state&&(this.state.anglesViewed?.clear(),this.state.npcsInteracted?.clear(),this.state.questBoardAccessed=!1,this.state.currentCameraAngle=0)}}}}]);