mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-27 03:04:39 +00:00
max number of boats
This commit is contained in:
@@ -58,13 +58,17 @@
|
||||
* REFACTOR: remove player config DONE 8/29/2024
|
||||
* give boats limit for how far they can go DONE 8/29/2024
|
||||
* boats can go around the world DONE 8/29/2024
|
||||
* max boats (3)?
|
||||
* PERF: more efficient spawns
|
||||
* PERF: load terrain map async
|
||||
* PERF: enable CDN
|
||||
* enable load balancing metrics
|
||||
* end game when no players left (or after 1 hour or so?)
|
||||
* Add terrain elevation to map
|
||||
* if completely surrended, lose piece of land
|
||||
* use better favicon
|
||||
* BUG: tiles get left behind during conquer
|
||||
* Add terrain elevation to map
|
||||
* REFACTOR: give terranullius an ID, game.player() returns terranullius
|
||||
* REFACTOR: ocean is considered TerraNullius ?
|
||||
* Create exit to menu button
|
||||
* Make fake humans
|
||||
|
||||
@@ -33,6 +33,7 @@ export interface Config {
|
||||
attackAmount(attacker: Player, defender: Player | TerraNullius): number
|
||||
boatAttackAmount(attacker: Player, defender: Player | TerraNullius): number
|
||||
boatMaxDistance(): number
|
||||
boatMaxNumber(): number
|
||||
}
|
||||
|
||||
export interface Theme {
|
||||
|
||||
@@ -6,6 +6,9 @@ import {pastelTheme} from "./PastelTheme";
|
||||
|
||||
|
||||
export class DefaultConfig implements Config {
|
||||
boatMaxNumber(): number {
|
||||
return 3
|
||||
}
|
||||
boatMaxDistance(): number {
|
||||
return 500
|
||||
}
|
||||
|
||||
@@ -44,9 +44,16 @@ export class BoatAttackExecution implements Execution {
|
||||
|
||||
init(mg: MutableGame, ticks: number) {
|
||||
this.lastMove = ticks
|
||||
|
||||
this.mg = mg
|
||||
|
||||
this.attacker = mg.player(this.attackerID)
|
||||
|
||||
if (this.attacker.boats().length >= mg.config().boatMaxNumber()) {
|
||||
console.log('too many boats')
|
||||
this.active = false
|
||||
return
|
||||
}
|
||||
|
||||
if (this.targetID == null) {
|
||||
this.target = mg.terraNullius()
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user