diff --git a/assets/script/game/common/config/GameSet.ts b/assets/script/game/common/config/GameSet.ts index be1e74da..7960415d 100644 --- a/assets/script/game/common/config/GameSet.ts +++ b/assets/script/game/common/config/GameSet.ts @@ -35,6 +35,7 @@ export enum FightSet { CSKILL_START_Y=30, SHIELD_MAX=5, WAVE_HEAL_RATE=0.5, // 回合结束时所有英雄恢复最大生命值的比例 + PUNCTURE_DOWN=50, } export const laneIdx = { diff --git a/assets/script/game/common/config/HeroAttrs.ts b/assets/script/game/common/config/HeroAttrs.ts index 5c5e25c8..80c6e605 100644 --- a/assets/script/game/common/config/HeroAttrs.ts +++ b/assets/script/game/common/config/HeroAttrs.ts @@ -33,7 +33,7 @@ export enum Attrs { knockback_distance = "knockback_distance", // 击退距离强化 knockback_res = "knockback_res", // 击退抗性 invincible_time = "invincible_time",// 无敌时间 - puncture = "puncture", // 穿刺次数 + puncture_chance = "puncture_chance", // 穿透概率 wfuny = "wfuny", // 风怒 } diff --git a/assets/script/game/common/config/SkillSet.ts b/assets/script/game/common/config/SkillSet.ts index add3a587..f645ede2 100644 --- a/assets/script/game/common/config/SkillSet.ts +++ b/assets/script/game/common/config/SkillSet.ts @@ -338,8 +338,8 @@ export const SkillSet: Record = { }, 6408:{ uuid:6408,name:"穿刺强化",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_ap",endAnm:"",act:"atk", - DTType:DTType.single,kind:SkillKind.Support,ap:1,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support, - RType:RType.fixed,EType:EType.animationEnd,buff_type:Attrs.puncture,info:"全体友方穿透次数提升1次,持续1次", + DTType:DTType.single,kind:SkillKind.Support,ap:20,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support, + RType:RType.fixed,EType:EType.animationEnd,buff_type:Attrs.puncture_chance,info:"全体友方穿透概率提升20%,持续1次", }, 6409:{ uuid:6409,name:"风怒强化",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_ap",endAnm:"",act:"atk", diff --git a/assets/script/game/hero/HeroAttrsComp.ts b/assets/script/game/hero/HeroAttrsComp.ts index 6ad8f285..d1b48aab 100644 --- a/assets/script/game/hero/HeroAttrsComp.ts +++ b/assets/script/game/hero/HeroAttrsComp.ts @@ -51,7 +51,7 @@ export class HeroAttrsComp extends ecs.Comp { knockback_distance: number = 0; // 击退距离强化 knockback_res: number = 0; // 击退抗性 crit_damage: number = 0; // 额外暴击伤害 - puncture: number = 0; // 穿刺次数 + puncture_chance: number = 0; // 穿透概率 wfuny: number = 0; // 风怒 revived_count: number = 0; // 已复活次数 @@ -243,6 +243,11 @@ export class HeroAttrsComp extends ecs.Comp { return this.freeze_chance + this.getFieldPercentValue(FieldSkillType.HeroFrost); } + /** 英雄实时穿透概率 = 基础穿透概率。 */ + public getRuntimePunctureChance(): number { + return this.puncture_chance; + } + /** 英雄实时暴击伤害 = 基础额外暴伤 + 驻场暴伤。 */ public getRuntimeCritDamageBonus(): number { if (this.fac !== FacSet.HERO) return this.crit_damage; @@ -330,7 +335,7 @@ export class HeroAttrsComp extends ecs.Comp { this.crit_damage = 0; this.revived_count = 0; this.invincible_time = 0; - this.puncture = 0; + this.puncture_chance = 0; this.wfuny = 0; this.boom = false; diff --git a/assets/script/game/hero/SCastSystem.ts b/assets/script/game/hero/SCastSystem.ts index d3ccac10..41391d77 100644 --- a/assets/script/game/hero/SCastSystem.ts +++ b/assets/script/game/hero/SCastSystem.ts @@ -108,7 +108,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate mockAttrs.ap = highestAp; mockAttrs.critical = 0; mockAttrs.freeze_chance = 0; - mockAttrs.puncture = 0; + mockAttrs.puncture_chance = 0; mockAttrs.fac = FacSet.HERO; for (let i = 0; i < castTimes; i++) { diff --git a/assets/script/game/skill/Skill.ts b/assets/script/game/skill/Skill.ts index e692ae75..84e87950 100644 --- a/assets/script/game/skill/Skill.ts +++ b/assets/script/game/skill/Skill.ts @@ -212,13 +212,14 @@ export class Skill extends ecs.Entity { const sCrt = (config.crt ?? 0)+(SUp.crt*skill_lv); const sFrz = (config.frz ?? 0)+(SUp.frz*skill_lv); const sAp =config.ap+(SUp.ap*skill_lv); - const sHit=config.hit_count+(SUp.hit_count*skill_lv) + cAttrsComp.puncture + const sHit=config.hit_count+(SUp.hit_count*skill_lv); sDataCom.Attrs[Attrs.ap] = Math.floor(cAttrsComp.ap*sAp/100); //技能的ap是百分值 需要/100 而且需要再最终计算总ap时再/100,不然会出现ap为90%变0 sDataCom.Attrs[Attrs.critical] = cAttrsComp.getRuntimeCritical() + sCrt; sDataCom.Attrs[Attrs.critical_damage] = cAttrsComp.getRuntimeCritDamageBonus(); sDataCom.Attrs[Attrs.freeze_chance] = cAttrsComp.getRuntimeFreezeChance() + sFrz; sDataCom.Attrs[Attrs.knockback_chance] = cAttrsComp.knockback_chance || 0; sDataCom.Attrs[Attrs.knockback_distance] = cAttrsComp.knockback_distance || 0; + sDataCom.Attrs[Attrs.puncture_chance] = cAttrsComp.getRuntimePunctureChance(); // 初始化携带施法者的穿透概率 sDataCom.s_uuid=s_uuid sDataCom.skill_lv = Math.max(0, skill_lv); sDataCom.fac=cAttrsComp.fac diff --git a/assets/script/game/skill/SkillView.ts b/assets/script/game/skill/SkillView.ts index a3a9ed3d..67bd00b4 100644 --- a/assets/script/game/skill/SkillView.ts +++ b/assets/script/game/skill/SkillView.ts @@ -2,11 +2,13 @@ import { _decorator, Animation, CCInteger, Collider2D, Contact2DType, UITransfor import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp"; import { HeroViewComp } from "../hero/HeroViewComp"; -import { EType, SkillConfig, SkillSet } from "../common/config/SkillSet"; +import { DTType, EType, SkillConfig, SkillSet } from "../common/config/SkillSet"; import { SDataCom } from "./SDataCom"; import { HeroAttrsComp } from "../hero/HeroAttrsComp"; import { DamageQueueHelper } from "../hero/DamageQueueComp"; import { mLogger } from "../common/Logger"; +import { FightSet } from "../common/config/GameSet"; +import { Attrs } from "../common/config/HeroAttrs"; const { ccclass, property } = _decorator; @@ -86,7 +88,30 @@ export class SkillView extends CCComp { } this.sData.hit_count++; if (this.sData.hit_count >= this.sData.max_hit_count) { - this.handle_collision_limit(); + // == 新增:穿透概率判定 == + // 仅对单体伤害技能生效(DTType.single)且存在穿透概率 + if (this.SConf.DTType === DTType.single) { + const punctureChance = this.sData.Attrs[Attrs.puncture_chance] || 0; + if (punctureChance > 0) { + const rand = Math.random() * 100; + if (rand < punctureChance) { + // 触发穿透:不销毁,增加 max_hit_count 允许继续穿透 + this.sData.max_hit_count++; + // 概率衰减(减去固定的 PUNCTURE_DOWN 值,比如 50) + this.sData.Attrs[Attrs.puncture_chance] = Math.max(0, punctureChance - FightSet.PUNCTURE_DOWN); + if (this.debugMode) { + mLogger.log(this.debugMode, 'SkillView', `[SkillView] 触发穿透!剩余概率: ${this.sData.Attrs[Attrs.puncture_chance]}%`); + } + } else { + // 未触发穿透,正常销毁 + this.handle_collision_limit(); + } + } else { + this.handle_collision_limit(); + } + } else { + this.handle_collision_limit(); + } } // 命中次数按碰撞事件统计:不依赖是否最终造成伤害