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.
150 lines
6.5 KiB
150 lines
6.5 KiB
1 week ago
|
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 InterfaceManager from "../Manager/InterfaceManager";
|
||
|
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_17 extends DHBase {
|
||
|
chatConfig = [
|
||
|
{ effectUrl: 'DH/DH_17/sound/呦,为了一个贱人,你还真舍得。', delayTime: 4.9, str: '呦,为了一个贱人,你还真舍得。', posi: 'qipao2' },
|
||
|
{ effectUrl: 'DH/DH_17/sound/少废话,合同拿来。', delayTime: 2.2, str: '少废话,合同拿来。', posi: '-1' },
|
||
|
{ effectUrl: 'DH/DH_17/sound/对了,看看你前女友从钱胖子那给我偷的好东西。', delayTime: 6.9, str: '对了,看看你前女友从钱胖子那给我偷的好东西。', posi: 'qipao2' },
|
||
|
// { effectUrl: 'DH/DH_17/sound/少了这个,你的机关盒就是个废品,哈哈!', delayTime: 3, str: '少了这个,你的机关盒就是个废品,哈哈!', posi: 'qipao2' },
|
||
|
{ effectUrl: 'DH/DH_17/sound/你,你怎么知道兽印的?你想干什么!', delayTime: 3.9, str: '你,你怎么知道兽印的?你想干什么!', posi: '-1' },
|
||
|
{ effectUrl: 'DH/DH_17/sound/就你这样,还和龙少争?太嫩了!', delayTime: 4.6, str: '就你这样,还和龙少争?太嫩了!', posi: 'qipao2' },
|
||
|
]
|
||
|
|
||
|
@property(cc.Node)
|
||
|
fushao: cc.Node = null;
|
||
|
|
||
|
start() {
|
||
|
this.scheduleOnce(() => {
|
||
|
PrefabManage.preloadPrefabByType(GameType.DH_18)
|
||
|
})
|
||
|
Common5.playRemoteAudioMusic('CommonSound/背景音111')
|
||
|
GameBaseScript.preLoadRemoteAudioByChatConfig(this.chatConfig);
|
||
|
super.start();
|
||
|
|
||
|
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
|
||
|
let mainId = mainTaskInfo.Id
|
||
|
this.continueStory();
|
||
|
// this.scheduleOnce(() => {
|
||
|
// PrefabManage.preloadPrefabByType(GameType.DH_59)
|
||
|
// })
|
||
|
|
||
|
// EventMgr.onEvent_custom(ryw_Event.RefreshJuQingDuiHua, () => {
|
||
|
// this.RefreshJuQingDuiHua();
|
||
|
// }, this);
|
||
|
}
|
||
|
|
||
|
// 继续剧情
|
||
|
continueStory() {
|
||
|
let fushaoSpine = this.fushao.getComponent(sp.Skeleton)
|
||
|
fushaoSpine.setAnimation(0, "拿合同待机", true)
|
||
|
const dialogEvents = [
|
||
|
(func) => {
|
||
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
fushaoSpine.setAnimation(0, "拿合同说话", true) //待机是说话的动作...
|
||
|
});
|
||
|
},
|
||
|
(func) => {
|
||
|
fushaoSpine.setAnimation(0, "拿合同待机", true)
|
||
|
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
});
|
||
|
},
|
||
|
(func) => {
|
||
|
Common5.playRemoteAudioEffect("action_effect/撕合同");
|
||
|
fushaoSpine.setAnimation(0, "撕合同", false)
|
||
|
fushaoSpine.setCompleteListener(() => {
|
||
|
fushaoSpine.setCompleteListener(null)
|
||
|
fushaoSpine.setAnimation(0, "撕合同待机", true)
|
||
|
this.scheduleOnce(() => {
|
||
|
func()
|
||
|
}, 1)
|
||
|
})
|
||
|
},
|
||
|
(func) => {
|
||
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
fushaoSpine.setAnimation(0, "拿羊印说话", true)
|
||
|
});
|
||
|
},
|
||
|
// (func) => {
|
||
|
// this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
// });
|
||
|
// },
|
||
|
(func) => {
|
||
|
fushaoSpine.setAnimation(0, "拿羊印待机", true)
|
||
|
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
});
|
||
|
},
|
||
|
(func) => {
|
||
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
fushaoSpine.setAnimation(0, "拿羊印说话", true)
|
||
|
});
|
||
|
},
|
||
|
]
|
||
|
const dialogCallFunc = (logEvents: any[]) => {
|
||
|
logEvents.shift()(() => {
|
||
|
if (logEvents.length > 0) {
|
||
|
dialogCallFunc(logEvents);
|
||
|
} else {
|
||
|
UserManager.subMoney(100000000)
|
||
|
PrefabManage.showBlackGuoDu(() => {
|
||
|
PrefabManage.loadPrefabByType(GameType.CityPrefab)
|
||
|
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_1007)
|
||
|
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_1008)
|
||
|
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);
|
||
|
}
|
||
|
}
|