mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 13:00:42 +00:00
38cb3027cb
If this PR fixes an issue, link it below. If not, delete these two lines. Resolves #3174 ## Description: This PR implements a keybind for retaliation against incoming non-bot attacks (Players and Nations). It currently will target the most recent (last in array) incoming attack when the keybind is pressed, choosing the minimum of attack ratio or incoming attack troop size to retaliate with. This correlates with the last displayed incoming attack on the bottom modal. It works when there are multiple attacks (press multiple times to retaliate against each consecutive attack). If the retaliation size is smaller than the attack, the keybind can be pressed multiple times to repeatedly blunt the incoming troop count. Due to the current keybind logic KeyR cannot be used but Shift+KeyR can so it is set to that until refactor. <img width="867" height="121" alt="image" src="https://github.com/user-attachments/assets/56e80810-4900-4db0-8ce7-1856e13529e5" /> No tests have been added as the retaliation feature doesn't seem to have any to begin with since it is just an attack intent. The keybind is not configured any differently than others. I did run all current tests and was all good. ## 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: n1ghtingal3