Bläddra i källkod

【新增】让 TT 枪管兼容 Alpha Dog、AA-12 Gen2 兼容 La Rue

116mm TT 自制螺纹枪管的 mod_muzzle 新增兼容 Alpha Dog Alpha 9 9x19 消音器;AA-12 Gen2 的 mod_scope 新增兼容 La Rue Tactical QD LT-101 皮卡汀尼立管导轨基座。csproj 版本 0.17.0 → 0.18.0。
PJ568 1 månad sedan
förälder
incheckning
0f66b050be

+ 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.17.0</Version>
-    <AssemblyVersion>0.17.0.0</AssemblyVersion>
-    <FileVersion>0.17.0.0</FileVersion>
+    <Version>0.18.0</Version>
+    <AssemblyVersion>0.18.0.0</AssemblyVersion>
+    <FileVersion>0.18.0.0</FileVersion>
     <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
   </PropertyGroup>
 

+ 2 - 2
docs/compatibility.md

@@ -14,7 +14,7 @@
 - **原版物品**:RPD 520mm 枪管、M700 全部 4 种枪管、ORSIS T-5000M 660mm 枪管、SKS 与 OP-SKS 的 520mm 枪管、TAPCO Intrafuse SKS 枪身套件、Fab Defence UAS SKS 枪身套件及其枪托槽配件(TAPCO Intrafuse 缓冲管、Fab Defence UAS 折叠枪托)、SKS / OP-SKS 照门固定环、SKS / OP-SKS / SVT-40 / AVT-40 枪本体与 SVT-40 625mm 枪管、SVDS 照门固定环、SVDS 枪本体与 SVDS 枪管、PPSh-41 71 发弹鼓,以及 AKM PBS-1 7.62x39 消音器均为原版物品,不依赖 `WTT-ContentBackport`。
 - **PPSh-41 上机匣槽**:`mod_reciever` 槽同时承载 PPSh-41 防尘盖、TAPCO Intrafuse SKS 与 Fab Defence UAS SKS 枪身套件,共用同一槽位,因此彼此天然二选一。
 - **新增互斥**:两个 SKS 枪身套件与除 KS-23 金属枪托之外的全部 PPSh-41 枪托(含原装木制枪托与 Zveno 缓冲管转接器)互不兼容;两个 SKS 枪身套件与 PPSh-41 的 71 发弹鼓互不兼容;KS-23 金属枪托与两个 SKS 枪身套件枪托槽可装的配件互不兼容;TKPD 导轨防尘盖与 SKS / OP-SKS / SVT-40 / AVT-40 / SVDS 枪本体互不兼容;SVDS 照门固定环护木槽可装的莫辛 200mm、M700 全部 4 种与 ORSIS T-5000M 枪管与 SVDS 枪本体互不兼容;SVDS 枪管与自身互不兼容(防止重复安装);SVDS 照门固定环与 PPSh-41 防尘盖、TAPCO Intrafuse SKS 枪身套件互不兼容;SVDS 照门固定环护木槽可装的 3 种原版 SVDS 护木与 PPSh-41 枪本体互不兼容;SVDS 照门固定环护木槽可装的 SVT-40 / AVT-40 625mm 枪管与 SVDS 枪本体互不兼容;TKPD 导轨防尘盖与自身互不兼容(防止重复安装);MDR BLK LBL ALX 20 脚架与自身互不兼容(防止重复安装);5 种 SKS 导气管防尘盖与 UltiMAK M1-B AK 导气管套件彼此之间(含与自身)互不兼容,使一把武器上最多只能装一个。
-- **新增兼容**:Fab Defence UAS SKS 枪身套件的下导轨(`mod_tactical_002`)新增兼容 AK-100 系列聚合物护木可安装的全部 33 种前握把(含 Zenit RK 系列、BCM MOD.3、KAC、ASh-12、Tactical Dynamics 镂空、TangoDown Stubby BGV-MK46K 三色、Fortis Shift 等);Alpha Dog Alpha 9 9x19 声音抑制器的 `mod_scope` 槽新增兼容 M14 SAGE International DCSB 瞄具基座;Marlin MXLR .308 ME 杠杆步枪的 5 发管状弹仓新增兼容全部 7 种 7.62x25 托卡列夫弹药;20x1mm 玩具枪的 `mod_magazine` 槽新增兼容 Marlin MXLR 的 5 发管状弹仓;EMTI-019 基座的 `mod_scope` 槽新增兼容 DCSB 瞄具基座;MTs-255-12 的护木槽新增兼容 MP-18 的全部护木,枪托槽新增兼容雷明顿 Model 870 的 Magpul SGA、Remington SPS 与 Shockwave Raptor 枪托。
+- **新增兼容**:Fab Defence UAS SKS 枪身套件的下导轨(`mod_tactical_002`)新增兼容 AK-100 系列聚合物护木可安装的全部 33 种前握把(含 Zenit RK 系列、BCM MOD.3、KAC、ASh-12、Tactical Dynamics 镂空、TangoDown Stubby BGV-MK46K 三色、Fortis Shift 等);Alpha Dog Alpha 9 9x19 声音抑制器的 `mod_scope` 槽新增兼容 M14 SAGE International DCSB 瞄具基座;Marlin MXLR .308 ME 杠杆步枪的 5 发管状弹仓新增兼容全部 7 种 7.62x25 托卡列夫弹药;20x1mm 玩具枪的 `mod_magazine` 槽新增兼容 Marlin MXLR 的 5 发管状弹仓;EMTI-019 基座的 `mod_scope` 槽新增兼容 DCSB 瞄具基座;MTs-255-12 的护木槽新增兼容 MP-18 的全部护木,枪托槽新增兼容雷明顿 Model 870 的 Magpul SGA、Remington SPS 与 Shockwave Raptor 枪托;116mm TT 自制螺纹枪管的枪口槽新增兼容 Alpha Dog Alpha 9 9x19 消音器;AA-12 Gen2 的瞄具槽新增兼容 La Rue Tactical QD LT-101 皮卡汀尼立管导轨基座。
 - 插件只改写物品数据库,不注册 Harmony patch,也不与客户端插件争抢运行时方法。
 
 ## 已知限制
@@ -53,7 +53,7 @@
 - **Vanilla items**: the RPD 520 mm barrel, all four M700 barrels, the ORSIS T-5000M 660 mm barrel, the SKS and OP-SKS 520 mm barrels, the TAPCO Intrafuse SKS chassis kit, the Fab Defence UAS SKS chassis kit and their stock-slot parts (TAPCO Intrafuse buffer tube, Fab Defence UAS folding stock), the SKS / OP-SKS rear sight blocks, the SKS / OP-SKS / SVT-40 / AVT-40 weapons and the SVT-40 625 mm barrel, the SVDS rear sight block, the SVDS weapon and the SVDS barrel, the PPSh-41 71-round drum magazine, and the AKM PBS-1 7.62x39 suppressor are all vanilla items and do not depend on `WTT-ContentBackport`.
 - **PPSh-41 upper receiver slot**: the `mod_reciever` slot carries the PPSh-41 dust cover, the TAPCO Intrafuse SKS and the Fab Defence UAS SKS chassis kits; since they share the same slot, they are inherently an either/or choice.
 - **New exclusions**: the two SKS chassis kits are incompatible with every PPSh-41 stock except the KS-23 metal stock (including the PPSh wooden stock and the Zveno buffer tube adapter) and with the PPSh-41 71-round drum magazine; the KS-23 metal stock is incompatible with the parts accepted by the two SKS chassis kits' stock slots; the TKPD railed dust cover is incompatible with the SKS, OP-SKS, SVT-40, AVT-40 and SVDS weapons; the Mosin 200 mm, all four M700 and the ORSIS T-5000M barrels accepted by the SVDS rear sight block's handguard slot are incompatible with the SVDS weapon; the SVDS barrel is incompatible with itself (to prevent duplicate mounting); the SVDS rear sight block is incompatible with the PPSh-41 dust cover and with the TAPCO Intrafuse SKS chassis kit; the 3 vanilla SVDS handguards accepted by the SVDS rear sight block's handguard slot are incompatible with the PPSh-41 weapon itself; the SVT-40 / AVT-40 625 mm barrel accepted by that handguard slot is incompatible with the SVDS weapon; the TKPD railed dust cover is incompatible with itself (to prevent duplicate mounting); the MDR BLK LBL ALX 20 bipod is incompatible with itself (to prevent duplicate mounting); the 5 SKS gas-tube covers and the UltiMAK M1-B AK gas tube kit are mutually incompatible with each other (including with themselves), so at most one can be installed on a weapon.
-- **New compatibility**: the Fab Defence UAS SKS chassis kit's lower rail (`mod_tactical_002`) now accepts all 33 foregrips compatible with the AK-100 series polymer handguards (Zenit RK series, BCM MOD.3, KAC, ASh-12, Tactical Dynamics skeletonized, TangoDown Stubby BGV-MK46K in three colors, Fortis Shift, and 25 others); the Alpha Dog Alpha 9 9x19 sound suppressor's `mod_scope` slot now accepts the M14 SAGE International DCSB scope mount; the Marlin MXLR .308 ME lever-action rifle's 5-round tubular magazine now accepts all 7 types of 7.62x25 Tokarev ammunition; the 20x1mm toy gun's `mod_magazine` slot now accepts the Marlin MXLR 5-round tubular magazine; the EMTI-019 mount's `mod_scope` slot now accepts the DCSB scope mount; the MTs-255-12's handguard slot now accepts all MP-18 handguards and its stock slot now accepts the Remington Model 870's Magpul SGA, Remington SPS and Shockwave Raptor stocks.
+- **New compatibility**: the Fab Defence UAS SKS chassis kit's lower rail (`mod_tactical_002`) now accepts all 33 foregrips compatible with the AK-100 series polymer handguards (Zenit RK series, BCM MOD.3, KAC, ASh-12, Tactical Dynamics skeletonized, TangoDown Stubby BGV-MK46K in three colors, Fortis Shift, and 25 others); the Alpha Dog Alpha 9 9x19 sound suppressor's `mod_scope` slot now accepts the M14 SAGE International DCSB scope mount; the Marlin MXLR .308 ME lever-action rifle's 5-round tubular magazine now accepts all 7 types of 7.62x25 Tokarev ammunition; the 20x1mm toy gun's `mod_magazine` slot now accepts the Marlin MXLR 5-round tubular magazine; the EMTI-019 mount's `mod_scope` slot now accepts the DCSB scope mount; the MTs-255-12's handguard slot now accepts all MP-18 handguards and its stock slot now accepts the Remington Model 870's Magpul SGA, Remington SPS and Shockwave Raptor stocks; the 116 mm TT handmade threaded barrel's muzzle slot now accepts the Alpha Dog Alpha 9 9x19 suppressor; the AA-12 Gen2's scope slot now accepts the La Rue Tactical QD LT-101 Picatinny riser mount.
 - The plugin only rewrites the item database. It registers no Harmony patch and never contends with client plugins for runtime methods.
 
 ## Known Limitations

+ 4 - 0
docs/features.md

@@ -23,6 +23,8 @@
 - AA-12 457mm 枪管的 `mod_mount` 导轨槽:新增 M60 脚架。
 - MP-18 与 Marlin MXLR 的 `mod_stock` 枪托槽:新增 KS-23 金属枪托。
 - MTs-255-12 12 号左轮霰弹枪的 `mod_handguard` 护木槽:新增 MP-18 的全部护木(木制、塑料);其 `mod_stock` 枪托槽:新增雷明顿 Model 870 的 Magpul SGA、Remington SPS 与 Shockwave Raptor 枪托(不含 Mesa Tactical LEO 转接器与 Fab Defence AGR 握把)。
+- 116mm 7.62x25 TT 自制螺纹枪管的 `mod_muzzle` 枪口槽:新增 Alpha Dog Alpha 9 9x19 声音抑制器。
+- AA-12 Gen2 (MPS Auto Assault-12 Gen2) 的 `mod_scope` 瞄具槽:新增 La Rue Tactical QD LT-101 皮卡汀尼立管导轨基座。
 
 ## 弹药与口径
 
@@ -85,6 +87,8 @@
 - `mod_mount` rail slot of the AA-12 457 mm barrel: adds the M60 bipod.
 - `mod_stock` slot of the MP-18 and Marlin MXLR: adds the KS-23 metal stock.
 - `mod_handguard` slot of the MTs-255-12 12ga revolver shotgun: adds all MP-18 handguards (wooden, plastic); its `mod_stock` slot: adds the Remington Model 870's Magpul SGA, Remington SPS and Shockwave Raptor stocks (excluding the Mesa Tactical LEO stock adapter and the Fab Defence AGR pistol grip).
+- `mod_muzzle` slot of the 116 mm 7.62x25 TT handmade threaded barrel: adds the Alpha Dog Alpha 9 9x19 sound suppressor.
+- `mod_scope` slot of the AA-12 Gen2 (MPS Auto Assault-12 Gen2): adds the La Rue Tactical QD LT-101 Picatinny riser mount.
 
 ## Ammunition and caliber
 

+ 4 - 0
docs/verification.md

@@ -35,6 +35,8 @@
    - 在 Fab Defence UAS SKS 枪身套件的下导轨(`mod_tactical_002`)或 UltiMAK M1-B AK 导气管套件的战术配件槽(`mod_tactical_000`)安装 MDR BLK LBL ALX 20 脚架;
    - 在 MP-18 或 Marlin MXLR 的枪托槽安装 KS-23 金属枪托;
    - 在 MTs-255-12 的护木槽(`mod_handguard`)安装 MP-18 的护木(木制 / 塑料),在其枪托槽(`mod_stock`)安装雷明顿 Model 870 的任一枪托(如 Magpul SGA、Remington SPS),确认均可安装;
+   - 在 116mm TT 自制螺纹枪管的枪口槽(`mod_muzzle`)安装 Alpha Dog Alpha 9 9x19 消音器,确认可安装;
+   - 在 AA-12 Gen2 的瞄具槽(`mod_scope`)安装 La Rue Tactical QD LT-101 皮卡汀尼立管导轨基座,确认可安装;
    - 清客户端缓存后,验证 7.62x25 供弹链路:给 Marlin MXLR 的 5 发管状弹仓压入 7.62x25 托卡列夫子弹,插入玩具枪的 `mod_magazine` 槽,尝试开火;同时确认玩具枪原装 20x1mm 玩具弹仍可使用;
    - 尝试同时安装 PPSh-41 防尘盖与 HUXWRX HX-QD 消音器,确认二者互斥;
    - 尝试在 PPSh-41 上同时安装 SKS 枪身套件与任一非 KS-23 枪托(含 Zveno 缓冲管转接器),确认二者互斥;
@@ -99,6 +101,8 @@ The slot names should cover `mod_scope`, `mod_sight_front`, `mod_sight_rear`, `m
    - mount an MDR BLK LBL ALX 20 bipod on the lower rail (`mod_tactical_002`) of the Fab Defence UAS SKS chassis kit or the tactical slot (`mod_tactical_000`) of the UltiMAK M1-B AK gas tube kit;
    - mount a KS-23 metal stock on the stock slot of the MP-18 or Marlin MXLR;
    - mount an MP-18 handguard (wooden / plastic) on the MTs-255-12's `mod_handguard` slot and a Remington Model 870 stock (e.g. Magpul SGA or Remington SPS) on its `mod_stock` slot, and confirm both can be installed;
+- mount an Alpha Dog Alpha 9 9x19 suppressor on the 116 mm TT handmade threaded barrel's `mod_muzzle` slot, and confirm it can be installed;
+- mount a La Rue Tactical QD LT-101 Picatinny riser mount on the AA-12 Gen2's `mod_scope` slot, and confirm it can be installed;
    - after clearing the client cache, load 7.62x25 Tokarev rounds into the Marlin MXLR's 5-round tubular magazine, insert it into the toy gun's `mod_magazine` slot and try to fire; also confirm the original 20x1mm toy rounds still work;
    - try mounting the PPSh-41 dust cover and a HUXWRX HX-QD suppressor together and confirm they are mutually exclusive;
    - try mounting an SKS chassis kit on the PPSh-41 together with any non-KS-23 stock (including the Zveno buffer tube adapter) and confirm they are mutually exclusive;

+ 20 - 0
src/Mod.cs

@@ -75,6 +75,8 @@ namespace Pj568.WeaponCrossModding;
 ///  53. 让 MTs-255-12 12 号左轮霰弹枪的护木槽(mod_handguard)支持安装 MP-18 的全部护木(木制 / 塑料),
 ///      枪托槽(mod_stock)支持安装雷明顿 Model 870 的 Magpul SGA、Remington SPS 与 Shockwave Raptor 枪托
 ///      (不含 Mesa Tactical LEO 转接器与 Fab Defence AGR 握把)。
+///  54. 让 116mm 7.62x25 TT 自制螺纹枪管的枪口槽(mod_muzzle)支持安装 Alpha Dog Alpha 9 9x19 声音抑制器。
+///  55. 让 AA-12 Gen2 的瞄具槽(mod_scope)支持安装 La Rue Tactical QD LT-101 皮卡汀尼立管导轨基座。
 ///
 /// 做法:往目标槽的 SlotFilter.Filter(HashSet&lt;MongoId&gt;)追加物品 id(幂等)。
 /// </summary>
@@ -162,6 +164,10 @@ public class WeaponCrossModdingPlugin(
     private const string AimSportsTriRailSecondTacticalSlotName = "mod_tactical_001";
     private const string AimSportsTriRailLabel = "Aim Sports tri-rail";
 
+    // La Rue Tactical QD LT-101 皮卡汀尼立管导轨基座(mod_scope 瞄具槽宿主,自身可装瞄具)。
+    private const string LaRueLt101Id = "5c064c400db834001d23f468";
+    private const string LaRueLt101Label = "La Rue Tactical QD LT-101";
+
     // Fab Defence UAS SKS 枪身套件的下导轨(原本兼容脚架的第三个战术槽)。
     private const string FabDefenceUasLowerRailSlotName = "mod_tactical_002";
 
@@ -261,6 +267,9 @@ public class WeaponCrossModdingPlugin(
     // AA-12 457mm 枪管(mod_mount 导轨槽宿主)。
     private const string Aa12Barrel457Id = "670fced86a7e274b1a0964e8";
 
+    // AA-12 Gen2 (MPS Auto Assault-12 Gen2) 自动霰弹枪(mod_scope 瞄具槽宿主)。
+    private const string Aa12Gen2Id = "67124dcfa3541f2a1f0e788b";
+
     // MTs-255-12 12 号左轮霰弹枪(weapon_ckib_mc_255_12g)—— 护木槽与枪托槽宿主。
     private const string Mts255Id = "60db29ce99594040e04c4a27";
 
@@ -288,6 +297,10 @@ public class WeaponCrossModdingPlugin(
     private const string RpdBarrel520Id = "6513eff1e06849f06c0957d4";
     private const string AkmPbs1Id = "5a0d63621526d8dba31fe3bf";
 
+    // 116mm 7.62x25 TT 自制螺纹枪管(mod_muzzle 枪口槽宿主)。
+    private const string TtBarrel116ThreadedId = "571a279b24597720b4066566";
+    private const string TtBarrel116ThreadedLabel = "116mm TT 7.62x25 threaded barrel";
+
     // M700 枪管(4 种)与 ORSIS T-5000M 枪管(可安装于 PPSh-41 枪管槽)。
     private const string M700Barrel660Id = "5bfebc250db834001a6694e1"; // 26 英寸
     private const string M700Barrel508ThreadedId = "5bfebc320db8340019668d79"; // 20 英寸螺纹
@@ -454,6 +467,7 @@ public class WeaponCrossModdingPlugin(
     private const string RpdBarrel520Label = "RPD 520mm barrel";
     private const string MosinBarrel730Label = "Mosin 730mm barrel";
     private const string Aa12Barrel457Label = "AA-12 457mm barrel";
+    private const string Aa12Gen2Label = "AA-12 Gen2";
     private const string Mp18RifleLabel = "MP-18 rifle";
     private const string Mts255Label = "MTs-255-12";
     private const string MarlinMxlrLabel = "Marlin MXLR";
@@ -606,6 +620,12 @@ public class WeaponCrossModdingPlugin(
 
             // EMTI-019 基座的 mod_scope 槽:追加 DCSB 瞄具基座。
             AddItemIdsToSlot(items, EmtiId, EmtiLabel, ScopeSlotName, M14DcsbMountId);
+
+            // 116mm 7.62x25 TT 自制螺纹枪管的 mod_muzzle 枪口槽:追加 Alpha Dog Alpha 9 9x19 声音抑制器。
+            AddItemIdsToSlot(items, TtBarrel116ThreadedId, TtBarrel116ThreadedLabel, MuzzleSlotName, AlphaDogSuppressorId);
+
+            // AA-12 Gen2 的 mod_scope 瞄具槽:追加 La Rue Tactical QD LT-101 皮卡汀尼立管导轨基座。
+            AddItemIdsToSlot(items, Aa12Gen2Id, Aa12Gen2Label, ScopeSlotName, LaRueLt101Id);
         }
         catch (Exception ex)
         {

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

@@ -171,6 +171,13 @@ public class WeaponCrossModdingPluginTests
     private const string MxlrMagId = "67c5424826265106dd0697a4";
     private const string Ks23MetalStockId = "5e848dc4e4dbc5266a4ec63d";
 
+    // TT 116mm 螺纹枪管、AA-12 Gen2、La Rue LT-101。
+    private const string TtBarrel116ThreadedId = "571a279b24597720b4066566";
+    private const string TtBarrel116ThreadedExistingMuzzleId = "571a28e524597720b4066567";
+    private const string Aa12Gen2Id = "67124dcfa3541f2a1f0e788b";
+    private const string Aa12Gen2ExistingScopeId = "57ae0171245977343c27bfcf";
+    private const string LaRueLt101Id = "5c064c400db834001d23f468";
+
     // 20x1mm 玩具枪、其原装弹匣与玩具弹,以及 7.62x25 托卡列夫全部 7 种弹药。
     private const string ToyGunId = "66015072e9f84d5680039678";
     private const string ToyGunMagId = "66015dc4aaad2f54cb04c56a";
@@ -1186,6 +1193,34 @@ public class WeaponCrossModdingPluginTests
         Assert.Equal(1 + M870StockIds.Length, filter.Count);
     }
 
+    [Fact]
+    public async Task AddsAlphaDogSuppressorToTtBarrel116MuzzleSlot()
+    {
+        var barrel = ItemWithSlot("barrel_tt_116mm_762x25tt_threaded", "mod_muzzle", TtBarrel116ThreadedExistingMuzzleId);
+        var items = new Dictionary<MongoId, TemplateItem> { [new MongoId(TtBarrel116ThreadedId)] = barrel };
+
+        await BuildPlugin(items).OnLoadAsync(CancellationToken.None);
+
+        var filter = FilterOf(barrel, "mod_muzzle");
+        Assert.Contains(new MongoId(TtBarrel116ThreadedExistingMuzzleId), filter);
+        Assert.Contains(new MongoId(AlphaDogSuppressorId), filter);
+        Assert.Equal(2, filter.Count);
+    }
+
+    [Fact]
+    public async Task AddsLaRueLt101ToAa12Gen2ScopeSlot()
+    {
+        var gun = ItemWithSlot("weapon_mps_aa_12_gen_2_12g", "mod_scope", Aa12Gen2ExistingScopeId);
+        var items = new Dictionary<MongoId, TemplateItem> { [new MongoId(Aa12Gen2Id)] = gun };
+
+        await BuildPlugin(items).OnLoadAsync(CancellationToken.None);
+
+        var filter = FilterOf(gun, "mod_scope");
+        Assert.Contains(new MongoId(Aa12Gen2ExistingScopeId), filter);
+        Assert.Contains(new MongoId(LaRueLt101Id), filter);
+        Assert.Equal(2, filter.Count);
+    }
+
     [Fact]
     public async Task MissingItemsDoNotThrow()
     {