/
nukeManifest.ts
86 lines (80 loc) · 1.54 KB
/
nukeManifest.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import {log} from './log';
const launchFrom = [
'E26S47',
'E22S46',
'E24S49',
'E22S49',
'E16S47',
'E25S52',
'E12S47',
'E15S49',
'E13S44',
'E8S45',
'E8S48',
'E3S46',
'E5S47',
'E3S48',
'E2S52',
];
const launchTo = [
'E19S53',
'E17S54',
'E18S56',
'E15S53',
'E15S57',
'E16S59',
'E13S55',
'E12S58',
'E11S52',
'E9S52',
'E8S57',
'E5S53',
'E3S55',
'E3S58',
'W2S59',
];
let launchPos = [
[7, 15],
[24, 33],
[28, 17],
[11, 25],
[33, 23],
[20, 13],
[13, 29],
[27, 40],
[13, 20],
[8, 29],
[13, 20],
[21, 17],
[42, 42],
[25, 26],
[13, 29],
];
export function verifyLaunchManifest() {
for (let i in launchFrom) {
let from = launchFrom[i];
let to = launchTo[i];
let [x, y] = launchPos[i];
let nuker: StructureNuker = Overmind.colonies[from].commandCenter.nuker;
if (Game.map.getRoomLinearDistance(from, to) > NUKE_RANGE) {
log.info(`${from} to ${to} is out of range!`);
} else if (!nuker || nuker.ghodium < nuker.ghodiumCapacity || nuker.energy < nuker.energyCapacity) {
log.info(`Not enough resources in ${from} nuker!`);
} else {
log.info(`Nuclear launch ${from} to ${to} is OK`);
}
}
}
export function doomsdayLaunch() {
for (let i in launchFrom) {
let from = launchFrom[i];
let to = launchTo[i];
let [x, y] = launchPos[i];
let nuker: StructureNuker = Overmind.colonies[from].commandCenter.nuker;
if (nuker.cooldown == 0) {
let pos = new RoomPosition(x, y, to);
let ret = nuker.launchNuke(pos);
log.alert(`[NUCLEAR LAUNCH] Launching nuke from ${from} to ${pos.print}! Result: ${ret}`);
}
}
}