护盾改为 护甲值
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { _decorator, Component, Node, v3, Vec3 } from 'cc';
|
||||
import { _decorator, Component, Node, ProgressBar, v3, Vec3 } from 'cc';
|
||||
import { HeroViewComp } from './HeroViewComp';
|
||||
import { BuffAttr, DTType, SkillSet, SType, TGroup, TType } from '../common/config/SkillSet';
|
||||
import { BuffAttr, CdType, DTType, SKILL_CONST, SkillSet, SType, TGroup, TType } from '../common/config/SkillSet';
|
||||
import { Skill } from '../skills/Skill';
|
||||
import { ecs } from 'db://oops-framework/libs/ecs/ECS';
|
||||
import { oops } from 'db://oops-framework/core/Oops';
|
||||
@@ -11,6 +11,7 @@ import { CCComp } from 'db://oops-framework/module/common/CCComp';
|
||||
import { MonModelComp } from './MonModelComp';
|
||||
import { HeroModelComp } from './HeroModelComp';
|
||||
import { FightSet } from '../common/config/Mission';
|
||||
import { Timer } from 'db://oops-framework/core/common/timer/Timer';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('SkillCon')
|
||||
@@ -35,15 +36,32 @@ export class SkillConComp extends CCComp {
|
||||
|
||||
update(dt: number) {
|
||||
if(!smc.mission.play||smc.mission.pause) return
|
||||
|
||||
if(this.HeroView.DEBUFF_STUN <= 0&&this.HeroView.DEBUFF_FROST <= 0) {
|
||||
for(let i=0;i<this.HeroView.skills.length;i++){
|
||||
this.HeroView.skills[i].cd += dt;
|
||||
if(this.HeroView.skills[i].cd > (i==0?this.HeroView.Attrs[BuffAttr.ATK_CD]:this.HeroView.skills[i].cd_max)){
|
||||
let sc=SkillSet[this.HeroView.skills[i].uuid]
|
||||
if(!sc) return
|
||||
if(sc.SType==SType.damage&&!this.HeroView.is_atking) return
|
||||
this.castSkill(sc)
|
||||
this.HeroView.skills[i].cd = 0
|
||||
let skills=this.HeroView.skills
|
||||
for(let i=0;i<skills.length;i++){
|
||||
if(SkillSet[skills[i].uuid].CdType==CdType.cd) {
|
||||
skills[i].cd += dt;
|
||||
if(skills[i].cd > (i==0?this.HeroView.Attrs[BuffAttr.ATK_CD]:skills[i].cd_max)){
|
||||
if(SkillSet[skills[i].uuid].SType==SType.damage&&this.HeroView.is_atking){
|
||||
this.castSkill(SkillSet[skills[i].uuid])
|
||||
this.HeroView.skills[i].cd = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(skills[1]){
|
||||
if(this.HeroView.fac==FacSet.HERO) {
|
||||
console.log("[SkillConComp] 角色状态:",this.HeroView.hero_name+"=>能量:"+this.HeroView.power+"/"+this.HeroView.power_max,skills)
|
||||
}
|
||||
this.HeroView.power+=(1+this.HeroView.Attrs[BuffAttr.POWER_UP])*dt*SKILL_CONST.POWER_UP
|
||||
let progress=this.HeroView.power/this.HeroView.power_max
|
||||
this.HeroView.node.getChildByName("top").getChildByName("pow").getComponent(ProgressBar).progress=progress
|
||||
if(this.HeroView.power>this.HeroView.power_max){
|
||||
this.HeroView.power=0
|
||||
}
|
||||
}else{
|
||||
if(this.HeroView.fac==FacSet.HERO) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user