Skip to content

Sam Upgrades#85

Merged
1brucben merged 11 commits into
v0.2.0from
samupdate
Nov 14, 2025
Merged

Sam Upgrades#85
1brucben merged 11 commits into
v0.2.0from
samupdate

Conversation

@1brucben
Copy link
Copy Markdown
Owner

This pull request adds support for SAM Launcher upgrades to the client-side structure rendering and interaction logic, refines the upgrade price display in upgrade mode, and makes minor UI and code cleanup improvements. The most significant changes are the addition of SAM Launcher upgrade logic and the improved upgrade price labeling for all upgradeable structures.

Structure upgrade support and UI enhancements

  • Added SAM Launcher (UnitType.SAMLauncher) as an upgradeable structure throughout StructureLayer, including rendering, highlight logic, upgrade interaction, and level cap enforcement. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
  • Refactored upgrade price calculation to use a multiplier for all structure types and added a compact gold formatter for price labels.
  • In upgrade mode, now displays upgrade price labels below all upgradeable structures owned by the player, with color indicating affordability.
  • Improved label rendering for structure levels: only shows secondary level if present, and refactored layout logic for clarity and maintainability.

Minor UI and code cleanup

  • Removed unused Google Fonts from index.html and updated header font stack to remove references to "Anton" and "Bebas Neue". [1] [2]
  • Increased opacity for non-targetable units in UnitLayer from 0.4 to 0.5 for better visibility.
  • Fixed duplicate entry for UpgradeStructureIntentSchema in Schemas.ts.

Current SAM behavior is to shoot a missile as soon as a nuke is in
range.
Players can exploit it by overshooting behind the SAM, so the SAM
missile will take way longer to reach the nuke, usually too late to
prevent its explosion.

This PR introduces a "smart" targeting system that allows SAM to
calculate an optimal interception tile along the nuke's trajectory. They
can also preshot before the nuke becomes vulnerable, as long as the
interception tile will be within the vulnerable window.

This change makes SAM range enforcement much more strict.

Changes:
- Nukes now precompute their full trajectory on creation and update
their current position index every tick.
- SAMs use this trajectory data and their own missile speed to calculate
the ideal interception tile.
- SAM missiles now aim directly at that interception point rather than
chasing the nuke.

Small changes on the fly:
- `BezierCurve` now uses a provided increment so the curve LUT is the
optimal size
- Increased nuke opacity when untargetable: 0.4 → 0.5
- Slightly extended nuke vulnerability range to SAMs: 120 → 150

===

Preshot an incoming nuke still in the unfocusable state. Notice how the
nuke is destroyed as soon as becomes focusable:

https://github.com/user-attachments/assets/9fbf1ae4-33b4-4fa0-9b53-cb53f3adc17b

Shooting right at the range limit:

https://github.com/user-attachments/assets/d68793ac-b249-45fe-88bf-e20f70758449

Shooting behind the SAM:

https://github.com/user-attachments/assets/800cd7ff-d9d9-40f3-aba8-fa3ab526b3b2

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I have read and accepted the CLA agreement (only required once).
regression is found:

IngloriousTom
@1brucben 1brucben merged commit 665fa40 into v0.2.0 Nov 14, 2025
5 of 7 checks passed
@El-Magico777 El-Magico777 added this to the v0.1.11 milestone Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants