mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-29 03:22:12 +00:00
Fixes missing announcements, bad returned() check
Also fixes some bad grammar in the shuttle authorization announcements, and reduces the number of authorizations required to 2. 3 seemed a bit high.
This commit is contained in:
@@ -77,8 +77,7 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
|
|||||||
//launch the pods!
|
//launch the pods!
|
||||||
for (var/datum/shuttle/ferry/escape_pod/pod in escape_pods)
|
for (var/datum/shuttle/ferry/escape_pod/pod in escape_pods)
|
||||||
pod.launch(src)
|
pod.launch(src)
|
||||||
|
|
||||||
if(autopilot)
|
|
||||||
shuttle.launch(src)
|
shuttle.launch(src)
|
||||||
|
|
||||||
//called when the shuttle has arrived.
|
//called when the shuttle has arrived.
|
||||||
@@ -119,7 +118,7 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
|
|||||||
set_launch_countdown(get_shuttle_prep_time())
|
set_launch_countdown(get_shuttle_prep_time())
|
||||||
auto_recall_time = rand(world.time + 300, launch_time - 300)
|
auto_recall_time = rand(world.time + 300, launch_time - 300)
|
||||||
|
|
||||||
captain_announce("A crew transfer has been initiated. The shuttle has been called. It will arrive in approximately [round(estimate_arrival_time()/60)] minutes.")
|
captain_announce("A crew transfer has been scheduled. The shuttle has been called. It will arrive in approximately [round(estimate_arrival_time()/60)] minutes.")
|
||||||
|
|
||||||
//recalls the shuttle
|
//recalls the shuttle
|
||||||
/datum/emergency_shuttle_controller/proc/recall()
|
/datum/emergency_shuttle_controller/proc/recall()
|
||||||
@@ -198,7 +197,7 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
|
|||||||
//returns 1 if the shuttle has gone to the station and come back at least once,
|
//returns 1 if the shuttle has gone to the station and come back at least once,
|
||||||
//used for game completion checking purposes
|
//used for game completion checking purposes
|
||||||
/datum/emergency_shuttle_controller/proc/returned()
|
/datum/emergency_shuttle_controller/proc/returned()
|
||||||
return (departed && shuttle.moving_status != SHUTTLE_IDLE && shuttle.location) //we've gone to the station at least once, no longer in transit and are idle back at centcom
|
return (departed && shuttle.moving_status == SHUTTLE_IDLE && shuttle.location) //we've gone to the station at least once, no longer in transit and are idle back at centcom
|
||||||
|
|
||||||
//returns 1 if the shuttle is not idle at centcom
|
//returns 1 if the shuttle is not idle at centcom
|
||||||
/datum/emergency_shuttle_controller/proc/online()
|
/datum/emergency_shuttle_controller/proc/online()
|
||||||
|
|||||||
@@ -11,10 +11,10 @@
|
|||||||
travel_time = SHUTTLE_TRANSIT_DURATION_RETURN
|
travel_time = SHUTTLE_TRANSIT_DURATION_RETURN
|
||||||
else
|
else
|
||||||
travel_time = SHUTTLE_TRANSIT_DURATION
|
travel_time = SHUTTLE_TRANSIT_DURATION
|
||||||
|
|
||||||
//update move_time so we get correct ETAs
|
//update move_time so we get correct ETAs
|
||||||
move_time = travel_time
|
move_time = travel_time
|
||||||
|
|
||||||
..()
|
..()
|
||||||
|
|
||||||
/datum/shuttle/ferry/emergency/move(var/area/origin,var/area/destination)
|
/datum/shuttle/ferry/emergency/move(var/area/origin,var/area/destination)
|
||||||
@@ -22,10 +22,23 @@
|
|||||||
last_move_time = world.time
|
last_move_time = world.time
|
||||||
else
|
else
|
||||||
last_move_time = null
|
last_move_time = null
|
||||||
|
|
||||||
if (origin == area_station) //leaving the station
|
if (origin == area_station) //leaving the station
|
||||||
emergency_shuttle.departed = 1
|
emergency_shuttle.departed = 1
|
||||||
captain_announce("The Emergency Shuttle has left the station. Estimate [round(emergency_shuttle.estimate_arrival_time()/60,1)] minutes until the shuttle docks at Central Command.")
|
|
||||||
|
if (emergency_shuttle.evac)
|
||||||
|
captain_announce("The Emergency Shuttle has left the station. Estimate [round(emergency_shuttle.estimate_arrival_time()/60,1)] minutes until the shuttle docks at Central Command.")
|
||||||
|
else
|
||||||
|
captain_announce("The Crew Transfer Shuttle has left the station. Estimate [round(emergency_shuttle.estimate_arrival_time()/60,1)] minutes until the shuttle docks at Central Command.")
|
||||||
|
|
||||||
|
if (destination == area_station) //arrived at the station
|
||||||
|
if(autopilot)
|
||||||
|
if (evac)
|
||||||
|
captain_announce("The Emergency Shuttle has docked with the station. You have approximately [round(estimate_launch_time()/60,1)] minutes to board the Emergency Shuttle.")
|
||||||
|
world << sound('sound/AI/shuttledock.ogg')
|
||||||
|
else
|
||||||
|
captain_announce("The scheduled Crew Transfer Shuttle has docked with the station. It will depart in approximately [round(estimate_launch_time()/60,1)] minutes.")
|
||||||
|
|
||||||
..(origin, destination)
|
..(origin, destination)
|
||||||
|
|
||||||
/datum/shuttle/ferry/emergency/launch(var/user)
|
/datum/shuttle/ferry/emergency/launch(var/user)
|
||||||
@@ -35,25 +48,25 @@
|
|||||||
var/obj/machinery/computer/shuttle_control/emergency/C = user
|
var/obj/machinery/computer/shuttle_control/emergency/C = user
|
||||||
if (!C.has_authorization())
|
if (!C.has_authorization())
|
||||||
return
|
return
|
||||||
|
|
||||||
if (emergency_shuttle.autopilot)
|
if (emergency_shuttle.autopilot)
|
||||||
emergency_shuttle.autopilot = 0
|
emergency_shuttle.autopilot = 0
|
||||||
world << "\blue <B>Alert: The shuttle autopilot has been overridden. Launch sequence initiated!</B>"
|
world << "\blue <B>Alert: The shuttle autopilot has been overridden. Launch sequence initiated!</B>"
|
||||||
|
|
||||||
..(user)
|
..(user)
|
||||||
|
|
||||||
/datum/shuttle/ferry/emergency/force_launch(var/user)
|
/datum/shuttle/ferry/emergency/force_launch(var/user)
|
||||||
if (!can_force()) return
|
if (!can_force()) return
|
||||||
|
|
||||||
if (istype(user, /obj/machinery/computer/shuttle_control/emergency)) //if we were given a command by an emergency shuttle console
|
if (istype(user, /obj/machinery/computer/shuttle_control/emergency)) //if we were given a command by an emergency shuttle console
|
||||||
var/obj/machinery/computer/shuttle_control/emergency/C = user
|
var/obj/machinery/computer/shuttle_control/emergency/C = user
|
||||||
if (!C.has_authorization())
|
if (!C.has_authorization())
|
||||||
return
|
return
|
||||||
|
|
||||||
if (emergency_shuttle.autopilot)
|
if (emergency_shuttle.autopilot)
|
||||||
emergency_shuttle.autopilot = 0
|
emergency_shuttle.autopilot = 0
|
||||||
world << "\blue <B>Alert: The shuttle autopilot has been overridden. Bluespace drive engaged!</B>"
|
world << "\blue <B>Alert: The shuttle autopilot has been overridden. Bluespace drive engaged!</B>"
|
||||||
|
|
||||||
..(user)
|
..(user)
|
||||||
|
|
||||||
/datum/shuttle/ferry/emergency/cancel_launch(var/user)
|
/datum/shuttle/ferry/emergency/cancel_launch(var/user)
|
||||||
@@ -63,17 +76,17 @@
|
|||||||
var/obj/machinery/computer/shuttle_control/emergency/C = user
|
var/obj/machinery/computer/shuttle_control/emergency/C = user
|
||||||
if (!C.has_authorization())
|
if (!C.has_authorization())
|
||||||
return
|
return
|
||||||
|
|
||||||
if (emergency_shuttle.autopilot)
|
if (emergency_shuttle.autopilot)
|
||||||
emergency_shuttle.autopilot = 0
|
emergency_shuttle.autopilot = 0
|
||||||
world << "\blue <B>Alert: The shuttle autopilot has been overridden. Launch sequence aborted!</B>"
|
world << "\blue <B>Alert: The shuttle autopilot has been overridden. Launch sequence aborted!</B>"
|
||||||
|
|
||||||
..(user)
|
..(user)
|
||||||
|
|
||||||
/obj/machinery/computer/shuttle_control/emergency
|
/obj/machinery/computer/shuttle_control/emergency
|
||||||
shuttle_tag = "Escape"
|
shuttle_tag = "Escape"
|
||||||
var/debug = 0
|
var/debug = 0
|
||||||
var/req_authorizations = 3
|
var/req_authorizations = 2
|
||||||
var/list/authorized = list()
|
var/list/authorized = list()
|
||||||
|
|
||||||
/obj/machinery/computer/shuttle_control/emergency/proc/has_authorization()
|
/obj/machinery/computer/shuttle_control/emergency/proc/has_authorization()
|
||||||
@@ -81,32 +94,34 @@
|
|||||||
|
|
||||||
//returns 1 if the ID was accepted and a new authorization was added, 0 otherwise
|
//returns 1 if the ID was accepted and a new authorization was added, 0 otherwise
|
||||||
/obj/machinery/computer/shuttle_control/emergency/proc/read_authorization(var/ident)
|
/obj/machinery/computer/shuttle_control/emergency/proc/read_authorization(var/ident)
|
||||||
|
if (!ident)
|
||||||
|
return 0
|
||||||
if (authorized.len >= req_authorizations)
|
if (authorized.len >= req_authorizations)
|
||||||
return 0 //don't need any more
|
return 0 //don't need any more
|
||||||
|
|
||||||
var/list/access
|
var/list/access
|
||||||
var/auth_name
|
var/auth_name
|
||||||
var/dna_hash
|
var/dna_hash
|
||||||
|
|
||||||
if(istype(ident, /obj/item/weapon/card/id))
|
if(istype(ident, /obj/item/weapon/card/id))
|
||||||
var/obj/item/weapon/card/id/ID = ident
|
var/obj/item/weapon/card/id/ID = ident
|
||||||
access = ID.access
|
access = ID.access
|
||||||
auth_name = "[ID.registered_name] ([ID.assignment])"
|
auth_name = "[ID.registered_name] ([ID.assignment])"
|
||||||
dna_hash = ID.dna_hash
|
dna_hash = ID.dna_hash
|
||||||
|
|
||||||
if(istype(ident, /obj/item/device/pda))
|
if(istype(ident, /obj/item/device/pda))
|
||||||
var/obj/item/device/pda/PDA = ident
|
var/obj/item/device/pda/PDA = ident
|
||||||
access = PDA.id.access
|
access = PDA.id.access
|
||||||
auth_name = "[PDA.id.registered_name] ([PDA.id.assignment])"
|
auth_name = "[PDA.id.registered_name] ([PDA.id.assignment])"
|
||||||
dna_hash = PDA.id.dna_hash
|
dna_hash = PDA.id.dna_hash
|
||||||
|
|
||||||
if (!access || !istype(access))
|
if (!access || !istype(access))
|
||||||
return 0 //not an ID
|
return 0 //not an ID
|
||||||
|
|
||||||
if (dna_hash in authorized)
|
if (dna_hash in authorized)
|
||||||
src.visible_message("[src] buzzes. That ID has already been scanned.")
|
src.visible_message("[src] buzzes. That ID has already been scanned.")
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
if (!(access_heads in access))
|
if (!(access_heads in access))
|
||||||
src.visible_message("[src] buzzes, rejecting [ident].")
|
src.visible_message("[src] buzzes, rejecting [ident].")
|
||||||
return 0
|
return 0
|
||||||
@@ -114,18 +129,18 @@
|
|||||||
src.visible_message("[src] beeps as it scans [ident].")
|
src.visible_message("[src] beeps as it scans [ident].")
|
||||||
authorized[dna_hash] = auth_name
|
authorized[dna_hash] = auth_name
|
||||||
if (req_authorizations - authorized.len)
|
if (req_authorizations - authorized.len)
|
||||||
world << "\blue <B>Alert: [req_authorizations - authorized.len] authorization\s needed override the shuttle autopilot.</B>"
|
world << "\blue <B>Alert: [req_authorizations - authorized.len] authorization\s needed to override the shuttle autopilot.</B>"
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/obj/machinery/computer/shuttle_control/emergency/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
/obj/machinery/computer/shuttle_control/emergency/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||||
if (istype(W, /obj/item/weapon/card/emag) && !emagged)
|
if (istype(W, /obj/item/weapon/card/emag) && !emagged)
|
||||||
user << "\blue You short out the [src]'s authorization protocols."
|
user << "\blue You short out the [src]'s authorization protocols."
|
||||||
emagged = 1
|
emagged = 1
|
||||||
return
|
return
|
||||||
|
|
||||||
read_authorization(W)
|
read_authorization(W)
|
||||||
..()
|
..()
|
||||||
|
|
||||||
@@ -159,7 +174,7 @@
|
|||||||
|
|
||||||
//build a list of authorizations
|
//build a list of authorizations
|
||||||
var/list/auth_list[req_authorizations]
|
var/list/auth_list[req_authorizations]
|
||||||
|
|
||||||
if (!emagged)
|
if (!emagged)
|
||||||
var/i = 1
|
var/i = 1
|
||||||
for (var/dna_hash in authorized)
|
for (var/dna_hash in authorized)
|
||||||
@@ -170,9 +185,9 @@
|
|||||||
else
|
else
|
||||||
for (var/i = 1; i <= req_authorizations; i++)
|
for (var/i = 1; i <= req_authorizations; i++)
|
||||||
auth_list[i] = list("auth_name"="<font color=\"red\">ERROR</font>", "auth_hash"=null)
|
auth_list[i] = list("auth_name"="<font color=\"red\">ERROR</font>", "auth_hash"=null)
|
||||||
|
|
||||||
var/has_auth = has_authorization()
|
var/has_auth = has_authorization()
|
||||||
|
|
||||||
data = list(
|
data = list(
|
||||||
"shuttle_status" = shuttle_status,
|
"shuttle_status" = shuttle_status,
|
||||||
"shuttle_state" = shuttle_state,
|
"shuttle_state" = shuttle_state,
|
||||||
@@ -236,9 +251,9 @@
|
|||||||
for(var/obj/machinery/door/D in origin)
|
for(var/obj/machinery/door/D in origin)
|
||||||
spawn(0)
|
spawn(0)
|
||||||
D.close()
|
D.close()
|
||||||
|
|
||||||
..(origin, destination)
|
..(origin, destination)
|
||||||
|
|
||||||
for(var/obj/machinery/door/D in destination)
|
for(var/obj/machinery/door/D in destination)
|
||||||
spawn(0)
|
spawn(0)
|
||||||
D.open()
|
D.open()
|
||||||
|
|||||||
Reference in New Issue
Block a user