Files
VOREStation/code/modules/shuttles/shuttle_supply.dm
T
Selis f4bf017921 Unit Test rework & Master/Ticker update (#17912)
* Unit Test rework & Master/Ticker update

* Fixes and working unit testing

* Fixes

* Test fixes and FA update

* Fixed runtimes

* Radio subsystem

* move that glob wherever later

* ident

* CIBUILDING compile option

* Fixed runtimes

* Some changes to the workflow

* CI Split

* More split

* Pathing

* Linters and Annotators

* ci dir fix

* Missing undef fixed

* Enable grep checks

* More test conversions

* More split

* Correct file

* Removes unneeded inputs

* oop

* More dependency changes

* More conversions

* Conversion fixes

* Fixes

* Some assert fixes

* Corrects start gate

* Converted some README.dms to README.mds

* Removes duplicate proc

* Removes unused defines

* Example configs

* fix dll access viol by double calling

* Post-rebase fixes

* Cleans up names global list

* Undef restart counter

* More code/game/ cleanup

* Statpanel update

* Skybox

* add

* Fix ticker

* Roundend fix

* Persistence dependency update

* Reordering

* Reordering

* Reordering

* Initstage fix

* .

* .

* Reorder

* Reorder

* Circle

* Mobs

* Air

* Test fix

* CI Script Fix

* Configs

* More ticker stuff

* This is now in 'reboot world'

* Restart world announcements

* no glob in PreInit

* to define

* Update

* Removed old include

* Make this file normal again

* moved

* test

* shared unit testing objects

* Updates batched_spritesheets and universal_icon

* .

* job data debug

* rm that

* init order

* show us

* .

* i wonder

* .

* .

* urg

* do we not have a job ID?

* .

* rm sleep for now

* updated rust-g linux binaries

* binaries update 2

* binaries update 3

* testing something

* change that

* test something

* .

* .

* .

* locavar

* test

* move that

* .

* debug

* don't run this test

* strack trace it

* cleaner

* .

* .

* cras again

* also comment this out

* return to official rust g

* Update robot_icons.dm

* monitor the generation

* .

---------

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
2025-08-10 01:37:23 +02:00

108 lines
3.4 KiB
Plaintext

// Formerly /datum/shuttle/ferry/supply
/datum/shuttle/autodock/ferry/supply
var/away_location = FERRY_LOCATION_OFFSITE //the location to hide at while pretending to be in-transit
var/late_chance = 80
var/max_late_time = 300
flags = SHUTTLE_FLAGS_PROCESS|SHUTTLE_FLAGS_SUPPLY
category = /datum/shuttle/autodock/ferry/supply
/datum/shuttle/autodock/ferry/supply/short_jump(var/obj/effect/shuttle_landmark/destination)
if(moving_status != SHUTTLE_IDLE)
return
if(isnull(location))
return
// Set the supply shuttle displays to read out the ETA
var/datum/signal/S = new()
S.source = src
S.data = list("command" = "supply")
var/datum/radio_frequency/F = SSradio.return_frequency(1435)
F.post_signal(src, S)
//it would be cool to play a sound here
moving_status = SHUTTLE_WARMUP
spawn(warmup_time*10)
make_sounds(HYPERSPACE_WARMUP)
sleep(5 SECONDS) // so the sound finishes.
if (moving_status == SHUTTLE_IDLE)
make_sounds(HYPERSPACE_END)
return //someone cancelled the launch
if (at_station() && forbidden_atoms_check())
//cancel the launch because of forbidden atoms. announce over supply channel?
moving_status = SHUTTLE_IDLE
make_sounds(HYPERSPACE_END)
return
if (!at_station()) //at centcom
SSmail.create_mail()
SSsupply.buy()
//We pretend it's a long_jump by making the shuttle stay at centcom for the "in-transit" period.
var/obj/effect/shuttle_landmark/away_waypoint = get_location_waypoint(away_location)
moving_status = SHUTTLE_INTRANSIT
//If we are at the away_landmark then we are just pretending to move, otherwise actually do the move
if (next_location == away_waypoint)
attempt_move(away_waypoint)
//wait ETA here.
arrive_time = world.time + SSsupply.movetime
while (world.time <= arrive_time)
sleep(5)
if (next_location != away_waypoint)
//late
if (prob(late_chance))
sleep(rand(0,max_late_time))
attempt_move(destination)
moving_status = SHUTTLE_IDLE
make_sounds(HYPERSPACE_END)
if (!at_station()) //at centcom
SSsupply.sell()
// returns 1 if the supply shuttle should be prevented from moving because it contains forbidden atoms
/datum/shuttle/autodock/ferry/supply/proc/forbidden_atoms_check()
if (!at_station())
return 0 //if badmins want to send mobs or a nuke on the supply shuttle from centcom we don't care
for(var/area/A in shuttle_area)
if(SSsupply.forbidden_atoms_check(A))
return 1
/datum/shuttle/autodock/ferry/supply/proc/at_station()
return (!location)
//returns 1 if the shuttle is idle and we can still mess with the cargo shopping list
/datum/shuttle/autodock/ferry/supply/proc/idle()
return (moving_status == SHUTTLE_IDLE)
//returns the ETA in minutes
/datum/shuttle/autodock/ferry/supply/proc/eta_minutes()
return round((arrive_time - world.time) / (1 MINUTE)) // Floor, so it's an actual timer
// returns the ETA in seconds
/datum/shuttle/autodock/ferry/supply/proc/eta_seconds()
return round((arrive_time - world.time) / (1 SECOND)) // Floor, so it's an actual timer
//returns the ETA in deciseconds
/datum/shuttle/autodock/ferry/supply/proc/eta_deciseconds()
return round(arrive_time - world.time)
/datum/shuttle/autodock/ferry/supply/cargo
name = "Supply"
location = FERRY_LOCATION_OFFSITE
shuttle_area = /area/shuttle/supply
warmup_time = 10
landmark_offsite = "supply_cc"
landmark_station = "supply_station"
docking_controller_tag = "supply_shuttle"
flags = SHUTTLE_FLAGS_PROCESS|SHUTTLE_FLAGS_SUPPLY
move_direction = WEST