mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 10:21:27 +00:00
update front page background image
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 606 KiB |
@@ -6,7 +6,7 @@ import {GameID, Lobby, ServerMessage, ServerMessageSchema} from "../core/Schemas
|
|||||||
import {loadTerrainMap, TerrainMap} from "../core/TerrainMapLoader";
|
import {loadTerrainMap, TerrainMap} from "../core/TerrainMapLoader";
|
||||||
import {ClientGame, createClientGame} from "./ClientGame";
|
import {ClientGame, createClientGame} from "./ClientGame";
|
||||||
import {v4 as uuidv4} from 'uuid';
|
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 favicon from '../../resources/images/Favicon.png';
|
||||||
|
|
||||||
import './styles.css';
|
import './styles.css';
|
||||||
|
|||||||
+27
-14
@@ -1,5 +1,5 @@
|
|||||||
import {Executor} from "../core/execution/Executor";
|
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 {createGame} from "../core/GameImpl";
|
||||||
import {EventBus} from "../core/EventBus";
|
import {EventBus} from "../core/EventBus";
|
||||||
import {Config} from "../core/configuration/Config";
|
import {Config} from "../core/configuration/Config";
|
||||||
@@ -188,24 +188,37 @@ export class ClientGame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const owner = tile.owner()
|
const owner = tile.owner()
|
||||||
const targetID = owner.isPlayer() ? owner.id() : null
|
const targetID = owner.isPlayer() ? owner.id() : null;
|
||||||
if (tile.owner() != this.myPlayer && tile.isLand()) {
|
let tn: Tile[] = []
|
||||||
const tn = Array.from(bfs(tile, 6))
|
if (tile.owner() != this.myPlayer) {
|
||||||
.filter(t => t.isOcean())
|
|
||||||
.filter(t => !t.hasOwner())
|
// Boat Attack Terra Nullius
|
||||||
.sort((a, b) => manhattanDist(tile.cell(), a.cell()) - manhattanDist(tile.cell(), b.cell()))
|
if (tile.isLand()) {
|
||||||
.flatMap(t => t.neighbors())
|
tn = Array.from(bfs(tile, 2))
|
||||||
.filter(n => n.isShore())
|
.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) {
|
if (tn.length > 0) {
|
||||||
this.sendBoatAttackIntent(targetID, tn[0].cell(), this.gs.config().player().boatAttackAmount(this.myPlayer, owner))
|
this.sendBoatAttackIntent(targetID, tn[0].cell(), this.gs.config().player().boatAttackAmount(this.myPlayer, owner))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.myPlayer.sharesBorderWith(tile.owner())) {
|
// Attack Player
|
||||||
this.sendAttackIntent(targetID, cell, this.gs.config().player().attackAmount(this.myPlayer, owner))
|
if (tile.isLand()) {
|
||||||
} else if (owner.isPlayer()) {
|
if (this.myPlayer.sharesBorderWith(tile.owner())) {
|
||||||
console.log('going to send boat')
|
this.sendAttackIntent(targetID, cell, this.gs.config().player().attackAmount(this.myPlayer, owner))
|
||||||
this.sendBoatAttackIntent(targetID, cell, this.gs.config().player().boatAttackAmount(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))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>OpenFront</title>
|
<title>OpenFront (ALPHA)</title>
|
||||||
<link rel="stylesheet" href="styles.css">
|
<link rel="stylesheet" href="styles.css">
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
@@ -119,11 +119,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-family: 'Overpass', sans-serif;
|
font-family: Overpass, serif;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #000000;
|
color: #3d3c3c;
|
||||||
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
|
/* text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); */
|
||||||
font-size: 2.5em;
|
font-size: 8em;
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h1>OpenFront (ALPHA)</h1>
|
<h1>OpenFront.io</h1>
|
||||||
<div id="username-container">
|
<div id="username-container">
|
||||||
<input type="text" id="username" placeholder="Enter your username">
|
<input type="text" id="username" placeholder="Enter your username">
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ export class DefaultPlayerConfig implements PlayerConfig {
|
|||||||
|
|
||||||
startTroops(playerInfo: PlayerInfo): number {
|
startTroops(playerInfo: PlayerInfo): number {
|
||||||
if (playerInfo.isBot) {
|
if (playerInfo.isBot) {
|
||||||
return 1000
|
return 5000
|
||||||
}
|
}
|
||||||
return 5000
|
return 5000
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export const devConfig = new class extends DefaultConfig {
|
|||||||
export const devPlayerConfig = new class extends DefaultPlayerConfig {
|
export const devPlayerConfig = new class extends DefaultPlayerConfig {
|
||||||
startTroops(playerInfo: PlayerInfo): number {
|
startTroops(playerInfo: PlayerInfo): number {
|
||||||
if (playerInfo.isBot) {
|
if (playerInfo.isBot) {
|
||||||
return 1000
|
return 5000
|
||||||
}
|
}
|
||||||
return 5000
|
return 5000
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 {Boat, Cell, Execution, MutableBoat, MutableGame, MutablePlayer, Player, PlayerID, TerraNullius, Tile, TileEvent} from "../Game";
|
||||||
import {manhattanDist} from "../Util";
|
import {manhattanDist} from "../Util";
|
||||||
import {AttackExecution} from "./AttackExecution";
|
import {AttackExecution} from "./AttackExecution";
|
||||||
import {Config, PlayerConfig} from "../configuration/Config";
|
|
||||||
|
|
||||||
export class BoatAttackExecution implements Execution {
|
export class BoatAttackExecution implements Execution {
|
||||||
|
|
||||||
@@ -64,7 +63,7 @@ export class BoatAttackExecution implements Execution {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.aStarPre = new AStar(this.src, this.dst)
|
this.aStarPre = new AStar(this.src, this.dst)
|
||||||
this.aStarPre.compute(100)
|
this.aStarPre.compute(30)
|
||||||
this.path = this.aStarPre.reconstructPath()
|
this.path = this.aStarPre.reconstructPath()
|
||||||
if (this.path != null) {
|
if (this.path != null) {
|
||||||
console.log(`got path ${this.path.map(t => t.cell().toString())}`)
|
console.log(`got path ${this.path.map(t => t.cell().toString())}`)
|
||||||
|
|||||||
Reference in New Issue
Block a user