Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Обновленная медицинская система: Шанс провалов #461

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4c5d2d9
Первая инициализация
msw7007 Jul 25, 2024
48e3eab
Небольшая переработка баланса
msw7007 Jul 25, 2024
274b427
Merge branch 'master' into MedP_surgery_fail
msw7007 Jul 25, 2024
e94c611
Лишний нолик, упс
msw7007 Jul 25, 2024
1882b19
Merge branch 'master' into MedP_surgery_fail
msw7007 Jul 26, 2024
edd6af9
Отработка по ревью
msw7007 Jul 27, 2024
734bf33
Merge branch 'master' into MedP_surgery_fail
msw7007 Jul 27, 2024
ca70037
Обновлене механики расчетов
msw7007 Jul 27, 2024
2c14b4a
Отработка по ревью
msw7007 Jul 29, 2024
55941f9
Merge branch 'master' into MedP_surgery_fail
msw7007 Sep 20, 2024
c449434
Чистка от лишнего, объединение с медпаком Свотина
msw7007 Sep 20, 2024
b091d40
Ну конечно, а про dme забыл
msw7007 Sep 20, 2024
76f79c2
Обновление по предложению
msw7007 Sep 21, 2024
a38b366
добавление трейта стазиса как защиты от провала (пациенту все еще буд…
msw7007 Nov 15, 2024
0d756fd
Упс...
msw7007 Nov 15, 2024
7f4f337
Добавление обезбола стазису
msw7007 Nov 15, 2024
88bf0b5
Добавление комментария
msw7007 Nov 15, 2024
151e236
Merge branch 'master' into MedP_surgery_fail
msw7007 Nov 15, 2024
c24ad71
Merge branch 'MedP_surgery_fail' of https://github.com/msw7007/Bandas…
msw7007 Nov 15, 2024
42358fe
Отработка по ревью
msw7007 Jan 15, 2025
21856f5
Merge branch 'master' into MedP_surgery_fail
msw7007 Jan 15, 2025
31ea95a
Merge branch 'MedP_surgery_fail' of https://github.com/msw7007/Bandas…
msw7007 Jan 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/modules/surgery/surgery_step.dm
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,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, modded_time) //BANDASTATION EDIT - было: if modded_time > time * modifier, then fail_prob = modded_time - time*modifier. starts at 0, caps at 99 // BANDASTATION EDIT
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.
Expand Down
1 change: 1 addition & 0 deletions modular_bandastation/medical/_medical.dme
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "_medical.dm"

#include "code/surgery/vocal_cords.dm"
#include "code/surgery/surgery_fail_chance.dm"
33 changes: 33 additions & 0 deletions modular_bandastation/medical/code/surgery/surgery_fail_chance.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#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] : BASIC_SURGERY_SUCCESS_CHANCE
var/turf/user_turf = get_turf(user)
var/light_amount = user_turf.get_lumcount()
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 -= 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

/datum/status_effect/grouped/stasis/on_apply()
. = ..()
add_traits(list(TRAIT_ANALGESIA), TRAIT_STATUS_EFFECT(id))

/datum/status_effect/grouped/stasis/on_remove()
. = ..()
remove_traits(list(TRAIT_ANALGESIA), TRAIT_STATUS_EFFECT(id))
Loading