This commit is contained in:
2025-06-25 23:57:19 +08:00
parent 7363952dae
commit 862777a9c7
6 changed files with 4486 additions and 4792 deletions

View File

@@ -28,6 +28,7 @@ export enum GameEvent {
HeroSkillSelect = "HeroSkillSelect",
HeroSkillSelectEnd = "HeroSkillSelectEnd",
HeroSelect = "HeroSelect",
FriendCalled = "FriendCalled",
FightStart = "FightStart",
FightPause = "FightPause",
FightResume = "FightResume",

View File

@@ -92,8 +92,7 @@ export class BuffComp extends Component {
}
vmdata_update(is_hp:boolean=false){
if(this.HeroView.is_kalami) return
console.log("[BuffComp]:to_update_vmdata:"+this.HeroView.hero_name)
// console.log("[BuffComp]:to_update_vmdata:"+this.HeroView.hero_name)
let buff=null
let info= null
@@ -121,6 +120,8 @@ export class BuffComp extends Component {
view_deatk += this.HeroView.DEBUFF_DEATKS[i].value
}
info.ap=this.HeroView.ap
info.cd=this.HeroView.cd*(100-buff.ATK_CD)/100
console.log("info.buff.ATK_CD",buff.ATK_CD)
info.equip_ap=buff.ATK
info.buff_ap=view_atk
info.debuff_ap=view_deatk
@@ -133,15 +134,6 @@ export class BuffComp extends Component {
}
update_info_hp(){
let ihp_node = this.top_node.getChildByName("ihp");
ihp_node.getChildByName("num").getComponent(Label)!.string = this.HeroView.hp.toFixed(0)
}
update_info_ap(){
let iap_node = this.top_node.getChildByName("iap");
iap_node.getChildByName("num").getComponent(Label)!.string = this.HeroView.ap.toFixed(0)
}
update_info_lv(){
let lv_node = this.top_node.getChildByName("lv");

View File

@@ -214,7 +214,6 @@ export class HeroViewComp extends CCComp {
}else{
this.ap += Math.floor(ap/100*this.ap);
}
this.BUFFCOMP.update_info_ap()
this.BUFFCOMP.vmdata_update()
}
@@ -225,7 +224,6 @@ export class HeroViewComp extends CCComp {
}else{
this.ap -= Math.floor(ap/100*this.ap);
}
this.BUFFCOMP.update_info_ap()
this.BUFFCOMP.vmdata_update()
}
update_hp(e:GameEvent,data:any){
@@ -234,8 +232,8 @@ export class HeroViewComp extends CCComp {
this.buff_hp += data.hp
if(data.hp > 0){
this.hp += this.hp_max*data.hp/100
if(this.hp > this.hp_max*(100+this.buff_hp/100)){
this.hp=this.hp_max*(100+this.buff_hp/100)
if(this.hp > this.hp_max*(100+this.buff_hp)/100){
this.hp=this.hp_max*(100+this.buff_hp)/100
}
}
}
@@ -243,14 +241,13 @@ export class HeroViewComp extends CCComp {
add_hp_max(hp: number=0,is_num:boolean=true){
this.hp_max += Math.floor(hp) ;
this.hp += Math.floor(hp*(100+this.buff_hp)/100) ;
this.BUFFCOMP.update_info_hp()
this.BUFFCOMP.vmdata_update(true)
}
de_hp_max(hp: number=0,is_num:boolean=true){ //最大值 只存在数值添加, 比例通过buff_hp处理
console.log("[HeroViewComp]:de_hp_max de:",hp,this.hp_max)
this.hp_max -= Math.floor(hp) ;
this.BUFFCOMP.update_info_hp()
this.BUFFCOMP.vmdata_update(true)
}
@@ -410,7 +407,6 @@ export class HeroViewComp extends CCComp {
this.ent.destroy();
}
}
this.BUFFCOMP.update_info_hp()
this.BUFFCOMP.vmdata_update(true)
this.showDamage(damage, is_crit);
@@ -525,7 +521,7 @@ export class HeroViewComp extends CCComp {
to_alive(){
this.is_dead=false
this.hp=this.hp_max*(100+this.buff_hp)/100
this.BUFFCOMP.update_info_hp()
this.BUFFCOMP.vmdata_update(true)
this.node.setPosition(HeroPos[this.fight_pos].pos)
this.BUFFCOMP.heathed()
}

View File

@@ -30,6 +30,7 @@ export class MissionComp extends CCComp {
this.on(GameEvent.MissionEnd,this.mission_end,this)
// this.on(GameEvent.CardsClose,this.after_used_skill_card,this)
this.on(GameEvent.WaveUpdate,this.on_mon_wave_update,this)
this.on(GameEvent.FriendCalled,this.friend_called,this)
}
protected update(dt: number): void {
@@ -51,7 +52,7 @@ export class MissionComp extends CCComp {
let wave=smc.vmdata.mission_data.current_wave
if(wave==FightSet.FRIEND_WAVE_UP){
console.log("[任务系统] FRIEND_WAVE_UP 英雄选择 :",wave,FightSet.FRIEND_WAVE_UP)
this.to_hero_select()
this.to_call_friend()
}
if(wave==FightSet.BOSS_WAVE_UP_1){
console.log("[任务系统] BOSS_WAVE_UP_1 装备选择 :",wave,FightSet.BOSS_WAVE_UP_1)
@@ -88,6 +89,7 @@ export class MissionComp extends CCComp {
async mission_start(){
oops.message.dispatchEvent(GameEvent.FightReady)
this.node.getChildByName("herobar").getChildByName("fbar").active=false //隐藏伙伴栏
this.node.active=true
this.data_init()
this.hart_hero_load()
@@ -104,10 +106,12 @@ export class MissionComp extends CCComp {
// oops.message.dispatchEvent(GameEvent.HeroSkillSelect)
}
to_hero_select(){
to_call_friend(){
oops.message.dispatchEvent(GameEvent.HeroSelect)
}
friend_called(){
this.node.getChildByName("herobar").getChildByName("fbar").active=true
}
to_fight(){
smc.vmdata.mission_data.in_fight=true
oops.message.dispatchEvent(GameEvent.FightStart) //MissionMonComp 监听刷怪

View File

@@ -134,7 +134,7 @@ export class MissionHeroCompComp extends CCComp {
let scale = 1
let pos:Vec3 = HeroPos[freind_pos].pos;
hero.load(pos,scale,uuid,info,freind_pos);
this.current_hero_uuid=0
oops.message.dispatchEvent(GameEvent.FriendCalled)
}
get_info_and_remove(fight_pos:number,uuid:number){