From a0d17ed85ebbbff192b9d21091934bffe65b32d8 Mon Sep 17 00:00:00 2001 From: evanpelle Date: Tue, 10 Jun 2025 10:03:02 -0700 Subject: [PATCH] counter attack doesn't cancel out attack (#1132) ## Description: Instead of a counter attack cancelling out the initial attack, both attacks run concurrently. This results in a more dynamic frontline. ## 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: --- src/core/execution/AttackExecution.ts | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/core/execution/AttackExecution.ts b/src/core/execution/AttackExecution.ts index 1926d9991..51c07c212 100644 --- a/src/core/execution/AttackExecution.ts +++ b/src/core/execution/AttackExecution.ts @@ -122,20 +122,6 @@ export class AttackExecution implements Execution { // Record stats this.mg.stats().attack(this._owner, this.target, this.startTroops); - for (const incoming of this._owner.incomingAttacks()) { - if (incoming.attacker() === this.target) { - // Target has opposing attack, cancel them out - if (incoming.troops() > this.attack.troops()) { - incoming.setTroops(incoming.troops() - this.attack.troops()); - this.attack.delete(); - this.active = false; - return; - } else { - this.attack.setTroops(this.attack.troops() - incoming.troops()); - incoming.delete(); - } - } - } for (const outgoing of this._owner.outgoingAttacks()) { if ( outgoing !== this.attack &&