mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-30 00:21:11 +01:00
Repaths obj/machinery to obj/structure/machinery. **Note for reviewers:** the only meaningful changed code exists within **code/game/objects/structures.dm** and **code/game/objects/structures/_machinery.dm**, largely concerning damage procs. With the exception of moving airlock defines to their own file, ALL OTHER CHANGES ARE STRICTLY PATH CHANGES. Objects, _categorically_, are largely divided between those you can hold in your hand/inventory and those you can't. Machinery objects are already subtypes of Structures behaviorally, this PR just makes their pathing reflect that, and allows for future work (tool actions, more health/destruction functionality) to be developed without unnecessary code duplication. I have tested this PR by loading up the Horizon and dismantling various machines and structures with tools, shooting guns of various types throughout the ship, and detonating a bunch of explosions throughout the ship.
51 lines
1.6 KiB
Plaintext
51 lines
1.6 KiB
Plaintext
/obj/structure/machinery/stargazer
|
|
name = "stargazer system"
|
|
icon = 'icons/obj/machinery/stargazer.dmi'
|
|
icon_state = "stargazer_off"
|
|
anchored = TRUE
|
|
density = TRUE
|
|
pixel_x = -32
|
|
pixel_y = -24
|
|
var/image/star_system_image
|
|
|
|
/obj/structure/machinery/stargazer/feedback_hints(mob/user, distance, is_adjacent)
|
|
. += ..()
|
|
if(!(stat & BROKEN) && !(stat & NOPOWER))
|
|
. += SPAN_NOTICE("\The [src] shows the current sector to be <a href='byond://?src=[REF(src)];examine=1'>[SSatlas.current_sector.name]</a>.")
|
|
|
|
/obj/structure/machinery/stargazer/Initialize(mapload, d, populate_components)
|
|
. = ..()
|
|
star_system_image = image(icon, null, "stargazer_[SSatlas.current_sector.name]")
|
|
star_system_image.plane = ABOVE_LIGHTING_PLANE
|
|
star_system_image.layer = SUPERMATTER_WALL_LAYER
|
|
power_change()
|
|
|
|
/obj/structure/machinery/stargazer/power_change()
|
|
..()
|
|
if(stat & BROKEN)
|
|
icon_state = "stargazer_off"
|
|
ClearOverlays()
|
|
set_light(0)
|
|
else if(!(stat & NOPOWER))
|
|
icon_state = "stargazer_on"
|
|
AddOverlays(star_system_image)
|
|
var/stargazer_light_color = LIGHT_COLOR_HALOGEN
|
|
if(SSatlas.current_sector.starlight_color)
|
|
stargazer_light_color = SSatlas.current_sector.starlight_color
|
|
set_light(6, 2, stargazer_light_color)
|
|
else
|
|
icon_state = "stargazer_off"
|
|
ClearOverlays()
|
|
set_light(0)
|
|
|
|
/obj/structure/machinery/stargazer/Topic(href, href_list, datum/ui_state/state)
|
|
if((stat & BROKEN) || (stat & NOPOWER))
|
|
return TRUE
|
|
if(!is_in_sight(usr, src))
|
|
return TRUE
|
|
if(usr.incapacitated(INCAPACITATION_KNOCKOUT))
|
|
return TRUE
|
|
|
|
if(href_list["examine"])
|
|
to_chat(usr, SSatlas.current_sector.get_chat_description())
|