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

233 lines
9.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 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_30 extends DHBase {
chatConfig = [
{ effectUrl: 'DH/DH_30/sound/你个老不死的,机关盒就是个骗局,根本打不开!', delayTime: 5.1, str: '你个老不死的,机关盒就是个骗局,根本打不开!', posi: 'qipao1' },
{ effectUrl: 'DH/DH_30/sound/混账,还真以为我要死了吗?辰儿,把机关盒打开!', delayTime: 6.3, str: '混账,还真以为我要死了吗?辰儿,把机关盒打开!', posi: 'qipao2' },
{ effectUrl: 'DH/DH_30/sound/好的,爷爷!', delayTime: 1.1, str: '好的,爷爷!', posi: '-1' },
{ effectUrl: 'DH/DH_30/sound/很好,有了这令牌,我龙家又可以重返那个地方了!', delayTime: 7.2, str: '很好,有了这令牌,我龙家又可以重返那个地方了!', posi: 'qipao2' },
{ effectUrl: 'DH/DH_30/sound/你们给我等着,我一定会亲手毁了龙家!', delayTime: 3.5, str: '你们给我等着,我一定会亲手毁了龙家!', posi: 'qipao1' },
{ effectUrl: 'DH/DH_30/sound/爷爷,你说的那个地方是指哪里?', delayTime: 2.7, str: '爷爷,你说的那个地方是指哪里?', posi: '-1' },
{ effectUrl: 'DH/DH_30/sound/你先收好令牌,等我确认好自会告诉你!', delayTime: 5, str: '你先收好令牌,等我确认好自会告诉你!', posi: 'qipao3' },
]
@property(sp.Skeleton)
longzhentian: sp.Skeleton = null;
@property(sp.Skeleton)
longshao: sp.Skeleton = null;
@property(sp.Skeleton)
hezi: sp.Skeleton = null;
@property(cc.Node)
btn_open: cc.Node = null;
start() {
this.scheduleOnce(() => {
PrefabManage.preloadPrefabByType(GameType.DH_31)
})
Common5.playRemoteAudioMusic('CommonSound/背景音111')
GameBaseScript.preLoadRemoteAudioByChatConfig(this.chatConfig);
super.start();
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_2503)
// TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_2601)
PrefabManage.showBlackGuoDu(() => {
PrefabManage.loadPrefabByType(GameType.CityPrefab)
this.node.destroy()
})
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.scheduleOnce(() => {
// PrefabManage.preloadPrefabByType(GameType.DH_59)
// })
// EventMgr.onEvent_custom(ryw_Event.RefreshJuQingDuiHua, () => {
// this.continueStory1();
// }, this);
}
// 继续剧情
continueStory() {
this.longzhentian.setAnimation(0, "待机", true)
this.hezi.node.active = false
const dialogEvents = [
(func) => {
this.longzhentian.setAnimation(0, "龙少丢盒", false)
this.longzhentian.setCompleteListener(() => {
this.longzhentian.setCompleteListener(null)
func()
})
},
(func) => {
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
this.longzhentian.setAnimation(0, "龙少丢盒说话", true)
});
},
(func) => {
this.longzhentian.setAnimation(0, "龙震天打龙少", false)
this.longzhentian.setCompleteListener(() => {
this.longzhentian.setCompleteListener(null)
func()
})
},
(func) => {
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
this.longzhentian.setAnimation(0, "龙震天打龙少说话", true)
});
},
(func) => {
this.longzhentian.setAnimation(0, "龙震天打龙少待机", true)
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
});
},
]
const dialogCallFunc = (logEvents: any[]) => {
logEvents.shift()(() => {
if (logEvents.length > 0) {
dialogCallFunc(logEvents);
} else {
this.hezi.node.active = true
this.hezi.setAnimation(0, "待机1", true)
// TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_2302)
// TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_2303)
// PrefabManage.loadPrefabByType(GameType.CityPrefab)
// this.node.destroy()
}
});
}
dialogCallFunc(dialogEvents);
}
// 继续剧情
continueStory1() {
const dialogEvents = [
(func) => {
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
this.longzhentian.setAnimation(0, "龙少丢盒说话", true)
});
},
(func) => {
this.longzhentian.setAnimation(0, "待机龙震天", true)
this.longshao.node.active = true
cc.tween(this.longshao.node)
.by(1, { position: cc.v3(500, 0, 0) })
.start()
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
});
},
(func) => {
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
// this.longzhentian.setAnimation(0, "龙震天打龙少说话", true)
});
},
(func) => {
// this.longzhentian.setAnimation(0, "龙震天打龙少待机", true)
func()
},
]
const dialogCallFunc = (logEvents: any[]) => {
logEvents.shift()(() => {
if (logEvents.length > 0) {
dialogCallFunc(logEvents);
} else {
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_2503)
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_2601)
PrefabManage.showBlackGuoDu(() => {
PrefabManage.loadPrefabByType(GameType.CityPrefab)
this.node.destroy()
})
}
});
}
dialogCallFunc(dialogEvents);
}
onTouchOpen() {
this.btn_open.active = false
this.hezi.setAnimation(0, "出现令牌", false)
this.hezi.setCompleteListener(() => {
this.hezi.setCompleteListener(null)
this.hezi.setAnimation(0, "待机2", true)
cc.tween(this.hezi.node)
.sequence(
cc.tween().delay(1),
cc.tween().to(1, { opacity: 0 }),
cc.tween().call(() => {
this.showQiPao(this.chatConfig[this.dialogIndex++], () => {
this.continueStory1()
}, () => {
this.longzhentian.setAnimation(0, "龙震天打龙少说话", true)
});
})
)
.start()
})
}
// 震屏效果
// 参数: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);
}
}