debuff 灼烧完成
This commit is contained in:
20
assets/script/game/skills/OnceCom.ts
Normal file
20
assets/script/game/skills/OnceCom.ts
Normal 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) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
9
assets/script/game/skills/OnceCom.ts.meta
Normal file
9
assets/script/game/skills/OnceCom.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "34a04999-1c8d-4380-b218-59d8a41818a6",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -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))
|
||||
|
||||
@@ -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;//暴击伤害加成
|
||||
|
||||
32
assets/script/game/skills/debuff.ts
Normal file
32
assets/script/game/skills/debuff.ts
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
9
assets/script/game/skills/debuff.ts.meta
Normal file
9
assets/script/game/skills/debuff.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "69132caf-02ba-40a8-a835-30baced39701",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user