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

[TM] Spaceloot changes #1764

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

Conversation

m-dzianishchyts
Copy link
Collaborator

@m-dzianishchyts m-dzianishchyts commented Jan 24, 2025

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

Чинит спавн лута в космосе.
Увеличивает бюджет пула в связи с тем, что он расходуется дополнительно на ЦК и гейт.

Changelog

🆑 Maxiemar
fix: Исправлен спавн лута в космосе.
/:cl:

Summary by Sourcery

Fix space loot spawning and increase the available points for loot generation to account for additional usage in centcomm and the gateway.

Bug Fixes:

  • Fixed a bug that prevented space loot from spawning correctly.

Enhancements:

  • Increased the available points for loot generation.

Copy link

sourcery-ai bot commented Jan 24, 2025

Reviewer's Guide by Sourcery

This pull request fixes an issue where space loot was not spawning correctly. It also increases the available points for the space loot pool to account for additional spawns.

Class diagram for spawn pool system

classDiagram
    class SpawnPool {
        +available_points: 2200
        +known_spawners: list
        +guaranteed_spawners: list
        +process_guaranteed_spawners()
    }
    class PoolSpawner {
        +point_value
        +spawn_pool_id
        +Initialize()
        +generate_loot_list()
    }
    SpawnPool "1" -- "*" PoolSpawner: contains
    note for SpawnPool "Updated available_points
to 2200 for space loot"
Loading

Flow diagram for updated spawn pool logic

flowchart TD
    Start[Start Spawn Process] --> Init[Initialize Available Points]
    Init --> ProcessGuaranteed[Process Guaranteed Spawners]
    ProcessGuaranteed --> ShuffleSpawners[Shuffle Known Spawners]
    ShuffleSpawners --> CopyList[Copy Known Spawners List]
    CopyList --> CheckPoints{Available Points > 0?}
    CheckPoints -->|Yes| CheckSpawners{Any Spawners Left?}
    CheckSpawners -->|Yes| GetSpawner[Get Next Spawner]
    GetSpawner --> CheckValue{Point Value <= Available Points?}
    CheckValue -->|No| DeleteSpawner[Delete Spawner]
    CheckValue -->|Yes| SpawnItem[Spawn Item]
    SpawnItem --> UpdateList[Update Remaining List]
    DeleteSpawner --> CheckPoints
    UpdateList --> CheckPoints
    CheckPoints -->|No| Finish[Finish & Cleanup]
    CheckSpawners -->|No| Finish
Loading

File-Level Changes

Change Details Files
Fixed space loot spawning logic and added logging.
  • Created a copy of the known spawners list to track remaining spawners.
  • Added a log message when there are not enough points to spawn a spawner.
  • Modified the log message at the end of the spawning process to include the initial available points.
code/game/objects/effects/spawners/random/pool/spawn_pool.dm
Changed the return value of the pool spawner initialization.
  • Changed the return value of the pool spawner initialization from INITIALIZE_HINT_QDEL to INITIALIZE_HINT_NORMAL.
code/game/objects/effects/spawners/random/pool/pool_spawner.dm
Increased the available points for the space loot pool.
  • Increased the available points for the space loot pool from an unspecified value to 2200.
modular_ss220/balance/code/loot/pools.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 🔧 Фикс Переписываем ошибку так, чтобы она проявлялась в других обстоятельствах :feelsgood: Частичная модульность Не всегда получается всё впихнуть в модуль, увы. :shipit: Улучшение Наконец-то это сделали удобнее и лучше... labels Jan 24, 2025
@ss220app ss220app bot added the 📜 CL валиден Этот чейнджлог будет успешно опубликован label Jan 24, 2025
@kyunkyunkyun
Copy link

у нас ЦК и гейты же пока не фигурируют никак в пуле спавна лута, рановато повышается бюджет, нет?

@m-dzianishchyts
Copy link
Collaborator Author

m-dzianishchyts commented Jan 24, 2025

у нас ЦК и гейты же пока не фигурируют никак в пуле спавна лута, рановато повышается бюджет, нет?

image

@kyunkyunkyun
Copy link

image

уээ

@m-dzianishchyts m-dzianishchyts changed the title Spaceloot fix tweak Spaceloot changes Jan 24, 2025
@m-dzianishchyts m-dzianishchyts changed the title Spaceloot changes [TM] Spaceloot changes Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:feelsgood: Частичная модульность Не всегда получается всё впихнуть в модуль, увы. 📜 CL валиден Этот чейнджлог будет успешно опубликован :shipit: Улучшение Наконец-то это сделали удобнее и лучше... Testmerge Required 🔧 Фикс Переписываем ошибку так, чтобы она проявлялась в других обстоятельствах
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants