mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Merge pull request #3041 from meyar/master
Emergency map fix: Security escape pod
This commit is contained in:
@@ -2,6 +2,341 @@
|
||||
#define SPECOPS_MOVETIME 600 //Time to station is milliseconds. 60 seconds, enough time for everyone to be on the shuttle before it leaves.
|
||||
#define SPECOPS_STATION_AREATYPE "/area/shuttle/specops/station" //Type of the spec ops shuttle area for station
|
||||
#define SPECOPS_DOCK_AREATYPE "/area/shuttle/specops/centcom" //Type of the spec ops shuttle area for dock
|
||||
#define SPECOPS_RETURN_DELAY 6000 //Time between the shuttle is capable of moving.
|
||||
|
||||
var/specops_shuttle_moving_to_station = 0
|
||||
var/specops_shuttle_moving_to_centcom = 0
|
||||
var/specops_shuttle_at_station = 0
|
||||
var/specops_shuttle_can_send = 1
|
||||
var/specops_shuttle_time = 0
|
||||
var/specops_shuttle_timeleft = 0
|
||||
|
||||
/obj/machinery/computer/specops_shuttle
|
||||
name = "Spec. Ops. Shuttle Console"
|
||||
icon = 'computer.dmi'
|
||||
icon_state = "shuttle"
|
||||
req_access = list(access_cent_specops)
|
||||
// req_access = list(ACCESS_CENT_SPECOPS)
|
||||
var/temp = null
|
||||
var/hacked = 0
|
||||
var/allowedtocall = 0
|
||||
var/specops_shuttle_timereset = 0
|
||||
|
||||
/proc/specops_return()
|
||||
var/obj/item/device/radio/intercom/announcer = new /obj/item/device/radio/intercom(null)//We need a fake AI to announce some stuff below. Otherwise it will be wonky.
|
||||
announcer.config(list("Response Team" = 0))
|
||||
|
||||
var/message_tracker[] = list(0,1,2,3,5,10,30,45)//Create a a list with potential time values.
|
||||
var/message = "\"THE SPECIAL OPERATIONS SHUTTLE IS PREPARING TO RETURN\""//Initial message shown.
|
||||
if(announcer)
|
||||
announcer.autosay(message, "A.L.I.C.E.", "Response Team")
|
||||
|
||||
while(specops_shuttle_time - world.timeofday > 0)
|
||||
var/ticksleft = specops_shuttle_time - world.timeofday
|
||||
|
||||
if(ticksleft > 1e5)
|
||||
specops_shuttle_time = world.timeofday + 10 // midnight rollover
|
||||
specops_shuttle_timeleft = (ticksleft / 10)
|
||||
|
||||
//All this does is announce the time before launch.
|
||||
if(announcer)
|
||||
var/rounded_time_left = round(specops_shuttle_timeleft)//Round time so that it will report only once, not in fractions.
|
||||
if(rounded_time_left in message_tracker)//If that time is in the list for message announce.
|
||||
message = "\"ALERT: [rounded_time_left] SECOND[(rounded_time_left!=1)?"S":""] REMAIN\""
|
||||
if(rounded_time_left==0)
|
||||
message = "\"ALERT: TAKEOFF\""
|
||||
announcer.autosay(message, "A.L.I.C.E.", "Response Team")
|
||||
message_tracker -= rounded_time_left//Remove the number from the list so it won't be called again next cycle.
|
||||
//Should call all the numbers but lag could mean some issues. Oh well. Not much I can do about that.
|
||||
|
||||
sleep(5)
|
||||
|
||||
specops_shuttle_moving_to_station = 0
|
||||
specops_shuttle_moving_to_centcom = 0
|
||||
|
||||
specops_shuttle_at_station = 1
|
||||
|
||||
var/area/start_location = locate(/area/shuttle/specops/station)
|
||||
var/area/end_location = locate(/area/shuttle/specops/centcom)
|
||||
|
||||
var/list/dstturfs = list()
|
||||
var/throwy = world.maxy
|
||||
|
||||
for(var/turf/T in end_location)
|
||||
dstturfs += T
|
||||
if(T.y < throwy)
|
||||
throwy = T.y
|
||||
|
||||
// hey you, get out of the way!
|
||||
for(var/turf/T in dstturfs)
|
||||
// find the turf to move things to
|
||||
var/turf/D = locate(T.x, throwy - 1, 1)
|
||||
//var/turf/E = get_step(D, SOUTH)
|
||||
for(var/atom/movable/AM as mob|obj in T)
|
||||
AM.Move(D)
|
||||
if(istype(T, /turf/simulated))
|
||||
del(T)
|
||||
|
||||
start_location.move_contents_to(end_location)
|
||||
|
||||
for(var/turf/T in get_area_turfs(end_location) )
|
||||
var/mob/M = locate(/mob) in T
|
||||
M << "\red You have arrived at Central Command. Operation has ended!"
|
||||
|
||||
specops_shuttle_at_station = 0
|
||||
|
||||
for(var/obj/machinery/computer/specops_shuttle/S in world)
|
||||
S.specops_shuttle_timereset = world.time + SPECOPS_RETURN_DELAY
|
||||
|
||||
del(announcer)
|
||||
|
||||
/proc/specops_process()
|
||||
var/area/centcom/specops/special_ops = locate()//Where is the specops area located?
|
||||
var/obj/item/device/radio/intercom/announcer = new /obj/item/device/radio/intercom(null)//We need a fake AI to announce some stuff below. Otherwise it will be wonky.
|
||||
announcer.config(list("Response Team" = 0))
|
||||
|
||||
var/message_tracker[] = list(0,1,2,3,5,10,30,45)//Create a a list with potential time values.
|
||||
var/message = "\"THE SPECIAL OPERATIONS SHUTTLE IS PREPARING FOR LAUNCH\""//Initial message shown.
|
||||
if(announcer)
|
||||
announcer.autosay(message, "A.L.I.C.E.", "Response Team")
|
||||
// message = "ARMORED SQUAD TAKE YOUR POSITION ON GRAVITY LAUNCH PAD"
|
||||
// announcer.autosay(message, "A.L.I.C.E.", "Response Team")
|
||||
|
||||
while(specops_shuttle_time - world.timeofday > 0)
|
||||
var/ticksleft = specops_shuttle_time - world.timeofday
|
||||
|
||||
if(ticksleft > 1e5)
|
||||
specops_shuttle_time = world.timeofday + 10 // midnight rollover
|
||||
specops_shuttle_timeleft = (ticksleft / 10)
|
||||
|
||||
//All this does is announce the time before launch.
|
||||
if(announcer)
|
||||
var/rounded_time_left = round(specops_shuttle_timeleft)//Round time so that it will report only once, not in fractions.
|
||||
if(rounded_time_left in message_tracker)//If that time is in the list for message announce.
|
||||
message = "\"ALERT: [rounded_time_left] SECOND[(rounded_time_left!=1)?"S":""] REMAIN\""
|
||||
if(rounded_time_left==0)
|
||||
message = "\"ALERT: TAKEOFF\""
|
||||
announcer.autosay(message, "A.L.I.C.E.", "Response Team")
|
||||
message_tracker -= rounded_time_left//Remove the number from the list so it won't be called again next cycle.
|
||||
//Should call all the numbers but lag could mean some issues. Oh well. Not much I can do about that.
|
||||
|
||||
sleep(5)
|
||||
|
||||
specops_shuttle_moving_to_station = 0
|
||||
specops_shuttle_moving_to_centcom = 0
|
||||
|
||||
specops_shuttle_at_station = 1
|
||||
if (specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return
|
||||
|
||||
if (!specops_can_move())
|
||||
usr << "\red The Special Operations shuttle is unable to leave."
|
||||
return
|
||||
|
||||
//Begin Marauder launchpad.
|
||||
spawn(0)//So it parallel processes it.
|
||||
for(var/obj/machinery/door/poddoor/M in special_ops)
|
||||
switch(M.id)
|
||||
if("ASSAULT0")
|
||||
spawn(10)//1 second delay between each.
|
||||
M.open()
|
||||
if("ASSAULT1")
|
||||
spawn(20)
|
||||
M.open()
|
||||
if("ASSAULT2")
|
||||
spawn(30)
|
||||
M.open()
|
||||
if("ASSAULT3")
|
||||
spawn(40)
|
||||
M.open()
|
||||
|
||||
sleep(10)
|
||||
|
||||
var/spawn_marauder[] = new()
|
||||
for(var/obj/effect/landmark/L in world)
|
||||
if(L.name == "Marauder Entry")
|
||||
spawn_marauder.Add(L)
|
||||
for(var/obj/effect/landmark/L in world)
|
||||
if(L.name == "Marauder Exit")
|
||||
var/obj/effect/portal/P = new(L.loc)
|
||||
P.invisibility = 101//So it is not seen by anyone.
|
||||
P.failchance = 0//So it has no fail chance when teleporting.
|
||||
P.target = pick(spawn_marauder)//Where the marauder will arrive.
|
||||
spawn_marauder.Remove(P.target)
|
||||
|
||||
sleep(10)
|
||||
|
||||
for(var/obj/machinery/mass_driver/M in special_ops)
|
||||
switch(M.id)
|
||||
if("ASSAULT0")
|
||||
spawn(10)
|
||||
M.drive()
|
||||
if("ASSAULT1")
|
||||
spawn(20)
|
||||
M.drive()
|
||||
if("ASSAULT2")
|
||||
spawn(30)
|
||||
M.drive()
|
||||
if("ASSAULT3")
|
||||
spawn(40)
|
||||
M.drive()
|
||||
|
||||
sleep(50)//Doors remain open for 5 seconds.
|
||||
|
||||
for(var/obj/machinery/door/poddoor/M in special_ops)
|
||||
switch(M.id)//Doors close at the same time.
|
||||
if("ASSAULT0")
|
||||
spawn(0)
|
||||
M.close()
|
||||
if("ASSAULT1")
|
||||
spawn(0)
|
||||
M.close()
|
||||
if("ASSAULT2")
|
||||
spawn(0)
|
||||
M.close()
|
||||
if("ASSAULT3")
|
||||
spawn(0)
|
||||
M.close()
|
||||
special_ops.readyreset()//Reset firealarm after the team launched.
|
||||
//End Marauder launchpad.
|
||||
|
||||
var/area/start_location = locate(/area/shuttle/specops/centcom)
|
||||
var/area/end_location = locate(/area/shuttle/specops/station)
|
||||
|
||||
var/list/dstturfs = list()
|
||||
var/throwy = world.maxy
|
||||
|
||||
for(var/turf/T in end_location)
|
||||
dstturfs += T
|
||||
if(T.y < throwy)
|
||||
throwy = T.y
|
||||
|
||||
// hey you, get out of the way!
|
||||
for(var/turf/T in dstturfs)
|
||||
// find the turf to move things to
|
||||
var/turf/D = locate(T.x, throwy - 1, 1)
|
||||
//var/turf/E = get_step(D, SOUTH)
|
||||
for(var/atom/movable/AM as mob|obj in T)
|
||||
AM.Move(D)
|
||||
if(istype(T, /turf/simulated))
|
||||
del(T)
|
||||
|
||||
start_location.move_contents_to(end_location)
|
||||
|
||||
for(var/turf/T in get_area_turfs(end_location) )
|
||||
var/mob/M = locate(/mob) in T
|
||||
M << "\red You have arrived to [station_name]. Commence operation!"
|
||||
|
||||
for(var/obj/machinery/computer/specops_shuttle/S in world)
|
||||
S.specops_shuttle_timereset = world.time + SPECOPS_RETURN_DELAY
|
||||
|
||||
del(announcer)
|
||||
|
||||
/proc/specops_can_move()
|
||||
if(specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom)
|
||||
return 0
|
||||
for(var/obj/machinery/computer/specops_shuttle/S in world)
|
||||
if(world.timeofday <= S.specops_shuttle_timereset)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/machinery/computer/specops_shuttle/attack_ai(var/mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/specops_shuttle/attack_paw(var/mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/specops_shuttle/attackby(I as obj, user as mob)
|
||||
if(istype(I,/obj/item/weapon/card/emag))
|
||||
user << "\blue The electronic systems in this console are far too advanced for your primitive hacking peripherals."
|
||||
else
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/specops_shuttle/attack_hand(var/mob/user as mob)
|
||||
if(!allowed(user))
|
||||
user << "\red Access Denied."
|
||||
return
|
||||
|
||||
if (sent_strike_team == 0 && send_emergency_team == 0)
|
||||
usr << "\red The strike team has not yet deployed."
|
||||
return
|
||||
|
||||
if(..())
|
||||
return
|
||||
|
||||
user.machine = src
|
||||
var/dat
|
||||
if (temp)
|
||||
dat = temp
|
||||
else
|
||||
dat += {"<BR><B>Special Operations Shuttle</B><HR>
|
||||
\nLocation: [specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom ? "Departing for [station_name] in ([specops_shuttle_timeleft] seconds.)":specops_shuttle_at_station ? "Station":"Dock"]<BR>
|
||||
[specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom ? "\n*The Special Ops. shuttle is already leaving.*<BR>\n<BR>":specops_shuttle_at_station ? "\n<A href='?src=\ref[src];sendtodock=1'>Shuttle standing by...</A><BR>\n<BR>":"\n<A href='?src=\ref[src];sendtostation=1'>Depart to [station_name]</A><BR>\n<BR>"]
|
||||
\n<A href='?src=\ref[user];mach_close=computer'>Close</A>"}
|
||||
|
||||
user << browse(dat, "window=computer;size=575x450")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/specops_shuttle/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||
usr.machine = src
|
||||
|
||||
if (href_list["sendtodock"])
|
||||
if(!specops_shuttle_at_station|| specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return
|
||||
|
||||
if (!specops_can_move())
|
||||
usr << "\blue Central Command will not allow the Special Operations shuttle to return yet."
|
||||
if(world.timeofday <= specops_shuttle_timereset)
|
||||
if (((world.timeofday - specops_shuttle_timereset)/10) > 60)
|
||||
usr << "\blue [-((world.timeofday - specops_shuttle_timereset)/10)/60] minutes remain!"
|
||||
usr << "\blue [-(world.timeofday - specops_shuttle_timereset)/10] seconds remain!"
|
||||
return
|
||||
|
||||
usr << "\blue The Special Operations shuttle will arrive at Central Command in [(SPECOPS_MOVETIME/10)] seconds."
|
||||
|
||||
temp += "Shuttle departing.<BR><BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||
updateUsrDialog()
|
||||
|
||||
specops_shuttle_moving_to_centcom = 1
|
||||
specops_shuttle_time = world.timeofday + SPECOPS_MOVETIME
|
||||
spawn(0)
|
||||
specops_return()
|
||||
|
||||
else if (href_list["sendtostation"])
|
||||
if(specops_shuttle_at_station || specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return
|
||||
|
||||
if (!specops_can_move())
|
||||
usr << "\red The Special Operations shuttle is unable to leave."
|
||||
return
|
||||
|
||||
usr << "\blue The Special Operations shuttle will arrive on [station_name] in [(SPECOPS_MOVETIME/10)] seconds."
|
||||
|
||||
temp += "Shuttle departing.<BR><BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
|
||||
updateUsrDialog()
|
||||
|
||||
var/area/centcom/specops/special_ops = locate()
|
||||
if(special_ops)
|
||||
special_ops.readyalert()//Trigger alarm for the spec ops area.
|
||||
specops_shuttle_moving_to_station = 1
|
||||
|
||||
specops_shuttle_time = world.timeofday + SPECOPS_MOVETIME
|
||||
spawn(0)
|
||||
specops_process()
|
||||
|
||||
else if (href_list["mainmenu"])
|
||||
temp = null
|
||||
|
||||
add_fingerprint(usr)
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
/*//Config stuff
|
||||
#define SPECOPS_MOVETIME 600 //Time to station is milliseconds. 60 seconds, enough time for everyone to be on the shuttle before it leaves.
|
||||
#define SPECOPS_STATION_AREATYPE "/area/shuttle/specops/station" //Type of the spec ops shuttle area for station
|
||||
#define SPECOPS_DOCK_AREATYPE "/area/shuttle/specops/centcom" //Type of the spec ops shuttle area for dock
|
||||
|
||||
var/specops_shuttle_moving_to_station = 0
|
||||
var/specops_shuttle_moving_to_centcom = 0
|
||||
@@ -179,9 +514,9 @@ var/specops_shuttle_timeleft = 0
|
||||
user << "\red Access Denied."
|
||||
return
|
||||
|
||||
if (sent_strike_team == 0)
|
||||
usr << "\red The strike team has not yet deployed."
|
||||
return
|
||||
// if (sent_strike_team == 0)
|
||||
// usr << "\red The strike team has not yet deployed."
|
||||
// return
|
||||
|
||||
if(..())
|
||||
return
|
||||
@@ -239,4 +574,5 @@ var/specops_shuttle_timeleft = 0
|
||||
|
||||
add_fingerprint(usr)
|
||||
updateUsrDialog()
|
||||
return
|
||||
return
|
||||
*/
|
||||
@@ -96,15 +96,15 @@ proc/trigger_armed_response_team(var/force = 0)
|
||||
|
||||
/client/proc/create_response_team(obj/spawn_location, leader_selected = 0, commando_name)
|
||||
|
||||
usr << "\red ERT has been temporarily disabled. Talk to a coder."
|
||||
return
|
||||
//usr << "\red ERT has been temporarily disabled. Talk to a coder."
|
||||
//return
|
||||
|
||||
var/mob/living/carbon/human/M = new(null)
|
||||
response_team_members |= M
|
||||
|
||||
//todo: god damn this.
|
||||
//make it a panel, like in character creation
|
||||
/*var/new_facial = input("Please select facial hair color.", "Character Generation") as color
|
||||
var/new_facial = input("Please select facial hair color.", "Character Generation") as color
|
||||
if(new_facial)
|
||||
M.r_facial = hex2num(copytext(new_facial, 2, 4))
|
||||
M.g_facial = hex2num(copytext(new_facial, 4, 6))
|
||||
@@ -139,16 +139,25 @@ proc/trigger_armed_response_team(var/force = 0)
|
||||
hairs.Add(H.name) // add hair name to hairs
|
||||
del(H) // delete the hair after it's all done
|
||||
|
||||
var/new_style = input("Please select hair style", "Character Generation") as null|anything in hairs
|
||||
// var/new_style = input("Please select hair style", "Character Generation") as null|anything in hairs
|
||||
//hair
|
||||
var/new_hstyle = input(usr, "Select a hair style", "Grooming") as null|anything in hair_styles_list
|
||||
if(new_hstyle)
|
||||
M.h_style = new_hstyle
|
||||
|
||||
// facial hair
|
||||
var/new_fstyle = input(usr, "Select a facial hair style", "Grooming") as null|anything in facial_hair_styles_list
|
||||
if(new_fstyle)
|
||||
M.f_style = new_fstyle
|
||||
|
||||
// if new style selected (not cancel)
|
||||
if (new_style)
|
||||
/* if (new_style)
|
||||
M.h_style = new_style
|
||||
|
||||
for(var/x in all_hairs) // loop through all_hairs again. Might be slightly CPU expensive, but not significantly.
|
||||
var/datum/sprite_accessory/hair/H = new x // create new hair datum
|
||||
if(H.name == new_style)
|
||||
M.hair_style = H // assign the hair_style variable a new hair datum
|
||||
M.h_style = H // assign the hair_style variable a new hair datum
|
||||
break
|
||||
else
|
||||
del(H) // if hair H not used, delete. BYOND can garbage collect, but better safe than sorry
|
||||
@@ -169,19 +178,21 @@ proc/trigger_armed_response_team(var/force = 0)
|
||||
for(var/x in all_fhairs)
|
||||
var/datum/sprite_accessory/facial_hair/H = new x
|
||||
if(H.name == new_style)
|
||||
M.facial_hair_style = H
|
||||
M.f_style = H
|
||||
break
|
||||
else
|
||||
del(H)
|
||||
|
||||
*/
|
||||
var/new_gender = alert(usr, "Please select gender.", "Character Generation", "Male", "Female")
|
||||
if (new_gender)
|
||||
if(new_gender == "Male")
|
||||
M.gender = MALE
|
||||
else
|
||||
M.gender = FEMALE
|
||||
M.rebuild_appearance()
|
||||
M.update_body()*/
|
||||
//M.rebuild_appearance()
|
||||
M.update_hair()
|
||||
M.update_body()
|
||||
M.check_dna(M)
|
||||
|
||||
M.real_name = commando_name
|
||||
M.name = commando_name
|
||||
@@ -233,21 +244,28 @@ proc/trigger_armed_response_team(var/force = 0)
|
||||
//Backpack
|
||||
equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security(src), slot_back)
|
||||
equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(src), slot_in_backpack)
|
||||
equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/adv(src), slot_in_backpack)
|
||||
equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/regular(src), slot_in_backpack)
|
||||
|
||||
var/obj/item/weapon/card/id/W = new(src)
|
||||
W.name = "[real_name]'s ID Card (Emergency Response Team)"
|
||||
W.icon_state = "centcom"
|
||||
if(leader_selected)
|
||||
W.name = "[real_name]'s ID Card (Emergency Response Team Leader)"
|
||||
W.access = get_access("Captain")
|
||||
W.access += list(access_cent_teleporter)
|
||||
W.access = get_all_accesses()
|
||||
W.access += get_all_centcom_access()
|
||||
W.assignment = "Emergency Response Team Leader"
|
||||
else
|
||||
W.access = get_access("Head of Personnel")
|
||||
W.access = get_all_accesses()
|
||||
W.access += get_all_centcom_access()
|
||||
W.assignment = "Emergency Response Team"
|
||||
W.access += list(access_cent_general, access_cent_specops, access_cent_living, access_cent_storage)//Let's add their alloted CentCom access.
|
||||
W.registered_name = real_name
|
||||
equip_to_slot_or_del(W, slot_wear_id)
|
||||
|
||||
return 1
|
||||
|
||||
/*//debug verb
|
||||
client/verb/ResponseTeam()
|
||||
set category = "Admin"
|
||||
if(!send_emergency_team)
|
||||
send_emergency_team = 1*/
|
||||
Reference in New Issue
Block a user