++护盾技能
This commit is contained in:
@@ -88,6 +88,8 @@ export class Skill extends ecs.Entity {
|
||||
SComp.caster_crit_d = ap_data.crit_d
|
||||
SComp.puncture = ap_data.puncture
|
||||
SComp.puncture_damage = ap_data.puncture_damage
|
||||
SComp.heal = config.heal
|
||||
SComp.shield = config.shield
|
||||
// 设置技能组件属性
|
||||
Object.assign(SComp, {
|
||||
s_uuid: uuid,
|
||||
@@ -101,7 +103,7 @@ export class Skill extends ecs.Entity {
|
||||
group: caster.box_group,
|
||||
fac: caster.fac,
|
||||
scale: caster.scale,
|
||||
animName: config.animName
|
||||
animName: config.animName,
|
||||
});
|
||||
|
||||
this.add(SComp);
|
||||
|
||||
@@ -4,7 +4,7 @@ import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/modu
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { GameEvent } from "../common/config/GameEvent";
|
||||
import { AType, EType, RType, SkillSet } from "../common/config/SkillSet";
|
||||
import { AType, DTType, EType, RType, SkillSet, SType, TGroup } from "../common/config/SkillSet";
|
||||
import { BoxSet, FacSet } from "../common/config/BoxSet";
|
||||
import { HeroFac, HeroSet } from "../common/config/heroSet";
|
||||
import { HeroViewComp } from "../hero/HeroViewComp";
|
||||
@@ -42,6 +42,8 @@ export class SkillCom extends CCComp {
|
||||
distance_x:number=0;
|
||||
distance_y:number=0;
|
||||
ap:number=0;
|
||||
heal:number=0;
|
||||
shield:number=0;
|
||||
FIGHTCON:FightConComp=null;
|
||||
run_time:number=0;
|
||||
hited_time:number=0;
|
||||
@@ -110,6 +112,13 @@ export class SkillCom extends CCComp {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AType.fixedStart:
|
||||
this.node.setPosition(this.startPos.x,this.startPos.y,0)
|
||||
this.scheduleOnce(()=>{
|
||||
this.do_buff()
|
||||
console.log("[SkillCom]:fixedStart",SkillSet[this.s_uuid].in-0.2)
|
||||
},SkillSet[this.s_uuid].in-0.2)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -150,7 +159,7 @@ export class SkillCom extends CCComp {
|
||||
target.add_debuff(debuff.debuff,dev,deC,deR)
|
||||
}
|
||||
this.hit_count++
|
||||
if(this.hit_count>=(SkillSet[this.s_uuid].hit+this.puncture)&&(this.EType!=EType.animationEnd&&this.EType!=EType.timeEnd)) this.is_destroy=true // 技能命中次数
|
||||
if(this.hit_count>=(SkillSet[this.s_uuid].hit+this.puncture)&&(SkillSet[this.s_uuid].DTType!=DTType.range)) this.is_destroy=true // 技能命中次数
|
||||
}
|
||||
|
||||
onBeginContact (seCol: Collider2D, oCol: Collider2D) {
|
||||
@@ -179,7 +188,7 @@ export class SkillCom extends CCComp {
|
||||
* 执行2段位移:先升高,然后移到目的地
|
||||
*/
|
||||
private executeTwoStageMovement() {
|
||||
const totalDuration = SkillSet[this.s_uuid].in;
|
||||
const totalDuration = SkillSet[this.s_uuid].in-0.1
|
||||
const firstStageDuration = totalDuration * 0.4; // 第一段占40%时间
|
||||
const secondStageDuration = totalDuration * 0.6; // 第二段占60%时间
|
||||
|
||||
@@ -204,9 +213,25 @@ export class SkillCom extends CCComp {
|
||||
})
|
||||
.start();
|
||||
}
|
||||
do_buff(){
|
||||
private do_buff(){
|
||||
console.log("[SkillCom]:do_buff")
|
||||
let teams=ecs.query(ecs.allOf(HeroModelComp))
|
||||
if(this.fac==FacSet.MON) teams=ecs.query(ecs.allOf(MonModelComp))
|
||||
if(SkillSet[this.s_uuid].TGroup==TGroup.Team||SkillSet[this.s_uuid].TGroup==TGroup.Self) {
|
||||
teams.forEach(entity => {
|
||||
let view=entity.get(HeroViewComp)
|
||||
if(view.node.position.x==this.targetPos.x){
|
||||
if(SkillSet[this.s_uuid].SType==SType.heal){
|
||||
view.add_hp(this.heal,false)
|
||||
}
|
||||
if(SkillSet[this.s_uuid].SType==SType.shield){
|
||||
view.add_shield(this.shield)
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private startLinearMove(dt: number) {
|
||||
if (!this.speed || this.is_destroy) return;
|
||||
if(this.s_uuid == 6005){
|
||||
@@ -243,7 +268,7 @@ export class SkillCom extends CCComp {
|
||||
}
|
||||
//范围伤害
|
||||
this.hited_time+=deltaTime
|
||||
if(this.hited_time>config.hited&&(config.EType==EType.animationEnd||config.EType==EType.timeEnd)){
|
||||
if(this.hited_time>config.hited&&(SkillSet[this.s_uuid].DTType==DTType.range)){
|
||||
this.hited_time=0
|
||||
this.range_damage()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user