新增天巫种对敌方空投袭击的自动拦截功能: - GameComponent_DropPodInterceptor: 全局拦截状态管理与核心逻辑 - Harmony Prefix 挂钩 EdgeDrop/CenterDrop Arrive(),拦截 1-3 个运输仓 - 被拦截 Pawn 击杀(Bite)后尸体以空投仓形式落地 - 拦截时生成天巫种 FlyOver 视觉飞越 + PositiveEvent 信件通知 - 引航种新增 ARA_ToggleDropPodIntercept 自释放能力切换开关 - 前置检查:开关启用 + 天巫升空 + 敌对派系,至少保留 1 名袭击者 新增文件: - Source/.../GameComponent_DropPodInterceptor.cs - Source/.../Patch_DropPodIntercept.cs - Source/.../CompAbilityEffect_ToggleDropPodIntercept.cs - Defs/AbilityDefs/Ability_DropPodIntercept.xml 修改文件: - ARA_PawnKinds.xml (Skyraider abilities) - AirStrike_Keys.xml (10 localization keys) - ArachnaeSwarm.csproj (3 Compile entries)
113 lines
5.3 KiB
Markdown
113 lines
5.3 KiB
Markdown
# 落地交付文档:天巫集群掠食 - 空投拦截系统
|
||
|
||
## 1. 目标与结论
|
||
- 目标:实现“敌方空投袭击可被天巫种拦截”的完整闭环(开关控制、拦截逻辑、视觉反馈、通知、持久化)。
|
||
- 结论:核心功能已完成并通过编译,已具备交由 planer 进行方案审阅与验收测试的条件。
|
||
|
||
## 2. 实现范围(按 plan.md 对齐)
|
||
|
||
### 2.1 GameComponent 全局状态与拦截逻辑
|
||
- 新增文件:`Source/ArachnaeSwarm/Flyover/GameComponent_DropPodInterceptor.cs`
|
||
- 已实现:
|
||
- `bool interceptEnabled` 持久化(`ExposeData` + `Scribe_Values.Look`)。
|
||
- `ToggleIntercept()` 开关切换与日志。
|
||
- `HasAirborneTianwu()` 检查 `WorldComponent_AircraftManager.GetAvailableAircraftCount(...) > 0`。
|
||
- `TryInterceptDropPods(...)`:
|
||
- 前置检查:开关、敌对派系、可用天巫、至少保留 1 名袭击者。
|
||
- 随机拦截 1-3 名(上限由 `pawns.Count - 1` 约束)。
|
||
- 拦截对象执行 `Pawn.Kill(DamageInfo)`,收集 `Corpse`。
|
||
- 用 `DropPodUtility.DropThingsNear(...)` 以空投仓形式落尸。
|
||
- 触发 FlyOver(复用 `ARA_HiveCorvette_Fake`)与信件通知。
|
||
|
||
### 2.2 Harmony 补丁
|
||
- 新增文件:`Source/ArachnaeSwarm/HarmonyPatches/Patch_DropPodIntercept.cs`
|
||
- 已实现:
|
||
- Prefix 挂钩:
|
||
- `PawnsArrivalModeWorker_EdgeDrop.Arrive`
|
||
- `PawnsArrivalModeWorker_CenterDrop.Arrive`
|
||
- 两个入口共用 `InterceptPrefix(...)`。
|
||
- **不跳过原方法**(`return true`),原方法继续处理剩余 `pawns`。
|
||
|
||
### 2.3 引航种能力(开关)
|
||
- 新增文件:`Source/ArachnaeSwarm/Abilities/CompAbilityEffect_ToggleDropPodIntercept.cs`
|
||
- 已实现:
|
||
- `CompProperties_ToggleDropPodIntercept`
|
||
- `CompAbilityEffect_ToggleDropPodIntercept`
|
||
- `Apply`:切换全局开关 + 消息提示。
|
||
- `Valid`:无可用天巫时拒绝施放并提示。
|
||
- `ExtraLabelMouseAttachment`:显示“开启/关闭”状态文本。
|
||
|
||
### 2.4 Ability Def
|
||
- 新增文件:`1.6/1.6/Defs/AbilityDefs/Ability_DropPodIntercept.xml`
|
||
- 已实现:
|
||
- 新能力 `ARA_ToggleDropPodIntercept`
|
||
- 自施放、`targetRequired=false`、`targetable=false`、无冷却切换。
|
||
|
||
### 2.5 挂载到 Skyraider
|
||
- 修改文件:`1.6/1.6/Defs/PawnKindDef/ARA_PawnKinds.xml`
|
||
- 已实现:
|
||
- 在 `ArachnaeNode_Race_Skyraider` 的 `abilities` 中追加:`ARA_ToggleDropPodIntercept`
|
||
|
||
### 2.6 本地化
|
||
- 修改文件:`1.6/1.6/Languages/ChineseSimplified (简体中文)/Keyed/AirStrike_Keys.xml`
|
||
- 已实现 key:
|
||
- `ARA_ToggleDropPodIntercept_Label`
|
||
- `ARA_ToggleDropPodIntercept_Desc`
|
||
- `ARA_InterceptDropPod_Enabled`
|
||
- `ARA_InterceptDropPod_Disabled`
|
||
- `ARA_InterceptDropPod_NoAircraft`
|
||
- `ARA_InterceptDropPod_Status`
|
||
- `ARA_InterceptDropPod_StatusOn`
|
||
- `ARA_InterceptDropPod_StatusOff`
|
||
- `ARA_InterceptDropPod_LetterLabel`
|
||
- `ARA_InterceptDropPod_LetterText`
|
||
|
||
### 2.7 工程文件同步
|
||
- 修改文件:`Source/ArachnaeSwarm/ArachnaeSwarm.csproj`
|
||
- 已实现:新增 3 个 C# 文件的 `<Compile Include="..." />`。
|
||
|
||
## 3. 与 plan.md 的差异说明(供 planer 决策)
|
||
- FlyOver Def:按 plan 的“优先复用”策略,当前复用 `ARA_HiveCorvette_Fake`,**未新增** `ARA_HiveCorvette_Intercept` ThingDef。
|
||
- `CompAbilityEffect_ToggleDropPodIntercept.Valid` 使用单目标签名(与现项目其他 Ability 风格一致),未采用数组签名版本。
|
||
- 能力 label/description 当前写在 AbilityDef 内,key 已补全;若需严格 DefInjected 化,可由 planer 决定是否二次整理。
|
||
|
||
## 4. 构建与验证
|
||
- 构建命令(已执行):
|
||
- `MSBuild ArachnaeSwarm.csproj -p:Configuration=Release -verbosity:minimal`
|
||
- 结果:通过。
|
||
- 输出:
|
||
- `1.6/1.6/Assemblies/ArachnaeSwarm.dll`
|
||
- `1.6/1.6/Assemblies/ArachnaeSwarm.pdb`
|
||
|
||
## 5. 建议的审阅清单(给 planer)
|
||
- 逻辑正确性:
|
||
- 是否接受“至少保留 1 名袭击者”的平衡策略。
|
||
- 是否接受“仅敌对派系 + EdgeDrop/CenterDrop 生效”的作用域。
|
||
- 体验反馈:
|
||
- FlyOver 速度、出现时机、信件文案是否符合预期。
|
||
- 兼容性:
|
||
- 与其他修改袭击到场逻辑的 Harmony 补丁是否可能冲突。
|
||
- 本地化策略:
|
||
- 是否要求将 AbilityDef `label/description` 进一步改为 DefInjected。
|
||
|
||
## 6. 建议测试用例(未在本轮自动化执行)
|
||
- Dev 触发 `Raid (EdgeDrop)`:验证拦截 1-3,尸体空投、FlyOver、信件。
|
||
- Dev 触发 `Raid (CenterDrop)`:同上。
|
||
- 关闭拦截后再触发空投:验证不拦截。
|
||
- 触发 `EdgeWalkIn`:验证不拦截。
|
||
- 触发友军空投:验证不拦截。
|
||
- 存档/读档:验证 `interceptEnabled` 状态持久化。
|
||
|
||
## 7. 当前改动文件清单
|
||
- `Source/ArachnaeSwarm/Flyover/GameComponent_DropPodInterceptor.cs`(新增)
|
||
- `Source/ArachnaeSwarm/HarmonyPatches/Patch_DropPodIntercept.cs`(新增)
|
||
- `Source/ArachnaeSwarm/Abilities/CompAbilityEffect_ToggleDropPodIntercept.cs`(新增)
|
||
- `1.6/1.6/Defs/AbilityDefs/Ability_DropPodIntercept.xml`(新增)
|
||
- `1.6/1.6/Defs/PawnKindDef/ARA_PawnKinds.xml`(修改)
|
||
- `1.6/1.6/Languages/ChineseSimplified (简体中文)/Keyed/AirStrike_Keys.xml`(修改)
|
||
- `Source/ArachnaeSwarm/ArachnaeSwarm.csproj`(修改)
|
||
|
||
---
|
||
|
||
如需我继续,可下一步直接输出“planer审阅意见处理版”补丁(按审阅结论二改)。
|