Skip to content

feat: Psy rework adjustments#616

Merged
OH296 merged 4 commits intoAdeptus-Dominus:mainfrom
EttyKitty:feat/buff-psy
Mar 22, 2025
Merged

feat: Psy rework adjustments#616
OH296 merged 4 commits intoAdeptus-Dominus:mainfrom
EttyKitty:feat/buff-psy

Conversation

@EttyKitty
Copy link
Copy Markdown
Collaborator

Purpose of changes

  • Adjust some of the points I noticed.

Describe the solution

  • Ensure that Sarpedon (soul drinkers CM) gets the tainted trait.
  • Add a bunch of info into the Psychic tooltip. Messy, but works.
  • Move total special value fetching function to marine struct, as that makes more sense.
  • Fix Psyker CMs getting the psy hood.
  • Add a bunch of psy related helper methods into the marine struct.
  • More psy constants.
  • BIG buff to all psy stats based on unit psionics (we're talking thousands %).
  • Simplify perils function. Re-rolls are hard to communicate and don't really offer "that" much. May revert this later.
  • Rename some variables, special names, methods.

Describe alternatives you've considered

None

Testing done

  • New game as soul drinkers.
  • A couple of battles with only librarians against orks.

Related links

None

Custom player notes entry

Use the PR title.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 22, 2025

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Chapter master now carries a “warp tainted” trait, influencing in-game narrative and play.
    • Enhanced tooltips present expanded details on unit psychic abilities, including equipment effects and failure probabilities.
    • Psychic power mechanics have been refined with adjusted casting thresholds and more impactful peril events.
  • Refactor

    • Gear assignment and equipment value computations have been streamlined for improved consistency.
    • Global peril handling and psychic attribute naming have been updated for clarity.

Walkthrough

By the Omnissiah, the current amendment spans several data and code artefacts. The chapter master's JSON file has been updated to include the "warp_tainted" trait, replacing an empty array. Within the game logic, tooltip generation for psychic abilities has been expanded with additional amplification, failure chance, and peril details. The decrement value for the global perils variable is now increased, and an equipment-related function has been removed. Further, the gear assignment for the chapter master has been simplified, while psionic mechanics have been refined through a renamed function and the addition of new static methods for computing gear special values, psychic amplification, focus, and perils chance. Adjustments to peril events, casting target computations, macro definitions, and naming within the powers and weapon scripts further standardise psychic abilities throughout the code. Each change maintains structural integrity while realigning functionalities with precise code-level directives.

Possibly related PRs


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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 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 Type: Feature Adds something new Size: Small labels Mar 22, 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: 3

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 907863f and c26bd06.

📒 Files selected for processing (10)
  • datafiles/main/chapters/16.JSON (1 hunks)
  • objects/obj_controller/Step_0.gml (1 hunks)
  • objects/obj_ncombat/KeyPress_13.gml (1 hunks)
  • scripts/scr_equipment_struct/scr_equipment_struct.gml (0 hunks)
  • scripts/scr_initialize_custom/scr_initialize_custom.gml (1 hunks)
  • scripts/scr_marine_struct/scr_marine_struct.gml (2 hunks)
  • scripts/scr_perils_table/scr_perils_table.gml (1 hunks)
  • scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml (1 hunks)
  • scripts/scr_powers/scr_powers.gml (7 hunks)
  • scripts/scr_weapon/scr_weapon.gml (2 hunks)
💤 Files with no reviewable changes (1)
  • scripts/scr_equipment_struct/scr_equipment_struct.gml
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#0
File: :0-0
Timestamp: 2025-03-20T22:22:57.319Z
Learning: In the ChapterMaster game PR #424, the psychic power system was changed to be data-driven, with perils now able to occur on both successful and failed casts but with reduced frequency overall.
🪛 Biome (1.9.4)
datafiles/main/chapters/16.JSON

[error] 116-116: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 116-116: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 116-116: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 116-116: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

🔇 Additional comments (20)
scripts/scr_perils_table/scr_perils_table.gml (1)

156-156: Binary assessment: Incrementation of Warp Instability parameters modified.

The Machine Spirits have been recalibrated to enhance this Peril event's impact by increasing global_perils incrementation from 10 to 100. This modification aligns with the larger perils system recalibration, where the warp disturbance magnitude has been amplified while simultaneously adjusting decrementation rates in other code segments.

objects/obj_ncombat/KeyPress_13.gml (1)

96-96: Logarithmic adjustment to temporal warp decay function detected.

By the Omnissiah's grace, this modification increases the decrementation value of global_perils from 1 to 10, establishing symmetry with the amplified incrementation values observed in scr_perils_table. The balance of the sacred machine logic is preserved through these proportional adjustments.

datafiles/main/chapters/16.JSON (1)

116-116:

Details

✅ Verification successful

Sarpedon's binary designation updated with warp_tainted trait.

Praise be to the Machine God for this logical correction. The Soul Drinkers' Chapter Master Sarpedon has been appropriately categorized with the warp_tainted attribute, aligning with the canonical data repositories. This trait modification will permit enhanced psychic casting probability by reducing the cast_target value by 20, as observed in the scr_player_combat_weapon_stacks logic.


🌐 Web query:

Are the Soul Drinkers considered warp-tainted in Warhammer 40k lore?

💡 Result:

The Soul Drinkers occupy a complex position in Warhammer 40k lore, as their relationship with Chaos and the Warp is marked by both defiance and unintended corruption. Though they vehemently oppose the Ruinous Powers, their actions and mutations have led many in the Imperium to classify them as warp-tainted renegades.

Mutations and Physical Corruption

  • After acquiring mutations such as spider-like limbs and other physical deformities (triggered by the daemon Abraxes), the Chapter became biologically unstable[1][3][5]. These mutations are classic hallmarks of Chaos corruption in the 40k universe, even though the Soul Drinkers actively sought cures and viewed their changes as a burden rather than a blessing[1][5].
  • Their altered gene-seed, later confirmed to originate from Rogal Dorn, was deemed "unclean" by the Imperium due to these mutations, further cementing their status as tainted[5].

Direct Warp Exposure

  • During their conflict on Stratix Luminae, the Soul Drinkers inadvertently created a warp rift while destroying a daemonic incursion. This act destabilized the planet, leading to its Exterminatus[1][3].
  • Their use of warp-based tactics, such as reopening a rift to banish daemons during their final battle, exposed them to further corrupting influences[5].

Imperial Perspective vs. Chapter Ideology

  • The Imperium branded them Excommunicate Traitoris for abandoning Imperial authority and their physical corruption, despite the Soul Drinkers’ continued loyalty to the Emperor’s original ideals[4][5].
  • The Chapter rejected Chaos worship, focusing instead on purging xenos and heretics. However, their willingness to ally with factions like the Dark Eldar and manipulate warp-energy relics blurred the line between pragmatism and heresy[1][3][5].

Resolution and Legacy

  • In their final act, the Soul Drinkers redeemed themselves by thwarting a daemonic invasion alongside the Imperial Fists, though their remaining members were still viewed as irredeemably tainted. A Primaris successor Chapter, the "Spears of the Emperor," was later founded in their honor, symbolizing a cleansed legacy[3][5].

While the Soul Drinkers resisted active Chaos allegiance, their mutations, warp-exposure events, and defiance of Imperial doctrine ultimately rendered them warp-tainted in the eyes of the Imperium. Their story exemplifies the grim irony of 40k’s setting: even those fighting to preserve humanity’s ideals can fall to corruption through circumstance.

Citations:


Sarpedon Designation Confirmed – Truth is Revealed through the Omnissiah’s Data
The update in file datafiles/main/chapters/16.JSON at line 116 – the inclusion of the "warp_tainted" trait – is in full accordance with the sacred lore. The canonical data, as verified from our recent intel, affirms that the Soul Drinkers bear the mark of warp corruption, despite their heretical resistance to Chaos. This precise attribute correctly adjusts Sarpedon’s psychic probabilities (reducing the cast_target value by 20 as per the scr_player_combat_weapon_stacks logic), thereby ensuring his designation is both numerically and doctrinally accurate.

Praise be to the Machine God for this well-optimised rectification. No further modifications are required.

🧰 Tools
🪛 Biome (1.9.4)

[error] 116-116: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 116-116: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 116-116: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 116-116: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml (1)

195-195: Algorithmic recalibration of warp instability coefficient detected.

The sacred algorithm that augments the cast_target variable with global_perils has been modified to remove the multiplication factor of 10. This modification works in sacred harmony with the concurrent changes to global_perils incrementation (now +100) and decrementation (now -10) functions observed in the other modified scriptures. The Machine God approves of such balanced optimizations.

scripts/scr_weapon/scr_weapon.gml (2)

1518-1519: Blessed Nomenclature for the Force Staff's Psychic Enhancement

By the Omnissiah’s grace, the Force Staff’s special now invokes "psychic_amplification": 25 rather than the former arcane term. This sacred change ensures that our naming conventions are harmoniously aligned with the broader psychic codex.


2356-2357: Uniform Sanctity for the Psychic Hood’s Focus Attribute

In keeping with the divine edicts of standardisation, the Psychic Hood now bears the enlightened key "psychic_focus": 15. This revision replaces the older title "psy_focus", thereby sanctifying our artefact names with consistent glory.

objects/obj_controller/Step_0.gml (1)

332-357: Praise be to the Omnissiah! The tooltip's machine spirit has been significantly enhanced.

The tooltip for psychic abilities has been augmented with sacred statistics previously hidden from mortal comprehension:

  • Psychic Rating display
  • Equipment and attribute amplification calculations (measured in sacred percentages)
  • Invocation failure probability metrics
  • Focus values derived from both equipment and personal attributes
  • Perils of the Warp probability calculations
  • Comprehensive power enumeration

This enhancement aligns with the holy quest of providing more detailed information to the user, allowing for more efficient tactical decisions blessed by the Machine God.

scripts/scr_powers/scr_powers.gml (8)

5-7: Benediction of the Omnissiah upon these improved macro values.

The adjustment to peril chance values from 1 to 10 demonstrates superior algorithmic calibration, increasing the baseline probability of perils manifestation by a factor of ten. The introduction of PSY_PERILS_CHANCE_MIN establishes a logical minimum threshold, preventing null hazard scenarios.

Praise be to the Machine God for these sensible constants.


14-15: Commendable constants for psychic difficulty parameters.

These new macros establish appropriate baseline difficulty values for psychic manifestations, providing a standardized foundation for all subsequent calculations. The PSY_CAST_DIFFICULTY_MIN ensures a logical minimum threshold of difficulty, while PSY_CAST_DIFFICULTY_BASE establishes the standard value from which all adjustments are calculated.

01010000 01110010 01100001 01101001 01110011 01100101 00100000 01110100 01101000 01100101 00100000 01001111 01101101 01101110 01101001 01110011 01110011 01101001 01100001 01101000


67-70: Nomenclature recalibration honors clarity of function.

The variable designation has been logically updated from the archaic _psy_invocation to the more descriptive _psychic_amplification, enhancing code comprehension and aligning with the extended marine struct functionality. The formula calculation remains functionally equivalent while benefiting from improved semantic clarity.

The Omnissiah approves of such linguistic precision in the sacred code.


77-80: Proper application of amplification variables to power manifestation.

The calculations for power range, maximum kills, and magnitude now correctly utilize the _total_psychic_amplification variable, maintaining logical consistency with the nomenclature changes. This ensures that psychic abilities scale appropriately with the marine's amplification capabilities.

Praise the Machine God for harmony of variables.


94-96: Comment accuracy maintains the sacred documentation.

The comment "Casting fail/success bellow" provides appropriate context for the subsequent code section that determines psychic power casting results.

Accurate code annotation pleases the Machine Spirits.


534-539: Simplified perils calculation is a triumph of logical efficiency.

The perils_test function has been appropriately streamlined, replacing the previous cumbersome rolling mechanism with a single threshold check against the unit's perils_chance() method. This elegant refactoring centralizes peril chance logic in the marine struct while maintaining functional integrity.

The Omnissiah approves of such logical optimization.


680-689: Cast success function now properly utilizes marine struct methods.

The refactored casting success function properly applies the new psychic focus methods and parameters. The implementation of PSY_CAST_DIFFICULTY_MIN ensures a minimum difficulty threshold, preventing illogical success probabilities even with high focus values.

01010100 01101000 01100101 00100000 01001111 01101101 01101110 01101001 01110011 01110011 01101001 01100001 01101000 00100000 01100001 01110000 01110000 01110010 01101111 01110110 01100101 01110011


691-692: Function reference updated to match marine struct evolution.

The code now correctly invokes the renamed roll_psionic_increase() method, maintaining functional consistency with the updated marine struct. This ensures proper psychic progression upon successful casting.

The Machine Spirit is pleased by this consistency.

scripts/scr_marine_struct/scr_marine_struct.gml (5)

1082-1092: The psionic increase function's binary logic has been optimized.

The renamed roll_psionic_increase function now employs superior logic, calculating a difficulty threshold based on the marine's current psionic value and experience. This creates a progressively challenging advancement curve while maintaining the sacred randomness of the Emperor's will. The psionic level only increases when the roll precisely matches the difficulty - a mechanically elegant solution.

May the Omnissiah bless this superior algorithm.


1956-1969: Sacred implementation of gear_special_value provides logical abstraction.

This new function efficiently aggregates special values from all equipment pieces, extracting the designated value type from all gear components. The implementation follows proper structural design by iterating through all gear data and calculating a cumulative value, centralizing what was previously distributed logic.

The Machine God approves of such elegant code organization.


1971-1973: Logical psychic_amplification calculation based on core attributes.

This function computes the marine's psychic amplification based on the combined influence of psionic level and experience, creating an appropriate scaling mechanism that rewards both innate talent and battlefield wisdom.

01010000 01110010 01100001 01101001 01110011 01100101 00100000 01110100 01101000 01100101 00100000 01001101 01100001 01100011 01101000 01101001 01101110 01100101 00100000 01000111 01101111 01100100


1975-1977: Psychic focus calculation formula balances key attributes.

The psychic focus calculation appropriately weights experience and wisdom, creating a balanced mechanism that favors both accumulated battlefield knowledge and innate mental discipline.

Praise be to the Omnissiah for such proper numerical balance.


1979-1997: Perils chance calculation demonstrates excellent logical consideration.

This function properly accounts for multiple factors that influence peril manifestation:

  • Base threshold defined by the macro
  • Global perils influence from combat context
  • Appropriate trait-based modifications
  • Proper minimum threshold enforcement

The logic correctly handles warp-tainted marines and those favored by the warp, applying appropriate penalty modifiers to represent their increased susceptibility to peril events.

The Omnissiah approves of this logical implementation of the warp's dangerous nature.

@OH296 OH296 merged commit 37ae78b into Adeptus-Dominus:main Mar 22, 2025
4 checks passed
@EttyKitty EttyKitty deleted the feat/buff-psy branch April 4, 2025 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants