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

238 lines
9.3 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 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_23 extends DHBase {
chatConfig = [
{ effectUrl: 'DH/DH_23/sound/拍卖开始,价高者得!', delayTime: 2.35, str: '拍卖开始,价高者得!', posi: 'qipao2' },
{ effectUrl: 'DH/DH_23/sound/恭喜傅少,10亿零1元获得拍品!', delayTime: 3.5, str: '恭喜傅少,10亿零1元获得拍品!', posi: 'qipao2' },
{ effectUrl: 'DH/DH_23/sound/什么?你们在作弊!', delayTime: 2.7, str: '什么?你们在作弊!', posi: '-1' },
{ effectUrl: 'DH/DH_23/sound/哼!玩不起就别玩,滚蛋!', delayTime: 3.9, str: '哼!玩不起就别玩,滚蛋!', posi: 'qipao1' },
{ effectUrl: 'DH/DH_23/sound/龙少,恭喜你了!', delayTime: 2.1, str: '龙少,恭喜你了!', posi: 'qipao4' },
{ effectUrl: 'DH/DH_23/sound/哼!他凭什么和我争!', delayTime: 2.5, str: '哼!他凭什么和我争!', posi: 'qipao3' },
]
@property(sp.Skeleton)
fushao: sp.Skeleton = null;
@property(sp.Skeleton)
paimaishi: sp.Skeleton = null;
@property(sp.Skeleton)
guanzhong: sp.Skeleton = null;
@property(sp.Skeleton)
chujiaobiao: sp.Skeleton = null;
@property(cc.Node)
xinfen: cc.Node = null;
@property(cc.Node)
dengzi: cc.Node = null;
start() {
this.scheduleOnce(() => {
PrefabManage.preloadPrefabByType(GameType.DH_25)
})
GameBaseScript.preLoadRemoteAudioByChatConfig(this.chatConfig);
super.start();
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
// if (mainId == MainTaskIdEnum.MainTask_606) {
// 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.fushao.node.active = false
this.chujiaobiao.node.active = false
this.guanzhong.setAnimation(0, "观众待机", true)
this.paimaishi.setAnimation(0, "待机", true)
this.xinfen.active = false
this.dengzi.active = false
const dialogEvents = [
(func) => {
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
});
},
(func) => {
this.xinfen.active = true
func()
},
]
const dialogCallFunc = (logEvents: any[]) => {
logEvents.shift()(() => {
if (logEvents.length > 0) {
dialogCallFunc(logEvents);
} else {
// TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_1203)
// TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_1204)
// PrefabManage.loadPrefabByType(GameType.CityPrefab)
// this.node.destroy()
}
});
}
dialogCallFunc(dialogEvents);
}
// 继续剧情
continueStory1() {
// this.fushao.node.active = false
// this.chujiaobiao.node.active = false
// this.guanzhong.setAnimation(0, "观众待机", true)
// this.paimaishi.setAnimation(0, "待机", true)
// this.xinfen.active = false
// this.dengzi.active = false
const dialogEvents = [
(func) => {
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
this.paimaishi.setAnimation(0, "敲槌", false)
this.paimaishi.setCompleteListener(() => {
this.paimaishi.setCompleteListener(null)
this.paimaishi.setAnimation(0, "待机", true)
})
});
},
(func) => {
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
});
},
(func) => {
this.guanzhong.setAnimation(0, "观众待机无反派", true)
this.fushao.node.active = true
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
this.fushao.setAnimation(0, "站立说话", true)
});
},
(func) => {
this.fushao.setAnimation(0, "站立待机", true)
cc.tween(this.node.getChildByName("black"))
.sequence(
cc.tween().to(2, { opacity: 255 }),
cc.tween().call(() => {
this.dengzi.active = true
this.guanzhong.node.active = false
}),
cc.tween().to(2, { opacity: 0 }),
cc.tween().call(() => {
func()
})
)
.start()
},
(func) => {
this.fushao.setAnimation(0, "鞠躬", false)
this.fushao.setCompleteListener(() => {
this.fushao.setCompleteListener(null)
func()
})
},
(func) => {
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
this.fushao.setAnimation(0, "鞠躬说话", true)
});
},
(func) => {
this.fushao.setAnimation(0, "鞠躬待机", true)
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
});
},
]
const dialogCallFunc = (logEvents: any[]) => {
logEvents.shift()(() => {
if (logEvents.length > 0) {
dialogCallFunc(logEvents);
} else {
PrefabManage.showBlackGuoDu(() => {
PrefabManage.loadPrefabByType(GameType.CityPrefab)
this.node.destroy()
}, () => {
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_1603)
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_1604)
})
}
});
}
dialogCallFunc(dialogEvents);
}
onTouch() {
this.xinfen.active = false
this.chujiaobiao.node.active = true
this.chujiaobiao.setAnimation(0, "写", false)
this.chujiaobiao.setCompleteListener(() => {
this.chujiaobiao.setCompleteListener(null)
this.chujiaobiao.node.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);
}
}