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

162 lines
7.0 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_11 extends DHBase {
chatConfig = [
{ effectUrl: 'DH/DH_11/sound/今天由我白诗诗主持拍卖会,请出价。', delayTime: 4.86, str: '今天由我白诗诗主持拍卖会,请出价。', posi: 'qipao2' },
{ effectUrl: 'DH/DH_11/sound/1000万', delayTime: 3, str: '100万', str1: "200万", posi: '-1' },
{ effectUrl: 'DH/DH_11/sound/白诗诗,你个贱人!老子还没出价呢!', delayTime: 3.95, str: '白诗诗,你个贱人!老子还没出价呢!', posi: 'qipao1' },
{ effectUrl: 'DH/DH_11/sound/这是龙氏产业,你敢撒野?', delayTime: 2.8, str: '这是龙氏产业,你敢撒野?', posi: 'qipao2' },
{ effectUrl: 'DH/DH_11/sound/咱们走着瞧!', delayTime: 2.12, str: '咱们走着瞧!', posi: 'qipao1' },
]
@property(cc.Node)
fanpai: cc.Node = null;
@property(cc.Node)
baishihsi: cc.Node = null;
@property(cc.Node)
guanzhong: cc.Node = null;
start() {
this.scheduleOnce(() => {
PrefabManage.preloadPrefabByType(GameType.DH_12)
})
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 baishihsiSpine = this.baishihsi.getComponent(sp.Skeleton)
baishihsiSpine.setAnimation(0, "白诗诗待机", true)
let guanzhongSpine = this.guanzhong.getComponent(sp.Skeleton)
guanzhongSpine.setAnimation(0, "观众待机", true)
let fanpaiSpine = this.fanpai.getComponent(sp.Skeleton)
this.fanpai.active = false
this.node.getChildByName("nameplate").active = true
const dialogEvents = [
(func) => {
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
baishihsiSpine.setAnimation(0, "白诗诗说话", true)
});
},
(func) => {
baishihsiSpine.setAnimation(0, "白诗诗待机", true)
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
});
},
(func) => {
baishihsiSpine.setAnimation(0, "白诗诗敲锤", false)
Common5.playRemoteAudioEffect("action_effect/拍卖敲锤子");
baishihsiSpine.setCompleteListener(() => {
baishihsiSpine.setCompleteListener(null)
baishihsiSpine.setAnimation(0, "白诗诗看反派待机", true)
func()
})
},
(func) => {
guanzhongSpine.setAnimation(0, "观众待机无反派", true)
this.fanpai.active = true
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
fanpaiSpine.setAnimation(0, "反派站说话", true)
});
},
(func) => {
fanpaiSpine.setAnimation(0, "反派站待机", true)
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
baishihsiSpine.setAnimation(0, "白诗诗看反派说话", true)
});
},
(func) => {
baishihsiSpine.setAnimation(0, "白诗诗看反派待机", true)
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
fanpaiSpine.setAnimation(0, "反派说话", true)
});
},
]
const dialogCallFunc = (logEvents: any[]) => {
logEvents.shift()(() => {
if (logEvents.length > 0) {
dialogCallFunc(logEvents);
} else {
if (this.selectIndex == 1) {
PrefabManage.showTextTips("扣除拍卖费200万")
UserManager.subMoney(2000000)
} else {
PrefabManage.showTextTips("扣除拍卖费100万")
UserManager.subMoney(1000000)
}
// PrefabManage.loadPrefabByType(GameType.CityPrefab)
PrefabManage.showBlackGuoDu(() => {
PrefabManage.loadPrefabByType(GameType.CityPrefab)
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_708)
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_709)
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);
}
}