Skip to content

Commit

Permalink
adds explosion handling to experimental sensor tower
Browse files Browse the repository at this point in the history
  • Loading branch information
Birdtalon committed Nov 20, 2023
1 parent ef2b7f1 commit 71034ea
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions code/modules/desert_dam/motion_sensor/sensortower.dm
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,25 @@
..()
update_icon()

/* Decreases the buildstate of the sensor tower and switches it off if affected by any explosion.
Higher severity explosion will damage the sensor tower more
*/
/obj/structure/machinery/sensortower/ex_act(severity)
if(buildstate == SENSORTOWER_BUILDSTATE_WRENCH)
return
switch(severity)
if(0 to EXPLOSION_THRESHOLD_LOW)
buildstate += 1
if(EXPLOSION_THRESHOLD_LOW to EXPLOSION_THRESHOLD_MEDIUM)
buildstate = min(buildstate + 2, buildstate)
if(EXPLOSION_THRESHOLD_HIGH to INFINITY)
buildstate = 3
if(is_on)
is_on = FALSE
cur_tick = 0
stop_processing()
update_icon()

#undef SENSORTOWER_BUILDSTATE_WORKING
#undef SENSORTOWER_BUILDSTATE_BLOWTORCH
#undef SENSORTOWER_BUILDSTATE_WIRECUTTERS
Expand Down

0 comments on commit 71034ea

Please sign in to comment.