mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-11 07:58:57 +01:00
4ecb0bc21c
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.
71 lines
2.5 KiB
Plaintext
71 lines
2.5 KiB
Plaintext
/datum/build_mode/basic
|
|
the_default = TRUE
|
|
name = "Basic"
|
|
icon_state = "buildmode1"
|
|
|
|
/datum/build_mode/basic/Help()
|
|
to_chat(user, SPAN_NOTICE("***********************************************************"))
|
|
to_chat(user, SPAN_NOTICE("Left Click = Construct / Upgrade"))
|
|
to_chat(user, SPAN_NOTICE("Right Click = Deconstruct / Delete / Downgrade"))
|
|
to_chat(user, SPAN_NOTICE("Left Click + Ctrl = R-Window"))
|
|
to_chat(user, SPAN_NOTICE("Left Click + Alt = Airlock"))
|
|
to_chat(user, "")
|
|
to_chat(user, SPAN_NOTICE("Use the directional button in the upper left corner to"))
|
|
to_chat(user, SPAN_NOTICE("change the direction of built objects."))
|
|
to_chat(user, SPAN_NOTICE("***********************************************************"))
|
|
|
|
/datum/build_mode/basic/OnClick(var/atom/object, var/list/pa)
|
|
if(istype(object,/turf) && pa["left"] && !pa["alt"] && !pa["ctrl"] )
|
|
if(istype(object,/turf/space))
|
|
var/turf/T = object
|
|
Log("Upgraded - [log_info_line(object)]")
|
|
T.ChangeTurf(/turf/simulated/floor)
|
|
return
|
|
else if(istype(object,/turf/simulated/floor))
|
|
var/turf/T = object
|
|
Log("Upgraded - [log_info_line(object)]")
|
|
T.ChangeTurf(/turf/simulated/wall)
|
|
return
|
|
else if(istype(object,/turf/simulated/wall))
|
|
var/turf/T = object
|
|
Log("Upgraded - [log_info_line(object)]")
|
|
T.ChangeTurf(/turf/simulated/wall/r_wall)
|
|
return
|
|
else if(pa["right"])
|
|
if(istype(object,/turf/simulated/wall))
|
|
var/turf/T = object
|
|
Log("Downgraded - [log_info_line(object)]")
|
|
T.ChangeTurf(/turf/simulated/floor)
|
|
return
|
|
else if(istype(object,/turf/simulated/floor))
|
|
var/turf/T = object
|
|
Log("Downgraded - [log_info_line(object)]")
|
|
T.ChangeTurf(/turf/space)
|
|
return
|
|
else if(istype(object,/turf/simulated/wall/r_wall))
|
|
var/turf/T = object
|
|
Log("Downgraded - [log_info_line(object)]")
|
|
T.ChangeTurf(/turf/simulated/wall)
|
|
return
|
|
else if(istype(object,/obj))
|
|
Log("Deleted - [log_info_line(object)]")
|
|
qdel(object)
|
|
return
|
|
else if(istype(object,/turf) && pa["alt"] && pa["left"])
|
|
var/airlock = new/obj/structure/machinery/door/airlock(get_turf(object))
|
|
Log("Created - [log_info_line(airlock)]")
|
|
else if(istype(object,/turf) && pa["ctrl"] && pa["left"])
|
|
var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object))
|
|
Log("Created - [log_info_line(object)]")
|
|
switch(host.dir)
|
|
if(NORTH)
|
|
WIN.set_dir(NORTH)
|
|
if(SOUTH)
|
|
WIN.set_dir(SOUTH)
|
|
if(EAST)
|
|
WIN.set_dir(EAST)
|
|
if(WEST)
|
|
WIN.set_dir(WEST)
|
|
if(NORTHWEST)
|
|
WIN.set_dir(NORTHWEST)
|