Skip to content

fix: Fallen trait improvement and loyalty changes#851

Merged
OH296 merged 4 commits intoAdeptus-Dominus:mainfrom
OH296:ai_d_fallen
Jun 1, 2025
Merged

fix: Fallen trait improvement and loyalty changes#851
OH296 merged 4 commits intoAdeptus-Dominus:mainfrom
OH296:ai_d_fallen

Conversation

@OH296
Copy link
Copy Markdown
Collaborator

@OH296 OH296 commented May 30, 2025

Purpose

  • Self-descriptive.
  • fix a bug with failing fallen missions
  • add a handler function to edit marine loyalty to avoid needing to always define clamps
  • add a few more effects to marine traits
    • charismatic marines reroll failed charisma tests
    • faithless marines are less corruptable
    • jaded marines take bigger hits to loyalty
    • soft_target marines have a -10 mod to constitution checks
    • honerable marines loose loyalty by half values
    • old guard marines have all loyalty changes halved

Describe your changes/additions

  • Self-descriptive.

What can/needs to be improved/changed

  • Nothing.

Testing done

  • None, and I understand the risks.

Related things and/or additional context

  • None.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented May 30, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Trait descriptions now display explicit gameplay effects for several traits, enhancing clarity on their impact.
    • Traits such as "old_guard", "faithless", "charismatic", "jaded", "soft_target", and "honorable" now include detailed effect descriptions.
  • Bug Fixes

    • Loyalty adjustments now consistently apply trait-based modifiers, ensuring correct behaviour for traits like "honorable", "jaded", and "old_guard".
    • Charisma-based tests now support rerolls for units with the "charismatic" trait.
  • Refactor

    • Loyalty changes are now handled through a centralised method, improving consistency and maintainability.

Walkthrough

By the Omnissiah's will, this update augments trait data with explicit gameplay effects, refines loyalty adjustment logic to use a centralised method, and introduces reroll mechanics for charisma tests. Direct attribute manipulation is replaced with method calls, ensuring trait effects are consistently applied across the codebase.

Changes

Files/Paths Change Summary
datafiles/data/traits.json Added "effect" fields to several traits; adjusted constitution and luck modifiers for "soft_target".
objects/obj_controller/Alarm_5.gml Replaced direct loyalty decrement with alter_loyalty(-1) method call.
scripts/scr_enemy_ai_d/scr_enemy_ai_d.gml Changed loyalty/corruption logic to use alter_loyalty; adjusted value ranges and alert text.
scripts/scr_marine_struct/scr_marine_struct.gml Added static method alter_loyalty to handle loyalty changes with trait-based modifiers.
scripts/scr_pen_And_paper/scr_pen_And_paper.gml Added reroll logic for charisma tests based on traits; introduced test_rerollable method.
scripts/scr_squads/scr_squads.gml Refactored loyalty changes in sergeant swaps to use alter_loyalty method.

Possibly related PRs

Suggested labels

PR: Fix, PR: Improvment, PR: Feature, Area: JSON

Suggested reviewers

  • Blogaugis

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added Area: JSON Changes to external JSON files or their under-the-hood functionality Size: Small Type: Fix This is a fix for a bug labels May 30, 2025
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 30726bb and f923b19.

📒 Files selected for processing (6)
  • datafiles/data/traits.json (6 hunks)
  • objects/obj_controller/Alarm_5.gml (1 hunks)
  • scripts/scr_enemy_ai_d/scr_enemy_ai_d.gml (2 hunks)
  • scripts/scr_marine_struct/scr_marine_struct.gml (1 hunks)
  • scripts/scr_pen_And_paper/scr_pen_And_paper.gml (2 hunks)
  • scripts/scr_squads/scr_squads.gml (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
`**/*.gml`: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e. `#macro ARR_body_parts["arm"]` will crash the ...

**/*.gml: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e. #macro ARR_body_parts["arm"] will crash the game, because there is no space between the array and the name of the macro.

  • objects/obj_controller/Alarm_5.gml
  • scripts/scr_marine_struct/scr_marine_struct.gml
  • scripts/scr_enemy_ai_d/scr_enemy_ai_d.gml
  • scripts/scr_squads/scr_squads.gml
  • scripts/scr_pen_And_paper/scr_pen_And_paper.gml
`**/*.*`: - Having humanly understandable and maintainable code is always the top most priority. - DRY (Don't repeat yourself) principle is also very important. - Ensure that the c...

**/*.*: - Having humanly understandable and maintainable code is always the top most priority.

  • objects/obj_controller/Alarm_5.gml
  • scripts/scr_marine_struct/scr_marine_struct.gml
  • scripts/scr_enemy_ai_d/scr_enemy_ai_d.gml
  • scripts/scr_squads/scr_squads.gml
  • datafiles/data/traits.json
  • scripts/scr_pen_And_paper/scr_pen_And_paper.gml
`**/*.json`: - JSON files with comments are supported by the parser used by this team. Don't warn or request changes to remove them.

**/*.json: - JSON files with comments are supported by the parser used by this team. Don't warn or request changes to remove them.

  • datafiles/data/traits.json
🔇 Additional comments (8)
datafiles/data/traits.json (1)

97-99: Praise the Omnissiah! Explicit trait effects enhance code clarity.

The addition of explicit effect descriptions to these traits provides excellent documentation for their gameplay mechanics. This standardisation will aid both developers and players in understanding trait functionality.

Also applies to: 323-325, 423-425, 452-454, 723-723

🧰 Tools
🪛 Biome (1.9.4)

[error] 99-99: Expected a property but instead found '}'.

Expected a property here.

(parse)

scripts/scr_marine_struct/scr_marine_struct.gml (1)

866-879: By the Machine God's blessing, this centralised loyalty modification serves the greater good.

The implementation correctly handles trait-based loyalty modifications with proper bounds checking. The logic flow appropriately applies trait effects in the correct order, ensuring consistent behaviour across the codebase.

scripts/scr_pen_And_paper/scr_pen_And_paper.gml (2)

3-10: By the Omnissiah's wisdom, this function is blessed.

The logic matrix is sound - charismatic units receive the Emperor's favour in charisma tests.


87-92: The Emperor protects through second chances.

Reroll logic is properly implemented - charismatic units receive blessed opportunity to retry failed charisma tests.

objects/obj_controller/Alarm_5.gml (1)

258-258: Sacred protocols demand consistency.

Loyalty adjustment now follows the blessed alter_loyalty method, ensuring trait effects are properly applied to the penitorium's influence.

scripts/scr_squads/scr_squads.gml (1)

595-597: The machine spirit approves of standardised protocols.

Sergeant changes now properly utilise the blessed alter_loyalty method, ensuring trait effects modify loyalty adjustments as the Omnissiah intended.

scripts/scr_enemy_ai_d/scr_enemy_ai_d.gml (2)

211-212: Balance protocols recalibrated by the Omnissiah's will.

Corruption range reduced for more measured effect (3-6 instead of 3-18), and loyalty adjustments now utilise the blessed alter_loyalty method for consistent trait interactions.


217-223: Chapter-wide notifications updated with precision.

Alert text enhanced with specific loyalty penalty information and chaplain observations. Global loyalty penalties reduced from -30 to -10 for balanced punishment whilst maintaining narrative coherence.

OH296 and others added 2 commits May 30, 2025 23:49
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
coderabbitai[bot]
coderabbitai bot previously approved these changes May 30, 2025
@EttyKitty EttyKitty changed the title fix: fallen trait improvement and loyalty changes fix: Fallen trait improvement and loyalty changes May 30, 2025
@OH296
Copy link
Copy Markdown
Collaborator Author

OH296 commented Jun 1, 2025

@EttyKitty i know we discussed various changes to this, but as they are all essentially new systems is it ok if this merges as is and i will work on the new systems to allow data driven roll changes in a new pr before i add any more trait roll effects into game?

@EttyKitty
Copy link
Copy Markdown
Collaborator

@EttyKitty i know we discussed various changes to this, but as they are all essentially new systems is it ok if this merges as is and i will work on the new systems to allow data driven roll changes in a new pr before i add any more trait roll effects into game?

Yeah, sure. Not sure if you've fixed the soft_target not having the mod effect or not, but that's up to you.

@OH296 OH296 merged commit f5a3368 into Adeptus-Dominus:main Jun 1, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: JSON Changes to external JSON files or their under-the-hood functionality Size: Small Type: Fix This is a fix for a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants