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 19 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 EDIT - PERMA-DEATH
msw7007 marked this conversation as resolved.
Show resolved Hide resolved

// 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
7 changes: 6 additions & 1 deletion code/game/data_huds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,13 @@
set_hud_image_state(STATUS_HUD, "hudxeno")
return FALSE

// BANDASTATION EDIT START - PERMA-DEATH
var/obj/item/organ/brain/current_brain = get_organ_by_type(/obj/item/organ/brain)
brain_dead = current_brain.perma_death && (current_brain.organ_flags & ORGAN_FAILING)

Check failure on line 188 in code/game/data_huds.dm

View workflow job for this annotation

GitHub Actions / Run Linters

OD0404: Unknown identifier "organ_flags"

Check failure on line 188 in code/game/data_huds.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined var: "brain_dead"

if(stat == DEAD || (HAS_TRAIT(src, TRAIT_FAKEDEATH)))
if(HAS_TRAIT(src, TRAIT_MIND_TEMPORARILY_GONE) || can_defib_client())
if((HAS_TRAIT(src, TRAIT_MIND_TEMPORARILY_GONE) || can_defib_client()) && !brain_dead)

Check failure on line 191 in code/game/data_huds.dm

View workflow job for this annotation

GitHub Actions / Run Linters

OD0404: Unknown identifier "brain_dead"

Check failure on line 191 in code/game/data_huds.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined var: "brain_dead"
// BANDASTATION EDIT END - PERMA-DEATH
msw7007 marked this conversation as resolved.
Show resolved Hide resolved
set_hud_image_state(STATUS_HUD, "huddefib")
else if(HAS_TRAIT(src, TRAIT_GHOSTROLE_ON_REVIVE))
set_hud_image_state(STATUS_HUD, "hudghost")
Expand Down
5 changes: 4 additions & 1 deletion code/game/objects/items/defib.dm
Original file line number Diff line number Diff line change
Expand Up @@ -613,8 +613,11 @@
fail_reason = "Patient's heart too damaged, replace or repair and try again."
if (DEFIB_FAIL_TISSUE_DAMAGE)
fail_reason = "Tissue damage too severe, repair and try again."
if (DEFIB_FAIL_HUSK)

Check failure on line 616 in code/game/objects/items/defib.dm

View workflow job for this annotation

GitHub Actions / Run Linters

OD3100: Empty block detected
fail_reason = "Patient's body is a mere husk, repair and try again."
// BANDASTATION EDIT START - PERMA-DEATH fail_reason = "Patient's body is a mere husk, repair and try again."
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
4 changes: 4 additions & 0 deletions code/modules/mob/living/brain/brain_item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
var/can_smoothen_out = TRUE
/// We got smooth from being washed
var/smooth_brain = FALSE
// BANDASTATION ADDITION START - PERMADEATH
/// Is client brain can't be revived
var/perma_death = FALSE
// BANDASTATION ADDITION END - PERMADEATH
Gaxeer marked this conversation as resolved.
Show resolved Hide resolved

/obj/item/organ/brain/Initialize(mapload)
. = ..()
Expand Down
12 changes: 12 additions & 0 deletions code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,16 @@
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.organ_flags & ORGAN_FAILING)
return current_brain.perma_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,13 +999,15 @@
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))
return DEFIB_FAIL_NO_BRAIN

if (current_brain.organ_flags & ORGAN_FAILING)
return DEFIB_FAIL_FAILING_BRAIN
*/ // BANDASTATION EDIT END - PERMA-DEATH

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
Expand Down
8 changes: 8 additions & 0 deletions code/modules/reagents/chemistry/reagents/medicine_reagents.dm
msw7007 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,14 @@
if(exposed_mob.stat != DEAD || !(exposed_mob.mob_biotypes & MOB_ORGANIC))
return ..()

// BANDASTATION EDIT START - PERMADEATH
if(ishuman(exposed_mob))
var/obj/item/organ/brain/brain = exposed_mob.get_organ_slot(ORGAN_SLOT_BRAIN)
if(!(brain?.organ_flags & ORGAN_FAILING) && !brain?.perma_death)
exposed_mob.visible_message(span_warning("[exposed_mob] have a criticaly damaged brain, and not react..."))
return
// BANDASTATION EDIT END - PERMADEATH

if(HAS_TRAIT(exposed_mob, TRAIT_SUICIDED)) //they are never coming back
exposed_mob.visible_message(span_warning("[exposed_mob]'s body does not react..."))
return
Expand Down
2 changes: 1 addition & 1 deletion code/modules/reagents/reagent_containers/hypospray.dm
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
ignore_flags = 1 //so you can medipen through spacesuits
reagent_flags = NONE
flags_1 = null
list_reagents = list(/datum/reagent/medicine/epinephrine = 10, /datum/reagent/toxin/formaldehyde = 3, /datum/reagent/medicine/coagulant = 2)
list_reagents = list(/datum/reagent/medicine/epinephrine = 10, /datum/reagent/medicine/coagulant = 2) // BANDASTATION EDIT - PERMADEATH (/datum/reagent/toxin/formaldehyde = 3,)
msw7007 marked this conversation as resolved.
Show resolved Hide resolved
custom_price = PAYCHECK_CREW
custom_premium_price = PAYCHECK_COMMAND
var/label_examine = TRUE
Expand Down
8 changes: 7 additions & 1 deletion code/modules/surgery/brain_surgery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@
success_sound = 'sound/items/taperecorder/taperecorder_close.ogg'

/datum/surgery/brain_surgery/can_start(mob/user, mob/living/carbon/target)
return target.get_organ_slot(ORGAN_SLOT_BRAIN) && ..()
// BANDASTATION EDIT START - PERMADEATH
var/obj/item/organ/brain/brain = target.get_organ_slot(ORGAN_SLOT_BRAIN)
var/not_dead = TRUE
if(brain)
not_dead = !(brain.organ_flags & ORGAN_FAILING) && !brain.perma_death
return brain && not_dead && ..()
Gaxeer marked this conversation as resolved.
Show resolved Hide resolved
// BANDASTATION EDIT END - PERMADEATH

/datum/surgery_step/fix_brain/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
display_results(
Expand Down
1 change: 1 addition & 0 deletions code/modules/surgery/organs/_organ.dm
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ INITIALIZE_IMMEDIATE(/obj/item/organ)

if(damage >= maxHealth)
organ_flags |= ORGAN_FAILING
owner?.med_hud_set_status() // BANDASTATION EDIT - PERMA-DEATH
else
organ_flags &= ~ORGAN_FAILING

Expand Down
2 changes: 2 additions & 0 deletions config/bandastation/bandastation_config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ 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

BRAIN_PERMANENT_DEATH false
msw7007 marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions modular_bandastation/balance/_balance.dme
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
#include "code/station_traits.dm"
#include "code/supply_packs.dm"
#include "code/crew_manifest.dm"
#include "code/_brain.dm"

#include "code/~undefs.dm"
12 changes: 12 additions & 0 deletions modular_bandastation/balance/code/_brain.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/obj/item/organ/brain/Initialize(mapload)
. = ..()
var/new_death_time = CONFIG_GET(number/revival_brain_life)
var/perma_death = CONFIG_GET(flag/brain_permanent_death)
if(new_death_time)
var/standart_death_time = 30 MINUTES
// DА => SDT ; NDR => NDT => DF/SDT = NDT/NDR => NDR = (SDT*NDT)DF
var/relative_data = standart_death_time / new_death_time
var/new_decay_rate = relative_data * decay_factor
decay_factor = new_decay_rate
msw7007 marked this conversation as resolved.
Show resolved Hide resolved

/datum/config_entry/flag/brain_permanent_death
Loading