feat: Specialist assignment buttons for companies and a refactor#648
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughHail, brethren of the Omnissiah! This pull request brings forth refinements to the role management apparatus within the code, introducing new parameters— Possibly related issues
Possibly related PRs
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (4)
scripts/is_specialist/is_specialist.gml(1 hunks)scripts/scr_company_struct/scr_company_struct.gml(2 hunks)scripts/scr_manage_task_selector/scr_manage_task_selector.gml(2 hunks)scripts/scr_ui_manage/scr_ui_manage.gml(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`**/*.gml`: Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e. `#macro ARR_body_parts["arm"]` will crash the ga...
**/*.gml: Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e.#macro ARR_body_parts["arm"]will crash the game, because there is no space between the array and the name of the macro.
scripts/is_specialist/is_specialist.gmlscripts/scr_ui_manage/scr_ui_manage.gmlscripts/scr_company_struct/scr_company_struct.gmlscripts/scr_manage_task_selector/scr_manage_task_selector.gml
`**/*.gml`: Color codes in the code shouldn't have any spaces in their id. I.e., color code `# 80 bf40` will crash the game.
**/*.gml: Color codes in the code shouldn't have any spaces in their id. I.e., color code# 80 bf40will crash the game.
scripts/is_specialist/is_specialist.gmlscripts/scr_ui_manage/scr_ui_manage.gmlscripts/scr_company_struct/scr_company_struct.gmlscripts/scr_manage_task_selector/scr_manage_task_selector.gml
🔇 Additional comments (5)
scripts/is_specialist/is_specialist.gml (1)
193-216: Functioning logic added for new specialist candidate types.By the Omnissiah's grace, this code extension follows an efficient pattern of the existing logic architecture. New specialist candidate types have been appropriately categorized and initialized in accordance with the Machine God's patterns. The special case check for "Iron Hands" is a logical adaptation to accommodate the sacred chapter's unique requirements.
01001101 01100001 01111001 00100000 01110100 01101000 01100101 00100000 01001111 01101101 01101110 01101001 01110011 01110011 01101001 01100001 01101000 00100000 01100001 01110000 01110000 01110010 01101111 01110110 01100101
scripts/scr_company_struct/scr_company_struct.gml (2)
148-151: Data structure expansion for new unit roles.The binary cogitators have been augmented with new data storage variables. These additional properties follow the STC template of the existing architecture. Praise be to the Omnissiah for such consistent data structuring.
185-196: Logic implemented for role assignment processing.The sacred algorithms that populate company data structures have been extended with binary precision. Each new specialist role is accurately extracted from the company units through proper classification checks. This implementation follows the Machine Cult's doctrine of consistent pattern recognition.
scripts/scr_ui_manage/scr_ui_manage.gml (2)
658-661: New tracking variables for specialist roles.The blessed cogitator variables have been added to monitor the presence of Chaplain, Apothecary, Tech Marine, and Librarian roles within the company data structure. These additions maintain binary harmony with the existing variable patterns.
664-664: Logical condition expansion for specialist role checks.The sacred conditional operator has been appropriately augmented to include the verification of new specialist roles. This modification extends the binary logic to trigger appropriate UI responses when these positions are unfilled.
|
Chaplains not included? |
|
They are i simply forgot to put them in title |
OH296
left a comment
There was a problem hiding this comment.
Ok looking good some of this needs rationalising as it's looking a bit spaghettish but i can handle that
|
made a pr to your branch Frost-bit-jpg#3 with some minor tweaks |
9b5dcd7
There was a problem hiding this comment.
Actionable comments posted: 6
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (7)
scripts/is_specialist/is_specialist.gml(4 hunks)scripts/scr_company_struct/scr_company_struct.gml(2 hunks)scripts/scr_ui_manage/scr_ui_manage.gml(2 hunks)sprites/spr_scout_colors/spr_scout_colors.yy(1 hunks)sprites/spr_scout_complex/spr_scout_complex.yy(1 hunks)sprites/spr_scout_heads/spr_scout_heads.yy(1 hunks)sprites/spr_scout_new/spr_scout_new.yy(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
`**/*.gml`: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e. `#macro ARR_body_parts["arm"]` will crash the ...
**/*.gml: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e.#macro ARR_body_parts["arm"]will crash the game, because there is no space between the array and the name of the macro.
- Color codes in the code shouldn't have any spaces in their id. I.e., color code
# 80 bf40will crash the game.
scripts/scr_ui_manage/scr_ui_manage.gmlscripts/is_specialist/is_specialist.gmlscripts/scr_company_struct/scr_company_struct.gml
`**/*.gml`: - Always suggest adding JSDoc to every function and method that doesn't have it.
**/*.gml: - Always suggest adding JSDoc to every function and method that doesn't have it.
scripts/scr_ui_manage/scr_ui_manage.gmlscripts/is_specialist/is_specialist.gmlscripts/scr_company_struct/scr_company_struct.gml
`**/*.gml`: - Readability and maintainability are always the top priority throughout the code. - DRY principle is also very important.
**/*.gml: - Readability and maintainability are always the top priority throughout the code.
- DRY principle is also very important.
scripts/scr_ui_manage/scr_ui_manage.gmlscripts/is_specialist/is_specialist.gmlscripts/scr_company_struct/scr_company_struct.gml
🔇 Additional comments (7)
sprites/spr_scout_heads/spr_scout_heads.yy (1)
67-68: Dimensions added to sequence data structure - The Omnissiah approves.The addition of precise dimensional parameters to the sequence data structure represents a logical enhancement. The Machine Spirit now possesses explicit knowledge of its dimensional boundaries, with height at 232.0 and width at 167.0 units. This standardization across sprite configurations will promote harmony in the visual protocols.
Praise be to the Omnissiah for this consistent implementation of dimensional parameters.
sprites/spr_scout_colors/spr_scout_colors.yy (1)
77-78: Sequence dimensional parameters added - Binary blessing confirmed.The sacred incantation of dimensional parameters has been correctly applied to this visual asset. The sequence object now contains the sanctified values of seqHeight (232.0) and seqWidth (167.0), maintaining consistency with other sprite configurations in this repository.
This standardization of dimensional parameters across multiple sprite assets indicates proper adherence to the sacred STC templates. The Machine Spirit will be pleased with this uniformity.
sprites/spr_scout_new/spr_scout_new.yy (1)
74-75: Dimensional parameters added to sequence - Mechanicum standardization protocol enforced.The addition of the precise dimensional parameters to this sprite configuration aligns with the modifications observed in the other sprite assets. This systematic implementation of seqHeight (232.0) and seqWidth (167.0) demonstrates adherence to standardized rendering protocols.
By the will of the Omnissiah, these consistent dimensional parameters shall ensure proper visual representation across all sprite assets. The pattern recognition satisfies the Machine God.
sprites/spr_scout_complex/spr_scout_complex.yy (1)
66-67: Sequence dimensional parameters added - Blessed standardization complete.The sacred dimensions have been added to the final sprite configuration, completing the pattern of modifications across all sprite assets. The addition of seqHeight (232.0) and seqWidth (167.0) maintains the holy consistency required by the Omnissiah.
This systematic implementation of dimensional parameters across all sprite configurations represents a logical and efficient approach to sprite management. The Machine Spirit shall now correctly interpret the dimensional boundaries of all these visual assets.
01010000 01110010 01100001 01101001 01110011 01100101 00100000 01110100 01101000 01100101 00100000 01001111 01101101 01101110 01101001 01110011 01110011 01101001 01100001 01101000
scripts/is_specialist/is_specialist.gml (1)
140-142: Binary logic pathways for hierarchy inclusion implemented.The conditional blocks for including head roles in various specialist types follow a consistent pattern, appropriately guarded by the new
include_headsparameter. This maintains proper separation of concerns in the code's sacred architecture.Also applies to: 149-151, 163-165, 177-179
scripts/scr_ui_manage/scr_ui_manage.gml (2)
682-686: Additional role tracking variables established.The Omnissiah approves of these logical extensions to track the presence of Chaplain, Apothecary, Tech Marine, and Librarian roles, following the established pattern of existing role tracking variables.
688-688: Condition expanded to check for all sacred specialist roles.The updated condition now correctly includes checks for all specialist roles, ensuring proper activation of role selection prompts when any specialist role is missing.
There was a problem hiding this comment.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
scripts/is_specialist/is_specialist.gml (1)
221-285: 🛠️ Refactor suggestionExpand the collect_role_group function's documentation to reflect its divine purpose.
This complex function lacks proper documentation to explain its operation, especially with the new parameter usage in the IsSpecialist call.
Adorn this function with the sacred JSDoc inscriptions to improve future maintenance:
+/** + * Collects units that match specified role groups and conditions. + * @param {string|array} group - The role group to filter by, or "all" to ignore filtering. Can also be an array to filter for multiple groups. + * @param {string|array} location - The location to filter by. Can be a string with a system name or an array [location_name, planet_number, ship_number]. + * @param {boolean} opposite - If true, roles defined in the group argument are ignored and all others are collected. + * @param {object} search_conditions - Additional conditions for filtering. + * @param {string|array} search_conditions.companies - The companies to search in, either an int or an array of company numbers, or "all". + * @param {array} [search_conditions.stat] - Stat conditions to filter by. + * @param {string} [search_conditions.job] - Job to filter by. + * @param {number} [search_conditions.max] - Maximum number of units to collect. + * @return {array} An array of units that match the specified conditions. + */ function collect_role_group(group="standard", location="", opposite=false, search_conditions = {companies:"all"}){
♻️ Duplicate comments (1)
scripts/is_specialist/is_specialist.gml (1)
100-100: 🛠️ Refactor suggestionBy the Omnissiah's decree, document the sacred parameters for posterity.
The function signature has been expanded with
include_heads, a parameter of machine logic that would benefit from proper documentation. The Machine Spirit demands clarity in all inputs to facilitate future maintenance and divine understanding.Adorn this function with the sacred JSDoc inscriptions as follows:
+/** + * Determines if a unit role is considered a specialist of a given type. + * @param {string} unit_role - The role to check + * @param {string} [type="standard"] - The specialist group to check against + * @param {boolean} [include_trainee=false] - Whether to include trainee roles + * @param {boolean} [include_heads=true] - Whether to include head roles like "Chief Librarian" + * @return {boolean} True if the unit_role is a specialist of the specified type + */ function is_specialist(unit_role, type="standard", include_trainee=false, include_heads=true) {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
scripts/is_specialist/is_specialist.gml(4 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
`**/*.gml`: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e. `#macro ARR_body_parts["arm"]` will crash the ...
**/*.gml: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e.#macro ARR_body_parts["arm"]will crash the game, because there is no space between the array and the name of the macro.
- Color codes in the code shouldn't have any spaces in their id. I.e., color code
# 80 bf40will crash the game.
scripts/is_specialist/is_specialist.gml
`**/*.gml`: - Always suggest adding JSDoc to every function and method that doesn't have it.
**/*.gml: - Always suggest adding JSDoc to every function and method that doesn't have it.
scripts/is_specialist/is_specialist.gml
`**/*.gml`: - Readability and maintainability are always the top priority throughout the code. - DRY principle is also very important.
**/*.gml: - Readability and maintainability are always the top priority throughout the code.
- DRY principle is also very important.
scripts/is_specialist/is_specialist.gml
🔇 Additional comments (4)
scripts/is_specialist/is_specialist.gml (4)
149-151: Binary logic structure approved for Forge Master inclusion.The conditional inclusion of the "Forge Master" role based on the
include_headsparameter is a logical extension of the function's new capability.
163-165: Conditional inclusion of Master of Sanctity follows proper protocol.The implementation correctly appends the "Master of Sanctity" role to the specialists array when
include_headsis true, as required by the parameter's purpose.
177-179: The Apothecarion's Master enters the data array with sacred precision.The implementation correctly appends the "Master of the Apothecarion" role to the specialists array when
include_headsis true.
257-257:Details
✅ Verification successful
Verify the group index parameters for proper data transmission.
The call to
unit.IsSpecialisthas been updated to passgroup[2]as the third parameter. Previous review comments indicated uncertainty about the appropriate index, suggestinggroup[3]might be more appropriate.The machine spirits require clarity on the structure of the
grouparray to ensure proper data transmission. Execute the following binary search to identify the correct usage pattern:Additionally, consider adding a comment documenting the structure of the
grouparray and the purpose of each index:- _is_special_group = unit.IsSpecialist(group[0], group[1],group[2]); + // group structure: [type, subtype, include_heads] + _is_special_group = unit.IsSpecialist(group[0], group[1], group[2]);
🏁 Script executed:
#!/bin/bash # Analyze how group array is constructed and used throughout the codebase echo "Searching for group array construction and initialization..." rg -A 5 "group\s*=\s*\[" --glob "*.gml" echo "\nSearching for IsSpecialist function definitions to understand parameter usage..." rg "function\s+IsSpecialist" --glob "*.gml" -A 10 echo "\nSearching for all IsSpecialist calls to understand parameter patterns..." rg "IsSpecialist\(" --glob "*.gml" -A 2 -B 2Length of output: 22421
Group Array Structure Verification Satisfied
After a thorough scan of the sacred code, it is confirmed that thegrouparray is indeed structured as[type, subtype, include_heads]. The call tounit.IsSpecialist(group[0], group[1], group[2])faithfully adheres to this structure, and there is no evidence suggesting that an index ofgroup[3]should be used.For the clarity of future servitors and fellow Tech-Priests, please consider appending an inline comment to document the array’s structure. A suitable diff snippet is provided below:
- _is_special_group = unit.IsSpecialist(group[0], group[1],group[2]); + // group structure: [type, subtype, include_heads] + _is_special_group = unit.IsSpecialist(group[0], group[1], group[2]);May the blessings of the Omnissiah guide your code maintenance.
|
I couldn't understand what is going on with the |
36b27aa to
c209065
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 8
🔭 Outside diff range comments (5)
scripts/scr_draw_unit_image/scr_draw_unit_image.gml (5)
95-96: 🧹 Nitpick (assertive)Documentation ritual required for preserving knowledge
By the Binary Doctrines, this commented TODO requires attention. Functions should be documented with JSDoc to preserve knowledge for future tech-adepts.
-//TODO this is a laxy fix and can be written better +/** + * Sets the color for a specific shader type using the given color index. + * TODO: This is a temporary solution and can be implemented more efficiently. + * + * @param {ShaderType} shaderType - The type of shader to set the color for. + * @param {number} colorIndex - The index of the color to use. + */ function set_shader_color(shaderType, colorIndex) {
196-197: 🧹 Nitpick (assertive)Add sacred JSDoc annotation to function
The function scr_draw_unit_image lacks proper JSDoc documentation. The Omnissiah demands structured documentation for all functions to maintain the sanctity of code knowledge.
/// @mixin +/** + * Draws a unit image with the appropriate colors, equipment, and specializations. + * + * @param {boolean} [_background=false] - Whether to draw a background behind the unit image. + * @returns {UnitImage} - A constructed UnitImage object containing the rendered unit. + */ function scr_draw_unit_image(_background = false) {
55-57: 🧹 Nitpick (assertive)Add JSDoc to UnitImage constructor
The UnitImage constructor requires proper documentation according to the Machine Cult's standards for code clarity and maintenance.
+/** + * Creates a new UnitImage object that manages the rendering of a unit sprite. + * + * @constructor + * @param {sprite} unit_surface - The surface containing the rendered unit. + */ function UnitImage(unit_surface) constructor { u_surface = unit_surface;
89-93: 🧹 Nitpick (assertive)Add JSDoc to BaseColor constructor
The BaseColor constructor requires blessed documentation to facilitate understanding by future tech-adepts.
+/** + * Creates a new BaseColor object that holds RGB color values. + * + * @constructor + * @param {number} R - Red component value (0-255). + * @param {number} G - Green component value (0-255). + * @param {number} B - Blue component value (0-255). + */ function BaseColor(R, G, B) constructor { r = R; g = G; b = B; }
48-53: 🧹 Nitpick (assertive)Add JSDoc to set_and_clear_surface function
This utility function lacks the sacred documentation required by the Omnissiah's coding doctrines.
+/** + * Sets a surface as the target, clears it, resets the target and frees the surface. + * + * @param {surface} _surface - The surface to set, clear, and free. + */ function set_and_clear_surface(_surface) { surface_set_target(_surface); draw_clear_alpha(c_white, 0); surface_reset_target(); surface_free(_surface); }
♻️ Duplicate comments (3)
scripts/scr_company_struct/scr_company_struct.gml (2)
148-151: 🧹 Nitpick (assertive)Sacred binary augmentations to the Company Struct detected.
The Omnissiah approves of these logical extensions to the CompanyStruct constructor. The addition of chaplain, apothecary, tech_marine, and lib properties follows the established pattern of the existing captain, champion, and ancient roles. This promotes symmetry in the Machine Spirit's cognition matrices.
Consider blessing these properties with sacred JSDoc documentation to facilitate proper knowledge transfer to future adepts:
+/** @type {Struct|String} Chaplain unit assigned to the company or "none" if unassigned */ chaplain = "none"; +/** @type {Struct|String} Apothecary unit assigned to the company or "none" if unassigned */ apothecary = "none"; +/** @type {Struct|String} Tech Marine unit assigned to the company or "none" if unassigned */ tech_marine = "none"; +/** @type {Struct|String} Librarian unit assigned to the company or "none" if unassigned */ lib = "none";
184-192: 🧹 Nitpick (assertive)Logic pathways for specialist role identification implemented according to the Mechanicus doctrine.
The conditional blocks correctly identify and assign units to their respective specialist roles within the company structure, properly extending the existing role identification system to include the sacred roles of the Chaplain, Apothecary, Techmarine, and Librarian.
The whitespace formatting in these conditional blocks is inconsistent with the prior code blocks. The Machine Spirit craves uniformity in all things:
- else if (unit.role() == role_set[eROLE.Chaplain]){ + } else if (unit.role() == role_set[eROLE.Chaplain]){ chaplain = unit; -}else if (unit.role() == role_set[eROLE.Apothecary]){ + } else if (unit.role() == role_set[eROLE.Apothecary]){ apothecary = unit; } - else if (unit.role() == role_set[eROLE.Techmarine]){ + } else if (unit.role() == role_set[eROLE.Techmarine]){ tech_marine = unit; } - else if (unit.role() == role_set[eROLE.Librarian]){ + } else if (unit.role() == role_set[eROLE.Librarian]){ lib = unit; }scripts/scr_manage_task_selector/scr_manage_task_selector.gml (1)
86-106: 🛠️ Refactor suggestionImplementation of Chaplain promotion logics
The sacred algorithms for promoting a unit to the esteemed rank of Chaplain have been implemented following the established pattern. The ritual of transferring the unit, clearing its squad assignment, and reorganizing company records has been properly executed.
This servant of the Omnissiah observes excessive code duplication across all specialist promotion cases. Consider consolidating these sacred rites into a reusable function:
+ function promote_specialist(unit_index, end_company) { + var unit = display_unit[unit_index]; + unit.squad = "none"; + var start_company = unit.company; + var endslot = 0; + for (var i=0; i<array_length(obj_ini.name[end_company]); i++) { + if (obj_ini.name[end_company][i] == "") { + endslot = i; + break; + } + } + scr_move_unit_info(start_company, end_company, unit.marine_number, endslot); + with (obj_ini) { + scr_company_order(start_company); + scr_company_order(end_company); + } + managing = end_company; + update_general_manage_view(); + }Then invoke it thusly:
case "chaplain_promote": - unit = display_unit[i]; - unit.squad="none"; - var start_company = unit.company; - var end_company = selection_data.system; - var endslot = 0; - for (i=0; i<array_length(obj_ini.name[end_company]); i++) { - if (obj_ini.name[end_company][i]=="") { - endslot=i; - break; - } - } - scr_move_unit_info(start_company, end_company, unit.marine_number, endslot); - with (obj_ini) { - scr_company_order(start_company); - scr_company_order(end_company); - } - managing = end_company; - update_general_manage_view(); + promote_specialist(i, selection_data.system); exit; break;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (15)
objects/obj_popup/Draw_0.gml(1 hunks)scripts/exp_and_exp_growth/exp_and_exp_growth.gml(2 hunks)scripts/is_specialist/is_specialist.gml(2 hunks)scripts/scr_company_struct/scr_company_struct.gml(2 hunks)scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml(1 hunks)scripts/scr_culture_visuals/scr_culture_visuals.gml(3 hunks)scripts/scr_draw_unit_image/scr_draw_unit_image.gml(1 hunks)scripts/scr_drop_fiddle/scr_drop_fiddle.gml(2 hunks)scripts/scr_manage_task_selector/scr_manage_task_selector.gml(2 hunks)scripts/scr_marine_struct/scr_marine_struct.gml(4 hunks)scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml(1 hunks)scripts/scr_random_marine/scr_random_marine.gml(1 hunks)scripts/scr_roster/scr_roster.gml(1 hunks)scripts/scr_special_view/scr_special_view.gml(1 hunks)scripts/scr_ui_manage/scr_ui_manage.gml(2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
`**/*.gml`: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e. `#macro ARR_body_parts["arm"]` will crash the ...
**/*.gml: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e.#macro ARR_body_parts["arm"]will crash the game, because there is no space between the array and the name of the macro.
- Color codes in the code shouldn't have any spaces in their id. I.e., color code
# 80 bf40will crash the game.
scripts/scr_draw_unit_image/scr_draw_unit_image.gmlscripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gmlscripts/scr_drop_fiddle/scr_drop_fiddle.gmlscripts/scr_roster/scr_roster.gmlscripts/scr_complex_colour_kit/scr_complex_colour_kit.gmlscripts/exp_and_exp_growth/exp_and_exp_growth.gmlscripts/scr_random_marine/scr_random_marine.gmlscripts/scr_manage_task_selector/scr_manage_task_selector.gmlobjects/obj_popup/Draw_0.gmlscripts/scr_company_struct/scr_company_struct.gmlscripts/scr_special_view/scr_special_view.gmlscripts/scr_culture_visuals/scr_culture_visuals.gmlscripts/scr_marine_struct/scr_marine_struct.gmlscripts/is_specialist/is_specialist.gmlscripts/scr_ui_manage/scr_ui_manage.gml
`**/*.gml`: - Always suggest adding JSDoc to every function and method that doesn't have it.
**/*.gml: - Always suggest adding JSDoc to every function and method that doesn't have it.
scripts/scr_draw_unit_image/scr_draw_unit_image.gmlscripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gmlscripts/scr_drop_fiddle/scr_drop_fiddle.gmlscripts/scr_roster/scr_roster.gmlscripts/scr_complex_colour_kit/scr_complex_colour_kit.gmlscripts/exp_and_exp_growth/exp_and_exp_growth.gmlscripts/scr_random_marine/scr_random_marine.gmlscripts/scr_manage_task_selector/scr_manage_task_selector.gmlobjects/obj_popup/Draw_0.gmlscripts/scr_company_struct/scr_company_struct.gmlscripts/scr_special_view/scr_special_view.gmlscripts/scr_culture_visuals/scr_culture_visuals.gmlscripts/scr_marine_struct/scr_marine_struct.gmlscripts/is_specialist/is_specialist.gmlscripts/scr_ui_manage/scr_ui_manage.gml
`**/*.gml`: - Readability and maintainability are always the top priority throughout the code. - DRY principle is also very important.
**/*.gml: - Readability and maintainability are always the top priority throughout the code.
- DRY principle is also very important.
scripts/scr_draw_unit_image/scr_draw_unit_image.gmlscripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gmlscripts/scr_drop_fiddle/scr_drop_fiddle.gmlscripts/scr_roster/scr_roster.gmlscripts/scr_complex_colour_kit/scr_complex_colour_kit.gmlscripts/exp_and_exp_growth/exp_and_exp_growth.gmlscripts/scr_random_marine/scr_random_marine.gmlscripts/scr_manage_task_selector/scr_manage_task_selector.gmlobjects/obj_popup/Draw_0.gmlscripts/scr_company_struct/scr_company_struct.gmlscripts/scr_special_view/scr_special_view.gmlscripts/scr_culture_visuals/scr_culture_visuals.gmlscripts/scr_marine_struct/scr_marine_struct.gmlscripts/is_specialist/is_specialist.gmlscripts/scr_ui_manage/scr_ui_manage.gml
🔇 Additional comments (29)
objects/obj_popup/Draw_0.gml (1)
1575-1575: Binary cogitation: String standardization improves logic clarityThe mutation from "libs" to "lib" in this commented code section aligns with the omniscient machine-spirit's directive to standardize specialist role nomenclature across the sacred codebase. Such consistency pleases the Omnissiah.
scripts/scr_roster/scr_roster.gml (1)
546-546: Praise the standardization of specialist identification parametersThe logical parameter alteration from "libs" to "lib" in the IsSpecialist function invocation properly aligns with the sacred codebase standardization. This modification maintains ritual consistency with other alterations throughout the machine-spirit's domain.
scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml (1)
176-176: Binary blessing: Parameter standardization completed successfullyThe transition from "libs" to "lib" in this IsSpecialist function invocation completes the ritual of standardization across the codebase. The Machine God approves of such consistent nomenclature alterations, ensuring the cogitator processes librarian specialist identification with mechanized precision.
scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml (1)
414-414: Praise to the Omnissiah for consistent nomenclatureThe sacred strings of code have been wisely amended from "libs" to "lib" when identifying the Librarian specialist role in the is_specialist() function call. This aligns with the standardization of terminology across the codebase, ensuring the machine spirit processes queries with greater efficiency. Such consistency is the foundation of proper data sanctification.
scripts/scr_drop_fiddle/scr_drop_fiddle.gml (2)
54-54: Blessed be this binary correctionThe sacred parameter has been modified from "libs" to "lib" for the IsSpecialist() function call. This ensures consistent interpretation of the Librarian role throughout the machine spirit of the application, facilitating proper identification and enumeration of psykers in the loading process.
122-122: The Omnissiah approves of this symmetrical amendmentThe modification from "libs" to "lib" in this IsSpecialist() invocation ensures proper decrementing of psykers when removing marines from the drop roster. The sacred symmetry with the increment operation at line 54 has been maintained, as dictated by the proper rituals of code maintenance.
scripts/scr_draw_unit_image/scr_draw_unit_image.gml (1)
350-350: Binary blessing upon this nomenclature harmonizationThe parameter has been correctly modified from "libs" to "lib" in the is_specialist() function call. This alteration maintains consistency with similar changes across the sacred codebase and ensures proper identification of Librarian specialists.
The Machine God approves of such systematic standardization, as it reduces cognitive load on both the machine spirit and the human operators who maintain this holy code.
scripts/exp_and_exp_growth/exp_and_exp_growth.gml (2)
93-93: Blessed correction of datatype designation for Librarians detected.The Omnissiah's servants have updated the reference from "libs" to "lib" in the group_growths array, which aligns with other modifications observed in this sacred technical protocol update. This binary alteration maintains consistency with other files where similar terminological standardizations have been implemented.
261-263: Conditional logic realignment for Librarian classification complete.The condition now correctly utilizes the singular nomenclature "lib" rather than the plural "libs" when checking for specialist designation. This ensures harmony with the Mechanicus-approved standardization implemented across multiple script files.
scripts/scr_special_view/scr_special_view.gml (1)
69-69: Function parameter alignment with new STC patterns detected.The parameter array passed to collect_role_group has been properly updated from ["libs",true] to ["lib",true], bringing it into compliance with the standardized nomenclature for Librarians implemented throughout this sacred code revision. The logic flow remains unaltered, maintaining the machine spirit's intended functionality.
scripts/scr_culture_visuals/scr_culture_visuals.gml (3)
318-318: Visual identifier designation corrected for Librarian iconography.The role_type array for the spr_gear_librarian sprite has been updated from ["libs"] to ["lib"], ensuring consistent nomenclature across all Librarian-related code structures. Praise the Omnissiah for this logical correction.
324-324: Terminator-pattern Librarian visual identifier standardized.The role_type array for spr_gear_librarian_term has been updated to use ["lib"] instead of ["libs"], maintaining binary consistency with other Librarian-related modifications in this sacred update.
548-548: Psychic hood identifier corrected in accordance with Machine God's will.The role_type array for spr_gear_hood2 has been properly updated from ["libs"] to ["lib"], completing the trio of Librarian visual component standardizations.
scripts/scr_marine_struct/scr_marine_struct.gml (4)
506-508: Function signature expansion enhances specialist role handlingThe Machine Spirit's interface has been modified to accommodate a new parameter
include_headswith a default value oftrue. This logical extension grants greater flexibility in filtering specialist roles, aligning with the binary sacred will of the Omnissiah.
469-471: Nomenclature standardization from "libs" to "lib"The sacred binary has been aligned to use the singular form "lib" instead of "libs" when identifying Librarians. This rectifies the inconsistent terminology across the codebase, satisfying the Omnissiah's desire for logical consistency.
977-979: Consistent designation update for Librarian specialistsThe designation has been standardized to "lib" here as well, maintaining the prescribed nomenclature across all invocations. The Machine Spirit approves of such consistency.
1683-1684: Final instance of librarian designation standardizationThe third occurrence of the terminology standardization from "libs" to "lib". This mechanical consistency enhances the clarity of the code and prevents potential logical errors in the future.
scripts/scr_manage_task_selector/scr_manage_task_selector.gml (3)
107-127: Implementation of Apothecary promotion logicsThe ritual for promoting units to the blessed role of Apothecary has been properly implemented. This code follows the established pattern identical to other specialist promotions.
The recommendation to refactor specialist promotion code also applies to this segment.
128-148: Implementation of Tech Marine promotion logicsThe Machine Spirit approves of the implementation for Tech Marine promotions, a role most venerated by the Omnissiah. The code follows the sacred pattern established for other specialist roles.
The recommendation to refactor specialist promotion code also applies to this segment.
149-169: Implementation of Librarian promotion logicsThe binary incantations for elevating a unit to the psychically attuned rank of Librarian have been properly implemented. The Machine Spirit recognizes this follows the pattern of other specialist promotions.
The recommendation to refactor specialist promotion code also applies to this segment.
scripts/scr_ui_manage/scr_ui_manage.gml (9)
682-685: Variables introduced with consistency.
These declarations for chaplain, apothecary, tech marine, and librarian slots are functionally straightforward and appear coherent.
688-688: Conditional logic deemed acceptable.
The condition verifying whether a company’s specialist slots are filled is clear and aligns with the designated property checks.
703-718: Identical duplication identified.
The champion assignment code replicates the same pattern we have already flagged.
722-736: Identical duplication identified.
The ancient assignment block again reiterates the same code structure.
737-751: Identical duplication identified.
The chaplain slot code likewise resonates with the repeated pattern.
752-766: Identical duplication identified.
The apothecary slot logic remains consistent with the aforementioned repeated pattern.
767-781: Identical duplication identified.
The tech marine pledge is also a reiteration of the same approach.
782-795: Identical duplication identified.
The librarian assignment logic follows the same repeated code pattern.
798-798: Empty line detected.
No functional changes present.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
scripts/is_specialist/is_specialist.gml(2 hunks)scripts/scr_company_struct/scr_company_struct.gml(2 hunks)scripts/scr_ui_manage/scr_ui_manage.gml(2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
`**/*.gml`: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e. `#macro ARR_body_parts["arm"]` will crash the ...
**/*.gml: - Macro constants require a space between the constant name and value. Without it, the compiler will throw an error. I.e.#macro ARR_body_parts["arm"]will crash the game, because there is no space between the array and the name of the macro.
- Color codes in the code shouldn't have any spaces in their id. I.e., color code
# 80 bf40will crash the game.
scripts/scr_company_struct/scr_company_struct.gmlscripts/scr_ui_manage/scr_ui_manage.gmlscripts/is_specialist/is_specialist.gml
`**/*.gml`: - Always suggest adding JSDoc to every function and method that doesn't have it.
**/*.gml: - Always suggest adding JSDoc to every function and method that doesn't have it.
scripts/scr_company_struct/scr_company_struct.gmlscripts/scr_ui_manage/scr_ui_manage.gmlscripts/is_specialist/is_specialist.gml
`**/*.gml`: - Readability and maintainability are always the top priority throughout the code. - DRY principle is also very important.
**/*.gml: - Readability and maintainability are always the top priority throughout the code.
- DRY principle is also very important.
scripts/scr_company_struct/scr_company_struct.gmlscripts/scr_ui_manage/scr_ui_manage.gmlscripts/is_specialist/is_specialist.gml
🔇 Additional comments (4)
scripts/scr_ui_manage/scr_ui_manage.gml (2)
690-693: Slot naming consistency.Thou hast introduced
chaplain_slot,apothecary_slot,tech_marine_slot, andlib_slot, setting them to booleans. The naming is consistent with the other_slotvariables. This appears correct for determining if these roles remain vacant. No immediate issues detected.
696-804: Repetitive slot checks mirror prior code suggestions.The approach of confirming each vacant role and invoking
special_role_slot_openis sound. Yet, it repeats the pattern for each role individually, echoing a known tapestry from previous reviews that recommended a data-table loop. This comment replicates that guidance.scripts/is_specialist/is_specialist.gml (2)
6-168: Streamline role definitions.All hail the mechanised fervour of enumerating roles within
role_groups. Still, the repetitious and branched structure begs for a data-driven approach, as previously explored. Doing so might lighten your logic burden and foster ease of expansion.
170-174: New function parameters are well-structured.The expansion of
is_specialistto includeinclude_traineeandinclude_headssuits the flexible identification of specialists. This is a righteous extension, aligning with the role groups. No unholy anomalies found.
Purpose of changes
Describe the solution
special_role_slot_openfunction.role_groupsandis_specialistfunctions.Describe alternatives you've considered
None
Testing done
Loading executing marines then reassigning the roles.
Assigning on empty companies.
Reading on attack and raid tooltip/
Related links
None
Custom player notes entry
Use the PR title.