Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Shuttle Requisition Elevator #8070

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions code/__DEFINES/shuttles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
#define DROPSHIP_MORANA "dropship_morana"
#define DROPSHIP_DEVANA "dropship_devana"

#define ELEVATOR_REQ_USCM "elevator_req_uscm"
#define ELEVATOR_REQ_USCM_ADMIN "elevator_req_uscm_admin"

#define ALMAYER_DROPSHIP_LZ1 "almayer-hangar-lz1"
#define ALMAYER_DROPSHIP_LZ2 "almayer-hangar-lz2"

Expand Down
8 changes: 8 additions & 0 deletions code/game/area/Sulaco.dm
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,14 @@
name = "\improper Devana Landing Zone"
icon_state = "away2"

////

/area/shuttle/elevator_req_uscm
name = "Requisition ASRS"
icon_state = "shuttle"
base_muffle = MUFFLE_HIGH
base_lighting_alpha = 255

//DISTRESS SHUTTLES

/area/shuttle/distress
Expand Down
50 changes: 17 additions & 33 deletions code/game/supplyshuttle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ GLOBAL_DATUM_INIT(supply_controller, /datum/controller/supply, new())
density = TRUE
circuit = /obj/item/circuitboard/computer/ordercomp
var/datum/controller/supply/linked_supply_controller
var/railing_id = "supply_elevator_railing"
var/gear_id = "supply_elevator_gear"
var/faction = FACTION_MARINE
var/asrs_name = "Automated Storage and Retrieval System"

Expand Down Expand Up @@ -167,24 +169,12 @@ GLOBAL_DATUM_INIT(supply_controller, /datum/controller/supply, new())

.["current_order"] += list(list_pack)

var/datum/shuttle/ferry/supply/shuttle = linked_supply_controller.shuttle
.["shuttle_status"] = "lowered"
if (shuttle.has_arrive_time())
.["shuttle_status"] = "moving"
return

if (shuttle.at_station() )
var/obj/docking_port/mobile/marine_dropship/req_uscm/shuttle = linked_supply_controller.new_shuttle
.["shuttle_status"] = "moving"
if (shuttle.get_docked().id == shuttle.elevator_id)
.["shuttle_status"] = "raised"

switch(shuttle.docking_controller?.get_docking_status())
if ("docked")
.["shuttle_status"] = "raised"
if ("undocked")
.["shuttle_status"] = "lowered"
if ("docking")
.["shuttle_status"] = "raising"
if ("undocking")
.["shuttle_status"] = "lowering"
if (shuttle.get_docked().id == shuttle.pit_id)
.["shuttle_status"] = "lowered"

/obj/structure/machinery/computer/supply/ui_static_data(mob/user)
. = ..()
Expand Down Expand Up @@ -387,6 +377,7 @@ GLOBAL_DATUM_INIT(supply_controller, /datum/controller/supply, new())
. = ..()
LAZYREMOVE(linked_supply_controller.bound_supply_computer_list, src)


/obj/structure/machinery/computer/supply/asrs/attackby(obj/item/hit_item, mob/user)
if(istype(hit_item, /obj/item/spacecash))
if(can_order_contraband)
Expand Down Expand Up @@ -746,6 +737,8 @@ GLOBAL_DATUM_INIT(supply_controller, /datum/controller/supply, new())
var/obj/item/paper/manifest/manifest_to_print = /obj/item/paper/manifest
var/obj/structure/machinery/computer/supply/asrs/bound_supply_computer_list

var/obj/docking_port/mobile/marine_dropship/req_uscm/new_shuttle

var/list/all_supply_groups = list(
"Operations",
"Weapons",
Expand Down Expand Up @@ -885,7 +878,7 @@ GLOBAL_DATUM_INIT(supply_controller, /datum/controller/supply, new())

// Called when the elevator is lowered.
/datum/controller/supply/proc/sell()
var/area/area_shuttle = shuttle.get_location_area()
var/area/area_shuttle = new_shuttle.shuttle_areas[1]
if(!area_shuttle)
return

Expand Down Expand Up @@ -939,7 +932,7 @@ GLOBAL_DATUM_INIT(supply_controller, /datum/controller/supply, new())

//Buyin
/datum/controller/supply/proc/buy()
var/area/area_shuttle = shuttle?.get_location_area()
var/area/area_shuttle = new_shuttle.shuttle_areas[1]
if(!area_shuttle || !length(shoppinglist))
return

Expand Down Expand Up @@ -1112,10 +1105,10 @@ GLOBAL_DATUM_INIT(supply_controller, /datum/controller/supply, new())
.["used_points"] = used_points
.["used_dollars"] = used_dollars

var/datum/shuttle/ferry/supply/shuttle = linked_supply_controller.shuttle
.["can_launch"] = shuttle.can_launch()
.["can_force"] = shuttle.can_force()
.["can_cancel"] = shuttle.can_cancel()
var/obj/docking_port/mobile/marine_dropship/req_uscm/shuttle = linked_supply_controller.new_shuttle
.["can_launch"] = shuttle.canMove()
.["can_force"] = FALSE//shuttle.can_force() need to figure this out with the new shuttle what it even does
.["can_cancel"] = FALSE//shuttle.can_cancel()

.["black_market"] = can_order_contraband
.["mendoza_status"] = linked_supply_controller.mendoza_status
Expand Down Expand Up @@ -1197,16 +1190,7 @@ GLOBAL_DATUM_INIT(supply_controller, /datum/controller/supply, new())
return TRUE

if("send")
var/datum/shuttle/ferry/supply/shuttle = linked_supply_controller.shuttle

if(shuttle.at_station())
if (shuttle.forbidden_atoms_check())
system_message = "For safety reasons, the Automated Storage and Retrieval System cannot store live organisms, classified nuclear weaponry or homing beacons."
return TRUE
shuttle.launch(src)
return TRUE

shuttle.launch(src)
linked_supply_controller.new_shuttle.swap_station()
return TRUE

if("force_launch")
Expand Down
4 changes: 4 additions & 0 deletions code/game/turfs/transit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@
shuttle_tag = DROPSHIP_DEVANA
dir = SOUTH

/turf/open/space/transit/dropship/req
shuttle_tag = ELEVATOR_REQ_USCM
dir = SOUTH

/turf/open/space/transit/south
dir = SOUTH

Expand Down
111 changes: 111 additions & 0 deletions code/modules/shuttle/shuttles/dropship.dm
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,30 @@
/obj/docking_port/mobile/marine_dropship/devana/get_transit_path_type()
return /turf/open/space/transit/dropship/devana

/obj/docking_port/mobile/marine_dropship/req_uscm
name = "Elevator ASRS"
id = ELEVATOR_REQ_USCM
preferred_direction = SOUTH // If you are changing this, please update the dir of the path below as well
var/elevator_id = ELEVATOR_REQ_USCM
var/pit_id = ELEVATOR_REQ_USCM_ADMIN
faction = FACTION_MARINE

/obj/docking_port/mobile/marine_dropship/req_uscm/Initialize(mapload)
. = ..()
switch(faction)
if(FACTION_MARINE)
GLOB.supply_controller.new_shuttle = src

/obj/docking_port/mobile/marine_dropship/req_uscm/get_transit_path_type()
return /turf/open/space/transit/dropship/req

/obj/docking_port/mobile/marine_dropship/req_uscm/proc/swap_station()
var/obj/docking_port/stationary/dockedAt = get_docked()
if(dockedAt.id == elevator_id)
SSshuttle.moveShuttle(id, pit_id, TRUE)
else
SSshuttle.moveShuttle(id, elevator_id, TRUE)


/obj/docking_port/mobile/marine_dropship/check()
. = ..()
Expand Down Expand Up @@ -318,6 +342,89 @@
auto_open = TRUE
roundstart_template = /datum/map_template/shuttle/morana

/obj/docking_port/stationary/marine_dropship/req_uscm
name = "Requisition Bay ASRS"
id = ELEVATOR_REQ_USCM
auto_open = TRUE
var/railing_id = "supply_elevator_railing"
var/gear_id = "supply_elevator_gear"

/obj/docking_port/stationary/marine_dropship/req_uscm/on_dock_ignition(obj/docking_port/mobile/departing_shuttle)
.=..()
raise_railings()
start_gears()

/obj/docking_port/stationary/marine_dropship/req_uscm/on_departure(obj/docking_port/mobile/departing_shuttle)
.=..()
stop_gears()

/obj/docking_port/stationary/marine_dropship/req_uscm/on_prearrival(obj/docking_port/mobile/arriving_shuttle)
. = ..()
start_gears()

/obj/docking_port/stationary/marine_dropship/req_uscm/on_arrival(obj/docking_port/mobile/arriving_shuttle)
. = ..()
stop_gears()
lower_railings()


/obj/docking_port/stationary/marine_dropship/req_uscm/proc/raise_railings()
var/effective = 0
for(var/obj/structure/machinery/door/poddoor/railing in GLOB.machines)
if(railing.id == railing_id && !railing.density)
effective = TRUE
spawn()
railing.close()
if(effective)
playsound(src, 'sound/machines/elevator_openclose.ogg', 50, 0)

/obj/docking_port/stationary/marine_dropship/req_uscm/proc/lower_railings()
var/effective = 0
for(var/obj/structure/machinery/door/poddoor/railing in GLOB.machines)
if(railing.id == railing_id && railing.density)
effective = TRUE
INVOKE_ASYNC(railing, TYPE_PROC_REF(/obj/structure/machinery/door, open))
if(effective)
playsound(src, 'sound/machines/elevator_openclose.ogg', 50, 0)

/obj/docking_port/stationary/marine_dropship/req_uscm/proc/start_gears(direction = 1)
for(var/obj/structure/machinery/gear/gear in GLOB.machines)
if(gear.id == gear_id)
spawn()
gear.icon_state = "gear_moving"
gear.setDir(direction)

/obj/docking_port/stationary/marine_dropship/req_uscm/proc/stop_gears()
for(var/obj/structure/machinery/gear/gear in GLOB.machines)
if(gear.id == gear_id)
spawn()
gear.icon_state = "gear"


// roundstart_template = /datum/map_template/shuttle/elevator_req_uscm

/obj/docking_port/stationary/marine_dropship/req_uscm_admin
name = "Requisition Bay Admin Zone"
id = ELEVATOR_REQ_USCM_ADMIN
auto_open = TRUE
roundstart_template = /datum/map_template/shuttle/elevator_req_uscm
faction = FACTION_MARINE
var/datum/controller/supply/linked_supply_controller

/obj/docking_port/stationary/marine_dropship/req_uscm_admin/Initialize(mapload)
. = ..()
switch(faction)
if(FACTION_MARINE)
linked_supply_controller = GLOB.supply_controller

/obj/docking_port/stationary/marine_dropship/req_uscm_admin/on_arrival(obj/docking_port/mobile/arriving_shuttle)
. = ..()
linked_supply_controller.sell()

/obj/docking_port/stationary/marine_dropship/req_uscm_admin/on_dock_ignition(obj/docking_port/mobile/departing_shuttle)
. = ..()
linked_supply_controller.buy()

/obj/docking_port/stationary/marine_dropship/crash_site
auto_open = TRUE

Expand Down Expand Up @@ -367,4 +474,8 @@
name = "Devana"
shuttle_id = DROPSHIP_DEVANA

/datum/map_template/shuttle/elevator_req_uscm
name = "Elevator ASRS"
shuttle_id = ELEVATOR_REQ_USCM


2 changes: 1 addition & 1 deletion code/modules/shuttle/vehicle_elevator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
// Play the 'raising' sound effect at the destination docking port manually.
// `landing_sound` can't be used since that only plays on the elevator itself,
// and this sound file is too long for that either way.
playsound(destination, 'sound/machines/asrs_raising.ogg', 60)
playsound(destination, 'sound/machines/asrs_raising.ogg', 60) //might just change it on the shuttle FIX ME
return

// If the elevator *is* in the vehicle bay, close the railings and start the gears when it leaves.
Expand Down
45 changes: 1 addition & 44 deletions code/modules/shuttles/shuttle_supply.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,11 @@
return //someone cancelled the launch

if (at_station())
raise_railings()
sleep(12)
if(forbidden_atoms_check())
//cancel the launch because of forbidden atoms. announce over supply channel?
moving_status = SHUTTLE_IDLE
playsound(locate(Elevator_x,Elevator_y,Elevator_z), 'sound/machines/buzz-two.ogg', 50, 0)
lower_railings()
return
else //at centcom
linked_supply_controller.buy()
Expand Down Expand Up @@ -138,7 +136,6 @@
NW.icon_state = "supply_elevator_lowering"
NE.icon_state = "supply_elevator_lowering"
animate(elevator_animation, pixel_x = 160, pixel_y = -80, time = 2 SECONDS)
start_gears(SOUTH)
sleep(21)
SW.icon_state = "supply_elevator_lowered"
SE.icon_state = "supply_elevator_lowered"
Expand All @@ -147,7 +144,6 @@
sleep(70)
else
playsound(locate(Elevator_x,Elevator_y,Elevator_z), 'sound/machines/asrs_raising.ogg', 50, 0)
start_gears(NORTH)
sleep(70)
SW.icon_state = "supply_elevator_raising"
SE.icon_state = "supply_elevator_raising"
Expand All @@ -162,7 +158,6 @@
move(away_area, destination)

moving_status = SHUTTLE_IDLE
stop_gears()

for(var/turf/vis_turf in elevator_animation.vis_contents)
for(var/atom/movable/vis_content in vis_turf.contents)
Expand All @@ -171,13 +166,7 @@

elevator_animation.vis_contents.Cut()

if (!at_station()) //at centcom
handle_sell()
else
lower_railings()

spawn(0)
recharging = 0
recharging = 0

/datum/shuttle/ferry/supply/proc/handle_sell()
linked_supply_controller.sell() // fix this make it expandable
Expand All @@ -195,35 +184,3 @@
//returns 1 if the shuttle is idle and we can still mess with the cargo shopping list
/datum/shuttle/ferry/supply/proc/idle()
return (moving_status == SHUTTLE_IDLE)

/datum/shuttle/ferry/supply/proc/raise_railings()
var/effective = 0
for(var/obj/structure/machinery/door/poddoor/M in GLOB.machines)
if(M.id == railing_id && !M.density)
effective = 1
spawn()
M.close()
if(effective)
playsound(locate(Elevator_x,Elevator_y,Elevator_z), 'sound/machines/elevator_openclose.ogg', 50, 0)

/datum/shuttle/ferry/supply/proc/lower_railings()
var/effective = 0
for(var/obj/structure/machinery/door/poddoor/M in GLOB.machines)
if(M.id == railing_id && M.density)
effective = 1
INVOKE_ASYNC(M, TYPE_PROC_REF(/obj/structure/machinery/door, open))
if(effective)
playsound(locate(Elevator_x,Elevator_y,Elevator_z), 'sound/machines/elevator_openclose.ogg', 50, 0)

/datum/shuttle/ferry/supply/proc/start_gears(direction = 1)
for(var/obj/structure/machinery/gear/M in GLOB.machines)
if(M.id == gear_id)
spawn()
M.icon_state = "gear_moving"
M.setDir(direction)

/datum/shuttle/ferry/supply/proc/stop_gears()
for(var/obj/structure/machinery/gear/M in GLOB.machines)
if(M.id == gear_id)
spawn()
M.icon_state = "gear"
Loading
Loading