-
Notifications
You must be signed in to change notification settings - Fork 1
/
const.js
453 lines (416 loc) · 15.6 KB
/
const.js
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
const MAP_WIDTH = 120;
const MAP_HEIGHT = 50;
const SIDEBAR_WIDTH = 40;
const COMBAT_LOG_LENGTH = 8;
const N_STAR_SYSTEMS = 8;
const N_CLUES = 6;
const N_TURNS = 1000;
const BODY_STAR_YELLOW = 0;
const BODY_STAR_RED = 1;
const BODY_STAR_BLUE = 2;
const BODY_STAR_ORANGE = 3;
const BODY_PLANET_BARREN = 4;
const BODY_PLANET_TERRAN = 5;
const BODY_PLANET_FROZEN = 6;
const BODY_PLANET_VOLCANIC = 7;
const BODY_PLANET_TOXIC = 8;
const BODY_GAS_1 = 9;
const BODY_GAS_2 = 10;
const BODY_GAS_3 = 11;
const BODY_GAS_4 = 12;
const BODY_BLACK_HOLE = 13;
const BODY_ANOMALY = 14;
const BODY_QUASAR = 15;
var LARGE_BODIES = [{prob: 80, opt: BODY_STAR_YELLOW}, {prob: 10, opt: BODY_QUASAR}, {prob: 10, opt: BODY_BLACK_HOLE}];
var SMALL_BODIES = [{prob: 60, opt: BODY_PLANET_BARREN}, {prob: 10, opt: BODY_PLANET_TERRAN}, {prob: 30, opt: BODY_PLANET_FROZEN}];
var STAR_COMMON_NAMES = ["ARCTURUS", "ERIDANUS", "CYGNUS", "POLARIS", "CORVUS", "CARINA", "AIN", "CARCERI", "TARTARUS"];
var CONSTELLATION_NAMES_POSSESSIVE = ["CENTAURI", "CASSIOPEIAE", "ANDROMEDAE", "ORIONIS", "PEGASI", "PYXIDIS"];
var SMALL_BODY_COMMON_NAMES = ["CERES", "QUAOAR", "SEDNA", "ORCUS", "SALACIA", "VARUNA", "ERIS", "VULCAN", "IO", "EUROPA", "GANYMEDE", "CALLISTO", "LYSITHEA", "STYX", "NIX", "KERBEROS", "HYDRA", "IAPETUS", "ELARA", "DIA", "ANANKE", "THYONE", "AOEDE", "KALYKE", "CYLLENE", "MEGACLITE", "ERINOME", "DIA"];
var SMALL_BODY_SYSTEM_DERIVED_NAMES = ["I", "II", "III", "IV", "V", "VI", "VII", "VIII"];
var SMALL_BODY_SCIENTIFIC_NAMES = ["XV", "KZ", "QX", "GD"];
var GREEK_LETTERS = ["ALPHA", "BETA", "GAMMA", "DELTA", "EPSILON", "LAMBDA", "KAPPA"];
var USED_BODY_NAMES = [];
const PLANET_NAMING_STYLE_COMMON = 0;
const PLANET_NAMING_STYLE_SCIENTIFIC = 1;
const PLANET_NAMING_STYLE_SYSTEM_DERIVED = 2;
const TERRAIN_NONE_EMPTY = 0;
const TERRAIN_NONE_DIM_STAR = 1;
const TERRAIN_NONE_BRIGHT_STAR = 2;
const TERRAIN_STAR_YELLOW = 3;
const TERRAIN_CORONA_YELLOW = 4;
const TERRAIN_BARREN_1 = 5;
const TERRAIN_BARREN_2 = 6;
const TERRAIN_BARREN_3 = 7;
const TERRAIN_GRASS = 8;
const TERRAIN_WATER = 9;
const TERRAIN_ICE = 10;
const TERRAIN_BLACK_HOLE = 11;
const TERRAIN_ANOMALY = 12;
const TERRAIN_QUASAR = 13;
const TERRAIN_QUASAR_JET = 14;
const EAST = 0;
const WEST = 4;
const NORTH = 2;
const SOUTH = 6;
const NE = 1;
const NW = 3;
const SE = 7;
const SW = 5;
const CENTER = 8;
const DIRECTIONS = [];
DIRECTIONS[EAST] = [1, 0];
DIRECTIONS[WEST] = [-1, 0];
DIRECTIONS[NORTH] = [0, -1];
DIRECTIONS[SOUTH] = [0, 1];
DIRECTIONS[NE] = [1, -1];
DIRECTIONS[NW] = [-1, -1];
DIRECTIONS[SE] = [1, 1];
DIRECTIONS[SW] = [-1, 1];
DIRECTIONS[CENTER] = [0, 0];
const DIRECTION_NAMES = [];
DIRECTION_NAMES[EAST] = 'east';
DIRECTION_NAMES[WEST] = 'west';
DIRECTION_NAMES[NORTH] = 'north';
DIRECTION_NAMES[SOUTH] = 'south';
DIRECTION_NAMES[NE] = 'northeast';
DIRECTION_NAMES[NW] = 'northwest';
DIRECTION_NAMES[SE] = 'southeast';
DIRECTION_NAMES[SW] = 'southwest';
DIRECTION_NAMES[CENTER] = 'center';
const ARROWS = [];
ARROWS[EAST] = '\u25B6';
ARROWS[WEST] = '\u25C0';
ARROWS[NORTH] = '\u25B2';
ARROWS[SOUTH] = '\u25BC';
ARROWS[NE] = '\u25E5';
ARROWS[NW] = '\u25E4';
ARROWS[SE] = '\u25E2';
ARROWS[SW] = '\u25E3';
ARROWS[CENTER] = '\u25A0';
const OCTANT1 = Math.tan(Math.PI/8); //0.41
const OCTANT2 = Math.tan(3*Math.PI/8); //2.41
const OCTANT3 = Math.tan(5*Math.PI/8); //-2.41
const OCTANT4 = Math.tan(7*Math.PI/8); //-0.41
const MOUNT_FWD = 0;
const MOUNT_STBD = 1;
const MOUNT_AFT = 2;
const MOUNT_PORT = 3;
const MOUNT_TURRET = 4;
const MOUNT_NAMES = [];
MOUNT_NAMES[MOUNT_FWD] = "FWD";
MOUNT_NAMES[MOUNT_STBD] = "STBD";
MOUNT_NAMES[MOUNT_AFT] = "AFT";
MOUNT_NAMES[MOUNT_PORT] = "PORT";
MOUNT_NAMES[MOUNT_TURRET] = "TRT";
const AFT_MOUNT_PENALTY = 1;
const DAMAGE_NORMAL = 0;
const DAMAGE_ION = 1;
const DAMAGE_TRACTOR = 2;
const DAMAGE_NEUTRON = 3;
const DAMAGE_SIPHON = 4;
const DAMAGE_OVERLOAD = 5;
const DAMAGE_MINDCONTROL = 6;
const WEAPON_LASER_CANNON = 0;
const WEAPON_ION_CANNON = 1;
const WEAPON_TRACTOR_BEAM = 2;
const WEAPON_NEUTRON_BEAM = 3;
const WEAPON_HEAVY_LASER = 4;
const WEAPON_HEAVY_ION = 5;
const WEAPON_SIEGE_LASER = 6;
const WEAPON_SIPHON = 7;
const WEAPON_MINDCONTROL = 8;
const WEAPON_ZERO_POINT = 9;
const WEAPON_REACTOR_OVERCHARGE = 10;
const WEAPON_SINGULARITY = 11;
const WEAPON_NEURAL_STATIC_PROJECTOR = 12;
const WEAPON_GRAVATIC_SHEAR = 13;
const WEAPON_PURIFICATION = 14;
const SHIP_TYPE_FIGHTER = 0;
const SHIP_TYPE_SLOOP = 1;
const SHIP_TYPE_FRIGATE = 2;
const SHIP_TYPE_TRANSPORT = 3;
const SHIP_TYPE_CARRIER = 4;
const SHIP_TYPE_BATTLESHIP = 5;
const SHIP_TYPE_DREADNOUGHT = 6;
const SHIP_TYPE_STATION = 7;
const SHIP_TYPE_OTHER = 8;
const SHIP_TYPE_ARBITER = 9;
const SHIP_TYPE_WRAITH = 10;
const SHIP_FLAG_PLAYER = 0;
const SHIP_FLAG_MERCHANT = 1;
const SHIP_FLAG_PIRATE = 2;
const SHIP_FLAG_KHAN = 3;
const SHIP_FLAG_UNKNOWN = 4;
const SHIP_FLAG_PRECURSOR = 5;
const TEAM_NAME = {};
TEAM_NAME[SHIP_FLAG_PLAYER] = "Your";
TEAM_NAME[SHIP_FLAG_MERCHANT] = "Merchant";
TEAM_NAME[SHIP_FLAG_PIRATE] = "Pirate";
TEAM_NAME[SHIP_FLAG_KHAN] = "Khanate";
TEAM_NAME[SHIP_FLAG_UNKNOWN] = "Unknown";
TEAM_NAME[SHIP_FLAG_PRECURSOR] = "Precursor";
const SHIP_HULL = {};
SHIP_HULL[SHIP_TYPE_FIGHTER] = 2;
SHIP_HULL[SHIP_TYPE_SLOOP] = 4;
SHIP_HULL[SHIP_TYPE_FRIGATE] = 8;
SHIP_HULL[SHIP_TYPE_TRANSPORT] = 15;
SHIP_HULL[SHIP_TYPE_CARRIER] = 20;
SHIP_HULL[SHIP_TYPE_BATTLESHIP] = 35;
SHIP_HULL[SHIP_TYPE_DREADNOUGHT] = 50;
SHIP_HULL[SHIP_TYPE_STATION] = 30;
SHIP_HULL[SHIP_TYPE_OTHER] = 5;
SHIP_HULL[SHIP_TYPE_ARBITER] = 20;
SHIP_HULL[SHIP_TYPE_WRAITH] = 10;
const SHIP_SHIELD = {};
SHIP_SHIELD[SHIP_TYPE_FIGHTER] = 2;
SHIP_SHIELD[SHIP_TYPE_SLOOP] = 3;
SHIP_SHIELD[SHIP_TYPE_FRIGATE] = 4;
SHIP_SHIELD[SHIP_TYPE_TRANSPORT] = 10;
SHIP_SHIELD[SHIP_TYPE_CARRIER] = 10;
SHIP_SHIELD[SHIP_TYPE_BATTLESHIP] = 15;
SHIP_SHIELD[SHIP_TYPE_DREADNOUGHT] = 20;
SHIP_SHIELD[SHIP_TYPE_STATION] = 5;
SHIP_SHIELD[SHIP_TYPE_OTHER] = 5;
SHIP_SHIELD[SHIP_TYPE_ARBITER] = 20;
SHIP_SHIELD[SHIP_TYPE_WRAITH] = 10;
const SHIP_ENERGY = {};
SHIP_ENERGY[SHIP_TYPE_FIGHTER] = 8;
SHIP_ENERGY[SHIP_TYPE_SLOOP] = 10;
SHIP_ENERGY[SHIP_TYPE_FRIGATE] = 10;
SHIP_ENERGY[SHIP_TYPE_TRANSPORT] = 15;
SHIP_ENERGY[SHIP_TYPE_CARRIER] = 20;
SHIP_ENERGY[SHIP_TYPE_BATTLESHIP] = 20;
SHIP_ENERGY[SHIP_TYPE_DREADNOUGHT] = 30;
SHIP_ENERGY[SHIP_TYPE_STATION] = 15;
SHIP_ENERGY[SHIP_TYPE_OTHER] = 5;
SHIP_ENERGY[SHIP_TYPE_ARBITER] = 40;
SHIP_ENERGY[SHIP_TYPE_WRAITH] = 20;
const SHIP_ENERGY_RECHARGE = {};
SHIP_ENERGY_RECHARGE[SHIP_TYPE_FIGHTER] = 1;
SHIP_ENERGY_RECHARGE[SHIP_TYPE_SLOOP] = 1;
SHIP_ENERGY_RECHARGE[SHIP_TYPE_FRIGATE] = 1;
SHIP_ENERGY_RECHARGE[SHIP_TYPE_TRANSPORT] = 3;
SHIP_ENERGY_RECHARGE[SHIP_TYPE_CARRIER] = 3;
SHIP_ENERGY_RECHARGE[SHIP_TYPE_BATTLESHIP] = 3;
SHIP_ENERGY_RECHARGE[SHIP_TYPE_DREADNOUGHT] = 5;
SHIP_ENERGY_RECHARGE[SHIP_TYPE_STATION] = 5;
SHIP_ENERGY_RECHARGE[SHIP_TYPE_OTHER] = 1;
SHIP_ENERGY_RECHARGE[SHIP_TYPE_ARBITER] = 8;
SHIP_ENERGY_RECHARGE[SHIP_TYPE_WRAITH] = 6;
const SHIP_MIN_CREW = {};
SHIP_MIN_CREW[SHIP_TYPE_FIGHTER] = 1;
SHIP_MIN_CREW[SHIP_TYPE_SLOOP] = 5;
SHIP_MIN_CREW[SHIP_TYPE_FRIGATE] = 5;
SHIP_MIN_CREW[SHIP_TYPE_TRANSPORT] = 20;
SHIP_MIN_CREW[SHIP_TYPE_CARRIER] = 40;
SHIP_MIN_CREW[SHIP_TYPE_BATTLESHIP] = 30;
SHIP_MIN_CREW[SHIP_TYPE_DREADNOUGHT] = 50;
SHIP_MIN_CREW[SHIP_TYPE_STATION] = 25;
SHIP_MIN_CREW[SHIP_TYPE_OTHER] = 5;
SHIP_MIN_CREW[SHIP_TYPE_ARBITER] = 0;
SHIP_MIN_CREW[SHIP_TYPE_WRAITH] = 0;
const SHIP_MAX_CREW = {};
SHIP_MAX_CREW[SHIP_TYPE_FIGHTER] = 1;
SHIP_MAX_CREW[SHIP_TYPE_SLOOP] = 10;
SHIP_MAX_CREW[SHIP_TYPE_FRIGATE] = 20;
SHIP_MAX_CREW[SHIP_TYPE_TRANSPORT] = 80;
SHIP_MAX_CREW[SHIP_TYPE_CARRIER] = 120;
SHIP_MAX_CREW[SHIP_TYPE_BATTLESHIP] = 60;
SHIP_MAX_CREW[SHIP_TYPE_DREADNOUGHT] = 200;
SHIP_MAX_CREW[SHIP_TYPE_STATION] = 150;
SHIP_MAX_CREW[SHIP_TYPE_OTHER] = 10;
SHIP_MAX_CREW[SHIP_TYPE_ARBITER] = 40;
SHIP_MAX_CREW[SHIP_TYPE_WRAITH] = 10;
const SHIP_MANEUVER_COST = {};
SHIP_MANEUVER_COST[SHIP_TYPE_FIGHTER] = 1;
SHIP_MANEUVER_COST[SHIP_TYPE_SLOOP] = 2;
SHIP_MANEUVER_COST[SHIP_TYPE_FRIGATE] = 3;
SHIP_MANEUVER_COST[SHIP_TYPE_TRANSPORT] = 5;
SHIP_MANEUVER_COST[SHIP_TYPE_CARRIER] = 6;
SHIP_MANEUVER_COST[SHIP_TYPE_BATTLESHIP] = 6;
SHIP_MANEUVER_COST[SHIP_TYPE_DREADNOUGHT] = 6;
SHIP_MANEUVER_COST[SHIP_TYPE_STATION] = 100;
SHIP_MANEUVER_COST[SHIP_TYPE_OTHER] = 2;
SHIP_MANEUVER_COST[SHIP_TYPE_ARBITER] = 5;
SHIP_MANEUVER_COST[SHIP_TYPE_WRAITH] = 1;
const SHIP_NAMES = {};
SHIP_NAMES[SHIP_TYPE_FIGHTER] = "Fighter";
SHIP_NAMES[SHIP_TYPE_SLOOP] = "Sloop";
SHIP_NAMES[SHIP_TYPE_FRIGATE] = "Frigate";
SHIP_NAMES[SHIP_TYPE_TRANSPORT] = "Assault Transport";
SHIP_NAMES[SHIP_TYPE_CARRIER] = "Strike Carrier";
SHIP_NAMES[SHIP_TYPE_BATTLESHIP] = "Battleship";
SHIP_NAMES[SHIP_TYPE_DREADNOUGHT] = "Dreadnought";
SHIP_NAMES[SHIP_TYPE_STATION] = "Station";
SHIP_NAMES[SHIP_TYPE_OTHER] = "Vessel";
SHIP_NAMES[SHIP_TYPE_ARBITER] = "Arbiter"; //ancient precursor vessel, random artifact
SHIP_NAMES[SHIP_TYPE_WRAITH] = "Wraith"; //ancient precursor vessel
const SHIP_SYMBOL = {};
SHIP_SYMBOL[SHIP_TYPE_FIGHTER] = "f";
SHIP_SYMBOL[SHIP_TYPE_SLOOP] = "S";
SHIP_SYMBOL[SHIP_TYPE_FRIGATE] = "F";
SHIP_SYMBOL[SHIP_TYPE_TRANSPORT] = "T";
SHIP_SYMBOL[SHIP_TYPE_CARRIER] = "C";
SHIP_SYMBOL[SHIP_TYPE_BATTLESHIP] = "B";
SHIP_SYMBOL[SHIP_TYPE_DREADNOUGHT] = "D";
SHIP_SYMBOL[SHIP_TYPE_STATION] = "S";
SHIP_SYMBOL[SHIP_TYPE_OTHER] = "V";
SHIP_SYMBOL[SHIP_TYPE_ARBITER] = "A";
SHIP_SYMBOL[SHIP_TYPE_WRAITH] = "W";
const SHIP_LOOT = {};
SHIP_LOOT[SHIP_TYPE_FIGHTER] = 0;
SHIP_LOOT[SHIP_TYPE_SLOOP] = 10;
SHIP_LOOT[SHIP_TYPE_FRIGATE] = 20;
SHIP_LOOT[SHIP_TYPE_TRANSPORT] = 200;
SHIP_LOOT[SHIP_TYPE_CARRIER] = 300;
SHIP_LOOT[SHIP_TYPE_BATTLESHIP] = 300;
SHIP_LOOT[SHIP_TYPE_DREADNOUGHT] = 1000;
SHIP_LOOT[SHIP_TYPE_STATION] = 400;
SHIP_LOOT[SHIP_TYPE_OTHER] = 20;
SHIP_LOOT[SHIP_TYPE_ARBITER] = 400;
SHIP_LOOT[SHIP_TYPE_WRAITH] = 100;
var TILES = {};
TILES[TERRAIN_NONE_EMPTY] = [
{prob: 99, opt: {character : ".", color : "#000", backgroundColor : "#000"}},
{prob: 1, opt: {character : ".", color : "#006", backgroundColor : "#000"}}];
TILES[TERRAIN_NONE_DIM_STAR] = [
{prob: 99, opt: {character : ".", color : "#006", backgroundColor : "#000"}},
{prob: 1, opt: {character : ".", color : "#FFF", backgroundColor : "#000"}}];
TILES[TERRAIN_NONE_BRIGHT_STAR] = [
{prob: 99, opt: {character : ".", color : "#FFF", backgroundColor : "#000"}},
{prob: 1, opt: {character : ".", color : "#006", backgroundColor : "#000"}}];
TILES[TERRAIN_STAR_YELLOW] = [
{prob: 51, opt: {character : "~", color : "#D81", backgroundColor : "#DD4"}},
{prob: 49, opt: {character : "~", color : "#DD4", backgroundColor : "#D81"}}];
TILES[TERRAIN_CORONA_YELLOW] = [
{prob: 67, opt: {character : " ", color : "#FFF", backgroundColor : "#000"}},
{prob: 33, opt: {character : " ", color : "#FFF", backgroundColor : "#DD4"}}];
TILES[TERRAIN_BARREN_1] = [
{prob: 100, opt: {character : "~", color : "#000", backgroundColor : "#999"}}];
TILES[TERRAIN_BARREN_2] = [
{prob: 100, opt: {character : "~", color : "#000", backgroundColor : "#BBB"}}];
TILES[TERRAIN_BARREN_3] = [
{prob: 100, opt: {character : "~", color : "#000", backgroundColor : "#555"}}];
TILES[TERRAIN_GRASS] = [
{prob: 100, opt: {character : "\"", color : "#460", backgroundColor : "#0c0"}}];
TILES[TERRAIN_WATER] = [
{prob: 65, opt: {character : "~", color : "#9CF", backgroundColor : "#00F"}},
{prob: 35, opt: {character : " ", color : "#9CF", backgroundColor : "#00F"}}];
TILES[TERRAIN_ICE] = [
{prob: 100, opt: {character : "*", color : "#FFF", backgroundColor : "#9CF"}}];
TILES[TERRAIN_BLACK_HOLE] = [
{prob: 100, opt: {character : " ", color : "#000", backgroundColor : "#000"}}];
TILES[TERRAIN_ANOMALY] = [
{prob: 25, opt: {character : " ", color : "#99F", backgroundColor : "#000"}},
{prob: 25, opt: {character : "?", color : "purple", backgroundColor : "#000"}},
{prob: 25, opt: {character : "?", color : "green", backgroundColor : "#000"}},
{prob: 25, opt: {character : "?", color : "blue", backgroundColor : "#000"}}];
TILES[TERRAIN_QUASAR] = [
{prob: 51, opt: {character : "~", color : "#73A", backgroundColor : "#CEF"}},
{prob: 49, opt: {character : "~", color : "#CEF", backgroundColor : "#73A"}}];
TILES[TERRAIN_QUASAR_JET] = [
{prob: 40, opt: {character : ":", color : "#314", backgroundColor : "#637"}},
{prob: 60, opt: {character : ".", color : "#000", backgroundColor : "#000"}}];
TILES[TERRAIN_CORONA_YELLOW] = [
{prob: 60, opt: {character : ":", color : "#CA1", backgroundColor : "#742"}},
{prob: 40, opt: {character : ".", color : "#000", backgroundColor : "#000"}}];
var TERRAINS = {};
TERRAINS[BODY_STAR_YELLOW] = [{prob: 100, opt: TERRAIN_STAR_YELLOW}];
TERRAINS[BODY_PLANET_BARREN] = [{prob: 33, opt: TERRAIN_BARREN_1}, {prob: 33, opt: TERRAIN_BARREN_2}, {prob: 34, opt: TERRAIN_BARREN_3}];
TERRAINS[BODY_PLANET_TERRAN] = [{prob: 70, opt: TERRAIN_WATER}, {prob: 20, opt: TERRAIN_GRASS}, {prob: 10, opt: TERRAIN_BARREN_1}];
TERRAINS[BODY_PLANET_FROZEN] = [{prob: 80, opt: TERRAIN_ICE}, {prob: 20, opt: TERRAIN_BARREN_1}];
TERRAINS[BODY_ANOMALY] = [{prob: 100, opt: TERRAIN_ANOMALY}];
TERRAINS[BODY_BLACK_HOLE] = [{prob: 100, opt: TERRAIN_BLACK_HOLE}];
TERRAINS[BODY_QUASAR] = [{prob: 100, opt: TERRAIN_QUASAR}];
var CORONAS = {};
CORONAS[BODY_QUASAR] = [{prob: 100, opt: TERRAIN_QUASAR_JET}];
CORONAS[BODY_STAR_YELLOW] = [{prob: 100, opt: TERRAIN_CORONA_YELLOW}];
var JETS = {};
JETS[BODY_QUASAR] = [{prob: 100, opt: TERRAIN_QUASAR_JET}];
var TERRAIN_EFFECTS = {};
TERRAIN_EFFECTS[TERRAIN_STAR_YELLOW] = {
minSpeedForDamage: 0,
damage: 10,
damageType: DAMAGE_NORMAL,
stopOnDeath: true,
disintegrateOnDeath: true,
stopForEvent: false,
terrainName: 'the surface of a star'
};
TERRAIN_EFFECTS[TERRAIN_QUASAR] = {
minSpeedForDamage: 0,
damage: 10,
damageType: DAMAGE_NORMAL,
stopOnDeath: true,
disintegrateOnDeath: true,
stopForEvent: false,
terrainName: 'the surface of a quasar'
};
TERRAIN_EFFECTS[TERRAIN_BLACK_HOLE] = {
minSpeedForDamage: 0,
damage: 100,
damageType: DAMAGE_NORMAL,
stopOnDeath: true,
disintegrateOnDeath: true,
stopForEvent: false,
terrainName: 'the event horizon of a black hole'
};
TERRAIN_EFFECTS[TERRAIN_CORONA_YELLOW] = {
minSpeedForDamage: 0,
damage: 3,
damageType: DAMAGE_ION,
stopOnDeath: false,
disintegrateOnDeath: false,
stopForEvent: false,
terrainName: 'a solar corona'
};
TERRAIN_EFFECTS[TERRAIN_QUASAR_JET] = {
minSpeedForDamage: 0,
damage: 10,
damageType: DAMAGE_ION,
stopOnDeath: false,
disintegrateOnDeath: false,
stopForEvent: false,
terrainName: 'the relativistic ion jet of a quasar'
};
TERRAIN_EFFECTS[TERRAIN_ANOMALY] = {
minSpeedForDamage: 0,
damage: 2,
damageType: DAMAGE_ION,
stopOnDeath: false,
disintegrateOnDeath: false,
stopForEvent: false,
terrainName: 'the bizarre subspatial curvature of an anomaly'
};
const terrestialTerrain = {
minSpeedForDamage: 1,
damage: 2,
damageType: DAMAGE_NORMAL,
stopOnDeath: true,
disintegrateOnDeath: false,
stopForEvent: true,
terrainName: 'the surface of a planet'
};
const harmlessTerrain = {
minSpeedForDamage: 10,
damage: 0,
damageType: DAMAGE_NORMAL,
stopOnDeath: false,
disintegrateOnDeath: false,
stopForEvent: false
};
TERRAIN_EFFECTS[TERRAIN_NONE_EMPTY] = harmlessTerrain;
TERRAIN_EFFECTS[TERRAIN_NONE_DIM_STAR] = harmlessTerrain;
TERRAIN_EFFECTS[TERRAIN_NONE_BRIGHT_STAR] = harmlessTerrain;
TERRAIN_EFFECTS[TERRAIN_BARREN_1] = terrestialTerrain;
TERRAIN_EFFECTS[TERRAIN_BARREN_2] = terrestialTerrain;
TERRAIN_EFFECTS[TERRAIN_BARREN_3] = terrestialTerrain;
TERRAIN_EFFECTS[TERRAIN_WATER] = terrestialTerrain;
TERRAIN_EFFECTS[TERRAIN_ICE] = terrestialTerrain;
TERRAIN_EFFECTS[TERRAIN_GRASS] = terrestialTerrain;
var notEnoughEnergy = new Audio('sounds/Battlecruiser_EnergyLow00.mp3');
var bgm1 = new Audio('sounds/bgm_01.mp3');
bgm1.loop = true;
var bgm2 = new Audio('sounds/bgm_02.mp3');
bgm2.loop = true;
bgms = [bgm1, bgm2];