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

338 lines
15 KiB

import User from "../../FrameWork/User/User";
import Common5 from "../../Platform/th/Common5";
import GameBaseScript from "../GameRoomRes/GameBaseScript";
import TaskManager, { MainTaskIdEnum } from "../JuQingChat/TaskManager";
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_2 extends DHBase {
chatConfig = [
{ effectUrl: 'DH/DH_2/sound/你要摆不平这个小杂种,就去陪那个死胖子吧!', delayTime: 4.7, str: '你要摆不平这个小杂种,就去陪那个死胖子吧!', posi: 'qipao5' },
{ effectUrl: 'DH/DH_2/sound/死舔狗,你敢空着手来?翅膀硬了是吧!', delayTime: 4.23, str: '死舔狗,你敢空着手来?翅膀硬了是吧!', posi: 'qipao1' },
{ effectUrl: 'DH/DH_2/sound/你等我下,老子今天不让你颜面扫地,我跟你姓!', delayTime: 4.5, str: '你等我下,老子今天不让你颜面扫地,我跟你姓!', posi: '-1' },
{ effectUrl: 'DH/DH_2/sound/若若,给你,希望你喜欢!', delayTime: 2.8, str: '若若,给你,希望你喜欢!', posi: '-1' },
{ effectUrl: 'DH/DH_2/sound/叶辰!我给你脸了是吧!', delayTime: 3, str: '叶辰!我给你脸了是吧!', posi: 'qipao1' },
{ effectUrl: 'DH/DH_2/sound/贱人!今天我给你长长脸!', delayTime: 3, str: '贱人!今天我给你长长脸!', posi: '-1' },
{ effectUrl: 'DH/DH_2/sound/好,好,你给我等着!', delayTime: 3.63, str: '好,好,你给我等着!', posi: 'qipao2' },
{ effectUrl: 'DH/DH_2/sound/辰哥,谢谢你!', delayTime: 2.27, str: '辰哥,谢谢你!', posi: 'qipao3' },
]
@property(cc.Node)
anruoruo: cc.Node = null;
// @property(cc.Node)
// anruoruo_big: cc.Node = null;
@property(cc.Node)
nanzhu: cc.Node = null;
@property(cc.Node)
liumeng: cc.Node = null;
// @property(cc.Node)
// liumeng_bala: cc.Node = null;
@property(cc.Node)
texie: cc.Node = null;
@property(cc.Node)
luren: cc.Node = null;
@property(sp.Skeleton)
songlishou: sp.Skeleton = null;
@property(sp.Skeleton)
fushao: sp.Skeleton = null;
start() {
this.scheduleOnce(() => {
PrefabManage.preloadPrefabByType(GameType.DH_3)
})
Common5.playRemoteAudioMusic('CommonSound/人群音')
GameBaseScript.preLoadRemoteAudioByChatConfig(this.chatConfig);
super.start();
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
if (mainId == MainTaskIdEnum.MainTask_206) {
// this.liumeng_bala.active = false
// this.anruoruo_big.active = false
this.fushao.node.active = false
this.liumeng.active = true
this.anruoruo.active = true
this.anruoruo.getComponent(sp.Skeleton).setAnimation(0, "待机2", true)
this.liumeng.getComponent(sp.Skeleton).setAnimation(0, "待机", true)
this.dialogIndex = 3;
this.continueStory1();
} else {
this.node.getChildByName("nameplate").active = true
this.continueStory();
}
// this.scheduleOnce(() => {
// PrefabManage.preloadPrefabByType(GameType.DH_29)
// })
}
// 继续剧情
continueStory() {
let fushaopos = this.fushao.node.position.clone()
this.fushao.node.setPosition(cc.v2(-900, fushaopos.y))
this.fushao.setAnimation(0, "待机小", true)
let bg = this.node.getChildByName("场景")
bg.scale = 0.98
this.anruoruo.scale = 0.8
this.liumeng.scale = 0.8
// this.fushao.node.scale = 0.9
const dialogEvents = [
// (func) => {
// let bg = this.node.getChildByName("场景")
// bg.scale = 0.9
// this.scheduleOnce(() => {
// this.shakeEffect(5)
// cc.tween(bg)
// .sequence(
// cc.tween().to(5, { scale: 1 }),
// cc.tween().call(() => {
// func()
// })
// )
// .start()
// }, 0.5)
// },
(func) => {
Common5.ReportDY("inLevel", "任务001-开场三6傅少说");
cc.tween(this.fushao.node)
.sequence(
cc.tween().delay(1),
cc.tween().to(0.5, { position: fushaopos }),
cc.tween().call(() => {
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
this.fushao.setAnimation(0, "说话小", true)
});
})
)
.start()
},
(func) => {
cc.tween(this.fushao.node)
.sequence(
cc.tween().to(0.5, { position: cc.v3(-900, this.fushao.node.position.y, 0) }),
cc.tween().delay(0.5),
cc.tween().call(() => {
func()
})
)
.start()
},
(func) => {
cc.tween(this.anruoruo)
.sequence(
cc.tween().to(0.5, { scale: 1 }),
cc.tween().call(() => {
func()
})
)
.start()
cc.tween(this.liumeng)
.sequence(
cc.tween().to(0.5, { scale: 1 }),
cc.tween().call(() => {
// func()
})
)
.start()
cc.tween(bg)
.sequence(
cc.tween().to(0.5, { scale: 1 }),
cc.tween().call(() => {
// func()
})
)
.start()
},
// (func) => {
// this.anruoruo_big.active = false
// Common5.playRemoteAudioEffect("DH/DH_2/sound/女生叫", false);
// this.liumeng_bala.getComponent(sp.Skeleton).setAnimation(0, "柳梦扒拉", false)
// this.liumeng_bala.getComponent(sp.Skeleton).setCompleteListener(()=>{
// this.liumeng_bala.getComponent(sp.Skeleton).setCompleteListener(null)
// this.anruoruo.active = true
// this.anruoruo.getComponent(sp.Skeleton).setAnimation(0, "待机2", true)
// this.liumeng_bala.active = false
// this.liumeng.active = true
// this.liumeng.getComponent(sp.Skeleton).setAnimation(0, "待机", true)
// func()
// })
// },
(func) => {
Common5.ReportDY("inLevel", "任务001-开场三7死舔狗");
this.nanzhu.getComponent(sp.Skeleton).setAnimation(0, "待机", true)
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
this.liumeng.getComponent(sp.Skeleton).setAnimation(0, "说话", true)
});
},
(func) => {
Common5.ReportDY("inLevel", "任务001-开场三8我哪敢啊");
this.liumeng.getComponent(sp.Skeleton).setAnimation(0, "待机", true)
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
this.nanzhu.getComponent(sp.Skeleton).setAnimation(0, "说话", true)
});
},
]
const dialogCallFunc = (logEvents: any[]) => {
logEvents.shift()(() => {
if (logEvents.length > 0) {
dialogCallFunc(logEvents);
} else {
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_204)
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_205)
// PrefabManage.showBlackGuoDu(() => {
// PrefabManage.loadPrefabByType(GameType.CityPrefab)
// this.node.destroy()
// })
}
});
}
dialogCallFunc(dialogEvents);
}
// 继续剧情
continueStory1() {
const dialogEvents = [
// (func) => {
// let bg = this.node.getChildByName("场景")
// bg.scale = 0.9
// this.scheduleOnce(() => {
// this.shakeEffect(5)
// cc.tween(bg)
// .sequence(
// cc.tween().to(5, { scale: 1 }),
// cc.tween().call(() => {
// func()
// })
// )
// .start()
// }, 0.5)
// },
(func) => {
this.songlishou.node.active = true
this.songlishou.setAnimation(0, "入场", false)
this.songlishou.setCompleteListener(() => {
this.songlishou.setCompleteListener(null)
this.songlishou.setAnimation(0, "待机", true)
})
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
this.nanzhu.getComponent(sp.Skeleton).setAnimation(0, "说话", true)
});
},
(func) => {
this.songlishou.setAnimation(0, "退场", false)
this.anruoruo.getComponent(sp.Skeleton).setAnimation(0, "待机2有礼品袋", true)
this.songlishou.setCompleteListener(() => {
this.songlishou.setCompleteListener(null)
func()
})
},
(func) => {
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
this.liumeng.getComponent(sp.Skeleton).setAnimation(0, "指人说话", true)
});
},
(func) => {
this.liumeng.getComponent(sp.Skeleton).setAnimation(0, "待机", true)
this.showClickDialog(this.chatConfig[this.dialogIndex++], null, () => {
this.nanzhu.getComponent(sp.Skeleton).setAnimation(0, "说话", true)
Common5.playRemoteAudioEffect("action_effect/扇巴掌");
this.texie.active = true
this.texie.getComponent(sp.Skeleton).setAnimation(0, "animation", false)
this.texie.getComponent(sp.Skeleton).setCompleteListener(() => {
this.texie.getComponent(sp.Skeleton).setCompleteListener(null)
this.texie.active = false
this.liumeng.getComponent(sp.Skeleton).setAnimation(0, "倒下", false)
this.liumeng.getComponent(sp.Skeleton).setCompleteListener(() => {
this.liumeng.getComponent(sp.Skeleton).setCompleteListener(null)
this.liumeng.getComponent(sp.Skeleton).setAnimation(0, "倒下待机", true)
func()
})
})
});
},
(func) => {
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
this.liumeng.getComponent(sp.Skeleton).setAnimation(0, "倒下说话", true)
});
},
(func) => {
cc.tween(this.liumeng)
.sequence(
cc.tween().to(0.5, { opacity: 0 }),
cc.tween().call(() => {
this.liumeng.active = false
this.luren.active = false
this.anruoruo.setPosition(this.liumeng.position)
// this.anruoruo.getComponent(sp.Skeleton).setAnimation(0, "待机2有礼品袋", true)
func()
})
)
.start()
},
// (func) => {
// this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
// this.nanzhu.getComponent(sp.Skeleton).setAnimation(0, "说话", true)
// });
// },
(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_206)
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_301)
// PrefabManage.showBlackGuoDu(() => {
// 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, 15)),
// cc.moveTo(0.2, cc.v2(-6, 7)),
cc.moveTo(0.2, cc.v2(-10, 3)),
// cc.moveTo(0.2, cc.v2(3, -6)),
cc.moveTo(0.2, cc.v2(-5, 10)),
// 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);
}
}