From 0796bf7cd438c3b5a32a2b428fac739dc2d2f519 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 13 Sep 2020 13:19:10 +0200 Subject: [PATCH] [MIRROR] Random whiteship selection (#789) * Random whiteship selection (#53603) Breaks shit if the deprecated map pr is merged before/after without me fixing it so only merge one of those * Random whiteship selection Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com> --- .../RandomRuins/SpaceRuins/whiteshipdock.dmm | 11 +----- code/modules/shuttle/shuttle.dm | 37 ++++++++++++++----- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/_maps/RandomRuins/SpaceRuins/whiteshipdock.dmm b/_maps/RandomRuins/SpaceRuins/whiteshipdock.dmm index 0bcfba908b4..ca0a4b55aae 100644 --- a/_maps/RandomRuins/SpaceRuins/whiteshipdock.dmm +++ b/_maps/RandomRuins/SpaceRuins/whiteshipdock.dmm @@ -3,16 +3,7 @@ /turf/open/space/basic, /area/space) "b" = ( -/obj/docking_port/stationary{ - dheight = 0; - dir = 2; - dwidth = 11; - height = 22; - id = "whiteship_away"; - name = "Deep Space"; - width = 35; - json_key = "whiteship" - }, +/obj/docking_port/stationary/picked/whiteship, /turf/open/space, /area/space) diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index 5c04decaf5a..dc3bb999fc6 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -40,7 +40,7 @@ // may result. if(force) ..() - . = QDEL_HINT_QUEUE + return QDEL_HINT_QUEUE else return QDEL_HINT_LETMELIVE @@ -57,7 +57,7 @@ /obj/docking_port/shuttleRotate() return //we don't rotate with shuttles via this code. -//returns a list(x0,y0, x1,y1) where points 0 and 1 are bounding corners of the projected rectangle +///returns a list(x0,y0, x1,y1) where points 0 and 1 are bounding corners of the projected rectangle /obj/docking_port/proc/return_coords(_x, _y, _dir) if(_dir == null) _dir = dir @@ -87,15 +87,14 @@ _y + (-dwidth+width-1)*sin + (-dheight+height-1)*cos ) -//returns turfs within our projected rectangle in no particular order +///returns turfs within our projected rectangle in no particular order /obj/docking_port/proc/return_turfs() var/list/L = return_coords() var/turf/T0 = locate(L[1],L[2],z) var/turf/T1 = locate(L[3],L[4],z) return block(T0,T1) -//returns turfs within our projected rectangle in a specific order. -//this ensures that turfs are copied over in the same order, regardless of any rotation +///returns turfs within our projected rectangle in a specific order.this ensures that turfs are copied over in the same order, regardless of any rotation /obj/docking_port/proc/return_ordered_turfs(_x, _y, _z, _dir) var/cos = 1 var/sin = 0 @@ -246,6 +245,28 @@ reserved_area = null return ..() +/obj/docking_port/stationary/picked + ///Holds a list of map name strings for the port to pick from + var/list/shuttlekeys + +/obj/docking_port/stationary/picked/Initialize(mapload) + . = ..() + if(!LAZYLEN(shuttlekeys)) + WARNING("Random docking port [id] loaded with no shuttle keys") + return + var/selectedid = pick(shuttlekeys) + roundstart_template = SSmapping.shuttle_templates[selectedid] + +/obj/docking_port/stationary/picked/whiteship + name = "Deep Space" + id = "whiteship_away" + dheight = 0 + dir = 2 + dwidth = 11 + height = 22 + width = 35 + shuttlekeys = list("whiteship_meta", "whiteship_pubby", "whiteship_box", "whiteship_cere", "whiteship_kilo", "whiteship_donut", "whiteship_delta") + /obj/docking_port/mobile name = "shuttle" icon_state = "pinonclose" @@ -268,11 +289,9 @@ /// time spent after transit 'landing' before actually arriving var/prearrivalTime = 0 - /// The direction the shuttle prefers to travel in, ie what direction - /// the animation will cause it to appear to be traveling in + /// The direction the shuttle prefers to travel in, ie what direction the animation will cause it to appear to be traveling in var/preferred_direction = NORTH - /// relative direction of the docking port from the front of the shuttle - /// NORTH is towards front, EAST would be starboard side, WEST port, etc. + /// relative direction of the docking port from the front of the shuttle. NORTH is towards front, EAST would be starboard side, WEST port, etc. var/port_direction = NORTH var/obj/docking_port/stationary/destination