2553 Commits

Author SHA1 Message Date
evanpelle 349e7acb61 bugfix: have Privilege support flags v0.26.4 2025-10-14 20:07:05 -07:00
evanpelle eea8db7a06 delete warship when player is afk 2025-10-14 19:51:58 -07:00
evanpelle 9ab35a0436 bugfix: don't use bigint for zod schema as it causes json parsing issues v0.26.3 2025-10-14 19:05:53 -07:00
evanpelle 5579fcf91b update win_modal territory pattern to say go ad free v0.26.2 2025-10-14 18:01:16 -07:00
Evan 090b0756b7 Allow donation in team games. (#2198)
## Description:

Was a bug disabling donation in public team games.

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

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

evan
v0.26.1
2025-10-14 16:10:32 -07:00
Evan bce27f1a6b don't show ads if skin has been purchased, fixed ads not getting removed sometimes (#2196)
## Description:

Now checks if player has any "pattern" flares and does not show ads.
Also set visible=false when hiding ads, sometimes the ads were not
getting destroyed properly.

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

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

evan
v0.26.0
2025-10-14 13:55:30 -07:00
evanpelle 810b12b7ff Merge branch 'v25' into v26 2025-10-14 12:02:44 -07:00
VariableVince 69fc14f1fd Fix user having to click 3-4x times before building is deleted (#2195)
## Description:

There is a 5 second cooldown between building deletions (as was proposed
here:
https://github.com/openfrontio/OpenFrontIO/pull/1609#issuecomment-3146188728).

But this cooldown is only checked when in DeleteUnitExecution from
canDeleteUnit in PlayerImpl.
The delete button in RadialMenuElements always gets True back from
canDeleteUnit in GameView.

This results in a user seeing an enabled Delete button after just
deleting another building. And being able to click it, but no deletion
would happen. So they have to click 3-4 times before it 'works'.

Fix: also apply the 5s cooldown when deciding to disable the button. 

In the fix in canDeleteUnit in GameView, added +1 to the current game
tick. So the Delete button is enabled 1 tick before DeleteUnitExecution
would get True back from canDeleteUnit in PlayerImpl. Between seeing and
clicking the button is probably 1 tick anyway, and sometimes also after
clicking it and the execution it takes another tick so this is safe.
Also tested the other way around: after deletion the button should
immediately not be visible, while it can take 2 ticks before GameView
gets lastDeleteUnitTick back from PlayerImpl. But since the Radial menu
is closed after clicking the button, i couldn't open it fast enough
again to still see the button enabled (ie. it was always already neatly
disabled). And if someone with an auto-clicker were to be able to click
it still, their attempt would still be blocked by the cooldown check in
DeleteUnitExecution.

BEFORE:

https://github.com/user-attachments/assets/17242c39-982e-47c6-89f2-6fe22a296c7d

AFTER:

https://github.com/user-attachments/assets/dfe20111-3313-4ad2-95a9-0152c0270c08

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

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

tryout33

---------

Co-authored-by: evanpelle <evanpelle@gmail.com>
v0.26.0-beta4
2025-10-14 11:18:50 -07:00
VariableVince 2f67c45a17 Cleanup redundant code win tad performance back (#2194)
## Description:

Cleanup code & small perf improvement

Gave it v26 milestone because it gives a little perf bump at no cost,
all the removed code isn't used anywhere so can be safely deleted.
Triple checked.

- Remove 'setFocusedPlayer' and 'checkTileUnderCursor' (not to be
confused by still in use 'getTileUnderCursor') from ClientGameRunner,
'_focusedPlayer' and 'setFocusedPlayer' (not to be confused with
still-in-use 'focusedPlayer') from GameView, and 'setFocusedPlayer' from
TransformHander.
These are remnants of PR #304, the first one that added highlighting
territory. The remants are still ran for every mouse-move, costing some
performance for no reason. _focusedPlayer is never used anywhere
anymore, only calculated and set.

It was later adapted from #387. But ultimately almost completely
disabled because it was too performance-costly, from commits 15c2cc1 and
then ec895af.

The thing that remained was permanent highlight of the player's own
border. For that, function 'focusedPlayer' in GameView is still used by
'drawFocusedPlayerHighlight' in TerritoryLayer. But it simply returns
myPlayer instead of the obsolete _focusedPlayer that it returned
earlier. Function 'focusedPlayer' still had the annotation "// TODO:
renable when performance issues are fixed." which i removed. Because
another PR for highlighting other's territory already followed it up
with its own functions, so chances of needing to change 'focusedPlayer'
back are very slim.

Later PR #1320 introduced a new attempt for highlighting territory in
the alternate view. It used its own equivalent functions in
TerritoryLayer for MouseOver and updateHighlightedTerritory (the latter
being the equivalent of the old checkTileUnderCursor in
ClientGameRunner). That was also disabled in part due to perfomance
cost, and now only shows border color changes. All this to say: the
remnants of PR 320 and 387 have long been redundant.

- Main: removed uncommented chatModal code, which was never used and
leftover from tests during development probably.

- PlayerActionHandler: removed handleQuickChat and the
sendQuickChatEvent import it needed. It was added in PR Multi-level
radial menu #1018. But the new Radial menu in the meantime moved to
using ChatIntegration.ts to send the chat event, or from there opened
the original Chat Modal which then sent the chat event. Later on, chat
was even removed from the Radial menu. 'handleQuickChat' is used nowhere
anymore and isn't needed. This is maybe also the case for
ChatIntegration, but i didn't remove it because it may still be enabled
again in the future for UI changes or something.

- OptionsMenu: removed, also from index.html (options-menu). This menu
has been succeeded by GameRightSidebar (game-right-sidebar for
index.html) for awhile now.

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

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

tryout33
2025-10-14 11:12:37 -07:00
Michal Martínek 522413678a Enabled the @typescript-eslint/no-unused-expressions eslint rule (#2014)
## Description:

- Fixes #1790
- Fixed the codebase:
- expressions short-circuiting with `&&` changed to proper `if`
statements
  - `A instanceof B;` expressions now emit warnings

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

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

---------

Co-authored-by: Evan <evanpelle@gmail.com>
2025-10-14 11:10:52 -07:00
Evan b58d140f94 fix encirclement issues (#2191)
## Description:

Players with no ongoing attacks were ignored during cluster calculations
in
https://github.com/openfrontio/OpenFrontIO/commit/3680d9cc1663a22f0e174d2c2de806c0ee78b923

This PR has it fallback to neighbor with largest border if no ongoing
attacks

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

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

evan
v0.26-beta4
2025-10-13 19:54:05 -07:00
evanpelle f016c3ee9d don't show ads if in iframe v0.25.23 2025-10-13 19:03:16 -07:00
Evan d55c145298 publift homepage ads (#2160)
## Description:

Put ads on the left and right gutters

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

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

evan
v0.25.22
2025-10-13 17:32:28 -07:00
evanpelle 136cfa1316 improve nation ai (#2172)
## Description:

1. Create forceSendAttack function so nations expand faster at the start
(their reserve troop ratio was too low, causing them to skip the first
attack
2. modify the perceived cost modifier to reduce the number of defense
posts built.
3. Updated how random land is selected to avoid player.tiles() since
that can be millions of entries.
4. Improve performance of valueFunction by using closestTile and
reducing the number of tiles checked.
5. Nations now launch hydros if they have enough gold.
6. used boundBox instead of bfs because doing a large bfs for h-bombs
can get expensive.
7. Modified perceived multiplayer to remove cap and scale super-linearly
to discourage nations from spamming too many building. Instead they are
more likely to spend that money on nukes.

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

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

evan
v0.26.0-beta3
2025-10-11 19:35:11 -07:00
VariableVince 730d492475 Fix owned % in Teams stats (#2176)
## Description:

In Teams games, the Leaderboard for individual players shows a different
Owned % than the Team stats next to it. This is because Leaderboard
correctly takes fallout/nuked territory into account (lines 99 and 113).
But Team stats doesn't.

It's only visual because the win condition for 95% of the land is also
already calculated correctly in WinCheckCondition (lines 78-80).

There is still a difference where Leaderbord uses toFixed(1) and
TeamStats does toPrecision(2). Didn't touch that because i don't know
the reason for it.

BEFORE:
<img width="699" height="206" alt="Team stats owned not taking fallout
into consideration"
src="https://github.com/user-attachments/assets/3bd03671-e32a-4c7a-b097-cfd8201c4299"
/>

AFTER:
<img width="892" height="453" alt="image"
src="https://github.com/user-attachments/assets/10c3eae8-8292-404f-83d5-820d10279367"
/>

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

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

tryout33
2025-10-11 13:40:07 -07:00
Vivacious Box 843aa11c84 Fix the ghost unit turning green when hovering an ennemy structure (#2175)
## Description:

Fix the ghost unit turning green when hovering an ennemy structure

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

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

DISCORD_USERNAME
2025-10-11 10:05:23 -07:00
evanpelle b9a4add1ca Revert "Added trackpad support for moving maps (#1717)"
This reverts commit 8746df69fd.
2025-10-10 17:54:29 -07:00
evanpelle d59b73d6b9 Revert "Fix: Rework wheel and touch handling for pan and zoom (#1956)"
This reverts commit 584acea7ed.
2025-10-10 17:54:13 -07:00
Angel Uriot fa6e4fce00 Remove confusing characters from game IDs (#2171)
## Description:

I have often encountered the problem of characters that look alike when
typing a private game code, mainly `l` / `I`, and `O` / `0`.

In this PR, I therefore propose removing these 4 characters from ID
generation.

The number of possible combinations goes from $$2.2\times10^{14}$$ to
$$1.3\times10^{14}$$, which is still the same order of magnitude.

## Please complete the following:

- [ ] ~~I have added screenshots for all UI updates~~
- [ ] ~~I process any text displayed to the user through translateText()
and I've added it to the en.json file~~
- [ ] ~~I have added relevant tests to the test directory~~
- [ ] ~~I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced~~

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

`@dimension`
2025-10-10 11:14:04 -07:00
Loymdayddaud c9c29308d7 update stale action (#2168)
## Description:

Updates the stale action to:

1. Do nothing with issues, since issues should generally not stale
2. Close PRs and add the Orphaned label to them, along with a comment
about being unmaintained
3. Add a "will not stale" label for PRs we don't want to be closed
4. Removes the start-date because there's really no reason for it

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

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

loymdayddaud
2025-10-09 22:07:23 -07:00
evanpelle 584fa9fb5d add support for custom colors (#2103)
## Description:

Added a colors tab in territory patterns modal so players can select
their color.

Refactored the PrivilegeChecker, removed custom flag checks since we no
longer support custom flags.

<img width="479" height="345" alt="Screenshot 2025-09-27 at 5 01 17 PM"
src="https://github.com/user-attachments/assets/ad96da65-f0eb-4731-a861-e6e5fcb4566a"
/>
## 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

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

evan
2025-10-09 20:47:20 -07:00
evanpelle 2521466191 Merge branch 'v25' 2025-10-09 19:54:35 -07:00
DevelopingTom 4f73548a4e Use larger responsive classes (#2167)
## Description:

Issue:
With low resolution screens, or simply by resizing the window, the build
menu can be drawn above the event logs:
<img width="513" height="180" alt="image"
src="https://github.com/user-attachments/assets/01c62002-467d-47c0-b3a1-b46446d4dbc9"
/>

Changes:
- use larger responsive Tailwind classes:


https://github.com/user-attachments/assets/e583b70e-235a-4f5b-b10d-d032ac621984


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

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

IngloriousTom

Co-authored-by: evanpelle <evanpelle@gmail.com>
2025-10-09 19:26:53 -07:00
Jeff 649e4d2ed7 fix(PlayerExecution): remove alarming DefensePost destruction messages on capture (#2163)
## Description:

Patches issue flagged from
https://github.com/openfrontio/OpenFrontIO/pull/1957#issuecomment-3386398998.

Right now for every single defense post capture, attackers receive two
messages:
- "Your Defense Post was destroyed" and "Captured Defense Post from ..."

By downgrading before captures, behavior will now be:
- defender receives "Your Defense Post was destroyed"
- attacker receives no message unless capturing a lv2+ defense post
(downgraded to lv 1), in which case they receive "Captured Defense Post
from ..."

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

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

`seekerreturns`

---------

Co-authored-by: evanpelle <evanpelle@gmail.com>
2025-10-10 02:21:05 +00:00
evanpelle cc49dc986e reduce coverage threshold 2025-10-09 18:12:10 -07:00
Vivacious Box a8002a038c Transparent railroads (#2153)
## Description:

Make the railroads fade before disappearing

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

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

Mr. Box
2025-10-09 15:31:22 -07:00
DevelopingTom fc38fed972 Fix target FX on retreating units (#2166)
## Description:

Retreating naval invasions spams the target FX each frames.
Changes: filter out retreating invasions.

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

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

IngloriousTom
2025-10-09 14:44:17 -07:00
Abdallah Bahrawi 0076996dce Implement send resources modal (#2146)
## Description:
Fixes https://github.com/openfrontio/OpenFrontIO/issues/2015
Implemented a new interactive modal component for sending troops/gold
between players, replacing the previous automatic troop donation system.

Screenshots
<img width="388" height="569" alt="s1"
src="https://github.com/user-attachments/assets/b5b5cfce-972e-474c-848a-4ea0dc7dde8f"
/>

<img width="383" height="534" alt="s2"
src="https://github.com/user-attachments/assets/4c467fa2-7631-4e7b-ab17-898778b08ea6"
/>

<img width="377" height="548" alt="s3"
src="https://github.com/user-attachments/assets/9359ee06-18af-48ea-a47c-586198e26f57"
/>

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

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

abodcraft1

---------

Co-authored-by: evanpelle <evanpelle@gmail.com>
2025-10-09 13:19:05 -07:00
Loymdayddaud d070c5810c Increase the frequency of teams games (#1809)
## Description:

Updates the frequency of teams games to fix #1808.

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

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

loymdayddaud

Co-authored-by: TheGiraffe3 <TheGiraffe3@users.noreply.github.com>
2025-10-09 19:56:51 +00:00
Britton Fischer 3680d9cc16 fix: allies cannot annex your clusters (#2158)
## Description:

Fixes #1685
Continuation from #1924, which was auto-closed after the upstream repo
force-pushed main and I synced my fork.

This change ensures that allies are excluded from the `getMode()` call
made by `getCapturingPlayer()` inside `removeCluster()`.

- Previously, friendly neighbors were treated as candidates for
capturing, leading to incorrect annexations in certain edge cases.
- Added a small efficiency improvement by filtering out non-player and
friendly neighbors up front to reduce total computations down-the-line.
- Important: we can’t simply check if the `getMode(neighborsIDs)` result
is a friendly. Doing so would cause the territory to go to nobody until
the user is attacked. I believe the expected behavior is the largest
neighboring enemy should take it automatically.

Here's an example of the new behavior in an extreme edge case:
<img width="622" height="422" alt="Screenshot 2025-08-24 at 4 56 46 PM"
src="https://github.com/user-attachments/assets/c5dd9c0d-0a3c-4657-8154-e114fa920689"
/>

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

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

nottirb
2025-10-08 18:28:26 -07:00
Jeff 187ef1f2dd feat(PlayerExecution): downgrade defense posts on capture (#1957)
## Description:

Closes https://github.com/openfrontio/OpenFrontIO/issues/1619.

On capture, defense posts will be downgraded.

On the live version this means defense posts will be destroyed, as
defense posts can only be level 1.

Misc. changes:
- added `decreaserLevel` helper
- cleaned up if/else in tick unit loop for clarity to avoid yet another
nested layer

Continuation of the stale PR,
https://github.com/openfrontio/OpenFrontIO/pull/1622.

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

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

Discord username: `seekerreturns`
2025-10-08 17:31:56 -07:00
evanpelle e895e53a1e fix spawn highlighting bug & improve highlight ring (#2157)
## Description:

The PR that added a highlight ring, broke highlights for other player
spawns. This PR fixes that, and makes the highlight ring more visible.

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

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

evan
2025-10-08 16:40:53 -07:00
Vivacious Box 020b0de875 Fix forgotten mirv cursor (#2156)
## Description:

Forgot to show cross cursor for mirv

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

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

Mr.Box
2025-10-08 16:40:39 -07:00
Aotumuri 4d3e358fbc mls (v4.7) (#2152)
## Description:

mls for v26
Version identifier within MLS: v4.7

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

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

aotumuri

Co-authored-by: evanpelle <evanpelle@gmail.com>
2025-10-08 13:58:36 -07:00
Vivacious Box f6839ffe99 Fix icons and add mirv to build bar (#2154)
## Description:

Fix blurry icons and add mirv to build bar
<img width="792" height="101" alt="image"
src="https://github.com/user-attachments/assets/a46c4724-c99b-4541-b56b-92ec662c8ec5"
/>

<img width="176" height="275" alt="image"
src="https://github.com/user-attachments/assets/dbcd2ed4-0f21-4065-9a52-9b16e9043270"
/>


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

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

DISCORD_USERNAME
2025-10-08 13:49:54 -07:00
evanpelle 1bc0343829 Merge branch 'evan-nations' 2025-10-07 19:01:35 -07:00
FloPinguin af50e5e9c8 "Spectate" instead of "Keep playing" after loss (#2150)
## Description:

Fixes #2149

Losing a game now causes the "Keep playing" button to say "Spectate"
instead.

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

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

FloPinguin
2025-10-07 18:10:00 -07:00
evanpelle 0f79060f58 add openfront copyright to loading screen (#2151)
## Description:

This will make the copyright notice more clear.


<img width="369" height="242" alt="Screenshot 2025-10-07 at 6 03 44 PM"
src="https://github.com/user-attachments/assets/53925a24-bf1a-437e-84c1-3d146d598bfd"
/>

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

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

evan
2025-10-07 18:06:16 -07:00
Abdallah Bahrawi b03f9778db Fix nations break alliance too ealry bug (#2123)
Betrayal was being considered too early (inside shouldAttack), causing
alliances to break before calling attackChance.

- [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
regression is found:

abodcraft1
2025-10-07 16:04:00 -07:00
evanpelle d42fd9b5fc reduce global coverage 2025-10-07 15:20:39 -07:00
Scott Anderson e216b8a22b cleanup: Nations rarely launch nukes (#1948)
## Description:

In #1860, some unused code was left behind. Remove the unused code.

## 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
2025-10-06 15:37:04 -07:00
Scott Anderson d83a66196a bugfix: Nations rarely launch nukes (#1860)
## Description:

Simplify nation enemy selection to make nations more likely to launch
nukes.

Partially fixes #1855 by addressing a v24 regression in nation behavior.

## 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
2025-10-06 15:37:04 -07:00
Scott Anderson 8308d7f1e7 Nations send emoji when declining assistance requests (#1911)
## Description:

Nations will now send emoji when declining assistance requests.

## 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
2025-10-06 15:37:04 -07:00
Scott Anderson 81bd98c8d6 Nations send emoji when declining assistance requests (#1911)
Nations will now send emoji when declining assistance requests.

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

Cancel alliance requests if the recipient attacks (#1733)

Problem: attacking a player right before accepting an alliance request
is very effective since the requester can't fight back or reclaim his
territory without canceling the alliance and being penalized with the
traitor debuff.

Change:
- Attacking a player after he requested an alliance automatically
rejects the request
- No changes to existing attacks in both directions, only new attacks
affect the request

- [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
2025-10-06 15:37:00 -07:00
Scott Anderson f0f9318852 Nations build defense posts (#1935)
## Description:

Nations build defense posts. Fixes #1854.

<img width="259" height="383" alt="image"
src="https://github.com/user-attachments/assets/aee75fd3-f52e-47d8-b47f-b192b8aaa69b"
/>

## 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
2025-10-06 14:40:46 -07:00
Scott Anderson 47edfe3e40 Nations build SAM launchers (#1931)
## Description:

Fixes #201 by adding the ability for nations to build SAM launchers.

<img width="888" height="625" alt="image"
src="https://github.com/user-attachments/assets/b07f1b4e-d022-4674-b842-bc8b4247825d"
/>

## 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
2025-10-06 14:40:08 -07:00
Scott Anderson c7f7fb0ee4 Refactor structureSpawnTileValue() (#1927)
## Description:

Move `structureSpawnTileValue()` into its own file, as
`FakeHumanExecution.ts` was getting quite large.

## 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
2025-10-06 14:36:22 -07:00
evanpelle 469a14d62a Allow attacking allies or teammates if player is disconnected (#2144)
## Description:

This will allow players to conquer land from afk teammates in team
games.

No troop loss if attacking afk teammate.

Also remove the team check in attack execution because we already do an
isFriendly check.

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

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

evan
2025-10-06 14:25:46 -07:00
Tiago Santos Da Silva fa7b7fceb3 Enable the @typescript-eslint/no-unused-vars eslint rule (#2130)
## Description:

###  Summary of Changes

This PR enables the ESLint rule **`@typescript-eslint/no-unused-vars`**
as requested in the issue and applies the necessary code adjustments
across the project.

#### 🔧 What was done:
- Activated the rule `@typescript-eslint/no-unused-vars` in the ESLint
config.
- Updated ~70 files to comply with the rule:
  - Replaced unused variables with a `_` prefix where appropriate.
- Added inline ESLint disable comments (`eslint-disable-next-line`) for
specific cases where the variable or code block seemed important for
context, readability, or future use.
- Ensured no linting errors remain related to this rule.

---

###  Clarification

Some cases were handled with inline disable comments instead of removing
the variable entirely, to avoid accidental breaking changes or loss of
intent.
If a different approach is preferred (e.g., stricter removal or
alternative handling), I’m happy to adjust the implementation
accordingly — just let me know!

---

### 🙌 Next Steps

Please review and let me know if:
- Any file should be handled differently.
- You prefer removal instead of disabling in certain areas.
- Additional rules should be enforced or reverted.

I’m available to make any follow-up improvements needed.

---

### 🎃 Hacktoberfest Note

I'm participating in **Hacktoberfest**, so if this PR is accepted,
please add the label:

`hacktoberfest-accepted`

Thank you!

#1784 

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

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

DISCORD_USERNAME
2025-10-06 13:26:43 -07:00
Abdallah Bahrawi 175d492b99 Improve player panel (#2060)
## Description:

Fixes #2015
Improved the Player Panel UI for better usability and appearance.

**Screenshots**

<img width="334" height="523" alt="2"
src="https://github.com/user-attachments/assets/bd0afaac-07df-4abc-a20f-208a0783e558"
/>

<img width="337" height="523" alt="3"
src="https://github.com/user-attachments/assets/f712ad77-4546-487b-9a9c-2c535b8a45f7"
/>

**Future Plan**

Add a modal for sending gold and troops to other players from the Player
Panel.

<img width="343" height="494" alt="sending troops"
src="https://github.com/user-attachments/assets/9c9c21db-e13a-426f-93e9-b477a9db442a"
/>


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

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

abodcraft1

---------

Co-authored-by: evanpelle <evanpelle@gmail.com>
2025-10-06 12:45:30 -07:00