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

refactor: Data-driven psychic power system #74

Draft
wants to merge 8 commits into
base: release/0.10.0.0
Choose a base branch
from

Conversation

EttyKitty
Copy link
Owner

@EttyKitty EttyKitty commented Nov 4, 2024

I will fill this later. For now, just to let others know that I'm doing/was doing this.
Partly I'm just trying to get better at coding, so it's very WIP and may or may not change drastically.

https://discord.com/channels/714022226810372107/1293320552743702549

Summary by Sourcery

Refactor power selection logic to use a data structure, simplifying the code and making it more maintainable. Standardize tome and daemonic artifact tags. Improve Perils of the Warp calculations and effects. Adjust UI elements and button sizes.

New Features:

  • Added support for different psychic disciplines and powers.

Enhancements:

  • Simplified power selection logic using a data structure for better maintainability.
  • Improved Perils of the Warp calculations and effects.

Tests:

  • Updated tests to reflect the changes in power selection and Perils of the Warp.

@EttyKitty EttyKitty changed the title Feat/psy rework feat: rework psy combat stuff Nov 4, 2024
@EttyKitty EttyKitty added PR: Major Coding Big enough to possibly clash with other PRs PR: Refactor Rewriting/restructuring code, while keeping general behaviour PR: Balance labels Nov 4, 2024
@EttyKitty EttyKitty marked this pull request as ready for review December 20, 2024 16:41
@EttyKitty
Copy link
Owner Author

@sourcery-ai review

@EttyKitty EttyKitty changed the title feat: rework psy combat stuff feat: @sourcery-ai Dec 20, 2024
Copy link

sourcery-ai bot commented Dec 20, 2024

Reviewer's Guide by Sourcery

This pull request reworks the psychic combat system by refactoring the power implementation and adjusting the Perils of the Warp mechanic.

File-Level Changes

Change Details Files
Refactored psychic power implementation
  • Consolidated power definitions into a single data structure.
  • Introduced helper functions to determine power selection based on unit equipment and psychic discipline.
  • Simplified power application logic using the consolidated data structure.
  • Added helper functions to convert power codes and determine tome disciplines.
  • Removed several redundant variables and calculations.
  • Improved code readability and organization.
scripts/scr_powers/scr_powers.gml
Adjusted Perils of the Warp mechanic
  • Modified the global Perils of the Warp effect to be less impactful.
  • Changed the way Perils of the Warp strength is calculated.
  • Updated the Perils of the Warp table to reflect the new mechanic.
scripts/scr_perils_table/scr_perils_table.gml
scripts/scr_powers/scr_powers.gml
objects/obj_ncombat/KeyPress_13.gml
Removed large text and heresy settings
  • Removed the large text and heresy settings from the in-game menu.
  • Removed associated code for handling these settings.
objects/obj_ingame_menu/Draw_0.gml
Updated artifact tag generation
  • Changed the way daemonic artifact tags are generated to use more descriptive names.
  • Updated the tag generation logic to be more consistent.
scripts/scr_add_artifact/scr_add_artifact.gml
Adjusted unit button drawing
  • Modified the calculation of unit button dimensions to use a fixed padding value.
  • Improved the visual consistency of unit buttons.
scripts/scr_buttons/scr_buttons.gml

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

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @EttyKitty - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Please provide a description of the functional changes this PR introduces. While the code changes look good, we need to understand how this affects gameplay.
  • Consider adding comments explaining the perils calculation formula and other key gameplay mechanics to help future maintainers understand the design decisions.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

sourcery-ai[bot]

This comment was marked as duplicate.

@sourcery-ai sourcery-ai bot changed the title feat: @sourcery-ai Refactor: Data-driven psychic power system Dec 20, 2024
@sourcery-ai sourcery-ai bot changed the title Refactor: Data-driven psychic power system Refactor: Simplify power selection logic and standardize tome tags Dec 20, 2024
@EttyKitty EttyKitty changed the title Refactor: Simplify power selection logic and standardize tome tags refactor: Data-driven psychic power system Dec 20, 2024
@EttyKitty EttyKitty marked this pull request as draft December 20, 2024 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Balance PR: Major Coding Big enough to possibly clash with other PRs PR: Refactor Rewriting/restructuring code, while keeping general behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant