Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix colony lights sometimes deleting after explosions #6131

Merged
merged 1 commit into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions code/game/machinery/colony_floodlights.dm
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,27 @@
else if(!is_lit)
. += SPAN_INFO("It doesn't seem powered.")

/obj/structure/machinery/colony_floodlight/ex_act(severity)
switch(severity)
if(0 to EXPLOSION_THRESHOLD_LOW)
if(prob(25))
set_damaged()
return
if(EXPLOSION_THRESHOLD_LOW to EXPLOSION_THRESHOLD_MEDIUM)
if(prob(50))
set_damaged()
return
if(EXPLOSION_THRESHOLD_MEDIUM to INFINITY)
set_damaged()
return

/obj/structure/machinery/colony_floodlight/proc/set_damaged()
playsound(src, "glassbreak", 70, 1)
damaged = TRUE
if(is_lit)
set_light(0)
update_icon()

/obj/structure/machinery/colony_floodlight/proc/toggle_light()
is_lit = !is_lit
if(!damaged)
Expand Down
6 changes: 1 addition & 5 deletions code/modules/mob/living/carbon/xenomorph/attack_alien.dm
Original file line number Diff line number Diff line change
Expand Up @@ -864,11 +864,7 @@
M.visible_message("[M] slashes away at [src]!","We slash and claw at the bright light!", max_distance = 5, message_flags = CHAT_TYPE_XENO_COMBAT)
health = max(health - rand(M.melee_damage_lower, M.melee_damage_upper), 0)
if(!health)
playsound(src, "glassbreak", 70, 1)
damaged = TRUE
if(is_lit)
set_light(0)
update_icon()
set_damaged()
else
playsound(loc, 'sound/effects/Glasshit.ogg', 25, 1)
return XENO_ATTACK_ACTION
Expand Down
Loading