From 4c5d2d9e0409a26986a267a42260bd167275fced Mon Sep 17 00:00:00 2001 From: KageIIte Date: Thu, 25 Jul 2024 23:23:00 +0300 Subject: [PATCH 1/9] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B2=D0=B0=D1=8F=20?= =?UTF-8?q?=D0=B8=D0=BD=D0=B8=D1=86=D0=B8=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modular_bandastation/medical/_medicalPlus.dm | 4 + modular_bandastation/medical/_medicalPlus.dme | 3 + .../code/surgery/surgery_fail_chance.dm | 90 +++++++++++++++++++ modular_bandastation/modular_bandastation.dme | 1 + 4 files changed, 98 insertions(+) create mode 100644 modular_bandastation/medical/_medicalPlus.dm create mode 100644 modular_bandastation/medical/_medicalPlus.dme create mode 100644 modular_bandastation/medical/code/surgery/surgery_fail_chance.dm diff --git a/modular_bandastation/medical/_medicalPlus.dm b/modular_bandastation/medical/_medicalPlus.dm new file mode 100644 index 0000000000000..b86359e80b5c9 --- /dev/null +++ b/modular_bandastation/medical/_medicalPlus.dm @@ -0,0 +1,4 @@ +/datum/modpack/medicalPlus + name = "Medical Plus" + desc = "Глобальное расширение медицинской системы" + author = "KageIIte" diff --git a/modular_bandastation/medical/_medicalPlus.dme b/modular_bandastation/medical/_medicalPlus.dme new file mode 100644 index 0000000000000..37af44f7bdc7f --- /dev/null +++ b/modular_bandastation/medical/_medicalPlus.dme @@ -0,0 +1,3 @@ +#include "_medicalPlus.dm" + +#include "code/surgery/surgery_fail_chance.dm" diff --git a/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm b/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm new file mode 100644 index 0000000000000..91f7e0909f253 --- /dev/null +++ b/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm @@ -0,0 +1,90 @@ +#define SURGERY_SLOWDOWN_CAP_MULTIPLIER 2.5 +#define SURGERY_SPEED_MORBID_CURIOSITY 0.7 +#define SURGERY_STATE_STARTED "surgery_started" +#define SURGERY_STATE_FAILURE "surgery_failed" +#define SURGERY_STATE_SUCCESS "surgery_success" +#define SURGERY_SPEED_DISSECTION_MODIFIER 0.8 +#define SURGERY_SPEED_TRAIT_ANALGESIA 0.8 + +/datum/surgery_step/initiate(mob/living/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, try_to_fail = FALSE) + // Only followers of Asclepius have the ability to use Healing Touch and perform miracle feats of surgery. + // Prevents people from performing multiple simultaneous surgeries unless they're holding a Rod of Asclepius. + + surgery.step_in_progress = TRUE + var/speed_mod = 1 + var/fail_prob = 50//100 - fail_prob = success_prob + var/advance = FALSE + + if(preop(user, target, target_zone, tool, surgery) == SURGERY_STEP_FAIL) + update_surgery_mood(target, SURGERY_STATE_FAILURE) + surgery.step_in_progress = FALSE + return FALSE + + update_surgery_mood(target, SURGERY_STATE_STARTED) + play_preop_sound(user, target, target_zone, tool, surgery) // Here because most steps overwrite preop + + if(tool) + speed_mod = tool.toolspeed + + if(HAS_TRAIT(target, TRAIT_SURGICALLY_ANALYZED)) + speed_mod *= SURGERY_SPEED_DISSECTION_MODIFIER + + if(check_morbid_curiosity(user, tool, surgery)) + speed_mod *= SURGERY_SPEED_MORBID_CURIOSITY + + if(HAS_TRAIT(target, TRAIT_ANALGESIA)) + speed_mod *= SURGERY_SPEED_TRAIT_ANALGESIA + + var/implement_speed_mod = 1 + if(implement_type) //this means it isn't a require hand or any item step. + implement_speed_mod = implements[implement_type] / 100.0 + + speed_mod /= (get_location_modifier(target) * (1 + surgery.speed_modifier) * implement_speed_mod) * target.mob_surgery_speed_mod + var/modded_time = time * speed_mod + + var/turf/user_turf = user.loc + if(tool) + fail_prob -= (1/tool.toolspeed) * 10 + else + fail_prob += 10 + fail_prob -= 3 * user_turf.luminosity() + if (HAS_TRAIT(target, TRAIT_ANALGESIA)) + fail_prob -= 100 + + fail_prob = fail_prob + min(max(0, modded_time - (time * SURGERY_SLOWDOWN_CAP_MULTIPLIER)),99)//if modded_time > time * modifier, then fail_prob = modded_time - time*modifier. starts at 0, caps at 99 + modded_time = min(modded_time, time * SURGERY_SLOWDOWN_CAP_MULTIPLIER)//also if that, then cap modded_time at time*modifier + + if(iscyborg(user))//any immunities to surgery slowdown should go in this check. + modded_time = time * tool.toolspeed + + var/was_sleeping = (target.stat != DEAD && target.IsSleeping()) + + if(do_after(user, modded_time, target = target, interaction_key = user.has_status_effect(/datum/status_effect/hippocratic_oath) ? target : DOAFTER_SOURCE_SURGERY)) //If we have the hippocratic oath, we can perform one surgery on each target, otherwise we can only do one surgery in total. + + var/chem_check_result = chem_check(target) + if((prob(100-fail_prob) || (iscyborg(user) && !silicons_obey_prob)) && chem_check_result && !try_to_fail) + + if(success(user, target, target_zone, tool, surgery)) + update_surgery_mood(target, SURGERY_STATE_SUCCESS) + play_success_sound(user, target, target_zone, tool, surgery) + advance = TRUE + else + if(failure(user, target, target_zone, tool, surgery, fail_prob)) + play_failure_sound(user, target, target_zone, tool, surgery) + update_surgery_mood(target, SURGERY_STATE_FAILURE) + advance = TRUE + if(chem_check_result) + return .(user, target, target_zone, tool, surgery, try_to_fail) //automatically re-attempt if failed for reason other than lack of required chemical + if(advance && !repeatable) + surgery.status++ + if(surgery.status > surgery.steps.len) + surgery.complete(user) + + else if(!QDELETED(target)) + update_surgery_mood(target, SURGERY_STATE_FAILURE) + + if(target.stat == DEAD && was_sleeping && user.client) + user.client.give_award(/datum/award/achievement/jobs/sandman, user) + + surgery.step_in_progress = FALSE + return advance diff --git a/modular_bandastation/modular_bandastation.dme b/modular_bandastation/modular_bandastation.dme index f805bb52659d5..1ddee7f15e335 100644 --- a/modular_bandastation/modular_bandastation.dme +++ b/modular_bandastation/modular_bandastation.dme @@ -20,6 +20,7 @@ #include "examine_panel/_examine_panel.dme" #include "gunhud/_gunhud.dme" #include "keybinding/_keybinding.dme" +#include "medical/_medicalPlus.dme" #include "pixel_shift/_pixel_shift.dme" #include "ru_jobs/_ru_jobs.dme" #include "translations/_translations.dme" From 48e3eabd14d6bd86ad133f054b9b626f6c761818 Mon Sep 17 00:00:00 2001 From: KageIIte Date: Thu, 25 Jul 2024 23:25:18 +0300 Subject: [PATCH 2/9] =?UTF-8?q?=D0=9D=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88?= =?UTF-8?q?=D0=B0=D1=8F=20=D0=BF=D0=B5=D1=80=D0=B5=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=BA=D0=B0=20=D0=B1=D0=B0=D0=BB=D0=B0=D0=BD=D1=81=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../medical/code/surgery/surgery_fail_chance.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm b/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm index 91f7e0909f253..24afaab462ecb 100644 --- a/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm +++ b/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm @@ -12,7 +12,7 @@ surgery.step_in_progress = TRUE var/speed_mod = 1 - var/fail_prob = 50//100 - fail_prob = success_prob + var/fail_prob = 70//100 - fail_prob = success_prob var/advance = FALSE if(preop(user, target, target_zone, tool, surgery) == SURGERY_STEP_FAIL) @@ -47,7 +47,7 @@ fail_prob -= (1/tool.toolspeed) * 10 else fail_prob += 10 - fail_prob -= 3 * user_turf.luminosity() + fail_prob -= 100 * user_turf.get_lumcount() if (HAS_TRAIT(target, TRAIT_ANALGESIA)) fail_prob -= 100 From e94c6115b1b489d28cbd4e45efe850d82d3b5000 Mon Sep 17 00:00:00 2001 From: KageIIte Date: Thu, 25 Jul 2024 23:36:21 +0300 Subject: [PATCH 3/9] =?UTF-8?q?=D0=9B=D0=B8=D1=88=D0=BD=D0=B8=D0=B9=20?= =?UTF-8?q?=D0=BD=D0=BE=D0=BB=D0=B8=D0=BA,=20=D1=83=D0=BF=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../medical/code/surgery/surgery_fail_chance.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm b/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm index 24afaab462ecb..e21913bb30a87 100644 --- a/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm +++ b/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm @@ -47,7 +47,7 @@ fail_prob -= (1/tool.toolspeed) * 10 else fail_prob += 10 - fail_prob -= 100 * user_turf.get_lumcount() + fail_prob -= 10 * user_turf.get_lumcount() if (HAS_TRAIT(target, TRAIT_ANALGESIA)) fail_prob -= 100 From edd6af9a7e13921b19a9310bedcc31c475b5cd44 Mon Sep 17 00:00:00 2001 From: KageIIte Date: Sat, 27 Jul 2024 10:59:52 +0300 Subject: [PATCH 4/9] =?UTF-8?q?=D0=9E=D1=82=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BF=D0=BE=20=D1=80=D0=B5=D0=B2=D1=8C=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/modules/surgery/surgery_step.dm | 2 +- .../code/surgery/surgery_fail_chance.dm | 86 +------------------ 2 files changed, 5 insertions(+), 83 deletions(-) diff --git a/code/modules/surgery/surgery_step.dm b/code/modules/surgery/surgery_step.dm index 350bd60fbd176..ac1ee45aed3a7 100644 --- a/code/modules/surgery/surgery_step.dm +++ b/code/modules/surgery/surgery_step.dm @@ -124,7 +124,7 @@ var/modded_time = time * speed_mod - fail_prob = min(max(0, modded_time - (time * SURGERY_SLOWDOWN_CAP_MULTIPLIER)),99)//if modded_time > time * modifier, then fail_prob = modded_time - time*modifier. starts at 0, caps at 99 + fail_prob = get_failure_probability(user,target,tool) + min(max(0, modded_time - (time * SURGERY_SLOWDOWN_CAP_MULTIPLIER)),99)//if modded_time > time * modifier, then fail_prob = modded_time - time*modifier. starts at 0, caps at 99 modded_time = min(modded_time, time * SURGERY_SLOWDOWN_CAP_MULTIPLIER)//also if that, then cap modded_time at time*modifier if(iscyborg(user))//any immunities to surgery slowdown should go in this check. diff --git a/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm b/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm index e21913bb30a87..298a35ea83adf 100644 --- a/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm +++ b/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm @@ -1,90 +1,12 @@ -#define SURGERY_SLOWDOWN_CAP_MULTIPLIER 2.5 -#define SURGERY_SPEED_MORBID_CURIOSITY 0.7 -#define SURGERY_STATE_STARTED "surgery_started" -#define SURGERY_STATE_FAILURE "surgery_failed" -#define SURGERY_STATE_SUCCESS "surgery_success" -#define SURGERY_SPEED_DISSECTION_MODIFIER 0.8 -#define SURGERY_SPEED_TRAIT_ANALGESIA 0.8 - -/datum/surgery_step/initiate(mob/living/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, try_to_fail = FALSE) - // Only followers of Asclepius have the ability to use Healing Touch and perform miracle feats of surgery. - // Prevents people from performing multiple simultaneous surgeries unless they're holding a Rod of Asclepius. - - surgery.step_in_progress = TRUE - var/speed_mod = 1 - var/fail_prob = 70//100 - fail_prob = success_prob - var/advance = FALSE - - if(preop(user, target, target_zone, tool, surgery) == SURGERY_STEP_FAIL) - update_surgery_mood(target, SURGERY_STATE_FAILURE) - surgery.step_in_progress = FALSE - return FALSE - - update_surgery_mood(target, SURGERY_STATE_STARTED) - play_preop_sound(user, target, target_zone, tool, surgery) // Here because most steps overwrite preop - - if(tool) - speed_mod = tool.toolspeed - - if(HAS_TRAIT(target, TRAIT_SURGICALLY_ANALYZED)) - speed_mod *= SURGERY_SPEED_DISSECTION_MODIFIER - - if(check_morbid_curiosity(user, tool, surgery)) - speed_mod *= SURGERY_SPEED_MORBID_CURIOSITY - - if(HAS_TRAIT(target, TRAIT_ANALGESIA)) - speed_mod *= SURGERY_SPEED_TRAIT_ANALGESIA - - var/implement_speed_mod = 1 - if(implement_type) //this means it isn't a require hand or any item step. - implement_speed_mod = implements[implement_type] / 100.0 - - speed_mod /= (get_location_modifier(target) * (1 + surgery.speed_modifier) * implement_speed_mod) * target.mob_surgery_speed_mod - var/modded_time = time * speed_mod - +/datum/surgery_step/proc/get_failure_probability(mob/living/user, mob/living/target, obj/item/tool) + var/fail_prob = 70 var/turf/user_turf = user.loc if(tool) fail_prob -= (1/tool.toolspeed) * 10 else fail_prob += 10 - fail_prob -= 10 * user_turf.get_lumcount() + fail_prob -= 20 * user_turf.get_lumcount() if (HAS_TRAIT(target, TRAIT_ANALGESIA)) fail_prob -= 100 - fail_prob = fail_prob + min(max(0, modded_time - (time * SURGERY_SLOWDOWN_CAP_MULTIPLIER)),99)//if modded_time > time * modifier, then fail_prob = modded_time - time*modifier. starts at 0, caps at 99 - modded_time = min(modded_time, time * SURGERY_SLOWDOWN_CAP_MULTIPLIER)//also if that, then cap modded_time at time*modifier - - if(iscyborg(user))//any immunities to surgery slowdown should go in this check. - modded_time = time * tool.toolspeed - - var/was_sleeping = (target.stat != DEAD && target.IsSleeping()) - - if(do_after(user, modded_time, target = target, interaction_key = user.has_status_effect(/datum/status_effect/hippocratic_oath) ? target : DOAFTER_SOURCE_SURGERY)) //If we have the hippocratic oath, we can perform one surgery on each target, otherwise we can only do one surgery in total. - - var/chem_check_result = chem_check(target) - if((prob(100-fail_prob) || (iscyborg(user) && !silicons_obey_prob)) && chem_check_result && !try_to_fail) - - if(success(user, target, target_zone, tool, surgery)) - update_surgery_mood(target, SURGERY_STATE_SUCCESS) - play_success_sound(user, target, target_zone, tool, surgery) - advance = TRUE - else - if(failure(user, target, target_zone, tool, surgery, fail_prob)) - play_failure_sound(user, target, target_zone, tool, surgery) - update_surgery_mood(target, SURGERY_STATE_FAILURE) - advance = TRUE - if(chem_check_result) - return .(user, target, target_zone, tool, surgery, try_to_fail) //automatically re-attempt if failed for reason other than lack of required chemical - if(advance && !repeatable) - surgery.status++ - if(surgery.status > surgery.steps.len) - surgery.complete(user) - - else if(!QDELETED(target)) - update_surgery_mood(target, SURGERY_STATE_FAILURE) - - if(target.stat == DEAD && was_sleeping && user.client) - user.client.give_award(/datum/award/achievement/jobs/sandman, user) - - surgery.step_in_progress = FALSE - return advance + return fail_prob From ca7003750abd87a9a586afe34a2b296c7f0962f3 Mon Sep 17 00:00:00 2001 From: KageIIte Date: Sat, 27 Jul 2024 14:04:08 +0300 Subject: [PATCH 5/9] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B5=20=D0=BC=D0=B5=D1=85=D0=B0=D0=BD=D0=B8=D0=BA=D0=B8?= =?UTF-8?q?=20=D1=80=D0=B0=D1=81=D1=87=D0=B5=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/modules/surgery/surgery_step.dm | 2 +- .../code/surgery/surgery_fail_chance.dm | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/code/modules/surgery/surgery_step.dm b/code/modules/surgery/surgery_step.dm index ac1ee45aed3a7..e615e932eb133 100644 --- a/code/modules/surgery/surgery_step.dm +++ b/code/modules/surgery/surgery_step.dm @@ -124,7 +124,7 @@ var/modded_time = time * speed_mod - fail_prob = get_failure_probability(user,target,tool) + min(max(0, modded_time - (time * SURGERY_SLOWDOWN_CAP_MULTIPLIER)),99)//if modded_time > time * modifier, then fail_prob = modded_time - time*modifier. starts at 0, caps at 99 + fail_prob = get_failure_probability(user,target,tool,modded_time,)//if modded_time > time * modifier, then fail_prob = modded_time - time*modifier. starts at 0, caps at 99 modded_time = min(modded_time, time * SURGERY_SLOWDOWN_CAP_MULTIPLIER)//also if that, then cap modded_time at time*modifier if(iscyborg(user))//any immunities to surgery slowdown should go in this check. diff --git a/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm b/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm index 298a35ea83adf..9418024a1f667 100644 --- a/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm +++ b/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm @@ -1,12 +1,14 @@ -/datum/surgery_step/proc/get_failure_probability(mob/living/user, mob/living/target, obj/item/tool) - var/fail_prob = 70 +/datum/surgery_step/proc/get_failure_probability(mob/living/user, mob/living/target, obj/item/tool, var/modded_time) + var/success_prob = implements[implement_type] var/turf/user_turf = user.loc if(tool) - fail_prob -= (1/tool.toolspeed) * 10 - else - fail_prob += 10 - fail_prob -= 20 * user_turf.get_lumcount() - if (HAS_TRAIT(target, TRAIT_ANALGESIA)) - fail_prob -= 100 + success_prob += (1/tool.toolspeed) * 10 + var/light_amount = user_turf.get_lumcount() + if (light_amount >= 0.6) + success_prob += clamp(light_amount, 0.6, 1) * 20 + if ((!(target.stat == UNCONSCIOUS || target.IsSleeping()) && target.stat != DEAD) && !HAS_TRAIT(target, TRAIT_ANALGESIA)) + success_prob -= 80 + var/fail_prob = 100 - success_prob + fail_prob *= modded_time / time return fail_prob From 2c14b4a4c8e6cc254fccb5a1f460b2b6d2db34b0 Mon Sep 17 00:00:00 2001 From: KageIIte Date: Mon, 29 Jul 2024 07:42:51 +0300 Subject: [PATCH 6/9] =?UTF-8?q?=D0=9E=D1=82=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BF=D0=BE=20=D1=80=D0=B5=D0=B2=D1=8C=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modular_bandastation/medical/_medicalPlus.dm | 4 ++-- .../medical/code/surgery/surgery_fail_chance.dm | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/modular_bandastation/medical/_medicalPlus.dm b/modular_bandastation/medical/_medicalPlus.dm index b86359e80b5c9..664c7d5e8ce70 100644 --- a/modular_bandastation/medical/_medicalPlus.dm +++ b/modular_bandastation/medical/_medicalPlus.dm @@ -1,4 +1,4 @@ -/datum/modpack/medicalPlus - name = "Medical Plus" +/datum/modpack/medicine_extension + name = "Medical Extension" desc = "Глобальное расширение медицинской системы" author = "KageIIte" diff --git a/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm b/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm index 9418024a1f667..2ba195aab35f1 100644 --- a/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm +++ b/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm @@ -1,11 +1,9 @@ /datum/surgery_step/proc/get_failure_probability(mob/living/user, mob/living/target, obj/item/tool, var/modded_time) - var/success_prob = implements[implement_type] - var/turf/user_turf = user.loc - if(tool) - success_prob += (1/tool.toolspeed) * 10 + var/success_prob = implement_type ? implements[implement_type] : 100 + var/turf/user_turf = get_turf(user) var/light_amount = user_turf.get_lumcount() - if (light_amount >= 0.6) - success_prob += clamp(light_amount, 0.6, 1) * 20 + if (light_amount < 0.6) + success_prob -= (0.6 - clamp(light_amount, 0, 0.6)) * 20 if ((!(target.stat == UNCONSCIOUS || target.IsSleeping()) && target.stat != DEAD) && !HAS_TRAIT(target, TRAIT_ANALGESIA)) success_prob -= 80 var/fail_prob = 100 - success_prob From c44943406347b467adae9b9af50114fd86cca930 Mon Sep 17 00:00:00 2001 From: KageIIte Date: Fri, 20 Sep 2024 18:19:46 +0300 Subject: [PATCH 7/9] =?UTF-8?q?=D0=A7=D0=B8=D1=81=D1=82=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=BE=D1=82=20=D0=BB=D0=B8=D1=88=D0=BD=D0=B5=D0=B3=D0=BE,=20?= =?UTF-8?q?=D0=BE=D0=B1=D1=8A=D0=B5=D0=B4=D0=B8=D0=BD=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D1=81=20=D0=BC=D0=B5=D0=B4=D0=BF=D0=B0=D0=BA=D0=BE?= =?UTF-8?q?=D0=BC=20=D0=A1=D0=B2=D0=BE=D1=82=D0=B8=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modular_bandastation/medical/_medical.dme | 1 + modular_bandastation/medical/_medicalPlus.dm | 4 ---- modular_bandastation/medical/_medicalPlus.dme | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) delete mode 100644 modular_bandastation/medical/_medicalPlus.dm delete mode 100644 modular_bandastation/medical/_medicalPlus.dme diff --git a/modular_bandastation/medical/_medical.dme b/modular_bandastation/medical/_medical.dme index 3783e0393c8c7..7c801faa1c429 100644 --- a/modular_bandastation/medical/_medical.dme +++ b/modular_bandastation/medical/_medical.dme @@ -1,3 +1,4 @@ #include "_medical.dm" #include "code/surgery/vocal_cords.dm" +#include "code/surgery/surgery_fail_chance.dm" diff --git a/modular_bandastation/medical/_medicalPlus.dm b/modular_bandastation/medical/_medicalPlus.dm deleted file mode 100644 index 664c7d5e8ce70..0000000000000 --- a/modular_bandastation/medical/_medicalPlus.dm +++ /dev/null @@ -1,4 +0,0 @@ -/datum/modpack/medicine_extension - name = "Medical Extension" - desc = "Глобальное расширение медицинской системы" - author = "KageIIte" diff --git a/modular_bandastation/medical/_medicalPlus.dme b/modular_bandastation/medical/_medicalPlus.dme deleted file mode 100644 index 37af44f7bdc7f..0000000000000 --- a/modular_bandastation/medical/_medicalPlus.dme +++ /dev/null @@ -1,3 +0,0 @@ -#include "_medicalPlus.dm" - -#include "code/surgery/surgery_fail_chance.dm" From b091d405fe1697dc4dbeb397d7b6ec9b8def8562 Mon Sep 17 00:00:00 2001 From: KageIIte Date: Fri, 20 Sep 2024 18:24:13 +0300 Subject: [PATCH 8/9] =?UTF-8?q?=D0=9D=D1=83=20=D0=BA=D0=BE=D0=BD=D0=B5?= =?UTF-8?q?=D1=87=D0=BD=D0=BE,=20=D0=B0=20=D0=BF=D1=80=D0=BE=20dme=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=B1=D1=8B=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modular_bandastation/modular_bandastation.dme | 1 - 1 file changed, 1 deletion(-) diff --git a/modular_bandastation/modular_bandastation.dme b/modular_bandastation/modular_bandastation.dme index ebfc557de2808..3aadf7b8ca3aa 100644 --- a/modular_bandastation/modular_bandastation.dme +++ b/modular_bandastation/modular_bandastation.dme @@ -21,7 +21,6 @@ #include "examine_panel/_examine_panel.dme" #include "gunhud/_gunhud.dme" #include "keybinding/_keybinding.dme" -#include "medical/_medicalPlus.dme" #include "loadout/_loadout.dme" #include "mapping/_mapping.dme" #include "medical/_medical.dme" From 76f79c210e97141b9a635dc60df60d3b115ff1c8 Mon Sep 17 00:00:00 2001 From: KageIIte Date: Sat, 21 Sep 2024 18:56:06 +0300 Subject: [PATCH 9/9] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BE=20=D0=BF=D1=80=D0=B5=D0=B4?= =?UTF-8?q?=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../code/surgery/surgery_fail_chance.dm | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm b/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm index 2ba195aab35f1..356b98716d7c8 100644 --- a/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm +++ b/modular_bandastation/medical/code/surgery/surgery_fail_chance.dm @@ -1,12 +1,25 @@ +#define SURGFAIL_LIGHT_AMOUNT_REQUERED 0.6 +#define SURGFAIL_LIGHT_AMOUNT_MULTIPLIER 20 +#define SURGFAIL_NO_PAINKILLER 80 +#define BASIC_SURGERY_SUCCESS_CHANCE 100 +#define CRITICAL_SUCCESS_CHANCE 100 + + /datum/surgery_step/proc/get_failure_probability(mob/living/user, mob/living/target, obj/item/tool, var/modded_time) - var/success_prob = implement_type ? implements[implement_type] : 100 + var/success_prob = implement_type ? implements[implement_type] : BASIC_SURGERY_SUCCESS_CHANCE var/turf/user_turf = get_turf(user) var/light_amount = user_turf.get_lumcount() - if (light_amount < 0.6) - success_prob -= (0.6 - clamp(light_amount, 0, 0.6)) * 20 + if (light_amount < SURGFAIL_LIGHT_AMOUNT_REQUERED) + success_prob -= (SURGFAIL_LIGHT_AMOUNT_REQUERED - clamp(light_amount, 0, SURGFAIL_LIGHT_AMOUNT_REQUERED)) * SURGFAIL_LIGHT_AMOUNT_MULTIPLIER if ((!(target.stat == UNCONSCIOUS || target.IsSleeping()) && target.stat != DEAD) && !HAS_TRAIT(target, TRAIT_ANALGESIA)) - success_prob -= 80 - var/fail_prob = 100 - success_prob + success_prob -= SURGFAIL_NO_PAINKILLER + var/fail_prob = CRITICAL_SUCCESS_CHANCE - success_prob fail_prob *= modded_time / time return fail_prob + +#undef SURGFAIL_LIGHT_AMOUNT_REQUERED +#undef SURGFAIL_LIGHT_AMOUNT_MULTIPLIER +#undef SURGFAIL_NO_PAINKILLER +#undef BASIC_SURGERY_SUCCESS_CHANCE +#undef CRITICAL_SUCCESS_CHANCE