取消掉副英雄

This commit is contained in:
panw
2025-07-14 16:53:39 +08:00
parent 0815d64f3c
commit fbcd12a5b9
19 changed files with 89 additions and 202 deletions

View File

@@ -88,8 +88,6 @@ export class HeroViewComp extends CCComp {
stop_cd: number = 0; /*停止倒计时*/
speek_time:number = 0;
is_stop_temp:boolean = false
Friend_alive_cd:Timer=new Timer(10)
double_dead:boolean=false
double_atked:boolean=false
BUFF_DEFS: Array<{value: number, count: number}> = [] //防御提升
@@ -136,9 +134,7 @@ export class HeroViewComp extends CCComp {
}
/* 显示角色血量 */
this.node.getChildByName("top").getChildByName("hp").active = true;
if(this.is_friend){ //只有伙伴需要召唤后添加hp 怪物,和boss 不要设置减hp debuff 主要 一开始就战斗开始就存在,所以不需要
this.hp+=this.FIGHTCON.friend_buff.HP*this.hp_max/100
}
}
update(dt: number){
if(!smc.mission.play||smc.mission.pause) return
@@ -146,13 +142,7 @@ export class HeroViewComp extends CCComp {
// this.ent.destroy();
// return
// }
if(this.is_dead) {
// console.log("[HeroViewComp]:alive friend cd",this.Friend_alive_cd ,this.Friend_alive_cd.elapsedTime)
if(this.Friend_alive_cd.update(dt)){
this.to_alive()
}
}
if(this.timer.update(dt)){
// this.add_ap(10)
};
@@ -291,23 +281,12 @@ export class HeroViewComp extends CCComp {
}
}
}
master_count_atk_count(){ //主将攻击次数 主要有装备加成,需要单独处理
count_atk_count(){ //主将攻击次数 主要有装备加成,需要单独处理
if(!this.is_master) return
this.atk_count+=1
if(this.atk_count< FightSet.ATK_ADD_FRIEND_COUNT) return
if(this.atk_count< FightSet.ATK_ADD_COUNT) return
if(this.FIGHTCON.atk_add_glod >0) smc.vmdata.mission_data.gold+=this.FIGHTCON.atk_add_glod
let friends=ecs.query(ecs.allOf(FriendModelComp))
friends.forEach(friend=>{
let friend_view=friend.get(HeroViewComp)
if(this.FIGHTCON.atk_add_friend_atk>0) {
friend_view.add_ap(this.FIGHTCON.atk_add_friend_atk)
}
if(this.FIGHTCON.atk_add_friend_hp>0) {
friend_view.add_hp_max(this.FIGHTCON.atk_add_friend_hp)
}
})
let master=ecs.query(ecs.allOf(MasterModelComp))
master.forEach(master=>{
@@ -323,19 +302,12 @@ export class HeroViewComp extends CCComp {
this.atk_count=0
}
friend_count_atk_count(){ //伙伴攻击次数 有装备加成,需要单独处理
if(this.is_master) return
if(this.atk_add_count==0) return
this.atk_count+=1
if(this.atk_count < this.atk_add_count) return
}
do_dead(){
this.do_dead_trigger()
this.Friend_alive_cd=new Timer(this.FIGHTCON.friend_alive_cd)
console.log("[HeroViewComp]:角色死亡",this.hero_uuid)
if(this.fac==FacSet.MON){
@@ -349,7 +321,7 @@ export class HeroViewComp extends CCComp {
}
}
if(this.is_master){
if(this.fac==FacSet.HERO){
console.log("[HeroViewComp]:英雄死亡")
oops.message.dispatchEvent(GameEvent.FightEnd,{victory:false})
}
@@ -358,8 +330,7 @@ export class HeroViewComp extends CCComp {
}
get_buff(){
let buff=null
if(this.is_master) buff=this.FIGHTCON.hero_buff
if(this.is_friend) buff=this.FIGHTCON.friend_buff
if(this.fac==FacSet.HERO) buff=this.FIGHTCON.hero_buff
if(this.is_boss) buff=this.FIGHTCON.enemy_buff
if(this.is_kalami) buff=this.FIGHTCON.enemy_buff
if(buff==null) return
@@ -572,16 +543,12 @@ export class HeroViewComp extends CCComp {
do_dead_trigger(){
if(this.is_dead||this.fac==FacSet.MON||this.is_master) return
let count = 1
if(this.double_dead) {
console.log("[HeroViewComp]:double_dead")
count =2
}
for(let i=0;i<count;i++){
console.log("[HeroViewComp]:dead"+i+"次")
}
}
do_atked_trigger(){
if(this.is_dead||this.fac==FacSet.MON||this.is_master) return
if(this.is_dead||this.fac==FacSet.MON) return
let count = 1
if(this.double_atked) {
console.log("[HeroViewComp]:double_atked")
@@ -598,13 +565,13 @@ export class HeroViewComp extends CCComp {
}
).start()
}
to_alive(){
this.is_dead=false
this.hp=this.hp_max*(100+this.buff_hp)/100
this.BUFFCOMP.vmdata_update(true)
this.node.setPosition(HeroPos[this.fight_pos].pos)
this.BUFFCOMP.heathed()
}
// to_alive(){
// this.is_dead=false
// this.hp=this.hp_max*(100+this.buff_hp)/100
// this.BUFFCOMP.vmdata_update(true)
// this.node.setPosition(HeroPos[this.fight_pos].pos)
// this.BUFFCOMP.heathed()
// }
//掉落物品
to_drop(){
// let Drops = getMonsterDrops(1, MonsterType.Normal, 1.2);