mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-16 15:02:53 +00:00
get attacks working, adjust name placement scaling factor
This commit is contained in:
@@ -218,6 +218,9 @@ export class ClientGameRunner {
|
||||
} else {
|
||||
outer_loop: for (const t of bfs(tile, and(t => !t.hasOwner() && t.terrain().isLand(), dist(tile, 200)))) {
|
||||
for (const n of t.neighbors()) {
|
||||
if (n.owner().isPlayer()) {
|
||||
console.log(`owner: ${(n.owner() as PlayerView).name()}`)
|
||||
}
|
||||
if (n.owner() == this.myPlayer) {
|
||||
this.eventBus.emit(new SendAttackIntentEvent(targetID, this.myPlayer.troops() * this.renderer.uiState.attackRatio))
|
||||
break outer_loop
|
||||
|
||||
@@ -18,8 +18,8 @@ export interface Rectangle {
|
||||
export function placeName(game: Game, player: Player): NameViewData {
|
||||
const boundingBox = calculateBoundingBox(player.borderTiles());
|
||||
|
||||
const rawScalingFactor = (boundingBox.max.x - boundingBox.min.x) / 50
|
||||
const scalingFactor = within(Math.floor(rawScalingFactor), 1, 100)
|
||||
const rawScalingFactor = (boundingBox.max.x - boundingBox.min.x) / 100
|
||||
const scalingFactor = within(Math.floor(rawScalingFactor), 1, 1000)
|
||||
|
||||
const grid = createGrid(game, player, boundingBox, scalingFactor);
|
||||
const largestRectangle = findLargestInscribedRectangle(grid);
|
||||
|
||||
Reference in New Issue
Block a user