mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Removes SHUTTLE_* defines being numeric
Wew, there was a lot to change. Fixes #17950. There is a lot of gamemode code here, so I'm not entirely sure if this is ultimately worth it.
This commit is contained in:
@@ -7,6 +7,10 @@
|
|||||||
#define SHUTTLE_ESCAPE 5
|
#define SHUTTLE_ESCAPE 5
|
||||||
#define SHUTTLE_ENDGAME 6
|
#define SHUTTLE_ENDGAME 6
|
||||||
|
|
||||||
|
#define EMERGENCY_IDLE_OR_RECALLED (SSshuttle.emergency && ((SSshuttle.emergency.mode == SHUTTLE_IDLE) || (SSshuttle.emergency.mode == SHUTTLE_RECALL)))
|
||||||
|
#define EMERGENCY_ESCAPED_OR_ENDGAMED (SSshuttle.emergency && ((SSshuttle.emergency.mode == SHUTTLE_ESCAPE) || (SSshuttle.emergency.mode == SHUTTLE_ENDGAME)))
|
||||||
|
#define EMERGENCY_AT_LEAST_DOCKED (SSshuttle.emergency && SSshuttle.emergency.mode != SHUTTLE_IDLE && SSshuttle.emergency.mode != SHUTTLE_RECALL && SSshuttle.emergency.mode != SHUTTLE_CALL)
|
||||||
|
|
||||||
// Shuttle return values
|
// Shuttle return values
|
||||||
#define SHUTTLE_NOT_A_DOCKING_PORT "not_a_docking_port"
|
#define SHUTTLE_NOT_A_DOCKING_PORT "not_a_docking_port"
|
||||||
#define SHUTTLE_DWIDTH_TOO_LARGE "docking_width_too_large"
|
#define SHUTTLE_DWIDTH_TOO_LARGE "docking_width_too_large"
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ var/datum/subsystem/shuttle/SSshuttle
|
|||||||
break
|
break
|
||||||
|
|
||||||
if(callShuttle)
|
if(callShuttle)
|
||||||
if(emergency.mode < SHUTTLE_CALL)
|
if(!EMERGENCY_IDLE_OR_RECALLED)
|
||||||
emergency.request(null, 2.5)
|
emergency.request(null, 2.5)
|
||||||
log_game("There is no means of calling the shuttle anymore. Shuttle automatically called.")
|
log_game("There is no means of calling the shuttle anymore. Shuttle automatically called.")
|
||||||
message_admins("All the communications consoles were destroyed and all AIs are inactive. Shuttle called.")
|
message_admins("All the communications consoles were destroyed and all AIs are inactive. Shuttle called.")
|
||||||
|
|||||||
@@ -351,9 +351,7 @@ var/datum/subsystem/ticker/ticker
|
|||||||
|
|
||||||
|
|
||||||
/datum/subsystem/ticker/proc/declare_completion()
|
/datum/subsystem/ticker/proc/declare_completion()
|
||||||
var/station_evacuated
|
var/station_evacuated = EMERGENCY_ESCAPED_OR_ENDGAMED
|
||||||
if(SSshuttle.emergency.mode >= SHUTTLE_ESCAPE)
|
|
||||||
station_evacuated = 1
|
|
||||||
var/num_survivors = 0
|
var/num_survivors = 0
|
||||||
var/num_escapees = 0
|
var/num_escapees = 0
|
||||||
|
|
||||||
|
|||||||
@@ -172,9 +172,10 @@
|
|||||||
/datum/game_mode/proc/check_finished() //to be called by ticker
|
/datum/game_mode/proc/check_finished() //to be called by ticker
|
||||||
if(replacementmode && round_converted == 2)
|
if(replacementmode && round_converted == 2)
|
||||||
return replacementmode.check_finished()
|
return replacementmode.check_finished()
|
||||||
if((SSshuttle.emergency && SSshuttle.emergency.mode >= SHUTTLE_ENDGAME) \
|
if(SSshuttle.emergency && (SSshuttle.emergency.mode == SHUTTLE_ENDGAME))
|
||||||
|| station_was_nuked)
|
return TRUE
|
||||||
return 1
|
if(station_was_nuked)
|
||||||
|
return TRUE
|
||||||
if(!round_converted && (!config.continuous[config_tag] || (config.continuous[config_tag] && config.midround_antag[config_tag]))) //Non-continuous or continous with replacement antags
|
if(!round_converted && (!config.continuous[config_tag] || (config.continuous[config_tag] && config.midround_antag[config_tag]))) //Non-continuous or continous with replacement antags
|
||||||
if(!continuous_sanity_checked) //make sure we have antags to be checking in the first place
|
if(!continuous_sanity_checked) //make sure we have antags to be checking in the first place
|
||||||
for(var/mob/Player in mob_list)
|
for(var/mob/Player in mob_list)
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
..()
|
..()
|
||||||
|
|
||||||
/datum/game_mode/monkey/check_finished()
|
/datum/game_mode/monkey/check_finished()
|
||||||
if(SSshuttle.emergency.mode >= SHUTTLE_ENDGAME || station_was_nuked)
|
if((SSshuttle.emergency.mode == SHUTTLE_ENDGAME) || station_was_nuked)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
if(!round_converted)
|
if(!round_converted)
|
||||||
|
|||||||
@@ -181,7 +181,7 @@
|
|||||||
/datum/game_mode/nuclear/check_finished() //to be called by ticker
|
/datum/game_mode/nuclear/check_finished() //to be called by ticker
|
||||||
if(replacementmode && round_converted == 2)
|
if(replacementmode && round_converted == 2)
|
||||||
return replacementmode.check_finished()
|
return replacementmode.check_finished()
|
||||||
if(SSshuttle.emergency.mode >= SHUTTLE_ENDGAME || station_was_nuked)
|
if((SSshuttle.emergency.mode == SHUTTLE_ENDGAME) || station_was_nuked)
|
||||||
return 1
|
return 1
|
||||||
if(are_operatives_dead())
|
if(are_operatives_dead())
|
||||||
if(bomb_set) //snaaaaaaaaaake! It's not over yet!
|
if(bomb_set) //snaaaaaaaaaake! It's not over yet!
|
||||||
@@ -194,7 +194,7 @@
|
|||||||
if(!D.onCentcom())
|
if(!D.onCentcom())
|
||||||
disk_rescued = 0
|
disk_rescued = 0
|
||||||
break
|
break
|
||||||
var/crew_evacuated = (SSshuttle.emergency.mode >= SHUTTLE_ENDGAME)
|
var/crew_evacuated = (SSshuttle.emergency.mode == SHUTTLE_ENDGAME)
|
||||||
//var/operatives_are_dead = is_operatives_are_dead()
|
//var/operatives_are_dead = is_operatives_are_dead()
|
||||||
|
|
||||||
|
|
||||||
@@ -223,7 +223,7 @@
|
|||||||
world << "<FONT size = 3><B>[syndicate_name()] operatives have earned Darwin Award!</B></FONT>"
|
world << "<FONT size = 3><B>[syndicate_name()] operatives have earned Darwin Award!</B></FONT>"
|
||||||
world << "<B>[syndicate_name()] operatives blew up something that wasn't [station_name()] and got caught in the explosion.</B> Next time, don't lose the disk!"
|
world << "<B>[syndicate_name()] operatives blew up something that wasn't [station_name()] and got caught in the explosion.</B> Next time, don't lose the disk!"
|
||||||
|
|
||||||
else if ((disk_rescued || SSshuttle.emergency.mode < SHUTTLE_ENDGAME) && are_operatives_dead())
|
else if ((disk_rescued || SSshuttle.emergency.mode != SHUTTLE_ENDGAME) && are_operatives_dead())
|
||||||
feedback_set_details("round_end_result","loss - evacuation - disk secured - syndi team dead")
|
feedback_set_details("round_end_result","loss - evacuation - disk secured - syndi team dead")
|
||||||
world << "<FONT size = 3><B>Crew Major Victory!</B></FONT>"
|
world << "<FONT size = 3><B>Crew Major Victory!</B></FONT>"
|
||||||
world << "<B>The Research Staff has saved the disc and killed the [syndicate_name()] Operatives</B>"
|
world << "<B>The Research Staff has saved the disc and killed the [syndicate_name()] Operatives</B>"
|
||||||
|
|||||||
@@ -212,7 +212,7 @@
|
|||||||
/datum/objective/hijack/check_completion()
|
/datum/objective/hijack/check_completion()
|
||||||
if(!owner.current || owner.current.stat)
|
if(!owner.current || owner.current.stat)
|
||||||
return 0
|
return 0
|
||||||
if(SSshuttle.emergency.mode < SHUTTLE_ENDGAME)
|
if(SSshuttle.emergency.mode != SHUTTLE_ENDGAME)
|
||||||
return 0
|
return 0
|
||||||
if(issilicon(owner.current))
|
if(issilicon(owner.current))
|
||||||
return 0
|
return 0
|
||||||
@@ -243,7 +243,7 @@
|
|||||||
/datum/objective/hijackclone/check_completion()
|
/datum/objective/hijackclone/check_completion()
|
||||||
if(!owner.current)
|
if(!owner.current)
|
||||||
return 0
|
return 0
|
||||||
if(SSshuttle.emergency.mode < SHUTTLE_ENDGAME)
|
if(SSshuttle.emergency.mode != SHUTTLE_ENDGAME)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
var/area/A = SSshuttle.emergency.areaInstance
|
var/area/A = SSshuttle.emergency.areaInstance
|
||||||
@@ -283,7 +283,7 @@
|
|||||||
/datum/objective/block/check_completion()
|
/datum/objective/block/check_completion()
|
||||||
if(!istype(owner.current, /mob/living/silicon))
|
if(!istype(owner.current, /mob/living/silicon))
|
||||||
return 0
|
return 0
|
||||||
if(SSshuttle.emergency.mode < SHUTTLE_ENDGAME)
|
if(SSshuttle.emergency.mode != SHUTTLE_ENDGAME)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
var/area/A = SSshuttle.emergency.areaInstance
|
var/area/A = SSshuttle.emergency.areaInstance
|
||||||
@@ -305,7 +305,7 @@
|
|||||||
martyr_compatible = 1
|
martyr_compatible = 1
|
||||||
|
|
||||||
/datum/objective/purge/check_completion()
|
/datum/objective/purge/check_completion()
|
||||||
if(SSshuttle.emergency.mode < SHUTTLE_ENDGAME)
|
if(SSshuttle.emergency.mode != SHUTTLE_ENDGAME)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
var/area/A = SSshuttle.emergency.areaInstance
|
var/area/A = SSshuttle.emergency.areaInstance
|
||||||
@@ -354,7 +354,7 @@
|
|||||||
return 1
|
return 1
|
||||||
if(ticker.mode.station_was_nuked) //If they escaped the blast somehow, let them win
|
if(ticker.mode.station_was_nuked) //If they escaped the blast somehow, let them win
|
||||||
return 1
|
return 1
|
||||||
if(SSshuttle.emergency.mode < SHUTTLE_ENDGAME)
|
if(SSshuttle.emergency.mode != SHUTTLE_ENDGAME)
|
||||||
return 0
|
return 0
|
||||||
var/turf/location = get_turf(owner.current)
|
var/turf/location = get_turf(owner.current)
|
||||||
if(!location)
|
if(!location)
|
||||||
|
|||||||
@@ -217,11 +217,11 @@ Made by Xhuis
|
|||||||
|
|
||||||
|
|
||||||
/datum/game_mode/shadowling/declare_completion()
|
/datum/game_mode/shadowling/declare_completion()
|
||||||
if(check_shadow_victory() && SSshuttle.emergency.mode >= SHUTTLE_ESCAPE) //Doesn't end instantly - this is hacky and I don't know of a better way ~X
|
if(check_shadow_victory() && EMERGENCY_ESCAPED_OR_ENDGAMED) //Doesn't end instantly - this is hacky and I don't know of a better way ~X
|
||||||
world << "<span class='greentext'>The shadowlings have ascended and taken over the station!</span>"
|
world << "<span class='greentext'>The shadowlings have ascended and taken over the station!</span>"
|
||||||
else if(shadowling_dead && !check_shadow_victory()) //If the shadowlings have ascended, they can not lose the round
|
else if(shadowling_dead && !check_shadow_victory()) //If the shadowlings have ascended, they can not lose the round
|
||||||
world << "<span class='redtext'>The shadowlings have been killed by the crew!</span>"
|
world << "<span class='redtext'>The shadowlings have been killed by the crew!</span>"
|
||||||
else if(!check_shadow_victory() && SSshuttle.emergency.mode >= SHUTTLE_ESCAPE)
|
else if(!check_shadow_victory() && EMERGENCY_ESCAPED_OR_ENDGAMED)
|
||||||
world << "<span class='redtext'>The crew escaped the station before the shadowlings could ascend!</span>"
|
world << "<span class='redtext'>The crew escaped the station before the shadowlings could ascend!</span>"
|
||||||
else
|
else
|
||||||
world << "<span class='redtext'>The shadowlings have failed!</span>"
|
world << "<span class='redtext'>The shadowlings have failed!</span>"
|
||||||
|
|||||||
@@ -505,7 +505,7 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12
|
|||||||
dat += "Current login: None"
|
dat += "Current login: None"
|
||||||
dat += "<BR><BR><B>General Functions</B>"
|
dat += "<BR><BR><B>General Functions</B>"
|
||||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=ai-messagelist'>Message List</A> \]"
|
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=ai-messagelist'>Message List</A> \]"
|
||||||
if(SSshuttle.emergency.mode <= SHUTTLE_IDLE)
|
if(SSshuttle.emergency.mode == SHUTTLE_IDLE)
|
||||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=ai-callshuttle'>Call Emergency Shuttle</A> \]"
|
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=ai-callshuttle'>Call Emergency Shuttle</A> \]"
|
||||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=ai-status'>Set Status Display</A> \]"
|
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=ai-status'>Set Status Display</A> \]"
|
||||||
dat += "<BR><BR><B>Special Functions</B>"
|
dat += "<BR><BR><B>Special Functions</B>"
|
||||||
|
|||||||
@@ -318,11 +318,11 @@
|
|||||||
dat += "Current Game Mode: <B>[ticker.mode.name]</B><BR>"
|
dat += "Current Game Mode: <B>[ticker.mode.name]</B><BR>"
|
||||||
dat += "Round Duration: <B>[round(world.time / 36000)]:[add_zero("[world.time / 600 % 60]", 2)]:[world.time / 100 % 6][world.time / 100 % 10]</B><BR>"
|
dat += "Round Duration: <B>[round(world.time / 36000)]:[add_zero("[world.time / 600 % 60]", 2)]:[world.time / 100 % 6][world.time / 100 % 10]</B><BR>"
|
||||||
dat += "<B>Emergency shuttle</B><BR>"
|
dat += "<B>Emergency shuttle</B><BR>"
|
||||||
if(SSshuttle.emergency.mode < SHUTTLE_CALL)
|
if(EMERGENCY_IDLE_OR_RECALLED)
|
||||||
dat += "<a href='?_src_=holder;call_shuttle=1'>Call Shuttle</a><br>"
|
dat += "<a href='?_src_=holder;call_shuttle=1'>Call Shuttle</a><br>"
|
||||||
else
|
else
|
||||||
var/timeleft = SSshuttle.emergency.timeLeft()
|
var/timeleft = SSshuttle.emergency.timeLeft()
|
||||||
if(SSshuttle.emergency.mode < SHUTTLE_DOCKED)
|
if(SSshuttle.emergency.mode == SHUTTLE_CALL)
|
||||||
dat += "ETA: <a href='?_src_=holder;edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]</a><BR>"
|
dat += "ETA: <a href='?_src_=holder;edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]</a><BR>"
|
||||||
dat += "<a href='?_src_=holder;call_shuttle=2'>Send Back</a><br>"
|
dat += "<a href='?_src_=holder;call_shuttle=2'>Send Back</a><br>"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -252,14 +252,14 @@
|
|||||||
|
|
||||||
switch(href_list["call_shuttle"])
|
switch(href_list["call_shuttle"])
|
||||||
if("1")
|
if("1")
|
||||||
if(SSshuttle.emergency.mode >= SHUTTLE_DOCKED)
|
if(EMERGENCY_AT_LEAST_DOCKED)
|
||||||
return
|
return
|
||||||
SSshuttle.emergency.request()
|
SSshuttle.emergency.request()
|
||||||
log_admin("[key_name(usr)] called the Emergency Shuttle")
|
log_admin("[key_name(usr)] called the Emergency Shuttle")
|
||||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] called the Emergency Shuttle to the station</span>")
|
message_admins("<span class='adminnotice'>[key_name_admin(usr)] called the Emergency Shuttle to the station</span>")
|
||||||
|
|
||||||
if("2")
|
if("2")
|
||||||
if(SSshuttle.emergency.mode >= SHUTTLE_DOCKED)
|
if(EMERGENCY_AT_LEAST_DOCKED)
|
||||||
return
|
return
|
||||||
switch(SSshuttle.emergency.mode)
|
switch(SSshuttle.emergency.mode)
|
||||||
if(SHUTTLE_CALL)
|
if(SHUTTLE_CALL)
|
||||||
|
|||||||
@@ -642,7 +642,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
|||||||
set category = "Admin"
|
set category = "Admin"
|
||||||
set name = "Call Shuttle"
|
set name = "Call Shuttle"
|
||||||
|
|
||||||
if(SSshuttle.emergency.mode >= SHUTTLE_DOCKED)
|
if(EMERGENCY_AT_LEAST_DOCKED)
|
||||||
return
|
return
|
||||||
|
|
||||||
if (!holder)
|
if (!holder)
|
||||||
@@ -667,7 +667,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
|||||||
if(alert(src, "You sure?", "Confirm", "Yes", "No") != "Yes")
|
if(alert(src, "You sure?", "Confirm", "Yes", "No") != "Yes")
|
||||||
return
|
return
|
||||||
|
|
||||||
if(SSshuttle.emergency.mode >= SHUTTLE_DOCKED)
|
if(EMERGENCY_AT_LEAST_DOCKED)
|
||||||
return
|
return
|
||||||
|
|
||||||
SSshuttle.emergency.cancel()
|
SSshuttle.emergency.cancel()
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ var/list/ai_list = list()
|
|||||||
SSshuttle.requestEvac(src, reason)
|
SSshuttle.requestEvac(src, reason)
|
||||||
|
|
||||||
// hack to display shuttle timer
|
// hack to display shuttle timer
|
||||||
if(SSshuttle.emergency.mode >= SHUTTLE_CALL)
|
if(!EMERGENCY_IDLE_OR_RECALLED)
|
||||||
var/obj/machinery/computer/communications/C = locate() in machines
|
var/obj/machinery/computer/communications/C = locate() in machines
|
||||||
if(C)
|
if(C)
|
||||||
C.post_status("shuttle")
|
C.post_status("shuttle")
|
||||||
|
|||||||
Reference in New Issue
Block a user