Skip to content

Commit

Permalink
Fix colony lights having default implementation for explosion acts
Browse files Browse the repository at this point in the history
  • Loading branch information
Drulikar committed Apr 10, 2024
1 parent 659327b commit c696055
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 c696055

Please sign in to comment.