refactor: Update legacy code with UnitIndex - #1505
Conversation
There was a problem hiding this comment.
2 issues found across 9 files
Confidence score: 5/5
- In
scripts/scr_UnitGroup/scr_UnitGroup.gml,sum_rolesusesrolesinstead of the required_rolesnaming convention; rename the argument and its loop references to keep local-variable style consistent. - In
scripts/scr_UnitGroup/scr_UnitGroup.gml,plural_string_roleusesroleanduse_xinstead of_roleand_use_x; update the arguments and all references to satisfy the naming convention.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="scripts/scr_UnitGroup/scr_UnitGroup.gml">
<violation number="1" location="scripts/scr_UnitGroup/scr_UnitGroup.gml:547">
P2: Custom agent: **Code Quality Review**
The new `plural_string_role` arguments violate the required local-variable naming convention. Rename `role` and `use_x` to `_role` and `_use_x`, and update their references.</violation>
<violation number="2" location="scripts/scr_UnitGroup/scr_UnitGroup.gml:551">
P2: Custom agent: **Code Quality Review**
The new `sum_roles` argument violates the required local-variable naming convention. Rename `roles` to `_roles` and update both references in the loop.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
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>
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>
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>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
…ctor/combat_index
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval blocked by 5 unresolved issues from previous reviews.
Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
Confidence score: 3/5
- In
objects/obj_ncombat/Alarm_1.gml,_dread_countexcludes theVenerable <dreadnought>role while the Venerable Ancients advance is active, undercounting dreadnoughts and potentially causing count-dependent behavior to diverge from the previousdreadnoughtscounter — include the venerable role in the count or retain the established counter.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="objects/obj_ncombat/Alarm_1.gml">
<violation number="1" location="objects/obj_ncombat/Alarm_1.gml:79">
P2: When the 'Venerable Ancients' advance is active, dreadnought units carry the role "Venerable <dreadnought>", so _dread_count only counts base Dreadnoughts and undercounts vs the old `dreadnoughts` counter, which counted both (scr_civil_roster.gml:548-556). This changes the armoured-division check `_dread_count + predators + land_raiders > 3` at Alarm_1.gml:228 and the `_others -= _dread_count` at line 206, so a force of only Venerable dreadnoughts no longer triggers the armoured-division narration. Count Venerable Dreadnought units as well (e.g. via role_groups(SPECIALISTS_DREADNOUGHTS)) so the index count matches the previous counter.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Confidence score: 3/5
- In
objects/obj_ncombat/Alarm_1.gml, the mismatchedVenerableDreadnoughtlookup excludes venerable dreadnoughts from formation narration and role totals, producing incorrect battle reporting; use the indexedVenerable Dreadnoughtkey.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="objects/obj_ncombat/Alarm_1.gml">
<violation number="1" location="objects/obj_ncombat/Alarm_1.gml:79">
P2: When a battle roster contains venerable dreadnoughts, this lookup uses `VenerableDreadnought` instead of the indexed `Venerable Dreadnought` key, so `_dread_count` excludes them from formation narration and role totals. Add the separator when constructing the venerable role name.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval blocked by 4 unresolved issues from previous reviews.
Re-trigger cubic
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval blocked by 4 unresolved issues from previous reviews.
Re-trigger cubic
|
/review |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
The-Real-Nyx
left a comment
There was a problem hiding this comment.
I was kinda in rush so don't take my suggestions as absolutely correct or anything as I might've overlooked something.
All good, all the points are valid in one way or the other |
Co-authored-by: Nyx <80511023+The-Real-Nyx@users.noreply.github.com>
Co-authored-by: Nyx <80511023+The-Real-Nyx@users.noreply.github.com>
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval blocked by 3 unresolved issues from previous reviews.
Re-trigger cubic
EttyKitty
left a comment
There was a problem hiding this comment.
This is a code collapse. I'm not going to nitpick, because this is better than what was. A net positive.
If there are no bugs with this - it's fine. And I'm bad at spotting bugs with my eye on GH.
Summary by cubic
Replaces
obj_ncombat's legacy per-role counters andbig_mofogating with theUnitIndexsystem so unit tracking and battle narration come from a single source.Refactors
Alarm_1.gmlbuilds role summaries fromplayer_unit_indexusingrole_count,plural_string_role, andsum_roles; dreadnought counts include Venerable dreadnoughts.Roster/collect_role_grouppath; the duplicatescr_ship_battlescript is removed.scr_rosterpopulatesplayer_unit_indexviaadd_to_index; legacy counter andbig_mofoupdates are dropped fromscr_rosterandscr_civil_roster.Migration
big_mofo,important_dudes, and the per-role counters are no longer maintained; anything referencing them must read fromplayer_unit_indexinstead.Written for commit 2c3e3b5. Summary will update on new commits.