have MIRV target all non allied players, increase price to 25 million

This commit is contained in:
Evan
2025-03-03 20:46:28 -08:00
parent ccebe86664
commit 226112beb5
4 changed files with 14 additions and 24 deletions
+1 -1
View File
@@ -184,7 +184,7 @@ export class DefaultConfig implements Config {
cost: (p: Player) =>
p.type() == PlayerType.Human && this.infiniteGold()
? 0
: 15_000_000,
: 25_000_000,
territoryBound: false,
};
case UnitType.MIRVWarhead:
+12 -19
View File
@@ -9,6 +9,7 @@ import {
UnitType,
TerraNullius,
MessageType,
AllPlayers,
} from "../game/Game";
import { PathFinder } from "../pathfinding/PathFinding";
import { PathFindResultType } from "../pathfinding/AStar";
@@ -27,7 +28,6 @@ export class MirvExecution implements Execution {
private nuke: Unit;
private mirvRange = 1500;
private warheadCount = 350;
private random: PseudoRandom;
@@ -74,16 +74,14 @@ export class MirvExecution implements Execution {
return;
}
this.nuke = this.player.buildUnit(UnitType.MIRV, 0, spawn);
const x = Math.floor(
(this.mg.x(this.dst) + this.mg.x(this.mg.x(this.nuke.tile()))) / 2,
);
const y = Math.max(0, this.mg.y(this.dst) - 500) + 50;
const x = Math.floor(Math.floor(this.mg.width() / 2));
const y = Math.min(this.mg.height(), 50);
this.separateDst = this.mg.ref(x, y);
this.mg.displayMessage(
`⚠️⚠️⚠️ ${this.player.name()} - MIRV INBOUND ⚠️⚠️⚠️`,
`⚠️⚠️⚠️ ${this.player.name()} - MIRV LAUNCH DETECTED ⚠️⚠️⚠️`,
MessageType.ERROR,
this.targetPlayer.id(),
null,
);
}
@@ -118,7 +116,7 @@ export class MirvExecution implements Execution {
let attempts = 1000;
while (attempts > 0 && dsts.length < this.warheadCount) {
attempts--;
const potential = this.randomLand(this.dst, dsts);
const potential = this.randomLand(dsts);
if (potential == null) {
continue;
}
@@ -156,18 +154,12 @@ export class MirvExecution implements Execution {
this.nuke.delete(false);
}
randomLand(ref: TileRef, taken: TileRef[]): TileRef | null {
randomLand(taken: TileRef[]): TileRef | null {
let tries = 0;
while (tries < 100) {
tries++;
const x = this.random.nextInt(
this.mg.x(ref) - this.mirvRange,
this.mg.x(ref) + this.mirvRange,
);
const y = this.random.nextInt(
this.mg.y(ref) - this.mirvRange,
this.mg.y(ref) + this.mirvRange,
);
const x = this.random.nextInt(0, this.mg.width());
const y = this.random.nextInt(0, this.mg.height());
if (!this.mg.isValidCoord(x, y)) {
continue;
}
@@ -176,10 +168,11 @@ export class MirvExecution implements Execution {
if (!this.mg.isLand(tile)) {
continue;
}
if (this.mg.euclideanDist(tile, ref) > this.mirvRange) {
const owner = this.mg.owner(tile);
if (!owner.isPlayer()) {
continue;
}
if (this.mg.owner(tile) != this.targetPlayer) {
if (owner == this.player || this.player.allianceWith(owner)) {
continue;
}
for (const t of taken) {
+1 -1
View File
@@ -134,7 +134,7 @@ export class NukeExecution implements Execution {
let magnitude;
switch (this.type) {
case UnitType.MIRVWarhead:
magnitude = { inner: 25, outer: 30 };
magnitude = { inner: 30, outer: 35 };
break;
case UnitType.AtomBomb:
magnitude = { inner: 12, outer: 30 };
-3
View File
@@ -650,9 +650,6 @@ export class PlayerImpl implements Player {
}
switch (unitType) {
case UnitType.MIRV:
if (!this.mg.hasOwner(targetTile)) {
return false;
}
return this.nukeSpawn(targetTile);
case UnitType.AtomBomb:
case UnitType.HydrogenBomb: