From af416c71a73099c9e05634cb769de51cadcbb568 Mon Sep 17 00:00:00 2001 From: Flleeppyy Date: Sun, 1 Sep 2024 21:27:20 -0700 Subject: [PATCH] commiting some shit --- code/game/world.dm | 2 +- .../code/controllers/subsystem/plexora.dm | 106 +++++++++++++++++- .../code/modules/blueshift/uplinks/kits.dm | 2 +- .../modules/code_redemption/code_generator.dm | 99 +++++++++------- monkestation/code/modules/mentor/mentor_pm.dm | 4 +- .../virology/disease/symtoms/stage1.dm | 2 +- 6 files changed, 167 insertions(+), 48 deletions(-) diff --git a/code/game/world.dm b/code/game/world.dm index cc22d04cdf7a..6b0dde0e5db0 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -300,7 +300,7 @@ GLOBAL_VAR(restart_counter) log_admin("[key_name(usr)] Has requested an immediate world restart via client side debugging tools") message_admins("[key_name_admin(usr)] Has requested an immediate world restart via client side debugging tools") to_chat(world, span_boldannounce("Rebooting World immediately due to host request.")) - SSplexora.Shutdown(TRUE) // Monkestation edit: plexora + SSplexora.Shutdown(TRUE, usr ? key_name(usr) : null) // Monkestation edit: plexora else to_chat(world, span_boldannounce("Rebooting world...")) Master.Shutdown() //run SS shutdowns diff --git a/monkestation/code/controllers/subsystem/plexora.dm b/monkestation/code/controllers/subsystem/plexora.dm index 551e9e0bb293..9e9a6e4c679d 100644 --- a/monkestation/code/controllers/subsystem/plexora.dm +++ b/monkestation/code/controllers/subsystem/plexora.dm @@ -122,7 +122,7 @@ SUBSYSTEM_DEF(plexora) request.begin_async() UNTIL(request.is_complete()) -/datum/controller/subsystem/plexora/Shutdown(hard = FALSE) +/datum/controller/subsystem/plexora/Shutdown(hard = FALSE, requestedby) var/list/body = list(); body["type"] = "servershutdown" body["timestamp"] = rustg_unix_timestamp() @@ -132,6 +132,9 @@ SUBSYSTEM_DEF(plexora) body["playercount"] = length(GLOB.clients) body["hard"] = hard + if (!isnull(requestedby)) + body["requestedby"] = requestedby + http_basicasync("serverupdates", body) /datum/controller/subsystem/plexora/proc/serverstarted() @@ -408,6 +411,27 @@ SUBSYSTEM_DEF(plexora) return mentors +/datum/world_topic/plx_getloadoutrewards + keyword = "PLX_getloadoutrewards" + require_comms_key = TRUE + +/datum/world_topic/plx_getloadoutrewards/Run(list/input) + return subtypesof(/datum/store_item) - typesof(/datum/store_item/roundstart) + +/datum/world_topic/plx_getunusualitems + keyword = "PLX_getunusualitems" + require_comms_key = TRUE + +/datum/world_topic/plx_getunusualitems/Run(list/input) + return GLOB.possible_lootbox_clothing + +/datum/world_topic/get_unusualeffects + keyword = "PLX_getunusualeffects" + require_comms_key = TRUE + +/datum/world_topic/get_unusualeffects/Run(list/input) + return subtypesof(/datum/component/particle_spewer) - /datum/component/particle_spewer/movement + /datum/world_topic/plx_getsmites keyword = "PLX_getsmites" require_comms_key = TRUE @@ -534,6 +558,86 @@ SUBSYSTEM_DEF(plexora) return returning +/datum/world_topic/plx_generategiveawaycodes + keyword = "PLX_generategiveawaycodes" + require_comms_key = TRUE + +/datum/world_topic/plx_generategiveawaycodes/Run(list/input) + var/type = input["type"] + var/codeamount = input["limit"] + + var/codes = list() + + if (type == "loadout" && !input["loadout"]) + return + + for (var/i in 1 to codeamount) + var/code + var/returning = list("type" = type) + + switch(type) + if ("coin") + var/amount = input["amount"] + if (!amount) + amount = 5000 + returning["amount"] = amount + code = generate_coin_code(amount, TRUE) + if ("loadout") + var/loadout = input["loadout"] + //we are not chosing a random one for this, you MUST specify + if (!loadout) return + returning["loadout"] = loadout + code = generate_loadout_code(loadout, TRUE) + if ("antagtoken") + var/tokentype = input["antagtoken"] + if (!tokentype) + tokentype = LOW_THREAT + code = generate_antag_token_code(tokentype, TRUE) + if ("unusual") + var/item = input["unusual_item"] + var/effect = input["unusual_effect"] + if (!item) + item = pick(GLOB.possible_lootbox_clothing) + if (!effect) + var/static/list/possible_effects = subtypesof(/datum/component/particle_spewer) - /datum/component/particle_spewer/movement + effect = pick(possible_effects) + returning["item"] = item + returning["effect"] = effect + code = generate_unusual_code(item, effect, TRUE) + codes += code + return codes + +/datum/world_topic/plx_givecoins + keyword = "PLX_givecoins" + require_comms_key = TRUE + +/datum/world_topic/plx_givecoins/Run(list/input) + var/ckey = input["ckey"] + var/amount = input["amount"] + var/reason = input["reason"] + + var/client/userclient = disambiguate_client(ckey) + + var/datum/preferences/prefs + if (isnull(userclient)) + var/datum/client_interface/mock_player = new(ckey) + mock_player.prefs = new /datum/preferences(mock_player) + + prefs = mock_player.prefs + else + prefs = userclient.prefs + + prefs.adjust_metacoins(ckey, amount, reason, donator_multipler = FALSE, respects_roundcap = FALSE, announces = FALSE) + + return list("totalcoins" = prefs.metacoins) + +/datum/world_topic/plx_generategiveawaycode + keyword = "PLX_generategiveawaycode" + require_comms_key = TRUE + +/datum/world_topic/plx_generategiveawaycode/Run(list/input) + + /datum/world_topic/plx_forceemote keyword = "PLX_forceemote" require_comms_key = TRUE diff --git a/monkestation/code/modules/blueshift/uplinks/kits.dm b/monkestation/code/modules/blueshift/uplinks/kits.dm index d5fffcafd9b9..3e8b20bc6ca8 100644 --- a/monkestation/code/modules/blueshift/uplinks/kits.dm +++ b/monkestation/code/modules/blueshift/uplinks/kits.dm @@ -19,7 +19,7 @@ name = "M-90gl Carbine Case (Hard)" desc = "A fully-loaded, specialized three-round burst carbine that fires .223 ammunition from a 30 round magazine \ with a 40mm underbarrel grenade launcher. Use secondary-fire to fire the grenade launcher. Comes with two spare magazines \ - and a box of 40mm rubber slugs." + and a box of 40mm HE." item = /obj/item/storage/toolbox/guncase/m90gl cost = 14 diff --git a/monkestation/code/modules/code_redemption/code_generator.dm b/monkestation/code/modules/code_redemption/code_generator.dm index ef1feffbbc17..25fca4d6b9af 100644 --- a/monkestation/code/modules/code_redemption/code_generator.dm +++ b/monkestation/code/modules/code_redemption/code_generator.dm @@ -13,18 +13,64 @@ GLOBAL_LIST_INIT(stored_codes, list()) switch(choice) if("Coins") - generate_coin_code() + generate_coin_code_tgui() if("Loadout Items") - generate_loadout_code() + generate_loadout_code_tgui() if("Antag Tokens") - generate_antag_token_code() + generate_antag_token_code_tgui() if("Unusual") - generate_unsual_code() + generate_unusual_code_tgui() -/proc/generate_coin_code(no_logs = FALSE) +/proc/generate_coin_code_tgui(no_logs = FALSE) if(!check_rights(R_FUN)) return var/amount = tgui_input_number(usr, "Please enter an amount of coins to give", "Coin Amount", 0, 10000, 0) + if(!amount) + return + return generate_coin_code(amount, no_logs) + +/proc/generate_loadout_code_tgui(no_logs = FALSE) + if(!check_rights(R_FUN)) + return + var/choice = tgui_input_list(usr, "Please choose a loadout item to award", "Loadout Choice", subtypesof(/datum/store_item) - typesof(/datum/store_item/roundstart)) + if(!choice) + return + return generate_loadout_code(choice, no_logs) + +/proc/generate_antag_token_code_tgui(no_logs = FALSE) + if(!check_rights(R_FUN)) + return + var/choice = tgui_input_list(usr, "Please choose an antag token level to award", "Token Choice", list(HIGH_THREAT, MEDIUM_THREAT, LOW_THREAT)) + if(!choice) + return + return generate_antag_token_code(choice, no_logs) + +/proc/generate_unusual_code_tgui(no_logs = FALSE) + if(!check_rights(R_FUN)) + return + var/item_choice = tgui_alert(usr, "Should it be a random item?", "Loadout Choice", list("Yes", "No")) + if(!item_choice) + return + if(item_choice == "Yes") + item_choice = pick(GLOB.possible_lootbox_clothing) + else + item_choice = tgui_input_list(usr, "Please choose a loadout item to award", "Loadout Choice", GLOB.possible_lootbox_clothing) + if(!item_choice || !ispath(item_choice)) + return + + var/effect_choice = tgui_alert(usr, "Should it be a random effect?", "Loadout Choice", list("Yes", "No")) + if(!effect_choice) + return + var/static/list/possible_effects = subtypesof(/datum/component/particle_spewer) - /datum/component/particle_spewer/movement + if(effect_choice == "Yes") + effect_choice = pick(possible_effects) + else + effect_choice = tgui_input_list(usr, "Please choose an effect to give the item.", "Loadout Choice", possible_effects) + if(!effect_choice || !ispath(effect_choice)) + return + return generate_unusual_code(item_choice, effect_choice, no_logs) + +/proc/generate_coin_code(amount, no_logs = FALSE) if(!amount) return var/string = generate_code_string() @@ -48,10 +94,7 @@ GLOBAL_LIST_INIT(stored_codes, list()) to_chat(usr, span_big("Your generated code is: [string]")) return string -/proc/generate_loadout_code(no_logs = FALSE) - if(!check_rights(R_FUN)) - return - var/choice = tgui_input_list(usr, "Please choose a loadout item to award", "Loadout Choice", subtypesof(/datum/store_item) - typesof(/datum/store_item/roundstart)) +/proc/generate_loadout_code(choice, no_logs = FALSE) if(!choice) return reload_global_stored_codes() @@ -76,12 +119,7 @@ GLOBAL_LIST_INIT(stored_codes, list()) to_chat(usr, span_big("Your generated code is: [string]")) return string -/proc/generate_antag_token_code(no_logs = FALSE) - if(!check_rights(R_FUN)) - return - var/choice = tgui_input_list(usr, "Please choose an antag token level to award", "Token Choice", list(HIGH_THREAT, MEDIUM_THREAT, LOW_THREAT)) - if(!choice) - return +/proc/generate_antag_token_code(choice, no_logs = FALSE) var/string = generate_code_string() var/json_file = file(CODE_STORAGE_PATH) @@ -104,30 +142,7 @@ GLOBAL_LIST_INIT(stored_codes, list()) to_chat(usr, span_big("Your generated code is: [string]")) return string -/proc/generate_unsual_code(no_logs = FALSE) - if(!check_rights(R_FUN)) - return - var/item_choice = tgui_alert(usr, "Should it be a random item?", "Loadout Choice", list("Yes", "No")) - if(!item_choice) - return - if(item_choice == "Yes") - item_choice = pick(GLOB.possible_lootbox_clothing) - else - item_choice = tgui_input_list(usr, "Please choose a loadout item to award", "Loadout Choice", GLOB.possible_lootbox_clothing) - if(!item_choice || !ispath(item_choice)) - return - - var/effect_choice = tgui_alert(usr, "Should it be a random effect?", "Loadout Choice", list("Yes", "No")) - if(!effect_choice) - return - var/static/list/possible_effects = subtypesof(/datum/component/particle_spewer) - /datum/component/particle_spewer/movement - if(effect_choice == "Yes") - effect_choice = pick(possible_effects) - else - effect_choice = tgui_input_list(usr, "Please choose an effect to give the item.", "Loadout Choice", possible_effects) - if(!effect_choice || !ispath(effect_choice)) - return - +/proc/generate_unusual_code(item_choice, effect_choice, no_logs = FALSE) reload_global_stored_codes() var/string = generate_code_string() @@ -181,11 +196,11 @@ GLOBAL_LIST_INIT(stored_codes, list()) var/list/generated_codes = list() for(var/num in 1 to amount) if(choice == "Coins") - generated_codes += generate_coin_code(TRUE) + generated_codes += generate_coin_code_tgui(TRUE) else if(choice == "Loadout Items") - generated_codes += generate_loadout_code(TRUE) + generated_codes += generate_loadout_code_tgui(TRUE) else - generated_codes += generate_antag_token_code(TRUE) + generated_codes += generate_antag_token_code_tgui(TRUE) log_game("[usr] generated [amount] new redemption codes.") message_admins("[usr] generated a new redemption codes.") diff --git a/monkestation/code/modules/mentor/mentor_pm.dm b/monkestation/code/modules/mentor/mentor_pm.dm index d653a444aa0e..7edf248dc35f 100644 --- a/monkestation/code/modules/mentor/mentor_pm.dm +++ b/monkestation/code/modules/mentor/mentor_pm.dm @@ -31,7 +31,7 @@ var/datum/request/request = GLOB.mentor_requests.requests[ckey][length(GLOB.mentor_requests.requests[ckey])] if(request) id = "[request.id]" - SSplexora.mticket_pm(request, usr, msg) + SSplexora.mticket_pm(request, src.mob, usr, msg) var/regular_webhook_url = CONFIG_GET(string/regular_mentorhelp_webhook_url) if(regular_webhook_url) @@ -61,7 +61,7 @@ var/datum/request/request = GLOB.mentor_requests.requests[ckey][length(GLOB.mentor_requests.requests[ckey])] if(request) id = "[request.id]" - SSplexora.mticket_pm(request, usr, msg) + SSplexora.mticket_pm(request, src.mob, usr, msg) var/regular_webhook_url = CONFIG_GET(string/regular_mentorhelp_webhook_url) if(regular_webhook_url) diff --git a/monkestation/code/modules/virology/disease/symtoms/stage1.dm b/monkestation/code/modules/virology/disease/symtoms/stage1.dm index 1a8154e1e0fb..d00fb72bd8db 100644 --- a/monkestation/code/modules/virology/disease/symtoms/stage1.dm +++ b/monkestation/code/modules/virology/disease/symtoms/stage1.dm @@ -150,7 +150,7 @@ /datum/symptom/wendigo_warning name = "Fullness Syndrome" - desc = "An unsual symptom that causes the infected to feel hungry, even after eating." + desc = "An unusual symptom that causes the infected to feel hungry, even after eating." stage = 1 badness = EFFECT_DANGER_ANNOYING var/list/host_messages = list(