shuttle_controller now uses a shuttle datum

Conflicts:
	code/game/machinery/computer/communications.dm
	code/modules/admin/verbs/randomverbs.dm
	code/modules/mob/living/silicon/ai/ai.dm
	code/modules/power/singularity/singularity.dm
This commit is contained in:
mwerezak
2014-06-23 11:07:58 -04:00
committed by ZomgPonies
parent 55532e51a0
commit 9874ce38ce
34 changed files with 441 additions and 585 deletions
+1 -1
View File
@@ -111,7 +111,7 @@ var/list/blob_nodes = list()
greet_blob(blob)
if(emergency_shuttle)
emergency_shuttle.always_fake_recall = 1
emergency_shuttle.auto_recall = 1
/*// Disable the blob event for this round.
if(events)
+1 -1
View File
@@ -189,7 +189,7 @@ Implants;
break
/datum/game_mode/proc/check_finished() //to be called by ticker
if(emergency_shuttle.location==2 || station_was_nuked)
if(emergency_shuttle.returned() || station_was_nuked)
return 1
return 0
+2 -2
View File
@@ -370,10 +370,10 @@ var/global/datum/controller/gameticker/ticker
var/game_finished = 0
var/mode_finished = 0
if (config.continous_rounds)
game_finished = (emergency_shuttle.location == 2 || mode.station_was_nuked)
game_finished = (emergency_shuttle.returned() || mode.station_was_nuked)
mode_finished = (!post_game && mode.check_finished())
else
game_finished = (mode.check_finished() || (emergency_shuttle.location == 2 && emergency_shuttle.alert == 1))
game_finished = (mode.check_finished() || (emergency_shuttle.returned() && emergency_shuttle.evac == 1))
mode_finished = game_finished
if(!mode.explosion_in_progress && game_finished && (mode_finished || post_game))
@@ -67,7 +67,7 @@
AI_mind.current.icon_state = "ai-malf2"
*/
if(emergency_shuttle)
emergency_shuttle.always_fake_recall = 1
emergency_shuttle.auto_recall = 1
spawn (rand(waittime_l, waittime_h))
send_intercept()
..()
@@ -136,7 +136,7 @@
if (is_malf_ai_dead())
if(config.continous_rounds)
if(emergency_shuttle)
emergency_shuttle.always_fake_recall = 0
emergency_shuttle.auto_recall = 0
malf_mode_declared = 0
else
return 1
@@ -206,7 +206,7 @@
/datum/game_mode/malfunction/declare_completion()
var/malf_dead = is_malf_ai_dead()
var/crew_evacuated = (emergency_shuttle.location==2)
var/crew_evacuated = (emergency_shuttle.returned())
if ( station_captured && station_was_nuked)
feedback_set_details("round_end_result","win - AI win - nuke")
+6 -6
View File
@@ -267,7 +267,7 @@ datum
explanation_text = "Frame [target.current.real_name], the [target.assigned_role] for a crime and make sure they are arrested and brought back to the Centcom station alive. We'll handle the rest from there."
check_completion()
if(emergency_shuttle.location<2)
if(!emergency_shuttle.returned())
return 0
if(target.current.stat == 2)
return 0
@@ -313,7 +313,7 @@ datum
explanation_text = "[target.current.real_name], the [target.assigned_role] is a [pick("relative of a","friend of a","") + pick("high ranking","important","well-liked")] Syndicate [pick("Leader","Officer","Agent","sympathiser")]. Make sure they get off the station safely, while minimizing intervention."
check_completion()
if(emergency_shuttle.location<2)
if(!emergency_shuttle.returned())
return 0
if(target.current.stat == 2)
@@ -477,7 +477,7 @@ datum
explanation_text = "Hijack the emergency shuttle by escaping alone."
check_completion()
if(emergency_shuttle.location<2)
if(!emergency_shuttle.returned())
return 0
if(!owner.current || owner.current.stat == 2)
@@ -512,7 +512,7 @@ datum
explanation_text = "Escape on the shuttle alive, without being arrested."
check_completion()
if(emergency_shuttle.location<2)
if(!emergency_shuttle.returned())
return 0
if(!owner.current || owner.current.stat ==2)
@@ -1224,7 +1224,7 @@ datum
check_completion()
if(!istype(owner.current, /mob/living/silicon))
return 0
if(emergency_shuttle.location<2)
if(!emergency_shuttle.returned())
return 0
if(!owner.current)
return 0
@@ -1447,7 +1447,7 @@ datum/objective/silence
explanation_text = "Do not allow anyone to escape the station. Only allow the shuttle to be called when everyone is dead and your story is the only one left."
check_completion()
if(emergency_shuttle.location<2)
if(!emergency_shuttle.returned())
return 0
var/area/shuttle = locate(/area/shuttle/escape/centcom)
+1 -1
View File
@@ -270,7 +270,7 @@ proc/issyndicate(mob/living/M as mob)
if(!is_type_in_list(disk_area, centcom_areas))
disk_rescued = 0
break
var/crew_evacuated = (emergency_shuttle.location==2)
var/crew_evacuated = (emergency_shuttle.returned())
//var/operatives_are_dead = is_operatives_are_dead()
+6 -6
View File
@@ -308,7 +308,7 @@ datum/objective/hijack
check_completion()
if(!owner.current || owner.current.stat)
return 0
if(emergency_shuttle.location<2)
if(!emergency_shuttle.returned())
return 0
if(issilicon(owner.current))
return 0
@@ -333,7 +333,7 @@ datum/objective/speciesist
return 1
check_completion()
if(emergency_shuttle.location<2)
if(!emergency_shuttle.location())
return 0
var/area/shuttle = locate(/area/shuttle/escape/centcom)
for(var/mob/living/carbon/human/player in player_list)
@@ -351,7 +351,7 @@ datum/objective/block
check_completion()
if(!istype(owner.current, /mob/living/silicon))
return 0
if(emergency_shuttle.location<2)
if(!emergency_shuttle.returned())
return 0
if(!owner.current)
return 0
@@ -369,7 +369,7 @@ datum/objective/silence
explanation_text = "Do not allow anyone to escape the station. Only allow the shuttle to be called when everyone is dead and your story is the only one left."
check_completion()
if(emergency_shuttle.location<2)
if(!emergency_shuttle.returned())
return 0
for(var/mob/living/player in player_list)
@@ -393,7 +393,7 @@ datum/objective/escape
return 0
if(isbrain(owner.current))
return 0
if(emergency_shuttle.location<2)
if(!emergency_shuttle.returned())
return 0
if(!owner.current || owner.current.stat ==2)
return 0
@@ -684,7 +684,7 @@ datum/objective/absorb
explanation_text = "Our knowledge must live on. Make sure at least 5 acolytes escape on the shuttle to spread their work on an another station."
check_completion()
if(emergency_shuttle.location<2)
if(!emergency_shuttle.returned())
return 0
var/cultists_escaped = 0
+2 -2
View File
@@ -91,7 +91,7 @@
greet_revolutionary(rev_mind)
modePlayer += head_revolutionaries
if(emergency_shuttle)
emergency_shuttle.always_fake_recall = 1
emergency_shuttle.auto_recall = 1
spawn (rand(waittime_l, waittime_h))
send_intercept()
..()
@@ -171,7 +171,7 @@
if(config.continous_rounds)
if(finished != 0)
if(emergency_shuttle)
emergency_shuttle.always_fake_recall = 0
emergency_shuttle.auto_recall = 0
return ..()
if(finished != 0)
return 1
+1 -1
View File
@@ -18,4 +18,4 @@
/datum/game_mode/sandbox/post_setup()
..()
if(emergency_shuttle)
emergency_shuttle.always_fake_recall = 1
emergency_shuttle.auto_recall = 1
+2 -2
View File
@@ -305,7 +305,7 @@
<B>Ore Mined:</B> [score_oremined] ([score_oremined * 2] Points)<BR>
<B>Refreshments Prepared:</B> [score_meals] ([score_meals * 5] Points)<BR>
<B>Research Completed:</B> [score_researchdone] ([score_researchdone * 30] Points)<BR>"}
if (emergency_shuttle.location == 2) dat += "<B>Shuttle Escapees:</B> [score_escapees] ([score_escapees * 25] Points)<BR>"
if (!emergency_shuttle.location()) dat += "<B>Shuttle Escapees:</B> [score_escapees] ([score_escapees * 25] Points)<BR>"
dat += {"<B>Random Events Endured:</B> [score_eventsendured] ([score_eventsendured * 50] Points)<BR>
<B>Whole Station Powered:</B> [score_powerbonus ? "Yes" : "No"] ([score_powerbonus * 2500] Points)<BR>
<B>Ultra-Clean Station:</B> [score_mess ? "No" : "Yes"] ([score_messbonus * 3000] Points)<BR><BR>
@@ -326,7 +326,7 @@
dat += {"<B>Richest Escapee:</B> [score_richestname], [score_richestjob]: $[num2text(score_richestcash,50)] ([score_richestkey])<BR>
<B>Most Battered Escapee:</B> [score_dmgestname], [score_dmgestjob]: [score_dmgestdamage] damage ([score_dmgestkey])<BR>"}
else
if (emergency_shuttle.location != 2) dat += "The station wasn't evacuated!<BR>"
if (emergency_shuttle.location()) dat += "The station wasn't evacuated!<BR>"
else dat += "No-one escaped!<BR>"
dat += {"<HR><BR>
<B><U>FINAL SCORE: [score_crewscore]</U></B><BR>"}
+36 -33
View File
@@ -29,7 +29,7 @@ var/shuttle_call/shuttle_calls[0]
from=get_turf(computer)
when=worldtime2text()
if(dir==SHUTTLE_RECALL)
var/timeleft=emergency_shuttle.timeleft()
var/timeleft=emergency_shuttle.estimate_arrival_time()
eta="[timeleft / 60 % 60]:[add_zero(num2text(timeleft % 60), 2)]"
// The communications computer
@@ -142,7 +142,7 @@ var/shuttle_call/shuttle_calls[0]
var/response = alert("Are you sure you wish to call the shuttle?", "Confirm", "Yes", "No")
if(response == "Yes")
call_shuttle_proc(usr)
if(emergency_shuttle.online)
if(emergency_shuttle.online())
post_status("shuttle")
setMenuState(usr,COMM_SCREEN_MAIN)
if("cancelshuttle")
@@ -150,8 +150,8 @@ var/shuttle_call/shuttle_calls[0]
if(src.authenticated)
var/response = alert("Are you sure you wish to recall the shuttle?", "Confirm", "Yes", "No")
if(response == "Yes")
recall_shuttle(usr)
if(emergency_shuttle.online)
cancel_call_proc(usr)
if(emergency_shuttle.online())
post_status("shuttle")
setMenuState(usr,COMM_SCREEN_MAIN)
if("messagelist")
@@ -307,11 +307,11 @@ var/shuttle_call/shuttle_calls[0]
data["current_message"] = data["is_ai"] ? aicurrmsg : currmsg
var/shuttle[0]
shuttle["on"]=emergency_shuttle.online
if (emergency_shuttle.online && emergency_shuttle.location==0)
var/timeleft=emergency_shuttle.timeleft()
shuttle["on"]=emergency_shuttle.online()
if (emergency_shuttle.online() && emergency_shuttle.location())
var/timeleft=emergency_shuttle.estimate_arrival_time()
shuttle["eta"]="[timeleft / 60 % 60]:[add_zero(num2text(timeleft % 60), 2)]"
shuttle["pos"] = emergency_shuttle.location
shuttle["pos"] = !emergency_shuttle.location()
shuttle["can_recall"]=!(recall_time_limit && world.time >= recall_time_limit)
data["shuttle"]=shuttle
@@ -358,42 +358,49 @@ var/shuttle_call/shuttle_calls[0]
PS.allowedtocall = !(PS.allowedtocall)
/proc/call_shuttle_proc(var/mob/user)
if ((!( ticker ) || emergency_shuttle.location))
if ((!( ticker ) || !emergency_shuttle.location()))
return
if(sent_strike_team == 1)
user << "Centcom will not allow the shuttle to be called. Consider all contracts terminated."
return
if(world.time < 6000) // Ten minute grace period to let the game get going without lolmetagaming. -- TLE
user << "The emergency shuttle is refueling. Please wait another [round((6000-world.time)/600)] minutes before trying again."
if(emergency_shuttle.deny_shuttle)
user << "The emergency shuttle may not be sent at this time. Please try again later."
return
if(emergency_shuttle.direction == -1)
if(world.time < 6000) // Ten minute grace period to let the game get going without lolmetagaming. -- TLE
user << "The emergency shuttle is refueling. Please wait another [round((6000-world.time)/60)] minutes before trying again."
return
if(emergency_shuttle.going_to_centcom())
user << "The emergency shuttle may not be called while returning to CentCom."
return
if(emergency_shuttle.online)
if(emergency_shuttle.online())
user << "The emergency shuttle is already on its way."
return
emergency_shuttle.incall()
if(ticker.mode.name == "blob")
user << "Under directive 7-10, [station_name()] is quarantined until further notice."
return
emergency_shuttle.call_evac()
log_game("[key_name(user)] has called the shuttle.")
message_admins("[key_name_admin(user)] has called the shuttle.", 1)
captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.")
world << sound('sound/AI/shuttlecalled.ogg')
return
/proc/init_shift_change(var/mob/user, var/force = 0)
if ((!( ticker ) || emergency_shuttle.location))
if ((!( ticker ) || !emergency_shuttle.location()))
return
if(emergency_shuttle.direction == -1)
if(emergency_shuttle.going_to_centcom())
user << "The shuttle may not be called while returning to CentCom."
return
if(emergency_shuttle.online)
if(emergency_shuttle.online())
user << "The shuttle is already on its way."
return
@@ -408,32 +415,32 @@ var/shuttle_call/shuttle_calls[0]
return
if(world.time < 54000) // 30 minute grace period to let the game get going
user << "The shuttle is refueling. Please wait another [round((54000-world.time)/600)] minutes before trying again."//may need to change "/600"
user << "The shuttle is refueling. Please wait another [round((54000-world.time)/60)] minutes before trying again."
return
if(ticker.mode.name == "revolution" || ticker.mode.name == "AI malfunction" || ticker.mode.name == "sandbox")
//New version pretends to call the shuttle but cause the shuttle to return after a random duration.
emergency_shuttle.fake_recall = rand(300,500)
emergency_shuttle.auto_recall = 1
if(ticker.mode.name == "epidemic")
user << "Under directive 7-10, [station_name()] is quarantined until further notice."
return
emergency_shuttle.shuttlealert(1)
emergency_shuttle.incall()
emergency_shuttle.call_transfer()
log_game("[key_name(user)] has called the shuttle.")
message_admins("[key_name_admin(user)] has called the shuttle - [formatJumpTo(user)].", 1)
captain_announce("A crew transfer has been initiated. The shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.")
captain_announce("A crew transfer has been initiated. The shuttle has been called. It will arrive in [round(emergency_shuttle.estimate_arrival_time()/60)] minutes.")
return
/proc/recall_shuttle(var/mob/user)
if ((!( ticker ) || emergency_shuttle.location || emergency_shuttle.direction == 0 || emergency_shuttle.timeleft() < 300))
/proc/cancel_call_proc(var/mob/user)
if (!( ticker ) || !emergency_shuttle.can_recall())
return
if(ticker.mode.name == "meteor")
return
if(emergency_shuttle.direction != -1 && emergency_shuttle.online) //check that shuttle isn't already heading to centcomm
if(!emergency_shuttle.going_to_centcom()) //check that shuttle isn't already heading to centcomm
emergency_shuttle.recall()
log_game("[key_name(user)] has recalled the shuttle.")
message_admins("[key_name_admin(user)] has recalled the shuttle - [formatJumpTo(user)].", 1)
@@ -479,11 +486,9 @@ var/shuttle_call/shuttle_calls[0]
if(ticker.mode.name == "revolution" || ticker.mode.name == "AI malfunction" || sent_strike_team)
return ..()
emergency_shuttle.incall(2)
emergency_shuttle.call_evac()
log_game("All the AIs, comm consoles and boards are destroyed. Shuttle called.")
message_admins("All the AIs, comm consoles and boards are destroyed. Shuttle called.", 1)
captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.")
world << sound('sound/AI/shuttlecalled.ogg')
..()
@@ -504,10 +509,8 @@ var/shuttle_call/shuttle_calls[0]
if(ticker.mode.name == "revolution" || ticker.mode.name == "AI malfunction" || sent_strike_team)
return ..()
emergency_shuttle.incall(2)
emergency_shuttle.call_evac()
log_game("All the AIs, comm consoles and boards are destroyed. Shuttle called.")
message_admins("All the AIs, comm consoles and boards are destroyed. Shuttle called.", 1)
captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.")
world << sound('sound/AI/shuttlecalled.ogg')
..()
+5 -6
View File
@@ -8,7 +8,7 @@
attackby(var/obj/item/weapon/card/W as obj, var/mob/user as mob)
if(stat & (BROKEN|NOPOWER)) return
if ((!( istype(W, /obj/item/weapon/card) ) || !( ticker ) || emergency_shuttle.location != 1 || !( user ))) return
if ((!( istype(W, /obj/item/weapon/card) ) || !( ticker ) || emergency_shuttle.location() || !( user ))) return
if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
if (istype(W, /obj/item/device/pda))
var/obj/item/device/pda/pda = W
@@ -27,7 +27,7 @@
return 0
var/choice = alert(user, text("Would you like to (un)authorize a shortened launch time? [] authorization\s are still needed. Use abort to cancel all authorizations.", src.auth_need - src.authorized.len), "Shuttle Launch", "Authorize", "Repeal", "Abort")
if(emergency_shuttle.location != 1 && user.get_active_hand() != W)
if(emergency_shuttle.location() && user.get_active_hand() != W)
return 0
switch(choice)
if("Authorize")
@@ -41,8 +41,7 @@
message_admins("[key_name_admin(user)] has launched the shuttle")
log_game("[user.ckey] has launched the shuttle early")
world << "\blue <B>Alert: Shuttle launch time shortened to 10 seconds!</B>"
emergency_shuttle.online = 1
emergency_shuttle.settimeleft(10)
emergency_shuttle.launch_time = min(world.time + 100, emergency_shuttle.launch_time)
//src.authorized = null
del(src.authorized)
src.authorized = list( )
@@ -59,11 +58,11 @@
else if (istype(W, /obj/item/weapon/card/emag) && !emagged)
var/choice = alert(user, "Would you like to launch the shuttle?","Shuttle control", "Launch", "Cancel")
if(!emagged && emergency_shuttle.location == 1 && user.get_active_hand() == W)
if(!emagged && !emergency_shuttle.location() && user.get_active_hand() == W)
switch(choice)
if("Launch")
world << "\blue <B>Alert: Shuttle launch time shortened to 10 seconds!</B>"
emergency_shuttle.settimeleft( 10 )
emergency_shuttle.launch_time = min(world.time + 100, emergency_shuttle.launch_time)
emagged = 1
if("Cancel")
return
+19 -11
View File
@@ -79,13 +79,15 @@
if(0) //blank
remove_display()
if(1) //emergency shuttle timer
if(emergency_shuttle.online)
var/line1
var/line2 = get_shuttle_timer()
if(emergency_shuttle.location == 1)
line1 = "-ETD-"
else
line1 = "-ETA-"
if(emergency_shuttle.waiting_to_leave())
var/line1 = "-ETD-"
var/line2 = get_shuttle_timer_departure()
if(length(line2) > CHARS_PER_LINE)
line2 = "Error!"
update_display(line1, line2)
else if(emergency_shuttle.has_eta())
var/line1 = "-ETA-"
var/line2 = get_shuttle_timer_arrival()
if(length(line2) > CHARS_PER_LINE)
line2 = "Error!"
update_display(line1, line2)
@@ -116,7 +118,7 @@
if(4) // supply shuttle timer
var/line1 = "SUPPLY"
var/line2 = ""
var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle
if (!shuttle)
line2 = "Error"
@@ -169,8 +171,14 @@
if(maptext != new_text)
maptext = new_text
proc/get_shuttle_timer()
var/timeleft = emergency_shuttle.timeleft()
proc/get_shuttle_timer_arrival()
var/timeleft = emergency_shuttle.estimate_arrival_time()
if(timeleft)
return "[add_zero(num2text((timeleft / 60) % 60),2)]:[add_zero(num2text(timeleft % 60), 2)]"
return ""
proc/get_shuttle_timer_departure()
var/timeleft = emergency_shuttle.estimate_launch_time()
if(timeleft)
return "[add_zero(num2text((timeleft / 60) % 60),2)]:[add_zero(num2text(timeleft % 60), 2)]"
return ""
@@ -179,7 +187,7 @@
var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle
if (!shuttle)
return "Error"
if(shuttle.has_eta())
var/timeleft = round((shuttle.arrive_time - world.time) / 10,1)
if(timeleft < 0)