8 Commits

Author SHA1 Message Date
DevelopingTom 256ac3b1b8 SAM not working against MIRV warhead (#818)
## Description:

The nukes are setting a `detonationDst` that is never used in UnitImpl.

Without the target tile, SAM launchers ignore the MIRV warheads.

Illustration with 50 SAM vs 2 warhead:

![image](https://github.com/user-attachments/assets/cac20dc6-9a28-4801-a834-364fa36b612d)



The nuke icon is also staying white while being nuked:

![image](https://github.com/user-attachments/assets/badf6630-9a5e-4491-b1b7-1008d32f5efc)


## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

IngloriousTom
2025-05-22 23:47:06 -04:00
evanpelle 500b5fcfde Clean up and refactor the Unit class (#769)
## Description:

* Merged similar fields so they can be reused (eg warshipTarget =>
targetUnit)
* simplified isCooldown api
* added "touch" method to send update to UI layer
* standardized on "undefined"


## Please complete the following:

- [ ] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

<DISCORD USERNAME>
evan

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Refactor**
- Unified and simplified how unit targets and cooldowns are managed
across all unit types, resulting in more consistent in-game behavior for
nukes, warships, trade ships, and SAM launchers.
- Updated naming and logic for unit targeting and cooldowns, improving
clarity in status displays and interactions.
- Reorganized unit interface and streamlined cooldown handling for
smoother gameplay experience.
- **Bug Fixes**
- Corrected visual indicators for nukes and warships to accurately
reflect their targets.
- **Tests**
- Updated automated tests to align with the new cooldown and targeting
logic.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-17 17:45:10 -07:00
evanpelle 1d0732d3d9 Refactor UnitSpecific info => AllUnitParams type union (#701)
## Description:

By using a type union we get better type safety, enforcing each unit
type have the appropriate params when initializing

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:
evan

---------

Co-authored-by: evan <openfrontio@gmail.com>
2025-05-10 11:40:47 -07:00
Evan 9de072c0c6 fix failing SAM test 2025-04-18 14:26:19 -07:00
Evan 924ca2c69e bugfix: humans start with zero troops on teams, also removed manpower argument to addPlayer() 2025-04-04 10:03:00 -07:00
Evan 8b6895d745 add prettier import plugin 2025-03-31 13:09:27 -07:00
Readixyee 0891637eb2 MissileSilo cooldown (#309)
changed the sam cooldown to be a general cooldown function and added a
missilesilo cooldown

The function either adds the current tick as the starting point of the
cooldown or sets the cooldown to null and updates the unit. That way
getcooldown function can be used to get back the tick the cooldown was
started and can be compared to the cooldown set in the config.

changed the sam test / added a missilesilo test

---------

Co-authored-by: evanpelle <evanpelle@gmail.com>
2025-03-29 15:19:07 -07:00
Ilan Schemoul 68621f326a sam do not target twice same nuke (#270) 2025-03-21 10:17:33 -07:00