Zaliteam-DynamicShipDoorHealth icon

DynamicShipDoorHealth

Replaces timed ship door power drain and overheating with a 0-100% door integrity pool that monsters batter down to barge open, plus a solid closed-door NavMesh barrier.

Last updated a day ago
Total downloads 37
Total rating 0 
Categories Mods Server-side Tweaks & Quality Of Life AI Generated
Dependency string Zaliteam-DynamicShipDoorHealth-1.0.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100

README

Dynamic Ship Door Health (Door Integrity & Monster Breach)

Replaces the ship hangar door's timed battery drain and overheat lockout with a dynamic structural integrity pool (0%–100%). Keep the door shut as long as you need—until outside monsters start battering it down and force it open.


Player Guide (Simple Overview)

What It Changes

  • No More Idle Battery Drain: Closing the ship door no longer drains power over time or overheats the hydraulics. You can keep the door closed indefinitely while no monsters are attacking it.
  • Monster Battering & Barge-Ins: When outside enemies get close to the closed ship door, they slam against it, draining the door's integrity percentage (100% down to 0%):
    • Heavy monsters (Eyeless Dogs, Forest Keepers, Earth Leviathans, Old Birds, Thumpers) break the door down quickly.
    • Medium monsters (Masked, Baboon Hawks, Spiders, Nutcrackers, Butlers, Snare Fleas) deal moderate damage.
    • Smaller / other outside monsters chip away at it slowly.
  • Audio & Screen Shake Warnings: While monsters are hammering the door, you will hear metallic impacts and feel light camera shakes inside the ship.
  • Door Breach: If integrity hits 0%, the door is violently forced open with a heavy screen shake and opening sound.
  • Slow Self-Repair & Instant Reset: When no monsters are near the doorway, integrity slowly recovers (+5% per second). Opening or re-closing the door restores integrity to 100%.
  • Solid Closed Doorway: Monsters cannot clip or pathfind through the closed doorway while attacking it.
  • Orbit Safe by Default: When the ship is in orbit (inShipPhase), this mod leaves vanilla door lock behavior alone unless paired with OrbitDoorsAndSpacewalk.

Configuration (BepInEx/config/com.khameli0n.dynamicshipdoorhealth.cfg)

Section Key Default Description
ShipDoor ShipDoorInfinitePower true Disables timed door battery drain/overheat and enables dynamic door integrity + monster battering.
ShipDoor EnableDoorwayEnemyBarrier true Spawns a solid collider and NavMesh carving obstacle across the closed doorway.

Technical Details (For Developers)

  • Plugin GUID: com.khameli0n.dynamicshipdoorhealth
  • Target Framework: netstandard2.1 (BepInEx 5 / HarmonyX)
  • Multiplayer Note: HangarShipDoor.Update runs locally on each client; on breach (doorPower <= 0f), the host calls StartOfRound.SetDoorsClosedServerRpc(false) while non-host clients call StartOfRound.SetShipDoorsClosed(false). For identical door integrity numbers across all players, install on all clients.

Harmony Patches (DynamicShipDoorHealth.Patches.ShipDoorPatches)

Target Method Type Behavior
HangarShipDoor.Update Prefix Yields (return true) during inShipPhase after resetting overheated = false, doorPower = 1f, and deactivating the barrier. When landed (!inShipPhase), replaces vanilla update (return false): invokes SetScreenDisplay, forces overheated = false, buttonsEnabled = true, triggerScript.interactable = true, manages barrier visibility, scans enemies, applies DPS/regen, and updates doorPowerDisplay.
StartOfRound.SetShipDoorsClosed Postfix When closed == true, resets doorPower = 1f, lastDisplayedMeter = -1, and sets doorPowerDisplay.text to "100%".
StartOfRound.SetShipDoorsOverheatServerRpc Prefix Suppresses overheat server RPC (return false) when ShipDoorInfinitePower is enabled.
StartOfRound.Start Postfix Resets cached scan state and creates DynamicShipDoor_EnemyBarrier if EnableDoorwayEnemyBarrier is enabled.
StartOfRound.ShipLeave Postfix Resets cached scan timers/counters and deactivates DynamicShipDoor_EnemyBarrier.

Mechanics & Constants

  • Enemy Scan: Runs every 0.15s via Object.FindObjectsOfType<EnemyAI>(), checking active, alive, outside enemies within 6.5f meters of StartOfRound.shipDoorNode (fallback: outsideDoorPosition, then HangarShipDoor.transform).
  • Damage Tiers (Normalized doorPower per second per enemy):
    • Heavy (0.12f/s, ~8.3s solo): enemyName contains mouth, dog, forest, giant, worm, radmech, mech, crawler, thumper.
    • Medium (0.07f/s, ~14.3s solo): enemyName contains mask, baboon, spider, nutcracker, butler, centipede.
    • Light (0.04f/s, 25.0s solo): all other outside enemies.
  • Recovery & Feedback:
    • Regenerates doorPower by +0.05f * Time.deltaTime when cachedAttackingCount == 0 while closed.
    • Plays a random StartOfRound.shutDoorMetal clip every 0.5s while attacked, plus HUDManager.ShakeCamera(ScreenShakeType.Small) if localPlayerController.isInHangarShipRoom.
    • On breach (doorPower <= 0f), calls PlayDoorAnimation(false), opens doors via StartOfRound, plays openingHangarDoorAudio, and triggers ScreenShakeType.Big.
  • Doorway Barrier (DynamicShipDoor_EnemyBarrier):
    • Child of StartOfRound.elevatorTransform on layer "Room", positioned/rotated at shipDoorNode (or outsideDoorPosition).
    • Components: NavMeshObstacle (NavMeshObstacleShape.Box, carving = true, carveOnlyStationary = false, size = (3.2, 3.5, 0.8), center = (0, 1.5, 0)) and non-trigger BoxCollider with matching bounds.