refactor(game): 重构Buff系统并移除废弃代码
- 将Debuff枚举移至Attrs作为状态属性,统一Buff/Debuff处理逻辑 - 移除HeroViewComp中废弃的MP显示代码和三个设计文档文件 - 重构HeroAttrsComp的Buff系统,支持临时/永久增益、状态控制和属性修改 - 重构SkillSet配置,分离Buff定义为独立列表,简化技能配置 - 更新技能距离缓存逻辑,直接基于技能配置计算
This commit is contained in:
@@ -1,45 +0,0 @@
|
||||
Based on the analysis of `MissionCardComp.ts`, `MissionComp.ts`, `RogueConfig.ts`, and `heroSet.ts`, I have designed a balanced configuration plan for a 15-minute roguelike game loop.
|
||||
|
||||
The current configuration has some imbalances (e.g., Boss HP 25000 vs Hero AP 15, low card costs vs high drop rates). The plan aims to smooth out the difficulty curve and establish a sustainable economy.
|
||||
|
||||
### 1. Economy Rebalance (GameSet.ts)
|
||||
Adjust costs to prevent "infinite card spamming" while ensuring steady progression.
|
||||
* **Card Draw Cost (`CHOU_GOLD`)**: Increase from `5` to **100**.
|
||||
* **Level Up Cost (`LVUP_GOLD`)**: Increase from `10` to **50** (Base) + **50** (Increment).
|
||||
* **Goal**: Players need to kill ~10-15 enemies to afford one card/upgrade, making choices impactful.
|
||||
|
||||
### 2. Hero Configuration (heroSet.ts)
|
||||
Establish distinct roles and meaningful growth to keep up with monster scaling.
|
||||
* **Base Stats (`HeroInfo`)**:
|
||||
* **Warrior**: HP 300, AP 25, Def 5 (Tanky)
|
||||
* **Mage**: HP 150, AP 40, Range Mid (Glass Cannon)
|
||||
* **Archer**: HP 180, AP 30, AS 1.0 (DPS)
|
||||
* **Growth (`HeroUpSet`)**:
|
||||
* **HP**: +30 per level
|
||||
* **AP**: +5 per level
|
||||
* **Def**: +1 per level
|
||||
|
||||
### 3. Monster & Wave Configuration (RogueConfig.ts)
|
||||
Implement a dynamic difficulty curve that ramps up intensity over 15 minutes.
|
||||
* **Base Stats (`heroSet.ts`)**:
|
||||
* **Fodder (5201)**: HP 60, AP 8, Speed 100
|
||||
* **Fast (5301)**: HP 40, AP 12, Speed 180
|
||||
* **Tank (5401)**: HP 200, AP 15, Speed 60
|
||||
* **Boss (5701)**: HP 5000 (reduced from 25k to match new scaling), AP 60
|
||||
* **Scaling Logic (`RogueConfig.ts`)**:
|
||||
* **HP Growth**: Exponential (`1.15` per minute factor).
|
||||
* **Spawn Logic**:
|
||||
* **0-3 min**: Fodder swarm (accumulate gold).
|
||||
* **3-8 min**: Fast + Tank mix (test DPS and defense).
|
||||
* **8-14 min**: Elites + Special mechanics (high pressure).
|
||||
* **15 min**: Final Boss.
|
||||
* **Gold Drop**:
|
||||
* Formula: `Base (5) + Level * 1 + TypeBonus`.
|
||||
* Elite/Boss give significantly more to reward tough fights.
|
||||
|
||||
### 4. Implementation Steps
|
||||
1. **Modify `GameSet.ts`**: Update economy constants (`CHOU_GOLD`, `LVUP_GOLD`).
|
||||
2. **Modify `heroSet.ts`**: Update `HeroConf`, `HeroUpSet`, and `HeroInfo` with new base stats.
|
||||
3. **Modify `RogueConfig.ts`**: Update `DefaultRogueConfig` (budget/intervals), `getMonAttr` (scaling formulas), `calculateMonsterGold`, and `getSpawnWeights` (wave phases).
|
||||
|
||||
This plan ensures the 15-minute session has a clear "Early-Mid-Late" game progression with a challenging but fair economy.
|
||||
@@ -1,61 +0,0 @@
|
||||
## 目标
|
||||
|
||||
创建 `TDLevelOptions.ts`。
|
||||
调整数值:**保持 AP/HP\_MAX 强度不变,将其余所有属性的强度(Base & Grow)减半。**
|
||||
并在配置中明确标注“20级极限总加成”。
|
||||
|
||||
## 调整后的数值表 (Revised V2)
|
||||
|
||||
| 属性 | Base | Grow | Lv1单次 | Lv20单次 | **20级累计总加成** | 调整说明 |
|
||||
| :---------------- | :--- | :--- | :---- | :----- | :----------- | :-------------- |
|
||||
| **AP** (攻) | 15 | 1.5 | 16 | 45 | **+610** | 保持不变 |
|
||||
| **HP\_MAX** (血) | 100 | 10 | 110 | 300 | **+4100** | 保持不变 |
|
||||
| **AS** (速) | 5 | 0.25 | 5% | 10% | **+150%** | 减半 |
|
||||
| **DIS** (距) | 15 | 1.0 | 16 | 35 | **+510** | 减半 |
|
||||
| **PIERCE** (穿) | 1 | 0 | 1 | 1 | **+20** | 无法减半(最小1),需接受 |
|
||||
| **CRITICAL** (暴) | 2.5 | 0.1 | 2.6% | 4.5% | **+71%** | 减半 (需配合多次选择才满暴) |
|
||||
| **CRITICAL\_DMG** | 10 | 0.5 | 10% | 20% | **+300%** | 减半 |
|
||||
| **DEF** (防) | 2.5 | 0.25 | 2.7 | 7.5 | **+102** | 减半 |
|
||||
| **控制类** | 1.5 | 0.05 | 1.5% | 2.5% | **+40%** | 减半 (不再必定永控) |
|
||||
| **吸血** | 1 | 0.05 | 1% | 2% | **+30%** | 减半 |
|
||||
|
||||
*(注:PIERCE 因作为整数逻辑,维持 +1,但在随机池权重中可以不作特殊处理,作为稀有强力项自然存在)*
|
||||
|
||||
## 配置文件内容
|
||||
|
||||
路径:`assets/script/game/common/config/TDLevelOptions.ts`
|
||||
|
||||
```typescript
|
||||
import { Attrs } from "./HeroAttrs";
|
||||
|
||||
export interface IOptionGrowth {
|
||||
base: number;
|
||||
grow: number;
|
||||
desc: string; // 使用 {val} 占位
|
||||
totalNote: string; // 备注20级总加成
|
||||
}
|
||||
|
||||
export const TD_OPTION_CONFIG: Record<number, IOptionGrowth> = {
|
||||
[Attrs.AP]: { base: 15, grow: 1.5, desc: "攻击力 +{val}", totalNote: "+610" },
|
||||
[Attrs.HP_MAX]: { base: 100, grow: 10, desc: "生命上限 +{val}", totalNote: "+4100" },
|
||||
|
||||
// 减半组
|
||||
[Attrs.AS]: { base: 5, grow: 0.25, desc: "攻击速度 +{val}%", totalNote: "+150%" },
|
||||
[Attrs.DIS]: { base: 15, grow: 1.0, desc: "攻击距离 +{val}", totalNote: "+510" },
|
||||
[Attrs.CRITICAL]: { base: 2.5, grow: 0.1, desc: "暴击率 +{val}%", totalNote: "+71%" },
|
||||
[Attrs.CRITICAL_DMG]: { base: 10, grow: 0.5, desc: "暴击伤害 +{val}%", totalNote: "+300%" },
|
||||
[Attrs.DEF]: { base: 2.5, grow: 0.25, desc: "防御 +{val}", totalNote: "+102" },
|
||||
|
||||
// 控制与特效 (统一配置)
|
||||
[Attrs.STUN_CHANCE]: { base: 1.5, grow: 0.05, desc: "眩晕概率 +{val}%", totalNote: "+40%" },
|
||||
// ... 其他控制类同上
|
||||
[Attrs.PUNCTURE]: { base: 1, grow: 0, desc: "穿透 +{val}", totalNote: "+20" },
|
||||
};
|
||||
|
||||
// 辅助函数
|
||||
export const getLevelOptions = (level: number): any[] => { ... }
|
||||
```
|
||||
|
||||
## 执行
|
||||
|
||||
直接按此数值创建文件。无需再次确认。
|
||||
@@ -1,62 +0,0 @@
|
||||
## 目标
|
||||
- 新增一个“生效属性配置文件”,集中声明超休闲塔防要启用的属性键,供系统与 UI 快速判断哪些属性参与计算与展示。
|
||||
|
||||
## 文件位置
|
||||
- `assets/script/game/common/config/TDEnabledAttrs.ts`
|
||||
|
||||
## 内容结构
|
||||
- 引用 `HeroAttrs.ts` 的 `Attrs` 枚举。
|
||||
- 导出两类集合:
|
||||
- 核心启用集合 `TD_ENABLED_ATTRS`(ReadonlySet<Attrs>)
|
||||
- 轻度可选集合 `TD_OPTIONAL_ATTRS`(ReadonlySet<Attrs>)
|
||||
- 额外导出 `TD_ATTR_GROUPS`(用于 UI 分组展示,非必需)。
|
||||
|
||||
## 初始启用键(核心)
|
||||
- 塔/英雄输出:`AP`、`AS`、`DIS`、`PIERCE`
|
||||
- 爽点:`CRITICAL`、`CRITICAL_DMG`
|
||||
- 敌人生存:`HP_MAX`、`DEF`
|
||||
|
||||
## 轻度可选键(后续可开关)
|
||||
- 控制:`SLOW_CHANCE`(或改为 `STUN_CHANCE`)
|
||||
- 经济:`GOLD_GAIN`
|
||||
- 精英修正:`DMG_RED`
|
||||
|
||||
## 计划代码(示例)
|
||||
```ts
|
||||
// assets/script/game/common/config/TDEnabledAttrs.ts
|
||||
import { Attrs } from "./HeroAttrs";
|
||||
|
||||
export const TD_ENABLED_ATTRS: ReadonlySet<Attrs> = new Set<Attrs>([
|
||||
Attrs.AP,
|
||||
Attrs.AS,
|
||||
Attrs.DIS,
|
||||
Attrs.PUNCTURE,
|
||||
Attrs.CRITICAL,
|
||||
Attrs.CRITICAL_DMG,
|
||||
Attrs.HP_MAX,
|
||||
Attrs.DEF,
|
||||
]);
|
||||
|
||||
export const TD_OPTIONAL_ATTRS: ReadonlySet<Attrs> = new Set<Attrs>([
|
||||
Attrs.SLOW_CHANCE,
|
||||
Attrs.GOLD_GAIN,
|
||||
Attrs.DMG_RED,
|
||||
]);
|
||||
|
||||
export const TD_ATTR_GROUPS = {
|
||||
towerCore: [Attrs.AP, Attrs.AS, Attrs.DIS, Attrs.PUNCTURE],
|
||||
towerBonus: [Attrs.CRITICAL, Attrs.CRITICAL_DMG],
|
||||
enemyCore: [Attrs.HP_MAX, Attrs.DEF],
|
||||
optional: [Attrs.SLOW_CHANCE, Attrs.GOLD_GAIN, Attrs.DMG_RED],
|
||||
} as const;
|
||||
```
|
||||
|
||||
## 接入点(不改动逻辑,只引用)
|
||||
- 计算系统:在重算或结算处通过 `TD_ENABLED_ATTRS.has(attr)` 判断展示/参与计算(不改变已有正确计算路径,只做筛选)。
|
||||
- UI:面板按 `TD_ATTR_GROUPS` 渲染;未启用键默认隐藏。
|
||||
|
||||
## 验证
|
||||
- 在测试环境加载 1 个塔与 2 类敌人,确认仅启用键被展示和参与战斗,TTK/DPS 表现符合预期。
|
||||
|
||||
## 等待下一步
|
||||
- 若确认上述文件结构与键集合,开始创建文件并接入引用;如需改用 `AREA_OF_EFFECT` 替代 `PIERCE` 或改为 `STUN_CHANCE`,我会在提交前同步调整。
|
||||
Reference in New Issue
Block a user