Skip to content

fix: send tech marines to mars mission#927

Merged
OH296 merged 5 commits intoAdeptus-Dominus:mainfrom
OH296:fix_mech_missions
Jul 16, 2025
Merged

fix: send tech marines to mars mission#927
OH296 merged 5 commits intoAdeptus-Dominus:mainfrom
OH296:fix_mech_missions

Conversation

@OH296
Copy link
Collaborator

@OH296 OH296 commented Jul 16, 2025

Purpose and Description

  • Self-descriptive.

Testing done

  • None, and I understand the risks.

Related things and/or additional context

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 16, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

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

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

📝 Walkthrough

Summary by CodeRabbit

New Features

  • Added new cheat code for triggering specific Mechanicus missions, with options for mission selection.
  • Introduced a method to check if a unit is controllable based on location.

Improvements

  • Enhanced cheat code documentation with detailed mission options and usage.
  • Mission durations for Mechanicus missions are now dynamically calculated based on travel time.
  • Mission reward logic for Mars Spelunk missions has been streamlined and clarified.
  • Mission briefings now provide more detailed recommendations and information.
  • Improved clarity and accuracy in event log and popup messages.

Bug Fixes

  • Corrected case sensitivity in mission problem names for governor missions.

Refactor

  • Standardised variable naming for units across several panels and functions.
  • Simplified and consolidated fleet action checks and move options.
  • Improved internal logic for handling unit unloading and mission rewards.

Walkthrough

By the Omnissiah’s will, documentation for cheat codes was expanded to clarify mission parameters, and a new mechmission code was inscribed. Numerous scripts were refined: variable naming sanctified, mission logic and reward calculations recalibrated, and new macros and methods introduced for clarity and machine efficiency.

Changes

Files/Paths Change Summary
docs/CHEATCODES.md Expanded documentation for govmission and introduced mechmission cheat code with mission parameter details.
scripts/macros/macros.gml Added FLEET_MOVE_OPTIONS macro array.
scripts/scr_fleet_functions/scr_fleet_functions.gml Updated set_fleet_movement signature to include minimum_eta and maximum_eta; refactored ETA logic and storm penalty application; improved trade goods checks in fleet_arrival_logic.
scripts/scr_cheatcode/scr_cheatcode.gml Modified mechmission cheat code handling to support optional mission argument.
scripts/scr_mechanicus_missions/scr_mechanicus_missions.gml Refined Mechanicus mission logic: improved unit handling, dynamic mission durations, expanded briefings, and updated spawn_mechanicus_mission signature.
scripts/scr_mission_functions/scr_mission_functions.gml Added location_out_of_player_control function; corrected mission problem string capitalisation.
scripts/scr_marine_struct/scr_marine_struct.gml Added controllable static method; updated unload method for control checks and simplified location logic.
scripts/scr_mission_reward/scr_mission_reward.gml Refactored "mars_spelunk" reward logic; improved tech specialist handling, reward calculation, and message formatting.
scripts/scr_pen_And_paper/scr_pen_And_paper.gml Minor formatting: added spaces in comparison operators within standard_test.
scripts/scr_draw_management_unit/scr_draw_management_unit.gml Renamed unit to _unit; added controllability checks for location string and wrong location logic.
scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml Systematic renaming of unit to _unit in all relevant functions for clarity.
objects/obj_p_fleet/Alarm_1.gml Replaced explicit action checks with array_contains(FLEET_MOVE_OPTIONS, action); minor formatting adjustments.

Possibly related PRs

Suggested labels

PR: Fix, Size: Small


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

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

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

Support

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

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

CodeRabbit Commands (Invoked using PR comments)

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

Other keywords and placeholders

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

CodeRabbit Configuration File (.coderabbit.yaml)

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

Documentation and Community

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

@github-actions github-actions bot added Type: Docs Changes to documentation files Size: Big Type: Fix This is a fix for a bug labels Jul 16, 2025
Copy link
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: 7

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3e0fea2 and 9a8f428.

📒 Files selected for processing (12)
  • docs/CHEATCODES.md (2 hunks)
  • objects/obj_p_fleet/Alarm_1.gml (3 hunks)
  • scripts/macros/macros.gml (1 hunks)
  • scripts/scr_cheatcode/scr_cheatcode.gml (1 hunks)
  • scripts/scr_draw_management_unit/scr_draw_management_unit.gml (10 hunks)
  • scripts/scr_fleet_functions/scr_fleet_functions.gml (3 hunks)
  • scripts/scr_marine_struct/scr_marine_struct.gml (2 hunks)
  • scripts/scr_mechanicus_missions/scr_mechanicus_missions.gml (6 hunks)
  • scripts/scr_mission_functions/scr_mission_functions.gml (2 hunks)
  • scripts/scr_mission_reward/scr_mission_reward.gml (4 hunks)
  • scripts/scr_pen_And_paper/scr_pen_And_paper.gml (1 hunks)
  • scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml (9 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.gml

Instructions used from:

Sources:
⚙️ CodeRabbit Configuration File

**/*.*

Instructions used from:

Sources:
⚙️ CodeRabbit Configuration File

🧠 Learnings (10)
📓 Common learnings
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#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: MCPO-Spartan-117
PR: Adeptus-Dominus/ChapterMaster#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
PR: Adeptus-Dominus/ChapterMaster#0
File: :0-0
Timestamp: 2025-03-20T22:22:57.319Z
Learning: In the ChapterMaster game PR #424, the psychic power system was changed to be data-driven, with perils now able to occur on both successful and failed casts but with reduced frequency overall.
objects/obj_p_fleet/Alarm_1.gml (4)
Learnt from: OH296
PR: Adeptus-Dominus/ChapterMaster#646
File: objects/obj_pnunit/Alarm_5.gml:84-91
Timestamp: 2025-03-31T23:32:30.003Z
Learning: In obj_pnunit/Alarm_5.gml, the function get_armour_data("maintenance") will always return a numeric value (at minimum 0), making null/undefined checks unnecessary.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#649
File: objects/obj_enunit/Alarm_0.gml:289-291
Timestamp: 2025-03-31T15:41:45.611Z
Learning: GameMaker Studio's function `action_if_variable(image_index, -500, 0)` is auto-generated code from GameMaker's visual Drag and Drop system. It checks if image_index equals -500. In ChapterMaster, this was being used as a special flag for enemy unit movement, but wasn't triggering consistently, causing enemies to move only every other turn. The refactored code replaced this with direct function calls at specific combat stages.
Learnt from: MCPO-Spartan-117
PR: Adeptus-Dominus/ChapterMaster#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.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#649
File: objects/obj_enunit/Alarm_0.gml:289-291
Timestamp: 2025-03-31T15:41:45.611Z
Learning: GameMaker Studio's function `action_if_variable(image_index, -500, 0)` was part of an old enemy movement system in ChapterMaster. This syntax is auto-generated from GameMaker's Drag-and-Drop interface and checks if image_index is greater than or equal to -500. In the refactored code, enemy movement is triggered directly through function calls rather than relying on this conditional check.
scripts/scr_cheatcode/scr_cheatcode.gml (2)
Learnt from: MCPO-Spartan-117
PR: Adeptus-Dominus/ChapterMaster#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
PR: Adeptus-Dominus/ChapterMaster#649
File: objects/obj_enunit/Alarm_0.gml:289-291
Timestamp: 2025-03-31T15:41:45.611Z
Learning: GameMaker Studio's function `action_if_variable(image_index, -500, 0)` is auto-generated code from GameMaker's visual Drag and Drop system. It checks if image_index equals -500. In ChapterMaster, this was being used as a special flag for enemy unit movement, but wasn't triggering consistently, causing enemies to move only every other turn. The refactored code replaced this with direct function calls at specific combat stages.
scripts/scr_pen_And_paper/scr_pen_And_paper.gml (6)
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#649
File: objects/obj_enunit/Alarm_0.gml:289-291
Timestamp: 2025-03-31T15:41:45.611Z
Learning: GameMaker Studio's function `action_if_variable(image_index, -500, 0)` is auto-generated code from GameMaker's visual Drag and Drop system. It checks if image_index equals -500. In ChapterMaster, this was being used as a special flag for enemy unit movement, but wasn't triggering consistently, causing enemies to move only every other turn. The refactored code replaced this with direct function calls at specific combat stages.
Learnt from: OH296
PR: Adeptus-Dominus/ChapterMaster#646
File: objects/obj_pnunit/Alarm_5.gml:84-91
Timestamp: 2025-03-31T23:32:30.003Z
Learning: In obj_pnunit/Alarm_5.gml, the function get_armour_data("maintenance") will always return a numeric value (at minimum 0), making null/undefined checks unnecessary.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#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
PR: Adeptus-Dominus/ChapterMaster#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
PR: Adeptus-Dominus/ChapterMaster#474
File: scripts/scr_buttons/scr_buttons.gml:153-201
Timestamp: 2025-02-24T17:50:27.583Z
Learning: For consistency in GML code, prefer multi-line conditions with brackets over single-line conditions.
Learnt from: MCPO-Spartan-117
PR: Adeptus-Dominus/ChapterMaster#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.
scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml (10)
Learnt from: OH296
PR: Adeptus-Dominus/ChapterMaster#646
File: objects/obj_pnunit/Alarm_5.gml:84-91
Timestamp: 2025-03-31T23:32:30.003Z
Learning: In obj_pnunit/Alarm_5.gml, the function get_armour_data("maintenance") will always return a numeric value (at minimum 0), making null/undefined checks unnecessary.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#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
PR: Adeptus-Dominus/ChapterMaster#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: VanWeapon
PR: Adeptus-Dominus/ChapterMaster#737
File: scripts/scr_save/scr_save.gml:203-205
Timestamp: 2025-04-19T23:59:08.325Z
Learning: In the ChapterMaster codebase, empty values are expected when retrieving units with fetch_unit(), and checking for empty strings with `if(unit == "")` is sufficient error handling. Additional struct validation is not required.
Learnt from: MCPO-Spartan-117
PR: Adeptus-Dominus/ChapterMaster#554
File: objects/obj_popup/Step_0.gml:756-767
Timestamp: 2025-03-06T16:02:06.286Z
Learning: The variable 'woopwoopwoop' in the ChapterMaster codebase is a poorly named multi-purpose variable used both for controlling ancient ruins combat flow and for passing menu state in the save/load system. This type of naming makes code maintenance difficult.
Learnt from: MCPO-Spartan-117
PR: Adeptus-Dominus/ChapterMaster#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.
Learnt from: VanWeapon
PR: Adeptus-Dominus/ChapterMaster#725
File: scripts/scr_special_view/scr_special_view.gml:49-49
Timestamp: 2025-04-15T10:54:19.720Z
Learning: In the ChapterMaster codebase, obj_ini.role[100][2] and obj_ini.role[100][eROLE.ChapterMaster] reference different roles, and both are needed in conditions checking for specific types of units. Numeric indices should not be assumed to match their corresponding enum values without verification.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#647
File: scripts/scr_en_weapon/scr_en_weapon.gml:24-928
Timestamp: 2025-03-29T10:30:25.598Z
Learning: A data-driven approach for weapon management in `scripts/scr_en_weapon/scr_en_weapon.gml` is planned for a future PR, not within the scope of PR #647.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#579
File: objects/obj_enunit/Alarm_0.gml:186-187
Timestamp: 2025-03-11T01:34:29.268Z
Learning: In the ChapterMaster game, the variable `_column_size_value` represents the physical size/mass of a column of units, calculated as (vehicles * 2.5) + (dreadnoughts * 2) + (men * 0.5), and is used for determining back row protection rules.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#649
File: objects/obj_enunit/Alarm_0.gml:289-291
Timestamp: 2025-03-31T15:41:45.611Z
Learning: GameMaker Studio's function `action_if_variable(image_index, -500, 0)` is auto-generated code from GameMaker's visual Drag and Drop system. It checks if image_index equals -500. In ChapterMaster, this was being used as a special flag for enemy unit movement, but wasn't triggering consistently, causing enemies to move only every other turn. The refactored code replaced this with direct function calls at specific combat stages.
scripts/scr_marine_struct/scr_marine_struct.gml (1)
Learnt from: MCPO-Spartan-117
PR: Adeptus-Dominus/ChapterMaster#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.
scripts/scr_mission_reward/scr_mission_reward.gml (5)
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#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: MCPO-Spartan-117
PR: Adeptus-Dominus/ChapterMaster#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
PR: Adeptus-Dominus/ChapterMaster#0
File: :0-0
Timestamp: 2025-03-20T22:22:57.319Z
Learning: In the ChapterMaster game PR #424, the psychic power system was changed to be data-driven, with perils now able to occur on both successful and failed casts but with reduced frequency overall.
Learnt from: VanWeapon
PR: Adeptus-Dominus/ChapterMaster#725
File: scripts/scr_special_view/scr_special_view.gml:49-49
Timestamp: 2025-04-15T10:54:19.720Z
Learning: In the ChapterMaster codebase, obj_ini.role[100][2] and obj_ini.role[100][eROLE.ChapterMaster] reference different roles, and both are needed in conditions checking for specific types of units. Numeric indices should not be assumed to match their corresponding enum values without verification.
Learnt from: MCPO-Spartan-117
PR: Adeptus-Dominus/ChapterMaster#554
File: objects/obj_popup/Step_0.gml:756-767
Timestamp: 2025-03-06T16:02:06.286Z
Learning: The variable 'woopwoopwoop' in ancient ruins exploration code is a poorly named boolean flag that controls the flow between detecting a battle in ruins and initiating the combat sequence.
scripts/scr_fleet_functions/scr_fleet_functions.gml (3)
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#649
File: objects/obj_enunit/Alarm_0.gml:289-291
Timestamp: 2025-03-31T15:41:45.611Z
Learning: GameMaker Studio's function `action_if_variable(image_index, -500, 0)` was part of an old enemy movement system in ChapterMaster. This syntax is auto-generated from GameMaker's Drag-and-Drop interface and checks if image_index is greater than or equal to -500. In the refactored code, enemy movement is triggered directly through function calls rather than relying on this conditional check.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#649
File: objects/obj_enunit/Alarm_0.gml:289-291
Timestamp: 2025-03-31T15:41:45.611Z
Learning: GameMaker Studio's function `action_if_variable(image_index, -500, 0)` is auto-generated code from GameMaker's visual Drag and Drop system. It checks if image_index equals -500. In ChapterMaster, this was being used as a special flag for enemy unit movement, but wasn't triggering consistently, causing enemies to move only every other turn. The refactored code replaced this with direct function calls at specific combat stages.
Learnt from: MCPO-Spartan-117
PR: Adeptus-Dominus/ChapterMaster#554
File: objects/obj_popup/Step_0.gml:756-767
Timestamp: 2025-03-06T16:02:06.286Z
Learning: The variable 'woopwoopwoop' in ancient ruins exploration code is a poorly named boolean flag that controls the flow between detecting a battle in ruins and initiating the combat sequence.
scripts/scr_draw_management_unit/scr_draw_management_unit.gml (9)
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#649
File: objects/obj_enunit/Alarm_0.gml:289-291
Timestamp: 2025-03-31T15:41:45.611Z
Learning: GameMaker Studio's function `action_if_variable(image_index, -500, 0)` is auto-generated code from GameMaker's visual Drag and Drop system. It checks if image_index equals -500. In ChapterMaster, this was being used as a special flag for enemy unit movement, but wasn't triggering consistently, causing enemies to move only every other turn. The refactored code replaced this with direct function calls at specific combat stages.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#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
PR: Adeptus-Dominus/ChapterMaster#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: OH296
PR: Adeptus-Dominus/ChapterMaster#646
File: objects/obj_pnunit/Alarm_5.gml:84-91
Timestamp: 2025-03-31T23:32:30.003Z
Learning: In obj_pnunit/Alarm_5.gml, the function get_armour_data("maintenance") will always return a numeric value (at minimum 0), making null/undefined checks unnecessary.
Learnt from: VanWeapon
PR: Adeptus-Dominus/ChapterMaster#725
File: scripts/scr_special_view/scr_special_view.gml:49-49
Timestamp: 2025-04-15T10:54:19.720Z
Learning: In the ChapterMaster codebase, obj_ini.role[100][2] and obj_ini.role[100][eROLE.ChapterMaster] reference different roles, and both are needed in conditions checking for specific types of units. Numeric indices should not be assumed to match their corresponding enum values without verification.
Learnt from: MCPO-Spartan-117
PR: Adeptus-Dominus/ChapterMaster#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.
Learnt from: VanWeapon
PR: Adeptus-Dominus/ChapterMaster#737
File: scripts/scr_save/scr_save.gml:203-205
Timestamp: 2025-04-19T23:59:08.325Z
Learning: In the ChapterMaster codebase, empty values are expected when retrieving units with fetch_unit(), and checking for empty strings with `if(unit == "")` is sufficient error handling. Additional struct validation is not required.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#647
File: scripts/scr_en_weapon/scr_en_weapon.gml:24-928
Timestamp: 2025-03-29T10:30:25.598Z
Learning: A data-driven approach for weapon management in `scripts/scr_en_weapon/scr_en_weapon.gml` is planned for a future PR, not within the scope of PR #647.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#579
File: objects/obj_enunit/Alarm_0.gml:186-187
Timestamp: 2025-03-11T01:34:29.268Z
Learning: In the ChapterMaster game, the variable `_column_size_value` represents the physical size/mass of a column of units, calculated as (vehicles * 2.5) + (dreadnoughts * 2) + (men * 0.5), and is used for determining back row protection rules.
scripts/scr_mechanicus_missions/scr_mechanicus_missions.gml (3)
Learnt from: MCPO-Spartan-117
PR: Adeptus-Dominus/ChapterMaster#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.
Learnt from: VanWeapon
PR: Adeptus-Dominus/ChapterMaster#725
File: scripts/scr_special_view/scr_special_view.gml:49-49
Timestamp: 2025-04-15T10:54:19.720Z
Learning: In the ChapterMaster codebase, obj_ini.role[100][2] and obj_ini.role[100][eROLE.ChapterMaster] reference different roles, and both are needed in conditions checking for specific types of units. Numeric indices should not be assumed to match their corresponding enum values without verification.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#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.
🪛 markdownlint-cli2 (0.17.2)
docs/CHEATCODES.md

54-54: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


55-55: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


55-55: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)


56-56: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


57-57: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


57-57: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)


58-58: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


59-59: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


59-59: Trailing spaces
Expected: 0 or 2; Actual: 4

(MD009, no-trailing-spaces)


60-60: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


61-61: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


72-72: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


73-73: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


74-74: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

🔇 Additional comments (19)
scripts/macros/macros.gml (1)

24-25: By the Omnissiah's will, this macro consolidation pleases the machine spirit.

The FLEET_MOVE_OPTIONS macro properly centralises fleet movement actions with correct syntax spacing. The inclusion of "mars_spelunk1" aligns with the Mars mission objectives.

scripts/scr_pen_And_paper/scr_pen_And_paper.gml (1)

90-93: Sacred formatting rituals have been properly observed.

The spacing around comparison operators (>= and <) enhances readability of the conditional logic whilst preserving the machine spirit's calculations.

objects/obj_p_fleet/Alarm_1.gml (3)

30-30: Excellent refactoring of the fleet movement logic, Tech-Adept.

The consolidation from multiple string comparisons to array_contains(FLEET_MOVE_OPTIONS, action) follows the DRY principle and centralises movement action definitions. The machine spirit approves this efficiency improvement.


45-45: Minor formatting sanctification detected.

Proper spacing around the assignment operator enhances code readability.


60-60: Assignment formatting blessed by the Omnissiah.

Consistent spacing improves code clarity without altering functionality.

scripts/scr_mission_functions/scr_mission_functions.gml (2)

10-13: Blessed function addition serves the Mars mission protocols.

The location_out_of_player_control function provides centralised logic for determining marine controllability. The inclusion of "Mars" in the static array directly supports the PR's Mars mission objectives.


63-63: Case sensitivity anomaly purged from the machine spirit.

The correction from "Show_of_power" to "show_of_power" ensures consistency in mission problem selection logic for Hive planets.

scripts/scr_cheatcode/scr_cheatcode.gml (1)

142-150: By the Omnissiah's will, the mechanicus mission implementation is sanctified.

The conditional argument passing to spawn_mechanicus_mission() follows the blessed patterns established by other cheat codes. The logic correctly handles both parameterised and default invocations.

scripts/scr_marine_struct/scr_marine_struct.gml (3)

2021-2023: Blessed early termination prevents heretical processing.

The addition of the controllable check with immediate return follows the sacred principle of failing fast. This prevents unnecessary processing for marines outside player control.


1936-1938: Approval granted: controllable() and its dependency are verified
The location_out_of_player_control function is defined in scripts/scr_mission_functions/scr_mission_functions.gml and behaves as expected. The new static controllable() method is clean, efficient, and ready for consecration.


2025-2025: Affirmed: Unloading condition retains all exclusions

By the Omnissiah’s logic, the check

current_location[2] != "Warp" && current_location[2] == system.name

implicitly excludes “Lost” and any non-matching locations, while still allowing valid systems (e.g. Terra, Mechanicus Vessel). Other scripts (Step_0.gml’s repair logic and scr_unit_quick_find_pane.gml’s unload_selection) continue to enforce their own exclusions. No further changes required.

scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml (1)

21-755: Blessed be the Machine God's nomenclature standards.

The systematic renaming of unit to _unit brings order to the code's sacred patterns. This follows proper cogitator protocols for local variable designation.

scripts/scr_draw_management_unit/scr_draw_management_unit.gml (2)

3-522: The Omnissiah approves this uniformity of designation.

Variable renaming to _unit maintains consistency with the sacred codebase patterns established in other machine-scripts.


27-37: The Machine Spirit's logic flows with greater clarity.

Replacing hardcoded location checks with the controllable() method invocation is a sacred improvement. This abstraction honours the principles of modularity.

Also applies to: 432-432

scripts/scr_fleet_functions/scr_fleet_functions.gml (2)

142-142: The Motive Force flows with greater precision.

The addition of temporal constraints via minimum_eta and maximum_eta parameters grants superior control over fleet chronometry. The storm penalty's proper containment within orbital verification prevents erroneous calculations.

Also applies to: 187-189, 195-195


498-509: By the Omnissiah's binary truth, precision is achieved!

The sacred Mars expedition protocols now employ exact string comparison rather than substring divination. The explicit fleet action assignment and mutually exclusive conditionals ensure proper mechanicus vessel navigation.

scripts/scr_mission_reward/scr_mission_reward.gml (1)

17-109: The Machine God's algorithms have been properly sanctified.

The refactored Mars spelunk reward logic employs superior data structures and skill testing protocols. The use of collect_role_group with filtered conditions is a blessed improvement over primitive iteration patterns.

scripts/scr_mechanicus_missions/scr_mechanicus_missions.gml (2)

342-361: The Omnissiah approves these temporal calculations

Dynamic mission duration based on actual travel distance demonstrates proper logistical cogitation. The Machine Spirit is pleased.


150-152: Logic anomaly in disposition calculation detected

The sacred calculation max(techs_taken, 4) grants minimum 4 disposition even when fewer tech-marines embark. This defies the Machine God's principle of proportional reward.

Consider:

-            if (techs_taken>=5){
-            	obj_controller.disposition[3]+=max(techs_taken,4);
-            }
+            if (techs_taken>=5){
+            	obj_controller.disposition[3]+=techs_taken;
+            }
⛔ Skipped due to learnings
Learnt from: MCPO-Spartan-117
PR: Adeptus-Dominus/ChapterMaster#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
PR: Adeptus-Dominus/ChapterMaster#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: MCPO-Spartan-117
PR: Adeptus-Dominus/ChapterMaster#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.
Learnt from: VanWeapon
PR: Adeptus-Dominus/ChapterMaster#725
File: scripts/scr_initialize_custom/scr_initialize_custom.gml:956-959
Timestamp: 2025-04-15T11:07:33.927Z
Learning: Negative vehicle counts (like `rhino -= 2` potentially resulting in negative values) are acceptable in the `scr_initialize_custom` function, particularly when handling chapter advantages like "Lightning Warriors". This is intentional behavior in the game's design.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#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
PR: Adeptus-Dominus/ChapterMaster#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
PR: Adeptus-Dominus/ChapterMaster#647
File: scripts/scr_en_weapon/scr_en_weapon.gml:24-928
Timestamp: 2025-03-29T10:30:25.598Z
Learning: A data-driven approach for weapon management in `scripts/scr_en_weapon/scr_en_weapon.gml` is planned for a future PR, not within the scope of PR #647.
Learnt from: OH296
PR: Adeptus-Dominus/ChapterMaster#646
File: objects/obj_pnunit/Alarm_5.gml:84-91
Timestamp: 2025-03-31T23:32:30.003Z
Learning: In obj_pnunit/Alarm_5.gml, the function get_armour_data("maintenance") will always return a numeric value (at minimum 0), making null/undefined checks unnecessary.

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

Labels

Size: Big Type: Docs Changes to documentation files Type: Fix This is a fix for a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant