mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-30 15:32:11 +00:00
add terrain to map
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import {Cell} from './Game';
|
||||
import binAsString from "!!binary-loader!../../resources/World.bin";
|
||||
import binAsString from "!!binary-loader!../../resources/TopoWorldMap.bin";
|
||||
|
||||
export class TerrainMap {
|
||||
constructor(public readonly tiles: Terrain[][]) { }
|
||||
|
||||
@@ -16,7 +16,7 @@ export const devConfig = new class extends DefaultConfig {
|
||||
}
|
||||
|
||||
numBots(): number {
|
||||
return 250
|
||||
return 0
|
||||
}
|
||||
|
||||
startTroops(playerInfo: PlayerInfo): number {
|
||||
|
||||
@@ -90,7 +90,11 @@ export const pastelTheme = new class implements Theme {
|
||||
if (tile.isShore()) {
|
||||
return this.shore
|
||||
}
|
||||
return this.land;
|
||||
return colord({
|
||||
r: 174 + 5 * tile.magnitude(),
|
||||
g: 163 + 5 * tile.magnitude(),
|
||||
b: 128 + 5 * tile.magnitude()
|
||||
})
|
||||
} else {
|
||||
const w = this.water.rgba
|
||||
if (tile.isShorelineWater()) {
|
||||
|
||||
@@ -80,6 +80,9 @@ export class PlayerExecution implements Execution {
|
||||
const tiles = bfs(firstTile, filter)
|
||||
|
||||
const modePlayer = this.mg.player(mode)
|
||||
if (modePlayer == null) {
|
||||
console.warn('mode player is null')
|
||||
}
|
||||
for (const tile of tiles) {
|
||||
modePlayer.conquer(tile)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user