migrate from perforce
This commit is contained in:
2
dist/Simulation/Actions/ISimAction.js
vendored
Normal file
2
dist/Simulation/Actions/ISimAction.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export {};
|
||||
//# sourceMappingURL=ISimAction.js.map
|
||||
1
dist/Simulation/Actions/ISimAction.js.map
vendored
Normal file
1
dist/Simulation/Actions/ISimAction.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ISimAction.js","sourceRoot":"","sources":["../../../src/Simulation/Actions/ISimAction.ts"],"names":[],"mappings":""}
|
||||
11
dist/Simulation/Actions/SimActionFireTowers.js
vendored
Normal file
11
dist/Simulation/Actions/SimActionFireTowers.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
export class SimActionFireTowers {
|
||||
execute(simMain) {
|
||||
const level = simMain.currentLevel;
|
||||
level.simCells.forEach((simCell) => {
|
||||
if (simCell.simTower != null) {
|
||||
simCell.simTower.fireIfAble();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=SimActionFireTowers.js.map
|
||||
1
dist/Simulation/Actions/SimActionFireTowers.js.map
vendored
Normal file
1
dist/Simulation/Actions/SimActionFireTowers.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"SimActionFireTowers.js","sourceRoot":"","sources":["../../../src/Simulation/Actions/SimActionFireTowers.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,mBAAmB;IACrB,OAAO,CAAC,OAAgB;QAC3B,MAAM,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC;QACnC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAgB,EAAE,EAAE;YACxC,IAAI,OAAO,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;gBAC3B,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;YAClC,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"}
|
||||
33
dist/Simulation/Actions/SimActionMoveEnemies.js
vendored
Normal file
33
dist/Simulation/Actions/SimActionMoveEnemies.js
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
import { Hex, Vector2 } from "../../Util/index.js";
|
||||
export class SimActionMoveEnemies {
|
||||
execute(simMain) {
|
||||
const simLevel = simMain.currentLevel;
|
||||
const deadEnemies = [];
|
||||
simLevel.simEnemies.forEach((simEnemy, idx) => {
|
||||
if (simEnemy.dead)
|
||||
deadEnemies.push(idx);
|
||||
});
|
||||
for (const idx of deadEnemies) {
|
||||
simLevel.simEnemies.splice(idx, 1);
|
||||
}
|
||||
for (const simEnemy of simLevel.simEnemies) {
|
||||
const duration = simEnemy.speed / simMain.gdRoot.simulation.stepsPerSecond;
|
||||
const t = (simLevel.currentStep - simEnemy.currentPathStep) * duration;
|
||||
const path2 = simLevel.simCells[simEnemy.path[simEnemy.currentPathIndex + 1]];
|
||||
if (!path2) {
|
||||
simEnemy.dead = true;
|
||||
return;
|
||||
}
|
||||
const hex2 = path2.hex;
|
||||
const pos1 = simEnemy.currentPathPosition;
|
||||
const pos2 = Hex.toWorld(hex2);
|
||||
simEnemy.position = Vector2.lerp(pos1, pos2, t);
|
||||
if (t >= 1) {
|
||||
simEnemy.currentPathIndex += 1;
|
||||
simEnemy.currentPathStep = simLevel.currentStep;
|
||||
simEnemy.onPathUpdated();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=SimActionMoveEnemies.js.map
|
||||
1
dist/Simulation/Actions/SimActionMoveEnemies.js.map
vendored
Normal file
1
dist/Simulation/Actions/SimActionMoveEnemies.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"SimActionMoveEnemies.js","sourceRoot":"","sources":["../../../src/Simulation/Actions/SimActionMoveEnemies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAGnD,MAAM,OAAO,oBAAoB;IACtB,OAAO,CAAC,OAAgB;QAC3B,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AI,CAAC,CAAC;gBAC/B,QAAQ,CAAC,eAAe,GAAG,QAAQ,CAAC,WAAW,CAAC;gBAChD,QAAQ,CAAC,aAAa,EAAE,CAAC;YAC7B,CAAC;QACL,CAAC;IACL,CAAC;CACJ"}
|
||||
32
dist/Simulation/Actions/SimActionMoveProjectiles.js
vendored
Normal file
32
dist/Simulation/Actions/SimActionMoveProjectiles.js
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
export class SimActionMoveProjectiles {
|
||||
execute(simMain) {
|
||||
const simLevel = simMain.currentLevel;
|
||||
const deadProjectiles = [];
|
||||
simLevel.simProjectiles.forEach((simProjectile, idx) => {
|
||||
if (simProjectile.dead)
|
||||
deadProjectiles.push(idx);
|
||||
});
|
||||
for (const idx of deadProjectiles) {
|
||||
simLevel.simProjectiles.splice(idx, 1);
|
||||
}
|
||||
simLevel.simProjectiles.forEach((simProjectile) => {
|
||||
const target = simLevel.simEnemies[simProjectile.targetEnemyIdx];
|
||||
if (!target || target.dead) {
|
||||
simProjectile.dead = true;
|
||||
return;
|
||||
}
|
||||
const pos1 = simProjectile.position;
|
||||
const pos2 = target.position;
|
||||
const dir = pos2.subtract(pos1);
|
||||
const len = dir.magnitude();
|
||||
let duration = simProjectile.speed / simMain.gdRoot.simulation.stepsPerSecond;
|
||||
if (len < duration) {
|
||||
duration = len;
|
||||
simProjectile.dead = true;
|
||||
target.suffer(simProjectile.gdEffect);
|
||||
}
|
||||
simProjectile.position = pos1.add(dir.normalized().multiplyScalar(duration));
|
||||
});
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=SimActionMoveProjectiles.js.map
|
||||
1
dist/Simulation/Actions/SimActionMoveProjectiles.js.map
vendored
Normal file
1
dist/Simulation/Actions/SimActionMoveProjectiles.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"SimActionMoveProjectiles.js","sourceRoot":"","sources":["../../../src/Simulation/Actions/SimActionMoveProjectiles.ts"],"names":[],"mappings":"AAEA,MAAM,O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,CAAC;YACD,aAAa,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;QACjF,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"}
|
||||
31
dist/Simulation/Actions/SimActionSpawnEnemies.js
vendored
Normal file
31
dist/Simulation/Actions/SimActionSpawnEnemies.js
vendored
Normal 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
|
||||
1
dist/Simulation/Actions/SimActionSpawnEnemies.js.map
vendored
Normal file
1
dist/Simulation/Actions/SimActionSpawnEnemies.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"SimActionSpawnEnemies.js","sourceRoot":"","sources":["../../../src/Simulation/Actions/SimActionSpawnEnemies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAc,uBAAuB,EAAE,QAAQ,EAAqB,MAAM,aAAa,CAAC;AAE/F,MAAM,OAAO,qBAAqB;IACvB,OAAO,CAAC,OAAgB;QAC3B,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAwB,CAAC;QAClD,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;QACjC,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,CAAC;QAClC,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACjD,IAAI,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC;QACtD,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;YAChB,KAAK,UAAU,CAAC,IAAI;gBAChB,UAAU,IAAI,CAAC,CAAC;gBAChB,MAAM;YACV,KAAK,UAAU,CAAC,IAAI;gBAChB,UAAU,IAAI,GAAG,CAAC;gBAClB,MAAM;QACd,CAAC;QAED,IAAI,QAAQ,CAAC,kBAAkB,GAAG,CAAC,IAAI,QAAQ,CAAC,kBAAkB,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,cAAc,IAAI,QAAQ,CAAC,WAAW,EAAE,CAAC;YACjJ,QAAQ,CAAC,kBAAkB,IAAI,CAAC,CAAC;YACjC,QAAQ,CAAC,kBAAkB,GAAG,IAAI,CAAC;YAEnC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAA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