Skip to content

Commit

Permalink
Fix colony lights sometimes deleting after explosions (#6131)
Browse files Browse the repository at this point in the history
# About the pull request

I don't know if this was ever implemented, but I would like colony
lights to break down, not disappear if they explode.

# Explain why it's good for the game

Fixes #6130 

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>


![image](https://github.com/cmss13-devs/cmss13/assets/76988376/66ed4f1c-d2c9-4be6-8900-61cc9c54fe9c)

</details>


# Changelog
:cl: Drathek
fix: Fixed colony lights deconstructing sometimes after explosions
/:cl:
  • Loading branch information
Drulikar committed Apr 13, 2024
1 parent 6412329 commit ea0fcc8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
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

0 comments on commit ea0fcc8

Please sign in to comment.