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 BagManager from "../Manager/BagManager"; import InterfaceManager from "../Manager/InterfaceManager"; 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_10 extends DHBase { chatConfig = [ { effectUrl: 'DH/DH_10/sound/穷鳖,入场验资200万,你进的来吗?', delayTime: 4.86, str: '穷鳖,入场验资200万,你进的来吗?', posi: 'qipao2' }, { effectUrl: 'DH/DH_10/sound/哼,我自有办法!', delayTime: 2.48, str: '哼,我自有办法!', posi: '-1' }, { effectUrl: 'DH/DH_10/sound/哈哈,进来又怎样,争的过我千亿资产吗?', delayTime: 6.16, str: '哈哈,进来又怎样,争的过我千亿资产吗?', posi: 'qipao2' }, { effectUrl: 'DH/DH_10/sound/咦?白诗诗?她来干什么?', delayTime: 3, str: '咦?白诗诗?她来干什么?', posi: '-1' }, ] @property(cc.Node) fanpai: cc.Node = null; @property(cc.Node) nanzhu: cc.Node = null; @property(cc.Node) baishihsi: cc.Node = null; start() { this.scheduleOnce(() => { PrefabManage.preloadPrefabByType(GameType.DH_11) }) Common5.playRemoteAudioMusic('CommonSound/背景音111') GameBaseScript.preLoadRemoteAudioByChatConfig(this.chatConfig); super.start(); this.baishihsi.active = false let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo() let mainId = mainTaskInfo.Id this.continueStory(); // this.scheduleOnce(() => { // PrefabManage.preloadPrefabByType(GameType.DH_59) // }) // EventMgr.onEvent_custom(ryw_Event.RefreshJuQingDuiHua, () => { // this.RefreshJuQingDuiHua(); // }, this); } // 继续剧情 continueStory() { let nanzhuSpine = this.nanzhu.getComponent(sp.Skeleton) nanzhuSpine.setAnimation(0, "男主待机", true) let fanpaiSpine = this.fanpai.getComponent(sp.Skeleton) fanpaiSpine.setAnimation(0, "反派待机", true) let baishishiSpine = this.baishihsi.getComponent(sp.Skeleton) const dialogEvents = [ (func) => { this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => { fanpaiSpine.setAnimation(0, "反派说话", true) }); }, (func) => { fanpaiSpine.setAnimation(0, "反派待机", true) this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => { nanzhuSpine.setAnimation(0, "男主说话", true) }); }, (func) => { nanzhuSpine.setAnimation(0, "男主待机", true) this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => { fanpaiSpine.setAnimation(0, "反派说话", true) }); }, (func) => { fanpaiSpine.setAnimation(0, "反派进门", false) fanpaiSpine.setCompleteListener(() => { fanpaiSpine.setCompleteListener(null) func() }) }, (func) => { baishishiSpine.node.active = true baishishiSpine.setAnimation(0, "白诗诗进门", false) baishishiSpine.setCompleteListener(() => { baishishiSpine.setCompleteListener(null) func() }) }, (func) => { this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => { nanzhuSpine.setAnimation(0, "男主说话", true) }); }, ] const dialogCallFunc = (logEvents: any[]) => { logEvents.shift()(() => { if (logEvents.length > 0) { dialogCallFunc(logEvents); } else { TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_706) TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_707) InterfaceManager.setDaoyeList("鱼塘", 2) // 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); } }