@gamebob/axon-surge 0.11.0 → 0.13.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 +756 -631
- package/dist/config/GameConfig.d.ts +1 -0
- package/dist/config/GameConfig.d.ts.map +1 -1
- package/dist/core/GameEngine.d.ts.map +1 -1
- package/dist/entities/CoreEntity.d.ts +2 -0
- package/dist/entities/CoreEntity.d.ts.map +1 -1
- package/dist/i18n/locales.d.ts +2 -0
- package/dist/i18n/locales.d.ts.map +1 -1
- package/dist/input/InputManager.d.ts.map +1 -1
- package/dist/physics/PhysicsEngine.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/render/CanvasRenderer.d.ts +1 -0
- package/dist/render/CanvasRenderer.d.ts.map +1 -1
- package/dist/render/CosmosBackgroundRenderer.d.ts +7 -1
- package/dist/render/CosmosBackgroundRenderer.d.ts.map +1 -1
- package/dist/render/JuiceEffects.d.ts.map +1 -1
- package/dist/render/OffscreenIndicatorRenderer.d.ts +2 -1
- package/dist/render/OffscreenIndicatorRenderer.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/ToxicSporeStrategy.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme/ThemeManager.d.ts +6 -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 V {
|
|
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 J {
|
|
|
15
15
|
this.listeners.clear();
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
class
|
|
18
|
+
class W {
|
|
19
19
|
animationFrameId = null;
|
|
20
20
|
lastTime = 0;
|
|
21
21
|
isRunning = !1;
|
|
@@ -36,23 +36,24 @@ class X {
|
|
|
36
36
|
this.lastTime = t, this.updateCallback(e), this.renderCallback(), this.animationFrameId = requestAnimationFrame(this.tick);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
const
|
|
39
|
+
const k = {
|
|
40
40
|
core: {
|
|
41
41
|
maxIntegrity: 3,
|
|
42
42
|
invulnerabilityDuration: 1.5,
|
|
43
43
|
radius: 32,
|
|
44
|
-
vampirismHealProgressRate: 0
|
|
44
|
+
vampirismHealProgressRate: 0,
|
|
45
|
+
hasOffscreenIndicators: !1
|
|
45
46
|
},
|
|
46
47
|
toxicPool: {
|
|
47
|
-
baseRadius:
|
|
48
|
-
synergyRadius:
|
|
48
|
+
baseRadius: 40,
|
|
49
|
+
synergyRadius: 80,
|
|
49
50
|
baseDuration: 4.5,
|
|
50
51
|
synergyDuration: 8,
|
|
51
52
|
damage: 50
|
|
52
53
|
},
|
|
53
54
|
gravityVortex: {
|
|
54
|
-
baseRadius:
|
|
55
|
-
synergyRadius:
|
|
55
|
+
baseRadius: 75,
|
|
56
|
+
synergyRadius: 130,
|
|
56
57
|
baseDuration: 4,
|
|
57
58
|
synergyDuration: 6,
|
|
58
59
|
basePullForce: 2200,
|
|
@@ -74,14 +75,14 @@ const B = {
|
|
|
74
75
|
homingTargets: 1
|
|
75
76
|
}
|
|
76
77
|
};
|
|
77
|
-
class
|
|
78
|
+
class E {
|
|
78
79
|
static instance;
|
|
79
80
|
config;
|
|
80
81
|
constructor() {
|
|
81
|
-
this.config = JSON.parse(JSON.stringify(
|
|
82
|
+
this.config = JSON.parse(JSON.stringify(k));
|
|
82
83
|
}
|
|
83
84
|
static getInstance() {
|
|
84
|
-
return
|
|
85
|
+
return E.instance || (E.instance = new E()), E.instance;
|
|
85
86
|
}
|
|
86
87
|
getConfig() {
|
|
87
88
|
return this.config;
|
|
@@ -99,10 +100,10 @@ class A {
|
|
|
99
100
|
this.config.core.maxIntegrity += t;
|
|
100
101
|
}
|
|
101
102
|
resetToDefault() {
|
|
102
|
-
this.config = JSON.parse(JSON.stringify(
|
|
103
|
+
this.config = JSON.parse(JSON.stringify(k));
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
|
-
class
|
|
106
|
+
class F {
|
|
106
107
|
position;
|
|
107
108
|
radius;
|
|
108
109
|
integrity;
|
|
@@ -113,18 +114,22 @@ class z {
|
|
|
113
114
|
maxInvulnerabilityDuration;
|
|
114
115
|
customColor = { r: 0, g: 240, b: 255 };
|
|
115
116
|
powerUpCount = 0;
|
|
117
|
+
collectedPowerUpColors = [];
|
|
116
118
|
constructor(t, e) {
|
|
117
|
-
const i =
|
|
119
|
+
const i = E.getInstance().getConfig().core;
|
|
118
120
|
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;
|
|
119
121
|
}
|
|
120
122
|
absorbPowerUpColor(t, e = 0.35) {
|
|
121
|
-
this.powerUpCount
|
|
123
|
+
this.powerUpCount++, this.collectedPowerUpColors.push(t);
|
|
122
124
|
const i = t.replace("#", "");
|
|
123
125
|
if (i.length === 6) {
|
|
124
|
-
const s = parseInt(i.substring(0, 2), 16), a = parseInt(i.substring(2, 4), 16),
|
|
125
|
-
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) +
|
|
126
|
+
const s = parseInt(i.substring(0, 2), 16), a = parseInt(i.substring(2, 4), 16), c = parseInt(i.substring(4, 6), 16);
|
|
127
|
+
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) + c * e);
|
|
126
128
|
}
|
|
127
129
|
}
|
|
130
|
+
getHitboxRadius() {
|
|
131
|
+
return this.integrity > 0 ? this.radius + 16 + (this.integrity - 1) * 12 : this.radius;
|
|
132
|
+
}
|
|
128
133
|
getColorHex() {
|
|
129
134
|
const t = this.customColor.r.toString(16).padStart(2, "0"), e = this.customColor.g.toString(16).padStart(2, "0"), i = this.customColor.b.toString(16).padStart(2, "0");
|
|
130
135
|
return `#${t}${e}${i}`;
|
|
@@ -138,7 +143,7 @@ class z {
|
|
|
138
143
|
}
|
|
139
144
|
repairProgress = 0;
|
|
140
145
|
addKillRepair() {
|
|
141
|
-
const t =
|
|
146
|
+
const t = E.getInstance().getConfig().core.vampirismHealProgressRate;
|
|
142
147
|
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);
|
|
143
148
|
}
|
|
144
149
|
heal(t = 1) {
|
|
@@ -151,11 +156,11 @@ class z {
|
|
|
151
156
|
return this.invulnerabilityTimer > 0 ? !1 : this.integrity > 0 ? (this.integrity -= 1, this.invulnerabilityTimer = this.maxInvulnerabilityDuration, !0) : !1;
|
|
152
157
|
}
|
|
153
158
|
reset(t, e) {
|
|
154
|
-
const i =
|
|
155
|
-
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.customColor = { r: 0, g: 240, b: 255 };
|
|
159
|
+
const i = E.getInstance().getConfig().core;
|
|
160
|
+
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 };
|
|
156
161
|
}
|
|
157
162
|
}
|
|
158
|
-
class
|
|
163
|
+
class w {
|
|
159
164
|
id;
|
|
160
165
|
position = { x: 0, y: 0 };
|
|
161
166
|
velocity = { x: 0, y: 0 };
|
|
@@ -212,7 +217,7 @@ class H {
|
|
|
212
217
|
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.position = { x: 0, y: 0 }, this.velocity = { x: 0, y: 0 }, this.rotation = 0, this.strategy = null, this.maxSpeed = 200;
|
|
213
218
|
}
|
|
214
219
|
}
|
|
215
|
-
class
|
|
220
|
+
class G {
|
|
216
221
|
id;
|
|
217
222
|
definition;
|
|
218
223
|
position = { x: 0, y: 0 };
|
|
@@ -229,7 +234,7 @@ class K {
|
|
|
229
234
|
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);
|
|
230
235
|
}
|
|
231
236
|
}
|
|
232
|
-
class
|
|
237
|
+
class Y {
|
|
233
238
|
pointerPosition = { x: 0, y: 0 };
|
|
234
239
|
isPointerDown = !1;
|
|
235
240
|
grabbedEnemy = null;
|
|
@@ -241,16 +246,16 @@ class $ {
|
|
|
241
246
|
this.canvas = t, this.bindEvents();
|
|
242
247
|
}
|
|
243
248
|
updatePointerPos(t, e) {
|
|
244
|
-
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,
|
|
249
|
+
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, c = performance.now() / 1e3;
|
|
245
250
|
this.pointerPosition = {
|
|
246
251
|
x: (t - i.left) * s,
|
|
247
252
|
y: (e - i.top) * a
|
|
248
253
|
}, this.pointerHistory.push({
|
|
249
254
|
x: this.pointerPosition.x,
|
|
250
255
|
y: this.pointerPosition.y,
|
|
251
|
-
time:
|
|
256
|
+
time: c
|
|
252
257
|
});
|
|
253
|
-
const n =
|
|
258
|
+
const n = c - 0.08;
|
|
254
259
|
this.pointerHistory = this.pointerHistory.filter((o) => o.time >= n), this.grabbedEnemy && (this.grabbedEnemy.position = { ...this.pointerPosition });
|
|
255
260
|
}
|
|
256
261
|
bindEvents() {
|
|
@@ -291,8 +296,9 @@ class $ {
|
|
|
291
296
|
const i = e ? 50 : 20;
|
|
292
297
|
for (const s of t) {
|
|
293
298
|
if (!s.active || s.isGrabbed || s.isThrown || s.wasManipulated) continue;
|
|
294
|
-
const a = this.pointerPosition.x - s.position.x,
|
|
295
|
-
Math.hypot(a,
|
|
299
|
+
const a = this.pointerPosition.x - s.position.x, c = this.pointerPosition.y - s.position.y;
|
|
300
|
+
if (Math.hypot(a, c) <= s.getHitRadius() + i)
|
|
301
|
+
return s.isGrabbed = !0, this.grabbedEnemy = s, this.dragStart = { ...this.pointerPosition }, this.pointerHistory = [], s;
|
|
296
302
|
}
|
|
297
303
|
return null;
|
|
298
304
|
}
|
|
@@ -301,8 +307,8 @@ class $ {
|
|
|
301
307
|
const i = e ? 50 : 20;
|
|
302
308
|
for (const s of t) {
|
|
303
309
|
if (!s.active || s.isGrabbed) continue;
|
|
304
|
-
const a = this.pointerPosition.x - s.position.x,
|
|
305
|
-
if (Math.hypot(a,
|
|
310
|
+
const a = this.pointerPosition.x - s.position.x, c = this.pointerPosition.y - s.position.y;
|
|
311
|
+
if (Math.hypot(a, c) <= s.radius * 1.5 + i)
|
|
306
312
|
return s.isGrabbed = !0, this.grabbedOrb = s, s;
|
|
307
313
|
}
|
|
308
314
|
return null;
|
|
@@ -312,22 +318,22 @@ class $ {
|
|
|
312
318
|
const t = this.grabbedEnemy;
|
|
313
319
|
t.isGrabbed = !1, t.isThrown = !0, t.wasManipulated = !0;
|
|
314
320
|
const i = performance.now() / 1e3 - 0.08, s = this.pointerHistory.filter((o) => o.time >= i);
|
|
315
|
-
let a = 0,
|
|
321
|
+
let a = 0, c = 0;
|
|
316
322
|
if (s.length >= 2) {
|
|
317
|
-
const o = s[0], r = s[s.length - 1],
|
|
318
|
-
a = (r.x - o.x) /
|
|
323
|
+
const o = s[0], r = s[s.length - 1], l = Math.max(0.01, r.time - o.time);
|
|
324
|
+
a = (r.x - o.x) / l, c = (r.y - o.y) / l;
|
|
319
325
|
}
|
|
320
|
-
const n = Math.hypot(a,
|
|
326
|
+
const n = Math.hypot(a, c);
|
|
321
327
|
if (n > 30) {
|
|
322
|
-
const r = Math.min(n * 1.15, 2500),
|
|
328
|
+
const r = Math.min(n * 1.15, 2500), l = Math.atan2(c, a);
|
|
323
329
|
t.velocity = {
|
|
324
|
-
x: Math.cos(
|
|
325
|
-
y: Math.sin(
|
|
330
|
+
x: Math.cos(l) * r,
|
|
331
|
+
y: Math.sin(l) * r
|
|
326
332
|
};
|
|
327
333
|
} else if (this.dragStart) {
|
|
328
|
-
const o = t.position.x - this.dragStart.x, r = t.position.y - this.dragStart.y,
|
|
329
|
-
if (
|
|
330
|
-
const h = Math.atan2(r, o), u = Math.min(
|
|
334
|
+
const o = t.position.x - this.dragStart.x, r = t.position.y - this.dragStart.y, l = Math.hypot(o, r);
|
|
335
|
+
if (l > 5) {
|
|
336
|
+
const h = Math.atan2(r, o), u = Math.min(l * 4, 600);
|
|
331
337
|
t.velocity = {
|
|
332
338
|
x: Math.cos(h) * u,
|
|
333
339
|
y: Math.sin(h) * u
|
|
@@ -338,7 +344,7 @@ class $ {
|
|
|
338
344
|
if (t.type === "heavy")
|
|
339
345
|
t.shieldAngle = t.rotation, t.velocity = { x: 0, y: 0 }, t.isStationaryShield = !0, t.isThrown = !1;
|
|
340
346
|
else if (t.type === "piercer") {
|
|
341
|
-
const o =
|
|
347
|
+
const o = E.getInstance().getConfig().piercer;
|
|
342
348
|
o.hasHoming && (t.remainingHomingKills = o.homingTargets);
|
|
343
349
|
}
|
|
344
350
|
return this.grabbedEnemy = null, this.dragStart = null, this.pointerHistory = [], t;
|
|
@@ -350,7 +356,7 @@ class $ {
|
|
|
350
356
|
this.grabbedEnemy = null, this.grabbedOrb = null, this.dragStart = null, this.pointerHistory = [], this.isPointerDown = !1;
|
|
351
357
|
}
|
|
352
358
|
}
|
|
353
|
-
class
|
|
359
|
+
class Z {
|
|
354
360
|
cellSize;
|
|
355
361
|
grid = /* @__PURE__ */ new Map();
|
|
356
362
|
constructor(t = 100) {
|
|
@@ -361,23 +367,23 @@ class j {
|
|
|
361
367
|
}
|
|
362
368
|
insert(t) {
|
|
363
369
|
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);
|
|
364
|
-
for (let
|
|
370
|
+
for (let c = e; c <= i; c++)
|
|
365
371
|
for (let n = s; n <= a; n++) {
|
|
366
|
-
const o = `${
|
|
372
|
+
const o = `${c}:${n}`;
|
|
367
373
|
this.grid.has(o) || this.grid.set(o, /* @__PURE__ */ new Set()), this.grid.get(o).add(t);
|
|
368
374
|
}
|
|
369
375
|
}
|
|
370
376
|
getNearby(t, e) {
|
|
371
|
-
const i = /* @__PURE__ */ new Set(), s = Math.floor((t.x - e) / this.cellSize), a = Math.floor((t.x + e) / this.cellSize),
|
|
377
|
+
const i = /* @__PURE__ */ new Set(), s = Math.floor((t.x - e) / this.cellSize), a = Math.floor((t.x + e) / this.cellSize), c = Math.floor((t.y - e) / this.cellSize), n = Math.floor((t.y + e) / this.cellSize);
|
|
372
378
|
for (let o = s; o <= a; o++)
|
|
373
|
-
for (let r =
|
|
374
|
-
const
|
|
379
|
+
for (let r = c; r <= n; r++) {
|
|
380
|
+
const l = `${o}:${r}`, h = this.grid.get(l);
|
|
375
381
|
h && h.forEach((u) => i.add(u));
|
|
376
382
|
}
|
|
377
383
|
return i;
|
|
378
384
|
}
|
|
379
385
|
}
|
|
380
|
-
class
|
|
386
|
+
class J {
|
|
381
387
|
hitstopTime = 0;
|
|
382
388
|
shakeTime = 0;
|
|
383
389
|
shakeDuration = 0.14;
|
|
@@ -385,7 +391,7 @@ class q {
|
|
|
385
391
|
shakeVector = { x: 0, y: 0 };
|
|
386
392
|
flashAlpha = 0;
|
|
387
393
|
triggerHitstop(t = 0.06) {
|
|
388
|
-
this.hitstopTime =
|
|
394
|
+
this.hitstopTime = 0;
|
|
389
395
|
}
|
|
390
396
|
triggerFlash(t = 0.4) {
|
|
391
397
|
this.flashAlpha = t;
|
|
@@ -398,7 +404,7 @@ class q {
|
|
|
398
404
|
}, this.shakeIntensity = s, this.shakeTime = this.shakeDuration;
|
|
399
405
|
}
|
|
400
406
|
update(t, e, i) {
|
|
401
|
-
this.hitstopTime > 0 && (this.hitstopTime -= t), this.shakeTime > 0 && (this.shakeTime -= t), this.flashAlpha > 0 && (this.flashAlpha = Math.max(0, this.flashAlpha - t * 4));
|
|
407
|
+
this.hitstopTime > 0 && (this.hitstopTime -= t), this.shakeTime > 0 && (this.shakeTime -= t), this.flashAlpha > 0 && (this.flashAlpha = Math.max(0, this.flashAlpha - t * 4)), e.length > 25 && e.splice(0, e.length - 25), i.length > 120 && i.splice(0, i.length - 120);
|
|
402
408
|
for (let s = e.length - 1; s >= 0; s--) {
|
|
403
409
|
const a = e[s];
|
|
404
410
|
a && (a.lifetime += t, a.position.x += a.velocity.x * t, a.position.y += a.velocity.y * t, a.alpha = 1 - a.lifetime / a.maxLifetime, a.lifetime >= a.maxLifetime && e.splice(s, 1));
|
|
@@ -417,7 +423,7 @@ class q {
|
|
|
417
423
|
};
|
|
418
424
|
}
|
|
419
425
|
}
|
|
420
|
-
const
|
|
426
|
+
const O = {
|
|
421
427
|
es: {
|
|
422
428
|
title: "AXON SURGE",
|
|
423
429
|
startButton: "INICIAR ENLACE",
|
|
@@ -443,11 +449,11 @@ const P = {
|
|
|
443
449
|
levelUpChoose: "¡NIVEL {level}! ELIGE UN MODIFICADOR",
|
|
444
450
|
rerollButton: "🎲 REROLL (1 DISPONIBLE)",
|
|
445
451
|
pu_spore_radius_title: "EXPANSIÓN ÁCIDA",
|
|
446
|
-
pu_spore_radius_desc: "+
|
|
452
|
+
pu_spore_radius_desc: "+12% Radio Ácido",
|
|
447
453
|
pu_spore_duration_title: "LONGEVIDAD ÁCIDA",
|
|
448
454
|
pu_spore_duration_desc: "+3.0s Duración Ácido",
|
|
449
455
|
pu_vortex_radius_title: "EXPANSIÓN DE SINGULARIDAD",
|
|
450
|
-
pu_vortex_radius_desc: "+
|
|
456
|
+
pu_vortex_radius_desc: "+12% Radio Vórtice",
|
|
451
457
|
pu_vortex_duration_title: "LONGEVIDAD GRAVITATORIA",
|
|
452
458
|
pu_vortex_duration_desc: "+2.5s Duración Vórtice",
|
|
453
459
|
pu_vortex_power_title: "SOBRECARGA GRAVITATORIA",
|
|
@@ -471,7 +477,9 @@ const P = {
|
|
|
471
477
|
pu_vampirism_boost_title: "IMPULSO VAMPÍRICO",
|
|
472
478
|
pu_vampirism_boost_desc: "+0.3% Curación por baja",
|
|
473
479
|
pu_core_ring_title: "SOBRECARGA DE NÚCLEO",
|
|
474
|
-
pu_core_ring_desc: "+1 Anillo de Vida"
|
|
480
|
+
pu_core_ring_desc: "+1 Anillo de Vida",
|
|
481
|
+
pu_offscreen_radar_title: "RADAR PSÍONICO",
|
|
482
|
+
pu_offscreen_radar_desc: "Detecta enemigos fuera de pantalla"
|
|
475
483
|
},
|
|
476
484
|
en: {
|
|
477
485
|
title: "AXON SURGE",
|
|
@@ -498,11 +506,11 @@ const P = {
|
|
|
498
506
|
levelUpChoose: "LEVEL {level}! CHOOSE MODIFIER",
|
|
499
507
|
rerollButton: "🎲 REROLL (1 AVAILABLE)",
|
|
500
508
|
pu_spore_radius_title: "ACID EXPANSION",
|
|
501
|
-
pu_spore_radius_desc: "+
|
|
509
|
+
pu_spore_radius_desc: "+12% Acid Radius",
|
|
502
510
|
pu_spore_duration_title: "ACID LINGER",
|
|
503
511
|
pu_spore_duration_desc: "+3.0s Acid Duration",
|
|
504
512
|
pu_vortex_radius_title: "SINGULARITY EXPANSION",
|
|
505
|
-
pu_vortex_radius_desc: "+
|
|
513
|
+
pu_vortex_radius_desc: "+12% Vortex Radius",
|
|
506
514
|
pu_vortex_duration_title: "GRAVITY LINGER",
|
|
507
515
|
pu_vortex_duration_desc: "+2.5s Vortex Duration",
|
|
508
516
|
pu_vortex_power_title: "GRAVITY SURGE",
|
|
@@ -526,7 +534,9 @@ const P = {
|
|
|
526
534
|
pu_vampirism_boost_title: "VAMPIRIC SURGE",
|
|
527
535
|
pu_vampirism_boost_desc: "+0.3% Heal per kill",
|
|
528
536
|
pu_core_ring_title: "NUCLEUS OVERCHARGE",
|
|
529
|
-
pu_core_ring_desc: "+1 Life Ring"
|
|
537
|
+
pu_core_ring_desc: "+1 Life Ring",
|
|
538
|
+
pu_offscreen_radar_title: "PSIONIC RADAR",
|
|
539
|
+
pu_offscreen_radar_desc: "Detect off-screen enemies"
|
|
530
540
|
},
|
|
531
541
|
fr: {
|
|
532
542
|
title: "AXON SURGE",
|
|
@@ -1243,7 +1253,7 @@ const P = {
|
|
|
1243
1253
|
pu_core_ring_title: "核心过载",
|
|
1244
1254
|
pu_core_ring_desc: "+1 生命环"
|
|
1245
1255
|
}
|
|
1246
|
-
},
|
|
1256
|
+
}, K = [
|
|
1247
1257
|
"es",
|
|
1248
1258
|
"en",
|
|
1249
1259
|
"fr",
|
|
@@ -1260,29 +1270,29 @@ const P = {
|
|
|
1260
1270
|
"ko",
|
|
1261
1271
|
"zh"
|
|
1262
1272
|
];
|
|
1263
|
-
function
|
|
1264
|
-
return
|
|
1273
|
+
function P(y) {
|
|
1274
|
+
return K.includes(y);
|
|
1265
1275
|
}
|
|
1266
|
-
const
|
|
1267
|
-
class
|
|
1276
|
+
const U = "axon_surge_language";
|
|
1277
|
+
class z {
|
|
1268
1278
|
currentLanguage;
|
|
1269
1279
|
constructor(t) {
|
|
1270
1280
|
this.currentLanguage = this.detectLanguage(t);
|
|
1271
1281
|
}
|
|
1272
1282
|
detectLanguage(t) {
|
|
1273
1283
|
try {
|
|
1274
|
-
const e = localStorage.getItem(
|
|
1275
|
-
if (e &&
|
|
1284
|
+
const e = localStorage.getItem(U);
|
|
1285
|
+
if (e && P(e))
|
|
1276
1286
|
return e;
|
|
1277
1287
|
} catch {
|
|
1278
1288
|
}
|
|
1279
|
-
if (t &&
|
|
1289
|
+
if (t && P(t))
|
|
1280
1290
|
return t;
|
|
1281
1291
|
try {
|
|
1282
1292
|
const e = (document.documentElement.lang || document.body?.getAttribute("lang") || document.documentElement.getAttribute("data-lang") || "").toLowerCase();
|
|
1283
1293
|
if (e) {
|
|
1284
1294
|
const i = e.split("-")[0];
|
|
1285
|
-
if (i &&
|
|
1295
|
+
if (i && P(i))
|
|
1286
1296
|
return i;
|
|
1287
1297
|
}
|
|
1288
1298
|
} catch {
|
|
@@ -1291,7 +1301,7 @@ class Q {
|
|
|
1291
1301
|
const e = (navigator.language || navigator.languages && navigator.languages[0] || "").toLowerCase();
|
|
1292
1302
|
if (e) {
|
|
1293
1303
|
const i = e.split("-")[0];
|
|
1294
|
-
if (i &&
|
|
1304
|
+
if (i && P(i))
|
|
1295
1305
|
return i;
|
|
1296
1306
|
}
|
|
1297
1307
|
} catch {
|
|
@@ -1299,10 +1309,10 @@ class Q {
|
|
|
1299
1309
|
return "en";
|
|
1300
1310
|
}
|
|
1301
1311
|
setLanguage(t) {
|
|
1302
|
-
if (
|
|
1312
|
+
if (O[t]) {
|
|
1303
1313
|
this.currentLanguage = t;
|
|
1304
1314
|
try {
|
|
1305
|
-
localStorage.setItem(
|
|
1315
|
+
localStorage.setItem(U, t);
|
|
1306
1316
|
} catch {
|
|
1307
1317
|
}
|
|
1308
1318
|
}
|
|
@@ -1311,33 +1321,33 @@ class Q {
|
|
|
1311
1321
|
return this.currentLanguage;
|
|
1312
1322
|
}
|
|
1313
1323
|
translate(t, e) {
|
|
1314
|
-
let s = (
|
|
1315
|
-
return e && Object.entries(e).forEach(([a,
|
|
1316
|
-
s = s.replace(`{${a}}`, String(
|
|
1324
|
+
let s = (O[this.currentLanguage] || O.en)[t] || O.en[t] || String(t);
|
|
1325
|
+
return e && Object.entries(e).forEach(([a, c]) => {
|
|
1326
|
+
s = s.replace(`{${a}}`, String(c));
|
|
1317
1327
|
}), s;
|
|
1318
1328
|
}
|
|
1319
1329
|
}
|
|
1320
|
-
class
|
|
1330
|
+
class $ {
|
|
1321
1331
|
static update(t, e, i) {
|
|
1322
|
-
const s =
|
|
1332
|
+
const s = E.getInstance().getConfig();
|
|
1323
1333
|
for (let a = t.length - 1; a >= 0; a--) {
|
|
1324
|
-
const
|
|
1325
|
-
if (
|
|
1326
|
-
|
|
1334
|
+
const c = t[a];
|
|
1335
|
+
if (c) {
|
|
1336
|
+
c.duration += i;
|
|
1327
1337
|
for (const n of e) {
|
|
1328
1338
|
if (!n.active || n.isGrabbed || n.isDying || n.isStationaryShield || n.isThrown && n.type === "piercer") continue;
|
|
1329
|
-
const o =
|
|
1330
|
-
if (
|
|
1331
|
-
const h = Math.pow(1 -
|
|
1339
|
+
const o = c.position.x - n.position.x, r = c.position.y - n.position.y, l = Math.hypot(o, r);
|
|
1340
|
+
if (l > 2 && l <= c.radius) {
|
|
1341
|
+
const h = Math.pow(1 - l / c.radius, 0.7), u = c.pullForce * h, p = Math.atan2(r, o);
|
|
1332
1342
|
n.velocity.x += Math.cos(p) * u * i, n.velocity.y += Math.sin(p) * u * i, n.position.x += Math.cos(p) * u * i * 0.8, n.position.y += Math.sin(p) * u * i * 0.8;
|
|
1333
1343
|
}
|
|
1334
1344
|
}
|
|
1335
|
-
if (
|
|
1345
|
+
if (c.duration >= c.maxDuration) {
|
|
1336
1346
|
if (s.gravityVortex.hasImplosionLaunch)
|
|
1337
1347
|
for (const n of e) {
|
|
1338
1348
|
if (!n.active || n.isDying) continue;
|
|
1339
|
-
const o = n.position.x -
|
|
1340
|
-
if (Math.hypot(o, r) <=
|
|
1349
|
+
const o = n.position.x - c.position.x, r = n.position.y - c.position.y;
|
|
1350
|
+
if (Math.hypot(o, r) <= c.radius) {
|
|
1341
1351
|
const h = Math.atan2(r, o), u = 1200;
|
|
1342
1352
|
n.isThrown = !0, n.wasManipulated = !0, n.velocity = {
|
|
1343
1353
|
x: Math.cos(h) * u,
|
|
@@ -1351,32 +1361,32 @@ class tt {
|
|
|
1351
1361
|
}
|
|
1352
1362
|
}
|
|
1353
1363
|
}
|
|
1354
|
-
class
|
|
1355
|
-
static update(t, e, i, s, a,
|
|
1364
|
+
class X {
|
|
1365
|
+
static update(t, e, i, s, a, c, n, o, r, l) {
|
|
1356
1366
|
for (const h of e) {
|
|
1357
1367
|
if (!h.active || h.isGrabbed || h.isDying) continue;
|
|
1358
1368
|
const u = t.position.x - h.position.x, p = t.position.y - h.position.y;
|
|
1359
|
-
if (Math.hypot(u, p) <= t.
|
|
1369
|
+
if (Math.hypot(u, p) <= t.getHitboxRadius() + h.radius) {
|
|
1360
1370
|
if (h.active = !1, t.takeDamage()) {
|
|
1361
1371
|
n.emit("onCoreDamaged", { currentIntegrity: t.integrity }), i.push({
|
|
1362
1372
|
id: Math.random().toString(),
|
|
1363
1373
|
position: { ...t.position },
|
|
1364
1374
|
radius: 20,
|
|
1365
|
-
maxRadius: Math.max(r,
|
|
1375
|
+
maxRadius: Math.max(r, l) * 1.3,
|
|
1366
1376
|
color: "#00f0ff",
|
|
1367
1377
|
alpha: 1,
|
|
1368
1378
|
lifetime: 0,
|
|
1369
1379
|
maxLifetime: 0.8
|
|
1370
|
-
}),
|
|
1371
|
-
for (const
|
|
1372
|
-
if (
|
|
1373
|
-
|
|
1374
|
-
for (let
|
|
1375
|
-
const x = Math.random() * Math.PI * 2,
|
|
1380
|
+
}), c.triggerScreenShake({ x: u, y: p }, 25), c.triggerHitstop(0.15), c.triggerFlash(0.6);
|
|
1381
|
+
for (const d of e)
|
|
1382
|
+
if (d.active && !d.isGrabbed) {
|
|
1383
|
+
d.triggerDissolveDeath();
|
|
1384
|
+
for (let m = 0; m < 8; m++) {
|
|
1385
|
+
const x = Math.random() * Math.PI * 2, A = 100 + Math.random() * 200;
|
|
1376
1386
|
s.push({
|
|
1377
1387
|
id: Math.random().toString(),
|
|
1378
|
-
position: { ...
|
|
1379
|
-
velocity: { x: Math.cos(x) *
|
|
1388
|
+
position: { ...d.position },
|
|
1389
|
+
velocity: { x: Math.cos(x) * A, y: Math.sin(x) * A },
|
|
1380
1390
|
color: "#00f0ff",
|
|
1381
1391
|
radius: 3 + Math.random() * 3,
|
|
1382
1392
|
alpha: 1,
|
|
@@ -1402,9 +1412,9 @@ class et {
|
|
|
1402
1412
|
}
|
|
1403
1413
|
}
|
|
1404
1414
|
}
|
|
1405
|
-
class
|
|
1415
|
+
class j {
|
|
1406
1416
|
execute(t) {
|
|
1407
|
-
const { thrownEnemy: e, targetEnemy: i, shockwaves: s, particles: a, floatingTexts:
|
|
1417
|
+
const { thrownEnemy: e, targetEnemy: i, shockwaves: s, particles: a, floatingTexts: c } = t;
|
|
1408
1418
|
i.active = !1, s.push({
|
|
1409
1419
|
id: Math.random().toString(),
|
|
1410
1420
|
position: { ...i.position },
|
|
@@ -1428,7 +1438,7 @@ class it {
|
|
|
1428
1438
|
maxLifetime: 0.5
|
|
1429
1439
|
});
|
|
1430
1440
|
}
|
|
1431
|
-
|
|
1441
|
+
c.push({
|
|
1432
1442
|
id: Math.random().toString(),
|
|
1433
1443
|
text: "PIERCING SLICE",
|
|
1434
1444
|
position: { ...i.position },
|
|
@@ -1441,32 +1451,32 @@ class it {
|
|
|
1441
1451
|
});
|
|
1442
1452
|
}
|
|
1443
1453
|
}
|
|
1444
|
-
class
|
|
1454
|
+
class q {
|
|
1445
1455
|
execute(t) {
|
|
1446
|
-
const { thrownEnemy: e, pools: i, shockwaves: s, particles: a, floatingTexts:
|
|
1456
|
+
const { thrownEnemy: e, pools: i, shockwaves: s, particles: a, floatingTexts: c, eventBus: n } = t, o = e.position, r = E.getInstance().getConfig();
|
|
1447
1457
|
i.push({
|
|
1448
1458
|
id: Math.random().toString(),
|
|
1449
1459
|
position: { ...o },
|
|
1450
|
-
radius:
|
|
1460
|
+
radius: Math.round(r.toxicPool.baseRadius * 2),
|
|
1451
1461
|
duration: 0,
|
|
1452
|
-
maxDuration:
|
|
1453
|
-
damage:
|
|
1462
|
+
maxDuration: r.toxicPool.baseDuration * 1.5,
|
|
1463
|
+
damage: r.toxicPool.damage
|
|
1454
1464
|
}), s.push({
|
|
1455
1465
|
id: Math.random().toString(),
|
|
1456
1466
|
position: { ...o },
|
|
1457
1467
|
radius: 10,
|
|
1458
|
-
maxRadius:
|
|
1468
|
+
maxRadius: Math.round(r.toxicPool.baseRadius * 2.2),
|
|
1459
1469
|
color: "#39ff14",
|
|
1460
1470
|
alpha: 1,
|
|
1461
1471
|
lifetime: 0,
|
|
1462
1472
|
maxLifetime: 0.6
|
|
1463
1473
|
});
|
|
1464
|
-
for (let
|
|
1465
|
-
const
|
|
1474
|
+
for (let l = 0; l < 45; l++) {
|
|
1475
|
+
const h = Math.random() * Math.PI * 2, u = 120 + Math.random() * 260;
|
|
1466
1476
|
a.push({
|
|
1467
1477
|
id: Math.random().toString(),
|
|
1468
1478
|
position: { ...o },
|
|
1469
|
-
velocity: { x: Math.cos(
|
|
1479
|
+
velocity: { x: Math.cos(h) * u, y: Math.sin(h) * u },
|
|
1470
1480
|
color: "#39ff14",
|
|
1471
1481
|
radius: 4 + Math.random() * 5,
|
|
1472
1482
|
alpha: 1,
|
|
@@ -1474,7 +1484,7 @@ class st {
|
|
|
1474
1484
|
maxLifetime: 0.9
|
|
1475
1485
|
});
|
|
1476
1486
|
}
|
|
1477
|
-
|
|
1487
|
+
c.push({
|
|
1478
1488
|
id: Math.random().toString(),
|
|
1479
1489
|
text: "MASSIVE SPORE NEBULA",
|
|
1480
1490
|
position: { ...o },
|
|
@@ -1487,9 +1497,9 @@ class st {
|
|
|
1487
1497
|
}), e.active = !1, n.emit("onPoolCreated", { position: o });
|
|
1488
1498
|
}
|
|
1489
1499
|
}
|
|
1490
|
-
class
|
|
1500
|
+
class Q {
|
|
1491
1501
|
execute(t) {
|
|
1492
|
-
const { thrownEnemy: e, targetEnemy: i, allEnemies: s, shockwaves: a, particles:
|
|
1502
|
+
const { thrownEnemy: e, targetEnemy: i, allEnemies: s, shockwaves: a, particles: c, floatingTexts: n } = t, o = i.position;
|
|
1493
1503
|
e.active = !1, i.active = !1, a.push({
|
|
1494
1504
|
id: Math.random().toString(),
|
|
1495
1505
|
position: { ...o },
|
|
@@ -1500,34 +1510,34 @@ class at {
|
|
|
1500
1510
|
lifetime: 0,
|
|
1501
1511
|
maxLifetime: 0.6
|
|
1502
1512
|
});
|
|
1503
|
-
const r =
|
|
1504
|
-
for (let u = 0; u <
|
|
1505
|
-
const p = u * Math.PI * 2 /
|
|
1513
|
+
const r = E.getInstance().getConfig(), l = r.cluster.fragmentCount, h = r.cluster.hasHoming;
|
|
1514
|
+
for (let u = 0; u < l; u++) {
|
|
1515
|
+
const p = u * Math.PI * 2 / l, _ = 800 + Math.random() * 300, g = {
|
|
1506
1516
|
x: o.x + Math.cos(p) * 45,
|
|
1507
1517
|
y: o.y + Math.sin(p) * 45
|
|
1508
1518
|
};
|
|
1509
|
-
let
|
|
1519
|
+
let d = p;
|
|
1510
1520
|
if (h) {
|
|
1511
|
-
let x = null,
|
|
1512
|
-
for (const
|
|
1513
|
-
if (
|
|
1514
|
-
const I = Math.hypot(
|
|
1515
|
-
I <
|
|
1521
|
+
let x = null, A = 1 / 0;
|
|
1522
|
+
for (const b of s) {
|
|
1523
|
+
if (b === e || b === i || !b.active || b.isGrabbed || b.isDying) continue;
|
|
1524
|
+
const I = Math.hypot(b.position.x - g.x, b.position.y - g.y);
|
|
1525
|
+
I < A && (A = I, x = b);
|
|
1516
1526
|
}
|
|
1517
|
-
x && (
|
|
1527
|
+
x && (d = Math.atan2(x.position.y - g.y, x.position.x - g.x));
|
|
1518
1528
|
}
|
|
1519
|
-
const
|
|
1520
|
-
x:
|
|
1521
|
-
y:
|
|
1529
|
+
const m = M.createEnemy("micro", g, {
|
|
1530
|
+
x: g.x + Math.cos(d) * 500,
|
|
1531
|
+
y: g.y + Math.sin(d) * 500
|
|
1522
1532
|
});
|
|
1523
|
-
|
|
1524
|
-
x: Math.cos(
|
|
1525
|
-
y: Math.sin(
|
|
1526
|
-
}, s.push(
|
|
1533
|
+
m.isThrown = !0, m.wasManipulated = !0, m.velocity = {
|
|
1534
|
+
x: Math.cos(d) * _,
|
|
1535
|
+
y: Math.sin(d) * _
|
|
1536
|
+
}, s.push(m);
|
|
1527
1537
|
}
|
|
1528
1538
|
for (let u = 0; u < 35; u++) {
|
|
1529
1539
|
const p = Math.random() * Math.PI * 2, _ = 200 + Math.random() * 300;
|
|
1530
|
-
|
|
1540
|
+
c.push({
|
|
1531
1541
|
id: Math.random().toString(),
|
|
1532
1542
|
position: { ...o },
|
|
1533
1543
|
velocity: { x: Math.cos(p) * _, y: Math.sin(p) * _ },
|
|
@@ -1551,24 +1561,24 @@ class at {
|
|
|
1551
1561
|
});
|
|
1552
1562
|
}
|
|
1553
1563
|
}
|
|
1554
|
-
class
|
|
1564
|
+
class tt {
|
|
1555
1565
|
execute(t) {
|
|
1556
|
-
const { thrownEnemy: e, targetEnemy: i, vortices: s, shockwaves: a } = t,
|
|
1566
|
+
const { thrownEnemy: e, targetEnemy: i, vortices: s, shockwaves: a } = t, c = E.getInstance().getConfig(), n = {
|
|
1557
1567
|
x: (e.position.x + i.position.x) / 2,
|
|
1558
1568
|
y: (e.position.y + i.position.y) / 2
|
|
1559
1569
|
};
|
|
1560
1570
|
s.push({
|
|
1561
1571
|
id: Math.random().toString(),
|
|
1562
|
-
position:
|
|
1563
|
-
radius:
|
|
1572
|
+
position: n,
|
|
1573
|
+
radius: Math.round(c.gravityVortex.baseRadius * 2.2),
|
|
1564
1574
|
duration: 0,
|
|
1565
|
-
maxDuration:
|
|
1566
|
-
pullForce:
|
|
1575
|
+
maxDuration: c.gravityVortex.baseDuration * 1.5,
|
|
1576
|
+
pullForce: c.gravityVortex.basePullForce * 1.6
|
|
1567
1577
|
}), a.push({
|
|
1568
1578
|
id: Math.random().toString(),
|
|
1569
|
-
position:
|
|
1579
|
+
position: n,
|
|
1570
1580
|
radius: 20,
|
|
1571
|
-
maxRadius:
|
|
1581
|
+
maxRadius: Math.round(c.gravityVortex.baseRadius * 2.2),
|
|
1572
1582
|
color: "#9d4edd",
|
|
1573
1583
|
alpha: 1,
|
|
1574
1584
|
lifetime: 0,
|
|
@@ -1576,20 +1586,23 @@ class ot {
|
|
|
1576
1586
|
}), e.triggerDissolveDeath(), i.triggerDissolveDeath();
|
|
1577
1587
|
}
|
|
1578
1588
|
}
|
|
1579
|
-
class
|
|
1589
|
+
class et {
|
|
1580
1590
|
execute(t) {
|
|
1581
|
-
const { thrownEnemy: e, targetEnemy: i, allEnemies: s, shockwaves: a, particles:
|
|
1582
|
-
if (e.isStationaryShield = !1, e.isThrown = !0, e.rotation =
|
|
1583
|
-
x: Math.cos(
|
|
1584
|
-
y: Math.sin(
|
|
1585
|
-
},
|
|
1586
|
-
const
|
|
1587
|
-
for (const
|
|
1588
|
-
const
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1591
|
+
const { thrownEnemy: e, targetEnemy: i, allEnemies: s, shockwaves: a, particles: c, floatingTexts: n } = t, o = i.position.x - e.position.x, r = i.position.y - e.position.y, l = Math.atan2(r, o), h = E.getInstance().getConfig().shield, u = h.blastSpeed || 1400;
|
|
1592
|
+
if (e.isStationaryShield = !1, e.isThrown = !0, e.wasManipulated = !0, e.rotation = l, e.velocity = {
|
|
1593
|
+
x: Math.cos(l) * u,
|
|
1594
|
+
y: Math.sin(l) * u
|
|
1595
|
+
}, h.isFanBlast) {
|
|
1596
|
+
const p = [-Math.PI / 4, Math.PI / 4];
|
|
1597
|
+
for (const _ of p) {
|
|
1598
|
+
const g = l + _, d = M.createEnemy("heavy", {
|
|
1599
|
+
x: e.position.x + Math.cos(g) * 30,
|
|
1600
|
+
y: e.position.y + Math.sin(g) * 30
|
|
1601
|
+
}, { x: 0, y: 0 });
|
|
1602
|
+
d.isStationaryShield = !1, d.isThrown = !0, d.wasManipulated = !0, d.shieldAngle = g, d.rotation = g, d.velocity = {
|
|
1603
|
+
x: Math.cos(g) * u,
|
|
1604
|
+
y: Math.sin(g) * u
|
|
1605
|
+
}, s.push(d);
|
|
1593
1606
|
}
|
|
1594
1607
|
}
|
|
1595
1608
|
i.active = !1, i.triggerDissolveDeath(), n.push({
|
|
@@ -1603,12 +1616,12 @@ class nt {
|
|
|
1603
1616
|
maxLifetime: 0.9,
|
|
1604
1617
|
size: 24
|
|
1605
1618
|
});
|
|
1606
|
-
for (let
|
|
1607
|
-
const
|
|
1608
|
-
|
|
1619
|
+
for (let p = 0; p < 50; p++) {
|
|
1620
|
+
const _ = (Math.random() - 0.5) * 1.5, g = l + _, d = 300 + Math.random() * 500;
|
|
1621
|
+
c.push({
|
|
1609
1622
|
id: Math.random().toString(),
|
|
1610
1623
|
position: { ...e.position },
|
|
1611
|
-
velocity: { x: Math.cos(
|
|
1624
|
+
velocity: { x: Math.cos(g) * d, y: Math.sin(g) * d },
|
|
1612
1625
|
color: "#00f5ff",
|
|
1613
1626
|
radius: 4 + Math.random() * 6,
|
|
1614
1627
|
alpha: 1,
|
|
@@ -1629,25 +1642,25 @@ class nt {
|
|
|
1629
1642
|
});
|
|
1630
1643
|
}
|
|
1631
1644
|
}
|
|
1632
|
-
class
|
|
1645
|
+
class M {
|
|
1633
1646
|
static createEnemy(t, e, i) {
|
|
1634
|
-
const s = `enemy_${Date.now()}_${Math.random()}`, a = new
|
|
1647
|
+
const s = `enemy_${Date.now()}_${Math.random()}`, a = new w(s);
|
|
1635
1648
|
return this.configureEnemy(a, t, e, i), a;
|
|
1636
1649
|
}
|
|
1637
1650
|
static configureEnemy(t, e, i, s) {
|
|
1638
1651
|
t.type = e, t.position = { ...i }, t.active = !0, t.isGrabbed = !1, t.isThrown = !1;
|
|
1639
|
-
const a = s.x - i.x,
|
|
1640
|
-
let o = 70, r = 100,
|
|
1641
|
-
e === "piercer" ? (o = 95, r = 140,
|
|
1652
|
+
const a = s.x - i.x, c = s.y - i.y, n = Math.atan2(c, a);
|
|
1653
|
+
let o = 70, r = 100, l = 20, h = "#ff2a5f", u = null;
|
|
1654
|
+
e === "piercer" ? (o = 95, r = 140, l = 18, h = "#ff2a5f", u = new j()) : e === "spore" ? (o = 65, r = 90, l = 24, h = "#39ff14", u = new q()) : e === "cluster" ? (o = 50, r = 75, l = 26, h = "#ffd700", u = new Q()) : e === "parasite" ? (o = 80, r = 110, l = 22, h = "#9d4edd", u = new tt()) : e === "heavy" ? (o = 35, r = 50, l = 34, h = "#00f5ff", u = new et(), t.rotation = Math.random() * Math.PI * 2) : e === "micro" && (o = 130, r = 160, l = 12, h = "#ffd700"), t.radius = l, t.color = h, t.strategy = u, t.maxSpeed = r, t.velocity = {
|
|
1642
1655
|
x: Math.cos(n) * o,
|
|
1643
1656
|
y: Math.sin(n) * o
|
|
1644
1657
|
};
|
|
1645
1658
|
}
|
|
1646
1659
|
}
|
|
1647
|
-
class
|
|
1648
|
-
static killEnemy(t, e, i, s, a,
|
|
1660
|
+
class T {
|
|
1661
|
+
static killEnemy(t, e, i, s, a, c) {
|
|
1649
1662
|
if (!t.active || t.isDying) return;
|
|
1650
|
-
const n =
|
|
1663
|
+
const n = E.getInstance().getConfig();
|
|
1651
1664
|
if (a.push({
|
|
1652
1665
|
id: Math.random().toString(),
|
|
1653
1666
|
position: { ...t.position },
|
|
@@ -1669,29 +1682,29 @@ class R {
|
|
|
1669
1682
|
else if (t.type === "cluster") {
|
|
1670
1683
|
t.triggerDissolveDeath();
|
|
1671
1684
|
const o = n.cluster.fragmentCount, r = n.cluster.hasHoming;
|
|
1672
|
-
for (let
|
|
1673
|
-
const h =
|
|
1685
|
+
for (let l = 0; l < o; l++) {
|
|
1686
|
+
const h = l * Math.PI * 2 / o, u = 750 + Math.random() * 250, p = {
|
|
1674
1687
|
x: t.position.x + Math.cos(h) * 40,
|
|
1675
1688
|
y: t.position.y + Math.sin(h) * 40
|
|
1676
1689
|
};
|
|
1677
1690
|
let _ = h;
|
|
1678
1691
|
if (r) {
|
|
1679
|
-
let
|
|
1680
|
-
for (const x of
|
|
1692
|
+
let d = null, m = 1 / 0;
|
|
1693
|
+
for (const x of c) {
|
|
1681
1694
|
if (x === t || !x.active || x.isGrabbed || x.isDying) continue;
|
|
1682
|
-
const
|
|
1683
|
-
|
|
1695
|
+
const A = Math.hypot(x.position.x - p.x, x.position.y - p.y);
|
|
1696
|
+
A < m && (m = A, d = x);
|
|
1684
1697
|
}
|
|
1685
|
-
|
|
1698
|
+
d && (_ = Math.atan2(d.position.y - p.y, d.position.x - p.x));
|
|
1686
1699
|
}
|
|
1687
|
-
const
|
|
1700
|
+
const g = M.createEnemy("micro", p, {
|
|
1688
1701
|
x: p.x + Math.cos(_) * 500,
|
|
1689
1702
|
y: p.y + Math.sin(_) * 500
|
|
1690
1703
|
});
|
|
1691
|
-
|
|
1704
|
+
g.isThrown = !0, g.wasManipulated = !0, g.velocity = {
|
|
1692
1705
|
x: Math.cos(_) * u,
|
|
1693
1706
|
y: Math.sin(_) * u
|
|
1694
|
-
},
|
|
1707
|
+
}, c.push(g);
|
|
1695
1708
|
}
|
|
1696
1709
|
} else t.type === "parasite" ? (t.triggerDissolveDeath(), s.push({
|
|
1697
1710
|
id: Math.random().toString(),
|
|
@@ -1703,16 +1716,16 @@ class R {
|
|
|
1703
1716
|
})) : t.type === "piercer" ? t.triggerSliceDeath(e) : t.triggerDissolveDeath();
|
|
1704
1717
|
}
|
|
1705
1718
|
}
|
|
1706
|
-
class
|
|
1707
|
-
static update(t, e, i, s, a,
|
|
1719
|
+
class it {
|
|
1720
|
+
static update(t, e, i, s, a, c, n, o, r, l, h, u, p) {
|
|
1708
1721
|
let _ = !1;
|
|
1709
|
-
for (const
|
|
1710
|
-
if (!(!
|
|
1711
|
-
if (_ = !0,
|
|
1712
|
-
if (
|
|
1722
|
+
for (const g of t)
|
|
1723
|
+
if (!(!g.active || !g.isThrown || g.isDying)) {
|
|
1724
|
+
if (_ = !0, g.position.x < -120 || g.position.x > l + 120 || g.position.y < -120 || g.position.y > h + 120) {
|
|
1725
|
+
if (g.type === "heavy") {
|
|
1713
1726
|
s.push({
|
|
1714
1727
|
id: Math.random().toString(),
|
|
1715
|
-
position: { ...
|
|
1728
|
+
position: { ...g.position },
|
|
1716
1729
|
radius: 20,
|
|
1717
1730
|
maxRadius: 350,
|
|
1718
1731
|
color: "#00f5ff",
|
|
@@ -1720,12 +1733,12 @@ class rt {
|
|
|
1720
1733
|
lifetime: 0,
|
|
1721
1734
|
maxLifetime: 0.6
|
|
1722
1735
|
});
|
|
1723
|
-
for (let
|
|
1724
|
-
const
|
|
1736
|
+
for (let d = 0; d < 40; d++) {
|
|
1737
|
+
const m = Math.random() * Math.PI * 2, x = 250 + Math.random() * 450;
|
|
1725
1738
|
a.push({
|
|
1726
1739
|
id: Math.random().toString(),
|
|
1727
|
-
position: { ...
|
|
1728
|
-
velocity: { x: Math.cos(
|
|
1740
|
+
position: { ...g.position },
|
|
1741
|
+
velocity: { x: Math.cos(m) * x, y: Math.sin(m) * x },
|
|
1729
1742
|
color: "#00f5ff",
|
|
1730
1743
|
radius: 4 + Math.random() * 5,
|
|
1731
1744
|
alpha: 1,
|
|
@@ -1733,15 +1746,15 @@ class rt {
|
|
|
1733
1746
|
maxLifetime: 0.6
|
|
1734
1747
|
});
|
|
1735
1748
|
}
|
|
1736
|
-
} else if (
|
|
1737
|
-
const
|
|
1738
|
-
if (
|
|
1739
|
-
const
|
|
1749
|
+
} else if (g.type === "piercer") {
|
|
1750
|
+
const d = E.getInstance().getConfig().piercer;
|
|
1751
|
+
if (d.terminalAoERadius > 0) {
|
|
1752
|
+
const m = d.terminalAoERadius;
|
|
1740
1753
|
s.push({
|
|
1741
1754
|
id: Math.random().toString(),
|
|
1742
|
-
position: { ...
|
|
1755
|
+
position: { ...g.position },
|
|
1743
1756
|
radius: 20,
|
|
1744
|
-
maxRadius:
|
|
1757
|
+
maxRadius: m,
|
|
1745
1758
|
color: "#ff2a5f",
|
|
1746
1759
|
alpha: 1,
|
|
1747
1760
|
lifetime: 0,
|
|
@@ -1749,28 +1762,28 @@ class rt {
|
|
|
1749
1762
|
});
|
|
1750
1763
|
for (const x of t) {
|
|
1751
1764
|
if (!x.active || x.isGrabbed || x.isDying) continue;
|
|
1752
|
-
const
|
|
1753
|
-
Math.hypot(
|
|
1765
|
+
const A = x.position.x - g.position.x, b = x.position.y - g.position.y;
|
|
1766
|
+
Math.hypot(A, b) <= m && T.killEnemy(x, Math.atan2(b, A), e, i, s, t);
|
|
1754
1767
|
}
|
|
1755
1768
|
}
|
|
1756
1769
|
}
|
|
1757
|
-
|
|
1770
|
+
g.active = !1, g.isThrown = !1;
|
|
1758
1771
|
continue;
|
|
1759
1772
|
}
|
|
1760
|
-
for (const
|
|
1761
|
-
if (
|
|
1762
|
-
const
|
|
1763
|
-
if (Math.hypot(
|
|
1764
|
-
u.pos = { x:
|
|
1765
|
-
const
|
|
1766
|
-
if (
|
|
1767
|
-
u.kills++,
|
|
1773
|
+
for (const d of t) {
|
|
1774
|
+
if (d === g || !d.active || d.isGrabbed || d.isDying) continue;
|
|
1775
|
+
const m = d.position.x - g.position.x, x = d.position.y - g.position.y;
|
|
1776
|
+
if (Math.hypot(m, x) <= g.getHitRadius() + d.getHitRadius()) {
|
|
1777
|
+
u.pos = { x: g.position.x, y: g.position.y };
|
|
1778
|
+
const b = Math.atan2(g.velocity.y, g.velocity.x);
|
|
1779
|
+
if (g.type === "heavy") {
|
|
1780
|
+
u.kills++, T.killEnemy(d, g.rotation, e, i, s, t), n.triggerHitstop(0.04), n.triggerScreenShake({ x: m, y: x }, 8);
|
|
1768
1781
|
for (let I = 0; I < 8; I++) {
|
|
1769
|
-
const S =
|
|
1782
|
+
const S = g.rotation + (Math.random() - 0.5), f = 200 + Math.random() * 350;
|
|
1770
1783
|
a.push({
|
|
1771
1784
|
id: Math.random().toString(),
|
|
1772
|
-
position: { ...
|
|
1773
|
-
velocity: { x: Math.cos(S) *
|
|
1785
|
+
position: { ...d.position },
|
|
1786
|
+
velocity: { x: Math.cos(S) * f, y: Math.sin(S) * f },
|
|
1774
1787
|
color: "#00f5ff",
|
|
1775
1788
|
radius: 3 + Math.random() * 4,
|
|
1776
1789
|
alpha: 1,
|
|
@@ -1779,10 +1792,10 @@ class rt {
|
|
|
1779
1792
|
});
|
|
1780
1793
|
}
|
|
1781
1794
|
p && p();
|
|
1782
|
-
} else if (
|
|
1783
|
-
u.kills++,
|
|
1795
|
+
} else if (g.type === "piercer") {
|
|
1796
|
+
u.kills++, T.killEnemy(d, b, e, i, s, t), n.triggerHitstop(0.05), n.triggerScreenShake({ x: m, y: x }, 7), s.push({
|
|
1784
1797
|
id: Math.random().toString(),
|
|
1785
|
-
position: { ...
|
|
1798
|
+
position: { ...d.position },
|
|
1786
1799
|
radius: 10,
|
|
1787
1800
|
maxRadius: 180,
|
|
1788
1801
|
color: "#ff2a5f",
|
|
@@ -1791,11 +1804,11 @@ class rt {
|
|
|
1791
1804
|
maxLifetime: 0.45
|
|
1792
1805
|
});
|
|
1793
1806
|
for (let I = 0; I < 16; I++) {
|
|
1794
|
-
const S = Math.random() * Math.PI * 2,
|
|
1807
|
+
const S = Math.random() * Math.PI * 2, f = 150 + Math.random() * 300;
|
|
1795
1808
|
a.push({
|
|
1796
1809
|
id: Math.random().toString(),
|
|
1797
|
-
position: { ...
|
|
1798
|
-
velocity: { x: Math.cos(S) *
|
|
1810
|
+
position: { ...d.position },
|
|
1811
|
+
velocity: { x: Math.cos(S) * f, y: Math.sin(S) * f },
|
|
1799
1812
|
color: "#ff2a5f",
|
|
1800
1813
|
radius: 3 + Math.random() * 3,
|
|
1801
1814
|
alpha: 1,
|
|
@@ -1803,97 +1816,98 @@ class rt {
|
|
|
1803
1816
|
maxLifetime: 0.4
|
|
1804
1817
|
});
|
|
1805
1818
|
}
|
|
1806
|
-
if (
|
|
1807
|
-
|
|
1819
|
+
if (g.remainingHomingKills > 0) {
|
|
1820
|
+
g.remainingHomingKills--;
|
|
1808
1821
|
let I = null, S = 1 / 0;
|
|
1809
|
-
for (const
|
|
1810
|
-
if (
|
|
1811
|
-
const
|
|
1812
|
-
|
|
1822
|
+
for (const f of t) {
|
|
1823
|
+
if (f === g || f === d || !f.active || f.isGrabbed || f.isDying) continue;
|
|
1824
|
+
const v = f.position.x - g.position.x, L = f.position.y - g.position.y, D = Math.hypot(v, L);
|
|
1825
|
+
D < S && (S = D, I = f);
|
|
1813
1826
|
}
|
|
1814
1827
|
if (I) {
|
|
1815
|
-
const
|
|
1816
|
-
|
|
1817
|
-
x: Math.cos(
|
|
1818
|
-
y: Math.sin(
|
|
1828
|
+
const f = Math.atan2(I.position.y - g.position.y, I.position.x - g.position.x), v = Math.hypot(g.velocity.x, g.velocity.y) || 1200;
|
|
1829
|
+
g.rotation = f, g.velocity = {
|
|
1830
|
+
x: Math.cos(f) * v,
|
|
1831
|
+
y: Math.sin(f) * v
|
|
1819
1832
|
};
|
|
1820
1833
|
}
|
|
1821
1834
|
}
|
|
1822
1835
|
p && p();
|
|
1823
1836
|
} else {
|
|
1824
|
-
const I =
|
|
1837
|
+
const I = g.type === d.type, S = I ? 360 : 250;
|
|
1825
1838
|
s.push({
|
|
1826
1839
|
id: Math.random().toString(),
|
|
1827
1840
|
position: { ...u.pos },
|
|
1828
1841
|
radius: 15,
|
|
1829
1842
|
maxRadius: S,
|
|
1830
|
-
color:
|
|
1843
|
+
color: g.color,
|
|
1831
1844
|
alpha: 1,
|
|
1832
1845
|
lifetime: 0,
|
|
1833
1846
|
maxLifetime: 0.55
|
|
1834
1847
|
});
|
|
1835
|
-
for (let
|
|
1836
|
-
const
|
|
1848
|
+
for (let f = 0; f < 45; f++) {
|
|
1849
|
+
const v = Math.random() * Math.PI * 2, L = 200 + Math.random() * 450;
|
|
1837
1850
|
a.push({
|
|
1838
1851
|
id: Math.random().toString(),
|
|
1839
1852
|
position: { ...u.pos },
|
|
1840
|
-
velocity: { x: Math.cos(
|
|
1841
|
-
color:
|
|
1853
|
+
velocity: { x: Math.cos(v) * L, y: Math.sin(v) * L },
|
|
1854
|
+
color: g.color,
|
|
1842
1855
|
radius: 4 + Math.random() * 6,
|
|
1843
1856
|
alpha: 1,
|
|
1844
1857
|
lifetime: 0,
|
|
1845
1858
|
maxLifetime: 0.7
|
|
1846
1859
|
});
|
|
1847
1860
|
}
|
|
1861
|
+
if (g.strategy) {
|
|
1862
|
+
g.strategy.execute({
|
|
1863
|
+
thrownEnemy: g,
|
|
1864
|
+
targetEnemy: d,
|
|
1865
|
+
allEnemies: t,
|
|
1866
|
+
pools: e,
|
|
1867
|
+
vortices: i,
|
|
1868
|
+
shockwaves: s,
|
|
1869
|
+
particles: a,
|
|
1870
|
+
floatingTexts: c,
|
|
1871
|
+
eventBus: o,
|
|
1872
|
+
width: l,
|
|
1873
|
+
height: h
|
|
1874
|
+
}), u.kills += 2, p && p();
|
|
1875
|
+
break;
|
|
1876
|
+
}
|
|
1848
1877
|
if (I) {
|
|
1849
|
-
u.kills += 2, n.triggerHitstop(0.14), n.triggerFlash(0.5), n.triggerScreenShake({ x:
|
|
1878
|
+
u.kills += 2, n.triggerHitstop(0.14), n.triggerFlash(0.5), n.triggerScreenShake({ x: m, y: x }, 16), c.push({
|
|
1850
1879
|
id: Math.random().toString(),
|
|
1851
1880
|
text: "COLOR SYNERGY!",
|
|
1852
1881
|
position: { ...u.pos },
|
|
1853
1882
|
velocity: { x: 0, y: -80 },
|
|
1854
|
-
color:
|
|
1883
|
+
color: g.color,
|
|
1855
1884
|
alpha: 1,
|
|
1856
1885
|
lifetime: 0,
|
|
1857
1886
|
maxLifetime: 1.2,
|
|
1858
1887
|
size: 26
|
|
1859
1888
|
});
|
|
1860
|
-
const
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
maxDuration: m.gravityVortex.synergyDuration,
|
|
1877
|
-
pullForce: m.gravityVortex.synergyPullForce
|
|
1878
|
-
});
|
|
1879
|
-
else if (d.type === "cluster")
|
|
1880
|
-
for (let y = 0; y < 8; y++) {
|
|
1881
|
-
const M = y * Math.PI * 2 / 8, L = {
|
|
1882
|
-
x: u.pos.x + Math.cos(M) * 15,
|
|
1883
|
-
y: u.pos.y + Math.sin(M) * 15
|
|
1884
|
-
}, C = T.createEnemy("micro", L, {
|
|
1885
|
-
x: L.x + Math.cos(M) * 220,
|
|
1886
|
-
y: L.y + Math.sin(M) * 220
|
|
1887
|
-
});
|
|
1888
|
-
C.isThrown = !0, t.push(C);
|
|
1889
|
-
}
|
|
1890
|
-
R.killEnemy(d, v, e, i, s, t), R.killEnemy(g, v, e, i, s, t);
|
|
1889
|
+
const f = E.getInstance().getConfig();
|
|
1890
|
+
g.type === "spore" ? e.push({
|
|
1891
|
+
id: Math.random().toString(),
|
|
1892
|
+
position: { ...u.pos },
|
|
1893
|
+
radius: Math.round(f.toxicPool.baseRadius * 2),
|
|
1894
|
+
duration: 0,
|
|
1895
|
+
maxDuration: f.toxicPool.synergyDuration,
|
|
1896
|
+
damage: f.toxicPool.damage * 2
|
|
1897
|
+
}) : g.type === "parasite" && i.push({
|
|
1898
|
+
id: Math.random().toString(),
|
|
1899
|
+
position: { ...u.pos },
|
|
1900
|
+
radius: Math.round(f.gravityVortex.baseRadius * 1.8),
|
|
1901
|
+
duration: 0,
|
|
1902
|
+
maxDuration: f.gravityVortex.synergyDuration,
|
|
1903
|
+
pullForce: f.gravityVortex.synergyPullForce
|
|
1904
|
+
}), T.killEnemy(g, b, e, i, s, t), T.killEnemy(d, b, e, i, s, t);
|
|
1891
1905
|
} else
|
|
1892
|
-
u.kills += 2, n.triggerHitstop(0.08), n.triggerFlash(0.35), n.triggerScreenShake({ x:
|
|
1893
|
-
for (const
|
|
1894
|
-
if (
|
|
1895
|
-
const
|
|
1896
|
-
Math.hypot(
|
|
1906
|
+
u.kills += 2, n.triggerHitstop(0.08), n.triggerFlash(0.35), n.triggerScreenShake({ x: m, y: x }, 10), T.killEnemy(g, b, e, i, s, t), T.killEnemy(d, b, e, i, s, t);
|
|
1907
|
+
for (const f of t) {
|
|
1908
|
+
if (f === g || f === d || !f.active || f.isGrabbed || f.isDying) continue;
|
|
1909
|
+
const v = f.position.x - u.pos.x, L = f.position.y - u.pos.y;
|
|
1910
|
+
Math.hypot(v, L) <= S && f.type !== "micro" && (T.killEnemy(f, b, e, i, s, t), u.kills++);
|
|
1897
1911
|
}
|
|
1898
1912
|
p && p();
|
|
1899
1913
|
break;
|
|
@@ -1901,7 +1915,7 @@ class rt {
|
|
|
1901
1915
|
}
|
|
1902
1916
|
}
|
|
1903
1917
|
}
|
|
1904
|
-
r.value = u.kills, !_ && u.kills > 0 && (u.kills >= 2 && u.pos &&
|
|
1918
|
+
r.value = u.kills, !_ && u.kills > 0 && (u.kills >= 2 && u.pos && c.push({
|
|
1905
1919
|
id: Math.random().toString(),
|
|
1906
1920
|
text: `MULTIKILL x${u.kills}!`,
|
|
1907
1921
|
position: { ...u.pos },
|
|
@@ -1914,30 +1928,30 @@ class rt {
|
|
|
1914
1928
|
}), o.emit("onComboUpdated", { combo: r.value }), u.kills = 0, u.pos = null);
|
|
1915
1929
|
}
|
|
1916
1930
|
}
|
|
1917
|
-
class
|
|
1918
|
-
static update(t, e, i, s, a,
|
|
1931
|
+
class st {
|
|
1932
|
+
static update(t, e, i, s, a, c, n, o) {
|
|
1919
1933
|
for (let r = t.length - 1; r >= 0; r--) {
|
|
1920
|
-
const
|
|
1921
|
-
if (
|
|
1922
|
-
|
|
1934
|
+
const l = t[r];
|
|
1935
|
+
if (l) {
|
|
1936
|
+
l.duration += c;
|
|
1923
1937
|
for (const h of e) {
|
|
1924
1938
|
if (!h.active || h.isGrabbed || h.isDying || h.isThrown && h.type === "piercer") continue;
|
|
1925
|
-
const u = h.position.x -
|
|
1926
|
-
Math.hypot(u, p) <=
|
|
1939
|
+
const u = h.position.x - l.position.x, p = h.position.y - l.position.y;
|
|
1940
|
+
Math.hypot(u, p) <= l.radius && (T.killEnemy(h, 0, t, i, s, e), n.kills++, o && o());
|
|
1927
1941
|
}
|
|
1928
|
-
|
|
1942
|
+
l.duration >= l.maxDuration && t.splice(r, 1);
|
|
1929
1943
|
}
|
|
1930
1944
|
}
|
|
1931
1945
|
}
|
|
1932
1946
|
}
|
|
1933
|
-
class
|
|
1934
|
-
static update(t, e, i, s, a,
|
|
1947
|
+
class at {
|
|
1948
|
+
static update(t, e, i, s, a, c, n, o, r, l, h, u) {
|
|
1935
1949
|
for (const p of t)
|
|
1936
1950
|
if (!(!p.active || !p.isStationaryShield || p.isDying))
|
|
1937
1951
|
for (const _ of t) {
|
|
1938
1952
|
if (_ === p || !_.active || _.isGrabbed || _.isDying) continue;
|
|
1939
|
-
const
|
|
1940
|
-
if (Math.hypot(
|
|
1953
|
+
const g = _.position.x - p.position.x, d = _.position.y - p.position.y;
|
|
1954
|
+
if (Math.hypot(g, d) <= p.getHitRadius() + _.getHitRadius()) {
|
|
1941
1955
|
p.isStationaryShield = !1, p.strategy && p.strategy.execute({
|
|
1942
1956
|
thrownEnemy: p,
|
|
1943
1957
|
targetEnemy: _,
|
|
@@ -1946,61 +1960,76 @@ class ct {
|
|
|
1946
1960
|
vortices: i,
|
|
1947
1961
|
shockwaves: s,
|
|
1948
1962
|
particles: a,
|
|
1949
|
-
floatingTexts:
|
|
1963
|
+
floatingTexts: c,
|
|
1950
1964
|
eventBus: o,
|
|
1951
|
-
width:
|
|
1965
|
+
width: l,
|
|
1952
1966
|
height: h
|
|
1953
|
-
}), r.kills += 2, n.triggerHitstop(0.12), n.triggerScreenShake({ x:
|
|
1967
|
+
}), r.kills += 2, n.triggerHitstop(0.12), n.triggerScreenShake({ x: g, y: d }, 18), u && u();
|
|
1954
1968
|
break;
|
|
1955
1969
|
}
|
|
1956
1970
|
}
|
|
1957
1971
|
}
|
|
1958
1972
|
}
|
|
1959
|
-
class
|
|
1973
|
+
class ot {
|
|
1960
1974
|
spatialHash;
|
|
1961
1975
|
eventBus;
|
|
1962
1976
|
i18n;
|
|
1963
1977
|
throwState = { kills: 0, pos: null };
|
|
1964
1978
|
constructor(t, e) {
|
|
1965
|
-
this.spatialHash = new
|
|
1979
|
+
this.spatialHash = new Z(100), this.eventBus = t, this.i18n = e;
|
|
1966
1980
|
}
|
|
1967
|
-
update(t, e, i, s, a,
|
|
1981
|
+
update(t, e, i, s, a, c, n, o, r, l, h, u, p, _) {
|
|
1968
1982
|
this.spatialHash.clear();
|
|
1969
|
-
const
|
|
1970
|
-
for (const
|
|
1971
|
-
if (
|
|
1972
|
-
if (
|
|
1973
|
-
let
|
|
1974
|
-
for (const
|
|
1975
|
-
if (
|
|
1976
|
-
const
|
|
1977
|
-
S < x && (x = S,
|
|
1983
|
+
const g = E.getInstance().getConfig().piercer;
|
|
1984
|
+
for (const d of i)
|
|
1985
|
+
if (d.active && !d.isDying) {
|
|
1986
|
+
if (d.isThrown && d.type === "piercer" && g.hasHoming && d.remainingHomingKills > 0) {
|
|
1987
|
+
let m = null, x = 1 / 0;
|
|
1988
|
+
for (const A of i) {
|
|
1989
|
+
if (A === d || !A.active || A.isGrabbed || A.isDying) continue;
|
|
1990
|
+
const b = A.position.x - d.position.x, I = A.position.y - d.position.y, S = Math.hypot(b, I);
|
|
1991
|
+
S < x && (x = S, m = A);
|
|
1978
1992
|
}
|
|
1979
|
-
if (
|
|
1980
|
-
const
|
|
1981
|
-
let
|
|
1982
|
-
for (;
|
|
1983
|
-
for (;
|
|
1984
|
-
const
|
|
1985
|
-
|
|
1986
|
-
x: Math.cos(
|
|
1987
|
-
y: Math.sin(
|
|
1993
|
+
if (m) {
|
|
1994
|
+
const A = Math.atan2(m.position.y - d.position.y, m.position.x - d.position.x), b = Math.max(Math.hypot(d.velocity.x, d.velocity.y), 1e3), I = 25 * t, S = Math.atan2(d.velocity.y, d.velocity.x);
|
|
1995
|
+
let f = A - S;
|
|
1996
|
+
for (; f < -Math.PI; ) f += Math.PI * 2;
|
|
1997
|
+
for (; f > Math.PI; ) f -= Math.PI * 2;
|
|
1998
|
+
const v = S + Math.sign(f) * Math.min(Math.abs(f), I);
|
|
1999
|
+
d.rotation = v, d.velocity = {
|
|
2000
|
+
x: Math.cos(v) * b,
|
|
2001
|
+
y: Math.sin(v) * b
|
|
1988
2002
|
};
|
|
1989
2003
|
}
|
|
1990
2004
|
}
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2005
|
+
if (d.isStationaryShield) {
|
|
2006
|
+
let m = null, x = 1 / 0;
|
|
2007
|
+
for (const A of i) {
|
|
2008
|
+
if (A === d || !A.active || A.isGrabbed || A.isDying || A.isStationaryShield) continue;
|
|
2009
|
+
const b = A.position.x - d.position.x, I = A.position.y - d.position.y, S = Math.hypot(b, I);
|
|
2010
|
+
S < x && (x = S, m = A);
|
|
2011
|
+
}
|
|
2012
|
+
if (m) {
|
|
2013
|
+
let b = Math.atan2(m.position.y - d.position.y, m.position.x - d.position.x) - d.rotation;
|
|
2014
|
+
for (; b < -Math.PI; ) b += Math.PI * 2;
|
|
2015
|
+
for (; b > Math.PI; ) b -= Math.PI * 2;
|
|
2016
|
+
const I = 5 * t;
|
|
2017
|
+
d.rotation += Math.sign(b) * Math.min(Math.abs(b), I);
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2020
|
+
d.update(t), this.spatialHash.insert(d);
|
|
2021
|
+
} else d.active && d.isDying && d.update(t);
|
|
2022
|
+
for (let d = c.length - 1; d >= 0; d--) {
|
|
2023
|
+
const m = c[d];
|
|
2024
|
+
if (!m) continue;
|
|
2025
|
+
m.lifetime += t;
|
|
2026
|
+
const x = m.lifetime / m.maxLifetime;
|
|
2027
|
+
m.radius = m.maxRadius * x, m.alpha = Math.max(0, 1 - x), m.lifetime >= m.maxLifetime && c.splice(d, 1);
|
|
2028
|
+
}
|
|
2029
|
+
$.update(a, i, t), X.update(
|
|
2001
2030
|
e,
|
|
2002
2031
|
i,
|
|
2003
|
-
|
|
2032
|
+
c,
|
|
2004
2033
|
n,
|
|
2005
2034
|
o,
|
|
2006
2035
|
r,
|
|
@@ -2008,34 +2037,34 @@ class ht {
|
|
|
2008
2037
|
h,
|
|
2009
2038
|
u,
|
|
2010
2039
|
p
|
|
2011
|
-
),
|
|
2040
|
+
), it.update(
|
|
2012
2041
|
i,
|
|
2013
2042
|
s,
|
|
2014
2043
|
a,
|
|
2015
|
-
|
|
2044
|
+
c,
|
|
2016
2045
|
n,
|
|
2017
2046
|
o,
|
|
2018
2047
|
r,
|
|
2019
2048
|
this.eventBus,
|
|
2020
|
-
|
|
2049
|
+
l,
|
|
2021
2050
|
u,
|
|
2022
2051
|
p,
|
|
2023
2052
|
this.throwState,
|
|
2024
2053
|
_
|
|
2025
|
-
),
|
|
2054
|
+
), st.update(
|
|
2026
2055
|
s,
|
|
2027
2056
|
i,
|
|
2028
2057
|
a,
|
|
2029
|
-
|
|
2058
|
+
c,
|
|
2030
2059
|
n,
|
|
2031
2060
|
t,
|
|
2032
2061
|
this.throwState,
|
|
2033
2062
|
_
|
|
2034
|
-
),
|
|
2063
|
+
), at.update(
|
|
2035
2064
|
i,
|
|
2036
2065
|
s,
|
|
2037
2066
|
a,
|
|
2038
|
-
|
|
2067
|
+
c,
|
|
2039
2068
|
n,
|
|
2040
2069
|
o,
|
|
2041
2070
|
r,
|
|
@@ -2047,11 +2076,11 @@ class ht {
|
|
|
2047
2076
|
);
|
|
2048
2077
|
}
|
|
2049
2078
|
}
|
|
2050
|
-
class
|
|
2079
|
+
class nt {
|
|
2051
2080
|
pool = [];
|
|
2052
2081
|
constructor(t = 500) {
|
|
2053
2082
|
for (let e = 0; e < t; e++) {
|
|
2054
|
-
const i = new
|
|
2083
|
+
const i = new w(`pool_enemy_${e}`);
|
|
2055
2084
|
this.pool.push(i);
|
|
2056
2085
|
}
|
|
2057
2086
|
}
|
|
@@ -2059,7 +2088,7 @@ class ut {
|
|
|
2059
2088
|
for (const e of this.pool)
|
|
2060
2089
|
if (!e.active)
|
|
2061
2090
|
return e.reset(), e;
|
|
2062
|
-
const t = new
|
|
2091
|
+
const t = new w(`fallback_enemy_${Date.now()}_${Math.random()}`);
|
|
2063
2092
|
return this.pool.push(t), t;
|
|
2064
2093
|
}
|
|
2065
2094
|
resetAll() {
|
|
@@ -2067,7 +2096,7 @@ class ut {
|
|
|
2067
2096
|
t.reset();
|
|
2068
2097
|
}
|
|
2069
2098
|
}
|
|
2070
|
-
class
|
|
2099
|
+
class R {
|
|
2071
2100
|
static getOffscreenPosition(t, e) {
|
|
2072
2101
|
const i = Math.floor(Math.random() * 4), s = 70;
|
|
2073
2102
|
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 };
|
|
@@ -2075,11 +2104,11 @@ class O {
|
|
|
2075
2104
|
static spawnCircleOfDeath(t, e, i, s) {
|
|
2076
2105
|
const a = [], n = Math.max(i, s) * 0.55 + 80;
|
|
2077
2106
|
for (let o = 0; o < 18; o++) {
|
|
2078
|
-
const r = o * Math.PI * 2 / 18,
|
|
2107
|
+
const r = o * Math.PI * 2 / 18, l = {
|
|
2079
2108
|
x: e.x + Math.cos(r) * n,
|
|
2080
2109
|
y: e.y + Math.sin(r) * n
|
|
2081
2110
|
}, h = t.get(), u = ["piercer", "spore", "cluster", "parasite"], p = u[o % u.length];
|
|
2082
|
-
|
|
2111
|
+
M.configureEnemy(h, p, l, e), h.velocity = {
|
|
2083
2112
|
x: Math.cos(r + Math.PI) * 55,
|
|
2084
2113
|
y: Math.sin(r + Math.PI) * 55
|
|
2085
2114
|
}, a.push(h);
|
|
@@ -2091,15 +2120,15 @@ class O {
|
|
|
2091
2120
|
let o = { x: -60, y: -60 };
|
|
2092
2121
|
n === 0 ? o = { x: Math.random() * e, y: -80 } : n === 1 ? o = { x: e + 80, y: Math.random() * i } : n === 2 ? o = { x: Math.random() * e, y: i + 80 } : o = { x: -80, y: Math.random() * i };
|
|
2093
2122
|
for (let r = 0; r < 14; r++) {
|
|
2094
|
-
const
|
|
2123
|
+
const l = {
|
|
2095
2124
|
x: (Math.random() - 0.5) * 60,
|
|
2096
2125
|
y: (Math.random() - 0.5) * 60
|
|
2097
|
-
}, h = { x: o.x +
|
|
2098
|
-
|
|
2099
|
-
const p = s.x - h.x, _ = s.y - h.y,
|
|
2126
|
+
}, h = { x: o.x + l.x, y: o.y + l.y }, u = t.get();
|
|
2127
|
+
M.configureEnemy(u, "spore", h, s);
|
|
2128
|
+
const p = s.x - h.x, _ = s.y - h.y, g = Math.atan2(_, p);
|
|
2100
2129
|
u.velocity = {
|
|
2101
|
-
x: Math.cos(
|
|
2102
|
-
y: Math.sin(
|
|
2130
|
+
x: Math.cos(g) * (50 + Math.random() * 20),
|
|
2131
|
+
y: Math.sin(g) * (50 + Math.random() * 20)
|
|
2103
2132
|
}, a.push(u);
|
|
2104
2133
|
}
|
|
2105
2134
|
return a;
|
|
@@ -2110,30 +2139,30 @@ class O {
|
|
|
2110
2139
|
const r = {
|
|
2111
2140
|
x: -60 - o * 40,
|
|
2112
2141
|
y: n + Math.sin(o * 0.45) * 70
|
|
2113
|
-
},
|
|
2114
|
-
|
|
2142
|
+
}, l = t.get();
|
|
2143
|
+
M.configureEnemy(l, "cluster", r, s), l.velocity = { x: 75, y: Math.cos(o * 0.45) * 30 }, a.push(l);
|
|
2115
2144
|
}
|
|
2116
2145
|
return a;
|
|
2117
2146
|
}
|
|
2118
2147
|
static spawnDoubleSpiral(t, e, i, s) {
|
|
2119
2148
|
const a = [];
|
|
2120
2149
|
for (let n = 0; n < 14; n++) {
|
|
2121
|
-
const o = n / 14, r = o * Math.PI * 4,
|
|
2122
|
-
x: e + Math.cos(r) *
|
|
2123
|
-
y: -60 + Math.sin(r) *
|
|
2150
|
+
const o = n / 14, r = o * Math.PI * 4, l = 120 + o * 450, h = {
|
|
2151
|
+
x: e + Math.cos(r) * l,
|
|
2152
|
+
y: -60 + Math.sin(r) * l
|
|
2124
2153
|
}, u = t.get();
|
|
2125
|
-
|
|
2154
|
+
M.configureEnemy(u, "parasite", h, s), a.push(u);
|
|
2126
2155
|
}
|
|
2127
2156
|
return a;
|
|
2128
2157
|
}
|
|
2129
2158
|
static spawnMarchingWall(t, e, i, s) {
|
|
2130
2159
|
const a = [], n = Math.random() > 0.5;
|
|
2131
2160
|
for (let o = 0; o < 12; o++) {
|
|
2132
|
-
const r = o / 11 * i,
|
|
2161
|
+
const r = o / 11 * i, l = {
|
|
2133
2162
|
x: n ? -60 : e + 60,
|
|
2134
2163
|
y: r
|
|
2135
2164
|
}, h = t.get();
|
|
2136
|
-
|
|
2165
|
+
M.configureEnemy(h, "piercer", l, s), h.velocity = {
|
|
2137
2166
|
x: n ? 70 : -70,
|
|
2138
2167
|
y: 0
|
|
2139
2168
|
}, a.push(h);
|
|
@@ -2144,14 +2173,14 @@ class O {
|
|
|
2144
2173
|
const a = [];
|
|
2145
2174
|
for (let n = 0; n < 10; n++) {
|
|
2146
2175
|
const o = { x: -50 - n * 35, y: -50 - n * 35 }, r = t.get();
|
|
2147
|
-
|
|
2148
|
-
const
|
|
2149
|
-
|
|
2176
|
+
M.configureEnemy(r, "spore", o, s), a.push(r);
|
|
2177
|
+
const l = { x: e + 50 + n * 35, y: i + 50 + n * 35 }, h = t.get();
|
|
2178
|
+
M.configureEnemy(h, "cluster", l, s), a.push(h);
|
|
2150
2179
|
}
|
|
2151
2180
|
return a;
|
|
2152
2181
|
}
|
|
2153
2182
|
}
|
|
2154
|
-
class
|
|
2183
|
+
class rt {
|
|
2155
2184
|
wave = 1;
|
|
2156
2185
|
pool;
|
|
2157
2186
|
spawnTimer = 0;
|
|
@@ -2159,63 +2188,63 @@ class pt {
|
|
|
2159
2188
|
patternCooldown = 0;
|
|
2160
2189
|
initialGracePeriod = 6;
|
|
2161
2190
|
constructor() {
|
|
2162
|
-
this.pool = new
|
|
2191
|
+
this.pool = new nt(500);
|
|
2163
2192
|
}
|
|
2164
2193
|
reset() {
|
|
2165
2194
|
this.wave = 1, this.spawnTimer = 0, this.waveTimer = 0, this.patternCooldown = 0;
|
|
2166
2195
|
}
|
|
2167
2196
|
update(t, e, i, s, a) {
|
|
2168
2197
|
this.waveTimer += t, this.spawnTimer += t, this.patternCooldown += t, this.applyFlockingBehaviors(e, t, a);
|
|
2169
|
-
const
|
|
2170
|
-
if (this.waveTimer > this.initialGracePeriod && this.patternCooldown > Math.max(12 - this.wave, 6) &&
|
|
2198
|
+
const c = e.filter((r) => r.active).length, n = Math.max(0.9, 2.2 - (this.wave - 1) * 0.18);
|
|
2199
|
+
if (this.waveTimer > this.initialGracePeriod && this.patternCooldown > Math.max(12 - this.wave, 6) && c < 35) {
|
|
2171
2200
|
this.patternCooldown = 0;
|
|
2172
2201
|
const r = this.spawnPatternFormation(i, s, a);
|
|
2173
|
-
for (const
|
|
2174
|
-
e.push(
|
|
2202
|
+
for (const l of r)
|
|
2203
|
+
e.push(l);
|
|
2175
2204
|
}
|
|
2176
2205
|
const o = Math.min(18 + this.wave * 4, 80);
|
|
2177
|
-
return this.spawnTimer >= n &&
|
|
2206
|
+
return this.spawnTimer >= n && c < o ? (this.spawnTimer = 0, this.spawnSingleEnemy(i, s, a)) : null;
|
|
2178
2207
|
}
|
|
2179
2208
|
spawnSingleEnemy(t, e, i) {
|
|
2180
|
-
const s =
|
|
2181
|
-
let
|
|
2182
|
-
a > 0.75 ?
|
|
2209
|
+
const s = R.getOffscreenPosition(t, e), a = Math.random();
|
|
2210
|
+
let c = "piercer";
|
|
2211
|
+
a > 0.75 ? c = "heavy" : a > 0.55 ? c = "parasite" : a > 0.35 ? c = "cluster" : a > 0.15 && (c = "spore");
|
|
2183
2212
|
const n = this.pool.get();
|
|
2184
|
-
return
|
|
2213
|
+
return M.configureEnemy(n, c, s, i), n;
|
|
2185
2214
|
}
|
|
2186
2215
|
spawnPatternFormation(t, e, i) {
|
|
2187
2216
|
const s = Math.random();
|
|
2188
|
-
return s < 0.25 ?
|
|
2217
|
+
return s < 0.25 ? R.spawnCircleOfDeath(this.pool, i, t, e) : s < 0.5 ? R.spawnDenseCluster(this.pool, t, e, i) : s < 0.75 ? R.spawnSineSnake(this.pool, t, e, i) : R.spawnMarchingWall(this.pool, t, e, i);
|
|
2189
2218
|
}
|
|
2190
2219
|
applyFlockingBehaviors(t, e, i) {
|
|
2191
2220
|
for (let a = 0; a < t.length; a++) {
|
|
2192
|
-
const
|
|
2193
|
-
if (!
|
|
2221
|
+
const c = t[a];
|
|
2222
|
+
if (!c.active || c.isGrabbed || c.isThrown || c.isDying) continue;
|
|
2194
2223
|
let n = 0, o = 0, r = 0;
|
|
2195
2224
|
for (let p = 0; p < t.length; p++) {
|
|
2196
2225
|
if (a === p) continue;
|
|
2197
2226
|
const _ = t[p];
|
|
2198
2227
|
if (!_.active || _.isGrabbed || _.isDying) continue;
|
|
2199
|
-
const
|
|
2200
|
-
|
|
2228
|
+
const g = c.position.x - _.position.x, d = c.position.y - _.position.y, m = Math.hypot(g, d);
|
|
2229
|
+
m > 0 && m < 70 && (n += g / m, o += d / m, r++);
|
|
2201
2230
|
}
|
|
2202
|
-
r > 0 && (n /= r, o /= r,
|
|
2203
|
-
const
|
|
2231
|
+
r > 0 && (n /= r, o /= r, c.velocity.x += n * 60 * e, c.velocity.y += o * 60 * e);
|
|
2232
|
+
const l = i.x - c.position.x, h = i.y - c.position.y, u = Math.hypot(l, h);
|
|
2204
2233
|
if (u > 0) {
|
|
2205
2234
|
const p = 80 + Math.min(this.wave * 4, 40);
|
|
2206
|
-
|
|
2235
|
+
c.velocity.x += l / u * p * e, c.velocity.y += h / u * p * e;
|
|
2207
2236
|
}
|
|
2208
|
-
if (
|
|
2209
|
-
const p = Math.hypot(
|
|
2210
|
-
if (p >
|
|
2211
|
-
const _ =
|
|
2212
|
-
|
|
2237
|
+
if (c.maxSpeed > 0) {
|
|
2238
|
+
const p = Math.hypot(c.velocity.x, c.velocity.y);
|
|
2239
|
+
if (p > c.maxSpeed) {
|
|
2240
|
+
const _ = c.maxSpeed / p;
|
|
2241
|
+
c.velocity.x *= _, c.velocity.y *= _;
|
|
2213
2242
|
}
|
|
2214
2243
|
}
|
|
2215
2244
|
}
|
|
2216
2245
|
}
|
|
2217
2246
|
}
|
|
2218
|
-
const
|
|
2247
|
+
const C = {
|
|
2219
2248
|
bioluminescent: {
|
|
2220
2249
|
bgInner: "#081220",
|
|
2221
2250
|
bgMid: "#050b16",
|
|
@@ -2230,7 +2259,13 @@ const N = {
|
|
|
2230
2259
|
corePrimary: "#00f0ff",
|
|
2231
2260
|
coreGlow: "rgba(0, 240, 255, 0.85)",
|
|
2232
2261
|
tendrilMagenta: "#ff00dd",
|
|
2233
|
-
tendrilCyan: "#00ffff"
|
|
2262
|
+
tendrilCyan: "#00ffff",
|
|
2263
|
+
effectHighlight: "#ffffff",
|
|
2264
|
+
effectInk: "#ffffff",
|
|
2265
|
+
effectShadow: "#000000",
|
|
2266
|
+
effectPanel: "rgba(0, 0, 0, 0.65)",
|
|
2267
|
+
vortexCore: "#000000",
|
|
2268
|
+
vortexMid: "#140028"
|
|
2234
2269
|
},
|
|
2235
2270
|
dark: {
|
|
2236
2271
|
bgInner: "#0d0f17",
|
|
@@ -2246,7 +2281,13 @@ const N = {
|
|
|
2246
2281
|
corePrimary: "#00b4d8",
|
|
2247
2282
|
coreGlow: "rgba(0, 180, 216, 0.85)",
|
|
2248
2283
|
tendrilMagenta: "#d800a6",
|
|
2249
|
-
tendrilCyan: "#00b4d8"
|
|
2284
|
+
tendrilCyan: "#00b4d8",
|
|
2285
|
+
effectHighlight: "#ffffff",
|
|
2286
|
+
effectInk: "#ffffff",
|
|
2287
|
+
effectShadow: "#000000",
|
|
2288
|
+
effectPanel: "rgba(0, 0, 0, 0.65)",
|
|
2289
|
+
vortexCore: "#000000",
|
|
2290
|
+
vortexMid: "#140028"
|
|
2250
2291
|
},
|
|
2251
2292
|
light: {
|
|
2252
2293
|
bgInner: "#f1f5f9",
|
|
@@ -2262,24 +2303,30 @@ const N = {
|
|
|
2262
2303
|
corePrimary: "#0077b6",
|
|
2263
2304
|
coreGlow: "rgba(0, 119, 182, 0.85)",
|
|
2264
2305
|
tendrilMagenta: "#b5008c",
|
|
2265
|
-
tendrilCyan: "#0077b6"
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2306
|
+
tendrilCyan: "#0077b6",
|
|
2307
|
+
effectHighlight: "#fffaf2",
|
|
2308
|
+
effectInk: "#17324d",
|
|
2309
|
+
effectShadow: "#18334c",
|
|
2310
|
+
effectPanel: "rgba(255, 255, 255, 0.82)",
|
|
2311
|
+
vortexCore: "#274760",
|
|
2312
|
+
vortexMid: "#577c9e"
|
|
2313
|
+
}
|
|
2314
|
+
}, N = "axon_surge_theme";
|
|
2315
|
+
class lt {
|
|
2269
2316
|
currentTheme = "dark";
|
|
2270
2317
|
isExplicit = !1;
|
|
2271
2318
|
targetElement;
|
|
2272
2319
|
constructor(t, e) {
|
|
2273
2320
|
e !== void 0 && (this.targetElement = e);
|
|
2274
2321
|
try {
|
|
2275
|
-
const i = localStorage.getItem(
|
|
2276
|
-
if (i &&
|
|
2322
|
+
const i = localStorage.getItem(N);
|
|
2323
|
+
if (i && C[i]) {
|
|
2277
2324
|
this.currentTheme = i, this.isExplicit = !0, this.applyThemeToDOM();
|
|
2278
2325
|
return;
|
|
2279
2326
|
}
|
|
2280
2327
|
} catch {
|
|
2281
2328
|
}
|
|
2282
|
-
if (t &&
|
|
2329
|
+
if (t && C[t]) {
|
|
2283
2330
|
this.currentTheme = t, this.isExplicit = !0, this.applyThemeToDOM();
|
|
2284
2331
|
return;
|
|
2285
2332
|
}
|
|
@@ -2289,10 +2336,10 @@ class dt {
|
|
|
2289
2336
|
this.targetElement = t, this.isExplicit ? this.applyThemeToDOM() : this.currentTheme = this.detectParentOrSystemTheme();
|
|
2290
2337
|
}
|
|
2291
2338
|
setTheme(t) {
|
|
2292
|
-
if (
|
|
2339
|
+
if (C[t]) {
|
|
2293
2340
|
this.currentTheme = t, this.isExplicit = !0, this.applyThemeToDOM();
|
|
2294
2341
|
try {
|
|
2295
|
-
localStorage.setItem(
|
|
2342
|
+
localStorage.setItem(N, t);
|
|
2296
2343
|
} catch {
|
|
2297
2344
|
}
|
|
2298
2345
|
}
|
|
@@ -2300,7 +2347,7 @@ class dt {
|
|
|
2300
2347
|
clearExplicitTheme() {
|
|
2301
2348
|
this.isExplicit = !1;
|
|
2302
2349
|
try {
|
|
2303
|
-
localStorage.removeItem(
|
|
2350
|
+
localStorage.removeItem(N);
|
|
2304
2351
|
} catch {
|
|
2305
2352
|
}
|
|
2306
2353
|
this.removeThemeClasses(), this.currentTheme = this.detectParentOrSystemTheme();
|
|
@@ -2309,7 +2356,7 @@ class dt {
|
|
|
2309
2356
|
return this.isExplicit || (this.currentTheme = this.detectParentOrSystemTheme()), this.currentTheme;
|
|
2310
2357
|
}
|
|
2311
2358
|
getPalette() {
|
|
2312
|
-
return
|
|
2359
|
+
return C[this.getTheme()] || C.dark;
|
|
2313
2360
|
}
|
|
2314
2361
|
detectParentOrSystemTheme() {
|
|
2315
2362
|
try {
|
|
@@ -2347,69 +2394,110 @@ class dt {
|
|
|
2347
2394
|
this.targetElement.classList.add(t);
|
|
2348
2395
|
}
|
|
2349
2396
|
}
|
|
2350
|
-
class
|
|
2351
|
-
maxDistance =
|
|
2352
|
-
maxThickness =
|
|
2353
|
-
minThickness =
|
|
2354
|
-
maxLength =
|
|
2355
|
-
minLength =
|
|
2356
|
-
render(t, e, i, s) {
|
|
2357
|
-
for (const
|
|
2358
|
-
if (!
|
|
2359
|
-
const
|
|
2360
|
-
if (
|
|
2361
|
-
const
|
|
2362
|
-
if (
|
|
2363
|
-
const
|
|
2364
|
-
if (t.save(), t.globalAlpha =
|
|
2365
|
-
const d = Math.max(0,
|
|
2366
|
-
t.moveTo(
|
|
2397
|
+
class ct {
|
|
2398
|
+
maxDistance = 800;
|
|
2399
|
+
maxThickness = 18;
|
|
2400
|
+
minThickness = 5;
|
|
2401
|
+
maxLength = 110;
|
|
2402
|
+
minLength = 50;
|
|
2403
|
+
render(t, e, i, s, a) {
|
|
2404
|
+
for (const c of e) {
|
|
2405
|
+
if (!c.active || c.isGrabbed || c.isDying) continue;
|
|
2406
|
+
const n = c.position.x, o = c.position.y;
|
|
2407
|
+
if (n >= 0 && n <= i && o >= 0 && o <= s) continue;
|
|
2408
|
+
const r = Math.min(i, Math.max(0, n)), l = Math.min(s, Math.max(0, o)), h = Math.hypot(n - r, o - l);
|
|
2409
|
+
if (h <= 0 || h > this.maxDistance) continue;
|
|
2410
|
+
const u = Math.min(1, Math.max(0, h / this.maxDistance)), p = this.minThickness + (this.maxThickness - this.minThickness) * (1 - u), _ = this.minLength + (this.maxLength - this.minLength) * (1 - u), g = 0.55 + (1 - u) * 0.35;
|
|
2411
|
+
if (t.save(), t.globalAlpha = g, t.shadowColor = c.color, t.shadowBlur = 14, t.strokeStyle = c.color, t.lineWidth = p, t.lineCap = "round", t.beginPath(), r === 0 || r === i) {
|
|
2412
|
+
const d = Math.max(0, l - _ / 2), m = Math.min(s, l + _ / 2);
|
|
2413
|
+
t.moveTo(r, d), t.lineTo(r, m);
|
|
2367
2414
|
} else {
|
|
2368
|
-
const d = Math.max(0,
|
|
2369
|
-
t.moveTo(d,
|
|
2415
|
+
const d = Math.max(0, r - _ / 2), m = Math.min(i, r + _ / 2);
|
|
2416
|
+
t.moveTo(d, l), t.lineTo(m, l);
|
|
2370
2417
|
}
|
|
2371
|
-
t.stroke(), t.strokeStyle =
|
|
2418
|
+
t.stroke(), t.strokeStyle = a.effectHighlight, t.lineWidth = Math.max(1.8, p * 0.28), t.globalAlpha = g * 0.9, t.stroke(), t.restore();
|
|
2372
2419
|
}
|
|
2373
2420
|
}
|
|
2374
2421
|
}
|
|
2375
|
-
class
|
|
2376
|
-
render(t, e, i, s, a,
|
|
2377
|
-
const
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2422
|
+
class ht {
|
|
2423
|
+
render(t, e, i, s, a, c, n = !1) {
|
|
2424
|
+
const o = Math.max(1, a), r = Math.min(1, (o - 1) / 8), l = this.wrapHue(190 + (o - 1) * 34 + Math.sin(s * 0.1) * 5), h = this.wrapHue(l + 42), u = this.wrapHue(l + 150), p = e / 2, _ = i / 2, g = Math.max(e, i) * 0.82, d = t.createRadialGradient(p, _, 20, p, _, g);
|
|
2425
|
+
n ? (d.addColorStop(0, `hsl(${l}, 42%, 91%)`), d.addColorStop(0.42, `hsl(${h}, 42%, 86%)`), d.addColorStop(0.78, `hsl(${u}, 38%, 81%)`), d.addColorStop(1, c.bgOuter)) : (d.addColorStop(0, `hsl(${l}, 42%, 11%)`), d.addColorStop(0.42, `hsl(${h}, 48%, 8%)`), d.addColorStop(0.78, `hsl(${u}, 42%, 5%)`), d.addColorStop(1, `hsl(${u}, 48%, 2.5%)`)), t.fillStyle = d, t.fillRect(0, 0, e, i);
|
|
2426
|
+
const m = Math.min(e, i) * 0.055;
|
|
2427
|
+
this.drawNebula(
|
|
2428
|
+
t,
|
|
2429
|
+
e * 0.22 + Math.sin(s * 0.18) * m,
|
|
2430
|
+
i * 0.28 + Math.cos(s * 0.15) * m,
|
|
2431
|
+
Math.max(e, i) * 0.42,
|
|
2432
|
+
l,
|
|
2433
|
+
n ? 0.27 : 0.23,
|
|
2434
|
+
n
|
|
2435
|
+
), this.drawNebula(
|
|
2436
|
+
t,
|
|
2437
|
+
e * 0.8 + Math.cos(s * 0.14) * m,
|
|
2438
|
+
i * 0.7 + Math.sin(s * 0.17) * m,
|
|
2439
|
+
Math.max(e, i) * 0.48,
|
|
2440
|
+
h,
|
|
2441
|
+
n ? 0.23 : 0.2,
|
|
2442
|
+
n
|
|
2443
|
+
), this.drawNebula(
|
|
2444
|
+
t,
|
|
2445
|
+
e * 0.86 + Math.sin(s * 0.11) * m * 0.7,
|
|
2446
|
+
i * 0.16 + Math.cos(s * 0.13) * m * 0.7,
|
|
2447
|
+
Math.max(e, i) * 0.3,
|
|
2448
|
+
u,
|
|
2449
|
+
n ? 0.17 : 0.14,
|
|
2450
|
+
n
|
|
2451
|
+
), this.drawSoftFlows(t, e, i, s, l, r, n), this.drawParticleField(t, e, i, s, l, h, o, n);
|
|
2452
|
+
const x = t.createRadialGradient(p, _, Math.min(e, i) * 0.28, p, _, g);
|
|
2453
|
+
x.addColorStop(0, "rgba(0, 0, 0, 0)"), x.addColorStop(1, n ? "rgba(40, 60, 90, 0.09)" : "rgba(0, 0, 0, 0.2)"), t.fillStyle = x, t.fillRect(0, 0, e, i);
|
|
2454
|
+
}
|
|
2455
|
+
drawNebula(t, e, i, s, a, c, n) {
|
|
2456
|
+
const o = t.createRadialGradient(e, i, 0, e, i, s), r = n ? 52 : 60;
|
|
2457
|
+
o.addColorStop(0, `hsla(${a}, ${n ? 88 : 80}%, ${r}%, ${c})`), o.addColorStop(0.38, `hsla(${a}, ${n ? 82 : 75}%, ${r - (n ? 7 : 12)}%, ${c * 0.5})`), o.addColorStop(1, "rgba(0, 0, 0, 0)"), t.fillStyle = o, t.beginPath(), t.arc(e, i, s, 0, Math.PI * 2), t.fill();
|
|
2458
|
+
}
|
|
2459
|
+
drawSoftFlows(t, e, i, s, a, c, n) {
|
|
2460
|
+
t.save();
|
|
2461
|
+
const o = Math.min(e, i), r = o * 0.035;
|
|
2462
|
+
t.globalAlpha = n ? 0.15 : 0.12, t.lineWidth = Math.max(1.3, o * 17e-4), t.lineCap = "round", t.shadowBlur = o * 0.02, t.shadowColor = `hsla(${a}, 85%, ${n ? 52 : 62}%, 0.28)`;
|
|
2463
|
+
for (let l = 0; l < 3; l++) {
|
|
2464
|
+
const h = (l - 1) * o * 0.075 + Math.sin(s * 0.06 + l) * r, u = l * 28 + c * 18;
|
|
2465
|
+
t.strokeStyle = `hsla(${this.wrapHue(a + u)}, ${n ? 78 : 74}%, ${n ? 47 : 62}%, ${0.52 - l * 0.08})`, t.beginPath(), t.moveTo(-o * 0.12, i * 0.2 + h), t.bezierCurveTo(e * 0.2, i * 0.02 + h, e * 0.47, i * 0.2 - h, e * 0.73, i * 0.07 + h), t.bezierCurveTo(e * 0.94, -o * 0.02 + h, e * 1.04, i * 0.16 + h, e * 1.1, i * 0.36 + h), t.stroke(), t.beginPath(), t.moveTo(-o * 0.1, i * 0.8 - h), t.bezierCurveTo(e * 0.2, i * 0.98 - h, e * 0.48, i * 0.8 + h, e * 0.75, i * 0.93 - h), t.bezierCurveTo(e * 0.94, i * 1.02 - h, e * 1.04, i * 0.84 - h, e * 1.1, i * 0.65 - h), t.stroke();
|
|
2466
|
+
}
|
|
2467
|
+
t.restore();
|
|
2468
|
+
}
|
|
2469
|
+
drawParticleField(t, e, i, s, a, c, n, o) {
|
|
2470
|
+
const r = 44 + Math.min(24, n * 2), l = e / 2, h = i / 2, u = Math.min(e, i) * 0.17;
|
|
2471
|
+
for (let p = 0; p < r; p++) {
|
|
2472
|
+
const _ = p + n * 17, g = this.unitNoise(_ * 1.7) * e, d = this.unitNoise(_ * 2.9 + 13) * i, m = Math.hypot(g - l, d - h), x = Math.min(1, Math.max(0, (m - u) / (Math.min(e, i) * 0.28))), A = 0.7 + Math.sin(s * (0.6 + p % 4 * 0.08) + _) * 0.3, b = (o ? 0.34 : 0.3) * x * A, I = 0.65 + p % 3 * 0.45;
|
|
2473
|
+
t.fillStyle = `hsla(${p % 3 === 0 ? c : a}, ${o ? 82 : 78}%, ${o ? 40 : 70}%, ${b})`, t.beginPath(), t.arc(g, d, I, 0, Math.PI * 2), t.fill();
|
|
2386
2474
|
}
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2475
|
+
}
|
|
2476
|
+
unitNoise(t) {
|
|
2477
|
+
return (Math.sin(t * 12.9898) * 43758.5453 % 1 + 1) % 1;
|
|
2478
|
+
}
|
|
2479
|
+
wrapHue(t) {
|
|
2480
|
+
return (t % 360 + 360) % 360;
|
|
2393
2481
|
}
|
|
2394
2482
|
}
|
|
2395
|
-
class
|
|
2483
|
+
class ut {
|
|
2396
2484
|
render(t, e, i) {
|
|
2397
2485
|
if (!e.isActive) return;
|
|
2398
2486
|
const s = e.getLauncher(), a = e.getTarget();
|
|
2399
2487
|
if (!s || !a || !s.active || !a.active) return;
|
|
2400
|
-
const
|
|
2401
|
-
if (t.save(),
|
|
2488
|
+
const c = e.getStep();
|
|
2489
|
+
if (t.save(), c === 1) {
|
|
2402
2490
|
const n = Math.sin(i * 6) * 10, o = s.position.x, r = s.position.y - 65 + n;
|
|
2403
2491
|
t.shadowColor = "#00f0ff", t.shadowBlur = 20, t.fillStyle = "#00f0ff", t.beginPath(), t.moveTo(o, r + 20), t.lineTo(o - 16, r - 12), t.lineTo(o - 6, r - 12), t.lineTo(o - 6, r - 32), t.lineTo(o + 6, r - 32), t.lineTo(o + 6, r - 12), t.lineTo(o + 16, r - 12), t.closePath(), t.fill();
|
|
2404
|
-
const
|
|
2405
|
-
t.strokeStyle = "rgba(0, 240, 255, 0.8)", t.lineWidth = 3, t.beginPath(), t.arc(s.position.x, s.position.y,
|
|
2406
|
-
} else if (
|
|
2492
|
+
const l = s.radius * (1.6 + Math.sin(i * 8) * 0.3);
|
|
2493
|
+
t.strokeStyle = "rgba(0, 240, 255, 0.8)", t.lineWidth = 3, t.beginPath(), t.arc(s.position.x, s.position.y, l, 0, Math.PI * 2), t.stroke();
|
|
2494
|
+
} else if (c === 2) {
|
|
2407
2495
|
const n = a.position.x - s.position.x, o = a.position.y - s.position.y;
|
|
2408
2496
|
if (Math.hypot(n, o) > 10) {
|
|
2409
|
-
const
|
|
2497
|
+
const l = Math.atan2(o, n);
|
|
2410
2498
|
t.shadowColor = "#ff00dd", t.shadowBlur = 22, t.strokeStyle = "#ff00dd", 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([]);
|
|
2411
|
-
const h = a.position.x - Math.cos(
|
|
2412
|
-
t.fillStyle = "#ff00dd", t.beginPath(), t.moveTo(h, u), t.lineTo(h - Math.cos(
|
|
2499
|
+
const h = a.position.x - Math.cos(l) * (a.radius + 10), u = a.position.y - Math.sin(l) * (a.radius + 10);
|
|
2500
|
+
t.fillStyle = "#ff00dd", t.beginPath(), t.moveTo(h, u), t.lineTo(h - Math.cos(l - 0.4) * 24, u - Math.sin(l - 0.4) * 24), t.lineTo(h - Math.cos(l + 0.4) * 24, u - Math.sin(l + 0.4) * 24), t.closePath(), t.fill();
|
|
2413
2501
|
const p = a.radius * (1.8 + Math.cos(i * 10) * 0.3);
|
|
2414
2502
|
t.strokeStyle = "rgba(255, 0, 221, 0.9)", t.lineWidth = 3.5, t.beginPath(), t.arc(a.position.x, a.position.y, p, 0, Math.PI * 2), t.stroke();
|
|
2415
2503
|
}
|
|
@@ -2417,7 +2505,7 @@ class mt {
|
|
|
2417
2505
|
t.restore();
|
|
2418
2506
|
}
|
|
2419
2507
|
}
|
|
2420
|
-
class
|
|
2508
|
+
class pt {
|
|
2421
2509
|
canvas;
|
|
2422
2510
|
ctx;
|
|
2423
2511
|
themeManager;
|
|
@@ -2425,83 +2513,95 @@ class ft {
|
|
|
2425
2513
|
bgRenderer;
|
|
2426
2514
|
tutorialArrowRenderer;
|
|
2427
2515
|
constructor(t, e) {
|
|
2428
|
-
this.canvas = t, this.ctx = t.getContext("2d"), this.themeManager = e, this.indicatorRenderer = new
|
|
2516
|
+
this.canvas = t, this.ctx = t.getContext("2d"), this.themeManager = e, this.indicatorRenderer = new ct(), this.bgRenderer = new ht(), this.tutorialArrowRenderer = new ut();
|
|
2429
2517
|
}
|
|
2430
|
-
render(t, e, i, s, a,
|
|
2518
|
+
render(t, e, i, s, a, c, n, o, r, l, h = 1, u) {
|
|
2431
2519
|
if (!this.ctx) return;
|
|
2432
|
-
const p = this.themeManager.getPalette(), { width: _, height:
|
|
2433
|
-
this.ctx.save(), this.ctx.translate(
|
|
2520
|
+
const p = this.themeManager.getPalette(), { width: _, height: g } = this.canvas, d = o.getShakeOffset();
|
|
2521
|
+
this.ctx.save(), this.ctx.translate(d.x, d.y), this.bgRenderer.render(
|
|
2522
|
+
this.ctx,
|
|
2523
|
+
_,
|
|
2524
|
+
g,
|
|
2525
|
+
t.pulsePhase,
|
|
2526
|
+
h,
|
|
2527
|
+
p,
|
|
2528
|
+
this.themeManager.getTheme() === "light"
|
|
2529
|
+
), this.drawToxicPools(i, t.pulsePhase), this.drawGravityVortices(s, t.pulsePhase), this.drawShockwaves(a), this.drawCoreFilaments(t, p), this.drawParticles(c), E.getInstance().getConfig().core.hasOffscreenIndicators && this.indicatorRenderer.render(this.ctx, e, _, g, p), this.drawOrganicEnemies(e, t.pulsePhase, p), u && this.tutorialArrowRenderer.render(this.ctx, u, t.pulsePhase), r ? this.drawPsionicTendril(t.position, r.position, p) : t && this.drawHoverTendril(t.position, l, e, p), this.drawOrganicConsciousnessCore(t, p), this.drawFloatingTexts(n), o.flashAlpha > 0 && (this.ctx.fillStyle = `rgba(255, 255, 255, ${o.flashAlpha})`, this.ctx.fillRect(0, 0, _, g)), this.ctx.restore();
|
|
2434
2530
|
}
|
|
2435
2531
|
drawToxicPools(t, e) {
|
|
2436
2532
|
if (this.ctx)
|
|
2437
2533
|
for (const i of t) {
|
|
2438
|
-
const s = i.duration / i.maxDuration, a = Math.min(0.7, (1 - s) * 0.7), { x:
|
|
2534
|
+
const s = i.duration / i.maxDuration, a = Math.min(0.7, (1 - s) * 0.7), { x: c, y: n } = i.position;
|
|
2439
2535
|
this.ctx.save();
|
|
2440
|
-
const o = this.ctx.createRadialGradient(
|
|
2536
|
+
const o = this.ctx.createRadialGradient(c, n, 10, c, n, i.radius * 1.2);
|
|
2441
2537
|
o.addColorStop(0, `rgba(57, 255, 20, ${a * 0.9})`), o.addColorStop(0.4, `rgba(16, 185, 129, ${a * 0.65})`), o.addColorStop(0.8, `rgba(5, 80, 45, ${a * 0.35})`), o.addColorStop(1, "rgba(2, 35, 15, 0)"), this.ctx.fillStyle = o, this.ctx.shadowColor = "#39ff14", this.ctx.shadowBlur = 30, this.ctx.beginPath();
|
|
2442
2538
|
const r = 70;
|
|
2443
|
-
for (let
|
|
2444
|
-
const h =
|
|
2445
|
-
|
|
2539
|
+
for (let l = 0; l <= r; l++) {
|
|
2540
|
+
const h = l * Math.PI * 2 / r, u = Math.sin(h * 5 + e * 3) * 14, p = Math.cos(h * 3 - e * 2) * 9, _ = i.radius + u + p, g = c + Math.cos(h) * _, d = n + Math.sin(h) * _;
|
|
2541
|
+
l === 0 ? this.ctx.moveTo(g, d) : this.ctx.lineTo(g, d);
|
|
2446
2542
|
}
|
|
2447
2543
|
this.ctx.closePath(), this.ctx.fill(), this.ctx.strokeStyle = `rgba(57, 255, 20, ${a * 0.8})`, this.ctx.lineWidth = 2.5, this.ctx.beginPath();
|
|
2448
|
-
for (let
|
|
2449
|
-
const h =
|
|
2450
|
-
|
|
2544
|
+
for (let l = 0; l <= r; l++) {
|
|
2545
|
+
const h = l * Math.PI * 2 / r, u = Math.sin(h * 6 + e * 4) * 8, p = i.radius * 0.75 + u, _ = c + Math.cos(h) * p, g = n + Math.sin(h) * p;
|
|
2546
|
+
l === 0 ? this.ctx.moveTo(_, g) : this.ctx.lineTo(_, g);
|
|
2451
2547
|
}
|
|
2452
2548
|
this.ctx.closePath(), this.ctx.stroke();
|
|
2453
|
-
for (let
|
|
2454
|
-
const h =
|
|
2455
|
-
this.ctx.fillStyle = `rgba(255, 255, 255, ${a * 0.8})`, this.ctx.beginPath(), this.ctx.arc(p, _, Math.max(1,
|
|
2549
|
+
for (let l = 0; l < 6; l++) {
|
|
2550
|
+
const h = l * Math.PI * 0.33 + e * 1.5, u = i.radius * 0.5 * (0.3 + Math.sin(e * 2 + l) * 0.3), p = c + Math.cos(h) * u, _ = n + Math.sin(h) * u, g = 3 + Math.sin(e * 3 + l) * 2;
|
|
2551
|
+
this.ctx.fillStyle = `rgba(255, 255, 255, ${a * 0.8})`, this.ctx.beginPath(), this.ctx.arc(p, _, Math.max(1, g), 0, Math.PI * 2), this.ctx.fill();
|
|
2456
2552
|
}
|
|
2457
2553
|
this.ctx.restore();
|
|
2458
2554
|
}
|
|
2459
2555
|
}
|
|
2460
2556
|
drawShockwaves(t) {
|
|
2461
|
-
if (this.ctx)
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2557
|
+
if (!this.ctx) return;
|
|
2558
|
+
const e = this.themeManager.getTheme() === "light";
|
|
2559
|
+
for (const i of t) {
|
|
2560
|
+
this.ctx.save(), this.ctx.globalAlpha = i.alpha;
|
|
2561
|
+
const s = this.ctx.createRadialGradient(
|
|
2562
|
+
i.position.x,
|
|
2563
|
+
i.position.y,
|
|
2564
|
+
0,
|
|
2565
|
+
i.position.x,
|
|
2566
|
+
i.position.y,
|
|
2567
|
+
i.radius
|
|
2568
|
+
);
|
|
2569
|
+
s.addColorStop(0, e ? "rgba(255, 255, 255, 0.72)" : "rgba(255, 255, 255, 0.4)"), s.addColorStop(0.7, i.color), s.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.fillStyle = s, this.ctx.beginPath(), this.ctx.arc(i.position.x, i.position.y, i.radius, 0, Math.PI * 2), this.ctx.fill(), this.ctx.strokeStyle = e ? i.color : "#ffffff", this.ctx.lineWidth = 4, this.ctx.shadowColor = i.color, this.ctx.shadowBlur = 24, this.ctx.beginPath(), this.ctx.arc(i.position.x, i.position.y, i.radius, 0, Math.PI * 2), this.ctx.stroke(), this.ctx.restore();
|
|
2570
|
+
}
|
|
2474
2571
|
}
|
|
2475
2572
|
drawGravityVortices(t, e) {
|
|
2476
|
-
if (this.ctx)
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
this.ctx.restore();
|
|
2573
|
+
if (!this.ctx) return;
|
|
2574
|
+
const i = this.themeManager.getPalette();
|
|
2575
|
+
for (const s of t) {
|
|
2576
|
+
const a = Math.min(0.85, (1 - s.duration / s.maxDuration) * 0.85), c = s.radius * (1 - s.duration / s.maxDuration * 0.1), { x: n, y: o } = s.position;
|
|
2577
|
+
this.ctx.save();
|
|
2578
|
+
const r = this.ctx.createRadialGradient(n, o, 0, n, o, 60);
|
|
2579
|
+
r.addColorStop(0, this.colorWithAlpha(i.vortexCore, a)), r.addColorStop(0.7, this.colorWithAlpha(i.vortexMid, a)), r.addColorStop(1, `rgba(157, 78, 221, ${a * 0.5})`), this.ctx.fillStyle = r, this.ctx.beginPath(), this.ctx.arc(n, o, 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;
|
|
2580
|
+
for (let l = 1; l <= 5; l++) {
|
|
2581
|
+
const h = c * l / 5, u = e * l * 2.2;
|
|
2582
|
+
this.ctx.beginPath(), this.ctx.arc(n, o, h, u, u + Math.PI * 1.5), this.ctx.stroke();
|
|
2487
2583
|
}
|
|
2584
|
+
this.ctx.restore();
|
|
2585
|
+
}
|
|
2488
2586
|
}
|
|
2489
2587
|
drawFluidCosmosBackground(t, e, i, s) {
|
|
2490
2588
|
if (!this.ctx) return;
|
|
2491
2589
|
const a = this.ctx.createRadialGradient(t / 2, e / 2, 40, t / 2, e / 2, Math.max(t, e));
|
|
2492
2590
|
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);
|
|
2493
|
-
const
|
|
2494
|
-
o.addColorStop(0, s.nebulaCyan), o.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.fillStyle = o, this.ctx.beginPath(), this.ctx.arc(
|
|
2495
|
-
const r = t * 0.68 + Math.cos(i * 0.35) * 50,
|
|
2496
|
-
h.addColorStop(0, s.nebulaMagenta), h.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.fillStyle = h, this.ctx.beginPath(), this.ctx.arc(r,
|
|
2591
|
+
const c = t * 0.35 + Math.sin(i * 0.3) * 60, n = e * 0.45 + Math.cos(i * 0.25) * 50, o = this.ctx.createRadialGradient(c, n, 20, c, n, 380);
|
|
2592
|
+
o.addColorStop(0, s.nebulaCyan), o.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.fillStyle = o, this.ctx.beginPath(), this.ctx.arc(c, n, 380, 0, Math.PI * 2), this.ctx.fill();
|
|
2593
|
+
const r = t * 0.68 + Math.cos(i * 0.35) * 50, l = e * 0.55 + Math.sin(i * 0.3) * 45, h = this.ctx.createRadialGradient(r, l, 20, r, l, 420);
|
|
2594
|
+
h.addColorStop(0, s.nebulaMagenta), h.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.fillStyle = h, this.ctx.beginPath(), this.ctx.arc(r, l, 420, 0, Math.PI * 2), this.ctx.fill();
|
|
2497
2595
|
}
|
|
2498
2596
|
drawCoreFilaments(t, e) {
|
|
2499
2597
|
if (!this.ctx) return;
|
|
2500
|
-
const i =
|
|
2501
|
-
this.ctx.lineWidth = 1.5
|
|
2598
|
+
const i = t.powerUpCount;
|
|
2599
|
+
this.ctx.lineWidth = 1.5;
|
|
2502
2600
|
for (let s = 0; s < i; s++) {
|
|
2503
|
-
const a =
|
|
2504
|
-
this.ctx.
|
|
2601
|
+
const a = t.collectedPowerUpColors[s] || e.nebulaCyan;
|
|
2602
|
+
this.ctx.strokeStyle = a;
|
|
2603
|
+
const c = s * Math.PI * 2 / i + t.pulsePhase * 0.12, n = 85 + Math.sin(t.pulsePhase * 1.5 + s) * 25, o = t.position.x + Math.cos(c) * n, r = t.position.y + Math.sin(c) * n, l = t.position.x + Math.cos(c + 0.4) * 48, h = t.position.y + Math.sin(c + 0.4) * 48;
|
|
2604
|
+
this.ctx.beginPath(), this.ctx.moveTo(t.position.x, t.position.y), this.ctx.quadraticCurveTo(l, h, o, r), this.ctx.stroke(), this.ctx.fillStyle = a, this.ctx.beginPath(), this.ctx.arc(o, r, 3.5, 0, Math.PI * 2), this.ctx.fill();
|
|
2505
2605
|
}
|
|
2506
2606
|
}
|
|
2507
2607
|
drawOrganicConsciousnessCore(t, e) {
|
|
@@ -2513,55 +2613,55 @@ class ft {
|
|
|
2513
2613
|
}
|
|
2514
2614
|
const a = t.getColorHex();
|
|
2515
2615
|
for (let r = 0; r < t.integrity; r++) {
|
|
2516
|
-
const
|
|
2616
|
+
const l = t.radius + 16 + r * 12;
|
|
2517
2617
|
this.ctx.strokeStyle = a, this.ctx.lineWidth = 2.2, this.ctx.shadowColor = a, this.ctx.shadowBlur = 12, this.ctx.beginPath();
|
|
2518
2618
|
const h = 60;
|
|
2519
2619
|
for (let u = 0; u <= h; u++) {
|
|
2520
|
-
const p = u * Math.PI * 2 / h, _ =
|
|
2521
|
-
u === 0 ? this.ctx.moveTo(
|
|
2620
|
+
const p = u * Math.PI * 2 / h, _ = l + Math.sin(p * 4 + t.pulsePhase * 2 + r) * 3, g = i + Math.cos(p) * _, d = s + Math.sin(p) * _;
|
|
2621
|
+
u === 0 ? this.ctx.moveTo(g, d) : this.ctx.lineTo(g, d);
|
|
2522
2622
|
}
|
|
2523
2623
|
this.ctx.closePath(), this.ctx.stroke();
|
|
2524
2624
|
}
|
|
2525
2625
|
if (t.repairProgress > 0) {
|
|
2526
|
-
const r = t.integrity,
|
|
2626
|
+
const r = t.integrity, l = t.radius + 16 + r * 12;
|
|
2527
2627
|
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();
|
|
2528
2628
|
const h = 60;
|
|
2529
2629
|
for (let u = 0; u <= h; u++) {
|
|
2530
|
-
const p = u * Math.PI * 2 / h, _ =
|
|
2531
|
-
u === 0 ? this.ctx.moveTo(
|
|
2630
|
+
const p = u * Math.PI * 2 / h, _ = l + Math.sin(p * 4 + t.pulsePhase * 2 + r) * 3, g = i + Math.cos(p) * _, d = s + Math.sin(p) * _;
|
|
2631
|
+
u === 0 ? this.ctx.moveTo(g, d) : this.ctx.lineTo(g, d);
|
|
2532
2632
|
}
|
|
2533
2633
|
this.ctx.closePath(), this.ctx.stroke(), this.ctx.restore();
|
|
2534
2634
|
}
|
|
2535
|
-
const
|
|
2536
|
-
|
|
2635
|
+
const c = this.ctx.createRadialGradient(i, s, 5, i, s, t.radius * 2.2);
|
|
2636
|
+
c.addColorStop(0, a), c.addColorStop(0.5, e.nebulaMagenta), c.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.fillStyle = c, 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();
|
|
2537
2637
|
const n = 80;
|
|
2538
2638
|
for (let r = 0; r <= n; r++) {
|
|
2539
|
-
const
|
|
2639
|
+
const l = r * Math.PI * 2 / n, h = t.getMembraneRadius(l), u = Math.cos(l) * h, p = Math.sin(l) * h;
|
|
2540
2640
|
r === 0 ? this.ctx.moveTo(u, p) : this.ctx.lineTo(u, p);
|
|
2541
2641
|
}
|
|
2542
2642
|
this.ctx.closePath(), this.ctx.fill(), this.ctx.stroke();
|
|
2543
2643
|
const o = t.powerUpCount;
|
|
2544
2644
|
if (o > 0) {
|
|
2545
|
-
this.ctx.strokeStyle =
|
|
2645
|
+
this.ctx.strokeStyle = e.effectHighlight, this.ctx.lineWidth = 1.8, this.ctx.shadowColor = a, this.ctx.shadowBlur = 10;
|
|
2546
2646
|
for (let r = 0; r < o; r++) {
|
|
2547
|
-
const
|
|
2647
|
+
const l = r * Math.PI * 2 / o + t.pulsePhase * 0.4, h = t.radius * (0.45 + Math.sin(t.pulsePhase * 2 + r) * 0.15);
|
|
2548
2648
|
this.ctx.beginPath(), this.ctx.moveTo(0, 0);
|
|
2549
|
-
const u = Math.cos(
|
|
2550
|
-
this.ctx.quadraticCurveTo(u, p, _,
|
|
2649
|
+
const u = Math.cos(l + Math.sin(t.pulsePhase + r) * 0.4) * (h * 0.6), p = Math.sin(l + Math.cos(t.pulsePhase + r) * 0.4) * (h * 0.6), _ = Math.cos(l) * h, g = Math.sin(l) * h;
|
|
2650
|
+
this.ctx.quadraticCurveTo(u, p, _, g), this.ctx.stroke(), this.ctx.fillStyle = a, this.ctx.beginPath(), this.ctx.arc(_, g, 2.5, 0, Math.PI * 2), this.ctx.fill();
|
|
2551
2651
|
}
|
|
2552
2652
|
}
|
|
2553
|
-
this.ctx.fillStyle =
|
|
2653
|
+
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();
|
|
2554
2654
|
}
|
|
2555
2655
|
drawPsionicTendril(t, e, i) {
|
|
2556
2656
|
if (!this.ctx) return;
|
|
2557
2657
|
this.ctx.save();
|
|
2558
2658
|
const s = e.x - t.x, a = e.y - t.y;
|
|
2559
2659
|
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);
|
|
2560
|
-
const
|
|
2561
|
-
this.ctx.quadraticCurveTo(
|
|
2660
|
+
const c = (t.x + e.x) / 2 + Math.sin(Date.now() * 0.02) * 16, n = (t.y + e.y) / 2 + Math.cos(Date.now() * 0.02) * 16;
|
|
2661
|
+
this.ctx.quadraticCurveTo(c, n, 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();
|
|
2562
2662
|
for (let o = 0; o < 6; o++) {
|
|
2563
|
-
const r = Math.random(),
|
|
2564
|
-
this.ctx.fillStyle =
|
|
2663
|
+
const r = Math.random(), l = t.x + s * r + (Math.random() - 0.5) * 24, h = t.y + a * r + (Math.random() - 0.5) * 24;
|
|
2664
|
+
this.ctx.fillStyle = i.effectHighlight, this.ctx.beginPath(), this.ctx.arc(l, h, 2.5 + Math.random() * 2.5, 0, Math.PI * 2), this.ctx.fill();
|
|
2565
2665
|
}
|
|
2566
2666
|
this.ctx.restore();
|
|
2567
2667
|
}
|
|
@@ -2569,8 +2669,8 @@ class ft {
|
|
|
2569
2669
|
if (this.ctx)
|
|
2570
2670
|
for (const a of i) {
|
|
2571
2671
|
if (!a.active || a.isGrabbed || a.isThrown || a.wasManipulated || a.isDying) continue;
|
|
2572
|
-
const
|
|
2573
|
-
if (Math.hypot(
|
|
2672
|
+
const c = e.x - a.position.x, n = e.y - a.position.y;
|
|
2673
|
+
if (Math.hypot(c, n) <= a.getHitRadius()) {
|
|
2574
2674
|
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();
|
|
2575
2675
|
break;
|
|
2576
2676
|
}
|
|
@@ -2582,8 +2682,8 @@ class ft {
|
|
|
2582
2682
|
if (!s.active) continue;
|
|
2583
2683
|
let a = s.color;
|
|
2584
2684
|
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);
|
|
2585
|
-
const { x:
|
|
2586
|
-
if (this.ctx.save(), this.ctx.translate(
|
|
2685
|
+
const { x: c, y: n } = s.position;
|
|
2686
|
+
if (this.ctx.save(), this.ctx.translate(c, n), s.wasManipulated && !s.isDying) {
|
|
2587
2687
|
const o = s.radius * 1.5 + Math.sin(e * 6) * 4;
|
|
2588
2688
|
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, o, 0, Math.PI * 2), this.ctx.stroke();
|
|
2589
2689
|
const r = s.radius * 1.8 + Math.cos(e * 8) * 3;
|
|
@@ -2592,16 +2692,16 @@ class ft {
|
|
|
2592
2692
|
if (s.isDying) {
|
|
2593
2693
|
const o = s.deathTimer / s.maxDeathTimer, r = Math.max(0, 1 - o);
|
|
2594
2694
|
if (this.ctx.globalAlpha = r, s.deathType === "dissolve") {
|
|
2595
|
-
const
|
|
2596
|
-
this.ctx.fillStyle = i.sporeColor, this.ctx.shadowColor = i.sporeColor, this.ctx.shadowBlur = 20, this.ctx.beginPath(), this.ctx.arc(0, 0,
|
|
2695
|
+
const l = s.radius * (1 - o * 0.7);
|
|
2696
|
+
this.ctx.fillStyle = i.sporeColor, this.ctx.shadowColor = i.sporeColor, this.ctx.shadowBlur = 20, this.ctx.beginPath(), this.ctx.arc(0, 0, l, 0, Math.PI * 2), this.ctx.fill();
|
|
2597
2697
|
for (let h = 0; h < 4; h++) {
|
|
2598
|
-
const u = h * Math.PI * 0.5 + o * 4, p =
|
|
2599
|
-
this.ctx.fillStyle =
|
|
2698
|
+
const u = h * Math.PI * 0.5 + o * 4, p = l * 0.8 * o;
|
|
2699
|
+
this.ctx.fillStyle = i.effectHighlight, this.ctx.beginPath(), this.ctx.arc(Math.cos(u) * p, Math.sin(u) * p, 3, 0, Math.PI * 2), this.ctx.fill();
|
|
2600
2700
|
}
|
|
2601
2701
|
this.ctx.restore();
|
|
2602
2702
|
continue;
|
|
2603
2703
|
} else if (s.deathType === "sliced") {
|
|
2604
|
-
const
|
|
2704
|
+
const l = o * 24, h = s.sliceAngle + Math.PI / 2, u = Math.cos(h) * l, p = Math.sin(h) * l;
|
|
2605
2705
|
this.ctx.shadowColor = "#ff2a5f", this.ctx.shadowBlur = 22, this.ctx.fillStyle = a, this.ctx.save(), this.ctx.translate(u, p), 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(-u, -p), 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();
|
|
2606
2706
|
continue;
|
|
2607
2707
|
}
|
|
@@ -2610,18 +2710,18 @@ class ft {
|
|
|
2610
2710
|
this.ctx.rotate(s.rotation), this.ctx.beginPath();
|
|
2611
2711
|
const o = 12;
|
|
2612
2712
|
for (let r = 0; r <= o; r++) {
|
|
2613
|
-
const
|
|
2713
|
+
const l = r * Math.PI * 2 / o, h = s.radius * 1.6 + Math.sin(l * 3 + e * 4) * 3, u = s.radius * 0.6 + Math.cos(l * 2 + e * 3) * 2, p = Math.cos(l) * h, _ = Math.sin(l) * u;
|
|
2614
2714
|
r === 0 ? this.ctx.moveTo(p, _) : this.ctx.lineTo(p, _);
|
|
2615
2715
|
}
|
|
2616
|
-
this.ctx.closePath(), this.ctx.fill(), this.ctx.fillStyle =
|
|
2716
|
+
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();
|
|
2617
2717
|
} else if (s.type === "spore") {
|
|
2618
2718
|
this.ctx.beginPath();
|
|
2619
2719
|
const o = 8;
|
|
2620
2720
|
for (let r = 0; r < o; r++) {
|
|
2621
|
-
const
|
|
2721
|
+
const l = r * Math.PI * 2 / o, h = s.radius + Math.sin(l * 4 + e * 3 + s.position.x) * 4, u = Math.cos(l) * h, p = Math.sin(l) * h;
|
|
2622
2722
|
r === 0 ? this.ctx.moveTo(u, p) : this.ctx.lineTo(u, p);
|
|
2623
2723
|
}
|
|
2624
|
-
this.ctx.closePath(), this.ctx.fill(), this.ctx.fillStyle =
|
|
2724
|
+
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();
|
|
2625
2725
|
} else if (s.type === "cluster") {
|
|
2626
2726
|
this.ctx.beginPath();
|
|
2627
2727
|
const o = Math.sin(e * 3) * 2;
|
|
@@ -2630,19 +2730,19 @@ class ft {
|
|
|
2630
2730
|
this.ctx.beginPath();
|
|
2631
2731
|
const o = 14;
|
|
2632
2732
|
for (let r = 0; r <= o; r++) {
|
|
2633
|
-
const
|
|
2733
|
+
const l = r * Math.PI * 2 / o, h = s.radius + Math.sin(l * 5 - e * 5) * 3, u = Math.cos(l) * h, p = Math.sin(l) * h;
|
|
2634
2734
|
r === 0 ? this.ctx.moveTo(u, p) : this.ctx.lineTo(u, p);
|
|
2635
2735
|
}
|
|
2636
2736
|
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();
|
|
2637
2737
|
} else if (s.type === "heavy") {
|
|
2638
2738
|
this.ctx.rotate(s.rotation);
|
|
2639
|
-
const o = Math.PI * 0.75, r = s.radius * 1.35,
|
|
2739
|
+
const o = Math.PI * 0.75, r = s.radius * 1.35, l = s.radius * 0.75;
|
|
2640
2740
|
this.ctx.beginPath(), this.ctx.arc(0, 0, r, -o / 2, o / 2, !1);
|
|
2641
|
-
const h = Math.cos(o / 2) *
|
|
2642
|
-
this.ctx.lineTo(h, u), this.ctx.arc(0, 0,
|
|
2741
|
+
const h = Math.cos(o / 2) * l, u = Math.sin(o / 2) * l;
|
|
2742
|
+
this.ctx.lineTo(h, u), this.ctx.arc(0, 0, l, 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();
|
|
2643
2743
|
for (let p = -2; p <= 2; p++) {
|
|
2644
|
-
const _ = p * o / 6,
|
|
2645
|
-
this.ctx.fillStyle =
|
|
2744
|
+
const _ = p * o / 6, g = Math.cos(_) * (l + 6), d = Math.sin(_) * (l + 6);
|
|
2745
|
+
this.ctx.fillStyle = i.effectHighlight, this.ctx.beginPath(), this.ctx.arc(g, d, 3, 0, Math.PI * 2), this.ctx.fill();
|
|
2646
2746
|
}
|
|
2647
2747
|
} else
|
|
2648
2748
|
this.ctx.beginPath(), this.ctx.arc(0, 0, s.radius, 0, Math.PI * 2), this.ctx.fill();
|
|
@@ -2660,29 +2760,35 @@ class ft {
|
|
|
2660
2760
|
this.ctx.save(), this.ctx.globalAlpha = e.alpha, this.ctx.fillStyle = e.color, this.ctx.font = `900 ${e.size}px Orbitron, sans-serif`, this.ctx.textAlign = "center", this.ctx.shadowColor = e.color, this.ctx.shadowBlur = 12, this.ctx.fillText(e.text, e.position.x, e.position.y), this.ctx.restore();
|
|
2661
2761
|
}
|
|
2662
2762
|
drawOrbitingModifierOrbs(t, e, i, s = !0) {
|
|
2663
|
-
if (this.ctx)
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
const u = this.ctx.createRadialGradient(l, n, 2, l, n, h * 1.4);
|
|
2672
|
-
u.addColorStop(0, "#ffffff"), u.addColorStop(0.4, o), u.addColorStop(1, "rgba(0, 0, 0, 0.5)"), this.ctx.fillStyle = u, this.ctx.beginPath(), this.ctx.arc(l, n, h, 0, Math.PI * 2), this.ctx.fill(), this.ctx.strokeStyle = c, this.ctx.lineWidth = r === "legendary" ? 3.5 : 2.5, this.ctx.beginPath(), this.ctx.arc(l, n, h + 4, e * 3, e * 3 + Math.PI * 1.2), this.ctx.stroke(), (r === "legendary" || r === "epic") && (this.ctx.strokeStyle = "#ffffff", this.ctx.lineWidth = 1.5, this.ctx.beginPath(), this.ctx.arc(l, n, 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 = "#ffffff", this.ctx.shadowColor = "#000000", this.ctx.shadowBlur = 6, this.ctx.fillText(a.definition.badge, l, n);
|
|
2673
|
-
const p = i ? i.translate(a.definition.titleKey) : a.definition.badge;
|
|
2674
|
-
this.ctx.textBaseline = "alphabetic", this.ctx.font = "900 16px Orbitron, sans-serif", this.ctx.fillStyle = "#ffffff", this.ctx.shadowColor = c, this.ctx.shadowBlur = 14, this.ctx.fillText(p, l, n - h - 14), this.ctx.restore();
|
|
2675
|
-
}
|
|
2676
|
-
if (i && s) {
|
|
2677
|
-
const a = this.canvas.width / 2, l = this.canvas.height / 2 + 210, n = i.translate("rerollButton");
|
|
2678
|
-
this.ctx.save(), this.ctx.font = "900 14px Orbitron, sans-serif", this.ctx.textAlign = "center", this.ctx.textBaseline = "middle", this.ctx.fillStyle = "rgba(0, 0, 0, 0.65)", this.ctx.strokeStyle = "#00f0ff", this.ctx.lineWidth = 2, this.ctx.shadowColor = "#00f0ff", this.ctx.shadowBlur = 12;
|
|
2679
|
-
const c = this.ctx.measureText(n).width + 20 * 2, h = 38;
|
|
2680
|
-
this.ctx.beginPath(), this.ctx.roundRect(a - c / 2, l - h / 2, c, h, 8), this.ctx.fill(), this.ctx.stroke(), this.ctx.fillStyle = "#ffffff", this.ctx.shadowColor = "#000000", this.ctx.shadowBlur = 4, this.ctx.fillText(n, a, l), this.ctx.restore();
|
|
2763
|
+
if (!this.ctx) return;
|
|
2764
|
+
const a = this.themeManager.getPalette(), c = this.themeManager.getTheme() === "light";
|
|
2765
|
+
for (const n of t) {
|
|
2766
|
+
if (!n.active) continue;
|
|
2767
|
+
const { x: o, y: r } = n.position, l = n.definition.color, h = n.definition.rarity, u = h === "legendary" ? "#ff00ff" : h === "epic" ? "#ffd700" : h === "rare" ? "#9d4edd" : "#00f5ff", p = n.radius + Math.sin(e * 6 + n.orbitAngle) * 3;
|
|
2768
|
+
if (this.ctx.save(), this.ctx.shadowColor = u, this.ctx.shadowBlur = n.isGrabbed ? 36 : h === "legendary" ? 28 : 16, h === "legendary" || h === "epic") {
|
|
2769
|
+
const d = p + 12, m = this.ctx.createRadialGradient(o, r, p, o, r, d);
|
|
2770
|
+
m.addColorStop(0, u), m.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.fillStyle = m, this.ctx.beginPath(), this.ctx.arc(o, r, d, 0, Math.PI * 2), this.ctx.fill();
|
|
2681
2771
|
}
|
|
2772
|
+
const _ = this.ctx.createRadialGradient(o, r, 2, o, r, p * 1.4);
|
|
2773
|
+
_.addColorStop(0, a.effectHighlight), _.addColorStop(0.4, l), _.addColorStop(1, c ? "rgba(23, 50, 77, 0.24)" : "rgba(0, 0, 0, 0.5)"), this.ctx.fillStyle = _, this.ctx.beginPath(), this.ctx.arc(o, r, p, 0, Math.PI * 2), this.ctx.fill(), this.ctx.strokeStyle = u, this.ctx.lineWidth = h === "legendary" ? 3.5 : 2.5, this.ctx.beginPath(), this.ctx.arc(o, r, p + 4, e * 3, e * 3 + Math.PI * 1.2), this.ctx.stroke(), (h === "legendary" || h === "epic") && (this.ctx.strokeStyle = c ? u : a.effectHighlight, this.ctx.lineWidth = 1.5, this.ctx.beginPath(), this.ctx.arc(o, r, p + 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 = a.effectInk, this.ctx.shadowColor = a.effectShadow, this.ctx.shadowBlur = 6, this.ctx.fillText(n.definition.badge, o, r);
|
|
2774
|
+
const g = i ? i.translate(n.definition.titleKey) : n.definition.badge;
|
|
2775
|
+
this.ctx.textBaseline = "alphabetic", this.ctx.font = "900 16px Orbitron, sans-serif", this.ctx.fillStyle = a.effectInk, this.ctx.shadowColor = u, this.ctx.shadowBlur = 14, this.ctx.fillText(g, o, r - p - 14), this.ctx.restore();
|
|
2682
2776
|
}
|
|
2777
|
+
if (i && s) {
|
|
2778
|
+
const n = this.canvas.width / 2, o = this.canvas.height / 2 + 210, r = i.translate("rerollButton");
|
|
2779
|
+
this.ctx.save(), this.ctx.font = "900 14px Orbitron, sans-serif", this.ctx.textAlign = "center", this.ctx.textBaseline = "middle", this.ctx.fillStyle = a.effectPanel, this.ctx.strokeStyle = a.tendrilCyan, this.ctx.lineWidth = 2, this.ctx.shadowColor = a.tendrilCyan, this.ctx.shadowBlur = 12;
|
|
2780
|
+
const u = this.ctx.measureText(r).width + 20 * 2, p = 38;
|
|
2781
|
+
this.ctx.beginPath(), this.ctx.roundRect(n - u / 2, o - p / 2, u, p, 8), this.ctx.fill(), this.ctx.stroke(), this.ctx.fillStyle = a.effectInk, this.ctx.shadowColor = a.effectShadow, this.ctx.shadowBlur = 4, this.ctx.fillText(r, n, o), this.ctx.restore();
|
|
2782
|
+
}
|
|
2783
|
+
}
|
|
2784
|
+
colorWithAlpha(t, e) {
|
|
2785
|
+
const i = t.replace("#", "");
|
|
2786
|
+
if (i.length !== 6) return t;
|
|
2787
|
+
const s = Number.parseInt(i.slice(0, 2), 16), a = Number.parseInt(i.slice(2, 4), 16), c = Number.parseInt(i.slice(4, 6), 16);
|
|
2788
|
+
return `rgba(${s}, ${a}, ${c}, ${e})`;
|
|
2683
2789
|
}
|
|
2684
2790
|
}
|
|
2685
|
-
class
|
|
2791
|
+
class dt {
|
|
2686
2792
|
container;
|
|
2687
2793
|
i18n;
|
|
2688
2794
|
waveLabelElement;
|
|
@@ -2714,7 +2820,7 @@ class xt {
|
|
|
2714
2820
|
this.container.style.display = "none";
|
|
2715
2821
|
}
|
|
2716
2822
|
}
|
|
2717
|
-
class
|
|
2823
|
+
class gt {
|
|
2718
2824
|
container;
|
|
2719
2825
|
i18n;
|
|
2720
2826
|
onStartCallback;
|
|
@@ -2740,7 +2846,7 @@ class Et {
|
|
|
2740
2846
|
this.container.style.display = "none";
|
|
2741
2847
|
}
|
|
2742
2848
|
}
|
|
2743
|
-
class
|
|
2849
|
+
class _t {
|
|
2744
2850
|
modal;
|
|
2745
2851
|
card;
|
|
2746
2852
|
i18n;
|
|
@@ -2749,8 +2855,8 @@ class yt {
|
|
|
2749
2855
|
onLanguageChangedCallback;
|
|
2750
2856
|
onCloseCallback;
|
|
2751
2857
|
hapticsEnabled = !0;
|
|
2752
|
-
constructor(t, e, i, s, a,
|
|
2753
|
-
this.i18n = e, this.themeManager = i, this.platform = s, this.onLanguageChangedCallback = a, this.onCloseCallback =
|
|
2858
|
+
constructor(t, e, i, s, a, c) {
|
|
2859
|
+
this.i18n = e, this.themeManager = i, this.platform = s, this.onLanguageChangedCallback = a, this.onCloseCallback = c;
|
|
2754
2860
|
const n = localStorage.getItem("axon_surge_haptics");
|
|
2755
2861
|
n !== null && (this.hapticsEnabled = n === "true"), 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", () => {
|
|
2756
2862
|
this.onCloseCallback && this.onCloseCallback();
|
|
@@ -2768,7 +2874,7 @@ class yt {
|
|
|
2768
2874
|
s.className = "axon-select-wrapper";
|
|
2769
2875
|
const a = document.createElement("select");
|
|
2770
2876
|
a.className = "axon-select";
|
|
2771
|
-
const
|
|
2877
|
+
const c = {
|
|
2772
2878
|
es: "ESPAÑOL (ES)",
|
|
2773
2879
|
en: "ENGLISH (EN)",
|
|
2774
2880
|
fr: "FRANÇAIS (FR)",
|
|
@@ -2785,13 +2891,13 @@ class yt {
|
|
|
2785
2891
|
ko: "한국어 (KO)",
|
|
2786
2892
|
zh: "中文 (ZH)"
|
|
2787
2893
|
};
|
|
2788
|
-
for (const
|
|
2789
|
-
const
|
|
2790
|
-
|
|
2894
|
+
for (const f of K) {
|
|
2895
|
+
const v = document.createElement("option");
|
|
2896
|
+
v.value = f, v.textContent = c[f], this.i18n.getLanguage() === f && (v.selected = !0), a.appendChild(v);
|
|
2791
2897
|
}
|
|
2792
2898
|
a.addEventListener("change", () => {
|
|
2793
|
-
const
|
|
2794
|
-
this.i18n.setLanguage(
|
|
2899
|
+
const f = a.value;
|
|
2900
|
+
this.i18n.setLanguage(f), this.onLanguageChangedCallback && this.onLanguageChangedCallback(f), this.renderContent();
|
|
2795
2901
|
});
|
|
2796
2902
|
const n = document.createElement("span");
|
|
2797
2903
|
n.className = "axon-select-arrow", n.textContent = "▼", s.appendChild(a), s.appendChild(n), e.appendChild(i), e.appendChild(s);
|
|
@@ -2799,60 +2905,60 @@ class yt {
|
|
|
2799
2905
|
o.className = "axon-setting-row";
|
|
2800
2906
|
const r = document.createElement("span");
|
|
2801
2907
|
r.textContent = this.i18n.translate("themeLabel");
|
|
2802
|
-
const
|
|
2803
|
-
|
|
2908
|
+
const l = document.createElement("div");
|
|
2909
|
+
l.className = "axon-toggle-group";
|
|
2804
2910
|
const h = [
|
|
2805
2911
|
{ id: "bioluminescent", label: "BIO" },
|
|
2806
2912
|
{ id: "dark", label: "DARK" },
|
|
2807
2913
|
{ id: "light", label: "LIGHT" }
|
|
2808
2914
|
];
|
|
2809
|
-
for (const
|
|
2810
|
-
const
|
|
2811
|
-
|
|
2812
|
-
this.themeManager.setTheme(
|
|
2813
|
-
}),
|
|
2915
|
+
for (const f of h) {
|
|
2916
|
+
const v = document.createElement("button");
|
|
2917
|
+
v.type = "button", v.className = `axon-toggle-btn ${this.themeManager.getTheme() === f.id ? "active" : ""}`, v.textContent = f.label, v.addEventListener("click", () => {
|
|
2918
|
+
this.themeManager.setTheme(f.id), this.renderContent();
|
|
2919
|
+
}), l.appendChild(v);
|
|
2814
2920
|
}
|
|
2815
|
-
o.appendChild(r), o.appendChild(
|
|
2921
|
+
o.appendChild(r), o.appendChild(l);
|
|
2816
2922
|
const u = document.createElement("div");
|
|
2817
2923
|
u.className = "axon-setting-row";
|
|
2818
2924
|
const p = document.createElement("span");
|
|
2819
2925
|
p.textContent = this.i18n.translate("hapticsLabel");
|
|
2820
2926
|
const _ = document.createElement("div");
|
|
2821
2927
|
_.className = "axon-toggle-group";
|
|
2822
|
-
const
|
|
2928
|
+
const g = [
|
|
2823
2929
|
{ enabled: !0, label: this.i18n.translate("hapticsOn") },
|
|
2824
2930
|
{ enabled: !1, label: this.i18n.translate("hapticsOff") }
|
|
2825
2931
|
];
|
|
2826
|
-
for (const
|
|
2827
|
-
const
|
|
2828
|
-
|
|
2829
|
-
this.hapticsEnabled =
|
|
2830
|
-
}), _.appendChild(
|
|
2932
|
+
for (const f of g) {
|
|
2933
|
+
const v = document.createElement("button");
|
|
2934
|
+
v.type = "button", v.className = `axon-toggle-btn ${this.hapticsEnabled === f.enabled ? "active" : ""}`, v.textContent = f.label, v.addEventListener("click", () => {
|
|
2935
|
+
this.hapticsEnabled = f.enabled, localStorage.setItem("axon_surge_haptics", String(f.enabled)), this.hapticsEnabled && this.platform.haptics.selectionChanged(), this.renderContent();
|
|
2936
|
+
}), _.appendChild(v);
|
|
2831
2937
|
}
|
|
2832
2938
|
u.appendChild(p), u.appendChild(_);
|
|
2833
|
-
const
|
|
2834
|
-
|
|
2835
|
-
const
|
|
2836
|
-
|
|
2939
|
+
const d = document.createElement("div");
|
|
2940
|
+
d.className = "axon-setting-row";
|
|
2941
|
+
const m = document.createElement("span");
|
|
2942
|
+
m.textContent = this.i18n.translate("tutorialSettingLabel");
|
|
2837
2943
|
const x = document.createElement("div");
|
|
2838
2944
|
x.className = "axon-toggle-group";
|
|
2839
|
-
const
|
|
2945
|
+
const A = localStorage.getItem("axon_surge_show_tutorial") !== "false", b = [
|
|
2840
2946
|
{ enabled: !0, label: this.i18n.translate("hapticsOn") },
|
|
2841
2947
|
{ enabled: !1, label: this.i18n.translate("hapticsOff") }
|
|
2842
2948
|
];
|
|
2843
|
-
for (const
|
|
2844
|
-
const
|
|
2845
|
-
|
|
2846
|
-
localStorage.setItem("axon_surge_show_tutorial", String(
|
|
2847
|
-
}), x.appendChild(
|
|
2949
|
+
for (const f of b) {
|
|
2950
|
+
const v = document.createElement("button");
|
|
2951
|
+
v.type = "button", v.className = `axon-toggle-btn ${A === f.enabled ? "active" : ""}`, v.textContent = f.label, v.addEventListener("click", () => {
|
|
2952
|
+
localStorage.setItem("axon_surge_show_tutorial", String(f.enabled)), this.renderContent();
|
|
2953
|
+
}), x.appendChild(v);
|
|
2848
2954
|
}
|
|
2849
|
-
|
|
2955
|
+
d.appendChild(m), d.appendChild(x);
|
|
2850
2956
|
const I = document.createElement("div");
|
|
2851
2957
|
I.className = "axon-settings-credits", I.textContent = this.i18n.translate("creditsJam");
|
|
2852
2958
|
const S = document.createElement("button");
|
|
2853
2959
|
S.type = "button", S.className = "axon-start-button", S.style.padding = "12px 36px", S.style.fontSize = "14px", S.textContent = this.i18n.translate("closeButton"), S.addEventListener("click", () => {
|
|
2854
2960
|
this.modal.close();
|
|
2855
|
-
}), this.card.appendChild(t), this.card.appendChild(e), this.card.appendChild(o), this.card.appendChild(u), this.card.appendChild(
|
|
2961
|
+
}), this.card.appendChild(t), this.card.appendChild(e), this.card.appendChild(o), this.card.appendChild(u), this.card.appendChild(d), this.card.appendChild(I), this.card.appendChild(S);
|
|
2856
2962
|
}
|
|
2857
2963
|
isHapticsEnabled() {
|
|
2858
2964
|
return this.hapticsEnabled;
|
|
@@ -2864,8 +2970,8 @@ class yt {
|
|
|
2864
2970
|
this.modal.close();
|
|
2865
2971
|
}
|
|
2866
2972
|
}
|
|
2867
|
-
const
|
|
2868
|
-
class
|
|
2973
|
+
const H = "axon_surge_show_tutorial";
|
|
2974
|
+
class mt {
|
|
2869
2975
|
isActive = !1;
|
|
2870
2976
|
showWarning = !1;
|
|
2871
2977
|
dummyLauncher = null;
|
|
@@ -2874,14 +2980,14 @@ class At {
|
|
|
2874
2980
|
initialTargetPos = { x: 0, y: 0 };
|
|
2875
2981
|
isTutorialEnabled() {
|
|
2876
2982
|
try {
|
|
2877
|
-
return localStorage.getItem(
|
|
2983
|
+
return localStorage.getItem(H) !== "false";
|
|
2878
2984
|
} catch {
|
|
2879
2985
|
return !0;
|
|
2880
2986
|
}
|
|
2881
2987
|
}
|
|
2882
2988
|
setTutorialEnabled(t) {
|
|
2883
2989
|
try {
|
|
2884
|
-
localStorage.setItem(
|
|
2990
|
+
localStorage.setItem(H, String(t));
|
|
2885
2991
|
} catch {
|
|
2886
2992
|
}
|
|
2887
2993
|
}
|
|
@@ -2899,24 +3005,24 @@ class At {
|
|
|
2899
3005
|
this.isActive = !1;
|
|
2900
3006
|
return;
|
|
2901
3007
|
}
|
|
2902
|
-
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 =
|
|
3008
|
+
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 = M.createEnemy(
|
|
2903
3009
|
"piercer",
|
|
2904
3010
|
this.initialLauncherPos,
|
|
2905
3011
|
this.initialTargetPos
|
|
2906
|
-
), this.dummyLauncher.velocity = { x: 0, y: 0 }, this.dummyTarget =
|
|
3012
|
+
), this.dummyLauncher.velocity = { x: 0, y: 0 }, this.dummyTarget = M.createEnemy(
|
|
2907
3013
|
"spore",
|
|
2908
3014
|
this.initialTargetPos,
|
|
2909
3015
|
this.initialLauncherPos
|
|
2910
3016
|
), this.dummyTarget.velocity = { x: 0, y: 0 }, i.push(this.dummyLauncher), i.push(this.dummyTarget);
|
|
2911
3017
|
}
|
|
2912
|
-
update(t, e, i, s, a,
|
|
3018
|
+
update(t, e, i, s, a, c) {
|
|
2913
3019
|
if (!this.isActive || !this.dummyLauncher || !this.dummyTarget) return;
|
|
2914
3020
|
const n = this.dummyLauncher, o = this.dummyTarget;
|
|
2915
3021
|
e.includes(n) || e.push(n), e.includes(o) || e.push(o);
|
|
2916
|
-
const r = o.position.x - n.position.x,
|
|
3022
|
+
const r = o.position.x - n.position.x, l = o.position.y - n.position.y, h = Math.hypot(r, l);
|
|
2917
3023
|
if (n.isGrabbed) {
|
|
2918
3024
|
if (this.showWarning = !1, h <= n.radius + o.radius + 60) {
|
|
2919
|
-
|
|
3025
|
+
c && c(), n.isGrabbed = !1, this.showWarning = !0, this.resetDummies(n, o);
|
|
2920
3026
|
return;
|
|
2921
3027
|
}
|
|
2922
3028
|
return;
|
|
@@ -2924,14 +3030,14 @@ class At {
|
|
|
2924
3030
|
if (n.wasManipulated) {
|
|
2925
3031
|
const u = Math.hypot(n.velocity.x, n.velocity.y);
|
|
2926
3032
|
if (!n.isThrown || u < 70) {
|
|
2927
|
-
|
|
3033
|
+
c && c(), this.showWarning = !0, this.resetDummies(n, o);
|
|
2928
3034
|
return;
|
|
2929
3035
|
}
|
|
2930
3036
|
if (h <= n.getHitRadius() + o.getHitRadius()) {
|
|
2931
3037
|
n.triggerDissolveDeath(), o.triggerDissolveDeath(), this.showWarning = !1, this.isActive = !1, a();
|
|
2932
3038
|
return;
|
|
2933
3039
|
}
|
|
2934
|
-
(n.position.x < -60 || n.position.x > i + 60 || n.position.y < -60 || n.position.y > s + 60 || u < 40) && (
|
|
3040
|
+
(n.position.x < -60 || n.position.x > i + 60 || n.position.y < -60 || n.position.y > s + 60 || u < 40) && (c && c(), this.showWarning = !0, this.resetDummies(n, o));
|
|
2935
3041
|
}
|
|
2936
3042
|
}
|
|
2937
3043
|
resetDummies(t, e) {
|
|
@@ -2941,7 +3047,7 @@ class At {
|
|
|
2941
3047
|
this.isActive = !1, this.showWarning = !1;
|
|
2942
3048
|
}
|
|
2943
3049
|
}
|
|
2944
|
-
class
|
|
3050
|
+
class ft {
|
|
2945
3051
|
container;
|
|
2946
3052
|
i18n;
|
|
2947
3053
|
tutorialManager;
|
|
@@ -2977,7 +3083,7 @@ class bt {
|
|
|
2977
3083
|
this.container.style.display = "none";
|
|
2978
3084
|
}
|
|
2979
3085
|
}
|
|
2980
|
-
class
|
|
3086
|
+
class xt {
|
|
2981
3087
|
fillElement;
|
|
2982
3088
|
killsCount = 0;
|
|
2983
3089
|
currentLevel = 1;
|
|
@@ -3008,24 +3114,24 @@ class vt {
|
|
|
3008
3114
|
this.fillElement && this.fillElement.parentElement && (this.fillElement.parentElement.style.display = "none");
|
|
3009
3115
|
}
|
|
3010
3116
|
}
|
|
3011
|
-
class
|
|
3117
|
+
class B {
|
|
3012
3118
|
static powerUps = [
|
|
3013
3119
|
{
|
|
3014
3120
|
id: "spore_radius",
|
|
3015
3121
|
titleKey: "pu_spore_radius_title",
|
|
3016
3122
|
descKey: "pu_spore_radius_desc",
|
|
3017
|
-
badge: "+
|
|
3123
|
+
badge: "+12% RAD",
|
|
3018
3124
|
category: "radius",
|
|
3019
3125
|
rarity: "common",
|
|
3020
3126
|
rarityWeight: 35,
|
|
3021
3127
|
color: "#39ff14",
|
|
3022
3128
|
apply: () => {
|
|
3023
|
-
const t =
|
|
3129
|
+
const t = E.getInstance(), e = t.getConfig().toxicPool;
|
|
3024
3130
|
t.updateConfig({
|
|
3025
3131
|
toxicPool: {
|
|
3026
3132
|
...e,
|
|
3027
|
-
baseRadius: Math.round(e.baseRadius * 1.
|
|
3028
|
-
synergyRadius: Math.round(e.synergyRadius * 1.
|
|
3133
|
+
baseRadius: Math.round(e.baseRadius * 1.12),
|
|
3134
|
+
synergyRadius: Math.round(e.synergyRadius * 1.12)
|
|
3029
3135
|
}
|
|
3030
3136
|
});
|
|
3031
3137
|
}
|
|
@@ -3040,7 +3146,7 @@ class F {
|
|
|
3040
3146
|
rarityWeight: 35,
|
|
3041
3147
|
color: "#39ff14",
|
|
3042
3148
|
apply: () => {
|
|
3043
|
-
const t =
|
|
3149
|
+
const t = E.getInstance(), e = t.getConfig().toxicPool;
|
|
3044
3150
|
t.updateConfig({
|
|
3045
3151
|
toxicPool: {
|
|
3046
3152
|
...e,
|
|
@@ -3054,18 +3160,18 @@ class F {
|
|
|
3054
3160
|
id: "vortex_radius",
|
|
3055
3161
|
titleKey: "pu_vortex_radius_title",
|
|
3056
3162
|
descKey: "pu_vortex_radius_desc",
|
|
3057
|
-
badge: "+
|
|
3163
|
+
badge: "+12% RAD",
|
|
3058
3164
|
category: "radius",
|
|
3059
3165
|
rarity: "common",
|
|
3060
3166
|
rarityWeight: 35,
|
|
3061
3167
|
color: "#9d4edd",
|
|
3062
3168
|
apply: () => {
|
|
3063
|
-
const t =
|
|
3169
|
+
const t = E.getInstance(), e = t.getConfig().gravityVortex;
|
|
3064
3170
|
t.updateConfig({
|
|
3065
3171
|
gravityVortex: {
|
|
3066
3172
|
...e,
|
|
3067
|
-
baseRadius: Math.round(e.baseRadius * 1.
|
|
3068
|
-
synergyRadius: Math.round(e.synergyRadius * 1.
|
|
3173
|
+
baseRadius: Math.round(e.baseRadius * 1.12),
|
|
3174
|
+
synergyRadius: Math.round(e.synergyRadius * 1.12)
|
|
3069
3175
|
}
|
|
3070
3176
|
});
|
|
3071
3177
|
}
|
|
@@ -3080,7 +3186,7 @@ class F {
|
|
|
3080
3186
|
rarityWeight: 35,
|
|
3081
3187
|
color: "#9d4edd",
|
|
3082
3188
|
apply: () => {
|
|
3083
|
-
const t =
|
|
3189
|
+
const t = E.getInstance(), e = t.getConfig().gravityVortex;
|
|
3084
3190
|
t.updateConfig({
|
|
3085
3191
|
gravityVortex: {
|
|
3086
3192
|
...e,
|
|
@@ -3100,7 +3206,7 @@ class F {
|
|
|
3100
3206
|
rarityWeight: 25,
|
|
3101
3207
|
color: "#9d4edd",
|
|
3102
3208
|
apply: () => {
|
|
3103
|
-
const t =
|
|
3209
|
+
const t = E.getInstance(), e = t.getConfig().gravityVortex;
|
|
3104
3210
|
t.updateConfig({
|
|
3105
3211
|
gravityVortex: {
|
|
3106
3212
|
...e,
|
|
@@ -3120,7 +3226,7 @@ class F {
|
|
|
3120
3226
|
rarityWeight: 5,
|
|
3121
3227
|
color: "#9d4edd",
|
|
3122
3228
|
apply: () => {
|
|
3123
|
-
const t =
|
|
3229
|
+
const t = E.getInstance(), e = t.getConfig().gravityVortex;
|
|
3124
3230
|
t.updateConfig({
|
|
3125
3231
|
gravityVortex: {
|
|
3126
3232
|
...e,
|
|
@@ -3139,7 +3245,7 @@ class F {
|
|
|
3139
3245
|
rarityWeight: 5,
|
|
3140
3246
|
color: "#00f5ff",
|
|
3141
3247
|
apply: () => {
|
|
3142
|
-
const t =
|
|
3248
|
+
const t = E.getInstance(), e = t.getConfig().shield;
|
|
3143
3249
|
t.updateConfig({
|
|
3144
3250
|
shield: {
|
|
3145
3251
|
...e,
|
|
@@ -3158,7 +3264,7 @@ class F {
|
|
|
3158
3264
|
rarityWeight: 25,
|
|
3159
3265
|
color: "#ffcc00",
|
|
3160
3266
|
apply: () => {
|
|
3161
|
-
const t =
|
|
3267
|
+
const t = E.getInstance(), e = t.getConfig().cluster;
|
|
3162
3268
|
t.updateConfig({
|
|
3163
3269
|
cluster: {
|
|
3164
3270
|
...e,
|
|
@@ -3177,7 +3283,7 @@ class F {
|
|
|
3177
3283
|
rarityWeight: 5,
|
|
3178
3284
|
color: "#ffcc00",
|
|
3179
3285
|
apply: () => {
|
|
3180
|
-
const t =
|
|
3286
|
+
const t = E.getInstance(), e = t.getConfig().cluster;
|
|
3181
3287
|
t.updateConfig({
|
|
3182
3288
|
cluster: {
|
|
3183
3289
|
...e,
|
|
@@ -3196,7 +3302,7 @@ class F {
|
|
|
3196
3302
|
rarityWeight: 15,
|
|
3197
3303
|
color: "#ff3366",
|
|
3198
3304
|
apply: () => {
|
|
3199
|
-
const t =
|
|
3305
|
+
const t = E.getInstance(), e = t.getConfig().piercer;
|
|
3200
3306
|
t.updateConfig({
|
|
3201
3307
|
piercer: {
|
|
3202
3308
|
...e,
|
|
@@ -3215,7 +3321,7 @@ class F {
|
|
|
3215
3321
|
rarityWeight: 5,
|
|
3216
3322
|
color: "#ff2a5f",
|
|
3217
3323
|
apply: () => {
|
|
3218
|
-
const t =
|
|
3324
|
+
const t = E.getInstance(), e = t.getConfig().piercer;
|
|
3219
3325
|
t.updateConfig({
|
|
3220
3326
|
piercer: {
|
|
3221
3327
|
...e,
|
|
@@ -3224,6 +3330,25 @@ class F {
|
|
|
3224
3330
|
});
|
|
3225
3331
|
}
|
|
3226
3332
|
},
|
|
3333
|
+
{
|
|
3334
|
+
id: "offscreen_radar",
|
|
3335
|
+
titleKey: "pu_offscreen_radar_title",
|
|
3336
|
+
descKey: "pu_offscreen_radar_desc",
|
|
3337
|
+
badge: "RADAR",
|
|
3338
|
+
category: "defense",
|
|
3339
|
+
rarity: "legendary",
|
|
3340
|
+
rarityWeight: 5,
|
|
3341
|
+
color: "#00f0ff",
|
|
3342
|
+
apply: () => {
|
|
3343
|
+
const t = E.getInstance(), e = t.getConfig().core;
|
|
3344
|
+
t.updateConfig({
|
|
3345
|
+
core: {
|
|
3346
|
+
...e,
|
|
3347
|
+
hasOffscreenIndicators: !0
|
|
3348
|
+
}
|
|
3349
|
+
});
|
|
3350
|
+
}
|
|
3351
|
+
},
|
|
3227
3352
|
{
|
|
3228
3353
|
id: "piercer_homing_target",
|
|
3229
3354
|
titleKey: "pu_piercer_homing_target_title",
|
|
@@ -3234,7 +3359,7 @@ class F {
|
|
|
3234
3359
|
rarityWeight: 15,
|
|
3235
3360
|
color: "#ff2a5f",
|
|
3236
3361
|
apply: () => {
|
|
3237
|
-
const t =
|
|
3362
|
+
const t = E.getInstance(), e = t.getConfig().piercer;
|
|
3238
3363
|
t.updateConfig({
|
|
3239
3364
|
piercer: {
|
|
3240
3365
|
...e,
|
|
@@ -3253,7 +3378,7 @@ class F {
|
|
|
3253
3378
|
rarityWeight: 15,
|
|
3254
3379
|
color: "#00f5ff",
|
|
3255
3380
|
apply: () => {
|
|
3256
|
-
const t =
|
|
3381
|
+
const t = E.getInstance(), e = t.getConfig().core;
|
|
3257
3382
|
t.updateConfig({
|
|
3258
3383
|
core: {
|
|
3259
3384
|
...e,
|
|
@@ -3272,7 +3397,7 @@ class F {
|
|
|
3272
3397
|
rarityWeight: 25,
|
|
3273
3398
|
color: "#00f5ff",
|
|
3274
3399
|
apply: () => {
|
|
3275
|
-
const t =
|
|
3400
|
+
const t = E.getInstance(), e = t.getConfig().core;
|
|
3276
3401
|
t.updateConfig({
|
|
3277
3402
|
core: {
|
|
3278
3403
|
...e,
|
|
@@ -3291,15 +3416,15 @@ class F {
|
|
|
3291
3416
|
rarityWeight: 20,
|
|
3292
3417
|
color: "#00f5ff",
|
|
3293
3418
|
apply: (t) => {
|
|
3294
|
-
|
|
3419
|
+
E.getInstance().addCoreRing(1), t && t.addMaxRing(1);
|
|
3295
3420
|
}
|
|
3296
3421
|
}
|
|
3297
3422
|
];
|
|
3298
3423
|
static getRandomOptions(t = 3) {
|
|
3299
|
-
const e =
|
|
3424
|
+
const e = E.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 === "cluster_homing" && e.cluster.hasHoming || a.id === "offscreen_radar" && e.core.hasOffscreenIndicators)), s = [];
|
|
3300
3425
|
for (let a = 0; a < t && i.length > 0; a++) {
|
|
3301
|
-
const
|
|
3302
|
-
let n = Math.random() *
|
|
3426
|
+
const c = i.reduce((o, r) => o + r.rarityWeight, 0);
|
|
3427
|
+
let n = Math.random() * c;
|
|
3303
3428
|
for (let o = 0; o < i.length; o++) {
|
|
3304
3429
|
const r = i[o];
|
|
3305
3430
|
if (n -= r.rarityWeight, n <= 0) {
|
|
@@ -3314,7 +3439,7 @@ class F {
|
|
|
3314
3439
|
this.powerUps.push(t);
|
|
3315
3440
|
}
|
|
3316
3441
|
}
|
|
3317
|
-
class
|
|
3442
|
+
class yt {
|
|
3318
3443
|
haptics = {
|
|
3319
3444
|
impact: async (t) => {
|
|
3320
3445
|
if ("vibrate" in navigator) {
|
|
@@ -3354,7 +3479,7 @@ class St {
|
|
|
3354
3479
|
}
|
|
3355
3480
|
};
|
|
3356
3481
|
}
|
|
3357
|
-
class
|
|
3482
|
+
class Et {
|
|
3358
3483
|
container;
|
|
3359
3484
|
canvas;
|
|
3360
3485
|
i18n;
|
|
@@ -3389,7 +3514,7 @@ class It {
|
|
|
3389
3514
|
isRunning = !1;
|
|
3390
3515
|
isPaused = !1;
|
|
3391
3516
|
constructor(t) {
|
|
3392
|
-
this.container = t.root, this.container.classList.add("axon-game-root"), this.i18n = new
|
|
3517
|
+
this.container = t.root, this.container.classList.add("axon-game-root"), this.i18n = new z(t.language), this.themeManager = new lt(t.theme, this.container), this.platform = t.platform || new yt(), 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 V(), this.core = new F(this.canvas.width / 2, this.canvas.height / 2), this.inputManager = new Y(this.canvas), this.physicsEngine = new ot(this.eventBus, this.i18n), this.waveDirector = new rt(), this.renderer = new pt(this.canvas, this.themeManager), this.juice = new J(), this.settingsModal = new _t(
|
|
3393
3518
|
this.container,
|
|
3394
3519
|
this.i18n,
|
|
3395
3520
|
this.themeManager,
|
|
@@ -3398,11 +3523,11 @@ class It {
|
|
|
3398
3523
|
() => {
|
|
3399
3524
|
this.isPaused = !1;
|
|
3400
3525
|
}
|
|
3401
|
-
), this.interactiveTutorial = new
|
|
3526
|
+
), this.interactiveTutorial = new mt(), this.tutorialOverlay = new ft(this.container, this.i18n, this.interactiveTutorial), this.hud = new dt(this.container, this.i18n, () => {
|
|
3402
3527
|
this.isPaused = !0, this.settingsModal.show();
|
|
3403
|
-
}), this.hud.show(), this.progressBar = new
|
|
3528
|
+
}), this.hud.show(), this.progressBar = new xt(this.hud.progressSlot, (e) => {
|
|
3404
3529
|
this.waveDirector.wave = e, this.triggerLevelUp(e);
|
|
3405
|
-
}), this.startMenu = new
|
|
3530
|
+
}), this.startMenu = new gt(this.container, this.i18n, () => this.startGame()), this.initAmbientArena(), this.gameLoop = new W(
|
|
3406
3531
|
(e) => this.update(e),
|
|
3407
3532
|
() => this.render()
|
|
3408
3533
|
), this.setupEvents(), this.gameLoop.start();
|
|
@@ -3426,12 +3551,12 @@ class It {
|
|
|
3426
3551
|
this.ambientEnemies = [];
|
|
3427
3552
|
const t = ["piercer", "spore", "cluster", "parasite"];
|
|
3428
3553
|
for (let e = 0; e < 16; e++) {
|
|
3429
|
-
const i = t[e % t.length], s = e * Math.PI * 2 / 16, a = 180 + Math.random() * 220,
|
|
3554
|
+
const i = t[e % t.length], s = e * Math.PI * 2 / 16, a = 180 + Math.random() * 220, c = {
|
|
3430
3555
|
x: this.canvas.width / 2 + Math.cos(s) * a,
|
|
3431
3556
|
y: this.canvas.height / 2 + Math.sin(s) * a
|
|
3432
|
-
}, n =
|
|
3433
|
-
x:
|
|
3434
|
-
y:
|
|
3557
|
+
}, n = M.createEnemy(i, c, {
|
|
3558
|
+
x: c.x + Math.sin(s) * 100,
|
|
3559
|
+
y: c.y - Math.cos(s) * 100
|
|
3435
3560
|
});
|
|
3436
3561
|
this.ambientEnemies.push(n);
|
|
3437
3562
|
}
|
|
@@ -3460,7 +3585,7 @@ class It {
|
|
|
3460
3585
|
}), this.canvas.addEventListener("touchstart", () => t(!0), { passive: !0 }), this.canvas.addEventListener("touchend", e, { passive: !0 }), this.canvas.addEventListener("touchcancel", e, { passive: !0 });
|
|
3461
3586
|
}
|
|
3462
3587
|
startGame() {
|
|
3463
|
-
this.score.value = 0, this.combo.value = 0, this.enemies = [], this.ambientEnemies = [], this.pools = [], this.vortices = [], this.shockwaves = [], this.particles = [], this.floatingTexts = [], 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());
|
|
3588
|
+
E.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.orbitingOrbs = [], this.isLevelUpActive = !1, this.hasRerolledThisLevel = !1, 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());
|
|
3464
3589
|
}
|
|
3465
3590
|
update(t) {
|
|
3466
3591
|
if (this.core.update(t), !this.isRunning || this.isPaused) {
|
|
@@ -3499,16 +3624,16 @@ class It {
|
|
|
3499
3624
|
Math.hypot(i.x - s, i.y - a) <= 80 && (this.triggerReroll(), this.inputManager.isPointerDown = !1);
|
|
3500
3625
|
}
|
|
3501
3626
|
for (const s of this.orbitingOrbs) {
|
|
3502
|
-
const a = i.x - s.position.x,
|
|
3503
|
-
if (s.isHovered = Math.hypot(a,
|
|
3627
|
+
const a = i.x - s.position.x, c = i.y - s.position.y;
|
|
3628
|
+
if (s.isHovered = Math.hypot(a, c) <= s.radius * 1.5, s === e && this.inputManager.isPointerDown) {
|
|
3504
3629
|
s.position = { ...this.inputManager.pointerPosition };
|
|
3505
3630
|
const n = this.core.position.x - s.position.x, o = this.core.position.y - s.position.y;
|
|
3506
3631
|
if (Math.hypot(n, o) <= this.core.radius + s.radius) {
|
|
3507
3632
|
s.definition.apply(this.core), this.core.absorbPowerUpColor(s.definition.color, 0.4), this.juice.triggerFlash(0.8), this.juice.triggerScreenShake({ x: n, y: o }, 24);
|
|
3508
|
-
const
|
|
3633
|
+
const l = this.i18n.translate(s.definition.titleKey);
|
|
3509
3634
|
this.floatingTexts.push({
|
|
3510
3635
|
id: Math.random().toString(),
|
|
3511
|
-
text: `+ ${
|
|
3636
|
+
text: `+ ${l}`,
|
|
3512
3637
|
position: { ...this.core.position },
|
|
3513
3638
|
velocity: { x: 0, y: -80 },
|
|
3514
3639
|
color: s.definition.color,
|
|
@@ -3571,11 +3696,11 @@ class It {
|
|
|
3571
3696
|
if (i.active) {
|
|
3572
3697
|
i.triggerDissolveDeath();
|
|
3573
3698
|
for (let s = 0; s < 6; s++) {
|
|
3574
|
-
const a = Math.random() * Math.PI * 2,
|
|
3699
|
+
const a = Math.random() * Math.PI * 2, c = 100 + Math.random() * 200;
|
|
3575
3700
|
this.particles.push({
|
|
3576
3701
|
id: Math.random().toString(),
|
|
3577
3702
|
position: { ...i.position },
|
|
3578
|
-
velocity: { x: Math.cos(a) *
|
|
3703
|
+
velocity: { x: Math.cos(a) * c, y: Math.sin(a) * c },
|
|
3579
3704
|
color: "#00f0ff",
|
|
3580
3705
|
radius: 3 + Math.random() * 3,
|
|
3581
3706
|
alpha: 1,
|
|
@@ -3604,19 +3729,19 @@ class It {
|
|
|
3604
3729
|
maxLifetime: 2,
|
|
3605
3730
|
size: 30
|
|
3606
3731
|
});
|
|
3607
|
-
const e =
|
|
3732
|
+
const e = B.getRandomOptions(3);
|
|
3608
3733
|
this.orbitingOrbs = e.map((i, s) => {
|
|
3609
3734
|
const a = s * Math.PI * 2 / e.length;
|
|
3610
|
-
return new
|
|
3735
|
+
return new G(`orb_${Date.now()}_${s}`, i, a);
|
|
3611
3736
|
}), this.hasRerolledThisLevel = !1;
|
|
3612
3737
|
}
|
|
3613
3738
|
triggerReroll() {
|
|
3614
3739
|
if (this.hasRerolledThisLevel) return;
|
|
3615
3740
|
this.hasRerolledThisLevel = !0, this.juice.triggerFlash(0.4);
|
|
3616
|
-
const t =
|
|
3741
|
+
const t = B.getRandomOptions(3);
|
|
3617
3742
|
this.orbitingOrbs = t.map((e, i) => {
|
|
3618
3743
|
const s = i * Math.PI * 2 / t.length;
|
|
3619
|
-
return new
|
|
3744
|
+
return new G(`orb_${Date.now()}_${i}`, e, s);
|
|
3620
3745
|
});
|
|
3621
3746
|
}
|
|
3622
3747
|
render() {
|
|
@@ -3640,14 +3765,14 @@ class It {
|
|
|
3640
3765
|
this.gameLoop.stop(), this.canvas.remove();
|
|
3641
3766
|
}
|
|
3642
3767
|
}
|
|
3643
|
-
function
|
|
3644
|
-
return new
|
|
3768
|
+
function At(y) {
|
|
3769
|
+
return new Et(y);
|
|
3645
3770
|
}
|
|
3646
3771
|
export {
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3772
|
+
yt as BrowserPlatform,
|
|
3773
|
+
Et as GameEngine,
|
|
3774
|
+
K as LANGUAGES,
|
|
3775
|
+
lt as ThemeManager,
|
|
3776
|
+
At as createAxonSurge,
|
|
3777
|
+
P as isLanguage
|
|
3653
3778
|
};
|