From 16fa019927d7f0e4ca6e09ef21c7fd89a6e796dd Mon Sep 17 00:00:00 2001 From: evanpelle Date: Wed, 11 Sep 2024 20:14:10 -0700 Subject: [PATCH] must click near coast to send boat --- TODO.txt | 2 +- src/client/ClientGame.ts | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/TODO.txt b/TODO.txt index 0c008be98..cd9c2eb8c 100644 --- a/TODO.txt +++ b/TODO.txt @@ -106,7 +106,7 @@ * store username DONE 9/11/2024 * give anon unique number after Anon name DONE 9/11/2024 * make color a hash of name DONE 9/11/2024 -* Make boats more intuitive (larger area to click off coast) +* Make boats more intuitive (larger area to click off coast) DONE 9/11/2024 * FakeHumans retaliate when attacked diff --git a/src/client/ClientGame.ts b/src/client/ClientGame.ts index 50b4ffdfd..da2074576 100644 --- a/src/client/ClientGame.ts +++ b/src/client/ClientGame.ts @@ -236,7 +236,7 @@ export class ClientGame { const enemyShoreDists = Array.from(bfs( tile, - and((t) => t.isLand() && t.owner() == tile.owner(), dist(tile, bordersEnemy ? 10 : 500)) + and((t) => t.isLand() && t.owner() == tile.owner(), dist(tile, 10)) )).filter(t => t.isOceanShore()).map(t => ({ dist: manhattanDist(t.cell(), tile.cell()), tile: t @@ -270,9 +270,8 @@ export class ClientGame { if (!bordersOcean) { return } - const tn = Array.from(bfs(tile, dist(tile, 3))) + const tn = Array.from(bfs(tile, dist(tile, 10))) .filter(t => t.isOceanShore()) - .filter(t => t.owner() == tile.owner()) .sort((a, b) => manhattanDist(tile.cell(), a.cell()) - manhattanDist(tile.cell(), b.cell())) if (tn.length > 0) { this.sendBoatAttackIntent(targetID, tn[0].cell(), this.gs.config().boatAttackAmount(this.myPlayer, owner))