Gamemode refactor, lots of code shuffles, PR will have details.

This commit is contained in:
Zuhayr
2015-03-14 23:01:51 +10:30
parent cd0bf9622d
commit 98da191ac3
147 changed files with 5751 additions and 11965 deletions

View File

@@ -67,6 +67,9 @@
var/automute_on = 0 //enables automuting/spam prevention
var/jobs_have_minimal_access = 0 //determines whether jobs use minimal access or expanded access.
var/rp_rev = 0 // Changes between conversion methods in rev.
var/announce_revheads = 0 // Determines if revheads are announced in revolution mode.
var/cult_ghostwriter = 1 //Allows ghosts to write in blood in cult rounds...
var/cult_ghostwriter_req_cultists = 10 //...so long as this many cultists are active.
@@ -82,7 +85,7 @@
var/usealienwhitelist = 0
var/limitalienplayers = 0
var/alien_to_human_ratio = 0.5
var/allow_extra_antags = 0
var/guests_allowed = 1
var/debugparanoid = 0
@@ -585,6 +588,15 @@
if("disable_welder_vision")
config.welder_vision = 0
if("rp_rev")
config.rp_rev = 1
if("announce_revheads")
config.announce_revheads = 1
if("allow_extra_antags")
config.allow_extra_antags = 1
if("event_custom_start_mundane")
var/values = text2numlist(value, ";")
config.event_first_run[EVENT_LEVEL_MUNDANE] = list("lower" = MinutesToTicks(values[1]), "upper" = MinutesToTicks(values[2]))
@@ -770,6 +782,7 @@
for (var/T in (typesof(/datum/game_mode) - /datum/game_mode))
var/datum/game_mode/M = new T()
if (M.config_tag && M.config_tag == mode_name)
M.create_antagonists()
return M
del(M)
return new /datum/game_mode/extended()

View File

@@ -136,9 +136,8 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
/datum/emergency_shuttle_controller/proc/get_shuttle_prep_time()
// During mutiny rounds, the shuttle takes twice as long.
if(ticker && istype(ticker.mode,/datum/game_mode/mutiny))
return SHUTTLE_PREPTIME * 3 //15 minutes
if(ticker && ticker.mode)
return SHUTTLE_PREPTIME * ticker.mode.shuttle_delay
return SHUTTLE_PREPTIME

View File

@@ -26,7 +26,7 @@ datum/controller/game_controller/New()
job_master = new /datum/controller/occupations()
job_master.SetupOccupations()
job_master.LoadJobs("config/jobs.txt")
world << "\red \b Job setup complete"
world << "<span class='danger'>Job setup complete</span>"
if(!syndicate_code_phrase) syndicate_code_phrase = generate_code_phrase()
if(!syndicate_code_response) syndicate_code_response = generate_code_phrase()
@@ -42,7 +42,6 @@ datum/controller/game_controller/proc/setup()
setup_objects()
setupgenetics()
setupfactions()
setup_economy()
SetupXenoarch()
@@ -50,17 +49,17 @@ datum/controller/game_controller/proc/setup()
datum/controller/game_controller/proc/setup_objects()
world << "\red \b Initializing objects"
world << "<span class='danger'>Initializing objects</span>"
sleep(-1)
for(var/atom/movable/object in world)
object.initialize()
world << "\red \b Initializing pipe networks"
world << "<span class='danger'>Initializing pipe networks</span>"
sleep(-1)
for(var/obj/machinery/atmospherics/machine in machines)
machine.build_network()
world << "\red \b Initializing atmos machinery."
world << "<span class='danger'>Initializing atmos machinery.</span>"
sleep(-1)
for(var/obj/machinery/atmospherics/unary/U in machines)
if(istype(U, /obj/machinery/atmospherics/unary/vent_pump))
@@ -75,13 +74,11 @@ datum/controller/game_controller/proc/setup_objects()
// If you do not use the official Baycode asteroid map, you will need to change them.
asteroid_ore_map = new /datum/random_map/ore(null,13,32,5,217,223)
//Shitty hack to fix mining turf overlays, for some reason New() is not being called.
//for(var/turf/simulated/floor/plating/airless/asteroid/T in world)
// T.updateMineralOverlays()
// T.name = "asteroid"
// Set up antagonists.
populate_antag_type_list()
//Set up spawn points.
populate_spawn_points()
world << "\red \b Initializations complete."
world << "<span class='danger'>Initializations complete.</span>"
sleep(-1)

View File

@@ -52,6 +52,16 @@
message_admins("Admin [key_name_admin(usr)] has restarted the [controller] controller.")
return
/client/proc/debug_antagonist_template(antag_type in all_antag_types)
set category = "Debug"
set name = "Debug Antagonist"
set desc = "Debug an antagonist template."
var/datum/antagonist/antag = all_antag_types[antag_type]
if(antag)
usr.client.debug_variables(antag)
message_admins("Admin [key_name_admin(usr)] is debugging the [antag.role_text] template.")
/client/proc/debug_controller(controller in list("Master","Failsafe","Ticker","Lighting","Air","Jobs","Sun","Radio","Supply","Shuttles","Emergency Shuttle","Configuration","pAI", "Cameras", "Transfer Controller", "Gas Data","Event","Plants","Alarm","Nano"))
set category = "Debug"
set name = "Debug Controller"

View File

@@ -129,7 +129,7 @@ datum/controller/vote
for(var/key in current_votes)
if(choices[current_votes[key]] == .)
round_voters += key // Keep track of who voted for the winning round.
if((mode == "gamemode" && . == "extended") || ticker.hide_mode == 0) // Announce Extended gamemode, but not other gamemodes
if((mode == "gamemode" && . == "Extended") || ticker.hide_mode == 0) // Announce Extended gamemode, but not other gamemodes
text += "<b>Vote Result: [.]</b>"
else
if(mode != "gamemode")
@@ -139,6 +139,8 @@ datum/controller/vote
else
text += "<b>Vote Result: Inconclusive - No Votes!</b>"
if(mode == "add_antagonist")
antag_add_failed = 1
log_vote(text)
world << "<font color='purple'>[text]</font>"
return .
@@ -161,6 +163,11 @@ datum/controller/vote
if("crew_transfer")
if(. == "Initiate Crew Transfer")
init_shift_change(null, 1)
if("add_antagonist")
if(isnull(.) || . == "None")
antag_add_failed = 1
else
additional_antag_types |= antag_names_to_ids[.]
if(mode == "gamemode") //fire this even if the vote fails.
if(!going)
@@ -208,7 +215,7 @@ datum/controller/vote
var/list/L = typesof(/datum/game_mode) - /datum/game_mode
for (var/F in choices)
for (var/T in L)
var/datum/game_mode/M = new T()
var/datum/game_mode/M = new T(1)
if (M.config_tag == F)
gamemode_names[M.config_tag] = capitalize(M.name) //It's ugly to put this here but it works
additional_text.Add("<td align = 'center'>[M.required_players]</td>")
@@ -227,6 +234,14 @@ datum/controller/vote
initiator_key << "The crew transfer button has been disabled!"
question = "End the shift?"
choices.Add("Initiate Crew Transfer", "Continue The Round")
if("add_antagonist")
if(!config.allow_extra_antags || ticker.current_state >= 2)
return 0
for(var/antag_type in all_antag_types)
var/datum/antagonist/antag = all_antag_types[antag_type]
if(!(antag.id in additional_antag_types) && (antag.flags & ANTAG_VOTABLE))
choices.Add(antag.role_text)
choices.Add("None")
if("custom")
question = html_encode(input(usr,"What is the vote for?") as text|null)
if(!question) return 0
@@ -234,7 +249,8 @@ datum/controller/vote
var/option = capitalize(html_encode(input(usr,"Please enter an option or hit cancel to finish") as text|null))
if(!option || mode || !usr.client) break
choices.Add(option)
else return 0
else
return 0
mode = vote_type
initiator = initiator_key
started_time = world.time
@@ -320,7 +336,12 @@ datum/controller/vote
. += "<font color='grey'>GameMode (Disallowed)</font>"
if(trialmin)
. += "\t(<a href='?src=\ref[src];vote=toggle_gamemode'>[config.allow_vote_mode?"Allowed":"Disallowed"]</a>)"
. += "</li><li>"
//extra antagonists
if(trialmin || (!antag_add_failed && config.allow_extra_antags))
. += "<a href='?src=\ref[src];vote=add_antagonist'>Add Antagonist Type</a>"
else
. += "<font color='grey'>Restart (Disallowed)</font>"
. += "</li>"
//custom
if(trialmin)
@@ -355,6 +376,9 @@ datum/controller/vote
if("crew_transfer")
if(config.allow_vote_restart || usr.client.holder)
initiate_vote("crew_transfer",usr.key)
if("add_antagonist")
if(config.allow_extra_antags || usr.client.holder)
initiate_vote("add_antagonist",usr.key)
if("custom")
if(usr.client.holder)
initiate_vote("custom",usr.key)