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

Permadeath #1034

merged 45 commits into from
Jan 30, 2025

Conversation

msw7007
Copy link

@msw7007 msw7007 commented Jan 20, 2025

Что этот PR делает

closes #1032

Через запись конфига REVIVAL_BRAIN_LIFE при ее значение выше 0 позволяет изменить скорость разложения мозга. Так-же если это значение было изменено, это включает в себя перманентную смерть для игрока, в случае, если мозг умер (накладывает состояние DNR)

Почему это хорошо для игры

По запросу стримеров и для закрытия #1032

Изображения изменений

Тестирование

Локальный сервер

Changelog

🆑
balance: Теперь в игре на сервере можно настроить перманентную смерть. При полной смерти мозга, воскресить почти невозможно.
/:cl:

Summary by Sourcery

Implement permanent death configurable via the revival_brain_life config setting. If set to a value greater than 0, the brain decay rate is modified and permanent death is enabled for the player if their brain dies (DNR status is applied).

New Features:

  • Introduce a configurable permanent death option.

Tests:

  • Test the permanent death functionality on a local server.

Copy link

sourcery-ai bot commented Jan 20, 2025

Reviewer's Guide by Sourcery

This pull request introduces a configurable permadeath mechanic. When enabled, a player's brain death results in permanent death, preventing revival. The brain decay rate is also increased when permadeath is enabled. Additionally, a stasis body bag has been added to help with the transportation of bodies.

Sequence diagram for revival attempt with permadeath

sequenceDiagram
    participant M as Medic
    participant P as Patient
    participant B as Brain
    participant D as Defibrillator
    M->>P: Attempt Revival
    D->>B: Check Brain Status
    alt Brain Failed & Permadeath Enabled
        B-->>D: Return DEFIB_FAIL_PERMANENTLY_DEAD
        D-->>M: Show 'Brain electromagnetic activity gone' message
    else Brain OK
        B-->>D: Return DEFIB_POSSIBLE
        D->>P: Revive
        P-->>M: Patient Revived
    end
Loading

Class diagram for brain and stasis bag implementation

classDiagram
    class Brain {
        +decay_factor
        +Initialize()
        +organ_flags
    }
    class StasisBodyBag {
        +name
        +desc
        +mob_storage_capacity
        +deploy_bodybag()
        +close()
        +open()
    }
    class Carbon {
        +can_be_revived()
        +can_defib()
    }
    note for Brain "Decay factor doubled\nwhen permadeath enabled"
    note for StasisBodyBag "New item to preserve\nbodies longer"
    Carbon --o Brain : has
    StasisBodyBag --o Carbon : can contain
Loading

State diagram for brain death and revival process

stateDiagram-v2
    [*] --> Alive
    Alive --> Dead: Death
    Dead --> BrainDecaying: Start Brain Decay
    BrainDecaying --> BrainDead: Brain Fully Decayed
    BrainDecaying --> Alive: Revival (if brain not failed)
    BrainDead --> [*]: Permanent Death
    note right of BrainDecaying
        Decay rate doubled when
        permadeath enabled
    end note
    note right of BrainDead
        DNR status applied
        No revival possible
    end note
Loading

File-Level Changes

Change Details Files
Implements permadeath mechanics based on a config flag.
  • Added a config flag to enable/disable permadeath.
  • Modified the can_be_revived proc to check for brain death and the permadeath flag.
  • Modified the can_defib proc to return a specific fail state if the brain is permanently dead.
  • Modified the organ damage proc to update the medhud status.
  • Added a new defib fail state for permanent death.
  • Increased brain decay rate when permadeath is enabled.
code/modules/mob/living/carbon/carbon.dm
code/modules/surgery/organs/_organ.dm
code/game/objects/items/defib.dm
code/__DEFINES/mobs.dm
modular_bandastation/balance/code/_brain.dm
Added a stasis body bag.
  • Added a new research node for the stasis body bag.
  • Added a new stasis body bag item and structure.
  • Added functionality to apply stasis to mobs inside the bag.
  • Added functionality to remove stasis from mobs when the bag is opened.
code/modules/research/techweb/nodes/medbay_nodes.dm
modular_bandastation/balance/code/_brain.dm
Modified medipen reagents.
  • Modified the default medipen reagents.
  • Modified the survival medipen reagents.
  • Modified the luxury survival medipen reagents.
modular_bandastation/balance/code/_brain.dm

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions github-actions bot added the 💾 Изменение конфига Ф-ф-фуриор...? label Jan 20, 2025
dj-34
dj-34 previously requested changes Jan 21, 2025
code/modules/mob/living/brain/brain_item.dm Outdated Show resolved Hide resolved
config/game_options.txt Outdated Show resolved Hide resolved
Copy link
Collaborator

@larentoun larentoun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему это всё не модульно? Тут всё модульно можно сделать

config/game_options.txt Outdated Show resolved Hide resolved
code/__DEFINES/mobs.dm Outdated Show resolved Hide resolved
config/bandastation/bandastation_config.txt Outdated Show resolved Hide resolved
modular_bandastation/balance/code/_brain.dm Outdated Show resolved Hide resolved
modular_bandastation/balance/code/_brain.dm Outdated Show resolved Hide resolved
code/modules/mob/living/brain/brain_item.dm Outdated Show resolved Hide resolved
code/modules/mob/living/carbon/carbon.dm Show resolved Hide resolved
code/modules/reagents/reagent_containers/hypospray.dm Outdated Show resolved Hide resolved
code/modules/surgery/brain_surgery.dm Outdated Show resolved Hide resolved
code/game/data_huds.dm Outdated Show resolved Hide resolved
modular_bandastation/balance/code/_brain.dm Outdated Show resolved Hide resolved
modular_bandastation/balance/code/_brain.dm Outdated Show resolved Hide resolved
modular_bandastation/balance/code/_brain.dm Outdated Show resolved Hide resolved
modular_bandastation/balance/code/_brain.dm Show resolved Hide resolved
@Gaxeer Gaxeer changed the title Перма-смерть через конфиг Permadeath Jan 23, 2025
@github-actions github-actions bot added the 🖌️ Спрайты Вы заработали свою миска-рис и кошко-жена. Партия гордится вами! label Jan 23, 2025
@Gaxeer Gaxeer added the 🔬 Testmerge Active Находится в тестмерже на сервере label Jan 23, 2025
@dj-34 dj-34 added the :trollface: Фича Новая, определённо уникальная и интересная фича. Она абсолютно точно всем понравится! label Jan 26, 2025
@AyIong AyIong added the ⚖️ Баланс Идеальный баланс. Эталон гармонии... label Jan 26, 2025
@github-actions github-actions bot removed the :trollface: Фича Новая, определённо уникальная и интересная фича. Она абсолютно точно всем понравится! label Jan 26, 2025
@MelokGleb
Copy link

Стоп а это работает просто по времени или из-за 200 урона на мозге?
Если 200 урона на мозге то битраннерам это очень сильно усложнит жизнь, ведь они в основном по нему урон и получают.

@Gaxeer
Copy link
Collaborator

Gaxeer commented Jan 30, 2025

Стоп а это работает просто по времени или из-за 200 урона на мозге? Если 200 урона на мозге то битраннерам это очень сильно усложнит жизнь, ведь они в основном по нему урон и получают.

Даже лучше

@Gaxeer Gaxeer dismissed stale reviews from larentoun and dj-34 January 30, 2025 19:31

Всё пофикшено

@Gaxeer Gaxeer marked this pull request as ready for review January 30, 2025 19:31
@ss220app ss220app bot added the 📜 CL валиден Этот чейнджлог будет успешно опубликован label Jan 30, 2025
@Gaxeer Gaxeer merged commit 9f9d204 into ss220club:master Jan 30, 2025
29 checks passed
ss220app bot added a commit that referenced this pull request Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚖️ Баланс Идеальный баланс. Эталон гармонии... 💾 Изменение конфига Ф-ф-фуриор...? 🔬 Testmerge Active Находится в тестмерже на сервере 🖌️ Спрайты Вы заработали свою миска-рис и кошко-жена. Партия гордится вами! 📜 CL валиден Этот чейнджлог будет успешно опубликован
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Запрос с Прайма] Пермасмерть мозга после 7 минут
6 participants