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

Augmentations #1009

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Augmentations #1009

wants to merge 4 commits into from

Conversation

Gaxeer
Copy link
Collaborator

@Gaxeer Gaxeer commented Jan 17, 2025

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

Начало работы над аугментациями :aga:

Summary by Sourcery

Add body modifications to character preferences.

New Features:

  • Allow players to select body modifications in the character preferences menu.

Tests:

  • Add tests for body modification preferences.

Copy link

sourcery-ai bot commented Jan 17, 2025

Reviewer's Guide by Sourcery

This PR introduces body augmentations, including applying and removing body modifications.

Sequence diagram for applying body modification

sequenceDiagram
    actor User
    participant UI as PreferencesMenu
    participant MW as BodyModificationMiddleware
    participant BM as BodyModification

    User->>UI: Click 'Apply' on modification
    UI->>MW: apply_body_modification(key)
    MW->>BM: can_be_applied(user)
    BM-->>MW: Return validation result
    MW->>MW: Update preferences
    MW-->>UI: Return success/failure
    UI-->>User: Update interface
Loading

Class diagram for body modification system

classDiagram
    class BodyModification {
        +String key
        +String name
        +int cost
        +List incompatible_body_modifications
        +apply_to_human(target)
        +can_be_applied(target)
        +get_description()
    }

    class LimbAmputation {
        +String limb_body_zone
        +apply_to_human(target)
    }

    class BodypartProsthesis {
        +Type replacement_bodypart_type
        +apply_to_human(target)
    }

    BodyModification <|-- LimbAmputation
    BodyModification <|-- BodypartProsthesis

    note for BodyModification "Base class for all body modifications"
    note for LimbAmputation "Handles limb amputation modifications"
    note for BodypartProsthesis "Handles prosthetic replacements"
Loading

File-Level Changes

Change Details Files
Added body modification data to preference menu data.
  • Added incompatible_body_modifications and applied_body_modifications fields to PreferencesMenuData.
  • Added BodyModification type.
  • Added body_modifications to ServerData type.
tgui/packages/tgui/interfaces/PreferencesMenu/data.ts
Added Body Modifications page to character preferences window.
  • Added BodyModifications page to the Page enum.
  • Added a button for the Body Modifications page.
  • Added a case for the Body Modifications page in the page rendering logic.
tgui/packages/tgui/interfaces/PreferencesMenu/CharacterPreferenceWindow.tsx
Added body modification preference middleware.
  • Added middleware to handle applying and removing body modifications.
  • Added functions to get applied and incompatible body modifications.
  • Added functions to update body modification preferences data.
modular_bandastation/augmentation_preferences/code/preferences/body_modification_preference_middleware.dm
Created BodyModificationsPage component.
  • Created component to display and interact with body modifications.
  • Added logic to fetch and render body modification data.
  • Added buttons to apply and remove body modifications.
tgui/packages/tgui/interfaces/PreferencesMenu/BodyModificationsPage.tsx
Created body modification datum and related types.
  • Created body_modification datum and related subtypes.
  • Added functions to apply body modifications and check compatibility.
  • Added a function to initialize body modifications data.
modular_bandastation/augmentation_preferences/code/body_modifications/_body_modifications_datum.dm
Created body modification preference datum.
  • Created preference datum for storing body modifications.
  • Added functions to validate, apply, serialize, and deserialize body modification preferences.
  • Added a function to create a default value for the preference.
modular_bandastation/augmentation_preferences/code/preferences/body_modification_preference.dm
Added limb amputation body modifications.
  • Created limb amputation body modification types for arms and legs.
  • Added logic to apply limb amputations.
modular_bandastation/augmentation_preferences/code/body_modifications/body_part/amputations.dm
Added prosthetic body modifications.
  • Created prosthetic body modification types for arms and legs.
  • Added logic to apply prosthetics.
modular_bandastation/augmentation_preferences/code/body_modifications/body_part/prosthetics.dm
Added modpack definition for augmentation preferences.
  • Defined modpack information, including name, description, and author.
modular_bandastation/augmentation_preferences/_augmentation_preferences.dm
modular_bandastation/augmentation_preferences/_augmentation_preferences.dme
Added preference tab for body modifications.
  • Defined a preference tab for body modifications in the preferences menu.
modular_bandastation/_defines220/code/defines/preferenced.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.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a 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. You can also use
    this command to specify where the summary should be inserted.

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 TGUI Добавление или изменение существующего интерфейса на базе фреймворка TGUI label Jan 17, 2025
@adskipups
Copy link

Гахер, это всё круто но аугменты есть в чертах. Просто задаюсь вопросом зачем это переносить из черт в основной редактор.

@Gaxeer
Copy link
Collaborator Author

Gaxeer commented Jan 17, 2025

Гахер, это всё круто но аугменты есть в чертах. Просто задаюсь вопросом зачем это переносить из черт в основной редактор.

  1. Все черты для аугментаций будут удалены
  2. Будет удобный интерфейс

@adskipups
Copy link

Гахер, это всё круто но аугменты есть в чертах. Просто задаюсь вопросом зачем это переносить из черт в основной редактор.

1. Все черты для аугментаций будут удалены

2. Будет удобный интерфейс

А черту tin man трогать не будешь? Там просто самые хуёвые робо органы в игре.

@Gaxeer
Copy link
Collaborator Author

Gaxeer commented Jan 17, 2025

Гахер, это всё круто но аугменты есть в чертах. Просто задаюсь вопросом зачем это переносить из черт в основной редактор.

1. Все черты для аугментаций будут удалены

2. Будет удобный интерфейс

А черту tin man трогать не будешь? Там просто самые хуёвые робо органы в игре.

ВСЕ квирки на аугментации

Copy link

This PR has been inactive for long enough to be automatically marked as stale. This means it is at risk of being auto closed in ~ 7 days, please address any outstanding review items and ensure your PR is finished, if these are all true and you are auto-staled anyway, you need to actively ask maintainers if your PR will be merged. Once you have done any of the previous actions then you should request a maintainer remove the stale label on your PR, to reset the stale timer. If you feel no maintainer will respond in that time, you may wish to close this PR youself, while you seek maintainer comment, as you will then be able to reopen the PR yourself

@github-actions github-actions bot added the 💩 Stale Кажется всем похуй на этот ПР. Жизнь сурова... label Jan 25, 2025
@dj-34 dj-34 added 🛡️ Stale Exempt ПР не может быть устаревшим. Но всем всё равно на него похуй. :trollface: Фича Новая, определённо уникальная и интересная фича. Она абсолютно точно всем понравится! and removed 💩 Stale Кажется всем похуй на этот ПР. Жизнь сурова... labels Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛡️ Stale Exempt ПР не может быть устаревшим. Но всем всё равно на него похуй. TGUI Добавление или изменение существующего интерфейса на базе фреймворка TGUI :trollface: Фича Новая, определённо уникальная и интересная фича. Она абсолютно точно всем понравится!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants