From a4bb84fc6d3f9745c0674ce3988e4fc094d8310f Mon Sep 17 00:00:00 2001 From: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Date: Wed, 16 Dec 2020 19:05:10 +0000 Subject: [PATCH] SSticker minor refactor (#15089) * SSticker minor refactor * Even the experienced make mistakes * tiny lil bandaid * Oops * Update code/controllers/subsystem/ticker.dm * Adds this --- .github/CODEOWNERS | 1 + _maps/map_files/cyberiad/z2.dmm | 356 ++++++++----------------- code/controllers/subsystem/mapping.dm | 12 + code/controllers/subsystem/ticker.dm | 317 +++++++++++----------- code/game/area/dynamic_areas.dm | 44 --- code/game/world.dm | 6 +- code/modules/economy/Economy.dm | 100 ------- code/modules/economy/Economy_Events.dm | 50 +++- code/modules/spacepods/spacepod.dm | 10 - paradise.dme | 2 - 10 files changed, 335 insertions(+), 563 deletions(-) delete mode 100644 code/game/area/dynamic_areas.dm delete mode 100644 code/modules/economy/Economy.dm diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 34ca716cfb1..3a19bc34edf 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -6,6 +6,7 @@ ### AffectedArc07 # Actual Code /code/controllers/subsystem/mapping.dm @AffectedArc07 +/code/controllers/subsystem/ticker.dm @AffectedArc07 /tgui/ @AffectedArc07 # CI + Tooling diff --git a/_maps/map_files/cyberiad/z2.dmm b/_maps/map_files/cyberiad/z2.dmm index 67b16b42f04..df9c4bfa81c 100644 --- a/_maps/map_files/cyberiad/z2.dmm +++ b/_maps/map_files/cyberiad/z2.dmm @@ -2685,13 +2685,6 @@ }, /turf/simulated/floor/plating/airless, /area/syndicate_mothership) -"hH" = ( -/obj/machinery/vending/sovietsoda, -/obj/machinery/light/small{ - dir = 1 - }, -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_russian) "hI" = ( /turf/unsimulated/floor/snow, /turf/unsimulated/floor/snow{ @@ -2700,11 +2693,6 @@ dir = 1 }, /area/syndicate_mothership) -"hJ" = ( -/obj/structure/table/wood, -/obj/item/gun/projectile/revolver/russian, -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_russian) "hK" = ( /turf/unsimulated/floor/snow, /turf/unsimulated/floor/snow{ @@ -2713,13 +2701,6 @@ dir = 5 }, /area/syndicate_mothership) -"hL" = ( -/obj/machinery/vending/cigarette, -/obj/machinery/light/small{ - dir = 1 - }, -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_russian) "hM" = ( /turf/unsimulated/wall/fakeglass{ dir = 8; @@ -2750,39 +2731,6 @@ dir = 2 }, /area/syndicate_mothership) -"hR" = ( -/obj/structure/reagent_dispensers/beerkeg, -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_bar) -"hS" = ( -/obj/structure/table/wood, -/obj/machinery/chem_dispenser/beer, -/obj/machinery/light/small{ - dir = 1 - }, -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_bar) -"hT" = ( -/obj/structure/table/wood, -/obj/machinery/chem_dispenser/soda, -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_bar) -"hU" = ( -/obj/structure/table/wood, -/obj/item/storage/box/drinkingglasses, -/obj/machinery/light/small{ - dir = 1 - }, -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_bar) -"hV" = ( -/obj/structure/table/wood, -/obj/item/reagent_containers/food/drinks/shaker, -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_bar) -"hW" = ( -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_russian) "hX" = ( /obj/item/storage/fancy/crayons, /obj/machinery/light{ @@ -2796,27 +2744,6 @@ dir = 2 }, /area/syndicate_mothership) -"hY" = ( -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_disco) -"hZ" = ( -/turf/simulated/floor/light, -/area/dynamic/source/lobby_disco) -"ia" = ( -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_bar) -"ib" = ( -/obj/structure/table/wood, -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_russian) -"ic" = ( -/obj/machinery/light/small, -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_russian) -"id" = ( -/obj/machinery/light/small, -/turf/simulated/floor/light, -/area/dynamic/source/lobby_disco) "ie" = ( /obj/machinery/washing_machine, /turf/unsimulated/floor{ @@ -2824,17 +2751,6 @@ dir = 2 }, /area/syndicate_mothership) -"if" = ( -/obj/structure/table/wood, -/obj/machinery/light/small, -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_bar) -"ig" = ( -/obj/structure/table/wood, -/obj/item/book/manual/barman_recipes, -/obj/machinery/light/small, -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_bar) "ih" = ( /turf/unsimulated/wall, /area/wizard_station) @@ -12216,50 +12132,6 @@ icon_state = "blue" }, /area/holodeck/source_knightarena) -"Kc" = ( -/obj/structure/chair/comfy/brown{ - dir = 4 - }, -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_russian) -"Kd" = ( -/obj/structure/chair/comfy/brown{ - dir = 8 - }, -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_russian) -"Ke" = ( -/obj/structure/chair/sofa/right, -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_disco) -"Kf" = ( -/obj/machinery/light/small{ - dir = 1 - }, -/obj/structure/chair/sofa/left, -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_disco) -"Kg" = ( -/obj/machinery/light/small{ - dir = 1 - }, -/obj/structure/chair/sofa/right, -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_disco) -"Kh" = ( -/obj/structure/chair/sofa/left, -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_disco) -"Ki" = ( -/obj/structure/chair/comfy/brown{ - dir = 1 - }, -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_russian) -"Kk" = ( -/obj/structure/chair/stool, -/turf/simulated/floor/wood, -/area/dynamic/source/lobby_bar) "Kq" = ( /obj/structure/chair/comfy/red, /obj/effect/landmark{ @@ -73746,12 +73618,12 @@ an an eW aN -bZ -ak -ak -ak -ak -bZ +aN +aN +aN +aN +aN +aN aN aN bZ @@ -74003,12 +73875,12 @@ Zv Yp cc aN -af -hH -hW -hW -ib -cc +aN +aN +aN +aN +aN +aN aN aN bZ @@ -74260,12 +74132,12 @@ Zv Yp cc aN -af -Kc -hW -hW -ic -cc +aN +aN +aN +aN +aN +aN aN aN bZ @@ -74517,12 +74389,12 @@ Zv Yp cc aN -af -hJ -Ki -hW -hW -cc +aN +aN +aN +aN +aN +aN aN aN bZ @@ -74774,12 +74646,12 @@ Zv Yp cc aN -af -Kd -hW -hW -ic -cc +aN +aN +aN +aN +aN +aN aN aN bZ @@ -75031,12 +74903,12 @@ Zv Yp cc aN -af -hL -hW -hW -ib -cc +aN +aN +aN +aN +aN +aN aN aN bZ @@ -75288,12 +75160,12 @@ an an eW aN -bZ -an -an -an -an -bZ +aN +aN +aN +aN +aN +aN aN aN bZ @@ -75545,12 +75417,12 @@ TX FF cc aN -af -Ke -hY -hY -hY -cc +aN +aN +aN +aN +aN +aN aN bZ bZ @@ -75802,12 +75674,12 @@ eN IK cc aN -af -Kf -hZ -hZ -id -cc +aN +aN +aN +aN +aN +aN aN bZ dF @@ -76059,12 +75931,12 @@ eN IK cc aN -af -hY -hZ -hZ -hZ -cc +aN +aN +aN +aN +aN +aN aN bZ dF @@ -76316,12 +76188,12 @@ eN IK cc aN -af -Kg -hZ -hZ -id -cc +aN +aN +aN +aN +aN +aN aN bZ dF @@ -76573,12 +76445,12 @@ fT Uy cc aN -af -Kh -hY -hY -hY -cc +aN +aN +aN +aN +aN +aN aN bZ dF @@ -76830,12 +76702,12 @@ an an eW aN -bZ -an -an -an -an -bZ +aN +aN +aN +aN +aN +aN aN bZ dF @@ -77087,12 +76959,12 @@ CR zi cc aN -af -hR -ia -ia -Kk -cc +aN +aN +aN +aN +aN +aN aN bZ bZ @@ -77344,12 +77216,12 @@ eQ eH cc aN -af -hS -ia -ia -if -cc +aN +aN +aN +aN +aN +aN aN aN aN @@ -77601,12 +77473,12 @@ eQ eH cc aN -af -hT -ia -ia -ia -cc +aN +aN +aN +aN +aN +aN aN aN aN @@ -77858,12 +77730,12 @@ eQ eH cc aN -af -hU -ia -ia -ig -cc +aN +aN +aN +aN +aN +aN aN aN aN @@ -78115,12 +77987,12 @@ dO eM cc aN -af -hV -ia -ia -Kk -cc +aN +aN +aN +aN +aN +aN aN aN aN @@ -78372,12 +78244,12 @@ aE aE eX aN -bZ -aE -aE -aE -aE -bZ +aN +aN +aN +aN +aN +aN aN aN aN diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm index 163b2635d0e..533e3c6c024 100644 --- a/code/controllers/subsystem/mapping.dm +++ b/code/controllers/subsystem/mapping.dm @@ -63,6 +63,18 @@ SUBSYSTEM_DEF(mapping) GLOB.ghostteleportlocs = sortAssoc(GLOB.ghostteleportlocs) + // Map name. Break these down into SSmapping controller vars instaed of GLOBs at some point + if(GLOB.using_map && GLOB.using_map.name) + GLOB.map_name = "[GLOB.using_map.name]" + else + GLOB.map_name = "Unknown" + + // World name + if(config && config.server_name) + world.name = "[config.server_name]: [station_name()]" + else + world.name = station_name() + return ..() diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 2df69094701..473b4a3625f 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -7,32 +7,54 @@ SUBSYSTEM_DEF(ticker) runlevels = RUNLEVEL_LOBBY | RUNLEVEL_SETUP | RUNLEVEL_GAME offline_implications = "The game is no longer aware of when the round ends. Immediate server restart recommended." + /// Time the world started, relative to world.time var/round_start_time = 0 + /// Default timeout for if world.Reboot() doesnt have a time specified var/const/restart_timeout = 600 + /// Current status of the game. See code\__DEFINES\game.dm var/current_state = GAME_STATE_STARTUP - var/force_start = 0 // Do we want to force-start as soon as we can - var/force_ending = 0 - var/hide_mode = 0 // leave here at 0 ! setup() will take care of it when needed for Secret mode -walter0o + /// Do we want to force-start as soon as we can + var/force_start = FALSE + /// Do we want to force-end as soon as we can + var/force_ending = FALSE + /// Leave here at FALSE ! setup() will take care of it when needed for Secret mode -walter0o + var/hide_mode = FALSE + /// Our current game mode var/datum/game_mode/mode = null - var/event_time = null - var/event = 0 - var/login_music // music played in pregame lobby - var/list/datum/mind/minds = list()//The people in the game. Used for objective tracking. - var/Bible_icon_state // icon_state the chaplain has chosen for his bible - var/Bible_item_state // item_state the chaplain has chosen for his bible - var/Bible_name // name of the bible + /// The current pick of lobby music played in the lobby + var/login_music + /// List of all minds in the game. Used for objective tracking + var/list/datum/mind/minds = list() + /// icon_state the chaplain has chosen for his bible + var/Bible_icon_state + /// item_state the chaplain has chosen for his bible + var/Bible_item_state + /// Name of the bible + var/Bible_name + /// Name of the bible deity var/Bible_deity_name - var/datum/cult_info/cultdat = null //here instead of cult for adminbus purposes - var/random_players = 0 // if set to nonzero, ALL players who latejoin or declare-ready join will have random appearances/genders - var/tipped = FALSE //Did we broadcast the tip of the day yet? - var/selected_tip // What will be the tip of the day? - var/pregame_timeleft // This is used for calculations - var/delay_end = 0 //if set to nonzero, the round will not restart on it's own - var/triai = 0//Global holder for Triumvirate - var/next_autotransfer = 0 //holder for inital autotransfer vote timer - var/obj/screen/cinematic = null //used for station explosion cinematic - var/round_end_announced = 0 // Spam Prevention. Announce round end only once. - var/ticker_going = TRUE // This used to be in the unused globals, but it turns out its actually used in a load of places. Its now a ticker var because its related to round stuff, -aa + /// Cult data. Here instead of cult for adminbus purposes + var/datum/cult_info/cultdat = null + /// If set to nonzero, ALL players who latejoin or declare-ready join will have random appearances/genders + var/random_players = FALSE + /// Did we broadcast the tip of the round yet? + var/tipped = FALSE + /// What will be the tip of the round? + var/selected_tip + /// This is used for calculations for the statpanel + var/pregame_timeleft + /// If set to TRUE, the round will not restart on it's own + var/delay_end = FALSE + /// Global holder for triple AI mode + var/triai = FALSE + /// Holder for inital autotransfer vote timer + var/next_autotransfer = 0 + /// Used for station explosion cinematic + var/obj/screen/cinematic = null + /// Spam Prevention. Announce round end only once. + var/round_end_announced = FALSE + /// Is the ticker currently processing? If FALSE, roundstart is delayed + var/ticker_going = TRUE /datum/controller/subsystem/ticker/Initialize() login_music = pick(\ @@ -41,17 +63,6 @@ SUBSYSTEM_DEF(ticker) 'sound/music/title1.ogg',\ 'sound/music/title2.ogg',\ 'sound/music/title3.ogg',) - // Map name - if(GLOB.using_map && GLOB.using_map.name) - GLOB.map_name = "[GLOB.using_map.name]" - else - GLOB.map_name = "Unknown" - - // World name - if(config && config.server_name) - world.name = "[config.server_name]: [station_name()]" - else - world.name = station_name() return ..() @@ -73,9 +84,9 @@ SUBSYSTEM_DEF(ticker) // This is so we dont have sleeps in controllers, because that is a bad, bad thing if(!delay_end) - pregame_timeleft = max(0,round_start_time - world.time) // Normal lobby countdown when roundstart was not delayed + pregame_timeleft = max(0, round_start_time - world.time) // Normal lobby countdown when roundstart was not delayed else - pregame_timeleft = max(0,pregame_timeleft - 20) // If roundstart was delayed, we should resume the countdown where it left off + pregame_timeleft = max(0, pregame_timeleft - 20) // If roundstart was delayed, we should resume the countdown where it left off if(pregame_timeleft <= 600 && !tipped) // 60 seconds send_tip_of_the_round() @@ -89,7 +100,7 @@ SUBSYSTEM_DEF(ticker) current_state = GAME_STATE_STARTUP Master.SetRunLevel(RUNLEVEL_LOBBY) if(GAME_STATE_PLAYING) - delay_end = 0 // reset this in case round start was delayed + delay_end = FALSE // reset this in case round start was delayed mode.process() mode.process_job_tasks() @@ -107,10 +118,9 @@ SUBSYSTEM_DEF(ticker) if(GAME_STATE_FINISHED) current_state = GAME_STATE_FINISHED Master.SetRunLevel(RUNLEVEL_POSTGAME) // This shouldnt process more than once, but you never know - auto_toggle_ooc(1) // Turn it on + auto_toggle_ooc(TRUE) // Turn it on - spawn(0) - declare_completion() + declare_completion() spawn(50) if(mode.station_was_nuked) @@ -120,43 +130,47 @@ SUBSYSTEM_DEF(ticker) /datum/controller/subsystem/ticker/proc/setup() cultdat = setupcult() - //Create and announce mode - if(GLOB.master_mode=="secret") - src.hide_mode = 1 + + // Create and announce mode + if(GLOB.master_mode == "secret") + hide_mode = TRUE + var/list/datum/game_mode/runnable_modes - if((GLOB.master_mode=="random") || (GLOB.master_mode=="secret")) + + if(GLOB.master_mode == "random" || GLOB.master_mode == "secret") runnable_modes = config.get_runnable_modes() - if(runnable_modes.len==0) + if(!length(runnable_modes)) to_chat(world, "Unable to choose playable game mode. Reverting to pre-game lobby.") force_start = FALSE current_state = GAME_STATE_PREGAME Master.SetRunLevel(RUNLEVEL_LOBBY) - return 0 + return FALSE if(GLOB.secret_force_mode != "secret") var/datum/game_mode/M = config.pick_mode(GLOB.secret_force_mode) if(M.can_start()) - src.mode = config.pick_mode(GLOB.secret_force_mode) + mode = config.pick_mode(GLOB.secret_force_mode) SSjobs.ResetOccupations() - if(!src.mode) - src.mode = pickweight(runnable_modes) - if(src.mode) - var/mtype = src.mode.type - src.mode = new mtype + if(!mode) + mode = pickweight(runnable_modes) + if(mode) + var/mtype = mode.type + mode = new mtype else - src.mode = config.pick_mode(GLOB.master_mode) - if(!src.mode.can_start()) + mode = config.pick_mode(GLOB.master_mode) + + if(!mode.can_start()) to_chat(world, "Unable to start [mode.name]. Not enough players, [mode.required_players] players needed. Reverting to pre-game lobby.") mode = null current_state = GAME_STATE_PREGAME force_start = FALSE SSjobs.ResetOccupations() Master.SetRunLevel(RUNLEVEL_LOBBY) - return 0 + return FALSE //Configure mode and assign player to special mode stuff - src.mode.pre_pre_setup() + mode.pre_pre_setup() var/can_continue - can_continue = src.mode.pre_setup()//Setup special modes + can_continue = mode.pre_setup() //Setup special modes SSjobs.DivideOccupations() //Distribute jobs if(!can_continue) qdel(mode) @@ -165,27 +179,45 @@ SUBSYSTEM_DEF(ticker) force_start = FALSE SSjobs.ResetOccupations() Master.SetRunLevel(RUNLEVEL_LOBBY) - return 0 + return FALSE if(hide_mode) var/list/modes = new for(var/datum/game_mode/M in runnable_modes) - modes+=M.name + modes += M.name modes = sortList(modes) to_chat(world, "The current game mode is - Secret!") to_chat(world, "Possibilities: [english_list(modes)]") else - src.mode.announce() + mode.announce() - create_characters() //Create player characters and transfer them - populate_spawn_points() - collect_minds() - equip_characters() - GLOB.data_core.manifest() + // Behold, a rough way of figuring out what takes 10 years + var/watch = start_watch() + create_characters() // Create player characters and transfer clients + log_debug("Creating characters took [stop_watch(watch)]s") + + watch = start_watch() + populate_spawn_points() // Put mobs in their spawn locations + log_debug("Populating spawn points took [stop_watch(watch)]s") + + // Gather everyones minds + for(var/mob/living/player in GLOB.player_list) + if(player.mind) + minds += player.mind + + watch = start_watch() + equip_characters() // Apply outfits and loadouts to the characters + log_debug("Equipping characters took [stop_watch(watch)]s") + + watch = start_watch() + GLOB.data_core.manifest() // Create the manifest + log_debug("Manifest creation took [stop_watch(watch)]s") + + // Update the MC and state to game playing current_state = GAME_STATE_PLAYING Master.SetRunLevel(RUNLEVEL_GAME) - // Generate the list of playable AI cores in the world + // Generate the list of empty playable AI cores in the world for(var/obj/effect/landmark/start/S in GLOB.landmarks_list) if(S.name != "AI") continue @@ -194,93 +226,34 @@ SUBSYSTEM_DEF(ticker) GLOB.empty_playable_ai_cores += new /obj/structure/AIcore/deactivated(get_turf(S)) - //here to initialize the random events nicely at round start - setup_economy() + // Setup pregenerated newsfeeds + setup_news_feeds() - //shuttle_controller.setup_shuttle_docks() + // Generate code phrases and responses + if(!GLOB.syndicate_code_phrase) + GLOB.syndicate_code_phrase = generate_code_phrase() + if(!GLOB.syndicate_code_response) + GLOB.syndicate_code_response = generate_code_phrase() - spawn(0)//Forking here so we dont have to wait for this to finish - if(!GLOB.syndicate_code_phrase) - GLOB.syndicate_code_phrase = generate_code_phrase() - if(!GLOB.syndicate_code_response) - GLOB.syndicate_code_response = generate_code_phrase() - mode.post_setup() - //Cleanup some stuff - 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) + // Run post setup stuff + mode.post_setup() - // take care of random spesspod spawning - var/list/obj/effect/landmark/spacepod/random/L = list() - for(var/obj/effect/landmark/spacepod/random/SS in GLOB.landmarks_list) - if(istype(SS)) - L += SS - if(L.len) - var/obj/effect/landmark/spacepod/random/S = pick(L) - new /obj/spacepod/random(S.loc) - for(var/obj/effect/landmark/spacepod/random/R in L) - qdel(R) + // Delete starting landmarks (not AI ones because we need those for AI-ize) + for(var/obj/effect/landmark/start/S in GLOB.landmarks_list) + if(S.name != "AI") + qdel(S) - to_chat(world, "Enjoy the game!") - world << sound('sound/AI/welcome.ogg')// Skie - - if(SSholiday.holidays) - to_chat(world, "and...") - for(var/holidayname in SSholiday.holidays) - var/datum/holiday/holiday = SSholiday.holidays[holidayname] - to_chat(world, "

[holiday.greet()]

") - - spawn(0) // Forking dynamic room selection - var/list/area/dynamic/source/available_source_candidates = subtypesof(/area/dynamic/source) - var/list/area/dynamic/destination/available_destination_candidates = subtypesof(/area/dynamic/destination) - - for(var/area/dynamic/destination/current_destination_candidate in available_destination_candidates) - var/area/dynamic/destination/current_destination = locate(current_destination_candidate) - - if(!current_destination) - continue - - if(current_destination.match_width == 0 || current_destination.match_height == 0) - message_admins("Dynamic area destination '[current_destination.name]' does not have its size requirements set.") - continue - - var/list/area/dynamic/source/candidate_source_areas = new /list(0) - for(var/area/dynamic/source/candidate_source_area in available_source_candidates) - var/area/dynamic/source/candidate_source = locate(candidate_source_area) - - if(!candidate_source) - continue - - if(candidate_source.match_tag != current_destination.match_tag) - continue - - if(candidate_source.match_width != current_destination.match_width || \ - candidate_source.match_height != current_destination.match_height) - continue - - candidate_source_areas += candidate_source - - if(candidate_source_areas.len == 0) - message_admins("Failed to find a matching source for dynamic area: [current_destination.name]") - continue - - var/area/dynamic/source/selected_source = pick(candidate_source_areas) - available_source_candidates -= selected_source - - selected_source.copy_contents_to(current_destination, 0) - - if(current_destination.enable_lights || selected_source.enable_lights) - current_destination.power_light = 1 - else - current_destination.power_light = 0 - current_destination.power_change() - - //start_events() //handles random events and space dust. - //new random event system is handled from the MC. + to_chat(world, "Enjoy the game!") + world << sound('sound/AI/welcome.ogg') + if(SSholiday.holidays) + to_chat(world, "and...") + for(var/holidayname in SSholiday.holidays) + var/datum/holiday/holiday = SSholiday.holidays[holidayname] + to_chat(world, "

[holiday.greet()]

") + SSdiscord.send2discord_simple_noadmins("**\[Info]** Round has started") - auto_toggle_ooc(0) // Turn it off + auto_toggle_ooc(FALSE) // Turn it off round_start_time = world.time // Sets the auto shuttle vote to happen after the config duration @@ -310,7 +283,7 @@ SUBSYSTEM_DEF(ticker) if(cinematic) return //already a cinematic in progress! - auto_toggle_ooc(1) // Turn it on + auto_toggle_ooc(TRUE) // Turn it on //initialise our cinematic screen object cinematic = new /obj/screen(src) cinematic.icon = 'icons/effects/station_explosion.dmi' @@ -410,22 +383,15 @@ SUBSYSTEM_DEF(ticker) player.create_character() qdel(player) - -/datum/controller/subsystem/ticker/proc/collect_minds() - for(var/mob/living/player in GLOB.player_list) - if(player.mind) - SSticker.minds += player.mind - - /datum/controller/subsystem/ticker/proc/equip_characters() - var/captainless=1 + var/captainless = TRUE for(var/mob/living/carbon/human/player in GLOB.player_list) if(player && player.mind && player.mind.assigned_role) if(player.mind.assigned_role == "Captain") - captainless=0 + captainless = FALSE if(player.mind.assigned_role != player.mind.special_role) - SSjobs.AssignRank(player, player.mind.assigned_role, 0) - SSjobs.EquipRank(player, player.mind.assigned_role, 0) + SSjobs.AssignRank(player, player.mind.assigned_role, FALSE) + SSjobs.EquipRank(player, player.mind.assigned_role, FALSE) EquipCustomItems(player) if(captainless) for(var/mob/M in GLOB.player_list) @@ -448,7 +414,7 @@ SUBSYSTEM_DEF(ticker) to_chat(world, "Tip of the round: [html_encode(m)]") /datum/controller/subsystem/ticker/proc/declare_completion() - GLOB.nologevent = 1 //end of round murder and shenanigans are legal; there's no need to jam up attack logs past this point. + GLOB.nologevent = TRUE //end of round murder and shenanigans are legal; there's no need to jam up attack logs past this point. //Round statistics report var/datum/station_state/end_state = new /datum/station_state() end_state.count() @@ -464,7 +430,7 @@ SUBSYSTEM_DEF(ticker) to_chat(world, "[aiPlayer.name] (Played by: [aiPlayer.key])'s laws at the end of the game were:") else to_chat(world, "[aiPlayer.name] (Played by: [aiPlayer.key])'s laws when it was deactivated were:") - aiPlayer.show_laws(1) + aiPlayer.show_laws(TRUE) if(aiPlayer.connected_robots.len) var/robolist = "The AI's loyal minions were: " @@ -528,10 +494,41 @@ SUBSYSTEM_DEF(ticker) var/mob/M = m H.add_hud_to(M) - return 1 + return TRUE /datum/controller/subsystem/ticker/proc/HasRoundStarted() return current_state >= GAME_STATE_PLAYING /datum/controller/subsystem/ticker/proc/IsRoundInProgress() return current_state == GAME_STATE_PLAYING + + +/datum/controller/subsystem/ticker/proc/setup_news_feeds() + var/datum/feed_channel/newChannel = new /datum/feed_channel + newChannel.channel_name = "Public Station Announcements" + newChannel.author = "Automated Announcement Listing" + newChannel.icon = "bullhorn" + newChannel.frozen = TRUE + newChannel.admin_locked = TRUE + GLOB.news_network.channels += newChannel + + newChannel = new /datum/feed_channel + newChannel.channel_name = "Nyx Daily" + newChannel.author = "CentComm Minister of Information" + newChannel.icon = "meteor" + newChannel.frozen = TRUE + newChannel.admin_locked = TRUE + GLOB.news_network.channels += newChannel + + newChannel = new /datum/feed_channel + newChannel.channel_name = "The Gibson Gazette" + newChannel.author = "Editor Mike Hammers" + newChannel.icon = "star" + newChannel.frozen = TRUE + newChannel.admin_locked = TRUE + GLOB.news_network.channels += newChannel + + for(var/loc_type in subtypesof(/datum/trade_destination)) + var/datum/trade_destination/D = new loc_type + GLOB.weighted_randomevent_locations[D] = D.viable_random_events.len + GLOB.weighted_mundaneevent_locations[D] = D.viable_mundane_events.len diff --git a/code/game/area/dynamic_areas.dm b/code/game/area/dynamic_areas.dm deleted file mode 100644 index 10957e11d2a..00000000000 --- a/code/game/area/dynamic_areas.dm +++ /dev/null @@ -1,44 +0,0 @@ -/area/dynamic // Do not use. - name = "dynamic area" - icon_state = "purple" - var/match_tag = "none" - var/match_width = -1 - var/match_height = -1 - var/enable_lights = 0 - -/area/dynamic/destination // Do not use. - name = "dynamic area destination" - -/area/dynamic/destination/lobby - name = "Arrivals Lobby" - match_tag = "arrivals" - match_width = 5 - match_height = 4 - enable_lights = 1 - -/area/dynamic/source // Do not use. - name = "dynamic area source" - -/area/dynamic/source/lobby_bar - name = "\improper Bar Lounge" - match_tag = "arrivals" - match_width = 5 - match_height = 4 - requires_power = FALSE - dynamic_lighting = DYNAMIC_LIGHTING_FORCED - -/area/dynamic/source/lobby_russian - name = "\improper Russian Lounge" - match_tag = "arrivals" - match_width = 5 - match_height = 4 - requires_power = FALSE - dynamic_lighting = DYNAMIC_LIGHTING_FORCED - -/area/dynamic/source/lobby_disco - name = "\improper Disco Lounge" - match_tag = "arrivals" - match_width = 5 - match_height = 4 - requires_power = FALSE - dynamic_lighting = DYNAMIC_LIGHTING_FORCED diff --git a/code/game/world.dm b/code/game/world.dm index 5100722ea23..4c3aa24899f 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -92,8 +92,8 @@ GLOBAL_LIST_EMPTY(world_topic_handlers) return wth.invoke(input) /world/Reboot(var/reason, var/feedback_c, var/feedback_r, var/time) - TgsReboot() - if(reason == 1) //special reboot, do none of the normal stuff + //special reboot, do none of the normal stuff + if(reason == 1) // Do NOT change this to if(reason). You WILL break the entirety of world rebooting if(usr) if(!check_rights(R_SERVER)) message_admins("[key_name_admin(usr)] attempted to restart the server via the Profiler, without access.") @@ -104,6 +104,7 @@ GLOBAL_LIST_EMPTY(world_topic_handlers) spawn(0) to_chat(world, "Rebooting world immediately due to host request") rustg_log_close_all() // Past this point, no logging procs can be used, at risk of data loss. + TgsReboot() if(config && config.shutdown_on_reboot) sleep(0) if(GLOB.shutdown_shell_command) @@ -142,6 +143,7 @@ GLOBAL_LIST_EMPTY(world_topic_handlers) Master.Shutdown() //run SS shutdowns GLOB.dbcon.Disconnect() // DCs cleanly from the database rustg_log_close_all() // Past this point, no logging procs can be used, at risk of data loss. + TgsReboot() #ifdef UNIT_TESTS FinishTestRun() diff --git a/code/modules/economy/Economy.dm b/code/modules/economy/Economy.dm deleted file mode 100644 index 19ad16ac9a5..00000000000 --- a/code/modules/economy/Economy.dm +++ /dev/null @@ -1,100 +0,0 @@ - -#define RIOTS 1 -#define WILD_ANIMAL_ATTACK 2 -#define INDUSTRIAL_ACCIDENT 3 -#define BIOHAZARD_OUTBREAK 4 -#define WARSHIPS_ARRIVE 5 -#define PIRATES 6 -#define CORPORATE_ATTACK 7 -#define ALIEN_RAIDERS 8 -#define AI_LIBERATION 9 -#define MOURNING 10 -#define CULT_CELL_REVEALED 11 -#define SECURITY_BREACH 12 -#define ANIMAL_RIGHTS_RAID 13 -#define FESTIVAL 14 - -#define RESEARCH_BREAKTHROUGH 15 -#define BARGAINS 16 -#define SONG_DEBUT 17 -#define MOVIE_RELEASE 18 -#define BIG_GAME_HUNTERS 19 -#define ELECTION 20 -#define GOSSIP 21 -#define TOURISM 22 -#define CELEBRITY_DEATH 23 -#define RESIGNATION 24 - -#define DEFAULT 1 - -#define ADMINISTRATIVE 2 -#define CLOTHING 3 -#define SECURITY 4 -#define SPECIAL_SECURITY 5 - -#define FOOD 6 -#define ANIMALS 7 - -#define MINERALS 8 - -#define EMERGENCY 9 -#define EGAS 10 -#define MAINTENANCE 11 -#define ELECTRICAL 12 -#define ROBOTICS 13 -#define BIOMEDICAL 14 - -#define GEAR_EVA 15 - -//---- The following corporations are friendly with Nanotrasen and loosely enable trade and travel: -//Corporation Nanotrasen - Generalised / high tech research and plasma exploitation. -//Corporation Vessel Contracting - Ship and station construction, materials research. -//Corporation Osiris Atmospherics - Atmospherics machinery construction and chemical research. -//Corporation Second Red Cross Society - 26th century Red Cross reborn as a dominating economic force in biomedical science (research and materials). -//Corporation Blue Industries - High tech and high energy research, in particular into the mysteries of bluespace manipulation and power generation. -//Corporation Kusanagi Robotics - Founded by robotics legend Kaito Kusanagi in the 2070s, they have been on the forefront of mechanical augmentation and robotics development ever since. -//Corporation Free traders - Not so much a corporation as a loose coalition of spacers, Free Traders are a roving band of smugglers, traders and fringe elements following a rigid (if informal) code of loyalty and honour. Mistrusted by most corporations, they are tolerated because of their uncanny ability to smell out a profit. - -//---- Descriptions of destination types -//Space stations can be purpose built for a number of different things, but generally require regular shipments of essential supplies. -//Corvettes are small, fast warships generally assigned to border patrol or chasing down smugglers. -//Battleships are large, heavy cruisers designed for slugging it out with other heavies or razing planets. -//Yachts are fast civilian craft, often used for pleasure or smuggling. -//Destroyers are medium sized vessels, often used for escorting larger ships but able to go toe-to-toe with them if need be. -//Frigates are medium sized vessels, often used for escorting larger ships. They will rapidly find themselves outclassed if forced to face heavy warships head on. - -GLOBAL_VAR_INIT(setup_economy, 0) -/proc/setup_economy() - if(GLOB.setup_economy) - return - - var/datum/feed_channel/newChannel = new /datum/feed_channel - newChannel.channel_name = "Public Station Announcements" - newChannel.author = "Automated Announcement Listing" - newChannel.icon = "bullhorn" - newChannel.frozen = TRUE - newChannel.admin_locked = TRUE - GLOB.news_network.channels += newChannel - - newChannel = new /datum/feed_channel - newChannel.channel_name = "Nyx Daily" - newChannel.author = "CentComm Minister of Information" - newChannel.icon = "meteor" - newChannel.frozen = TRUE - newChannel.admin_locked = TRUE - GLOB.news_network.channels += newChannel - - newChannel = new /datum/feed_channel - newChannel.channel_name = "The Gibson Gazette" - newChannel.author = "Editor Mike Hammers" - newChannel.icon = "star" - newChannel.frozen = TRUE - newChannel.admin_locked = TRUE - GLOB.news_network.channels += newChannel - - for(var/loc_type in subtypesof(/datum/trade_destination)) - var/datum/trade_destination/D = new loc_type - GLOB.weighted_randomevent_locations[D] = D.viable_random_events.len - GLOB.weighted_mundaneevent_locations[D] = D.viable_mundane_events.len - - GLOB.setup_economy = 1 diff --git a/code/modules/economy/Economy_Events.dm b/code/modules/economy/Economy_Events.dm index 463ccc680f7..d47788fc385 100644 --- a/code/modules/economy/Economy_Events.dm +++ b/code/modules/economy/Economy_Events.dm @@ -1,4 +1,51 @@ +#define RIOTS 1 +#define WILD_ANIMAL_ATTACK 2 +#define INDUSTRIAL_ACCIDENT 3 +#define BIOHAZARD_OUTBREAK 4 +#define WARSHIPS_ARRIVE 5 +#define PIRATES 6 +#define CORPORATE_ATTACK 7 +#define ALIEN_RAIDERS 8 +#define AI_LIBERATION 9 +#define MOURNING 10 +#define CULT_CELL_REVEALED 11 +#define SECURITY_BREACH 12 +#define ANIMAL_RIGHTS_RAID 13 +#define FESTIVAL 14 + +#define RESEARCH_BREAKTHROUGH 15 +#define BARGAINS 16 +#define SONG_DEBUT 17 +#define MOVIE_RELEASE 18 +#define BIG_GAME_HUNTERS 19 +#define ELECTION 20 +#define GOSSIP 21 +#define TOURISM 22 +#define CELEBRITY_DEATH 23 +#define RESIGNATION 24 + +#define DEFAULT 1 + +#define ADMINISTRATIVE 2 +#define CLOTHING 3 +#define SECURITY 4 +#define SPECIAL_SECURITY 5 + +#define FOOD 6 +#define ANIMALS 7 + +#define MINERALS 8 + +#define EMERGENCY 9 +#define EGAS 10 +#define MAINTENANCE 11 +#define ELECTRICAL 12 +#define ROBOTICS 13 +#define BIOMEDICAL 14 + +#define GEAR_EVA 15 + /datum/event/economic_event endWhen = 50 //this will be set randomly, later announceWhen = 15 @@ -8,9 +55,6 @@ var/datum/trade_destination/affected_dest /datum/event/economic_event/start() - if(!GLOB.setup_economy) - setup_economy() - affected_dest = pickweight(GLOB.weighted_randomevent_locations) if(affected_dest.viable_random_events.len) endWhen = rand(60,300) diff --git a/code/modules/spacepods/spacepod.dm b/code/modules/spacepods/spacepod.dm index 43a9a4a6ee7..26144761e66 100644 --- a/code/modules/spacepods/spacepod.dm +++ b/code/modules/spacepods/spacepod.dm @@ -1103,16 +1103,6 @@ battery.charge = max(0, battery.charge - 1) next_move = world.time + move_delay -/obj/effect/landmark/spacepod/random - name = "spacepod spawner" - invisibility = 101 - icon = 'icons/mob/screen_gen.dmi' - icon_state = "x" - anchored = 1 - -/obj/effect/landmark/spacepod/random/New() - ..() - #undef DAMAGE #undef FIRE #undef WINDOW diff --git a/paradise.dme b/paradise.dme index 50add2c7036..b5d003a8bf7 100644 --- a/paradise.dme +++ b/paradise.dme @@ -483,7 +483,6 @@ #include "code\game\world.dm" #include "code\game\area\ai_monitored.dm" #include "code\game\area\areas.dm" -#include "code\game\area\dynamic_areas.dm" #include "code\game\area\ss13_areas.dm" #include "code\game\area\areas\depot-areas.dm" #include "code\game\area\areas\mining.dm" @@ -1456,7 +1455,6 @@ #include "code\modules\economy\Accounts.dm" #include "code\modules\economy\Accounts_DB.dm" #include "code\modules\economy\ATM.dm" -#include "code\modules\economy\Economy.dm" #include "code\modules\economy\Economy_Events.dm" #include "code\modules\economy\Economy_Events_Mundane.dm" #include "code\modules\economy\Economy_TradeDestinations.dm"