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.
205 lines
8.9 KiB
205 lines
8.9 KiB
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 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_20 extends DHBase {
|
|
chatConfig = [
|
|
{ effectUrl: 'DH/DH_20/sound/裤衩子都被坑没了,以后可怎么活啊。', delayTime: 4.6, str: '裤衩子都被坑没了,以后可怎么活啊。', posi: 'qipao1' },
|
|
{ effectUrl: 'DH/DH_20/sound/你别丢人了,快回家吧。', delayTime: 3, str: '你别丢人了,快回家吧。', posi: 'qipao2' },
|
|
{ effectUrl: 'DH/DH_20/sound/你还想干啥,快说吧!', delayTime: 3, str: '你还想干啥,快说吧!', posi: '-1' },
|
|
{ effectUrl: 'DH/DH_20/sound/我还有几座用来养老的矿山,帮老哥开采一下吧。', delayTime: 5.15, str: '我还有几座用来养老的矿山,帮老哥开采一下吧。', posi: 'qipao1' },
|
|
{ effectUrl: 'DH/DH_20/sound/我凭什么帮你?', delayTime: 1.4, str: '我凭什么帮你?', posi: '-1' },
|
|
{ effectUrl: 'DH/DH_20/sound/我这有个关于白诗诗的大秘密,你肯定敢兴趣。', delayTime: 3, str: '我这有个关于白诗诗的大秘密,你肯定敢兴趣。', posi: 'qipao1' },
|
|
{ effectUrl: 'DH/DH_20/sound/好,希望你别耍赖!', delayTime: 2.5, str: '好,希望你别耍赖!', posi: '-1' },
|
|
|
|
{ effectUrl: 'DH/DH_20/sound/叶贤侄大气,够意思!', delayTime: 2.64, str: '叶贤侄大气,够意思!', posi: 'qipao3' },
|
|
{ effectUrl: 'DH/DH_20/sound/行啦,要不是看在继才的面上,我才懒得搭理你。', delayTime: 4.4, str: '行啦,要不是看在继才的面上,我才懒得搭理你。', posi: '-1' },
|
|
{ effectUrl: 'DH/DH_20/sound/我偷偷告诉你,白诗诗曾是傅少的禁脔,你要小心她!', delayTime: 7, str: '我偷偷告诉你,白诗诗曾是傅少的禁脔,你要小心她!', posi: 'qipao3' },
|
|
]
|
|
|
|
@property(sp.Skeleton)
|
|
qianzong: sp.Skeleton = null;
|
|
@property(sp.Skeleton)
|
|
qianjicai: sp.Skeleton = null;
|
|
@property(sp.Skeleton)
|
|
touziren: sp.Skeleton = null;
|
|
|
|
@property(sp.Skeleton)
|
|
qianzong_big: sp.Skeleton = null;
|
|
|
|
start() {
|
|
this.scheduleOnce(() => {
|
|
PrefabManage.preloadPrefabByType(GameType.DH_21)
|
|
})
|
|
GameBaseScript.preLoadRemoteAudioByChatConfig(this.chatConfig);
|
|
super.start();
|
|
|
|
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
|
|
let mainId = mainTaskInfo.Id
|
|
if (mainId == MainTaskIdEnum.MainTask_1304) {
|
|
this.dialogIndex = 7;
|
|
this.continueStory1();
|
|
this.qianzong.node.active = false
|
|
this.qianjicai.node.active = false
|
|
this.touziren.node.active = false
|
|
this.qianzong_big.node.active = true
|
|
} else {
|
|
this.qianzong.node.active = true
|
|
this.qianjicai.node.active = true
|
|
this.touziren.node.active = true
|
|
this.qianzong_big.node.active = false
|
|
this.continueStory();
|
|
}
|
|
// this.scheduleOnce(() => {
|
|
// PrefabManage.preloadPrefabByType(GameType.DH_59)
|
|
// })
|
|
|
|
// EventMgr.onEvent_custom(ryw_Event.RefreshJuQingDuiHua, () => {
|
|
// this.continueStory1();
|
|
// }, this);
|
|
}
|
|
|
|
// 继续剧情
|
|
continueStory() {
|
|
this.qianzong.setAnimation(0, "大哭", true)
|
|
this.qianjicai.setAnimation(0, "待机", true)
|
|
const dialogEvents = [
|
|
(func) => {
|
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
|
// this.qianzong.setAnimation(0, "大哭", true)
|
|
});
|
|
},
|
|
(func) => {
|
|
this.qianzong.setAnimation(0, "看投资人", true)
|
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
|
this.qianjicai.setAnimation(0, "说话", true)
|
|
});
|
|
},
|
|
(func) => {
|
|
this.qianjicai.setAnimation(0, "待机", true)
|
|
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
|
|
});
|
|
},
|
|
(func) => {
|
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
|
// this.qianzong.setAnimation(0, "大哭", true)
|
|
});
|
|
},
|
|
(func) => {
|
|
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
|
|
});
|
|
},
|
|
(func) => {
|
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
|
// this.qianzong.setAnimation(0, "大哭", true)
|
|
});
|
|
},
|
|
(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_1302)
|
|
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_1303)
|
|
// PrefabManage.showBlackGuoDu(() => {
|
|
// PrefabManage.loadPrefabByType(GameType.CityPrefab)
|
|
// this.node.destroy()
|
|
// })
|
|
}
|
|
});
|
|
}
|
|
dialogCallFunc(dialogEvents);
|
|
}
|
|
|
|
// 继续剧情
|
|
continueStory1() {
|
|
this.qianzong_big.setAnimation(0, "待机笑", true)
|
|
const dialogEvents = [
|
|
(func) => {
|
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
|
this.qianzong_big.setAnimation(0, "说话", true)
|
|
});
|
|
},
|
|
(func) => {
|
|
this.qianzong_big.setAnimation(0, "待机笑", true)
|
|
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
|
|
});
|
|
},
|
|
(func) => {
|
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
|
this.qianzong_big.setAnimation(0, "说秘密", true)
|
|
});
|
|
},,
|
|
(func) => {
|
|
this.qianzong_big.setAnimation(0, "待机笑", true)
|
|
func()
|
|
},
|
|
]
|
|
const dialogCallFunc = (logEvents: any[]) => {
|
|
logEvents.shift()(() => {
|
|
if (logEvents.length > 0) {
|
|
dialogCallFunc(logEvents);
|
|
} else {
|
|
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_1304)
|
|
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_1305)
|
|
// PrefabManage.showBlackGuoDu(() => {
|
|
// PrefabManage.loadPrefabByType(GameType.CityPrefab)
|
|
// 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);
|
|
}
|
|
}
|
|
|