mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 15:20:43 +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 {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';
|
||||
|
||||
+27
-14
@@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>OpenFront</title>
|
||||
<title>OpenFront (ALPHA)</title>
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
<style>
|
||||
body {
|
||||
@@ -119,11 +119,11 @@
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-family: 'Overpass', sans-serif;
|
||||
font-family: Overpass, serif;
|
||||
text-align: center;
|
||||
color: #000000;
|
||||
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
|
||||
font-size: 2.5em;
|
||||
color: #3d3c3c;
|
||||
/* text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); */
|
||||
font-size: 8em;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
</style>
|
||||
@@ -131,7 +131,7 @@
|
||||
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1>OpenFront (ALPHA)</h1>
|
||||
<h1>OpenFront.io</h1>
|
||||
<div id="username-container">
|
||||
<input type="text" id="username" placeholder="Enter your username">
|
||||
</div>
|
||||
|
||||
@@ -65,7 +65,7 @@ export class DefaultPlayerConfig implements PlayerConfig {
|
||||
|
||||
startTroops(playerInfo: PlayerInfo): number {
|
||||
if (playerInfo.isBot) {
|
||||
return 1000
|
||||
return 5000
|
||||
}
|
||||
return 5000
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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())}`)
|
||||
|
||||
Reference in New Issue
Block a user