TheGunWorksNow
i made the gun work and an ammo system. physical item ammo i might add later but its kinda hardFunctional Shotgun 1.1
Turns the joke shotgun (FFShotgun) into a working weapon. Equip it and left click.
- 8 pellets per shot with spread, range and per-pellet damage (headshots hit harder).
- A magazine (2 shells) with auto-reload when empty, or press your reload key early. HUD shows shells / "RELOADING...".
- Sound: the Abandoned One's own gunfire, impact and reload audio, looked up from the game. Nothing is added to the game.
- Muzzle flash, pellet tracers and impact flashes.
- Monsters hit by a volley get stunned; optionally killed after N pellet hits (host only).
- Other players who also have the mod hear and see your shots.
Settings
Edit UserData/MelonPreferences.cfg, section [FunctionalShotgun] (after the first launch):
Pellets, DamagePerPellet, HeadshotMultiplier, Range, Spread, FireDelaySeconds, MagazineSize, InfiniteAmmo,
ReloadSeconds, HurtPlayers, StunMonsterSeconds, KillMonsterAfterHits, SuppressOriginalClick, Volume, ShowAmmoHud, Tracers.
Notes
- Damage is dealt by the shooter's game: as host it uses the game's damage call, as a client it asks the server (echo_SubtractHp).
- Pellets do not hurt other players unless
HurtPlayersis true.
New in 1.1
- Visible bullets: bright streaks travel from the muzzle to where each pellet lands.
- Muzzle light uses the game's own light component (UL_FastLight), plus the firecrackers' explosion particles (cloned and scaled down) for the flash and impacts. Hold or drop firecrackers once so the effect is loaded.
- Close range kills: inside CloseKillRange (7 m) CloseKillPellets (3) pellets on one target kill it. Damage is also multiplied up close and fades to normal at FalloffRange (30 m), so long shots still work.
- Pellets stop at walls and at closed doors (FairyDoor.Open == false), even if the door collider is a trigger.
- The joke gun's no-ammo click is silenced while the gun has shells (SuppressOriginalClick). It still clicks when you are empty / reloading. Settings: CloseKillRange, CloseKillPellets, CloseDamageMultiplier, FalloffRange, FlashIntensity, FlashRange, BulletSpeed, BulletLength, UseFirecrackerEffect, FlashScaleV2, FlashSeconds, FlashDistance, BeadCount, ShakeSeconds, ShakeDegrees, SpreadWide, PelletCount.
1.4.0
- U toggles the safety while holding the gun. R loads one shell at a time (both when two are carried and both chambers are empty). Capacity 2.
- Tiny 0.2 s explosions where pellets hit; yellow beads stay bright 0.1 s then fade 0.1 s.
- On-screen text copies the game's UI font.
- F9 while holding the gun writes UserData\FunctionalShotgun_research.txt (needed to add the shell item / shop entry).
1.5.0
- "shotgun ammo" is sold by the ECD supplier (500 per case, 2 shells per case). Shells in your pocket are saved between sessions. R loads from them.
- Everyone in the lobby (especially the host) needs the mod for the shop item to work.
- The purchase spawns a stand-in glowstick on the server; the mod removes it again.
- Log lines "UsePrefix:" / "Playing during shot:" help track down the dry-fire click.
1.6.0
- F3 opens a small menu: infinite ammo (free reloads), no shot cooldown, infinite magazine (999).
- The shell case purchase no longer leaves a glowstick behind (it is dropped and removed on the server).
- Setting renamed NeedShellsToReload (default on) so an old saved "off" can't bypass shells.
1.8.0
- Back to the 1.6.0 behaviour (pocket shells, original spark/bead timings).
- Shells in your pocket are saved per save file (UserData\FunctionalShotgun_shells.txt).
- Shell case price is now 8000 (setting ShellCaseCost2).
