Skip to content

feat: Psychic system overhaul P1#424

Merged
EttyKitty merged 143 commits intoAdeptus-Dominus:mainfrom
EttyKitty:feat/psy-rework
Mar 20, 2025
Merged

feat: Psychic system overhaul P1#424
EttyKitty merged 143 commits intoAdeptus-Dominus:mainfrom
EttyKitty:feat/psy-rework

Conversation

@EttyKitty
Copy link
Copy Markdown
Collaborator

@EttyKitty EttyKitty commented Jan 14, 2025

Purpose of the PR

  • Make the code readable, moddable, less verbose and sane.

Describe the solution

Psy stuff

  • Moved all psychic discipline data to a json file.
    • Powers array, additional perils chance and strength modifiers, artifact tags, descriptions, and abbreviation letters.
  • Moved most of the psychic power data to a json file (aside from some hardcoded buff bits and such).
    • Name, type (buff/attack), range, target type (vehicles/chaff), max kills, magnitude, ap (or not), duration, flavour text (with random options based on custom conditions) and magnitude modifiers (also based on custom conditions).
  • Standardized discipline and power naming across various files.
  • Wrapped obj_pnunit/Alarm_0.gml into a try/catch, to prevent critical crashes related to powers.
  • Moved most of the psy logic from obj_pnunit/Alarm_0.gml into scr_powers.
  • Added a marine_casting_cooldown variable, to separate the cooldown functionality from the marine_casting variable.
  • Created a marine struct method psy_powers_array to get known psy powers of a marine, in a ["power_id", ...] format.
  • Created a marine struct method psy_discipline to get psy discipline of a marine, based on his first psy power.
  • Optimized the scr_powers_new file (assigning marine powers).
  • Battlelog message priority for psy stuff is increased across the board.
  • Perils:
    • Changed a bunch of effects, to be more in touch with DW the reference.
    • Fixed some issues, preventing some from working properly.
    • Allowed for perils to happen on both successful and failed casts, after the power was cast.
    • Massively reduced perils chance.
    • Changed perils chance and strength formulas and what affects both.
    • Perils log message is top priority.

Non-psy stuff

  • Artifact daemon tags now have sane names.
  • Created a helper compress_enemy_array function, to compress enemy arrays after they lose units, replacing the verbose code in some places.
  • Created a helper destroy_empty_column function, to destroy columns if they have no alive units.
  • Created a helper check_dead_marines function, to apply various logic on dead marines, that was previously just copy-pasted.
  • Created a helper add_battle_log_message function, to simplify adding messages to the battle log.
  • Created display_battle_log_message just to trigger a battle log message display alarm with a readable name.
  • Battlelog message priority for kills is changed from depending on shot count and casualties, to only depend on casualties.
  • Enemy battlelog messages now run for each individual enemy target and are not stacked too much.
  • Battlelog message limit per turn (player or enemy) is increased from 8 to 24.
  • Enemy battlelog messages now include their target name.
  • Helper, wip, get_total_special_value function, to get the total value of a special from all the unit equipment.
  • New equipment property - specials. Basically just keywords with values, or abilities, if you prefer.

Testing done

Related links

@sourcery-ai

This comment was marked as outdated.

@github-actions github-actions bot added Type: Refactor Rewriting/restructuring code, while keeping general behavior Size: Big labels Jan 14, 2025
@EttyKitty
Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@EttyKitty EttyKitty marked this pull request as ready for review February 25, 2025 21:56
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 25, 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.

Note

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.
📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Expanded combat messaging now displays up to 24 messages, enhancing battle feedback.
    • Introduced a data-driven system for psychic powers and disciplines, offering richer ability options.
    • Added new trait and chapter setting adjustments, including refreshed advantages and disadvantages.
  • Improvements

    • Refined dice rolling mechanics for more versatile and standardised random outcomes.
    • Enhanced error handling and user interface elements for clearer combat and unit information.

Summary by CodeRabbit

  • New Features

    • Introduced a dynamic psychic system using external data for disciplines and powers.
    • Added advanced dice rolling mechanics for more nuanced outcomes.
  • Gameplay Enhancements

    • Increased combat message limits with refined colour indicators.
    • Rebalanced special effects on weapons, gear, and chapter traits.
    • Adjusted unit spawning ages and role assignments for heightened variety.
  • Improvements

    • Enhanced combat feedback and overall stability for a smoother gaming experience.

Walkthrough

The latest update encompasses a multitude of enhancements across the sacred code. The decrement operation for the global_perils variable has been refined, shifting from a reduction of 4 to a decrement of 1, thus altering the rate of peril reduction. The logic for artifact tagging has been elevated, replacing numeric suffixes with the revered names of the Chaos gods, enriching the thematic depth of the artefacts. Peril management has been fortified, with the introduction of new peril outcomes and a transition to case-sensitive string checks for demonic entities. The combat logic has undergone a significant restructuring, incorporating robust error handling and a comprehensive refactor of power selection mechanisms, including the rectification of equality checks. Marine casting logic has been meticulously reorganised, with updated variable initialisations and cooldown management. Furthermore, new functions have been integrated to streamline the retrieval of power data, flavour text processing, and battle log messaging. JSON configurations for psychic disciplines and powers have been introduced, alongside the standardisation of chapter data nomenclature, correcting "rune Magick" to "rune_magic".

Possibly related PRs

  • feat: Trait cost tweaks #521: The changes in the main PR regarding the messages_to_show variable and the global_perils variable are related to the modifications in the retrieved PR, which also involves adjustments to the all_advantages and all_disadvantages arrays, including the "Psyker Abundance" trait, indicating a shared focus on balancing game mechanics.
  • fix: Trait cost adjustments #490: The changes in the main PR regarding the adjustments to the messages_to_show variable and the modifications to the global_perils variable are related to the adjustments made in the retrieved PR, which also involves modifications to the all_advantages and all_disadvantages arrays, including the "Psyker Abundance" advantage. Both PRs focus on altering game mechanics related to advantages and messaging systems, indicating a direct connection at the code level.

Suggested labels

PR: Major Coding, PR: Fix

Suggested reviewers

  • OH296
  • Blogaugis

🪧 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.

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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 57230a1 and 3ac5216.

📒 Files selected for processing (3)
  • objects/obj_ncombat/KeyPress_13.gml (1 hunks)
  • scripts/scr_add_artifact/scr_add_artifact.gml (1 hunks)
  • scripts/scr_perils_table/scr_perils_table.gml (2 hunks)
🔇 Additional comments (5)
objects/obj_ncombat/KeyPress_13.gml (1)

94-95:

Details

✅ Verification successful

Adjustment to the Perils reduction rate identified.

By the blessed calculation engines of the Omnissiah, I observe the modification of the decrement coefficient from 4 to 0.04 - a reduction of precisely 100 units. This alteration coordinates with the decimal-based Perils system modifications observed in scr_perils_table.gml, where increments now occur at 0.2 rather than 25.

Commence analysis to ensure Perils accumulation and reduction maintains appropriate equilibrium:


🏁 Script executed:

#!/bin/bash
# Perform binary examination of psychic perils accumulation patterns

# Seek additional references to global_perils to ensure consistent decimal usage
rg -A 2 -B 2 "global_perils" --glob "*.gml"

Length of output: 1442


Perils Reduction Rate Confirmed & Approved

The binary incantations confirm that our decimal-based rites have been properly enacted:

  • KeyPress_13.gml (Lines 94-95): The global_perils now decrements by 0.04, harmonizing with the new standard.
  • scr_perils_table.gml: The increment of global_perils is now set to 0.2, evidencing the conversion from the old integer-based system to our sacred decimal scale.
  • scr_powers.gml: The integration of global_perils in perils_chance calculations aligns with these adjustments.

The machine spirits rejoice at the balance maintained across the codebase, and the adjustments meet the Omnissiah's precise calculations.

scripts/scr_perils_table/scr_perils_table.gml (1)

111-112: Perils accumulation value altered to decimal representation.

The Motive Force guides this change from integer incrementation (likely 25) to decimal incrementation (0.2). This modification aligns with the decimal reduction rate of 0.04 in obj_ncombat/KeyPress_13.gml, providing more granular control over the Perils of the Warp fluctuations.

scripts/scr_add_artifact/scr_add_artifact.gml (3)

160-162: Artifact tagging logic now uses canonical Chaos god identifiers.

The Machine Spirits will be pleased with this logical enhancement. The artifact tagging process now applies the uppercase Chaos god identifiers ("KHORNE", "NURGLE", "TZEENTCH", "SLAANESH") rather than numeric suffixes, which aligns with the modifications in scr_perils_table.gml and increases data coherence.


164-166: Tome artifacts correctly exclude KHORNE from possible Chaos alignments.

01001010 01110101 01100100 01100111 01100101 01100100 00100000 01100001 01100011 01100011 01110101 01110010 01100001 01110100 01100101

The logic correctly excludes the Blood God from tome artifacts, maintaining the lore-appropriate restriction that Khorne has no interest in psychic tomes or written knowledge. This is consistent with the established doctrine of the Adeptus Administratum.


161-164:

Details

✅ Verification successful

Verify consistency of string concatenation across codebase.

The sacred cogitators observe that the string concatenation procedure here lacks a separator between "daemonic" and the Chaos god name. This could be intentional, but requires verification to ensure proper string parsing elsewhere in the code.


🏁 Script executed:

#!/bin/bash
# Examine other string operations on daemonic artifacts

# Search for parsing operations on daemonic artifacts
rg "daemonic\w+" --glob "*.gml"

# Search for code that checks artifact tags
rg "artifact_tags.*daemonic" --glob "*.gml"

Length of output: 961


Directive: Harmonized Daemonic Concatenation Confirmed

After communing with the machine spirit and examining the sacred logs, it is observed that the concatenation ritual—fusing "daemonic" directly with the Chaos god name—is executed uniformly across the codebase. The repository’s records (e.g., in the artifact tag examinations within Step_0.gml and related scripts) corroborate that the absence of a separator is an intentional design decree rather than a coding impurity.

• In scripts/scr_add_artifact.gml, the concatenation of "daemonic" with choose("NURGLE", "TZEENTCH", "SLAANESH") mirrors the consistent practice found in other artifacts.
• Artifact tag validations in Step_0.gml and Alarm_1.gml similarly adhere to the same sacred pattern.

Thus, the ritual is sound. No alterations are required unless further stylistic clarifications are desired by the order.

May the Omnissiah bless your constructs.

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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 57230a1 and 3ac5216.

📒 Files selected for processing (3)
  • objects/obj_ncombat/KeyPress_13.gml (1 hunks)
  • scripts/scr_add_artifact/scr_add_artifact.gml (1 hunks)
  • scripts/scr_perils_table/scr_perils_table.gml (2 hunks)
🔇 Additional comments (4)
objects/obj_ncombat/KeyPress_13.gml (1)

94-94:

Details

✅ Verification successful

Calibration of perils decrement gradient adjusted to match new scaling system.

The modification of the decrement value from an assumed integer (4) to a decimal (0.04) indicates a 100-fold scaling adjustment in the perils system. This alteration allows for finer gradation and more precise control of the perils accumulation/dissipation cycle.


🏁 Script executed:

#!/bin/bash
# Seek other instances of perils manipulation to verify consistent decimal scaling
echo "Searching for all perils manipulations in the codebase..."
rg "global_perils\s*[-+]=\s*\d+\.?\d*" -A 2 -B 2

Length of output: 986


Attention, O Adept of the Sacred Code!

Your inspection has revealed that the perils scaling adjustments have indeed been enacted with decimal precision. The decrement of 0.04 in objects/obj_ncombat/KeyPress_13.gml stands in harmonious accord with the system-wide calibration, where decimal manipulations (such as the addition of 0.2 in scripts/scr_perils_table/scr_perils_table.gml) ensure finer control over perils accumulation and dissipation.

  • The updated decrement operation (if (global_perils>0) then global_perils-=0.04;) confirms the refined, 100-fold scaling adjustment.
  • The presence of similarly calibrated decimal operations elsewhere in the code confirms consistency across the repository.

May the Omnissiah bless your fusion of logic and precision. The machine spirits approve this adjustment.

scripts/scr_perils_table/scr_perils_table.gml (2)

143-145: Daemon entity identification now uses canonical Chaos god identifiers.

Praise be to the Omnissiah for this logical optimization. The daemon entity identification now employs uppercase string literals ("SLAANESH", "NURGLE", "TZEENTCH") rather than numeric identifiers, improving code semantics and thematic coherence. The binary efficiency of uppercase constants for string comparison is commendable.


111-111:

Details

✅ Verification successful

Perils increment value recalibrated to decimal system.

The modification transforms the perils increment value from an integer (presumed 25) to a decimal (0.2). This adjustment is in accordance with the omniscient plan to implement a finer gradient scaling system (100-fold reduction), enhancing precision in warp fluctuation calculations.


🏁 Script executed:

#!/bin/bash
# Verify consistent scaling in perils accumulation and dissipation
echo "Confirming alignment of perils scaling across the codebase..."
rg "global_perils\s*[-+]=\s*\d+\.?\d*" --sort path

Length of output: 353


Omnissiah’s Blessings: Decimal Calibration Verified
The recalibration of perils scaling to a refined decimal system has been confirmed. The increment in scripts/scr_perils_table/scr_perils_table.gml now correctly employs a value of 0.2 while the dissipation logic in objects/obj_ncombat/KeyPress_13.gml accurately subtracts 0.04. These sacred modifications align with the intentions of our finer gradient scaling, ensuring enhanced precision in warp fluctuation calculations.

scripts/scr_add_artifact/scr_add_artifact.gml (1)

160-160:

Details

✅ Verification successful

Standard artifacts now employ canonical Chaos god identifiers.

The artifact tagging algorithm has been optimized to utilize explicit Chaos god designations ("KHORNE", "NURGLE", "TZEENTCH", "SLAANESH") rather than numeric suffixes. This enhances both the machine-readability and thematic cohesion of the codebase.


🏁 Script executed:

#!/bin/bash
# Verify consistent Chaos god naming across the codebase
echo "Scanning for Chaos god references to ensure nomenclature consistency..."
rg -i "khorne|nurgle|tzeentch|slaanesh" --sort path

Length of output: 15978


Chaos God Naming Update Approved

Glory to the Machine Spirit! The artifact tagging algorithm has been successfully reformed to employ the canonical identifiers ("KHORNE", "NURGLE", "TZEENTCH", "SLAANESH") as confirmed by the repository scan. The explicit naming now permeates the codebase—demonstrably in scripts/scr_add_artifact/scr_add_artifact.gml on line 160—enhancing both machine-readability and thematic cohesion. No further alterations are required.

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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3ac5216 and 558007f.

📒 Files selected for processing (3)
  • objects/obj_pnunit/Alarm_0.gml (1 hunks)
  • scripts/scr_perils_table/scr_perils_table.gml (4 hunks)
  • scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml (1 hunks)
🔇 Additional comments (6)
scripts/scr_perils_table/scr_perils_table.gml (5)

2-2: Invocation recognized, no issues foreseen.
This doc-style annotation fosters clarity. Continue employing such markings to enhance code comprehension.


50-50: Safeguard the random index usage.
Summon caution when men could be zero, lest we breach array boundaries. Consider verifying men > 0 before calling irandom(men).


106-106: Reinforce indexing checks.
As with line 50, confirm that men is suitably positive to avoid out-of-range access in marine_type[t].


112-112: Gradual warp influence acknowledged.
Incrementing global_perils by 0.2 instead of 25 ensures a gentler escalation in warp effects.


144-146: Maintain consistent daemonic naming approach.
Previous review suggested using macros or a constant array for daemonic references. Standardize naming to avoid confusion.

scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml (1)

170-185: Scrutiny of psyker cast logic.

  1. Be wary of the single = usage for comparisons (e.g., (marine_type[g]="Chapter Master")), as it may act as an assignment in certain contexts.
  2. The new random-based cast threshold looks sound, but ensure it aligns with the overall difficulty levels.
  3. The commented-out relic (“big_boom”, “kamehameha”) suggests legacy code. Remove or maintain with clarifying justification.

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: 13

♻️ Duplicate comments (1)
objects/obj_pnunit/Alarm_0.gml (1)

18-19: ⚠️ Potential issue

Purify comparisons by using “==” instead of “=“
In the sacred GML dialect, = for equality checks channels the Warp’s unpredictability. Use == for infallible logic.

- if (obj_ncombat.defending=false) or (obj_ncombat.dropping=1){
+ if (obj_ncombat.defending==false) or (obj_ncombat.dropping==1){
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 558007f and a3e2d30.

📒 Files selected for processing (6)
  • objects/obj_enunit/Alarm_1.gml (2 hunks)
  • objects/obj_pnunit/Alarm_0.gml (1 hunks)
  • objects/obj_pnunit/Create_0.gml (1 hunks)
  • scripts/scr_json_functions/scr_json_functions.gml (0 hunks)
  • scripts/scr_perils_table/scr_perils_table.gml (4 hunks)
  • scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml (4 hunks)
💤 Files with no reviewable changes (1)
  • scripts/scr_json_functions/scr_json_functions.gml
🧰 Additional context used
🧠 Learnings (1)
objects/obj_pnunit/Alarm_0.gml (1)
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#424
File: objects/obj_pnunit/Alarm_0.gml:208-301
Timestamp: 2025-02-26T12:50:19.276Z
Learning: In GameMaker Language (GML), both `=` and `==` can be used for equality comparisons and the code will execute correctly. However, using `=` for comparisons is considered a bad practice. The preferred approach is to use `=` exclusively for assignments and `==` for equality comparisons to maintain code clarity.
🔇 Additional comments (21)
objects/obj_pnunit/Create_0.gml (1)

43-43: Augment Access Array for Casting Cooldowns.
By introducing marine_casting_cooldown as an empty array, thou hast laid the foundation for tracking psionic skill usage and ensuring proper intervals between warp manipulations. Verify that each marine’s array index is properly assigned and remains within bounds when storing or retrieving cooldown values.

objects/obj_enunit/Alarm_1.gml (2)

251-252: Commented-Out Casting Reset Logic.
The removal of marine_casting[g] = false; suggests that a separate script is now responsible for managing casting states. Ensure the new method consistently handles edge cases where marines remain stuck in a casting state if not properly reset elsewhere.


298-305: Conditional Weapon Assignment With Casting Check.
Gating weapon additions behind if (marine_casting[g] == false) cleanses the code of contradictory states, ensuring a marine in the midst of warp manipulations cannot simultaneously handle armaments. This is cogently aligned with the updated psionic flow. Maintain vigilance for any hidden concurrency among marines array.

scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml (3)

161-161: Secondary Profile Integration for Mobility Items.
Invoking add_second_profiles_to_stack(mobi_item); provides synergy for items with layered capabilities. Confirm that future expansions do not introduce repeated infinite loops.


218-218: Casting State Check.
Skipping ranged/melee assignment when marine_casting[g] is true is prudent, preventing resource overlap. This fosters clarity between warp-crafting and direct combat.


339-340: Initialization of Casting Arrays.
Adding marine_casting and marine_casting_cooldown to every new unit scaffolds robust psionic management. Ensure that new races or unique marine types also initialize these arrays properly for consistent usage.

scripts/scr_perils_table/scr_perils_table.gml (10)

2-2: Omnissiah Annotation Detected.
The /// @mixin annotation suggests potential doc or introspection. Verify that the environment respects this directive and does not discard it in normal execution.


6-6: Increment Cooldown by 2.
Invoking marine_casting_cooldown[unit_id] += 2; for mild psychic lash results in moderate extension of warp penalties. Such increments appear balanced, yet consider bounding extreme accumulations.


13-13: Increment Cooldown by 3.
This adds a longer recharge for more severe mental backlash. Confirm synergy with line 6 so that repeated lash events do not push marines into perpetual inaction unless desired.


26-26: Prolonged Ban on Casting.
Similarly, += 999 ensures no further powers are invoked. Verify that no overshadowing logic re-enables casting prematurely.


32-32: Extended Cooldown For Psychic Mishap.
Adding 3 to marine_casting_cooldown[unit_id] aligns with the fiery mishap penalty. Ensure a cohesive scale of warp penalties across all perils for consistent user experience.


52-52: Minor Casting Delay.
And so += 1 imposes a small penalty for a lesser mental disturbance. This is consistent with the established pattern; review to confirm these incremental steps form a balanced difficulty curve.


63-63: Warp Disturbance – Medium Cooldown.
+= 2 for conjuring lesser daemons is suitable. Confirm consistent logic with lines 6 and 13 regarding moderate peril outcomes.


122-122: Global Perils Increase With Smaller Delay.
A += 1 to marine_casting_cooldown combined with obj_ncombat.global_perils += 0.2 spreads mild warp chaos. Confirm synergy with other increments to maintain overall consistency.


128-128: Cataclysmic Shockwave.
By adding 999, the marine remains incapacitated for the conflict. This is consistent with your other severe outcomes.


155-157: Canonical Chaos God Identifiers.
Blessed is the standardization of uppercase checks for “SLAANESH”, “NURGLE”, and “TZEENTCH.” Reusing the same approach from previous expansions fosters code uniformity.

objects/obj_pnunit/Alarm_0.gml (5)

1-2: Blessed insertion of exception containment
O revered disciple, this try block is a wise invocation that shields the code from runtime calamities. The Machine God smiles upon robust error handling.


4-4: No immediate issues with initial variables
Your variables are consecrated in a single, clear line. Efficiency and clarity are upheld.


7-8: Double-check object count condition
O Magos, ensure you intentionally seek outcomes only if one entity is absent. If there is but a single instance, the code path is altered. Consider verifying related conditions if your design demands otherwise.


22-24: Admirable checks for missing or engaged foes
Exiting early if no worthy foes remain preserves the holy flow of logic. These lines stand well-blessed with clarity.


201-201: Reactivating enemy objects
No objections—granting life anew to the foe ensures continuous conflict. The Omnissiah’s will be done.

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

♻️ Duplicate comments (9)
objects/obj_pnunit/Alarm_0.gml (9)

60-60: ⚠️ Potential issue

Equality operator heresy detected

Your code utilizes assignment operators where comparison is intended. The Omnissiah demands consistency in logical operations.

- if ((range[i]!=floor(range[i]) || floor(range[i])=1) && engaged=1) then range_shoot="melee";
+ if ((range[i]!=floor(range[i]) || floor(range[i])==1) && engaged==1) then range_shoot="melee";

63-68: ⚠️ Potential issue

Purify comparison operators in weapon identification logic

String comparison and logical evaluation rituals must maintain proper form to appease the machine spirits.

- if (range_shoot="ranged") and (range[i]>=dist){
+ if (range_shoot=="ranged") and (range[i]>=dist){

- if (wep[i]="Missile Launcher") then ap=1;
+ if (wep[i]=="Missile Launcher") then ap=1;

- if (instance_number(obj_enunit)=1) and (obj_enunit.men=0) and (obj_enunit.veh>0) then ap=1;
+ if (instance_number(obj_enunit)==1) and (obj_enunit.men==0) and (obj_enunit.veh>0) then ap=1;

74-74: ⚠️ Potential issue

Equality transgressions detected in AP verification protocols

The binary evaluation sigil must be doubled for proper logical comparison.

- if (ap=1) and (once_only=0){
+ if (ap==1) and (once_only==0){

81-95: ⚠️ Potential issue

Multiple logical comparison deviations detected

Your conditional evaluations throughout this section use the forbidden single-equals notation. Rectify to maintain consistency with machine doctrine.

- if (good=0) and (instance_number(obj_enunit)>1){
+ if (good==0) and (instance_number(obj_enunit)>1){

- if (good=0){
+ if (good==0){

- if (enemy2.veh>0) and (good=0){
+ if (enemy2.veh>0) and (good==0){

- if (good=0) then ap=0;
+ if (good==0) then ap=0;

Additionally, the comment on line 95 employs language unbefitting of a sacred machine text. Consider a more appropriate phrasing.


104-124: ⚠️ Potential issue

Heretical equality sigils persist in medic targeting routines

The machine spirits require purification of comparison operators throughout this segment.

- if (instance_exists(enemy)) and (once_only=0){
+ if (instance_exists(enemy)) and (once_only==0){

- if (enemy.medi>0) and (enemy.veh=0){
+ if (enemy.medi>0) and (enemy.veh==0){

- if (good=0) and (instance_number(obj_enunit)>1){
+ if (good==0) and (instance_number(obj_enunit)>1){

- if (good=0){
+ if (good==0){

- if (enemy2.veh>0) and (good=0){
+ if (enemy2.veh>0) and (good==0){

- if (good=0) then ap=0;
+ if (good==0) then ap=0;

131-151: ⚠️ Potential issue

Rectify comparison operations in infantry targeting logic

The Machine Cult demands consistency in logical evaluations.

- if (ap=0) and (once_only=0){
+ if (ap==0) and (once_only==0){

- if (good=0) and (instance_number(obj_enunit)>1){
+ if (good==0) and (instance_number(obj_enunit)>1){

- if (good=0){
+ if (good==0){

- if (enemy2.men>0) and (good=0){
+ if (enemy2.men>0) and (good==0){

152-169: ⚠️ Potential issue

Equality sigil deficiencies in melee engagement protocols

The sacred machine code requires purification of comparison operators.

- else if  (range_shoot="melee") and ((range[i]==1) or (range[i]!=floor(range[i]))){
+ else if  (range_shoot=="melee") and ((range[i]==1) or (range[i]!=floor(range[i]))){

- if (enemy.men=0) and (apa[i]=0) and (att[i]>=80){
+ if (enemy.men==0) and (apa[i]==0) and (att[i]>=80){

- if (apa[i]==1) and (once_only=0){
+ if (apa[i]==1) and (once_only==0){

- if (range[i]=1) then scr_shoot(i,enemy,good,"arp","melee");
+ if (range[i]==1) then scr_shoot(i,enemy,good,"arp","melee");

- if (good=0) and (att[i]>0) then ap=0;
+ if (good==0) and (att[i]>0) then ap=0;

171-180: ⚠️ Potential issue

Logical comparison errors in medic engagement protocols

Binary evaluation consistency violations detected throughout this segment.

- if (enemy.veh=0) and (enemy.medi>0) and (once_only=0){
+ if (enemy.veh==0) and (enemy.medi>0) and (once_only==0){

- if (range[i]=1) then scr_shoot(i,enemy,good,"medi","melee");
+ if (range[i]==1) then scr_shoot(i,enemy,good,"medi","melee");

- if (good=0) and (att[i]>0) then ap=0;
+ if (good==0) and (att[i]>0) then ap=0;

184-193: ⚠️ Potential issue

Logical inconsistencies in final target engagement protocols

Purge the impure assignment operators used in comparison contexts.

- if (ap=0) and (once_only=0){
+ if (ap==0) and (once_only==0){

- if (enemy.men>0) and (once_only=0){
+ if (enemy.men>0) and (once_only==0){

- if (range[i]=1) then scr_shoot(i,enemy,good,"att","melee");
+ if (range[i]==1) then scr_shoot(i,enemy,good,"att","melee");
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a3e2d30 and bb9bf7a.

📒 Files selected for processing (3)
  • objects/obj_enunit/Alarm_1.gml (2 hunks)
  • objects/obj_pnunit/Alarm_0.gml (1 hunks)
  • scripts/scr_powers_new/scr_powers_new.gml (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
objects/obj_pnunit/Alarm_0.gml (2)
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#424
File: objects/obj_pnunit/Alarm_0.gml:203-299
Timestamp: 2025-02-26T14:38:08.117Z
Learning: Variable shadowing/overshadowing (reusing the same variable name in nested scopes, particularly loop iterators) should be flagged as a critical issue, not a nitpick, as it can cause unpredictable behavior, bugs that are difficult to trace, and potential crashes.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#424
File: objects/obj_pnunit/Alarm_0.gml:208-301
Timestamp: 2025-02-26T12:50:19.276Z
Learning: In GameMaker Language (GML), both `=` and `==` can be used for equality comparisons and the code will execute correctly. However, using `=` for comparisons is considered a bad practice. The preferred approach is to use `=` exclusively for assignments and `==` for equality comparisons to maintain good code style.
🔇 Additional comments (6)
objects/obj_enunit/Alarm_1.gml (3)

258-264: Documentation of the sacred function parameters preserved.

The Machine Spirit approves of the preserved documentation for the scr_en_weapon function. Such annotations serve as devotional rites to ensure future tech-adepts comprehend the machine's purpose.


305-305: Logical consistency maintained with boolean comparison.

The same boolean condition optimization has been consistently applied in this instance as well. The Machine Spirit values such consistency.


251-252:

Details

✅ Verification successful

Logical observation on variable removal, adept.

The removal of the variable initialization marine_casting[g] = 0 appears prudent if it was indeed redundant. However, the Omnissiah demands certainty - confirm that this variable is properly initialized elsewhere in the machine spirit's code to prevent undefined behavior.


🏁 Script executed:

#!/bin/bash
# Searching for marine_casting initialization or declaration in the codebase
echo "Searching for marine_casting initialization patterns..."
rg -A 3 "marine_casting\s*=\s*(0|false)" --glob "*.gml"
rg -A 3 "marine_casting\[\w+\]\s*=\s*(0|false)" --glob "*.gml"
echo "Checking for array declaration patterns..."
rg "marine_casting\s*=\s*\[\]" --glob "*.gml"
rg "marine_casting\s*=\s*array_create" --glob "*.gml"

Length of output: 1216


Initialization of the marine_casting array verified, O Faithful Codex-holder

The Machine Spirit confirms that the marine_casting array is properly instantiated in objects/obj_pnunit/Create_0.gml with the declaration marine_casting = [];. Additionally, assignment operations—such as setting marine_casting[g] = false in scripts/scr_player_combat_weapon_stacks.gml—reveal that the index values receive their fidelity elsewhere in the code. Thus, the removal of the now redundant initialization in objects/obj_enunit/Alarm_1.gml is in accordance with the Omnissiah’s will.

May you continue your endeavors with the blessings of the Machine Spirit, and verify that all indices receive their due liturgical assignments prior to invocation.

scripts/scr_powers_new/scr_powers_new.gml (2)

29-33: Binary constraint adjustments detected

The code has modified the upper boundaries of psychic power acquisition from letmax+1 to letmax, and adjusted the random power selection from floor(random(letmax))+1 to floor(random(letmax)). This harmonizes with the data-driven approach mentioned in the sacred scrolls of the PR description.


44-50: Logical constraints realigned

The Machine Spirit approves of these systematic boundary adjustments. The modification from powers_have<(letmax+1) to powers_have<(letmax) ensures consistent enforcement of psychic limitations across all codepaths.

objects/obj_pnunit/Alarm_0.gml (1)

1-307: Commendable implementation of the Omnissiah's protection protocols

The encapsulation of combat logic within try-catch blocks represents proper veneration of machine-spirit integrity. Error states are now properly captured and channeled to the handle_exception ritual instead of causing catastrophic system failure.

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 bb9bf7a and ecb2405.

📒 Files selected for processing (1)
  • objects/obj_pnunit/Alarm_0.gml (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
objects/obj_pnunit/Alarm_0.gml (2)
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#424
File: objects/obj_pnunit/Alarm_0.gml:203-299
Timestamp: 2025-02-26T14:38:08.117Z
Learning: Variable shadowing/overshadowing (reusing the same variable name in nested scopes, particularly loop iterators) should be flagged as a critical issue, not a nitpick, as it can cause unpredictable behavior, bugs that are difficult to trace, and potential crashes.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#424
File: objects/obj_pnunit/Alarm_0.gml:208-301
Timestamp: 2025-02-26T12:50:19.276Z
Learning: In GameMaker Language (GML), both `=` and `==` can be used for equality comparisons and the code will execute correctly. However, using `=` for comparisons is considered a bad practice. The preferred approach is to use `=` exclusively for assignments and `==` for equality comparisons to maintain good code style.
🔇 Additional comments (1)
objects/obj_pnunit/Alarm_0.gml (1)

300-308: Commendable try-catch structure.
Your use of try { } catch(...) admirably protects the engine from runic catastrophes. May the Omnissiah keep you in His favor for such diligence.

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: 2

♻️ Duplicate comments (1)
objects/obj_pnunit/Alarm_0.gml (1)

18-19: ⚠️ Potential issue

Prefer “==” for equality checks to avoid confusion.

In GML, using “=” for comparisons may function, but it blurs the line between assignment and comparison, risking heretical bugs. Embrace “==” for clarity:

- if (obj_ncombat.defending=false) or (obj_ncombat.dropping=1) {
+ if (obj_ncombat.defending==false) or (obj_ncombat.dropping==1) {

- if (range_shoot="ranged") ...
+ if (range_shoot=="ranged") ...

This applies wherever single “=” is used for comparison in these lines. Strengthen your code’s purity in the Omnissiah’s eyes!

Also applies to: 58-59, 62-63, 65-65, 67-67, 70-71, 73-74, 80-81, 88-88, 90-90, 94-95, 98-98, 100-101, 105-105, 130-131, 152-152, 155-156, 159-160, 163-165, 170-171, 174-175, 178-179, 183-184, 186-190, 203-203, 288-288

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ecb2405 and 91c897f.

📒 Files selected for processing (3)
  • objects/obj_pnunit/Alarm_0.gml (1 hunks)
  • scripts/scr_add_artifact/scr_add_artifact.gml (8 hunks)
  • scripts/scr_perils_table/scr_perils_table.gml (4 hunks)
🧰 Additional context used
🧠 Learnings (1)
objects/obj_pnunit/Alarm_0.gml (2)
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#424
File: objects/obj_pnunit/Alarm_0.gml:203-299
Timestamp: 2025-02-26T14:38:08.117Z
Learning: Variable shadowing/overshadowing (reusing the same variable name in nested scopes, particularly loop iterators) should be flagged as a critical issue, not a nitpick, as it can cause unpredictable behavior, bugs that are difficult to trace, and potential crashes.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#424
File: objects/obj_pnunit/Alarm_0.gml:208-301
Timestamp: 2025-02-26T12:50:19.276Z
Learning: In GameMaker Language (GML), both `=` and `==` can be used for equality comparisons and the code will execute correctly. However, using `=` for comparisons is considered a bad practice. The preferred approach is to use `=` exclusively for assignments and `==` for equality comparisons to maintain good code style.
🔇 Additional comments (8)
scripts/scr_add_artifact/scr_add_artifact.gml (2)

36-36: No issues detected in the artifact base assignment.

Blessed logic flows here, with no heresy detected. The assignment for base_type is proper and does not appear to conflict with the rest of the sacred code.


160-168: Codify the Chaos god names for consistency.

By the Omnissiah’s will, these references to “KHORNE,” “NURGLE,” “TZEENTCH,” and “SLAANESH” could be arrayed in constants or macros, ensuring rightful uniformity throughout the codebase.

scripts/scr_perils_table/scr_perils_table.gml (4)

2-2: Mixin annotation recognized.

The presence of /// @mixin is a minor addition that does not impede the sacred logic. Proceed without alarm.


6-6: Heavy-handed casting cooldown increments.

The repeated usage of marine_casting_cooldown[unit_id] += 999; effectively bars the marine from further warp manipulations this battle. This has previously been noted as an extreme solution — consider a more explicit sentinel approach or a carefully named maximum value for clarity.

Also applies to: 13-13, 21-21, 26-26, 32-32, 63-63, 110-110, 122-122, 128-128


39-39: Flavor text validated.

The new phrase, “burning in agony,” remains thematically apt and does not disrupt code logic.


152-165: Reinforce Chaos god references with constants.

Hail the Machine Spirit! This logic chooses daemon patrons by searching for “SLAANESH,” “NURGLE,” or “TZEENTCH” in marine_gear. As previously recommended, establishing a shared constants file or array for these venerable names fosters consistency.

objects/obj_pnunit/Alarm_0.gml (2)

1-3: Adoption of try/catch block.

Knowledgeable priest-ling, your new try/catch structure blesses the logic with robust exception handling—a wise addition to preserve stability during warp surges.


203-205: New psychic-casting logic is well-structured.

Your methodical approach to distributing powers among known buff or attack spells shows reverence for a data-driven system, enhancing readability and maintainability.

Also applies to: 295-295

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: 6

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 91c897f and e67d36a.

📒 Files selected for processing (1)
  • scripts/scr_perils_table/scr_perils_table.gml (4 hunks)
🔇 Additional comments (6)
scripts/scr_perils_table/scr_perils_table.gml (6)

39-39: Flavor text: No warp hazards detected.
Thy new line of dialogue about flames within the marine is thematically consistent and poses no mechanical concerns.


52-52: Mild warp penalty increment introduced.
A single increment (+1) to marine_casting_cooldown is consistent with a weaker peril effect and does not conflict with other lines.


55-63: Out-of-bounds prevention is sanctified.
Your new condition if (men > 0) { … irandom(men-1) } properly restrains indexing to the array’s valid boundaries. This pleases the Machine Spirit greatly, averting the dreaded warp crash.


67-67: Increment synergy.
Adding +2 to the casting cooldown here aligns well with other mild dangers, preserving consistent warp peril progression.


118-126: Another righteous out-of-bounds safeguard.
Enclosing the repeat block with if (men > 0) and using irandom(men-1) is a wise strategy that upholds array sanctity when distributing warp injuries to multiple marines.


130-131: Warp intensification recognized.
Incrementing marine_casting_cooldown[unit_id] by 1 and increasing obj_ncombat.global_perils by 0.2 together create a layered threat. Ensure downstream code properly accounts for this increment in broader warp mechanics.

@EttyKitty EttyKitty added Category: Improvement Makes something better Type: Feature Adds something new labels Feb 27, 2025
@EttyKitty EttyKitty changed the title refactor: Data-driven psychic power system feat: Data-driven psychic power system Feb 28, 2025
@Adeptus-Dominus Adeptus-Dominus deleted a comment from coderabbitai bot Feb 28, 2025
@Adeptus-Dominus Adeptus-Dominus deleted a comment from coderabbitai bot Feb 28, 2025
@EttyKitty EttyKitty marked this pull request as draft February 28, 2025 02:04
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: 17

🔭 Outside diff range comments (1)
scripts/scr_powers/scr_powers.gml (1)

142-971: 🛠️ Refactor suggestion

Partition the colossal scr_powers function
Its grand length impedes readability and maintainability. In the name of the Emperor, consider dividing it into multiple sub-scripts (e.g., separate subroutines for calculating Perils, applying buffs, randomizing powers). This will fortify your code’s clarity and reliability.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e67d36a and 0d92f5d.

📒 Files selected for processing (4)
  • ChapterMaster.yyp (1 hunks)
  • datafiles/data/psychic_disciplines.json (1 hunks)
  • datafiles/data/psychic_powers.json (1 hunks)
  • scripts/scr_powers/scr_powers.gml (3 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
datafiles/data/psychic_powers.json

[error] 1-4: JSON standard does not allow comments.

(parse)


[error] 4-844: End of file expected

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

(parse)

🔇 Additional comments (2)
datafiles/data/psychic_disciplines.json (1)

1-144: Omnissiah’s Blessings: The Structure of Psychic Disciplines is Sound
The new JSON codex for psychic disciplines is hierarchically and consistently organized. Each discipline contains the revered keys such as "powers", "perils_chance", and "perils_strength" (where applicable), ensuring seamless integration with the ChapterMaster build. May the Machine Spirit guide future expansions.

datafiles/data/psychic_powers.json (1)

844-844: Final Termination Admonition: Verify the File’s Closure
Ensure that the psychic powers scripture terminates without extraneous tokens or trailing commas as dictated by the immutable JSON canon. A final incantation of validation is recommended.

🧰 Tools
🪛 Biome (1.9.4)

[error] 4-844: End of file expected

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

(parse)

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: 22

🔭 Outside diff range comments (1)
scripts/scr_powers/scr_powers.gml (1)

142-972: 🛠️ Refactor suggestion

Massive Script Complexity
scr_powers() is extensive and handles retrieval, damage calculations, perils checks, messaging, and post-combat housekeeping all in one place. The Machine Spirit yearns for modular purity. Breaking down repeated logic (e.g., casualty assignment, flavor message composition) into specialized scripts or subroutines will enhance clarity and maintainability.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0d92f5d and 83e53a0.

📒 Files selected for processing (22)
  • datafiles/data/psychic_powers.json (1 hunks)
  • datafiles/main/chapters/1.JSON (1 hunks)
  • datafiles/main/chapters/10.JSON (1 hunks)
  • datafiles/main/chapters/11.JSON (1 hunks)
  • datafiles/main/chapters/12.JSON (1 hunks)
  • datafiles/main/chapters/13.JSON (1 hunks)
  • datafiles/main/chapters/14.JSON (1 hunks)
  • datafiles/main/chapters/15.JSON (1 hunks)
  • datafiles/main/chapters/16.JSON (1 hunks)
  • datafiles/main/chapters/17.JSON (1 hunks)
  • datafiles/main/chapters/2.JSON (1 hunks)
  • datafiles/main/chapters/3.JSON (1 hunks)
  • datafiles/main/chapters/4.JSON (1 hunks)
  • datafiles/main/chapters/5.JSON (1 hunks)
  • datafiles/main/chapters/6.JSON (1 hunks)
  • datafiles/main/chapters/7.JSON (1 hunks)
  • datafiles/main/chapters/8.JSON (1 hunks)
  • datafiles/main/chapters/9.JSON (1 hunks)
  • datafiles/main/chapters/template.JSON (1 hunks)
  • scripts/scr_initialize_custom/scr_initialize_custom.gml (2 hunks)
  • scripts/scr_powers/scr_powers.gml (3 hunks)
  • scripts/scr_powers_new/scr_powers_new.gml (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
datafiles/data/psychic_powers.json (1)
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#512
File: datafiles/data/traits.json:946-948
Timestamp: 2025-02-24T21:56:43.096Z
Learning: GameMaker Language (GML) JSON parser supports inline comments in JSON files, making them valid in GML projects despite being non-standard JSON.
🪛 Biome (1.9.4)
datafiles/main/chapters/15.JSON

[error] 25-25: expected , but instead found "discipline"

Remove "discipline"

(parse)


[error] 25-25: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

datafiles/main/chapters/10.JSON

[error] 25-25: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

datafiles/main/chapters/3.JSON

[error] 25-25: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

datafiles/main/chapters/16.JSON

[error] 24-24: expected , but instead found "discipline"

Remove "discipline"

(parse)


[error] 24-24: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

datafiles/main/chapters/7.JSON

[error] 26-27: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

datafiles/main/chapters/8.JSON

[error] 24-24: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

datafiles/main/chapters/1.JSON

[error] 24-24: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

datafiles/main/chapters/9.JSON

[error] 24-24: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

datafiles/main/chapters/12.JSON

[error] 24-24: expected , but instead found "discipline"

Remove "discipline"

(parse)


[error] 24-24: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

datafiles/main/chapters/template.JSON

[error] 24-24: expected , but instead found "discipline"

Remove "discipline"

(parse)


[error] 24-24: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

datafiles/main/chapters/11.JSON

[error] 23-24: Expected a property but instead found '// Recruiting Planet name, leave blank to autogenerate'.

Expected a property here.

(parse)


[error] 24-24: expected , but instead found "discipline"

Remove "discipline"

(parse)


[error] 24-25: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

datafiles/main/chapters/5.JSON

[error] 25-25: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

datafiles/main/chapters/13.JSON

[error] 25-25: expected , but instead found "discipline"

Remove "discipline"

(parse)


[error] 25-25: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

datafiles/main/chapters/2.JSON

[error] 25-25: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

datafiles/main/chapters/14.JSON

[error] 25-25: expected , but instead found "discipline"

Remove "discipline"

(parse)


[error] 25-25: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

datafiles/main/chapters/4.JSON

[error] 25-25: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

datafiles/main/chapters/17.JSON

[error] 24-24: expected , but instead found "discipline"

Remove "discipline"

(parse)


[error] 24-24: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

datafiles/main/chapters/6.JSON

[error] 25-25: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

datafiles/data/psychic_powers.json

[error] 1-4: JSON standard does not allow comments.

(parse)


[error] 4-844: End of file expected

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

(parse)

🔇 Additional comments (12)
datafiles/main/chapters/16.JSON (1)

1-24: Verify Discipline Value Consistency
The PR summary extols improvements such as correcting "rune Magick" to "rune magic", yet in this sacred chapter, the discipline is set to "default". Please verify that the intended value for the discipline field is uniform across all chapters, as per the new data-driven design, so that the Omnissiah’s data remains consistent.

🧰 Tools
🪛 Biome (1.9.4)

[error] 6-6: Expected a property but instead found '// 1 - Founding, 2 - Successor, 3 - Other/non-canon/fanmade, 4 - Custom'.

Expected a property here.

(parse)


[error] 7-7: expected , but instead found "points"

Remove "points"

(parse)


[error] 8-8: Expected a property but instead found '// The id of the founding chapter, 0 for unknown or none, 10 for random'.

Expected a property here.

(parse)


[error] 9-9: expected , but instead found "splash"

Remove "splash"

(parse)


[error] 9-9: Expected a property but instead found '// in \images\creation\chapters\splash folder, the img number, 1 being Dark Angels etc.'.

Expected a property here.

(parse)


[error] 10-10: expected , but instead found "icon"

Remove "icon"

(parse)


[error] 10-10: Expected a property but instead found '// in \images\creation\chapters\icons folder, the icon number, 1 being Dark Angels etc.'.

Expected a property here.

(parse)


[error] 11-11: expected , but instead found "icon_name"

Remove "icon_name"

(parse)


[error] 11-11: Expected a property but instead found '// ? dunno what this is used for yet but the icon breaks if you dont use it '.

Expected a property here.

(parse)


[error] 12-12: expected , but instead found "fleet_type"

Remove "fleet_type"

(parse)


[error] 12-12: Expected a property but instead found '// 1= Homeworld, 2 = Fleet based, 3 = Penitent'.

Expected a property here.

(parse)


[error] 13-13: expected , but instead found "strength"

Remove "strength"

(parse)


[error] 13-13: Expected a property but instead found '// 1-10'.

Expected a property here.

(parse)


[error] 14-14: expected , but instead found "purity"

Remove "purity"

(parse)


[error] 14-14: Expected a property but instead found '// 1-10'.

Expected a property here.

(parse)


[error] 15-15: expected , but instead found "stability"

Remove "stability"

(parse)


[error] 15-15: Expected a property but instead found '// 1-10'.

Expected a property here.

(parse)


[error] 16-16: expected , but instead found "cooperation"

Remove "cooperation"

(parse)


[error] 16-16: Expected a property but instead found '// 1-10'.

Expected a property here.

(parse)


[error] 17-17: expected , but instead found "homeworld_exists"

Remove "homeworld_exists"

(parse)


[error] 17-17: Expected a property but instead found '// 1 = true'.

Expected a property here.

(parse)


[error] 18-18: expected , but instead found "recruiting_exists"

Remove "recruiting_exists"

(parse)


[error] 18-18: Expected a property but instead found '// 1 = true'.

Expected a property here.

(parse)


[error] 19-19: expected , but instead found "homeworld_rule"

Remove "homeworld_rule"

(parse)


[error] 19-19: Expected a property but instead found '// 1 = Govenor, 2 = Countries, 3 = Personal Rule'.

Expected a property here.

(parse)


[error] 20-20: expected , but instead found "homeworld"

Remove "homeworld"

(parse)


[error] 20-20: Expected a property but instead found '// one of "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine"'.

Expected a property here.

(parse)


[error] 21-21: expected , but instead found "homeworld_name"

Remove "homeworld_name"

(parse)


[error] 21-21: Expected a property but instead found '// Homeworld Planet name, leave blank to autogenerate'.

Expected a property here.

(parse)


[error] 22-22: expected , but instead found "recruiting"

Remove "recruiting"

(parse)


[error] 22-22: Expected a property but instead found '// one of "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine"'.

Expected a property here.

(parse)


[error] 23-23: expected , but instead found "recruiting_name"

Remove "recruiting_name"

(parse)


[error] 23-23: Expected a property but instead found '// Recruiting Planet name, leave blank to autogenerate'.

Expected a property here.

(parse)


[error] 24-24: expected , but instead found "discipline"

Remove "discipline"

(parse)


[error] 24-24: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

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

25-25: Transmutation of the 'discipline' Field

The discipline value has been updated to "telekinesis". Verify, o servant of the Machine God, that this change reflects the intended data-driven design and that the inline commentary (i.e., the trailing comment specifying the permitted values) does not corrupt the sacred JSON structure when parsed by strict compilers.

🧰 Tools
🪛 Biome (1.9.4)

[error] 25-25: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

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

25-25: Validation of the 'discipline' Attribute in Chapter 5

The discipline is now set to "default". Confirm that this assignment aligns with the ritualistic schema for psychic powers as decreed by our data scriptures. Also, take heed that the inline commentary may not be embraced by all JSON parsers—ensure your tooling is thus attuned.

🧰 Tools
🪛 Biome (1.9.4)

[error] 25-25: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

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

25-25: Standardization of the 'discipline' Field in Chapter 3

The discipline has been harmonized to "rune magic", fulfilling the canonical reforms that our data must undergo. However, the inline commentary appended may defile strict JSON parsers; it is advisable to verify whether your parser supports such annotations or if they must be expunged from the sacred texts.

🧰 Tools
🪛 Biome (1.9.4)

[error] 25-25: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

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

24-24: Appropriation of the 'discipline' Attribute in Chapter 8

Herein, the discipline remains as "pyromancy", a choice both stalwart and true. Nonetheless, the presence of an inline comment detailing the permissible values might not be tolerated by all JSON compilers. Ensure that your build apparatus acknowledges such commentary, or consider its removal in the interests of purity.

🧰 Tools
🪛 Biome (1.9.4)

[error] 24-24: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

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

25-25: Harmonization of the 'discipline' Key in Chapter 2

The discipline field has been rectified to "rune magic", ensuring consistency and reverence throughout the datafiles. As always, be mindful that inline comments may incur parsing tribulations in environments that adhere strictly to the sacred JSON standard.

🧰 Tools
🪛 Biome (1.9.4)

[error] 25-25: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

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

25-25: 🧹 Nitpick (assertive)

Harmonization of the Arcane Lexicon in the Chapter Codex

The modification to the “discipline” field now sanctifies our commentary with “rune magic” in place of the outdated “rune Magick.” This ensures our records across the datafiles are consistent with the Machine Spirit’s decree. As with the other data archives, please ensure that your JSON parser is equipped to handle inline comments—if not, these sacred annotations should be removed or migrated to a comment-compliant format.

A diff for the rite is as follows:

-        "discipline": "default", // one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune Magick'
+        "discipline": "default", // one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic'

Likely an incorrect or invalid review comment.

🧰 Tools
🪛 Biome (1.9.4)

[error] 25-25: expected , but instead found "discipline"

Remove "discipline"

(parse)


[error] 25-25: Expected a property but instead found '// one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune magic''.

Expected a property here.

(parse)

scripts/scr_powers_new/scr_powers_new.gml (1)

19-19: Standardize Naming of Rune Magic
Blessings upon the updated nomenclature, adept. The invocation of "rune magic" achieves consistency across the codebase, sparing the Machine Spirit from confusion.

datafiles/data/psychic_powers.json (1)

124-125: Maintain a Uniform Flavour Text Structure
"Putrid Vomit" uses "default_1" key, diverging from the standard "default". Harmony is lost. Refer to previous incantations and unify the naming or structure so the data-litanies remain pure.

scripts/scr_powers/scr_powers.gml (3)

1-2: Commendable Use of Macros
Declaring ARR_power_discipline_list as a macro ensures rapid referencing of permitted disciplines. The Machine Spirit rejoices in these code-chants.


973-1003: Tome Discipline Mapping
Your get_tome_discipline() function is a clean approach to handle specialized tomes. Verify that expansions to the disciplines_map remain in sync with new or renamed keywords. The logic is otherwise efficient.


1005-1024: Conversion from Power Letter
convert_power_letter method is well-organized and concise, matching single-letter codes to relevant discipline strings. This preserves the Omnissiah’s clarity, ensuring the correct path to knowledge is always retrieved.

@EttyKitty EttyKitty marked this pull request as ready for review February 28, 2025 17:16
@EttyKitty
Copy link
Copy Markdown
Collaborator Author

@coderabbitai resolve

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 20, 2025

✅ Actions performed

Comments resolved and changes approved.

@EttyKitty EttyKitty changed the title feat: Data-driven psychic power system feat: Psychic system overhaul P1 Mar 20, 2025
@EttyKitty EttyKitty merged commit 47db637 into Adeptus-Dominus:main Mar 20, 2025
5 checks passed
@EttyKitty EttyKitty deleted the feat/psy-rework branch March 20, 2025 23:18
@EttyKitty EttyKitty added Type: Breaking Introduces backwards compatibility issues and removed Status: WIP Work in Progress labels Mar 21, 2025
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 Category: Balance Affects game balance Category: Improvement Makes something better Size: Warning Type: Breaking Introduces backwards compatibility issues Type: Feature Adds something new Type: Refactor Rewriting/restructuring code, while keeping general behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants