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.
218 lines
9.0 KiB
218 lines
9.0 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 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_28 extends DHBase {
|
||
|
chatConfig = [
|
||
|
{ effectUrl: 'DH/DH_28/sound/弟弟,你可终于来了!', delayTime: 2.56, str: '弟弟,你可终于来了!', posi: 'qipao1' },
|
||
|
{ effectUrl: 'DH/DH_28/sound/要怎样你才会放了她!', delayTime: 2.38, str: '要怎样你才会放了她!', posi: '-1' },
|
||
|
{ effectUrl: 'DH/DH_28/sound/机关盒,还有所有的兽印!', delayTime: 3.4, str: '机关盒,还有所有的兽印!', posi: 'qipao1' },
|
||
|
{ effectUrl: 'DH/DH_28/sound/你..你..,好,等我给你去拿!', delayTime: 3.95, str: '你..你..,好,等我给你去拿!', posi: '-1' },
|
||
|
|
||
|
{ effectUrl: 'DH/DH_28/sound/怎么这么慢,东西拿来没!', delayTime: 2.35, str: '怎么这么慢,东西拿来没!', posi: 'qipao1' },
|
||
|
{ effectUrl: 'DH/DH_28/sound/给你,把若若交给我。', delayTime: 1.72, str: '给你,把若若交给我。', posi: '-1' },
|
||
|
{ effectUrl: 'DH/DH_28/sound/记住,龙家的事别碰!', delayTime: 2.66, str: '记住,龙家的事别碰!', posi: 'qipao2' },
|
||
|
{ effectUrl: 'DH/DH_28/sound/那咱们就试试!', delayTime: 1.91, str: '那咱们就试试!', posi: '-1' },
|
||
|
|
||
|
]
|
||
|
|
||
|
@property(sp.Skeleton)
|
||
|
longshao: sp.Skeleton = null;
|
||
|
@property(sp.Skeleton)
|
||
|
anruoruo: sp.Skeleton = null;
|
||
|
@property(sp.Skeleton)
|
||
|
longshao_big: sp.Skeleton = null;
|
||
|
@property(sp.Skeleton)
|
||
|
hand: sp.Skeleton = null;
|
||
|
|
||
|
@property(cc.Node)
|
||
|
longshaoYinYing: cc.Node = null;
|
||
|
@property(cc.Node)
|
||
|
anruoruoYinYing: cc.Node = null;
|
||
|
|
||
|
start() {
|
||
|
this.scheduleOnce(() => {
|
||
|
PrefabManage.preloadPrefabByType(GameType.DH_29)
|
||
|
})
|
||
|
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.scheduleOnce(() => {
|
||
|
// PrefabManage.preloadPrefabByType(GameType.DH_59)
|
||
|
// })
|
||
|
|
||
|
// EventMgr.onEvent_custom(ryw_Event.RefreshJuQingDuiHua, () => {
|
||
|
// this.continueStory1();
|
||
|
// }, this);
|
||
|
}
|
||
|
|
||
|
// 继续剧情
|
||
|
continueStory() {
|
||
|
this.longshao.setAnimation(0, "待机", true)
|
||
|
const dialogEvents = [
|
||
|
(func) => {
|
||
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
this.longshao.setAnimation(0, "龙少说话", true)
|
||
|
});
|
||
|
},
|
||
|
(func) => {
|
||
|
this.longshao.setAnimation(0, "待机", true)
|
||
|
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
});
|
||
|
},
|
||
|
(func) => {
|
||
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
this.longshao.setAnimation(0, "龙少说话", true)
|
||
|
});
|
||
|
},
|
||
|
(func) => {
|
||
|
this.longshao.setAnimation(0, "待机", true)
|
||
|
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
});
|
||
|
},
|
||
|
]
|
||
|
const dialogCallFunc = (logEvents: any[]) => {
|
||
|
logEvents.shift()(() => {
|
||
|
if (logEvents.length > 0) {
|
||
|
dialogCallFunc(logEvents);
|
||
|
} else {
|
||
|
|
||
|
PrefabManage.showBlackGuoDu(() => {
|
||
|
PrefabManage.loadPrefabByType(GameType.CityPrefab)
|
||
|
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_2302)
|
||
|
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_2303)
|
||
|
this.node.destroy()
|
||
|
}, () => {
|
||
|
})
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
dialogCallFunc(dialogEvents);
|
||
|
}
|
||
|
|
||
|
// 继续剧情
|
||
|
continueStory1() {
|
||
|
this.longshao.setAnimation(0, "待机", true)
|
||
|
const dialogEvents = [
|
||
|
(func) => {
|
||
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
this.longshao.setAnimation(0, "龙少说话", true)
|
||
|
});
|
||
|
},
|
||
|
(func) => {
|
||
|
this.longshao.setAnimation(0, "待机", true)
|
||
|
this.hand.node.active = true
|
||
|
this.hand.setAnimation(0, "伸出", false)
|
||
|
this.hand.setCompleteListener(() => {
|
||
|
this.hand.setCompleteListener(null)
|
||
|
this.hand.setAnimation(0, "待机", true)
|
||
|
})
|
||
|
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
});
|
||
|
},
|
||
|
(func) => {
|
||
|
this.longshao.setAnimation(0, "甩开", false)
|
||
|
this.longshao.setCompleteListener(() => {
|
||
|
this.anruoruo.node.active = true
|
||
|
this.anruoruo.setAnimation(0, "安倒地待机", true)
|
||
|
this.longshao.node.active = false
|
||
|
this.longshaoYinYing.active = false
|
||
|
this.anruoruoYinYing.active = false
|
||
|
this.longshao_big.node.active = true
|
||
|
this.longshao_big.setAnimation(0, "待机", true)
|
||
|
this.hand.node.active = false
|
||
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
this.longshao_big.setAnimation(0, "说话", true)
|
||
|
});
|
||
|
})
|
||
|
|
||
|
},
|
||
|
(func) => {
|
||
|
this.longshao_big.setAnimation(0, "待机", true)
|
||
|
this.showClickDialog(this.chatConfig[this.dialogIndex++], func, () => {
|
||
|
});
|
||
|
},
|
||
|
]
|
||
|
const dialogCallFunc = (logEvents: any[]) => {
|
||
|
logEvents.shift()(() => {
|
||
|
if (logEvents.length > 0) {
|
||
|
dialogCallFunc(logEvents);
|
||
|
} else {
|
||
|
|
||
|
PrefabManage.showBlackGuoDu(() => {
|
||
|
PrefabManage.loadPrefabByType(GameType.CityPrefab)
|
||
|
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_2305)
|
||
|
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_2401)
|
||
|
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);
|
||
|
}
|
||
|
}
|