Skip to content

feat: Shot spillover; Speed force; scr_shoot refactor#1309

Draft
EttyKitty wants to merge 4 commits into
Adeptus-Dominus:mainfrom
EttyKitty:feat/combat-balance
Draft

feat: Shot spillover; Speed force; scr_shoot refactor#1309
EttyKitty wants to merge 4 commits into
Adeptus-Dominus:mainfrom
EttyKitty:feat/combat-balance

Conversation

@EttyKitty

@EttyKitty EttyKitty commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

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_shoot into modular helpers and splits player/enemy flows for more reliable damage, AP, and cleanup.

  • New Features

    • Shot spillover: excess damage rolls to the next alive rank (prefers same vehicle type), then the nearest formation behind; compresses and removes emptied formations.
    • Speed Force: sweeps the whole field (bypasses range/targeting via Alarm_0), allocates shots by rank size across all ranks, and reports one volley; auto-added to bike stacks with an optional ranged variant.
    • New helpers for armour/AP, per-rank damage, and formation cleanup with safer DR/splash math and HP checks.
  • Bug Fixes

    • Negative weapon indices now fire once as intended.
    • Corrected AP multipliers and dead-rank handling to prevent zero/negative damage and divide-by-HP errors.

Written for commit a82fa7e. Summary will update on new commits.

Review in cubic

@github-actions github-actions Bot added Size: Huge Type: Feature Adds something new labels Jul 8, 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.

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 calls unit.speed_force(...) on a struct that does not define it, which can break combat flow for those units. Add speed_force to 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 fractional dudes_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

Comment thread scripts/scr_shoot/scr_shoot.gml Outdated
Comment thread scripts/scr_shoot/scr_shoot.gml
Comment thread scripts/scr_shoot/scr_shoot.gml

@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.

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

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread scripts/scr_shoot/scr_shoot.gml Outdated
Comment thread scripts/scr_shoot/scr_shoot.gml Outdated

@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).

Re-trigger cubic

@EttyKitty EttyKitty marked this pull request as draft July 8, 2026 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Size: Huge Type: Feature Adds something new

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants