ROTATING SHUTTLES 0.1

This commit is contained in:
unid15
2015-08-09 01:08:36 +02:00
parent a84a40f98d
commit 8b910fb72b
15 changed files with 230 additions and 159 deletions

View File

@@ -48,7 +48,7 @@
var/dir = NORTH var/dir = NORTH
//Whether the shuttle can rotate. This feature is B R O K E N //Whether the shuttle can rotate. This feature is B R O K E N
var/can_rotate = 0 var/can_rotate = 1
//This is the time it takes for the shuttle to depart (if there's a transit area) or to travel (if there are no transit areas) //This is the time it takes for the shuttle to depart (if there's a transit area) or to travel (if there are no transit areas)
var/pre_flight_delay = 50 var/pre_flight_delay = 50
@@ -239,9 +239,6 @@
user << "The shuttle can't move ([D.areaname] is used by another shuttle)" user << "The shuttle can't move ([D.areaname] is used by another shuttle)"
return 0 return 0
//if( D.must_rotate(linked_port) && !can_rotate )
// return 0
//Handle the message //Handle the message
var/time = "as soon as possible" var/time = "as soon as possible"
switch(pre_flight_delay) switch(pre_flight_delay)
@@ -335,17 +332,33 @@
docked_shuttles |= S.linked_shuttle docked_shuttles |= S.linked_shuttle
docked_shuttles[S.linked_shuttle]=dock docked_shuttles[S.linked_shuttle]=dock
//******Handle rotation*********
var/rotate = 0
if(src.can_rotate)
if(linked_port.dir != turn(D.dir,180))
rotate = (dir2angle(D.dir) - dir2angle(linked_port.dir))
if(rotate < 0)
rotate += 360
//******Get the turf to move to**
var/turf/target_turf = D.get_docking_turf() var/turf/target_turf = D.get_docking_turf()
if(!ignore_innacuracy && innacuracy)
if(!ignore_innacuracy && innacuracy) //Handle innacuracy
var/list/turf_list = list() var/list/turf_list = list()
for(var/turf/T in orange(innacuracy,D.get_docking_turf())) for(var/turf/T in orange(innacuracy,D.get_docking_turf()))
turf_list|=T turf_list|=T
target_turf = pick(turf_list) target_turf = pick(turf_list)
//****Finally, move the area***
move_area_to(get_turf(linked_port),\ move_area_to(get_turf(linked_port),\
target_turf,rotate=0) target_turf,rotate)
linked_port.dock(D) linked_port.dock(D)
//****Move shuttles docked to us**
if(docked_shuttles.len) if(docked_shuttles.len)
for(var/datum/shuttle/S in docked_shuttles) for(var/datum/shuttle/S in docked_shuttles)
if(S in moved_shuttles) continue if(S in moved_shuttles) continue
@@ -444,8 +457,6 @@
/datum/shuttle/proc/move_area_to(var/turf/our_center, var/turf/new_center, var/rotate = 0) /datum/shuttle/proc/move_area_to(var/turf/our_center, var/turf/new_center, var/rotate = 0)
if(!our_center) return if(!our_center) return
if(!new_center) return if(!new_center) return
//if(!rotate % 90) rotate = 0 //if not divisible by 90, make it 0
if(rotate) return //not yet
var/datum/coords/our_center_coords = new(our_center.x,our_center.y) var/datum/coords/our_center_coords = new(our_center.x,our_center.y)
var/datum/coords/new_center_coords = new(new_center.x,new_center.y) var/datum/coords/new_center_coords = new(new_center.x,new_center.y)
@@ -476,8 +487,8 @@
coordinates += "[T.x];[T.y];[T.z]" coordinates += "[T.x];[T.y];[T.z]"
//Remove all stuff from the area var/cosine = cos(rotate)
//linked_area.contents = list() var/sine = sin(rotate)
//Calculate new coordinates //Calculate new coordinates
var/list/new_turfs = list() //Coordinates of turfs that WILL be created var/list/new_turfs = list() //Coordinates of turfs that WILL be created
@@ -494,12 +505,14 @@
new_turfs[new_coords] = C //Associate the old coordinates with the new ones for an easier time new_turfs[new_coords] = C //Associate the old coordinates with the new ones for an easier time
if(rotate != 0) if(rotate != 0)
var/datum/coords/relative_coords = new_coords.subtract(new_center_coords) //Oh god this works
var/x_after_rotation = relative_coords.x_pos * cos(rotate)
var/y_after_rotation = relative_coords.y_pos * sin(rotate) var/newX = (cosine * (new_coords.x_pos - new_center.x)) - (sine * (new_coords.y_pos - new_center.y)) + new_center.x
var/newY = (sine * (new_coords.x_pos - new_center.x)) - (cosine * (new_coords.y_pos - new_center.y)) + new_center.y
new_coords.x_pos = newX
new_coords.y_pos = newY
new_coords.x_pos = x_after_rotation
new_coords.y_pos = y_after_rotation
if(new_coords.y_pos < throwy) if(new_coords.y_pos < throwy)
throwy = new_coords.y_pos throwy = new_coords.y_pos
@@ -600,6 +613,9 @@
new_turf.dir = old_turf.dir new_turf.dir = old_turf.dir
new_turf.icon_state = old_turf.icon_state new_turf.icon_state = old_turf.icon_state
new_turf.icon = old_turf.icon new_turf.icon = old_turf.icon
if(rotate)
spawn
new_turf.shuttle_rotate(rotate)
//*****Move air***** //*****Move air*****
@@ -620,6 +636,9 @@
continue continue
AM.forceMove(new_turf) AM.forceMove(new_turf)
if(rotate)
spawn
AM.shuttle_rotate(rotate)
//Move landmarks - for moving the arrivals shuttle //Move landmarks - for moving the arrivals shuttle
for(var/list/L in moved_landmarks) //moved_landmarks: code/game/area/areas.dm, 527 (above the move_contents_to proc) for(var/list/L in moved_landmarks) //moved_landmarks: code/game/area/areas.dm, 527 (above the move_contents_to proc)
@@ -653,6 +672,9 @@
for(var/obj/machinery/door/D2 in T1) for(var/obj/machinery/door/D2 in T1)
D2.update_nearby_tiles() D2.update_nearby_tiles()
//Update shuttle's direction
src.dir = turn(linked_port.dir,180)
/proc/setup_shuttles() /proc/setup_shuttles()
world.log << "Setting up all shuttles..." world.log << "Setting up all shuttles..."
@@ -693,6 +715,133 @@
/datum/shuttle/custom /datum/shuttle/custom
name = "custom shuttle" name = "custom shuttle"
/datum/shuttle/proc/show_outline(var/mob/user, var/turf/centered_at)
if(!user)
return
if(!centered_at)
var/turf/user_turf = get_turf(user)
if(!user_turf)
user << "You must be standing on a turf!"
return
centered_at = get_step(user_turf,usr.dir)
var/turf/original_center = get_turf(linked_port)
if(!centered_at)
user << "ERROR: Unable to find center turf!"
return
var/offsetX = centered_at.x - original_center.x
var/offsetY = centered_at.y - original_center.y
var/datum/coords/offset = new(offsetX,offsetY)
var/list/original_coords = list()
for(var/turf/T in linked_area.get_turfs())
var/datum/coords/C = new(T.x,T.y)
original_coords += C
var/list/new_coords = list()
for(var/datum/coords/C in original_coords)
var/datum/coords/NC = C.add(offset)
new_coords += NC
var/list/images = list()
for(var/datum/coords/C in new_coords)
var/turf/T = locate(C.x_pos,C.y_pos,centered_at.z)
if(!T) continue
var/image/I = image('icons/turf/areas.dmi', icon_state="bluenew")
I.loc = T
images += I
user << I
var/image/center_img = image('icons/turf/areas.dmi', icon_state="blue") //This is actually RED, honk
center_img.loc = centered_at
images += center_img
user << center_img
alert(usr,"Press \"Ok\" to remove the images","Magic","Ok")
if(usr.client)
for(var/image/I in images)
usr.client.images -= I
return
/datum/shuttle/proc/show_movable_outline(var/mob/user)
if(!user)
return
var/turf/user_turf = get_turf(user)
if(!user_turf)
user << "You must be standing on a turf!"
return
var/turf/original_center = get_turf(linked_port)
var/turf/new_center = get_step(user_turf,usr.dir)
if(!new_center)
user << "The turf in front of you isn't a turf."
return
else if(!original_center)
user << "Unable to find the shuttle docking port's turf."
var/list/images = list()
for(var/turf/T in linked_area.get_turfs())
var/image/I = image(T.icon, T.icon_state)
I.alpha = 200
I.loc = user
I.pixel_x = 32 * (T.x - original_center.x)
I.pixel_y = 32 * (T.y - original_center.y)
images += I
user << I
var/image/center_img = image('icons/turf/areas.dmi', icon_state="blue") //This is actually RED, honk
center_img.loc = user
images += center_img
user << center_img
var/moving_with_user = 1
while(1)
switch(alert(usr,"Select one of the options below.","Magic","[moving_with_user ? "Stop moving the overlay" : "Center the overlay on user"]","Cancel"))
if("Cancel")
break
if("Stop moving the overlay")
if(moving_with_user)
user_turf = get_turf(user)
if(!user_turf)
user << "You must be standing on a turf!"
else
for(var/image/I in images)
var/turf/new_loc = locate ( user_turf.x + (round(I.pixel_x / 32)), user_turf.y + (round(I.pixel_y / 32)), user_turf.z )
I.pixel_x = 0
I.pixel_y = 0
I.loc = new_loc
moving_with_user = 0
user << "The overlay will now be centered at [user_turf.x];[user_turf.y];[user_turf.z]"
if("Center the overlay on user")
if(!moving_with_user)
var/turf/old_center_loc = center_img.loc
for(var/image/I in (images - center_img))
var/turf/old_loc = I.loc
if(!old_loc) continue
I.pixel_x = 32 * (old_loc.x - old_center_loc.x)
I.pixel_y = 32 * (old_loc.y - old_center_loc.y)
I.loc = user
moving_with_user = 1
user << "The overlay will now be moving with you"
if(usr.client)
for(var/image/I in images)
usr.client.images -= I
return
#undef INIT_SUCCESS #undef INIT_SUCCESS
#undef INIT_NO_AREA #undef INIT_NO_AREA
#undef INIT_NO_PORT #undef INIT_NO_PORT

View File

@@ -540,6 +540,18 @@ its easier to just keep the beam vertical.
/atom/proc/shuttle_act(var/datum/shuttle/S) /atom/proc/shuttle_act(var/datum/shuttle/S)
return return
//Called when a shuttle rotates
/atom/proc/shuttle_rotate(var/angle)
src.dir = turn(src.dir, angle)
if(canSmoothWith) //Smooth the smoothable
relativewall()
relativewall_neighbours()
if(pixel_x || pixel_y)
pixel_x = pixel_x * cos(angle)
pixel_y = pixel_y * sin(angle)
/atom/proc/singularity_pull() /atom/proc/singularity_pull()
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/atom/proc/singularity_pull() called tick#: [world.time]") //writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/atom/proc/singularity_pull() called tick#: [world.time]")
return return

View File

@@ -64,10 +64,6 @@ var/global/list/all_docking_ports = list()
/obj/structure/docking_port/proc/get_docking_turf() /obj/structure/docking_port/proc/get_docking_turf()
return get_step(get_turf(src),src.dir) return get_step(get_turf(src),src.dir)
/obj/structure/docking_port/proc/must_rotate(var/obj/structure/docking_port/D) //Returns the angle by which src must rotate to face D
if(!D) return 0
return ( (dir2angle(turn(src.dir, 180)) - dir2angle(D.dir)) % 360)
//SHUTTLE PORTS //SHUTTLE PORTS
/obj/structure/docking_port/shuttle //this guy is installed on shuttles and connects to obj/structure/docking_port/destination /obj/structure/docking_port/shuttle //this guy is installed on shuttles and connects to obj/structure/docking_port/destination

View File

@@ -21,6 +21,9 @@
density = 1 density = 1
anchored = 1.0 anchored = 1.0
/obj/structure/shuttle/engine/shuttle_rotate(angle)
..(angle + 180) //because a propulsion engine/heater with dir=NORTH is facing south
/obj/structure/shuttle/engine/heater /obj/structure/shuttle/engine/heater
name = "heater" name = "heater"
icon_state = "heater" icon_state = "heater"

View File

@@ -33,7 +33,7 @@ var/global/datum/shuttle/escape/escape_shuttle = new(starting_area=/area/shuttle
areaname = "central command" areaname = "central command"
/obj/structure/docking_port/destination/escape/shuttle/transit /obj/structure/docking_port/destination/escape/shuttle/transit
areaname = "hyperspace" areaname = "hyperspace (emergency shuttle)"
//pods later //pods later
/* /*

View File

@@ -17,7 +17,7 @@ var/global/datum/shuttle/mining/mining_shuttle = new(starting_area = /area/shutt
//code/game/objects/structures/docking_port.dm //code/game/objects/structures/docking_port.dm
/obj/structure/docking_port/destination/mining/station /obj/structure/docking_port/destination/mining/station
areaname = "cargo bay" areaname = "mining dock"
/obj/structure/docking_port/destination/mining/outpost /obj/structure/docking_port/destination/mining/outpost
areaname = "mining outpost" areaname = "mining outpost"

View File

@@ -56,7 +56,7 @@ var/global/datum/shuttle/transport/transport_shuttle = new(starting_area = /area
//code/game/objects/structures/docking_port.dm //code/game/objects/structures/docking_port.dm
/obj/structure/docking_port/destination/transport/station /obj/structure/docking_port/destination/transport/station
areaname = "station arrivals" areaname = "station arrivals (docking port 1)"
/obj/structure/docking_port/destination/transport/centcom /obj/structure/docking_port/destination/transport/centcom
areaname = "central command" areaname = "central command"

View File

@@ -86,7 +86,7 @@ var/global/datum/shuttle/salvage/salvage_shuttle = new(starting_area=/area/shutt
areaname = "abandoned ship" areaname = "abandoned ship"
/obj/structure/docking_port/destination/salvage/transit /obj/structure/docking_port/destination/salvage/transit
areaname = "hyperspace" areaname = "hyperspace (salvage shuttle)"
#undef SALVAGE_SHIP_MOVE_TIME #undef SALVAGE_SHIP_MOVE_TIME
#undef SALVAGE_SHIP_COOLDOWN #undef SALVAGE_SHIP_COOLDOWN

View File

@@ -72,4 +72,4 @@ var/global/datum/shuttle/syndicate/syndicate_shuttle = new(starting_area = /area
areaname = "north east of the mining asteroid" areaname = "north east of the mining asteroid"
/obj/structure/docking_port/destination/syndicate/transit /obj/structure/docking_port/destination/syndicate/transit
areaname = "hyperspace" areaname = "hyperspace (syndicate shuttle)"

View File

@@ -81,7 +81,7 @@ var/global/datum/shuttle/taxi/b/taxi_b = new(starting_area = TAXI_B_STARTING_ARE
areaname = "Abandoned Station" areaname = "Abandoned Station"
/obj/structure/docking_port/destination/taxi/a/transit /obj/structure/docking_port/destination/taxi/a/transit
areaname = "Hyperspace" areaname = "Hyperspace (taxi A)"
/obj/structure/docking_port/destination/taxi/b/medbay_silicon /obj/structure/docking_port/destination/taxi/b/medbay_silicon
areaname = "Medical and Silicon Station" areaname = "Medical and Silicon Station"
@@ -96,7 +96,7 @@ var/global/datum/shuttle/taxi/b/taxi_b = new(starting_area = TAXI_B_STARTING_ARE
areaname = "Abandoned Station" areaname = "Abandoned Station"
/obj/structure/docking_port/destination/taxi/b/transit /obj/structure/docking_port/destination/taxi/b/transit
areaname = "Hyperspace" areaname = "Hyperspace (taxi B)"
#undef TAXI_A_NAME #undef TAXI_A_NAME
#undef TAXI_B_NAME #undef TAXI_B_NAME

View File

@@ -34,7 +34,7 @@ var/global/datum/shuttle/vox/vox_shuttle = new(starting_area=/area/shuttle/vox/s
/datum/shuttle/vox/travel_to(var/obj/structure/docking_port/D, var/obj/machinery/computer/shuttle_control/broadcast = null, var/mob/user) /datum/shuttle/vox/travel_to(var/obj/structure/docking_port/D, var/obj/machinery/computer/shuttle_control/broadcast = null, var/mob/user)
if(D == dock_home) if(D == dock_home)
if(ticker && istype(ticker.mode, /datum/game_mode/heist)) if(ticker && istype(ticker.mode, /datum/game_mode/heist))
switch(alert(usr,"Returning to dark space will end your raid and report your success or failure. Are you sure?","Vox Skipjack","Yes","No")) switch(alert(usr,"Returning to the deep space will end your raid and report your success or failure. Are you sure?","Vox Skipjack","Yes","No"))
if("Yes") if("Yes")
var/location = get_turf(user) var/location = get_turf(user)
message_admins("[key_name_admin(user)] attempts to end the raid - [formatJumpTo(location)]") message_admins("[key_name_admin(user)] attempts to end the raid - [formatJumpTo(location)]")
@@ -67,19 +67,19 @@ var/global/datum/shuttle/vox/vox_shuttle = new(starting_area=/area/shuttle/vox/s
areaname = "deep space" areaname = "deep space"
/obj/structure/docking_port/destination/vox/northeast_solars /obj/structure/docking_port/destination/vox/northeast_solars
areaname = "north east of the station" areaname = "north east solars"
/obj/structure/docking_port/destination/vox/northwest_solars /obj/structure/docking_port/destination/vox/northwest_solars
areaname = "north west of the station" areaname = "north west solars"
/obj/structure/docking_port/destination/vox/southeast_solars /obj/structure/docking_port/destination/vox/southeast_solars
areaname = "south east of the station" areaname = "south east solars"
/obj/structure/docking_port/destination/vox/southwest_solars /obj/structure/docking_port/destination/vox/southwest_solars
areaname = "south west of the station" areaname = "south west solars"
/obj/structure/docking_port/destination/vox/mining /obj/structure/docking_port/destination/vox/mining
areaname = "mining asteroid" areaname = "vox trading outpost"
/obj/structure/docking_port/destination/vox/transit /obj/structure/docking_port/destination/vox/transit
areaname = "hyperspace" areaname = "hyperspace (vox skipjack)"

View File

@@ -223,31 +223,10 @@
blocks_air = 1 blocks_air = 1
explosion_block = 2 explosion_block = 2
/* /turf/simulated/shuttle/wall/shuttle_rotate(angle) //delete this when autosmooth is added
/turf/simulated/shuttle/wall/lighting_build_overlays() var/matrix/M = matrix()
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/turf/proc/lighting_build_overlays() called tick#: [world.time]") M.Turn(angle)
var/atom/movable/lighting_overlay/O = ..() src.transform = M
if(O)
if(icon_state in transparent_icons)
O.icon_state = "light1_corner"
O.dir = src.dir
else
switch(icon_state) //For incorrectly mapped corners
if("swall_s5")
O.icon_state = "light1_corner"
O.dir = SOUTH
if("swall_s6")
O.icon_state = "light1_corner"
O.dir = WEST
if("swall_s9")
O.icon_state = "light1_corner"
O.dir = EAST
if("swall_s10")
O.icon_state = "light1_corner"
O.dir = NORTH
return O*/
/turf/simulated/shuttle/wall/cultify() /turf/simulated/shuttle/wall/cultify()
ChangeTurf(/turf/simulated/wall/cult) ChangeTurf(/turf/simulated/wall/cult)

View File

@@ -840,56 +840,33 @@ var/global/floorIsLava = 0
return return
/datum/admins/proc/shuttle_magic() /datum/admins/proc/shuttle_magic()
var/dat = "<b>WARNING:</b> abuse will result in hilarity and removal of your flags.<br><h3>GENERAL COMMANDS:</h3><br>" var/dat = {"<b>WARNING:</b> server may explode!<hr><br>
dat +={"<a href='?src=\ref[src];shuttle_create_destination=1'> Create a destination docking port</a><br>
<i>This will create a destination docking port at your location, facing the direction you are currently facing.</i><br>
<a href='?src=\ref[src];shuttle_add_destination=1'> Add a destination docking port to a shuttle</a><br> <b> Shuttle construction & improvement: </b><br>
<i>This will allow the shuttle to move to it.</i><br> <a href='?src=\ref[src];shuttle_create_destination=1'>Create a destination docking port</a> |
<a href='?src=\ref[src];shuttle_create_shuttleport=1'>Create a shuttle docking port</a> |
<a href='?src=\ref[src];shuttle_add_destination=1'>Modify a shuttle's linked docking ports</a> |
<a href='?src=\ref[src];shuttle_set_transit=1'>Modify a shuttle's transit area</a> |
<a href='?src=\ref[src];shuttle_get_console=1'>Get a shuttle's control console</a> |
<a href='?src=\ref[src];shuttle_edit=1'>Modify a shuttle's parameters</a><hr><br>
<a href='?src=\ref[src];shuttle_set_transit=1'> Set a destination docking port to be a shuttle's transit area</a><br> <b> Moving shuttles: </b><br>
<i>Use the \"Edit a shuttle's parameters\" option below to change how the transit area is used</i><br> <a href='?src=\ref[src];shuttle_move_to=1'>Send a shuttle</a> |
<a href='?src=\ref[src];shuttle_forcemove=1'>Teleport a shuttle</a><hr><br>
<a href='?src=\ref[src];shuttle_create_shuttleport=1'> Create a shuttle docking port</a><br> <b> Other stuff: </b><br>
<i>This will create a shuttle docking port at your location, facing the direction you are currently facing.</i><br> <a href='?src=\ref[src];shuttle_show_overlay=1'>Draw a shuttle's outline</a> |
<b>Please read</b>: <i>Shuttle docking ports are most optimally spawned on a border turf of a shuttle, facing AWAY from it.</i><br> <a href='?src=\ref[src];shuttle_teleport_to_dock=1'>Teleport to a destination docking port</a> |
<a href='?src=\ref[src];shuttle_teleport_to=1'>Teleport to a shuttle</a> |<hr><br>
<a href='?src=\ref[src];shuttle_get_console=1'> Teleport to shuttle's control console</a><br> <b> In case of emergency: </b><br>
<i>If the shuttle has no control consoles linked to it, you'll have the option to create one at your location.</i><br> <a href='?src=\ref[src];shuttle_toggle_lockdown=1'>Toggle lockdown on a shuttle</a> |
<a href='?src=\ref[src];shuttle_delete=1'>Delete a shuttle</a> |
<a href='?src=\ref[src];shuttle_reset=1'>Reset a shuttle</a> |
<a href='?src=\ref[src];shuttle_mass_lockdown=1'><b>LOCKDOWN ALL SHUTTLES </b></a><hr><br>
<a href='?src=\ref[src];shuttle_move_to=1'> Send a shuttle</a><br>
<i>This command allows you to send any existing shuttle to any destination docking port in the world. Cooldown, lockdown and other factors are respected.</i><br>
<a href='?src=\ref[src];shuttle_teleport_to=1'> Teleport to a shuttle</a><br><br> "}
<a href='?src=\ref[src];shuttle_teleport_to_dock=1'> Teleport to a destination docking port</a><br><br>
<a href='?src=\ref[src];shuttle_edit=1'> Edit a shuttle's parameters</a><br><br>
<a href='?src=\ref[src];shuttle_show_overlay=1'> Show a shuttle's outline</a><br>
<i>This command will create a transparent overlay in the shape of a selected shuttle next to you. Its position is calculated as if it were docked at a docking port at your location. The overlay is only visible to you.</i><br>
<h3>FUN BUTTONS:</h3><br>
<a href='?src=\ref[src];shuttle_shuttlify=1'> Turn current area into a shuttle</a><br>
<a href='?src=\ref[src];shuttle_forcemove=1'> Teleport a shuttle</a><br>
<i>This command allows you to instantly move a shuttle to any destination docking port in the world OR to your location, with no regard for cooldowns and delays.</i><br>
<a href='?src=\ref[src];shuttle_supercharge=1'> SUPERCHARGE a shuttle</a><br>
<i>Once you select a shuttle, its cooldown and movement delay will become 0, but it will sometimes miss its destination.</i><br>
<h3>EMERGENCY BUTTONS:</h3><br>
<a href='?src=\ref[src];shuttle_toggle_lockdown=1'> Toggle lockdown on a shuttle</a><br>
<a href='?src=\ref[src];shuttle_delete=1'> Delete a shuttle</a><br>
<i>You'll have the option of deleting all of its objects and turfs.</i><br>
<a href='?src=\ref[src];shuttle_reset=1'> Reset a shuttle</a><br>
<i>Reset a shuttle to its initial state. Changes to turfs, objects and the shuttle's location won't be reverted.</i><br>
<a href='?src=\ref[src];shuttle_mass_lockdown=1'> LOCKDOWN ALL SHUTTLES</a><br>
<i>IT'S LOOSE</i><br>"}
usr << browse(dat, "window=shuttlemagic") usr << browse(dat, "window=shuttlemagic")

View File

@@ -3304,12 +3304,6 @@
var/datum/shuttle/shuttle_to_link = select_shuttle_from_all(usr,"Select a shuttle to link to [port_to_link] ([port_to_link.areaname])","Admin abuse") var/datum/shuttle/shuttle_to_link = select_shuttle_from_all(usr,"Select a shuttle to link to [port_to_link] ([port_to_link.areaname])","Admin abuse")
if(!shuttle_to_link) return if(!shuttle_to_link) return
if(shuttle_to_link.linked_port.must_rotate(port_to_link))
if(alert(usr,"[port_to_link] ([port_to_link.areaname]) will be rotated to match [shuttle_to_link.name]'s direction. Continue?","Admin abuse","Yes","No") == "No")
return
port_to_link.dir = turn(shuttle_to_link.linked_port.dir, 180)
shuttle_to_link.add_dock(port_to_link) shuttle_to_link.add_dock(port_to_link)
message_admins("[key_name_admin(usr)] has added a destination docking port ([port_to_link.areaname]) at [port_to_link.x];[port_to_link.y];[port_to_link.z] to [shuttle_to_link.name] ([shuttle_to_link.type]) [formatJumpTo(get_turf(port_to_link))]", 1) message_admins("[key_name_admin(usr)] has added a destination docking port ([port_to_link.areaname]) at [port_to_link.x];[port_to_link.y];[port_to_link.z] to [shuttle_to_link.name] ([shuttle_to_link.type]) [formatJumpTo(get_turf(port_to_link))]", 1)
@@ -3345,7 +3339,7 @@
feedback_inc("admin_shuttle_magic_used",1) feedback_inc("admin_shuttle_magic_used",1)
feedback_add_details("admin_shuttle_magic_used","SC") feedback_add_details("admin_shuttle_magic_used","SC")
var/obj/structure/docking_port/shuttle/D = new(usr.loc) var/obj/structure/docking_port/shuttle/D = new(get_turf(usr.loc))
D.dir = usr.dir D.dir = usr.dir
message_admins("<span class='notice'>[key_name_admin(usr)] has created a new shuttle docking port in [get_area(D)] [formatJumpTo(get_turf(D))]</span>", 1) message_admins("<span class='notice'>[key_name_admin(usr)] has created a new shuttle docking port in [get_area(D)] [formatJumpTo(get_turf(D))]</span>", 1)
@@ -3618,10 +3612,14 @@
usr << "Please create a shuttle docking port (/obj/structure/docking_port/shuttle) in this area!" usr << "Please create a shuttle docking port (/obj/structure/docking_port/shuttle) in this area!"
return return
var/name = input(usr, "Please name the new shuttle", "Shuttlify", A.name) as text var/name = input(usr, "Please name the new shuttle", "Shuttlify", A.name) as text|null
if(!name)
usr << "Shuttlifying cancelled."
return
var/datum/shuttle/custom/S = new(starting_area = A) var/datum/shuttle/custom/S = new(starting_area = A)
S.initialize()
S.name = name S.name = name
usr << "Shuttle created!" usr << "Shuttle created!"
@@ -3633,7 +3631,7 @@
feedback_inc("admin_shuttle_magic_used",1) feedback_inc("admin_shuttle_magic_used",1)
feedback_add_details("admin_shuttle_magic_used","FM") feedback_add_details("admin_shuttle_magic_used","FM")
var/list/L = list("!!YOUR CURRENT LOCATION!!") var/list/L = list("YOUR CURRENT LOCATION")
var/datum/shuttle/S = select_shuttle_from_all(usr, "Select a shuttle to teleport", "Shuttle teleporting") var/datum/shuttle/S = select_shuttle_from_all(usr, "Select a shuttle to teleport", "Shuttle teleporting")
if(!S) return if(!S) return
@@ -3652,7 +3650,7 @@
var/choice = input(usr, "Select a location to teleport [S.name] to!", "Shuttle teleporting") in L var/choice = input(usr, "Select a location to teleport [S.name] to!", "Shuttle teleporting") in L
if(choice == "!!YOUR CURRENT LOCATION!!") if(choice == "YOUR CURRENT LOCATION")
var/area/A = get_area(usr) var/area/A = get_area(usr)
var/turf/T = get_turf(usr) var/turf/T = get_turf(usr)
if(!A) return if(!A) return
@@ -3741,52 +3739,7 @@
if(usr.dir != S.dir) if(usr.dir != S.dir)
usr << "WARNING: You're not facing [dir2text(S.dir)]! The result may be <i>slightly</i> innacurate." usr << "WARNING: You're not facing [dir2text(S.dir)]! The result may be <i>slightly</i> innacurate."
var/turf/user_turf = get_turf(usr) S.show_movable_outline(usr)
if(!user_turf)
usr << "You must be standing on a turf!"
return
var/turf/original_center = get_turf(S.linked_port)
var/turf/new_center = get_step(user_turf,usr.dir)
if(!new_center)
usr << "The turf in front of you isn't a turf."
return
var/offsetX = new_center.x - original_center.x
var/offsetY = new_center.y - original_center.y
var/datum/coords/offset = new(offsetX,offsetY)
var/list/original_coords = list()
for(var/turf/T in S.linked_area.get_turfs())
var/datum/coords/C = new(T.x,T.y)
original_coords += C
var/list/new_coords = list()
for(var/datum/coords/C in original_coords)
var/datum/coords/NC = C.add(offset)
new_coords += NC
var/list/images = list()
for(var/datum/coords/C in new_coords)
var/turf/T = locate(C.x_pos,C.y_pos,new_center.z)
if(!T) continue
var/image/I = image('icons/turf/areas.dmi', icon_state="bluenew")
I.loc = T
images += I
usr << I
var/image/center_img = image('icons/turf/areas.dmi', icon_state="blue") //This is actually RED, honk
center_img.loc = new_center
images += center_img
usr << center_img
alert(usr,"Press \"Ok\" to remove the images","Magic","Ok")
if(usr.client)
for(var/image/I in images)
usr.client.images -= I
return
//------------------------------------------------------------------Shuttle stuff end--------------------------------- //------------------------------------------------------------------Shuttle stuff end---------------------------------

View File

@@ -20,6 +20,8 @@
return return
icon_state = "off" icon_state = "off"
/obj/machinery/gateway/shuttle_rotate()
return
//this is da important part wot makes things go //this is da important part wot makes things go