This commit is contained in:
2025-05-27 10:57:42 +08:00
parent 424edb89a7
commit cdb09a5ca1
13 changed files with 867 additions and 555 deletions

View File

@@ -1,7 +1,7 @@
import { _decorator, resources, Sprite, SpriteAtlas, SpriteFrame, v3, Vec3 } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { BoxSet, GameSet } from "../common/config/BoxSet";
import { BoxSet, } from "../common/config/BoxSet";
import { HeroInfo, HeroList, HeroPos, HeroSet, HeroUpInfo } from "../common/config/heroSet";
import { Hero } from "../hero/Hero";
import { smc } from "../common/SingletonModuleComp";
@@ -11,6 +11,7 @@ import { GameEvent } from "../common/config/GameEvent";
import { HeroModelComp } from "../hero/HeroModelComp";
import { HeroViewComp } from "../hero/HeroViewComp";
import { oops } from "db://oops-framework/core/Oops";
import { FightSet } from "../common/config/Mission";
const { ccclass, property } = _decorator;
@@ -113,23 +114,34 @@ export class MissionHeroCompComp extends CCComp {
for(let hero of heros){
if(hero.get(HeroViewComp).fight_pos==fight_pos){
let hv = hero.get(HeroViewComp)
let AP_UP_RATE = hv.hero_uuid === uuid ? GameSet.AP_UPDATE_RATE : GameSet.AP_CHANGE_RATE;
let heroUpData = HeroUpInfo[hv.hero_uuid] || {}
let o_ap_rate = heroUpData.ap_up_rate || 0 //被替换 升级的英雄额外被替换攻击增长比率
let o_ap = heroUpData.ap_up || 0 //被替换 升级的英雄额外被替换攻击增长值
let s_ap_rate = (HeroUpInfo[uuid] || {}).ap_up_rate || 0 //替换 升级的英雄额外替换攻击增长比率
let s_ap = (HeroUpInfo[uuid] || {}).ap_up || 0 //替换 升级的英雄额外替换攻击增长值
let o_hp_up = heroUpData.hp_up || 0 //被替换 升级的英雄额外被替换血量增长值
let s_hp_up = (HeroUpInfo[uuid] || {}).hp_up || 0 //替换 升级的英雄额外替换血量增长值
info.ap=Math.floor(hv.ap*(AP_UP_RATE+o_ap_rate+s_ap_rate)/100+o_ap+s_ap)
info.hp=Math.floor(o_hp_up+s_hp_up)
info.lv=hv.lv
// let AP_UP_RATE = hv.hero_uuid === uuid ? FightSet.AP_UPDATE_RATE : FightSet.AP_CHANGE_RATE;
// let heroUpData = HeroUpInfo[hv.hero_uuid] || {}
// let o_ap_rate = heroUpData.ap_up_rate || 0 //被替换 升级的英雄额外被替换攻击增长比率
// let o_ap = heroUpData.ap_up || 0 //被替换 升级的英雄额外被替换攻击增长值
// let s_ap_rate = (HeroUpInfo[uuid] || {}).ap_up_rate || 0 //替换 升级的英雄额外替换攻击增长比率
// let s_ap = (HeroUpInfo[uuid] || {}).ap_up || 0 //替换 升级的英雄额外替换攻击增长值
// let o_hp_up = heroUpData.hp_up || 0 //被替换 升级的英雄额外被替换血量增长值
// let s_hp_up = (HeroUpInfo[uuid] || {}).hp_up || 0 //替换 升级的英雄额外替换血量增长值
// info.ap=Math.floor(hv.ap*(AP_UP_RATE+o_ap_rate+s_ap_rate)/100+o_ap+s_ap)
// info.hp=Math.floor(o_hp_up+s_hp_up)
if(hv.hero_uuid === uuid){
info.ap=hv.ap
info.hp=hv.hp_max
info.lv=hv.lv
}else{
this.do_hero_change()
}
hero.destroy()
return info
}
}
return info
}
do_hero_change(){
//金币加1
}
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
reset() {
// this.node.destroy();