April sync (#360)

* Maps and things no code/icons

* helpers defines globalvars

* Onclick world.dm orphaned_procs

* subsystems

Round vote and shuttle autocall done here too

* datums

* Game folder

* Admin - chatter modules

* clothing - mining

* modular computers - zambies

* client

* mob level 1

* mob stage 2 + simple_animal

* silicons n brains

* mob stage 3 + Alien/Monkey

* human mobs

* icons updated

* some sounds

* emitter y u no commit

* update tgstation.dme

* compile fixes

* travis fixes

Also removes Fast digest mode, because reasons.

* tweaks for travis Mentors are broke again

Also fixes Sizeray guns

* oxygen loss fix for vore code.

* removes unused code

* some code updates

* bulk fixes

* further fixes

* outside things

* whoops.

* Maint bar ported

* GLOBs.
This commit is contained in:
Poojawa
2017-04-13 23:37:00 -05:00
committed by GitHub
parent cdc32c98fa
commit 7e9b96a00f
1322 changed files with 174827 additions and 23888 deletions
+99 -83
View File
@@ -1,10 +1,6 @@
#define ROUND_START_MUSIC_LIST "strings/round_start_sounds.txt"
var/round_start_time = 0
var/datum/controller/subsystem/ticker/ticker
/datum/controller/subsystem/ticker
SUBSYSTEM_DEF(ticker)
name = "Ticker"
init_order = 13
@@ -44,6 +40,8 @@ var/datum/controller/subsystem/ticker/ticker
var/timeLeft //pregame timer
var/start_at
var/gametime_offset = 432000 // equal to 12 hours, making gametime at roundstart 12:00:00
var/totalPlayers = 0 //used for pregame stats on statpanel
var/totalPlayersReady = 0 //used for pregame stats on statpanel
@@ -58,19 +56,19 @@ var/datum/controller/subsystem/ticker/ticker
var/late_join_disabled
var/modevoted = FALSE //Have we sent a vote for the gamemode?
var/round_start_time = 0
var/list/round_start_events
/datum/controller/subsystem/ticker/New()
NEW_SS_GLOBAL(ticker)
var/modevoted = FALSE //Have we sent a vote for the gamemode?
/datum/controller/subsystem/ticker/Initialize(timeofday)
var/list/music = file2list(ROUND_START_MUSIC_LIST, "\n")
login_music = pick(music)
if(!syndicate_code_phrase)
syndicate_code_phrase = generate_code_phrase()
if(!syndicate_code_response)
syndicate_code_response = generate_code_phrase()
if(!GLOB.syndicate_code_phrase)
GLOB.syndicate_code_phrase = generate_code_phrase()
if(!GLOB.syndicate_code_response)
GLOB.syndicate_code_response = generate_code_phrase()
..()
start_at = world.time + (config.lobby_countdown * 10)
@@ -79,7 +77,7 @@ var/datum/controller/subsystem/ticker/ticker
if(GAME_STATE_STARTUP)
if(Master.initializations_finished_with_no_players_logged_in)
start_at = world.time + (config.lobby_countdown * 10)
for(var/client/C in clients)
for(var/client/C in GLOB.clients)
window_flash(C, ignorepref = TRUE) //let them know lobby has opened up.
to_chat(world, "<span class='boldnotice'>Welcome to [station_name()]!</span>")
current_state = GAME_STATE_PREGAME
@@ -93,7 +91,7 @@ var/datum/controller/subsystem/ticker/ticker
timeLeft = max(0,start_at - world.time)
totalPlayers = 0
totalPlayersReady = 0
for(var/mob/dead/new_player/player in player_list)
for(var/mob/dead/new_player/player in GLOB.player_list)
++totalPlayers
if(player.ready)
++totalPlayersReady
@@ -137,15 +135,15 @@ var/datum/controller/subsystem/ticker/ticker
var/init_start = world.timeofday
//Create and announce mode
var/list/datum/game_mode/runnable_modes
if(master_mode == "random" || master_mode == "secret")
if(GLOB.master_mode == "random" || GLOB.master_mode == "secret")
runnable_modes = config.get_runnable_modes()
if(master_mode == "secret")
if(GLOB.master_mode == "secret")
hide_mode = 1
if(secret_force_mode != "secret")
var/datum/game_mode/smode = config.pick_mode(secret_force_mode)
if(GLOB.secret_force_mode != "secret")
var/datum/game_mode/smode = config.pick_mode(GLOB.secret_force_mode)
if(!smode.can_start())
message_admins("\blue Unable to force secret [secret_force_mode]. [smode.required_players] players and [smode.required_enemies] eligible antagonists needed.")
message_admins("\blue Unable to force secret [GLOB.secret_force_mode]. [smode.required_players] players and [smode.required_enemies] eligible antagonists needed.")
else
mode = smode
@@ -156,7 +154,7 @@ var/datum/controller/subsystem/ticker/ticker
mode = pickweight(runnable_modes)
else
mode = config.pick_mode(master_mode)
mode = config.pick_mode(GLOB.master_mode)
if(!mode.can_start())
to_chat(world, "<B>Unable to start [mode.name].</B> Not enough players, [mode.required_players] players and [mode.required_enemies] eligible antagonists needed. Reverting to pre-game lobby.")
qdel(mode)
@@ -172,11 +170,11 @@ var/datum/controller/subsystem/ticker/ticker
SSjob.DivideOccupations() //Distribute jobs
CHECK_TICK
if(!Debug2)
if(!GLOB.Debug2)
if(!can_continue)
qdel(mode)
mode = null
to_chat(world, "<B>Error setting up [master_mode].</B> Reverting to pre-game lobby.")
to_chat(world, "<B>Error setting up [GLOB.master_mode].</B> Reverting to pre-game lobby.")
SSjob.ResetOccupations()
return 0
else
@@ -196,19 +194,24 @@ var/datum/controller/subsystem/ticker/ticker
toggle_ooc(0) // Turn it off
CHECK_TICK
start_landmarks_list = shuffle(start_landmarks_list) //Shuffle the order of spawn points so they dont always predictably spawn bottom-up and right-to-left
GLOB.start_landmarks_list = shuffle(GLOB.start_landmarks_list) //Shuffle the order of spawn points so they dont always predictably spawn bottom-up and right-to-left
create_characters() //Create player characters
collect_minds()
equip_characters()
SSoverlays.Flush() //Flush the majority of the shit
data_core.manifest()
GLOB.data_core.manifest()
transfer_characters() //transfer keys to the new mobs
Master.RoundStart() //let the party begin...
for(var/I in round_start_events)
var/datum/callback/cb = I
cb.InvokeAsync()
LAZYCLEARLIST(round_start_events)
log_world("Game start took [(world.timeofday - init_start)/10]s")
round_start_time = world.time
@@ -217,10 +220,10 @@ var/datum/controller/subsystem/ticker/ticker
current_state = GAME_STATE_PLAYING
if(SSevent.holidays)
if(SSevents.holidays)
to_chat(world, "<font color='blue'>and...</font>")
for(var/holidayname in SSevent.holidays)
var/datum/holiday/holiday = SSevent.holidays[holidayname]
for(var/holidayname in SSevents.holidays)
var/datum/holiday/holiday = SSevents.holidays[holidayname]
to_chat(world, "<h4>[holiday.greet()]</h4>")
PostSetup()
@@ -231,7 +234,7 @@ var/datum/controller/subsystem/ticker/ticker
set waitfor = 0
mode.post_setup()
//Cleanup some stuff
for(var/obj/effect/landmark/start/S in landmarks_list)
for(var/obj/effect/landmark/start/S in GLOB.landmarks_list)
//Deleting Startpoints but we need the ai point to AI-ize people later
if(S.name != "AI")
qdel(S)
@@ -240,6 +243,12 @@ var/datum/controller/subsystem/ticker/ticker
var/list/allmins = adm["present"]
send2irc("Server", "Round of [hide_mode ? "secret":"[mode.name]"] has started[allmins.len ? ".":" with no active admins online!"]")
/datum/controller/subsystem/ticker/proc/OnRoundstart(datum/callback/cb)
if(current_state < GAME_STATE_PLAYING)
LAZYADD(round_start_events, cb)
else
cb.InvokeAsync()
/datum/controller/subsystem/ticker/proc/station_explosion_detonation(atom/bomb)
if(bomb) //BOOM
var/turf/epi = bomb.loc
@@ -252,7 +261,7 @@ var/datum/controller/subsystem/ticker/ticker
if( cinematic )
return //already a cinematic in progress!
for (var/datum/html_interface/hi in html_interfaces)
for (var/datum/html_interface/hi in GLOB.html_interfaces)
hi.closeAll()
SStgui.close_all_uis()
@@ -264,7 +273,7 @@ var/datum/controller/subsystem/ticker/ticker
//initialise our cinematic screen object
cinematic = new /obj/screen{icon='icons/effects/station_explosion.dmi';icon_state="station_intact";layer=21;mouse_opacity=0;screen_loc="1,0";}(src)
for(var/mob/M in mob_list)
for(var/mob/M in GLOB.mob_list)
M.notransform = TRUE //stop everything moving
if(M.client)
M.client.screen += cinematic //show every client the cinematic
@@ -366,30 +375,30 @@ var/datum/controller/subsystem/ticker/ticker
if(cinematic)
qdel(cinematic) //end the cinematic
cinematic = null
for(var/mob/M in mob_list)
for(var/mob/M in GLOB.mob_list)
M.notransform = FALSE
if(actually_blew_up && !isnull(killz) && M.stat != DEAD && M.z == killz)
M.gib()
/datum/controller/subsystem/ticker/proc/create_characters()
for(var/mob/dead/new_player/player in player_list)
for(var/mob/dead/new_player/player in GLOB.player_list)
if(player.ready && player.mind)
joined_player_list += player.ckey
GLOB.joined_player_list += player.ckey
player.create_character(FALSE)
else
player.new_player_panel()
CHECK_TICK
/datum/controller/subsystem/ticker/proc/collect_minds()
for(var/mob/dead/new_player/P in player_list)
for(var/mob/dead/new_player/P in GLOB.player_list)
if(P.new_character && P.new_character.mind)
ticker.minds += P.new_character.mind
SSticker.minds += P.new_character.mind
CHECK_TICK
/datum/controller/subsystem/ticker/proc/equip_characters()
var/captainless=1
for(var/mob/dead/new_player/N in player_list)
for(var/mob/dead/new_player/N in GLOB.player_list)
var/mob/living/carbon/human/player = N.new_character
if(istype(player) && player.mind && player.mind.assigned_role)
if(player.mind.assigned_role == "Captain")
@@ -398,14 +407,14 @@ var/datum/controller/subsystem/ticker/ticker
SSjob.EquipRank(N, player.mind.assigned_role, 0)
CHECK_TICK
if(captainless)
for(var/mob/dead/new_player/N in player_list)
for(var/mob/dead/new_player/N in GLOB.player_list)
if(N.new_character)
to_chat(N, "Captainship not forced on anyone.")
CHECK_TICK
/datum/controller/subsystem/ticker/proc/transfer_characters()
var/list/livings = list()
for(var/mob/dead/new_player/player in player_list)
for(var/mob/dead/new_player/player in GLOB.player_list)
var/mob/living = player.transfer_character()
if(living)
qdel(player)
@@ -432,7 +441,7 @@ var/datum/controller/subsystem/ticker/ticker
to_chat(world, "<BR><BR><BR><FONT size=3><B>The round has ended.</B></FONT>")
//Player status report
for(var/mob/Player in mob_list)
for(var/mob/Player in GLOB.mob_list)
if(Player.mind && !isnewplayer(Player))
if(Player.stat != DEAD && !isbrain(Player))
num_survivors++
@@ -457,28 +466,28 @@ var/datum/controller/subsystem/ticker/ticker
//Round statistics report
var/datum/station_state/end_state = new /datum/station_state()
end_state.count()
var/station_integrity = min(PERCENT(start_state.score(end_state)), 100)
var/station_integrity = min(PERCENT(GLOB.start_state.score(end_state)), 100)
to_chat(world, "<BR>[TAB]Shift Duration: <B>[round(world.time / 36000)]:[add_zero("[world.time / 600 % 60]", 2)]:[world.time / 100 % 6][world.time / 100 % 10]</B>")
to_chat(world, "<BR>[TAB]Station Integrity: <B>[mode.station_was_nuked ? "<font color='red'>Destroyed</font>" : "[station_integrity]%"]</B>")
to_chat(world, "<BR>[GLOB.TAB]Shift Duration: <B>[round(world.time / 36000)]:[add_zero("[world.time / 600 % 60]", 2)]:[world.time / 100 % 6][world.time / 100 % 10]</B>")
to_chat(world, "<BR>[GLOB.TAB]Station Integrity: <B>[mode.station_was_nuked ? "<font color='red'>Destroyed</font>" : "[station_integrity]%"]</B>")
if(mode.station_was_nuked)
ticker.news_report = STATION_DESTROYED_NUKE
var/total_players = joined_player_list.len
if(joined_player_list.len)
to_chat(world, "<BR>[TAB]Total Population: <B>[total_players]</B>")
SSticker.news_report = STATION_DESTROYED_NUKE
var/total_players = GLOB.joined_player_list.len
if(total_players)
to_chat(world, "<BR>[GLOB.TAB]Total Population: <B>[total_players]</B>")
if(station_evacuated)
to_chat(world, "<BR>[TAB]Evacuation Rate: <B>[num_escapees] ([PERCENT(num_escapees/total_players)]%)</B>")
to_chat(world, "<BR>[TAB](on emergency shuttle): <B>[num_shuttle_escapees] ([PERCENT(num_shuttle_escapees/total_players)]%)</B>")
to_chat(world, "<BR>[GLOB.TAB]Evacuation Rate: <B>[num_escapees] ([PERCENT(num_escapees/total_players)]%)</B>")
to_chat(world, "<BR>[GLOB.TAB](on emergency shuttle): <B>[num_shuttle_escapees] ([PERCENT(num_shuttle_escapees/total_players)]%)</B>")
news_report = STATION_EVACUATED
if(SSshuttle.emergency.is_hijacked())
news_report = SHUTTLE_HIJACK
to_chat(world, "<BR>[TAB]Survival Rate: <B>[num_survivors] ([PERCENT(num_survivors/total_players)]%)</B>")
to_chat(world, "<BR>[GLOB.TAB]Survival Rate: <B>[num_survivors] ([PERCENT(num_survivors/total_players)]%)</B>")
to_chat(world, "<BR>")
CHECK_TICK
//Silicon laws report
for (var/mob/living/silicon/ai/aiPlayer in mob_list)
for (var/mob/living/silicon/ai/aiPlayer in GLOB.mob_list)
if (aiPlayer.stat != 2 && aiPlayer.mind)
to_chat(world, "<b>[aiPlayer.name] (Played by: [aiPlayer.mind.key])'s laws at the end of the round were:</b>")
aiPlayer.show_laws(1)
@@ -497,7 +506,7 @@ var/datum/controller/subsystem/ticker/ticker
CHECK_TICK
for (var/mob/living/silicon/robot/robo in mob_list)
for (var/mob/living/silicon/robot/robo in GLOB.mob_list)
if (!robo.connected_ai && robo.mind)
if (robo.stat != 2)
to_chat(world, "<b>[robo.name] (Played by: [robo.mind.key]) survived as an AI-less borg! Its laws were:</b>")
@@ -548,9 +557,9 @@ var/datum/controller/subsystem/ticker/ticker
//Borers
var/borerwin = FALSE
if(borers.len)
if(GLOB.borers.len)
var/borertext = "<br><font size=3><b>The borers were:</b></font>"
for(var/mob/living/simple_animal/borer/B in borers)
for(var/mob/living/simple_animal/borer/B in GLOB.borers)
if((B.key || B.controlling) && B.stat != DEAD)
borertext += "<br>[B.controlling ? B.victim.key : B.key] was [B.truename] ("
var/turf/location = get_turf(B)
@@ -562,20 +571,20 @@ var/datum/controller/subsystem/ticker/ticker
to_chat(world, borertext)
var/total_borers = 0
for(var/mob/living/simple_animal/borer/B in borers)
for(var/mob/living/simple_animal/borer/B in GLOB.borers)
if((B.key || B.victim) && B.stat != DEAD)
total_borers++
if(total_borers)
var/total_borer_hosts = 0
for(var/mob/living/carbon/C in mob_list)
for(var/mob/living/carbon/C in GLOB.mob_list)
var/mob/living/simple_animal/borer/D = C.has_brain_worms()
var/turf/location = get_turf(C)
if(location.z == ZLEVEL_CENTCOM && D && D.stat != DEAD)
total_borer_hosts++
if(total_borer_hosts_needed <= total_borer_hosts)
if(GLOB.total_borer_hosts_needed <= total_borer_hosts)
borerwin = TRUE
to_chat(world, "<b>There were [total_borers] borers alive at round end!</b>")
to_chat(world, "<b>A total of [total_borer_hosts] borers with hosts escaped on the shuttle alive. The borers needed [total_borer_hosts_needed] hosts to escape.</b>")
to_chat(world, "<b>A total of [total_borer_hosts] borers with hosts escaped on the shuttle alive. The borers needed [GLOB.total_borer_hosts_needed] hosts to escape.</b>")
if(borerwin)
to_chat(world, "<b><font color='green'>The borers were successful!</font></b>")
else
@@ -668,43 +677,50 @@ var/datum/controller/subsystem/ticker/ticker
SSvote.initiate_vote("roundtype","server")
/world/proc/has_round_started()
if (ticker && ticker.current_state >= GAME_STATE_PLAYING)
if (SSticker && SSticker.current_state >= GAME_STATE_PLAYING)
return TRUE
return FALSE
/datum/controller/subsystem/ticker/Recover()
current_state = ticker.current_state
force_ending = ticker.force_ending
hide_mode = ticker.hide_mode
mode = ticker.mode
event_time = ticker.event_time
event = ticker.event
current_state = SSticker.current_state
force_ending = SSticker.force_ending
hide_mode = SSticker.hide_mode
mode = SSticker.mode
event_time = SSticker.event_time
event = SSticker.event
login_music = ticker.login_music
round_end_sound = ticker.round_end_sound
login_music = SSticker.login_music
round_end_sound = SSticker.round_end_sound
minds = ticker.minds
minds = SSticker.minds
syndicate_coalition = ticker.syndicate_coalition
factions = ticker.factions
availablefactions = ticker.availablefactions
syndicate_coalition = SSticker.syndicate_coalition
factions = SSticker.factions
availablefactions = SSticker.availablefactions
delay_end = ticker.delay_end
delay_end = SSticker.delay_end
triai = ticker.triai
tipped = ticker.tipped
selected_tip = ticker.selected_tip
triai = SSticker.triai
tipped = SSticker.tipped
selected_tip = SSticker.selected_tip
timeLeft = ticker.timeLeft
timeLeft = SSticker.timeLeft
totalPlayers = ticker.totalPlayers
totalPlayersReady = ticker.totalPlayersReady
totalPlayers = SSticker.totalPlayers
totalPlayersReady = SSticker.totalPlayersReady
queue_delay = ticker.queue_delay
queued_players = ticker.queued_players
cinematic = ticker.cinematic
maprotatechecked = ticker.maprotatechecked
modevoted = ticker.modevoted
queue_delay = SSticker.queue_delay
queued_players = SSticker.queued_players
cinematic = SSticker.cinematic
maprotatechecked = SSticker.maprotatechecked
round_start_time = SSticker.round_start_time
queue_delay = SSticker.queue_delay
queued_players = SSticker.queued_players
cinematic = SSticker.cinematic
maprotatechecked = SSticker.maprotatechecked
modevoted = SSticker.modevoted
/datum/controller/subsystem/ticker/proc/send_news_report()
var/news_message
@@ -759,7 +775,7 @@ var/datum/controller/subsystem/ticker/ticker
send2otherserver(news_source, news_message,"News_Report")
/datum/controller/subsystem/ticker/proc/GetTimeLeft()
if(isnull(ticker.timeLeft))
if(isnull(SSticker.timeLeft))
return max(0, start_at - world.time)
return timeLeft