Fix: Standardize MIRV travel time

Addresses player report regarding unfair and unintuitive MIRV launch delays.
MIRV travel time is now fixed at 5 ticks, independent of click location.

- Modified MIRVExecution.ts to dynamically calculate speed based on a fixed travel time.
- Added MIRVExecution.test.ts to verify the fixed travel time.
This commit is contained in:
Restart2008
2025-10-25 20:51:30 -07:00
parent 3478b3ab13
commit 4d924ef8d1
2 changed files with 74 additions and 1 deletions
+5 -1
View File
@@ -22,6 +22,7 @@ export class MirvExecution implements Execution {
private mirvRange = 1500;
private warheadCount = 350;
private MIRV_FIXED_TRAVEL_TIME = 5; // Ticks
private random: PseudoRandom;
@@ -43,7 +44,7 @@ export class MirvExecution implements Execution {
this.mg = mg;
this.pathFinder = new ParabolaPathFinder(mg);
this.targetPlayer = this.mg.owner(this.dst);
this.speed = this.mg.config().defaultNukeSpeed();
// Record stats
this.mg.stats().bombLaunch(this.player, this.targetPlayer, UnitType.MIRV);
@@ -75,6 +76,9 @@ export class MirvExecution implements Execution {
const y = Math.max(0, this.mg.y(this.dst) - 500) + 50;
this.separateDst = this.mg.ref(x, y);
this.pathFinder.computeControlPoints(spawn, this.separateDst);
// Calculate speed for fixed travel time
const distance = this.mg.euclideanDist(spawn, this.separateDst);
this.speed = distance / this.MIRV_FIXED_TRAVEL_TIME;
this.mg.displayIncomingUnit(
this.nuke.id(),