feat: Shot spillover; Speed force; scr_shoot refactor#1309
Draft
EttyKitty wants to merge 4 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
4 issues found across 3 files
Confidence score: 2/5
- In
scripts/scr_player_combat_weapon_stacks/scr_player_combat_weapon_stacks.gml, bike units can hit a runtime error when stack building callsunit.speed_force(...)on a struct that does not define it, which can break combat flow for those units. Addspeed_forceto the relevant unit struct (or guard the call) before merging. - In
scripts/scr_shoot/scr_shoot.gml(combat_apply_rank_damage), proportional allocation can produce fractional casualty caps and leave fractionaldudes_num/enemy_forces, which risks invalid combat state and downstream logic errors. Clamp/round casualties and resulting force counts to valid integer values before merge. - In
scripts/scr_shoot/scr_shoot.gml(scr_shoot_player), Missile Silo cost is deducted even when ammo is unavailable, so players can lose resources without firing. Gate the silo deduction behind a confirmed ammo-consuming shot so cost is only applied on successful fire. - In
scripts/scr_shoot/scr_shoot.gml, repeated magic numbers (30,-40) increase maintenance risk and make balancing changes error-prone. Replace them with named constants to reduce future regressions while touching this area.
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_shoot/scr_shoot.gml">
<violation number="1" location="scripts/scr_shoot/scr_shoot.gml:14">
P2: Custom agent: **Code Quality Review**
Newly added code uses the raw literals `30` (maximum formation rank) and `-40` (special weapon index threshold) repeatedly without defining them as constants. Defining them as `#macro MAX_RANKS 30` and `#macro SPECIAL_WEAPON_THRESHOLD -40` (or via `enum`) would eliminate these magic numbers and prevent inconsistent bounds if the data model ever changes.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Contributor
There was a problem hiding this comment.
2 issues found across 1 file (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by cubic
Adds shot spillover across enemy ranks and formations and introduces the Speed Force sweep attack, producing a single, consolidated volley message. Refactors
scr_shootinto modular helpers and splits player/enemy flows for more reliable damage, AP, and cleanup.New Features
Alarm_0), allocates shots by rank size across all ranks, and reports one volley; auto-added to bike stacks with an optional ranged variant.Bug Fixes
Written for commit a82fa7e. Summary will update on new commits.