Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/engine/systems/ai/AITacticsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const HUNT_MODE_STUCK_DISENGAGE_TICKS = 300; // ~15 seconds with no combat → f
// Air control constants
const AIR_HARASS_MAX_UNITS = 3; // Max air units for harassment
const AIR_FLANK_OFFSET = 20; // How far air units flank from the main army's attack vector
const AIR_REGROUP_DISTANCE = 30; // Distance from base to regroup air units
const _AIR_REGROUP_DISTANCE = 30; // Distance from base to regroup air units
const AIR_COMMAND_INTERVAL = 30; // Re-command air units every 30 ticks (~1.5 sec)
const SUPPORT_FOLLOW_DISTANCE = 12; // Support units stay this far behind army center

Expand Down Expand Up @@ -1766,10 +1766,7 @@ export class AITacticsManager {
* Command support air units (Lifter, Overseer) to follow the main army.
* Support units shadow the army centroid, staying slightly behind.
*/
private commandSupportAir(
ai: AIPlayer,
currentTick: number
): void {
private commandSupportAir(ai: AIPlayer, currentTick: number): void {
const supportUnits = this.getSupportAirUnits(ai.playerId);
if (supportUnits.length === 0) return;

Expand Down
11 changes: 4 additions & 7 deletions tests/engine/systems/AIMicroSystem.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1601,10 +1601,10 @@ describe('AIMicroSystem', () => {
isDead: boolean;
}

function getSupportAirUnits(units: MockSupportUnit[], playerId: string): number[] {
function getSupportAirUnits(units: MockSupportUnit[], _playerId: string): number[] {
return units
.filter(u => !u.isDead && u.isFlying && !u.isWorker && u.attackDamage === 0)
.map(u => u.id);
.filter((u) => !u.isDead && u.isFlying && !u.isWorker && u.attackDamage === 0)
.map((u) => u.id);
}

it('should return Lifter-type units (flying, no attack)', () => {
Expand Down Expand Up @@ -1644,10 +1644,7 @@ describe('AIMicroSystem', () => {
state: string;
}

function getScoutUnit(
units: MockScoutUnit[],
preferredTypes: Set<string>
): number | null {
function getScoutUnit(units: MockScoutUnit[], preferredTypes: Set<string>): number | null {
// First: idle flying units
for (const u of units) {
if (u.isFlying && !u.isWorker && u.state === 'idle') return u.id;
Expand Down
Loading