refactor: Move all equipment data to json#1108
refactor: Move all equipment data to json#1108EttyKitty merged 2 commits intoAdeptus-Dominus:mainfrom
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
📝 WalkthroughWalkthroughTech-Priest, this mandate restructures the war-engine's arsenal mechanisms. Four new JSON data codices (armour, gear, mobility, weapons) have been inscribed into the project manifest and integrated via runtime globals, whilst the obsolete scr_weapon manifest has been purged from the cogitator records. Changes
Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (7)
ChapterMaster.yypdatafiles/data/armour.jsondatafiles/data/gear.jsondatafiles/data/mobility.jsondatafiles/data/weapons.jsonscripts/__init_external/__init_external.gmlscripts/scr_weapon/scr_weapon.yy
💤 Files with no reviewable changes (1)
- scripts/scr_weapon/scr_weapon.yy
🧰 Additional context used
📓 Path-based instructions (3)
**/*.gml
⚙️ CodeRabbit configuration file
- All code should comply with the 2026 GML documentation.
Files:
scripts/__init_external/__init_external.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/__init_external/__init_external.gmldatafiles/data/mobility.jsonChapterMaster.yypdatafiles/data/gear.jsondatafiles/data/armour.json
**/*.json
⚙️ CodeRabbit configuration file
- In this project, JSON files with comments are supported by the parser. It's allowed to use comments in JSON.
Files:
datafiles/data/mobility.jsondatafiles/data/gear.jsondatafiles/data/armour.json
🧠 Learnings (5)
📓 Common learnings
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 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
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: 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-03-29T10:30:25.598Z
Learnt from: EttyKitty
Repo: Adeptus-Dominus/ChapterMaster PR: 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`.
Applied to files:
scripts/__init_external/__init_external.gmlChapterMaster.yypdatafiles/data/gear.json
📚 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/__init_external/__init_external.gmlChapterMaster.yyp
📚 Learning: 2025-03-20T22:22:57.319Z
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.
Applied to files:
ChapterMaster.yyp
📚 Learning: 2026-02-01T18:40:42.157Z
Learnt from: CR
Repo: Adeptus-Dominus/ChapterMaster PR: 0
File: docs/CODE_STYLE.md:0-0
Timestamp: 2026-02-01T18:40:42.157Z
Learning: Applies to docs/**/*.{gml,gml.json} : Follow the general GameMaker convention of using type prefixes in file names
Applied to files:
ChapterMaster.yyp
🪛 Biome (2.3.13)
datafiles/data/armour.json
[error] 26-26: Expected a property but instead found '// This is already a custom suit of armor shouldnt Master crafted be its base state?'.
Expected a property here.
(parse)
[error] 27-27: expected , but instead found "artifact"
Remove "artifact"
(parse)
[error] 530-531: Expected a property but instead found '// Hireling Armour'.
Expected a property here.
(parse)
[error] 532-532: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 532-532: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 536-537: Expected a property but instead found '// Might as well buff this'.
Expected a property here.
(parse)
[error] 537-537: expected , but instead found "master_crafted"
Remove "master_crafted"
(parse)
[error] 532-540: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 540-541: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 541-541: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 541-541: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 541-554: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 554-556: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 556-556: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 556-556: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 556-574: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 574-575: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 575-575: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 575-575: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 575-593: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 593-595: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 595-595: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 595-595: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 595-603: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 603-605: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 605-605: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 605-605: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 605-623: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 623-625: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 625-625: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 625-625: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 629-630: Expected a property but instead found '// TODO - needs rebalancing'.
Expected a property here.
(parse)
[error] 625-629: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 629-630: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 630-630: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 630-630: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 630-630: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 630-631: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 631-631: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 631-631: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 631-631: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 631-632: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 632-632: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 632-632: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 632-633: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 633-635: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
🔇 Additional comments (3)
ChapterMaster.yyp (1)
124-132: Tech-Priest: IncludedFiles update aligns with the new data codices.The new JSON assets are correctly registered for packaging.
datafiles/data/gear.json (1)
108-109: Machine Spirit affirms: Key schema is canonically sound.Inspection of the codebase reveals that
spliandarpare the established, canonical property names—already integrated intoEquipmentStruct(lines 44–45 of scr_equipment_struct.gml) and actively consumed by the combat resolver. Evidence of active use appears in scr_player_combat_weapon_stacks.gml (lines 31, 34) where these properties are extracted from weapon objects and applied to combat stacks. Further verification in scr_marine_struct.gml (lines 2381–2383) confirms these properties are read and propagated when constructing special weapon profiles.The data in gear.json aligns with the established schema. No remediation required.
scripts/__init_external/__init_external.gml (1)
96-101:⚠️ Potential issue | 🟠 MajorTech-Priest: Fortify the sacred data-loading sequence against the corrupted archives.
The JSON files for weapons and gear-systems may lie absent or malformed within the data-vault. When
json_to_gamemakerencounters such degradation, it yieldsundefined—a void-state from which the machine-spirit cannot recover. Downstream code performs direct struct-access upon these globals. Should they remain void, cascade-failure and system-corruption shall ensue.The existing error-handling logs the malfunction through
handle_exception, yet leaves no protective fallback. Defensive measures are warranted to prevent catastrophic runtime faults.⚔️ Fortified initialisation sequence
- global.weapons = json_to_gamemaker(working_directory + "\\data\\weapons.json", json_parse); - global.gear = { - "armour": json_to_gamemaker(working_directory + "\\data\\armour.json", json_parse), - "gear": json_to_gamemaker(working_directory + "\\data\\gear.json", json_parse), - "mobility": json_to_gamemaker(working_directory + "\\data\\mobility.json", json_parse), - }; + global.weapons = json_to_gamemaker(working_directory + "\\data\\weapons.json", json_parse); + if (is_undefined(global.weapons)) { + global.weapons = {}; + handle_exception({longMessage: "Weapons archive corrupted or void. Defaulting to empty dataset.", stacktrace: debug_get_stack_trace(dbg_all)}); + } + + var _armour_data = json_to_gamemaker(working_directory + "\\data\\armour.json", json_parse); + var _gear_data = json_to_gamemaker(working_directory + "\\data\\gear.json", json_parse); + var _mobility_data = json_to_gamemaker(working_directory + "\\data\\mobility.json", json_parse); + + global.gear = { + "armour": is_undefined(_armour_data) ? {} : _armour_data, + "gear": is_undefined(_gear_data) ? {} : _gear_data, + "mobility": is_undefined(_mobility_data) ? {} : _mobility_data, + }; + if (is_undefined(_armour_data) || is_undefined(_gear_data) || is_undefined(_mobility_data)) { + handle_exception({longMessage: "One or more gear-archives corrupted or void. Defaulted to empty structs.", stacktrace: debug_get_stack_trace(dbg_all)}); + }⛔ Skipped due to learnings
Learnt from: EttyKitty Repo: Adeptus-Dominus/ChapterMaster PR: 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 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.Learnt from: EttyKitty Repo: Adeptus-Dominus/ChapterMaster PR: 424 File: scripts/scr_powers/scr_powers.gml:13-14 Timestamp: 2025-03-13T06:18:06.719Z Learning: The `json_to_gamemaker` function already contains built-in error handling with a try-catch block that properly handles file loading and parsing exceptions, making additional error handling unnecessary when using this function.Learnt from: CR Repo: Adeptus-Dominus/ChapterMaster PR: 0 File: docs/CODE_STYLE.md:0-0 Timestamp: 2026-02-01T18:40:42.157Z Learning: Applies to docs/**/*.{gml,gml.json} : Local variables should have a `_` prefix (e.g., `var _player_health`), except for loop indices
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
Purpose and Description
Testing done