migrate from perforce

This commit is contained in:
2026-04-19 01:16:27 +02:00
commit d161a20915
1810 changed files with 1156171 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
import { EEnemySize } from "../../GameData/index.js";
import { SimCommandStartNextWave, SimEnemy } from "../index.js";
export class SimActionSpawnEnemies {
execute(simMain) {
const simLevel = simMain.currentLevel;
const gdLevel = simLevel.gdLevel;
const step = simLevel.currentStep;
const wave = gdLevel.waves[simLevel.currentWave];
let spawnDelay = simMain.gdRoot.simulation.spawnDelay;
switch (wave.size) {
case EEnemySize.Huge:
spawnDelay *= 2;
break;
case EEnemySize.Tiny:
spawnDelay *= 0.5;
break;
}
if (simLevel.enemiesLeftToSpawn > 0 && simLevel.lastEnemySpawnStep + spawnDelay * simMain.gdRoot.simulation.stepsPerSecond <= simLevel.currentStep) {
simLevel.enemiesLeftToSpawn -= 1;
simLevel.lastEnemySpawnStep = step;
const route = Math.floor(Math.random() * gdLevel.enemyRoutes.length);
const enemy = new SimEnemy(simMain.gdRoot, wave, route, simLevel);
enemy.onPathUpdated();
simLevel.simEnemies.push(enemy);
}
if (simLevel.nextWaveStep == step && !!gdLevel.waves[simLevel.currentWave + 1]) {
simMain.addCommand(new SimCommandStartNextWave(simMain.gdRoot, simLevel));
}
}
}
//# sourceMappingURL=SimActionSpawnEnemies.js.map