feat(penetration): 将穿刺机制从固定次数改为概率触发模式
统一重命名所有穿刺相关属性为 `puncture_chance` 以规范代码命名,新增FightSet.PUNCTURE_DOWN配置项控制每次穿透后的概率衰减值。调整6408号穿刺强化技能,将提升穿刺次数效果改为提升20%穿透概率并修正AP消耗。在技能命中逻辑中添加穿透概率判定逻辑,实现概率穿透效果,同时更新所有引用原属性的代码位置确保功能正常。
This commit is contained in:
@@ -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 = {
|
||||
|
||||
@@ -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", // 风怒
|
||||
}
|
||||
|
||||
|
||||
@@ -338,8 +338,8 @@ export const SkillSet: Record<number, SkillConfig> = {
|
||||
},
|
||||
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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
// 命中次数按碰撞事件统计:不依赖是否最终造成伤害
|
||||
|
||||
|
||||
Reference in New Issue
Block a user