技能选择 需要确定是技能1 23 中的哪个

This commit is contained in:
2025-06-26 16:44:22 +08:00
parent d31c495a54
commit b00cc9536f
5 changed files with 3531 additions and 2608 deletions

View File

@@ -51,8 +51,8 @@ export class MissionComp extends CCComp {
smc.vmdata.mission_data.current_wave++
let wave=smc.vmdata.mission_data.current_wave
if(wave==FightSet.FRIEND_WAVE_UP){
console.log("[任务系统] FRIEND_WAVE_UP 英雄选择 :",wave,FightSet.FRIEND_WAVE_UP)
this.to_call_friend()
let node= this.node.getChildByName("new_hero")
tween(node).to(0.3, {position:v3(node.position.x-200,node.position.y,1)}).start()
}
if(wave==FightSet.BOSS_WAVE_UP_1){
console.log("[任务系统] BOSS_WAVE_UP_1 装备选择 :",wave,FightSet.BOSS_WAVE_UP_1)
@@ -74,15 +74,15 @@ export class MissionComp extends CCComp {
}
if(wave==FightSet.SKILL_WAVE_UP_1){
console.log("[任务系统] SKILL_WAVE_UP_1 技能选择 :",wave,FightSet.SKILL_WAVE_UP_1)
oops.message.dispatchEvent(GameEvent.HeroSkillSelect)
this.show_skill_get("skill1")
}
if(wave==FightSet.SKILL_WAVE_UP_2){
console.log("[任务系统] SKILL_WAVE_UP_2 技能选择 :",wave,FightSet.SKILL_WAVE_UP_2)
oops.message.dispatchEvent(GameEvent.HeroSkillSelect)
this.show_skill_get("skill2")
}
if(wave==FightSet.SKILL_WAVE_UP_3){
console.log("[任务系统] SKILL_WAVE_UP_3 技能选择 :",wave,FightSet.SKILL_WAVE_UP_3)
oops.message.dispatchEvent(GameEvent.HeroSkillSelect)
this.show_skill_get("skill3")
}
}
@@ -119,6 +119,22 @@ export class MissionComp extends CCComp {
oops.message.dispatchEvent(GameEvent.FightEnd)
}
private show_skill_get(e:string){
this.node.getChildByName("equips").getChildByName("boxs").getChildByName(e).getChildByName("get").active =true
}
private hide_skill_get(e:any,data:string){
this.node.getChildByName("equips").getChildByName("boxs").getChildByName(data).getChildByName("get").active =false
}
private show_skill_change(e:string){
this.node.getChildByName("equips").getChildByName("boxs").getChildByName(e).getChildByName("change").active =true
}
private hide_skill_change(e:any,data:any){
this.node.getChildByName("equips").getChildByName("boxs").getChildByName(data).getChildByName("change").active =false
}
fight_end(){
console.log("任务结束")
// 延迟0.5秒后执行任务结束逻辑
@@ -184,10 +200,16 @@ export class MissionComp extends CCComp {
mission_data.gold-=(mission_data.refresh_gold+mission_data.buff_refresh_gold)
}
call_skill_card(e:any){
oops.message.dispatchEvent(GameEvent.HeroSkillSelect)
}
private cleanComponents() {
ecs.query(ecs.allOf(HeroViewComp)).forEach(entity => {entity.remove(HeroViewComp);entity.destroy()});
}
hide_call_friend(){
let node =this.node.getChildByName("new_hero")
tween(node).to(0.3, {position:v3(node.position.x+200,node.position.y,1)}).start()
}
/** 视图层逻辑代码分离演示 */
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */

View File

@@ -59,7 +59,7 @@ export class Skill extends ecs.Entity {
node.parent = parent;
node.setPosition(startPos);
node.angle+=angle
console.log("[Skill]:node=>",startPos)
// console.log("[Skill]:node=>",startPos)
// 添加技能组件
const SComp = node.getComponent(SkillCom); // 初始化技能参数
if (!SComp) {
@@ -85,7 +85,7 @@ export class Skill extends ecs.Entity {
SComp.caster_crit = ap_data.crit
SComp.caster_crit_d = ap_data.crit_d
console.log("[Skill]:caster=>",caster,config.name+"scomp=>",SComp,"fightcon=>",FIGHTCON)
// console.log("[Skill]:caster=>",caster,config.name+"scomp=>",SComp,"fightcon=>",FIGHTCON)
// 设置技能组件属性
Object.assign(SComp, {
s_uuid: uuid,
@@ -114,10 +114,10 @@ export class Skill extends ecs.Entity {
if(view.is_friend) buff=FIGHTCON.friend_buff
if(view.is_boss) buff=FIGHTCON.enemy_buff
if(view.is_kalami) buff=FIGHTCON.enemy_buff
if(!buff==null) {
if(buff!==null) {
buff_ap=(100+buff.ATK)/100 //装备区 总加成
}
// console.log("[skill] buff ",buff,"buff_ap",buff_ap)
// 汇总DEBUFF_DECD并处理count值
let BUFF_ATK = 0
let DEBUFF_DEATK = 0
@@ -143,9 +143,10 @@ export class Skill extends ecs.Entity {
let BUFF_AP=(100-DEBUFF_DEATK+BUFF_ATK+dmg)/100 //buff区 总加成
ap=view.ap*buff_ap*BUFF_AP*SkillSet[uuid].ap/100
// console.log("[Skill] skill ap:"+view.hero_name+"=>"+ap+" "+buff_ap+" "+BUFF_AP)
crit=view.crit+buff.CRITICAL
crit_d=view.crit_d+buff.CRITICAL_DMG
console.log("[Skill]:ap=>",ap,"crit=>",crit,"crit_d=>",crit_d)
// console.log("[Skill]:ap=>",ap,"crit=>",crit,"crit_d=>",crit_d)
return {ap,crit,crit_d}
}
}