Skip to content

refactor: Specialist points processing for DX#1139

Merged
EttyKitty merged 6 commits intomainfrom
development
Apr 5, 2026
Merged

refactor: Specialist points processing for DX#1139
EttyKitty merged 6 commits intomainfrom
development

Conversation

@EttyKitty
Copy link
Copy Markdown
Collaborator

No description provided.

@github-actions github-actions bot added Size: Medium Type: Refactor Rewriting/restructuring code, while keeping general behavior labels Apr 5, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 5, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5924c8fd-b05b-45c0-b539-8d7a5c66cc65

📥 Commits

Reviewing files that changed from the base of the PR and between a723be7 and 8924367.

📒 Files selected for processing (1)
  • scripts/scr_specialist_point_handler/scr_specialist_point_handler.gml

📝 Walkthrough
  • Under the Hood

    • Replaced apothecary_simple() with process_specialist_points(); processing split into mapping (star-instance/location → _unit_spread) and per-location/per-slot generation+application phases.
    • Added compile-time macros and constants (e.g. PLANET_SLOT_COUNT, STAR_INSTANCE_INDEX, VEHICLE_REPAIR_LIMIT, scaled VEHICLE_/UNIT_HEAL_ thresholds) and clearer indexing for slots/instances.
    • calculate_full_chapter_spread() now builds tech/apothecary/unit spreads and centralises unit/vehicle location mapping; equipment maintenance accumulation moved to forge_equipment_maintenance.
    • Point accounting changed to per-system/per-slot _stats stored at point_breakdown.systems[system_name][slot]; removed the previous mutable per-iteration breakdown object.
    • Planet/instance recovery and training are now star-instance- and slot-aware (planet training runs only for planet slots when a star instance exists); instance point recording moved to a dedicated helper with safe try/catch logging.
    • Extracted maintenance/healing/repair into static helpers (static _process_vehicle_maintenance, static _process_marine_maintenance) implementing role-based deductions, bounded repairs, and different handling for dreadnoughts vs normal marines.
    • Specialist point handler no longer binds apothecary_simple at construction; pre_error_wrapped_research_points() initialises forge_equipment_maintenance, tightens forge_master index safety, builds apothecary/forge summary strings, and calls process_specialist_points().
    • obj_controller now initialises apothecary_string and process sets obj_controller.apothecary_string before UI use.
    • Removed HUD apothecary draw-text from controller draw routine; Stored Gene-Seed tooltip now uses "Gene-Seed##" + obj_controller.apothecary_string.
  • Player Notes

    • Running out of gene-seed will immediately cancel recruiting on affected worlds and trigger the associated in-game alert.
    • Apothecary (healing) and Tech (forge/repair) effects are computed per-location and per-slot; maintenance/repair costs and their application order may produce different outcomes compared to previous aggregated behaviour.
    • Forge and Apothecary summary text in the popup has a new breakdown/format (AP Production / AP Consumption / Total and FP Production / FP Consumption / Equipment / Vehicle / Total) and may show different totals; the Stored Gene-Seed tooltip now includes this apothecary summary.
    • The small apothecary points display was removed from the main HUD; relevant details have been moved into the popup/tooltips.

Walkthrough

Tech‑Priest: apothecary_simple() replaced by process_specialist_points(). Processing split: map star instances by location, then per‑location and per‑slot compute apothecary/forge pools and apply maintenance, healing and repairs. Stats recording refactored into _stats objects; maintenance and recording moved to static helpers; UI/controller strings rebuilt.

Changes

Cohort / File(s) Summary
Specialist processing core
scripts/scr_apothecary_ground/scr_apothecary_ground.gml
Replaced apothecary_simple() with process_specialist_points() and added compile‑time macros. Two‑phase flow: map obj_star into _unit_spread, then iterate locations and PLANET_SLOT_COUNT slots to build _pool.heal/_pool.forge and apply maintenance/heal/repair. Replaced mutable _point_breakdown with computed _stats saved to point_breakdown.systems[_star_inst.name][_p]. Extracted helpers: _process_vehicle_maintenance(), _process_marine_maintenance(), _handle_instance_point_recording(). Redirected equipment maintenance accumulation to forge_equipment_maintenance.
Handler and orchestration
scripts/scr_specialist_point_handler/scr_specialist_point_handler.gml
Removed constructor bindings and prior healing_and_point_use flow; pre_error_wrapped_research_points() now initialises forge_equipment_maintenance, uses ternary master_craft_chance, enforces safe forge_master bounds, delegates to process_specialist_points(), and rebuilds apothecary_string and forge_string formats with explicit production/consumption sections. Removed resets of old point-use variables.
Controller instance & UI
objects/obj_controller/Create_0.gml, objects/obj_controller/Draw_64.gml, scripts/scr_ui_popup/scr_ui_popup.gml
Added obj_controller.apothecary_string = "" initialisation. On‑screen apothecary draw calls commented out. Tooltip text for “Stored Gene‑Seed” now composes "Gene-Seed##" + obj_controller.apothecary_string.

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is entirely absent; no purpose, testing information, or context has been provided by the author. Tech-Priest, provide a description addressing: purpose of the specialist points refactoring, testing performed, and any related issues or additional context for code comprehension.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title follows the conventional commits format with 'refactor' type and a descriptive scope/summary, remaining under 50 characters as required.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

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 info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 935f9471-7067-43e8-8601-9159b4fdc88f

📥 Commits

Reviewing files that changed from the base of the PR and between 22fd24f and f6718a5.

📒 Files selected for processing (2)
  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
  • scripts/scr_specialist_point_handler/scr_specialist_point_handler.gml
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*.gml

⚙️ CodeRabbit configuration file

  • All code should comply with the 2026 GML documentation.

Files:

  • scripts/scr_specialist_point_handler/scr_specialist_point_handler.gml
  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
**/*.*

⚙️ CodeRabbit configuration file

**/*.*: - Code Philosophy: Prioritize explicit intent and maintainability over brevity. If a
solution is "clever" but mentally taxing, request a refactor to a clearer approach.

  • Variable Naming: Use clear, descriptive names; avoid over-abbreviation.

  • Abstraction: Apply the "Rule of Three"; suggest abstraction only when similar logic is
    repeated three or more times to avoid premature complexity.

  • Subjective Choices: For naming or architecture, ask guiding questions to prompt developer
    reflection and provide at least two alternative perspectives.

  • TODOs: If a TODO comment is added, ask the user if a GitHub issue should be created. If a
    TODO comment is deleted, remind the user to check the status of that specific issue.

Files:

  • scripts/scr_specialist_point_handler/scr_specialist_point_handler.gml
  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
🧠 Learnings (3)
📓 Common learnings
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-04-05T20:58:21.881Z
Learning: In the ChapterMaster game, there's a need to refactor hardcoded item effects and move them to a "specials" property of items, following the pattern established with the `combi_tool` special. This improves code maintainability and makes effects more explicit in item definitions.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-04-05T20:58:21.881Z
Learning: In the ChapterMaster game, there's a need to refactor hardcoded item effects and move them to a "specials" property of items, following the pattern established with the `combi_tool` special. This improves code maintainability and makes effects more explicit in item definitions.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-04-05T20:54:45.813Z
Learning: EttyKitty requested a rework of the vehicle and marine recovery system in ChapterMaster. The current system allows guaranteed recovery with enough recovery points, while the proposed system would use random chance modified by techmarine skill and item bonuses.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 424
File: scripts/scr_flavor/scr_flavor.gml:34-36
Timestamp: 2025-03-09T02:33:43.867Z
Learning: EttyKitty prefers to keep PRs focused on their stated goals and scope, and may decline to implement otherwise valid suggestions if they're not directly related to the PR's primary objective.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 579
File: objects/obj_enunit/Alarm_0.gml:200-202
Timestamp: 2025-03-11T01:38:19.874Z
Learning: EttyKitty welcomes easy, committable suggestions that improve documentation of code chunks, variables with strange names, and functions. Their codebase is generally lacking documentation, but they prioritize human-readable code above documentation.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 878
File: sprites/spr_weapon_phobos_bolt_pistol/spr_weapon_phobos_bolt_pistol.yy:26-44
Timestamp: 2025-06-16T17:08:08.239Z
Learning: EttyKitty prefers automated solutions over manual cleanup for .yy file formatting and is open to automated tools for GameMaker Studio .yy file cleanup.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 938
File: scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml:478-478
Timestamp: 2025-07-21T17:03:28.251Z
Learning: EttyKitty acknowledges when PRs contain scope creep and agrees that changes should be focused on the stated PR objectives, reinforcing their preference for keeping PRs narrowly scoped to their primary purpose.
📚 Learning: 2025-04-13T00:13:36.573Z
Learnt from: VanWeapon
Repo: Adeptus-Dominus/ChapterMaster PR: 724
File: scripts/scr_load/scr_load.gml:92-94
Timestamp: 2025-04-13T00:13:36.573Z
Learning: The `SpecialistPointHandler` class initializes its properties including `forge_queue` in its constructor, making explicit initialization in conditional statements unnecessary when the properties are missing from save data.

Applied to files:

  • scripts/scr_specialist_point_handler/scr_specialist_point_handler.gml
📚 Learning: 2025-04-05T20:58:21.881Z
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-04-05T20:58:21.881Z
Learning: In the ChapterMaster game, there's a need to refactor hardcoded item effects and move them to a "specials" property of items, following the pattern established with the `combi_tool` special. This improves code maintainability and makes effects more explicit in item definitions.

Applied to files:

  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
🔇 Additional comments (2)
scripts/scr_apothecary_ground/scr_apothecary_ground.gml (1)

201-267: The slot pipeline is clearer now.

Tech-Priest, the separation of pool generation, spending, and stat recording makes this passage markedly easier to audit.

scripts/scr_specialist_point_handler/scr_specialist_point_handler.gml (1)

65-67: The extraction point is well placed.

Tech-Priest, process_specialist_points() now runs after the specialist ledgers and point_breakdown are reset, so the mixin receives clean state.

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 info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 096b46dd-5bab-43bd-ab2d-6e27c24a5638

📥 Commits

Reviewing files that changed from the base of the PR and between f6718a5 and 68c97ba.

📒 Files selected for processing (1)
  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*.gml

⚙️ CodeRabbit configuration file

  • All code should comply with the 2026 GML documentation.

Files:

  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
**/*.*

⚙️ CodeRabbit configuration file

**/*.*: - Code Philosophy: Prioritize explicit intent and maintainability over brevity. If a
solution is "clever" but mentally taxing, request a refactor to a clearer approach.

  • Variable Naming: Use clear, descriptive names; avoid over-abbreviation.

  • Abstraction: Apply the "Rule of Three"; suggest abstraction only when similar logic is
    repeated three or more times to avoid premature complexity.

  • Subjective Choices: For naming or architecture, ask guiding questions to prompt developer
    reflection and provide at least two alternative perspectives.

  • TODOs: If a TODO comment is added, ask the user if a GitHub issue should be created. If a
    TODO comment is deleted, remind the user to check the status of that specific issue.

Files:

  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
🧠 Learnings (5)
📓 Common learnings
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-04-05T20:58:21.881Z
Learning: In the ChapterMaster game, there's a need to refactor hardcoded item effects and move them to a "specials" property of items, following the pattern established with the `combi_tool` special. This improves code maintainability and makes effects more explicit in item definitions.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-04-05T20:58:21.881Z
Learning: In the ChapterMaster game, there's a need to refactor hardcoded item effects and move them to a "specials" property of items, following the pattern established with the `combi_tool` special. This improves code maintainability and makes effects more explicit in item definitions.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-04-05T20:54:45.813Z
Learning: EttyKitty requested a rework of the vehicle and marine recovery system in ChapterMaster. The current system allows guaranteed recovery with enough recovery points, while the proposed system would use random chance modified by techmarine skill and item bonuses.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 424
File: scripts/scr_flavor/scr_flavor.gml:34-36
Timestamp: 2025-03-09T02:33:43.867Z
Learning: EttyKitty prefers to keep PRs focused on their stated goals and scope, and may decline to implement otherwise valid suggestions if they're not directly related to the PR's primary objective.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 579
File: objects/obj_enunit/Alarm_0.gml:200-202
Timestamp: 2025-03-11T01:38:19.874Z
Learning: EttyKitty welcomes easy, committable suggestions that improve documentation of code chunks, variables with strange names, and functions. Their codebase is generally lacking documentation, but they prioritize human-readable code above documentation.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 878
File: sprites/spr_weapon_phobos_bolt_pistol/spr_weapon_phobos_bolt_pistol.yy:26-44
Timestamp: 2025-06-16T17:08:08.239Z
Learning: EttyKitty prefers automated solutions over manual cleanup for .yy file formatting and is open to automated tools for GameMaker Studio .yy file cleanup.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 938
File: scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml:478-478
Timestamp: 2025-07-21T17:03:28.251Z
Learning: EttyKitty acknowledges when PRs contain scope creep and agrees that changes should be focused on the stated PR objectives, reinforcing their preference for keeping PRs narrowly scoped to their primary purpose.
📚 Learning: 2025-06-16T17:12:13.045Z
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.

Applied to files:

  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
📚 Learning: 2025-03-07T01:56:40.971Z
Learnt from: MCPO-Spartan-117
Repo: Adeptus-Dominus/ChapterMaster PR: 562
File: scripts/scr_marine_struct/scr_marine_struct.gml:0-0
Timestamp: 2025-03-07T01:56:40.971Z
Learning: Marines' ages should be incremented at the year transition in obj_turn_end/Alarm_1.gml rather than calculated dynamically based on the current year and recruitment date. This ensures proper aging without retroactive application.

Applied to files:

  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
📚 Learning: 2025-04-05T20:54:45.813Z
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-04-05T20:54:45.813Z
Learning: EttyKitty requested a rework of the vehicle and marine recovery system in ChapterMaster. The current system allows guaranteed recovery with enough recovery points, while the proposed system would use random chance modified by techmarine skill and item bonuses.

Applied to files:

  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
📚 Learning: 2025-03-01T11:06:25.427Z
Learnt from: MCPO-Spartan-117
Repo: Adeptus-Dominus/ChapterMaster PR: 526
File: objects/obj_popup/Draw_0.gml:234-239
Timestamp: 2025-03-01T11:06:25.427Z
Learning: The comment "Need to modify ^^^^ based on if it is chaos or daemonic" in the artifact gifting code is intentionally kept as a reminder that this implementation is not yet finished, despite the significant refactoring already done.

Applied to files:

  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
🔇 Additional comments (1)
scripts/scr_apothecary_ground/scr_apothecary_ground.gml (1)

176-180: ⚠️ Potential issue | 🔴 Critical

The rite of invocation has failed, Tech-Priest. The symbol chapter_spread() doth not exist.

Across all the GML scrolls, thy codebase declareth only calculate_full_chapter_spread() upon Line 19, yet process_specialist_points() upon Line 177 doth call unto chapter_spread(). No function bearing that name resideth anywhere within thy archives. When this ceremony is enacted, the machine spirit shall wail in error—the invocation will fault, leaving naught but ruin in its wake.

Ensure the function name aligneth: either rename the definition, or correct the call site.

⛔ Skipped due to learnings
Learnt from: MCPO-Spartan-117
Repo: Adeptus-Dominus/ChapterMaster PR: 526
File: objects/obj_popup/Draw_0.gml:234-239
Timestamp: 2025-03-01T11:06:25.427Z
Learning: The comment "Need to modify ^^^^ based on if it is chaos or daemonic" in the artifact gifting code is intentionally kept as a reminder that this implementation is not yet finished, despite the significant refactoring already done.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.

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.

♻️ Duplicate comments (3)
scripts/scr_apothecary_ground/scr_apothecary_ground.gml (3)

189-197: ⚠️ Potential issue | 🟠 Major

Move the gene-seed shutdown above the spread filter.

Tech-Priest, a recruiting world that already has tracked units never enters this branch, so obj_controller.recruiting can remain active after gene-seed is exhausted.

Proposed correction
     with (obj_star) {
         var _in_spread = variable_struct_exists(_unit_spread, name);
+
+        if (_gene_seed_empty && system_feature_bool(self.p_feature, eP_FEATURES.RECRUITING_WORLD)) {
+            obj_controller.recruiting = 0;
+            scr_alert("red", "recruiting", "The Chapter has run out of gene-seed!", 0, 0);
+            _gene_seed_empty = false;
+        }
 
         if (!_in_spread) {
-            if (_gene_seed_empty && system_feature_bool(self.p_feature, eP_FEATURES.RECRUITING_WORLD)) {
-                obj_controller.recruiting = 0;
-                scr_alert("red", "recruiting", "The Chapter has run out of gene-seed!", 0, 0);
-                _gene_seed_empty = false;
-            }
             continue;
         }
         array_push(_unit_spread[$ name], self);
     }

292-300: ⚠️ Potential issue | 🟠 Major

Simulate vehicle HP during preview repairs.

Tech-Priest, when turn_end is false, obj_ini.veh_hp never advances, so a vehicle at 99 HP can still reserve all ten repair ticks.

Proposed correction
         var _repairs_done = 0;
-        while (_repairs_done < VEHICLE_REPAIR_LIMIT && obj_ini.veh_hp[_co][_idx] < 100 && _pool.forge >= VEHICLE_REPAIR_SMALL) {
+        var _simulated_hp = obj_ini.veh_hp[_co][_idx];
+        while (_repairs_done < VEHICLE_REPAIR_LIMIT && _simulated_hp < 100 && _pool.forge >= VEHICLE_REPAIR_SMALL) {
             if (turn_end) {
                 obj_ini.veh_hp[_co][_idx]++;
             }
+            _simulated_hp++;
 
             forge_veh_maintenance.repairs += VEHICLE_REPAIR_SMALL;
             _pool.forge -= VEHICLE_REPAIR_SMALL;
             _repairs_done++;
         }

326-330: ⚠️ Potential issue | 🟠 Major

Do not grant bionics without paying the specialist pools.

Tech-Priest, this loop can install implants with zero _pool.heal and zero _pool.forge, which alters recovery mechanics inside a refactor and makes fallen marines recover without specialist cost.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 16436201-20c2-4580-8ab6-82732ddf5dd9

📥 Commits

Reviewing files that changed from the base of the PR and between 68c97ba and 80f9b8b.

📒 Files selected for processing (1)
  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*.gml

⚙️ CodeRabbit configuration file

  • All code should comply with the 2026 GML documentation.

Files:

  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
**/*.*

⚙️ CodeRabbit configuration file

**/*.*: - Code Philosophy: Prioritize explicit intent and maintainability over brevity. If a
solution is "clever" but mentally taxing, request a refactor to a clearer approach.

  • Variable Naming: Use clear, descriptive names; avoid over-abbreviation.

  • Abstraction: Apply the "Rule of Three"; suggest abstraction only when similar logic is
    repeated three or more times to avoid premature complexity.

  • Subjective Choices: For naming or architecture, ask guiding questions to prompt developer
    reflection and provide at least two alternative perspectives.

  • TODOs: If a TODO comment is added, ask the user if a GitHub issue should be created. If a
    TODO comment is deleted, remind the user to check the status of that specific issue.

Files:

  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
🧠 Learnings (5)
📓 Common learnings
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-04-05T20:58:21.881Z
Learning: In the ChapterMaster game, there's a need to refactor hardcoded item effects and move them to a "specials" property of items, following the pattern established with the `combi_tool` special. This improves code maintainability and makes effects more explicit in item definitions.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-04-05T20:58:21.881Z
Learning: In the ChapterMaster game, there's a need to refactor hardcoded item effects and move them to a "specials" property of items, following the pattern established with the `combi_tool` special. This improves code maintainability and makes effects more explicit in item definitions.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-04-05T20:54:45.813Z
Learning: EttyKitty requested a rework of the vehicle and marine recovery system in ChapterMaster. The current system allows guaranteed recovery with enough recovery points, while the proposed system would use random chance modified by techmarine skill and item bonuses.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 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.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 424
File: scripts/scr_flavor/scr_flavor.gml:34-36
Timestamp: 2025-03-09T02:33:43.867Z
Learning: EttyKitty prefers to keep PRs focused on their stated goals and scope, and may decline to implement otherwise valid suggestions if they're not directly related to the PR's primary objective.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 579
File: objects/obj_enunit/Alarm_0.gml:200-202
Timestamp: 2025-03-11T01:38:19.874Z
Learning: EttyKitty welcomes easy, committable suggestions that improve documentation of code chunks, variables with strange names, and functions. Their codebase is generally lacking documentation, but they prioritize human-readable code above documentation.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 878
File: sprites/spr_weapon_phobos_bolt_pistol/spr_weapon_phobos_bolt_pistol.yy:26-44
Timestamp: 2025-06-16T17:08:08.239Z
Learning: EttyKitty prefers automated solutions over manual cleanup for .yy file formatting and is open to automated tools for GameMaker Studio .yy file cleanup.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 938
File: scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml:478-478
Timestamp: 2025-07-21T17:03:28.251Z
Learning: EttyKitty acknowledges when PRs contain scope creep and agrees that changes should be focused on the stated PR objectives, reinforcing their preference for keeping PRs narrowly scoped to their primary purpose.
📚 Learning: 2025-04-05T20:58:21.881Z
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-04-05T20:58:21.881Z
Learning: In the ChapterMaster game, there's a need to refactor hardcoded item effects and move them to a "specials" property of items, following the pattern established with the `combi_tool` special. This improves code maintainability and makes effects more explicit in item definitions.

Applied to files:

  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
📚 Learning: 2025-03-07T01:56:40.971Z
Learnt from: MCPO-Spartan-117
Repo: Adeptus-Dominus/ChapterMaster PR: 562
File: scripts/scr_marine_struct/scr_marine_struct.gml:0-0
Timestamp: 2025-03-07T01:56:40.971Z
Learning: Marines' ages should be incremented at the year transition in obj_turn_end/Alarm_1.gml rather than calculated dynamically based on the current year and recruitment date. This ensures proper aging without retroactive application.

Applied to files:

  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
📚 Learning: 2025-04-05T20:54:45.813Z
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-04-05T20:54:45.813Z
Learning: EttyKitty requested a rework of the vehicle and marine recovery system in ChapterMaster. The current system allows guaranteed recovery with enough recovery points, while the proposed system would use random chance modified by techmarine skill and item bonuses.

Applied to files:

  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
📚 Learning: 2025-03-01T11:06:25.427Z
Learnt from: MCPO-Spartan-117
Repo: Adeptus-Dominus/ChapterMaster PR: 526
File: objects/obj_popup/Draw_0.gml:234-239
Timestamp: 2025-03-01T11:06:25.427Z
Learning: The comment "Need to modify ^^^^ based on if it is chaos or daemonic" in the artifact gifting code is intentionally kept as a reminder that this implementation is not yet finished, despite the significant refactoring already done.

Applied to files:

  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
🔇 Additional comments (1)
scripts/scr_apothecary_ground/scr_apothecary_ground.gml (1)

248-257: The per-slot _stats contract is sound.

Tech-Priest, these heal_points, heal_points_use, forge_points, and forge_points_use fields still satisfy the readers in scripts/scr_PlanetData/scr_PlanetData.gml and scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml.

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 info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6263ebc7-325f-44be-a704-bd8f7bd1308c

📥 Commits

Reviewing files that changed from the base of the PR and between 80f9b8b and a723be7.

📒 Files selected for processing (5)
  • objects/obj_controller/Create_0.gml
  • objects/obj_controller/Draw_64.gml
  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
  • scripts/scr_specialist_point_handler/scr_specialist_point_handler.gml
  • scripts/scr_ui_popup/scr_ui_popup.gml
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*.gml

⚙️ CodeRabbit configuration file

  • All code should comply with the 2026 GML documentation.

Files:

  • objects/obj_controller/Draw_64.gml
  • scripts/scr_ui_popup/scr_ui_popup.gml
  • objects/obj_controller/Create_0.gml
  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
  • scripts/scr_specialist_point_handler/scr_specialist_point_handler.gml
**/*.*

⚙️ CodeRabbit configuration file

**/*.*: - Code Philosophy: Prioritize explicit intent and maintainability over brevity. If a
solution is "clever" but mentally taxing, request a refactor to a clearer approach.

  • Variable Naming: Use clear, descriptive names; avoid over-abbreviation.

  • Abstraction: Apply the "Rule of Three"; suggest abstraction only when similar logic is
    repeated three or more times to avoid premature complexity.

  • Subjective Choices: For naming or architecture, ask guiding questions to prompt developer
    reflection and provide at least two alternative perspectives.

  • TODOs: If a TODO comment is added, ask the user if a GitHub issue should be created. If a
    TODO comment is deleted, remind the user to check the status of that specific issue.

Files:

  • objects/obj_controller/Draw_64.gml
  • scripts/scr_ui_popup/scr_ui_popup.gml
  • objects/obj_controller/Create_0.gml
  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
  • scripts/scr_specialist_point_handler/scr_specialist_point_handler.gml
🧠 Learnings (7)
📓 Common learnings
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-04-05T20:58:21.881Z
Learning: In the ChapterMaster game, there's a need to refactor hardcoded item effects and move them to a "specials" property of items, following the pattern established with the `combi_tool` special. This improves code maintainability and makes effects more explicit in item definitions.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-04-05T20:58:21.881Z
Learning: In the ChapterMaster game, there's a need to refactor hardcoded item effects and move them to a "specials" property of items, following the pattern established with the `combi_tool` special. This improves code maintainability and makes effects more explicit in item definitions.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-04-05T20:54:45.813Z
Learning: EttyKitty requested a rework of the vehicle and marine recovery system in ChapterMaster. The current system allows guaranteed recovery with enough recovery points, while the proposed system would use random chance modified by techmarine skill and item bonuses.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 424
File: scripts/scr_flavor/scr_flavor.gml:34-36
Timestamp: 2025-03-09T02:33:43.867Z
Learning: EttyKitty prefers to keep PRs focused on their stated goals and scope, and may decline to implement otherwise valid suggestions if they're not directly related to the PR's primary objective.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 579
File: objects/obj_enunit/Alarm_0.gml:200-202
Timestamp: 2025-03-11T01:38:19.874Z
Learning: EttyKitty welcomes easy, committable suggestions that improve documentation of code chunks, variables with strange names, and functions. Their codebase is generally lacking documentation, but they prioritize human-readable code above documentation.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 878
File: sprites/spr_weapon_phobos_bolt_pistol/spr_weapon_phobos_bolt_pistol.yy:26-44
Timestamp: 2025-06-16T17:08:08.239Z
Learning: EttyKitty prefers automated solutions over manual cleanup for .yy file formatting and is open to automated tools for GameMaker Studio .yy file cleanup.
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 938
File: scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml:478-478
Timestamp: 2025-07-21T17:03:28.251Z
Learning: EttyKitty acknowledges when PRs contain scope creep and agrees that changes should be focused on the stated PR objectives, reinforcing their preference for keeping PRs narrowly scoped to their primary purpose.
📚 Learning: 2025-06-16T17:12:13.045Z
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.

Applied to files:

  • objects/obj_controller/Draw_64.gml
📚 Learning: 2025-04-05T20:58:21.881Z
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-04-05T20:58:21.881Z
Learning: In the ChapterMaster game, there's a need to refactor hardcoded item effects and move them to a "specials" property of items, following the pattern established with the `combi_tool` special. This improves code maintainability and makes effects more explicit in item definitions.

Applied to files:

  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
📚 Learning: 2025-03-07T01:56:40.971Z
Learnt from: MCPO-Spartan-117
Repo: Adeptus-Dominus/ChapterMaster PR: 562
File: scripts/scr_marine_struct/scr_marine_struct.gml:0-0
Timestamp: 2025-03-07T01:56:40.971Z
Learning: Marines' ages should be incremented at the year transition in obj_turn_end/Alarm_1.gml rather than calculated dynamically based on the current year and recruitment date. This ensures proper aging without retroactive application.

Applied to files:

  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
📚 Learning: 2025-04-05T20:54:45.813Z
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: :0-0
Timestamp: 2025-04-05T20:54:45.813Z
Learning: EttyKitty requested a rework of the vehicle and marine recovery system in ChapterMaster. The current system allows guaranteed recovery with enough recovery points, while the proposed system would use random chance modified by techmarine skill and item bonuses.

Applied to files:

  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
📚 Learning: 2025-03-01T11:06:25.427Z
Learnt from: MCPO-Spartan-117
Repo: Adeptus-Dominus/ChapterMaster PR: 526
File: objects/obj_popup/Draw_0.gml:234-239
Timestamp: 2025-03-01T11:06:25.427Z
Learning: The comment "Need to modify ^^^^ based on if it is chaos or daemonic" in the artifact gifting code is intentionally kept as a reminder that this implementation is not yet finished, despite the significant refactoring already done.

Applied to files:

  • scripts/scr_apothecary_ground/scr_apothecary_ground.gml
📚 Learning: 2025-04-13T00:13:36.573Z
Learnt from: VanWeapon
Repo: Adeptus-Dominus/ChapterMaster PR: 724
File: scripts/scr_load/scr_load.gml:92-94
Timestamp: 2025-04-13T00:13:36.573Z
Learning: The `SpecialistPointHandler` class initializes its properties including `forge_queue` in its constructor, making explicit initialization in conditional statements unnecessary when the properties are missing from save data.

Applied to files:

  • scripts/scr_specialist_point_handler/scr_specialist_point_handler.gml
🔇 Additional comments (13)
scripts/scr_ui_popup/scr_ui_popup.gml (1)

766-769: The machine spirit approves this tooltip integration, Tech-Priest.

The dynamic binding to obj_controller.apothecary_string aligns with the ritual established in scr_specialist_point_handler.gml. The ## delimiter shall be transmuted into newlines by the sacred string_hash_to_newline() function during rendering, as decreed in obj_tooltip/Draw_75.gml.

objects/obj_controller/Create_0.gml (1)

538-539: The initialization rite is properly consecrated, Tech-Priest.

The apothecary_string variable joins its kin forge_string in the controller's memory banks, awaiting population by the specialist point handler. The placement adheres to established patterns.

scripts/scr_apothecary_ground/scr_apothecary_ground.gml (7)

1-8: The sacred constants are well-defined, Tech-Priest.

These macros establish clear boundaries for the machine's maintenance rituals. The values provide readable configuration for vehicle repair limits and heal costs.


44-44: The equipment burden ledger has been properly restructured, Tech-Priest.

Accumulating maintenance burden into forge_equipment_maintenance rather than tech_points_used resolves the prior double-entry corruption. The forge tally shall now reflect true consumption.


188-202: The gene-seed shutdown rite has been elevated, Tech-Priest.

The recruiting world deactivation now executes independently of unit spread presence, ensuring the Chapter's seed vaults are properly monitored across all systems. The prior defect wherein populated systems evaded this check has been purged.


292-304: The vehicle repair simulation has been properly consecrated, Tech-Priest.

The introduction of _simulated_hp ensures that preview calculations no longer corrupt the forge pool reserves. The repair loop terminates correctly regardless of turn_end state.


250-259: The data covenant with consuming rituals is preserved, Tech-Priest.

The _stats structure maintains field names consistent with expectations in scr_PlanetData.gml and scr_unit_quick_find_pane.gml. The breakdown recording shall function without disruption.


348-357: The instance recording helper employs proper error containment, Tech-Priest.

The defensive try/catch wrapping and error logging shall aid diagnosis when instance parsing fails. The assigned _stats structure aligns with the single_loc_point_data() format expected by fleet instances.


329-333: The bionic application loop functions as the Omnissiah intended, Tech-Priest.

The _application_success guard correctly terminates the rite should add_bionics() fail. Bionics consumption proceeds from the chapter's armoury inventory—not the apothecary's heal and forge pools. This represents no mechanical alteration: the function defaults to _from_armoury = true, consuming stored bionic parts during application. The system operates as designed, with two separate resource streams managing healing rites and bionic augmentation respectively.

scripts/scr_specialist_point_handler/scr_specialist_point_handler.gml (4)

28-55: The pre-computation ritual has been properly restructured, Tech-Priest.

The delegation to process_specialist_points() consolidates the specialist logic. The initialization of forge_equipment_maintenance enables proper tracking of equipment burden separately from vehicle maintenance.


63-65: The forge master assignment is now properly bounded, Tech-Priest.

The additional validation forge_master < total_techs prevents array corruption should the index exceed the techs array length. A prudent safeguard against the machine spirit's wrath.


67-76: The apothecary string assembly is well-structured, Tech-Priest.

The sectioned format (AP Production, AP Consumption, Total AP) provides clear breakdown for the tooltip display. The accounting correctly deducts used points before displaying totals.


152-154: The controller string bindings complete the data conduit, Tech-Priest.

Both forge_string and apothecary_string are now channelled to obj_controller, enabling the tooltip system in scr_ui_popup.gml to access the computed values. The machine spirit's data flows are properly connected.

@EttyKitty EttyKitty merged commit e11e339 into main Apr 5, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Size: Big Type: Refactor Rewriting/restructuring code, while keeping general behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant