You are viewing a potentially older version of this package. View all versions.
dontbotherme-ExplosiveSprayPaint-1.1.4 icon

ExplosiveSprayPaint

Adds a configurable chance for spray paint cans to rupture explosively when shaken.

Date uploaded 3 weeks ago
Version 1.1.4
Download link dontbotherme-ExplosiveSprayPaint-1.1.4.zip
Downloads 19
Dependency string dontbotherme-ExplosiveSprayPaint-1.1.4

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

ExplosiveSprayPaint

A BepInEx/Harmony mod for Lethal Company that gives every spray paint shake a host-authoritative chance to rupture the can.

Default behavior:

  • 5% chance for a normal rupture when shaking a spray paint can.
  • 0.5% chance for a catastrophic rupture, rolled before the normal chance.
  • The ruptured can is deleted immediately.
  • The blast is small and non-instant-kill by default, but it can finish off already low-health players.
  • Nearby enemies and players take modest damage.
  • Paint splats are spawned around nearby floors and walls using the current spray can color when it can be resolved.
  • Visual particles, vanilla explosion effect/sound, optional camera shake, and a HUD tip are played client-side.
  • Only the host/server rolls the explosion chance and applies damage/despawn logic.

Build

Install BepInEx for Lethal Company, then set LETHAL_COMPANY_DIR to your game folder before building:

$env:LETHAL_COMPANY_DIR="C:\Program Files (x86)\Steam\steamapps\common\Lethal Company"
dotnet build -c Release

If you build from a Gale/r2modman/Thunderstore profile, point BEPINEX_PROFILE_DIR at that profile so the project uses its installed BepInEx pack:

$env:LETHAL_COMPANY_DIR="D:\SteamLibrary\steamapps\common\Lethal Company"
$env:BEPINEX_PROFILE_DIR="C:\Users\hunte\AppData\Roaming\com.kesomannen.gale\lethal-company\profiles\ExplosiveSpray"
dotnet build -c Release

If no local BepInEx core folder is found, the project falls back to NuGet compile references for BepInEx/Harmony.

The compiled mod DLL will be in:

bin\Release\ExplosiveSprayPaint.dll

Copy it into:

BepInEx\plugins\ExplosiveSprayPaint\

Config

The config file is generated at:

BepInEx\config\huntedbyacreature.explosivespraypaint.cfg

Important entries:

  • ExplosionChancePercent: default 5
  • CatastrophicExplosionChancePercent: default 0.5
  • EnableScreenShake: default true
  • EnableHudNotification: default true
  • GlowInTheDarkPaint: default true
  • EnableFunnyExplosionPhysics: default false
  • NormalPlayerDamage: default 20
  • CatastrophicPlayerDamage: default 45
  • NormalBlastRadius: default 4
  • CatastrophicBlastRadius: default 8
  • NormalPaintSplats: default 28
  • CatastrophicPaintSplats: default 90

Compatibility Notes

The shake detector patches SprayPaintItem.ItemInteractLeftRight(bool right) and treats right == false as the shake action, which matches current Lethal Company modding practice. If a future game update changes the control mapping, adjust the condition in src/Patches/SprayPaintItemPatches.cs.

Spray paint color and decal prefab fields are partially private and may differ between game builds or spray-paint overhaul mods. SprayPaintIntrospection probes common field names first and falls back to renderer color/generated decals when needed.

Thunderstore Package Layout

Recommended release package:

ExplosiveSprayPaint.zip
  manifest.json
  README.md
  CHANGELOG.md
  icon.png
  BepInEx/
    plugins/
      ExplosiveSprayPaint/
        ExplosiveSprayPaint.dll

CHANGELOG

Changelog

1.1.7

  • Fixed multiplayer cleanup so ruptured spray cans clear the holder's item slot and despawn for all clients.
  • Explosion messages now include the holder's item slot so clients can remove the ruptured can even if despawn arrives first.
  • Avoided vanilla DestroyObjectInHand for rupture cleanup because it can hide the local copy without removing the networked item.

1.1.6

  • Reduced runtime watcher overhead by caching the held spray can and throttling scene-wide fallback scans.
  • Prevented duplicate watcher ticks from plugin and player update loops in the same frame.
  • Added compatibility settings for disabling the fallback watcher or slowing its scene scan interval.

1.1.5

  • Cleaned public README build instructions to remove local machine/profile paths.
  • Refreshed the release package with the new Thunderstore icon.

1.1.4

  • Added GlowInTheDarkPaint to toggle between bright unlit paint splats and lit paint splats.
  • Added EnableFunnyExplosionPhysics to restore the high-force v1.0.8 launch behavior on purpose.

1.1.3

  • Paint color resolution now follows the selected spray can material index more closely.
  • Explosion splats prefer the selected spray particle material before falling back to the vanilla decal material.
  • Added debug logging that reports which material or texture supplied the synchronized paint color.

1.1.2

  • Paint raycasts now reject players, grabbable items, enemies, triggers, disabled colliders, and invisible utility colliders.
  • Paint splats are parented to the hit surface while preserving world placement.
  • Paint diagnostics now include rejected hit count.

1.1.1

  • Fixed fallback paint splats rendering as solid white squares by using generated transparent splat textures.
  • Removed custom fallback HDRP DecalProjector usage that produced instancing errors.
  • Fixed spray can color lookup to use sprayCanMatsIndex.
  • Fallback splat textures are cleaned up with their temporary GameObjects.

1.1.0

  • Paint spawning now logs explosion paint parameters, raycast attempts/hits, vanilla placements, and visible fallback splats.
  • Paint placement first tries Lethal Company's internal AddSprayPaintLocal and always creates visible surface splats as a fallback.
  • Removed explosion triggers from normal spray-use paths; spraying paint is safe, shaking is risky.
  • Host rejects rupture attempts while the can is actively spraying.
  • Spray audio, particles, and state flags are stopped before ruptured can cleanup.

1.0.9

  • Greatly reduced vanilla explosion physics force and extra player knockback.
  • Removed duplicate host-side client explosion playback that could double-apply local force/effects.
  • Added configurable paint splatter radius, lifetime, and low-force explosion tuning.
  • Reworked paint splatter placement with floor, wall, and angled-surface raycasts.
  • Added visible fallback HDRP decals/quads when the vanilla spray paint prefab cannot be used.
  • Explosion messages now synchronize blast radius, physics force, paint radius, and paint count from the host.

1.0.8

  • Prevents early plugin component destruction from removing Harmony patches and watcher hooks.
  • Adds a PlayerControllerB update-loop patch to keep the runtime watcher ticking even if the plugin component is destroyed.

1.0.7

  • Moved the runtime watcher off a temporary GameObject that was being disabled immediately after startup.
  • The watcher now runs from the plugin's own update loop and keeps its Unity-log fallback subscription alive.

1.0.6

  • Added a Unity log fallback detector for vanilla spray/shake log messages in stubborn mod profiles.
  • Runtime watcher now finds the local held spray can by scanning active spray paint items, not only currentlyHeldObjectServer.
  • Host now plays the local client-side explosion effect directly as well as broadcasting it.

1.0.5

  • Added a runtime watcher fallback that tracks the local held spray can directly.
  • The watcher triggers the same host-authoritative explosion flow when the shake meter increases.
  • When TreatSprayUseAsShake is enabled, the watcher also treats spray-start transitions as test triggers.

1.0.4

  • Fixed manual Harmony patch argument order so postfixes are no longer registered as transpilers.

1.0.3

  • Switched spray paint hooks from attribute discovery to explicit manual Harmony patching.
  • Added startup patch verification logs for each hooked spray paint method.
  • Added startup logging of loaded config values.

1.0.2

  • Added a fallback detector that watches the spray can's internal shake meter increasing.
  • Added optional TreatSprayUseAsShake compatibility config for profiles where the shake input is remapped or unavailable.
  • Added debug logging when spray paint items initialize.

1.0.1

  • Replaced strict ownership check with a more compatible local-holder check.
  • Added optional debug logging for shake detection, host roll decisions, and explosion broadcast flow.

1.0.0

  • Initial release.
  • Adds host-authoritative spray paint shake explosions.
  • Adds catastrophic rupture chance, configurable damage/radius/paint count, HUD tip, particles, screen shake, and multiplayer broadcast effects.