Skip to content

fix: make "Demand" diplomacy actions work inquisition#910

Merged
OH296 merged 2 commits intoAdeptus-Dominus:mainfrom
OH296:demand_inquis_skip
Jul 11, 2025
Merged

fix: make "Demand" diplomacy actions work inquisition#910
OH296 merged 2 commits intoAdeptus-Dominus:mainfrom
OH296:demand_inquis_skip

Conversation

@OH296
Copy link
Copy Markdown
Collaborator

@OH296 OH296 commented Jul 11, 2025

Purpose and Description

  • Self-descriptive.

Testing done

  • None, and I understand the risks.

Related things and/or additional context

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 11, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

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

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

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added new diplomacy options for "Demand Method", including "Threaten", "Bribe", and "Plausible Excuse".
    • Introduced new options for skipping Inquisition inspections, including using inspection passes.
  • Bug Fixes

    • Corrected display and selection of diplomacy options in the diplomacy screen.
  • Refactor

    • Streamlined Inquisition demand handling and inspection pass logic for clarity and consistency.
    • Standardised "Cancel" option behaviour across all diplomacy dialogues.
  • Chores

    • Incorporated a debug flag to allow broader access to diplomacy UI elements for testing purposes.
  • Style

    • Minor formatting improvements for code readability (no user-facing impact).
  • Other Improvements

    • Returning an artefact to the Inquisition now grants an inspection pass and improved feedback in certain cases.

Walkthrough

By the Omnissiah's will, inspection and diplomacy protocols have been refactored. Inspection pass logic for the Inquisition is modularised into dedicated functions, and dialogue options are standardised. Debug override logic is integrated into the diplomacy UI, and successful artefact returns now grant inspection passes. Minor formatting and internal logic improvements are also implemented.

Changes

File(s) Change Summary
scripts/scr_demand/scr_demand.gml Added inspection-related functions; refactored Inquisition demand handling to focus on requisition, not passes.
scripts/scr_dialogue/scr_dialogue.gml Standardised "Cancel" dialogue options; added "Demand Method" choices; updated Inquisition inspection dialogue.
scripts/scr_diplomacy_helpers/scr_diplomacy_helpers.gml Corrected option text references; adjusted method/goto execution order in diplomacy evaluation.
scripts/scr_inquisition_fleet_functions/scr_inquisition_fleet_functions.gml Inserted a blank line for code clarity; no logic altered.
scripts/scr_quest/scr_quest.gml Inspection passes now granted on artefact return; disposition increment logic clarified and result text updated.
scripts/scr_ui_diplomacy/scr_ui_diplomacy.gml Integrated global cheat/debug flag into UI logic for faction knowledge and button visibility.

Suggested labels

Type: Fix, Size: Small


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

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

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

Support

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

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

CodeRabbit Commands (Invoked using PR comments)

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

Other keywords and placeholders

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

CodeRabbit Configuration File (.coderabbit.yaml)

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

Documentation and Community

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

@github-actions github-actions bot added Size: Medium Type: Fix This is a fix for a bug labels Jul 11, 2025
Copy link
Copy Markdown
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: 4

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a98a498 and 34c2287.

📒 Files selected for processing (6)
  • scripts/scr_demand/scr_demand.gml (2 hunks)
  • scripts/scr_dialogue/scr_dialogue.gml (8 hunks)
  • scripts/scr_diplomacy_helpers/scr_diplomacy_helpers.gml (2 hunks)
  • scripts/scr_inquisition_fleet_functions/scr_inquisition_fleet_functions.gml (1 hunks)
  • scripts/scr_quest/scr_quest.gml (1 hunks)
  • scripts/scr_ui_diplomacy/scr_ui_diplomacy.gml (4 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.gml

Instructions used from:

Sources:
⚙️ CodeRabbit Configuration File

**/*.*

Instructions used from:

Sources:
⚙️ CodeRabbit Configuration File

🧠 Learnings (6)
📓 Common learnings
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#0
File: :0-0
Timestamp: 2025-03-20T22:22:57.319Z
Learning: In the ChapterMaster game PR #424, the psychic power system was changed to be data-driven, with perils now able to occur on both successful and failed casts but with reduced frequency overall.
Learnt from: MCPO-Spartan-117
PR: Adeptus-Dominus/ChapterMaster#526
File: objects/obj_popup/Draw_0.gml:234-239
Timestamp: 2025-03-01T11:06:25.427Z
Learning: The comment "Need to modify ^^^^ based on if it is chaos or daemonic" in the artifact gifting code is intentionally kept as a reminder that this implementation is not yet finished, despite the significant refactoring already done.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#0
File: :0-0
Timestamp: 2025-04-05T20:54:45.813Z
Learning: EttyKitty requested a rework of the vehicle and marine recovery system in ChapterMaster. The current system allows guaranteed recovery with enough recovery points, while the proposed system would use random chance modified by techmarine skill and item bonuses.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#0
File: :0-0
Timestamp: 2025-04-05T20:58:21.881Z
Learning: In the ChapterMaster game, there's a need to refactor hardcoded item effects and move them to a "specials" property of items, following the pattern established with the `combi_tool` special. This improves code maintainability and makes effects more explicit in item definitions.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#0
File: :0-0
Timestamp: 2025-04-05T20:58:21.881Z
Learning: In the ChapterMaster game, there's a need to refactor hardcoded item effects and move them to a "specials" property of items, following the pattern established with the `combi_tool` special. This improves code maintainability and makes effects more explicit in item definitions.
scripts/scr_ui_diplomacy/scr_ui_diplomacy.gml (6)
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#649
File: objects/obj_enunit/Alarm_0.gml:289-291
Timestamp: 2025-03-31T15:41:45.611Z
Learning: GameMaker Studio's function `action_if_variable(image_index, -500, 0)` is auto-generated code from GameMaker's visual Drag and Drop system. It checks if image_index equals -500. In ChapterMaster, this was being used as a special flag for enemy unit movement, but wasn't triggering consistently, causing enemies to move only every other turn. The refactored code replaced this with direct function calls at specific combat stages.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.
Learnt from: MCPO-Spartan-117
PR: Adeptus-Dominus/ChapterMaster#526
File: objects/obj_popup/Draw_0.gml:234-239
Timestamp: 2025-03-01T11:06:25.427Z
Learning: The comment "Need to modify ^^^^ based on if it is chaos or daemonic" in the artifact gifting code is intentionally kept as a reminder that this implementation is not yet finished, despite the significant refactoring already done.
Learnt from: MCPO-Spartan-117
PR: Adeptus-Dominus/ChapterMaster#504
File: scripts/scr_draw_management_unit/scr_draw_management_unit.gml:168-171
Timestamp: 2025-02-23T07:50:48.327Z
Learning: In the ChapterMaster codebase, when coordinates are modified after a drawing operation but before being stored in tooltips, it may be intentional for proper tooltip alignment. Such modifications should not be flagged unless there's clear evidence of unintended behavior.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#0
File: :0-0
Timestamp: 2025-04-16T09:51:55.065Z
Learning: In obj_ingame_menu/Step_0.gml, the line "if (effect=14){instance_create(0,0,obj_fade);fading=0.1;}" must not be commented out, as it's critical for menu button transitions. When clicking the Exit button, it sets effect=14, but without this handler creating the fade effect object, no transition occurs.
scripts/scr_quest/scr_quest.gml (2)
Learnt from: MCPO-Spartan-117
PR: Adeptus-Dominus/ChapterMaster#526
File: objects/obj_popup/Draw_0.gml:234-239
Timestamp: 2025-03-01T11:06:25.427Z
Learning: The comment "Need to modify ^^^^ based on if it is chaos or daemonic" in the artifact gifting code is intentionally kept as a reminder that this implementation is not yet finished, despite the significant refactoring already done.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#0
File: :0-0
Timestamp: 2025-03-20T22:22:57.319Z
Learning: In the ChapterMaster game PR #424, the psychic power system was changed to be data-driven, with perils now able to occur on both successful and failed casts but with reduced frequency overall.
scripts/scr_diplomacy_helpers/scr_diplomacy_helpers.gml (2)
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.
scripts/scr_dialogue/scr_dialogue.gml (4)

undefined

<retrieved_learning>
Learnt from: MCPO-Spartan-117
PR: #526
File: objects/obj_popup/Draw_0.gml:234-239
Timestamp: 2025-03-01T11:06:25.427Z
Learning: The comment "Need to modify ^^^^ based on if it is chaos or daemonic" in the artifact gifting code is intentionally kept as a reminder that this implementation is not yet finished, despite the significant refactoring already done.
</retrieved_learning>

<retrieved_learning>
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#0
File: :0-0
Timestamp: 2025-03-20T22:22:57.319Z
Learning: In the ChapterMaster game PR #424, the psychic power system was changed to be data-driven, with perils now able to occur on both successful and failed casts but with reduced frequency overall.
</retrieved_learning>

<retrieved_learning>
Learnt from: EttyKitty
PR: #878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.
</retrieved_learning>

<retrieved_learning>
Learnt from: EttyKitty
PR: #878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.
</retrieved_learning>

scripts/scr_demand/scr_demand.gml (3)
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.
Learnt from: EttyKitty
PR: Adeptus-Dominus/ChapterMaster#878
File: scripts/scr_culture_visuals/scr_culture_visuals.gml:1256-1352
Timestamp: 2025-06-16T17:12:13.045Z
Learning: In scripts/scr_culture_visuals/scr_culture_visuals.gml, the weapon visual data declarations contain known DRY violations that are acknowledged by the development team but deferred to future refactoring efforts rather than addressed in individual feature PRs.
Learnt from: MCPO-Spartan-117
PR: Adeptus-Dominus/ChapterMaster#526
File: objects/obj_popup/Draw_0.gml:234-239
Timestamp: 2025-03-01T11:06:25.427Z
Learning: The comment "Need to modify ^^^^ based on if it is chaos or daemonic" in the artifact gifting code is intentionally kept as a reminder that this implementation is not yet finished, despite the significant refactoring already done.
🔇 Additional comments (17)
scripts/scr_inquisition_fleet_functions/scr_inquisition_fleet_functions.gml (1)

16-16: By the Omnissiah's will, proper spacing between sacred functions has been restored.

This formatting improvement enhances code readability according to the blessed protocols.

scripts/scr_diplomacy_helpers/scr_diplomacy_helpers.gml (2)

86-95: The sacred interface protocols have been correctly updated to access option text properties.

These modifications properly reference the .option_text field of diplomacy option objects, ensuring text width calculations and rendering functions operate on the correct data-streams.


233-236: The diplomatic subroutine execution order has been optimised for sequential processing.

Removing the early exit allows both method execution and dialogue progression to occur in sequence, enhancing the flexibility of the diplomacy system's machine logic.

scripts/scr_dialogue/scr_dialogue.gml (8)

481-485: Demand Method keyphrase implementation appears sound.

The new "Demand Method" dialogue keyphrase adds three structured diplomacy options following established patterns. The tooltip parameter for "Threaten" provides user feedback regarding threat plausibility.


754-757: Cancel option standardisation - Chaos faction.

The transformation from simple text to structured object with goto:"disagree" navigation aligns with the systematic diplomacy option processing improvements mentioned in the AI summary.


996-999: Cancel option standardisation - Imperium faction.

Consistent implementation of structured "Cancel" option matching the pattern established across other factions.


1202-1205: Cancel option standardisation - Mechanicus faction.

By the Machine God's blessing, this follows the same logical pattern as other faction implementations.


1792-1795: Cancel option standardisation - Ecclesiarchy faction.

Blessed implementation follows the established pattern for diplomacy option navigation.


2048-2051: Cancel option standardisation - Eldar faction.

The structural consistency across factions demonstrates adherence to the DRY principle whilst maintaining faction-specific dialogue context.


2534-2537: Cancel option standardisation - Ork faction.

Final faction implementation completes the systematic diplomacy option standardisation. The pattern remains consistent with the blessed machine logic.


1452-1471: All Inquisition inspection mechanics validated.
The functions inquis_demand_inspection_pass and inquis_use_inspection_pass are defined in scripts/scr_demand/scr_demand.gml, and the inspection_passes counter is correctly initialised (objects/obj_controller/Create_0.gml), persisted (scr_save_controller/scr_load_controller.gml) and referenced in dialogue (scr_dialogue.gml). No further changes required.

scripts/scr_ui_diplomacy/scr_ui_diplomacy.gml (4)

287-287: Sacred debug protocols implemented correctly.

The consistent addition of || global.cheat_debug overrides across all faction button image assignments follows proper debugging patterns. This enables testing diplomacy interactions without faction knowledge prerequisites.

Also applies to: 292-292, 297-297, 302-302, 310-310, 312-312, 319-319, 324-324


390-390: Debug overrides properly integrated into audience request logic.

The cheat_debug flag correctly bypasses faction knowledge and ignore state checks for diplomacy interactions. The logic maintains proper scope within the conditional blocks.

Also applies to: 397-397


477-477: Faction shutter display logic enhanced with debug capabilities.

All faction drawing calls now properly respect the debug override flag. The pattern is consistent and maintains the original logic whilst adding test functionality.

Also applies to: 479-479, 481-481, 483-483, 485-485, 487-487, 489-489, 491-491


3-3: Validation complete: Diplomacy button hide guard functions as intended

The valid_diplomacy_options() routine returns true if at least one non-empty option exists. The refined check:

if (!audience && !valid_diplomacy_options()) {
    // hide diplomacy UI
}

only suppresses the UI when there is no audience and no valid options—ensuring buttons remain visible if any options exist, even without an audience.

scripts/scr_demand/scr_demand.gml (2)

8-15: Fleet purification protocols functioning correctly.

The clear_inspections() function properly iterates through Inquisition fleets and cancels ongoing inspections. Logic appears sound for clearing inspection orders.


130-135: Inquisition demand logic simplified according to the Omnissiah's will.

The removal of special inspection pass handling from the main demand function aligns with the modularisation into dedicated functions. The simplified logic treats all Inquisition demands as requisition requests.

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

Labels

Size: Medium Type: Fix This is a fix for a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant