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.
122 lines
5.5 KiB
122 lines
5.5 KiB
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_4 extends DHBase {
|
|
chatConfig = [
|
|
{ effectUrl: 'DH/DH_4/sound/老二住手,说了别冲动!', delayTime: 2.32, str: '老二住手,说了别冲动!', posi: '-1' },
|
|
{ effectUrl: 'DH/DH_4/sound/你个贱人,离我爸远点!', delayTime: 2.27, str: '你个贱人,离我爸远点!', posi: 'qipao1' },
|
|
{ effectUrl: 'DH/DH_4/sound/我们是真爱,你管得着吗?', delayTime: 3.08, str: '我们是真爱,你管得着吗?', posi: 'qipao2' },
|
|
{ effectUrl: 'DH/DH_4/sound/那个,钱叔叔,你看这合同?', delayTime: 3.27, str: '那个,钱叔叔,你看这合同?', posi: '-1' },
|
|
{ effectUrl: 'DH/DH_4/sound/马上签!赶快带继才走。', delayTime: 2.6, str: '马上签!赶快带继才走。', posi: 'qipao3' },
|
|
]
|
|
|
|
@property(cc.Node)
|
|
yanwu: cc.Node = null;
|
|
|
|
@property(cc.Node)
|
|
liumeng: cc.Node = null;
|
|
|
|
@property(cc.Node)
|
|
qianzong: cc.Node = null;
|
|
|
|
start() {
|
|
this.scheduleOnce(() => {
|
|
PrefabManage.preloadPrefabByType(GameType.DH_5)
|
|
})
|
|
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();
|
|
Common5.playRemoteAudioEffect("action_effect/打成一团",true);
|
|
// }
|
|
// this.scheduleOnce(() => {
|
|
// PrefabManage.preloadPrefabByType(GameType.DH_49)
|
|
// })
|
|
}
|
|
|
|
// 继续剧情
|
|
continueStory() {
|
|
const dialogEvents = [
|
|
(func) => {
|
|
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
|
|
});
|
|
},
|
|
(func) => {
|
|
cc.audioEngine.stopAllEffects()
|
|
this.yanwu.active = false
|
|
this.liumeng.active = true
|
|
this.liumeng.getComponent(sp.Skeleton).setAnimation(0, "出现", false)
|
|
this.liumeng.getComponent(sp.Skeleton).setCompleteListener(() => {
|
|
this.liumeng.getComponent(sp.Skeleton).setCompleteListener(null)
|
|
this.liumeng.getComponent(sp.Skeleton).setAnimation(0, "喘气", true)
|
|
this.node.getChildByName("nameplate").active = true
|
|
func()
|
|
})
|
|
},
|
|
(func) => {
|
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
|
this.liumeng.getComponent(sp.Skeleton).setAnimation(0, "钱继财说话", true)
|
|
});
|
|
},
|
|
(func) => {
|
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
|
this.liumeng.getComponent(sp.Skeleton).setAnimation(0, "柳梦说话", true)
|
|
});
|
|
},
|
|
(func) => {
|
|
this.liumeng.getComponent(sp.Skeleton).setAnimation(0, "喘气", true)
|
|
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
|
|
});
|
|
},
|
|
(func) => {
|
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
|
this.qianzong.getComponent(sp.Skeleton).setAnimation(0, "说话", true)
|
|
});
|
|
},
|
|
]
|
|
const dialogCallFunc = (logEvents: any[]) => {
|
|
logEvents.shift()(() => {
|
|
if (logEvents.length > 0) {
|
|
dialogCallFunc(logEvents);
|
|
} else {
|
|
PrefabManage.loadPrefabByType(GameType.ZuLinHeTong, null, (prefab) => {
|
|
let money = 200000
|
|
prefab.getComponent(ZuLinHeTong).initView(0, money, () => {
|
|
UserManager.subMoney(money)
|
|
PrefabManage.showTextTips(`签租赁合同成功`)
|
|
PrefabManage.showBlackGuoDu(() => {
|
|
PrefabManage.loadPrefabByType(GameType.CityPrefab)
|
|
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_308)
|
|
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_309)
|
|
this.node.destroy()
|
|
}, () => {
|
|
})
|
|
|
|
})
|
|
})
|
|
|
|
// TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_305)
|
|
// TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_306)
|
|
// PrefabManage.loadPrefabByType(GameType.CityPrefab)
|
|
// this.node.destroy()
|
|
}
|
|
});
|
|
}
|
|
dialogCallFunc(dialogEvents);
|
|
}
|
|
}
|
|
|