diff --git a/resources/images/VintageMap2.png b/resources/images/VintageMap2.png new file mode 100644 index 000000000..d98438680 Binary files /dev/null and b/resources/images/VintageMap2.png differ diff --git a/src/client/Client.ts b/src/client/Client.ts index 2d2b53787..e0d2c8917 100644 --- a/src/client/Client.ts +++ b/src/client/Client.ts @@ -6,7 +6,7 @@ import {GameID, Lobby, ServerMessage, ServerMessageSchema} from "../core/Schemas import {loadTerrainMap, TerrainMap} from "../core/TerrainMapLoader"; import {ClientGame, createClientGame} from "./ClientGame"; import {v4 as uuidv4} from 'uuid'; -import backgroundImage from '../../resources/images/VintageMap.png'; +import backgroundImage from '../../resources/images/VintageMap2.png'; import favicon from '../../resources/images/Favicon.png'; import './styles.css'; diff --git a/src/client/ClientGame.ts b/src/client/ClientGame.ts index 00aa4a8da..02d37b8aa 100644 --- a/src/client/ClientGame.ts +++ b/src/client/ClientGame.ts @@ -1,5 +1,5 @@ import {Executor} from "../core/execution/Executor"; -import {Cell, MutableGame, PlayerEvent, PlayerID, MutablePlayer, TileEvent, Player, Game, BoatEvent} from "../core/Game"; +import {Cell, MutableGame, PlayerEvent, PlayerID, MutablePlayer, TileEvent, Player, Game, BoatEvent, Tile} from "../core/Game"; import {createGame} from "../core/GameImpl"; import {EventBus} from "../core/EventBus"; import {Config} from "../core/configuration/Config"; @@ -188,24 +188,37 @@ export class ClientGame { } const owner = tile.owner() - const targetID = owner.isPlayer() ? owner.id() : null - if (tile.owner() != this.myPlayer && tile.isLand()) { - const tn = Array.from(bfs(tile, 6)) - .filter(t => t.isOcean()) - .filter(t => !t.hasOwner()) - .sort((a, b) => manhattanDist(tile.cell(), a.cell()) - manhattanDist(tile.cell(), b.cell())) - .flatMap(t => t.neighbors()) - .filter(n => n.isShore()) + const targetID = owner.isPlayer() ? owner.id() : null; + let tn: Tile[] = [] + if (tile.owner() != this.myPlayer) { + + // Boat Attack Terra Nullius + if (tile.isLand()) { + tn = Array.from(bfs(tile, 2)) + .filter(t => t.isOcean()) + .sort((a, b) => manhattanDist(tile.cell(), a.cell()) - manhattanDist(tile.cell(), b.cell())) + .flatMap(t => t.neighbors()) + .filter(n => n.isShore()) + .filter(n => !n.hasOwner()) + } else if (tile.isOcean()) { + tn = Array.from(bfs(tile, 3)) + .filter(t => t.isShore()) + .filter(t => !t.hasOwner()) + .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().player().boatAttackAmount(this.myPlayer, owner)) return } - if (this.myPlayer.sharesBorderWith(tile.owner())) { - this.sendAttackIntent(targetID, cell, this.gs.config().player().attackAmount(this.myPlayer, owner)) - } else if (owner.isPlayer()) { - console.log('going to send boat') - this.sendBoatAttackIntent(targetID, cell, this.gs.config().player().boatAttackAmount(this.myPlayer, owner)) + // Attack Player + if (tile.isLand()) { + if (this.myPlayer.sharesBorderWith(tile.owner())) { + this.sendAttackIntent(targetID, cell, this.gs.config().player().attackAmount(this.myPlayer, owner)) + } else if (owner.isPlayer()) { + console.log('going to send boat') + this.sendBoatAttackIntent(targetID, cell, this.gs.config().player().boatAttackAmount(this.myPlayer, owner)) + } } } } diff --git a/src/client/index.html b/src/client/index.html index 10fa9afcb..be2667af0 100644 --- a/src/client/index.html +++ b/src/client/index.html @@ -4,7 +4,7 @@ - OpenFront + OpenFront (ALPHA) @@ -131,7 +131,7 @@
-

OpenFront (ALPHA)

+

OpenFront.io

diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index 78210f4b9..57a5ec381 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -65,7 +65,7 @@ export class DefaultPlayerConfig implements PlayerConfig { startTroops(playerInfo: PlayerInfo): number { if (playerInfo.isBot) { - return 1000 + return 5000 } return 5000 } diff --git a/src/core/configuration/DevConfig.ts b/src/core/configuration/DevConfig.ts index bc3693378..323ab22c7 100644 --- a/src/core/configuration/DevConfig.ts +++ b/src/core/configuration/DevConfig.ts @@ -23,7 +23,7 @@ export const devConfig = new class extends DefaultConfig { export const devPlayerConfig = new class extends DefaultPlayerConfig { startTroops(playerInfo: PlayerInfo): number { if (playerInfo.isBot) { - return 1000 + return 5000 } return 5000 } diff --git a/src/core/execution/BoatAttackExecution.ts b/src/core/execution/BoatAttackExecution.ts index 2fc67f8e6..c825333b5 100644 --- a/src/core/execution/BoatAttackExecution.ts +++ b/src/core/execution/BoatAttackExecution.ts @@ -2,7 +2,6 @@ import PriorityQueue from "priority-queue-typescript"; import {Boat, Cell, Execution, MutableBoat, MutableGame, MutablePlayer, Player, PlayerID, TerraNullius, Tile, TileEvent} from "../Game"; import {manhattanDist} from "../Util"; import {AttackExecution} from "./AttackExecution"; -import {Config, PlayerConfig} from "../configuration/Config"; export class BoatAttackExecution implements Execution { @@ -64,7 +63,7 @@ export class BoatAttackExecution implements Execution { return } this.aStarPre = new AStar(this.src, this.dst) - this.aStarPre.compute(100) + this.aStarPre.compute(30) this.path = this.aStarPre.reconstructPath() if (this.path != null) { console.log(`got path ${this.path.map(t => t.cell().toString())}`)