mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-30 17:02:27 +00:00
nerf SAM (#258)
More costly (start at 1.5M), increase cost cap (4.5M), biggest timeout (5s->10s), much lower chance to stop hydrogen (70%->10%), triple construction time (10s->30s) otherwise it's trivial to build a SAM right before a nuke hits
This commit is contained in:
@@ -22,7 +22,7 @@ export class SAMLauncherExecution implements Execution {
|
||||
|
||||
private searchRange = 100;
|
||||
|
||||
private missileAttackRate = 50;
|
||||
private missileAttackRate = 100; // 10 seconds
|
||||
private lastMissileAttack = 0;
|
||||
|
||||
private pseudoRandom: PseudoRandom;
|
||||
|
||||
@@ -24,7 +24,9 @@ export class SAMMissileExecution implements Execution {
|
||||
private mg: Game,
|
||||
private pseudoRandom: number,
|
||||
private speed: number = 6,
|
||||
// Regular atom bomb or warhead of MIRV
|
||||
private hittingChance: number = 0.75,
|
||||
private hittingChanceHydrogen: number = 0.1,
|
||||
) {}
|
||||
|
||||
init(mg: Game, ticks: number): void {
|
||||
@@ -61,7 +63,17 @@ export class SAMMissileExecution implements Execution {
|
||||
switch (result.type) {
|
||||
case PathFindResultType.Completed:
|
||||
this.active = false;
|
||||
if (this.pseudoRandom < this.hittingChance) {
|
||||
let hit = false;
|
||||
if (
|
||||
this.target.type() == UnitType.HydrogenBomb &&
|
||||
this.pseudoRandom < this.hittingChanceHydrogen
|
||||
) {
|
||||
hit = true;
|
||||
} else if (this.pseudoRandom < this.hittingChance) {
|
||||
hit = true;
|
||||
}
|
||||
|
||||
if (hit) {
|
||||
this.target.delete();
|
||||
|
||||
this.mg.displayMessage(
|
||||
|
||||
Reference in New Issue
Block a user