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

Permadeath #1034

Merged
merged 45 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
cd4c446
Update TGS DMAPI
tgstation-server-ci[bot] Oct 6, 2024
9eff4de
Merge pull request #3 from msw7007/tgs-dmapi-update
msw7007 Nov 18, 2024
3dfb553
Merge branch 'ss220club:master' into master
msw7007 Dec 6, 2024
171d114
Merge branch 'ss220club:master' into master
msw7007 Dec 7, 2024
b36347b
Merge branch 'ss220club:master' into master
msw7007 Dec 25, 2024
3d4a141
Merge branch 'ss220club:master' into master
msw7007 Jan 11, 2025
7b643ef
Merge branch 'ss220club:master' into master
msw7007 Jan 15, 2025
f0dda7c
Merge branch 'ss220club:master' into master
msw7007 Jan 16, 2025
ef24d2f
Merge branch 'ss220club:master' into master
msw7007 Jan 16, 2025
66b01b2
Merge remote-tracking branch 'upstream/master'
msw7007 Jan 20, 2025
3bcfba7
Первая инициализация
msw7007 Jan 20, 2025
e28e4d5
Первая инициализация
msw7007 Jan 20, 2025
62d0b6d
Merge branch 'perma_death' of https://github.com/msw7007/Bandastation…
msw7007 Jan 20, 2025
c72db79
Изменение логики
msw7007 Jan 20, 2025
2ea6251
Merge branch 'master' into perma_death
msw7007 Jan 20, 2025
436db44
Линтер...
msw7007 Jan 20, 2025
f9d7660
Отработки по ревью
msw7007 Jan 21, 2025
b2ffe42
Merge branch 'master' into perma_death
msw7007 Jan 21, 2025
59479c3
Изменение логика, переброски, твики
msw7007 Jan 21, 2025
ec53cea
По просьба Гахера
msw7007 Jan 21, 2025
b51f5e4
Ввод первый - стазис мешки
msw7007 Jan 21, 2025
a284289
Правки по ревью
msw7007 Jan 21, 2025
0601a13
Отработка по запросу
msw7007 Jan 22, 2025
1bf5a8b
Merge remote-tracking branch 'upstream/master' into perma_death
msw7007 Jan 22, 2025
25bde5e
Отработка по ревью
msw7007 Jan 22, 2025
39ca3cb
Отработка по запросу
msw7007 Jan 22, 2025
186d087
Merge branch 'master' into perma_death
msw7007 Jan 22, 2025
675c09c
По ревью
msw7007 Jan 22, 2025
fb3b249
Merge branch 'master' into perma_death
msw7007 Jan 23, 2025
08ab4ae
Отработки по запросу, првоерка Линтера
msw7007 Jan 23, 2025
6211cfe
Ревью, Линтер
msw7007 Jan 23, 2025
3911b6e
Перенос стазис-мешко в крио-стазис
msw7007 Jan 23, 2025
aaf5c7b
Отработка по запросам, добавление спрайтов
msw7007 Jan 23, 2025
1fe2fba
Песня про асенизаторов
msw7007 Jan 23, 2025
e27ff35
Изменение способа обновления худа
msw7007 Jan 23, 2025
04990c5
Линтер и пробелы
msw7007 Jan 23, 2025
7337892
Merge branch 'master' into perma_death
msw7007 Jan 24, 2025
0dc2bd4
Update modular_bandastation/balance/code/_brain.dm
Gaxeer Jan 24, 2025
a45d6da
Новые мещьки
msw7007 Jan 24, 2025
0151d10
Merge branch 'master' into perma_death
msw7007 Jan 24, 2025
ae55954
Отработка по ревью
msw7007 Jan 24, 2025
4ab3126
Merge branch 'master' into perma_death
msw7007 Jan 26, 2025
f9e940d
Merge branch 'master' into perma_death
msw7007 Jan 27, 2025
05ea94d
Merge branch 'master' into perma_death
Gaxeer Jan 28, 2025
dcead7d
Merge branch 'master' into perma_death
msw7007 Jan 29, 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
1 change: 1 addition & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@
#define DEFIB_FAIL_NO_INTELLIGENCE (1<<8)
#define DEFIB_FAIL_BLACKLISTED (1<<9)
#define DEFIB_NOGRAB_AGHOST (1<<10)
#define DEFIB_FAIL_PERMANENTLY_DEAD (1<<11) // BANDASTATION ADDITION - PERMA-DEATH

// Bit mask of possible return values by can_defib that would result in a revivable patient
#define DEFIB_REVIVABLE_STATES (DEFIB_FAIL_NO_HEART | DEFIB_FAIL_FAILING_HEART | DEFIB_FAIL_HUSK | DEFIB_FAIL_TISSUE_DAMAGE | DEFIB_FAIL_FAILING_BRAIN | DEFIB_POSSIBLE)
Expand Down
4 changes: 4 additions & 0 deletions code/game/objects/items/defib.dm
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,10 @@
fail_reason = "Tissue damage too severe, repair and try again."
if (DEFIB_FAIL_HUSK)
fail_reason = "Patient's body is a mere husk, repair and try again."
// BANDASTATION EDIT START - PERMA-DEATH
if (DEFIB_FAIL_PERMANENTLY_DEAD)
fail_reason = "Patient's brain electomagnetic activity gone. It's too late for them..."
// BANDASTATION EDIT END - PERMA-DEATH
if (DEFIB_FAIL_FAILING_BRAIN)
fail_reason = "Patient's brain is too damaged, repair and try again."
if (DEFIB_FAIL_NO_INTELLIGENCE)
Expand Down
21 changes: 20 additions & 1 deletion code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -962,8 +962,12 @@
return ..()

/mob/living/carbon/can_be_revived()
if(!get_organ_by_type(/obj/item/organ/brain) && (!IS_CHANGELING(src)) || HAS_TRAIT(src, TRAIT_HUSK))
// BANDASTATION EDIT START - PERMA-DEATH
var/obj/item/organ/brain/brain = get_organ_by_type(/obj/item/organ/brain)
var/brain_non_functional = isnull(brain) || (CONFIG_GET(flag/brain_permanent_death) && brain.organ_flags & ORGAN_FAILING)
if(brain_non_functional && !IS_CHANGELING(src) || HAS_TRAIT(src, TRAIT_HUSK))
return FALSE
// BANDASTATION EDIT END - PERMA-DEATH
return ..()

/mob/living/carbon/proc/can_defib()
Expand All @@ -976,6 +980,19 @@
if (HAS_TRAIT(src, TRAIT_DEFIB_BLACKLISTED))
return DEFIB_FAIL_BLACKLISTED
Gaxeer marked this conversation as resolved.
Show resolved Hide resolved

// BANDASTATION EDIT START - PERMA-DEATH
var/obj/item/organ/brain/current_brain = get_organ_by_type(/obj/item/organ/brain)

if (QDELETED(current_brain))
return DEFIB_FAIL_NO_BRAIN

if (current_brain.suicided || (current_brain.brainmob && HAS_TRAIT(current_brain.brainmob, TRAIT_SUICIDED)))
return DEFIB_FAIL_NO_INTELLIGENCE

if (current_brain.organ_flags & ORGAN_FAILING)
return CONFIG_GET(flag/brain_permanent_death) ? DEFIB_FAIL_PERMANENTLY_DEAD : DEFIB_FAIL_FAILING_BRAIN
// BANDASTATION EDIT END - PERMA-DEATH

if ((getBruteLoss() >= MAX_REVIVE_BRUTE_DAMAGE) || (getFireLoss() >= MAX_REVIVE_FIRE_DAMAGE))
return DEFIB_FAIL_TISSUE_DAMAGE

Expand All @@ -989,6 +1006,7 @@
if (heart.organ_flags & ORGAN_FAILING)
return DEFIB_FAIL_FAILING_HEART

/* // BANDASTATION EDIT START - PERMA-DEATH
var/obj/item/organ/brain/current_brain = get_organ_by_type(/obj/item/organ/brain)

if (QDELETED(current_brain))
Expand All @@ -999,6 +1017,7 @@

if (current_brain.suicided || (current_brain.brainmob && HAS_TRAIT(current_brain.brainmob, TRAIT_SUICIDED)))
return DEFIB_FAIL_NO_INTELLIGENCE
msw7007 marked this conversation as resolved.
Show resolved Hide resolved
*/ // BANDASTATION EDIT END - PERMA-DEATH

if(key && key[1] == "@") // Adminghosts
return DEFIB_NOGRAB_AGHOST
Expand Down
1 change: 1 addition & 0 deletions code/modules/research/techweb/nodes/medbay_nodes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
"stasis",
"cryo_grenade",
"splitbeaker",
"stasisbodybag", // BANDASTATION ADDITION - PERMA-DEATH
)
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = TECHWEB_TIER_4_POINTS)
discount_experiments = list(/datum/experiment/scanning/reagent/cryostylane = TECHWEB_TIER_4_POINTS)
Expand Down
6 changes: 6 additions & 0 deletions code/modules/surgery/organs/_organ.dm
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,17 @@ INITIALIZE_IMMEDIATE(/obj/item/organ)
var/message = check_damage_thresholds(owner)
prev_damage = damage

var/old_organ_flags = organ_flags // BANDASTATION ADD - PERMA-DEATH
if(damage >= maxHealth)
organ_flags |= ORGAN_FAILING
else
organ_flags &= ~ORGAN_FAILING

// BANDASTATION ADDITION START - PERMA-DEATH
if(old_organ_flags != organ_flags)
owner?.med_hud_set_status()
// BANDASTATION ADDITION END - PERMA-DEATH

if(message && owner && owner.stat <= SOFT_CRIT)
to_chat(owner, message)

Expand Down
3 changes: 3 additions & 0 deletions config/bandastation/bandastation_config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ ROUNDSTART_RACES vulpkanin

## Time in deciseconds the mob must be clientless for to be despawned by cryopod. 30 minutes by default
#CRYO_MIN_SSD_TIME 18000

## Boolean value to derminate is it posible to die permanently due death of brain or not (value true means it's enabled)
BRAIN_PERMANENT_DEATH
1 change: 1 addition & 0 deletions modular_bandastation/balance/_balance.dme
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
#include "code/station_traits.dm"
#include "code/supply_packs.dm"
#include "code/wounds/cranial_fissure.dm"
#include "code/_brain.dm"

#include "code/~undefs.dm"
66 changes: 66 additions & 0 deletions modular_bandastation/balance/code/_brain.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/obj/item/organ/brain/Initialize(mapload)
. = ..()
if(CONFIG_GET(flag/brain_permanent_death))
decay_factor = STANDARD_ORGAN_DECAY * 2 //7 минут до полной смерти (в 4 раза быстрее чем по умолчанию (30 минут))

/datum/surgery/brain_surgery/can_start(mob/user, mob/living/carbon/target)
. = ..()
if(!.)
return

var/obj/item/organ/brain/brain = target.get_organ_slot(ORGAN_SLOT_BRAIN)
return !(brain.organ_flags & ORGAN_FAILING) || !CONFIG_GET(flag/brain_permanent_death)

/datum/config_entry/flag/brain_permanent_death

Gaxeer marked this conversation as resolved.
Show resolved Hide resolved
/obj/item/bodybag/stasis
name = "Stasis body bag"
desc = "A folded bag designed for the storage and transportation of cadavers with portable stasis module and little space."
icon = 'modular_bandastation/balance/icons/bodybag.dmi' //на замену
icon_state = "cryobag_folded" //на замену
// Stored path we use for spawning a new body bag entity when unfolded.
unfoldedbag_path = /obj/structure/closet/body_bag/stasis

/datum/design/stasisbodybag
name = "Stasis Body Bag"
desc = "A folded bag designed for the storage and transportation of cadavers with portable stasis module and little space."
id = "stasisbodybag"
build_type = PROTOLATHE | AWAY_LATHE
materials = list(/datum/material/iron =SHEET_MATERIAL_AMOUNT * 1.5, /datum/material/plasma =SHEET_MATERIAL_AMOUNT, /datum/material/diamond =SMALL_MATERIAL_AMOUNT*5)
build_path = /obj/item/bodybag/stasis
category = list(
RND_CATEGORY_EQUIPMENT + RND_SUBCATEGORY_TOOLS_MEDICAL
)
departmental_flags = DEPARTMENT_BITFLAG_MEDICAL | DEPARTMENT_BITFLAG_SCIENCE

/obj/structure/closet/body_bag/stasis
name = "stasis body bag"
desc = "A plastic bag designed for the storage and transportation of cadavers with portable stasis module and little space."
icon = 'modular_bandastation/balance/icons/bodybag.dmi' //на замену
icon_state = "cryobag"
mob_storage_capacity = 1
open_sound = 'sound/effects/spray.ogg'
close_sound = 'sound/effects/spray.ogg'
foldedbag_path = /obj/item/bodybag/stasis

/obj/structure/closet/body_bag/stasis/close(mob/living/user)
. = ..()
for(var/mob/living/mob in contents)
mob.apply_status_effect(/datum/status_effect/grouped/stasis, STASIS_MACHINE_EFFECT)
ADD_TRAIT(mob, TRAIT_TUMOR_SUPPRESSED, TRAIT_GENERIC)
mob.extinguish_mob()

/obj/structure/closet/body_bag/stasis/open(mob/living/user, force = FALSE, special_effects = TRUE)
for(var/mob/living/mob in contents)
mob.remove_status_effect(/datum/status_effect/grouped/stasis, STASIS_MACHINE_EFFECT)
REMOVE_TRAIT(mob, TRAIT_TUMOR_SUPPRESSED, TRAIT_GENERIC)
. = ..()

/obj/item/reagent_containers/hypospray/medipen
list_reagents = list(/datum/reagent/medicine/epinephrine = 10, /datum/reagent/medicine/coagulant = 2)

/obj/item/reagent_containers/hypospray/medipen/survival
list_reagents = list( /datum/reagent/medicine/epinephrine = 7, /datum/reagent/medicine/c2/aiuri = 7, /datum/reagent/medicine/c2/libital = 7, /datum/reagent/medicine/leporazine = 6, /datum/reagent/toxin/formaldehyde = 3)

/obj/item/reagent_containers/hypospray/medipen/survival/luxury
list_reagents = list(/datum/reagent/medicine/salbutamol = 10, /datum/reagent/medicine/c2/penthrite = 10, /datum/reagent/medicine/oxandrolone = 10, /datum/reagent/medicine/sal_acid = 10 ,/datum/reagent/medicine/omnizine = 10 ,/datum/reagent/medicine/leporazine = 5, /datum/reagent/toxin/formaldehyde = 5)
Binary file added modular_bandastation/balance/icons/bodybag.dmi
Binary file not shown.
Loading