Files
Bubberstation/code/modules/shuttle/shuttle_rotate.dm
uraniummeltdown 09be3e9b6b Airlock Construction Update (#33152)
* removed typetext and icontext vars from door assemblies, airlock painter no longer works on door assemblies
removed 'anchored = TRUE, state = 1' copypasta from door assemblies
door assemblies update their name more regularly during construction
added new airlock types to airlock painter on airlocks, and to the RCD
airlock assemblies built with metal are now in a list, you can build many more airlocks
vault door assemblies can be built with 4 plasteel
added a solid version of station2 airlocks, renamed to "public airlock"
glass and mineral sheets are now able to be welded out of door assemblies

* find n replace airlock/glass to airlock/glass_public in maps
door_assembly_glass to door_assembly_public

* made highsec airlocks built with 6 plasteel, removed from RCD and airlock painter
vault doors built with 8 plasteel
removed redundant vars in airlock_types.dm
reverts the dumb rglass 'replacement' addition in door assembly construction

* moved airlock assembly defines to construction defines file
fixed incorrectly named shuttle airlock glass_closed and maint panel protected closed overlays
improved examination message for glass/minerals present in assembly

* airlocks take their dir from the assembly when built from assembly
removed "vertical" variant of survival pod airlock, unneeded
survival pod airlock assembly can have glass applied
solid and glass overlays for survival pod airlocks

* OOPs some airlocks, removes a duplicate door assembly, removes some var edits on maps for a new glass type

* turn copied door assembly code into a proc
some feedback during door assembly construction
door assembly created airlock takes name from base_name if no custom name
moved plasma airlock proc to airlock_types.dm
2017-12-10 22:23:43 +01:00

107 lines
3.0 KiB
Plaintext

/*
All shuttleRotate procs go here
If ever any of these procs are useful for non-shuttles, rename it to proc/rotate and move it to be a generic atom proc
*/
/************************************Base proc************************************/
/atom/proc/shuttleRotate(rotation, params=ROTATE_DIR|ROTATE_SMOOTH|ROTATE_OFFSET)
if(params & ROTATE_DIR)
//rotate our direction
setDir(angle2dir(rotation+dir2angle(dir)))
//resmooth if need be.
if(smooth && (params & ROTATE_SMOOTH))
queue_smooth(src)
//rotate the pixel offsets too.
if((pixel_x || pixel_y) && (params & ROTATE_OFFSET))
if(rotation < 0)
rotation += 360
for(var/turntimes=rotation/90;turntimes>0;turntimes--)
var/oldPX = pixel_x
var/oldPY = pixel_y
pixel_x = oldPY
pixel_y = (oldPX*(-1))
SendSignal(COMSIG_ATOM_ROTATE, rotation, params)
/************************************Turf rotate procs************************************/
/turf/closed/mineral/shuttleRotate(rotation, params)
params &= ~ROTATE_OFFSET
return ..()
/************************************Mob rotate procs************************************/
//override to avoid rotating pixel_xy on mobs
/mob/shuttleRotate(rotation, params)
params = NONE
. = ..()
if(!buckled)
setDir(angle2dir(rotation+dir2angle(dir)))
/mob/dead/observer/shuttleRotate(rotation, params)
. = ..()
update_icon()
/************************************Structure rotate procs************************************/
/obj/structure/cable/shuttleRotate(rotation, params)
params &= ~ROTATE_DIR
. = ..()
if(d1)
d1 = angle2dir(rotation+dir2angle(d1))
if(d2)
d2 = angle2dir(rotation+dir2angle(d2))
//d1 should be less than d2 for cable icons to work
if(d1 > d2)
var/temp = d1
d1 = d2
d2 = temp
update_icon()
//Fixes dpdir on shuttle rotation
/obj/structure/disposalpipe/shuttleRotate(rotation, params)
. = ..()
var/new_dpdir = 0
for(var/D in GLOB.cardinals)
if(dpdir & D)
new_dpdir = new_dpdir | angle2dir(rotation+dir2angle(D))
dpdir = new_dpdir
/obj/structure/table/wood/bar/shuttleRotate(rotation, params)
. = ..()
boot_dir = angle2dir(rotation + dir2angle(boot_dir))
/obj/structure/alien/weeds/shuttleRotate(rotation, params)
params &= ~ROTATE_OFFSET
return ..()
/************************************Machine rotate procs************************************/
/obj/machinery/atmospherics/shuttleRotate(rotation, params)
var/list/real_node_connect = getNodeConnects()
for(DEVICE_TYPE_LOOP)
real_node_connect[I] = angle2dir(rotation+dir2angle(real_node_connect[I]))
. = ..()
SetInitDirections()
var/list/supposed_node_connect = getNodeConnects()
var/list/nodes_copy = nodes.Copy()
for(DEVICE_TYPE_LOOP)
var/new_pos = supposed_node_connect.Find(real_node_connect[I])
nodes[new_pos] = nodes_copy[I]
//prevents shuttles attempting to rotate this since it messes up sprites
/obj/machinery/gateway/shuttleRotate(rotation, params)
params = NONE
return ..()
//prevents shuttles attempting to rotate this since it messes up sprites
/obj/machinery/gravity_generator/shuttleRotate(rotation, params)
params = NONE
return ..()