mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 12:51:30 +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:
@@ -261,13 +261,13 @@ export class DefaultConfig implements Config {
|
||||
p.type() == PlayerType.Human && this.infiniteGold()
|
||||
? 0
|
||||
: Math.min(
|
||||
1_000_000,
|
||||
1_500_000 * 3,
|
||||
(p.unitsIncludingConstruction(UnitType.SAMLauncher).length +
|
||||
1) *
|
||||
1_000_000,
|
||||
1_500_000,
|
||||
),
|
||||
territoryBound: true,
|
||||
constructionDuration: this.instantBuild() ? 0 : 10 * 10,
|
||||
constructionDuration: this.instantBuild() ? 0 : 30 * 10,
|
||||
};
|
||||
case UnitType.City:
|
||||
return {
|
||||
|
||||
@@ -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