must click near coast to send boat

This commit is contained in:
evanpelle
2024-09-11 20:14:10 -07:00
parent 8f56fea0cd
commit 16fa019927
2 changed files with 3 additions and 4 deletions
+1 -1
View File
@@ -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
+2 -3
View File
@@ -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))