feat(card skill): add skill parameter override support
1. 新增卡牌技能参数覆写配置项,支持自定义伤害、buff数值等 2. 调整UI布局的上下边框参数,适配技能框显示 3. 完整打通技能覆写参数从配置到技能释放的全链路
This commit is contained in:
@@ -2692,8 +2692,8 @@
|
||||
"height": 81,
|
||||
"rawWidth": 185,
|
||||
"rawHeight": 81,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderTop": 40,
|
||||
"borderBottom": 35,
|
||||
"borderLeft": 92,
|
||||
"borderRight": 92,
|
||||
"packable": true,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,7 @@ import * as exp from "constants"
|
||||
import { HeroInfo, HeroList, HType } from "./heroSet"
|
||||
import { FightSet } from "./GameSet"
|
||||
import { oops } from "db://oops-framework/core/Oops"
|
||||
import { SkillOverrides } from "./SkillSet"
|
||||
|
||||
class I18nString {
|
||||
constructor(private key: string, private params?: any[]) { }
|
||||
@@ -62,6 +63,7 @@ export interface CardConfig {
|
||||
t_times?: number // 触发次数
|
||||
t_inv?: number // 触发间隔(秒)
|
||||
keep_waves?: number // 维持的波次数(-1表示持续到战斗结束,0或undefined表示仅本波次)
|
||||
overrides?: SkillOverrides // 技能参数覆写(如自定义伤害ap、buff值、金币数等)
|
||||
}
|
||||
export const CardsUpSet: Record<number, number> = {
|
||||
1: 50,
|
||||
|
||||
@@ -57,7 +57,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
|
||||
// 卡牌技能直接触发
|
||||
if (args.isCardSkill) {
|
||||
this.forceCastCardSkill(args.s_uuid, args.card_lv || 1, args.targetPos || new Vec3(FightSet.CSKILL_START_X, FightSet.CSKILL_START_Y, 0));
|
||||
this.forceCastCardSkill(args.s_uuid, args.card_lv || 1, args.targetPos || new Vec3(FightSet.CSKILL_START_X, FightSet.CSKILL_START_Y, 0), args.overrides);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -70,9 +70,10 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
* 强制执行卡牌技能
|
||||
* 卡牌技能没有施法者主体,直接从指定坐标释放,或者对全体/随机友方生效
|
||||
*/
|
||||
public forceCastCardSkill(s_uuid: number, cardLv: number, spawnPos: Vec3) {
|
||||
const config = SkillSet[s_uuid];
|
||||
public forceCastCardSkill(s_uuid: number, cardLv: number, spawnPos: Vec3, overrides?: SkillOverrides) {
|
||||
let config = SkillSet[s_uuid];
|
||||
if (!config) return;
|
||||
config = mergeSkillParams(config, overrides);
|
||||
|
||||
// 如果是敌方目标,没有战斗时不释放
|
||||
const isEnemyTarget = !this.isSelfSkill(config.TGroup) && !this.isFriendlySkill(config.TGroup);
|
||||
@@ -119,13 +120,13 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
this.applyFriendlySkillEffects(s_uuid, cardLv, config, null as any, mockAttrs, friendlyTargets, spawnPos);
|
||||
} else {
|
||||
const enemyTargetPos = this.resolveRepeatCastTargetPos(new Vec3(spawnPos.x + 300, spawnPos.y, spawnPos.z), i);
|
||||
this.createSkillEntityForCard(s_uuid, cardLv, mockAttrs, spawnPos, enemyTargetPos, i);
|
||||
this.createSkillEntityForCard(s_uuid, cardLv, mockAttrs, spawnPos, enemyTargetPos, i, overrides);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 专用于卡牌施放的技能实体生成 */
|
||||
private createSkillEntityForCard(s_uuid: number, skillLv: number, mockAttrs: HeroAttrsComp, startPos: Vec3, targetPos: Vec3 | null, castIndex: number = 0) {
|
||||
private createSkillEntityForCard(s_uuid: number, skillLv: number, mockAttrs: HeroAttrsComp, startPos: Vec3, targetPos: Vec3 | null, castIndex: number = 0, overrides?: SkillOverrides) {
|
||||
const scene = smc.map.MapView.scene;
|
||||
const parent = scene.entityLayer?.node?.getChildByName("SKILL");
|
||||
if (!parent || !targetPos) return;
|
||||
@@ -140,7 +141,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
box_group: BoxSet.HERO
|
||||
} as any;
|
||||
|
||||
skill.load(actualStartPos, parent, s_uuid, targetPos.clone(), mockView, mockAttrs, skillLv, 0);
|
||||
skill.load(actualStartPos, parent, s_uuid, targetPos.clone(), mockView, mockAttrs, skillLv, 0, overrides);
|
||||
}
|
||||
/** 空施法计划:用于“当前无可施法技能”时的统一返回 */
|
||||
private readonly emptyCastPlan = { skillId: 0, skillLv: 1, isFriendly: false, targetPos: null as Vec3 | null, targetEids: [] as number[], overrides: undefined as SkillOverrides | undefined };
|
||||
|
||||
@@ -30,7 +30,7 @@ import { _decorator, Node, Prefab, Sprite, Label, Vec3, resources, SpriteAtlas }
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { CardPoolList } from "../common/config/CardSet";
|
||||
import { SkillSet } from "../common/config/SkillSet";
|
||||
import { SkillSet, SkillOverrides } from "../common/config/SkillSet";
|
||||
import { oops } from "db://oops-framework/core/Oops";
|
||||
import { GameEvent } from "../common/config/GameEvent";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
@@ -70,6 +70,8 @@ export class SkillBoxComp extends CCComp {
|
||||
private trigger_interval: number = 0;
|
||||
/** 维持的波次数(-1表示直到战斗结束,0表示不跨波次,>0表示维持的具体波次数) */
|
||||
private keep_waves: number = 0;
|
||||
/** 技能覆写参数(自定义伤害、Buff等) */
|
||||
private overrides?: SkillOverrides;
|
||||
|
||||
// ======================== 运行时状态 ========================
|
||||
|
||||
@@ -125,6 +127,7 @@ export class SkillBoxComp extends CCComp {
|
||||
this.trigger_times = config.t_times ?? 1;
|
||||
this.trigger_interval = config.t_inv ?? 0;
|
||||
this.keep_waves = config.keep_waves ?? 0;
|
||||
this.overrides = config.overrides;
|
||||
}
|
||||
|
||||
this.current_trigger_times = 0;
|
||||
@@ -285,7 +288,8 @@ export class SkillBoxComp extends CCComp {
|
||||
s_uuid: this.s_uuid,
|
||||
isCardSkill: true, // 标记为卡牌技能(区别于英雄自身技能)
|
||||
card_lv: this.card_lv,
|
||||
targetPos: targetPos
|
||||
targetPos: targetPos,
|
||||
overrides: this.overrides
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user