添加暴捶英雄,同时修复 endanmbomcom 错误,使用rigid.sleep和rigid.wakeup关闭和启动碰撞检测

This commit is contained in:
2025-01-20 23:51:59 +08:00
parent 2a8b65d328
commit 478cf13f5e
12 changed files with 540 additions and 947 deletions

View File

@@ -167,14 +167,12 @@ export class HeroViewComp extends CCComp {
}
onBeginContact (seCol: Collider2D, oCol: Collider2D) {
if(oCol.tag==BoxSet.SKILL_TAG &&seCol.tag!=BoxSet.SKILL_TAG){
if(seCol.group != oCol.group){
let skill = oCol.node.getComponent(SkillCom)!;
// console.log(Date.now()+this.hero_name+":"+this.uuid+' onBeginContact: '+skill.s_name+skill.uuid);
if(this.hp <= 0 ) return
if(skill.tg< 3) return
this.check_uatk(skill);
}
if(oCol.tag==BoxSet.SKILL_TAG&&seCol.group != oCol.group){
let skill = oCol.node.getComponent(SkillCom)!;
// console.log(Date.now()+this.hero_name+":"+this.uuid+' onBeginContact: '+skill.s_name+skill.uuid);
if(this.hp <= 0 ) return
if(skill.tg< 3) return
this.check_uatk(skill);
}
}
@@ -321,7 +319,7 @@ export class HeroViewComp extends CCComp {
if(this.check_dodge()) return
this.in_atked();
let l_hp=this.check_less(skill.ap,skill.is_crit,skill.crit_add)
this.check_debuff(skill,l_hp*skill.derate)
this.check_debuff(skill,l_hp)
if(this.shield > 0){
this.shield -=1
l_hp = 0
@@ -347,7 +345,7 @@ export class HeroViewComp extends CCComp {
* @param l_hp - 可选参数表示英雄的当前生命值默认为0
*/
check_debuff(skill:any,l_hp:number=0){
console.log(this.hero_name+":"+this.uuid+"check_debuff "+skill.debuff);
console.log(this.hero_name+this.uuid+": skillname: "+skill.s_name+" :check_debuff "+skill.debuff);
if(skill.debuff == 0) return
let num=RandomManager.instance.getRandomInt(0,100)
switch (skill.debuff){
@@ -361,7 +359,7 @@ export class HeroViewComp extends CCComp {
case 2:
if(num > skill.depb) return
// console.log(this.hero_name+":"+this.uuid+"debuff触发成功 i="+num+":debtime="+skill.debtime+":l_hp="+l_hp);
this.BUFFCOMP.in_fired(skill.debtime,l_hp)
this.BUFFCOMP.in_fired(skill.debtime,l_hp*skill.derate/100)
break;
case 3:
if(num > skill.depb) return
@@ -370,6 +368,8 @@ export class HeroViewComp extends CCComp {
break;
case 4:
if(num > skill.depb) return
this.BUFFCOMP.buff_get("deap")
this.ap = this.ap-Math.floor(l_hp*skill.derate/100)
break;
case 5:
if(num > skill.depb) return