import { ryw_Event } from "../../FrameWork/Event/EventEnum"; import EventMgr from "../../FrameWork/Event/EventMgr"; import User from "../../FrameWork/User/User"; import Common5 from "../../Platform/th/Common5"; import TouZiXieYiShu from "../GameMethodRes/TouZiXieYiShu/TouZiXieYiShu"; import GameBaseScript from "../GameRoomRes/GameBaseScript"; import TaskManager, { MainTaskIdEnum } from "../JuQingChat/TaskManager"; import UserManager from "../Manager/UserManager"; import PrefabManage, { GameType } from "../PrefabManager/PrefabManage"; import GetAward from "../SCommon/GetAward"; import DHBase from "./DHBase"; const { ccclass, property } = cc._decorator; @ccclass export default class DH_6 extends DHBase { chatConfig = [ { effectUrl: 'DH/DH_6/sound/美女有些面熟啊,你是?', delayTime: 2.66, str: '美女有些面熟啊,你是?', posi: '-1' }, { effectUrl: 'DH/DH_6/sound/关你屁事!你要能调好我的失眠,我答应你任何事!', delayTime: 4.99, str: '关你屁事!你要能调好我的失眠,我答应你任何事!', posi: 'qipao2' }, { effectUrl: 'DH/DH_6/sound/那倒不必,等我给你特制一份膳食吧。', delayTime: 2.77, str: '那倒不必,等我给你特制一份膳食吧。', posi: '-1' }, { effectUrl: 'DH/DH_6/sound/小哥,想看看我是谁吗?', delayTime: 3, str: '小哥,想看看我是谁吗?', posi: 'qipao2' }, { effectUrl: 'DH/DH_6/sound/你喝汤不摘口罩吗?', delayTime: 2.17, str: '看', str1: "不看", endStr: "你喝汤不摘口罩吗?", posi: '-1' }, { effectUrl: 'DH/DH_6/sound/你是大明星,白诗诗?', delayTime: 3.16, str: '你是大明星,白诗诗?', posi: '-1' }, { effectUrl: 'DH/DH_6/sound/明星?傅少一句话就得被雪藏。', delayTime: 5.33, str: '明星?傅少一句话就得被雪藏。', posi: 'qipao2' }, // { effectUrl: 'DH/DH_6/sound/说话算话,想让我做什么?', delayTime: 3, str: '说话算话,想让我做什么?', posi: 'qipao2' }, // { effectUrl: 'DH/DH_6/sound/嗯..,先欠着吧,以后再说!', delayTime: 3, str: '嗯..,先欠着吧,以后再说!', posi: '-1' }, ] @property(cc.Node) bg: cc.Node = null; @property(cc.Node) baishishi: cc.Node = null; @property(cc.Node) yaoshan: cc.Node = null; start() { this.scheduleOnce(() => { PrefabManage.preloadPrefabByType(GameType.DH_7) }) GameBaseScript.preLoadRemoteAudioByChatConfig(this.chatConfig); super.start(); let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo() let mainId = mainTaskInfo.Id if (mainId == MainTaskIdEnum.MainTask_510) { this.dialogIndex = 3; this.continueStory1(); } else { this.continueStory(); } // this.scheduleOnce(() => { // PrefabManage.preloadPrefabByType(GameType.DH_59) // }) } // 继续剧情 continueStory() { let baishishiSpine = this.baishishi.getComponent(sp.Skeleton) baishishiSpine.setAnimation(0, "待机", true) this.yaoshan.active = false const dialogEvents = [ // (func) => { // this.bg.scale = 0.9 // this.scheduleOnce(() => { // this.shakeEffect(5) // cc.tween(this.bg) // .sequence( // cc.tween().to(5, { scale: 1 }), // cc.tween().call(() => { // func() // }) // ) // .start() // }, 0.5) // }, (func) => { this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => { }); }, (func) => { this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => { // baishishiSpine.setAnimation(0, "无奈说话", true) }); }, (func) => { baishishiSpine.setAnimation(0, "待机", true) this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => { }); }, ] const dialogCallFunc = (logEvents: any[]) => { logEvents.shift()(() => { if (logEvents.length > 0) { dialogCallFunc(logEvents); } else { TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_508) TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_509) // PrefabManage.loadPrefabByType(GameType.CityPrefab) // PrefabManage.showBlackGuoDu(() => { // this.node.destroy() // }) } }); } dialogCallFunc(dialogEvents); } // 继续剧情 continueStory1() { let baishishiSpine = this.baishishi.getComponent(sp.Skeleton) baishishiSpine.setAnimation(0, "待机", true) this.yaoshan.active = true this.yaoshan.scale = 2 const dialogEvents = [ (func) => { cc.tween(this.yaoshan) .sequence( cc.tween().to(0.5, { scale: 1 }), cc.tween().call(() => { func() }) ) .start() }, (func) => { this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => { // baishishiSpine.setAnimation(0, "无奈说话", true) }); }, (func) => { this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => { }); }, (func) => { baishishiSpine.setAnimation(0, "摘口罩", false) baishishiSpine.setCompleteListener(() => { baishishiSpine.setCompleteListener(null) baishishiSpine.setAnimation(0, "无口罩待机", true) this.node.getChildByName("nameplate").active = true func() }) }, (func) => { this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => { }); }, (func) => { this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => { baishishiSpine.setAnimation(0, "无奈说话", true) }); }, // (func) => { // this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => { // // baishishiSpine.setAnimation(0, "无奈说话", true) // }); // }, // (func) => { // baishishiSpine.setAnimation(0, "无口罩待机", true) // this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => { // }); // }, (func) => { baishishiSpine.setAnimation(0, "无口罩待机", true) func() }, ] const dialogCallFunc = (logEvents: any[]) => { logEvents.shift()(() => { if (logEvents.length > 0) { dialogCallFunc(logEvents); } else { TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_510) TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_601) EventMgr.emitEvent_custom(ryw_Event.EnterNextGame, true) // PrefabManage.loadPrefabByType(GameType.CityPrefab) // PrefabManage.showBlackGuoDu(() => { // this.node.destroy() // }) } }); } dialogCallFunc(dialogEvents); } // 震屏效果 // 参数:duration 震屏时间 shakeEffect(duration) { this.node.runAction( cc.repeatForever( cc.sequence( // cc.moveTo(0.02, cc.v2(5, 7)), // cc.moveTo(0.02, cc.v2(-6, 7)), // cc.moveTo(0.02, cc.v2(-13, 3)), // cc.moveTo(0.02, cc.v2(3, -6)), // cc.moveTo(0.02, cc.v2(-5, 5)), // cc.moveTo(0.02, cc.v2(2, -8)), // cc.moveTo(0.02, cc.v2(-8, -10)), // cc.moveTo(0.02, cc.v2(3, 10)), // cc.moveTo(0.02, cc.v2(0, 0)) cc.moveTo(0.2, cc.v2(5, 7)), // cc.moveTo(0.2, cc.v2(-6, 7)), cc.moveTo(0.2, cc.v2(-13, 3)), // cc.moveTo(0.2, cc.v2(3, -6)), cc.moveTo(0.2, cc.v2(-5, 5)), // cc.moveTo(0.2, cc.v2(2, -8)), cc.moveTo(0.2, cc.v2(-8, -10)), // cc.moveTo(0.2, cc.v2(3, 10)), cc.moveTo(0.2, cc.v2(0, 0)) ) ) ); setTimeout(() => { this.node.stopAllActions(); this.node.setPosition(0, 0); }, duration * 1000); } }