buff 重设 英雄和伙伴 改为公用debuff
This commit is contained in:
@@ -63,21 +63,19 @@ export enum DebuffAttr {
|
||||
DECD = 5, //减cd
|
||||
DEHP = 6, //减hp
|
||||
DEATK = 7, //减atk
|
||||
DEDEF = 8, //减def
|
||||
DECOUNT = 9, //减攻击次数
|
||||
DECOUNT = 8, //减攻击次数
|
||||
}
|
||||
|
||||
export const geDebuffNum=()=>{
|
||||
return {
|
||||
STUN:0,
|
||||
SLOW:0,
|
||||
FROST:0,
|
||||
BURN:0,
|
||||
DECD:0,
|
||||
DEHP:0,
|
||||
DEATK:0,
|
||||
DEDEF:0,
|
||||
DECOUNT:0,
|
||||
STUN:0, //眩晕
|
||||
SLOW:0, //减速
|
||||
FROST:0, //冰冻
|
||||
BURN:0, //易伤
|
||||
DECD:0, //减cd
|
||||
DEHP:0, //减hp
|
||||
DEATK:0, //减atk
|
||||
DECOUNT:0, //减攻击次数
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,28 +67,28 @@ export class SkillConComp extends CCComp {
|
||||
if(!this.HeroView.is_master) return
|
||||
console.log("hart cast_skill",uuid ,e)
|
||||
const config = SkillSet[uuid];
|
||||
this.castSkill(config)
|
||||
this.castSkill(config,1,this.FIGHTCON.hero.SKILL_DMG)
|
||||
}
|
||||
|
||||
/** 施放技能 */
|
||||
castSkill(config: typeof SkillSet[keyof typeof SkillSet],count:number=1) {
|
||||
castSkill(config: typeof SkillSet[keyof typeof SkillSet],count:number=1,dmg:number=0) {
|
||||
// console.log(view.uuid+"=>"+view.hero_name+"施放技能:"+config.uuid);
|
||||
if (config.TargetGroup === TargetGroup.Enemy) {
|
||||
this.HeroView.playSkillEffect(config.uuid);
|
||||
this.doSkill(config,count);
|
||||
this.doSkill(config,count,dmg);
|
||||
}
|
||||
|
||||
if (config.TargetGroup === TargetGroup.Ally) {
|
||||
const targets = this.selectAllyTargets( config);
|
||||
if (targets.length === 0) return;
|
||||
this.doSkill(config,count);
|
||||
this.doSkill(config,count,dmg);
|
||||
}
|
||||
if (config.TargetGroup === TargetGroup.Self) {
|
||||
this.doSkill(config,count);
|
||||
this.doSkill(config,count,dmg);
|
||||
}
|
||||
|
||||
}
|
||||
private doSkill(config: typeof SkillSet[keyof typeof SkillSet],count:number=1,angle:number=0) {
|
||||
private doSkill(config: typeof SkillSet[keyof typeof SkillSet],count:number=1,angle:number=0,dmg:number=0) {
|
||||
// 添加节点有效性检查
|
||||
if (!this.node || !this.node.isValid || !this.HeroView || !this.HeroView.node || !this.HeroView.node.isValid) {
|
||||
return;
|
||||
@@ -116,7 +116,8 @@ export class SkillConComp extends CCComp {
|
||||
config.uuid,
|
||||
new Vec3(targetView.node.position.x, targetView.node.position.y, 0),
|
||||
this.HeroView,
|
||||
angle
|
||||
angle,
|
||||
dmg
|
||||
);
|
||||
}, 300);
|
||||
count-=1
|
||||
|
||||
@@ -17,16 +17,18 @@ export class EquipSkillComp extends CCComp {
|
||||
skill1:any=null
|
||||
skill2:any=null
|
||||
skill3:any=null
|
||||
equips:EquipsComp=null
|
||||
boxs:Node=null
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
onLoad() {
|
||||
this.on(GameEvent.UseSkillCard, this.get_skill, this);
|
||||
this.on(GameEvent.FightReady,this.fight_ready,this)
|
||||
this.boxs=this.node.getChildByName("boxs")
|
||||
this.equips=this.node.getComponent(EquipsComp)
|
||||
}
|
||||
start(){
|
||||
this.fight_ready()
|
||||
let equips=this.node.getComponent(EquipsComp)
|
||||
this.equips=this.node.getComponent(EquipsComp)
|
||||
}
|
||||
fight_ready(){
|
||||
this.boxs.getChildByName("skill1").getChildByName("icon").active=false
|
||||
@@ -63,52 +65,52 @@ export class EquipSkillComp extends CCComp {
|
||||
update(dt: number): void {
|
||||
if(!smc.mission.play||smc.mission.pause) return
|
||||
if(this.skill1.uuid!=0){
|
||||
if(this.skill1.cd_time>0){
|
||||
this.skill1.cd_time-=dt
|
||||
if(this.skill1.cd_time < (this.skill1.cd-this.equips.attrs.hero.SKILL_CD)){
|
||||
this.skill1.cd_time+=dt
|
||||
}else{
|
||||
this.skill1.cd_time=0
|
||||
if(this.skill1.type==1){
|
||||
this.do_skill1()
|
||||
}
|
||||
}
|
||||
this.boxs.getChildByName("skill1").getChildByName("icon").getChildByName("cd").getComponent(ProgressBar).progress=this.skill1.cd_time/this.skill1.cd
|
||||
this.boxs.getChildByName("skill1").getChildByName("icon").getChildByName("cd").getComponent(ProgressBar).progress=(1-this.skill1.cd_time/this.skill1.cd)
|
||||
}
|
||||
if(this.skill2.uuid!=0){
|
||||
if(this.skill2.cd_time>0){
|
||||
this.skill2.cd_time-=dt
|
||||
if(this.skill2.cd_time < (this.skill2.cd-this.equips.attrs.hero.SKILL_CD)){
|
||||
this.skill2.cd_time+=dt
|
||||
}else{
|
||||
this.skill2.cd_time=0
|
||||
if(this.skill2.type==1){
|
||||
this.do_skill2()
|
||||
}
|
||||
}
|
||||
this.boxs.getChildByName("skill2").getChildByName("icon").getChildByName("cd").getComponent(ProgressBar).progress=this.skill2.cd_time/this.skill2.cd
|
||||
this.boxs.getChildByName("skill2").getChildByName("icon").getChildByName("cd").getComponent(ProgressBar).progress=(1-this.skill2.cd_time/this.skill2.cd)
|
||||
}
|
||||
if(this.skill3.uuid!=0){
|
||||
if(this.skill3.cd_time>0){
|
||||
this.skill3.cd_time-=dt
|
||||
if(this.skill3.cd_time < (this.skill3.cd-this.equips.attrs.hero.SKILL_CD)){
|
||||
this.skill3.cd_time+=dt
|
||||
}else{
|
||||
this.skill3.cd_time=0
|
||||
if(this.skill3.type==1){
|
||||
this.do_skill3()
|
||||
}
|
||||
}
|
||||
this.boxs.getChildByName("skill3").getChildByName("icon").getChildByName("cd").getComponent(ProgressBar).progress=this.skill3.cd_time/this.skill3.cd
|
||||
this.boxs.getChildByName("skill3").getChildByName("icon").getChildByName("cd").getComponent(ProgressBar).progress=(1-this.skill3.cd_time/this.skill3.cd)
|
||||
}
|
||||
}
|
||||
do_skill1(){
|
||||
console.log("do_skill1")
|
||||
this.skill1.cd_time=this.skill1.cd
|
||||
this.skill1.cd_time=0
|
||||
this.do_skill(this.skill1.uuid)
|
||||
}
|
||||
do_skill2(){
|
||||
console.log("do_skill2")
|
||||
this.skill2.cd_time=this.skill2.cd
|
||||
this.skill2.cd_time=0
|
||||
this.do_skill(this.skill2.uuid)
|
||||
}
|
||||
do_skill3(){
|
||||
console.log("do_skill3")
|
||||
this.skill3.cd_time=this.skill3.cd
|
||||
this.skill3.cd_time=0
|
||||
this.do_skill(this.skill3.uuid)
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,8 @@ export class Skill extends ecs.Entity {
|
||||
uuid: number, // 技能ID
|
||||
targetPos: Vec3, // 目标位置
|
||||
caster:any=null, // 施法者
|
||||
angle:number=0
|
||||
angle:number=0,
|
||||
dmg:number=0
|
||||
) {
|
||||
let FIGHTCON=parent.getComponent(FightConComp);
|
||||
const config = SkillSet[uuid];
|
||||
@@ -42,10 +43,11 @@ export class Skill extends ecs.Entity {
|
||||
// 设置节点属性
|
||||
node.parent = parent;
|
||||
node.setPosition(startPos);
|
||||
node.angle+=angle
|
||||
// console.log("加载预制体:",startPos,targetPos)
|
||||
// 添加技能组件
|
||||
const skillComp = node.getComponent(SkillCom); // 初始化技能参数
|
||||
skillComp.ap = caster.ap;
|
||||
skillComp.ap = caster.ap+dmg;
|
||||
if(caster.fac==0){
|
||||
if(caster.is_master){
|
||||
skillComp.ap=Math.floor(skillComp.ap*(100+FIGHTCON.hero.ATK+FIGHTCON.ally.ATK)/100);
|
||||
|
||||
@@ -10,6 +10,7 @@ import { BoxSet } from "../common/config/BoxSet";
|
||||
import { HeroFac, HeroSet } from "../common/config/heroSet";
|
||||
import { HeroViewComp } from "../hero/HeroViewComp";
|
||||
import { BezierMove } from "../BezierMove/BezierMove";
|
||||
import { FightConComp } from "../map/FightConComp";
|
||||
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
@@ -41,10 +42,11 @@ export class SkillCom extends CCComp {
|
||||
distance_x:number=0;
|
||||
distance_y:number=0;
|
||||
ap:number=0;
|
||||
FIGHTCON:FightConComp=null;
|
||||
private moveDirection: Vec3 | null = null; // 添加一个属性来存储移动方向
|
||||
|
||||
protected onLoad(): void {
|
||||
|
||||
this.FIGHTCON=this.node.parent.getComponent(FightConComp)
|
||||
|
||||
}
|
||||
|
||||
@@ -115,6 +117,9 @@ export class SkillCom extends CCComp {
|
||||
if(oCol.group!=this.group){
|
||||
if(target == null) return;
|
||||
let remainingDamage = this.ap;
|
||||
if(target.fac == BoxSet.HERO ){
|
||||
remainingDamage=remainingDamage*(100-this.FIGHTCON.hero.DEF+this.FIGHTCON.hero_debuff.BURN)/100
|
||||
}
|
||||
target.do_atked(remainingDamage)
|
||||
this.ent.destroy()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user