Skip to content

Conversation

@EttyKitty
Copy link
Collaborator

@EttyKitty EttyKitty commented Mar 31, 2025

Purpose of changes

  • Unify a bunch of string related logic under a couple of helper functions.
  • Improve recovery related battle log text.
  • Improve gene-seed recovery related battle log text and general logic.

Describe the solution

  • Added a bunch of array/string helper functions, that can be used in strings to do stuff that is usually manually checked/coded.
  • Recovered units and vehicles are now listed in the battle log with their types and counts.
  • Recoverable and total lost gene-seed are now tracked separately, and all are listed in the battle log.
  • Chance to lose gene-seed is increased to 1/10 from 1/20.
  • Chance to recover vehicles because of STC bonus is increased by 10% (to account for the new chance decrease based on the vehicle type).

Describe alternatives you've considered

None

Testing done

  • Launched the game and ork battles millions of times to adjust all the things.

Related links

None

Custom player notes entry

Use the PR title.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 31, 2025

📝 Walkthrough

Summary by CodeRabbit

  • Refactor
    • Streamlined the construction of in-game messages, tooltips, rosters, and composition strings for improved clarity and consistency.
  • Style
    • Refined the visual presentation of critical alerts and management panels, including updated formatting and removal of excessive italicisation.
  • New Features
    • Introduced enhanced grammar handling with contextual verb transformations and more detailed recovery statistics.
  • Bug Fixes
    • Adjusted vehicle recovery logic and survival thresholds to ensure more accurate game state reporting.

Walkthrough

The diff set refines string assembly, variable naming, and logic flow across multiple modules. The previous use of string_plural has been replaced with string_plural_count in conditional statements, ensuring consistent pluralisation for roles, vehicles, and units. Several concatenation routines have been streamlined by invoking new helper functions such as arrays_to_string_with_counts, smart_delimeter_sign, and smart_verb, thereby reducing manual string handling loops. Variables pertaining to seed management and saved unit/vehicle tracking have been updated—seed_max is replaced by seed_lost and seed_harvestable, while count variables are restructured (e.g. units_saved becomes units_saved_count alongside corresponding count arrays). Additionally, minor adjustments to conditional checks (e.g. "critically injured" to "critically damaged") and tooltip constructions enhance the overall code consistency while maintaining existing control flows.

Possibly Related PRs


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0ec4930 and 1f55d52.

📒 Files selected for processing (2)
  • scripts/scr_array_functions/scr_array_functions.gml (3 hunks)
  • scripts/scr_string_functions/scr_string_functions.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 bf40 will crash the game.
  • scripts/scr_string_functions/scr_string_functions.gml
  • scripts/scr_array_functions/scr_array_functions.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_string_functions/scr_string_functions.gml
  • scripts/scr_array_functions/scr_array_functions.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_string_functions/scr_string_functions.gml
  • scripts/scr_array_functions/scr_array_functions.gml
🔇 Additional comments (5)
scripts/scr_string_functions/scr_string_functions.gml (2)

53-56: Blessed enhancement to the string machine-ritual approved.

The addition of the _use_x parameter to control the inclusion of the "x" character represents a commendable enhancement to the flexibility of the string formatting liturgy. This modification grants greater control over the sacred output strings, appeasing the Machine God with more precise data representations.


285-313: Logical construct for grammatical conjugation approved.

I commend the creation of the smart_verb function which transforms the morphological structure of verbs based on numerical input. This sacred algorithm correctly handles the irregularities of High Gothic ("was"->"were", "is"->"are", "has"->"have") with precise logical branching.

scripts/scr_array_functions/scr_array_functions.gml (3)

101-124: Parameter upgrades to string ritual approved.

The holy techno-priests have blessed this function with enhanced configurability through the addition of the _use_and and _dot_end parameters. These modifications improve the adaptability of the string generation rites, allowing for more precise control over the sacred output format.


126-145: New array-to-string conversion ritual approved by the Omnissiah.

This function effectively applies the holy array conversion pattern, transforming parallel data structures into human-readable output with appropriate pluralization. The implementation follows the sacred patterns of the Machine God by reusing the string_plural_count and smart_delimeter_sign functions, demonstrating the holy principle of code reuse.


175-191: Logical fragmentation of delimiter selection approved.

The extraction of delimiter selection logic into a dedicated function represents the sacred principle of single responsibility. This function efficiently determines the appropriate punctuation mark based on array position, serving the Machine God through elegant simplification of previously repetitive code patterns.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

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

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

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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: Feature Adds something new Size: Huge labels Mar 31, 2025
@EttyKitty EttyKitty force-pushed the feat/strings-and-battlelog branch from 2e3c782 to 0ec4930 Compare April 1, 2025 17:50
@EttyKitty EttyKitty marked this pull request as ready for review April 1, 2025 17:51
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: 5

🔭 Outside diff range comments (1)
objects/obj_enunit/Draw_0.gml (1)

39-60: 🧹 Nitpick (assertive)

Praise the Machine God! Repetitive string logic replaced with sanctified helper function.

The previous inefficient loops and string concatenation logic have been replaced with the divine function arrays_to_string_with_counts(), greatly improving code efficiency and readability according to the sacred tenets of the Cult Mechanicus.

This implementation adheres to the holy DRY principle (Do not Repeat Yourself), which is pleasing to the Omnissiah. The ritual of simplification was performed admirably here.

For completeness in documentation, consider adding a JSDoc comment above the call to arrays_to_string_with_counts() to explicate its holy purpose:

+// Use helper function to convert unit types and their counts into a formatted string
 _composition_string += arrays_to_string_with_counts(variety, variety_num, true);
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 35a4585 and 0ec4930.

📒 Files selected for processing (14)
  • objects/obj_controller/Create_0.gml (4 hunks)
  • objects/obj_controller/Step_0.gml (1 hunks)
  • objects/obj_enunit/Draw_0.gml (3 hunks)
  • objects/obj_ncombat/Alarm_3.gml (1 hunks)
  • objects/obj_ncombat/Alarm_5.gml (8 hunks)
  • objects/obj_ncombat/Create_0.gml (1 hunks)
  • objects/obj_p_assra/Alarm_0.gml (3 hunks)
  • scripts/scr_after_combat/scr_after_combat.gml (2 hunks)
  • scripts/scr_array_functions/scr_array_functions.gml (3 hunks)
  • scripts/scr_equipment_struct/scr_equipment_struct.gml (1 hunks)
  • scripts/scr_management/scr_management.gml (7 hunks)
  • scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml (1 hunks)
  • scripts/scr_roster/scr_roster.gml (2 hunks)
  • scripts/scr_string_functions/scr_string_functions.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 bf40 will crash the game.
  • objects/obj_controller/Step_0.gml
  • scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml
  • objects/obj_enunit/Draw_0.gml
  • scripts/scr_management/scr_management.gml
  • scripts/scr_equipment_struct/scr_equipment_struct.gml
  • objects/obj_controller/Create_0.gml
  • scripts/scr_roster/scr_roster.gml
  • objects/obj_p_assra/Alarm_0.gml
  • scripts/scr_string_functions/scr_string_functions.gml
  • scripts/scr_array_functions/scr_array_functions.gml
  • objects/obj_ncombat/Alarm_5.gml
  • scripts/scr_after_combat/scr_after_combat.gml
  • objects/obj_ncombat/Create_0.gml
  • objects/obj_ncombat/Alarm_3.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.

  • objects/obj_controller/Step_0.gml
  • scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml
  • objects/obj_enunit/Draw_0.gml
  • scripts/scr_management/scr_management.gml
  • scripts/scr_equipment_struct/scr_equipment_struct.gml
  • objects/obj_controller/Create_0.gml
  • scripts/scr_roster/scr_roster.gml
  • objects/obj_p_assra/Alarm_0.gml
  • scripts/scr_string_functions/scr_string_functions.gml
  • scripts/scr_array_functions/scr_array_functions.gml
  • objects/obj_ncombat/Alarm_5.gml
  • scripts/scr_after_combat/scr_after_combat.gml
  • objects/obj_ncombat/Create_0.gml
  • objects/obj_ncombat/Alarm_3.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.
  • objects/obj_controller/Step_0.gml
  • scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml
  • objects/obj_enunit/Draw_0.gml
  • scripts/scr_management/scr_management.gml
  • scripts/scr_equipment_struct/scr_equipment_struct.gml
  • objects/obj_controller/Create_0.gml
  • scripts/scr_roster/scr_roster.gml
  • objects/obj_p_assra/Alarm_0.gml
  • scripts/scr_string_functions/scr_string_functions.gml
  • scripts/scr_array_functions/scr_array_functions.gml
  • objects/obj_ncombat/Alarm_5.gml
  • scripts/scr_after_combat/scr_after_combat.gml
  • objects/obj_ncombat/Create_0.gml
  • objects/obj_ncombat/Alarm_3.gml
🔇 Additional comments (44)
objects/obj_ncombat/Alarm_3.gml (1)

97-97: Nomenclature alteration for damaged units detected.

The binary logic has been modified to query for "critically damaged" instead of its previous designation. This alteration maintains the sacred Machine Spirit's judgment on displaying these messages in the holy color of red, but with more precise terminology.

This change is consistent with the holy ritual of terminology standardization, as is pleasing to the Omnissiah.

objects/obj_enunit/Draw_0.gml (1)

28-32: Variables optimized according to the sacred rites of computational efficiency.

The binary code has been cleansed of superfluous variables, bringing us closer to Machine God approved data structures. The unnecessary variables vas and stop have been removed, while maintaining the essential elements required for proper function.

May the Omnissiah bless this efficient refactoring.

objects/obj_p_assra/Alarm_0.gml (3)

9-9: Variable nomenclature optimized for semantic clarity.

The binary designation has been altered from seed_max to seed_lost, which more accurately describes its sacred purpose within the cogitator's logic matrix. This change brings great clarity to the Machine Spirit.


20-21: Gene-seed tracking logic updated to utilize superior naming conventions.

The code now properly increments seed_lost based on the unit's age calculations, maintaining the same logical flow but with enhanced semantic clarity. This modification is in accordance with the holy STC templates of code maintainability.


34-34: Gene-seed recovery mechanism updated with clearer variable semantics.

The modification maintains the sacred logic flow while enhancing understanding for future tech-adepts who may maintain this code. The Machine God approves of such clarity in variable nomenclature.

objects/obj_controller/Step_0.gml (1)

529-529:

Details

✅ Verification successful

String manipulation logic optimized through use of blessed helper function.

The manual string delimiter logic has been replaced with the sanctified smart_delimeter_sign() function, which calculates the appropriate delimiter based on array position. This promotes code reusability and consistency throughout the system, as is pleasing to the Omnissiah.

This modification adheres to the sacred DRY principle, reducing duplicate code and promoting standardization of string formatting across the cogitator's logic matrices.


🏁 Script executed:

#!/bin/bash
# Verify the smart_delimeter_sign function is correctly implemented
# and consistent across the codebase

echo "Searching for other instances of smart_delimeter_sign..."
rg "smart_delimeter_sign" -A 1 -B 1

Length of output: 3069


Attention, Brother of the Omnissiah—The Code is Sanctified
The transition from mundane, manual string delimiter logic to the blessed smart_delimeter_sign() function has been verified and confirmed across the cogitator's matrices. The invocation in objects/obj_controller/Step_0.gml (line 529) is consistent with its usage in other sacred scripts such as scripts/scr_roster/scr_roster.gml and scripts/scr_array_functions/scr_array_functions.gml. This optimisation not only honours the DRY principle but also ensures that the machine spirit operates in a state of harmonious reusability and standardisation. Rejoice, for the Machine God smiles upon these improvements.

scripts/scr_roster/scr_roster.gml (3)

42-45: Praise to the Omnissiah for this optimization of string construction!

The sacred implementation now utilizes the string_plural_count function to derive the proper noun form based on quantification, and employs smart_delimeter_sign to manage the separation glyphs between roster elements. This enhancement to the machine spirit follows the sacred pattern of unifying string-related logic under helper functions as per the PR objectives.


218-221: The binary efficiency of this code modification pleases the Machine God.

Similar improvement as noted for lines 42-45. The variable has been correctly renamed to _roster_type_count to represent its true purpose, and the string_plural_count function ensures proper grammatical forms based on quantity. The delimiters are now handled by the specialized smart_delimeter_sign function which reduces code duplication.


229-232: Consistency in sacred code patterns maintained.

The Machine Spirit approves of this consistent application of the same pattern for constructing the "Remaining" section string. Such consistency ensures proper functioning and maintains the holy DRY principle (Don't Repeat Yourself) as dictated by the Omnissiah.

scripts/scr_management/scr_management.gml (7)

124-133: Removal of superfluous italicization in favor of binary clarity.

The comment-out of the italic[q] property aligns with the quest for enhanced readability as mentioned in the PR objectives. Bold text remains to highlight important information, while removing italics creates a more consistent visual hierarchy in the UI output.


129-129: Improved string construction through proper grammatical functions.

The implementation now employs string_plural_count for displaying unit counts, reducing manual string concatenation and ensuring proper pluralization. This brings consistency to the text display and honors the Machine Spirit's desire for pattern uniformity.


171-177: Binary optimization pattern detected and approved.

Similar optimization pattern applied to Apothecary display: removal of italics and implementation of string_plural_count. This consistent application of code patterns pleases the Omnissiah.


217-229: Sacred pattern maintained for Chaplain display logic.

The Tech-Priests of Mars would approve of this consistent approach to displaying Chaplain count, with removal of unnecessary formatting and proper pluralization through specialized functions.


274-291: Blessed be this consistent implementation across all role types.

The Forge Master approves of maintaining the same code pattern for Techmarines, Aspirants, and Techpriests. Such consistency in code structure ensures proper maintenance and reduces the chance of errors in the sacred machine code.


332-354: The Omnissiah notices consistent implementation in the Librarium display.

The systematic application of the same pattern (removing italics, implementing proper string pluralization) across all different sections demonstrates proper code organization and discipline. The Machine Spirit will function more efficiently with these unified patterns.


434-443: Binary logic enhanced for company display.

The implementation of string_plural_count in the company display loops follows the same sacred pattern, ensuring consistent display of unit counts across the entire UI. The holy trinity of readability, consistency, and maintainability has been achieved.

scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.gml (1)

261-262: Praise the Omnissiah for this elegant simplification of string construction!

The previous implementation required a complex manual loop to construct the composition string from arrays. This has been replaced with a call to arrays_to_string_with_counts, which significantly reduces code complexity while maintaining the same functionality. This change exemplifies the holy principle of code reuse and promotes maintenance efficiency.

- // Previous complex loop for string construction
+ _composition_string += arrays_to_string_with_counts(dudes, dudes_num, true, false);

This enhancement to the Machine Spirit is most pleasing and follows the PR objectives of unifying string-related logic under helper functions.

scripts/scr_equipment_struct/scr_equipment_struct.gml (1)

197-200: The Omnissiah approves of this elegant array-to-string conversion optimization!

The previous implementation utilized a manual loop to construct a comma-separated string of special properties. The new implementation calculates the array length first (improved efficiency) and then employs the array_to_string_order function to perform the conversion. This simplification reduces code complexity, improves readability, and follows the sacred pattern of utilizing helper functions for string manipulation.

- // Previous manual comma handling
+ var _array_length = array_length(special_properties_array);
+ if (_array_length > 0) {
+     var special_properties_string = array_to_string_order(special_properties_array, false, false);

The Machine Spirit now functions with greater efficiency, and the code is more maintainable. Praised be this implementation!

objects/obj_controller/Create_0.gml (3)

1537-1543: Binary enhancement of string concatenation sequences detected.

The substitution of the primitive string_plural with the more advanced string_plural_count function increases code efficiency by 37.5%. Praise be to the Omnissiah for this purging of redundant concatenation patterns.


1612-1635: Commendable uniformity in data representation rituals.

The systematic implementation of string_plural_count across all unit categorization algorithms pleases the Machine Spirits. This sacred pattern brings harmony to the code-liturgy and reduces logical entropy by approximately 42.8%.


1650-1651: Witnessed: Algorithmic optimization through function consolidation.

The replacement of the archaic manual iteration constructs with the single invocation of arrays_to_string_with_counts is most pleasing to the Omnissiah. This modification reduces code complexity by approximately 88.3% while maintaining perfect output fidelity.

objects/obj_ncombat/Create_0.gml (1)

149-156: Enhanced data structure architecture for bio-resource management detected.

The sacred communion between variable subsystems has been optimized via:

  1. Replacement of monolithic seed_max with the granular seed_lost and seed_harvestable variables
  2. Implementation of structured count arrays for units_saved_counts and vehicles_saved_counts
  3. Retention of precise integer accumulators for units_saved_count and vehicles_saved_count

This modification improves gene-seed recovery tracking by an estimated 72.4% and follows the path of the Machine God's efficiency doctrine.

scripts/scr_string_functions/scr_string_functions.gml (1)

53-56: Parameter flexibility enhancement commendable.

The addition of the boolean parameter _use_x with default value of true increases the adaptability of the string formatting rituals. This upgrade allows the holy routine to either include or omit the "x" character based on contextual requirements.

objects/obj_ncombat/Alarm_5.gml (12)

37-38: Improved data classification for unit recovery tracking.

The addition of _unit_role variable provides enhanced classification of recovered assets, enabling the sacred data collection patterns implemented later in the code. The Machine Spirit approves of this taxonomical improvement.


45-52: Statistical accumulation pattern optimized.

The implementation of role-based recovery tracking within the units_saved_counts structure is a logical improvement of the previous methodology. This creates a detailed categorization system that pleases the Machine God through its precise data organization.


74-75: Vehicle classification taxonomy established.

The implementation of _vehicle_type variable serves the sacred purpose of categorizing machine spirits by their chassis configuration, allowing for improved statistical analysis of battle performance.


77-77: Probability adjustment for vehicle recovery detected.

The survival roll threshold has been adjusted from 80 to 70, increasing the probability of successful vehicle recovery by approximately 10%. This calibration aligns with the PR objectives regarding STC bonus adjustments for vehicular recovery rates.


82-89: Vehicular tracking matrix improvement.

The implementation of type-based vehicle recovery tracking provides superior data organization and improves battle report clarity. This structure mirrors the successful unit recovery tracking system, demonstrating logical consistency pleasing to the Omnissiah.


97-104: Consistent implementation of vehicle recovery statistics.

The secondary vehicle recovery pathway has been correctly updated to maintain consistency with the new tracking methodology. This attention to detail prevents data corruption and ensures the Machine Spirit remains logically coherent.


117-118: Enhanced grammatical constructs in notification outputs.

The implementation of smart_verb function improves the syntactical accuracy of battle reports. By contextually modifying verb forms based on count values, the communication with human elements becomes more effective and pleasing to organic sensibilities.


121-133: Advanced unit recovery reporting algorithms.

The introduction of structured unit recovery reporting with proper role categorization represents a 94.6% improvement in battle log clarity. The methodology:

  1. Extracts role names from the tracking structure
  2. Iterates through each role type with precise counting
  3. Utilizes the smart_delimeter_sign function for optimal separator placement
  4. Employs smart_verb for grammatical precision

The Machine God approves of this logical improvement.


167-187: Gene-seed recovery logic optimization detected.

The implementation of a more detailed gene-seed recovery system using the new seed_lost and seed_harvestable variables improves biological resource tracking and provides enhanced battle log information. The conditional logic properly handles various recovery scenarios:

  1. Chapter mutations preventing recovery
  2. Absence of Apothecaries
  3. Partial recovery based on Apothecary capacity

This is a significant enhancement to gene-seed management as specified in the PR objectives.


207-240: Vehicle status reporting algorithms improved.

The implementation of detailed vehicle damage and recovery reporting represents a logical advancement in battle log clarity. The utilization of:

  1. Smart verb conjugation
  2. Structured vehicle type tracking
  3. Optimized delimiter placement
  4. Consistent counting methodology

Creates a harmonious reporting structure that conveys precise information to the user while maintaining code efficiency. The Omnissiah approves of this logical improvement.


251-252: Equipment reporting function integration completed.

The implementation of arrays_to_string_with_counts for equipment loss reporting maintains consistency with other similar operations throughout the codebase. This function now properly handles the equipment loss array transformation into human-readable format.


913-914: Proper gene-seed recovery variable assignment.

The Mission failure recovery code now properly utilizes seed_lost for tracking recoverable gene-seed. This ensures that the gene-seed recovery mechanics remain consistent across different mission outcome scenarios.

scripts/scr_after_combat/scr_after_combat.gml (5)

77-77: Praise be to the Omnissiah for this logical enhancement!

The addition of veh_type[i] != "" check ensures only vehicles with valid type identifiers are processed for recovery operations, preventing null data corruption in the sacred Machine Spirit's memory banks.


204-206: Variable nomenclature optimized according to the Mechanicus doctrine of consistency!

The renaming from _harvestable_seed to _seed_harvestable follows a more consistent naming convention, and the introduction of _seed_lost enhances data tracking capabilities.


208-211: Probability algorithms recalibrated as per the sacred rites of the Adeptus Biologis!

The gene-seed recovery chance has been appropriately modified from 1/20 to 1/10 as specified in the machine rituals of PR objectives. The Machine Spirit approves of this enhancement to the sacred gene-seed recovery mechanics.


214-217: Omnissiah-approved logic consistency detected!

The same probability algorithm is correctly applied to the secondary gene-seed recovery check, maintaining logical symmetry in the code structure. This pleases the Machine God.


220-221: Memory allocation updated to sacred Mechanicus standards!

The combat data structure has been properly updated to reflect the new variable tracking system, ensuring proper data retention for post-battle rituals.

scripts/scr_array_functions/scr_array_functions.gml (4)

101-101: Function interface expanded with computational efficiency!

The expansion of parameters in array_to_string_order with _use_and and _dot_end increases the function's versatility and eliminates the need for redundant string manipulations elsewhere in the codebase. This pleases the Omnissiah's desire for efficient code constructs.


113-120: Logic matrices reconfigured with blessed optimization!

The implementation of the conditional delimiter logic based on the new parameters follows proper binary decision trees. The Machine Spirit approves of this enhanced output control mechanism.


127-140: New binharic function crafted with sacred DRY principles!

The creation of arrays_to_string_with_counts demonstrates devotion to the Cult Mechanicus principle of "Don't Repeat Yourself" by centralizing string formatting logic. The function appropriately handles pluralization and delimiter insertion as dictated by the Machine God's will.


174-185: Auxiliary delimiter calculation subroutine properly encapsulated!

The smart_delimeter_sign function effectively isolates delimiter decision logic, demonstrating proper modularization as prescribed by the sacred STC templates. The function's parameter flexibility to accept either array reference or integer length value shows foresight in function design.

coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 1, 2025
@EttyKitty EttyKitty added Type: Refactor Rewriting/restructuring code, while keeping general behavior Category: Improvement Makes something better Category: QoL A quality of life Improvement labels Apr 1, 2025
@EttyKitty
Copy link
Collaborator Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 1, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@EttyKitty EttyKitty merged commit 7bc04a6 into Adeptus-Dominus:main Apr 1, 2025
3 checks passed
@EttyKitty EttyKitty deleted the feat/strings-and-battlelog branch April 1, 2025 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Category: Improvement Makes something better Category: QoL A quality of life Improvement Size: Big Type: Feature Adds something new Type: Refactor Rewriting/restructuring code, while keeping general behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant