@gamebob/axon-surge 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/axon-surge.js +916 -877
- package/dist/core/GameEngine.d.ts.map +1 -1
- package/dist/entities/EnemyEntity.d.ts.map +1 -1
- package/dist/factory/EntityFactory.d.ts.map +1 -1
- package/dist/physics/handlers/CoreCollisionHandler.d.ts.map +1 -1
- package/dist/physics/handlers/ThrownCollisionHandler.d.ts.map +1 -1
- package/dist/powerups/PowerUpRegistry.d.ts.map +1 -1
- package/dist/powerups/PowerUpTypes.d.ts.map +1 -1
- package/dist/render/CanvasRenderer.d.ts +1 -0
- package/dist/render/CanvasRenderer.d.ts.map +1 -1
- package/dist/render/EnemyShapeRenderer.d.ts +12 -0
- package/dist/render/EnemyShapeRenderer.d.ts.map +1 -0
- package/dist/render/TutorialArrowRenderer.d.ts.map +1 -1
- package/dist/strategies/FragmentClusterStrategy.d.ts.map +1 -1
- package/dist/strategies/GravityParasiteStrategy.d.ts.map +1 -1
- package/dist/strategies/HeavyShieldStrategy.d.ts.map +1 -1
- package/dist/strategies/PiercingCellStrategy.d.ts.map +1 -1
- package/dist/strategies/ToxicSporeStrategy.d.ts.map +1 -1
- package/dist/theme/GameColors.d.ts +16 -0
- package/dist/theme/GameColors.d.ts.map +1 -0
- package/dist/theme/ThemeManager.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/axon-surge.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class Y {
|
|
2
2
|
listeners = /* @__PURE__ */ new Map();
|
|
3
3
|
on(t, e) {
|
|
4
4
|
return this.listeners.has(t) || this.listeners.set(t, /* @__PURE__ */ new Set()), this.listeners.get(t).add(e), () => this.off(t, e);
|
|
@@ -15,7 +15,7 @@ class W {
|
|
|
15
15
|
this.listeners.clear();
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
class
|
|
18
|
+
class Z {
|
|
19
19
|
animationFrameId = null;
|
|
20
20
|
lastTime = 0;
|
|
21
21
|
nextFrameTime = 0;
|
|
@@ -49,7 +49,7 @@ class Y {
|
|
|
49
49
|
this.lastTime = t, this.nextFrameTime += e, this.nextFrameTime < t - e && (this.nextFrameTime = t + e), this.updateCallback(i), this.renderCallback(), this.animationFrameId = requestAnimationFrame(this.tick);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
const
|
|
52
|
+
const H = {
|
|
53
53
|
core: {
|
|
54
54
|
maxIntegrity: 3,
|
|
55
55
|
invulnerabilityDuration: 1.5,
|
|
@@ -98,14 +98,14 @@ const G = {
|
|
|
98
98
|
absorptionSpeed: 680
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
|
-
class
|
|
101
|
+
class v {
|
|
102
102
|
static instance;
|
|
103
103
|
config;
|
|
104
104
|
constructor() {
|
|
105
|
-
this.config = JSON.parse(JSON.stringify(
|
|
105
|
+
this.config = JSON.parse(JSON.stringify(H));
|
|
106
106
|
}
|
|
107
107
|
static getInstance() {
|
|
108
|
-
return
|
|
108
|
+
return v.instance || (v.instance = new v()), v.instance;
|
|
109
109
|
}
|
|
110
110
|
getConfig() {
|
|
111
111
|
return this.config;
|
|
@@ -123,10 +123,10 @@ class A {
|
|
|
123
123
|
this.config.core.maxIntegrity += t;
|
|
124
124
|
}
|
|
125
125
|
resetToDefault() {
|
|
126
|
-
this.config = JSON.parse(JSON.stringify(
|
|
126
|
+
this.config = JSON.parse(JSON.stringify(H));
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
class
|
|
129
|
+
class $ {
|
|
130
130
|
position;
|
|
131
131
|
radius;
|
|
132
132
|
integrity;
|
|
@@ -139,15 +139,15 @@ class Z {
|
|
|
139
139
|
powerUpCount = 0;
|
|
140
140
|
collectedPowerUpColors = [];
|
|
141
141
|
constructor(t, e) {
|
|
142
|
-
const i =
|
|
142
|
+
const i = v.getInstance().getConfig().core;
|
|
143
143
|
this.position = { x: t, y: e }, this.radius = i.radius, this.integrity = i.maxIntegrity, this.maxIntegrity = i.maxIntegrity, this.maxInvulnerabilityDuration = i.invulnerabilityDuration, this.organicSeed = Math.random() * 100;
|
|
144
144
|
}
|
|
145
145
|
absorbPowerUpColor(t, e = 0.35) {
|
|
146
146
|
this.powerUpCount++, this.collectedPowerUpColors.push(t);
|
|
147
147
|
const i = t.replace("#", "");
|
|
148
148
|
if (i.length === 6) {
|
|
149
|
-
const s = parseInt(i.substring(0, 2), 16), a = parseInt(i.substring(2, 4), 16),
|
|
150
|
-
this.customColor.r = Math.round(this.customColor.r * (1 - e) + s * e), this.customColor.g = Math.round(this.customColor.g * (1 - e) + a * e), this.customColor.b = Math.round(this.customColor.b * (1 - e) +
|
|
149
|
+
const s = parseInt(i.substring(0, 2), 16), a = parseInt(i.substring(2, 4), 16), r = parseInt(i.substring(4, 6), 16);
|
|
150
|
+
this.customColor.r = Math.round(this.customColor.r * (1 - e) + s * e), this.customColor.g = Math.round(this.customColor.g * (1 - e) + a * e), this.customColor.b = Math.round(this.customColor.b * (1 - e) + r * e);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
getHitboxRadius() {
|
|
@@ -166,7 +166,7 @@ class Z {
|
|
|
166
166
|
}
|
|
167
167
|
repairProgress = 0;
|
|
168
168
|
addKillRepair() {
|
|
169
|
-
const t =
|
|
169
|
+
const t = v.getInstance().getConfig().core.vampirismHealProgressRate;
|
|
170
170
|
return t <= 0 ? !1 : (this.repairProgress += t, this.repairProgress >= 1 ? (this.integrity += 1, this.integrity > this.maxIntegrity && (this.maxIntegrity = this.integrity), this.repairProgress = 0, !0) : !1);
|
|
171
171
|
}
|
|
172
172
|
heal(t = 1) {
|
|
@@ -179,11 +179,25 @@ class Z {
|
|
|
179
179
|
return this.invulnerabilityTimer > 0 ? !1 : this.integrity > 0 ? (this.integrity -= 1, this.invulnerabilityTimer = this.maxInvulnerabilityDuration, !0) : !1;
|
|
180
180
|
}
|
|
181
181
|
reset(t, e) {
|
|
182
|
-
const i =
|
|
182
|
+
const i = v.getInstance().getConfig().core;
|
|
183
183
|
this.position = { x: t, y: e }, this.radius = i.radius, this.maxIntegrity = i.maxIntegrity, this.integrity = this.maxIntegrity, this.maxInvulnerabilityDuration = i.invulnerabilityDuration, this.pulsePhase = 0, this.invulnerabilityTimer = 0, this.repairProgress = 0, this.powerUpCount = 0, this.collectedPowerUpColors = [], this.customColor = { r: 0, g: 240, b: 255 };
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
-
|
|
186
|
+
const f = {
|
|
187
|
+
piercer: "#ff2a5f",
|
|
188
|
+
spore: "#39ff14",
|
|
189
|
+
cluster: "#ffd700",
|
|
190
|
+
parasite: "#9d4edd",
|
|
191
|
+
heavy: "#c8d0d8",
|
|
192
|
+
heavyAccent: "#7d8994",
|
|
193
|
+
micro: "#ffd700",
|
|
194
|
+
core: "#00f0ff",
|
|
195
|
+
coreGlow: "rgba(0, 240, 255, 0.85)",
|
|
196
|
+
coreAccent: "#ff00dd",
|
|
197
|
+
shieldEye: "#ffd447",
|
|
198
|
+
experience: "#fbbf24"
|
|
199
|
+
};
|
|
200
|
+
class G {
|
|
187
201
|
id;
|
|
188
202
|
position = { x: 0, y: 0 };
|
|
189
203
|
velocity = { x: 0, y: 0 };
|
|
@@ -194,7 +208,7 @@ class U {
|
|
|
194
208
|
isThrown = !1;
|
|
195
209
|
wasManipulated = !1;
|
|
196
210
|
rotation = 0;
|
|
197
|
-
color =
|
|
211
|
+
color = f.piercer;
|
|
198
212
|
strategy = null;
|
|
199
213
|
hitRadiusPadding = 1.2;
|
|
200
214
|
maxSpeed = 200;
|
|
@@ -242,7 +256,7 @@ class U {
|
|
|
242
256
|
this.active = !1, this.isGrabbed = !1, this.isThrown = !1, this.wasManipulated = !1, this.isDying = !1, this.deathType = "none", this.deathTimer = 0, this.sliceAngle = 0, this.isStationaryShield = !1, this.shieldAngle = 0, this.launchDelay = 0, this.experienceDropPending = !1, this.position = { x: 0, y: 0 }, this.velocity = { x: 0, y: 0 }, this.rotation = 0, this.strategy = null, this.maxSpeed = 200;
|
|
243
257
|
}
|
|
244
258
|
}
|
|
245
|
-
class
|
|
259
|
+
class B {
|
|
246
260
|
id;
|
|
247
261
|
definition;
|
|
248
262
|
position = { x: 0, y: 0 };
|
|
@@ -259,7 +273,7 @@ class H {
|
|
|
259
273
|
this.active && !this.isGrabbed && !this.isHovered && (this.orbitAngle += t * 0.25, this.position.x = e.x + Math.cos(this.orbitAngle) * this.orbitDistance, this.position.y = e.y + Math.sin(this.orbitAngle) * this.orbitDistance);
|
|
260
274
|
}
|
|
261
275
|
}
|
|
262
|
-
class
|
|
276
|
+
class z {
|
|
263
277
|
pointerPosition = { x: 0, y: 0 };
|
|
264
278
|
isPointerDown = !1;
|
|
265
279
|
grabbedEnemy = null;
|
|
@@ -271,17 +285,17 @@ class $ {
|
|
|
271
285
|
this.canvas = t, this.bindEvents();
|
|
272
286
|
}
|
|
273
287
|
updatePointerPos(t, e) {
|
|
274
|
-
const i = this.canvas.getBoundingClientRect(), s = i.width > 0 ? this.canvas.width / i.width : 1, a = i.height > 0 ? this.canvas.height / i.height : 1,
|
|
288
|
+
const i = this.canvas.getBoundingClientRect(), s = i.width > 0 ? this.canvas.width / i.width : 1, a = i.height > 0 ? this.canvas.height / i.height : 1, r = performance.now() / 1e3;
|
|
275
289
|
this.pointerPosition = {
|
|
276
290
|
x: (t - i.left) * s,
|
|
277
291
|
y: (e - i.top) * a
|
|
278
292
|
}, this.pointerHistory.push({
|
|
279
293
|
x: this.pointerPosition.x,
|
|
280
294
|
y: this.pointerPosition.y,
|
|
281
|
-
time:
|
|
295
|
+
time: r
|
|
282
296
|
});
|
|
283
|
-
const
|
|
284
|
-
this.pointerHistory = this.pointerHistory.filter((
|
|
297
|
+
const o = r - 0.08;
|
|
298
|
+
this.pointerHistory = this.pointerHistory.filter((n) => n.time >= o), this.grabbedEnemy && (this.grabbedEnemy.position = { ...this.pointerPosition });
|
|
285
299
|
}
|
|
286
300
|
bindEvents() {
|
|
287
301
|
this.canvas.addEventListener("mousemove", (t) => {
|
|
@@ -321,8 +335,8 @@ class $ {
|
|
|
321
335
|
const i = e ? 50 : 20;
|
|
322
336
|
for (const s of t) {
|
|
323
337
|
if (!s.active || s.isGrabbed || s.isThrown || s.wasManipulated || s.launchDelay > 0) continue;
|
|
324
|
-
const a = this.pointerPosition.x - s.position.x,
|
|
325
|
-
if (Math.hypot(a,
|
|
338
|
+
const a = this.pointerPosition.x - s.position.x, r = this.pointerPosition.y - s.position.y;
|
|
339
|
+
if (Math.hypot(a, r) <= s.getHitRadius() + i)
|
|
326
340
|
return s.isGrabbed = !0, this.grabbedEnemy = s, this.dragStart = { ...this.pointerPosition }, this.pointerHistory = [], s;
|
|
327
341
|
}
|
|
328
342
|
return null;
|
|
@@ -332,8 +346,8 @@ class $ {
|
|
|
332
346
|
const i = e ? 50 : 20;
|
|
333
347
|
for (const s of t) {
|
|
334
348
|
if (!s.active || s.isGrabbed) continue;
|
|
335
|
-
const a = this.pointerPosition.x - s.position.x,
|
|
336
|
-
if (Math.hypot(a,
|
|
349
|
+
const a = this.pointerPosition.x - s.position.x, r = this.pointerPosition.y - s.position.y;
|
|
350
|
+
if (Math.hypot(a, r) <= s.radius * 1.5 + i)
|
|
337
351
|
return s.isGrabbed = !0, this.grabbedOrb = s, s;
|
|
338
352
|
}
|
|
339
353
|
return null;
|
|
@@ -342,26 +356,26 @@ class $ {
|
|
|
342
356
|
if (!this.grabbedEnemy) return null;
|
|
343
357
|
const t = this.grabbedEnemy;
|
|
344
358
|
t.isGrabbed = !1, t.isThrown = !0, t.wasManipulated = !0;
|
|
345
|
-
const i = performance.now() / 1e3 - 0.08, s = this.pointerHistory.filter((
|
|
346
|
-
let a = 0,
|
|
359
|
+
const i = performance.now() / 1e3 - 0.08, s = this.pointerHistory.filter((n) => n.time >= i);
|
|
360
|
+
let a = 0, r = 0;
|
|
347
361
|
if (s.length >= 2) {
|
|
348
|
-
const
|
|
349
|
-
a = (
|
|
362
|
+
const n = s[0], l = s[s.length - 1], h = Math.max(0.01, l.time - n.time);
|
|
363
|
+
a = (l.x - n.x) / h, r = (l.y - n.y) / h;
|
|
350
364
|
}
|
|
351
|
-
const
|
|
352
|
-
if (
|
|
353
|
-
const
|
|
365
|
+
const o = Math.hypot(a, r);
|
|
366
|
+
if (o > 30) {
|
|
367
|
+
const l = Math.min(o * 1.15, 2500), h = Math.atan2(r, a);
|
|
354
368
|
t.velocity = {
|
|
355
|
-
x: Math.cos(
|
|
356
|
-
y: Math.sin(
|
|
369
|
+
x: Math.cos(h) * l,
|
|
370
|
+
y: Math.sin(h) * l
|
|
357
371
|
};
|
|
358
372
|
} else if (this.dragStart) {
|
|
359
|
-
const
|
|
360
|
-
if (
|
|
361
|
-
const
|
|
373
|
+
const n = t.position.x - this.dragStart.x, l = t.position.y - this.dragStart.y, h = Math.hypot(n, l);
|
|
374
|
+
if (h > 5) {
|
|
375
|
+
const c = Math.atan2(l, n), p = Math.min(h * 4, 600);
|
|
362
376
|
t.velocity = {
|
|
363
|
-
x: Math.cos(
|
|
364
|
-
y: Math.sin(
|
|
377
|
+
x: Math.cos(c) * p,
|
|
378
|
+
y: Math.sin(c) * p
|
|
365
379
|
};
|
|
366
380
|
} else
|
|
367
381
|
t.velocity = { x: 0, y: 0 }, t.isThrown = !1;
|
|
@@ -369,8 +383,8 @@ class $ {
|
|
|
369
383
|
if (t.type === "heavy")
|
|
370
384
|
t.shieldAngle = t.rotation, t.velocity = { x: 0, y: 0 }, t.isStationaryShield = !0, t.isThrown = !1;
|
|
371
385
|
else if (t.type === "piercer") {
|
|
372
|
-
const
|
|
373
|
-
|
|
386
|
+
const n = v.getInstance().getConfig().piercer;
|
|
387
|
+
n.hasHoming && (t.remainingHomingKills = n.homingTargets);
|
|
374
388
|
}
|
|
375
389
|
return this.grabbedEnemy = null, this.dragStart = null, this.pointerHistory = [], t;
|
|
376
390
|
}
|
|
@@ -381,7 +395,7 @@ class $ {
|
|
|
381
395
|
this.grabbedEnemy = null, this.grabbedOrb = null, this.dragStart = null, this.pointerHistory = [], this.isPointerDown = !1;
|
|
382
396
|
}
|
|
383
397
|
}
|
|
384
|
-
class
|
|
398
|
+
class J {
|
|
385
399
|
cellSize;
|
|
386
400
|
grid = /* @__PURE__ */ new Map();
|
|
387
401
|
constructor(t = 100) {
|
|
@@ -392,23 +406,23 @@ class z {
|
|
|
392
406
|
}
|
|
393
407
|
insert(t) {
|
|
394
408
|
const e = Math.floor((t.position.x - t.radius) / this.cellSize), i = Math.floor((t.position.x + t.radius) / this.cellSize), s = Math.floor((t.position.y - t.radius) / this.cellSize), a = Math.floor((t.position.y + t.radius) / this.cellSize);
|
|
395
|
-
for (let
|
|
396
|
-
for (let
|
|
397
|
-
const
|
|
398
|
-
this.grid.has(
|
|
409
|
+
for (let r = e; r <= i; r++)
|
|
410
|
+
for (let o = s; o <= a; o++) {
|
|
411
|
+
const n = `${r}:${o}`;
|
|
412
|
+
this.grid.has(n) || this.grid.set(n, /* @__PURE__ */ new Set()), this.grid.get(n).add(t);
|
|
399
413
|
}
|
|
400
414
|
}
|
|
401
415
|
getNearby(t, e) {
|
|
402
|
-
const i = /* @__PURE__ */ new Set(), s = Math.floor((t.x - e) / this.cellSize), a = Math.floor((t.x + e) / this.cellSize),
|
|
403
|
-
for (let
|
|
404
|
-
for (let
|
|
405
|
-
const
|
|
406
|
-
|
|
416
|
+
const i = /* @__PURE__ */ new Set(), s = Math.floor((t.x - e) / this.cellSize), a = Math.floor((t.x + e) / this.cellSize), r = Math.floor((t.y - e) / this.cellSize), o = Math.floor((t.y + e) / this.cellSize);
|
|
417
|
+
for (let n = s; n <= a; n++)
|
|
418
|
+
for (let l = r; l <= o; l++) {
|
|
419
|
+
const h = `${n}:${l}`, c = this.grid.get(h);
|
|
420
|
+
c && c.forEach((p) => i.add(p));
|
|
407
421
|
}
|
|
408
422
|
return i;
|
|
409
423
|
}
|
|
410
424
|
}
|
|
411
|
-
class
|
|
425
|
+
class X {
|
|
412
426
|
shakeTime = 0;
|
|
413
427
|
shakeDuration = 0.14;
|
|
414
428
|
shakeIntensity = 0;
|
|
@@ -1294,7 +1308,7 @@ const D = {
|
|
|
1294
1308
|
pu_core_ring_title: "核心过载",
|
|
1295
1309
|
pu_core_ring_desc: "+1 生命环"
|
|
1296
1310
|
}
|
|
1297
|
-
},
|
|
1311
|
+
}, W = [
|
|
1298
1312
|
"es",
|
|
1299
1313
|
"en",
|
|
1300
1314
|
"fr",
|
|
@@ -1311,29 +1325,29 @@ const D = {
|
|
|
1311
1325
|
"ko",
|
|
1312
1326
|
"zh"
|
|
1313
1327
|
];
|
|
1314
|
-
function
|
|
1315
|
-
return
|
|
1328
|
+
function k(b) {
|
|
1329
|
+
return W.includes(b);
|
|
1316
1330
|
}
|
|
1317
|
-
const
|
|
1318
|
-
class
|
|
1331
|
+
const K = "axon_surge_language";
|
|
1332
|
+
class j {
|
|
1319
1333
|
currentLanguage;
|
|
1320
1334
|
constructor(t) {
|
|
1321
1335
|
this.currentLanguage = this.detectLanguage(t);
|
|
1322
1336
|
}
|
|
1323
1337
|
detectLanguage(t) {
|
|
1324
1338
|
try {
|
|
1325
|
-
const e = localStorage.getItem(
|
|
1326
|
-
if (e &&
|
|
1339
|
+
const e = localStorage.getItem(K);
|
|
1340
|
+
if (e && k(e))
|
|
1327
1341
|
return e;
|
|
1328
1342
|
} catch {
|
|
1329
1343
|
}
|
|
1330
|
-
if (t &&
|
|
1344
|
+
if (t && k(t))
|
|
1331
1345
|
return t;
|
|
1332
1346
|
try {
|
|
1333
1347
|
const e = (document.documentElement.lang || document.body?.getAttribute("lang") || document.documentElement.getAttribute("data-lang") || "").toLowerCase();
|
|
1334
1348
|
if (e) {
|
|
1335
1349
|
const i = e.split("-")[0];
|
|
1336
|
-
if (i &&
|
|
1350
|
+
if (i && k(i))
|
|
1337
1351
|
return i;
|
|
1338
1352
|
}
|
|
1339
1353
|
} catch {
|
|
@@ -1342,7 +1356,7 @@ class X {
|
|
|
1342
1356
|
const e = (navigator.language || navigator.languages && navigator.languages[0] || "").toLowerCase();
|
|
1343
1357
|
if (e) {
|
|
1344
1358
|
const i = e.split("-")[0];
|
|
1345
|
-
if (i &&
|
|
1359
|
+
if (i && k(i))
|
|
1346
1360
|
return i;
|
|
1347
1361
|
}
|
|
1348
1362
|
} catch {
|
|
@@ -1353,7 +1367,7 @@ class X {
|
|
|
1353
1367
|
if (D[t]) {
|
|
1354
1368
|
this.currentLanguage = t;
|
|
1355
1369
|
try {
|
|
1356
|
-
localStorage.setItem(
|
|
1370
|
+
localStorage.setItem(K, t);
|
|
1357
1371
|
} catch {
|
|
1358
1372
|
}
|
|
1359
1373
|
}
|
|
@@ -1363,36 +1377,36 @@ class X {
|
|
|
1363
1377
|
}
|
|
1364
1378
|
translate(t, e) {
|
|
1365
1379
|
let s = (D[this.currentLanguage] || D.en)[t] || D.en[t] || String(t);
|
|
1366
|
-
return e && Object.entries(e).forEach(([a,
|
|
1367
|
-
s = s.replace(`{${a}}`, String(
|
|
1380
|
+
return e && Object.entries(e).forEach(([a, r]) => {
|
|
1381
|
+
s = s.replace(`{${a}}`, String(r));
|
|
1368
1382
|
}), s;
|
|
1369
1383
|
}
|
|
1370
1384
|
}
|
|
1371
|
-
class
|
|
1385
|
+
class q {
|
|
1372
1386
|
static update(t, e, i) {
|
|
1373
|
-
const s =
|
|
1387
|
+
const s = v.getInstance().getConfig();
|
|
1374
1388
|
for (let a = t.length - 1; a >= 0; a--) {
|
|
1375
|
-
const
|
|
1376
|
-
if (
|
|
1377
|
-
|
|
1378
|
-
for (const
|
|
1379
|
-
if (!
|
|
1380
|
-
const
|
|
1381
|
-
if (
|
|
1382
|
-
const p = Math.pow(1 -
|
|
1383
|
-
|
|
1389
|
+
const r = t[a];
|
|
1390
|
+
if (r) {
|
|
1391
|
+
r.duration += i;
|
|
1392
|
+
for (const o of e) {
|
|
1393
|
+
if (!o.active || o.isGrabbed || o.isDying || o.isStationaryShield || o.launchDelay > 0 || o.isThrown && o.type === "piercer") continue;
|
|
1394
|
+
const n = r.position.x - o.position.x, l = r.position.y - o.position.y, h = n * n + l * l, c = Math.sqrt(h);
|
|
1395
|
+
if (c > 2 && h <= r.radius * r.radius) {
|
|
1396
|
+
const p = Math.pow(1 - c / r.radius, 0.7), g = r.pullForce * p, _ = Math.atan2(l, n);
|
|
1397
|
+
o.velocity.x += Math.cos(_) * g * i, o.velocity.y += Math.sin(_) * g * i, o.position.x += Math.cos(_) * g * i * 0.8, o.position.y += Math.sin(_) * g * i * 0.8;
|
|
1384
1398
|
}
|
|
1385
1399
|
}
|
|
1386
|
-
if (
|
|
1400
|
+
if (r.duration >= r.maxDuration) {
|
|
1387
1401
|
if (s.gravityVortex.hasImplosionLaunch)
|
|
1388
|
-
for (const
|
|
1389
|
-
if (!
|
|
1390
|
-
const
|
|
1391
|
-
if (
|
|
1392
|
-
const
|
|
1393
|
-
|
|
1394
|
-
x: Math.cos(
|
|
1395
|
-
y: Math.sin(
|
|
1402
|
+
for (const o of e) {
|
|
1403
|
+
if (!o.active || o.isDying) continue;
|
|
1404
|
+
const n = o.position.x - r.position.x, l = o.position.y - r.position.y;
|
|
1405
|
+
if (n * n + l * l <= r.radius * r.radius) {
|
|
1406
|
+
const c = Math.atan2(l, n), p = 1200;
|
|
1407
|
+
o.isThrown = !0, o.wasManipulated = !0, o.velocity = {
|
|
1408
|
+
x: Math.cos(c) * p,
|
|
1409
|
+
y: Math.sin(c) * p
|
|
1396
1410
|
};
|
|
1397
1411
|
}
|
|
1398
1412
|
}
|
|
@@ -1402,33 +1416,33 @@ class j {
|
|
|
1402
1416
|
}
|
|
1403
1417
|
}
|
|
1404
1418
|
}
|
|
1405
|
-
class
|
|
1406
|
-
static update(t, e, i, s, a,
|
|
1407
|
-
for (const
|
|
1408
|
-
if (!
|
|
1409
|
-
const p = t.position.x -
|
|
1410
|
-
if (Math.hypot(p,
|
|
1411
|
-
if (
|
|
1412
|
-
|
|
1419
|
+
class Q {
|
|
1420
|
+
static update(t, e, i, s, a, r, o, n, l, h) {
|
|
1421
|
+
for (const c of e) {
|
|
1422
|
+
if (!c.active || c.isGrabbed || c.isDying || c.launchDelay > 0) continue;
|
|
1423
|
+
const p = t.position.x - c.position.x, g = t.position.y - c.position.y;
|
|
1424
|
+
if (Math.hypot(p, g) <= t.getHitboxRadius() + c.radius) {
|
|
1425
|
+
if (c.active = !1, t.takeDamage()) {
|
|
1426
|
+
o.emit("onCoreDamaged", { currentIntegrity: t.integrity }), i.push({
|
|
1413
1427
|
id: Math.random().toString(),
|
|
1414
1428
|
position: { ...t.position },
|
|
1415
1429
|
radius: 20,
|
|
1416
|
-
maxRadius: Math.max(
|
|
1417
|
-
color:
|
|
1430
|
+
maxRadius: Math.max(l, h) * 1.3,
|
|
1431
|
+
color: f.core,
|
|
1418
1432
|
alpha: 1,
|
|
1419
1433
|
lifetime: 0,
|
|
1420
1434
|
maxLifetime: 0.8
|
|
1421
|
-
}),
|
|
1435
|
+
}), r.triggerScreenShake({ x: p, y: g }, 25), r.triggerHitstop(0.15), r.triggerFlash(0.6);
|
|
1422
1436
|
for (const u of e)
|
|
1423
1437
|
if (u.active && !u.isGrabbed && u.launchDelay <= 0) {
|
|
1424
1438
|
u.triggerDissolveDeath();
|
|
1425
|
-
for (let
|
|
1426
|
-
const
|
|
1439
|
+
for (let d = 0; d < 8; d++) {
|
|
1440
|
+
const x = Math.random() * Math.PI * 2, y = 100 + Math.random() * 200;
|
|
1427
1441
|
s.push({
|
|
1428
1442
|
id: Math.random().toString(),
|
|
1429
1443
|
position: { ...u.position },
|
|
1430
|
-
velocity: { x: Math.cos(
|
|
1431
|
-
color:
|
|
1444
|
+
velocity: { x: Math.cos(x) * y, y: Math.sin(x) * y },
|
|
1445
|
+
color: f.core,
|
|
1432
1446
|
radius: 3 + Math.random() * 3,
|
|
1433
1447
|
alpha: 1,
|
|
1434
1448
|
lifetime: 0,
|
|
@@ -1441,50 +1455,50 @@ class q {
|
|
|
1441
1455
|
text: "CORE OVERLOAD PULSE!",
|
|
1442
1456
|
position: { ...t.position },
|
|
1443
1457
|
velocity: { x: 0, y: -90 },
|
|
1444
|
-
color:
|
|
1458
|
+
color: f.core,
|
|
1445
1459
|
alpha: 1,
|
|
1446
1460
|
lifetime: 0,
|
|
1447
1461
|
maxLifetime: 1.5,
|
|
1448
1462
|
size: 32
|
|
1449
|
-
}), t.integrity <= 0 &&
|
|
1463
|
+
}), t.integrity <= 0 && o.emit("onGameOver", { score: n.value, wave: 1 });
|
|
1450
1464
|
}
|
|
1451
1465
|
break;
|
|
1452
1466
|
}
|
|
1453
1467
|
}
|
|
1454
1468
|
}
|
|
1455
1469
|
}
|
|
1456
|
-
class
|
|
1470
|
+
class tt {
|
|
1457
1471
|
execute(t) {
|
|
1458
|
-
const { thrownEnemy: e, targetEnemy: i, shockwaves: s, particles: a, floatingTexts:
|
|
1472
|
+
const { thrownEnemy: e, targetEnemy: i, shockwaves: s, particles: a, floatingTexts: r } = t;
|
|
1459
1473
|
i.experienceDropPending = !0, i.active = !1, s.push({
|
|
1460
1474
|
id: Math.random().toString(),
|
|
1461
1475
|
position: { ...i.position },
|
|
1462
1476
|
radius: 10,
|
|
1463
1477
|
maxRadius: 180,
|
|
1464
|
-
color:
|
|
1478
|
+
color: f.piercer,
|
|
1465
1479
|
alpha: 1,
|
|
1466
1480
|
lifetime: 0,
|
|
1467
1481
|
maxLifetime: 0.5
|
|
1468
1482
|
});
|
|
1469
|
-
for (let
|
|
1470
|
-
const
|
|
1483
|
+
for (let o = 0; o < 30; o++) {
|
|
1484
|
+
const n = Math.random() * Math.PI * 2, l = 180 + Math.random() * 320;
|
|
1471
1485
|
a.push({
|
|
1472
1486
|
id: Math.random().toString(),
|
|
1473
1487
|
position: { ...i.position },
|
|
1474
|
-
velocity: { x: Math.cos(
|
|
1475
|
-
color:
|
|
1488
|
+
velocity: { x: Math.cos(n) * l, y: Math.sin(n) * l },
|
|
1489
|
+
color: f.piercer,
|
|
1476
1490
|
radius: 3 + Math.random() * 4,
|
|
1477
1491
|
alpha: 1,
|
|
1478
1492
|
lifetime: 0,
|
|
1479
1493
|
maxLifetime: 0.5
|
|
1480
1494
|
});
|
|
1481
1495
|
}
|
|
1482
|
-
|
|
1496
|
+
r.push({
|
|
1483
1497
|
id: Math.random().toString(),
|
|
1484
1498
|
text: "PIERCING SLICE",
|
|
1485
1499
|
position: { ...i.position },
|
|
1486
1500
|
velocity: { x: 0, y: -50 },
|
|
1487
|
-
color:
|
|
1501
|
+
color: f.piercer,
|
|
1488
1502
|
alpha: 1,
|
|
1489
1503
|
lifetime: 0,
|
|
1490
1504
|
maxLifetime: 0.8,
|
|
@@ -1492,109 +1506,109 @@ class Q {
|
|
|
1492
1506
|
});
|
|
1493
1507
|
}
|
|
1494
1508
|
}
|
|
1495
|
-
class
|
|
1509
|
+
class et {
|
|
1496
1510
|
execute(t) {
|
|
1497
|
-
const { thrownEnemy: e, pools: i, shockwaves: s, particles: a, floatingTexts:
|
|
1511
|
+
const { thrownEnemy: e, pools: i, shockwaves: s, particles: a, floatingTexts: r, eventBus: o } = t, n = e.position, l = v.getInstance().getConfig();
|
|
1498
1512
|
i.push({
|
|
1499
1513
|
id: Math.random().toString(),
|
|
1500
|
-
position: { ...
|
|
1501
|
-
radius: Math.round(
|
|
1514
|
+
position: { ...n },
|
|
1515
|
+
radius: Math.round(l.toxicPool.baseRadius * 2),
|
|
1502
1516
|
duration: 0,
|
|
1503
|
-
maxDuration:
|
|
1504
|
-
damage:
|
|
1517
|
+
maxDuration: l.toxicPool.baseDuration * 1.5,
|
|
1518
|
+
damage: l.toxicPool.damage
|
|
1505
1519
|
}), s.push({
|
|
1506
1520
|
id: Math.random().toString(),
|
|
1507
|
-
position: { ...
|
|
1521
|
+
position: { ...n },
|
|
1508
1522
|
radius: 10,
|
|
1509
|
-
maxRadius: Math.round(
|
|
1510
|
-
color:
|
|
1523
|
+
maxRadius: Math.round(l.toxicPool.baseRadius * 2.2),
|
|
1524
|
+
color: f.spore,
|
|
1511
1525
|
alpha: 1,
|
|
1512
1526
|
lifetime: 0,
|
|
1513
1527
|
maxLifetime: 0.6
|
|
1514
1528
|
});
|
|
1515
|
-
for (let
|
|
1516
|
-
const
|
|
1529
|
+
for (let h = 0; h < 45; h++) {
|
|
1530
|
+
const c = Math.random() * Math.PI * 2, p = 120 + Math.random() * 260;
|
|
1517
1531
|
a.push({
|
|
1518
1532
|
id: Math.random().toString(),
|
|
1519
|
-
position: { ...
|
|
1520
|
-
velocity: { x: Math.cos(
|
|
1521
|
-
color:
|
|
1533
|
+
position: { ...n },
|
|
1534
|
+
velocity: { x: Math.cos(c) * p, y: Math.sin(c) * p },
|
|
1535
|
+
color: f.spore,
|
|
1522
1536
|
radius: 4 + Math.random() * 5,
|
|
1523
1537
|
alpha: 1,
|
|
1524
1538
|
lifetime: 0,
|
|
1525
1539
|
maxLifetime: 0.9
|
|
1526
1540
|
});
|
|
1527
1541
|
}
|
|
1528
|
-
|
|
1542
|
+
r.push({
|
|
1529
1543
|
id: Math.random().toString(),
|
|
1530
1544
|
text: "MASSIVE SPORE NEBULA",
|
|
1531
|
-
position: { ...
|
|
1545
|
+
position: { ...n },
|
|
1532
1546
|
velocity: { x: 0, y: -60 },
|
|
1533
|
-
color:
|
|
1547
|
+
color: f.spore,
|
|
1534
1548
|
alpha: 1,
|
|
1535
1549
|
lifetime: 0,
|
|
1536
1550
|
maxLifetime: 1.2,
|
|
1537
1551
|
size: 26
|
|
1538
|
-
}), e.experienceDropPending = !0, e.active = !1,
|
|
1552
|
+
}), e.experienceDropPending = !0, e.active = !1, o.emit("onPoolCreated", { position: n });
|
|
1539
1553
|
}
|
|
1540
1554
|
}
|
|
1541
|
-
class
|
|
1555
|
+
class it {
|
|
1542
1556
|
execute(t) {
|
|
1543
|
-
const { thrownEnemy: e, targetEnemy: i, allEnemies: s, shockwaves: a, particles:
|
|
1557
|
+
const { thrownEnemy: e, targetEnemy: i, allEnemies: s, shockwaves: a, particles: r, floatingTexts: o } = t, n = i.position;
|
|
1544
1558
|
e.experienceDropPending = !0, i.experienceDropPending = !0, e.active = !1, i.active = !1, a.push({
|
|
1545
1559
|
id: Math.random().toString(),
|
|
1546
|
-
position: { ...
|
|
1560
|
+
position: { ...n },
|
|
1547
1561
|
radius: 15,
|
|
1548
1562
|
maxRadius: 280,
|
|
1549
|
-
color:
|
|
1563
|
+
color: f.cluster,
|
|
1550
1564
|
alpha: 1,
|
|
1551
1565
|
lifetime: 0,
|
|
1552
1566
|
maxLifetime: 0.6
|
|
1553
1567
|
});
|
|
1554
|
-
const
|
|
1555
|
-
for (let p = 0; p <
|
|
1556
|
-
const
|
|
1557
|
-
x:
|
|
1558
|
-
y:
|
|
1568
|
+
const l = v.getInstance().getConfig(), h = l.cluster.fragmentCount, c = l.cluster.hasHoming;
|
|
1569
|
+
for (let p = 0; p < h; p++) {
|
|
1570
|
+
const g = p * Math.PI * 2 / h, _ = 800 + Math.random() * 300, m = {
|
|
1571
|
+
x: n.x + Math.cos(g) * 45,
|
|
1572
|
+
y: n.y + Math.sin(g) * 45
|
|
1559
1573
|
};
|
|
1560
|
-
let u =
|
|
1561
|
-
if (
|
|
1562
|
-
let
|
|
1563
|
-
for (const
|
|
1564
|
-
if (
|
|
1565
|
-
const
|
|
1566
|
-
|
|
1574
|
+
let u = g;
|
|
1575
|
+
if (c) {
|
|
1576
|
+
let x = null, y = 1 / 0;
|
|
1577
|
+
for (const E of s) {
|
|
1578
|
+
if (E === e || E === i || !E.active || E.isGrabbed || E.isDying) continue;
|
|
1579
|
+
const I = Math.hypot(E.position.x - m.x, E.position.y - m.y);
|
|
1580
|
+
I < y && (y = I, x = E);
|
|
1567
1581
|
}
|
|
1568
|
-
|
|
1582
|
+
x && (u = Math.atan2(x.position.y - m.y, x.position.x - m.x));
|
|
1569
1583
|
}
|
|
1570
|
-
const
|
|
1584
|
+
const d = P.createEnemy("micro", m, {
|
|
1571
1585
|
x: m.x + Math.cos(u) * 500,
|
|
1572
1586
|
y: m.y + Math.sin(u) * 500
|
|
1573
1587
|
});
|
|
1574
|
-
|
|
1588
|
+
d.isThrown = !0, d.wasManipulated = !0, d.velocity = {
|
|
1575
1589
|
x: Math.cos(u) * _,
|
|
1576
1590
|
y: Math.sin(u) * _
|
|
1577
|
-
}, s.push(
|
|
1591
|
+
}, s.push(d);
|
|
1578
1592
|
}
|
|
1579
1593
|
for (let p = 0; p < 35; p++) {
|
|
1580
|
-
const
|
|
1581
|
-
|
|
1594
|
+
const g = Math.random() * Math.PI * 2, _ = 200 + Math.random() * 300;
|
|
1595
|
+
r.push({
|
|
1582
1596
|
id: Math.random().toString(),
|
|
1583
|
-
position: { ...
|
|
1584
|
-
velocity: { x: Math.cos(
|
|
1585
|
-
color:
|
|
1597
|
+
position: { ...n },
|
|
1598
|
+
velocity: { x: Math.cos(g) * _, y: Math.sin(g) * _ },
|
|
1599
|
+
color: f.cluster,
|
|
1586
1600
|
radius: 4 + Math.random() * 4,
|
|
1587
1601
|
alpha: 1,
|
|
1588
1602
|
lifetime: 0,
|
|
1589
1603
|
maxLifetime: 0.6
|
|
1590
1604
|
});
|
|
1591
1605
|
}
|
|
1592
|
-
|
|
1606
|
+
o.push({
|
|
1593
1607
|
id: Math.random().toString(),
|
|
1594
1608
|
text: "CLUSTER DETONATION",
|
|
1595
|
-
position: { ...
|
|
1609
|
+
position: { ...n },
|
|
1596
1610
|
velocity: { x: 0, y: -60 },
|
|
1597
|
-
color:
|
|
1611
|
+
color: f.cluster,
|
|
1598
1612
|
alpha: 1,
|
|
1599
1613
|
lifetime: 0,
|
|
1600
1614
|
maxLifetime: 1,
|
|
@@ -1602,36 +1616,36 @@ class et {
|
|
|
1602
1616
|
});
|
|
1603
1617
|
}
|
|
1604
1618
|
}
|
|
1605
|
-
class
|
|
1619
|
+
class st {
|
|
1606
1620
|
execute(t) {
|
|
1607
|
-
const { thrownEnemy: e, targetEnemy: i, vortices: s, shockwaves: a } = t,
|
|
1621
|
+
const { thrownEnemy: e, targetEnemy: i, vortices: s, shockwaves: a } = t, r = v.getInstance().getConfig(), o = {
|
|
1608
1622
|
x: (e.position.x + i.position.x) / 2,
|
|
1609
1623
|
y: (e.position.y + i.position.y) / 2
|
|
1610
1624
|
};
|
|
1611
1625
|
s.push({
|
|
1612
1626
|
id: Math.random().toString(),
|
|
1613
|
-
position:
|
|
1614
|
-
radius: Math.round(
|
|
1627
|
+
position: o,
|
|
1628
|
+
radius: Math.round(r.gravityVortex.baseRadius * 2.2),
|
|
1615
1629
|
duration: 0,
|
|
1616
|
-
maxDuration:
|
|
1617
|
-
pullForce:
|
|
1630
|
+
maxDuration: r.gravityVortex.baseDuration * 1.5,
|
|
1631
|
+
pullForce: r.gravityVortex.basePullForce * 1.6
|
|
1618
1632
|
}), a.push({
|
|
1619
1633
|
id: Math.random().toString(),
|
|
1620
|
-
position:
|
|
1634
|
+
position: o,
|
|
1621
1635
|
radius: 20,
|
|
1622
|
-
maxRadius: Math.round(
|
|
1623
|
-
color:
|
|
1636
|
+
maxRadius: Math.round(r.gravityVortex.baseRadius * 2.2),
|
|
1637
|
+
color: f.parasite,
|
|
1624
1638
|
alpha: 1,
|
|
1625
1639
|
lifetime: 0,
|
|
1626
1640
|
maxLifetime: 0.65
|
|
1627
1641
|
}), e.triggerDissolveDeath(!0), i.triggerDissolveDeath(!0);
|
|
1628
1642
|
}
|
|
1629
1643
|
}
|
|
1630
|
-
class
|
|
1644
|
+
class at {
|
|
1631
1645
|
execute(t) {
|
|
1632
|
-
const { thrownEnemy: e, targetEnemy: i, allEnemies: s, shockwaves: a, particles:
|
|
1633
|
-
for (const [_, m] of
|
|
1634
|
-
const u =
|
|
1646
|
+
const { thrownEnemy: e, targetEnemy: i, allEnemies: s, shockwaves: a, particles: r, floatingTexts: o } = t, n = i.position.x - e.position.x, l = i.position.y - e.position.y, h = Math.atan2(l, n), c = v.getInstance().getConfig().shield, p = c.blastSpeed || 1400, g = c.isFanBlast ? [0, -c.fanBlastAngle, c.fanBlastAngle] : [0];
|
|
1647
|
+
for (const [_, m] of g.entries()) {
|
|
1648
|
+
const u = h + m, d = _ === 0 ? e : P.createEnemy(
|
|
1635
1649
|
"heavy",
|
|
1636
1650
|
{
|
|
1637
1651
|
x: e.position.x + Math.cos(u) * 30,
|
|
@@ -1639,41 +1653,41 @@ class st {
|
|
|
1639
1653
|
},
|
|
1640
1654
|
{ x: 0, y: 0 }
|
|
1641
1655
|
);
|
|
1642
|
-
|
|
1656
|
+
d.isStationaryShield = !1, d.isThrown = !0, d.wasManipulated = !0, d.shieldAngle = u, d.rotation = u, d.launchDelay = c.isFanBlast ? _ * c.fanBlastInterval : 0, d.velocity = {
|
|
1643
1657
|
x: Math.cos(u) * p,
|
|
1644
1658
|
y: Math.sin(u) * p
|
|
1645
|
-
},
|
|
1659
|
+
}, d !== e && s.push(d);
|
|
1646
1660
|
}
|
|
1647
|
-
i.active = !1, i.triggerDissolveDeath(!0),
|
|
1661
|
+
i.active = !1, i.triggerDissolveDeath(!0), o.push({
|
|
1648
1662
|
id: Math.random().toString(),
|
|
1649
1663
|
text: "ARC BLAST!",
|
|
1650
1664
|
position: { ...e.position },
|
|
1651
1665
|
velocity: { x: 0, y: -50 },
|
|
1652
|
-
color:
|
|
1666
|
+
color: f.heavy,
|
|
1653
1667
|
alpha: 1,
|
|
1654
1668
|
lifetime: 0,
|
|
1655
1669
|
maxLifetime: 0.9,
|
|
1656
1670
|
size: 24
|
|
1657
1671
|
});
|
|
1658
1672
|
for (let _ = 0; _ < 50; _++) {
|
|
1659
|
-
const m = (Math.random() - 0.5) * 1.5, u =
|
|
1660
|
-
|
|
1673
|
+
const m = (Math.random() - 0.5) * 1.5, u = h + m, d = 300 + Math.random() * 500;
|
|
1674
|
+
r.push({
|
|
1661
1675
|
id: Math.random().toString(),
|
|
1662
1676
|
position: { ...e.position },
|
|
1663
|
-
velocity: { x: Math.cos(u) *
|
|
1664
|
-
color:
|
|
1677
|
+
velocity: { x: Math.cos(u) * d, y: Math.sin(u) * d },
|
|
1678
|
+
color: f.heavy,
|
|
1665
1679
|
radius: 4 + Math.random() * 6,
|
|
1666
1680
|
alpha: 1,
|
|
1667
1681
|
lifetime: 0,
|
|
1668
1682
|
maxLifetime: 0.7
|
|
1669
1683
|
});
|
|
1670
1684
|
}
|
|
1671
|
-
|
|
1685
|
+
o.push({
|
|
1672
1686
|
id: Math.random().toString(),
|
|
1673
1687
|
text: "ARC BLAST!",
|
|
1674
1688
|
position: { ...e.position },
|
|
1675
1689
|
velocity: { x: 0, y: -50 },
|
|
1676
|
-
color:
|
|
1690
|
+
color: f.heavy,
|
|
1677
1691
|
alpha: 1,
|
|
1678
1692
|
lifetime: 0,
|
|
1679
1693
|
maxLifetime: 0.9,
|
|
@@ -1681,25 +1695,25 @@ class st {
|
|
|
1681
1695
|
});
|
|
1682
1696
|
}
|
|
1683
1697
|
}
|
|
1684
|
-
class
|
|
1698
|
+
class P {
|
|
1685
1699
|
static createEnemy(t, e, i) {
|
|
1686
|
-
const s = `enemy_${Date.now()}_${Math.random()}`, a = new
|
|
1700
|
+
const s = `enemy_${Date.now()}_${Math.random()}`, a = new G(s);
|
|
1687
1701
|
return this.configureEnemy(a, t, e, i), a;
|
|
1688
1702
|
}
|
|
1689
1703
|
static configureEnemy(t, e, i, s) {
|
|
1690
1704
|
t.type = e, t.position = { ...i }, t.active = !0, t.isGrabbed = !1, t.isThrown = !1;
|
|
1691
|
-
const a = s.x - i.x,
|
|
1692
|
-
let
|
|
1693
|
-
e === "piercer" ? (
|
|
1694
|
-
x: Math.cos(
|
|
1695
|
-
y: Math.sin(
|
|
1705
|
+
const a = s.x - i.x, r = s.y - i.y, o = Math.atan2(r, a);
|
|
1706
|
+
let n = 70, l = 100, h = 20, c = f.piercer, p = null;
|
|
1707
|
+
e === "piercer" ? (n = 95, l = 140, h = 18, c = f.piercer, p = new tt()) : e === "spore" ? (n = 65, l = 90, h = 24, c = f.spore, p = new et()) : e === "cluster" ? (n = 50, l = 75, h = 26, c = f.cluster, p = new it()) : e === "parasite" ? (n = 80, l = 110, h = 22, c = f.parasite, p = new st()) : e === "heavy" ? (n = 35, l = 50, h = 34, c = f.heavy, p = new at(), t.rotation = Math.random() * Math.PI * 2) : e === "micro" && (n = 130, l = 160, h = 12, c = f.micro), t.radius = h, t.color = c, t.strategy = p, t.maxSpeed = l, t.velocity = {
|
|
1708
|
+
x: Math.cos(o) * n,
|
|
1709
|
+
y: Math.sin(o) * n
|
|
1696
1710
|
};
|
|
1697
1711
|
}
|
|
1698
1712
|
}
|
|
1699
|
-
class
|
|
1700
|
-
static killEnemy(t, e, i, s, a,
|
|
1713
|
+
class O {
|
|
1714
|
+
static killEnemy(t, e, i, s, a, r) {
|
|
1701
1715
|
if (!t.active || t.isDying) return;
|
|
1702
|
-
const
|
|
1716
|
+
const o = v.getInstance().getConfig();
|
|
1703
1717
|
if (t.experienceDropPending = !0, a.push({
|
|
1704
1718
|
id: Math.random().toString(),
|
|
1705
1719
|
position: { ...t.position },
|
|
@@ -1713,72 +1727,72 @@ class P {
|
|
|
1713
1727
|
t.triggerDissolveDeath(!0), i.push({
|
|
1714
1728
|
id: Math.random().toString(),
|
|
1715
1729
|
position: { ...t.position },
|
|
1716
|
-
radius:
|
|
1730
|
+
radius: o.toxicPool.baseRadius,
|
|
1717
1731
|
duration: 0,
|
|
1718
|
-
maxDuration:
|
|
1719
|
-
damage:
|
|
1732
|
+
maxDuration: o.toxicPool.baseDuration,
|
|
1733
|
+
damage: o.toxicPool.damage
|
|
1720
1734
|
});
|
|
1721
1735
|
else if (t.type === "cluster") {
|
|
1722
1736
|
t.triggerDissolveDeath(!0);
|
|
1723
|
-
const
|
|
1724
|
-
for (let
|
|
1725
|
-
const
|
|
1726
|
-
x: t.position.x + Math.cos(
|
|
1727
|
-
y: t.position.y + Math.sin(
|
|
1737
|
+
const n = o.cluster.fragmentCount, l = o.cluster.hasHoming;
|
|
1738
|
+
for (let h = 0; h < n; h++) {
|
|
1739
|
+
const c = h * Math.PI * 2 / n, p = 750 + Math.random() * 250, g = {
|
|
1740
|
+
x: t.position.x + Math.cos(c) * 40,
|
|
1741
|
+
y: t.position.y + Math.sin(c) * 40
|
|
1728
1742
|
};
|
|
1729
|
-
let _ =
|
|
1730
|
-
if (
|
|
1731
|
-
let u = null,
|
|
1732
|
-
for (const
|
|
1733
|
-
if (
|
|
1734
|
-
const
|
|
1735
|
-
|
|
1743
|
+
let _ = c;
|
|
1744
|
+
if (l) {
|
|
1745
|
+
let u = null, d = 1 / 0;
|
|
1746
|
+
for (const x of r) {
|
|
1747
|
+
if (x === t || !x.active || x.isGrabbed || x.isDying) continue;
|
|
1748
|
+
const y = Math.hypot(x.position.x - g.x, x.position.y - g.y);
|
|
1749
|
+
y < d && (d = y, u = x);
|
|
1736
1750
|
}
|
|
1737
|
-
u && (_ = Math.atan2(u.position.y -
|
|
1751
|
+
u && (_ = Math.atan2(u.position.y - g.y, u.position.x - g.x));
|
|
1738
1752
|
}
|
|
1739
|
-
const m =
|
|
1740
|
-
x:
|
|
1741
|
-
y:
|
|
1753
|
+
const m = P.createEnemy("micro", g, {
|
|
1754
|
+
x: g.x + Math.cos(_) * 500,
|
|
1755
|
+
y: g.y + Math.sin(_) * 500
|
|
1742
1756
|
});
|
|
1743
1757
|
m.isThrown = !0, m.wasManipulated = !0, m.velocity = {
|
|
1744
1758
|
x: Math.cos(_) * p,
|
|
1745
1759
|
y: Math.sin(_) * p
|
|
1746
|
-
},
|
|
1760
|
+
}, r.push(m);
|
|
1747
1761
|
}
|
|
1748
1762
|
} else t.type === "parasite" ? (t.triggerDissolveDeath(!0), s.push({
|
|
1749
1763
|
id: Math.random().toString(),
|
|
1750
1764
|
position: { ...t.position },
|
|
1751
|
-
radius:
|
|
1765
|
+
radius: o.gravityVortex.baseRadius,
|
|
1752
1766
|
duration: 0,
|
|
1753
|
-
maxDuration:
|
|
1754
|
-
pullForce:
|
|
1767
|
+
maxDuration: o.gravityVortex.baseDuration,
|
|
1768
|
+
pullForce: o.gravityVortex.basePullForce
|
|
1755
1769
|
})) : t.type === "piercer" ? t.triggerSliceDeath(e, !0) : t.triggerDissolveDeath(!0);
|
|
1756
1770
|
}
|
|
1757
1771
|
}
|
|
1758
|
-
class
|
|
1759
|
-
static update(t, e, i, s, a,
|
|
1772
|
+
class ot {
|
|
1773
|
+
static update(t, e, i, s, a, r, o, n, l, h, c, p, g, _) {
|
|
1760
1774
|
let m = !1;
|
|
1761
1775
|
for (const u of t)
|
|
1762
1776
|
if (!(!u.active || !u.isThrown || u.isDying || u.launchDelay > 0)) {
|
|
1763
|
-
if (m = !0, u.position.x < -120 || u.position.x >
|
|
1777
|
+
if (m = !0, u.position.x < -120 || u.position.x > h + 120 || u.position.y < -120 || u.position.y > c + 120) {
|
|
1764
1778
|
if (u.type === "heavy") {
|
|
1765
1779
|
s.push({
|
|
1766
1780
|
id: Math.random().toString(),
|
|
1767
1781
|
position: { ...u.position },
|
|
1768
1782
|
radius: 20,
|
|
1769
1783
|
maxRadius: 350,
|
|
1770
|
-
color:
|
|
1784
|
+
color: f.core,
|
|
1771
1785
|
alpha: 1,
|
|
1772
1786
|
lifetime: 0,
|
|
1773
1787
|
maxLifetime: 0.6
|
|
1774
1788
|
});
|
|
1775
|
-
for (let
|
|
1776
|
-
const
|
|
1789
|
+
for (let d = 0; d < 40; d++) {
|
|
1790
|
+
const x = Math.random() * Math.PI * 2, y = 250 + Math.random() * 450;
|
|
1777
1791
|
a.push({
|
|
1778
1792
|
id: Math.random().toString(),
|
|
1779
1793
|
position: { ...u.position },
|
|
1780
|
-
velocity: { x: Math.cos(
|
|
1781
|
-
color:
|
|
1794
|
+
velocity: { x: Math.cos(x) * y, y: Math.sin(x) * y },
|
|
1795
|
+
color: f.core,
|
|
1782
1796
|
radius: 4 + Math.random() * 5,
|
|
1783
1797
|
alpha: 1,
|
|
1784
1798
|
lifetime: 0,
|
|
@@ -1786,44 +1800,44 @@ class at {
|
|
|
1786
1800
|
});
|
|
1787
1801
|
}
|
|
1788
1802
|
} else if (u.type === "piercer") {
|
|
1789
|
-
const
|
|
1790
|
-
if (
|
|
1791
|
-
const
|
|
1803
|
+
const d = v.getInstance().getConfig().piercer;
|
|
1804
|
+
if (d.terminalAoERadius > 0) {
|
|
1805
|
+
const x = d.terminalAoERadius;
|
|
1792
1806
|
s.push({
|
|
1793
1807
|
id: Math.random().toString(),
|
|
1794
1808
|
position: { ...u.position },
|
|
1795
1809
|
radius: 20,
|
|
1796
|
-
maxRadius:
|
|
1797
|
-
color:
|
|
1810
|
+
maxRadius: x,
|
|
1811
|
+
color: f.piercer,
|
|
1798
1812
|
alpha: 1,
|
|
1799
1813
|
lifetime: 0,
|
|
1800
1814
|
maxLifetime: 0.6
|
|
1801
1815
|
});
|
|
1802
|
-
for (const
|
|
1803
|
-
if (!
|
|
1804
|
-
const
|
|
1805
|
-
|
|
1816
|
+
for (const y of g.getNearby(u.position, x)) {
|
|
1817
|
+
if (!y.active || y.isGrabbed || y.isDying) continue;
|
|
1818
|
+
const E = y.position.x - u.position.x, I = y.position.y - u.position.y;
|
|
1819
|
+
E * E + I * I <= x * x && O.killEnemy(y, Math.atan2(I, E), e, i, s, t);
|
|
1806
1820
|
}
|
|
1807
1821
|
}
|
|
1808
1822
|
}
|
|
1809
1823
|
u.active = !1, u.isThrown = !1;
|
|
1810
1824
|
continue;
|
|
1811
1825
|
}
|
|
1812
|
-
for (const
|
|
1813
|
-
if (
|
|
1814
|
-
const
|
|
1815
|
-
if (
|
|
1826
|
+
for (const d of g.getNearby(u.position, u.getHitRadius() + 80)) {
|
|
1827
|
+
if (d === u || !d.active || d.isGrabbed || d.isDying || d.launchDelay > 0) continue;
|
|
1828
|
+
const x = d.position.x - u.position.x, y = d.position.y - u.position.y, E = u.getHitRadius() + d.getHitRadius();
|
|
1829
|
+
if (x * x + y * y <= E * E) {
|
|
1816
1830
|
p.pos = { x: u.position.x, y: u.position.y };
|
|
1817
|
-
const
|
|
1831
|
+
const I = Math.atan2(u.velocity.y, u.velocity.x);
|
|
1818
1832
|
if (u.type === "heavy") {
|
|
1819
|
-
p.kills++,
|
|
1820
|
-
for (let
|
|
1821
|
-
const
|
|
1833
|
+
p.kills++, O.killEnemy(d, u.rotation, e, i, s, t), o.triggerHitstop(0.04), o.triggerScreenShake({ x, y }, 8);
|
|
1834
|
+
for (let T = 0; T < 8; T++) {
|
|
1835
|
+
const L = u.rotation + (Math.random() - 0.5), A = 200 + Math.random() * 350;
|
|
1822
1836
|
a.push({
|
|
1823
1837
|
id: Math.random().toString(),
|
|
1824
|
-
position: { ...
|
|
1825
|
-
velocity: { x: Math.cos(
|
|
1826
|
-
color:
|
|
1838
|
+
position: { ...d.position },
|
|
1839
|
+
velocity: { x: Math.cos(L) * A, y: Math.sin(L) * A },
|
|
1840
|
+
color: f.core,
|
|
1827
1841
|
radius: 3 + Math.random() * 4,
|
|
1828
1842
|
alpha: 1,
|
|
1829
1843
|
lifetime: 0,
|
|
@@ -1832,23 +1846,23 @@ class at {
|
|
|
1832
1846
|
}
|
|
1833
1847
|
_ && _();
|
|
1834
1848
|
} else if (u.type === "piercer") {
|
|
1835
|
-
p.kills++,
|
|
1849
|
+
p.kills++, O.killEnemy(d, I, e, i, s, t), o.triggerHitstop(0.05), o.triggerScreenShake({ x, y }, 7), s.push({
|
|
1836
1850
|
id: Math.random().toString(),
|
|
1837
|
-
position: { ...
|
|
1851
|
+
position: { ...d.position },
|
|
1838
1852
|
radius: 10,
|
|
1839
1853
|
maxRadius: 180,
|
|
1840
|
-
color:
|
|
1854
|
+
color: f.piercer,
|
|
1841
1855
|
alpha: 1,
|
|
1842
1856
|
lifetime: 0,
|
|
1843
1857
|
maxLifetime: 0.45
|
|
1844
1858
|
});
|
|
1845
|
-
for (let
|
|
1846
|
-
const
|
|
1859
|
+
for (let T = 0; T < 16; T++) {
|
|
1860
|
+
const L = Math.random() * Math.PI * 2, A = 150 + Math.random() * 300;
|
|
1847
1861
|
a.push({
|
|
1848
1862
|
id: Math.random().toString(),
|
|
1849
|
-
position: { ...
|
|
1850
|
-
velocity: { x: Math.cos(
|
|
1851
|
-
color:
|
|
1863
|
+
position: { ...d.position },
|
|
1864
|
+
velocity: { x: Math.cos(L) * A, y: Math.sin(L) * A },
|
|
1865
|
+
color: f.piercer,
|
|
1852
1866
|
radius: 3 + Math.random() * 3,
|
|
1853
1867
|
alpha: 1,
|
|
1854
1868
|
lifetime: 0,
|
|
@@ -1857,39 +1871,39 @@ class at {
|
|
|
1857
1871
|
}
|
|
1858
1872
|
if (u.remainingHomingKills > 0) {
|
|
1859
1873
|
u.remainingHomingKills--;
|
|
1860
|
-
let
|
|
1861
|
-
for (const
|
|
1862
|
-
if (
|
|
1863
|
-
const
|
|
1864
|
-
|
|
1874
|
+
let T = null, L = 1 / 0;
|
|
1875
|
+
for (const A of t) {
|
|
1876
|
+
if (A === u || A === d || !A.active || A.isGrabbed || A.isDying) continue;
|
|
1877
|
+
const R = A.position.x - u.position.x, C = A.position.y - u.position.y, S = Math.hypot(R, C);
|
|
1878
|
+
S < L && (L = S, T = A);
|
|
1865
1879
|
}
|
|
1866
|
-
if (
|
|
1867
|
-
const
|
|
1868
|
-
u.rotation =
|
|
1869
|
-
x: Math.cos(
|
|
1870
|
-
y: Math.sin(
|
|
1880
|
+
if (T) {
|
|
1881
|
+
const A = Math.atan2(T.position.y - u.position.y, T.position.x - u.position.x), R = Math.hypot(u.velocity.x, u.velocity.y) || 1200;
|
|
1882
|
+
u.rotation = A, u.velocity = {
|
|
1883
|
+
x: Math.cos(A) * R,
|
|
1884
|
+
y: Math.sin(A) * R
|
|
1871
1885
|
};
|
|
1872
1886
|
}
|
|
1873
1887
|
}
|
|
1874
1888
|
_ && _();
|
|
1875
1889
|
} else {
|
|
1876
|
-
const
|
|
1890
|
+
const T = u.type === d.type, L = T ? 360 : 250;
|
|
1877
1891
|
s.push({
|
|
1878
1892
|
id: Math.random().toString(),
|
|
1879
1893
|
position: { ...p.pos },
|
|
1880
1894
|
radius: 15,
|
|
1881
|
-
maxRadius:
|
|
1895
|
+
maxRadius: L,
|
|
1882
1896
|
color: u.color,
|
|
1883
1897
|
alpha: 1,
|
|
1884
1898
|
lifetime: 0,
|
|
1885
1899
|
maxLifetime: 0.55
|
|
1886
1900
|
});
|
|
1887
|
-
for (let
|
|
1888
|
-
const
|
|
1901
|
+
for (let A = 0; A < 45; A++) {
|
|
1902
|
+
const R = Math.random() * Math.PI * 2, C = 200 + Math.random() * 450;
|
|
1889
1903
|
a.push({
|
|
1890
1904
|
id: Math.random().toString(),
|
|
1891
1905
|
position: { ...p.pos },
|
|
1892
|
-
velocity: { x: Math.cos(
|
|
1906
|
+
velocity: { x: Math.cos(R) * C, y: Math.sin(R) * C },
|
|
1893
1907
|
color: u.color,
|
|
1894
1908
|
radius: 4 + Math.random() * 6,
|
|
1895
1909
|
alpha: 1,
|
|
@@ -1900,21 +1914,21 @@ class at {
|
|
|
1900
1914
|
if (u.strategy) {
|
|
1901
1915
|
u.strategy.execute({
|
|
1902
1916
|
thrownEnemy: u,
|
|
1903
|
-
targetEnemy:
|
|
1917
|
+
targetEnemy: d,
|
|
1904
1918
|
allEnemies: t,
|
|
1905
1919
|
pools: e,
|
|
1906
1920
|
vortices: i,
|
|
1907
1921
|
shockwaves: s,
|
|
1908
1922
|
particles: a,
|
|
1909
|
-
floatingTexts:
|
|
1910
|
-
eventBus:
|
|
1911
|
-
width:
|
|
1912
|
-
height:
|
|
1923
|
+
floatingTexts: r,
|
|
1924
|
+
eventBus: n,
|
|
1925
|
+
width: h,
|
|
1926
|
+
height: c
|
|
1913
1927
|
}), p.kills += 2, _ && _();
|
|
1914
1928
|
break;
|
|
1915
1929
|
}
|
|
1916
|
-
if (
|
|
1917
|
-
p.kills += 2,
|
|
1930
|
+
if (T) {
|
|
1931
|
+
p.kills += 2, o.triggerHitstop(0.14), o.triggerFlash(0.5), o.triggerScreenShake({ x, y }, 16), r.push({
|
|
1918
1932
|
id: Math.random().toString(),
|
|
1919
1933
|
text: "COLOR SYNERGY!",
|
|
1920
1934
|
position: { ...p.pos },
|
|
@@ -1925,28 +1939,28 @@ class at {
|
|
|
1925
1939
|
maxLifetime: 1.2,
|
|
1926
1940
|
size: 26
|
|
1927
1941
|
});
|
|
1928
|
-
const
|
|
1942
|
+
const A = v.getInstance().getConfig();
|
|
1929
1943
|
u.type === "spore" ? e.push({
|
|
1930
1944
|
id: Math.random().toString(),
|
|
1931
1945
|
position: { ...p.pos },
|
|
1932
|
-
radius: Math.round(
|
|
1946
|
+
radius: Math.round(A.toxicPool.baseRadius * 2),
|
|
1933
1947
|
duration: 0,
|
|
1934
|
-
maxDuration:
|
|
1935
|
-
damage:
|
|
1948
|
+
maxDuration: A.toxicPool.synergyDuration,
|
|
1949
|
+
damage: A.toxicPool.damage * 2
|
|
1936
1950
|
}) : u.type === "parasite" && i.push({
|
|
1937
1951
|
id: Math.random().toString(),
|
|
1938
1952
|
position: { ...p.pos },
|
|
1939
|
-
radius: Math.round(
|
|
1953
|
+
radius: Math.round(A.gravityVortex.baseRadius * 1.8),
|
|
1940
1954
|
duration: 0,
|
|
1941
|
-
maxDuration:
|
|
1942
|
-
pullForce:
|
|
1943
|
-
}),
|
|
1955
|
+
maxDuration: A.gravityVortex.synergyDuration,
|
|
1956
|
+
pullForce: A.gravityVortex.synergyPullForce
|
|
1957
|
+
}), O.killEnemy(u, I, e, i, s, t), O.killEnemy(d, I, e, i, s, t);
|
|
1944
1958
|
} else
|
|
1945
|
-
p.kills += 2,
|
|
1946
|
-
for (const
|
|
1947
|
-
if (
|
|
1948
|
-
const
|
|
1949
|
-
Math.hypot(
|
|
1959
|
+
p.kills += 2, o.triggerHitstop(0.08), o.triggerFlash(0.35), o.triggerScreenShake({ x, y }, 10), O.killEnemy(u, I, e, i, s, t), O.killEnemy(d, I, e, i, s, t);
|
|
1960
|
+
for (const A of t) {
|
|
1961
|
+
if (A === u || A === d || !A.active || A.isGrabbed || A.isDying) continue;
|
|
1962
|
+
const R = A.position.x - p.pos.x, C = A.position.y - p.pos.y;
|
|
1963
|
+
Math.hypot(R, C) <= L && A.type !== "micro" && (O.killEnemy(A, I, e, i, s, t), p.kills++);
|
|
1950
1964
|
}
|
|
1951
1965
|
_ && _();
|
|
1952
1966
|
break;
|
|
@@ -1954,49 +1968,49 @@ class at {
|
|
|
1954
1968
|
}
|
|
1955
1969
|
}
|
|
1956
1970
|
}
|
|
1957
|
-
|
|
1971
|
+
l.value = p.kills, !m && p.kills > 0 && (p.kills >= 2 && p.pos && r.push({
|
|
1958
1972
|
id: Math.random().toString(),
|
|
1959
1973
|
text: `MULTIKILL x${p.kills}!`,
|
|
1960
1974
|
position: { ...p.pos },
|
|
1961
1975
|
velocity: { x: 0, y: -90 },
|
|
1962
|
-
color:
|
|
1976
|
+
color: f.coreAccent,
|
|
1963
1977
|
alpha: 1,
|
|
1964
1978
|
lifetime: 0,
|
|
1965
1979
|
maxLifetime: 1.4,
|
|
1966
1980
|
size: 32
|
|
1967
|
-
}),
|
|
1981
|
+
}), n.emit("onComboUpdated", { combo: l.value }), p.kills = 0, p.pos = null);
|
|
1968
1982
|
}
|
|
1969
1983
|
}
|
|
1970
|
-
class
|
|
1971
|
-
static update(t, e, i, s, a,
|
|
1972
|
-
for (let
|
|
1973
|
-
const
|
|
1974
|
-
if (
|
|
1975
|
-
|
|
1976
|
-
for (const
|
|
1977
|
-
if (!
|
|
1978
|
-
const p =
|
|
1979
|
-
p * p +
|
|
1984
|
+
class nt {
|
|
1985
|
+
static update(t, e, i, s, a, r, o, n) {
|
|
1986
|
+
for (let l = t.length - 1; l >= 0; l--) {
|
|
1987
|
+
const h = t[l];
|
|
1988
|
+
if (h) {
|
|
1989
|
+
h.duration += r;
|
|
1990
|
+
for (const c of e) {
|
|
1991
|
+
if (!c.active || c.isGrabbed || c.isDying || c.launchDelay > 0 || c.isThrown && c.type === "piercer") continue;
|
|
1992
|
+
const p = c.position.x - h.position.x, g = c.position.y - h.position.y;
|
|
1993
|
+
p * p + g * g <= h.radius * h.radius && (O.killEnemy(c, 0, t, i, s, e), o.kills++, n && n());
|
|
1980
1994
|
}
|
|
1981
|
-
|
|
1995
|
+
h.duration >= h.maxDuration && t.splice(l, 1);
|
|
1982
1996
|
}
|
|
1983
1997
|
}
|
|
1984
1998
|
}
|
|
1985
1999
|
}
|
|
1986
|
-
class
|
|
1987
|
-
static update(t, e, i, s, a,
|
|
1988
|
-
const _ =
|
|
2000
|
+
class rt {
|
|
2001
|
+
static update(t, e, i, s, a, r, o, n, l, h, c, p, g) {
|
|
2002
|
+
const _ = v.getInstance().getConfig().shield.protectionArc;
|
|
1989
2003
|
for (const m of t)
|
|
1990
2004
|
if (!(!m.active || !m.isStationaryShield || m.isDying))
|
|
1991
2005
|
for (const u of p.getNearby(m.position, m.getHitRadius() + 80)) {
|
|
1992
2006
|
if (u === m || !u.active || u.isGrabbed || u.isDying || u.launchDelay > 0) continue;
|
|
1993
|
-
const
|
|
1994
|
-
let
|
|
1995
|
-
for (;
|
|
1996
|
-
for (;
|
|
1997
|
-
if (Math.abs(
|
|
1998
|
-
const
|
|
1999
|
-
if (
|
|
2007
|
+
const d = u.position.x - m.position.x, x = u.position.y - m.position.y;
|
|
2008
|
+
let y = Math.atan2(x, d) - m.rotation;
|
|
2009
|
+
for (; y < -Math.PI; ) y += Math.PI * 2;
|
|
2010
|
+
for (; y > Math.PI; ) y -= Math.PI * 2;
|
|
2011
|
+
if (Math.abs(y) > _ / 2) continue;
|
|
2012
|
+
const E = m.getHitRadius() + u.getHitRadius();
|
|
2013
|
+
if (d * d + x * x <= E * E) {
|
|
2000
2014
|
m.isStationaryShield = !1, m.strategy && m.strategy.execute({
|
|
2001
2015
|
thrownEnemy: m,
|
|
2002
2016
|
targetEnemy: u,
|
|
@@ -2005,133 +2019,133 @@ class nt {
|
|
|
2005
2019
|
vortices: i,
|
|
2006
2020
|
shockwaves: s,
|
|
2007
2021
|
particles: a,
|
|
2008
|
-
floatingTexts:
|
|
2009
|
-
eventBus:
|
|
2010
|
-
width:
|
|
2011
|
-
height:
|
|
2012
|
-
}),
|
|
2022
|
+
floatingTexts: r,
|
|
2023
|
+
eventBus: n,
|
|
2024
|
+
width: h,
|
|
2025
|
+
height: c
|
|
2026
|
+
}), l.kills += 2, o.triggerHitstop(0.12), o.triggerScreenShake({ x: d, y: x }, 18), g && g();
|
|
2013
2027
|
break;
|
|
2014
2028
|
}
|
|
2015
2029
|
}
|
|
2016
2030
|
}
|
|
2017
2031
|
}
|
|
2018
|
-
class
|
|
2032
|
+
class lt {
|
|
2019
2033
|
spatialHash;
|
|
2020
2034
|
eventBus;
|
|
2021
2035
|
i18n;
|
|
2022
2036
|
throwState = { kills: 0, pos: null };
|
|
2023
2037
|
constructor(t, e) {
|
|
2024
|
-
this.spatialHash = new
|
|
2025
|
-
}
|
|
2026
|
-
update(t, e, i, s, a,
|
|
2027
|
-
const m =
|
|
2028
|
-
for (const
|
|
2029
|
-
if (
|
|
2030
|
-
if (
|
|
2031
|
-
let
|
|
2032
|
-
for (const
|
|
2033
|
-
if (
|
|
2034
|
-
const
|
|
2035
|
-
|
|
2038
|
+
this.spatialHash = new J(100), this.eventBus = t, this.i18n = e;
|
|
2039
|
+
}
|
|
2040
|
+
update(t, e, i, s, a, r, o, n, l, h, c, p, g, _) {
|
|
2041
|
+
const m = v.getInstance().getConfig().piercer;
|
|
2042
|
+
for (const d of i)
|
|
2043
|
+
if (d.active && !d.isDying) {
|
|
2044
|
+
if (d.isThrown && d.type === "piercer" && m.hasHoming && d.remainingHomingKills > 0) {
|
|
2045
|
+
let x = null, y = 1 / 0;
|
|
2046
|
+
for (const E of i) {
|
|
2047
|
+
if (E === d || !E.active || E.isGrabbed || E.isDying) continue;
|
|
2048
|
+
const I = E.position.x - d.position.x, T = E.position.y - d.position.y, L = I * I + T * T;
|
|
2049
|
+
L < y && (y = L, x = E);
|
|
2036
2050
|
}
|
|
2037
|
-
if (
|
|
2038
|
-
const
|
|
2039
|
-
let
|
|
2040
|
-
for (;
|
|
2041
|
-
for (;
|
|
2042
|
-
const
|
|
2043
|
-
|
|
2044
|
-
x: Math.cos(
|
|
2045
|
-
y: Math.sin(
|
|
2051
|
+
if (x) {
|
|
2052
|
+
const E = Math.atan2(x.position.y - d.position.y, x.position.x - d.position.x), I = Math.max(Math.hypot(d.velocity.x, d.velocity.y), 1e3), T = 25 * t, L = Math.atan2(d.velocity.y, d.velocity.x);
|
|
2053
|
+
let A = E - L;
|
|
2054
|
+
for (; A < -Math.PI; ) A += Math.PI * 2;
|
|
2055
|
+
for (; A > Math.PI; ) A -= Math.PI * 2;
|
|
2056
|
+
const R = L + Math.sign(A) * Math.min(Math.abs(A), T);
|
|
2057
|
+
d.rotation = R, d.velocity = {
|
|
2058
|
+
x: Math.cos(R) * I,
|
|
2059
|
+
y: Math.sin(R) * I
|
|
2046
2060
|
};
|
|
2047
2061
|
}
|
|
2048
2062
|
}
|
|
2049
|
-
if (
|
|
2050
|
-
let
|
|
2051
|
-
for (const
|
|
2052
|
-
if (
|
|
2053
|
-
const
|
|
2054
|
-
|
|
2063
|
+
if (d.isStationaryShield) {
|
|
2064
|
+
let x = null, y = 1 / 0;
|
|
2065
|
+
for (const E of i) {
|
|
2066
|
+
if (E === d || !E.active || E.isGrabbed || E.isDying || E.isStationaryShield) continue;
|
|
2067
|
+
const I = E.position.x - d.position.x, T = E.position.y - d.position.y, L = I * I + T * T;
|
|
2068
|
+
L < y && (y = L, x = E);
|
|
2055
2069
|
}
|
|
2056
|
-
if (
|
|
2057
|
-
let
|
|
2058
|
-
for (;
|
|
2059
|
-
for (;
|
|
2060
|
-
const
|
|
2061
|
-
|
|
2070
|
+
if (x) {
|
|
2071
|
+
let I = Math.atan2(x.position.y - d.position.y, x.position.x - d.position.x) - d.rotation;
|
|
2072
|
+
for (; I < -Math.PI; ) I += Math.PI * 2;
|
|
2073
|
+
for (; I > Math.PI; ) I -= Math.PI * 2;
|
|
2074
|
+
const T = 5 * t;
|
|
2075
|
+
d.rotation += Math.sign(I) * Math.min(Math.abs(I), T);
|
|
2062
2076
|
}
|
|
2063
2077
|
}
|
|
2064
|
-
|
|
2065
|
-
} else
|
|
2066
|
-
for (let
|
|
2067
|
-
const
|
|
2068
|
-
if (!
|
|
2069
|
-
|
|
2070
|
-
const
|
|
2071
|
-
|
|
2078
|
+
d.update(t);
|
|
2079
|
+
} else d.active && d.isDying && d.update(t);
|
|
2080
|
+
for (let d = r.length - 1; d >= 0; d--) {
|
|
2081
|
+
const x = r[d];
|
|
2082
|
+
if (!x) continue;
|
|
2083
|
+
x.lifetime += t;
|
|
2084
|
+
const y = x.lifetime / x.maxLifetime;
|
|
2085
|
+
x.radius = x.maxRadius * y, x.alpha = Math.max(0, 1 - y), x.lifetime >= x.maxLifetime && r.splice(d, 1);
|
|
2072
2086
|
}
|
|
2073
|
-
|
|
2074
|
-
for (const
|
|
2075
|
-
|
|
2076
|
-
|
|
2087
|
+
q.update(a, i, t), this.spatialHash.clear();
|
|
2088
|
+
for (const d of i)
|
|
2089
|
+
d.active && !d.isDying && d.launchDelay <= 0 && this.spatialHash.insert(d);
|
|
2090
|
+
Q.update(
|
|
2077
2091
|
e,
|
|
2078
2092
|
i,
|
|
2079
|
-
l,
|
|
2080
|
-
n,
|
|
2081
|
-
o,
|
|
2082
2093
|
r,
|
|
2094
|
+
o,
|
|
2095
|
+
n,
|
|
2096
|
+
l,
|
|
2083
2097
|
this.eventBus,
|
|
2084
|
-
|
|
2098
|
+
c,
|
|
2085
2099
|
p,
|
|
2086
|
-
|
|
2087
|
-
),
|
|
2100
|
+
g
|
|
2101
|
+
), ot.update(
|
|
2088
2102
|
i,
|
|
2089
2103
|
s,
|
|
2090
2104
|
a,
|
|
2091
|
-
l,
|
|
2092
|
-
n,
|
|
2093
|
-
o,
|
|
2094
2105
|
r,
|
|
2106
|
+
o,
|
|
2107
|
+
n,
|
|
2108
|
+
l,
|
|
2095
2109
|
this.eventBus,
|
|
2096
|
-
|
|
2110
|
+
h,
|
|
2097
2111
|
p,
|
|
2098
|
-
|
|
2112
|
+
g,
|
|
2099
2113
|
this.throwState,
|
|
2100
2114
|
this.spatialHash,
|
|
2101
2115
|
_
|
|
2102
|
-
),
|
|
2116
|
+
), nt.update(
|
|
2103
2117
|
s,
|
|
2104
2118
|
i,
|
|
2105
2119
|
a,
|
|
2106
|
-
|
|
2107
|
-
|
|
2120
|
+
r,
|
|
2121
|
+
o,
|
|
2108
2122
|
t,
|
|
2109
2123
|
this.throwState,
|
|
2110
2124
|
_
|
|
2111
|
-
),
|
|
2125
|
+
), rt.update(
|
|
2112
2126
|
i,
|
|
2113
2127
|
s,
|
|
2114
2128
|
a,
|
|
2115
|
-
l,
|
|
2116
|
-
n,
|
|
2117
|
-
o,
|
|
2118
2129
|
r,
|
|
2130
|
+
o,
|
|
2131
|
+
n,
|
|
2132
|
+
l,
|
|
2119
2133
|
this.eventBus,
|
|
2120
2134
|
this.throwState,
|
|
2121
2135
|
p,
|
|
2122
|
-
|
|
2136
|
+
g,
|
|
2123
2137
|
this.spatialHash,
|
|
2124
2138
|
_
|
|
2125
2139
|
);
|
|
2126
2140
|
const u = 32;
|
|
2127
|
-
|
|
2141
|
+
r.length > u && r.splice(0, r.length - u);
|
|
2128
2142
|
}
|
|
2129
2143
|
}
|
|
2130
|
-
class
|
|
2144
|
+
class ct {
|
|
2131
2145
|
pool = [];
|
|
2132
2146
|
constructor(t = 500) {
|
|
2133
2147
|
for (let e = 0; e < t; e++) {
|
|
2134
|
-
const i = new
|
|
2148
|
+
const i = new G(`pool_enemy_${e}`);
|
|
2135
2149
|
this.pool.push(i);
|
|
2136
2150
|
}
|
|
2137
2151
|
}
|
|
@@ -2139,7 +2153,7 @@ class lt {
|
|
|
2139
2153
|
for (const e of this.pool)
|
|
2140
2154
|
if (!e.active)
|
|
2141
2155
|
return e.reset(), e;
|
|
2142
|
-
const t = new
|
|
2156
|
+
const t = new G(`fallback_enemy_${Date.now()}_${Math.random()}`);
|
|
2143
2157
|
return this.pool.push(t), t;
|
|
2144
2158
|
}
|
|
2145
2159
|
resetAll() {
|
|
@@ -2147,36 +2161,36 @@ class lt {
|
|
|
2147
2161
|
t.reset();
|
|
2148
2162
|
}
|
|
2149
2163
|
}
|
|
2150
|
-
class
|
|
2164
|
+
class N {
|
|
2151
2165
|
static getOffscreenPosition(t, e) {
|
|
2152
2166
|
const i = Math.floor(Math.random() * 4), s = 70;
|
|
2153
2167
|
return i === 0 ? { x: Math.random() * t, y: -s } : i === 1 ? { x: t + s, y: Math.random() * e } : i === 2 ? { x: Math.random() * t, y: e + s } : { x: -s, y: Math.random() * e };
|
|
2154
2168
|
}
|
|
2155
2169
|
static spawnCircleOfDeath(t, e, i, s) {
|
|
2156
|
-
const a = [],
|
|
2157
|
-
for (let
|
|
2158
|
-
const
|
|
2159
|
-
x: e.x + Math.cos(
|
|
2160
|
-
y: e.y + Math.sin(
|
|
2161
|
-
},
|
|
2162
|
-
|
|
2163
|
-
x: Math.cos(
|
|
2164
|
-
y: Math.sin(
|
|
2165
|
-
}, a.push(
|
|
2170
|
+
const a = [], o = Math.max(i, s) * 0.55 + 80;
|
|
2171
|
+
for (let n = 0; n < 18; n++) {
|
|
2172
|
+
const l = n * Math.PI * 2 / 18, h = {
|
|
2173
|
+
x: e.x + Math.cos(l) * o,
|
|
2174
|
+
y: e.y + Math.sin(l) * o
|
|
2175
|
+
}, c = t.get(), p = ["piercer", "spore", "cluster", "parasite"], g = p[n % p.length];
|
|
2176
|
+
P.configureEnemy(c, g, h, e), c.velocity = {
|
|
2177
|
+
x: Math.cos(l + Math.PI) * 55,
|
|
2178
|
+
y: Math.sin(l + Math.PI) * 55
|
|
2179
|
+
}, a.push(c);
|
|
2166
2180
|
}
|
|
2167
2181
|
return a;
|
|
2168
2182
|
}
|
|
2169
2183
|
static spawnDenseCluster(t, e, i, s) {
|
|
2170
|
-
const a = [],
|
|
2171
|
-
let
|
|
2172
|
-
|
|
2173
|
-
for (let
|
|
2174
|
-
const
|
|
2184
|
+
const a = [], o = Math.floor(Math.random() * 4);
|
|
2185
|
+
let n = { x: -60, y: -60 };
|
|
2186
|
+
o === 0 ? n = { x: Math.random() * e, y: -80 } : o === 1 ? n = { x: e + 80, y: Math.random() * i } : o === 2 ? n = { x: Math.random() * e, y: i + 80 } : n = { x: -80, y: Math.random() * i };
|
|
2187
|
+
for (let l = 0; l < 14; l++) {
|
|
2188
|
+
const h = {
|
|
2175
2189
|
x: (Math.random() - 0.5) * 60,
|
|
2176
2190
|
y: (Math.random() - 0.5) * 60
|
|
2177
|
-
},
|
|
2178
|
-
|
|
2179
|
-
const
|
|
2191
|
+
}, c = { x: n.x + h.x, y: n.y + h.y }, p = t.get();
|
|
2192
|
+
P.configureEnemy(p, "spore", c, s);
|
|
2193
|
+
const g = s.x - c.x, _ = s.y - c.y, m = Math.atan2(_, g);
|
|
2180
2194
|
p.velocity = {
|
|
2181
2195
|
x: Math.cos(m) * (50 + Math.random() * 20),
|
|
2182
2196
|
y: Math.sin(m) * (50 + Math.random() * 20)
|
|
@@ -2185,53 +2199,53 @@ class O {
|
|
|
2185
2199
|
return a;
|
|
2186
2200
|
}
|
|
2187
2201
|
static spawnSineSnake(t, e, i, s) {
|
|
2188
|
-
const a = [],
|
|
2189
|
-
for (let
|
|
2190
|
-
const
|
|
2191
|
-
x: -60 -
|
|
2192
|
-
y:
|
|
2193
|
-
},
|
|
2194
|
-
|
|
2202
|
+
const a = [], o = i * 0.2 + Math.random() * i * 0.6;
|
|
2203
|
+
for (let n = 0; n < 12; n++) {
|
|
2204
|
+
const l = {
|
|
2205
|
+
x: -60 - n * 40,
|
|
2206
|
+
y: o + Math.sin(n * 0.45) * 70
|
|
2207
|
+
}, h = t.get();
|
|
2208
|
+
P.configureEnemy(h, "cluster", l, s), h.velocity = { x: 75, y: Math.cos(n * 0.45) * 30 }, a.push(h);
|
|
2195
2209
|
}
|
|
2196
2210
|
return a;
|
|
2197
2211
|
}
|
|
2198
2212
|
static spawnDoubleSpiral(t, e, i, s) {
|
|
2199
2213
|
const a = [];
|
|
2200
|
-
for (let
|
|
2201
|
-
const
|
|
2202
|
-
x: e + Math.cos(
|
|
2203
|
-
y: -60 + Math.sin(
|
|
2214
|
+
for (let o = 0; o < 14; o++) {
|
|
2215
|
+
const n = o / 14, l = n * Math.PI * 4, h = 120 + n * 450, c = {
|
|
2216
|
+
x: e + Math.cos(l) * h,
|
|
2217
|
+
y: -60 + Math.sin(l) * h
|
|
2204
2218
|
}, p = t.get();
|
|
2205
|
-
|
|
2219
|
+
P.configureEnemy(p, "parasite", c, s), a.push(p);
|
|
2206
2220
|
}
|
|
2207
2221
|
return a;
|
|
2208
2222
|
}
|
|
2209
2223
|
static spawnMarchingWall(t, e, i, s) {
|
|
2210
|
-
const a = [],
|
|
2211
|
-
for (let
|
|
2212
|
-
const
|
|
2213
|
-
x:
|
|
2214
|
-
y:
|
|
2215
|
-
},
|
|
2216
|
-
|
|
2217
|
-
x:
|
|
2224
|
+
const a = [], o = Math.random() > 0.5;
|
|
2225
|
+
for (let n = 0; n < 12; n++) {
|
|
2226
|
+
const l = n / 11 * i, h = {
|
|
2227
|
+
x: o ? -60 : e + 60,
|
|
2228
|
+
y: l
|
|
2229
|
+
}, c = t.get();
|
|
2230
|
+
P.configureEnemy(c, "piercer", h, s), c.velocity = {
|
|
2231
|
+
x: o ? 70 : -70,
|
|
2218
2232
|
y: 0
|
|
2219
|
-
}, a.push(
|
|
2233
|
+
}, a.push(c);
|
|
2220
2234
|
}
|
|
2221
2235
|
return a;
|
|
2222
2236
|
}
|
|
2223
2237
|
static spawnCrossfireStreams(t, e, i, s) {
|
|
2224
2238
|
const a = [];
|
|
2225
|
-
for (let
|
|
2226
|
-
const
|
|
2227
|
-
|
|
2228
|
-
const
|
|
2229
|
-
|
|
2239
|
+
for (let o = 0; o < 10; o++) {
|
|
2240
|
+
const n = { x: -50 - o * 35, y: -50 - o * 35 }, l = t.get();
|
|
2241
|
+
P.configureEnemy(l, "spore", n, s), a.push(l);
|
|
2242
|
+
const h = { x: e + 50 + o * 35, y: i + 50 + o * 35 }, c = t.get();
|
|
2243
|
+
P.configureEnemy(c, "cluster", h, s), a.push(c);
|
|
2230
2244
|
}
|
|
2231
2245
|
return a;
|
|
2232
2246
|
}
|
|
2233
2247
|
}
|
|
2234
|
-
class
|
|
2248
|
+
class ht {
|
|
2235
2249
|
wave = 1;
|
|
2236
2250
|
pool;
|
|
2237
2251
|
spawnTimer = 0;
|
|
@@ -2239,63 +2253,63 @@ class ct {
|
|
|
2239
2253
|
patternCooldown = 0;
|
|
2240
2254
|
initialGracePeriod = 6;
|
|
2241
2255
|
constructor() {
|
|
2242
|
-
this.pool = new
|
|
2256
|
+
this.pool = new ct(500);
|
|
2243
2257
|
}
|
|
2244
2258
|
reset() {
|
|
2245
2259
|
this.wave = 1, this.spawnTimer = 0, this.waveTimer = 0, this.patternCooldown = 0;
|
|
2246
2260
|
}
|
|
2247
2261
|
update(t, e, i, s, a) {
|
|
2248
2262
|
this.waveTimer += t, this.spawnTimer += t, this.patternCooldown += t, this.applyFlockingBehaviors(e, t, a);
|
|
2249
|
-
const
|
|
2250
|
-
if (this.waveTimer > this.initialGracePeriod && this.patternCooldown > Math.max(12 - this.wave, 6) &&
|
|
2263
|
+
const r = e.filter((l) => l.active).length, o = Math.max(0.9, 2.2 - (this.wave - 1) * 0.18);
|
|
2264
|
+
if (this.waveTimer > this.initialGracePeriod && this.patternCooldown > Math.max(12 - this.wave, 6) && r < 35) {
|
|
2251
2265
|
this.patternCooldown = 0;
|
|
2252
|
-
const
|
|
2253
|
-
for (const
|
|
2254
|
-
e.push(
|
|
2266
|
+
const l = this.spawnPatternFormation(i, s, a);
|
|
2267
|
+
for (const h of l)
|
|
2268
|
+
e.push(h);
|
|
2255
2269
|
}
|
|
2256
|
-
const
|
|
2257
|
-
return this.spawnTimer >=
|
|
2270
|
+
const n = Math.min(18 + this.wave * 4, 80);
|
|
2271
|
+
return this.spawnTimer >= o && r < n ? (this.spawnTimer = 0, this.spawnSingleEnemy(i, s, a)) : null;
|
|
2258
2272
|
}
|
|
2259
2273
|
spawnSingleEnemy(t, e, i) {
|
|
2260
|
-
const s =
|
|
2261
|
-
let
|
|
2262
|
-
a > 0.75 ?
|
|
2263
|
-
const
|
|
2264
|
-
return
|
|
2274
|
+
const s = N.getOffscreenPosition(t, e), a = Math.random();
|
|
2275
|
+
let r = "piercer";
|
|
2276
|
+
a > 0.75 ? r = "heavy" : a > 0.55 ? r = "parasite" : a > 0.35 ? r = "cluster" : a > 0.15 && (r = "spore");
|
|
2277
|
+
const o = this.pool.get();
|
|
2278
|
+
return P.configureEnemy(o, r, s, i), o;
|
|
2265
2279
|
}
|
|
2266
2280
|
spawnPatternFormation(t, e, i) {
|
|
2267
2281
|
const s = Math.random();
|
|
2268
|
-
return s < 0.25 ?
|
|
2282
|
+
return s < 0.25 ? N.spawnCircleOfDeath(this.pool, i, t, e) : s < 0.5 ? N.spawnDenseCluster(this.pool, t, e, i) : s < 0.75 ? N.spawnSineSnake(this.pool, t, e, i) : N.spawnMarchingWall(this.pool, t, e, i);
|
|
2269
2283
|
}
|
|
2270
2284
|
applyFlockingBehaviors(t, e, i) {
|
|
2271
2285
|
for (let a = 0; a < t.length; a++) {
|
|
2272
|
-
const
|
|
2273
|
-
if (!
|
|
2274
|
-
let
|
|
2275
|
-
for (let
|
|
2276
|
-
if (a ===
|
|
2277
|
-
const _ = t[
|
|
2286
|
+
const r = t[a];
|
|
2287
|
+
if (!r.active || r.isGrabbed || r.isThrown || r.isDying) continue;
|
|
2288
|
+
let o = 0, n = 0, l = 0;
|
|
2289
|
+
for (let g = 0; g < t.length; g++) {
|
|
2290
|
+
if (a === g) continue;
|
|
2291
|
+
const _ = t[g];
|
|
2278
2292
|
if (!_.active || _.isGrabbed || _.isDying) continue;
|
|
2279
|
-
const m =
|
|
2280
|
-
|
|
2293
|
+
const m = r.position.x - _.position.x, u = r.position.y - _.position.y, d = Math.hypot(m, u);
|
|
2294
|
+
d > 0 && d < 70 && (o += m / d, n += u / d, l++);
|
|
2281
2295
|
}
|
|
2282
|
-
|
|
2283
|
-
const
|
|
2296
|
+
l > 0 && (o /= l, n /= l, r.velocity.x += o * 60 * e, r.velocity.y += n * 60 * e);
|
|
2297
|
+
const h = i.x - r.position.x, c = i.y - r.position.y, p = Math.hypot(h, c);
|
|
2284
2298
|
if (p > 0) {
|
|
2285
|
-
const
|
|
2286
|
-
|
|
2299
|
+
const g = 80 + Math.min(this.wave * 4, 40);
|
|
2300
|
+
r.velocity.x += h / p * g * e, r.velocity.y += c / p * g * e;
|
|
2287
2301
|
}
|
|
2288
|
-
if (
|
|
2289
|
-
const
|
|
2290
|
-
if (
|
|
2291
|
-
const _ =
|
|
2292
|
-
|
|
2302
|
+
if (r.maxSpeed > 0) {
|
|
2303
|
+
const g = Math.hypot(r.velocity.x, r.velocity.y);
|
|
2304
|
+
if (g > r.maxSpeed) {
|
|
2305
|
+
const _ = r.maxSpeed / g;
|
|
2306
|
+
r.velocity.x *= _, r.velocity.y *= _;
|
|
2293
2307
|
}
|
|
2294
2308
|
}
|
|
2295
2309
|
}
|
|
2296
2310
|
}
|
|
2297
2311
|
}
|
|
2298
|
-
class
|
|
2312
|
+
class pt {
|
|
2299
2313
|
id;
|
|
2300
2314
|
position;
|
|
2301
2315
|
velocity;
|
|
@@ -2317,15 +2331,15 @@ class ht {
|
|
|
2317
2331
|
update(t, e, i, s) {
|
|
2318
2332
|
if (this.active) {
|
|
2319
2333
|
if (this.isAbsorbing) {
|
|
2320
|
-
const a = e.x - this.position.x,
|
|
2321
|
-
if (
|
|
2334
|
+
const a = e.x - this.position.x, r = e.y - this.position.y, o = Math.hypot(a, r);
|
|
2335
|
+
if (o <= i + this.radius) {
|
|
2322
2336
|
this.position = { ...e }, this.active = !1;
|
|
2323
2337
|
return;
|
|
2324
2338
|
}
|
|
2325
|
-
const
|
|
2339
|
+
const n = Math.min(s + o * 0.7, 1600);
|
|
2326
2340
|
this.velocity = {
|
|
2327
|
-
x: a /
|
|
2328
|
-
y:
|
|
2341
|
+
x: a / o * n,
|
|
2342
|
+
y: r / o * n
|
|
2329
2343
|
};
|
|
2330
2344
|
} else {
|
|
2331
2345
|
const a = Math.pow(0.04, t);
|
|
@@ -2335,21 +2349,21 @@ class ht {
|
|
|
2335
2349
|
}
|
|
2336
2350
|
}
|
|
2337
2351
|
}
|
|
2338
|
-
const
|
|
2352
|
+
const w = {
|
|
2339
2353
|
bioluminescent: {
|
|
2340
2354
|
bgInner: "#081220",
|
|
2341
2355
|
bgMid: "#050b16",
|
|
2342
2356
|
bgOuter: "#020408",
|
|
2343
2357
|
nebulaCyan: "rgba(0, 240, 255, 0.08)",
|
|
2344
2358
|
nebulaMagenta: "rgba(255, 0, 221, 0.07)",
|
|
2345
|
-
piercerColor:
|
|
2346
|
-
sporeColor:
|
|
2347
|
-
clusterColor:
|
|
2348
|
-
parasiteColor:
|
|
2349
|
-
microColor:
|
|
2350
|
-
corePrimary:
|
|
2351
|
-
coreGlow:
|
|
2352
|
-
tendrilMagenta:
|
|
2359
|
+
piercerColor: f.piercer,
|
|
2360
|
+
sporeColor: f.spore,
|
|
2361
|
+
clusterColor: f.cluster,
|
|
2362
|
+
parasiteColor: f.parasite,
|
|
2363
|
+
microColor: f.micro,
|
|
2364
|
+
corePrimary: f.core,
|
|
2365
|
+
coreGlow: f.coreGlow,
|
|
2366
|
+
tendrilMagenta: f.coreAccent,
|
|
2353
2367
|
tendrilCyan: "#00ffff",
|
|
2354
2368
|
effectHighlight: "#ffffff",
|
|
2355
2369
|
effectInk: "#ffffff",
|
|
@@ -2402,22 +2416,22 @@ const N = {
|
|
|
2402
2416
|
vortexCore: "#274760",
|
|
2403
2417
|
vortexMid: "#577c9e"
|
|
2404
2418
|
}
|
|
2405
|
-
},
|
|
2406
|
-
class
|
|
2419
|
+
}, U = "axon_surge_theme";
|
|
2420
|
+
class ut {
|
|
2407
2421
|
currentTheme = "dark";
|
|
2408
2422
|
isExplicit = !1;
|
|
2409
2423
|
targetElement;
|
|
2410
2424
|
constructor(t, e) {
|
|
2411
2425
|
e !== void 0 && (this.targetElement = e);
|
|
2412
2426
|
try {
|
|
2413
|
-
const i = localStorage.getItem(
|
|
2414
|
-
if (i &&
|
|
2427
|
+
const i = localStorage.getItem(U);
|
|
2428
|
+
if (i && w[i]) {
|
|
2415
2429
|
this.currentTheme = i, this.isExplicit = !0, this.applyThemeToDOM();
|
|
2416
2430
|
return;
|
|
2417
2431
|
}
|
|
2418
2432
|
} catch {
|
|
2419
2433
|
}
|
|
2420
|
-
if (t &&
|
|
2434
|
+
if (t && w[t]) {
|
|
2421
2435
|
this.currentTheme = t, this.isExplicit = !0, this.applyThemeToDOM();
|
|
2422
2436
|
return;
|
|
2423
2437
|
}
|
|
@@ -2427,10 +2441,10 @@ class pt {
|
|
|
2427
2441
|
this.targetElement = t, this.isExplicit ? this.applyThemeToDOM() : this.currentTheme = this.detectParentOrSystemTheme();
|
|
2428
2442
|
}
|
|
2429
2443
|
setTheme(t) {
|
|
2430
|
-
if (
|
|
2444
|
+
if (w[t]) {
|
|
2431
2445
|
this.currentTheme = t, this.isExplicit = !0, this.applyThemeToDOM();
|
|
2432
2446
|
try {
|
|
2433
|
-
localStorage.setItem(
|
|
2447
|
+
localStorage.setItem(U, t);
|
|
2434
2448
|
} catch {
|
|
2435
2449
|
}
|
|
2436
2450
|
}
|
|
@@ -2438,7 +2452,7 @@ class pt {
|
|
|
2438
2452
|
clearExplicitTheme() {
|
|
2439
2453
|
this.isExplicit = !1;
|
|
2440
2454
|
try {
|
|
2441
|
-
localStorage.removeItem(
|
|
2455
|
+
localStorage.removeItem(U);
|
|
2442
2456
|
} catch {
|
|
2443
2457
|
}
|
|
2444
2458
|
this.removeThemeClasses(), this.currentTheme = this.detectParentOrSystemTheme();
|
|
@@ -2447,7 +2461,7 @@ class pt {
|
|
|
2447
2461
|
return this.isExplicit || (this.currentTheme = this.detectParentOrSystemTheme()), this.currentTheme;
|
|
2448
2462
|
}
|
|
2449
2463
|
getPalette() {
|
|
2450
|
-
return
|
|
2464
|
+
return w[this.getTheme()] || w.dark;
|
|
2451
2465
|
}
|
|
2452
2466
|
detectParentOrSystemTheme() {
|
|
2453
2467
|
try {
|
|
@@ -2485,83 +2499,83 @@ class pt {
|
|
|
2485
2499
|
this.targetElement.classList.add(t);
|
|
2486
2500
|
}
|
|
2487
2501
|
}
|
|
2488
|
-
class
|
|
2502
|
+
class dt {
|
|
2489
2503
|
maxDistance = 800;
|
|
2490
2504
|
maxThickness = 18;
|
|
2491
2505
|
minThickness = 5;
|
|
2492
2506
|
maxLength = 110;
|
|
2493
2507
|
minLength = 50;
|
|
2494
2508
|
render(t, e, i, s, a) {
|
|
2495
|
-
for (const
|
|
2496
|
-
if (!
|
|
2497
|
-
const
|
|
2498
|
-
if (
|
|
2499
|
-
const
|
|
2500
|
-
if (
|
|
2501
|
-
const p = Math.min(1, Math.max(0,
|
|
2502
|
-
if (t.save(), t.globalAlpha = m, t.shadowColor =
|
|
2503
|
-
const u = Math.max(0,
|
|
2504
|
-
t.moveTo(
|
|
2509
|
+
for (const r of e) {
|
|
2510
|
+
if (!r.active || r.isGrabbed || r.isDying) continue;
|
|
2511
|
+
const o = r.position.x, n = r.position.y;
|
|
2512
|
+
if (o >= 0 && o <= i && n >= 0 && n <= s) continue;
|
|
2513
|
+
const l = Math.min(i, Math.max(0, o)), h = Math.min(s, Math.max(0, n)), c = Math.hypot(o - l, n - h);
|
|
2514
|
+
if (c <= 0 || c > this.maxDistance) continue;
|
|
2515
|
+
const p = Math.min(1, Math.max(0, c / this.maxDistance)), g = this.minThickness + (this.maxThickness - this.minThickness) * (1 - p), _ = this.minLength + (this.maxLength - this.minLength) * (1 - p), m = 0.55 + (1 - p) * 0.35;
|
|
2516
|
+
if (t.save(), t.globalAlpha = m, t.shadowColor = r.color, t.shadowBlur = 14, t.strokeStyle = r.color, t.lineWidth = g, t.lineCap = "round", t.beginPath(), l === 0 || l === i) {
|
|
2517
|
+
const u = Math.max(0, h - _ / 2), d = Math.min(s, h + _ / 2);
|
|
2518
|
+
t.moveTo(l, u), t.lineTo(l, d);
|
|
2505
2519
|
} else {
|
|
2506
|
-
const u = Math.max(0,
|
|
2507
|
-
t.moveTo(u,
|
|
2520
|
+
const u = Math.max(0, l - _ / 2), d = Math.min(i, l + _ / 2);
|
|
2521
|
+
t.moveTo(u, h), t.lineTo(d, h);
|
|
2508
2522
|
}
|
|
2509
|
-
t.stroke(), t.strokeStyle = a.effectHighlight, t.lineWidth = Math.max(1.8,
|
|
2523
|
+
t.stroke(), t.strokeStyle = a.effectHighlight, t.lineWidth = Math.max(1.8, g * 0.28), t.globalAlpha = m * 0.9, t.stroke(), t.restore();
|
|
2510
2524
|
}
|
|
2511
2525
|
}
|
|
2512
2526
|
}
|
|
2513
|
-
class
|
|
2514
|
-
render(t, e, i, s, a,
|
|
2515
|
-
const
|
|
2516
|
-
|
|
2517
|
-
const
|
|
2527
|
+
class gt {
|
|
2528
|
+
render(t, e, i, s, a, r, o = !1) {
|
|
2529
|
+
const n = Math.max(1, a), l = Math.min(1, (n - 1) / 8), h = this.wrapHue(190 + (n - 1) * 34 + Math.sin(s * 0.1) * 5), c = this.wrapHue(h + 42), p = this.wrapHue(h + 150), g = e / 2, _ = i / 2, m = Math.max(e, i) * 0.82, u = t.createRadialGradient(g, _, 20, g, _, m);
|
|
2530
|
+
o ? (u.addColorStop(0, `hsl(${h}, 42%, 91%)`), u.addColorStop(0.42, `hsl(${c}, 42%, 86%)`), u.addColorStop(0.78, `hsl(${p}, 38%, 81%)`), u.addColorStop(1, r.bgOuter)) : (u.addColorStop(0, `hsl(${h}, 42%, 11%)`), u.addColorStop(0.42, `hsl(${c}, 48%, 8%)`), u.addColorStop(0.78, `hsl(${p}, 42%, 5%)`), u.addColorStop(1, `hsl(${p}, 48%, 2.5%)`)), t.fillStyle = u, t.fillRect(0, 0, e, i);
|
|
2531
|
+
const d = Math.min(e, i) * 0.055;
|
|
2518
2532
|
this.drawNebula(
|
|
2519
2533
|
t,
|
|
2520
|
-
e * 0.22 + Math.sin(s * 0.18) *
|
|
2521
|
-
i * 0.28 + Math.cos(s * 0.15) *
|
|
2534
|
+
e * 0.22 + Math.sin(s * 0.18) * d,
|
|
2535
|
+
i * 0.28 + Math.cos(s * 0.15) * d,
|
|
2522
2536
|
Math.max(e, i) * 0.42,
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2537
|
+
h,
|
|
2538
|
+
o ? 0.27 : 0.23,
|
|
2539
|
+
o
|
|
2526
2540
|
), this.drawNebula(
|
|
2527
2541
|
t,
|
|
2528
|
-
e * 0.8 + Math.cos(s * 0.14) *
|
|
2529
|
-
i * 0.7 + Math.sin(s * 0.17) *
|
|
2542
|
+
e * 0.8 + Math.cos(s * 0.14) * d,
|
|
2543
|
+
i * 0.7 + Math.sin(s * 0.17) * d,
|
|
2530
2544
|
Math.max(e, i) * 0.48,
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2545
|
+
c,
|
|
2546
|
+
o ? 0.23 : 0.2,
|
|
2547
|
+
o
|
|
2534
2548
|
), this.drawNebula(
|
|
2535
2549
|
t,
|
|
2536
|
-
e * 0.86 + Math.sin(s * 0.11) *
|
|
2537
|
-
i * 0.16 + Math.cos(s * 0.13) *
|
|
2550
|
+
e * 0.86 + Math.sin(s * 0.11) * d * 0.7,
|
|
2551
|
+
i * 0.16 + Math.cos(s * 0.13) * d * 0.7,
|
|
2538
2552
|
Math.max(e, i) * 0.3,
|
|
2539
2553
|
p,
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
), this.drawSoftFlows(t, e, i, s,
|
|
2543
|
-
const
|
|
2544
|
-
|
|
2554
|
+
o ? 0.17 : 0.14,
|
|
2555
|
+
o
|
|
2556
|
+
), this.drawSoftFlows(t, e, i, s, h, l, o), this.drawParticleField(t, e, i, s, h, c, n, o);
|
|
2557
|
+
const x = t.createRadialGradient(g, _, Math.min(e, i) * 0.28, g, _, m);
|
|
2558
|
+
x.addColorStop(0, "rgba(0, 0, 0, 0)"), x.addColorStop(1, o ? "rgba(40, 60, 90, 0.09)" : "rgba(0, 0, 0, 0.2)"), t.fillStyle = x, t.fillRect(0, 0, e, i);
|
|
2545
2559
|
}
|
|
2546
|
-
drawNebula(t, e, i, s, a,
|
|
2547
|
-
const
|
|
2548
|
-
|
|
2560
|
+
drawNebula(t, e, i, s, a, r, o) {
|
|
2561
|
+
const n = t.createRadialGradient(e, i, 0, e, i, s), l = o ? 52 : 60;
|
|
2562
|
+
n.addColorStop(0, `hsla(${a}, ${o ? 88 : 80}%, ${l}%, ${r})`), n.addColorStop(0.38, `hsla(${a}, ${o ? 82 : 75}%, ${l - (o ? 7 : 12)}%, ${r * 0.5})`), n.addColorStop(1, "rgba(0, 0, 0, 0)"), t.fillStyle = n, t.beginPath(), t.arc(e, i, s, 0, Math.PI * 2), t.fill();
|
|
2549
2563
|
}
|
|
2550
|
-
drawSoftFlows(t, e, i, s, a,
|
|
2564
|
+
drawSoftFlows(t, e, i, s, a, r, o) {
|
|
2551
2565
|
t.save();
|
|
2552
|
-
const
|
|
2553
|
-
t.globalAlpha =
|
|
2554
|
-
for (let
|
|
2555
|
-
const
|
|
2556
|
-
t.strokeStyle = `hsla(${this.wrapHue(a + p)}, ${
|
|
2566
|
+
const n = Math.min(e, i), l = n * 0.035;
|
|
2567
|
+
t.globalAlpha = o ? 0.15 : 0.12, t.lineWidth = Math.max(1.3, n * 17e-4), t.lineCap = "round", t.shadowBlur = n * 0.02, t.shadowColor = `hsla(${a}, 85%, ${o ? 52 : 62}%, 0.28)`;
|
|
2568
|
+
for (let h = 0; h < 3; h++) {
|
|
2569
|
+
const c = (h - 1) * n * 0.075 + Math.sin(s * 0.06 + h) * l, p = h * 28 + r * 18;
|
|
2570
|
+
t.strokeStyle = `hsla(${this.wrapHue(a + p)}, ${o ? 78 : 74}%, ${o ? 47 : 62}%, ${0.52 - h * 0.08})`, t.beginPath(), t.moveTo(-n * 0.12, i * 0.2 + c), t.bezierCurveTo(e * 0.2, i * 0.02 + c, e * 0.47, i * 0.2 - c, e * 0.73, i * 0.07 + c), t.bezierCurveTo(e * 0.94, -n * 0.02 + c, e * 1.04, i * 0.16 + c, e * 1.1, i * 0.36 + c), t.stroke(), t.beginPath(), t.moveTo(-n * 0.1, i * 0.8 - c), t.bezierCurveTo(e * 0.2, i * 0.98 - c, e * 0.48, i * 0.8 + c, e * 0.75, i * 0.93 - c), t.bezierCurveTo(e * 0.94, i * 1.02 - c, e * 1.04, i * 0.84 - c, e * 1.1, i * 0.65 - c), t.stroke();
|
|
2557
2571
|
}
|
|
2558
2572
|
t.restore();
|
|
2559
2573
|
}
|
|
2560
|
-
drawParticleField(t, e, i, s, a,
|
|
2561
|
-
const
|
|
2562
|
-
for (let
|
|
2563
|
-
const _ =
|
|
2564
|
-
t.fillStyle = `hsla(${
|
|
2574
|
+
drawParticleField(t, e, i, s, a, r, o, n) {
|
|
2575
|
+
const l = 44 + Math.min(24, o * 2), h = e / 2, c = i / 2, p = Math.min(e, i) * 0.17;
|
|
2576
|
+
for (let g = 0; g < l; g++) {
|
|
2577
|
+
const _ = g + o * 17, m = this.unitNoise(_ * 1.7) * e, u = this.unitNoise(_ * 2.9 + 13) * i, d = Math.hypot(m - h, u - c), x = Math.min(1, Math.max(0, (d - p) / (Math.min(e, i) * 0.28))), y = 0.7 + Math.sin(s * (0.6 + g % 4 * 0.08) + _) * 0.3, E = (n ? 0.34 : 0.3) * x * y, I = 0.65 + g % 3 * 0.45;
|
|
2578
|
+
t.fillStyle = `hsla(${g % 3 === 0 ? r : a}, ${n ? 82 : 78}%, ${n ? 40 : 70}%, ${E})`, t.beginPath(), t.arc(m, u, I, 0, Math.PI * 2), t.fill();
|
|
2565
2579
|
}
|
|
2566
2580
|
}
|
|
2567
2581
|
unitNoise(t) {
|
|
@@ -2571,45 +2585,109 @@ class dt {
|
|
|
2571
2585
|
return (t % 360 + 360) % 360;
|
|
2572
2586
|
}
|
|
2573
2587
|
}
|
|
2574
|
-
class
|
|
2588
|
+
class _t {
|
|
2575
2589
|
render(t, e, i) {
|
|
2576
2590
|
if (!e.isActive) return;
|
|
2577
2591
|
const s = e.getLauncher(), a = e.getTarget();
|
|
2578
2592
|
if (!s || !a || !s.active || !a.active) return;
|
|
2579
|
-
const
|
|
2580
|
-
if (t.save(),
|
|
2581
|
-
const
|
|
2582
|
-
t.shadowColor =
|
|
2583
|
-
const
|
|
2584
|
-
t.strokeStyle = "rgba(0, 240, 255, 0.8)", t.lineWidth = 3, t.beginPath(), t.arc(s.position.x, s.position.y,
|
|
2585
|
-
} else if (
|
|
2586
|
-
const
|
|
2587
|
-
if (Math.hypot(
|
|
2588
|
-
const
|
|
2589
|
-
t.shadowColor =
|
|
2590
|
-
const
|
|
2591
|
-
t.fillStyle =
|
|
2592
|
-
const
|
|
2593
|
-
t.strokeStyle = "rgba(255, 0, 221, 0.9)", t.lineWidth = 3.5, t.beginPath(), t.arc(a.position.x, a.position.y,
|
|
2593
|
+
const r = e.getStep();
|
|
2594
|
+
if (t.save(), r === 1) {
|
|
2595
|
+
const o = Math.sin(i * 6) * 10, n = s.position.x, l = s.position.y - 65 + o;
|
|
2596
|
+
t.shadowColor = f.core, t.shadowBlur = 20, t.fillStyle = f.core, t.beginPath(), t.moveTo(n, l + 20), t.lineTo(n - 16, l - 12), t.lineTo(n - 6, l - 12), t.lineTo(n - 6, l - 32), t.lineTo(n + 6, l - 32), t.lineTo(n + 6, l - 12), t.lineTo(n + 16, l - 12), t.closePath(), t.fill();
|
|
2597
|
+
const h = s.radius * (1.6 + Math.sin(i * 8) * 0.3);
|
|
2598
|
+
t.strokeStyle = "rgba(0, 240, 255, 0.8)", t.lineWidth = 3, t.beginPath(), t.arc(s.position.x, s.position.y, h, 0, Math.PI * 2), t.stroke();
|
|
2599
|
+
} else if (r === 2) {
|
|
2600
|
+
const o = a.position.x - s.position.x, n = a.position.y - s.position.y;
|
|
2601
|
+
if (Math.hypot(o, n) > 10) {
|
|
2602
|
+
const h = Math.atan2(n, o);
|
|
2603
|
+
t.shadowColor = f.coreAccent, t.shadowBlur = 22, t.strokeStyle = f.coreAccent, t.lineWidth = 4, t.setLineDash([12, 8]), t.beginPath(), t.moveTo(s.position.x, s.position.y), t.lineTo(a.position.x, a.position.y), t.stroke(), t.setLineDash([]);
|
|
2604
|
+
const c = a.position.x - Math.cos(h) * (a.radius + 10), p = a.position.y - Math.sin(h) * (a.radius + 10);
|
|
2605
|
+
t.fillStyle = f.coreAccent, t.beginPath(), t.moveTo(c, p), t.lineTo(c - Math.cos(h - 0.4) * 24, p - Math.sin(h - 0.4) * 24), t.lineTo(c - Math.cos(h + 0.4) * 24, p - Math.sin(h + 0.4) * 24), t.closePath(), t.fill();
|
|
2606
|
+
const g = a.radius * (1.8 + Math.cos(i * 10) * 0.3);
|
|
2607
|
+
t.strokeStyle = "rgba(255, 0, 221, 0.9)", t.lineWidth = 3.5, t.beginPath(), t.arc(a.position.x, a.position.y, g, 0, Math.PI * 2), t.stroke();
|
|
2594
2608
|
}
|
|
2595
2609
|
}
|
|
2596
2610
|
t.restore();
|
|
2597
2611
|
}
|
|
2598
2612
|
}
|
|
2599
|
-
class
|
|
2613
|
+
class mt {
|
|
2614
|
+
draw(t, e, i, s, a) {
|
|
2615
|
+
t.shadowColor = a, t.shadowBlur = 16, t.fillStyle = a, e.type === "piercer" ? this.drawPiercer(t, e, i, s) : e.type === "spore" ? this.drawSpore(t, e, i, s) : e.type === "cluster" ? this.drawCluster(t, e, i) : e.type === "parasite" ? this.drawParasite(t, e, i, s) : e.type === "heavy" ? this.drawHeavy(t, e, i, s) : (t.beginPath(), t.arc(0, 0, e.radius, 0, Math.PI * 2), t.fill());
|
|
2616
|
+
}
|
|
2617
|
+
drawPiercer(t, e, i, s) {
|
|
2618
|
+
t.rotate(e.rotation), t.beginPath();
|
|
2619
|
+
const a = 12;
|
|
2620
|
+
for (let r = 0; r <= a; r++) {
|
|
2621
|
+
const o = r * Math.PI * 2 / a, n = e.radius * 1.6 + Math.sin(o * 3 + i * 4) * 3, l = e.radius * 0.6 + Math.cos(o * 2 + i * 3) * 2, h = Math.cos(o) * n, c = Math.sin(o) * l;
|
|
2622
|
+
r === 0 ? t.moveTo(h, c) : t.lineTo(h, c);
|
|
2623
|
+
}
|
|
2624
|
+
t.closePath(), t.fill(), t.fillStyle = s.effectHighlight, t.beginPath(), t.arc(4, 0, 4, 0, Math.PI * 2), t.fill();
|
|
2625
|
+
}
|
|
2626
|
+
drawSpore(t, e, i, s) {
|
|
2627
|
+
t.beginPath();
|
|
2628
|
+
const a = 8;
|
|
2629
|
+
for (let r = 0; r < a; r++) {
|
|
2630
|
+
const o = r * Math.PI * 2 / a, n = e.radius + Math.sin(o * 4 + i * 3 + e.position.x) * 4, l = Math.cos(o) * n, h = Math.sin(o) * n;
|
|
2631
|
+
r === 0 ? t.moveTo(l, h) : t.lineTo(l, h);
|
|
2632
|
+
}
|
|
2633
|
+
t.closePath(), t.fill(), t.fillStyle = s.effectHighlight, t.beginPath(), t.arc(-4, -4, 5, 0, Math.PI * 2), t.arc(5, 3, 4, 0, Math.PI * 2), t.fill();
|
|
2634
|
+
}
|
|
2635
|
+
drawCluster(t, e, i) {
|
|
2636
|
+
t.beginPath();
|
|
2637
|
+
const s = Math.sin(i * 3) * 2;
|
|
2638
|
+
t.arc(0, 0, e.radius * 0.55, 0, Math.PI * 2), t.arc(-9 + s, -7, e.radius * 0.42, 0, Math.PI * 2), t.arc(9 - s, -7, e.radius * 0.42, 0, Math.PI * 2), t.arc(0, 9 + s, e.radius * 0.45, 0, Math.PI * 2), t.fill();
|
|
2639
|
+
}
|
|
2640
|
+
drawParasite(t, e, i, s) {
|
|
2641
|
+
t.beginPath();
|
|
2642
|
+
const a = 14;
|
|
2643
|
+
for (let r = 0; r <= a; r++) {
|
|
2644
|
+
const o = r * Math.PI * 2 / a, n = e.radius + Math.sin(o * 5 - i * 5) * 3, l = Math.cos(o) * n, h = Math.sin(o) * n;
|
|
2645
|
+
r === 0 ? t.moveTo(l, h) : t.lineTo(l, h);
|
|
2646
|
+
}
|
|
2647
|
+
t.closePath(), t.fill(), t.fillStyle = s.bgOuter, t.beginPath(), t.arc(0, 0, e.radius * 0.45, 0, Math.PI * 2), t.fill();
|
|
2648
|
+
}
|
|
2649
|
+
drawHeavy(t, e, i, s) {
|
|
2650
|
+
t.rotate(e.rotation);
|
|
2651
|
+
const a = e.radius, r = a * 0.88, o = Math.sin(i * 3 + e.position.x * 0.01) * 1.5, n = f.heavy;
|
|
2652
|
+
t.save(), t.translate(-a * 0.12, o), t.fillStyle = n, t.shadowColor = n, t.shadowBlur = 20, t.beginPath();
|
|
2653
|
+
const l = 10;
|
|
2654
|
+
for (let u = 0; u <= l; u++) {
|
|
2655
|
+
const d = u * Math.PI * 2 / l, x = 1 + Math.sin(d * 3 + i * 2.4) * 0.08, y = Math.cos(d) * r * x, E = Math.sin(d) * r * x * 0.9;
|
|
2656
|
+
u === 0 ? t.moveTo(y, E) : t.lineTo(y, E);
|
|
2657
|
+
}
|
|
2658
|
+
t.closePath(), t.fill(), t.fillStyle = f.shieldEye, t.shadowColor = f.shieldEye, t.shadowBlur = 7, t.beginPath(), t.arc(-a * 0.28, -a * 0.2, a * 0.11, 0, Math.PI * 2), t.arc(a * 0.02, a * 0.18, a * 0.08, 0, Math.PI * 2), t.fill(), t.restore();
|
|
2659
|
+
const h = a * 0.22, c = v.getInstance().getConfig().shield.protectionArc, p = a * 0.72, g = a * 0.38;
|
|
2660
|
+
t.save(), t.translate(h, 0), t.beginPath(), t.arc(0, 0, p, -c / 2, c / 2, !1);
|
|
2661
|
+
const _ = Math.cos(c / 2) * g, m = Math.sin(c / 2) * g;
|
|
2662
|
+
t.lineTo(_, m), t.arc(0, 0, g, c / 2, -c / 2, !0), t.closePath(), t.fillStyle = f.heavy, t.shadowColor = f.heavy, t.shadowBlur = e.isStationaryShield ? 28 : 16, t.fill(), t.strokeStyle = s.effectHighlight, t.lineWidth = 2.5, t.beginPath(), t.arc(0, 0, p + Math.sin(i * 4) * 2, -c / 2 + 0.1, c / 2 - 0.1), t.stroke(), t.strokeStyle = f.heavyAccent, t.lineWidth = 1.5, t.shadowColor = f.heavyAccent, t.shadowBlur = 8, t.beginPath(), t.arc(0, 0, g * 0.72, -c * 0.42, c * 0.42), t.stroke();
|
|
2663
|
+
for (let u = -2; u <= 2; u++) {
|
|
2664
|
+
const d = u * c / 6, x = Math.cos(d) * (g + 6), y = Math.sin(d) * (g + 6);
|
|
2665
|
+
t.fillStyle = s.effectHighlight, t.beginPath(), t.arc(x, y, 3, 0, Math.PI * 2), t.fill();
|
|
2666
|
+
}
|
|
2667
|
+
t.restore();
|
|
2668
|
+
}
|
|
2669
|
+
}
|
|
2670
|
+
const ft = {
|
|
2671
|
+
common: f.spore,
|
|
2672
|
+
rare: f.parasite,
|
|
2673
|
+
epic: f.cluster,
|
|
2674
|
+
legendary: f.core
|
|
2675
|
+
};
|
|
2676
|
+
class xt {
|
|
2600
2677
|
canvas;
|
|
2601
2678
|
ctx;
|
|
2602
2679
|
themeManager;
|
|
2603
2680
|
indicatorRenderer;
|
|
2604
2681
|
bgRenderer;
|
|
2605
2682
|
tutorialArrowRenderer;
|
|
2683
|
+
enemyShapeRenderer;
|
|
2606
2684
|
constructor(t, e) {
|
|
2607
|
-
this.canvas = t, this.ctx = t.getContext("2d"), this.themeManager = e, this.indicatorRenderer = new
|
|
2685
|
+
this.canvas = t, this.ctx = t.getContext("2d"), this.themeManager = e, this.indicatorRenderer = new dt(), this.bgRenderer = new gt(), this.tutorialArrowRenderer = new _t(), this.enemyShapeRenderer = new mt();
|
|
2608
2686
|
}
|
|
2609
|
-
render(t, e, i, s, a,
|
|
2687
|
+
render(t, e, i, s, a, r, o, n, l, h, c, p = 1, g) {
|
|
2610
2688
|
if (!this.ctx) return;
|
|
2611
|
-
const _ = this.themeManager.getPalette(), { width: m, height: u } = this.canvas,
|
|
2612
|
-
this.ctx.save(), this.ctx.translate(
|
|
2689
|
+
const _ = this.themeManager.getPalette(), { width: m, height: u } = this.canvas, d = l.getShakeOffset();
|
|
2690
|
+
this.ctx.save(), this.ctx.translate(d.x, d.y), this.bgRenderer.render(
|
|
2613
2691
|
this.ctx,
|
|
2614
2692
|
m,
|
|
2615
2693
|
u,
|
|
@@ -2617,42 +2695,43 @@ class _t {
|
|
|
2617
2695
|
p,
|
|
2618
2696
|
_,
|
|
2619
2697
|
this.themeManager.getTheme() === "light"
|
|
2620
|
-
), this.drawExperienceOrbs(i, t.position, t.pulsePhase, _), this.drawToxicPools(s, t.pulsePhase), this.drawGravityVortices(a, t.pulsePhase), this.drawShockwaves(
|
|
2698
|
+
), this.drawExperienceOrbs(i, t.position, t.pulsePhase, _), this.drawToxicPools(s, t.pulsePhase), this.drawGravityVortices(a, t.pulsePhase), this.drawShockwaves(r), this.drawCoreFilaments(t, _), this.drawParticles(o), v.getInstance().getConfig().core.hasOffscreenIndicators && this.indicatorRenderer.render(this.ctx, e, m, u, _), this.drawOrganicEnemies(e, t.pulsePhase, _), g && this.tutorialArrowRenderer.render(this.ctx, g, t.pulsePhase), h ? this.drawPsionicTendril(t.position, h.position, _) : t && this.drawHoverTendril(t.position, c, e, _), this.drawOrganicConsciousnessCore(t, _), this.drawFloatingTexts(n), l.flashAlpha > 0 && (this.ctx.fillStyle = `rgba(255, 255, 255, ${l.flashAlpha})`, this.ctx.fillRect(0, 0, m, u)), this.ctx.restore();
|
|
2621
2699
|
}
|
|
2622
2700
|
drawExperienceOrbs(t, e, i, s) {
|
|
2623
2701
|
if (this.ctx)
|
|
2624
2702
|
for (const a of t) {
|
|
2625
2703
|
if (!a.active) continue;
|
|
2626
|
-
const
|
|
2627
|
-
this.ctx.save(), this.ctx.shadowColor = s.corePrimary, this.ctx.shadowBlur = a.isAbsorbing ? 18 : 10, a.isAbsorbing && (this.ctx.globalAlpha = 0.35, this.ctx.strokeStyle = s.tendrilCyan, this.ctx.lineWidth = 1, this.ctx.setLineDash([4, 7]), this.ctx.beginPath(), this.ctx.moveTo(
|
|
2628
|
-
const
|
|
2629
|
-
|
|
2704
|
+
const r = a.radius + Math.sin(i * 7 + a.position.x * 0.01) * 0.8, { x: o, y: n } = a.position;
|
|
2705
|
+
this.ctx.save(), this.ctx.shadowColor = s.corePrimary, this.ctx.shadowBlur = a.isAbsorbing ? 18 : 10, a.isAbsorbing && (this.ctx.globalAlpha = 0.35, this.ctx.strokeStyle = s.tendrilCyan, this.ctx.lineWidth = 1, this.ctx.setLineDash([4, 7]), this.ctx.beginPath(), this.ctx.moveTo(o, n), this.ctx.lineTo(e.x, e.y), this.ctx.stroke(), this.ctx.setLineDash([]), this.ctx.globalAlpha = 1);
|
|
2706
|
+
const l = this.ctx.createRadialGradient(o - 1, n - 1, 1, o, n, r * 1.6);
|
|
2707
|
+
l.addColorStop(0, s.effectHighlight), l.addColorStop(0.4, s.corePrimary), l.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.fillStyle = l, this.ctx.beginPath(), this.ctx.arc(o, n, r * 1.6, 0, Math.PI * 2), this.ctx.fill(), this.ctx.fillStyle = s.effectHighlight, this.ctx.beginPath(), this.ctx.arc(o, n, r * 0.65, 0, Math.PI * 2), this.ctx.fill(), this.ctx.strokeStyle = s.tendrilCyan, this.ctx.lineWidth = 1, this.ctx.beginPath(), this.ctx.arc(o, n, r + 3, -i * 2, -i * 2 + Math.PI * 1.4), this.ctx.stroke(), this.ctx.restore();
|
|
2630
2708
|
}
|
|
2631
2709
|
}
|
|
2632
2710
|
drawToxicPools(t, e) {
|
|
2633
|
-
if (this.ctx)
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
this.ctx.closePath(), this.ctx.stroke();
|
|
2650
|
-
for (let c = 0; c < 6; c++) {
|
|
2651
|
-
const h = c * Math.PI * 0.33 + e * 1.5, p = i.radius * 0.5 * (0.3 + Math.sin(e * 2 + c) * 0.3), d = l + Math.cos(h) * p, _ = n + Math.sin(h) * p, m = 3 + Math.sin(e * 3 + c) * 2;
|
|
2652
|
-
this.ctx.fillStyle = `rgba(255, 255, 255, ${a * 0.8})`, this.ctx.beginPath(), this.ctx.arc(d, _, Math.max(1, m), 0, Math.PI * 2), this.ctx.fill();
|
|
2653
|
-
}
|
|
2654
|
-
this.ctx.restore();
|
|
2711
|
+
if (!this.ctx) return;
|
|
2712
|
+
const i = this.themeManager.getPalette();
|
|
2713
|
+
for (const s of t) {
|
|
2714
|
+
const a = s.duration / s.maxDuration, r = Math.min(0.7, (1 - a) * 0.7), { x: o, y: n } = s.position;
|
|
2715
|
+
this.ctx.save();
|
|
2716
|
+
const l = this.ctx.createRadialGradient(o, n, 10, o, n, s.radius * 1.2);
|
|
2717
|
+
l.addColorStop(0, this.colorWithAlpha(i.sporeColor, r * 0.9)), l.addColorStop(0.4, `rgba(16, 185, 129, ${r * 0.65})`), l.addColorStop(0.8, `rgba(5, 80, 45, ${r * 0.35})`), l.addColorStop(1, "rgba(2, 35, 15, 0)"), this.ctx.fillStyle = l, this.ctx.shadowColor = i.sporeColor, this.ctx.shadowBlur = 30, this.ctx.beginPath();
|
|
2718
|
+
const h = 70;
|
|
2719
|
+
for (let c = 0; c <= h; c++) {
|
|
2720
|
+
const p = c * Math.PI * 2 / h, g = Math.sin(p * 5 + e * 3) * 14, _ = Math.cos(p * 3 - e * 2) * 9, m = s.radius + g + _, u = o + Math.cos(p) * m, d = n + Math.sin(p) * m;
|
|
2721
|
+
c === 0 ? this.ctx.moveTo(u, d) : this.ctx.lineTo(u, d);
|
|
2722
|
+
}
|
|
2723
|
+
this.ctx.closePath(), this.ctx.fill(), this.ctx.strokeStyle = this.colorWithAlpha(i.sporeColor, r * 0.8), this.ctx.lineWidth = 2.5, this.ctx.beginPath();
|
|
2724
|
+
for (let c = 0; c <= h; c++) {
|
|
2725
|
+
const p = c * Math.PI * 2 / h, g = Math.sin(p * 6 + e * 4) * 8, _ = s.radius * 0.75 + g, m = o + Math.cos(p) * _, u = n + Math.sin(p) * _;
|
|
2726
|
+
c === 0 ? this.ctx.moveTo(m, u) : this.ctx.lineTo(m, u);
|
|
2655
2727
|
}
|
|
2728
|
+
this.ctx.closePath(), this.ctx.stroke();
|
|
2729
|
+
for (let c = 0; c < 6; c++) {
|
|
2730
|
+
const p = c * Math.PI * 0.33 + e * 1.5, g = s.radius * 0.5 * (0.3 + Math.sin(e * 2 + c) * 0.3), _ = o + Math.cos(p) * g, m = n + Math.sin(p) * g, u = 3 + Math.sin(e * 3 + c) * 2;
|
|
2731
|
+
this.ctx.fillStyle = `rgba(255, 255, 255, ${r * 0.8})`, this.ctx.beginPath(), this.ctx.arc(_, m, Math.max(1, u), 0, Math.PI * 2), this.ctx.fill();
|
|
2732
|
+
}
|
|
2733
|
+
this.ctx.restore();
|
|
2734
|
+
}
|
|
2656
2735
|
}
|
|
2657
2736
|
drawShockwaves(t) {
|
|
2658
2737
|
if (!this.ctx) return;
|
|
@@ -2676,13 +2755,13 @@ class _t {
|
|
|
2676
2755
|
if (!this.ctx) return;
|
|
2677
2756
|
const i = this.themeManager.getPalette();
|
|
2678
2757
|
for (const s of t) {
|
|
2679
|
-
const a = Math.min(0.85, (1 - s.duration / s.maxDuration) * 0.85),
|
|
2758
|
+
const a = Math.min(0.85, (1 - s.duration / s.maxDuration) * 0.85), r = s.radius * (1 - s.duration / s.maxDuration * 0.1), { x: o, y: n } = s.position;
|
|
2680
2759
|
this.ctx.save();
|
|
2681
|
-
const
|
|
2682
|
-
|
|
2683
|
-
for (let
|
|
2684
|
-
const
|
|
2685
|
-
this.ctx.beginPath(), this.ctx.arc(
|
|
2760
|
+
const l = this.ctx.createRadialGradient(o, n, 0, o, n, 60);
|
|
2761
|
+
l.addColorStop(0, this.colorWithAlpha(i.vortexCore, a)), l.addColorStop(0.7, this.colorWithAlpha(i.vortexMid, a)), l.addColorStop(1, this.colorWithAlpha(i.parasiteColor, a * 0.5)), this.ctx.fillStyle = l, this.ctx.beginPath(), this.ctx.arc(o, n, 60, 0, Math.PI * 2), this.ctx.fill(), this.ctx.strokeStyle = i.parasiteColor, this.ctx.lineWidth = 5, this.ctx.shadowColor = i.parasiteColor, this.ctx.shadowBlur = 32;
|
|
2762
|
+
for (let h = 1; h <= 5; h++) {
|
|
2763
|
+
const c = r * h / 5, p = e * h * 2.2;
|
|
2764
|
+
this.ctx.beginPath(), this.ctx.arc(o, n, c, p, p + Math.PI * 1.5), this.ctx.stroke();
|
|
2686
2765
|
}
|
|
2687
2766
|
this.ctx.restore();
|
|
2688
2767
|
}
|
|
@@ -2691,10 +2770,10 @@ class _t {
|
|
|
2691
2770
|
if (!this.ctx) return;
|
|
2692
2771
|
const a = this.ctx.createRadialGradient(t / 2, e / 2, 40, t / 2, e / 2, Math.max(t, e));
|
|
2693
2772
|
a.addColorStop(0, s.bgInner), a.addColorStop(0.5, s.bgMid), a.addColorStop(1, s.bgOuter), this.ctx.fillStyle = a, this.ctx.fillRect(0, 0, t, e);
|
|
2694
|
-
const
|
|
2695
|
-
|
|
2696
|
-
const
|
|
2697
|
-
|
|
2773
|
+
const r = t * 0.35 + Math.sin(i * 0.3) * 60, o = e * 0.45 + Math.cos(i * 0.25) * 50, n = this.ctx.createRadialGradient(r, o, 20, r, o, 380);
|
|
2774
|
+
n.addColorStop(0, s.nebulaCyan), n.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.fillStyle = n, this.ctx.beginPath(), this.ctx.arc(r, o, 380, 0, Math.PI * 2), this.ctx.fill();
|
|
2775
|
+
const l = t * 0.68 + Math.cos(i * 0.35) * 50, h = e * 0.55 + Math.sin(i * 0.3) * 45, c = this.ctx.createRadialGradient(l, h, 20, l, h, 420);
|
|
2776
|
+
c.addColorStop(0, s.nebulaMagenta), c.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.fillStyle = c, this.ctx.beginPath(), this.ctx.arc(l, h, 420, 0, Math.PI * 2), this.ctx.fill();
|
|
2698
2777
|
}
|
|
2699
2778
|
drawCoreFilaments(t, e) {
|
|
2700
2779
|
if (!this.ctx) return;
|
|
@@ -2703,54 +2782,54 @@ class _t {
|
|
|
2703
2782
|
for (let s = 0; s < i; s++) {
|
|
2704
2783
|
const a = t.collectedPowerUpColors[s] || e.nebulaCyan;
|
|
2705
2784
|
this.ctx.strokeStyle = a;
|
|
2706
|
-
const
|
|
2707
|
-
this.ctx.beginPath(), this.ctx.moveTo(t.position.x, t.position.y), this.ctx.quadraticCurveTo(
|
|
2785
|
+
const r = s * Math.PI * 2 / i + t.pulsePhase * 0.12, o = 85 + Math.sin(t.pulsePhase * 1.5 + s) * 25, n = t.position.x + Math.cos(r) * o, l = t.position.y + Math.sin(r) * o, h = t.position.x + Math.cos(r + 0.4) * 48, c = t.position.y + Math.sin(r + 0.4) * 48;
|
|
2786
|
+
this.ctx.beginPath(), this.ctx.moveTo(t.position.x, t.position.y), this.ctx.quadraticCurveTo(h, c, n, l), this.ctx.stroke(), this.ctx.fillStyle = a, this.ctx.beginPath(), this.ctx.arc(n, l, 3.5, 0, Math.PI * 2), this.ctx.fill();
|
|
2708
2787
|
}
|
|
2709
2788
|
}
|
|
2710
2789
|
drawOrganicConsciousnessCore(t, e) {
|
|
2711
2790
|
if (!this.ctx) return;
|
|
2712
2791
|
const { x: i, y: s } = t.position;
|
|
2713
2792
|
if (this.ctx.save(), t.invulnerabilityTimer > 0) {
|
|
2714
|
-
const
|
|
2715
|
-
this.ctx.globalAlpha =
|
|
2793
|
+
const l = Math.floor(t.invulnerabilityTimer * 20) % 2 === 0;
|
|
2794
|
+
this.ctx.globalAlpha = l ? 0.3 : 0.9;
|
|
2716
2795
|
}
|
|
2717
2796
|
const a = t.getColorHex();
|
|
2718
|
-
for (let
|
|
2719
|
-
const
|
|
2797
|
+
for (let l = 0; l < t.integrity; l++) {
|
|
2798
|
+
const h = t.radius + 16 + l * 12;
|
|
2720
2799
|
this.ctx.strokeStyle = a, this.ctx.lineWidth = 2.2, this.ctx.shadowColor = a, this.ctx.shadowBlur = 12, this.ctx.beginPath();
|
|
2721
|
-
const
|
|
2722
|
-
for (let p = 0; p <=
|
|
2723
|
-
const
|
|
2800
|
+
const c = 60;
|
|
2801
|
+
for (let p = 0; p <= c; p++) {
|
|
2802
|
+
const g = p * Math.PI * 2 / c, _ = h + Math.sin(g * 4 + t.pulsePhase * 2 + l) * 3, m = i + Math.cos(g) * _, u = s + Math.sin(g) * _;
|
|
2724
2803
|
p === 0 ? this.ctx.moveTo(m, u) : this.ctx.lineTo(m, u);
|
|
2725
2804
|
}
|
|
2726
2805
|
this.ctx.closePath(), this.ctx.stroke();
|
|
2727
2806
|
}
|
|
2728
2807
|
if (t.repairProgress > 0) {
|
|
2729
|
-
const
|
|
2808
|
+
const l = t.integrity, h = t.radius + 16 + l * 12;
|
|
2730
2809
|
this.ctx.save(), this.ctx.globalAlpha = Math.max(0.15, t.repairProgress), this.ctx.strokeStyle = a, this.ctx.lineWidth = 2, this.ctx.shadowColor = a, this.ctx.shadowBlur = 8, this.ctx.setLineDash([6, 4]), this.ctx.beginPath();
|
|
2731
|
-
const
|
|
2732
|
-
for (let p = 0; p <=
|
|
2733
|
-
const
|
|
2810
|
+
const c = 60;
|
|
2811
|
+
for (let p = 0; p <= c; p++) {
|
|
2812
|
+
const g = p * Math.PI * 2 / c, _ = h + Math.sin(g * 4 + t.pulsePhase * 2 + l) * 3, m = i + Math.cos(g) * _, u = s + Math.sin(g) * _;
|
|
2734
2813
|
p === 0 ? this.ctx.moveTo(m, u) : this.ctx.lineTo(m, u);
|
|
2735
2814
|
}
|
|
2736
2815
|
this.ctx.closePath(), this.ctx.stroke(), this.ctx.restore();
|
|
2737
2816
|
}
|
|
2738
|
-
const
|
|
2739
|
-
|
|
2740
|
-
const
|
|
2741
|
-
for (let
|
|
2742
|
-
const
|
|
2743
|
-
|
|
2817
|
+
const r = this.ctx.createRadialGradient(i, s, 5, i, s, t.radius * 2.2);
|
|
2818
|
+
r.addColorStop(0, a), r.addColorStop(0.5, e.nebulaMagenta), r.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.fillStyle = r, this.ctx.beginPath(), this.ctx.arc(i, s, t.radius * 2.2, 0, Math.PI * 2), this.ctx.fill(), this.ctx.save(), this.ctx.translate(i, s), this.ctx.strokeStyle = a, this.ctx.lineWidth = 3, this.ctx.fillStyle = a, this.ctx.shadowColor = a, this.ctx.shadowBlur = 20, this.ctx.beginPath();
|
|
2819
|
+
const o = 80;
|
|
2820
|
+
for (let l = 0; l <= o; l++) {
|
|
2821
|
+
const h = l * Math.PI * 2 / o, c = t.getMembraneRadius(h), p = Math.cos(h) * c, g = Math.sin(h) * c;
|
|
2822
|
+
l === 0 ? this.ctx.moveTo(p, g) : this.ctx.lineTo(p, g);
|
|
2744
2823
|
}
|
|
2745
2824
|
this.ctx.closePath(), this.ctx.fill(), this.ctx.stroke();
|
|
2746
|
-
const
|
|
2747
|
-
if (
|
|
2825
|
+
const n = t.powerUpCount;
|
|
2826
|
+
if (n > 0) {
|
|
2748
2827
|
this.ctx.strokeStyle = e.effectHighlight, this.ctx.lineWidth = 1.8, this.ctx.shadowColor = a, this.ctx.shadowBlur = 10;
|
|
2749
|
-
for (let
|
|
2750
|
-
const
|
|
2828
|
+
for (let l = 0; l < n; l++) {
|
|
2829
|
+
const h = l * Math.PI * 2 / n + t.pulsePhase * 0.4, c = t.radius * (0.45 + Math.sin(t.pulsePhase * 2 + l) * 0.15);
|
|
2751
2830
|
this.ctx.beginPath(), this.ctx.moveTo(0, 0);
|
|
2752
|
-
const p = Math.cos(
|
|
2753
|
-
this.ctx.quadraticCurveTo(p,
|
|
2831
|
+
const p = Math.cos(h + Math.sin(t.pulsePhase + l) * 0.4) * (c * 0.6), g = Math.sin(h + Math.cos(t.pulsePhase + l) * 0.4) * (c * 0.6), _ = Math.cos(h) * c, m = Math.sin(h) * c;
|
|
2832
|
+
this.ctx.quadraticCurveTo(p, g, _, m), this.ctx.stroke(), this.ctx.fillStyle = a, this.ctx.beginPath(), this.ctx.arc(_, m, 2.5, 0, Math.PI * 2), this.ctx.fill();
|
|
2754
2833
|
}
|
|
2755
2834
|
}
|
|
2756
2835
|
this.ctx.fillStyle = e.effectHighlight, this.ctx.beginPath(), this.ctx.arc(0, 0, t.radius * 0.3, 0, Math.PI * 2), this.ctx.fill(), this.ctx.restore(), this.ctx.restore();
|
|
@@ -2760,11 +2839,11 @@ class _t {
|
|
|
2760
2839
|
this.ctx.save();
|
|
2761
2840
|
const s = e.x - t.x, a = e.y - t.y;
|
|
2762
2841
|
this.ctx.strokeStyle = i.tendrilMagenta, this.ctx.lineWidth = 9, this.ctx.shadowColor = i.tendrilMagenta, this.ctx.shadowBlur = 20, this.ctx.beginPath(), this.ctx.moveTo(t.x, t.y);
|
|
2763
|
-
const
|
|
2764
|
-
this.ctx.quadraticCurveTo(
|
|
2765
|
-
for (let
|
|
2766
|
-
const
|
|
2767
|
-
this.ctx.fillStyle = i.effectHighlight, this.ctx.beginPath(), this.ctx.arc(
|
|
2842
|
+
const r = (t.x + e.x) / 2 + Math.sin(Date.now() * 0.02) * 16, o = (t.y + e.y) / 2 + Math.cos(Date.now() * 0.02) * 16;
|
|
2843
|
+
this.ctx.quadraticCurveTo(r, o, e.x, e.y), this.ctx.stroke(), this.ctx.strokeStyle = i.tendrilCyan, this.ctx.lineWidth = 3.5, this.ctx.shadowColor = i.tendrilCyan, this.ctx.shadowBlur = 12, this.ctx.beginPath(), this.ctx.moveTo(t.x, t.y), this.ctx.lineTo(e.x, e.y), this.ctx.stroke();
|
|
2844
|
+
for (let n = 0; n < 6; n++) {
|
|
2845
|
+
const l = Math.random(), h = t.x + s * l + (Math.random() - 0.5) * 24, c = t.y + a * l + (Math.random() - 0.5) * 24;
|
|
2846
|
+
this.ctx.fillStyle = i.effectHighlight, this.ctx.beginPath(), this.ctx.arc(h, c, 2.5 + Math.random() * 2.5, 0, Math.PI * 2), this.ctx.fill();
|
|
2768
2847
|
}
|
|
2769
2848
|
this.ctx.restore();
|
|
2770
2849
|
}
|
|
@@ -2772,8 +2851,8 @@ class _t {
|
|
|
2772
2851
|
if (this.ctx)
|
|
2773
2852
|
for (const a of i) {
|
|
2774
2853
|
if (!a.active || a.isGrabbed || a.isThrown || a.wasManipulated || a.isDying) continue;
|
|
2775
|
-
const
|
|
2776
|
-
if (Math.hypot(
|
|
2854
|
+
const r = e.x - a.position.x, o = e.y - a.position.y;
|
|
2855
|
+
if (Math.hypot(r, o) <= a.getHitRadius()) {
|
|
2777
2856
|
this.ctx.strokeStyle = s.tendrilMagenta, this.ctx.lineWidth = 2.5, this.ctx.beginPath(), this.ctx.moveTo(t.x, t.y), this.ctx.lineTo(a.position.x, a.position.y), this.ctx.stroke();
|
|
2778
2857
|
break;
|
|
2779
2858
|
}
|
|
@@ -2785,71 +2864,31 @@ class _t {
|
|
|
2785
2864
|
if (!s.active) continue;
|
|
2786
2865
|
let a = s.color;
|
|
2787
2866
|
s.type === "piercer" ? a = i.piercerColor : s.type === "spore" ? a = i.sporeColor : s.type === "cluster" ? a = i.clusterColor : s.type === "parasite" ? a = i.parasiteColor : s.type === "micro" && (a = i.microColor);
|
|
2788
|
-
const { x:
|
|
2789
|
-
if (this.ctx.save(), this.ctx.translate(
|
|
2790
|
-
const
|
|
2791
|
-
this.ctx.strokeStyle = i.tendrilMagenta, this.ctx.lineWidth = 2.5, this.ctx.shadowColor = i.tendrilMagenta, this.ctx.shadowBlur = 18, this.ctx.beginPath(), this.ctx.arc(0, 0,
|
|
2792
|
-
const
|
|
2793
|
-
this.ctx.strokeStyle = i.tendrilCyan, this.ctx.lineWidth = 1.5, this.ctx.beginPath(), this.ctx.arc(0, 0,
|
|
2867
|
+
const { x: r, y: o } = s.position;
|
|
2868
|
+
if (this.ctx.save(), this.ctx.translate(r, o), s.wasManipulated && !s.isDying) {
|
|
2869
|
+
const n = s.radius * 1.5 + Math.sin(e * 6) * 4;
|
|
2870
|
+
this.ctx.strokeStyle = i.tendrilMagenta, this.ctx.lineWidth = 2.5, this.ctx.shadowColor = i.tendrilMagenta, this.ctx.shadowBlur = 18, this.ctx.beginPath(), this.ctx.arc(0, 0, n, 0, Math.PI * 2), this.ctx.stroke();
|
|
2871
|
+
const l = s.radius * 1.8 + Math.cos(e * 8) * 3;
|
|
2872
|
+
this.ctx.strokeStyle = i.tendrilCyan, this.ctx.lineWidth = 1.5, this.ctx.beginPath(), this.ctx.arc(0, 0, l, 0, Math.PI * 2), this.ctx.stroke();
|
|
2794
2873
|
}
|
|
2795
2874
|
if (s.isDying) {
|
|
2796
|
-
const
|
|
2797
|
-
if (this.ctx.globalAlpha =
|
|
2798
|
-
const
|
|
2799
|
-
this.ctx.fillStyle = i.sporeColor, this.ctx.shadowColor = i.sporeColor, this.ctx.shadowBlur = 20, this.ctx.beginPath(), this.ctx.arc(0, 0,
|
|
2800
|
-
for (let
|
|
2801
|
-
const p =
|
|
2802
|
-
this.ctx.fillStyle = i.effectHighlight, this.ctx.beginPath(), this.ctx.arc(Math.cos(p) *
|
|
2875
|
+
const n = s.deathTimer / s.maxDeathTimer, l = Math.max(0, 1 - n);
|
|
2876
|
+
if (this.ctx.globalAlpha = l, s.deathType === "dissolve") {
|
|
2877
|
+
const h = s.radius * (1 - n * 0.7);
|
|
2878
|
+
this.ctx.fillStyle = i.sporeColor, this.ctx.shadowColor = i.sporeColor, this.ctx.shadowBlur = 20, this.ctx.beginPath(), this.ctx.arc(0, 0, h, 0, Math.PI * 2), this.ctx.fill();
|
|
2879
|
+
for (let c = 0; c < 4; c++) {
|
|
2880
|
+
const p = c * Math.PI * 0.5 + n * 4, g = h * 0.8 * n;
|
|
2881
|
+
this.ctx.fillStyle = i.effectHighlight, this.ctx.beginPath(), this.ctx.arc(Math.cos(p) * g, Math.sin(p) * g, 3, 0, Math.PI * 2), this.ctx.fill();
|
|
2803
2882
|
}
|
|
2804
2883
|
this.ctx.restore();
|
|
2805
2884
|
continue;
|
|
2806
2885
|
} else if (s.deathType === "sliced") {
|
|
2807
|
-
const
|
|
2808
|
-
this.ctx.shadowColor =
|
|
2886
|
+
const h = n * 24, c = s.sliceAngle + Math.PI / 2, p = Math.cos(c) * h, g = Math.sin(c) * h;
|
|
2887
|
+
this.ctx.shadowColor = i.piercerColor, this.ctx.shadowBlur = 22, this.ctx.fillStyle = a, this.ctx.save(), this.ctx.translate(p, g), this.ctx.beginPath(), this.ctx.arc(0, 0, s.radius * 0.8, 0, Math.PI), this.ctx.fill(), this.ctx.restore(), this.ctx.save(), this.ctx.translate(-p, -g), this.ctx.beginPath(), this.ctx.arc(0, 0, s.radius * 0.8, Math.PI, Math.PI * 2), this.ctx.fill(), this.ctx.restore(), this.ctx.restore();
|
|
2809
2888
|
continue;
|
|
2810
2889
|
}
|
|
2811
2890
|
}
|
|
2812
|
-
|
|
2813
|
-
this.ctx.rotate(s.rotation), this.ctx.beginPath();
|
|
2814
|
-
const o = 12;
|
|
2815
|
-
for (let r = 0; r <= o; r++) {
|
|
2816
|
-
const c = r * Math.PI * 2 / o, h = s.radius * 1.6 + Math.sin(c * 3 + e * 4) * 3, p = s.radius * 0.6 + Math.cos(c * 2 + e * 3) * 2, d = Math.cos(c) * h, _ = Math.sin(c) * p;
|
|
2817
|
-
r === 0 ? this.ctx.moveTo(d, _) : this.ctx.lineTo(d, _);
|
|
2818
|
-
}
|
|
2819
|
-
this.ctx.closePath(), this.ctx.fill(), this.ctx.fillStyle = i.effectHighlight, this.ctx.beginPath(), this.ctx.arc(4, 0, 4, 0, Math.PI * 2), this.ctx.fill();
|
|
2820
|
-
} else if (s.type === "spore") {
|
|
2821
|
-
this.ctx.beginPath();
|
|
2822
|
-
const o = 8;
|
|
2823
|
-
for (let r = 0; r < o; r++) {
|
|
2824
|
-
const c = r * Math.PI * 2 / o, h = s.radius + Math.sin(c * 4 + e * 3 + s.position.x) * 4, p = Math.cos(c) * h, d = Math.sin(c) * h;
|
|
2825
|
-
r === 0 ? this.ctx.moveTo(p, d) : this.ctx.lineTo(p, d);
|
|
2826
|
-
}
|
|
2827
|
-
this.ctx.closePath(), this.ctx.fill(), this.ctx.fillStyle = i.effectHighlight, this.ctx.beginPath(), this.ctx.arc(-4, -4, 5, 0, Math.PI * 2), this.ctx.arc(5, 3, 4, 0, Math.PI * 2), this.ctx.fill();
|
|
2828
|
-
} else if (s.type === "cluster") {
|
|
2829
|
-
this.ctx.beginPath();
|
|
2830
|
-
const o = Math.sin(e * 3) * 2;
|
|
2831
|
-
this.ctx.arc(0, 0, s.radius * 0.55, 0, Math.PI * 2), this.ctx.arc(-9 + o, -7, s.radius * 0.42, 0, Math.PI * 2), this.ctx.arc(9 - o, -7, s.radius * 0.42, 0, Math.PI * 2), this.ctx.arc(0, 9 + o, s.radius * 0.45, 0, Math.PI * 2), this.ctx.fill();
|
|
2832
|
-
} else if (s.type === "parasite") {
|
|
2833
|
-
this.ctx.beginPath();
|
|
2834
|
-
const o = 14;
|
|
2835
|
-
for (let r = 0; r <= o; r++) {
|
|
2836
|
-
const c = r * Math.PI * 2 / o, h = s.radius + Math.sin(c * 5 - e * 5) * 3, p = Math.cos(c) * h, d = Math.sin(c) * h;
|
|
2837
|
-
r === 0 ? this.ctx.moveTo(p, d) : this.ctx.lineTo(p, d);
|
|
2838
|
-
}
|
|
2839
|
-
this.ctx.closePath(), this.ctx.fill(), this.ctx.fillStyle = i.bgOuter, this.ctx.beginPath(), this.ctx.arc(0, 0, s.radius * 0.45, 0, Math.PI * 2), this.ctx.fill();
|
|
2840
|
-
} else if (s.type === "heavy") {
|
|
2841
|
-
this.ctx.rotate(s.rotation);
|
|
2842
|
-
const o = A.getInstance().getConfig().shield.protectionArc, r = s.radius * 1.35, c = s.radius * 0.75;
|
|
2843
|
-
this.ctx.beginPath(), this.ctx.arc(0, 0, r, -o / 2, o / 2, !1);
|
|
2844
|
-
const h = Math.cos(o / 2) * c, p = Math.sin(o / 2) * c;
|
|
2845
|
-
this.ctx.lineTo(h, p), this.ctx.arc(0, 0, c, o / 2, -o / 2, !0), this.ctx.closePath(), this.ctx.fillStyle = s.isStationaryShield ? i.corePrimary : a, this.ctx.shadowColor = i.corePrimary, this.ctx.shadowBlur = s.isStationaryShield ? 28 : 16, this.ctx.fill(), this.ctx.strokeStyle = i.effectHighlight, this.ctx.lineWidth = 3, this.ctx.beginPath(), this.ctx.arc(0, 0, r + Math.sin(e * 4) * 2, -o / 2 + 0.1, o / 2 - 0.1), this.ctx.stroke();
|
|
2846
|
-
for (let d = -2; d <= 2; d++) {
|
|
2847
|
-
const _ = d * o / 6, m = Math.cos(_) * (c + 6), u = Math.sin(_) * (c + 6);
|
|
2848
|
-
this.ctx.fillStyle = i.effectHighlight, this.ctx.beginPath(), this.ctx.arc(m, u, 3, 0, Math.PI * 2), this.ctx.fill();
|
|
2849
|
-
}
|
|
2850
|
-
} else
|
|
2851
|
-
this.ctx.beginPath(), this.ctx.arc(0, 0, s.radius, 0, Math.PI * 2), this.ctx.fill();
|
|
2852
|
-
this.ctx.restore();
|
|
2891
|
+
this.enemyShapeRenderer.draw(this.ctx, s, e, i, a), this.ctx.restore();
|
|
2853
2892
|
}
|
|
2854
2893
|
}
|
|
2855
2894
|
drawParticles(t) {
|
|
@@ -2867,34 +2906,34 @@ class _t {
|
|
|
2867
2906
|
}
|
|
2868
2907
|
drawOrbitingModifierOrbs(t, e, i, s = !0, a = 1) {
|
|
2869
2908
|
if (!this.ctx) return;
|
|
2870
|
-
const
|
|
2871
|
-
for (const
|
|
2872
|
-
if (!
|
|
2873
|
-
const { x:
|
|
2874
|
-
if (this.ctx.save(), this.ctx.shadowColor =
|
|
2875
|
-
const
|
|
2876
|
-
|
|
2909
|
+
const r = this.themeManager.getPalette(), o = this.themeManager.getTheme() === "light";
|
|
2910
|
+
for (const n of t) {
|
|
2911
|
+
if (!n.active) continue;
|
|
2912
|
+
const { x: l, y: h } = n.position, c = n.definition.color, p = n.definition.rarity, g = ft[p], _ = n.radius + Math.sin(e * 6 + n.orbitAngle) * 3;
|
|
2913
|
+
if (this.ctx.save(), this.ctx.shadowColor = g, this.ctx.shadowBlur = n.isGrabbed ? 36 : p === "legendary" ? 28 : 16, p === "legendary" || p === "epic") {
|
|
2914
|
+
const d = _ + 12, x = this.ctx.createRadialGradient(l, h, _, l, h, d);
|
|
2915
|
+
x.addColorStop(0, g), x.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.fillStyle = x, this.ctx.beginPath(), this.ctx.arc(l, h, d, 0, Math.PI * 2), this.ctx.fill();
|
|
2877
2916
|
}
|
|
2878
|
-
const m = this.ctx.createRadialGradient(
|
|
2879
|
-
m.addColorStop(0,
|
|
2880
|
-
const u = i ? i.translate(
|
|
2881
|
-
this.ctx.textBaseline = "alphabetic", this.ctx.font = "900 16px Orbitron, sans-serif", this.ctx.fillStyle =
|
|
2917
|
+
const m = this.ctx.createRadialGradient(l, h, 2, l, h, _ * 1.4);
|
|
2918
|
+
m.addColorStop(0, r.effectHighlight), m.addColorStop(0.4, c), m.addColorStop(1, o ? "rgba(23, 50, 77, 0.24)" : "rgba(0, 0, 0, 0.5)"), this.ctx.fillStyle = m, this.ctx.beginPath(), this.ctx.arc(l, h, _, 0, Math.PI * 2), this.ctx.fill(), this.ctx.strokeStyle = g, this.ctx.lineWidth = p === "legendary" ? 3.5 : 2.5, this.ctx.beginPath(), this.ctx.arc(l, h, _ + 4, e * 3, e * 3 + Math.PI * 1.2), this.ctx.stroke(), (p === "legendary" || p === "epic") && (this.ctx.strokeStyle = o ? g : r.effectHighlight, this.ctx.lineWidth = 1.5, this.ctx.beginPath(), this.ctx.arc(l, h, _ + 8, -e * 2, -e * 2 + Math.PI * 0.9), this.ctx.stroke()), this.ctx.font = "900 14px Orbitron, sans-serif", this.ctx.textAlign = "center", this.ctx.textBaseline = "middle", this.ctx.fillStyle = r.effectInk, this.ctx.shadowColor = r.effectShadow, this.ctx.shadowBlur = 6, this.ctx.fillText(n.definition.badge, l, h);
|
|
2919
|
+
const u = i ? i.translate(n.definition.titleKey) : n.definition.badge;
|
|
2920
|
+
this.ctx.textBaseline = "alphabetic", this.ctx.font = "900 16px Orbitron, sans-serif", this.ctx.fillStyle = r.effectInk, this.ctx.shadowColor = g, this.ctx.shadowBlur = 14, this.ctx.fillText(u, l, h - _ - 14), this.ctx.restore();
|
|
2882
2921
|
}
|
|
2883
2922
|
if (i && s) {
|
|
2884
|
-
const
|
|
2885
|
-
this.ctx.save(), this.ctx.font = "900 14px Orbitron, sans-serif", this.ctx.textAlign = "center", this.ctx.textBaseline = "middle", this.ctx.fillStyle =
|
|
2886
|
-
const
|
|
2887
|
-
this.ctx.beginPath(), this.ctx.roundRect(
|
|
2923
|
+
const n = this.canvas.width / 2, l = this.canvas.height / 2 + 210, h = i.translate("rerollButton", { count: a });
|
|
2924
|
+
this.ctx.save(), this.ctx.font = "900 14px Orbitron, sans-serif", this.ctx.textAlign = "center", this.ctx.textBaseline = "middle", this.ctx.fillStyle = r.effectPanel, this.ctx.strokeStyle = r.tendrilCyan, this.ctx.lineWidth = 2, this.ctx.shadowColor = r.tendrilCyan, this.ctx.shadowBlur = 12;
|
|
2925
|
+
const g = this.ctx.measureText(h).width + 20 * 2, _ = 38;
|
|
2926
|
+
this.ctx.beginPath(), this.ctx.roundRect(n - g / 2, l - _ / 2, g, _, 8), this.ctx.fill(), this.ctx.stroke(), this.ctx.fillStyle = r.effectInk, this.ctx.shadowColor = r.effectShadow, this.ctx.shadowBlur = 4, this.ctx.fillText(h, n, l), this.ctx.restore();
|
|
2888
2927
|
}
|
|
2889
2928
|
}
|
|
2890
2929
|
colorWithAlpha(t, e) {
|
|
2891
2930
|
const i = t.replace("#", "");
|
|
2892
2931
|
if (i.length !== 6) return t;
|
|
2893
|
-
const s = Number.parseInt(i.slice(0, 2), 16), a = Number.parseInt(i.slice(2, 4), 16),
|
|
2894
|
-
return `rgba(${s}, ${a}, ${
|
|
2932
|
+
const s = Number.parseInt(i.slice(0, 2), 16), a = Number.parseInt(i.slice(2, 4), 16), r = Number.parseInt(i.slice(4, 6), 16);
|
|
2933
|
+
return `rgba(${s}, ${a}, ${r}, ${e})`;
|
|
2895
2934
|
}
|
|
2896
2935
|
}
|
|
2897
|
-
class
|
|
2936
|
+
class yt {
|
|
2898
2937
|
container;
|
|
2899
2938
|
i18n;
|
|
2900
2939
|
waveLabelElement;
|
|
@@ -2926,7 +2965,7 @@ class mt {
|
|
|
2926
2965
|
this.container.style.display = "none";
|
|
2927
2966
|
}
|
|
2928
2967
|
}
|
|
2929
|
-
class
|
|
2968
|
+
class Et {
|
|
2930
2969
|
container;
|
|
2931
2970
|
i18n;
|
|
2932
2971
|
onStartCallback;
|
|
@@ -2952,7 +2991,7 @@ class ft {
|
|
|
2952
2991
|
this.container.style.display = "none";
|
|
2953
2992
|
}
|
|
2954
2993
|
}
|
|
2955
|
-
class
|
|
2994
|
+
class At {
|
|
2956
2995
|
modal;
|
|
2957
2996
|
card;
|
|
2958
2997
|
i18n;
|
|
@@ -2963,12 +3002,12 @@ class xt {
|
|
|
2963
3002
|
hapticsEnabled = !0;
|
|
2964
3003
|
fpsLimit = 60;
|
|
2965
3004
|
onFpsLimitChangedCallback;
|
|
2966
|
-
constructor(t, e, i, s, a,
|
|
2967
|
-
this.i18n = e, this.themeManager = i, this.platform = s, this.onLanguageChangedCallback = a, this.onCloseCallback =
|
|
2968
|
-
const
|
|
2969
|
-
|
|
2970
|
-
const
|
|
2971
|
-
(
|
|
3005
|
+
constructor(t, e, i, s, a, r, o) {
|
|
3006
|
+
this.i18n = e, this.themeManager = i, this.platform = s, this.onLanguageChangedCallback = a, this.onCloseCallback = r, this.onFpsLimitChangedCallback = o;
|
|
3007
|
+
const n = localStorage.getItem("axon_surge_haptics");
|
|
3008
|
+
n !== null && (this.hapticsEnabled = n === "true");
|
|
3009
|
+
const l = Number(localStorage.getItem("axon_surge_fps_limit"));
|
|
3010
|
+
(l === 30 || l === 60 || l === 120) && (this.fpsLimit = l), this.modal = document.createElement("dialog"), this.modal.className = "axon-settings-modal", this.card = document.createElement("div"), this.card.className = "axon-settings-card", this.modal.appendChild(this.card), t.appendChild(this.modal), this.modal.addEventListener("close", () => {
|
|
2972
3011
|
this.onCloseCallback && this.onCloseCallback();
|
|
2973
3012
|
}), this.renderContent();
|
|
2974
3013
|
}
|
|
@@ -2984,7 +3023,7 @@ class xt {
|
|
|
2984
3023
|
s.className = "axon-select-wrapper";
|
|
2985
3024
|
const a = document.createElement("select");
|
|
2986
3025
|
a.className = "axon-select";
|
|
2987
|
-
const
|
|
3026
|
+
const r = {
|
|
2988
3027
|
es: "ESPAÑOL (ES)",
|
|
2989
3028
|
en: "ENGLISH (EN)",
|
|
2990
3029
|
fr: "FRANÇAIS (FR)",
|
|
@@ -3001,38 +3040,38 @@ class xt {
|
|
|
3001
3040
|
ko: "한국어 (KO)",
|
|
3002
3041
|
zh: "中文 (ZH)"
|
|
3003
3042
|
};
|
|
3004
|
-
for (const
|
|
3005
|
-
const
|
|
3006
|
-
|
|
3043
|
+
for (const S of W) {
|
|
3044
|
+
const M = document.createElement("option");
|
|
3045
|
+
M.value = S, M.textContent = r[S], this.i18n.getLanguage() === S && (M.selected = !0), a.appendChild(M);
|
|
3007
3046
|
}
|
|
3008
3047
|
a.addEventListener("change", () => {
|
|
3009
|
-
const
|
|
3010
|
-
this.i18n.setLanguage(
|
|
3048
|
+
const S = a.value;
|
|
3049
|
+
this.i18n.setLanguage(S), this.onLanguageChangedCallback && this.onLanguageChangedCallback(S), this.renderContent();
|
|
3011
3050
|
});
|
|
3012
|
-
const
|
|
3013
|
-
|
|
3014
|
-
const
|
|
3015
|
-
|
|
3016
|
-
const
|
|
3017
|
-
|
|
3018
|
-
const
|
|
3019
|
-
|
|
3020
|
-
const
|
|
3051
|
+
const o = document.createElement("span");
|
|
3052
|
+
o.className = "axon-select-arrow", o.textContent = "▼", s.appendChild(a), s.appendChild(o), e.appendChild(i), e.appendChild(s);
|
|
3053
|
+
const n = document.createElement("div");
|
|
3054
|
+
n.className = "axon-setting-row";
|
|
3055
|
+
const l = document.createElement("span");
|
|
3056
|
+
l.textContent = this.i18n.translate("themeLabel");
|
|
3057
|
+
const h = document.createElement("div");
|
|
3058
|
+
h.className = "axon-toggle-group";
|
|
3059
|
+
const c = [
|
|
3021
3060
|
{ id: "bioluminescent", label: "BIO" },
|
|
3022
3061
|
{ id: "dark", label: "DARK" },
|
|
3023
3062
|
{ id: "light", label: "LIGHT" }
|
|
3024
3063
|
];
|
|
3025
|
-
for (const
|
|
3026
|
-
const
|
|
3027
|
-
|
|
3028
|
-
this.themeManager.setTheme(
|
|
3029
|
-
}),
|
|
3064
|
+
for (const S of c) {
|
|
3065
|
+
const M = document.createElement("button");
|
|
3066
|
+
M.type = "button", M.className = `axon-toggle-btn ${this.themeManager.getTheme() === S.id ? "active" : ""}`, M.textContent = S.label, M.addEventListener("click", () => {
|
|
3067
|
+
this.themeManager.setTheme(S.id), this.renderContent();
|
|
3068
|
+
}), h.appendChild(M);
|
|
3030
3069
|
}
|
|
3031
|
-
|
|
3070
|
+
n.appendChild(l), n.appendChild(h);
|
|
3032
3071
|
const p = document.createElement("div");
|
|
3033
3072
|
p.className = "axon-setting-row";
|
|
3034
|
-
const
|
|
3035
|
-
|
|
3073
|
+
const g = document.createElement("span");
|
|
3074
|
+
g.textContent = this.i18n.translate("fpsLimitLabel");
|
|
3036
3075
|
const _ = document.createElement("div");
|
|
3037
3076
|
_.className = "axon-toggle-group";
|
|
3038
3077
|
const m = [
|
|
@@ -3040,53 +3079,53 @@ class xt {
|
|
|
3040
3079
|
{ limit: 60, label: "60 FPS" },
|
|
3041
3080
|
{ limit: 120, label: "120 FPS" }
|
|
3042
3081
|
];
|
|
3043
|
-
for (const
|
|
3044
|
-
const
|
|
3045
|
-
|
|
3046
|
-
this.fpsLimit =
|
|
3047
|
-
}), _.appendChild(
|
|
3082
|
+
for (const S of m) {
|
|
3083
|
+
const M = document.createElement("button");
|
|
3084
|
+
M.type = "button", M.className = `axon-toggle-btn ${this.fpsLimit === S.limit ? "active" : ""}`, M.textContent = S.label, M.addEventListener("click", () => {
|
|
3085
|
+
this.fpsLimit = S.limit, localStorage.setItem("axon_surge_fps_limit", String(S.limit)), this.onFpsLimitChangedCallback?.(S.limit), this.renderContent();
|
|
3086
|
+
}), _.appendChild(M);
|
|
3048
3087
|
}
|
|
3049
|
-
p.appendChild(
|
|
3088
|
+
p.appendChild(g), p.appendChild(_);
|
|
3050
3089
|
const u = document.createElement("div");
|
|
3051
3090
|
u.className = "axon-setting-row";
|
|
3052
|
-
const
|
|
3053
|
-
|
|
3054
|
-
const
|
|
3055
|
-
|
|
3056
|
-
const
|
|
3091
|
+
const d = document.createElement("span");
|
|
3092
|
+
d.textContent = this.i18n.translate("hapticsLabel");
|
|
3093
|
+
const x = document.createElement("div");
|
|
3094
|
+
x.className = "axon-toggle-group";
|
|
3095
|
+
const y = [
|
|
3057
3096
|
{ enabled: !0, label: this.i18n.translate("hapticsOn") },
|
|
3058
3097
|
{ enabled: !1, label: this.i18n.translate("hapticsOff") }
|
|
3059
3098
|
];
|
|
3060
|
-
for (const
|
|
3061
|
-
const
|
|
3062
|
-
|
|
3063
|
-
this.hapticsEnabled =
|
|
3064
|
-
}),
|
|
3099
|
+
for (const S of y) {
|
|
3100
|
+
const M = document.createElement("button");
|
|
3101
|
+
M.type = "button", M.className = `axon-toggle-btn ${this.hapticsEnabled === S.enabled ? "active" : ""}`, M.textContent = S.label, M.addEventListener("click", () => {
|
|
3102
|
+
this.hapticsEnabled = S.enabled, localStorage.setItem("axon_surge_haptics", String(S.enabled)), this.hapticsEnabled && this.platform.haptics.selectionChanged(), this.renderContent();
|
|
3103
|
+
}), x.appendChild(M);
|
|
3065
3104
|
}
|
|
3066
|
-
u.appendChild(
|
|
3067
|
-
const
|
|
3068
|
-
|
|
3069
|
-
const
|
|
3070
|
-
|
|
3071
|
-
const
|
|
3072
|
-
|
|
3073
|
-
const
|
|
3105
|
+
u.appendChild(d), u.appendChild(x);
|
|
3106
|
+
const E = document.createElement("div");
|
|
3107
|
+
E.className = "axon-setting-row";
|
|
3108
|
+
const I = document.createElement("span");
|
|
3109
|
+
I.textContent = this.i18n.translate("tutorialSettingLabel");
|
|
3110
|
+
const T = document.createElement("div");
|
|
3111
|
+
T.className = "axon-toggle-group";
|
|
3112
|
+
const L = localStorage.getItem("axon_surge_show_tutorial") !== "false", A = [
|
|
3074
3113
|
{ enabled: !0, label: this.i18n.translate("hapticsOn") },
|
|
3075
3114
|
{ enabled: !1, label: this.i18n.translate("hapticsOff") }
|
|
3076
3115
|
];
|
|
3077
|
-
for (const
|
|
3078
|
-
const
|
|
3079
|
-
|
|
3080
|
-
localStorage.setItem("axon_surge_show_tutorial", String(
|
|
3081
|
-
}),
|
|
3116
|
+
for (const S of A) {
|
|
3117
|
+
const M = document.createElement("button");
|
|
3118
|
+
M.type = "button", M.className = `axon-toggle-btn ${L === S.enabled ? "active" : ""}`, M.textContent = S.label, M.addEventListener("click", () => {
|
|
3119
|
+
localStorage.setItem("axon_surge_show_tutorial", String(S.enabled)), this.renderContent();
|
|
3120
|
+
}), T.appendChild(M);
|
|
3082
3121
|
}
|
|
3083
|
-
|
|
3084
|
-
const
|
|
3085
|
-
|
|
3086
|
-
const
|
|
3087
|
-
|
|
3122
|
+
E.appendChild(I), E.appendChild(T);
|
|
3123
|
+
const R = document.createElement("div");
|
|
3124
|
+
R.className = "axon-settings-credits", R.textContent = this.i18n.translate("creditsJam");
|
|
3125
|
+
const C = document.createElement("button");
|
|
3126
|
+
C.type = "button", C.className = "axon-start-button", C.style.padding = "12px 36px", C.style.fontSize = "14px", C.textContent = this.i18n.translate("closeButton"), C.addEventListener("click", () => {
|
|
3088
3127
|
this.modal.close();
|
|
3089
|
-
}), this.card.appendChild(t), this.card.appendChild(e), this.card.appendChild(
|
|
3128
|
+
}), this.card.appendChild(t), this.card.appendChild(e), this.card.appendChild(n), this.card.appendChild(p), this.card.appendChild(u), this.card.appendChild(E), this.card.appendChild(R), this.card.appendChild(C);
|
|
3090
3129
|
}
|
|
3091
3130
|
isHapticsEnabled() {
|
|
3092
3131
|
return this.hapticsEnabled;
|
|
@@ -3101,8 +3140,8 @@ class xt {
|
|
|
3101
3140
|
this.modal.close();
|
|
3102
3141
|
}
|
|
3103
3142
|
}
|
|
3104
|
-
const
|
|
3105
|
-
class
|
|
3143
|
+
const F = "axon_surge_show_tutorial";
|
|
3144
|
+
class bt {
|
|
3106
3145
|
isActive = !1;
|
|
3107
3146
|
showWarning = !1;
|
|
3108
3147
|
dummyLauncher = null;
|
|
@@ -3111,14 +3150,14 @@ class yt {
|
|
|
3111
3150
|
initialTargetPos = { x: 0, y: 0 };
|
|
3112
3151
|
isTutorialEnabled() {
|
|
3113
3152
|
try {
|
|
3114
|
-
return localStorage.getItem(
|
|
3153
|
+
return localStorage.getItem(F) !== "false";
|
|
3115
3154
|
} catch {
|
|
3116
3155
|
return !0;
|
|
3117
3156
|
}
|
|
3118
3157
|
}
|
|
3119
3158
|
setTutorialEnabled(t) {
|
|
3120
3159
|
try {
|
|
3121
|
-
localStorage.setItem(
|
|
3160
|
+
localStorage.setItem(F, String(t));
|
|
3122
3161
|
} catch {
|
|
3123
3162
|
}
|
|
3124
3163
|
}
|
|
@@ -3136,39 +3175,39 @@ class yt {
|
|
|
3136
3175
|
this.isActive = !1;
|
|
3137
3176
|
return;
|
|
3138
3177
|
}
|
|
3139
|
-
this.isActive = !0, this.showWarning = !1, i.length = 0, this.initialLauncherPos = { x: t * 0.28, y: e * 0.28 }, this.initialTargetPos = { x: t * 0.72, y: e * 0.28 }, this.dummyLauncher =
|
|
3178
|
+
this.isActive = !0, this.showWarning = !1, i.length = 0, this.initialLauncherPos = { x: t * 0.28, y: e * 0.28 }, this.initialTargetPos = { x: t * 0.72, y: e * 0.28 }, this.dummyLauncher = P.createEnemy(
|
|
3140
3179
|
"piercer",
|
|
3141
3180
|
this.initialLauncherPos,
|
|
3142
3181
|
this.initialTargetPos
|
|
3143
|
-
), this.dummyLauncher.velocity = { x: 0, y: 0 }, this.dummyTarget =
|
|
3182
|
+
), this.dummyLauncher.velocity = { x: 0, y: 0 }, this.dummyTarget = P.createEnemy(
|
|
3144
3183
|
"spore",
|
|
3145
3184
|
this.initialTargetPos,
|
|
3146
3185
|
this.initialLauncherPos
|
|
3147
3186
|
), this.dummyTarget.velocity = { x: 0, y: 0 }, i.push(this.dummyLauncher), i.push(this.dummyTarget);
|
|
3148
3187
|
}
|
|
3149
|
-
update(t, e, i, s, a,
|
|
3188
|
+
update(t, e, i, s, a, r) {
|
|
3150
3189
|
if (!this.isActive || !this.dummyLauncher || !this.dummyTarget) return;
|
|
3151
|
-
const
|
|
3152
|
-
e.includes(
|
|
3153
|
-
const
|
|
3154
|
-
if (
|
|
3155
|
-
if (this.showWarning = !1,
|
|
3156
|
-
|
|
3190
|
+
const o = this.dummyLauncher, n = this.dummyTarget;
|
|
3191
|
+
e.includes(o) || e.push(o), e.includes(n) || e.push(n);
|
|
3192
|
+
const l = n.position.x - o.position.x, h = n.position.y - o.position.y, c = Math.hypot(l, h);
|
|
3193
|
+
if (o.isGrabbed) {
|
|
3194
|
+
if (this.showWarning = !1, c <= o.radius + n.radius + 60) {
|
|
3195
|
+
r && r(), o.isGrabbed = !1, this.showWarning = !0, this.resetDummies(o, n);
|
|
3157
3196
|
return;
|
|
3158
3197
|
}
|
|
3159
3198
|
return;
|
|
3160
3199
|
}
|
|
3161
|
-
if (
|
|
3162
|
-
const p = Math.hypot(
|
|
3163
|
-
if (!
|
|
3164
|
-
|
|
3200
|
+
if (o.wasManipulated) {
|
|
3201
|
+
const p = Math.hypot(o.velocity.x, o.velocity.y);
|
|
3202
|
+
if (!o.isThrown || p < 70) {
|
|
3203
|
+
r && r(), this.showWarning = !0, this.resetDummies(o, n);
|
|
3165
3204
|
return;
|
|
3166
3205
|
}
|
|
3167
|
-
if (
|
|
3168
|
-
|
|
3206
|
+
if (c <= o.getHitRadius() + n.getHitRadius()) {
|
|
3207
|
+
o.triggerDissolveDeath(!0), n.triggerDissolveDeath(!0), this.showWarning = !1, this.isActive = !1, a();
|
|
3169
3208
|
return;
|
|
3170
3209
|
}
|
|
3171
|
-
(
|
|
3210
|
+
(o.position.x < -60 || o.position.x > i + 60 || o.position.y < -60 || o.position.y > s + 60 || p < 40) && (r && r(), this.showWarning = !0, this.resetDummies(o, n));
|
|
3172
3211
|
}
|
|
3173
3212
|
}
|
|
3174
3213
|
resetDummies(t, e) {
|
|
@@ -3178,7 +3217,7 @@ class yt {
|
|
|
3178
3217
|
this.isActive = !1, this.showWarning = !1;
|
|
3179
3218
|
}
|
|
3180
3219
|
}
|
|
3181
|
-
class
|
|
3220
|
+
class vt {
|
|
3182
3221
|
container;
|
|
3183
3222
|
i18n;
|
|
3184
3223
|
tutorialManager;
|
|
@@ -3214,7 +3253,7 @@ class Et {
|
|
|
3214
3253
|
this.container.style.display = "none";
|
|
3215
3254
|
}
|
|
3216
3255
|
}
|
|
3217
|
-
class
|
|
3256
|
+
class It {
|
|
3218
3257
|
fillElement;
|
|
3219
3258
|
experienceCount = 0;
|
|
3220
3259
|
currentLevel = 1;
|
|
@@ -3251,7 +3290,7 @@ class bt {
|
|
|
3251
3290
|
this.fillElement && this.fillElement.parentElement && (this.fillElement.parentElement.style.display = "none");
|
|
3252
3291
|
}
|
|
3253
3292
|
}
|
|
3254
|
-
class
|
|
3293
|
+
class V {
|
|
3255
3294
|
static powerUps = [
|
|
3256
3295
|
{
|
|
3257
3296
|
id: "spore_radius",
|
|
@@ -3261,9 +3300,9 @@ class F {
|
|
|
3261
3300
|
category: "radius",
|
|
3262
3301
|
rarity: "common",
|
|
3263
3302
|
rarityWeight: 35,
|
|
3264
|
-
color:
|
|
3303
|
+
color: f.spore,
|
|
3265
3304
|
apply: () => {
|
|
3266
|
-
const t =
|
|
3305
|
+
const t = v.getInstance(), e = t.getConfig().toxicPool;
|
|
3267
3306
|
t.updateConfig({
|
|
3268
3307
|
toxicPool: {
|
|
3269
3308
|
...e,
|
|
@@ -3281,9 +3320,9 @@ class F {
|
|
|
3281
3320
|
category: "duration",
|
|
3282
3321
|
rarity: "common",
|
|
3283
3322
|
rarityWeight: 35,
|
|
3284
|
-
color:
|
|
3323
|
+
color: f.spore,
|
|
3285
3324
|
apply: () => {
|
|
3286
|
-
const t =
|
|
3325
|
+
const t = v.getInstance(), e = t.getConfig().toxicPool;
|
|
3287
3326
|
t.updateConfig({
|
|
3288
3327
|
toxicPool: {
|
|
3289
3328
|
...e,
|
|
@@ -3301,9 +3340,9 @@ class F {
|
|
|
3301
3340
|
category: "radius",
|
|
3302
3341
|
rarity: "common",
|
|
3303
3342
|
rarityWeight: 35,
|
|
3304
|
-
color:
|
|
3343
|
+
color: f.parasite,
|
|
3305
3344
|
apply: () => {
|
|
3306
|
-
const t =
|
|
3345
|
+
const t = v.getInstance(), e = t.getConfig().gravityVortex;
|
|
3307
3346
|
t.updateConfig({
|
|
3308
3347
|
gravityVortex: {
|
|
3309
3348
|
...e,
|
|
@@ -3321,9 +3360,9 @@ class F {
|
|
|
3321
3360
|
category: "duration",
|
|
3322
3361
|
rarity: "common",
|
|
3323
3362
|
rarityWeight: 35,
|
|
3324
|
-
color:
|
|
3363
|
+
color: f.parasite,
|
|
3325
3364
|
apply: () => {
|
|
3326
|
-
const t =
|
|
3365
|
+
const t = v.getInstance(), e = t.getConfig().gravityVortex;
|
|
3327
3366
|
t.updateConfig({
|
|
3328
3367
|
gravityVortex: {
|
|
3329
3368
|
...e,
|
|
@@ -3341,9 +3380,9 @@ class F {
|
|
|
3341
3380
|
category: "power",
|
|
3342
3381
|
rarity: "rare",
|
|
3343
3382
|
rarityWeight: 25,
|
|
3344
|
-
color:
|
|
3383
|
+
color: f.parasite,
|
|
3345
3384
|
apply: () => {
|
|
3346
|
-
const t =
|
|
3385
|
+
const t = v.getInstance(), e = t.getConfig().gravityVortex;
|
|
3347
3386
|
t.updateConfig({
|
|
3348
3387
|
gravityVortex: {
|
|
3349
3388
|
...e,
|
|
@@ -3361,9 +3400,9 @@ class F {
|
|
|
3361
3400
|
category: "power",
|
|
3362
3401
|
rarity: "legendary",
|
|
3363
3402
|
rarityWeight: 5,
|
|
3364
|
-
color:
|
|
3403
|
+
color: f.parasite,
|
|
3365
3404
|
apply: () => {
|
|
3366
|
-
const t =
|
|
3405
|
+
const t = v.getInstance(), e = t.getConfig().gravityVortex;
|
|
3367
3406
|
t.updateConfig({
|
|
3368
3407
|
gravityVortex: {
|
|
3369
3408
|
...e,
|
|
@@ -3380,9 +3419,9 @@ class F {
|
|
|
3380
3419
|
category: "power",
|
|
3381
3420
|
rarity: "legendary",
|
|
3382
3421
|
rarityWeight: 5,
|
|
3383
|
-
color:
|
|
3422
|
+
color: f.heavy,
|
|
3384
3423
|
apply: () => {
|
|
3385
|
-
const t =
|
|
3424
|
+
const t = v.getInstance(), e = t.getConfig().shield;
|
|
3386
3425
|
t.updateConfig({
|
|
3387
3426
|
shield: {
|
|
3388
3427
|
...e,
|
|
@@ -3399,9 +3438,9 @@ class F {
|
|
|
3399
3438
|
category: "power",
|
|
3400
3439
|
rarity: "epic",
|
|
3401
3440
|
rarityWeight: 15,
|
|
3402
|
-
color:
|
|
3441
|
+
color: f.heavy,
|
|
3403
3442
|
apply: () => {
|
|
3404
|
-
const t =
|
|
3443
|
+
const t = v.getInstance(), e = t.getConfig().shield;
|
|
3405
3444
|
t.updateConfig({
|
|
3406
3445
|
shield: {
|
|
3407
3446
|
...e,
|
|
@@ -3420,9 +3459,9 @@ class F {
|
|
|
3420
3459
|
category: "defense",
|
|
3421
3460
|
rarity: "common",
|
|
3422
3461
|
rarityWeight: 35,
|
|
3423
|
-
color:
|
|
3462
|
+
color: f.heavy,
|
|
3424
3463
|
apply: () => {
|
|
3425
|
-
const t =
|
|
3464
|
+
const t = v.getInstance(), e = t.getConfig().shield;
|
|
3426
3465
|
t.updateConfig({
|
|
3427
3466
|
shield: {
|
|
3428
3467
|
...e,
|
|
@@ -3439,9 +3478,9 @@ class F {
|
|
|
3439
3478
|
category: "power",
|
|
3440
3479
|
rarity: "rare",
|
|
3441
3480
|
rarityWeight: 25,
|
|
3442
|
-
color:
|
|
3481
|
+
color: f.cluster,
|
|
3443
3482
|
apply: () => {
|
|
3444
|
-
const t =
|
|
3483
|
+
const t = v.getInstance(), e = t.getConfig().cluster;
|
|
3445
3484
|
t.updateConfig({
|
|
3446
3485
|
cluster: {
|
|
3447
3486
|
...e,
|
|
@@ -3458,9 +3497,9 @@ class F {
|
|
|
3458
3497
|
category: "power",
|
|
3459
3498
|
rarity: "legendary",
|
|
3460
3499
|
rarityWeight: 5,
|
|
3461
|
-
color:
|
|
3500
|
+
color: f.cluster,
|
|
3462
3501
|
apply: () => {
|
|
3463
|
-
const t =
|
|
3502
|
+
const t = v.getInstance(), e = t.getConfig().cluster;
|
|
3464
3503
|
t.updateConfig({
|
|
3465
3504
|
cluster: {
|
|
3466
3505
|
...e,
|
|
@@ -3477,9 +3516,9 @@ class F {
|
|
|
3477
3516
|
category: "power",
|
|
3478
3517
|
rarity: "epic",
|
|
3479
3518
|
rarityWeight: 15,
|
|
3480
|
-
color:
|
|
3519
|
+
color: f.piercer,
|
|
3481
3520
|
apply: () => {
|
|
3482
|
-
const t =
|
|
3521
|
+
const t = v.getInstance(), e = t.getConfig().piercer;
|
|
3483
3522
|
t.updateConfig({
|
|
3484
3523
|
piercer: {
|
|
3485
3524
|
...e,
|
|
@@ -3496,9 +3535,9 @@ class F {
|
|
|
3496
3535
|
category: "power",
|
|
3497
3536
|
rarity: "legendary",
|
|
3498
3537
|
rarityWeight: 5,
|
|
3499
|
-
color:
|
|
3538
|
+
color: f.piercer,
|
|
3500
3539
|
apply: () => {
|
|
3501
|
-
const t =
|
|
3540
|
+
const t = v.getInstance(), e = t.getConfig().piercer;
|
|
3502
3541
|
t.updateConfig({
|
|
3503
3542
|
piercer: {
|
|
3504
3543
|
...e,
|
|
@@ -3515,9 +3554,9 @@ class F {
|
|
|
3515
3554
|
category: "defense",
|
|
3516
3555
|
rarity: "legendary",
|
|
3517
3556
|
rarityWeight: 5,
|
|
3518
|
-
color:
|
|
3557
|
+
color: f.core,
|
|
3519
3558
|
apply: () => {
|
|
3520
|
-
const t =
|
|
3559
|
+
const t = v.getInstance(), e = t.getConfig().core;
|
|
3521
3560
|
t.updateConfig({
|
|
3522
3561
|
core: {
|
|
3523
3562
|
...e,
|
|
@@ -3534,9 +3573,9 @@ class F {
|
|
|
3534
3573
|
category: "power",
|
|
3535
3574
|
rarity: "epic",
|
|
3536
3575
|
rarityWeight: 15,
|
|
3537
|
-
color:
|
|
3576
|
+
color: f.piercer,
|
|
3538
3577
|
apply: () => {
|
|
3539
|
-
const t =
|
|
3578
|
+
const t = v.getInstance(), e = t.getConfig().piercer;
|
|
3540
3579
|
t.updateConfig({
|
|
3541
3580
|
piercer: {
|
|
3542
3581
|
...e,
|
|
@@ -3553,9 +3592,9 @@ class F {
|
|
|
3553
3592
|
category: "defense",
|
|
3554
3593
|
rarity: "epic",
|
|
3555
3594
|
rarityWeight: 15,
|
|
3556
|
-
color:
|
|
3595
|
+
color: f.core,
|
|
3557
3596
|
apply: () => {
|
|
3558
|
-
const t =
|
|
3597
|
+
const t = v.getInstance(), e = t.getConfig().core;
|
|
3559
3598
|
t.updateConfig({
|
|
3560
3599
|
core: {
|
|
3561
3600
|
...e,
|
|
@@ -3572,9 +3611,9 @@ class F {
|
|
|
3572
3611
|
category: "defense",
|
|
3573
3612
|
rarity: "rare",
|
|
3574
3613
|
rarityWeight: 25,
|
|
3575
|
-
color:
|
|
3614
|
+
color: f.core,
|
|
3576
3615
|
apply: () => {
|
|
3577
|
-
const t =
|
|
3616
|
+
const t = v.getInstance(), e = t.getConfig().core;
|
|
3578
3617
|
t.updateConfig({
|
|
3579
3618
|
core: {
|
|
3580
3619
|
...e,
|
|
@@ -3591,9 +3630,9 @@ class F {
|
|
|
3591
3630
|
category: "defense",
|
|
3592
3631
|
rarity: "rare",
|
|
3593
3632
|
rarityWeight: 20,
|
|
3594
|
-
color:
|
|
3633
|
+
color: f.core,
|
|
3595
3634
|
apply: (t) => {
|
|
3596
|
-
|
|
3635
|
+
v.getInstance().addCoreRing(1), t && t.addMaxRing(1);
|
|
3597
3636
|
}
|
|
3598
3637
|
},
|
|
3599
3638
|
{
|
|
@@ -3604,9 +3643,9 @@ class F {
|
|
|
3604
3643
|
category: "magnet",
|
|
3605
3644
|
rarity: "common",
|
|
3606
3645
|
rarityWeight: 35,
|
|
3607
|
-
color:
|
|
3646
|
+
color: f.core,
|
|
3608
3647
|
apply: () => {
|
|
3609
|
-
const t =
|
|
3648
|
+
const t = v.getInstance(), e = t.getConfig().magnet;
|
|
3610
3649
|
t.updateConfig({
|
|
3611
3650
|
magnet: {
|
|
3612
3651
|
...e,
|
|
@@ -3623,9 +3662,9 @@ class F {
|
|
|
3623
3662
|
category: "magnet",
|
|
3624
3663
|
rarity: "rare",
|
|
3625
3664
|
rarityWeight: 25,
|
|
3626
|
-
color:
|
|
3665
|
+
color: f.core,
|
|
3627
3666
|
apply: () => {
|
|
3628
|
-
const t =
|
|
3667
|
+
const t = v.getInstance(), e = t.getConfig().magnet;
|
|
3629
3668
|
t.updateConfig({
|
|
3630
3669
|
magnet: {
|
|
3631
3670
|
...e,
|
|
@@ -3636,14 +3675,14 @@ class F {
|
|
|
3636
3675
|
}
|
|
3637
3676
|
];
|
|
3638
3677
|
static getRandomOptions(t = 3) {
|
|
3639
|
-
const e =
|
|
3678
|
+
const e = v.getInstance().getConfig(), i = this.powerUps.filter((a) => !(a.id === "vampirism_unlock" && e.core.vampirismHealProgressRate > 0 || a.id === "vampirism_boost" && e.core.vampirismHealProgressRate <= 0 || a.id === "piercer_homing" && e.piercer.hasHoming || a.id === "piercer_homing_target" && !e.piercer.hasHoming || a.id === "vortex_pocket" && e.gravityVortex.hasImplosionLaunch || a.id === "shield_fan" && e.shield.isFanBlast || a.id === "shield_fan_upgrade" && (!e.shield.isFanBlast || e.shield.hasFanBlastUpgrade) || a.id === "cluster_homing" && e.cluster.hasHoming || a.id === "offscreen_radar" && e.core.hasOffscreenIndicators)), s = [];
|
|
3640
3679
|
for (let a = 0; a < t && i.length > 0; a++) {
|
|
3641
|
-
const
|
|
3642
|
-
let
|
|
3643
|
-
for (let
|
|
3644
|
-
const
|
|
3645
|
-
if (
|
|
3646
|
-
s.push(
|
|
3680
|
+
const r = i.reduce((n, l) => n + l.rarityWeight, 0);
|
|
3681
|
+
let o = Math.random() * r;
|
|
3682
|
+
for (let n = 0; n < i.length; n++) {
|
|
3683
|
+
const l = i[n];
|
|
3684
|
+
if (o -= l.rarityWeight, o <= 0) {
|
|
3685
|
+
s.push(l), i.splice(n, 1);
|
|
3647
3686
|
break;
|
|
3648
3687
|
}
|
|
3649
3688
|
}
|
|
@@ -3654,7 +3693,7 @@ class F {
|
|
|
3654
3693
|
this.powerUps.push(t);
|
|
3655
3694
|
}
|
|
3656
3695
|
}
|
|
3657
|
-
class
|
|
3696
|
+
class St {
|
|
3658
3697
|
haptics = {
|
|
3659
3698
|
impact: async (t) => {
|
|
3660
3699
|
if ("vibrate" in navigator) {
|
|
@@ -3694,7 +3733,7 @@ class At {
|
|
|
3694
3733
|
}
|
|
3695
3734
|
};
|
|
3696
3735
|
}
|
|
3697
|
-
class
|
|
3736
|
+
class Mt {
|
|
3698
3737
|
enabled;
|
|
3699
3738
|
overlay;
|
|
3700
3739
|
copyButton;
|
|
@@ -3812,7 +3851,7 @@ HEAP ${(t.usedJSHeapSize / 1024 / 1024).toFixed(1)} MB` : "";
|
|
|
3812
3851
|
`), this.overlay.textContent = this.lastReport;
|
|
3813
3852
|
}
|
|
3814
3853
|
}
|
|
3815
|
-
class
|
|
3854
|
+
class Tt {
|
|
3816
3855
|
container;
|
|
3817
3856
|
canvas;
|
|
3818
3857
|
i18n;
|
|
@@ -3852,7 +3891,7 @@ class It {
|
|
|
3852
3891
|
isRunning = !1;
|
|
3853
3892
|
isPaused = !1;
|
|
3854
3893
|
constructor(t) {
|
|
3855
|
-
this.container = t.root, this.container.classList.add("axon-game-root"), this.i18n = new
|
|
3894
|
+
this.container = t.root, this.container.classList.add("axon-game-root"), this.i18n = new j(t.language), this.themeManager = new ut(t.theme, this.container), this.platform = t.platform || new St(), this.canvas = document.createElement("canvas"), this.canvas.className = "axon-canvas", this.container.appendChild(this.canvas), this.resizeCanvas(), window.addEventListener("resize", () => this.resizeCanvas()), this.eventBus = new Y(), this.core = new $(this.canvas.width / 2, this.canvas.height / 2), this.inputManager = new z(this.canvas), this.physicsEngine = new lt(this.eventBus, this.i18n), this.waveDirector = new ht(), this.renderer = new xt(this.canvas, this.themeManager), this.juice = new X(), this.settingsModal = new At(
|
|
3856
3895
|
this.container,
|
|
3857
3896
|
this.i18n,
|
|
3858
3897
|
this.themeManager,
|
|
@@ -3864,11 +3903,11 @@ class It {
|
|
|
3864
3903
|
(e) => {
|
|
3865
3904
|
this.gameLoop.setFpsLimit(e), this.performanceAudit.setFpsLimit(e);
|
|
3866
3905
|
}
|
|
3867
|
-
), this.interactiveTutorial = new
|
|
3906
|
+
), this.interactiveTutorial = new bt(), this.tutorialOverlay = new vt(this.container, this.i18n, this.interactiveTutorial), this.hud = new yt(this.container, this.i18n, () => {
|
|
3868
3907
|
this.isPaused = !0, this.settingsModal.show();
|
|
3869
|
-
}), this.hud.show(), this.progressBar = new
|
|
3908
|
+
}), this.hud.show(), this.progressBar = new It(this.hud.progressSlot, (e) => {
|
|
3870
3909
|
this.waveDirector.wave = e, this.triggerLevelUp(e);
|
|
3871
|
-
}), this.performanceAudit = new
|
|
3910
|
+
}), this.performanceAudit = new Mt(this.container, this.debugPerformanceEnabled), this.startMenu = new Et(this.container, this.i18n, () => this.startGame()), this.initAmbientArena(), this.gameLoop = new Z(
|
|
3872
3911
|
(e) => this.update(e),
|
|
3873
3912
|
() => this.render()
|
|
3874
3913
|
), this.gameLoop.setFpsLimit(this.settingsModal.getFpsLimit()), this.performanceAudit.setFpsLimit(this.settingsModal.getFpsLimit()), this.setupEvents(), this.gameLoop.start();
|
|
@@ -3892,14 +3931,14 @@ class It {
|
|
|
3892
3931
|
this.ambientEnemies = [];
|
|
3893
3932
|
const t = ["piercer", "spore", "cluster", "parasite"];
|
|
3894
3933
|
for (let e = 0; e < 16; e++) {
|
|
3895
|
-
const i = t[e % t.length], s = e * Math.PI * 2 / 16, a = 180 + Math.random() * 220,
|
|
3934
|
+
const i = e === 0 ? "heavy" : t[(e - 1) % t.length], s = e * Math.PI * 2 / 16, a = 180 + Math.random() * 220, r = {
|
|
3896
3935
|
x: this.canvas.width / 2 + Math.cos(s) * a,
|
|
3897
3936
|
y: this.canvas.height / 2 + Math.sin(s) * a
|
|
3898
|
-
},
|
|
3899
|
-
x:
|
|
3900
|
-
y:
|
|
3937
|
+
}, o = P.createEnemy(i, r, {
|
|
3938
|
+
x: r.x + Math.sin(s) * 100,
|
|
3939
|
+
y: r.y - Math.cos(s) * 100
|
|
3901
3940
|
});
|
|
3902
|
-
this.ambientEnemies.push(
|
|
3941
|
+
this.ambientEnemies.push(o);
|
|
3903
3942
|
}
|
|
3904
3943
|
}
|
|
3905
3944
|
resizeCanvas() {
|
|
@@ -3926,7 +3965,7 @@ class It {
|
|
|
3926
3965
|
}), this.canvas.addEventListener("touchstart", () => t(!0), { passive: !0 }), this.canvas.addEventListener("touchend", e, { passive: !0 }), this.canvas.addEventListener("touchcancel", e, { passive: !0 });
|
|
3927
3966
|
}
|
|
3928
3967
|
startGame() {
|
|
3929
|
-
|
|
3968
|
+
v.getInstance().resetToDefault(), this.score.value = 0, this.combo.value = 0, this.enemies = [], this.ambientEnemies = [], this.pools = [], this.vortices = [], this.shockwaves = [], this.particles = [], this.floatingTexts = [], this.experienceOrbs = [], this.orbitingOrbs = [], this.isLevelUpActive = !1, this.pendingLevelUps = [], this.rerollsRemaining = this.getRerollLimit(), this.core.reset(this.canvas.width / 2, this.canvas.height / 2), this.waveDirector.reset(), this.inputManager.reset(), this.hud.show(), this.hud.update(1, 0), this.progressBar.reset(), this.progressBar.show(), this.isPaused = !1, this.isRunning = !0, this.interactiveTutorial.isTutorialEnabled() ? (this.interactiveTutorial.start(this.canvas.width, this.canvas.height, this.enemies), this.tutorialOverlay.show()) : (this.interactiveTutorial.isActive = !1, this.tutorialOverlay.hide());
|
|
3930
3969
|
}
|
|
3931
3970
|
update(t) {
|
|
3932
3971
|
if (this.performanceAudit.beginFrame(), this.performanceAudit.setState(this.isRunning ? this.isPaused ? "PAUSED" : "GAME" : "MENU"), this.core.update(t), !this.isRunning || this.isPaused) {
|
|
@@ -3969,20 +4008,20 @@ class It {
|
|
|
3969
4008
|
!this.inputManager.isPointerDown && i && (i.isGrabbed = !1, this.inputManager.grabbedOrb = null);
|
|
3970
4009
|
const s = this.inputManager.pointerPosition;
|
|
3971
4010
|
if (this.inputManager.isPointerDown && !this.inputManager.grabbedOrb && this.rerollsRemaining > 0) {
|
|
3972
|
-
const a = this.canvas.width / 2,
|
|
3973
|
-
Math.hypot(s.x - a, s.y -
|
|
4011
|
+
const a = this.canvas.width / 2, r = this.canvas.height / 2 + 210;
|
|
4012
|
+
Math.hypot(s.x - a, s.y - r) <= 80 && (this.triggerReroll(), this.inputManager.isPointerDown = !1);
|
|
3974
4013
|
}
|
|
3975
4014
|
for (const a of this.orbitingOrbs) {
|
|
3976
|
-
const
|
|
3977
|
-
if (a.isHovered = Math.hypot(
|
|
4015
|
+
const r = s.x - a.position.x, o = s.y - a.position.y;
|
|
4016
|
+
if (a.isHovered = Math.hypot(r, o) <= a.radius * 1.5, a === i && this.inputManager.isPointerDown) {
|
|
3978
4017
|
a.position = { ...this.inputManager.pointerPosition };
|
|
3979
|
-
const
|
|
3980
|
-
if (Math.hypot(
|
|
3981
|
-
a.definition.apply(this.core), this.core.absorbPowerUpColor(a.definition.color, 0.4), this.juice.triggerFlash(0.8), this.juice.triggerScreenShake({ x:
|
|
3982
|
-
const
|
|
4018
|
+
const n = this.core.position.x - a.position.x, l = this.core.position.y - a.position.y;
|
|
4019
|
+
if (Math.hypot(n, l) <= this.core.radius + a.radius) {
|
|
4020
|
+
a.definition.apply(this.core), this.core.absorbPowerUpColor(a.definition.color, 0.4), this.juice.triggerFlash(0.8), this.juice.triggerScreenShake({ x: n, y: l }, 24);
|
|
4021
|
+
const c = this.i18n.translate(a.definition.titleKey);
|
|
3983
4022
|
this.floatingTexts.push({
|
|
3984
4023
|
id: Math.random().toString(),
|
|
3985
|
-
text: `+ ${
|
|
4024
|
+
text: `+ ${c}`,
|
|
3986
4025
|
position: { ...this.core.position },
|
|
3987
4026
|
velocity: { x: 0, y: -80 },
|
|
3988
4027
|
color: a.definition.color,
|
|
@@ -3992,11 +4031,11 @@ class It {
|
|
|
3992
4031
|
size: 26
|
|
3993
4032
|
});
|
|
3994
4033
|
for (let p = 0; p < 45; p++) {
|
|
3995
|
-
const
|
|
4034
|
+
const g = Math.random() * Math.PI * 2, _ = 200 + Math.random() * 400;
|
|
3996
4035
|
this.particles.push({
|
|
3997
4036
|
id: Math.random().toString(),
|
|
3998
4037
|
position: { ...this.core.position },
|
|
3999
|
-
velocity: { x: Math.cos(
|
|
4038
|
+
velocity: { x: Math.cos(g) * _, y: Math.sin(g) * _ },
|
|
4000
4039
|
color: a.definition.color,
|
|
4001
4040
|
radius: 4 + Math.random() * 5,
|
|
4002
4041
|
alpha: 1,
|
|
@@ -4033,7 +4072,7 @@ class It {
|
|
|
4033
4072
|
text: "RING RESTORED!",
|
|
4034
4073
|
position: { ...this.core.position },
|
|
4035
4074
|
velocity: { x: 0, y: -60 },
|
|
4036
|
-
color:
|
|
4075
|
+
color: f.core,
|
|
4037
4076
|
alpha: 1,
|
|
4038
4077
|
lifetime: 0,
|
|
4039
4078
|
maxLifetime: 1.2,
|
|
@@ -4065,7 +4104,7 @@ class It {
|
|
|
4065
4104
|
text: this.i18n.translate("levelUpChoose", { level: t }),
|
|
4066
4105
|
position: { ...this.core.position },
|
|
4067
4106
|
velocity: { x: 0, y: -100 },
|
|
4068
|
-
color:
|
|
4107
|
+
color: f.core,
|
|
4069
4108
|
alpha: 1,
|
|
4070
4109
|
lifetime: 0,
|
|
4071
4110
|
maxLifetime: 2,
|
|
@@ -4077,40 +4116,40 @@ class It {
|
|
|
4077
4116
|
id: Math.random().toString(),
|
|
4078
4117
|
position: { ...this.core.position },
|
|
4079
4118
|
velocity: { x: Math.cos(s) * a, y: Math.sin(s) * a },
|
|
4080
|
-
color:
|
|
4119
|
+
color: f.core,
|
|
4081
4120
|
radius: 2 + Math.random() * 3,
|
|
4082
4121
|
alpha: 1,
|
|
4083
4122
|
lifetime: 0,
|
|
4084
4123
|
maxLifetime: 0.7
|
|
4085
4124
|
});
|
|
4086
4125
|
}
|
|
4087
|
-
const e =
|
|
4126
|
+
const e = V.getRandomOptions(3);
|
|
4088
4127
|
this.orbitingOrbs = e.map((i, s) => {
|
|
4089
4128
|
const a = s * Math.PI * 2 / e.length;
|
|
4090
|
-
return new
|
|
4129
|
+
return new B(`orb_${Date.now()}_${s}`, i, a);
|
|
4091
4130
|
}), this.rerollsRemaining = this.getRerollLimit();
|
|
4092
4131
|
}
|
|
4093
4132
|
spawnExperienceDrops() {
|
|
4094
4133
|
for (const t of this.enemies)
|
|
4095
|
-
t.experienceDropPending && (t.experienceDropPending = !1, this.experienceOrbs.push(new
|
|
4134
|
+
t.experienceDropPending && (t.experienceDropPending = !1, this.experienceOrbs.push(new pt(t.position)));
|
|
4096
4135
|
}
|
|
4097
4136
|
updateExperienceOrbs(t) {
|
|
4098
|
-
const e =
|
|
4137
|
+
const e = v.getInstance().getConfig().magnet;
|
|
4099
4138
|
for (const i of this.experienceOrbs)
|
|
4100
4139
|
if (i.active) {
|
|
4101
4140
|
if (i.isAbsorbing || Math.hypot(
|
|
4102
4141
|
this.core.position.x - i.position.x,
|
|
4103
4142
|
this.core.position.y - i.position.y
|
|
4104
4143
|
) <= this.core.getHitboxRadius() + e.corePickupRadius && i.beginAbsorption(), !i.isAbsorbing) {
|
|
4105
|
-
const s = this.inputManager.pointerPosition.x - i.position.x, a = this.inputManager.pointerPosition.y - i.position.y,
|
|
4106
|
-
Math.hypot(s, a) <=
|
|
4144
|
+
const s = this.inputManager.pointerPosition.x - i.position.x, a = this.inputManager.pointerPosition.y - i.position.y, r = e.psionicRadius + e.pickupRadius + i.radius;
|
|
4145
|
+
Math.hypot(s, a) <= r && i.beginAbsorption();
|
|
4107
4146
|
}
|
|
4108
4147
|
i.update(t, this.core.position, this.core.getHitboxRadius(), e.absorptionSpeed), i.active || (this.progressBar.addExperience(i.value), this.juice.triggerFlash(0.12), this.floatingTexts.push({
|
|
4109
4148
|
id: Math.random().toString(),
|
|
4110
4149
|
text: `+${i.value} XP`,
|
|
4111
4150
|
position: { ...this.core.position },
|
|
4112
4151
|
velocity: { x: 0, y: -55 },
|
|
4113
|
-
color:
|
|
4152
|
+
color: f.experience,
|
|
4114
4153
|
alpha: 1,
|
|
4115
4154
|
lifetime: 0,
|
|
4116
4155
|
maxLifetime: 0.8,
|
|
@@ -4122,10 +4161,10 @@ class It {
|
|
|
4122
4161
|
triggerReroll() {
|
|
4123
4162
|
if (this.rerollsRemaining <= 0) return;
|
|
4124
4163
|
this.rerollsRemaining -= 1, this.juice.triggerFlash(0.4);
|
|
4125
|
-
const t =
|
|
4164
|
+
const t = V.getRandomOptions(3);
|
|
4126
4165
|
this.orbitingOrbs = t.map((e, i) => {
|
|
4127
4166
|
const s = i * Math.PI * 2 / t.length;
|
|
4128
|
-
return new
|
|
4167
|
+
return new B(`orb_${Date.now()}_${i}`, e, s);
|
|
4129
4168
|
});
|
|
4130
4169
|
}
|
|
4131
4170
|
render() {
|
|
@@ -4159,14 +4198,14 @@ class It {
|
|
|
4159
4198
|
this.gameLoop.stop(), this.performanceAudit.destroy(), this.canvas.remove();
|
|
4160
4199
|
}
|
|
4161
4200
|
}
|
|
4162
|
-
function
|
|
4163
|
-
return new
|
|
4201
|
+
function Lt(b) {
|
|
4202
|
+
return new Tt(b);
|
|
4164
4203
|
}
|
|
4165
4204
|
export {
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4205
|
+
St as BrowserPlatform,
|
|
4206
|
+
Tt as GameEngine,
|
|
4207
|
+
W as LANGUAGES,
|
|
4208
|
+
ut as ThemeManager,
|
|
4209
|
+
Lt as createAxonSurge,
|
|
4210
|
+
k as isLanguage
|
|
4172
4211
|
};
|