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 GameBaseScript from "../GameRoomRes/GameBaseScript"; import TaskManager, { MainTaskIdEnum } from "../JuQingChat/TaskManager"; import UserManager from "../Manager/UserManager"; import NewGuideScript from "../NewGuide/NewGuideScript"; import PrefabManage, { GameType } from "../PrefabManager/PrefabManage"; import GetAward from "../SCommon/GetAward"; import DHBase from "./DHBase"; import selectButtons from "./selectButtons"; const { ccclass, property, disallowMultiple, menu } = cc._decorator; @ccclass @disallowMultiple() @menu('对话剧情/DH_5') export default class DH_5 extends DHBase { chatConfig = [ { effectUrl: 'DH/DH_5/sound/怎么样?是还钱还是交房啊?', delayTime: 3.91, str: '怎么样?是还钱还是交房啊?', posi: 'qipao2' }, { effectUrl: 'DH/DH_5/sound/债务两清了', delayTime: 3.91, str: '债务两清了', posi: '-1' }, ] @property(sp.Skeleton) nanzhu: sp.Skeleton = null @property(cc.Node) m_bg: cc.Node = null @property(cc.Node) MoveNodes: cc.Node = null // @property(cc.Node) // buttons: cc.Node = null taskGoodStep: any = 0; isPengYao: boolean; start() { Common5.preLoadRemoteAudioByChatConfig(this.chatConfig); super.start(); this.continueStory() } // 继续剧情 continueStory() { // this.scheduleOnce(() => { // PrefabManage.preloadPrefabByType(GameType.DH_2) // }) // this.nanzhu.setAnimation(0, "下面持续", true) // this.heishehui.setAnimation(0, "小弟待机", true) const dialogEvents = [ (func) => { this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => { this.nanzhu.setAnimation(0, "提箱黑社会说话", true) }); }, (func) => { this.nanzhu.setAnimation(0, "提箱待机", true) this.m_bg.getChildByName("needGoodNode_503").active = true }, ] const dialogCallFunc = (logEvents: any[]) => { logEvents.shift()(() => { if (logEvents.length > 0) { dialogCallFunc(logEvents); } else { // PrefabManage.loadPrefabByType(GameType.GetAward, null, (prefabNode) => { // let goods = [{ goodId: 1733, goodNum: 1 }]; // prefabNode.getComponent(GetAward).initView(goods, () => { // // TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_530) // // User.setRoomGoodStatus("DH_29") // // UserManager.clearAndaddStructureFlash("cf_FengRenYuan") // }); // }); // TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_202) // TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_203) // this.node.destroy() } }); } dialogCallFunc(dialogEvents); } onTouch() { this.m_bg.getChildByName("needGoodNode_503").active = false this.nanzhu.setAnimation(0, "放箱待机", true) this.showClickDialog(this.chatConfig[this.dialogIndex++], () => { this.nanzhu.setAnimation(0, "放箱待机", true) User.setStatistics("zhangJie", 5) TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_503) TaskManager.setCurTask(MainTaskIdEnum.MainTask_601) UserManager.subMoney(5000000) PrefabManage.showBlackGuoDu(() => { PrefabManage.loadPrefabByType(GameType.MainHall) this.node.removeFromParent() this.node.destroy() }) }, () => { this.nanzhu.setAnimation(0, "放箱男主说话", true) }); } guideView(nodeArray, opacity = -1) { PrefabManage.loadPrefabByType(GameType.GuideMskNode, this.node, (prefab) => { // prefab.zIndex = 199 let guideNodeArray = nodeArray let firstNode = guideNodeArray.shift() prefab.getComponent(NewGuideScript).setBindNode(firstNode, guideNodeArray) if (opacity != -1) { prefab.getComponent(NewGuideScript).setOpacityMaskNode(opacity) } }) } runBg(time, scale, endnode, callFunc) { cc.tween(this.m_bg) .to(time, { scale: scale }) .start() cc.tween(this.m_bg) .sequence( cc.tween().to(time, { position: cc.v2(-endnode.position.x * scale, -endnode.position.y * scale) }), cc.tween().call(() => { callFunc() }) ) .start() } }