diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index b1773ba10d5..962e8daf286 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -44,7 +44,7 @@ // Subsystem init_order, from highest priority to lowest priority // Subsystems shutdown in the reverse of the order they initialize in // The numbers just define the ordering, they are meaningless otherwise. - +#define INIT_ORDER_TITLE 100 // This **MUST** load first or people will se blank lobyb screens #define INIT_ORDER_GARBAGE 19 #define INIT_ORDER_DBCORE 18 #define INIT_ORDER_BLACKBOX 17 diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index 0002bc0d488..8ab919f9061 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -23,6 +23,11 @@ init_subtypes(/datum/surgery_step, GLOB.surgery_steps) + // Different bodies + __init_body_accessory(/datum/body_accessory/body) + // Different tails + __init_body_accessory(/datum/body_accessory/tail) + for(var/path in (subtypesof(/datum/surgery))) GLOB.surgeries_list += new path() @@ -30,6 +35,7 @@ init_datum_subtypes(/datum/superheroes, GLOB.all_superheroes, null, "name") init_datum_subtypes(/datum/language, GLOB.all_languages, null, "name") + // Setup languages for(var/language_name in GLOB.all_languages) var/datum/language/L = GLOB.all_languages[language_name] if(!(L.flags & NONGLOBAL)) @@ -54,7 +60,61 @@ var/datum/pipes/P = D if(P.rpd_dispensable) GLOB.rpd_pipe_list += list(list("pipe_name" = P.pipe_name, "pipe_id" = P.pipe_id, "pipe_type" = P.pipe_type, "pipe_category" = P.pipe_category, "orientations" = P.orientations, "pipe_icon" = P.pipe_icon, "bendy" = P.bendy)) - return 1 + + // Setup PAI software + for(var/type in subtypesof(/datum/pai_software)) + var/datum/pai_software/P = new type() + if(GLOB.pai_software_by_key[P.id]) + var/datum/pai_software/O = GLOB.pai_software_by_key[P.id] + to_chat(world, "pAI software module [P.name] has the same key as [O.name]!") + continue + GLOB.pai_software_by_key[P.id] = P + if(P.default) + GLOB.default_pai_software[P.id] = P + + // Setup loadout gear + for(var/geartype in subtypesof(/datum/gear)) + var/datum/gear/G = geartype + + var/use_name = initial(G.display_name) + var/use_category = initial(G.sort_category) + + if(G == initial(G.subtype_path)) + continue + + if(!use_name) + error("Loadout - Missing display name: [G]") + continue + if(!initial(G.cost)) + error("Loadout - Missing cost: [G]") + continue + if(!initial(G.path)) + error("Loadout - Missing path definition: [G]") + continue + + if(!GLOB.loadout_categories[use_category]) + GLOB.loadout_categories[use_category] = new /datum/loadout_category(use_category) + var/datum/loadout_category/LC = GLOB.loadout_categories[use_category] + GLOB.gear_datums[use_name] = new geartype + LC.gear[use_name] = GLOB.gear_datums[use_name] + + GLOB.loadout_categories = sortAssoc(GLOB.loadout_categories) + for(var/loadout_category in GLOB.loadout_categories) + var/datum/loadout_category/LC = GLOB.loadout_categories[loadout_category] + LC.gear = sortAssoc(LC.gear) + + + // Setup a list of robolimbs + GLOB.basic_robolimb = new() + for(var/limb_type in typesof(/datum/robolimb)) + var/datum/robolimb/R = new limb_type() + GLOB.all_robolimbs[R.company] = R + if(!R.unavailable_at_chargen) + if(R != "head" && R != "chest" && R != "groin" ) //Part of the method that ensures only IPCs can access head, chest and groin prosthetics. + if(R.has_subtypes) //Ensures solos get added to the list as well be incorporating has_subtypes == 1 and has_subtypes == 2. + GLOB.chargen_robolimbs[R.company] = R //List only main brands and solo parts. + if(R.selectable) + GLOB.selectable_robolimbs[R.company] = R /* // Uncomment to debug chemical reaction list. /client/verb/debug_chemical_list() diff --git a/code/_globalvars/mapping.dm b/code/_globalvars/mapping.dm index ca1c899e301..5ea100f1718 100644 --- a/code/_globalvars/mapping.dm +++ b/code/_globalvars/mapping.dm @@ -54,3 +54,7 @@ GLOBAL_LIST_EMPTY(space_ruins_templates) GLOBAL_LIST_EMPTY(lava_ruins_templates) GLOBAL_LIST_EMPTY(shelter_templates) GLOBAL_LIST_EMPTY(shuttle_templates) + +// Teleport locations +GLOBAL_LIST_EMPTY(teleportlocs) +GLOBAL_LIST_EMPTY(ghostteleportlocs) diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm index 32d6370f3d0..ac7bf14a70f 100644 --- a/code/_globalvars/misc.dm +++ b/code/_globalvars/misc.dm @@ -89,7 +89,7 @@ GLOBAL_VAR_INIT(copier_items_printed_logged, FALSE) GLOBAL_VAR(map_name) // Self explanatory -GLOBAL_DATUM(data_core, /datum/datacore) // Station datacore, manifest, etc +GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) // Station datacore, manifest, etc GLOBAL_VAR_INIT(panic_bunker_enabled, FALSE) // Is the panic bunker enabled diff --git a/code/controllers/hooks-defs.dm b/code/controllers/hooks-defs.dm deleted file mode 100644 index 59510162e1c..00000000000 --- a/code/controllers/hooks-defs.dm +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Startup hook. - * Called in world.dm when the server starts. - */ -/hook/startup - -/** - * Roundstart hook. - * Called in gameticker.dm when a round starts. - */ -/hook/roundstart diff --git a/code/controllers/hooks.dm b/code/controllers/hooks.dm deleted file mode 100644 index 48f1199ef76..00000000000 --- a/code/controllers/hooks.dm +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @file hooks.dm - * Implements hooks, a simple way to run code on pre-defined events. - */ - -/** @page hooks Code hooks - * @section hooks Hooks - * A hook is defined under /hook in the type tree. - * - * To add some code to be called by the hook, define a proc under the type, as so: - * @code - /hook/foo/proc/bar() - if(1) - return 1 //Sucessful - else - return 0 //Error, or runtime. - * @endcode - * All hooks must return nonzero on success, as runtimes will force return null. - */ - -/** - * Calls a hook, executing every piece of code that's attached to it. - * @param hook Identifier of the hook to call. - * @returns 1 if all hooked code runs successfully, 0 otherwise. - */ -/proc/callHook(hook, list/args=null) - var/hook_path = text2path("/hook/[hook]") - if(!hook_path) - error("Invalid hook '/hook/[hook]' called.") - return 0 - - var/caller = new hook_path - var/status = 1 - for(var/P in typesof("[hook_path]/proc")) - if(!call(caller, P)(arglist(args))) - error("Hook '[P]' failed or runtimed.") - status = 0 - - return status diff --git a/code/controllers/subsystem/icon_smooth.dm b/code/controllers/subsystem/icon_smooth.dm index 289505a153c..8d6a7e39852 100644 --- a/code/controllers/subsystem/icon_smooth.dm +++ b/code/controllers/subsystem/icon_smooth.dm @@ -19,8 +19,18 @@ SUBSYSTEM_DEF(icon_smooth) can_fire = 0 /datum/controller/subsystem/icon_smooth/Initialize() - smooth_zlevel(1,TRUE) - smooth_zlevel(2,TRUE) + log_startup_progress("Smoothing atoms...") + // Smooth EVERYTHING in the world + for(var/turf/T in world) + if(T.smooth) + smooth_icon(T) + for(var/A in T) + var/atom/AA = A + if(AA.smooth) + smooth_icon(AA) + CHECK_TICK + + // Incase any new atoms were added to the smoothing queue for whatever reason var/queue = smooth_queue smooth_queue = list() for(var/V in queue) diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm index 67e2b5c5e88..2e7d65aa085 100644 --- a/code/controllers/subsystem/mapping.dm +++ b/code/controllers/subsystem/mapping.dm @@ -30,6 +30,27 @@ SUBSYSTEM_DEF(mapping) seedRuins(list(level_name_to_num(MINING)), config.lavaland_budget, /area/lavaland/surface/outdoors/unexplored, GLOB.lava_ruins_templates) spawn_rivers(list(level_name_to_num(MINING))) + // Now we make a list of areas for teleport locs + // TOOD: Make these locs into lists on the SS itself, not globs + for(var/area/AR in world) + if(AR.no_teleportlocs) continue + if(GLOB.teleportlocs.Find(AR.name)) continue + var/turf/picked = safepick(get_area_turfs(AR.type)) + if(picked && is_station_level(picked.z)) + GLOB.teleportlocs += AR.name + GLOB.teleportlocs[AR.name] = AR + + GLOB.teleportlocs = sortAssoc(GLOB.teleportlocs) + + for(var/area/AR in world) + if(GLOB.ghostteleportlocs.Find(AR.name)) continue + var/list/turfs = get_area_turfs(AR.type) + if(turfs.len) + GLOB.ghostteleportlocs += AR.name + GLOB.ghostteleportlocs[AR.name] = AR + + GLOB.ghostteleportlocs = sortAssoc(GLOB.ghostteleportlocs) + return ..() diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index c05d96bb441..7fa61252fef 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -188,7 +188,14 @@ SUBSYSTEM_DEF(ticker) current_state = GAME_STATE_PLAYING Master.SetRunLevel(RUNLEVEL_GAME) - callHook("roundstart") + // Generate the list of playable AI cores in the world + for(var/obj/effect/landmark/start/S in GLOB.landmarks_list) + if(S.name != "AI") + continue + if(locate(/mob/living) in S.loc) + continue + 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() @@ -291,7 +298,16 @@ SUBSYSTEM_DEF(ticker) if(N.client) N.new_player_panel_proc() - return 1 + // Now that every other piece of the round has initialized, lets setup player job scaling + var/playercount = length(GLOB.clients) + var/highpop_trigger = 80 + + if(playercount >= highpop_trigger) + log_debug("Playercount: [playercount] versus trigger: [highpop_trigger] - loading highpop job config"); + SSjobs.LoadJobs("config/jobs_highpop.txt") + else + log_debug("Playercount: [playercount] versus trigger: [highpop_trigger] - keeping standard job config"); + return TRUE /datum/controller/subsystem/ticker/proc/station_explosion_cinematic(station_missed = 0, override = null) if(cinematic) diff --git a/code/modules/fancytitle/fancytitle.dm b/code/controllers/subsystem/titlescreen.dm similarity index 85% rename from code/modules/fancytitle/fancytitle.dm rename to code/controllers/subsystem/titlescreen.dm index d1cf08ff58c..e597f74e05f 100644 --- a/code/modules/fancytitle/fancytitle.dm +++ b/code/controllers/subsystem/titlescreen.dm @@ -1,4 +1,9 @@ -/hook/startup/proc/setup_title_screen() +SUBSYSTEM_DEF(title) + name = "Title Screen" + flags = SS_NO_FIRE + init_order = INIT_ORDER_TITLE + +/datum/controller/subsystem/title/Initialize() var/list/provisional_title_screens = flist("config/title_screens/images/") var/list/title_screens = list() var/use_rare_screens = prob(1) @@ -29,5 +34,5 @@ for(var/turf/unsimulated/wall/splashscreen/splash in world) splash.icon = icon - return TRUE - return FALSE + + return ..() diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index 7bfc79e4e71..0e98179e2f9 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -1,7 +1,3 @@ -/hook/startup/proc/createDatacore() - GLOB.data_core = new /datum/datacore() - return 1 - /datum/datacore var/list/medical = list() var/list/general = list() diff --git a/code/game/area/Space Station 13 areas.dm b/code/game/area/Space Station 13 areas.dm index edfae8fd53e..a04094d184f 100644 --- a/code/game/area/Space Station 13 areas.dm +++ b/code/game/area/Space Station 13 areas.dm @@ -13,35 +13,6 @@ NOTE: there are two lists of areas in the end of this file: centcom and station */ -/*Adding a wizard area teleport list because motherfucking lag -- Urist*/ -/*I am far too lazy to make it a proper list of areas so I'll just make it run the usual telepot routine at the start of the game*/ -GLOBAL_LIST_EMPTY(teleportlocs) -/hook/startup/proc/process_teleport_locs() - for(var/area/AR in world) - if(AR.no_teleportlocs) continue - if(GLOB.teleportlocs.Find(AR.name)) continue - var/turf/picked = safepick(get_area_turfs(AR.type)) - if(picked && is_station_level(picked.z)) - GLOB.teleportlocs += AR.name - GLOB.teleportlocs[AR.name] = AR - - GLOB.teleportlocs = sortAssoc(GLOB.teleportlocs) - - return 1 - -GLOBAL_LIST_EMPTY(ghostteleportlocs) -/hook/startup/proc/process_ghost_teleport_locs() - for(var/area/AR in world) - if(GLOB.ghostteleportlocs.Find(AR.name)) continue - var/list/turfs = get_area_turfs(AR.type) - if(turfs.len) - GLOB.ghostteleportlocs += AR.name - GLOB.ghostteleportlocs[AR.name] = AR - - GLOB.ghostteleportlocs = sortAssoc(GLOB.ghostteleportlocs) - - return 1 - /*-----------------------------------------------------------------------------*/ diff --git a/code/game/jobs/job_scaling.dm b/code/game/jobs/job_scaling.dm deleted file mode 100644 index c062fe6c216..00000000000 --- a/code/game/jobs/job_scaling.dm +++ /dev/null @@ -1,11 +0,0 @@ -/hook/roundstart/proc/jobscaling() - sleep(10 SECONDS) // give everyone time to finish spawning, and the lag to die down - var/playercount = length(GLOB.clients) - var/highpop_trigger = 80 - - if(playercount >= highpop_trigger) - log_debug("Playercount: [playercount] versus trigger: [highpop_trigger] - loading highpop job config"); - SSjobs.LoadJobs("config/jobs_highpop.txt") - else - log_debug("Playercount: [playercount] versus trigger: [highpop_trigger] - keeping standard job config"); - return 1 diff --git a/code/game/jobs/whitelist.dm b/code/game/jobs/whitelist.dm index ab1bd3b8067..46b98ce1030 100644 --- a/code/game/jobs/whitelist.dm +++ b/code/game/jobs/whitelist.dm @@ -2,10 +2,11 @@ GLOBAL_LIST_EMPTY(whitelist) -/hook/startup/proc/loadWhitelist() +/proc/init_whitelists() if(config.usewhitelist) load_whitelist() - return 1 + if(config.usealienwhitelist) + load_alienwhitelist() /proc/load_whitelist() GLOB.whitelist = file2list(WHITELISTFILE) @@ -48,11 +49,6 @@ GLOBAL_LIST_EMPTY(whitelist) GLOBAL_LIST_EMPTY(alien_whitelist) -/hook/startup/proc/loadAlienWhitelist() - if(config.usealienwhitelist) - load_alienwhitelist() - return 1 - /proc/load_alienwhitelist() var/text = file2text("config/alienwhitelist.txt") if(!text) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index aa3f7b898a1..b78b90f2769 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -54,19 +54,6 @@ if (opacity) has_opaque_atom = TRUE -/hook/startup/proc/smooth_world() - var/watch = start_watch() - log_startup_progress("Smoothing atoms...") - for(var/turf/T in world) - if(T.smooth) - queue_smooth(T) - for(var/A in T) - var/atom/AA = A - if(AA.smooth) - queue_smooth(AA) - log_startup_progress(" Smoothed atoms in [stop_watch(watch)]s.") - return 1 - /turf/Destroy() // Adds the adjacent turfs to the current atmos processing if(SSair) diff --git a/code/game/world.dm b/code/game/world.dm index 174a1662dd0..9d0e6e5a0ba 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -11,7 +11,8 @@ GLOBAL_LIST_INIT(map_transition_config, MAP_TRANSITION_CONFIG) enable_debugger() // Enable the extools debugger log_world("World loaded at [time_stamp()]") log_world("[GLOB.vars.len - GLOB.gvars_datum_in_built_vars.len] global variables") - + connectDB() // This NEEDS TO HAPPEN EARLY. I CANNOT STRESS THIS ENOUGH!!!!!!! -aa + load_admins() // Same here if(byond_version < RECOMMENDED_VERSION) log_world("Your server's byond version does not meet the recommended requirements for this code. Please update BYOND") @@ -21,8 +22,7 @@ GLOBAL_LIST_INIT(map_transition_config, MAP_TRANSITION_CONFIG) GLOB.timezoneOffset = text2num(time2text(0, "hh")) * 36000 - makeDatumRefLists() - callHook("startup") + startup_procs() // Call procs that need to occur on startup (Generate lists, load MOTD, etc) src.update_status() @@ -30,9 +30,6 @@ GLOBAL_LIST_INIT(map_transition_config, MAP_TRANSITION_CONFIG) . = ..() - // Create robolimbs for chargen. - populate_robolimb_list() - Master.Initialize(10, FALSE) @@ -40,6 +37,16 @@ GLOBAL_LIST_INIT(map_transition_config, MAP_TRANSITION_CONFIG) return +// This is basically a replacement for hook/startup. Please dont shove random bullshit here +// If it doesnt need to happen IMMEDIATELY on world load, make a subsystem for it +/world/proc/startup_procs() + LoadBans() // Load up who is banned and who isnt. DONT PUT THIS IN A SUBSYSTEM IT WILL TAKE TOO LONG TO BE CALLED + jobban_loadbanfile() // Load up jobbans. Again, DO NOT PUT THIS IN A SUBSYSTEM IT WILL TAKE TOO LONG TO BE CALLED + load_motd() // Loads up the MOTD (Welcome message players see when joining the server) + load_mode() // Loads up the gamemode + investigate_reset() // This is part of the admin investigate system. PLEASE DONT SS THIS EITHER + makeDatumRefLists() // Setups up lists of datums and their subtypes + //world/Topic(href, href_list[]) // to_chat(world, "Received a Topic() call!") // to_chat(world, "[href]") @@ -324,11 +331,6 @@ GLOBAL_VAR_INIT(world_topic_spam_protect_time, world.timeofday) else ..(0) - -/hook/startup/proc/loadMode() - world.load_mode() - return 1 - /world/proc/load_mode() var/list/Lines = file2list("data/mode.txt") if(Lines.len) @@ -341,10 +343,6 @@ GLOBAL_VAR_INIT(world_topic_spam_protect_time, world.timeofday) fdel(F) F << the_mode -/hook/startup/proc/loadMOTD() - world.load_motd() - return 1 - /world/proc/load_motd() GLOB.join_motd = file2text("config/motd.txt") GLOB.join_tos = file2text("config/tos.txt") @@ -431,7 +429,7 @@ GLOBAL_VAR_INIT(failed_old_db_connections, 0) fdel(GLOB.config_error_log) -/hook/startup/proc/connectDB() +/world/proc/connectDB() if(!setup_database_connection()) log_world("Your server failed to establish a connection with the feedback database.") else diff --git a/code/modules/admin/NewBan.dm b/code/modules/admin/NewBan.dm index 7b9a9330704..9aab12234d2 100644 --- a/code/modules/admin/NewBan.dm +++ b/code/modules/admin/NewBan.dm @@ -58,9 +58,6 @@ GLOBAL_PROTECT(banlist_savefile) // Obvious reasons GLOB.CMinutes = (world.realtime / 10) / 60 return 1 -/hook/startup/proc/loadBans() - return LoadBans() - /proc/LoadBans() GLOB.banlist_savefile = new("data/banlist.bdb") diff --git a/code/modules/admin/admin_investigate.dm b/code/modules/admin/admin_investigate.dm index 13b786c5174..a627c96148f 100644 --- a/code/modules/admin/admin_investigate.dm +++ b/code/modules/admin/admin_investigate.dm @@ -11,10 +11,6 @@ /proc/investigate_subject2file(var/subject) return file("[INVESTIGATE_DIR][subject].html") -/hook/startup/proc/resetInvestigate() - investigate_reset() - return 1 - /proc/investigate_reset() if(fdel(INVESTIGATE_DIR)) return 1 return 0 diff --git a/code/modules/admin/admin_ranks.dm b/code/modules/admin/admin_ranks.dm index fdf3d0dc8d0..861882b0dbb 100644 --- a/code/modules/admin/admin_ranks.dm +++ b/code/modules/admin/admin_ranks.dm @@ -56,10 +56,6 @@ GLOBAL_PROTECT(admin_ranks) // this shit is being protected for obvious reasons testing(msg) #endif -/hook/startup/proc/loadAdmins() - load_admins() - return 1 - /proc/load_admins() //clear the datums references GLOB.admin_datums.Cut() diff --git a/code/modules/admin/banjob.dm b/code/modules/admin/banjob.dm index 9efc4c9ce88..2122f88f4ed 100644 --- a/code/modules/admin/banjob.dm +++ b/code/modules/admin/banjob.dm @@ -56,10 +56,6 @@ DEBUG jobban_loadbanfile() */ -/hook/startup/proc/loadJobBans() - jobban_loadbanfile() - return 1 - /proc/jobban_loadbanfile() if(config.ban_legacy_system) var/savefile/S=new("data/job_full.ban") diff --git a/code/modules/client/preference/loadout/loadout.dm b/code/modules/client/preference/loadout/loadout.dm index 1091b38a11c..f1f0e2082de 100644 --- a/code/modules/client/preference/loadout/loadout.dm +++ b/code/modules/client/preference/loadout/loadout.dm @@ -9,39 +9,6 @@ GLOBAL_LIST_EMPTY(gear_datums) category = cat ..() -/hook/startup/proc/populate_gear_list() - //create a list of gear datums to sort - for(var/geartype in subtypesof(/datum/gear)) - var/datum/gear/G = geartype - - var/use_name = initial(G.display_name) - var/use_category = initial(G.sort_category) - - if(G == initial(G.subtype_path)) - continue - - if(!use_name) - error("Loadout - Missing display name: [G]") - continue - if(!initial(G.cost)) - error("Loadout - Missing cost: [G]") - continue - if(!initial(G.path)) - error("Loadout - Missing path definition: [G]") - continue - - if(!GLOB.loadout_categories[use_category]) - GLOB.loadout_categories[use_category] = new /datum/loadout_category(use_category) - var/datum/loadout_category/LC = GLOB.loadout_categories[use_category] - GLOB.gear_datums[use_name] = new geartype - LC.gear[use_name] = GLOB.gear_datums[use_name] - - GLOB.loadout_categories = sortAssoc(GLOB.loadout_categories) - for(var/loadout_category in GLOB.loadout_categories) - var/datum/loadout_category/LC = GLOB.loadout_categories[loadout_category] - LC.gear = sortAssoc(LC.gear) - return 1 - /datum/gear var/display_name //Name/index. Must be unique. var/description //Description of this gear. If left blank will default to the description of the pathed item. diff --git a/code/modules/events/holidays/AprilFools.dm b/code/modules/events/holidays/AprilFools.dm deleted file mode 100644 index 562e6b98e0d..00000000000 --- a/code/modules/events/holidays/AprilFools.dm +++ /dev/null @@ -1 +0,0 @@ -//placeholder for holiday stuff diff --git a/code/modules/events/holidays/Christmas.dm b/code/modules/events/holidays/Christmas.dm deleted file mode 100644 index e04471482a5..00000000000 --- a/code/modules/events/holidays/Christmas.dm +++ /dev/null @@ -1,61 +0,0 @@ -/proc/Christmas_Game_Start() - for(var/obj/structure/flora/tree/pine/xmas in world) - if(!is_station_level(xmas.z)) continue - for(var/turf/simulated/floor/T in orange(1,xmas)) - for(var/i=1,i<=rand(1,5),i++) - new /obj/item/a_gift(T) - for(var/mob/living/simple_animal/corgi/Ian/Ian in GLOB.mob_list) - Ian.place_on_head(new /obj/item/clothing/head/helmet/space/santahat(Ian)) - -/proc/ChristmasEvent() - for(var/obj/structure/flora/tree/pine/xmas in world) - var/mob/living/simple_animal/hostile/tree/evil_tree = new /mob/living/simple_animal/hostile/tree(xmas.loc) - evil_tree.icon_state = xmas.icon_state - evil_tree.icon_living = evil_tree.icon_state - evil_tree.icon_dead = evil_tree.icon_state - evil_tree.icon_gib = evil_tree.icon_state - qdel(xmas) - -/obj/item/toy/xmas_cracker - name = "xmas cracker" - icon = 'icons/obj/christmas.dmi' - icon_state = "cracker" - desc = "Directions for use: Requires two people, one to pull each end." - var/cracked = 0 - -/obj/item/toy/xmas_cracker/New() - ..() - -/obj/item/toy/xmas_cracker/attack(mob/target, mob/user) - if( !cracked && istype(target,/mob/living/carbon/human) && (target.stat == CONSCIOUS) && !target.get_active_hand() ) - target.visible_message("[user] and [target] pop \an [src]! *pop*", "You pull \an [src] with [target]! *pop*", "You hear a *pop*.") - var/obj/item/paper/Joke = new /obj/item/paper(user.loc) - Joke.name = "[pick("awful","terrible","unfunny")] joke" - Joke.info = pick("What did one snowman say to the other?\n\n'Is it me or can you smell carrots?'", - "Why couldn't the snowman get laid?\n\nHe was frigid!", - "Where are santa's helpers educated?\n\nNowhere, they're ELF-taught.", - "What happened to the man who stole advent calanders?\n\nHe got 25 days.", - "What does Santa get when he gets stuck in a chimney?\n\nClaus-trophobia.", - "Where do you find chili beans?\n\nThe north pole.", - "What do you get from eating tree decorations?\n\nTinsilitis!", - "What do snowmen wear on their heads?\n\nIce caps!", - "Why is Christmas just like life on ss13?\n\nYou do all the work and the fat guy gets all the credit.", - "Why doesn�t Santa have any children?\n\nBecause he only comes down the chimney.") - new /obj/item/clothing/head/festive(target.loc) - user.update_icons() - cracked = 1 - icon_state = "cracker1" - var/obj/item/toy/xmas_cracker/other_half = new /obj/item/toy/xmas_cracker(target) - other_half.cracked = 1 - other_half.icon_state = "cracker2" - target.put_in_active_hand(other_half) - playsound(user, 'sound/effects/snap.ogg', 50, 1) - return 1 - return ..() - -/obj/item/clothing/head/festive - name = "festive paper hat" - icon_state = "xmashat" - desc = "A crappy paper hat that you are REQUIRED to wear." - flags_inv = 0 - armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0) diff --git a/code/modules/events/holidays/Easter.dm b/code/modules/events/holidays/Easter.dm deleted file mode 100644 index 562e6b98e0d..00000000000 --- a/code/modules/events/holidays/Easter.dm +++ /dev/null @@ -1 +0,0 @@ -//placeholder for holiday stuff diff --git a/code/modules/events/holidays/Holidays.dm b/code/modules/events/holidays/Holidays.dm deleted file mode 100644 index 5bc49001e3a..00000000000 --- a/code/modules/events/holidays/Holidays.dm +++ /dev/null @@ -1,183 +0,0 @@ -//Uncommenting ALLOW_HOLIDAYS in config.txt will enable Holidays -GLOBAL_VAR_INIT(Holiday) // I didnt update the rest of this code because this file hasnt been ticked in years, and holiday code got overhauled - // If it really needs fixing, yell at me, -aa - -//Just thinking ahead! Here's the foundations to a more robust Holiday event system. -//It's easy as hell to add stuff. Just set Holiday to something using the switch(or something else) -//then use if(Holiday == "MyHoliday") to make stuff happen on that specific day only -//Please, Don't spam stuff up with easter eggs, I'd rather somebody just delete this than people cause -//the game to lag even more in the name of one-day content. - -////////////////////////////////////////////////////////////////////////////////////////////////////////// -//ALSO, MOST IMPORTANTLY: Don't add stupid stuff! Discuss bonus content with Project-Heads first please!// -////////////////////////////////////////////////////////////////////////////////////////////////////////// -// ~Carn - -/hook/startup/proc/updateHoliday() - Get_Holiday() - return 1 - -//sets up the Holiday global variable. Shouldbe called on game configuration or something. -/proc/Get_Holiday() - if(!Holiday) return // Holiday stuff was not enabled in the config! - - Holiday = null // reset our switch now so we can recycle it as our Holiday name - - var/YY = text2num(time2text(world.timeofday, "YY")) // get the current year - var/MM = text2num(time2text(world.timeofday, "MM")) // get the current month - var/DD = text2num(time2text(world.timeofday, "DD")) // get the current day - - //Main switch. If any of these are too dumb/inappropriate, or you have better ones, feel free to change whatever - switch(MM) - if(1) //Jan - switch(DD) - if(1) Holiday = "New Year's Day" - - if(2) //Feb - switch(DD) - if(2) Holiday = "Groundhog Day" - if(14) Holiday = "Valentine's Day" - if(17) Holiday = "Random Acts of Kindness Day" - - if(3) //Mar - switch(DD) - if(14) Holiday = "Pi Day" - if(17) Holiday = "St. Patrick's Day" - if(27) - if(YY == 16) - Holiday = "Easter" - if(31) - if(YY == 13) - Holiday = "Easter" - - if(4) //Apr - switch(DD) - if(1) - Holiday = "April Fool's Day" - if(YY == 18 && prob(50)) Holiday = "Easter" - if(5) - if(YY == 15) Holiday = "Easter" - if(16) - if(YY == 17) Holiday = "Easter" - if(20) - Holiday = "Four-Twenty" - if(YY == 14 && prob(50)) Holiday = "Easter" - if(22) Holiday = "Earth Day" - - if(5) //May - switch(DD) - if(1) Holiday = "Labour Day" - if(4) Holiday = "FireFighter's Day" - if(12) Holiday = "Owl and Pussycat Day" //what a dumb day of observence...but we -do- have costumes already :3 - - if(6) //Jun - - if(7) //Jul - switch(DD) - if(1) Holiday = "Doctor's Day" - if(2) Holiday = "UFO Day" - if(8) Holiday = "Writer's Day" - if(30) Holiday = "Friendship Day" - - if(8) //Aug - switch(DD) - if(5) Holiday = "Beer Day" - - if(9) //Sep - switch(DD) - if(19) Holiday = "Talk-Like-a-Pirate Day" - if(28) Holiday = "Stupid-Questions Day" - - if(10) //Oct - switch(DD) - if(4) Holiday = "Animal's Day" - if(7) Holiday = "Smiling Day" - if(16) Holiday = "Boss' Day" - if(31) Holiday = "Halloween" - - if(11) //Nov - switch(DD) - if(1) Holiday = "Vegan Day" - if(13) Holiday = "Kindness Day" - if(19) Holiday = "Flowers Day" - if(21) Holiday = "Saying-'Hello' Day" - - if(12) //Dec - switch(DD) - if(10) Holiday = "Human-Rights Day" - if(14) Holiday = "Monkey Day" - if(21) if(YY==12) Holiday = "End of the World" - if(22) Holiday = "Orgasming Day" //lol. These all actually exist - if(24) Holiday = "Christmas Eve" - if(25) Holiday = "Christmas" - if(26) Holiday = "Boxing Day" - if(31) Holiday = "New Year's Eve" - - if(!Holiday) - //Friday the 13th - if(DD == 13) - if(time2text(world.timeofday, "DDD") == "Fri") - Holiday = "Friday the 13th" - -//Allows GA and GM to set the Holiday variable -/client/proc/Set_Holiday(T as text|null) - set name = ".Set Holiday" - set category = "Event" - set desc = "Force-set the Holiday variable to make the game think it's a certain day." - if(!check_rights(R_SERVER)) return - - Holiday = T - //get a new station name - station_name = null - station_name() - //update our hub status - world.update_status() - Holiday_Game_Start() - - message_admins("ADMIN: Event: [key_name_admin(src)] force-set Holiday to \"[Holiday]\"") - log_admin("[key_name(src)] force-set Holiday to \"[Holiday]\"") - - -//Run at the start of a round -/proc/Holiday_Game_Start() - if(Holiday) - to_chat(world, "and...") - to_chat(world, "

Happy [Holiday] Everybody!

") - switch(Holiday) //special holidays - if("Easter") - //do easter stuff - if("Christmas Eve","Christmas") - Christmas_Game_Start() - - return - -//Nested in the random events loop. Will be triggered every 2 minutes -/proc/Holiday_Random_Event() - switch(Holiday) //special holidays - - if("",null) //no Holiday today! Back to work! - return - - if("Easter") //I'll make this into some helper procs at some point -/* var/list/turf/simulated/floor/Floorlist = list() - for(var/turf/simulated/floor/T) - if(T.contents) - Floorlist += T - var/turf/simulated/floor/F = Floorlist[rand(1,Floorlist.len)] - Floorlist = null - var/obj/structure/closet/C = locate(/obj/structure/closet) in F - var/obj/item/reagent_containers/food/snacks/chocolateegg/wrapped/Egg - if( C ) Egg = new(C) - else Egg = new(F) -*/ -/* var/list/obj/containers = list() - for(var/obj/item/storage/S in world) - if(!is_station_level(S.z)) continue - containers += S - - message_admins("DEBUG: Event: Egg spawned at [Egg.loc] ([Egg.x],[Egg.y],[Egg.z])")*/ - if("End of the World") - if(prob(eventchance)) GameOver() - - if("Christmas","Christmas Eve") - if(prob(eventchance)) ChristmasEvent() diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index 65fadaa9b45..8fa7629863e 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -3,11 +3,6 @@ GLOBAL_DATUM_INIT(library_catalog, /datum/library_catalog, new()) GLOBAL_LIST_INIT(library_section_names, list("Any", "Fiction", "Non-Fiction", "Adult", "Reference", "Religion")) - -/hook/startup/proc/load_manuals() - GLOB.library_catalog.initialize() - return 1 - /* * Borrowbook datum */ @@ -65,7 +60,7 @@ GLOBAL_LIST_INIT(library_section_names, list("Any", "Fiction", "Non-Fiction", "A /datum/library_catalog var/list/cached_books = list() -/datum/library_catalog/proc/initialize() +/datum/library_catalog/New() var/newid=1 for(var/typepath in subtypesof(/obj/item/book/manual)) var/obj/item/book/B = new typepath(null) diff --git a/code/modules/mob/living/carbon/human/body_accessories.dm b/code/modules/mob/living/carbon/human/body_accessories.dm index e214f6068bb..f644ed20e92 100644 --- a/code/modules/mob/living/carbon/human/body_accessories.dm +++ b/code/modules/mob/living/carbon/human/body_accessories.dm @@ -1,17 +1,5 @@ GLOBAL_LIST_INIT(body_accessory_by_name, list("None" = null)) - -/hook/startup/proc/initalize_body_accessories() - - __init_body_accessory(/datum/body_accessory/body) - __init_body_accessory(/datum/body_accessory/tail) - - if(GLOB.body_accessory_by_name.len) - if(initialize_body_accessory_by_species()) - return TRUE - - return FALSE //fail if no bodies are found - GLOBAL_LIST_INIT(body_accessory_by_species, list("None" = null)) /proc/initialize_body_accessory_by_species() diff --git a/code/modules/mob/living/silicon/ai/latejoin.dm b/code/modules/mob/living/silicon/ai/latejoin.dm index 75e8854b45c..e1be5450811 100644 --- a/code/modules/mob/living/silicon/ai/latejoin.dm +++ b/code/modules/mob/living/silicon/ai/latejoin.dm @@ -1,15 +1,5 @@ GLOBAL_LIST_EMPTY(empty_playable_ai_cores) -/hook/roundstart/proc/spawn_empty_ai() - for(var/obj/effect/landmark/start/S in GLOB.landmarks_list) - if(S.name != "AI") - continue - if(locate(/mob/living) in S.loc) - continue - GLOB.empty_playable_ai_cores += new /obj/structure/AIcore/deactivated(get_turf(S)) - - return 1 - /mob/living/silicon/ai/verb/wipe_core() set name = "Wipe Core" set category = "OOC" diff --git a/code/modules/mob/living/silicon/pai/recruit.dm b/code/modules/mob/living/silicon/pai/recruit.dm index f52da9942e4..920dff8a8c2 100644 --- a/code/modules/mob/living/silicon/pai/recruit.dm +++ b/code/modules/mob/living/silicon/pai/recruit.dm @@ -1,6 +1,6 @@ // Recruiting observers to play as pAIs -GLOBAL_DATUM(paiController, /datum/paiController) // Global handler for pAI candidates +GLOBAL_DATUM_INIT(paiController, /datum/paiController, new) // Global handler for pAI candidates /datum/paiCandidate var/name @@ -10,12 +10,6 @@ GLOBAL_DATUM(paiController, /datum/paiController) // Global handler for pAI cand var/comments var/ready = 0 - -/hook/startup/proc/paiControllerSetup() - GLOB.paiController = new /datum/paiController() - return 1 - - /datum/paiController var/list/pai_candidates = list() var/list/asked = list() diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index 3b51048452e..574dcda3230 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -13,19 +13,6 @@ GLOBAL_LIST_INIT(pai_emotions, list( GLOBAL_LIST_EMPTY(pai_software_by_key) GLOBAL_LIST_EMPTY(default_pai_software) -/hook/startup/proc/populate_pai_software_list() - var/r = 1 // I would use ., but it'd sacrifice runtime detection - for(var/type in subtypesof(/datum/pai_software)) - var/datum/pai_software/P = new type() - if(GLOB.pai_software_by_key[P.id]) - var/datum/pai_software/O = GLOB.pai_software_by_key[P.id] - to_chat(world, "pAI software module [P.name] has the same key as [O.name]!") - r = 0 - continue - GLOB.pai_software_by_key[P.id] = P - if(P.default) - GLOB.default_pai_software[P.id] = P - return r /mob/living/silicon/pai/New() ..() diff --git a/code/modules/surgery/organs/robolimbs.dm b/code/modules/surgery/organs/robolimbs.dm index eb40fa40994..e69889a709b 100644 --- a/code/modules/surgery/organs/robolimbs.dm +++ b/code/modules/surgery/organs/robolimbs.dm @@ -3,18 +3,6 @@ GLOBAL_LIST_EMPTY(chargen_robolimbs) GLOBAL_LIST_EMPTY(selectable_robolimbs) GLOBAL_DATUM(basic_robolimb, /datum/robolimb) -/proc/populate_robolimb_list() - GLOB.basic_robolimb = new() - for(var/limb_type in typesof(/datum/robolimb)) - var/datum/robolimb/R = new limb_type() - GLOB.all_robolimbs[R.company] = R - if(!R.unavailable_at_chargen) - if(R != "head" && R != "chest" && R != "groin" ) //Part of the method that ensures only IPCs can access head, chest and groin prosthetics. - if(R.has_subtypes) //Ensures solos get added to the list as well be incorporating has_subtypes == 1 and has_subtypes == 2. - GLOB.chargen_robolimbs[R.company] = R //List only main brands and solo parts. - if(R.selectable) - GLOB.selectable_robolimbs[R.company] = R - /datum/robolimb var/company = "Unbranded" // Shown when selecting the limb. var/desc = "A generic unbranded robotic prosthesis." // Seen when examining a limb. diff --git a/paradise.dme b/paradise.dme index acc84e8d18f..39a1a3ba137 100644 --- a/paradise.dme +++ b/paradise.dme @@ -206,8 +206,6 @@ #include "code\controllers\controller.dm" #include "code\controllers\failsafe.dm" #include "code\controllers\globals.dm" -#include "code\controllers\hooks-defs.dm" -#include "code\controllers\hooks.dm" #include "code\controllers\master.dm" #include "code\controllers\subsystem.dm" #include "code\controllers\verbs.dm" @@ -246,6 +244,7 @@ #include "code\controllers\subsystem\throwing.dm" #include "code\controllers\subsystem\ticker.dm" #include "code\controllers\subsystem\timer.dm" +#include "code\controllers\subsystem\titlescreen.dm" #include "code\controllers\subsystem\vote.dm" #include "code\controllers\subsystem\weather.dm" #include "code\controllers\subsystem\processing\fastprocess.dm" @@ -605,7 +604,6 @@ #include "code\game\jobs\access.dm" #include "code\game\jobs\job_exp.dm" #include "code\game\jobs\job_objective.dm" -#include "code\game\jobs\job_scaling.dm" #include "code\game\jobs\jobs.dm" #include "code\game\jobs\whitelist.dm" #include "code\game\jobs\job\central.dm" @@ -1527,7 +1525,6 @@ #include "code\modules\examine\descriptions\weapons.dm" #include "code\modules\ext_scripts\irc.dm" #include "code\modules\ext_scripts\python.dm" -#include "code\modules\fancytitle\fancytitle.dm" #include "code\modules\fish\fish_eggs.dm" #include "code\modules\fish\fish_items.dm" #include "code\modules\fish\fish_types.dm"