Skip to content

Commit

Permalink
[MIRROR] Self destruct tile fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SierraKomodo authored and SuhEugene committed Sep 14, 2023
1 parent a7aeb57 commit 47f6320
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 25 deletions.
32 changes: 16 additions & 16 deletions code/game/machinery/nuclear_bomb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@ var/global/bomb_set
deployable = 1
extended = 1

var/list/flash_tiles = list()
var/list/inserters = list()
var/last_turf_state

Expand All @@ -463,14 +462,17 @@ var/global/bomb_set
maxTime = 900

/obj/machinery/nuclearbomb/station/Initialize()
. = ..()
..()
verbs -= /obj/machinery/nuclearbomb/verb/toggle_deployable
for(var/turf/simulated/floor/T in get_area(src))
if(istype(T.flooring, /singleton/flooring/reinforced/circuit/red))
flash_tiles += T
update_icon()
for(var/obj/machinery/self_destruct/ch in get_area(src))
inserters += ch
return INITIALIZE_HINT_LATELOAD


/obj/machinery/nuclearbomb/station/LateInitialize(mapload, ...)
// Relies on turfs to have their `flooring` var set, which is done during init.
queue_icon_update()


/obj/machinery/nuclearbomb/station/attackby(obj/item/O as obj, mob/user as mob)
if(isWrench(O))
Expand Down Expand Up @@ -498,10 +500,6 @@ var/global/bomb_set
return
..()

/obj/machinery/nuclearbomb/station/Destroy()
flash_tiles.Cut()
return ..()

/obj/machinery/nuclearbomb/station/Process()
..()
if(timeleft > 0 && GAME_STATE < RUNLEVEL_POSTGAME)
Expand All @@ -526,27 +524,29 @@ var/global/bomb_set

/obj/machinery/nuclearbomb/station/on_update_icon()
var/target_icon_state
var/turf_color = COLOR_BLACK
if(lighthack)
target_icon_state = "rcircuit_off"
icon_state = "idle"
else if(timing == -1)
target_icon_state = "rcircuitanim"
icon_state = "exploding"
turf_color = COLOR_RED
else if(timing)
target_icon_state = "rcircuitanim"
icon_state = "urgent"
turf_color = COLOR_RED
else if(!safety)
target_icon_state = "rcircuit"
icon_state = "greenlight"
turf_color = COLOR_RED
else
target_icon_state = "rcircuit_off"
icon_state = "idle"

if(!last_turf_state || target_icon_state != last_turf_state)
for(var/thing in flash_tiles)
var/turf/simulated/floor/T = thing
if(!istype(T.flooring, /singleton/flooring/reinforced/circuit/red))
flash_tiles -= T
continue
T.icon_state = target_icon_state
for (var/turf/simulated/floor/floor in get_area(src))
if (istype(floor.flooring, /singleton/flooring/reinforced/circuit/selfdestruct))
floor.icon_state = target_icon_state
floor.set_light(l_color = turf_color)
last_turf_state = target_icon_state
5 changes: 4 additions & 1 deletion code/game/turfs/flooring/flooring.dm
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,11 @@

/singleton/flooring/reinforced/circuit/red
icon_base = "rcircuit"

/singleton/flooring/reinforced/circuit/selfdestruct
icon_base = "rcircuit_off"
flags = TURF_ACID_IMMUNE
can_paint = 0
can_paint = FALSE

/singleton/flooring/reinforced/cult
name = "engraved floor"
Expand Down
11 changes: 10 additions & 1 deletion code/game/turfs/flooring/flooring_premade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
light_max_bright = 3
light_color = COLOR_GREEN

/turf/simulated/floor/blackgrid
/turf/simulated/floor/redgrid
name = "mainframe floor"
icon = 'icons/turf/flooring/circuit.dmi'
icon_state = "rcircuit"
Expand All @@ -32,6 +32,15 @@
light_max_bright = 2
light_color = COLOR_RED

/turf/simulated/floor/selfestructgrid
name = "self-destruct mainframe floor"
icon = 'icons/turf/flooring/circuit.dmi'
icon_state = "rcircuit_off"
initial_flooring = /singleton/flooring/reinforced/circuit/selfdestruct
light_outer_range = 2
light_max_bright = 2
light_color = COLOR_BLACK

/turf/simulated/floor/wood
name = "wooden floor"
icon = 'icons/turf/flooring/wood.dmi'
Expand Down
14 changes: 7 additions & 7 deletions maps/torch/torch5_deck1.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -22423,7 +22423,7 @@
/obj/machinery/keycard_auth/torch{
pixel_x = -28
},
/turf/simulated/floor/blackgrid,
/turf/simulated/floor/selfestructgrid,
/area/security/nuke_storage)
"mGj" = (
/obj/machinery/atmospherics/pipe/simple/visible/cyan{
Expand All @@ -22436,7 +22436,7 @@
dir = 1;
icon_state = "warning"
},
/turf/simulated/floor/blackgrid,
/turf/simulated/floor/selfestructgrid,
/area/security/nuke_storage)
"mHr" = (
/obj/machinery/atmospherics/pipe/simple/visible/cyan{
Expand Down Expand Up @@ -22555,7 +22555,7 @@
dir = 4
},
/obj/random_multi/single_item/poppy,
/turf/simulated/floor/blackgrid,
/turf/simulated/floor/selfestructgrid,
/area/security/nuke_storage)
"mOb" = (
/obj/effect/floor_decal/industrial/warning{
Expand Down Expand Up @@ -22635,7 +22635,7 @@
/obj/machinery/nuclearbomb/station{
name = "ship self-destruct terminal"
},
/turf/simulated/floor/blackgrid,
/turf/simulated/floor/selfestructgrid,
/area/security/nuke_storage)
"mVW" = (
/obj/effect/wallframe_spawn/reinforced/polarized{
Expand Down Expand Up @@ -22721,7 +22721,7 @@
/obj/machinery/atmospherics/pipe/simple/hidden/supply{
dir = 4
},
/turf/simulated/floor/blackgrid,
/turf/simulated/floor/selfestructgrid,
/area/security/nuke_storage)
"nfb" = (
/obj/effect/floor_decal/industrial/warning{
Expand Down Expand Up @@ -22923,11 +22923,11 @@
/obj/machinery/keycard_auth/torch{
pixel_x = -28
},
/turf/simulated/floor/blackgrid,
/turf/simulated/floor/selfestructgrid,
/area/security/nuke_storage)
"nob" = (
/obj/effect/floor_decal/industrial/warning,
/turf/simulated/floor/blackgrid,
/turf/simulated/floor/selfestructgrid,
/area/security/nuke_storage)
"npb" = (
/obj/structure/table/standard,
Expand Down

0 comments on commit 47f6320

Please sign in to comment.