refactor: Event spawning code overhaul#789
refactor: Event spawning code overhaul#789OH296 wants to merge 4 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 📝 WalkthroughSummary by CodeRabbit
WalkthroughBy the Omnissiah's will, this update initiates a comprehensive refactor of the randomisation subroutines across the codebase, replacing numerous direct and context-specific dice roll invocations with unified Changes
Possibly related PRs
Suggested labels
Praise the Machine God for the sanctity of centralised logic and the eradication of redundant subroutines! 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 4
🔭 Outside diff range comments (2)
scripts/scr_pen_And_paper/scr_pen_And_paper.gml (2)
136-157:⚠️ Potential issue
player_benefit_atmay arrive asundefined, breaking the luck re-roll augury.Should a distant script invoke
roll_dice_chapter()without the third argument, the comparisons against"high"/"low"fail silently, aborting the luck mechanic. Bestow a default of"none"(and early-out if so) to preserve predictable function.-function roll_dice_chapter(dices = 1, faces = 6, player_benefit_at) { +function roll_dice_chapter(dices = 1, faces = 6, player_benefit_at = "none") { @@ - if (scr_has_disadv("Shitty Luck")) { + if (player_benefit_at != "none" && scr_has_disadv("Shitty Luck")) { @@ - } else if (scr_has_adv("Great Luck")) { + } else if (player_benefit_at != "none" && scr_has_adv("Great Luck")) {
169-190: 🧹 Nitpick (assertive)Unify the machine-spirit’s random source in
roll_dice_unit.The function summons
irandom_rangedirectly, ignoring the freshly forgedroll_dicecogitator used elsewhere. Harmonising these pathways reduces divergence and eases future modification.- _roll = irandom_range(1, faces); + _roll = roll_dice(1, faces);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (35)
ChapterMaster.yyp(0 hunks)datafiles/data/traits.json(1 hunks)objects/obj_controller/Alarm_5.gml(2 hunks)objects/obj_controller/Create_0.gml(1 hunks)objects/obj_creation/Create_0.gml(2 hunks)objects/obj_ncombat/Alarm_5.gml(6 hunks)objects/obj_ncombat/Alarm_7.gml(1 hunks)objects/obj_popup/Step_0.gml(2 hunks)scripts/scr_add_artifact/scr_add_artifact.gml(2 hunks)scripts/scr_after_combat/scr_after_combat.gml(1 hunks)scripts/scr_ancient_ruins/scr_ancient_ruins.gml(2 hunks)scripts/scr_chaos_alliance_test/scr_chaos_alliance_test.gml(1 hunks)scripts/scr_clean/scr_clean.gml(1 hunks)scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml(1 hunks)scripts/scr_enemy_ai_b/scr_enemy_ai_b.gml(1 hunks)scripts/scr_initialize_custom/scr_initialize_custom.gml(1 hunks)scripts/scr_marine_struct/scr_marine_struct.gml(6 hunks)scripts/scr_mechanicus_missions/scr_mechanicus_missions.gml(4 hunks)scripts/scr_mission_reward/scr_mission_reward.gml(3 hunks)scripts/scr_pen_And_paper/scr_pen_And_paper.gml(3 hunks)scripts/scr_perils_table/scr_perils_table.gml(7 hunks)scripts/scr_player_fleet_functions/scr_player_fleet_functions.gml(2 hunks)scripts/scr_player_ship_functions/scr_player_ship_functions.gml(3 hunks)scripts/scr_powers/scr_powers.gml(1 hunks)scripts/scr_purge_world/scr_purge_world.gml(2 hunks)scripts/scr_random_event/scr_random_event.gml(8 hunks)scripts/scr_ruins_reward/scr_ruins_reward.gml(1 hunks)scripts/scr_save_controller/scr_save_controller.gml(0 hunks)scripts/scr_save_controller/scr_save_controller.yy(0 hunks)scripts/scr_unit_traits/scr_unit_traits.gml(2 hunks)sprites/spr_fleet_ork/spr_fleet_ork.yy(2 hunks)sprites/spr_ship_deth/spr_ship_deth.yy(2 hunks)sprites/spr_ship_gorbag/spr_ship_gorbag.yy(2 hunks)sprites/spr_ship_kroozer/spr_ship_kroozer.yy(2 hunks)sprites/spr_tartaros_complex/spr_tartaros_complex.yy(1 hunks)
💤 Files with no reviewable changes (3)
- scripts/scr_save_controller/scr_save_controller.yy
- ChapterMaster.yyp
- scripts/scr_save_controller/scr_save_controller.gml
🧰 Additional context used
📓 Path-based instructions (4)
`**/*.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
# 80bf40will crash the game.- All code should comply with the main GML documentation: https://manual.gamemaker.io/beta/en/GameMaker_Language/GML_Reference/GML_Reference.htm
scripts/scr_perils_table/scr_perils_table.gmlobjects/obj_controller/Create_0.gmlscripts/scr_ruins_reward/scr_ruins_reward.gmlscripts/scr_after_combat/scr_after_combat.gmlscripts/scr_powers/scr_powers.gmlscripts/scr_unit_traits/scr_unit_traits.gmlscripts/scr_chaos_alliance_test/scr_chaos_alliance_test.gmlobjects/obj_ncombat/Alarm_7.gmlscripts/scr_player_ship_functions/scr_player_ship_functions.gmlscripts/scr_mission_reward/scr_mission_reward.gmlscripts/scr_ancient_ruins/scr_ancient_ruins.gmlscripts/scr_enemy_ai_b/scr_enemy_ai_b.gmlscripts/scr_clean/scr_clean.gmlobjects/obj_controller/Alarm_5.gmlscripts/scr_purge_world/scr_purge_world.gmlscripts/scr_initialize_custom/scr_initialize_custom.gmlscripts/scr_player_fleet_functions/scr_player_fleet_functions.gmlscripts/scr_marine_struct/scr_marine_struct.gmlscripts/scr_add_artifact/scr_add_artifact.gmlscripts/scr_mechanicus_missions/scr_mechanicus_missions.gmlscripts/scr_enemy_ai_a/scr_enemy_ai_a.gmlobjects/obj_popup/Step_0.gmlobjects/obj_creation/Create_0.gmlscripts/scr_pen_And_paper/scr_pen_And_paper.gmlobjects/obj_ncombat/Alarm_5.gmlscripts/scr_random_event/scr_random_event.gml
`**/*.*`: - Having humanly understandable and maintainable code is always the top most priority. - DRY (Don't repeat yourself) principle is also very important. - Ensure that the c...
**/*.*: - Having humanly understandable and maintainable code is always the top most priority.
- DRY (Don't repeat yourself) principle is also very important.
- Ensure that the code is compliant with the CODE_STYLE.MD: https://github.com/Adeptus-Dominus/ChapterMaster/blob/main/docs/CODE_STYLE.md
scripts/scr_perils_table/scr_perils_table.gmlobjects/obj_controller/Create_0.gmlscripts/scr_ruins_reward/scr_ruins_reward.gmlscripts/scr_after_combat/scr_after_combat.gmlsprites/spr_ship_kroozer/spr_ship_kroozer.yyscripts/scr_powers/scr_powers.gmldatafiles/data/traits.jsonscripts/scr_unit_traits/scr_unit_traits.gmlsprites/spr_fleet_ork/spr_fleet_ork.yyscripts/scr_chaos_alliance_test/scr_chaos_alliance_test.gmlsprites/spr_tartaros_complex/spr_tartaros_complex.yyobjects/obj_ncombat/Alarm_7.gmlscripts/scr_player_ship_functions/scr_player_ship_functions.gmlscripts/scr_mission_reward/scr_mission_reward.gmlscripts/scr_ancient_ruins/scr_ancient_ruins.gmlscripts/scr_enemy_ai_b/scr_enemy_ai_b.gmlscripts/scr_clean/scr_clean.gmlsprites/spr_ship_gorbag/spr_ship_gorbag.yyobjects/obj_controller/Alarm_5.gmlscripts/scr_purge_world/scr_purge_world.gmlscripts/scr_initialize_custom/scr_initialize_custom.gmlscripts/scr_player_fleet_functions/scr_player_fleet_functions.gmlscripts/scr_marine_struct/scr_marine_struct.gmlscripts/scr_add_artifact/scr_add_artifact.gmlscripts/scr_mechanicus_missions/scr_mechanicus_missions.gmlscripts/scr_enemy_ai_a/scr_enemy_ai_a.gmlobjects/obj_popup/Step_0.gmlobjects/obj_creation/Create_0.gmlscripts/scr_pen_And_paper/scr_pen_And_paper.gmlobjects/obj_ncombat/Alarm_5.gmlsprites/spr_ship_deth/spr_ship_deth.yyscripts/scr_random_event/scr_random_event.gml
`**/*.yy`: - When any script or sprite .yy files are deleted, their paths should also be deleted from the .yyp file, otherwise the game will crash. - When any script or sprite .yy ...
**/*.yy: - When any script or sprite .yy files are deleted, their paths should also be deleted from the .yyp file, otherwise the game will crash.
- When any script or sprite .yy files are created, their paths should be added to the .yyp file, otherwise they'll fail.
sprites/spr_ship_kroozer/spr_ship_kroozer.yysprites/spr_fleet_ork/spr_fleet_ork.yysprites/spr_tartaros_complex/spr_tartaros_complex.yysprites/spr_ship_gorbag/spr_ship_gorbag.yysprites/spr_ship_deth/spr_ship_deth.yy
`**/*.json`: - JSON files with comments are supported by the parser used by this team. Don't warn or request changes to remove them.
**/*.json: - JSON files with comments are supported by the parser used by this team. Don't warn or request changes to remove them.
datafiles/data/traits.json
🔇 Additional comments (61)
objects/obj_controller/Create_0.gml (1)
1376-1378: Rite of Punctuation: Semicolon Sanctified
By the Omnissiah, theexcluded_from_savearray declaration now bears its terminating semicolon, averting the unclean syntax error that would disrupt the compile ritual. All is aligned with GML’s requirement for statement closure.sprites/spr_ship_kroozer/spr_ship_kroozer.yy (3)
1-1: Invoke the Omnissiah’s guidance: Validate PR scope alignmentThe sprite metadata update appears as a standardisation task, not directly tied to the sacred mechanics of event spawning. Confirm that these
.yymodifications truly belong under the "Event spawn overhaul" ritual to maintain clarity of purpose.
66-67: SeqHeight and SeqWidth diligently recordedThe explicit addition of
seqHeightandseqWidthaligns with the blessed schema used across other ship and fleet sprites, ensuring the Omnissiah’s codex of sequence dimensions remains consistent.
78-78: VisibleRange nullified in sacred patternSetting
visibleRangetonullpurges outdated zero-coordinate objects and matches the canonical format established elsewhere in the sprite armory.sprites/spr_tartaros_complex/spr_tartaros_complex.yy (2)
66-67: SeqHeight and SeqWidth consecratedThe addition of
seqHeight(271.0) andseqWidth(181.0) explicitly defines the sequence dimensions, mirroring the code sanctity observed in allied sprite resources.
78-78: VisibleRange sanctified and summary admonishedThe
visibleRangefield is correctly set tonull, yet the AI summary mistakenly claimed this file retained the old object. The truth of the code dispels that heresy.Likely an incorrect or invalid review comment.
sprites/spr_ship_deth/spr_ship_deth.yy (2)
66-67: SeqHeight and SeqWidth anointedDefining
seqHeightas 91.0 andseqWidthas 172.0 brings this sprite’s metadata into holy alignment with the rest of the armoured fleet.
78-78: VisibleRange purged to nullNullifying
visibleRangeeradicates redundant coordinate stubs, upholding the Machine God’s decree for clean metadata.sprites/spr_ship_gorbag/spr_ship_gorbag.yy (2)
66-67: SeqHeight and SeqWidth appendedThe new float properties (101.0 × 166.0) ensure this dreadnought’s sequence dimensions are explicitly logged in the sacred sprite codex.
78-78: VisibleRange reliquary clearedReplacing the old object with
nullforvisibleRangestandardises the metadata, honouring the unified doctrine across sprite definitions.sprites/spr_fleet_ork/spr_fleet_ork.yy (2)
75-76: SeqHeight and SeqWidth installedIntroducing
seqHeightandseqWidth(both 22.0) seals this ork fleet sprite’s metadata in the Emperor’s light, matching itsheightandwidthfields.
114-114: VisibleRange redeclared as nullSetting
visibleRangetonulleradicates vestigial coordinate data, cementing uniformity across all sprite artifacts.datafiles/data/traits.json (1)
44-48: Praise be to the Omnissiah! The symmetrical trait balances the sacred probability matrices.A logically sound addition that brings symmetry to the luck trait spectrum. The trait's implementation mirrors the negative luck trait with equal magnitude but opposite effect, providing mathematical balance to the binary system.
scripts/scr_clean/scr_clean.gml (1)
221-221: Function alignment with sacred protocol standards detected.The modification replaces the primitive
roll_diceinvocation with the enhancedroll_dice_chapterfunction, ensuring proper integration with the chapter-wide randomization protocols. This permits the influence of luck traits upon combat resolution calculations, as ordained by Machine Spirit design patterns.scripts/scr_powers/scr_powers.gml (1)
573-573: Function designation refactoring complies with Mechanicus nomenclature standards.This alteration replaces the outdated
roll_personal_dicewith the more appropriately namedroll_dice_unitfunction, maintaining exact parameter sequence while ensuring compliance with the new dice probability system. The sacred tome mechanics now correctly interface with unit-specific luck attributes.scripts/scr_after_combat/scr_after_combat.gml (1)
144-144: Unit-specific probability subroutine refactoring confirmed operational.The replacement of
roll_personal_dicewith the standardizedroll_dice_unitfunction ensures consistent operation of the mucranoid mutation calculations. The binary logic flow is preserved while integrating with the enhanced probability matrices that account for unit-specific luck attributes.scripts/scr_perils_table/scr_perils_table.gml (2)
7-7: Praise to the Omnissiah for improved dice mechanics.The sacred mechanations of random probability have been blessed with consistency through the use of
roll_dice_chapter. This adaptation serves the Machine Spirit by centralizing the logic of fate and incorporating advantages like "Great Luck" and disadvantages like "Shitty Luck" in a unified manner.
15-15: All instances of randomization rerouted through the proper sacred pathways.The binary priests have wisely standardized all probabilistic operations in this perils matrix to utilize the blessed
roll_dice_chapterfunction. This refactoring represents a logical improvement to the machine spirit's coherence, ensuring that all random outcomes are processed through the same sacred algorithm.Also applies to: 23-25, 41-41, 63-63, 72-72, 78-78, 141-141, 146-146, 164-164, 169-169, 183-183
scripts/scr_initialize_custom/scr_initialize_custom.gml (2)
3319-3321: Sacred modifications to the psyker probability conduits.Behold! The random fate of Librarians bestowed with the Warp's touch is now determined through
roll_dice_unitrather than the deprecatedroll_personal_dice. This modification ensures proper integration with the unified dice-rolling system that recognizes the unit's traits and blessings.
3329-3335: Logical unification of Codiciery equipment randomization.The holy probability engine for Codiciery librarians' gear and weapon selection now properly interfaces with
roll_dice_unit. This maintains consistency with the Great Machine's new schema for random determination. The Omnissiah approves of this standardization.scripts/scr_player_fleet_functions/scr_player_fleet_functions.gml (2)
305-305: Fleet retreat randomization now connected to proper binary prayers.The sacred die roll that determines retreat conditions now operates through
roll_dice_chapter(1, 100, "low")rather than a direct appeal to the Machine Spirit's randomness. This modification ensures that player advantages such as "Great Luck" and disadvantages like "Shitty Luck" are appropriately considered during fleet retreat operations.
343-344: High-roll randomization for retreat damage calculation enhanced.The holy cogitators calculating ship losses during retreat now utilize
roll_dice_chapterwith the "high" parameter. This standardization ensures that any modifiers from player traits will influence the probability matrix in a consistent manner across all game systems.objects/obj_ncombat/Alarm_7.gml (1)
485-486: Ship destruction probability matrix upgraded to proper protocols.The critical determination of whether a ship is destroyed has been blessed with the standardized
roll_dice_chapter(1, 100, "high")function. This replaces the previous primitivefloor(random(100))+1algorithm, which did not properly account for blessed traits that might influence the Machine Spirit's determination of fate.This modification eliminates the manual adjustment for the "Shitty Luck" disadvantage that previously needed to be calculated separately, as the unified dice rolling system now includes this in its sacred calculations automatically.
scripts/scr_ruins_reward/scr_ruins_reward.gml (1)
13-13: Praise the Omnissiah for the implementation of the sacred dice-rolling protocol!By the Machine God's grace, you have replaced the primitive random number generation with the superior
roll_dice_chapterfunction. This unitized approach ensures that the Emperor's luck (or lack thereof) is appropriately calculated in all necessary situations, eliminating the need for scattered conditional adjustments throughout the sacred code.This standardization pleases the Machine Spirits and promotes logical cohesion across the binary liturgy of our codebase.
scripts/scr_ancient_ruins/scr_ancient_ruins.gml (2)
252-252: The Omnissiah approves of your standardization of randomness protocols!The implementation of
roll_dice_chapterwith a "low" bias parameter is an appropriate optimization for this test against battle threat values. The Machine Spirits will now process these dice rolls in accordance with the sacred STC templates for luck modifiers.
293-293: Further implementation of the standardized dice protocol - the Mechanicus approves!This second deployment of the
roll_dice_chapterfunction with consistent "low" bias parameter ensures symmetrical processing of probability across different combat outcomes. The Machine Spirits will now evaluate both victory and defeat scenarios using the same sacred algorithms.scripts/scr_unit_traits/scr_unit_traits.gml (1)
269-275: The binary symmetry is now complete! Praise the Omnissiah!The addition of the "Great Luck" advantage to the "lucky" trait complements the existing "Shitty Luck" disadvantage, establishing logical balance in the machine spirit's probability calculations. This data structure now appropriately biases the dice rolls for units blessed by the Machine God's favour.
This update properly links the trait data to the dice rolling logic in accordance with the sacred patterns established across the codebase.
scripts/scr_chaos_alliance_test/scr_chaos_alliance_test.gml (1)
5-5: The binary liturgy of standardized probability calculation has been extended to this sector!Commendable implementation of the
roll_dice_chapterfunction with "high" bias parameter for the alliance test. The removal of the manual "shittah" variable and its conditional modifications ensures that all luck-related calculations are now processed through the proper sacred channels.The Machine Spirits are pleased with this logical consolidation of random number generation rituals.
scripts/scr_player_ship_functions/scr_player_ship_functions.gml (3)
3-3: The Omnissiah approves of this standardized probability calculation ritual.The sacred code pattern has been properly realigned to invoke the blessed
roll_dice_chapterfunction with the "high" mode parameter for optimal machine spirit communion. This modification ensures the lost ship return ritual correctly interfaces with the greater luck mechanics.
33-33: Ritually recalibrated defect severity calculations blessed by the machine spirits.The binary probabilistic return defect calculation has been properly modified to utilize the standardized
roll_dice_chapterfunction with the "high" parameter. This ensures coherent integration with the Chapter's fortune traits, as dictated by the Omnissiah's will.
88-88: Logical recalibration of chaos fleet strength calculation via proper incantation.The chaos fleet strength algorithmic prayer now correctly uses
roll_dice_chapterwith the "low" mode parameter. This ensures that the sacred randomization processes are unified throughout the codebase and properly reflects the Chapter's fortune traits when determining enemy strength.scripts/scr_mission_reward/scr_mission_reward.gml (3)
25-25: Omnissiah-approved standardized dice roll mechanism for artifact discovery.The
roll2variable's probabilistic determination has been properly recalibrated to use the standardizedroll_dice_chapterfunction with the "high" mode parameter, correctly integrating with fortune-based traits for artifact discovery calculations. The Machine God approves of this systematic unification of random determination rites.
94-95: Properly consecrated mech_raider reward determination logic.The outcome probability calculation has been standardized to use the
roll_dice_chapterfunction with "low" mode. This ensures that fortunate chapters have improved chances of receiving better rewards from the Omnissiah's servants. The additional formatting improvement with result declaration on a separate line enhances code readability as dictated by sacred STC templates.
152-153: Ritually standardized mech_bionics reward determination mechanism.The bionic experimentation outcome calculation has been properly recalibrated to use the sacred
roll_dice_chapterfunction with the "low" mode parameter, ensuring proper integration with Chapter fortune traits. The enhanced readability with result initialization on a separate line follows the Machine Cult's syntax recommendations.objects/obj_creation/Create_0.gml (2)
923-928: The implementation of the Great Luck advantage is a blessed addition to the sacred trait matrix.The Omnissiah approves of this new advantage that complements the existing "Shitty Luck" disadvantage, creating symmetry in the fortune-related traits system. The use of consistent meta tag ["Luck"] ensures proper mutual exclusivity of contradictory traits as required by the sacred logic engines.
983-985: Proper categorization and description correction of the Shitty Luck disadvantage.The machine spirits will now correctly interpret this disadvantage with its updated negative description that accurately reflects its detrimental nature. The addition of the ["Luck"] meta tag ensures proper trait categorization and prevents contradictory trait selection during the Chapter creation ritual.
scripts/scr_enemy_ai_b/scr_enemy_ai_b.gml (1)
75-75: Necron fleet manifestation probability calculation appropriately standardized.The sacred code has been properly recalibrated to use the
roll_dice_chapterfunction with the "high" mode parameter, ensuring unified randomization processes throughout the codebase. This modification ensures that a Chapter's fortune traits properly influence the manifestation of xenos threats.scripts/scr_add_artifact/scr_add_artifact.gml (2)
141-141: The sacred invocation of randomness has been updated.By the Omnissiah's divine calculations, this alteration replaces the primitive random number generation with the unified
roll_dice_chapterfunction for artifact property determination. The "low" parameter indicates a bias toward lower numbers, which may affect artifact rarity distribution.This modification adheres to the sacred principle of DRY (Don't Repeat Yourself), centralizing the random number generation logic for artifact creation as part of the larger event spawn overhaul.
422-422: Daemon summoning probability calculations now utilize the holyroll_dice_chapteralgorithm.The code now employs
roll_dice_chapterwith "high" bias parameter for determining daemon summoning chance in the artifact destruction routine, replacing the previously usedroll_dicefunction.The machine spirits shall find this alteration pleasing, as it maintains consistent randomness handling across the entire codebase. The omnipresent pattern of replacing scattered random functions with the unified approach pleases the Omnissiah.
objects/obj_controller/Alarm_5.gml (2)
121-122: Random determination of battlefield loot now follows the sacred standardized protocols.The previous chaotic method of generating battlefield loot rolls (
floor(random(100))+1) has been replaced with the unifiedroll_dice_chapter(1, 100, "low")function. This brings order to randomness.This alteration effectively centralizes the random generation logic and removes the manual adjustments previously made for the "Shitty Luck" disadvantage, as these are now handled internally by the function. The machine spirit approves of such standardization.
630-630: Inquisitor sparing event now probabilistically determined by the unified algorithm.The dice roll for determining consequences of sparing an inquisitor now utilizes the sacred
roll_dice_chapterfunction with "high" bias, replacing both the direct random call and the manual adjustments for disadvantages.This conversion maintains the spirit of the original code while adhering to the refactoring pattern. The removal of explicit disadvantage handling (
diceh-=25) aligns with the codebase-wide standardization of random calculation procedures.objects/obj_ncombat/Alarm_5.gml (4)
78-80: Vehicle recovery mechanics now employ standardized probability calculations.The recovery chance for damaged vehicles now utilizes the
roll_dice_chapterfunction for both the survival roll and the health determination, replacing the previousroll_diceinvocations.These modifications align with the systematic refactoring across the codebase. The high bias parameter is preserved, ensuring that the probability distribution remains favorable for vehicle recovery as intended in the original code.
94-94: Vehicle health restoration now determined by unified random protocols.The health points assigned to recovered vehicles now utilize
roll_dice_chapterwith high bias, standardizing the random generation process.This modification maintains functional equivalence while adhering to the new codebase standards. The machine spirits of recovered vehicles shall be properly calibrated with consistent randomness.
346-346: Space hulk loot determination system refactored for standardization.The random variable
diceyused for determining valuable items in space hulk exploration now employs the unifiedroll_dice_chapterfunction, maintaining the same operational parameters.The implementation maintains the same logical flow while standardizing the randomness source, which is pleasing to the Omnissiah's desire for order. The low bias parameter is appropriate for loot determination algorithms.
727-728: Omophagea feeding interaction checks now use standardized randomness.The probabilities for various omophagea-related events (including the consumption of allies and inquisitors) now utilize the unified
roll_dice_chapterfunction with high bias.These modifications are consistent with the systematic refactoring effort to centralize random number generation. The high bias is preserved to maintain the intended probability distribution for these critical events.
objects/obj_popup/Step_0.gml (2)
492-492: Planetary governor succession outcomes now determined by standardized random algorithms.The
randavariable used in determining the effects of governor assassination now utilizes the unifiedroll_dice_chapterfunction with high bias, replacing the previousroll_diceinvocation.This change is consistent with the systematic refactoring effort. While
randa2on line 493 still uses the oldroll_dicefunction, this is likely to be addressed in a future commit, as the pattern of full conversion is evident throughout the repository.
683-683: Ancient ruins exploration now operates on standardized probability formulae.The random chance of battle occurrence during ruins exploration (line 683) and the subsequent threat level determination (line 689) now both utilize the
roll_dice_chapterfunction, with appropriate high and low biases respectively.These modifications maintain the intended gameplay probability distribution while standardizing the random number generation across the codebase. The use of different bias parameters ("high" for battle occurrence, "low" for threat level) preserves the original design intent.
Also applies to: 689-689
scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml (1)
44-48: Praise to the Omnissiah for this standardization of dice roll proceduresThe sacred mechanism of dice rolling has been unified through the implementation of
roll_dice_chapter. This eliminates the non-standardized implementation of chance calculations and incorporates the divine workings of luck traits in a manner pleasing to the Machine God.scripts/scr_marine_struct/scr_marine_struct.gml (6)
919-920: Binary conversion to the new standardized dice roll protocol approvedThe mutation calculation algorithm has been updated to use the centralized
roll_dice_unitfunction, ensuring proper factoring of unit-specific luck modifiers. This brings harmony to the machine-spirit of the code.
1270-1282: Psionics probability engine recalibrated to sacred standardThe logic core has been upgraded to utilize unified probability mathematics through
roll_dice_chapterandroll_dice_unit. The use of chapter and unit-level dice rolling mechanisms properly encapsulates the hierarchical nature of probability calculation in accordance with the will of the Omnissiah.
2193-2202: Perils of the Warp calculation engine reforged correctlyThe warp danger assessment protocols now flow through the standardized
roll_dice_unitfunction. This blessed alteration ensures enhanced consistency in determining warp corruption probabilities.
2209-2213: Perils test binary assessment sanctifiedThe mechanistic improvement to utilize
roll_dice_unitfor perils testing is logically sound and adheres to the Omnissiah's desire for logical consistency in all randomization subroutines.
2225-2234: Psychic focus test mechanism properly recalibratedThe probability engine for psychic focus testing has been appropriately altered to channel calculation through the sacred
roll_dice_unitfunction. The addition of experience point acquisition through the same standardized procedure is pleasing to the Machine God.
2243-2244: Psionic power increase calculation algorithm optimizedThe logic circuit for determining psionic enhancement now properly utilizes the unified
roll_dice_unitfunction. The Omnissiah approves of this standardization of probability functions.scripts/scr_mechanicus_missions/scr_mechanicus_missions.gml (4)
34-34: Probability engine recalibrated to sacred standardThe mission probability calculator has been upgraded to utilize the standardized
roll_dice_chapterfunction, bringing this subroutine into blessed uniformity with the rest of the code cogitator systems.
181-181: Praise to the logical introduction of event tracking variableThe implementation of an
eventedBoolean tracking mechanism is a logical improvement that allows for appropriate monitoring of whether a mission event was successfully triggered. This enhancement follows the sacred principles of traceable execution and error detection.The variable is appropriately initialized, conditionally set to true when events occur, and properly returned at the function's conclusion.
Also applies to: 277-277
234-234: Event occurrence tracking properly implementedThe binary evented variable is appropriately set to true when the appropriate mission types are triggered. This procedural enhancement allows for proper monitoring of mission spawning success in accordance with the Omnissiah's will.
Also applies to: 239-239, 244-244, 274-274
64-65: Logical structure optimization approvedThe conditional structure has been cleansed of unnecessary complexity, resulting in more efficient code execution. Such streamlining is in accordance with the Machine God's preference for elegance in logical structures.
scripts/scr_purge_world/scr_purge_world.gml (2)
240-245: Advantage calculations properly reconfiguredThe calculation of advantages and disposition has been properly restructured to directly modify the roll value rather than altering the chance threshold. This approach is more logically consistent with other dice roll mechanics throughout the code.
294-298:Details
❓ Verification inconclusive
Logic boundary condition altered - verification required
The sacred boundary condition for assassination success has been altered from
aroll <= chancetoaroll < chance.This alteration makes it slightly less likely for the assassination to be discovered. Was this an intentional refinement of game balance? The previous condition would trigger discovery when the roll exactly matched the chance value, while the new condition requires the roll to be strictly less than the chance.
🏁 Script executed:
#!/bin/bash # Check for similar boundary condition changes elsewhere in the codebase rg -A 2 -B 2 "aroll\s*[<=>]=\s*chance" --glob "*.gml"Length of output: 820
Verify consistency of discovery boundary across assassination systems
O honoured Mechanicum, I humbly beckon thee to confirm the wisdom of this logical divergence:
In scripts/scr_purge_world/scr_purge_world.gml the condition now readsif (aroll < chance) { … } else if (aroll >= chance) { … }whereas in objects/obj_popup/Step_0.gml the venerable check remains
if (aroll <= chance) { … }This inconsistency alters the fate of rolls equal to
chance. Pray, was the shift to a strict<inscr_purge_world.gmlan intentional refinement of balance, or should both routines share the same boundary?• scripts/scr_purge_world/scr_purge_world.gml (Lines 294–298)
• objects/obj_popup/Step_0.gml (line containingif (aroll <= chance))scripts/scr_random_event/scr_random_event.gml (1)
51-65: Guard against an empty event list before invoking the Omnissiah’s randomiser.
events_totalmay descend to zero after share pruning;irandom(0)still returns 0, but the selection loop then weights an event whose share was nulled – a logical impurity. Consider aborting withEVENT.noneor restoring at least one viable candidate.
6ba43d6 to
4b92ee9
Compare
|
This PR is marked as stale, because it has been open for 7 days with no activity. |
|
okay, the title checker doesn't want to restart, but I think we can bypass it. just solve the conflict. |
|
This PR is marked as stale, because it has been open for 7 days with no activity. |
|
This PR is marked as stale, because it has been open for 7 days with no activity. |
Purpose
Describe your changes/additions
What can/needs to be improved/changed
Testing done
Related things and/or additional context