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.
105 lines
4.5 KiB
105 lines
4.5 KiB
1 week ago
|
import User from "../../FrameWork/User/User";
|
||
|
import Common5 from "../../Platform/th/Common5";
|
||
|
import TouZiXieYiShu from "../GameMethodRes/TouZiXieYiShu/TouZiXieYiShu";
|
||
|
import ZuLinHeTong from "../GameMethodRes/ZuLinHeTong/ZuLinHeTong";
|
||
|
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_18 extends DHBase {
|
||
|
chatConfig = [
|
||
|
{ effectUrl: 'DH/DH_18/sound/狐狸精,把家产还给我!', delayTime: 3, str: '狐狸精,把家产还给我!', posi: 'qipao1' },
|
||
|
{ effectUrl: 'DH/DH_18/sound/叶贤侄,救救老哥吧。', delayTime: 2.8, str: '叶贤侄,救救老哥吧。', posi: 'qipao2' },
|
||
|
{ effectUrl: 'DH/DH_18/sound/柳梦,你不怕遭报应吗?', delayTime: 2.8, str: '柳梦,你不怕遭报应吗?', posi: '-1' },
|
||
|
{ effectUrl: 'DH/DH_18/sound/你先顾好自己吧,那块地不租了,给你几天时间赶紧搬走!', delayTime: 6.2, str: '你先顾好自己吧,那块地不租了,给你几天时间赶紧搬走!', posi: 'qipao3' },
|
||
|
{ effectUrl: 'DH/DH_18/sound/你够狠!这公司你保不住!', delayTime: 4, str: '你够狠!这公司你保不住!', posi: '-1' },
|
||
|
]
|
||
|
|
||
|
@property(cc.Node)
|
||
|
shiyou: cc.Node = null;
|
||
|
@property(cc.Node)
|
||
|
qianlaoban: cc.Node = null;
|
||
|
@property(cc.Node)
|
||
|
liumeng: cc.Node = null;
|
||
|
|
||
|
start() {
|
||
|
this.scheduleOnce(() => {
|
||
|
PrefabManage.preloadPrefabByType(GameType.DH_19)
|
||
|
})
|
||
|
Common5.playRemoteAudioMusic('CommonSound/被毒害')
|
||
|
GameBaseScript.preLoadRemoteAudioByChatConfig(this.chatConfig);
|
||
|
super.start();
|
||
|
// let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
|
||
|
// let mainId = mainTaskInfo.Id
|
||
|
// if (mainId == MainTaskIdEnum.MainTask_205) {
|
||
|
// this.dialogIndex = 3;
|
||
|
// this.continueStory1();
|
||
|
// } else {
|
||
|
this.continueStory();
|
||
|
// }
|
||
|
// this.scheduleOnce(() => {
|
||
|
// PrefabManage.preloadPrefabByType(GameType.DH_189)
|
||
|
// })
|
||
|
}
|
||
|
|
||
|
// 继续剧情
|
||
|
continueStory() {
|
||
|
let shiyouSpine = this.shiyou.getComponent(sp.Skeleton)
|
||
|
shiyouSpine.setAnimation(0, "钱继财", true)
|
||
|
let qianlaobanSpine = this.qianlaoban.getComponent(sp.Skeleton)
|
||
|
qianlaobanSpine.setAnimation(0, "钱有财", true)
|
||
|
let liumengSpine = this.liumeng.getComponent(sp.Skeleton)
|
||
|
liumengSpine.setAnimation(0, "柳梦", true)
|
||
|
|
||
|
const dialogEvents = [
|
||
|
(func) => {
|
||
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
shiyouSpine.setAnimation(0, "钱继财说话", true)
|
||
|
});
|
||
|
},
|
||
|
(func) => {
|
||
|
shiyouSpine.setAnimation(0, "钱继财放下手", true)
|
||
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
qianlaobanSpine.setAnimation(0, "钱有财作揖", true)
|
||
|
});
|
||
|
},
|
||
|
(func) => {
|
||
|
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
});
|
||
|
},
|
||
|
(func) => {
|
||
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
liumengSpine.setAnimation(0, "柳梦说话", true)
|
||
|
});
|
||
|
},
|
||
|
(func) => {
|
||
|
liumengSpine.setAnimation(0, "柳梦", true)
|
||
|
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
});
|
||
|
},
|
||
|
]
|
||
|
const dialogCallFunc = (logEvents: any[]) => {
|
||
|
logEvents.shift()(() => {
|
||
|
if (logEvents.length > 0) {
|
||
|
dialogCallFunc(logEvents);
|
||
|
} else {
|
||
|
|
||
|
PrefabManage.showBlackGuoDu(() => {
|
||
|
PrefabManage.loadPrefabByType(GameType.CityPrefab)
|
||
|
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_1102)
|
||
|
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_1103)
|
||
|
this.node.destroy()
|
||
|
}, () => {
|
||
|
})
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
dialogCallFunc(dialogEvents);
|
||
|
}
|
||
|
}
|