diff --git a/src/client/InputHandler.ts b/src/client/InputHandler.ts index 2162ccdc5..3556bf889 100644 --- a/src/client/InputHandler.ts +++ b/src/client/InputHandler.ts @@ -124,12 +124,12 @@ export class InputHandler { const screenCenterX = window.innerWidth / 2; const screenCenterY = window.innerHeight / 2; - if (this.activeKeys.has("Minus")) { + if (this.activeKeys.has("Minus") || this.activeKeys.has("KeyQ")) { this.eventBus.emit( new ZoomEvent(screenCenterX, screenCenterY, this.ZOOM_SPEED), ); } - if (this.activeKeys.has("Equal")) { + if (this.activeKeys.has("Equal") || this.activeKeys.has("KeyE")) { this.eventBus.emit( new ZoomEvent(screenCenterX, screenCenterY, -this.ZOOM_SPEED), ); @@ -158,6 +158,8 @@ export class InputHandler { "ArrowRight", "Minus", "Equal", + "KeyE", + "KeyQ", ].includes(e.code) ) { this.activeKeys.add(e.code); @@ -188,6 +190,8 @@ export class InputHandler { "ArrowRight", "Minus", "Equal", + "KeyE", + "KeyQ", ].includes(e.code) ) { this.activeKeys.delete(e.code); diff --git a/src/client/index.html b/src/client/index.html index 707780ef4..730e0fbaa 100644 --- a/src/client/index.html +++ b/src/client/index.html @@ -144,7 +144,7 @@
- v0.15.0 + v0.15.1
diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index 638717eb2..a57ab7970 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -1,8 +1,10 @@ +import { renderNumber } from "../../client/Utils"; import { Difficulty, Game, GameType, Gold, + MessageType, Player, PlayerInfo, PlayerType, @@ -298,13 +300,23 @@ export class DefaultConfig implements Config { } } + let largeModifier = 1; + if (attacker.numTilesOwned() > 50_000) { + largeModifier = Math.sqrt(50_000 / attacker.numTilesOwned()); + } + if (defender.isPlayer()) { return { attackerTroopLoss: - within(defender.troops() / attackTroops, 0.5, 2) * mag * 0.8, + within(defender.troops() / attackTroops, 0.5, 2) * + mag * + 0.8 * + largeModifier, defenderTroopLoss: defender.troops() / defender.numTilesOwned(), tilesPerTickUsed: - within(defender.troops() / (5 * attackTroops), 0.2, 1.5) * speed, + within(defender.troops() / (5 * attackTroops), 0.2, 1.5) * + speed * + largeModifier, }; } else { return { diff --git a/src/core/execution/AttackExecution.ts b/src/core/execution/AttackExecution.ts index d85434947..6bff9b4b0 100644 --- a/src/core/execution/AttackExecution.ts +++ b/src/core/execution/AttackExecution.ts @@ -69,7 +69,9 @@ export class AttackExecution implements Execution { : mg.player(this._targetID); if (this._owner == this.target) { - throw new Error(`Player ${this._owner} cannot attack itself`); + console.error(`Player ${this._owner} cannot attack itself`); + this.active = false; + return; } if (