Commit Graph

1357 Commits

Author SHA1 Message Date
Ilan Schemoul da50aa28d2 feat: more trade when there are few ports worldwide (#242) 2025-03-14 09:45:40 -07:00
Ilan Schemoul c4f612eb98 easier to take nuclear land if most of the land are nuclear (#241)
- **Revert "Change BorderTiles from Array to Set (#230)"**
- **easier to take nuclear land if most of the land are nuclear**
2025-03-13 17:05:22 -07:00
Ilan Schemoul b9dad022fc fix timer (#239)
- **improve and fix dynamic lobby**
- **Revert "Change BorderTiles from Array to Set (#230)"**

I'm obviously forced to include the revert patch otherwise I can't
compile. but you should first merge PR dedicated to revert before tthis
2025-03-13 17:03:38 -07:00
Ilan Schemoul 70c3c43a5f feat: handle embargo fake human (#240) 2025-03-13 14:53:27 -07:00
Ilan Schemoul 7ec3f0c81f Revert "Change BorderTiles from Array to Set (#230)" (#238)
This reverts commit 8124651382 which
breaks compilation, has wrong indentation and uses flatMap without
Array.from which is also wrong.
2025-03-13 14:51:35 -07:00
Ilan Schemoul cb3f36a74f fix: update dst port when ship captured (#217) 2025-03-13 06:31:41 -07:00
ByGoalZ 8124651382 Change BorderTiles from Array to Set (#230)
Changed border constant from Array to Set, to avoid potential
duplicates.
2025-03-13 06:05:10 -07:00
Ilan Schemoul a1d0c87232 remove Game starts when ... in lobby (#233) 2025-03-13 06:02:45 -07:00
APuddle210 67af4b06ab TerrainMapGenerator General Cleanup (#234)
> There were 4 separate implementations of getting neighboring
coordinates for a given x,y pair, 3 completely unique implementations.
These were found in neighbors(), processOcean(), processDistToLand(),
and getArea(), with processOcean() and processDistToLand() having
essentially identical implementations. Created new function
getNeighborCoords() with implementation closely resembling that found in
neighbors().

Revised aforementioned functions to utilize the new getNeighborCoords()
instead, with revised implementations being much more consistent across
the impacted functions.

> Revised getArea() to correctly assess the area, was previously likely
to overestimate the area as it included all coordinates it check
regardless of their terrainType. getArea() now also explicitely
implements the Coord[] interface, allowing for standardized
implementation syntax in all functions which call getArea().

Also removed the parameter targetType as all calls to getArea()
targetted the same TerrainType as was present at the passed x, y
position. getArea() will now assess targetType based on the passed x, y
values.

Reordered the parameters of getArea() so that it conformed with the
ordering used elsewhere in the script (x, y, map, visited). Updated all
calling locations accordingly.

> Revised processOcean() to make use of getArea() instead of using its
own reimplementation of area checking. This coupled with the use of the
new getNeighborCoords() significantly reduced the size of processOcean
and improved comprehensibility.

Also removed unnecessary check of waterBody.size that would always
return TRUE in that context.

> Removed checks against and setting of Terrain.ocean values in the
removeSmallIslands() and removeSmallLakes() functions as these functions
are called prior to processOcean() making the checking
redundant/unncessary, and the setting potentially problematic.

Revised Terrain class to default ocean to false, to address compiler
warning, and since processOcean() handles setting this property to true
explicitly.

Reduced total lines from 417 to 372.
2025-03-13 06:02:30 -07:00
Evan ad90f636b3 better check for profane username 2025-03-12 20:10:37 -07:00
Ilan Schemoul 07ad7912bc feat: timer starts if enough player or enough time (#229)
Avoid these huge lobbies
2025-03-12 14:18:34 -07:00
Ilan Schemoul cef8a61d9c fix: crash when spectating (#232)
Nuke icon patch added a crash when spectating game (myPlayer is NULL)
2025-03-12 14:17:11 -07:00
evanpelle 439f5af2bd PathFinder: return path not found when src or dst is null (#228) 2025-03-12 12:59:36 -07:00
evanpelle 8b5d402d96 fix nginx.conf (#226) 2025-03-12 12:29:08 -07:00
evanpelle ea628570b2 have nginx cache index for 1s. (#224)
This is required for A B deployments, the browser wasn't updating due to
conditional caches
2025-03-12 11:03:28 -07:00
evanpelle 920dafc425 update deployment: add alt deployment (#223) 2025-03-12 10:40:51 -07:00
evanpelle b1035a8e77 update to hetzner deployment (#220) 2025-03-12 09:17:27 -07:00
Ilan Schemoul 3ce5785d1e nuke icon (#207)
- **feat: white nuke icon next to name if player nukes you**
![Capture d'écran 2025-03-10
220439](https://github.com/user-attachments/assets/1b717b2d-bffb-45fc-96ea-2feb57d25de0)
- **feat: red nuke icon if player sends nuke towards you**
- 
![Capture d'écran 2025-03-10
220358](https://github.com/user-attachments/assets/b755fa06-9510-4bd1-8312-7180dc681d85)
2025-03-11 15:44:45 -07:00
Ilan Schemoul 5cf75c71a7 feat: closable modal when desynced (#214)
![Capture d'écran 2025-03-11
215857](https://github.com/user-attachments/assets/9aec98d9-dd3c-4a00-a257-aa0acb67633c)
2025-03-11 14:34:55 -07:00
Ilan Schemoul c4b8d6b92e cancel trade if port is captured (no trade inside same country) (#194)
If the port of destination and of source have same owner it means a
player captures port of another player, we cease all trade that happens
inside same country.
Also added a check in the canTrade code to be more reliable and correct
even outside of the specific case of capturing a port.
2025-03-11 12:33:45 -07:00
evanpelle 4c372b3877 fix build error importing image from extra, rename Extra=>extra (#212) 2025-03-11 08:33:58 -07:00
Evan 0597622a4a don't show ads on winlose menu 2025-03-10 19:46:51 -07:00
Ilan Schemoul 87d1a8d69d feat: retreat stops attack + show when ennemy retreats (#209) 2025-03-10 17:25:21 -07:00
Ilan Schemoul 04833caf4d fix: crash because wrong path (#210) 2025-03-10 17:24:56 -07:00
Ilan Schemoul 837d59d929 fix: translation broke numbers (#211) 2025-03-10 17:24:36 -07:00
evanpelle 9b71c8e78f use ticks instead of Date when retreating for determinism (#208) 2025-03-10 14:38:41 -07:00
Ilan Schemoul 4375797d92 feat: show a message when attack is canceled (with number of deaths) (#193) 2025-03-10 13:30:07 -07:00
PilkeySEK 9389005e39 Possibly fix the NaN bug (#200)
There's a bug that when using translators in your browser it shows
troops/gold/... as `NaN`, I couldn't get a translator to work to
confirm, but this should work
2025-03-10 13:29:36 -07:00
evanpelle 5aae1468c2 fix player glow during spawn phase (#206) 2025-03-10 13:27:45 -07:00
evanpelle 5dc00bc3ab use git commit hash verification when replaying archived games (#204) 2025-03-10 12:40:36 -07:00
evanpelle 6a24bce213 fix decompress game record function, start at -1 (#203) 2025-03-10 07:21:24 -07:00
evanpelle e2f18df426 use center eucl dist on spawn tiles, looks nicer (#202) 2025-03-10 06:37:43 -07:00
evanpelle 3ca4bb4dad switch to multistage docker build to fix docker build (#199) 2025-03-09 20:46:46 -07:00
evanpelle c23c332ccb only compare archived hash if not null/undefined (#198) 2025-03-09 19:30:32 -07:00
evanpelle 61cfe7102c update error modal to show game id (#197) 2025-03-09 19:16:57 -07:00
evanpelle 33292aec5c feat: replay archived games, gamestate hash verification (#195)
create endpoint to load archived game. when joining game client first
checks if the game is active, if not it requests the game archive from
the server. the archive is sent to LocalServer to replay the game
locally. Every 10 ticks a hash is stored on the archive, and during
replay the LocalServer verifies this hash.
2025-03-09 14:24:39 -07:00
Readixyee 84951fed9f Sam anti nuke missile launcher (#176)
now with better name

---------

Co-authored-by: evanpelle <evanpelle@gmail.com>
2025-03-09 13:25:51 -07:00
PilkeySEK fe9a73c967 Update wiki link to Miraheze (#190) 2025-03-09 13:25:36 -07:00
Tiger McSwane 219d732f84 Added Britannia map with 23 NPC as well as their flags (#186)
Let me know if you have any questions or concerns. This is my first time
near coding, so it would not hurt to double check my work. Thanks!
2025-03-08 16:58:04 -08:00
evanpelle 4281095666 update maps: remove small lakes as it breaks encirclement. More money… (#188)
… more frequent trade ships, lakes prevent encirclement, warships start
at full health
2025-03-08 16:45:23 -08:00
evanpelle de584329b8 remove ad background (#185) 2025-03-08 12:38:19 -08:00
evanpelle c99cec8f0b add South America map (#184) 2025-03-08 12:11:34 -08:00
evanpelle b77bc46a80 store lobby start time on first fetch for smoother countdown (#183) 2025-03-08 11:28:23 -08:00
evanpelle bfbb2ac011 update version to 0.19.0 (#182) 2025-03-08 11:05:20 -08:00
evanpelle 09132495c0 Revert "have MIRV target all non allied players, increase price to 25… (#181)
… million"

This reverts commit 226112beb5.
2025-03-08 10:58:46 -08:00
Maeght Loan e1ed8dbe36 Boat attack event (#177)
Allow user to focus on outgoing boats

Partial #133 


https://github.com/user-attachments/assets/0e287bf5-71bb-4def-a3ca-f0b652ed6d69
2025-03-08 10:44:27 -08:00
Ilan Schemoul afe4f85919 fix: warship icon (#178) 2025-03-08 10:27:16 -08:00
evanpelle 9037872298 Merge pull request #175 from PilkeySEK/mirv-typo
Fix minor typo in MIRVExecution
2025-03-08 09:39:03 -08:00
PilkeySEK 8fca3f6c3d Fix minor typo in MIRVExecution 2025-03-08 18:21:49 +01:00
evanpelle 37043ab479 Merge pull request #173 from ilan-schemoul/stats-records
feat: remove LocalPersistantStats so we locally save GameRecords
2025-03-08 09:19:57 -08:00