buff 重设 英雄和伙伴 改为公用debuff

This commit is contained in:
2025-06-13 16:42:01 +08:00
parent 8ea55fd99e
commit d01b98f9c3
6 changed files with 60 additions and 35 deletions

View File

@@ -63,21 +63,19 @@ export enum DebuffAttr {
DECD = 5, //减cd DECD = 5, //减cd
DEHP = 6, //减hp DEHP = 6, //减hp
DEATK = 7, //减atk DEATK = 7, //减atk
DEDEF = 8, //减def DECOUNT = 8, //减攻击次数
DECOUNT = 9, //减攻击次数
} }
export const geDebuffNum=()=>{ export const geDebuffNum=()=>{
return { return {
STUN:0, STUN:0, //眩晕
SLOW:0, SLOW:0, //减速
FROST:0, FROST:0, //冰冻
BURN:0, BURN:0, //易伤
DECD:0, DECD:0, //减cd
DEHP:0, DEHP:0, //减hp
DEATK:0, DEATK:0, //减atk
DEDEF:0, DECOUNT:0, //减攻击次数
DECOUNT:0,
} }
} }

View File

@@ -67,28 +67,28 @@ export class SkillConComp extends CCComp {
if(!this.HeroView.is_master) return if(!this.HeroView.is_master) return
console.log("hart cast_skill",uuid ,e) console.log("hart cast_skill",uuid ,e)
const config = SkillSet[uuid]; 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); // console.log(view.uuid+"=>"+view.hero_name+"施放技能:"+config.uuid);
if (config.TargetGroup === TargetGroup.Enemy) { if (config.TargetGroup === TargetGroup.Enemy) {
this.HeroView.playSkillEffect(config.uuid); this.HeroView.playSkillEffect(config.uuid);
this.doSkill(config,count); this.doSkill(config,count,dmg);
} }
if (config.TargetGroup === TargetGroup.Ally) { if (config.TargetGroup === TargetGroup.Ally) {
const targets = this.selectAllyTargets( config); const targets = this.selectAllyTargets( config);
if (targets.length === 0) return; if (targets.length === 0) return;
this.doSkill(config,count); this.doSkill(config,count,dmg);
} }
if (config.TargetGroup === TargetGroup.Self) { 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) { if (!this.node || !this.node.isValid || !this.HeroView || !this.HeroView.node || !this.HeroView.node.isValid) {
return; return;
@@ -116,7 +116,8 @@ export class SkillConComp extends CCComp {
config.uuid, config.uuid,
new Vec3(targetView.node.position.x, targetView.node.position.y, 0), new Vec3(targetView.node.position.x, targetView.node.position.y, 0),
this.HeroView, this.HeroView,
angle angle,
dmg
); );
}, 300); }, 300);
count-=1 count-=1

View File

@@ -17,16 +17,18 @@ export class EquipSkillComp extends CCComp {
skill1:any=null skill1:any=null
skill2:any=null skill2:any=null
skill3:any=null skill3:any=null
equips:EquipsComp=null
boxs:Node=null boxs:Node=null
/** 视图层逻辑代码分离演示 */ /** 视图层逻辑代码分离演示 */
onLoad() { onLoad() {
this.on(GameEvent.UseSkillCard, this.get_skill, this); this.on(GameEvent.UseSkillCard, this.get_skill, this);
this.on(GameEvent.FightReady,this.fight_ready,this) this.on(GameEvent.FightReady,this.fight_ready,this)
this.boxs=this.node.getChildByName("boxs") this.boxs=this.node.getChildByName("boxs")
this.equips=this.node.getComponent(EquipsComp)
} }
start(){ start(){
this.fight_ready() this.fight_ready()
let equips=this.node.getComponent(EquipsComp) this.equips=this.node.getComponent(EquipsComp)
} }
fight_ready(){ fight_ready(){
this.boxs.getChildByName("skill1").getChildByName("icon").active=false this.boxs.getChildByName("skill1").getChildByName("icon").active=false
@@ -63,52 +65,52 @@ export class EquipSkillComp extends CCComp {
update(dt: number): void { update(dt: number): void {
if(!smc.mission.play||smc.mission.pause) return if(!smc.mission.play||smc.mission.pause) return
if(this.skill1.uuid!=0){ if(this.skill1.uuid!=0){
if(this.skill1.cd_time>0){ if(this.skill1.cd_time < (this.skill1.cd-this.equips.attrs.hero.SKILL_CD)){
this.skill1.cd_time-=dt this.skill1.cd_time+=dt
}else{ }else{
this.skill1.cd_time=0 this.skill1.cd_time=0
if(this.skill1.type==1){ if(this.skill1.type==1){
this.do_skill1() 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.uuid!=0){
if(this.skill2.cd_time>0){ if(this.skill2.cd_time < (this.skill2.cd-this.equips.attrs.hero.SKILL_CD)){
this.skill2.cd_time-=dt this.skill2.cd_time+=dt
}else{ }else{
this.skill2.cd_time=0 this.skill2.cd_time=0
if(this.skill2.type==1){ if(this.skill2.type==1){
this.do_skill2() 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.uuid!=0){
if(this.skill3.cd_time>0){ if(this.skill3.cd_time < (this.skill3.cd-this.equips.attrs.hero.SKILL_CD)){
this.skill3.cd_time-=dt this.skill3.cd_time+=dt
}else{ }else{
this.skill3.cd_time=0 this.skill3.cd_time=0
if(this.skill3.type==1){ if(this.skill3.type==1){
this.do_skill3() 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(){ do_skill1(){
console.log("do_skill1") console.log("do_skill1")
this.skill1.cd_time=this.skill1.cd this.skill1.cd_time=0
this.do_skill(this.skill1.uuid) this.do_skill(this.skill1.uuid)
} }
do_skill2(){ do_skill2(){
console.log("do_skill2") console.log("do_skill2")
this.skill2.cd_time=this.skill2.cd this.skill2.cd_time=0
this.do_skill(this.skill2.uuid) this.do_skill(this.skill2.uuid)
} }
do_skill3(){ do_skill3(){
console.log("do_skill3") console.log("do_skill3")
this.skill3.cd_time=this.skill3.cd this.skill3.cd_time=0
this.do_skill(this.skill3.uuid) this.do_skill(this.skill3.uuid)
} }

View File

@@ -28,7 +28,8 @@ export class Skill extends ecs.Entity {
uuid: number, // 技能ID uuid: number, // 技能ID
targetPos: Vec3, // 目标位置 targetPos: Vec3, // 目标位置
caster:any=null, // 施法者 caster:any=null, // 施法者
angle:number=0 angle:number=0,
dmg:number=0
) { ) {
let FIGHTCON=parent.getComponent(FightConComp); let FIGHTCON=parent.getComponent(FightConComp);
const config = SkillSet[uuid]; const config = SkillSet[uuid];
@@ -42,10 +43,11 @@ export class Skill extends ecs.Entity {
// 设置节点属性 // 设置节点属性
node.parent = parent; node.parent = parent;
node.setPosition(startPos); node.setPosition(startPos);
node.angle+=angle
// console.log("加载预制体:",startPos,targetPos) // console.log("加载预制体:",startPos,targetPos)
// 添加技能组件 // 添加技能组件
const skillComp = node.getComponent(SkillCom); // 初始化技能参数 const skillComp = node.getComponent(SkillCom); // 初始化技能参数
skillComp.ap = caster.ap; skillComp.ap = caster.ap+dmg;
if(caster.fac==0){ if(caster.fac==0){
if(caster.is_master){ if(caster.is_master){
skillComp.ap=Math.floor(skillComp.ap*(100+FIGHTCON.hero.ATK+FIGHTCON.ally.ATK)/100); skillComp.ap=Math.floor(skillComp.ap*(100+FIGHTCON.hero.ATK+FIGHTCON.ally.ATK)/100);

View File

@@ -10,6 +10,7 @@ import { BoxSet } from "../common/config/BoxSet";
import { HeroFac, HeroSet } from "../common/config/heroSet"; import { HeroFac, HeroSet } from "../common/config/heroSet";
import { HeroViewComp } from "../hero/HeroViewComp"; import { HeroViewComp } from "../hero/HeroViewComp";
import { BezierMove } from "../BezierMove/BezierMove"; import { BezierMove } from "../BezierMove/BezierMove";
import { FightConComp } from "../map/FightConComp";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
@@ -41,10 +42,11 @@ export class SkillCom extends CCComp {
distance_x:number=0; distance_x:number=0;
distance_y:number=0; distance_y:number=0;
ap:number=0; ap:number=0;
FIGHTCON:FightConComp=null;
private moveDirection: Vec3 | null = null; // 添加一个属性来存储移动方向 private moveDirection: Vec3 | null = null; // 添加一个属性来存储移动方向
protected onLoad(): void { 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(oCol.group!=this.group){
if(target == null) return; if(target == null) return;
let remainingDamage = this.ap; 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) target.do_atked(remainingDamage)
this.ent.destroy() this.ent.destroy()
} }

View File

@@ -2,4 +2,21 @@
- [ ] 技能 ,伙伴,装备的出现波次 - [ ] 技能 ,伙伴,装备的出现波次
- [x] cards 展示逻辑修改,修改为 cards载入后再通知card更新特定卡牌 - [x] cards 展示逻辑修改,修改为 cards载入后再通知card更新特定卡牌
- [x] cards 通过队列进行展示,新展示要求,先加入队列 - [x] cards 通过队列进行展示,新展示要求,先加入队列
- [x] cards 添加放弃操作, 特定选择不能放弃 - [x] cards 添加放弃操作, 特定选择不能放弃
- [x] 攻击加80%
- [x] 攻击速度加20%
- [x] 技能速度加20%
- [x] 技能伤害加10%
- [ ] 卡牌效果加10%
- [x] 攻击次数+1
- [ ] HP加100%
- [ ] 免伤50%
- [ ] 普通攻击改为飓风攻击带击退(被动)
- [ ] 普通攻击改为寒冰攻击带冰冻(被动)
- [ ] 普通攻击改为火焰攻击带易伤(被动)
- [ ] 伙伴复活时间减少%(被动)
- [ ] 每攻击n次 加伙伴hp
- [ ] 每攻击n次 加伙伴ap
- [ ] 每攻击n次后 增加1金币
- [ ] 每攻击n次减少下次一次伙伴复活时间