Преглед изворни кода

【新增】让莫辛 730 mm 枪管准星槽兼容 ALX 16/20 脚架

在 730 mm 标准莫辛枪管的 mod_sight_front 前准星槽白名单追加 MDR BLK LBL ALX 脚架 16/20 两型
(680f6d9a4d7624d36e06527b、680f7e4aeee716732708e84e,由 WTT-ContentBackport 注入),
与莫辛准星共用同一槽位而互斥;同步更新单元测试与文档。

csproj 0.1.0 → 0.2.0
PJ568 пре 1 месец
родитељ
комит
46a2f10145
7 измењених фајлова са 40 додато и 8 уклоњено
  1. 2 2
      README.md
  2. 3 3
      WeaponCrossModding.csproj
  3. 2 2
      docs/compatibility.md
  4. 2 0
      docs/features.md
  5. 2 0
      docs/verification.md
  6. 10 1
      src/Mod.cs
  7. 19 0
      tests/WeaponCrossModding.Tests/ModTests.cs

+ 2 - 2
README.md

@@ -16,7 +16,7 @@
 | CR 50DS 前准星槽与战术设备槽 | PPSh-41 枪管与枪托槽 |
 | --- | --- |
 | ![Chiappa 犀牛 50DS 左轮手枪](assets/50DS.webp) | ![PPSh-41 冲锋枪](assets/PPSh.webp) |
-| 前准星槽装瞄具基座;战术设备槽装 RK 系列前握把。 | 枪管槽装莫辛纳甘枪管并挂三轨;枪托槽装 M14ALCS (MOD-0) 枪托。 |
+| 前准星槽装瞄具基座;战术设备槽装 RK 系列前握把。 | 枪管槽装莫辛纳甘枪管并挂三轨;枪托槽装 M14ALCS (MOD-0) 枪托;730mm 莫辛枪管的准星槽可装 MDR BLK LBL ALX 脚架(16 / 20)。 |
 
 ## 文档
 
@@ -54,7 +54,7 @@ All injections are idempotent: an id already present is never added twice.
 | CR 50DS front sight and tactical slots | PPSh-41 barrel and stock slots |
 | --- | --- |
 | ![Chiappa Rhino 50DS revolver](assets/50DS.webp) | ![PPSh-41 SMG](assets/PPSh.webp) |
-| The front sight slot takes a scope base; the tactical slot takes an RK-series foregrip. | The barrel slot takes a Mosin barrel with the tri-rail mounted on it; the stock slot takes the M14ALCS (MOD-0) buttstock. |
+| The front sight slot takes a scope base; the tactical slot takes an RK-series foregrip. | The barrel slot takes a Mosin barrel with the tri-rail mounted on it; the stock slot takes the M14ALCS (MOD-0) buttstock; the 730 mm Mosin barrel's front sight slot takes an MDR BLK LBL ALX bipod (16 / 20). |
 
 ## Documentation
 

+ 3 - 3
WeaponCrossModding.csproj

@@ -13,9 +13,9 @@
       钉到 4.1.2 是当前最稳的策略;服务端校验 mod 编译引用的 SPTarkov.Server.Core
       AssemblyVersion,使用 4.1.2 编译的 mod 可被 4.1.5 宿主加载。
     -->
-    <Version>0.1.0</Version>
-    <AssemblyVersion>0.1.0.0</AssemblyVersion>
-    <FileVersion>0.1.0.0</FileVersion>
+    <Version>0.2.0</Version>
+    <AssemblyVersion>0.2.0.0</AssemblyVersion>
+    <FileVersion>0.2.0.0</FileVersion>
     <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
   </PropertyGroup>
 

+ 2 - 2
docs/compatibility.md

@@ -7,7 +7,7 @@
 ## 与其它模组的关系
 
 - **幂等共存**:所有注入基于 `HashSet.Add`,与同样向槽位过滤器追加白名单的模组共存时不会产生重复条目,也不会互相覆盖。若另一模组已加入同一 id,本插件只记一条 `Debug` 日志。
-- **`WTT-ContentBackport`**:部分物品由该模组注入,例如 HUXWRX HX-QD 7.62x51 消音器(黑 / 黄褐色)与 Tyrant Designs MOD Chevron AR-15 镂空手枪式握把(黑 / 黄 / 红)。
+- **`WTT-ContentBackport`**:部分物品由该模组注入,例如 HUXWRX HX-QD 7.62x51 消音器(黑 / 黄褐色)、Tyrant Designs MOD Chevron AR-15 镂空手枪式握把(黑 / 黄 / 红)以及 MDR BLK LBL ALX 脚架(16 与 20 型号)。
   - 这些物品作为**白名单新增项**时,插件只追加 id,不要求其存在,因此无论该模组是否安装都能正常加载。
   - 这些物品作为**冲突目标**时(HUXWRX 消音器),若其尚未注入,插件仅记 `Debug` 并跳过;由于 PPSh-41 防尘盖一侧的冲突记录仍会建立,互斥关系依旧成立,并避免了对第三方模组加载顺序的依赖。
 - 插件只改写物品数据库,不注册 Harmony patch,也不与客户端插件争抢运行时方法。
@@ -40,7 +40,7 @@
 ## Interaction with Other Mods
 
 - **Idempotent coexistence**: every injection relies on `HashSet.Add`, so running alongside mods that also append to slot filters produces no duplicates and no overwrites. If another mod already added the same id, this plugin only writes a `Debug` entry.
-- **`WTT-ContentBackport`**: some items are injected by that mod, such as the HUXWRX HX-QD 7.62x51 suppressors (black / tan) and the Tyrant Designs MOD Chevron AR-15 skeletonized pistol grips (black / yellow / red).
+- **`WTT-ContentBackport`**: some items are injected by that mod, such as the HUXWRX HX-QD 7.62x51 suppressors (black / tan), the Tyrant Designs MOD Chevron AR-15 skeletonized pistol grips (black / yellow / red) and the MDR BLK LBL ALX bipods (16 and 20 models).
   - When these items are **whitelist additions**, the plugin only appends their ids and does not require them to exist, so it loads fine whether or not that mod is installed.
   - When these items are **conflict targets** (the HUXWRX suppressors), if they are not yet injected the plugin only logs `Debug` and skips; because the PPSh-41 dust cover side still records the conflict, the exclusion still holds, avoiding any dependency on third-party load order.
 - The plugin only rewrites the item database. It registers no Harmony patch and never contends with client plugins for runtime methods.

+ 2 - 0
docs/features.md

@@ -12,6 +12,7 @@
 
 - PPSh-41 冲锋枪的 `mod_barrel` 枪管槽:新增莫辛纳甘全部 4 种尺寸枪管(200mm 锯短、220mm 锯短螺纹、514mm 卡宾、730mm 标准)。
 - PPSh-41 冲锋枪的 `mod_stock` 枪托槽:新增 Benelli M3 可伸缩枪托、PKM 木制枪托、Zenit PT-2 "Klassika" PK 机枪枪托、PKP 聚合物枪托、Ultima MP-155 塑料手枪式握把、KS-23 金属枪托与 M14 SAGE International M14ALCS (MOD-0) 枪托。
+- 730mm 标准莫辛枪管的 `mod_sight_front` 前准星槽:新增 MDR BLK LBL ALX 脚架(16 与 20 型号,由 `WTT-ContentBackport` 注入;与莫辛准星共用同一槽位,二者互斥)。
 
 ## 握把与配件
 
@@ -41,6 +42,7 @@
 
 - `mod_barrel` slot of the PPSh-41: adds all four Mosin barrel lengths (200 mm sawn-off, 220 mm threaded sawn-off, 514 mm carbine, 730 mm standard).
 - `mod_stock` slot of the PPSh-41: adds the Benelli M3 telescopic stock, the PKM wooden stock, the Zenit PT-2 "Klassika" PK stock, the PKP polymer stock, the Ultima MP-155 plastic pistol grip, the KS-23 metal stock and the M14 SAGE International M14ALCS (MOD-0) buttstock.
+- `mod_sight_front` slot of the 730 mm standard Mosin barrel: adds the MDR BLK LBL ALX bipods (16 and 20 models, injected by `WTT-ContentBackport`; shared with the Mosin front sight, so the two are mutually exclusive).
 
 ## Grips and accessories
 

+ 2 - 0
docs/verification.md

@@ -24,6 +24,7 @@
    - 在 UZI StormWerkz 顶盖导轨上安装 ELCAN SpecterDR 或 SIG Sauer BRAVO4;
    - 在 CR 200DS / CR 50DS 前准星槽安装 StormWerkz 顶盖导轨或 MP-18 瞄具基座;
    - 在 PPSh-41 上安装莫辛纳甘枪管或 M14ALCS (MOD-0) 枪托;
+   - 在 730mm 标准莫辛枪管的前准星槽安装 MDR BLK LBL ALX 脚架(16 或 20 型号);
    - 尝试同时安装 PPSh-41 防尘盖与 HUXWRX HX-QD 消音器,确认二者互斥。
 4. 若修改了物品 id,重新运行单元测试确认夹具仍与代码一致。
 
@@ -63,6 +64,7 @@ The slot names should cover `mod_scope`, `mod_sight_front`, `mod_barrel`, `mod_s
    - mount the ELCAN SpecterDR or SIG Sauer BRAVO4 on the UZI StormWerkz top cover rail;
    - mount the StormWerkz top cover rail or MP-18 scope base on the CR 200DS / CR 50DS front sight slot;
    - mount a Mosin barrel or the M14ALCS (MOD-0) buttstock on the PPSh-41;
+   - mount an MDR BLK LBL ALX bipod (16 or 20 model) on the front sight slot of the 730 mm standard Mosin barrel;
    - try mounting the PPSh-41 dust cover and a HUXWRX HX-QD suppressor together and confirm they are mutually exclusive.
 4. If you changed any item id, re-run the unit tests to confirm the fixtures still match the code.
 

+ 10 - 1
src/Mod.cs

@@ -31,7 +31,8 @@ namespace Pj568.WeaponCrossModding;
 ///      Tyrant Designs MOD Chevron AR-15 镂空手枪式握把(黑 / 黄 / 红)与 AS VAL Rotor 43 手枪式握把附缓冲管转接器;
 ///  14. 让 CR 50DS 转轮手枪的前准星槽支持安装 StormWerkz 顶盖导轨与 MP-18 瞄具基座;
 ///  15. 让 CR 50DS 转轮手枪的战术设备槽支持安装 Zenit RK 系列前握把、KAC MWS 脚架转接器
-///      与 BT10 V8 Atlas 折叠脚架。
+///      与 BT10 V8 Atlas 折叠脚架;
+///  16. 让 730mm 标准莫辛枪管的前准星槽支持安装 MDR BLK LBL ALX 脚架(16 与 20 型号);
 ///
 /// 做法:往目标槽的 SlotFilter.Filter(HashSet&lt;MongoId&gt;)追加物品 id(幂等)。
 /// </summary>
@@ -78,6 +79,10 @@ public class WeaponCrossModdingPlugin(
     private const string MosinBarrel514Id = "5bfd4cbe0db834001b73449f"; // 514mm 卡宾
     private const string MosinBarrel730Id = "5ae09bff5acfc4001562219d"; // 730mm 标准
 
+    // MDR BLK LBL ALX 脚架(16 / 20 型号,由 WTT-ContentBackport 注入;安装于 730mm 标准莫辛枪管的前准星槽)。
+    private const string AlxBipod16Id = "680f6d9a4d7624d36e06527b";
+    private const string AlxBipod20Id = "680f7e4aeee716732708e84e";
+
     // PPSh-41 枪托槽兼容的枪托 / 握把。
     private const string BenelliM3TelescopicStockId = "6259c3387d6aab70bc23a18d"; // Benelli M3 可伸缩枪托
     private const string PkmWoodenStockId = "646371a9f2404ab67905c8e6"; // PKM 木制枪托
@@ -158,6 +163,7 @@ public class WeaponCrossModdingPlugin(
     private const string Cr50DsLabel = "CR 50DS";
     private const string Ppsh41Label = "PPSh-41";
     private const string M14ButtstockLabel = "M14ALCS (MOD-0) stock";
+    private const string MosinBarrel730Label = "Mosin 730mm barrel";
 
     public Task OnLoadAsync(CancellationToken cancellationToken)
     {
@@ -182,6 +188,9 @@ public class WeaponCrossModdingPlugin(
             // PPSh-41 枪管槽:追加莫辛纳甘的全部尺寸枪管。
             AddItemIdsToSlot(items, Ppsh41Id, Ppsh41Label, BarrelSlotName, MosinBarrel200Id, MosinBarrel220ThreadedId, MosinBarrel514Id, MosinBarrel730Id);
 
+            // 730mm 标准莫辛枪管的前准星槽:追加 MDR BLK LBL ALX 脚架(16 与 20 型号)。
+            AddItemIdsToSlot(items, MosinBarrel730Id, MosinBarrel730Label, SightSlotName, AlxBipod16Id, AlxBipod20Id);
+
             // PPSh-41 枪托槽:追加 Benelli M3 可伸缩枪托、PKM / PKP 枪托、Ultima MP-155 握把、
             // KS-23 金属枪托,以及 M14 SAGE International M14ALCS (MOD-0) 枪托。
             AddItemIdsToSlot(items, Ppsh41Id, Ppsh41Label, StockSlotName, BenelliM3TelescopicStockId, PkmWoodenStockId, PkZenitPt2StockId, PkpPolymerStockId, UltimaMp155PistolGripId, Ks23MetalStockId, M14AlcsButtstockId);

+ 19 - 0
tests/WeaponCrossModding.Tests/ModTests.cs

@@ -63,6 +63,10 @@ public class WeaponCrossModdingPluginTests
     private const string FortisShiftForegripId = "59f8a37386f7747af3328f06";
     private const string M14AlcsButtstockId = "5addc7ac5acfc400194dbd90";
     private const string M14AlcsPistolGripId = "5addc7db5acfc4001669f279";
+    private const string MosinBarrel730Id = "5ae09bff5acfc4001562219d";
+    private const string MosinFrontSightId = "5ae099875acfc4001714e593";
+    private const string AlxBipod16Id = "680f6d9a4d7624d36e06527b";
+    private const string AlxBipod20Id = "680f7e4aeee716732708e84e";
 
     // 与 src/Mod.cs 对应:M14ALCS (MOD-0) 枪托握把位的新增握把。
     private static readonly string[] M14AlcsPistolGripCompatIds =
@@ -343,6 +347,21 @@ public class WeaponCrossModdingPluginTests
         }
     }
 
+    [Fact]
+    public async Task AddsAlxBipodsToMosin730mmBarrelSightSlot()
+    {
+        var barrel = ItemWithSlot("barrel_mosin_izhmash_mosin_std_730mm", "mod_sight_front", MosinFrontSightId);
+        var items = new Dictionary<MongoId, TemplateItem> { [new MongoId(MosinBarrel730Id)] = barrel };
+
+        await BuildPlugin(items).OnLoadAsync(CancellationToken.None);
+
+        var filter = FilterOf(barrel, "mod_sight_front");
+        Assert.Contains(new MongoId(MosinFrontSightId), filter);
+        Assert.Contains(new MongoId(AlxBipod16Id), filter);
+        Assert.Contains(new MongoId(AlxBipod20Id), filter);
+        Assert.Equal(3, filter.Count);
+    }
+
     [Fact]
     public async Task AddsM14DcsbMountToTriRailScopeSlot()
     {