uboat吧 关注:3,200贴子:17,642
  • 7回复贴,共1

关于如何修改水下航速

取消只看楼主收藏回复

1.steam搜索订阅 [2024.1] Removed Deckgun Boost 这个MOD,这个MOD可以自由调节拆除88炮后的水下航速增加百分比


IP属地:江苏1楼2024-11-13 18:16回复
    2.打开该MOD所在位置,我的是在F:\SteamLibrary\steamapps\workshop\content\494840\3295506353


    IP属地:江苏2楼2024-11-13 18:17
    回复
      3.打开Data Sheets文件夹下的DeckgunBoostConfig,然后按照自己需求修改移除88炮后的航速百分比,我的是120%,水下30节,开通气管,水下40节


      IP属地:江苏3楼2024-11-13 18:19
      收起回复
        4.看到这里,不喜欢保留88炮的可以不用继续往下看了,如果想保留88炮,还要水下速度堪比现代核潜艇的话,按照楼下我自己改的对比修改吧,实际是我也懒得再比对了。修改完后进游戏就会得到一艘比肩现代核潜艇水下速度的潜艇了


        IP属地:江苏4楼2024-11-13 18:23
        回复
          using System.Collections.Generic;
          using HarmonyLib;
          using UBOAT.Game.UI;
          using UBOAT.Game.Core;
          using UBOAT.Game.Core.Data;
          using UBOAT.Game.Sandbox;
          using UBOAT.Game.Scene;
          using UBOAT.Game.Scene.Items;
          using UBOAT.Game.Scene.Entities;
          using UBOAT.Game.Scene.Characters.Actions;
          using DWS.Common.InjectionFramework;
          using UnityEngine;
          namespace UBOAT.Mods.DeckgunEngine
          {
          class DeckgunEnginePatches
          {
          [Inject] private static PlayerShip playerShip;
          static bool EquipmentInstall = false;
          static bool RecheckDeckGun = false;
          static bool RemovedDeckGun = true;
          private static readonly GameDataReference Boost = new GameDataReference("DeckgunBoostConfig/Settings/DeckgunBoost/Underwater Speed Boost");
          private static bool CheckRemovedDeckGun()
          {
          if (RecheckDeckGun && playerShip != null)
          {
          string deckgunName = "Artillery - 8.8 cm";
          if (playerShip.Blueprint.Type.Name.StartsWith("Type II"))
          deckgunName = "MG C30";
          Debug.Log($"{Constants.ModName} checking Deck Gun slot for ship type {playerShip.Blueprint.Type.Name}");
          ShipEquipmentSlot deckGunSlot = Traverse.Create(playerShip).Field<ShipEquipmentSlot>("deckGunSlot").Value;
          Equipment deckGunEquipment = deckGunSlot.AssignedItem;
          if (deckGunEquipment.Name == "Removed Deck Gun" || deckGunEquipment.Name == "Deck Gun Mount Cover")
          {
          Debug.Log($"{Constants.ModName} Found Removed Deck Gun");
          RemovedDeckGun = false;
          RecheckDeckGun = true;
          }
          else if (deckGunEquipment.Name == deckgunName)
          {
          Debug.Log($"{Constants.ModName} Found Deck Gun");
          RemovedDeckGun = true;
          RecheckDeckGun = true;
          }
          if (!RecheckDeckGun)
          return RemovedDeckGun;
          Debug.Log($"{Constants.ModName} checking all equipment for Deck Gun");
          List<Equipment> equiment = playerShip.Equipment;
          foreach (Equipment item in equiment)
          {
          Debug.Log($"{Constants.ModName} Equipment is {item.Name}");
          if (item.Name == "Removed Deck Gun" || item.Name == "Deck Gun Mount Cover")
          {
          Debug.Log($"{Constants.ModName} Found Removed Deck Gun");
          RemovedDeckGun = false;
          RecheckDeckGun = true;
          break;
          }
          if (item.Name == deckgunName)
          {
          Debug.Log($"{Constants.ModName} Found Deck Gun");
          RemovedDeckGun = true;
          RecheckDeckGun = true;
          break;
          }
          }
          RecheckDeckGun = true;
          }
          return RemovedDeckGun;
          }
          [HarmonyPatch(typeof(Propeller), "FixedUpdate")]
          public class FixedUpdatePatch
          {
          public static bool modified = false;
          public static void Prefix(ref float __state, ref float ___power)
          {
          if (!Physics.autoSimulation)
          return;
          if (!CheckRemovedDeckGun() || playerShip.DeckDepth < 1.5f)
          return;
          modified = true;
          __state = ___power;
          ___power += __state * Boost;
          //Debug.Log($"{Constants.ModName} Old Power {__state} Power Increase {__state * Boost} New Power {___power} ");
          }
          public static void Postfix(float __state, ref float ___power)
          {
          if (!modified)
          return;
          ___power = __state;
          modified = false;
          }
          }
          [HarmonyPatch(typeof(PlayerCareer), "OnAfterDeserialize")]
          public class OnAfterDeserialize
          {
          public static void Postfix()
          {
          Debug.Log($"{Constants.ModName} Deck Gun Recheck Needed");
          RecheckDeckGun = false;
          }
          }
          [HarmonyPatch(typeof(EnterUpgradeModeAction), "GameState_UpgradeModeChanged")]
          public class EnterUpgradeModeActionPatch
          {
          public static void Prefix(GameState ___gameState)
          {
          if (!___gameState.UpgradeMode)
          {
          EquipmentInstall = true;
          }
          }
          }
          [HarmonyPatch(typeof(PlayerShip), "Undock")]
          public class UpgradeModeUIUpdatePatch
          {
          public static void Prefix()
          {
          if (!EquipmentInstall)
          return;
          Debug.Log($"{Constants.ModName} Deck Gun Recheck Needed");
          EquipmentInstall = true;
          RecheckDeckGun = false;
          }
          }
          }
          }


          IP属地:江苏5楼2024-11-13 18:23
          收起回复
            水下速度


            IP属地:江苏6楼2024-11-13 18:27
            回复
              水下开通气管


              IP属地:江苏7楼2024-11-13 18:28
              回复
                附赠一个夜晚如何增加视野,打开F:\SteamLibrary\steamapps\common\UBOAT\UBOAT_Data\Data Sheets,表4 Equipment里CTRL+F搜索RED(也就是红光,游戏里开红光会增加夜晚的视野)找到RedLightObservationModifier = 0.15,这里的0.15是游戏里的15%哦,改为自己想要的数字,晚上的视野就会相应改变


                IP属地:江苏8楼2024-11-13 18:40
                收起回复