Skip to content

refactor: disposition alter functions to return strings#1240

Open
OH296 wants to merge 3 commits into
Adeptus-Dominus:mainfrom
OH296:disposition_change_strings
Open

refactor: disposition alter functions to return strings#1240
OH296 wants to merge 3 commits into
Adeptus-Dominus:mainfrom
OH296:disposition_change_strings

Conversation

@OH296

@OH296 OH296 commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Summary by cubic

Refactored disposition helpers to optionally return formatted messages and centralized bounds so dispositions stay within 0–100.

  • Refactors

    • alter_disposition(faction, value, return_string=false) and alter_dispositions(alterations, return_strings) can return strings ("Faction Name : +/-N"); faction_disp_mods now includes strings: [].
    • Bounds are enforced in calc_final_disp_value to keep results in 0–100; alter_disposition only applies the adjusted delta.
  • Migration

    • Update any code that expected dispositions in -100..100 or relied on alter_disposition clamping. Use the return_string(s) flags if you need messages.

Written for commit 60558ab. Summary will update on new commits.

Review in cubic

@github-actions github-actions Bot added Size: Tiny Type: Refactor Rewriting/restructuring code, while keeping general behavior labels Jun 16, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 2 files

Confidence score: 2/5

  • In scripts/scr_ChapterTraits/scr_ChapterTraits.gml, array_create(14, struct) makes all faction_disp_mods entries point to the same struct, so merge_mods can overwrite every faction with identical int_mod/mult values and cause broad gameplay regressions — initialize each array slot with a distinct struct before merging.
  • In scripts/scr_diplomacy_helpers/scr_diplomacy_helpers.gml, a string template is missing the $ prefix, so {} placeholders will render literally and show broken text to players — add the $ so interpolation occurs as intended.
  • In scripts/scr_ChapterTraits/scr_ChapterTraits.gml, the new strings field is currently unused and not merged, which adds confusing dead state (and currently inherits the same shared-reference risk) — either wire it into merge/use paths or remove it in this PR to reduce follow-on bugs.

Shadow auto-approve: would not auto-approve because issues were found.

Re-trigger cubic

Comment thread scripts/scr_diplomacy_helpers/scr_diplomacy_helpers.gml Outdated
Comment thread scripts/scr_ChapterTraits/scr_ChapterTraits.gml Outdated
Comment thread scripts/scr_ChapterTraits/scr_ChapterTraits.gml Outdated
OH296 and others added 2 commits June 17, 2026 19:50
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Shadow auto-approve: would require human review. Refactors core disposition logic, altering bounds from -100..100 to 0..100 and adding string return capabilities. Even though it's a single file, this changes how disposition values are calculated and stored, which could break any code relying on the old range or behavior.

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Size: Tiny Type: Refactor Rewriting/restructuring code, while keeping general behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant