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.
191 lines
7.6 KiB
191 lines
7.6 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_29 extends DHBase {
|
||
|
chatConfig = [
|
||
|
{ effectUrl: 'DH/DH_29/sound/老神棍,你要送我什么?', delayTime: 2.25, str: '老神棍,你要送我什么?', posi: '-1' },
|
||
|
{ effectUrl: 'DH/DH_29/sound/给,老龙90大寿邀请函。', delayTime: 3.79, str: '给,老龙90大寿邀请函。', posi: 'qipao2' },
|
||
|
{ effectUrl: 'DH/DH_29/sound/接手龙家没这么简单吧?', delayTime: 3.4, str: '接手龙家没这么简单吧?', posi: '-1' },
|
||
|
{ effectUrl: 'DH/DH_29/sound/一是掌控龙氏集团,二是打开机关盒获得祖传之物!', delayTime: 7.55, str: '一是掌控龙氏集团,二是打开机关盒获得祖传之物!', posi: 'qipao2' },
|
||
|
{ effectUrl: 'DH/DH_29/sound/那就先搞定龙氏集团吧!', delayTime: 2.35, str: '那就先搞定龙氏集团吧!', posi: '-1' },
|
||
|
{ effectUrl: 'DH/DH_29/sound/好,那就宴会见吧!', delayTime: 3.42, str: '好,那就宴会见吧!', posi: 'qipao2' },
|
||
|
]
|
||
|
|
||
|
@property(sp.Skeleton)
|
||
|
yeye: sp.Skeleton = null;
|
||
|
@property(sp.Skeleton)
|
||
|
mama: sp.Skeleton = null;
|
||
|
@property(cc.Node)
|
||
|
touchnode: cc.Node = null;
|
||
|
|
||
|
@property(cc.Node)
|
||
|
yaoqinghan: cc.Node = null;
|
||
|
|
||
|
start() {
|
||
|
this.scheduleOnce(() => {
|
||
|
PrefabManage.preloadPrefabByType(GameType.DH_30)
|
||
|
})
|
||
|
GameBaseScript.preLoadRemoteAudioByChatConfig(this.chatConfig);
|
||
|
super.start();
|
||
|
|
||
|
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
|
||
|
let mainId = mainTaskInfo.Id
|
||
|
// 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.node.getChildByName("nameplate").active = true
|
||
|
// }
|
||
|
// this.scheduleOnce(() => {
|
||
|
// PrefabManage.preloadPrefabByType(GameType.DH_59)
|
||
|
// })
|
||
|
|
||
|
// EventMgr.onEvent_custom(ryw_Event.RefreshJuQingDuiHua, () => {
|
||
|
// this.continueStory1();
|
||
|
// }, this);
|
||
|
}
|
||
|
|
||
|
// 继续剧情
|
||
|
continueStory() {
|
||
|
this.yeye.setAnimation(0, "老登待机", true)
|
||
|
this.mama.setAnimation(0, "妈", true)
|
||
|
const dialogEvents = [
|
||
|
(func) => {
|
||
|
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
});
|
||
|
},
|
||
|
(func) => {
|
||
|
this.yeye.setAnimation(0, "老登递请帖", false)
|
||
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
this.yeye.setAnimation(0, "老登递请帖说话", true)
|
||
|
});
|
||
|
},
|
||
|
(func) => {
|
||
|
this.yeye.setAnimation(0, "老登递请帖", true)
|
||
|
this.touchnode.active = true
|
||
|
func()
|
||
|
},
|
||
|
]
|
||
|
const dialogCallFunc = (logEvents: any[]) => {
|
||
|
logEvents.shift()(() => {
|
||
|
if (logEvents.length > 0) {
|
||
|
dialogCallFunc(logEvents);
|
||
|
} else {
|
||
|
// TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_2302)
|
||
|
// TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_2303)
|
||
|
// PrefabManage.loadPrefabByType(GameType.CityPrefab)
|
||
|
// this.node.destroy()
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
dialogCallFunc(dialogEvents);
|
||
|
}
|
||
|
|
||
|
// 继续剧情
|
||
|
continueStory1() {
|
||
|
this.yeye.setAnimation(0, "老登待机", true)
|
||
|
const dialogEvents = [
|
||
|
(func) => {
|
||
|
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
});
|
||
|
},
|
||
|
(func) => {
|
||
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
});
|
||
|
},
|
||
|
(func) => {
|
||
|
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
});
|
||
|
},
|
||
|
(func) => {
|
||
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
});
|
||
|
},
|
||
|
]
|
||
|
const dialogCallFunc = (logEvents: any[]) => {
|
||
|
logEvents.shift()(() => {
|
||
|
if (logEvents.length > 0) {
|
||
|
dialogCallFunc(logEvents);
|
||
|
} else {
|
||
|
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_2403)
|
||
|
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_2404)
|
||
|
InterfaceManager.setDaoyeList("快递站2", 9)
|
||
|
// PrefabManage.showBlackGuoDu(() => {
|
||
|
// PrefabManage.loadPrefabByType(GameType.CityPrefab)
|
||
|
// this.node.destroy()
|
||
|
// })
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
dialogCallFunc(dialogEvents);
|
||
|
}
|
||
|
|
||
|
onTouchsmall() {
|
||
|
this.yaoqinghan.active = true
|
||
|
this.touchnode.active = false
|
||
|
}
|
||
|
|
||
|
onTouchbig() {
|
||
|
this.yaoqinghan.active = false
|
||
|
this.continueStory1()
|
||
|
}
|
||
|
|
||
|
// 震屏效果
|
||
|
// 参数: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);
|
||
|
}
|
||
|
}
|