From 9c4317a444ca04171c50dbceabadd77ea4b66567 Mon Sep 17 00:00:00 2001 From: 1brucben <1benjbruce@gmail.com> Date: Sat, 31 May 2025 23:53:45 +0200 Subject: [PATCH] Prevent Attack Spam (#977) ## Description: This PR assigns a small cost (1% of population) to creating each new attack. This nerfs the strategy of spamming 1% size attacks against an enemy to max pop growth and encourages more normal >10% attack sizes. ## 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: 1brucben --- src/core/execution/AttackExecution.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/execution/AttackExecution.ts b/src/core/execution/AttackExecution.ts index 42d361736..daf17d759 100644 --- a/src/core/execution/AttackExecution.ts +++ b/src/core/execution/AttackExecution.ts @@ -120,6 +120,9 @@ export class AttackExecution implements Execution { new Set(), ); + const penalty = Math.floor(this._owner.population() * 0.01); + this._owner.removeTroops(penalty); + if (this.sourceTile !== null) { this.addNeighbors(this.sourceTile); } else {