Commit Graph

28 Commits

Author SHA1 Message Date
Kipstz Avenger 86a329f7cb Add random shell damage (#1665)
Closes #555 

## Description:

Added random damage for warship shells and defence posts.
Damage mapping: roll 1-5 → 200, 225, 250, 275, 300 damage respectively.

## Please complete the following:

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

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

kipstzz
2025-08-02 22:08:17 +00:00
g-santos-m 31381f67f4 Enable @typescript eslint/prefer nullish coalescing eslint rule (#1420)
## Description:

Fixes #952 
Enabled @typescript-eslint/prefer-nullish-coalescing rule and worked
through every error, introducing ?? and ??= operators or disabling
errors with inline comments where appropriate, to the best of my
ability.

## Please complete the following:

- [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 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:

g_santos_m
2025-07-15 03:00:06 +00:00
DevelopingTom e8834e15e6 Add naval combat animations (#858)
## Description:


https://github.com/user-attachments/assets/b46f949a-eb50-4656-8492-216cf820ac46

Add a couple animations for naval combat:

- shell hit
- ship explosion
- ship sinking

Added a simple `Timeline` class to spread FX animations over time.
Added a `ColoredAnimatedSprite` similar to the existing `ColoredSprite`.
Refactored the latter to avoid code duplication.

## 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-26 19:59:11 -04:00
Scott Anderson 5aa8356513 Record player stats during the game (#784)
## Description:

Record player stats for the analytics worker to import in to to
postgres. This changes defines a new Analytics schema version, `v0.0.2`,
containing additional metadata about each player.

## 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
2025-05-21 00:10:29 -04:00
Scott Anderson 70745faac4 Enable strictNullChecks, eqeqeq (#436)
## Description:

Improve type safety and runtime correctness by:
1. Enabling TypeScript's
[strictNullChecks](https://www.typescriptlang.org/tsconfig/#strictNullChecks)
compiler option.
2. Replacing all loose equality operators (`==` and `!=`) with strict
equality operators (`===` and `!==`).
3. Cleaning up of type declarations, null handling logic, and equality
expressions throughout the project.

Currently, the code allows implicit assumptions that `null` and
`undefined` are interchangeable, and relies on type-coercing equality
checks that can introduce subtle bugs. These practices make it difficult
to reason about when values may be absent and hinder the effectiveness
of static analysis.

Migrating to strict null checks and enforcing strict equality
comparisons will clarify intent, reduce bugs, and make the codebase
safer and easier to maintain.

Fixes #466 

## 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

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
Co-authored-by: evanpelle <openfrontio@gmail.com>
2025-05-15 16:39:40 -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 1f890396ab update ShellExecution to use AirPathFinder 2025-04-23 17:22:37 -07:00
evanpelle 84287b8dfa Multi src astar (#594)
## Description:
Samples border shore tiles and uses multi-a* for determining the
transport ship spawn cell.

## 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:

<DISCORD USERNAME>
evan

---------

Co-authored-by: evan <openfrontio@gmail.com>
2025-04-23 10:16:43 -07:00
APuddle210 f713254081 Address-River-Criticisms (#536)
## Description:

Please see description on: #535 

fixes #535 

## 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:

aPuddle

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-04-18 18:05:27 -07:00
Evan 8b6895d745 add prettier import plugin 2025-03-31 13:09:27 -07:00
Ilan Schemoul 849d612314 increase shell lifetime to 1s after death of target (#354)
TITLE IS WRONG I meant 2s not 1s

Problem: two warship fight each other, if one back off he won't be hit
by the ennemy at all. he'll kill other warship, then all shells
dissapear so 0% damage are received. It's OP and unfair.
Solution: make warship's shells last 2s after its death so even if one
warship backs off he'll eventually receive some damages. 2s is enough to
get between 250-750 HP loss

---------

Co-authored-by: evanpelle <evanpelle@gmail.com>
2025-03-29 14:10:31 -07:00
Readixyee 665a8c3823 Executions dont switch owner (#326)
when an building is taken over by another player the execution for it
doesnt change its owner this makes it so when a sam is captured it tries
to intercept your own nukes and doesnt intercept the ones by the
previous player

this change makes executions of buildings automaticly switch their owner
2025-03-27 16:03:15 -07:00
Evan 4ee37323f9 format codebase with prettier 2025-02-01 12:05:11 -08:00
evanpelle 75fe718f16 Combine Unit & MutableUnit 2025-02-01 12:05:11 -08:00
evanpelle de1dbff570 combine Game & MutableGame 2025-02-01 12:05:11 -08:00
evanpelle 7d15c0c065 combine Player & MutablePlayer interfaces 2025-02-01 12:05:11 -08:00
Evan f0f5bae79f thread_split: convert all tile to tileref 2025-02-01 12:05:11 -08:00
evanpelle b22532d41f use TileRef instead of TerrainTile for astar 2025-02-01 12:05:11 -08:00
Evan c9c10ccfa8 shell does not attack friendly units 2024-12-27 10:02:00 -08:00
Evan 5307285d8b give Battleships & Destroyers health, make shells more frequent & larger 2024-12-20 20:31:41 -08:00
evanpelle ff02d9d8b6 have core/ directory use consolex for remote logging 2024-12-18 12:00:00 -08:00
Evan 2816ba1807 don't alert on delete trade ship or shell 2024-12-12 21:12:29 -08:00
Evan 1a9170d10b fix shellexecution deleting already inactive unit 2024-12-10 20:28:39 -08:00
evanpelle e6fa108eaa use mini a star for all pathfinding 2024-12-03 15:06:55 -08:00
evanpelle 4edd66dc1f AStar returns cell instead of path 2024-12-03 14:35:09 -08:00
Evan 020d193667 create async path finder, trade ships use async when captured 2024-11-29 15:41:13 -08:00
Evan 3e4f4e42cf created path finding web worker 2024-11-29 11:34:03 -08:00
Evan 8abc5e4aed implement battleship 2024-11-26 10:15:54 -08:00