diff --git a/_maps/RandomRuins/LavaRuins/lavaland_surface_pizzaparty.dmm b/_maps/RandomRuins/LavaRuins/lavaland_surface_pizzaparty.dmm index 21f2d38090..b66fbdf3d5 100644 --- a/_maps/RandomRuins/LavaRuins/lavaland_surface_pizzaparty.dmm +++ b/_maps/RandomRuins/LavaRuins/lavaland_surface_pizzaparty.dmm @@ -28,7 +28,7 @@ "g" = ( /obj/structure/reagent_dispensers/water_cooler{ name = "punch cooler"; - reagent_id = "bacchus_blessing" + reagent_id = /datum/reagent/consumable/ethanol/bacchus_blessing }, /obj/effect/decal/cleanable/dirt, /turf/open/floor/wood{ diff --git a/_maps/RandomRuins/SpaceRuins/TheDerelict.dmm b/_maps/RandomRuins/SpaceRuins/TheDerelict.dmm index e5038c0730..1464dd9529 100644 --- a/_maps/RandomRuins/SpaceRuins/TheDerelict.dmm +++ b/_maps/RandomRuins/SpaceRuins/TheDerelict.dmm @@ -3410,7 +3410,7 @@ "lq" = ( /obj/structure/table, /obj/item/reagent_containers/glass/beaker{ - list_reagents = list("sacid" = 50) + list_reagents = list(/datum/reagent/toxin/acid = 50) }, /obj/item/paper/crumpled/bloody/ruins/thederelict/unfinished, /obj/item/pen, diff --git a/_maps/templates/shelter_1.dmm b/_maps/templates/shelter_1.dmm index f5b2e141f4..7f95fba10f 100644 --- a/_maps/templates/shelter_1.dmm +++ b/_maps/templates/shelter_1.dmm @@ -50,9 +50,7 @@ /area/survivalpod) "l" = ( /obj/structure/tubes, -/obj/structure/chair/comfy/black{ - dir = 8 - }, +/obj/machinery/recharge_station, /turf/open/floor/pod, /area/survivalpod) "m" = ( diff --git a/_maps/templates/shelter_2.dmm b/_maps/templates/shelter_2.dmm index 80de4438da..825cb26e3a 100644 --- a/_maps/templates/shelter_2.dmm +++ b/_maps/templates/shelter_2.dmm @@ -67,8 +67,7 @@ layer = 3 }, /obj/machinery/door/window/survival_pod{ - dir = 1; - icon_state = "windoor" + dir = 1 }, /turf/open/floor/carpet/black, /area/survivalpod) @@ -133,7 +132,6 @@ /area/survivalpod) "u" = ( /obj/machinery/door/window/survival_pod{ - icon_state = "windoor"; dir = 1 }, /turf/open/floor/carpet/black, @@ -169,10 +167,10 @@ /area/survivalpod) "y" = ( /obj/structure/sink/kitchen{ - icon_state = "sink_alt"; dir = 4; pixel_x = -13 }, +/obj/machinery/recharge_station/upgraded, /turf/open/floor/carpet/black, /area/survivalpod) "z" = ( diff --git a/_maps/templates/shelter_3.dmm b/_maps/templates/shelter_3.dmm index b71da1fba0..bb400f29ac 100644 --- a/_maps/templates/shelter_3.dmm +++ b/_maps/templates/shelter_3.dmm @@ -268,6 +268,10 @@ /obj/structure/fans/tiny, /turf/open/floor/carpet/black, /area/survivalpod) +"T" = ( +/obj/machinery/recharge_station/fullupgrade, +/turf/open/floor/carpet/black, +/area/survivalpod) (1,1,1) = {" a @@ -287,7 +291,7 @@ b f q s -x +T y D F diff --git a/code/__DEFINES/inventory.dm b/code/__DEFINES/inventory.dm index f5ea8d835f..2756be76fb 100644 --- a/code/__DEFINES/inventory.dm +++ b/code/__DEFINES/inventory.dm @@ -130,33 +130,24 @@ #define NECK (1<<11) #define FULL_BODY (~0) +//flags for alternate styles: These are hard sprited so don't set this if you didn't put the effort in +#define NORMAL_STYLE 0 +#define ALT_STYLE 1 + //flags for female outfits: How much the game can safely "take off" the uniform without it looking weird #define NO_FEMALE_UNIFORM 0 #define FEMALE_UNIFORM_FULL 1 #define FEMALE_UNIFORM_TOP 2 -//flags for alternate styles: These are hard sprited so don't set this if you didn't put the effort in -#define NORMAL_STYLE 0 -#define ALT_STYLE 1 - -#define NORMAL_SUIT_STYLE 0 -#define DIGITIGRADE_SUIT_STYLE 1 - -//Tauric Specific suits -#define NOT_TAURIC 0 -#define SNEK_TAURIC 1 -#define PAW_TAURIC 2 -#define HOOF_TAURIC 3 - -//Helmets/masks for muzzles or beaks -#define NORMAL_FACED 0 -#define MUZZLE_FACED 1 -#define BEAKED_FACED 2 - -//flags for outfits that have mutantrace variants (try not to use this): Currently only needed if you're trying to add tight fitting bootyshorts -#define NO_MUTANTRACE_VARIATION 0 -#define MUTANTRACE_VARIATION 1 +//flags for outfits that have mutantrace variants: These are hard sprited too. +#define STYLE_DIGITIGRADE (1<<0) //jumpsuits, suits and shoes +#define STYLE_MUZZLE (1<<1) //hats or masks +#define STYLE_SNEK_TAURIC (1<<2) //taur-friendly suits +#define STYLE_PAW_TAURIC (1<<3) +#define STYLE_HOOF_TAURIC (1<<4) +#define STYLE_ALL_TAURIC (STYLE_SNEK_TAURIC|STYLE_PAW_TAURIC|STYLE_HOOF_TAURIC) +//digitigrade legs settings. #define NOT_DIGITIGRADE 0 #define FULL_DIGITIGRADE 1 #define SQUISHED_DIGITIGRADE 2 diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index c194e578c9..5c54843df2 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -47,6 +47,7 @@ // Subsystems shutdown in the reverse of the order they initialize in // The numbers just define the ordering, they are meaningless otherwise. +#define INIT_ORDER_FAIL2TOPIC 22 #define INIT_ORDER_TITLE 20 #define INIT_ORDER_GARBAGE 19 #define INIT_ORDER_DBCORE 18 diff --git a/code/__HELPERS/_logging.dm b/code/__HELPERS/_logging.dm index 3ee77d3edc..4dd590d9a1 100644 --- a/code/__HELPERS/_logging.dm +++ b/code/__HELPERS/_logging.dm @@ -78,7 +78,6 @@ if (CONFIG_GET(flag/log_manifest)) WRITE_LOG(GLOB.world_manifest_log, "[ckey] \\ [body.real_name] \\ [mind.assigned_role] \\ [mind.special_role ? mind.special_role : "NONE"] \\ [latejoin ? "LATEJOIN":"ROUNDSTART"]") - /proc/log_say(text) if (CONFIG_GET(flag/log_say)) WRITE_LOG(GLOB.world_game_log, "SAY: [text]") @@ -121,7 +120,6 @@ if (CONFIG_GET(flag/log_vote)) WRITE_LOG(GLOB.world_game_log, "VOTE: [text]") - /proc/log_topic(text) WRITE_LOG(GLOB.world_game_log, "TOPIC: [text]") @@ -141,6 +139,9 @@ if (CONFIG_GET(flag/log_job_debug)) WRITE_LOG(GLOB.world_job_debug_log, "JOB: [text]") +/proc/log_subsystem(subsystem, text) + WRITE_LOG(GLOB.subsystem_log, "[subsystem]: [text]") + /* Log to both DD and the logfile. */ /proc/log_world(text) #ifdef USE_CUSTOM_ERROR_HANDLER diff --git a/code/__HELPERS/areas.dm b/code/__HELPERS/areas.dm index 1f5b82f7bf..4b52187e13 100644 --- a/code/__HELPERS/areas.dm +++ b/code/__HELPERS/areas.dm @@ -43,6 +43,13 @@ var/static/blacklisted_areas = typecacheof(list( /area/space, )) + + if(creator) + if(creator.create_area_cooldown >= world.time) + to_chat(creator, "You're trying to create a new area a little too fast.") + return + creator.create_area_cooldown = world.time + 10 + var/list/turfs = detect_room(get_turf(creator), area_or_turf_fail_types) if(!turfs) to_chat(creator, "The new area must be completely airtight and not a part of a shuttle.") diff --git a/code/__HELPERS/cmp.dm b/code/__HELPERS/cmp.dm index 4a86f57fcd..c95896d853 100644 --- a/code/__HELPERS/cmp.dm +++ b/code/__HELPERS/cmp.dm @@ -97,6 +97,9 @@ GLOBAL_VAR_INIT(cmp_field, "name") /proc/cmp_numbered_displays_name_dsc(datum/numbered_display/A, datum/numbered_display/B) return sorttext(B.sample_object.name, A.sample_object.name) +/proc/cmp_reagents_asc(datum/reagent/a, datum/reagent/b) + return sorttext(initial(b.name),initial(a.name)) + /proc/cmp_quirk_asc(datum/quirk/A, datum/quirk/B) var/a_sign = num2sign(initial(A.value) * -1) var/b_sign = num2sign(initial(B.value) * -1) diff --git a/code/_globalvars/lists/mobs.dm b/code/_globalvars/lists/mobs.dm index 1707c3a536..3577402b36 100644 --- a/code/_globalvars/lists/mobs.dm +++ b/code/_globalvars/lists/mobs.dm @@ -61,26 +61,6 @@ GLOBAL_LIST_EMPTY(latejoiners) //CIT CHANGE - All latejoining people, for traito var/mob/M = i M.update_config_movespeed() -GLOBAL_LIST_INIT(noodle_taurs, list( - "Naga", - "Tentacle" - )) - -GLOBAL_LIST_INIT(paw_taurs, list( - "Fox", - "Wolf", - "Otie", - "Drake", - "Lab", - "Shepherd", - "Husky", - "Eevee", - "Panther", - "Horse", - "Cow", - "Tiger" - )) - //blood types GLOBAL_LIST_INIT(regular_bloods,list( "O-", diff --git a/code/_globalvars/logging.dm b/code/_globalvars/logging.dm index 5ca3513e66..01d5051dba 100644 --- a/code/_globalvars/logging.dm +++ b/code/_globalvars/logging.dm @@ -30,6 +30,8 @@ GLOBAL_VAR(world_virus_log) GLOBAL_PROTECT(world_virus_log) GLOBAL_VAR(world_map_error_log) GLOBAL_PROTECT(world_map_error_log) +GLOBAL_VAR(subsystem_log) +GLOBAL_PROTECT(subsystem_log) GLOBAL_LIST_EMPTY(bombers) GLOBAL_PROTECT(bombers) diff --git a/code/controllers/configuration/configuration.dm b/code/controllers/configuration/configuration.dm index 14954524fa..730a3f17f4 100644 --- a/code/controllers/configuration/configuration.dm +++ b/code/controllers/configuration/configuration.dm @@ -236,7 +236,6 @@ if(!(M.config_tag in modes)) // ensure each mode is added only once modes += M.config_tag mode_names[M.config_tag] = M.name - probabilities[M.config_tag] = M.probability mode_reports[M.config_tag] = M.generate_report() if(probabilities[M.config_tag]>0) mode_false_report_weight[M.config_tag] = M.false_report_weight @@ -342,6 +341,9 @@ if(probabilities[M.config_tag]<=0) qdel(M) continue + if(M.config_tag in SSvote.stored_modetier_results && SSvote.stored_modetier_results[M.config_tag] < Get(/datum/config_entry/number/dropped_modes)) + qdel(M) + continue if(min_pop[M.config_tag]) M.required_players = min_pop[M.config_tag] if(max_pop[M.config_tag]) diff --git a/code/controllers/configuration/entries/fail2topic.dm b/code/controllers/configuration/entries/fail2topic.dm new file mode 100644 index 0000000000..7ed09b378a --- /dev/null +++ b/code/controllers/configuration/entries/fail2topic.dm @@ -0,0 +1,19 @@ +/datum/config_entry/number/fail2topic_rate_limit + config_entry_value = 10 //deciseconds + +/datum/config_entry/number/fail2topic_max_fails + config_entry_value = 5 + +/datum/config_entry/string/fail2topic_rule_name + config_entry_value = "_dd_fail2topic" + protection = CONFIG_ENTRY_LOCKED //affects physical server configuration, no touchies!! + +/datum/config_entry/flag/fail2topic_enabled + config_entry_value = TRUE + +/datum/config_entry/number/topic_max_size + config_entry_value = 8192 + +/datum/config_entry/keyed_list/topic_rate_limit_whitelist + key_mode = KEY_MODE_TEXT + value_mode = VALUE_MODE_FLAG diff --git a/code/controllers/configuration/entries/game_options.dm b/code/controllers/configuration/entries/game_options.dm index b95ef43d37..8b6bbe83b4 100644 --- a/code/controllers/configuration/entries/game_options.dm +++ b/code/controllers/configuration/entries/game_options.dm @@ -378,9 +378,9 @@ /datum/config_entry/keyed_list/box_random_engine key_mode = KEY_MODE_TEXT - value_mode = VALUE_MODE_FLAG + value_mode = VALUE_MODE_NUM lowercase = FALSE - splitter = "-" + splitter = "," /datum/config_entry/number/auto_transfer_delay config_entry_value = 72000 @@ -394,3 +394,9 @@ /datum/config_entry/flag/allow_clockwork_marauder_on_station config_entry_value = TRUE + +/datum/config_entry/flag/modetier_voting + config_entry_value = TRUE + +/datum/config_entry/number/dropped_modes + config_entry_value = 3 diff --git a/code/controllers/master.dm b/code/controllers/master.dm index 125da84a30..7244212630 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -54,7 +54,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new var/static/restart_clear = 0 var/static/restart_timeout = 0 var/static/restart_count = 0 - + var/static/random_seed //current tick limit, assigned before running a subsystem. @@ -69,7 +69,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new if(!random_seed) random_seed = (TEST_RUN_PARAMETER in world.params) ? 29051994 : rand(1, 1e9) rand_seed(random_seed) - + var/list/_subsystems = list() subsystems = _subsystems if (Master != src) diff --git a/code/controllers/subsystem.dm b/code/controllers/subsystem.dm index 4fe0812c56..3be4f36270 100644 --- a/code/controllers/subsystem.dm +++ b/code/controllers/subsystem.dm @@ -155,6 +155,8 @@ if(SS_SLEEPING) state = SS_PAUSING +/datum/controller/subsystem/proc/subsystem_log(msg) + return log_subsystem(name, msg) //used to initialize the subsystem AFTER the map has loaded /datum/controller/subsystem/Initialize(start_timeofday) @@ -162,7 +164,7 @@ var/time = (REALTIMEOFDAY - start_timeofday) / 10 var/msg = "Initialized [name] subsystem within [time] second[time == 1 ? "" : "s"]!" to_chat(world, "[msg]") - log_world(msg) + log_subsystem("INIT", msg) return time //hook for printing stats to the "MC" statuspanel for admins to see performance and related stats etc. diff --git a/code/controllers/subsystem/fail2topic.dm b/code/controllers/subsystem/fail2topic.dm new file mode 100644 index 0000000000..a589ae2462 --- /dev/null +++ b/code/controllers/subsystem/fail2topic.dm @@ -0,0 +1,113 @@ +SUBSYSTEM_DEF(fail2topic) + name = "Fail2Topic" + init_order = INIT_ORDER_FAIL2TOPIC + flags = SS_BACKGROUND + runlevels = ALL + + var/list/rate_limiting = list() + var/list/fail_counts = list() + var/list/active_bans = list() + + var/rate_limit + var/max_fails + var/rule_name + var/enabled = FALSE + +/datum/controller/subsystem/fail2topic/Initialize(timeofday) + rate_limit = CONFIG_GET(number/fail2topic_rate_limit) + max_fails = CONFIG_GET(number/fail2topic_max_fails) + rule_name = CONFIG_GET(string/fail2topic_rule_name) + enabled = CONFIG_GET(flag/fail2topic_enabled) + + DropFirewallRule() // Clear the old bans if any still remain + + if (world.system_type == UNIX && enabled) + enabled = FALSE + subsystem_log("DISABLED - UNIX systems are not supported.") + if(!enabled) + flags |= SS_NO_FIRE + can_fire = FALSE + + return ..() + +/datum/controller/subsystem/fail2topic/fire() + while (rate_limiting.len) + var/ip = rate_limiting[1] + var/last_attempt = rate_limiting[ip] + + if (world.time - last_attempt > rate_limit) + rate_limiting -= ip + fail_counts -= ip + + if (MC_TICK_CHECK) + return + +/datum/controller/subsystem/fail2topic/Shutdown() + DropFirewallRule() + +/datum/controller/subsystem/fail2topic/proc/IsRateLimited(ip) + var/last_attempt = rate_limiting[ip] + + var/static/datum/config_entry/keyed_list/topic_rate_limit_whitelist/cached_whitelist_entry + if(!istype(cached_whitelist_entry)) + cached_whitelist_entry = CONFIG_GET(keyed_list/topic_rate_limit_whitelist) + + if(istype(cached_whitelist_entry)) + if(cached_whitelist_entry.config_entry_value[ip]) + return FALSE + + if (active_bans[ip]) + return TRUE + + rate_limiting[ip] = world.time + + if (isnull(last_attempt)) + return FALSE + + if (world.time - last_attempt > rate_limit) + fail_counts -= ip + return FALSE + else + var/failures = fail_counts[ip] + + if (isnull(failures)) + fail_counts[ip] = 1 + return TRUE + else if (failures > max_fails) + BanFromFirewall(ip) + return TRUE + else + fail_counts[ip] = failures + 1 + return TRUE + +/datum/controller/subsystem/fail2topic/proc/BanFromFirewall(ip) + if (!enabled) + return + + active_bans[ip] = world.time + fail_counts -= ip + rate_limiting -= ip + + . = shell("netsh advfirewall firewall add rule name=\"[rule_name]\" dir=in interface=any action=block remoteip=[ip]") + + if (.) + subsystem_log("Failed to ban [ip]. Exit code: [.].") + else if (isnull(.)) + subsystem_log("Failed to invoke shell to ban [ip].") + else + subsystem_log("Banned [ip].") + +/datum/controller/subsystem/fail2topic/proc/DropFirewallRule() + if (!enabled) + return + + active_bans = list() + + . = shell("netsh advfirewall firewall delete rule name=\"[rule_name]\"") + + if (.) + subsystem_log("Failed to drop firewall rule. Exit code: [.].") + else if (isnull(.)) + subsystem_log("Failed to invoke shell for firewall rule drop.") + else + subsystem_log("Firewall rule dropped.") diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 45c8e3c8fe..0948e428ff 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -221,6 +221,12 @@ SUBSYSTEM_DEF(ticker) var/init_start = world.timeofday //Create and announce mode var/list/datum/game_mode/runnable_modes + if(SSvote.mode && (SSvote.mode == "roundtype" || SSvote.mode == "dynamic" || SSvote.mode == "mode tiers")) + SSvote.result() + SSpersistence.SaveSavedVotes() + for(var/client/C in SSvote.voting) + C << browse(null, "window=vote;can_close=0") + SSvote.reset() if(GLOB.master_mode == "random" || GLOB.master_mode == "secret") runnable_modes = config.get_runnable_modes() @@ -484,9 +490,10 @@ SUBSYSTEM_DEF(ticker) SSticker.modevoted = TRUE var/dynamic = CONFIG_GET(flag/dynamic_voting) if(dynamic) - SSvote.initiate_vote("dynamic","server",hideresults=TRUE,votesystem=SCORE_VOTING,forced=TRUE,vote_time = 2 MINUTES) + SSvote.initiate_vote("dynamic","server",hideresults=TRUE,votesystem=SCORE_VOTING,forced=TRUE,vote_time = 20 MINUTES) else - SSvote.initiate_vote("roundtype","server",hideresults=TRUE,votesystem=PLURALITY_VOTING,forced=TRUE, vote_time = 2 MINUTES) + SSvote.initiate_vote("roundtype","server",hideresults=TRUE,votesystem=PLURALITY_VOTING,forced=TRUE, \ + vote_time = (CONFIG_GET(flag/modetier_voting) ? 1 MINUTES : 20 MINUTES)) /datum/controller/subsystem/ticker/Recover() current_state = SSticker.current_state diff --git a/code/controllers/subsystem/vote.dm b/code/controllers/subsystem/vote.dm index 573c89a5af..f82954276e 100644 --- a/code/controllers/subsystem/vote.dm +++ b/code/controllers/subsystem/vote.dm @@ -15,6 +15,7 @@ SUBSYSTEM_DEF(vote) var/vote_system = PLURALITY_VOTING var/question = null var/list/choices = list() + var/list/scores = list() var/list/choice_descs = list() // optional descriptions var/list/voted = list() var/list/voting = list() @@ -26,6 +27,8 @@ SUBSYSTEM_DEF(vote) var/list/stored_gamemode_votes = list() //Basically the last voted gamemode is stored here for end-of-round use. + var/list/stored_modetier_results = list() // The aggregated tier list of the modes available in secret. + /datum/controller/subsystem/vote/fire() //called by master_controller if(mode) if(end_time < world.time) @@ -33,7 +36,8 @@ SUBSYSTEM_DEF(vote) SSpersistence.SaveSavedVotes() for(var/client/C in voting) C << browse(null, "window=vote;can_close=0") - reset() + if(end_time < world.time) // result() can change this + reset() else if(next_pop < world.time) var/datum/browser/client_popup for(var/client/C in voting) @@ -54,6 +58,7 @@ SUBSYSTEM_DEF(vote) choice_descs.Cut() voted.Cut() voting.Cut() + scores.Cut() obfuscated = FALSE //CIT CHANGE - obfuscated votes remove_action_buttons() @@ -116,10 +121,8 @@ SUBSYSTEM_DEF(vote) var/opposite_pref = d[j][i] if(pref_number>opposite_pref) p[i][j] = d[i][j] - p[j][i] = 0 else p[i][j] = 0 - p[j][i] = d[i][j] for(var/i in 1 to choices.len) for(var/j in 1 to choices.len) if(i != j) @@ -180,6 +183,22 @@ SUBSYSTEM_DEF(vote) score.Cut(median_pos,median_pos+1) choices[score_name]++ +/datum/controller/subsystem/vote/proc/calculate_scores(var/blackbox_text) + var/list/scores_by_choice = list() + for(var/choice in choices) + scores_by_choice[choice] = list() + for(var/ckey in voted) + var/list/this_vote = voted[ckey] + for(var/choice in this_vote) + sorted_insert(scores_by_choice[choice],this_vote[choice],/proc/cmp_numeric_asc) + var/middle_score = round(GLOB.vote_score_options.len/2,1) + for(var/score_name in scores_by_choice) + var/list/score = scores_by_choice[score_name] + for(var/S in score) + scores[score_name] += S-middle_score + SSblackbox.record_feedback("nested tally","voting",scores[score_name],list(blackbox_text,"Total scores",score_name)) + + /datum/controller/subsystem/vote/proc/announce_result() var/vote_title_text var/text @@ -234,6 +253,8 @@ SUBSYSTEM_DEF(vote) var/admintext = "Obfuscated results" if(vote_system == RANKED_CHOICE_VOTING) admintext += "\nIt should be noted that this is not a raw tally of votes (impossible in ranked choice) but the score determined by the schulze method of voting, so the numbers will look weird!" + else if(vote_system == SCORE_VOTING) + admintext += "\nIt should be noted that this is not a raw tally of votes but the number of runoffs done by majority judgement!" for(var/i=1,i<=choices.len,i++) var/votes = choices[choices[i]] admintext += "\n[choices[i]]: [votes]" @@ -252,6 +273,12 @@ SUBSYSTEM_DEF(vote) SSticker.save_mode(.) message_admins("The gamemode has been voted for, and has been changed to: [GLOB.master_mode]") log_admin("Gamemode has been voted for and switched to: [GLOB.master_mode].") + if(CONFIG_GET(flag/modetier_voting)) + reset() + started_time = 0 + initiate_vote("mode tiers","server",hideresults=FALSE,votesystem=RANKED_CHOICE_VOTING,forced=TRUE, vote_time = 30 MINUTES) + to_chat(world,"The vote will end right as the round starts.") + return . if("restart") if(. == "Restart Round") restart = 1 @@ -262,6 +289,8 @@ SUBSYSTEM_DEF(vote) restart = 1 else GLOB.master_mode = . + if("mode tiers") + stored_modetier_results = choices.Copy() if("dynamic") if(SSticker.current_state > GAME_STATE_PREGAME)//Don't change the mode if the round already started. return message_admins("A vote has tried to change the gamemode, but the game has already started. Aborting.") @@ -382,6 +411,13 @@ SUBSYSTEM_DEF(vote) choices |= M if("roundtype") //CIT CHANGE - adds the roundstart secret/extended vote choices.Add("secret", "extended") + if("mode tiers") + var/list/modes_to_add = config.votable_modes + var/list/probabilities = CONFIG_GET(keyed_list/probability) + for(var/tag in modes_to_add) + if(probabilities[tag] <= 0) + modes_to_add -= tag + choices.Add(modes_to_add) if("dynamic") for(var/T in config.storyteller_cache) var/datum/dynamic_storyteller/S = T diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index feac1de972..dfaa6f061d 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -947,21 +947,25 @@ if(A.reagents) var/chosen_id - var/list/reagent_options = sortList(GLOB.chemical_reagents_list) - switch(alert(usr, "Choose a method.", "Add Reagents", "Enter ID", "Choose ID")) - if("Enter ID") + switch(alert(usr, "Choose a method.", "Add Reagents", "Search", "Choose from a list", "I'm feeling lucky")) + if("Search") var/valid_id while(!valid_id) - chosen_id = stripped_input(usr, "Enter the ID of the reagent you want to add.") - if(!chosen_id) //Get me out of here! + chosen_id = input(usr, "Enter the ID of the reagent you want to add.", "Search reagents") as null|text + if(isnull(chosen_id)) //Get me out of here! break - for(var/ID in reagent_options) - if(ID == chosen_id) - valid_id = 1 + if(!ispath(text2path(chosen_id))) + chosen_id = pick_closest_path(chosen_id, make_types_fancy(subtypesof(/datum/reagent))) + if(ispath(chosen_id)) + valid_id = TRUE + else + valid_id = TRUE if(!valid_id) to_chat(usr, "A reagent with that ID doesn't exist!") - if("Choose ID") - chosen_id = input(usr, "Choose a reagent to add.", "Choose a reagent.") as null|anything in reagent_options + if("Choose from a list") + chosen_id = input(usr, "Choose a reagent to add.", "Choose a reagent.") as null|anything in subtypesof(/datum/reagent) + if("I'm feeling lucky") + chosen_id = pick(subtypesof(/datum/reagent)) if(chosen_id) var/amount = input(usr, "Choose the amount to add.", "Choose the amount.", A.reagents.maximum_volume) as num if(amount) diff --git a/code/datums/diseases/_disease.dm b/code/datums/diseases/_disease.dm index 8a6966666e..056f99c7a4 100644 --- a/code/datums/diseases/_disease.dm +++ b/code/datums/diseases/_disease.dm @@ -103,7 +103,7 @@ if(!(spread_flags & DISEASE_SPREAD_AIRBORNE) && !force_spread) return - if(affected_mob.reagents.has_reagent("spaceacillin") || (affected_mob.satiety > 0 && prob(affected_mob.satiety/10))) + if(affected_mob.reagents.has_reagent(/datum/reagent/medicine/spaceacillin) || (affected_mob.satiety > 0 && prob(affected_mob.satiety/10))) return var/spread_range = 2 diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm index 8d5e915b31..a844254ef9 100644 --- a/code/datums/diseases/advance/advance.dm +++ b/code/datums/diseases/advance/advance.dm @@ -36,37 +36,41 @@ // The order goes from easy to cure to hard to cure. Keep in mind that sentient diseases pick two cures from tier 6 and up, ensure they wont react away in bodies. var/static/list/advance_cures = list( list( // level 1 - "copper", "silver", "iodine", "iron", "carbon" + /datum/reagent/copper, /datum/reagent/silver, /datum/reagent/iodine, /datum/reagent/iron, /datum/reagent/carbon ), list( // level 2 - "potassium", "ethanol", "lithium", "silicon", "bromine" + /datum/reagent/potassium, /datum/reagent/consumable/ethanol, /datum/reagent/lithium, + /datum/reagent/silicon, /datum/reagent/bromine ), list( // level 3 - "sodiumchloride", "sugar", "orangejuice", "tomatojuice", "milk" + /datum/reagent/consumable/sodiumchloride, /datum/reagent/consumable/sugar, /datum/reagent/consumable/orangejuice, + /datum/reagent/consumable/tomatojuice, /datum/reagent/consumable/milk ), list( //level 4 - "spaceacillin", "salglu_solution", "epinephrine", "charcoal" + /datum/reagent/medicine/spaceacillin, /datum/reagent/medicine/salglu_solution, + /datum/reagent/medicine/epinephrine, /datum/reagent/medicine/charcoal ), list( //level 5 - "oil", "synaptizine", "mannitol", "space_drugs", "cryptobiolin" + /datum/reagent/oil, /datum/reagent/medicine/synaptizine, /datum/reagent/medicine/mannitol, + /datum/reagent/drug/space_drugs, /datum/reagent/cryptobiolin ), list( // level 6 - "phenol", "inacusiate", "oculine", "antihol" + /datum/reagent/phenol, /datum/reagent/medicine/inacusiate, /datum/reagent/medicine/oculine, /datum/reagent/medicine/antihol ), list( // level 7 - "leporazine", "mindbreaker", "corazone" + /datum/reagent/medicine/leporazine, /datum/reagent/toxin/mindbreaker, /datum/reagent/medicine/corazone ), list( // level 8 - "pax", "happiness", "ephedrine" + /datum/reagent/pax, /datum/reagent/drug/happiness, /datum/reagent/medicine/ephedrine ), list( // level 9 - "lipolicide", "sal_acid" + /datum/reagent/toxin/lipolicide, /datum/reagent/medicine/sal_acid ), list( // level 10 - "haloperidol", "aranesp", "diphenhydramine" + /datum/reagent/medicine/haloperidol, /datum/reagent/drug/aranesp, /datum/reagent/medicine/diphenhydramine ), list( //level 11 - "modafinil", "anacea" + /datum/reagent/medicine/modafinil, /datum/reagent/toxin/anacea ) ) diff --git a/code/datums/diseases/advance/symptoms/choking.dm b/code/datums/diseases/advance/symptoms/choking.dm index a54b132de1..069c62cf3f 100644 --- a/code/datums/diseases/advance/symptoms/choking.dm +++ b/code/datums/diseases/advance/symptoms/choking.dm @@ -138,7 +138,7 @@ Bonus var/get_damage = rand(15,21) * power M.adjustOxyLoss(get_damage) if(paralysis) - M.reagents.add_reagent_list(list("pancuronium" = 3, "sodium_thiopental" = 3)) + M.reagents.add_reagent_list(list(/datum/reagent/toxin/pancuronium = 3, /datum/reagent/toxin/sodium_thiopental = 3)) return 1 /datum/symptom/asphyxiation/proc/Asphyxiate_death(mob/living/M, datum/disease/advance/A) diff --git a/code/datums/diseases/advance/symptoms/fire.dm b/code/datums/diseases/advance/symptoms/fire.dm index f85024a7a9..6429db9439 100644 --- a/code/datums/diseases/advance/symptoms/fire.dm +++ b/code/datums/diseases/advance/symptoms/fire.dm @@ -156,7 +156,7 @@ Bonus M.adjust_fire_stacks(get_stacks) M.adjustFireLoss(get_stacks/2) if(chems) - M.reagents.add_reagent("clf3", 2 * power) + M.reagents.add_reagent(/datum/reagent/clf3, 2 * power) return 1 /datum/symptom/alkali/proc/Alkali_fire_stage_5(mob/living/M, datum/disease/advance/A) @@ -164,5 +164,5 @@ Bonus M.adjust_fire_stacks(get_stacks) M.adjustFireLoss(get_stacks) if(chems) - M.reagents.add_reagent_list(list("napalm" = 4 * power, "clf3" = 4 * power)) + M.reagents.add_reagent_list(list(/datum/reagent/napalm = 4 * power, /datum/reagent/clf3 = 4 * power)) return 1 diff --git a/code/datums/diseases/advance/symptoms/flesh_eating.dm b/code/datums/diseases/advance/symptoms/flesh_eating.dm index c38acc8e9e..d1e9d3fdca 100644 --- a/code/datums/diseases/advance/symptoms/flesh_eating.dm +++ b/code/datums/diseases/advance/symptoms/flesh_eating.dm @@ -124,7 +124,7 @@ Bonus var/get_damage = rand(6,10) M.adjustBruteLoss(get_damage) if(chems) - M.reagents.add_reagent_list(list("heparin" = 2, "lipolicide" = 2)) + M.reagents.add_reagent_list(list(/datum/reagent/toxin/heparin = 2, /datum/reagent/toxin/lipolicide = 2)) if(zombie) - M.reagents.add_reagent("romerol", 1) + M.reagents.add_reagent(/datum/reagent/romerol, 1) return 1 \ No newline at end of file diff --git a/code/datums/diseases/advance/symptoms/heal.dm b/code/datums/diseases/advance/symptoms/heal.dm index 8b205db756..d41e0bf225 100644 --- a/code/datums/diseases/advance/symptoms/heal.dm +++ b/code/datums/diseases/advance/symptoms/heal.dm @@ -117,8 +117,9 @@ power = 2 /datum/symptom/heal/chem/Heal(mob/living/M, datum/disease/advance/A, actual_power) - for(var/datum/reagent/R in M.reagents.reagent_list) //Not just toxins! - M.reagents.remove_reagent(R.id, actual_power) + for(var/E in M.reagents.reagent_list) //Not just toxins! + var/datum/reagent/R = E + M.reagents.remove_reagent(R.type, actual_power) if(food_conversion) M.nutrition += 0.3 if(prob(2)) @@ -329,11 +330,11 @@ if(M.fire_stacks < 0) M.fire_stacks = min(M.fire_stacks + 1 * absorption_coeff, 0) . += power - if(M.reagents.has_reagent("holywater")) - M.reagents.remove_reagent("holywater", 0.5 * absorption_coeff) + if(M.reagents.has_reagent(/datum/reagent/water/holywater)) + M.reagents.remove_reagent(/datum/reagent/water/holywater, 0.5 * absorption_coeff) . += power * 0.75 - else if(M.reagents.has_reagent("water")) - M.reagents.remove_reagent("water", 0.5 * absorption_coeff) + else if(M.reagents.has_reagent(/datum/reagent/water)) + M.reagents.remove_reagent(/datum/reagent/water, 0.5 * absorption_coeff) . += power * 0.5 /datum/symptom/heal/water/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power) @@ -392,7 +393,7 @@ plasmamount = environment.gases[/datum/gas/plasma] if(plasmamount && plasmamount > GLOB.meta_gas_visibility[/datum/gas/plasma]) //if there's enough plasma in the air to see . += power * 0.5 - if(M.reagents.has_reagent("plasma")) + if(M.reagents.has_reagent(/datum/reagent/toxin/plasma)) . += power * 0.75 /datum/symptom/heal/plasma/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power) diff --git a/code/datums/diseases/advance/symptoms/sensory.dm b/code/datums/diseases/advance/symptoms/sensory.dm index 2705e0b168..1f8cc8d7af 100644 --- a/code/datums/diseases/advance/symptoms/sensory.dm +++ b/code/datums/diseases/advance/symptoms/sensory.dm @@ -44,10 +44,10 @@ if(A.stage >= 4) M.drowsyness = max(0, M.drowsyness - 2) - if(M.reagents.has_reagent("mindbreaker")) - M.reagents.remove_reagent("mindbreaker", 5) - if(M.reagents.has_reagent("histamine")) - M.reagents.remove_reagent("histamine", 5) + if(M.reagents.has_reagent(/datum/reagent/toxin/mindbreaker)) + M.reagents.remove_reagent(/datum/reagent/toxin/mindbreaker, 5) + if(M.reagents.has_reagent(/datum/reagent/toxin/histamine)) + M.reagents.remove_reagent(/datum/reagent/toxin/histamine, 5) M.hallucination = max(0, M.hallucination - 10) if(A.stage >= 5) diff --git a/code/datums/diseases/anxiety.dm b/code/datums/diseases/anxiety.dm index 2d96157bb0..20ecceb224 100644 --- a/code/datums/diseases/anxiety.dm +++ b/code/datums/diseases/anxiety.dm @@ -5,7 +5,7 @@ spread_text = "On contact" spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS cure_text = "Ethanol" - cures = list("ethanol") + cures = list(/datum/reagent/consumable/ethanol) agent = "Excess Lepidopticides" viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) desc = "If left untreated subject will regurgitate butterflies." diff --git a/code/datums/diseases/beesease.dm b/code/datums/diseases/beesease.dm index ab64fd515c..edd6f151c9 100644 --- a/code/datums/diseases/beesease.dm +++ b/code/datums/diseases/beesease.dm @@ -5,7 +5,7 @@ spread_text = "On contact" spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS cure_text = "Sugar" - cures = list("sugar") + cures = list(/datum/reagent/consumable/sugar) agent = "Apidae Infection" viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) desc = "If left untreated subject will regurgitate bees." diff --git a/code/datums/diseases/brainrot.dm b/code/datums/diseases/brainrot.dm index 98ae74270b..1028d1fff4 100644 --- a/code/datums/diseases/brainrot.dm +++ b/code/datums/diseases/brainrot.dm @@ -4,7 +4,7 @@ spread_text = "On contact" spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS cure_text = "Mannitol" - cures = list("mannitol") + cures = list(/datum/reagent/medicine/mannitol) agent = "Cryptococcus Cosmosis" viable_mobtypes = list(/mob/living/carbon/human) cure_chance = 15//higher chance to cure, since two reagents are required diff --git a/code/datums/diseases/cold.dm b/code/datums/diseases/cold.dm index 22d45ffb29..8bbb05e17c 100644 --- a/code/datums/diseases/cold.dm +++ b/code/datums/diseases/cold.dm @@ -2,7 +2,7 @@ name = "The Cold" max_stages = 3 cure_text = "Rest & Spaceacillin" - cures = list("spaceacillin") + cures = list(/datum/reagent/medicine/spaceacillin) agent = "XY-rhinovirus" viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) permeability_mod = 0.5 diff --git a/code/datums/diseases/cold9.dm b/code/datums/diseases/cold9.dm index da5e67a4fb..eea3147107 100644 --- a/code/datums/diseases/cold9.dm +++ b/code/datums/diseases/cold9.dm @@ -4,7 +4,7 @@ spread_text = "On contact" spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS cure_text = "Common Cold Anti-bodies & Spaceacillin" - cures = list("spaceacillin") + cures = list(/datum/reagent/medicine/spaceacillin) agent = "ICE9-rhinovirus" viable_mobtypes = list(/mob/living/carbon/human) desc = "If left untreated the subject will slow, as if partly frozen." diff --git a/code/datums/diseases/dna_spread.dm b/code/datums/diseases/dna_spread.dm index 267dd711a3..972a7f4e18 100644 --- a/code/datums/diseases/dna_spread.dm +++ b/code/datums/diseases/dna_spread.dm @@ -4,7 +4,7 @@ spread_text = "On contact" spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS cure_text = "Mutadone" - cures = list("mutadone") + cures = list(/datum/reagent/medicine/mutadone) disease_flags = CAN_CARRY|CAN_RESIST|CURABLE agent = "S4E1 retrovirus" viable_mobtypes = list(/mob/living/carbon/human) diff --git a/code/datums/diseases/fake_gbs.dm b/code/datums/diseases/fake_gbs.dm index add60c73f1..70bcc67d21 100644 --- a/code/datums/diseases/fake_gbs.dm +++ b/code/datums/diseases/fake_gbs.dm @@ -4,7 +4,7 @@ spread_text = "On contact" spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS cure_text = "Synaptizine & Sulfur" - cures = list("synaptizine","sulfur") + cures = list(/datum/reagent/medicine/synaptizine,/datum/reagent/sulfur) agent = "Gravitokinetic Bipotential SADS-" viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) desc = "If left untreated death will occur." diff --git a/code/datums/diseases/flu.dm b/code/datums/diseases/flu.dm index e1943937ba..4fc646a590 100644 --- a/code/datums/diseases/flu.dm +++ b/code/datums/diseases/flu.dm @@ -3,7 +3,7 @@ max_stages = 3 spread_text = "Airborne" cure_text = "Spaceacillin" - cures = list("spaceacillin") + cures = list(/datum/reagent/medicine/spaceacillin) cure_chance = 10 agent = "H13N1 flu virion" viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) diff --git a/code/datums/diseases/fluspanish.dm b/code/datums/diseases/fluspanish.dm index 9577ca43d0..1557ddfbd8 100644 --- a/code/datums/diseases/fluspanish.dm +++ b/code/datums/diseases/fluspanish.dm @@ -3,7 +3,7 @@ max_stages = 3 spread_text = "Airborne" cure_text = "Spaceacillin & Anti-bodies to the common flu" - cures = list("spaceacillin") + cures = list(/datum/reagent/medicine/spaceacillin) cure_chance = 10 agent = "1nqu1s1t10n flu virion" viable_mobtypes = list(/mob/living/carbon/human) diff --git a/code/datums/diseases/gbs.dm b/code/datums/diseases/gbs.dm index 0487b1c815..8a6eab6048 100644 --- a/code/datums/diseases/gbs.dm +++ b/code/datums/diseases/gbs.dm @@ -4,7 +4,7 @@ spread_text = "On contact" spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS cure_text = "Synaptizine & Sulfur" - cures = list("synaptizine","sulfur") + cures = list(/datum/reagent/medicine/synaptizine,/datum/reagent/sulfur) cure_chance = 15//higher chance to cure, since two reagents are required agent = "Gravitokinetic Bipotential SADS+" viable_mobtypes = list(/mob/living/carbon/human) diff --git a/code/datums/diseases/heart_failure.dm b/code/datums/diseases/heart_failure.dm index 2389052a54..196cd95f69 100644 --- a/code/datums/diseases/heart_failure.dm +++ b/code/datums/diseases/heart_failure.dm @@ -58,7 +58,7 @@ H.visible_message("[H] clutches at [H.p_their()] chest as if [H.p_their()] heart is stopping!") H.adjustStaminaLoss(60) H.set_heartattack(TRUE) - H.reagents.add_reagent("corazone", 3) // To give the victim a final chance to shock their heart before losing consciousness + H.reagents.add_reagent(/datum/reagent/medicine/corazone, 3) // To give the victim a final chance to shock their heart before losing consciousness cure() else diff --git a/code/datums/diseases/magnitis.dm b/code/datums/diseases/magnitis.dm index 7c5f05c440..cb00f571aa 100644 --- a/code/datums/diseases/magnitis.dm +++ b/code/datums/diseases/magnitis.dm @@ -3,7 +3,7 @@ max_stages = 4 spread_text = "Airborne" cure_text = "Iron" - cures = list("iron") + cures = list(/datum/reagent/iron) agent = "Fukkos Miracos" viable_mobtypes = list(/mob/living/carbon/human) disease_flags = CAN_CARRY|CAN_RESIST|CURABLE diff --git a/code/datums/diseases/parrotpossession.dm b/code/datums/diseases/parrotpossession.dm index d9c4b324f6..68e962055a 100644 --- a/code/datums/diseases/parrotpossession.dm +++ b/code/datums/diseases/parrotpossession.dm @@ -5,7 +5,7 @@ spread_flags = DISEASE_SPREAD_SPECIAL disease_flags = CURABLE cure_text = "Holy Water." - cures = list("holywater") + cures = list(/datum/reagent/water/holywater) cure_chance = 20 agent = "Avian Vengence" viable_mobtypes = list(/mob/living/carbon/human) diff --git a/code/datums/diseases/pierrot_throat.dm b/code/datums/diseases/pierrot_throat.dm index b2241d59ba..392e1bc85f 100644 --- a/code/datums/diseases/pierrot_throat.dm +++ b/code/datums/diseases/pierrot_throat.dm @@ -3,7 +3,7 @@ max_stages = 4 spread_text = "Airborne" cure_text = "Banana products, especially banana bread." - cures = list("banana") + cures = list(/datum/reagent/consumable/banana) cure_chance = 75 agent = "H0NI<42 Virus" viable_mobtypes = list(/mob/living/carbon/human) diff --git a/code/datums/diseases/retrovirus.dm b/code/datums/diseases/retrovirus.dm index fe099e495b..5854249e54 100644 --- a/code/datums/diseases/retrovirus.dm +++ b/code/datums/diseases/retrovirus.dm @@ -17,7 +17,7 @@ ..() agent = "Virus class [pick("A","B","C","D","E","F")][pick("A","B","C","D","E","F")]-[rand(50,300)]" if(prob(40)) - cures = list("mutadone") + cures = list(/datum/reagent/medicine/mutadone) else restcure = 1 diff --git a/code/datums/diseases/rhumba_beat.dm b/code/datums/diseases/rhumba_beat.dm index 52e9c2e19f..da6e7da8df 100644 --- a/code/datums/diseases/rhumba_beat.dm +++ b/code/datums/diseases/rhumba_beat.dm @@ -4,7 +4,7 @@ spread_text = "On contact" spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS cure_text = "Chick Chicky Boom!" - cures = list("plasma") + cures = list(/datum/reagent/toxin/plasma) agent = "Unknown" viable_mobtypes = list(/mob/living/carbon/human) permeability_mod = 1 diff --git a/code/datums/diseases/transformation.dm b/code/datums/diseases/transformation.dm index 083a1f9c6c..1c214c8516 100644 --- a/code/datums/diseases/transformation.dm +++ b/code/datums/diseases/transformation.dm @@ -93,7 +93,7 @@ /datum/disease/transformation/jungle_fever name = "Jungle Fever" cure_text = "Death." - cures = list("adminordrazine") + cures = list(/datum/reagent/medicine/adminordrazine) spread_text = "Monkey Bites" spread_flags = DISEASE_SPREAD_SPECIAL viable_mobtypes = list(/mob/living/carbon/monkey, /mob/living/carbon/human) @@ -156,7 +156,7 @@ name = "Robotic Transformation" cure_text = "An injection of copper." - cures = list("copper") + cures = list(/datum/reagent/copper) cure_chance = 5 agent = "R2D2 Nanomachines" desc = "This disease, actually acute nanomachine infection, converts the victim into a cyborg." @@ -189,7 +189,7 @@ name = "Xenomorph Transformation" cure_text = "Spaceacillin & Glycerol" - cures = list("spaceacillin", "glycerol") + cures = list(/datum/reagent/medicine/spaceacillin, /datum/reagent/glycerol) cure_chance = 5 agent = "Rip-LEY Alien Microbes" desc = "This disease changes the victim into a xenomorph." @@ -218,7 +218,7 @@ /datum/disease/transformation/slime name = "Advanced Mutation Transformation" cure_text = "frost oil" - cures = list("frostoil") + cures = list(/datum/reagent/consumable/frostoil) cure_chance = 80 agent = "Advanced Mutation Toxin" desc = "This highly concentrated extract converts anything into more of itself." @@ -247,7 +247,7 @@ /datum/disease/transformation/corgi name = "The Barkening" cure_text = "Death" - cures = list("adminordrazine") + cures = list(/datum/reagent/medicine/adminordrazine) agent = "Fell Doge Majicks" desc = "This disease transforms the victim into a corgi." severity = DISEASE_SEVERITY_BIOHAZARD @@ -272,7 +272,7 @@ /datum/disease/transformation/morph name = "Gluttony's Blessing" cure_text = "nothing" - cures = list("adminordrazine") + cures = list(/datum/reagent/medicine/adminordrazine) agent = "Gluttony's Blessing" desc = "A 'gift' from somewhere terrible." stage_prob = 20 @@ -289,7 +289,7 @@ /datum/disease/transformation/gondola name = "Gondola Transformation" cure_text = "Condensed Capsaicin, ingested or injected." //getting pepper sprayed doesn't help - cures = list("condensedcapsaicin") //beats the hippie crap right out of your system + cures = list(/datum/reagent/consumable/condensedcapsaicin) //beats the hippie crap right out of your system cure_chance = 80 stage_prob = 5 agent = "Tranquility" @@ -310,17 +310,17 @@ if (prob(5)) affected_mob.emote("smile") if (prob(20)) - affected_mob.reagents.add_reagent_list(list("pax" = 5)) + affected_mob.reagents.add_reagent(/datum/reagent/pax, 5) if(3) if (prob(5)) affected_mob.emote("smile") if (prob(20)) - affected_mob.reagents.add_reagent_list(list("pax" = 5)) + affected_mob.reagents.add_reagent(/datum/reagent/pax, 5) if(4) if (prob(5)) affected_mob.emote("smile") if (prob(20)) - affected_mob.reagents.add_reagent_list(list("pax" = 5)) + affected_mob.reagents.add_reagent(/datum/reagent/pax, 5) if (prob(2)) to_chat(affected_mob, "You let go of what you were holding.") var/obj/item/I = affected_mob.get_active_held_item() diff --git a/code/datums/diseases/tuberculosis.dm b/code/datums/diseases/tuberculosis.dm index 788107c4b6..23902603ce 100644 --- a/code/datums/diseases/tuberculosis.dm +++ b/code/datums/diseases/tuberculosis.dm @@ -4,7 +4,7 @@ max_stages = 5 spread_text = "Airborne" cure_text = "Spaceacillin & salbutamol" - cures = list("spaceacillin", "salbutamol") + cures = list(/datum/reagent/medicine/spaceacillin, /datum/reagent/medicine/salbutamol) agent = "Fungal Tubercle bacillus Cosmosis" viable_mobtypes = list(/mob/living/carbon/human) cure_chance = 5//like hell are you getting out of hell diff --git a/code/datums/diseases/wizarditis.dm b/code/datums/diseases/wizarditis.dm index b288046380..244cc819d8 100644 --- a/code/datums/diseases/wizarditis.dm +++ b/code/datums/diseases/wizarditis.dm @@ -3,7 +3,7 @@ max_stages = 4 spread_text = "Airborne" cure_text = "The Manly Dorf" - cures = list("manlydorf") + cures = list(/datum/reagent/consumable/ethanol/manly_dorf) cure_chance = 100 agent = "Rincewindus Vulgaris" viable_mobtypes = list(/mob/living/carbon/human) diff --git a/code/datums/elements/wuv.dm b/code/datums/elements/wuv.dm new file mode 100644 index 0000000000..84f327500f --- /dev/null +++ b/code/datums/elements/wuv.dm @@ -0,0 +1,60 @@ + +/datum/element/wuv //D'awwwww + element_flags = ELEMENT_BESPOKE + id_arg_index = 2 + //the for the me emote proc call when petted. + var/pet_emote + //whether the emote is visible or audible + var/pet_type + //same as above, except when harmed. "You are going into orbit, you stupid mutt!" + var/punt_emote + //same as pet_type + var/punt_type + //mood typepath for the moodlet signal when petted. + var/pet_moodlet + //same as above but for harm + var/punt_moodlet + +/datum/element/wuv/Attach(datum/target, pet, pet_t, pet_mood, punt, punt_t, punt_mood) + . = ..() + + if(!isliving(target)) + return ELEMENT_INCOMPATIBLE + + pet_emote = pet + pet_type = pet_t + punt_emote = punt + punt_type = punt_t + pet_moodlet = pet_mood + punt_moodlet = punt_mood + + RegisterSignal(target, COMSIG_MOB_ATTACK_HAND, .proc/on_attack_hand) + +/datum/element/wuv/proc/on_attack_hand(datum/source, mob/user) + var/mob/living/L = source + + if(L.stat == DEAD) + return + //we want to delay the effect to be displayed after the mob is petted, not before. + switch(user.a_intent) + if(INTENT_HARM, INTENT_DISARM) + addtimer(CALLBACK(src, .proc/kick_the_dog, source, user), 1) + if(INTENT_HELP) + addtimer(CALLBACK(src, .proc/pet_the_dog, source, user), 1) + +/datum/element/wuv/proc/pet_the_dog(mob/target, mob/user) + if(!QDELETED(target) || !QDELETED(user) || target.stat != CONSCIOUS) + return + new /obj/effect/temp_visual/heart(target.loc) + if(pet_emote) + target.emote("me", pet_type, pet_emote) + if(pet_moodlet && !CHECK_BITFIELD(target.flags_1, HOLOGRAM_1)) //prevents unlimited happiness petting park exploit. + SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, target, pet_moodlet, target) + +/datum/element/wuv/proc/kick_the_dog(mob/target, mob/user) + if(!QDELETED(target) || !QDELETED(user) || target.stat != CONSCIOUS) + return + if(punt_emote) + target.emote("me", punt_type, punt_emote) + if(punt_moodlet && !CHECK_BITFIELD(target.flags_1, HOLOGRAM_1)) + SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, target, punt_moodlet, target) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 5c92c83fb5..8ae45ff720 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -525,7 +525,7 @@ if(!objective) to_chat(usr,"Invalid objective.") return - //qdel(objective) Needs cleaning objective destroys + qdel(objective) //TODO: Needs cleaning objective destroys (whatever that means) message_admins("[key_name_admin(usr)] removed an objective for [current]: [objective.explanation_text]") log_admin("[key_name(usr)] removed an objective for [current]: [objective.explanation_text]") diff --git a/code/datums/mood_events/generic_positive_events.dm b/code/datums/mood_events/generic_positive_events.dm index 94fd08535f..98a8eade59 100644 --- a/code/datums/mood_events/generic_positive_events.dm +++ b/code/datums/mood_events/generic_positive_events.dm @@ -23,10 +23,13 @@ mood_change = 3 timeout = 3000 -/datum/mood_event/pet_corgi - description = "Corgis are adorable! I can't stop petting them!\n" - mood_change = 3 - timeout = 3000 +/datum/mood_event/pet_animal + description = "Animals are adorable! I can't stop petting them!\n" + mood_change = 2 + timeout = 5 MINUTES + +/datum/mood_event/pet_animal/add_effects(mob/animal) + description = "\The [animal.name] is adorable! I can't stop petting [animal.p_them()]!\n" /datum/mood_event/honk description = "Maybe clowns aren't so bad after all. Honk!\n" diff --git a/code/datums/recipe.dm b/code/datums/recipe.dm index 0ceb4443de..c4d0d6f9c6 100644 --- a/code/datums/recipe.dm +++ b/code/datums/recipe.dm @@ -88,7 +88,7 @@ var/obj/result_obj = new result(container) for (var/obj/O in (container.contents-result_obj)) if (O.reagents) - O.reagents.del_reagent("nutriment") + O.reagents.del_reagent(/datum/reagent/consumable/nutriment) O.reagents.update_total() O.reagents.trans_to(result_obj, O.reagents.total_volume) qdel(O) diff --git a/code/datums/ruins/station.dm b/code/datums/ruins/station.dm index 624081156a..e637b6178f 100644 --- a/code/datums/ruins/station.dm +++ b/code/datums/ruins/station.dm @@ -8,29 +8,29 @@ /datum/map_template/ruin/station/box/engine id = "engine_sm" suffix = "Box/Engine/engine_sm.dmm" - name = "Engine SM" + name = "Box SM" /datum/map_template/ruin/station/box/engine/onebythree id = "engine_sm_1x3" suffix = "Box/Engine/engine_sm_1x3.dmm" - name = "Engine SM 1x3" + name = "Box SM 1x3" /datum/map_template/ruin/station/box/engine/fivebyfive id = "engine_sm_5x5" suffix = "Box/Engine/engine_sm_5x5.dmm" - name = "Engine SM 5x5" + name = "Box SM 5x5" /datum/map_template/ruin/station/box/engine/threesm id = "engine_sm_3x" suffix = "Box/Engine/engine_sm_3x.dmm" - name = "Engine SM 3x" + name = "Box SM 3x" /datum/map_template/ruin/station/box/engine/singulo id = "engine_singulo" suffix = "Box/Engine/engine_singulo.dmm" - name = "Engine Singulo" + name = "Box Singulo" /datum/map_template/ruin/station/box/engine/tesla id = "engine_tesla" suffix = "Box/Engine/engine_tesla.dmm" - name = "Engine Tesla" \ No newline at end of file + name = "Box Tesla" diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index f5f012e7f9..036d8193fb 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -99,6 +99,12 @@ id = "Mesmerize" alert_type = /obj/screen/alert/status_effect/mesmerized +/datum/status_effect/no_combat_mode/mesmerize/on_apply() + ADD_TRAIT(owner, TRAIT_MUTE, "mesmerize") + +/datum/status_effect/no_combat_mode/mesmerize/on_remove() + REMOVE_TRAIT(owner, TRAIT_MUTE, "mesmerize") + /obj/screen/alert/status_effect/mesmerized name = "Mesmerized" desc = "You cant tear your sight from who is in front of you...Their gaze is simply too enthralling.." @@ -302,7 +308,7 @@ /datum/status_effect/cultghost/tick() if(owner.reagents) - owner.reagents.del_reagent("holywater") //can't be deconverted + owner.reagents.del_reagent(/datum/reagent/water/holywater) //can't be deconverted /datum/status_effect/crusher_mark id = "crusher_mark" diff --git a/code/datums/traits/negative.dm b/code/datums/traits/negative.dm index 3319259381..c5217d8e4b 100644 --- a/code/datums/traits/negative.dm +++ b/code/datums/traits/negative.dm @@ -289,7 +289,7 @@ medical_record_text = "Patient suffers from acute Reality Dissociation Syndrome and experiences vivid hallucinations." /datum/quirk/insanity/on_process() - if(quirk_holder.reagents.has_reagent("mindbreaker")) + if(quirk_holder.reagents.has_reagent(/datum/reagent/toxin/mindbreaker)) quirk_holder.hallucination = 0 return if(prob(2)) //we'll all be mad soon enough diff --git a/code/datums/traits/neutral.dm b/code/datums/traits/neutral.dm index e712a38df1..8be3174f50 100644 --- a/code/datums/traits/neutral.dm +++ b/code/datums/traits/neutral.dm @@ -122,6 +122,15 @@ gain_text = "You feel like exposing yourself to the world." lose_text = "Indecent exposure doesn't sound as charming to you anymore." +/datum/quirk/coldblooded + name = "Cold-blooded" + desc = "Your body doesn't create its own internal heat, requiring external heat regulation." + value = 0 + medical_record_text = "Patient is ectothermic." + mob_trait = TRAIT_COLDBLOODED + gain_text = "You feel cold-blooded." + lose_text = "You feel more warm-blooded." + /datum/quirk/alcohol_intolerance name = "Alcohol Intolerance" desc = "You take toxin damage from alcohol rather than getting drunk." diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index 0c43d33a4b..e01b525e02 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -25,16 +25,16 @@ var/key_valid var/require_comms_key = FALSE -/datum/world_topic/proc/TryRun(list/input) +/datum/world_topic/proc/TryRun(list/input, addr) key_valid = config && (CONFIG_GET(string/comms_key) == input["key"]) if(require_comms_key && !key_valid) return "Bad Key" input -= "key" - . = Run(input) + . = Run(input, addr) if(islist(.)) . = list2params(.) -/datum/world_topic/proc/Run(list/input) +/datum/world_topic/proc/Run(list/input, addr) CRASH("Run() not implemented for [type]!") // TOPICS @@ -43,7 +43,7 @@ keyword = "ping" log = FALSE -/datum/world_topic/ping/Run(list/input) +/datum/world_topic/ping/Run(list/input, addr) . = 0 for (var/client/C in GLOB.clients) ++. @@ -52,7 +52,7 @@ keyword = "playing" log = FALSE -/datum/world_topic/playing/Run(list/input) +/datum/world_topic/playing/Run(list/input, addr) return GLOB.player_list.len /datum/world_topic/pr_announce @@ -60,7 +60,7 @@ require_comms_key = TRUE var/static/list/PRcounts = list() //PR id -> number of times announced this round -/datum/world_topic/pr_announce/Run(list/input) +/datum/world_topic/pr_announce/Run(list/input, addr) var/list/payload = json_decode(input["payload"]) var/id = "[payload["pull_request"]["id"]]" if(!PRcounts[id]) @@ -78,14 +78,14 @@ keyword = "Ahelp" require_comms_key = TRUE -/datum/world_topic/ahelp_relay/Run(list/input) +/datum/world_topic/ahelp_relay/Run(list/input, addr) relay_msg_admins("HELP: [input["source"]] [input["message_sender"]]: [input["message"]]") /datum/world_topic/comms_console keyword = "Comms_Console" require_comms_key = TRUE -/datum/world_topic/comms_console/Run(list/input) +/datum/world_topic/comms_console/Run(list/input, addr) minor_announce(input["message"], "Incoming message from [input["message_sender"]]") for(var/obj/machinery/computer/communications/CM in GLOB.machines) CM.overrideCooldown() @@ -94,17 +94,17 @@ keyword = "News_Report" require_comms_key = TRUE -/datum/world_topic/news_report/Run(list/input) +/datum/world_topic/news_report/Run(list/input, addr) minor_announce(input["message"], "Breaking Update From [input["message_sender"]]") /datum/world_topic/server_hop keyword = "server_hop" -/datum/world_topic/server_hop/Run(list/input) +/datum/world_topic/server_hop/Run(list/input, addr) var/expected_key = input[keyword] for(var/mob/dead/observer/O in GLOB.player_list) if(O.key == expected_key) - if(O.client) + if(O.client?.address == addr) new /obj/screen/splash(O.client, TRUE) break @@ -112,14 +112,14 @@ keyword = "adminmsg" require_comms_key = TRUE -/datum/world_topic/adminmsg/Run(list/input) +/datum/world_topic/adminmsg/Run(list/input, addr) return IrcPm(input[keyword], input["msg"], input["sender"]) /datum/world_topic/namecheck keyword = "namecheck" require_comms_key = TRUE -/datum/world_topic/namecheck/Run(list/input) +/datum/world_topic/namecheck/Run(list/input, addr) //Oh this is a hack, someone refactor the functionality out of the chat command PLS var/datum/tgs_chat_command/namecheck/NC = new var/datum/tgs_chat_user/user = new @@ -131,13 +131,13 @@ keyword = "adminwho" require_comms_key = TRUE -/datum/world_topic/adminwho/Run(list/input) +/datum/world_topic/adminwho/Run(list/input, addr) return ircadminwho() /datum/world_topic/status keyword = "status" -/datum/world_topic/status/Run(list/input) +/datum/world_topic/status/Run(list/input, addr) . = list() .["version"] = GLOB.game_version .["mode"] = "hidden" //CIT CHANGE - hides the gamemode in topic() calls to prevent meta'ing the gamemode diff --git a/code/game/gamemodes/bloodsucker/bloodsucker.dm b/code/game/gamemodes/bloodsucker/bloodsucker.dm index e784fd836d..ca2ebfe00d 100644 --- a/code/game/gamemodes/bloodsucker/bloodsucker.dm +++ b/code/game/gamemodes/bloodsucker/bloodsucker.dm @@ -9,6 +9,8 @@ var/list/vassal_allowed_antags = list(/datum/antagonist/brother, /datum/antagonist/traitor, /datum/antagonist/traitor/internal_affairs, /datum/antagonist/survivalist, \ /datum/antagonist/rev, /datum/antagonist/nukeop, /datum/antagonist/pirate, /datum/antagonist/cult, /datum/antagonist/abductee) // The antags you're allowed to be if turning Vassal. +/proc/isvamp(mob/living/M) + return istype(M) && M.mind && M.mind.has_antag_datum(/datum/antagonist/bloodsucker) /datum/game_mode/bloodsucker name = "bloodsucker" diff --git a/code/game/gamemodes/clown_ops/clown_weapons.dm b/code/game/gamemodes/clown_ops/clown_weapons.dm index 9b52ddda1e..0945875ac9 100644 --- a/code/game/gamemodes/clown_ops/clown_weapons.dm +++ b/code/game/gamemodes/clown_ops/clown_weapons.dm @@ -8,7 +8,7 @@ spray_range = 1 stream_range = 1 volume = 30 - list_reagents = list("lube" = 30) + list_reagents = list(/datum/reagent/lube = 30) //COMBAT CLOWN SHOES //Clown shoes with combat stats and noslip. Of course they still squeak. @@ -165,7 +165,7 @@ customfoodfilling = FALSE seed = null tastes = list("explosives" = 10) - list_reagents = list("vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 1) /obj/item/grown/bananapeel/bombanana desc = "A peel from a banana. Why is it beeping?" diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 520721560a..4fd4a7929d 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -14,14 +14,14 @@ circuit = /obj/item/circuitboard/machine/sleeper req_access = list(ACCESS_CMO) //Used for reagent deletion and addition of non medicines var/efficiency = 1 - var/min_health = -25 + var/min_health = 30 var/list/available_chems var/controls_inside = FALSE var/list/possible_chems = list( - list("epinephrine", "morphine", "salbutamol", "bicaridine", "kelotane"), - list("oculine","inacusiate"), - list("antitoxin", "mutadone", "mannitol", "pen_acid"), - list("omnizine") + list(/datum/reagent/medicine/epinephrine, /datum/reagent/medicine/morphine, /datum/reagent/medicine/salbutamol, /datum/reagent/medicine/bicaridine, /datum/reagent/medicine/kelotane), + list(/datum/reagent/medicine/oculine,/datum/reagent/medicine/inacusiate), + list(/datum/reagent/medicine/antitoxin, /datum/reagent/medicine/mutadone, /datum/reagent/medicine/mannitol, /datum/reagent/medicine/pen_acid), + list(/datum/reagent/medicine/omnizine) ) var/list/chem_buttons //Used when emagged to scramble which chem is used, eg: antitoxin -> morphine var/scrambled_chems = FALSE //Are chem buttons scrambled? used as a warning @@ -106,7 +106,7 @@ return if(is_operational() && occupant) var/datum/reagent/R = pick(reagents.reagent_list) - inject_chem(R.id, occupant) + inject_chem(R.type, occupant) open_machine() //Is this too much? if(severity == EMP_HEAVY) @@ -217,9 +217,9 @@ for(var/chem in available_chems) var/datum/reagent/R = reagents.has_reagent(chem) R = GLOB.chemical_reagents_list[chem] - data["synthchems"] += list(list("name" = R.name, "id" = R.id, "synth_allowed" = synth_allowed(chem))) + data["synthchems"] += list(list("name" = R.name, "id" = R.type, "synth_allowed" = synth_allowed(chem))) for(var/datum/reagent/R in reagents.reagent_list) - data["chems"] += list(list("name" = R.name, "id" = R.id, "vol" = R.volume, "purity" = R.purity, "allowed" = chem_allowed(R.id))) + data["chems"] += list(list("name" = R.name, "id" = R.type, "vol" = R.volume, "purity" = R.purity, "allowed" = chem_allowed(R.type))) data["occupant"] = list() var/mob/living/mob_occupant = occupant @@ -289,23 +289,23 @@ open_machine() . = TRUE if("inject") - var/chem = params["chem"] + var/chem = text2path(params["chem"]) var/amount = text2num(params["volume"]) - if(!is_operational() || !mob_occupant) + if(!is_operational() || !mob_occupant || isnull(chem)) return - if(mob_occupant.health < min_health && chem != "epinephrine") + if(mob_occupant.health < min_health && chem != /datum/reagent/medicine/epinephrine) return if(inject_chem(chem, usr, amount)) . = TRUE if(scrambled_chems && prob(5)) to_chat(usr, "Chemical system re-route detected, results may not be as expected!") if("synth") - var/chem = params["chem"] + var/chem = text2path(params["chem"]) if(!is_operational()) return reagents.add_reagent(chem_buttons[chem], 10) //other_purity = 0.75 for when the mechanics are in if("purge") - var/chem = params["chem"] + var/chem = text2path(params["chem"]) if(allowed(usr)) if(!is_operational()) return @@ -342,7 +342,7 @@ if(!mob_occupant || !mob_occupant.reagents) return var/amount = mob_occupant.reagents.get_reagent_amount(chem) + 10 <= 20 * efficiency - var/occ_health = mob_occupant.health > min_health || chem == "epinephrine" + var/occ_health = mob_occupant.health > min_health || chem == /datum/reagent/medicine/epinephrine return amount && occ_health /obj/machinery/sleeper/proc/synth_allowed(chem) diff --git a/code/game/machinery/bloodbankgen.dm b/code/game/machinery/bloodbankgen.dm index c92e55084d..948e9b98f9 100644 --- a/code/game/machinery/bloodbankgen.dm +++ b/code/game/machinery/bloodbankgen.dm @@ -123,15 +123,15 @@ if(reagents.total_volume >= reagents.maximum_volume || !bag || !bag.reagents.total_volume) beep_stop_pumping() return - var/blood_amount = bag.reagents.get_reagent_amount("blood") + var/blood_amount = bag.reagents.get_reagent_amount(/datum/reagent/blood) //monitor the machine and blood bag's reagents storage. var/amount = min(blood_amount, min(transfer_amount, reagents.maximum_volume - reagents.total_volume)) if(!amount) beep_stop_pumping() return var/bonus = bag.blood_type == "SY" ? 0 : 5 * efficiency //no infinite loops using synthetics. - reagents.add_reagent("syntheticblood", amount + bonus) - bag.reagents.remove_reagent("blood", amount) + reagents.add_reagent(/datum/reagent/blood/synthetics, amount + bonus) + bag.reagents.remove_reagent(/datum/reagent/blood, amount) update_icon() if(filling) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index e683d67be2..97b260f3bf 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -155,6 +155,8 @@ mess = TRUE update_icon() return FALSE + if(isvamp(clonemind)) //If the mind is a bloodsucker + return FALSE attempting = TRUE //One at a time!! countdown.start() diff --git a/code/game/machinery/computer/dna_console.dm b/code/game/machinery/computer/dna_console.dm index 394cc4593d..7330ae26e7 100644 --- a/code/game/machinery/computer/dna_console.dm +++ b/code/game/machinery/computer/dna_console.dm @@ -88,7 +88,7 @@ occupant_status += "" occupant_status += "