This commit is contained in:
1brucben
2025-04-23 04:55:51 +02:00
4 changed files with 9 additions and 4 deletions
+2 -1
View File
@@ -380,7 +380,8 @@ export class RadialMenu implements Layer {
});
}
if (
actions.buildableUnits.some((bu) => bu.type == UnitType.TransportShip)
actions.buildableUnits.find((bu) => bu.type == UnitType.TransportShip)
?.canBuild
) {
this.activateMenuElement(Slot.Boat, "#3f6ab1", boatIcon, () => {
// BestTransportShipSpawn is an expensive operation, so
+1 -1
View File
@@ -148,7 +148,7 @@ export class DefaultConfig implements Config {
return 0.5;
}
traitorDuration(): number {
return 30 * 10; // 30 seconds
return 15 * 10; // 15 seconds
}
spawnImmunityDuration(): Tick {
return 5 * 10;
+2 -2
View File
@@ -43,7 +43,7 @@ import { andFN, manhattanDistFN, TileRef } from "./GameMap";
import { AttackUpdate, GameUpdateType, PlayerUpdate } from "./GameUpdates";
import { TerraNulliusImpl } from "./TerraNulliusImpl";
import {
bestShoreDeploymentSource as bestTranpsortShipSpawn,
bestShoreDeploymentSource,
canBuildTransportShip,
} from "./TransportShipUtils";
import { UnitImpl } from "./UnitImpl";
@@ -1017,7 +1017,7 @@ export class PlayerImpl implements Player {
}
bestTransportShipSpawn(targetTile: TileRef): TileRef | false {
return bestTranpsortShipSpawn(this.mg, this, targetTile);
return bestShoreDeploymentSource(this.mg, this, targetTile);
}
// It's a probability list, so if an element appears twice it's because it's
+4
View File
@@ -148,6 +148,10 @@ export function bestShoreDeploymentSource(
player: Player,
target: TileRef,
): TileRef | null {
target = targetTransportTile(gm, target);
if (target == null) {
return null;
}
let closestManhattanDistance = Infinity;
let minX = Infinity,
minY = Infinity,