debuff 灼烧完成

This commit is contained in:
2025-01-05 15:59:40 +08:00
parent 511459c66c
commit 064c7f057f
26 changed files with 3561 additions and 2463 deletions

View File

@@ -0,0 +1,20 @@
import { _decorator, Animation, Component, Node } from 'cc';
import { SkillCom } from './SkillCom';
const { ccclass, property } = _decorator;
@ccclass('OnceCom')
export class OnceCom extends Component {
start() {
let anim = this.node.getComponent(Animation);
anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
}
onAnimationFinished(){
let bese = this.node.getComponent(SkillCom)
bese.is_destroy = true
}
update(deltaTime: number) {
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "34a04999-1c8d-4380-b218-59d8a41818a6",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -45,9 +45,10 @@ export class Skill extends ecs.Entity {
sv.s_name = SkillSet[uuid].name;
sv.ap = ap*SkillSet[uuid].ap;
sv.cd = SkillSet[uuid].cd;
sv.decd = SkillSet[uuid].decd;
sv.debtime = SkillSet[uuid].debtime;
sv.debuff = SkillSet[uuid].debuff;
sv.rate = SkillSet[uuid].rate;
sv.depb = SkillSet[uuid].depb;
sv.derate = SkillSet[uuid].derate;
sv.is_crit=is_crit
sv.crit_add=crit_add
// node.setScale(v3(node.scale.x*scale,node.scale.y))

View File

@@ -20,8 +20,9 @@ export class SkillCom extends CCComp {
ap:number = 10;
cd:number = 1;
debuff:number = 0;
decd:number = 0;
rate:number = 0;
debtime:number = 0;
depb:number = 0;
derate:number = 0;
atk_count:number = 0;
is_crit:boolean = false;
crit_add: number = 0;//暴击伤害加成

View File

@@ -0,0 +1,32 @@
import { _decorator, Component, Node } from 'cc';
import { timedCom } from './timedCom';
import { HeroViewComp } from '../hero/HeroViewComp';
const { ccclass, property } = _decorator;
@ccclass('debuff')
export class debuff extends Component {
base: timedCom = null
hero:HeroViewComp = null
cd: number = 0
ap: number = 0
start() {
this.base =this.node.getComponent(timedCom)
this.hero = this.node.parent.getComponent(HeroViewComp)
}
update(deltaTime: number) {
this.cd += deltaTime
if(this.cd >=1){
// this.node.setPosition(v3(-1000,0,0))
if(this.hero){
this.hero.in_atked()
this.hero.hp_less(Math.ceil(this.base.ap/this.base.time))
console.log("debuff 总扣血:"+this.base.ap+" 每秒: "+Math.ceil(this.base.ap/this.base.time))
}
this.cd=0
}
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "69132caf-02ba-40a8-a835-30baced39701",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -1,11 +1,15 @@
import { _decorator, Component, Node } from 'cc';
import { SkillSet } from '../common/config/SkillSet';
const { ccclass, property } = _decorator;
@ccclass('timedCom')
export class timedCom extends Component {
time = 0.3;
start() {
cd: number = 0;
ap: number = 0;
start() {
}
update(deltaTime: number) {