mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-11 10:22:13 +00:00
Merge pull request #31302 from ninjanomnom/shuttle-rotation
Move shuttleRotate into the shuttle module
This commit is contained in:
committed by
CitadelStationBot
parent
e6830cfec3
commit
cedb56af1b
@@ -38,10 +38,6 @@
|
|||||||
if(istype(T, /turf/closed/mineral/random))
|
if(istype(T, /turf/closed/mineral/random))
|
||||||
Spread(T)
|
Spread(T)
|
||||||
|
|
||||||
/turf/closed/mineral/shuttleRotate(rotation)
|
|
||||||
setDir(angle2dir(rotation+dir2angle(dir)))
|
|
||||||
queue_smooth(src)
|
|
||||||
|
|
||||||
/turf/closed/mineral/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)
|
/turf/closed/mineral/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)
|
||||||
if(turf_type)
|
if(turf_type)
|
||||||
underlay_appearance.icon = initial(turf_type.icon)
|
underlay_appearance.icon = initial(turf_type.icon)
|
||||||
|
|||||||
@@ -60,10 +60,6 @@ GLOBAL_DATUM(the_gateway, /obj/machinery/gateway/centerstation)
|
|||||||
return
|
return
|
||||||
icon_state = "off"
|
icon_state = "off"
|
||||||
|
|
||||||
//prevents shuttles attempting to rotate this since it messes up sprites
|
|
||||||
/obj/machinery/gateway/shuttleRotate()
|
|
||||||
return
|
|
||||||
|
|
||||||
/obj/machinery/gateway/attack_hand(mob/user)
|
/obj/machinery/gateway/attack_hand(mob/user)
|
||||||
if(!detect())
|
if(!detect())
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -104,10 +104,6 @@
|
|||||||
direction = expected_dir
|
direction = expected_dir
|
||||||
..()
|
..()
|
||||||
|
|
||||||
/obj/machinery/door/airlock/survival_pod/shuttleRotate(rotation)
|
|
||||||
expected_dir = angle2dir(rotation+dir2angle(dir))
|
|
||||||
..()
|
|
||||||
|
|
||||||
/obj/machinery/door/airlock/survival_pod/vertical
|
/obj/machinery/door/airlock/survival_pod/vertical
|
||||||
dir = EAST
|
dir = EAST
|
||||||
expected_dir = EAST
|
expected_dir = EAST
|
||||||
@@ -127,10 +123,6 @@
|
|||||||
direction = expected_dir
|
direction = expected_dir
|
||||||
..()
|
..()
|
||||||
|
|
||||||
/obj/structure/door_assembly/door_assembly_pod/shuttleRotate(rotation)
|
|
||||||
expected_dir = angle2dir(rotation+dir2angle(dir))
|
|
||||||
..()
|
|
||||||
|
|
||||||
/obj/structure/door_assembly/door_assembly_pod/vertical
|
/obj/structure/door_assembly/door_assembly_pod/vertical
|
||||||
dir = EAST
|
dir = EAST
|
||||||
expected_dir = EAST
|
expected_dir = EAST
|
||||||
|
|||||||
@@ -743,10 +743,6 @@
|
|||||||
mob_spell_list -= S
|
mob_spell_list -= S
|
||||||
qdel(S)
|
qdel(S)
|
||||||
|
|
||||||
//override to avoid rotating pixel_xy on mobs
|
|
||||||
/mob/shuttleRotate(rotation)
|
|
||||||
setDir(angle2dir(rotation+dir2angle(dir)))
|
|
||||||
|
|
||||||
//You can buckle on mobs if you're next to them since most are dense
|
//You can buckle on mobs if you're next to them since most are dense
|
||||||
/mob/buckle_mob(mob/living/M, force = FALSE, check_loc = TRUE)
|
/mob/buckle_mob(mob/living/M, force = FALSE, check_loc = TRUE)
|
||||||
if(M.buckled)
|
if(M.buckled)
|
||||||
|
|||||||
@@ -437,21 +437,6 @@ By design, d1 is the smallest direction and d2 is the highest
|
|||||||
if(!P.connect_to_network()) //can't find a node cable on a the turf to connect to
|
if(!P.connect_to_network()) //can't find a node cable on a the turf to connect to
|
||||||
P.disconnect_from_network() //remove from current network
|
P.disconnect_from_network() //remove from current network
|
||||||
|
|
||||||
/obj/structure/cable/shuttleRotate(rotation)
|
|
||||||
//..() is not called because wires are not supposed to have a non-default direction
|
|
||||||
//Rotate connections
|
|
||||||
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()
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////
|
///////////////////////////////////////////////
|
||||||
// The cable coil object, used for laying cable
|
// The cable coil object, used for laying cable
|
||||||
|
|||||||
@@ -48,10 +48,6 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
|
|||||||
..()
|
..()
|
||||||
icon_state = "[get_status()]_[sprite_number]"
|
icon_state = "[get_status()]_[sprite_number]"
|
||||||
|
|
||||||
//prevents shuttles attempting to rotate this since it messes up sprites
|
|
||||||
/obj/machinery/gravity_generator/shuttleRotate()
|
|
||||||
return
|
|
||||||
|
|
||||||
/obj/machinery/gravity_generator/proc/get_status()
|
/obj/machinery/gravity_generator/proc/get_status()
|
||||||
return "off"
|
return "off"
|
||||||
|
|
||||||
|
|||||||
@@ -339,16 +339,6 @@
|
|||||||
if(current_size >= STAGE_FIVE)
|
if(current_size >= STAGE_FIVE)
|
||||||
deconstruct()
|
deconstruct()
|
||||||
|
|
||||||
//Fixes dpdir on shuttle rotation
|
|
||||||
/obj/structure/disposalpipe/shuttleRotate(rotation)
|
|
||||||
..()
|
|
||||||
var/new_dpdir = 0
|
|
||||||
for(var/D in GLOB.cardinals)
|
|
||||||
if(dpdir & D)
|
|
||||||
new_dpdir = new_dpdir | angle2dir(rotation+dir2angle(D))
|
|
||||||
dpdir = new_dpdir
|
|
||||||
|
|
||||||
|
|
||||||
// *** TEST verb
|
// *** TEST verb
|
||||||
//client/verb/dispstop()
|
//client/verb/dispstop()
|
||||||
// for(var/obj/structure/disposalholder/H in world)
|
// for(var/obj/structure/disposalholder/H in world)
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ All ShuttleMove procs go here
|
|||||||
return
|
return
|
||||||
|
|
||||||
if(rotation)
|
if(rotation)
|
||||||
shuttleRotate(rotation)
|
shuttleRotate(rotation) //see shuttle_rotate.dm
|
||||||
loc = newT
|
loc = newT
|
||||||
if(length(client_mobs_in_contents))
|
if(length(client_mobs_in_contents))
|
||||||
update_parallax_contents()
|
update_parallax_contents()
|
||||||
@@ -126,26 +126,6 @@ All ShuttleMove procs go here
|
|||||||
/area/proc/afterShuttleMove()
|
/area/proc/afterShuttleMove()
|
||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
/************************************Shuttle Rotation************************************/
|
|
||||||
|
|
||||||
/atom/proc/shuttleRotate(rotation)
|
|
||||||
//rotate our direction
|
|
||||||
setDir(angle2dir(rotation+dir2angle(dir)))
|
|
||||||
|
|
||||||
//resmooth if need be.
|
|
||||||
if(smooth)
|
|
||||||
queue_smooth(src)
|
|
||||||
|
|
||||||
//rotate the pixel offsets too.
|
|
||||||
if (pixel_x || pixel_y)
|
|
||||||
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))
|
|
||||||
|
|
||||||
/************************************Turf move procs************************************/
|
/************************************Turf move procs************************************/
|
||||||
|
|
||||||
/turf/open/afterShuttleMove(turf/oldT) //Recalculates SSair stuff for turfs on both sides
|
/turf/open/afterShuttleMove(turf/oldT) //Recalculates SSair stuff for turfs on both sides
|
||||||
@@ -223,21 +203,6 @@ All ShuttleMove procs go here
|
|||||||
. = ..()
|
. = ..()
|
||||||
. |= MOVE_CONTENTS
|
. |= MOVE_CONTENTS
|
||||||
|
|
||||||
//Properly updates pipes on shuttle movement
|
|
||||||
/obj/machinery/atmospherics/shuttleRotate(rotation)
|
|
||||||
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]
|
|
||||||
|
|
||||||
/obj/machinery/atmospherics/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir)
|
/obj/machinery/atmospherics/afterShuttleMove(list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir)
|
||||||
. = ..()
|
. = ..()
|
||||||
var/missing_nodes = FALSE
|
var/missing_nodes = FALSE
|
||||||
|
|||||||
100
code/modules/shuttle/shuttle_rotate.dm
Normal file
100
code/modules/shuttle/shuttle_rotate.dm
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
/*
|
||||||
|
All shuttleRotate procs go here
|
||||||
|
*/
|
||||||
|
|
||||||
|
/************************************Base proc************************************/
|
||||||
|
|
||||||
|
/atom/proc/shuttleRotate(rotation)
|
||||||
|
//rotate our direction
|
||||||
|
setDir(angle2dir(rotation+dir2angle(dir)))
|
||||||
|
|
||||||
|
//resmooth if need be.
|
||||||
|
if(smooth)
|
||||||
|
queue_smooth(src)
|
||||||
|
|
||||||
|
//rotate the pixel offsets too.
|
||||||
|
if (pixel_x || pixel_y)
|
||||||
|
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))
|
||||||
|
|
||||||
|
/************************************Turf rotate procs************************************/
|
||||||
|
|
||||||
|
/turf/closed/mineral/shuttleRotate(rotation)
|
||||||
|
setDir(angle2dir(rotation+dir2angle(dir)))
|
||||||
|
queue_smooth(src)
|
||||||
|
|
||||||
|
/************************************Mob rotate procs************************************/
|
||||||
|
|
||||||
|
//override to avoid rotating pixel_xy on mobs
|
||||||
|
/mob/shuttleRotate(rotation)
|
||||||
|
setDir(angle2dir(rotation+dir2angle(dir)))
|
||||||
|
|
||||||
|
/************************************Structure rotate procs************************************/
|
||||||
|
|
||||||
|
/obj/structure/door_assembly/door_assembly_pod/shuttleRotate(rotation)
|
||||||
|
. = ..()
|
||||||
|
expected_dir = angle2dir(rotation+dir2angle(dir))
|
||||||
|
|
||||||
|
/obj/structure/cable/shuttleRotate(rotation)
|
||||||
|
//..() is not called because wires are not supposed to have a non-default direction
|
||||||
|
//Rotate connections
|
||||||
|
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)
|
||||||
|
. = ..()
|
||||||
|
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)
|
||||||
|
. = ..()
|
||||||
|
boot_dir = angle2dir(rotation + dir2angle(boot_dir))
|
||||||
|
|
||||||
|
/obj/structure/alien/weeds/shuttleRotate(rotation)
|
||||||
|
return
|
||||||
|
|
||||||
|
/************************************Machine rotate procs************************************/
|
||||||
|
|
||||||
|
/obj/machinery/atmospherics/shuttleRotate(rotation)
|
||||||
|
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()
|
||||||
|
return
|
||||||
|
|
||||||
|
/obj/machinery/door/airlock/survival_pod/shuttleRotate(rotation)
|
||||||
|
expected_dir = angle2dir(rotation+dir2angle(dir))
|
||||||
|
return ..()
|
||||||
|
|
||||||
|
//prevents shuttles attempting to rotate this since it messes up sprites
|
||||||
|
/obj/machinery/gravity_generator/shuttleRotate()
|
||||||
|
return
|
||||||
@@ -195,10 +195,6 @@
|
|||||||
else
|
else
|
||||||
. = ..()
|
. = ..()
|
||||||
|
|
||||||
/obj/structure/table/wood/bar/shuttleRotate(rotation)
|
|
||||||
. = ..()
|
|
||||||
boot_dir = angle2dir(rotation + dir2angle(boot_dir))
|
|
||||||
|
|
||||||
/obj/structure/table/wood/bar/proc/is_barstaff(mob/living/user)
|
/obj/structure/table/wood/bar/proc/is_barstaff(mob/living/user)
|
||||||
. = FALSE
|
. = FALSE
|
||||||
if(ishuman(user))
|
if(ishuman(user))
|
||||||
|
|||||||
@@ -2154,6 +2154,7 @@
|
|||||||
#include "code\modules\shuttle\on_move.dm"
|
#include "code\modules\shuttle\on_move.dm"
|
||||||
#include "code\modules\shuttle\ripple.dm"
|
#include "code\modules\shuttle\ripple.dm"
|
||||||
#include "code\modules\shuttle\shuttle.dm"
|
#include "code\modules\shuttle\shuttle.dm"
|
||||||
|
#include "code\modules\shuttle\shuttle_rotate.dm"
|
||||||
#include "code\modules\shuttle\special.dm"
|
#include "code\modules\shuttle\special.dm"
|
||||||
#include "code\modules\shuttle\supply.dm"
|
#include "code\modules\shuttle\supply.dm"
|
||||||
#include "code\modules\shuttle\syndicate.dm"
|
#include "code\modules\shuttle\syndicate.dm"
|
||||||
|
|||||||
Reference in New Issue
Block a user