mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 11:20:45 +00:00
remove name, rebalance income
This commit is contained in:
@@ -96,6 +96,7 @@
|
||||
* Make three terrain types: Plains, highlands, mountains DONE 9/5/2024
|
||||
* more random names for game id & client id DONE 9/5/2024
|
||||
* BUG: attacks speed up DONE 9/6/2024
|
||||
* rebalance income DONE 9/7/2024
|
||||
* Make fake humans
|
||||
* directed expansion
|
||||
* UI: win condition & popup
|
||||
|
||||
@@ -48,20 +48,20 @@ export class UIRenderer {
|
||||
}
|
||||
|
||||
render(context: CanvasRenderingContext2D) {
|
||||
const p = this.game.players().find(p => p.clientID() == this.clientID);
|
||||
let troopCount = p ? `${renderTroops(p.troops())}` : '';
|
||||
// const p = this.game.players().find(p => p.clientID() == this.clientID);
|
||||
// let troopCount = p ? `${renderTroops(p.troops())}` : '';
|
||||
|
||||
context.save();
|
||||
context.fillStyle = 'rgba(0, 0, 0, 0.7)'; // Black with 70% opacity
|
||||
context.textAlign = 'center';
|
||||
context.textBaseline = 'top';
|
||||
// context.save();
|
||||
// context.fillStyle = 'rgba(0, 0, 0, 0.7)'; // Black with 70% opacity
|
||||
// context.textAlign = 'center';
|
||||
// context.textBaseline = 'top';
|
||||
|
||||
const x = context.canvas.width / 2; // Center horizontally
|
||||
const y = 40; // Distance from the top
|
||||
// const x = context.canvas.width / 2; // Center horizontally
|
||||
// const y = 40; // Distance from the top
|
||||
|
||||
context.font = `bold ${60}px ${this.theme.font()}`;
|
||||
context.fillText(troopCount, x, y);
|
||||
context.restore();
|
||||
// context.font = `bold ${60}px ${this.theme.font()}`;
|
||||
// context.fillText(troopCount, x, y);
|
||||
// context.restore();
|
||||
}
|
||||
|
||||
onExitButtonClick() {
|
||||
|
||||
@@ -85,7 +85,11 @@ export class DefaultConfig implements Config {
|
||||
let max = Math.sqrt(player.numTilesOwned()) * 3000 + 50000
|
||||
max = Math.min(max, 1_000_000)
|
||||
|
||||
let toAdd = 10 + (player.troops() + Math.sqrt(player.troops() * player.numTilesOwned())) / 150
|
||||
let toAdd = 10 + (player.troops() + Math.sqrt(player.troops() * player.numTilesOwned())) / 100
|
||||
|
||||
const ratio = 1 - (player.troops() / max)
|
||||
toAdd *= ratio
|
||||
// console.log(`to add ${toAdd}`)
|
||||
|
||||
return Math.min(player.troops() + toAdd, max)
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ export class BoatAttackExecution implements Execution {
|
||||
if (this.attacker.boats().length >= mg.config().boatMaxNumber()) {
|
||||
console.log('too many boats')
|
||||
this.active = false
|
||||
this.attacker.addTroops(this.troops)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user