Commit Graph

372 Commits

Author SHA1 Message Date
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 9d1b4f35e4 bugfix: SpawnExecution was not attaching PlayerExecution to humans
bugfix: WinModal was saying player died even if they hadn't spawned

added hasSpawned() method to player
2025-04-03 20:12:36 -07:00
Evan 9fa3691c5c bugfix: SpawnExecution couldn't find existing player because Game.Players() only returns alive players. This caused SpawnExecution to respawn each human player. 2025-04-03 19:31:42 -07:00
Scott Anderson 10c411b1ee bug: lastEmojiSet is never used (#406)
## Description:

In the existing code, lastEmojiSent can only ever be set if it is
already set, causing it to never be used. This change updates the logic
to work as intended.

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

fake.neo

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-04-03 16:12:07 -07:00
Quentin Siruguet 8de3a5f106 Add notifications for troops attacking wilderness (#363)
+Retreat cost no soldiers when coming back from wilderness
+ Also work with contamined area


![image](https://github.com/user-attachments/assets/6dda168c-aade-4ba5-ac2a-6de028fbaf6d)

![image](https://github.com/user-attachments/assets/89966516-e86d-4d06-8b32-3bf36179eea1)


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

quentin.qsi
2025-04-02 08:37:58 -07:00
Evan 8b6895d745 add prettier import plugin 2025-03-31 13:09:27 -07:00
Ilan Schemoul 11791719e4 nukes now reduce attacking troops and transport ships (same as rest of pop) (#350)
Co-authored-by: Evan <evanpelle@gmail.com>
2025-03-31 12:39:18 -07:00
Aotumuri 745017aee2 Added Gold & Troop donate button (#373)
## 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

Changed the icon for the troop donation button, as it looked like it was
donating gold.
I replaced it with a soldier icon to better reflect its function.
Additionally, I updated the icon below it to clearly represent gold
donation instead.

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

The cat is because of an extension I have put in. Please ignore it.
<img width="345" alt="スクリーンショット 2025-03-30 10 13 06"
src="https://github.com/user-attachments/assets/9088be1a-57b4-4d10-9507-ca8dc0fcc68c"
/>
<img width="396" alt="スクリーンショット 2025-03-30 10 18 10"
src="https://github.com/user-attachments/assets/2555fd24-0bbc-4b40-8f80-ccf43a1e9a75"
/>

---------

Co-authored-by: Evan <evanpelle@gmail.com>
2025-03-31 10:51:05 -07:00
evanpelle ab3f4fbac1 All players must join game before spawn (#380)
## Description:
The server stores all players that have joined, and once the game starts
it sends a list of players to all clients. Players cannot join after the
game has started. Server now generated the PlayerID instead of the
client.

The is necessary for team mode, we need to know how who is playing the
game before it starts so we can properly assign teams based on clans.

## 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
2025-03-30 17:04:29 -07:00
PilkeySEK d6e596f7d8 fix: Make bots not attack teammates (#368)
Bug report:
https://discord.com/channels/1284581928254701718/1355194642592694412
## 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:
PilkeySEK
2025-03-30 10:43:24 -07:00
Ilan Schemoul 80ece56268 fix crash (#371) 2025-03-30 10:42:31 -07:00
PilkeySEK d59a3bb623 fix: Make bot team not able to win (#375)
## 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:
PilkeySEK

Bot team has over 80% of the map:

![image](https://github.com/user-attachments/assets/a3f3e18b-e23e-4645-89a6-fd876ec73ff7)
How it was before (the bug):

![image](https://github.com/user-attachments/assets/ff872d2d-a9a9-4f3f-96ff-3153d3bff333)
2025-03-30 09:13:41 -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 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
PilkeySEK 9434d82d78 Add gold for encircling someone + display message (#369)
## 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:
PilkeySEK
2025-03-29 13:56:17 -07:00
Evan 8dd5f654ff Attacks don't create embargos against bots because they can't trade anyways 2025-03-28 14:02:29 -07:00
evanpelle d8fe41de7a teams (#349) 2025-03-27 20:43:56 -07:00
Evan 9ed1fe865c bugfix: ports not spawning on coastline 2025-03-27 19:08:46 -07:00
Ilan Schemoul 60be8b236a fix compilation (#359)
## Please complete the following:
just a compilation bug fix. npm run dev is how i test

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

respectful pinguin
2025-03-27 17:34:30 -07:00
Ilan Schemoul 6834f0683f embargo if attacked (#353)
## Responsibility Acknowledgment

- [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 basic manual testing:
  - Significantly slows down the entire development process
  - Blocks releases and new features for all contributors
  - Harms the project's reliability and reputation
- Places additional debugging burden on maintainers who already have
limited time
- Diverts valuable resources away from new development and improvements
  - Makes me seen as a loser
  - Makes me more likely to go to hell
2025-03-27 16:39:37 -07:00
Ilan Schemoul f2193edc7c priortize ally ports and close ports (#335)
2x more likely to trade with ports belonging to an ally OR close.
3x more likely to trade with ports belonging to an ally AND close.
Add trading tests
2025-03-27 16:09:58 -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
Readixyee 6b07446965 unitgrid instead of defensepostgrid (#265)
added a unitgrid instead of a defensepostgrid for all units to be able
to see if a tile is inside the range of a unit by a custom distance

this is used for the sam launcher to draw a circle around the area it
protects

removed all parts that use the defensepostgrid and made it use the
unitgrid instead
2025-03-26 10:00:37 -07:00
Readixyee e02361c2f4 Disable nukes option (#237)
This makes it possible to disable all nukes as well as missile silos
from the game in privat lobbies and singleplayer games
2025-03-21 13:52:36 -07:00
Ilan Schemoul 68621f326a sam do not target twice same nuke (#270) 2025-03-21 10:17:33 -07:00
Ilan Schemoul 26bfb84b7b SAM rebalance (circle radius, faster speed, smaller range) (#266)
see commit
2025-03-18 20:37:49 -07:00
Ilan Schemoul 24f25d677a sam is red when reloading (#268) 2025-03-18 14:16:02 -07:00
Ilan Schemoul 6ad4ac86f4 feat: when player has no port warship do not capture trade or heal anymore (#280) 2025-03-18 12:07:51 -07:00
Evan c4381a9ad3 encirclement bug: ensure player is inscribed before losing territory 2025-03-16 20:39:20 -07:00
Ilan Schemoul 46889077f0 sam can't touch mirv (only mirv warhead) (#259) 2025-03-15 19:32:45 -07:00
Ilan Schemoul b2d9bb670a nerf SAM (#258)
More costly (start at 1.5M), increase cost cap (4.5M), biggest timeout
(5s->10s), much lower chance to stop hydrogen (70%->10%), triple
construction time (10s->30s) otherwise it's trivial to build a SAM right
before a nuke hits
2025-03-15 18:22:14 -07:00
Ilan Schemoul 275de50fcd feat: move warship (#196) 2025-03-14 16:30:30 -07:00
Ilan Schemoul da50aa28d2 feat: more trade when there are few ports worldwide (#242) 2025-03-14 09:45:40 -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 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 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
Ilan Schemoul 87d1a8d69d feat: retreat stops attack + show when ennemy retreats (#209) 2025-03-10 17:25:21 -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
evanpelle e2f18df426 use center eucl dist on spawn tiles, looks nicer (#202) 2025-03-10 06:37:43 -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
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 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
Ilan Schemoul afe4f85919 fix: warship icon (#178) 2025-03-08 10:27:16 -08:00
PilkeySEK 8fca3f6c3d Fix minor typo in MIRVExecution 2025-03-08 18:21:49 +01:00
ilan schemoul 1b76c46bc5 feat: remove LocalPersistantStats so we locally save GameRecords
GameRecords also now include PlayerStats
2025-03-08 17:39:41 +01:00
Evan 3dd02ec4df remove max boat distance 2025-03-07 10:38:26 -08:00