From 71372a90479130f8fb1f0539c8ad598a83fd0465 Mon Sep 17 00:00:00 2001 From: KageIIte Date: Mon, 11 Nov 2024 19:30:19 +0300 Subject: [PATCH 1/7] =?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_ss220/prime_only/_prime.dme | 1 + .../code/death_debuffs/dd_brain_traumas.dm | 31 ++++ .../code/death_debuffs/dd_ears_traumas.dm | 34 +++++ .../code/death_debuffs/dd_eyes_traumas.dm | 40 ++++++ .../code/death_debuffs/dd_head_trauma.dm | 15 ++ .../code/death_debuffs/dd_heart_traumas.dm | 34 +++++ .../code/death_debuffs/dd_kidney_traumas.dm | 35 +++++ .../code/death_debuffs/dd_limb_failure.dm | 47 ++++++ .../code/death_debuffs/dd_liver_traumas.dm | 39 +++++ .../code/death_debuffs/dd_lungs_traumas.dm | 32 +++++ .../code/death_debuffs/dd_paralyze.dm | 47 ++++++ .../code/death_debuffs/dd_spazms.dm | 46 ++++++ .../death_debuffs/death_debuff_component.dm | 135 ++++++++++++++++++ .../code/death_debuffs/death_debuffs.dm | 16 +++ .../death_debuffs/death_debuffs_defines.dm | 120 ++++++++++++++++ 15 files changed, 672 insertions(+) create mode 100644 modular_ss220/prime_only/code/death_debuffs/dd_brain_traumas.dm create mode 100644 modular_ss220/prime_only/code/death_debuffs/dd_ears_traumas.dm create mode 100644 modular_ss220/prime_only/code/death_debuffs/dd_eyes_traumas.dm create mode 100644 modular_ss220/prime_only/code/death_debuffs/dd_head_trauma.dm create mode 100644 modular_ss220/prime_only/code/death_debuffs/dd_heart_traumas.dm create mode 100644 modular_ss220/prime_only/code/death_debuffs/dd_kidney_traumas.dm create mode 100644 modular_ss220/prime_only/code/death_debuffs/dd_limb_failure.dm create mode 100644 modular_ss220/prime_only/code/death_debuffs/dd_liver_traumas.dm create mode 100644 modular_ss220/prime_only/code/death_debuffs/dd_lungs_traumas.dm create mode 100644 modular_ss220/prime_only/code/death_debuffs/dd_paralyze.dm create mode 100644 modular_ss220/prime_only/code/death_debuffs/dd_spazms.dm create mode 100644 modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm create mode 100644 modular_ss220/prime_only/code/death_debuffs/death_debuffs.dm create mode 100644 modular_ss220/prime_only/code/death_debuffs/death_debuffs_defines.dm diff --git a/modular_ss220/prime_only/_prime.dme b/modular_ss220/prime_only/_prime.dme index 901850d569ec..833c1411057a 100644 --- a/modular_ss220/prime_only/_prime.dme +++ b/modular_ss220/prime_only/_prime.dme @@ -10,3 +10,4 @@ #include "code/vending.dm" #include "code/crematorium.dm" #include "code/shuttle_gib.dm" +#include "code/death_debuffs/death_debuffs.dm" diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_brain_traumas.dm b/modular_ss220/prime_only/code/death_debuffs/dd_brain_traumas.dm new file mode 100644 index 000000000000..0e90687bb855 --- /dev/null +++ b/modular_ss220/prime_only/code/death_debuffs/dd_brain_traumas.dm @@ -0,0 +1,31 @@ +/datum/death_debuff/brain_hallucination + name = "посттравматическое стрессовое расстройство" + reagent_list = list(/datum/reagent/medicine/mannitol,/datum/reagent/medicine/sterilizine) + affected_zone = "brain" + applied_text = "Вы начинаете видеть необычные вещи." + removed_text = "Похоже призраки прошлого решили оставить вас." + +/datum/death_debuff/brain_hallucination/dd_effect() + . = ..() + var/obj/item/organ/organ = H.get_organ_slot(affected_zone) + if(!organ) + return + + //Вызывает эффект галлюцинаций + H.AdjustHallucinate(2 SECONDS) + +/datum/death_debuff/brain_confusion + name = "сильное сотрясение мозга" + reagent_list = list(/datum/reagent/medicine/mannitol,/datum/reagent/medicine/omnizine) + affected_zone = "brain" + applied_text = "Либо вы, либо весь мир решил кружиться в вальсе." + removed_text = "Вы снова нормально видите этот мир." + +/datum/death_debuff/brain_confusion/dd_effect() + . = ..() + var/obj/item/organ/organ = H.get_organ_slot(affected_zone) + if(!organ) + return + + //Вызывает эффект пошатывания + H.SetConfused(2 SECONDS) diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_ears_traumas.dm b/modular_ss220/prime_only/code/death_debuffs/dd_ears_traumas.dm new file mode 100644 index 000000000000..833c01e425c9 --- /dev/null +++ b/modular_ss220/prime_only/code/death_debuffs/dd_ears_traumas.dm @@ -0,0 +1,34 @@ +/datum/death_debuff/ears_destruction + name = "разрушение нервного узла" + reagent_list = list(/datum/reagent/medicine/oculine,/datum/reagent/medicine/mannitol) + affected_zone = "ears" + applied_text = "Вы осознаете, что полностью потеряли слух." + removed_text = "До вас начинают доносится какие-то звуки." + +/datum/death_debuff/ears_destruction/dd_effect() + . = ..() + var/obj/item/organ/organ = H.get_organ_slot(affected_zone) + if(!organ) + return + + //Накладывает эффект глухоты + organ.status |= ORGAN_DEAD + +/datum/death_debuff/ears_mailfuction + name = "кровоизлияние барабанной перепонки" + reagent_list = list(/datum/reagent/medicine/oculine,/datum/reagent/medicine/heal_on_apply/styptic_powder) + affected_zone = "ears" + applied_text = "Вам становится чуть теплее в районе уха и гоегоову пронзает острая боль." + removed_text = "Боль в районе уха отступила." + +/datum/death_debuff/ears_mailfuction/dd_effect() + . = ..() + var/obj/item/organ/organ = H.get_organ_slot(affected_zone) + if(!organ) + return + + //Накладывает эффект глухоты + if(prob(10)) + H.Deaf(state*0.1 SECONDS) + H.KnockDown(state*0.05 SECONDS) + diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_eyes_traumas.dm b/modular_ss220/prime_only/code/death_debuffs/dd_eyes_traumas.dm new file mode 100644 index 000000000000..6f6b78216767 --- /dev/null +++ b/modular_ss220/prime_only/code/death_debuffs/dd_eyes_traumas.dm @@ -0,0 +1,40 @@ +/datum/death_debuff/eyes_destruction + name = "повреждение затылочной доли" + reagent_list = list(/datum/reagent/medicine/oculine,/datum/reagent/medicine/salglu_solution) + affected_zone = "eyes" + applied_text = "Вы осознаете, что полностью потеряли зрение." + removed_text = "Пелена на глазах отступает." + +/datum/death_debuff/eyes_destruction/dd_effect() + . = ..() + var/obj/item/organ/organ = H.get_organ_slot(affected_zone) + if(!organ) + return + + //Накладывает эффект полной слепоты + organ.status |= ORGAN_DEAD + +/datum/death_debuff/eyes_mailfuction + name = "травма зрительного нерва" + reagent_list = list(/datum/reagent/medicine/oculine,/datum/reagent/medicine/heal_on_apply/silver_sulfadiazine) + affected_zone = "eyes" + applied_text = "Глаза пронзает резкая боль, все кажется слишком ярким." + removed_text = "Похоже что резь в глазах от яркого света отступила." + +/datum/death_debuff/eyes_mailfuction/dd_effect() + . = ..() + var/obj/item/organ/internal/eyes/organ = H.get_organ_slot(affected_zone) + if(!organ) + return + + //Накладывает кратковременный эффект слепоты и размытия, повышает чувствительной глаз + organ.flash_protect = FLASH_PROTECTION_VERYVUNERABLE + if(prob(10)) + H.SetEyeBlurry(state*0.1 SECONDS) + H.SetEyeBlind(state*0.01 SECONDS) + +/datum/death_debuff/liver_mailfunction/remove_debuff() + var/obj/item/organ/internal/eyes/organ = H.get_organ_slot(affected_zone) + if(!organ) + organ.flash_protect = initial(organ.flash_protect) + . = ..() diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_head_trauma.dm b/modular_ss220/prime_only/code/death_debuffs/dd_head_trauma.dm new file mode 100644 index 000000000000..e2974336c678 --- /dev/null +++ b/modular_ss220/prime_only/code/death_debuffs/dd_head_trauma.dm @@ -0,0 +1,15 @@ +/datum/death_debuff/head_trauma + name = "мозговая травма" + reagent_list = list(/datum/chemical_reaction/mannitol,/datum/chemical_reaction/osseous_reagent) + affected_zone = "head" + applied_text = "Вашу голову пронзила резкая, давящая боль." + removed_text = "Боль в голове постепенно отступила." + +/datum/death_debuff/head_trauma/dd_effect() + . = ..() + var/obj/item/organ/organ = H.get_limb_by_name(affected_zone) + if(!organ) + return + + //Накладывает эффект дееспособности на конечность (считается словно ампутированная) + H.adjustBrainLoss(0.02) diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_heart_traumas.dm b/modular_ss220/prime_only/code/death_debuffs/dd_heart_traumas.dm new file mode 100644 index 000000000000..6610bc4963aa --- /dev/null +++ b/modular_ss220/prime_only/code/death_debuffs/dd_heart_traumas.dm @@ -0,0 +1,34 @@ +/datum/death_debuff/heart_failure + name = "прогрессирующий инфаркт" + reagent_list = list(/datum/reagent/medicine/mitocholide,/datum/reagent/medicine/epinephrine) + affected_zone = "heart" + applied_text = "Ваше сердце пронзает резкая боль, и кажется, она становится только сильнее." + removed_text = "Боль в сердце отступила." + +/datum/death_debuff/heart_failure/dd_effect() + . = ..() + var/obj/item/organ/organ = H.get_organ_slot(affected_zone) + if(!organ) + return + + //Сердце бьется неровно и вот-вот будет инфаркт + var/datum/disease/critical/heart_failure/CA + if(!(organ.owner.HasDisease(/datum/disease/critical/heart_failure))) + CA = new /datum/disease/critical/heart_failure + H.ForceContractDisease(CA) + +/datum/death_debuff/heart_mailfunction + name = "брадикардия" + reagent_list = list(/datum/reagent/medicine/mitocholide,/datum/reagent/medicine/ephedrine) + affected_zone = "heart" + applied_text = "Ваше сердце издает медленное, успокаивающее биение, и силы покидают вас." + removed_text = "Вы снова чувствуете прилив сил." + +/datum/death_debuff/heart_mailfunction/dd_effect() + . = ..() + var/obj/item/organ/organ = H.get_organ_slot(affected_zone) + if(!organ) + return + + //Сердце медленно бьется и пациент испытывает слабость + H.adjustStaminaLoss(state * 0.5) diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_kidney_traumas.dm b/modular_ss220/prime_only/code/death_debuffs/dd_kidney_traumas.dm new file mode 100644 index 000000000000..c6ab4d4a2ab6 --- /dev/null +++ b/modular_ss220/prime_only/code/death_debuffs/dd_kidney_traumas.dm @@ -0,0 +1,35 @@ +/datum/death_debuff/kidneys_failure + name = "отказ почек" + reagent_list = list(/datum/reagent/medicine/pen_acid) + affected_zone = "kidneys" + applied_text = "Вы чувствуете резь в районе чуть ниже спины." + removed_text = "Боль чуть ниже спины отступает." + +/datum/death_debuff/kidneys_failure/dd_effect() + . = ..() + var/obj/item/organ/organ = H.get_organ_slot(affected_zone) + if(!organ) + return + + //Почки начинают выбрасывать в организм токсины, в зависимости от силы дебаффа + organ.status |= ORGAN_DEAD + if(prob(50)) + H.adjustToxLoss(state * 0.01) + +/datum/death_debuff/kidneys_mailfunction + name = "почечная недостаточность" + reagent_list = list(/datum/reagent/medicine/calomel) + affected_zone = "kidneys" + applied_text = "Вы чувствуете легкий дискомфорт где-то в нижней части спины." + removed_text = "Ощущения в нижней части спины пришли в норму, и больше не приносят дискомфорт." + +/datum/death_debuff/kidneys_mailfunction/dd_effect() + . = ..() + var/obj/item/organ/organ = H.get_organ_slot(affected_zone) + if(!organ) + return + + //При употреблении пищи, почки вырабаьывают гистамин + for(var/datum/reagent/consumable/chemical in H.reagents.reagent_list) + if(!isnull(chemical)) + H.reagents.add_reagent("histamine", state * 0.01 * chemical.nutriment_factor) diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_limb_failure.dm b/modular_ss220/prime_only/code/death_debuffs/dd_limb_failure.dm new file mode 100644 index 000000000000..f33345bebddb --- /dev/null +++ b/modular_ss220/prime_only/code/death_debuffs/dd_limb_failure.dm @@ -0,0 +1,47 @@ +/datum/death_debuff/shaking_hands + name = "трасущиеся руки" + reagent_list = list(/datum/reagent/medicine/salglu_solution,/datum/reagent/medicine/sanguine_reagent) + affected_zone = "l_arm" + applied_text = "Ваша левая рука едва-заметно трясется" + removed_text = "Вы чувствуете, как ваша левая рука пришла в норму." + +/datum/death_debuff/shaking_hands/r_arm + affected_zone = "r_arm" + applied_text = "Ваша правая рука едва-заметно трясется" + removed_text = "Вы чувствуете, как ваша правая рука пришла в норму." + +/datum/death_debuff/shaking_hands/dd_effect() + . = ..() + var/obj/item/organ/organ = H.get_limb_by_name(affected_zone) + if(!organ) + return + + //Накладывает эффект дееспособности на конечность (считается словно ампутированная) + var/chance_drop = clamp(state,30,100) + if(prob(chance_drop)) + var/arm_slot = (affected_zone == "r_arm" ? SLOT_HUD_RIGHT_HAND : SLOT_HUD_LEFT_HAND) + var/obj/item/arm_item = organ.owner.get_item_by_slot(arm_slot) + organ.owner.unEquip(arm_item) + +/datum/death_debuff/muscular_weakness + name = "мышечная слабость" + reagent_list = list(/datum/reagent/medicine/salglu_solution,/datum/reagent/medicine/osseous_reagent) + affected_zone = "l_leg" + applied_text = "Ваша левая нога испытывает слабость и едва вас держит." + removed_text = "Вы чувствуете, как ваша левая нога пришла в норму." + +/datum/death_debuff/muscular_weakness/r_leg + affected_zone = "r_leg" + applied_text = "Ваша правая нога испытывает слабость и едва вас держит." + removed_text = "Вы чувствуете, как ваша правая нога пришла в норму." + +/datum/death_debuff/muscular_weakness/dd_effect() + . = ..() + var/obj/item/organ/organ = H.get_limb_by_name(affected_zone) + if(!organ) + return + + //Накладывает эффект дееспособности на конечность (считается словно ампутированная) + var/chance_drop = clamp(state*2,15,50) + if(prob(chance_drop)) + H.KnockDown(2 SECONDS) diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_liver_traumas.dm b/modular_ss220/prime_only/code/death_debuffs/dd_liver_traumas.dm new file mode 100644 index 000000000000..bed13adbab98 --- /dev/null +++ b/modular_ss220/prime_only/code/death_debuffs/dd_liver_traumas.dm @@ -0,0 +1,39 @@ +/datum/death_debuff/liver_failure + name = "отказ печени" + reagent_list = list(/datum/reagent/medicine/potass_iodide) + affected_zone = "liver" + applied_text = "Ваше тело пронзает резкая боль в районе печени." + removed_text = "Боль в районе печени отступила." + +/datum/death_debuff/liver_failure/dd_effect() + . = ..() + var/obj/item/organ/organ = H.get_organ_slot(affected_zone) + if(!organ) + return + + //Печень отмирает и начинает выбрасывать по 2 токсина в тело + organ.status |= ORGAN_DEAD + if(prob(33)) + H.adjustToxLoss(0.5) + +/datum/death_debuff/liver_mailfunction + name = "нарушение обмена веществ" + reagent_list = list(/datum/reagent/medicine/charcoal) + affected_zone = "liver" + applied_text = "Вы внезапно испытываете дикий, почти непреодолимый голод." + removed_text = "Похоже, ваше чувство насыщения вернулось." + +/datum/death_debuff/liver_mailfunction/dd_effect() + . = ..() + var/obj/item/organ/organ = H.get_organ_slot(affected_zone) + if(!organ) + return + + //Печень сбоит и повышает уровень голода жертвы + organ.owner.physiology.hunger_mod = state * 0.1 * initial(organ.owner.physiology.hunger_mod) + +/datum/death_debuff/liver_mailfunction/remove_debuff() + var/obj/item/organ/organ = H.get_organ_slot(affected_zone) + if(!organ) + organ.owner.physiology.hunger_mod = initial(organ.owner.physiology.hunger_mod) + . = ..() diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_lungs_traumas.dm b/modular_ss220/prime_only/code/death_debuffs/dd_lungs_traumas.dm new file mode 100644 index 000000000000..04619c2df0e0 --- /dev/null +++ b/modular_ss220/prime_only/code/death_debuffs/dd_lungs_traumas.dm @@ -0,0 +1,32 @@ +/datum/death_debuff/lungs_failure + name = "повреждение альвеол" + reagent_list = list(/datum/reagent/medicine/perfluorodecalin,/datum/reagent/medicine/salglu_solution) + affected_zone = "lungs" + applied_text = "Вам трудно дышать, вы жадно хватаете ртом воздух." + removed_text = "Ваше дыхание приходит в норму." + +/datum/death_debuff/lungs_failure/dd_effect() + . = ..() + var/obj/item/organ/organ = H.get_organ_slot(affected_zone) + if(!organ) + return + + //Легкие плохо работают и в итоге персонаж испытывает удушье + if(prob(50)) + H.adjustOxyLoss(state * 0.1) + +/datum/death_debuff/lungs_mailfunction + name = "переохлаждение легких" + reagent_list = list(/datum/reagent/medicine/teporone,/datum/reagent/medicine/heal_on_apply/silver_sulfadiazine) + affected_zone = "lungs" + applied_text = "Вы чувствуете холод в своих легких, который неприятно распротраняется по всему телу." + removed_text = "Похоже, озноб отступил." + +/datum/death_debuff/lungs_mailfunction/dd_effect() + . = ..() + var/obj/item/organ/organ = H.get_organ_slot(affected_zone) + if(!organ) + return + + //Легкие переохлаждены и снижают температуру тела владельца + organ.owner.bodytemperature -= 0.05 * state diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_paralyze.dm b/modular_ss220/prime_only/code/death_debuffs/dd_paralyze.dm new file mode 100644 index 000000000000..ee5aac9d8d26 --- /dev/null +++ b/modular_ss220/prime_only/code/death_debuffs/dd_paralyze.dm @@ -0,0 +1,47 @@ +/datum/death_debuff/paralyze + name = "паралич конечности" + reagent_list = list(/datum/reagent/medicine/mannitol,/datum/reagent/medicine/mitocholide) + affected_zone = "l_arm" + applied_text = "Вы понимаете, что с вашей левой рукой что-то не так и она почти безжизненно болтается." + removed_text = "Похоже, ваша левая рука снова в норме." + +/datum/death_debuff/paralyze/r_arm + affected_zone = "r_arm" + applied_text = "Вы понимаете, что с вашей правой рукой что-то не так и она почти безжизненно болтается." + removed_text = "Похоже, ваша правая рука снова в норме." + +/datum/death_debuff/paralyze/r_leg + affected_zone = "r_leg" + applied_text = "Вы понимаете, что с вашей левой ногой что-то не так и она почти безжизненно болтается." + removed_text = "Похоже, ваша левая нога снова в норме." + +/datum/death_debuff/paralyze/l_leg + affected_zone = "l_leg" + applied_text = "Вы понимаете, что с вашей правой ногой что-то не так и она почти безжизненно болтается." + removed_text = "Похоже, ваша правая нога снова в норме." + +/datum/death_debuff/paralyze/dd_effect() + . = ..() + var/obj/item/organ/external/organ = H.get_limb_by_name(affected_zone) + if(!organ) + return + + //Накладывает эффект дееспособности на конечность (считается словно ампутированная) + organ.paralyzed = TRUE + organ.children[1].paralyzed = TRUE + +/datum/death_debuff/paralyze/remove_debuff() + var/obj/item/organ/external/organ = H.get_limb_by_name(affected_zone) + if(organ) + organ.paralyzed = FALSE + organ.children[1].paralyzed = FALSE + . = ..() + + +/obj/item/organ/external + var/paralyzed = FALSE + +/obj/item/organ/external/is_malfunctioning() + if(paralyzed) + return TRUE + . = ..() diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_spazms.dm b/modular_ss220/prime_only/code/death_debuffs/dd_spazms.dm new file mode 100644 index 000000000000..47015e33ab72 --- /dev/null +++ b/modular_ss220/prime_only/code/death_debuffs/dd_spazms.dm @@ -0,0 +1,46 @@ +/datum/death_debuff/spazms + name = "спазм" + reagent_list = list(/datum/reagent/medicine/diphenhydramine,/datum/reagent/medicine/sal_acid) + affected_zone = "head" + applied_text = "Вашу голову пронзает резкая, пульсирующая боль." + removed_text = "Пульсирующая боль в вашей голове отступила." + +/datum/death_debuff/spazms/r_arm + affected_zone = "l_arm" + applied_text = "Вашу левую руку пронзает резкая, пульсирующая боль." + removed_text = "Пульсирующая боль в вашей левой руке отступила." + +/datum/death_debuff/spazms/r_arm + affected_zone = "r_arm" + applied_text = "Вашу правую руку пронзает резкая, пульсирующая боль." + removed_text = "Пульсирующая боль в вашей правой руке отступила." + +/datum/death_debuff/spazms/r_leg + affected_zone = "r_leg" + applied_text = "Вашу левую ногу пронзает резкая, пульсирующая боль." + removed_text = "Пульсирующая боль в вашей левой ноге отступила." + +/datum/death_debuff/spazms/l_leg + affected_zone = "l_leg" + applied_text = "Вашу правую ногу пронзает резкая, пульсирующая боль." + removed_text = "Пульсирующая боль в вашей правой ноге отступила." + +/datum/death_debuff/spazms/dd_effect() + . = ..() + var/obj/item/organ/organ = H.get_limb_by_name(affected_zone) + if(!organ) + return + + //Накладывает эффект спазма на конечность + if(prob(state)) + if(affected_zone == "r_arm" || affected_zone == "l_arm") + if(prob(15)) + var/arm_slot = (affected_zone == "r_arm" ? SLOT_HUD_RIGHT_HAND : SLOT_HUD_LEFT_HAND) + var/obj/item/arm_item = organ.owner.get_item_by_slot(arm_slot) + organ.owner.unEquip(arm_item) + else if(affected_zone == "r_leg" || affected_zone == "l_leg") + if(prob(10)) + H.KnockDown(0.5 SECONDS) + else + if(prob(33)) + H.Weaken(10 SECONDS) diff --git a/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm b/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm new file mode 100644 index 000000000000..39be3bbf0e2b --- /dev/null +++ b/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm @@ -0,0 +1,135 @@ +#define COMSIG_MOB_REVIVED "mob_revived" +#define COMSIG_MOB_ADV_SCANNED "mob_adv_scanned" +#define COMSIG_MOB_CLONNED "mob_bio_scanned" +#define COMSIG_MOB_GET_OLD_DDS "mob_get_old_dds" +#define DD_THRESHOLD 1 SECONDS //60 SECONDS + +/datum/component/death_debuff + var/death_count = 0 + var/list/applied_debuffs = list() + var/obj/item/organ/internal/brain/brain_item + var/death_time = 0 + +/datum/component/death_debuff/Initialize() + . = ..() + brain_item = parent + death_time = world.time + +/datum/component/death_debuff/RegisterWithParent() + RegisterSignal(parent, COMSIG_MOB_REVIVED, PROC_REF(apply_debuffs)) + RegisterSignal(parent, COMSIG_MOB_DEATH, PROC_REF(set_death_time)) + RegisterSignal(parent, COMSIG_BRAIN_UNDEBUFFED, PROC_REF(remove_debuff)) + RegisterSignal(parent, COMSIG_MOB_ADV_SCANNED, PROC_REF(brain_scan)) + RegisterSignal(parent, COMSIG_MOB_CLONNED, PROC_REF(clonning_transfer)) + RegisterSignal(parent, COMSIG_MOB_GET_OLD_DDS, PROC_REF(get_list)) + +/datum/component/death_debuff/UnregisterFromParent() + UnregisterSignal(parent, COMSIG_MOB_REVIVED) + UnregisterSignal(parent, COMSIG_MOB_DEATH) + UnregisterSignal(parent, COMSIG_BRAIN_UNDEBUFFED) + UnregisterSignal(parent, COMSIG_MOB_ADV_SCANNED) + UnregisterSignal(parent, COMSIG_MOB_CLONNED) + UnregisterSignal(parent, COMSIG_MOB_GET_OLD_DDS) + +/datum/component/death_debuff/proc/clonning_transfer(obj/item/organ/internal/brain/new_brain, obj/item/organ/internal/brain/old_brain,) + SIGNAL_HANDLER + . = list() + SEND_SIGNAL(old_brain, COMSIG_MOB_GET_OLD_DDS, .) + applied_debuffs = . + for(var/datum/death_debuff/debuff_selected in applied_debuffs) + debuff_selected.apply_debuff(brain_item.owner, debuff_selected.state) + +/datum/component/death_debuff/proc/get_list(obj/item/organ/internal/brain/source, list/income_list) + income_list = applied_debuffs + +/datum/component/death_debuff/proc/bio_scan(obj/item/organ/internal/brain/source, list/scan_list) + SIGNAL_HANDLER + for(var/datum/death_debuff/dd_check in applied_debuffs) + scan_list += dd_check.name + +/datum/component/death_debuff/proc/brain_scan(obj/item/organ/internal/brain/source, list/scan_list) + SIGNAL_HANDLER + for(var/datum/death_debuff/dd_check in applied_debuffs) + scan_list += dd_check.get_adv_analyzer_info() + +/datum/component/death_debuff/proc/set_death_time() + SIGNAL_HANDLER + death_time = world.time + +/datum/component/death_debuff/proc/remove_debuff(obj/item/organ/internal/brain/component_holder, datum/death_debuff/debuff) + SIGNAL_HANDLER + applied_debuffs -= debuff + +/datum/component/death_debuff/proc/apply_debuffs() + SIGNAL_HANDLER + if (world.time - death_time > DD_THRESHOLD) + death_count += 1 + //Наложить случайный дебафф + + for(var/i in 1 to death_count) + var/datum/death_debuff/debuff_selected = select_debuff() + + // Если найден подходящий дебафф, применяем его + if (debuff_selected) + debuff_selected.apply_debuff(brain_item.owner) + applied_debuffs += debuff_selected + +/datum/component/death_debuff/proc/select_debuff() + var/dd_candidate = null + var/list/available_debuffs = subtypesof(/datum/death_debuff) - applied_debuffs + var/list/affected_zones = list() + + for(var/datum/death_debuff/dd_check in applied_debuffs) + affected_zones += dd_check.affected_zone + + for(var/i in 1 to length(available_debuffs)) + var/datum/death_debuff/dd_check_candidate = pick(available_debuffs) + if(dd_check_candidate.affected_zone in affected_zones) + continue + else + dd_candidate = dd_check_candidate + break + + if(!dd_candidate) + dd_candidate = pick(available_debuffs) + + var/datum/death_debuff/debuff = new dd_candidate + return debuff + +/obj/item/organ/internal/brain/Initialize(mapload, datum/species/new_species) + . = ..() + AddComponent(/datum/component/death_debuff) + +#undef DD_THRESHOLD + +/mob/living/death(gibbed) + . = ..() + var/is_zombie = HAS_TRAIT(src, TRAIT_I_WANT_BRAINS) + if(ishuman(src) && !is_zombie) + var/obj/item/organ/internal/brain/brain_item = get_int_organ_tag("brain") + SEND_SIGNAL(brain_item, COMSIG_MOB_DEATH) + +/mob/living/update_revive() + . = ..() + var/is_zombie = HAS_TRAIT(src, TRAIT_I_WANT_BRAINS) + if(ishuman(src) && !is_zombie) + var/obj/item/organ/internal/brain/brain_item = get_int_organ_tag("brain") + SEND_SIGNAL(brain_item, COMSIG_MOB_REVIVED) + +/obj/item/healthanalyzer/attack(mob/living/M, mob/living/user) + . = ..() + var/is_zombie = HAS_TRAIT(src, TRAIT_I_WANT_BRAINS) + if(ishuman(M) && !is_zombie) + var/obj/item/organ/internal/brain/brain_item = M.get_int_organ_tag("brain") + . = list() + SEND_SIGNAL(brain_item, COMSIG_MOB_ADV_SCANNED, .) + var/list/result = . + to_chat(user, chat_box_healthscan(result.Join("
"))) + +/obj/machinery/clonepod/eject_clone(force = FALSE) + var/datum/mind/patient_mind = locateUID(patient_data.mindUID) + var/mob/living/carbon/human/original = locateUID(patient_mind.original_mob_UID) + var/obj/item/organ/internal/brain/old_brain = original.get_int_organ_tag("brain") + var/obj/item/organ/internal/brain/new_brain = clone.get_int_organ_tag("brain") + SEND_SIGNAL(new_brain, COMSIG_MOB_GET_OLD_DDS, old_brain) + . = ..() diff --git a/modular_ss220/prime_only/code/death_debuffs/death_debuffs.dm b/modular_ss220/prime_only/code/death_debuffs/death_debuffs.dm new file mode 100644 index 000000000000..e68aa7275fe3 --- /dev/null +++ b/modular_ss220/prime_only/code/death_debuffs/death_debuffs.dm @@ -0,0 +1,16 @@ +#include "death_debuffs_defines.dm" + +#include "dd_brain_traumas.dm" +#include "dd_ears_traumas.dm" +#include "dd_eyes_traumas.dm" +#include "dd_kidney_traumas.dm" +#include "dd_liver_traumas.dm" +#include "dd_lungs_traumas.dm" +#include "dd_heart_traumas.dm" + +#include "dd_head_trauma.dm" +#include "dd_limb_failure.dm" +#include "dd_spazms.dm" +#include "dd_paralyze.dm" + +#include "death_debuff_component.dm" diff --git a/modular_ss220/prime_only/code/death_debuffs/death_debuffs_defines.dm b/modular_ss220/prime_only/code/death_debuffs/death_debuffs_defines.dm new file mode 100644 index 000000000000..d460caa2888e --- /dev/null +++ b/modular_ss220/prime_only/code/death_debuffs/death_debuffs_defines.dm @@ -0,0 +1,120 @@ +#define DD_BASIC_HEALING_FACTOR 0.1 +#define DD_BASIC_STRENGTH_FACTOR 0.2 +#define COMSIG_BRAIN_UNDEBUFFED "brain_undebuffed" + +/datum/death_debuff + var/name = "basic death debuff" + var/state = 1 + var/list/datum/reagent/reagent_list = list(/datum/reagent/msg) + var/affected_zone = "brain" + var/mob/living/carbon/human/H + var/applied_text = "" + var/removed_text = "" + +/datum/death_debuff/process() + dd_effect() + +/datum/death_debuff/proc/dd_effect() + if(!H) + remove_debuff() + + threatment() + state = clamp(state, 0, 100) + if(state == 0) + remove_debuff() + +/datum/death_debuff/proc/threatment() + var/healing_factor = threatment_chemical() ? DD_BASIC_HEALING_FACTOR : 0 + healing_factor += threatment_medical() ? DD_BASIC_HEALING_FACTOR : 0 + healing_factor += (threatment_rest()) ? DD_BASIC_HEALING_FACTOR : 0 + //Добавить механизм нарастания эффекта, если игрок движется вне медицинского блока ходит + if(danger_condition()) + state += DD_BASIC_STRENGTH_FACTOR + else + state -= healing_factor + +/datum/death_debuff/proc/danger_condition() + var/area/area = get_area(H) + if(istype(area, /area/station/medical)) + return FALSE + + var/result = (world.time - H.last_movement < 10) + return result + +/datum/death_debuff/proc/threatment_chemical() + var/reagent_count = 0 + for(var/datum/reagent/R in H.reagents.reagent_list) + if (R in reagent_list) + reagent_count++ + + return (length(reagent_list) == reagent_count) + +/datum/death_debuff/proc/threatment_medical() + var/obj/buckled_object = H.buckled + if(buckled_object) + var/area/area = get_area(buckled_object) + if(istype(area, /area/station/medical)) + return TRUE + + return FALSE + +/datum/death_debuff/proc/threatment_rest() + var/resting_in_med = threatment_medical() && threatment_chemical() && H.IsSleeping() + return resting_in_med + +/datum/death_debuff/proc/apply_debuff(mob/living/carbon/human/victim, income_state = 100) + H = victim + state = income_state + to_chat(H, span_notice(applied_text)) + H.throw_alert("death_debuff", /atom/movable/screen/alert/death_debuff) + START_PROCESSING(SSfastprocess, src) + +/datum/death_debuff/proc/remove_debuff() + state = 0 + var/obj/item/organ/internal/brain/brain_item = H.get_int_organ_tag("brain") + to_chat(H, span_notice(removed_text)) + H.clear_alert("death_debuff") + H = null + SEND_SIGNAL(brain_item, COMSIG_BRAIN_UNDEBUFFED, src) + STOP_PROCESSING(SSfastprocess, src) + qdel(src) + +/datum/death_debuff/proc/get_adv_analyzer_info() + var/description = "WARNING! [name] detected! Affected: " + switch(affected_zone) + if("l_arm") + description += "left arm" + if("r_arm") + description += "right arm" + if("l_leg") + description += "left leg" + if("r_leg") + description += "right leg" + else + description += affected_zone + + description += "\n Threatment: " + + var/reagents_string + for(var/type in reagent_list) + var/datum/reagent/temp_reagent = new type + if(reagents_string) + reagents_string += ", " + reagents_string += temp_reagent.name + qdel(temp_reagent) + description += reagents_string + + return description + +#undef DD_BASIC_HEALING_FACTOR +#undef DD_BASIC_STRENGTH_FACTOR + +/atom/movable/screen/alert/death_debuff + icon = 'icons/mob/screen_alert.dmi' + name = "Слабость в теле." + desc = "Вы чувствуете слабость в теле." + icon_state = "weaken" + +/atom/movable/screen/alert/death_debuff/Click() + if(isliving(usr) && ..()) + to_chat(usr, span_notice("Вы чувствуете сильную слабость в своем теле. Возможно стоит обратиться за медицинской помощью.")) From 9a52af5cb178ec5769302d9f67a6a20832aef5fe Mon Sep 17 00:00:00 2001 From: KageIIte Date: Wed, 13 Nov 2024 08:21:06 +0300 Subject: [PATCH 2/7] =?UTF-8?q?=D0=9B=D0=B5=D0=B3=D0=BA=D0=B8=D0=B9=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=D1=87=D0=B5=D1=81=D0=BE=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../death_debuffs/death_debuff_component.dm | 2 +- .../death_debuffs/death_debuffs_defines.dm | 32 +++++++++++-------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm b/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm index 39be3bbf0e2b..f987a4dc9e9f 100644 --- a/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm +++ b/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm @@ -2,7 +2,7 @@ #define COMSIG_MOB_ADV_SCANNED "mob_adv_scanned" #define COMSIG_MOB_CLONNED "mob_bio_scanned" #define COMSIG_MOB_GET_OLD_DDS "mob_get_old_dds" -#define DD_THRESHOLD 1 SECONDS //60 SECONDS +#define DD_THRESHOLD 60 SECONDS /datum/component/death_debuff var/death_count = 0 diff --git a/modular_ss220/prime_only/code/death_debuffs/death_debuffs_defines.dm b/modular_ss220/prime_only/code/death_debuffs/death_debuffs_defines.dm index d460caa2888e..9ee4cc3cf9db 100644 --- a/modular_ss220/prime_only/code/death_debuffs/death_debuffs_defines.dm +++ b/modular_ss220/prime_only/code/death_debuffs/death_debuffs_defines.dm @@ -1,15 +1,18 @@ +#define DD_BASIC_PROGRESS_FACTOR 0.2 #define DD_BASIC_HEALING_FACTOR 0.1 -#define DD_BASIC_STRENGTH_FACTOR 0.2 +#define DD_BASIC_STATE 100 #define COMSIG_BRAIN_UNDEBUFFED "brain_undebuffed" /datum/death_debuff var/name = "basic death debuff" - var/state = 1 + var/state = DD_BASIC_STATE var/list/datum/reagent/reagent_list = list(/datum/reagent/msg) var/affected_zone = "brain" var/mob/living/carbon/human/H var/applied_text = "" var/removed_text = "" + var/healing_speed = DD_BASIC_HEALING_FACTOR + var/progress_speed = DD_BASIC_PROGRESS_FACTOR /datum/death_debuff/process() dd_effect() @@ -19,17 +22,17 @@ remove_debuff() threatment() - state = clamp(state, 0, 100) + state = clamp(state, 0, initial(state)) if(state == 0) remove_debuff() /datum/death_debuff/proc/threatment() - var/healing_factor = threatment_chemical() ? DD_BASIC_HEALING_FACTOR : 0 - healing_factor += threatment_medical() ? DD_BASIC_HEALING_FACTOR : 0 - healing_factor += (threatment_rest()) ? DD_BASIC_HEALING_FACTOR : 0 + var/healing_factor = threatment_chemical() ? healing_speed : 0 + healing_factor += threatment_medical() ? healing_speed : 0 + healing_factor += (threatment_rest()) ? healing_speed : 0 //Добавить механизм нарастания эффекта, если игрок движется вне медицинского блока ходит if(danger_condition()) - state += DD_BASIC_STRENGTH_FACTOR + state += progress_speed else state -= healing_factor @@ -80,20 +83,20 @@ qdel(src) /datum/death_debuff/proc/get_adv_analyzer_info() - var/description = "WARNING! [name] detected! Affected: " + var/description = "Внимание! Обнаружено: [name]! Зона поражения: " switch(affected_zone) if("l_arm") - description += "left arm" + description += "левая рука" if("r_arm") - description += "right arm" + description += "правая рука" if("l_leg") - description += "left leg" + description += "левая нога" if("r_leg") - description += "right leg" + description += "правая нога" else description += affected_zone - description += "\n Threatment: " + description += "\n Лечение: " var/reagents_string for(var/type in reagent_list) @@ -107,7 +110,8 @@ return description #undef DD_BASIC_HEALING_FACTOR -#undef DD_BASIC_STRENGTH_FACTOR +#undef DD_BASIC_PROGRESS_FACTOR +#undef DD_BASIC_STATE /atom/movable/screen/alert/death_debuff icon = 'icons/mob/screen_alert.dmi' From 7fccb1eabf019d7d34a8a1dbf37efdb8c35ef6f6 Mon Sep 17 00:00:00 2001 From: KageIIte Date: Wed, 13 Nov 2024 08:25:08 +0300 Subject: [PATCH 3/7] =?UTF-8?q?=D0=9B=D0=B8=D0=BD=D1=82=D0=B5=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../prime_only/code/death_debuffs/death_debuff_component.dm | 4 ++-- .../prime_only/code/death_debuffs/death_debuffs_defines.dm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm b/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm index f987a4dc9e9f..0311f4698660 100644 --- a/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm +++ b/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm @@ -62,7 +62,7 @@ /datum/component/death_debuff/proc/apply_debuffs() SIGNAL_HANDLER - if (world.time - death_time > DD_THRESHOLD) + if(world.time - death_time > DD_THRESHOLD) death_count += 1 //Наложить случайный дебафф @@ -70,7 +70,7 @@ var/datum/death_debuff/debuff_selected = select_debuff() // Если найден подходящий дебафф, применяем его - if (debuff_selected) + if(debuff_selected) debuff_selected.apply_debuff(brain_item.owner) applied_debuffs += debuff_selected diff --git a/modular_ss220/prime_only/code/death_debuffs/death_debuffs_defines.dm b/modular_ss220/prime_only/code/death_debuffs/death_debuffs_defines.dm index 9ee4cc3cf9db..4327b5302a47 100644 --- a/modular_ss220/prime_only/code/death_debuffs/death_debuffs_defines.dm +++ b/modular_ss220/prime_only/code/death_debuffs/death_debuffs_defines.dm @@ -47,7 +47,7 @@ /datum/death_debuff/proc/threatment_chemical() var/reagent_count = 0 for(var/datum/reagent/R in H.reagents.reagent_list) - if (R in reagent_list) + if(R in reagent_list) reagent_count++ return (length(reagent_list) == reagent_count) From c4d90c60d34685502f2a40cb3e77cb7f7df13dd7 Mon Sep 17 00:00:00 2001 From: KageIIte Date: Wed, 13 Nov 2024 09:06:08 +0300 Subject: [PATCH 4/7] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=81?= =?UTF-8?q?=D1=82=D1=80=D1=83=D0=BA=D1=83=D1=82=D1=83=D1=80=D1=8B=20=D0=BD?= =?UTF-8?q?=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88=D0=B0=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modular_ss220/prime_only/_prime.dme | 2 +- .../code/death_debuffs/{death_debuffs.dm => death_debuffs.dme} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename modular_ss220/prime_only/code/death_debuffs/{death_debuffs.dm => death_debuffs.dme} (100%) diff --git a/modular_ss220/prime_only/_prime.dme b/modular_ss220/prime_only/_prime.dme index 833c1411057a..e49e26ed052a 100644 --- a/modular_ss220/prime_only/_prime.dme +++ b/modular_ss220/prime_only/_prime.dme @@ -10,4 +10,4 @@ #include "code/vending.dm" #include "code/crematorium.dm" #include "code/shuttle_gib.dm" -#include "code/death_debuffs/death_debuffs.dm" +#include "code/death_debuffs/death_debuffs.dme" diff --git a/modular_ss220/prime_only/code/death_debuffs/death_debuffs.dm b/modular_ss220/prime_only/code/death_debuffs/death_debuffs.dme similarity index 100% rename from modular_ss220/prime_only/code/death_debuffs/death_debuffs.dm rename to modular_ss220/prime_only/code/death_debuffs/death_debuffs.dme From c220b254493cba6463a2f54366b22a85798ebb63 Mon Sep 17 00:00:00 2001 From: KageIIte Date: Wed, 13 Nov 2024 10:16:11 +0300 Subject: [PATCH 5/7] =?UTF-8?q?=D0=A0=D1=83=D1=81=D1=81=D0=B8=D1=84=D0=B8?= =?UTF-8?q?=D0=BA=D0=B0=D1=86=D0=B8=D1=8F,=20=D0=B8=D0=B7=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=D1=82=D1=80=D1=83=D0=BA?= =?UTF-8?q?=D1=82=D1=83=D1=80=D1=8B=20=D0=BD=D0=B0=20=D0=BE=D1=80=D0=B3?= =?UTF-8?q?=D0=B0=D0=BD=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../death_debuffs/dd_basic_deffenitions.dm | 31 +++++++++++++++++++ .../code/death_debuffs/dd_brain_traumas.dm | 10 +++--- .../code/death_debuffs/dd_ears_traumas.dm | 12 +++---- .../code/death_debuffs/dd_eyes_traumas.dm | 12 +++---- .../code/death_debuffs/dd_head_trauma.dm | 5 ++- .../code/death_debuffs/dd_heart_traumas.dm | 10 +++--- .../code/death_debuffs/dd_kidney_traumas.dm | 10 +++--- .../code/death_debuffs/dd_liver_traumas.dm | 12 +++---- .../code/death_debuffs/dd_lungs_traumas.dm | 10 +++--- .../death_debuffs/death_debuff_component.dm | 12 ++++++- .../code/death_debuffs/death_debuffs.dme | 2 ++ .../death_debuffs/death_debuffs_defines.dm | 3 +- 12 files changed, 79 insertions(+), 50 deletions(-) create mode 100644 modular_ss220/prime_only/code/death_debuffs/dd_basic_deffenitions.dm diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_basic_deffenitions.dm b/modular_ss220/prime_only/code/death_debuffs/dd_basic_deffenitions.dm new file mode 100644 index 000000000000..2142dc1cfa27 --- /dev/null +++ b/modular_ss220/prime_only/code/death_debuffs/dd_basic_deffenitions.dm @@ -0,0 +1,31 @@ +/datum/death_debuff/brain + affected_zone = "brain" + scanned_zone = "мозг" + +/datum/death_debuff/ears + affected_zone = "ears" + scanned_zone = "уши" + +/datum/death_debuff/eyes + affected_zone = "eyes" + scanned_zone = "глаза" + +/datum/death_debuff/heart + affected_zone = "heart" + scanned_zone = "сердце" + +/datum/death_debuff/lungs + affected_zone = "lungs" + scanned_zone = "легкие" + +/datum/death_debuff/liver + affected_zone = "liver" + scanned_zone = "печень" + +/datum/death_debuff/kidneys + affected_zone = "kidneys" + scanned_zone = "почки" + +/datum/death_debuff/head + affected_zone = "head" + scanned_zone = "голова" diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_brain_traumas.dm b/modular_ss220/prime_only/code/death_debuffs/dd_brain_traumas.dm index 0e90687bb855..c8dbf731be4c 100644 --- a/modular_ss220/prime_only/code/death_debuffs/dd_brain_traumas.dm +++ b/modular_ss220/prime_only/code/death_debuffs/dd_brain_traumas.dm @@ -1,11 +1,10 @@ -/datum/death_debuff/brain_hallucination +/datum/death_debuff/brain/hallucination name = "посттравматическое стрессовое расстройство" reagent_list = list(/datum/reagent/medicine/mannitol,/datum/reagent/medicine/sterilizine) - affected_zone = "brain" applied_text = "Вы начинаете видеть необычные вещи." removed_text = "Похоже призраки прошлого решили оставить вас." -/datum/death_debuff/brain_hallucination/dd_effect() +/datum/death_debuff/brain/hallucination/dd_effect() . = ..() var/obj/item/organ/organ = H.get_organ_slot(affected_zone) if(!organ) @@ -14,14 +13,13 @@ //Вызывает эффект галлюцинаций H.AdjustHallucinate(2 SECONDS) -/datum/death_debuff/brain_confusion +/datum/death_debuff/brain/confusion name = "сильное сотрясение мозга" reagent_list = list(/datum/reagent/medicine/mannitol,/datum/reagent/medicine/omnizine) - affected_zone = "brain" applied_text = "Либо вы, либо весь мир решил кружиться в вальсе." removed_text = "Вы снова нормально видите этот мир." -/datum/death_debuff/brain_confusion/dd_effect() +/datum/death_debuff/brain/confusion/dd_effect() . = ..() var/obj/item/organ/organ = H.get_organ_slot(affected_zone) if(!organ) diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_ears_traumas.dm b/modular_ss220/prime_only/code/death_debuffs/dd_ears_traumas.dm index 833c01e425c9..fa1c03052f5a 100644 --- a/modular_ss220/prime_only/code/death_debuffs/dd_ears_traumas.dm +++ b/modular_ss220/prime_only/code/death_debuffs/dd_ears_traumas.dm @@ -1,11 +1,10 @@ -/datum/death_debuff/ears_destruction +/datum/death_debuff/ears/destruction name = "разрушение нервного узла" reagent_list = list(/datum/reagent/medicine/oculine,/datum/reagent/medicine/mannitol) - affected_zone = "ears" applied_text = "Вы осознаете, что полностью потеряли слух." removed_text = "До вас начинают доносится какие-то звуки." -/datum/death_debuff/ears_destruction/dd_effect() +/datum/death_debuff/ears/destruction/dd_effect() . = ..() var/obj/item/organ/organ = H.get_organ_slot(affected_zone) if(!organ) @@ -14,14 +13,13 @@ //Накладывает эффект глухоты organ.status |= ORGAN_DEAD -/datum/death_debuff/ears_mailfuction +/datum/death_debuff/ears/mailfuction name = "кровоизлияние барабанной перепонки" reagent_list = list(/datum/reagent/medicine/oculine,/datum/reagent/medicine/heal_on_apply/styptic_powder) - affected_zone = "ears" - applied_text = "Вам становится чуть теплее в районе уха и гоегоову пронзает острая боль." + applied_text = "Вам становится чуть теплее в районе уха и его пронзает острая боль." removed_text = "Боль в районе уха отступила." -/datum/death_debuff/ears_mailfuction/dd_effect() +/datum/death_debuff/ears/mailfuction/dd_effect() . = ..() var/obj/item/organ/organ = H.get_organ_slot(affected_zone) if(!organ) diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_eyes_traumas.dm b/modular_ss220/prime_only/code/death_debuffs/dd_eyes_traumas.dm index 6f6b78216767..4effe0c8e651 100644 --- a/modular_ss220/prime_only/code/death_debuffs/dd_eyes_traumas.dm +++ b/modular_ss220/prime_only/code/death_debuffs/dd_eyes_traumas.dm @@ -1,11 +1,10 @@ -/datum/death_debuff/eyes_destruction +/datum/death_debuff/eyes/destruction name = "повреждение затылочной доли" reagent_list = list(/datum/reagent/medicine/oculine,/datum/reagent/medicine/salglu_solution) - affected_zone = "eyes" applied_text = "Вы осознаете, что полностью потеряли зрение." removed_text = "Пелена на глазах отступает." -/datum/death_debuff/eyes_destruction/dd_effect() +/datum/death_debuff/eyes/destruction/dd_effect() . = ..() var/obj/item/organ/organ = H.get_organ_slot(affected_zone) if(!organ) @@ -14,14 +13,13 @@ //Накладывает эффект полной слепоты organ.status |= ORGAN_DEAD -/datum/death_debuff/eyes_mailfuction +/datum/death_debuff/eyes/mailfuction name = "травма зрительного нерва" reagent_list = list(/datum/reagent/medicine/oculine,/datum/reagent/medicine/heal_on_apply/silver_sulfadiazine) - affected_zone = "eyes" applied_text = "Глаза пронзает резкая боль, все кажется слишком ярким." removed_text = "Похоже что резь в глазах от яркого света отступила." -/datum/death_debuff/eyes_mailfuction/dd_effect() +/datum/death_debuff/eyes/mailfuction/dd_effect() . = ..() var/obj/item/organ/internal/eyes/organ = H.get_organ_slot(affected_zone) if(!organ) @@ -33,7 +31,7 @@ H.SetEyeBlurry(state*0.1 SECONDS) H.SetEyeBlind(state*0.01 SECONDS) -/datum/death_debuff/liver_mailfunction/remove_debuff() +/datum/death_debuff/eyes/mailfuction/remove_debuff() var/obj/item/organ/internal/eyes/organ = H.get_organ_slot(affected_zone) if(!organ) organ.flash_protect = initial(organ.flash_protect) diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_head_trauma.dm b/modular_ss220/prime_only/code/death_debuffs/dd_head_trauma.dm index e2974336c678..b9010615e9dd 100644 --- a/modular_ss220/prime_only/code/death_debuffs/dd_head_trauma.dm +++ b/modular_ss220/prime_only/code/death_debuffs/dd_head_trauma.dm @@ -1,11 +1,10 @@ -/datum/death_debuff/head_trauma +/datum/death_debuff/head/trauma name = "мозговая травма" reagent_list = list(/datum/chemical_reaction/mannitol,/datum/chemical_reaction/osseous_reagent) - affected_zone = "head" applied_text = "Вашу голову пронзила резкая, давящая боль." removed_text = "Боль в голове постепенно отступила." -/datum/death_debuff/head_trauma/dd_effect() +/datum/death_debuff/head/trauma/dd_effect() . = ..() var/obj/item/organ/organ = H.get_limb_by_name(affected_zone) if(!organ) diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_heart_traumas.dm b/modular_ss220/prime_only/code/death_debuffs/dd_heart_traumas.dm index 6610bc4963aa..f521517819bd 100644 --- a/modular_ss220/prime_only/code/death_debuffs/dd_heart_traumas.dm +++ b/modular_ss220/prime_only/code/death_debuffs/dd_heart_traumas.dm @@ -1,11 +1,10 @@ -/datum/death_debuff/heart_failure +/datum/death_debuff/heart/failure name = "прогрессирующий инфаркт" reagent_list = list(/datum/reagent/medicine/mitocholide,/datum/reagent/medicine/epinephrine) - affected_zone = "heart" applied_text = "Ваше сердце пронзает резкая боль, и кажется, она становится только сильнее." removed_text = "Боль в сердце отступила." -/datum/death_debuff/heart_failure/dd_effect() +/datum/death_debuff/heart/failure/dd_effect() . = ..() var/obj/item/organ/organ = H.get_organ_slot(affected_zone) if(!organ) @@ -17,14 +16,13 @@ CA = new /datum/disease/critical/heart_failure H.ForceContractDisease(CA) -/datum/death_debuff/heart_mailfunction +/datum/death_debuff/heart/mailfunction name = "брадикардия" reagent_list = list(/datum/reagent/medicine/mitocholide,/datum/reagent/medicine/ephedrine) - affected_zone = "heart" applied_text = "Ваше сердце издает медленное, успокаивающее биение, и силы покидают вас." removed_text = "Вы снова чувствуете прилив сил." -/datum/death_debuff/heart_mailfunction/dd_effect() +/datum/death_debuff/heart/mailfunction/dd_effect() . = ..() var/obj/item/organ/organ = H.get_organ_slot(affected_zone) if(!organ) diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_kidney_traumas.dm b/modular_ss220/prime_only/code/death_debuffs/dd_kidney_traumas.dm index c6ab4d4a2ab6..074dbbcf4d61 100644 --- a/modular_ss220/prime_only/code/death_debuffs/dd_kidney_traumas.dm +++ b/modular_ss220/prime_only/code/death_debuffs/dd_kidney_traumas.dm @@ -1,11 +1,10 @@ -/datum/death_debuff/kidneys_failure +/datum/death_debuff/kidneys/failure name = "отказ почек" reagent_list = list(/datum/reagent/medicine/pen_acid) - affected_zone = "kidneys" applied_text = "Вы чувствуете резь в районе чуть ниже спины." removed_text = "Боль чуть ниже спины отступает." -/datum/death_debuff/kidneys_failure/dd_effect() +/datum/death_debuff/kidneys/failure/dd_effect() . = ..() var/obj/item/organ/organ = H.get_organ_slot(affected_zone) if(!organ) @@ -16,14 +15,13 @@ if(prob(50)) H.adjustToxLoss(state * 0.01) -/datum/death_debuff/kidneys_mailfunction +/datum/death_debuff/kidneys/mailfunction name = "почечная недостаточность" reagent_list = list(/datum/reagent/medicine/calomel) - affected_zone = "kidneys" applied_text = "Вы чувствуете легкий дискомфорт где-то в нижней части спины." removed_text = "Ощущения в нижней части спины пришли в норму, и больше не приносят дискомфорт." -/datum/death_debuff/kidneys_mailfunction/dd_effect() +/datum/death_debuff/kidneys/mailfunction/dd_effect() . = ..() var/obj/item/organ/organ = H.get_organ_slot(affected_zone) if(!organ) diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_liver_traumas.dm b/modular_ss220/prime_only/code/death_debuffs/dd_liver_traumas.dm index bed13adbab98..a5c25b208209 100644 --- a/modular_ss220/prime_only/code/death_debuffs/dd_liver_traumas.dm +++ b/modular_ss220/prime_only/code/death_debuffs/dd_liver_traumas.dm @@ -1,11 +1,10 @@ -/datum/death_debuff/liver_failure +/datum/death_debuff/liver/failure name = "отказ печени" reagent_list = list(/datum/reagent/medicine/potass_iodide) - affected_zone = "liver" applied_text = "Ваше тело пронзает резкая боль в районе печени." removed_text = "Боль в районе печени отступила." -/datum/death_debuff/liver_failure/dd_effect() +/datum/death_debuff/liver/failure/dd_effect() . = ..() var/obj/item/organ/organ = H.get_organ_slot(affected_zone) if(!organ) @@ -16,14 +15,13 @@ if(prob(33)) H.adjustToxLoss(0.5) -/datum/death_debuff/liver_mailfunction +/datum/death_debuff/liver/mailfunction name = "нарушение обмена веществ" reagent_list = list(/datum/reagent/medicine/charcoal) - affected_zone = "liver" applied_text = "Вы внезапно испытываете дикий, почти непреодолимый голод." removed_text = "Похоже, ваше чувство насыщения вернулось." -/datum/death_debuff/liver_mailfunction/dd_effect() +/datum/death_debuff/liver/mailfunction/dd_effect() . = ..() var/obj/item/organ/organ = H.get_organ_slot(affected_zone) if(!organ) @@ -32,7 +30,7 @@ //Печень сбоит и повышает уровень голода жертвы organ.owner.physiology.hunger_mod = state * 0.1 * initial(organ.owner.physiology.hunger_mod) -/datum/death_debuff/liver_mailfunction/remove_debuff() +/datum/death_debuff/liver/mailfunction/remove_debuff() var/obj/item/organ/organ = H.get_organ_slot(affected_zone) if(!organ) organ.owner.physiology.hunger_mod = initial(organ.owner.physiology.hunger_mod) diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_lungs_traumas.dm b/modular_ss220/prime_only/code/death_debuffs/dd_lungs_traumas.dm index 04619c2df0e0..0f29aa5b7666 100644 --- a/modular_ss220/prime_only/code/death_debuffs/dd_lungs_traumas.dm +++ b/modular_ss220/prime_only/code/death_debuffs/dd_lungs_traumas.dm @@ -1,11 +1,10 @@ -/datum/death_debuff/lungs_failure +/datum/death_debuff/lungs/failure name = "повреждение альвеол" reagent_list = list(/datum/reagent/medicine/perfluorodecalin,/datum/reagent/medicine/salglu_solution) - affected_zone = "lungs" applied_text = "Вам трудно дышать, вы жадно хватаете ртом воздух." removed_text = "Ваше дыхание приходит в норму." -/datum/death_debuff/lungs_failure/dd_effect() +/datum/death_debuff/lungs/failure/dd_effect() . = ..() var/obj/item/organ/organ = H.get_organ_slot(affected_zone) if(!organ) @@ -15,14 +14,13 @@ if(prob(50)) H.adjustOxyLoss(state * 0.1) -/datum/death_debuff/lungs_mailfunction +/datum/death_debuff/lungs/mailfunction name = "переохлаждение легких" reagent_list = list(/datum/reagent/medicine/teporone,/datum/reagent/medicine/heal_on_apply/silver_sulfadiazine) - affected_zone = "lungs" applied_text = "Вы чувствуете холод в своих легких, который неприятно распротраняется по всему телу." removed_text = "Похоже, озноб отступил." -/datum/death_debuff/lungs_mailfunction/dd_effect() +/datum/death_debuff/lungs/mailfunction/dd_effect() . = ..() var/obj/item/organ/organ = H.get_organ_slot(affected_zone) if(!organ) diff --git a/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm b/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm index 0311f4698660..8dd87c73b7be 100644 --- a/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm +++ b/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm @@ -9,6 +9,16 @@ var/list/applied_debuffs = list() var/obj/item/organ/internal/brain/brain_item var/death_time = 0 + var/dd_blacklist = list( + /datum/death_debuff/brain, + /datum/death_debuff/ears, + /datum/death_debuff/eyes, + /datum/death_debuff/heart, + /datum/death_debuff/lungs, + /datum/death_debuff/liver, + /datum/death_debuff/kidneys, + /datum/death_debuff/head + ) /datum/component/death_debuff/Initialize() . = ..() @@ -76,7 +86,7 @@ /datum/component/death_debuff/proc/select_debuff() var/dd_candidate = null - var/list/available_debuffs = subtypesof(/datum/death_debuff) - applied_debuffs + var/list/available_debuffs = subtypesof(/datum/death_debuff) - dd_blacklist - applied_debuffs var/list/affected_zones = list() for(var/datum/death_debuff/dd_check in applied_debuffs) diff --git a/modular_ss220/prime_only/code/death_debuffs/death_debuffs.dme b/modular_ss220/prime_only/code/death_debuffs/death_debuffs.dme index e68aa7275fe3..68b52424d51c 100644 --- a/modular_ss220/prime_only/code/death_debuffs/death_debuffs.dme +++ b/modular_ss220/prime_only/code/death_debuffs/death_debuffs.dme @@ -1,5 +1,7 @@ #include "death_debuffs_defines.dm" +#include "dd_basic_deffenitions.dm" + #include "dd_brain_traumas.dm" #include "dd_ears_traumas.dm" #include "dd_eyes_traumas.dm" diff --git a/modular_ss220/prime_only/code/death_debuffs/death_debuffs_defines.dm b/modular_ss220/prime_only/code/death_debuffs/death_debuffs_defines.dm index 4327b5302a47..eacbc62ff213 100644 --- a/modular_ss220/prime_only/code/death_debuffs/death_debuffs_defines.dm +++ b/modular_ss220/prime_only/code/death_debuffs/death_debuffs_defines.dm @@ -8,6 +8,7 @@ var/state = DD_BASIC_STATE var/list/datum/reagent/reagent_list = list(/datum/reagent/msg) var/affected_zone = "brain" + var/scanned_zone = "мозг" var/mob/living/carbon/human/H var/applied_text = "" var/removed_text = "" @@ -94,7 +95,7 @@ if("r_leg") description += "правая нога" else - description += affected_zone + description += scanned_zone description += "\n Лечение: " From 5f68522d5b23092e53a471f51bb5624fa5725d85 Mon Sep 17 00:00:00 2001 From: KageIIte Date: Wed, 13 Nov 2024 12:43:49 +0300 Subject: [PATCH 6/7] =?UTF-8?q?=D0=A1=D0=BD=D0=B8=D0=BC=D0=B0=D0=B5=D0=BC?= =?UTF-8?q?=20=D1=8D=D1=84=D1=84=D0=B5=D0=BA=D1=82=D1=8B=20=D1=81=20=D0=B3?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=D0=BA=D1=80=D0=B0=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../code/death_debuffs/death_debuff_component.dm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm b/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm index 8dd87c73b7be..80274fe4d3b7 100644 --- a/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm +++ b/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm @@ -72,6 +72,9 @@ /datum/component/death_debuff/proc/apply_debuffs() SIGNAL_HANDLER + if(IS_CHANGELING(brain_item.owner)) + return + if(world.time - death_time > DD_THRESHOLD) death_count += 1 //Наложить случайный дебафф @@ -108,7 +111,9 @@ /obj/item/organ/internal/brain/Initialize(mapload, datum/species/new_species) . = ..() - AddComponent(/datum/component/death_debuff) + if(!IS_CHANGELING(owner)) + AddComponent(/datum/component/death_debuff) + #undef DD_THRESHOLD From 57968ba15e77e105ab0feeb5f66050ba480ddab2 Mon Sep 17 00:00:00 2001 From: KageIIte Date: Thu, 14 Nov 2024 00:09:27 +0300 Subject: [PATCH 7/7] =?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=D0=B4=20=D0=B8=D0=B7=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=A2=D0=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../code/death_debuffs/dd_head_trauma.dm | 3 +- .../code/death_debuffs/dd_heart_traumas.dm | 5 +- .../code/death_debuffs/dd_kidney_traumas.dm | 4 +- .../code/death_debuffs/dd_liver_traumas.dm | 4 +- .../code/death_debuffs/dd_lungs_traumas.dm | 2 +- .../death_debuffs/death_debuff_component.dm | 49 +++++++++++++++---- .../death_debuffs/death_debuffs_defines.dm | 31 +++++++++--- 7 files changed, 75 insertions(+), 23 deletions(-) diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_head_trauma.dm b/modular_ss220/prime_only/code/death_debuffs/dd_head_trauma.dm index b9010615e9dd..0fe7e9af474b 100644 --- a/modular_ss220/prime_only/code/death_debuffs/dd_head_trauma.dm +++ b/modular_ss220/prime_only/code/death_debuffs/dd_head_trauma.dm @@ -11,4 +11,5 @@ return //Накладывает эффект дееспособности на конечность (считается словно ампутированная) - H.adjustBrainLoss(0.02) + if(H.stat != DEAD) + H.adjustBrainLoss(0.02) diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_heart_traumas.dm b/modular_ss220/prime_only/code/death_debuffs/dd_heart_traumas.dm index f521517819bd..7fbf2d375996 100644 --- a/modular_ss220/prime_only/code/death_debuffs/dd_heart_traumas.dm +++ b/modular_ss220/prime_only/code/death_debuffs/dd_heart_traumas.dm @@ -12,7 +12,7 @@ //Сердце бьется неровно и вот-вот будет инфаркт var/datum/disease/critical/heart_failure/CA - if(!(organ.owner.HasDisease(/datum/disease/critical/heart_failure))) + if(!(H.HasDisease(/datum/disease/critical/heart_failure)) && H.stat != DEAD) CA = new /datum/disease/critical/heart_failure H.ForceContractDisease(CA) @@ -29,4 +29,5 @@ return //Сердце медленно бьется и пациент испытывает слабость - H.adjustStaminaLoss(state * 0.5) + if(H.stat != DEAD) + H.adjustStaminaLoss(state * 0.5) diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_kidney_traumas.dm b/modular_ss220/prime_only/code/death_debuffs/dd_kidney_traumas.dm index 074dbbcf4d61..64f17efde8f6 100644 --- a/modular_ss220/prime_only/code/death_debuffs/dd_kidney_traumas.dm +++ b/modular_ss220/prime_only/code/death_debuffs/dd_kidney_traumas.dm @@ -12,8 +12,8 @@ //Почки начинают выбрасывать в организм токсины, в зависимости от силы дебаффа organ.status |= ORGAN_DEAD - if(prob(50)) - H.adjustToxLoss(state * 0.01) + if(prob(50) && H.stat != DEAD) + H.adjustToxLoss(state * 0.001) /datum/death_debuff/kidneys/mailfunction name = "почечная недостаточность" diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_liver_traumas.dm b/modular_ss220/prime_only/code/death_debuffs/dd_liver_traumas.dm index a5c25b208209..28609ae79b24 100644 --- a/modular_ss220/prime_only/code/death_debuffs/dd_liver_traumas.dm +++ b/modular_ss220/prime_only/code/death_debuffs/dd_liver_traumas.dm @@ -12,8 +12,8 @@ //Печень отмирает и начинает выбрасывать по 2 токсина в тело organ.status |= ORGAN_DEAD - if(prob(33)) - H.adjustToxLoss(0.5) + if(prob(33) && H.stat != DEAD) + H.adjustToxLoss(0.25) /datum/death_debuff/liver/mailfunction name = "нарушение обмена веществ" diff --git a/modular_ss220/prime_only/code/death_debuffs/dd_lungs_traumas.dm b/modular_ss220/prime_only/code/death_debuffs/dd_lungs_traumas.dm index 0f29aa5b7666..1874288fb35e 100644 --- a/modular_ss220/prime_only/code/death_debuffs/dd_lungs_traumas.dm +++ b/modular_ss220/prime_only/code/death_debuffs/dd_lungs_traumas.dm @@ -11,7 +11,7 @@ return //Легкие плохо работают и в итоге персонаж испытывает удушье - if(prob(50)) + if(prob(50) && H.stat != DEAD) H.adjustOxyLoss(state * 0.1) /datum/death_debuff/lungs/mailfunction diff --git a/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm b/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm index 80274fe4d3b7..6a633cc83028 100644 --- a/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm +++ b/modular_ss220/prime_only/code/death_debuffs/death_debuff_component.dm @@ -1,7 +1,8 @@ #define COMSIG_MOB_REVIVED "mob_revived" #define COMSIG_MOB_ADV_SCANNED "mob_adv_scanned" #define COMSIG_MOB_CLONNED "mob_bio_scanned" -#define COMSIG_MOB_GET_OLD_DDS "mob_get_old_dds" +#define COMSIG_MOB_GET_DDS "mob_get_old_dds" +#define COMSIG_MOB_GIVES_CARE "mob_gives_care" #define DD_THRESHOLD 60 SECONDS /datum/component/death_debuff @@ -19,6 +20,7 @@ /datum/death_debuff/kidneys, /datum/death_debuff/head ) + var/currently_care = FALSE /datum/component/death_debuff/Initialize() . = ..() @@ -31,7 +33,8 @@ RegisterSignal(parent, COMSIG_BRAIN_UNDEBUFFED, PROC_REF(remove_debuff)) RegisterSignal(parent, COMSIG_MOB_ADV_SCANNED, PROC_REF(brain_scan)) RegisterSignal(parent, COMSIG_MOB_CLONNED, PROC_REF(clonning_transfer)) - RegisterSignal(parent, COMSIG_MOB_GET_OLD_DDS, PROC_REF(get_list)) + RegisterSignal(parent, COMSIG_MOB_GET_DDS, PROC_REF(get_list)) + RegisterSignal(parent, COMSIG_MOB_GIVES_CARE, PROC_REF(pre_give_threatment)) /datum/component/death_debuff/UnregisterFromParent() UnregisterSignal(parent, COMSIG_MOB_REVIVED) @@ -39,25 +42,27 @@ UnregisterSignal(parent, COMSIG_BRAIN_UNDEBUFFED) UnregisterSignal(parent, COMSIG_MOB_ADV_SCANNED) UnregisterSignal(parent, COMSIG_MOB_CLONNED) - UnregisterSignal(parent, COMSIG_MOB_GET_OLD_DDS) + UnregisterSignal(parent, COMSIG_MOB_GET_DDS) + UnregisterSignal(parent, COMSIG_MOB_GIVES_CARE) /datum/component/death_debuff/proc/clonning_transfer(obj/item/organ/internal/brain/new_brain, obj/item/organ/internal/brain/old_brain,) SIGNAL_HANDLER . = list() - SEND_SIGNAL(old_brain, COMSIG_MOB_GET_OLD_DDS, .) + SEND_SIGNAL(old_brain, COMSIG_MOB_GET_DDS, .) applied_debuffs = . for(var/datum/death_debuff/debuff_selected in applied_debuffs) debuff_selected.apply_debuff(brain_item.owner, debuff_selected.state) -/datum/component/death_debuff/proc/get_list(obj/item/organ/internal/brain/source, list/income_list) +/datum/component/death_debuff/proc/get_list(obj/item/organ/internal/brain/component_holder, list/income_list) + SIGNAL_HANDLER income_list = applied_debuffs -/datum/component/death_debuff/proc/bio_scan(obj/item/organ/internal/brain/source, list/scan_list) +/datum/component/death_debuff/proc/bio_scan(obj/item/organ/internal/brain/component_holder, list/scan_list) SIGNAL_HANDLER for(var/datum/death_debuff/dd_check in applied_debuffs) scan_list += dd_check.name -/datum/component/death_debuff/proc/brain_scan(obj/item/organ/internal/brain/source, list/scan_list) +/datum/component/death_debuff/proc/brain_scan(obj/item/organ/internal/brain/component_holder, list/scan_list) SIGNAL_HANDLER for(var/datum/death_debuff/dd_check in applied_debuffs) scan_list += dd_check.get_adv_analyzer_info() @@ -75,7 +80,8 @@ if(IS_CHANGELING(brain_item.owner)) return - if(world.time - death_time > DD_THRESHOLD) + var/death_timer = world.time - death_time + if(death_timer > DD_THRESHOLD) death_count += 1 //Наложить случайный дебафф @@ -109,6 +115,21 @@ var/datum/death_debuff/debuff = new dd_candidate return debuff +/datum/component/death_debuff/proc/pre_give_threatment(obj/item/organ/internal/brain/component_holder, mob/living/carbon/human/user) + SIGNAL_HANDLER + if(currently_care) + return + INVOKE_ASYNC(src, PROC_REF(give_threatment), user) + +/datum/component/death_debuff/proc/give_threatment(mob/living/carbon/human/nurse) + var/mob/living/carbon/human/victim = brain_item.owner + currently_care = TRUE + while(do_mob(nurse, victim, 3 SECONDS) && victim.stat != DEAD && length(applied_debuffs) > 0) + var/datum/death_debuff/dd = pick(applied_debuffs) + dd.threatment_care(nurse) + + currently_care = FALSE + /obj/item/organ/internal/brain/Initialize(mapload, datum/species/new_species) . = ..() if(!IS_CHANGELING(owner)) @@ -146,5 +167,15 @@ var/mob/living/carbon/human/original = locateUID(patient_mind.original_mob_UID) var/obj/item/organ/internal/brain/old_brain = original.get_int_organ_tag("brain") var/obj/item/organ/internal/brain/new_brain = clone.get_int_organ_tag("brain") - SEND_SIGNAL(new_brain, COMSIG_MOB_GET_OLD_DDS, old_brain) + SEND_SIGNAL(new_brain, COMSIG_MOB_GET_DDS, old_brain) + . = ..() + +/mob/living/carbon/help_shake_act(mob/living/carbon/M) . = ..() + if(ishuman(M) && ishuman(src)) + var/obj/item/organ/internal/brain/brain_item = src.get_int_organ_tag("brain") + SEND_SIGNAL(brain_item, COMSIG_MOB_GIVES_CARE, M) +//В хелп интенте клик по кукле +//проверка на ДДс +//Начинается уход если да +//За каждый тик ухода выбирается случайный дебафф и применяется его метод лечения diff --git a/modular_ss220/prime_only/code/death_debuffs/death_debuffs_defines.dm b/modular_ss220/prime_only/code/death_debuffs/death_debuffs_defines.dm index eacbc62ff213..ff78b56b2d2a 100644 --- a/modular_ss220/prime_only/code/death_debuffs/death_debuffs_defines.dm +++ b/modular_ss220/prime_only/code/death_debuffs/death_debuffs_defines.dm @@ -1,5 +1,9 @@ #define DD_BASIC_PROGRESS_FACTOR 0.2 -#define DD_BASIC_HEALING_FACTOR 0.1 +#define DD_BASIC_CHEMICAL_FACTOR 0.3 +#define DD_BASIC_HEALING_CHEM_FACTOR 0.3 +#define DD_BASIC_HEALING_MED_FACTOR 0.2 +#define DD_BASIC_HEALING_CARE_FACTOR 0.2 +#define DD_BASIC_HEALING_SLEEP_FACTOR 0.1 #define DD_BASIC_STATE 100 #define COMSIG_BRAIN_UNDEBUFFED "brain_undebuffed" @@ -12,7 +16,10 @@ var/mob/living/carbon/human/H var/applied_text = "" var/removed_text = "" - var/healing_speed = DD_BASIC_HEALING_FACTOR + var/healing_chemical_factor = DD_BASIC_HEALING_CHEM_FACTOR + var/healing_medical_factor = DD_BASIC_HEALING_MED_FACTOR + var/healing_care_factor = DD_BASIC_HEALING_CARE_FACTOR + var/healing_sleep_factor = DD_BASIC_HEALING_SLEEP_FACTOR var/progress_speed = DD_BASIC_PROGRESS_FACTOR /datum/death_debuff/process() @@ -21,16 +28,18 @@ /datum/death_debuff/proc/dd_effect() if(!H) remove_debuff() + return threatment() state = clamp(state, 0, initial(state)) if(state == 0) remove_debuff() + return /datum/death_debuff/proc/threatment() - var/healing_factor = threatment_chemical() ? healing_speed : 0 - healing_factor += threatment_medical() ? healing_speed : 0 - healing_factor += (threatment_rest()) ? healing_speed : 0 + var/healing_factor = threatment_chemical() ? healing_chemical_factor : 0 + healing_factor += threatment_medical() ? healing_medical_factor : 0 + healing_factor += threatment_rest() ? healing_sleep_factor : 0 //Добавить механизм нарастания эффекта, если игрок движется вне медицинского блока ходит if(danger_condition()) state += progress_speed @@ -62,6 +71,11 @@ return FALSE +/datum/death_debuff/proc/threatment_care(nurse_person) + if(threatment_medical()) + state -= healing_care_factor + to_chat(H, span_notice("[nurse_person] ухаживает за вами, и Вы начинаете чувствовать себя чуть лучше")) + /datum/death_debuff/proc/threatment_rest() var/resting_in_med = threatment_medical() && threatment_chemical() && H.IsSleeping() return resting_in_med @@ -108,9 +122,14 @@ qdel(temp_reagent) description += reagents_string + var/progress = ((initial(state) - state)/initial(state)) * 100 + description += "\n Прогресс лечения: [progress]%" return description -#undef DD_BASIC_HEALING_FACTOR +#undef DD_BASIC_HEALING_CHEM_FACTOR +#undef DD_BASIC_HEALING_MED_FACTOR +#undef DD_BASIC_HEALING_CARE_FACTOR +#undef DD_BASIC_HEALING_SLEEP_FACTOR #undef DD_BASIC_PROGRESS_FACTOR #undef DD_BASIC_STATE