Skip to content

Commit

Permalink
[MIRROR] Stun Baton Eyecandy | Glows and Sparks (#975)
Browse files Browse the repository at this point in the history
* Stun Baton Eyecandy | Glows and Sparks (#81449)

## About The Pull Request
Adds a soft glow and sparks to the stun baton and stun prod. Video
below:

https://github.com/tgstation/tgstation/assets/70779744/468351ef-0574-46b9-8d32-58cf40651f3a
## Why It's Good For The Game

![metro-cop](https://github.com/tgstation/tgstation/assets/70779744/63b53d1f-6489-49b2-8c91-1e6faaa8370e)

Looks cool.
## Changelog
:cl:
add: In an attempt to stop the greytide, NanoTrasen has increased
security's baton energy output. This has, through testing, done nothing
but make the device spark more than it used to.
/:cl:

* Stun Baton Eyecandy | Glows and Sparks

---------

Co-authored-by: WinterDarkraven <[email protected]>
  • Loading branch information
2 people authored and StealsThePRs committed Feb 17, 2024
1 parent 01ddf28 commit 4fd5b8b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions code/game/objects/items/melee/baton.dm
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,12 @@
on_stun_volume = 50
active = FALSE
context_living_rmb_active = "Harmful Stun"
light_range = 1.5
light_system = OVERLAY_LIGHT
light_on = FALSE
light_color = LIGHT_COLOR_ORANGE
light_power = 0.5


var/throw_stun_chance = 35
var/obj/item/stock_parts/cell/cell
Expand Down Expand Up @@ -541,6 +547,8 @@
active = !active
balloon_alert(user, "turned [active ? "on" : "off"]")
playsound(src, SFX_SPARKS, 75, TRUE, -1)
toggle_light(user)
do_sparks(1, TRUE, src)
else
active = FALSE
if(!cell)
Expand All @@ -550,6 +558,11 @@
update_appearance()
add_fingerprint(user)

/// Toggles the stun baton's light
/obj/item/melee/baton/security/proc/toggle_light(mob/user)
set_light_on(!light_on)
return

/obj/item/melee/baton/security/proc/deductcharge(deducted_charge)
if(!cell)
return
Expand All @@ -559,6 +572,7 @@
if(active && cell.charge < cell_hit_cost)
//we're below minimum, turn off
active = FALSE
set_light_on(FALSE)
update_appearance()
playsound(src, SFX_SPARKS, 75, TRUE, -1)

Expand Down Expand Up @@ -649,6 +663,8 @@
if (!cell || cell.charge < cell_hit_cost)
return
active = !active
toggle_light()
do_sparks(1, TRUE, src)
playsound(src, SFX_SPARKS, 75, TRUE, -1)
update_appearance()

Expand Down

0 comments on commit 4fd5b8b

Please sign in to comment.