You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
123 lines
5.3 KiB
123 lines
5.3 KiB
import User from "../../FrameWork/User/User";
|
|
import Common5 from "../../Platform/th/Common5";
|
|
import GameBaseScript from "../GameRoomRes/GameBaseScript";
|
|
import TaskManager, { MainTaskIdEnum } from "../JuQingChat/TaskManager";
|
|
import ChuShiXieHuiManager from "../Manager/ChuShiXieHuiManager";
|
|
import TanWeiManager from "../Manager/TanWeiManager";
|
|
import UserManager from "../Manager/UserManager";
|
|
import NewGuideScript from "../NewGuide/NewGuideScript";
|
|
import PrefabManage, { GameType } from "../PrefabManager/PrefabManage";
|
|
import CommonTips from "../SCommon/CommonTips";
|
|
import GetAward from "../SCommon/GetAward";
|
|
import DHBase from "./DHBase";
|
|
const { ccclass, property, disallowMultiple, menu } = cc._decorator;
|
|
|
|
@ccclass
|
|
@disallowMultiple()
|
|
@menu('对话剧情/DH_45')
|
|
export default class DH_45 extends DHBase {
|
|
chatConfig = [
|
|
{ effectUrl: 'DH/DH_45/sound/(柳家豪,竟然如此没有底线,那就别怪我不客气了。)', delayTime: 4.66, str: '(柳家豪,竟然如此没有底线,那就别怪我不客气了。)', posi: '-1' },
|
|
{ effectUrl: 'DH/DH_45/sound/(等我达到一级面点师,再来收拾你们。)', delayTime: 2.57, str: '(等我达到一级面点师,再来收拾你们。)', posi: '-1' },
|
|
]
|
|
|
|
@property(sp.Skeleton)
|
|
zhumian: sp.Skeleton = null
|
|
|
|
@property(cc.Node)
|
|
m_bg: cc.Node = null
|
|
@property(cc.Node)
|
|
MoveNodes: cc.Node = null
|
|
|
|
start() {
|
|
Common5.playRemoteAudioMusic("remotesound/effect/轻快-10秒", true)
|
|
Common5.preLoadRemoteAudioByChatConfig(this.chatConfig);
|
|
//换摆摊车
|
|
// if (!TanWeiManager.getLockById(5)) {
|
|
// this.m_bg.getChildByName("车豪华").active = true
|
|
// this.m_bg.getChildByName("车").active = false
|
|
// } else {
|
|
this.m_bg.getChildByName("车豪华").active = false
|
|
this.m_bg.getChildByName("车").active = true
|
|
// }
|
|
super.start();
|
|
this.continueStory();
|
|
// this.scheduleOnce(() => {
|
|
// PrefabManage.preloadPrefabByType(GameType.DH_459)
|
|
// })
|
|
}
|
|
|
|
// 继续剧情
|
|
continueStory() {
|
|
// this.scheduleOnce(() => {
|
|
// PrefabManage.preloadPrefabByType(GameType.DH_4)
|
|
// })
|
|
const dialogEvents = [
|
|
(func) => {
|
|
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
|
|
});
|
|
},
|
|
(func) => {
|
|
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
|
|
});
|
|
},
|
|
]
|
|
const dialogCallFunc = (logEvents: any[]) => {
|
|
logEvents.shift()(() => {
|
|
if (logEvents.length > 0) {
|
|
dialogCallFunc(logEvents);
|
|
} else {
|
|
// TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_536)
|
|
// TaskManager.setCurTask(MainTaskIdEnum.MainTask_537)
|
|
TaskManager.setCurTask(MainTaskIdEnum.MainTask_536)
|
|
PrefabManage.loadPrefabByType(GameType.commonTips, null, (node) => {
|
|
let config = ChuShiXieHuiManager.getManagerConfigById(3)
|
|
node.getComponent(CommonTips).init(`认证一级面点师需要达到的条件:人物等级${config.dengji},报名费用:${Common5.getNumberChangeHanzi(config.moneystr)}`, () => {
|
|
this.node.removeFromParent()
|
|
this.node.destroy()
|
|
PrefabManage.loadPrefabByType(GameType.MainHall)
|
|
})
|
|
})
|
|
// 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_459")
|
|
// // UserManager.clearAndaddStructureFlash("cf_FengRenYuan")
|
|
// });
|
|
// });
|
|
// TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_202)
|
|
// TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_203)
|
|
// this.node.destroy()
|
|
}
|
|
});
|
|
}
|
|
dialogCallFunc(dialogEvents);
|
|
}
|
|
|
|
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()
|
|
}
|
|
}
|
|
|