From 75cb146205cae25f1fd6909ca90c19772d26a320 Mon Sep 17 00:00:00 2001 From: Lexanx <61974560+Lexanx@users.noreply.github.com> Date: Wed, 27 Mar 2024 20:32:32 +0300 Subject: [PATCH 1/4] Doctor's Mistake (#2051) --- mods/global_modpacks.dm | 1 + mods/surgery/README.md | 74 ++++++++++++++++++++++++++++++++++++ mods/surgery/_surgery.dm | 4 ++ mods/surgery/_surgery.dme | 8 ++++ mods/surgery/code/surgery.dm | 5 +++ 5 files changed, 92 insertions(+) create mode 100644 mods/surgery/README.md create mode 100644 mods/surgery/_surgery.dm create mode 100644 mods/surgery/_surgery.dme create mode 100644 mods/surgery/code/surgery.dm diff --git a/mods/global_modpacks.dm b/mods/global_modpacks.dm index 601f025ecba54..7ae1b7c1fa410 100644 --- a/mods/global_modpacks.dm +++ b/mods/global_modpacks.dm @@ -19,6 +19,7 @@ #include "nyc_posters/_nyc_posters.dme" #include "ssinput/_ssinput.dme" #include "statusbar/_statusbar.dme" +#include "surgery/_surgery.dme" #include "unathi/_unathi.dme" #include "utf8/_utf8.dme" #include "utility_items/_utility_items.dme" diff --git a/mods/surgery/README.md b/mods/surgery/README.md new file mode 100644 index 0000000000000..fb07d992b8e58 --- /dev/null +++ b/mods/surgery/README.md @@ -0,0 +1,74 @@ + +#### Список PRов: + +- https://github.com/SierraBay/SierraBay12/pull/2051 + + + +## Мод-пример + +ID мода: MODPACK_SURGERY + + +### Описание мода + +Добавляет проверку на одежду при проведении операция + + +### Изменения *кор кода* + +- `code\modules\surgery\surgery.dm`: `/singleton/surgery_step/proc/success_chance` + + +### Оверрайды + + + +### Дефайны + + + +### Используемые файлы, не содержащиеся в модпаке + + + +### Авторы: + +Lexanx + diff --git a/mods/surgery/_surgery.dm b/mods/surgery/_surgery.dm new file mode 100644 index 0000000000000..571948afd507b --- /dev/null +++ b/mods/surgery/_surgery.dm @@ -0,0 +1,4 @@ +/singleton/modpack/syrgery + name = "Хирургия" + desc = "Сюда следует помещать все изменения связанные с хирургией в коде." + author = "Lexanx" diff --git a/mods/surgery/_surgery.dme b/mods/surgery/_surgery.dme new file mode 100644 index 0000000000000..08723c443f289 --- /dev/null +++ b/mods/surgery/_surgery.dme @@ -0,0 +1,8 @@ +#ifndef MODPACK_SURGERY +#define MODPACK_SURGERY + +#include "_surgery.dm" + +#include "code/surgery.dm" + +#endif diff --git a/mods/surgery/code/surgery.dm b/mods/surgery/code/surgery.dm new file mode 100644 index 0000000000000..132fb9a69d768 --- /dev/null +++ b/mods/surgery/code/surgery.dm @@ -0,0 +1,5 @@ +/singleton/surgery_step/success_chance(mob/living/user, mob/living/carbon/human/target, obj/item/tool, target_zone) + .=..() + var/obj/item/I = target.get_covering_equipped_item_by_zone(target_zone) + if(I && (I.body_parts_covered)) + . -= 30 From d9a9758c8d29538f2404963e60573f1e5bd80878 Mon Sep 17 00:00:00 2001 From: ddorou <155924453+ddorou@users.noreply.github.com> Date: Wed, 27 Mar 2024 20:50:17 +0300 Subject: [PATCH 2/4] fix welding augment (#2070) --- maps/sierra/items/items.dm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/maps/sierra/items/items.dm b/maps/sierra/items/items.dm index 62242485277d1..0aca9ea868838 100644 --- a/maps/sierra/items/items.dm +++ b/maps/sierra/items/items.dm @@ -546,3 +546,10 @@ Passports /material/wood sheet_icon_base = "sheet-wood" + +/obj/item/clothing/glasses/glare_dampeners + flash_protection = FLASH_PROTECTION_MAJOR + tint = TINT_HEAVY + +/obj/item/organ/internal/augment/active/item/glare_dampeners + desc = "Thick, tinted lenses installed in your head can deploy over your eyes, reducing visibility but providing protection from welding glare and bright lights." From 80dd03b2654f1bc7c3b18742aac0a7ca273022e2 Mon Sep 17 00:00:00 2001 From: UEDCommander <52104104+UEDCommander@users.noreply.github.com> Date: Wed, 27 Mar 2024 22:06:28 +0300 Subject: [PATCH 3/4] Air Alarm hotfix (#2072) --- code/game/machinery/alarm/alarm.dm | 130 +++++++++++++++++------------ html/changelogs/.all_changelog.yml | 7 ++ 2 files changed, 82 insertions(+), 55 deletions(-) diff --git a/code/game/machinery/alarm/alarm.dm b/code/game/machinery/alarm/alarm.dm index 02b4249d49cb7..ab619c0df2f80 100644 --- a/code/game/machinery/alarm/alarm.dm +++ b/code/game/machinery/alarm/alarm.dm @@ -1,7 +1,7 @@ /singleton/environment_data var/list/important_gasses = list( - GAS_OXYGEN = TRUE, - GAS_NITROGEN = TRUE, + GAS_OXYGEN = TRUE, + GAS_NITROGEN = TRUE, GAS_CO2 = TRUE ) var/list/dangerous_gasses = list( @@ -15,11 +15,20 @@ GAS_PHORON ) -/singleton/environment_data/finnish/Initialize() - . = ..() - important_gasses[GAS_STEAM] = TRUE - dangerous_gasses -= GAS_STEAM - +/singleton/environment_data/finnish + important_gasses = list( + GAS_OXYGEN = TRUE, + GAS_NITROGEN = TRUE, + GAS_CO2 = TRUE, + GAS_STEAM = TRUE + ) + filter_gasses = list( + GAS_OXYGEN, + GAS_NITROGEN, + GAS_CO2, + GAS_N2O, + GAS_PHORON + ) //////////////////////////////////////// //CONTAINS: Air Alarms and Fire Alarms// @@ -99,8 +108,10 @@ var/datum/radio_frequency/radio_connection - var/list/TLV = list() - var/list/trace_gas = list() //list of other gases that this air alarm is able to detect + /// Lazy list of danger groups by environment criteria like temperature, pressure, specific gas etc. + /// Has following structure: criteria => list(danger_group_1, danger_group_2, danger_group_3, danger_group_4) + var/list/TLV + var/list/trace_gas var/danger_level = 0 var/pressure_dangerlevel = 0 @@ -111,12 +122,16 @@ var/environment_type = /singleton/environment_data var/report_danger_level = 1 - //Used to cache the previous gas mixture result, and evaluate if we can skip processing or not - var/previous_environment_group_multiplier = null - var/previous_environment_temperature = null - var/previous_environment_total_moles = null - var/previous_environment_volume = null - var/list/previous_environment_gas = list() + /// Cached previous environment group multiplier + var/previous_environment_group_multiplier + /// Cached previous environment temperature + var/previous_environment_temperature + /// Cached previous environment total moles + var/previous_environment_total_moles + /// Cached previous environment volume + var/previous_environment_volume + /// Lazy list of cached previus enrironment gases as: gas_id => amount of moles + var/list/previous_environment_gas /obj/machinery/alarm/Destroy() unregister_radio(src, frequency) @@ -126,7 +141,7 @@ ..(loc) if(dir) - src.set_dir(dir) + set_dir(dir) if(istype(frame)) buildstage = 0 @@ -143,12 +158,15 @@ if (name == "alarm") SetName("[alarm_area.name] Air Alarm") + LAZYINITLIST(TLV) + LAZYINITLIST(trace_gas) + // breathable air according to human/Life() - TLV[GAS_OXYGEN] = list(16, 19, 135, 140) // Partial pressure, kpa + TLV[GAS_OXYGEN] = list(16, 19, 135, 140) // Partial pressure, kpa TLV[GAS_CO2] = list(-1.0, -1.0, 5, 10) // Partial pressure, kpa - TLV["other"] = list(-1.0, -1.0, 0.2, 0.5) // Partial pressure, kpa - TLV["pressure"] = list(ONE_ATMOSPHERE*0.80,ONE_ATMOSPHERE*0.90,ONE_ATMOSPHERE*1.10,ONE_ATMOSPHERE*1.20) /* kpa */ - TLV["temperature"] = list(T0C-26, T0C, T0C+40, T0C+66) // K + TLV["other"] = list(-1.0, -1.0, 0.2, 0.5) // Partial pressure, kpa + TLV["pressure"] = list(ONE_ATMOSPHERE * 0.80, ONE_ATMOSPHERE * 0.90, ONE_ATMOSPHERE * 1.10, ONE_ATMOSPHERE * 1.20) /* kpa */ + TLV["temperature"] = list(T0C-26, T0C, T0C+40, T0C+66) // K var/singleton/environment_data/env_info = GET_SINGLETON(environment_type) @@ -177,30 +195,11 @@ if(environment.return_pressure() > ONE_ATMOSPHERE*0.05) handle_heating_cooling(environment) - var/is_same_environment = TRUE - for(var/gas_id in environment.gas) - if(environment.gas[gas_id] != previous_environment_gas[gas_id]) - is_same_environment = FALSE - previous_environment_gas = environment.gas.Copy() - break - - if(is_same_environment) - if((environment.temperature != previous_environment_temperature) ||\ - (environment.group_multiplier != previous_environment_group_multiplier) ||\ - (environment.total_moles != previous_environment_total_moles) ||\ - (environment.volume != previous_environment_volume) - ) - is_same_environment = FALSE - previous_environment_group_multiplier = environment.group_multiplier - previous_environment_temperature = environment.temperature - previous_environment_total_moles = environment.total_moles - previous_environment_volume = environment.volume - - if(is_same_environment) + if(is_same_environment(environment)) return var/old_level = danger_level - danger_level = get_overall_danger_level(environment) + danger_level = get_max_danger_level(environment) if (old_level != danger_level) if(danger_level == 2) @@ -252,6 +251,28 @@ else if(dev_type == "AVP") alarm_area.air_vent_info[id_tag] = signal.data +/obj/machinery/alarm/proc/is_same_environment(datum/gas_mixture/environment) + if(length(previous_environment_gas) != length(environment.gas)) + return FALSE + + for(var/gas_id in environment.gas) + if(environment.gas[gas_id] != previous_environment_gas[gas_id]) + previous_environment_gas = environment.gas.Copy() + return FALSE + + if((environment.temperature != previous_environment_temperature) || \ + (environment.group_multiplier != previous_environment_group_multiplier) || \ + (environment.total_moles != previous_environment_total_moles) || \ + (environment.volume != previous_environment_volume) + ) + previous_environment_group_multiplier = environment.group_multiplier + previous_environment_temperature = environment.temperature + previous_environment_total_moles = environment.total_moles + previous_environment_volume = environment.volume + return FALSE + + return TRUE + /obj/machinery/alarm/proc/handle_heating_cooling(datum/gas_mixture/environment) var/danger_level = get_danger_level(target_temperature, TLV["temperature"]) @@ -300,38 +321,37 @@ environment.merge(gas) /** - * Get the danger level of a zone + * Get the danger level of specific criteria based on `danger_levels` * - * * RETURN_VALUE - The variable to store the return value * * current_value - The current value to check the danger-ness against * * danger_levels - A list with the danger levels */ /obj/machinery/alarm/proc/get_danger_level(current_value, list/danger_levels) if((current_value > danger_levels[4] && danger_levels[4] > 0) || current_value < danger_levels[1]) return 2 - else if((current_value > danger_levels[3] && danger_levels[3] > 0) || current_value < danger_levels[2]) + + if((current_value > danger_levels[3] && danger_levels[3] > 0) || current_value < danger_levels[2]) return 1 - else - return 0 + + return 0 /** - * Get the overall danger level of the environment + * Get the maximum danger level across all environment criteria * - * * RETURN_VALUE - The variable to store the return value * * environment - A `/datum/gas_mixture` to perform the danger level calculation against */ -/obj/machinery/alarm/proc/get_overall_danger_level(datum/gas_mixture/environment) +/obj/machinery/alarm/proc/get_max_danger_level(datum/gas_mixture/environment) var/partial_pressure = R_IDEAL_GAS_EQUATION * environment.temperature / environment.volume var/other_moles = 0 for(var/gas_id in trace_gas) - other_moles += environment.get_gas(gas_id) + other_moles += environment.gas[gas_id] return max( get_danger_level(environment.return_pressure(), TLV["pressure"]), get_danger_level(environment.gas[GAS_OXYGEN] * partial_pressure, TLV[GAS_OXYGEN]), get_danger_level(environment.gas[GAS_CO2] * partial_pressure, TLV[GAS_CO2]), get_danger_level(environment.temperature, TLV["temperature"]), - get_danger_level(other_moles*partial_pressure, TLV["other"]) + get_danger_level(other_moles * partial_pressure, TLV["other"]) ) @@ -934,11 +954,11 @@ report_danger_level = 0 breach_pressure = -1 -/obj/machinery/alarm/server/New() - ..() +/obj/machinery/alarm/server/Initialize() + . = ..() req_access = list(access_rd, access_atmospherics, access_engine_equip) - TLV["temperature"] = list(T0C-26, T0C, T0C+30, T0C+40) // K - target_temperature = T0C+10 + TLV["temperature"] = list(T0C-26, T0C, T0C+30, T0C+40) + target_temperature = T0C + 10 /* AIR ALARM CIRCUIT diff --git a/html/changelogs/.all_changelog.yml b/html/changelogs/.all_changelog.yml index 7ef27d04f754e..07aa68c194dab 100644 --- a/html/changelogs/.all_changelog.yml +++ b/html/changelogs/.all_changelog.yml @@ -23272,3 +23272,10 @@ DO NOT EDIT THIS FILE BY HAND! AUTOMATICALLY GENERATED BY sierra_genchangelog.p - wip: Partially ported escape pod system, allowing for hacking & premature launch. - tweak: Ported an air alarm refactor, improving optimization. - tweak: Xeno characters are now allowed to learn Legalise. +2024-03-27: + UEDHighCommand: + - bugfix: Introduced a hotfix for Air Alarm triggering conditions. + Lexanx: + - rscadd: Added a chance to fail surgery based on whether the patient is clothed or not. + dorou: + - bugfix: Fixed welding lenses augment. From 432e0b5f4d2fde8360495ae07aac12c1e97d2436 Mon Sep 17 00:00:00 2001 From: Lexanx <61974560+Lexanx@users.noreply.github.com> Date: Thu, 28 Mar 2024 11:17:14 +0300 Subject: [PATCH 4/4] Apostrof The Grand Return (#2074) --- code/modules/client/preference_setup/general/01_basic.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/client/preference_setup/general/01_basic.dm b/code/modules/client/preference_setup/general/01_basic.dm index d8f475bdc5ffd..c59a41e19c5ba 100644 --- a/code/modules/client/preference_setup/general/01_basic.dm +++ b/code/modules/client/preference_setup/general/01_basic.dm @@ -39,7 +39,7 @@ /datum/category_item/player_setup_item/physical/basic/OnTopic(href, list/href_list, mob/user) if(href_list["rename"]) - var/raw_name = tgui_input_text(user, "Choose your character's name", "Character Name", max_length = MAX_NAME_LEN) + var/raw_name = tgui_input_text(user, "Choose your character's name", "Character Name", max_length = MAX_NAME_LEN, encode = FALSE) if(isnull(raw_name) && CanUseTopic(user)) return