释放技能动画 设定在技能参数中+伤害系统建立

This commit is contained in:
2025-02-03 10:45:06 +08:00
parent 89978ddbe8
commit cdb8261be9
17 changed files with 960 additions and 462 deletions

View File

@@ -177,18 +177,39 @@ export class HeroViewComp extends CCComp {
}
//受伤判断
check_uatk(skill:any){
check_uatk(damage:number,is_crit:boolean){
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)
let l_hp=damage
// this.check_debuff(skill,l_hp)
if(this.shield > 0){
this.shield -=1
if(this.shield == 0) this.BUFFCOMP.show_shield(false)
l_hp = 0
this.shield -= damage
if(this.shield <= 0) {
l_hp = -this.shield
this.shield = 0
this.BUFFCOMP.show_shield(false)
}
}
this.hp_less(l_hp,is_crit);
}
hp_less(hp: number,is_crit:boolean=false){
if(this.is_dead) return
hp=Math.floor(hp)
this.hp -= hp
if(is_crit){
this.BUFFCOMP.tooltip(4,hp.toFixed(0),250);
}else{
this.BUFFCOMP.tooltip(1,hp.toFixed(0),250);
}
if(this.hp > this.hp_max){
this.hp = this.hp_max;
}
if(this.hp <= 0){
this.dead();
this.to_grave()
this.is_dead = true;
}
this.hp_less(l_hp,skill.is_crit);
}
check_less(ap:number,is_crit:boolean,crit_add:number=0){
let d=this.def/ap
@@ -455,24 +476,7 @@ export class HeroViewComp extends CCComp {
this.hp += Math.floor(hprate/100*this.hp_max) ;
}
hp_less(hp: number,is_crit:boolean=false){
if(this.is_dead) return
hp=Math.floor(hp)
this.hp -= hp
if(is_crit){
this.BUFFCOMP.tooltip(4,hp.toFixed(0),250);
}else{
this.BUFFCOMP.tooltip(1,hp.toFixed(0),250);
}
if(this.hp > this.hp_max){
this.hp = this.hp_max;
}
if(this.hp <= 0){
this.dead();
this.to_grave()
this.is_dead = true;
}
}
/** 静止时间 */
in_stop (dt: number) {
if(this.stop_cd > 0){
@@ -548,8 +552,18 @@ export class HeroViewComp extends CCComp {
this.node.destroy();
}
playSkillEffect() {
this.as.max()
playSkillEffect(skill_id:number) {
let skill = SkillSet[skill_id]
switch(skill.act){
case "max":
this.as.max()
this.BUFFCOMP.max_show(skill.fname)
this.BUFFCOMP.tooltip(3,skill.name,skill_id)
break
case "atk":
this.as.atk()
break
}
}
public revive() {