觉醒时刻
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.

158 lines
6.2 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_34 extends DHBase {
chatConfig = [
// { effectUrl: 'DH/DH_34/sound/叶辰,好久不见啊!', delayTime: 3, str: '叶辰,好久不见啊!', posi: 'qipao2' },
// { effectUrl: 'DH/DH_34/sound/你,你怎么成了五毒殿的人?', delayTime: 3, str: '你,你怎么成了五毒殿的人?', posi: '-1' },
// { effectUrl: 'DH/DH_34/sound/别废话了,等会见真章吧!', delayTime: 3, str: '别废话了,等会见真章吧!', posi: 'qipao2' },
// { effectUrl: 'DH/DH_34/sound/让你先保存几天,早晚你会乖乖的送给我!', delayTime: 3, str: '让你先保存几天,早晚你会乖乖的送给我!', posi: 'qipao2' },
]
// @property(sp.Skeleton)
// liumeng_1: sp.Skeleton = null;
// @property(sp.Skeleton)
// liumeng_2: sp.Skeleton = null;
// @property(sp.Skeleton)
// chujiaobiao: sp.Skeleton = null;
// @property(sp.Skeleton)
// paimaishi: sp.Skeleton = null;
// @property(cc.Node)
// bg: cc.Node = null;
// @property(cc.Node)
// xinfen: cc.Node = null;
// @property(cc.Node)
// dengzi: cc.Node = null;
start() {
// this.scheduleOnce(() => {
// PrefabManage.preloadPrefabByType(GameType.DH_34)
// })
// Common5.playRemoteAudioMusic('CommonSound/背景音111')
GameBaseScript.preLoadRemoteAudioByChatConfig(this.chatConfig);
super.start();
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
PrefabManage.showTextTips("剧情待更新")
// if (mainId == MainTaskIdEnum.MainTask_2305) {
// this.dialogIndex = 4;
// this.continueStory1();
// // let gushuyaSpine = this.gushuya.getComponent(sp.Skeleton)
// // gushuyaSpine.setAnimation(0, "跌倒待机", true)
// // BagManager.addBagList({ goodId: 3027, goodNum: 1 })
// // this.node.getChildByName("needGoodNode1").active = true
// // } else if (mainId == MainTaskIdEnum.MainTask_607) {
// // this.gushuya.active = false
// // this.zhituan.active = true
// // this.zhituan.position = this.zhituanpos.position
// } else {
// this.continueStory();
// }
// this.scheduleOnce(() => {
// PrefabManage.preloadPrefabByType(GameType.DH_59)
// })
// EventMgr.onEvent_custom(ryw_Event.RefreshJuQingDuiHua, () => {
// this.continueStory();
// }, this);
}
// 继续剧情
continueStory() {
this.liumeng_1.setAnimation(0, "待机", true)
const dialogEvents = [
(func) => {
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
this.liumeng_1.setAnimation(0, "说话", true)
});
},
(func) => {
this.liumeng_1.setAnimation(0, "待机", true)
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
});
},
(func) => {
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
this.liumeng_1.setAnimation(0, "说话", true)
});
},
(func) => {
this.liumeng_1.setAnimation(0, "待机", true)
func()
},
]
const dialogCallFunc = (logEvents: any[]) => {
logEvents.shift()(() => {
if (logEvents.length > 0) {
dialogCallFunc(logEvents);
} else {
this.liumeng_2.node.active = false
PrefabManage.showBlackGuoDu(() => {
this.node.getChildByName("layer2").active = true
}, () => {
this.xinfen.active = true
})
// 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);
}
}