mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交开宝箱
This commit is contained in:
@@ -27,6 +27,8 @@ import GPetAttribute from "../base/values/attribute/role/GPetAttribute";
|
||||
import GDefaultMode from "./default/GDefaultMode";
|
||||
import GOnHookData from "../../data/GOnHookData";
|
||||
import { GModeEvent, GModeHitInfo } from "./GMode";
|
||||
import GAttributeData from "../base/values/GAttributeData";
|
||||
import GBattleData, { GBattleDataEnum } from "../../data/GBattleData";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
//挂机模式状态
|
||||
@@ -103,12 +105,14 @@ export default class GOnHookMode extends GDefaultMode<{},{}>{
|
||||
//添加监听事件
|
||||
addEvent(){
|
||||
app.event.on(PlayerTacticalEvent.UPDATE_TACTICAL,this.onUpdatePlayerPet,this);
|
||||
app.event.on(GBattleDataEnum.UPDARE_ATTRIBUTE_SUCCESS,this.onUpdateAttribute,this);
|
||||
// app.event.on(GOnHookManagerEvent.UPDATE_MAP,this.onUpdateWorld,this);
|
||||
}
|
||||
//移除监听事件
|
||||
onDestroy(){
|
||||
super.onDestroy();
|
||||
app.event.off(PlayerTacticalEvent.UPDATE_TACTICAL,this.onUpdatePlayerPet,this);
|
||||
app.event.off(GBattleDataEnum.UPDARE_ATTRIBUTE_SUCCESS,this.onUpdateAttribute,this);
|
||||
// app.event.off(GOnHookManagerEvent.UPDATE_MAP,this.onUpdateWorld,this);
|
||||
}
|
||||
|
||||
@@ -188,6 +192,15 @@ export default class GOnHookMode extends GDefaultMode<{},{}>{
|
||||
|
||||
}
|
||||
|
||||
//更新属性
|
||||
onUpdateAttribute(){
|
||||
|
||||
this.getOnesRole(GOnHookModePlayerEnum.PLAYER).forEach(pet => {
|
||||
pet.onEffectiveValue(GBattleData.getIns().data.getPetAttribute(pet.getComponent(GRoleOnHookPlayerExpand).petId));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//更新帧
|
||||
onSyncUpdate(dt: number,frame:JNFrameInfo, input?: {}){
|
||||
super.onSyncUpdate(dt,frame,input);
|
||||
@@ -247,7 +260,7 @@ export default class GOnHookMode extends GDefaultMode<{},{}>{
|
||||
expand.petId = petId;
|
||||
|
||||
//添加宠物属性
|
||||
role.onEffectiveValue(new GPetAttribute(info));
|
||||
role.onEffectiveValue(GBattleData.getIns().data.getPetAttribute(petId));
|
||||
|
||||
}
|
||||
|
||||
@@ -261,7 +274,7 @@ export default class GOnHookMode extends GDefaultMode<{},{}>{
|
||||
expand.creeps = creeps;
|
||||
|
||||
//添加野怪属性
|
||||
role.onEffectiveValue(new GPetAttribute({
|
||||
role.onEffectiveValues(new GPetAttribute({
|
||||
petId:0,
|
||||
petPlayerId:0,
|
||||
petTbId:creeps.petTbId,
|
||||
@@ -381,6 +394,7 @@ export default class GOnHookMode extends GDefaultMode<{},{}>{
|
||||
JNFrameTime.getInstance().setTimeout(() => {
|
||||
if(role.isValid)
|
||||
role.node.destroy()
|
||||
else console.log(role,"无法销毁");
|
||||
},3000)
|
||||
|
||||
//清理
|
||||
|
@@ -145,7 +145,7 @@ export default class GPVPMode extends GBaseMode<{},GPVPStart>{
|
||||
entity.addKillBackEvent(this.onRoleKillBack.bind(this))
|
||||
|
||||
//添加宠物属性
|
||||
entity.onEffectiveValue(new GPetAttribute(info));
|
||||
entity.onEffectiveValues(new GPetAttribute(info));
|
||||
|
||||
this.addGObject(entity,tactical.getPosition(index));
|
||||
this.getOnesRole(type).push(entity);
|
||||
|
Reference in New Issue
Block a user