Merge branch 'release' of https://github.com/VOREStation/VOREStation into izac-voreupdate

All conflicts resolved

Signed-off-by: izac112 <izac10@live.com>
This commit is contained in:
izac112
2020-05-06 21:53:03 +02:00
1099 changed files with 63850 additions and 118586 deletions
+3 -7
View File
@@ -2,8 +2,8 @@ SUBSYSTEM_DEF(ai)
name = "AI"
init_order = INIT_ORDER_AI
priority = FIRE_PRIORITY_AI
wait = 5 // This gets run twice a second, however this is technically two loops in one, with the second loop being run every four iterations.
flags = SS_NO_INIT|SS_TICKER
wait = 2 SECONDS
flags = SS_NO_INIT
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
var/list/processing = list()
@@ -22,15 +22,11 @@ SUBSYSTEM_DEF(ai)
var/list/currentrun = src.currentrun
while(currentrun.len)
// var/mob/living/L = currentrun[currentrun.len]
var/datum/ai_holder/A = currentrun[currentrun.len]
--currentrun.len
if(!A || QDELETED(A) || A.busy) // Doesn't exist or won't exist soon or not doing it this tick
continue
if(times_fired % 4 == 0 && A.holder.stat != DEAD)
A.handle_strategicals()
if(A.holder.stat != DEAD) // The /TG/ version checks stat twice, presumably in-case processing somehow got the mob killed in that instant.
A.handle_tactics()
A.handle_strategicals()
if(MC_TICK_CHECK)
return
+32
View File
@@ -0,0 +1,32 @@
SUBSYSTEM_DEF(aifast)
name = "AI (Fast)"
init_order = INIT_ORDER_AI_FAST
priority = FIRE_PRIORITY_AI
wait = 0.25 SECONDS // Every quarter second
flags = SS_NO_INIT
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
var/list/processing = list()
var/list/currentrun = list()
/datum/controller/subsystem/aifast/stat_entry(msg_prefix)
var/list/msg = list(msg_prefix)
msg += "P:[processing.len]"
..(msg.Join())
/datum/controller/subsystem/aifast/fire(resumed = 0)
if (!resumed)
src.currentrun = processing.Copy()
//cache for sanic speed (lists are references anyways)
var/list/currentrun = src.currentrun
while(currentrun.len)
var/datum/ai_holder/A = currentrun[currentrun.len]
--currentrun.len
if(!A || QDELETED(A) || A.busy) // Doesn't exist or won't exist soon or not doing it this tick
continue
A.handle_tactics()
if(MC_TICK_CHECK)
return
+5 -3
View File
@@ -6,9 +6,11 @@ SUBSYSTEM_DEF(assets)
var/list/preload = list()
/datum/controller/subsystem/assets/Initialize(timeofday)
for(var/type in typesof(/datum/asset) - list(/datum/asset, /datum/asset/simple))
var/datum/asset/A = new type()
A.register()
for(var/type in typesof(/datum/asset))
var/datum/asset/A = type
if (type != initial(A._abstract))
get_asset_datum(type)
preload = cache.Copy() //don't preload assets generated during the round
+1 -1
View File
@@ -16,7 +16,7 @@ SUBSYSTEM_DEF(inactivity)
var/client/C = client_list[client_list.len]
client_list.len--
if(C.is_afk(config.kick_inactive MINUTES) && can_kick(C))
to_chat(C, "<span class='warning'>You have been inactive for more than [config.kick_inactive] minute\s and have been disconnected.</span>")
to_chat_immediate(C, world.time, "<span class='warning'>You have been inactive for more than [config.kick_inactive] minute\s and have been disconnected.</span>")
var/information
if(C.mob)
+2 -4
View File
@@ -121,10 +121,8 @@ SUBSYSTEM_DEF(machines)
while(current_run.len)
var/obj/machinery/M = current_run[current_run.len]
current_run.len--
if(istype(M) && !QDELETED(M) && !(M.process(wait) == PROCESS_KILL))
if(M.use_power)
M.auto_use_power()
else
if(!istype(M) || QDELETED(M) || (M.process(wait) == PROCESS_KILL))
global.processing_machines.Remove(M)
if(!QDELETED(M))
DISABLE_BITFIELD(M.datum_flags, DF_ISPROCESSING)
+70
View File
@@ -0,0 +1,70 @@
SUBSYSTEM_DEF(nightshift)
name = "Night Shift"
init_order = INIT_ORDER_NIGHTSHIFT
priority = FIRE_PRIORITY_NIGHTSHIFT
wait = 60 SECONDS
flags = SS_NO_TICK_CHECK
var/nightshift_active = FALSE
var/nightshift_first_check = 30 SECONDS
var/high_security_mode = FALSE
/datum/controller/subsystem/nightshift/Initialize()
if(!config.enable_night_shifts)
can_fire = FALSE
/*
if(config.randomize_shift_time)
GLOB.gametime_offset = rand(0, 23) HOURS
*/
return ..()
/datum/controller/subsystem/nightshift/fire(resumed = FALSE)
if(round_duration_in_ticks < nightshift_first_check)
return
check_nightshift()
/datum/controller/subsystem/nightshift/proc/announce(message)
var/announce_z
if(using_map.station_levels.len)
announce_z = pick(using_map.station_levels)
//VOREStation Edit - TTS
var/pickedsound
if(!high_security_mode)
if(nightshift_active)
pickedsound = 'sound/AI/dim_lights.ogg'
else
pickedsound = 'sound/AI/bright_lights.ogg'
priority_announcement.Announce(message, new_title = "Automated Lighting System Announcement", new_sound = pickedsound, zlevel = announce_z)
//VOREStation Edit End
/datum/controller/subsystem/nightshift/proc/check_nightshift(check_canfire=FALSE) //This is called from elsewhere, like setting the alert levels
if(check_canfire && !can_fire)
return
var/emergency = security_level > SEC_LEVEL_GREEN
var/announcing = TRUE
var/night_time = using_map.get_nightshift()
if(high_security_mode != emergency)
high_security_mode = emergency
if(night_time)
announcing = FALSE
if(!emergency)
announce("Restoring night lighting configuration to normal operation.")
else
announce("Disabling night lighting: Station is in a state of emergency.")
if(emergency)
night_time = FALSE
if(nightshift_active != night_time)
update_nightshift(night_time, announcing)
/datum/controller/subsystem/nightshift/proc/update_nightshift(active, announce = TRUE)
nightshift_active = active
if(announce)
if(active)
announce("Good evening, crew. To reduce power consumption and stimulate the circadian rhythms of some species, all of the lights aboard the station have been dimmed for the night.")
else
announce("Good morning, crew. As it is now day time, all of the lights aboard the station have been restored to their former brightness.")
for(var/obj/machinery/power/apc/apc in machines)
if(apc.z in using_map.station_levels)
apc.set_nightshift(active, TRUE)
CHECK_TICK
+7 -7
View File
@@ -6,16 +6,16 @@ SUBSYSTEM_DEF(planets)
flags = SS_BACKGROUND
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
var/list/new_outdoor_turfs = list()
var/list/new_outdoor_walls = list()
var/static/list/new_outdoor_turfs = list()
var/static/list/new_outdoor_walls = list()
var/list/planets = list()
var/list/z_to_planet = list()
var/static/list/planets = list()
var/static/list/z_to_planet = list()
var/list/currentrun = list()
var/static/list/currentrun = list()
var/list/needs_sun_update = list()
var/list/needs_temp_update = list()
var/static/list/needs_sun_update = list()
var/static/list/needs_temp_update = list()
/datum/controller/subsystem/planets/Initialize(timeofday)
admin_notice("<span class='danger'>Initializing planetary weather.</span>", R_DEBUG)
+27 -27
View File
@@ -72,8 +72,8 @@ var/global/datum/controller/subsystem/ticker/ticker
post_game_tick()
/datum/controller/subsystem/ticker/proc/pregame_welcome()
to_chat(world, "<B><FONT color='blue'>Welcome to the pregame lobby!</FONT></B>")
to_chat(world, "Please set up your character and select ready. The round will start in [pregame_timeleft] seconds.")
to_world("<span class='boldannounce notice'><em>Welcome to the pregame lobby!</em></span>")
to_world("<span class='boldannounce notice'>Please set up your character and select ready. The round will start in [pregame_timeleft] seconds.</span>")
// Called during GAME_STATE_PREGAME (RUNLEVEL_LOBBY)
/datum/controller/subsystem/ticker/proc/pregame_tick()
@@ -120,7 +120,7 @@ var/global/datum/controller/subsystem/ticker/ticker
var/list/runnable_modes = config.get_runnable_modes()
if((master_mode == "random") || (master_mode == "secret"))
if(!runnable_modes.len)
to_chat(world, "<B>Unable to choose playable game mode.</B> Reverting to pregame lobby.")
to_world("<span class='danger'><B>Unable to choose playable game mode.</B> Reverting to pregame lobby.</span>")
return 0
if(secret_force_mode != "secret")
src.mode = config.pick_mode(secret_force_mode)
@@ -133,7 +133,7 @@ var/global/datum/controller/subsystem/ticker/ticker
src.mode = config.pick_mode(master_mode)
if(!src.mode)
to_chat(world, "<span class='danger'>Serious error in mode setup!</span> Reverting to pregame lobby.") //Uses setup instead of set up due to computational context.
to_world("<span class='danger'>Serious error in mode setup! Reverting to pregame lobby.</span>") //Uses setup instead of set up due to computational context.
return 0
job_master.ResetOccupations()
@@ -142,21 +142,21 @@ var/global/datum/controller/subsystem/ticker/ticker
job_master.DivideOccupations() // Apparently important for new antagonist system to register specific job antags properly.
if(!src.mode.can_start())
to_world("<B>Unable to start [mode.name].</B> Not enough players readied, [config.player_requirements[mode.config_tag]] players needed. Reverting to pregame lobby.")
to_world("<span class='danger'><B>Unable to start [mode.name].</B> Not enough players readied, [config.player_requirements[mode.config_tag]] players needed. Reverting to pregame lobby.</span>")
mode.fail_setup()
mode = null
job_master.ResetOccupations()
return 0
if(hide_mode)
to_world("<B>The current game mode is - Secret!</B>")
to_world("<span class='notice'><B>The current game mode is - Secret!</B></span>")
if(runnable_modes.len)
var/list/tmpmodes = new
for (var/datum/game_mode/M in runnable_modes)
tmpmodes+=M.name
tmpmodes = sortList(tmpmodes)
if(tmpmodes.len)
to_chat(world, "<B>Possibilities:</B> [english_list(tmpmodes, and_text= "; ", comma_text = "; ")]")
to_world("<span class='info'><B>Possibilities:</B> [english_list(tmpmodes, and_text= "; ", comma_text = "; ")]</span>")
else
src.mode.announce()
return 1
@@ -178,7 +178,7 @@ var/global/datum/controller/subsystem/ticker/ticker
//Deleting Startpoints but we need the ai point to AI-ize people later
if (S.name != "AI")
qdel(S)
to_chat(world, "<FONT color='blue'><B>Enjoy the game!</B></FONT>")
to_world("<span class='boldannounce notice'><em>Enjoy the game!</em></span>")
world << sound('sound/AI/welcome.ogg') // Skie
//Holiday Round-start stuff ~Carn
Holiday_Game_Start()
@@ -227,7 +227,7 @@ var/global/datum/controller/subsystem/ticker/ticker
end_game_state = END_GAME_MODE_FINISHED // Only do this cleanup once!
mode.cleanup()
//call a transfer shuttle vote
to_chat(world, "<span class='danger'>The round has ended!</span>")
to_world("<span class='danger'>The round has ended!</span>")
SSvote.autotransfer()
// Called during GAME_STATE_FINISHED (RUNLEVEL_POSTGAME)
@@ -240,7 +240,7 @@ var/global/datum/controller/subsystem/ticker/ticker
feedback_set_details("end_proper", "nuke")
restart_timeleft = 1 MINUTE // No point waiting five minutes if everyone's dead.
if(!delay_end)
to_chat(world, "<span class='notice'><b>Rebooting due to destruction of [station_name()] in [round(restart_timeleft/600)] minute\s.</b></span>")
to_world("<span class='notice'><b>Rebooting due to destruction of [station_name()] in [round(restart_timeleft/600)] minute\s.</b></span>")
last_restart_notify = world.time
else
feedback_set_details("end_proper", "proper completion")
@@ -254,12 +254,12 @@ var/global/datum/controller/subsystem/ticker/ticker
if(END_GAME_ENDING)
restart_timeleft -= (world.time - last_fire)
if(delay_end)
to_chat(world, "<span class='notice'><b>An admin has delayed the round end.</b></span>")
to_world("<span class='notice'><b>An admin has delayed the round end.</b></span>")
end_game_state = END_GAME_DELAYED
else if(restart_timeleft <= 0)
world.Reboot()
else if (world.time - last_restart_notify >= 1 MINUTE)
to_chat(world, "<span class='notice'><b>Restarting in [round(restart_timeleft/600, 1)] minute\s.</b></span>")
to_world("<span class='notice'><b>Restarting in [round(restart_timeleft/600, 1)] minute\s.</b></span>")
last_restart_notify = world.time
return
if(END_GAME_DELAYED)
@@ -430,47 +430,47 @@ var/global/datum/controller/subsystem/ticker/ticker
if(captainless)
for(var/mob/M in player_list)
if(!istype(M,/mob/new_player))
to_chat(M, "Colony Directorship not forced on anyone.")
to_chat(M, "<span class='notice'>Colony Directorship not forced on anyone.</span>")
/datum/controller/subsystem/ticker/proc/declare_completion()
to_world("<br><br><br><H1>A round of [mode.name] has ended!</H1>")
to_world("<span class='filter_system'><br><br><br><H1>A round of [mode.name] has ended!</H1></span>")
for(var/mob/Player in player_list)
if(Player.mind && !isnewplayer(Player))
if(Player.stat != DEAD)
var/turf/playerTurf = get_turf(Player)
if(emergency_shuttle.departed && emergency_shuttle.evac)
if(isNotAdminLevel(playerTurf.z))
to_chat(Player, "<font color='blue'><b>You survived the round, but remained on [station_name()] as [Player.real_name].</b></font>")
to_chat(Player, "<span class='filter_system'><font color='blue'><b>You survived the round, but remained on [station_name()] as [Player.real_name].</b></font></span>")
else
to_chat(Player, "<font color='green'><b>You managed to survive the events on [station_name()] as [Player.real_name].</b></font>")
to_chat(Player, "<span class='filter_system'><font color='green'><b>You managed to survive the events on [station_name()] as [Player.real_name].</b></font></span>")
else if(isAdminLevel(playerTurf.z))
to_chat(Player, "<font color='green'><b>You successfully underwent crew transfer after events on [station_name()] as [Player.real_name].</b></font>")
to_chat(Player, "<span class='filter_system'><font color='green'><b>You successfully underwent crew transfer after events on [station_name()] as [Player.real_name].</b></font></span>")
else if(issilicon(Player))
to_chat(Player, "<font color='green'><b>You remain operational after the events on [station_name()] as [Player.real_name].</b></font>")
to_chat(Player, "<span class='filter_system'><font color='green'><b>You remain operational after the events on [station_name()] as [Player.real_name].</b></font></span>")
else
to_chat(Player, "<font color='blue'><b>You missed the crew transfer after the events on [station_name()] as [Player.real_name].</b></font>")
to_chat(Player, "<span class='filter_system'><font color='blue'><b>You missed the crew transfer after the events on [station_name()] as [Player.real_name].</b></font></span>")
else
if(istype(Player,/mob/observer/dead))
var/mob/observer/dead/O = Player
if(!O.started_as_observer)
to_chat(Player, "<font color='red'><b>You did not survive the events on [station_name()]...</b></font>")
to_chat(Player, "<span class='filter_system'><font color='red'><b>You did not survive the events on [station_name()]...</b></font></span>")
else
to_chat(Player, "<font color='red'><b>You did not survive the events on [station_name()]...</b></font>")
to_chat(Player, "<span class='filter_system'><font color='red'><b>You did not survive the events on [station_name()]...</b></font></span>")
to_world("<br>")
for (var/mob/living/silicon/ai/aiPlayer in mob_list)
if (aiPlayer.stat != 2)
to_world("<b>[aiPlayer.name] (Played by: [aiPlayer.key])'s laws at the end of the round were:</b>")
to_world("<span class='filter_system'><b>[aiPlayer.name] (Played by: [aiPlayer.key])'s laws at the end of the round were:</b></span>")
else
to_world("<b>[aiPlayer.name] (Played by: [aiPlayer.key])'s laws when it was deactivated were:</b>")
to_world("<span class='filter_system'><b>[aiPlayer.name] (Played by: [aiPlayer.key])'s laws when it was deactivated were:</b></span>")
aiPlayer.show_laws(1)
if (aiPlayer.connected_robots.len)
var/robolist = "<b>The AI's loyal minions were:</b> "
for(var/mob/living/silicon/robot/robo in aiPlayer.connected_robots)
robolist += "[robo.name][robo.stat?" (Deactivated) (Played by: [robo.key]), ":" (Played by: [robo.key]), "]"
to_world("[robolist]")
to_world("<span class='filter_system'>[robolist]</span>")
var/dronecount = 0
@@ -482,15 +482,15 @@ var/global/datum/controller/subsystem/ticker/ticker
if (!robo.connected_ai)
if (robo.stat != 2)
to_world("<b>[robo.name] (Played by: [robo.key]) survived as an AI-less stationbound synthetic! Its laws were:</b>")
to_world("<span class='filter_system'><b>[robo.name] (Played by: [robo.key]) survived as an AI-less stationbound synthetic! Its laws were:</b></span>")
else
to_world("<b>[robo.name] (Played by: [robo.key]) was unable to survive the rigors of being a stationbound synthetic without an AI. Its laws were:</b>")
to_world("<span class='filter_system'><b>[robo.name] (Played by: [robo.key]) was unable to survive the rigors of being a stationbound synthetic without an AI. Its laws were:</b></span>")
if(robo) //How the hell do we lose robo between here and the world messages directly above this?
robo.laws.show_laws(world)
if(dronecount)
to_world("<b>There [dronecount>1 ? "were" : "was"] [dronecount] industrious maintenance [dronecount>1 ? "drones" : "drone"] at the end of this round.</b>")
to_world("<span class='filter_system'><b>There [dronecount>1 ? "were" : "was"] [dronecount] industrious maintenance [dronecount>1 ? "drones" : "drone"] at the end of this round.</b></span>")
mode.declare_completion()//To declare normal completion.