max number of boats

This commit is contained in:
evanpelle
2024-08-30 11:27:10 -07:00
parent 906412e64a
commit a3156bd50c
4 changed files with 17 additions and 2 deletions
+5 -1
View File
@@ -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
+1
View File
@@ -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 {
+3
View File
@@ -6,6 +6,9 @@ import {pastelTheme} from "./PastelTheme";
export class DefaultConfig implements Config {
boatMaxNumber(): number {
return 3
}
boatMaxDistance(): number {
return 500
}
+8 -1
View File
@@ -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 {