@gamebob/axon-surge 0.7.0 → 0.9.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 +372 -323
- package/dist/core/GameEngine.d.ts +3 -0
- package/dist/core/GameEngine.d.ts.map +1 -1
- package/dist/i18n/I18nService.d.ts.map +1 -1
- package/dist/render/CosmosBackgroundRenderer.d.ts +1 -1
- package/dist/render/CosmosBackgroundRenderer.d.ts.map +1 -1
- package/dist/theme/ThemeManager.d.ts +1 -0
- package/dist/theme/ThemeManager.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/axon-surge.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class 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 B {
|
|
|
15
15
|
this.listeners.clear();
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
class
|
|
18
|
+
class F {
|
|
19
19
|
animationFrameId = null;
|
|
20
20
|
lastTime = 0;
|
|
21
21
|
isRunning = !1;
|
|
@@ -36,7 +36,7 @@ class H {
|
|
|
36
36
|
this.lastTime = t, this.updateCallback(e), this.renderCallback(), this.animationFrameId = requestAnimationFrame(this.tick);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
class
|
|
39
|
+
class Y {
|
|
40
40
|
position;
|
|
41
41
|
radius = 32;
|
|
42
42
|
integrity = 3;
|
|
@@ -60,7 +60,7 @@ class K {
|
|
|
60
60
|
this.position = { x: t, y: e }, this.integrity = this.maxIntegrity, this.pulsePhase = 0;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
class
|
|
63
|
+
class U {
|
|
64
64
|
id;
|
|
65
65
|
position = { x: 0, y: 0 };
|
|
66
66
|
velocity = { x: 0, y: 0 };
|
|
@@ -114,7 +114,7 @@ class O {
|
|
|
114
114
|
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.position = { x: 0, y: 0 }, this.velocity = { x: 0, y: 0 }, this.rotation = 0, this.strategy = null, this.maxSpeed = 200;
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
class
|
|
117
|
+
class J {
|
|
118
118
|
pointerPosition = { x: 0, y: 0 };
|
|
119
119
|
isPointerDown = !1;
|
|
120
120
|
grabbedEnemy = null;
|
|
@@ -134,8 +134,8 @@ class W {
|
|
|
134
134
|
y: this.pointerPosition.y,
|
|
135
135
|
time: l
|
|
136
136
|
});
|
|
137
|
-
const
|
|
138
|
-
this.pointerHistory = this.pointerHistory.filter((n) => n.time >=
|
|
137
|
+
const o = l - 0.08;
|
|
138
|
+
this.pointerHistory = this.pointerHistory.filter((n) => n.time >= o), this.grabbedEnemy && (this.grabbedEnemy.position = { ...this.pointerPosition });
|
|
139
139
|
}
|
|
140
140
|
bindEvents() {
|
|
141
141
|
this.canvas.addEventListener("mousemove", (t) => {
|
|
@@ -188,20 +188,20 @@ class W {
|
|
|
188
188
|
const i = performance.now() / 1e3 - 0.08, s = this.pointerHistory.filter((n) => n.time >= i);
|
|
189
189
|
let a = 0, l = 0;
|
|
190
190
|
if (s.length >= 2) {
|
|
191
|
-
const n = s[0],
|
|
192
|
-
a = (
|
|
191
|
+
const n = s[0], r = s[s.length - 1], h = Math.max(0.01, r.time - n.time);
|
|
192
|
+
a = (r.x - n.x) / h, l = (r.y - n.y) / h;
|
|
193
193
|
}
|
|
194
|
-
const
|
|
195
|
-
if (
|
|
196
|
-
const
|
|
194
|
+
const o = Math.hypot(a, l);
|
|
195
|
+
if (o > 30) {
|
|
196
|
+
const r = Math.min(o * 1.15, 2500), h = Math.atan2(l, a);
|
|
197
197
|
t.velocity = {
|
|
198
|
-
x: Math.cos(h) *
|
|
199
|
-
y: Math.sin(h) *
|
|
198
|
+
x: Math.cos(h) * r,
|
|
199
|
+
y: Math.sin(h) * r
|
|
200
200
|
};
|
|
201
201
|
} else if (this.dragStart) {
|
|
202
|
-
const n = t.position.x - this.dragStart.x,
|
|
202
|
+
const n = t.position.x - this.dragStart.x, r = t.position.y - this.dragStart.y, h = Math.hypot(n, r);
|
|
203
203
|
if (h > 5) {
|
|
204
|
-
const c = Math.atan2(
|
|
204
|
+
const c = Math.atan2(r, n), u = Math.min(h * 4, 600);
|
|
205
205
|
t.velocity = {
|
|
206
206
|
x: Math.cos(c) * u,
|
|
207
207
|
y: Math.sin(c) * u
|
|
@@ -218,7 +218,7 @@ class W {
|
|
|
218
218
|
this.grabbedEnemy = null, this.dragStart = null, this.pointerHistory = [], this.isPointerDown = !1;
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
-
class
|
|
221
|
+
class Z {
|
|
222
222
|
cellSize;
|
|
223
223
|
grid = /* @__PURE__ */ new Map();
|
|
224
224
|
constructor(t = 100) {
|
|
@@ -230,22 +230,22 @@ class V {
|
|
|
230
230
|
insert(t) {
|
|
231
231
|
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);
|
|
232
232
|
for (let l = e; l <= i; l++)
|
|
233
|
-
for (let
|
|
234
|
-
const n = `${l}:${
|
|
233
|
+
for (let o = s; o <= a; o++) {
|
|
234
|
+
const n = `${l}:${o}`;
|
|
235
235
|
this.grid.has(n) || this.grid.set(n, /* @__PURE__ */ new Set()), this.grid.get(n).add(t);
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
getNearby(t, e) {
|
|
239
|
-
const i = /* @__PURE__ */ new Set(), s = Math.floor((t.x - e) / this.cellSize), a = Math.floor((t.x + e) / this.cellSize), l = Math.floor((t.y - e) / this.cellSize),
|
|
239
|
+
const i = /* @__PURE__ */ new Set(), s = Math.floor((t.x - e) / this.cellSize), a = Math.floor((t.x + e) / this.cellSize), l = Math.floor((t.y - e) / this.cellSize), o = Math.floor((t.y + e) / this.cellSize);
|
|
240
240
|
for (let n = s; n <= a; n++)
|
|
241
|
-
for (let
|
|
242
|
-
const h = `${n}:${
|
|
241
|
+
for (let r = l; r <= o; r++) {
|
|
242
|
+
const h = `${n}:${r}`, c = this.grid.get(h);
|
|
243
243
|
c && c.forEach((u) => i.add(u));
|
|
244
244
|
}
|
|
245
245
|
return i;
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
class
|
|
248
|
+
class X {
|
|
249
249
|
hitstopTime = 0;
|
|
250
250
|
shakeTime = 0;
|
|
251
251
|
shakeDuration = 0.14;
|
|
@@ -285,7 +285,7 @@ class F {
|
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
|
-
const
|
|
288
|
+
const N = {
|
|
289
289
|
es: {
|
|
290
290
|
title: "AXON SURGE",
|
|
291
291
|
startButton: "INICIAR ENLACE",
|
|
@@ -631,7 +631,7 @@ const w = {
|
|
|
631
631
|
tutorialStep2Text: "步骤 2: 朝目标快速挥动抛投",
|
|
632
632
|
tutorialDragWarning: "最佳策略是快速挥动抛投!"
|
|
633
633
|
}
|
|
634
|
-
},
|
|
634
|
+
}, K = [
|
|
635
635
|
"es",
|
|
636
636
|
"en",
|
|
637
637
|
"fr",
|
|
@@ -648,29 +648,29 @@ const w = {
|
|
|
648
648
|
"ko",
|
|
649
649
|
"zh"
|
|
650
650
|
];
|
|
651
|
-
function
|
|
652
|
-
return
|
|
651
|
+
function P(T) {
|
|
652
|
+
return K.includes(T);
|
|
653
653
|
}
|
|
654
|
-
const
|
|
655
|
-
class
|
|
654
|
+
const H = "axon_surge_language";
|
|
655
|
+
class $ {
|
|
656
656
|
currentLanguage;
|
|
657
657
|
constructor(t) {
|
|
658
658
|
this.currentLanguage = this.detectLanguage(t);
|
|
659
659
|
}
|
|
660
660
|
detectLanguage(t) {
|
|
661
661
|
try {
|
|
662
|
-
const e = localStorage.getItem(
|
|
663
|
-
if (e &&
|
|
662
|
+
const e = localStorage.getItem(H);
|
|
663
|
+
if (e && P(e))
|
|
664
664
|
return e;
|
|
665
665
|
} catch {
|
|
666
666
|
}
|
|
667
|
-
if (t &&
|
|
667
|
+
if (t && P(t))
|
|
668
668
|
return t;
|
|
669
669
|
try {
|
|
670
|
-
const e = (document.documentElement.lang || document.body?.getAttribute("lang") || "").toLowerCase();
|
|
670
|
+
const e = (document.documentElement.lang || document.body?.getAttribute("lang") || document.documentElement.getAttribute("data-lang") || "").toLowerCase();
|
|
671
671
|
if (e) {
|
|
672
672
|
const i = e.split("-")[0];
|
|
673
|
-
if (i &&
|
|
673
|
+
if (i && P(i))
|
|
674
674
|
return i;
|
|
675
675
|
}
|
|
676
676
|
} catch {
|
|
@@ -679,7 +679,7 @@ class Y {
|
|
|
679
679
|
const e = (navigator.language || navigator.languages && navigator.languages[0] || "").toLowerCase();
|
|
680
680
|
if (e) {
|
|
681
681
|
const i = e.split("-")[0];
|
|
682
|
-
if (i &&
|
|
682
|
+
if (i && P(i))
|
|
683
683
|
return i;
|
|
684
684
|
}
|
|
685
685
|
} catch {
|
|
@@ -687,10 +687,10 @@ class Y {
|
|
|
687
687
|
return "en";
|
|
688
688
|
}
|
|
689
689
|
setLanguage(t) {
|
|
690
|
-
if (
|
|
690
|
+
if (N[t]) {
|
|
691
691
|
this.currentLanguage = t;
|
|
692
692
|
try {
|
|
693
|
-
localStorage.setItem(
|
|
693
|
+
localStorage.setItem(H, t);
|
|
694
694
|
} catch {
|
|
695
695
|
}
|
|
696
696
|
}
|
|
@@ -699,13 +699,13 @@ class Y {
|
|
|
699
699
|
return this.currentLanguage;
|
|
700
700
|
}
|
|
701
701
|
translate(t, e) {
|
|
702
|
-
let s = (
|
|
702
|
+
let s = (N[this.currentLanguage] || N.en)[t] || N.en[t] || String(t);
|
|
703
703
|
return e && Object.entries(e).forEach(([a, l]) => {
|
|
704
704
|
s = s.replace(`{${a}}`, String(l));
|
|
705
705
|
}), s;
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
|
-
class
|
|
708
|
+
class z {
|
|
709
709
|
execute(t) {
|
|
710
710
|
const { thrownEnemy: e, targetEnemy: i, shockwaves: s, particles: a, floatingTexts: l } = t;
|
|
711
711
|
i.active = !1, s.push({
|
|
@@ -718,12 +718,12 @@ class J {
|
|
|
718
718
|
lifetime: 0,
|
|
719
719
|
maxLifetime: 0.5
|
|
720
720
|
});
|
|
721
|
-
for (let
|
|
722
|
-
const n = Math.random() * Math.PI * 2,
|
|
721
|
+
for (let o = 0; o < 30; o++) {
|
|
722
|
+
const n = Math.random() * Math.PI * 2, r = 180 + Math.random() * 320;
|
|
723
723
|
a.push({
|
|
724
724
|
id: Math.random().toString(),
|
|
725
725
|
position: { ...i.position },
|
|
726
|
-
velocity: { x: Math.cos(n) *
|
|
726
|
+
velocity: { x: Math.cos(n) * r, y: Math.sin(n) * r },
|
|
727
727
|
color: "#ff2a5f",
|
|
728
728
|
radius: 3 + Math.random() * 4,
|
|
729
729
|
alpha: 1,
|
|
@@ -744,9 +744,9 @@ class J {
|
|
|
744
744
|
});
|
|
745
745
|
}
|
|
746
746
|
}
|
|
747
|
-
class
|
|
747
|
+
class _ {
|
|
748
748
|
execute(t) {
|
|
749
|
-
const { thrownEnemy: e, pools: i, shockwaves: s, particles: a, floatingTexts: l, eventBus:
|
|
749
|
+
const { thrownEnemy: e, pools: i, shockwaves: s, particles: a, floatingTexts: l, eventBus: o } = t, n = e.position;
|
|
750
750
|
i.push({
|
|
751
751
|
id: Math.random().toString(),
|
|
752
752
|
position: { ...n },
|
|
@@ -764,7 +764,7 @@ class Z {
|
|
|
764
764
|
lifetime: 0,
|
|
765
765
|
maxLifetime: 0.6
|
|
766
766
|
});
|
|
767
|
-
for (let
|
|
767
|
+
for (let r = 0; r < 45; r++) {
|
|
768
768
|
const h = Math.random() * Math.PI * 2, c = 120 + Math.random() * 260;
|
|
769
769
|
a.push({
|
|
770
770
|
id: Math.random().toString(),
|
|
@@ -787,12 +787,12 @@ class Z {
|
|
|
787
787
|
lifetime: 0,
|
|
788
788
|
maxLifetime: 1.2,
|
|
789
789
|
size: 26
|
|
790
|
-
}), e.active = !1,
|
|
790
|
+
}), e.active = !1, o.emit("onPoolCreated", { position: n });
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
|
-
class
|
|
793
|
+
class q {
|
|
794
794
|
execute(t) {
|
|
795
|
-
const { thrownEnemy: e, targetEnemy: i, allEnemies: s, shockwaves: a, particles: l, floatingTexts:
|
|
795
|
+
const { thrownEnemy: e, targetEnemy: i, allEnemies: s, shockwaves: a, particles: l, floatingTexts: o } = t, n = i.position;
|
|
796
796
|
e.active = !1, i.active = !1, a.push({
|
|
797
797
|
id: Math.random().toString(),
|
|
798
798
|
position: { ...n },
|
|
@@ -803,17 +803,17 @@ class X {
|
|
|
803
803
|
lifetime: 0,
|
|
804
804
|
maxLifetime: 0.6
|
|
805
805
|
});
|
|
806
|
-
for (let
|
|
807
|
-
const h =
|
|
806
|
+
for (let r = 0; r < 6; r++) {
|
|
807
|
+
const h = r * Math.PI * 2 / 6, c = {
|
|
808
808
|
x: n.x + Math.cos(h) * 15,
|
|
809
809
|
y: n.y + Math.sin(h) * 15
|
|
810
|
-
}, u =
|
|
810
|
+
}, u = L.createEnemy("micro", c, {
|
|
811
811
|
x: c.x + Math.cos(h) * 200,
|
|
812
812
|
y: c.y + Math.sin(h) * 200
|
|
813
813
|
});
|
|
814
814
|
u.isThrown = !0, s.push(u);
|
|
815
815
|
}
|
|
816
|
-
for (let
|
|
816
|
+
for (let r = 0; r < 35; r++) {
|
|
817
817
|
const h = Math.random() * Math.PI * 2, c = 200 + Math.random() * 300;
|
|
818
818
|
l.push({
|
|
819
819
|
id: Math.random().toString(),
|
|
@@ -826,7 +826,7 @@ class X {
|
|
|
826
826
|
maxLifetime: 0.6
|
|
827
827
|
});
|
|
828
828
|
}
|
|
829
|
-
|
|
829
|
+
o.push({
|
|
830
830
|
id: Math.random().toString(),
|
|
831
831
|
text: "CLUSTER DETONATION",
|
|
832
832
|
position: { ...n },
|
|
@@ -839,7 +839,7 @@ class X {
|
|
|
839
839
|
});
|
|
840
840
|
}
|
|
841
841
|
}
|
|
842
|
-
class
|
|
842
|
+
class j {
|
|
843
843
|
execute(t) {
|
|
844
844
|
const { thrownEnemy: e, targetEnemy: i, vortices: s, shockwaves: a } = t, l = {
|
|
845
845
|
x: (e.position.x + i.position.x) / 2,
|
|
@@ -864,31 +864,31 @@ class $ {
|
|
|
864
864
|
}), e.triggerDissolveDeath(), i.triggerDissolveDeath();
|
|
865
865
|
}
|
|
866
866
|
}
|
|
867
|
-
class
|
|
867
|
+
class L {
|
|
868
868
|
static createEnemy(t, e, i) {
|
|
869
|
-
const s = `enemy_${Date.now()}_${Math.random()}`, a = new
|
|
869
|
+
const s = `enemy_${Date.now()}_${Math.random()}`, a = new U(s);
|
|
870
870
|
return this.configureEnemy(a, t, e, i), a;
|
|
871
871
|
}
|
|
872
872
|
static configureEnemy(t, e, i, s) {
|
|
873
873
|
t.type = e, t.position = { ...i }, t.active = !0, t.isGrabbed = !1, t.isThrown = !1;
|
|
874
|
-
const a = s.x - i.x, l = s.y - i.y,
|
|
875
|
-
let n = 70,
|
|
876
|
-
e === "piercer" ? (n = 95,
|
|
877
|
-
x: Math.cos(
|
|
878
|
-
y: Math.sin(
|
|
874
|
+
const a = s.x - i.x, l = s.y - i.y, o = Math.atan2(l, a);
|
|
875
|
+
let n = 70, r = 100, h = 20, c = "#ff2a5f", u = null;
|
|
876
|
+
e === "piercer" ? (n = 95, r = 140, h = 18, c = "#ff2a5f", u = new z()) : e === "spore" ? (n = 65, r = 90, h = 24, c = "#39ff14", u = new _()) : e === "cluster" ? (n = 50, r = 75, h = 26, c = "#ffd700", u = new q()) : e === "parasite" ? (n = 80, r = 110, h = 22, c = "#9d4edd", u = new j()) : e === "micro" && (n = 130, r = 160, h = 12, c = "#ffd700"), t.radius = h, t.color = c, t.strategy = u, t.maxSpeed = r, t.velocity = {
|
|
877
|
+
x: Math.cos(o) * n,
|
|
878
|
+
y: Math.sin(o) * n
|
|
879
879
|
};
|
|
880
880
|
}
|
|
881
881
|
}
|
|
882
|
-
class
|
|
882
|
+
class Q {
|
|
883
883
|
spatialHash;
|
|
884
884
|
eventBus;
|
|
885
885
|
i18n;
|
|
886
886
|
currentThrowKills = 0;
|
|
887
887
|
currentThrowPos = null;
|
|
888
888
|
constructor(t, e) {
|
|
889
|
-
this.spatialHash = new
|
|
889
|
+
this.spatialHash = new Z(100), this.eventBus = t, this.i18n = e;
|
|
890
890
|
}
|
|
891
|
-
update(t, e, i, s, a, l,
|
|
891
|
+
update(t, e, i, s, a, l, o, n, r, h, c, u, p, f) {
|
|
892
892
|
this.spatialHash.clear();
|
|
893
893
|
for (const d of i)
|
|
894
894
|
d.active && !d.isDying ? (d.update(t), this.spatialHash.insert(d)) : d.active && d.isDying && d.update(t);
|
|
@@ -905,10 +905,10 @@ class z {
|
|
|
905
905
|
m.duration += t;
|
|
906
906
|
for (const x of i) {
|
|
907
907
|
if (!x.active || x.isGrabbed || x.isDying || x.isThrown && x.type === "piercer") continue;
|
|
908
|
-
const
|
|
908
|
+
const S = m.position.x - x.position.x, v = m.position.y - x.position.y, b = Math.hypot(S, v);
|
|
909
909
|
if (b > 2 && b <= m.radius) {
|
|
910
|
-
const M = Math.pow(1 - b / m.radius, 0.7),
|
|
911
|
-
x.velocity.x += Math.cos(g) *
|
|
910
|
+
const M = Math.pow(1 - b / m.radius, 0.7), E = m.pullForce * M, g = Math.atan2(v, S);
|
|
911
|
+
x.velocity.x += Math.cos(g) * E * t, x.velocity.y += Math.sin(g) * E * t, x.position.x += Math.cos(g) * E * t * 0.8, x.position.y += Math.sin(g) * E * t * 0.8;
|
|
912
912
|
}
|
|
913
913
|
}
|
|
914
914
|
m.duration >= m.maxDuration && a.splice(d, 1);
|
|
@@ -919,7 +919,7 @@ class z {
|
|
|
919
919
|
const m = e.position.x - d.position.x, x = e.position.y - d.position.y;
|
|
920
920
|
if (Math.hypot(m, x) <= e.radius + d.radius) {
|
|
921
921
|
d.active = !1;
|
|
922
|
-
const
|
|
922
|
+
const v = e.takeDamage();
|
|
923
923
|
this.eventBus.emit("onCoreDamaged", { currentIntegrity: e.integrity }), l.push({
|
|
924
924
|
id: Math.random().toString(),
|
|
925
925
|
position: { ...e.position },
|
|
@@ -929,16 +929,16 @@ class z {
|
|
|
929
929
|
alpha: 1,
|
|
930
930
|
lifetime: 0,
|
|
931
931
|
maxLifetime: 0.8
|
|
932
|
-
}),
|
|
932
|
+
}), r.triggerScreenShake({ x: m, y: x }, 25), r.triggerHitstop(0.15), r.triggerFlash(0.6);
|
|
933
933
|
for (const b of i)
|
|
934
934
|
if (b.active && !b.isGrabbed) {
|
|
935
935
|
b.triggerDissolveDeath();
|
|
936
936
|
for (let M = 0; M < 8; M++) {
|
|
937
|
-
const
|
|
938
|
-
|
|
937
|
+
const E = Math.random() * Math.PI * 2, g = 100 + Math.random() * 200;
|
|
938
|
+
o.push({
|
|
939
939
|
id: Math.random().toString(),
|
|
940
940
|
position: { ...b.position },
|
|
941
|
-
velocity: { x: Math.cos(
|
|
941
|
+
velocity: { x: Math.cos(E) * g, y: Math.sin(E) * g },
|
|
942
942
|
color: "#00f0ff",
|
|
943
943
|
radius: 3 + Math.random() * 3,
|
|
944
944
|
alpha: 1,
|
|
@@ -957,25 +957,25 @@ class z {
|
|
|
957
957
|
lifetime: 0,
|
|
958
958
|
maxLifetime: 1.5,
|
|
959
959
|
size: 32
|
|
960
|
-
}), (!
|
|
960
|
+
}), (!v || e.integrity <= 0) && this.eventBus.emit("onGameOver", { score: c.value, wave: 1 });
|
|
961
961
|
break;
|
|
962
962
|
}
|
|
963
963
|
}
|
|
964
|
-
let
|
|
964
|
+
let y = !1;
|
|
965
965
|
for (const d of i)
|
|
966
966
|
if (!(!d.active || !d.isThrown || d.isDying)) {
|
|
967
|
-
if (
|
|
967
|
+
if (y = !0, d.position.x < -120 || d.position.x > u + 120 || d.position.y < -120 || d.position.y > p + 120) {
|
|
968
968
|
d.active = !1, d.isThrown = !1;
|
|
969
969
|
continue;
|
|
970
970
|
}
|
|
971
971
|
for (const m of i) {
|
|
972
972
|
if (m === d || !m.active || m.isGrabbed || m.isDying) continue;
|
|
973
|
-
const x = m.position.x - d.position.x,
|
|
974
|
-
if (Math.hypot(x,
|
|
973
|
+
const x = m.position.x - d.position.x, S = m.position.y - d.position.y;
|
|
974
|
+
if (Math.hypot(x, S) <= d.getHitRadius() + m.getHitRadius()) {
|
|
975
975
|
this.currentThrowPos = { x: d.position.x, y: d.position.y };
|
|
976
976
|
const b = Math.atan2(d.velocity.y, d.velocity.x);
|
|
977
977
|
if (d.type === "piercer") {
|
|
978
|
-
this.currentThrowKills++, this.killEnemyWithChainReaction(m, b, s, a, l,
|
|
978
|
+
this.currentThrowKills++, this.killEnemyWithChainReaction(m, b, s, a, l, o, i), r.triggerHitstop(0.05), r.triggerScreenShake({ x, y: S }, 7), l.push({
|
|
979
979
|
id: Math.random().toString(),
|
|
980
980
|
position: { ...m.position },
|
|
981
981
|
radius: 10,
|
|
@@ -986,11 +986,11 @@ class z {
|
|
|
986
986
|
maxLifetime: 0.45
|
|
987
987
|
});
|
|
988
988
|
for (let M = 0; M < 16; M++) {
|
|
989
|
-
const
|
|
990
|
-
|
|
989
|
+
const E = Math.random() * Math.PI * 2, g = 150 + Math.random() * 300;
|
|
990
|
+
o.push({
|
|
991
991
|
id: Math.random().toString(),
|
|
992
992
|
position: { ...m.position },
|
|
993
|
-
velocity: { x: Math.cos(
|
|
993
|
+
velocity: { x: Math.cos(E) * g, y: Math.sin(E) * g },
|
|
994
994
|
color: "#ff2a5f",
|
|
995
995
|
radius: 3 + Math.random() * 3,
|
|
996
996
|
alpha: 1,
|
|
@@ -1000,23 +1000,23 @@ class z {
|
|
|
1000
1000
|
}
|
|
1001
1001
|
f && f();
|
|
1002
1002
|
} else {
|
|
1003
|
-
const M = d.type === m.type,
|
|
1003
|
+
const M = d.type === m.type, E = M ? 360 : 250;
|
|
1004
1004
|
l.push({
|
|
1005
1005
|
id: Math.random().toString(),
|
|
1006
1006
|
position: { ...this.currentThrowPos },
|
|
1007
1007
|
radius: 15,
|
|
1008
|
-
maxRadius:
|
|
1008
|
+
maxRadius: E,
|
|
1009
1009
|
color: d.color,
|
|
1010
1010
|
alpha: 1,
|
|
1011
1011
|
lifetime: 0,
|
|
1012
1012
|
maxLifetime: 0.55
|
|
1013
1013
|
});
|
|
1014
1014
|
for (let g = 0; g < 45; g++) {
|
|
1015
|
-
const
|
|
1016
|
-
|
|
1015
|
+
const A = Math.random() * Math.PI * 2, I = 200 + Math.random() * 450;
|
|
1016
|
+
o.push({
|
|
1017
1017
|
id: Math.random().toString(),
|
|
1018
1018
|
position: { ...this.currentThrowPos },
|
|
1019
|
-
velocity: { x: Math.cos(
|
|
1019
|
+
velocity: { x: Math.cos(A) * I, y: Math.sin(A) * I },
|
|
1020
1020
|
color: d.color,
|
|
1021
1021
|
radius: 4 + Math.random() * 6,
|
|
1022
1022
|
alpha: 1,
|
|
@@ -1025,7 +1025,7 @@ class z {
|
|
|
1025
1025
|
});
|
|
1026
1026
|
}
|
|
1027
1027
|
if (M) {
|
|
1028
|
-
if (this.currentThrowKills += 2,
|
|
1028
|
+
if (this.currentThrowKills += 2, r.triggerHitstop(0.14), r.triggerFlash(0.5), r.triggerScreenShake({ x, y: S }, 16), n.push({
|
|
1029
1029
|
id: Math.random().toString(),
|
|
1030
1030
|
text: "COLOR SYNERGY!",
|
|
1031
1031
|
position: { ...this.currentThrowPos },
|
|
@@ -1055,22 +1055,22 @@ class z {
|
|
|
1055
1055
|
});
|
|
1056
1056
|
else if (d.type === "cluster")
|
|
1057
1057
|
for (let g = 0; g < 8; g++) {
|
|
1058
|
-
const
|
|
1059
|
-
x: this.currentThrowPos.x + Math.cos(
|
|
1060
|
-
y: this.currentThrowPos.y + Math.sin(
|
|
1061
|
-
},
|
|
1062
|
-
x:
|
|
1063
|
-
y:
|
|
1058
|
+
const A = g * Math.PI * 2 / 8, I = {
|
|
1059
|
+
x: this.currentThrowPos.x + Math.cos(A) * 15,
|
|
1060
|
+
y: this.currentThrowPos.y + Math.sin(A) * 15
|
|
1061
|
+
}, C = L.createEnemy("micro", I, {
|
|
1062
|
+
x: I.x + Math.cos(A) * 220,
|
|
1063
|
+
y: I.y + Math.sin(A) * 220
|
|
1064
1064
|
});
|
|
1065
|
-
|
|
1065
|
+
C.isThrown = !0, i.push(C);
|
|
1066
1066
|
}
|
|
1067
|
-
this.killEnemyWithChainReaction(d, b, s, a, l,
|
|
1067
|
+
this.killEnemyWithChainReaction(d, b, s, a, l, o, i), this.killEnemyWithChainReaction(m, b, s, a, l, o, i);
|
|
1068
1068
|
} else
|
|
1069
|
-
this.currentThrowKills += 2,
|
|
1069
|
+
this.currentThrowKills += 2, r.triggerHitstop(0.08), r.triggerFlash(0.35), r.triggerScreenShake({ x, y: S }, 10), this.killEnemyWithChainReaction(d, b, s, a, l, o, i), this.killEnemyWithChainReaction(m, b, s, a, l, o, i);
|
|
1070
1070
|
for (const g of i) {
|
|
1071
1071
|
if (g === d || g === m || !g.active || g.isGrabbed || g.isDying) continue;
|
|
1072
|
-
const
|
|
1073
|
-
Math.hypot(
|
|
1072
|
+
const A = g.position.x - this.currentThrowPos.x, I = g.position.y - this.currentThrowPos.y;
|
|
1073
|
+
Math.hypot(A, I) <= E && (this.killEnemyWithChainReaction(g, b, s, a, l, o, i), this.currentThrowKills++);
|
|
1074
1074
|
}
|
|
1075
1075
|
f && f();
|
|
1076
1076
|
break;
|
|
@@ -1078,7 +1078,7 @@ class z {
|
|
|
1078
1078
|
}
|
|
1079
1079
|
}
|
|
1080
1080
|
}
|
|
1081
|
-
h.value = this.currentThrowKills, !
|
|
1081
|
+
h.value = this.currentThrowKills, !y && this.currentThrowKills > 0 && (this.currentThrowKills >= 2 && this.currentThrowPos && n.push({
|
|
1082
1082
|
id: Math.random().toString(),
|
|
1083
1083
|
text: `MULTIKILL x${this.currentThrowKills}!`,
|
|
1084
1084
|
position: { ...this.currentThrowPos },
|
|
@@ -1095,14 +1095,14 @@ class z {
|
|
|
1095
1095
|
m.duration += t;
|
|
1096
1096
|
for (const x of i) {
|
|
1097
1097
|
if (!x.active || x.isGrabbed || x.isDying || x.isThrown && x.type === "piercer") continue;
|
|
1098
|
-
const
|
|
1099
|
-
Math.hypot(
|
|
1098
|
+
const S = x.position.x - m.position.x, v = x.position.y - m.position.y;
|
|
1099
|
+
Math.hypot(S, v) <= m.radius && (this.killEnemyWithChainReaction(x, 0, s, a, l, o, i), this.currentThrowKills++, f && f());
|
|
1100
1100
|
}
|
|
1101
1101
|
m.duration >= m.maxDuration && s.splice(d, 1);
|
|
1102
1102
|
}
|
|
1103
1103
|
}
|
|
1104
1104
|
}
|
|
1105
|
-
killEnemyWithChainReaction(t, e, i, s, a, l,
|
|
1105
|
+
killEnemyWithChainReaction(t, e, i, s, a, l, o) {
|
|
1106
1106
|
if (!(!t.active || t.isDying))
|
|
1107
1107
|
if (a.push({
|
|
1108
1108
|
id: Math.random().toString(),
|
|
@@ -1125,14 +1125,14 @@ class z {
|
|
|
1125
1125
|
else if (t.type === "cluster") {
|
|
1126
1126
|
t.triggerDissolveDeath();
|
|
1127
1127
|
for (let n = 0; n < 6; n++) {
|
|
1128
|
-
const
|
|
1129
|
-
x: t.position.x + Math.cos(
|
|
1130
|
-
y: t.position.y + Math.sin(
|
|
1131
|
-
}, c =
|
|
1132
|
-
x: h.x + Math.cos(
|
|
1133
|
-
y: h.y + Math.sin(
|
|
1128
|
+
const r = n * Math.PI * 2 / 6, h = {
|
|
1129
|
+
x: t.position.x + Math.cos(r) * 15,
|
|
1130
|
+
y: t.position.y + Math.sin(r) * 15
|
|
1131
|
+
}, c = L.createEnemy("micro", h, {
|
|
1132
|
+
x: h.x + Math.cos(r) * 200,
|
|
1133
|
+
y: h.y + Math.sin(r) * 200
|
|
1134
1134
|
});
|
|
1135
|
-
c.isThrown = !0,
|
|
1135
|
+
c.isThrown = !0, o.push(c);
|
|
1136
1136
|
}
|
|
1137
1137
|
} else t.type === "parasite" ? (t.triggerDissolveDeath(), s.push({
|
|
1138
1138
|
id: Math.random().toString(),
|
|
@@ -1144,11 +1144,11 @@ class z {
|
|
|
1144
1144
|
})) : t.type === "piercer" ? t.triggerSliceDeath(e) : t.triggerDissolveDeath();
|
|
1145
1145
|
}
|
|
1146
1146
|
}
|
|
1147
|
-
class
|
|
1147
|
+
class tt {
|
|
1148
1148
|
pool = [];
|
|
1149
1149
|
constructor(t = 500) {
|
|
1150
1150
|
for (let e = 0; e < t; e++) {
|
|
1151
|
-
const i = new
|
|
1151
|
+
const i = new U(`pool_enemy_${e}`);
|
|
1152
1152
|
this.pool.push(i);
|
|
1153
1153
|
}
|
|
1154
1154
|
}
|
|
@@ -1156,7 +1156,7 @@ class _ {
|
|
|
1156
1156
|
for (const e of this.pool)
|
|
1157
1157
|
if (!e.active)
|
|
1158
1158
|
return e.reset(), e;
|
|
1159
|
-
const t = new
|
|
1159
|
+
const t = new U(`fallback_enemy_${Date.now()}_${Math.random()}`);
|
|
1160
1160
|
return this.pool.push(t), t;
|
|
1161
1161
|
}
|
|
1162
1162
|
resetAll() {
|
|
@@ -1164,74 +1164,74 @@ class _ {
|
|
|
1164
1164
|
t.reset();
|
|
1165
1165
|
}
|
|
1166
1166
|
}
|
|
1167
|
-
class
|
|
1167
|
+
class w {
|
|
1168
1168
|
static getOffscreenPosition(t, e) {
|
|
1169
1169
|
const i = Math.floor(Math.random() * 4), s = 70;
|
|
1170
1170
|
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 };
|
|
1171
1171
|
}
|
|
1172
1172
|
static spawnCircleOfDeath(t, e, i, s) {
|
|
1173
|
-
const a = [],
|
|
1173
|
+
const a = [], o = Math.max(i, s) * 0.55 + 80;
|
|
1174
1174
|
for (let n = 0; n < 18; n++) {
|
|
1175
|
-
const
|
|
1176
|
-
x: e.x + Math.cos(
|
|
1177
|
-
y: e.y + Math.sin(
|
|
1175
|
+
const r = n * Math.PI * 2 / 18, h = {
|
|
1176
|
+
x: e.x + Math.cos(r) * o,
|
|
1177
|
+
y: e.y + Math.sin(r) * o
|
|
1178
1178
|
}, c = t.get(), u = ["piercer", "spore", "cluster", "parasite"], p = u[n % u.length];
|
|
1179
|
-
|
|
1180
|
-
x: Math.cos(
|
|
1181
|
-
y: Math.sin(
|
|
1179
|
+
L.configureEnemy(c, p, h, e), c.velocity = {
|
|
1180
|
+
x: Math.cos(r + Math.PI) * 55,
|
|
1181
|
+
y: Math.sin(r + Math.PI) * 55
|
|
1182
1182
|
}, a.push(c);
|
|
1183
1183
|
}
|
|
1184
1184
|
return a;
|
|
1185
1185
|
}
|
|
1186
1186
|
static spawnDenseCluster(t, e, i, s) {
|
|
1187
|
-
const a = [],
|
|
1187
|
+
const a = [], o = Math.floor(Math.random() * 4);
|
|
1188
1188
|
let n = { x: -60, y: -60 };
|
|
1189
|
-
|
|
1190
|
-
for (let
|
|
1189
|
+
o === 0 ? n = { x: Math.random() * e, y: -80 } : o === 1 ? n = { x: e + 80, y: Math.random() * i } : o === 2 ? n = { x: Math.random() * e, y: i + 80 } : n = { x: -80, y: Math.random() * i };
|
|
1190
|
+
for (let r = 0; r < 14; r++) {
|
|
1191
1191
|
const h = {
|
|
1192
1192
|
x: (Math.random() - 0.5) * 60,
|
|
1193
1193
|
y: (Math.random() - 0.5) * 60
|
|
1194
1194
|
}, c = { x: n.x + h.x, y: n.y + h.y }, u = t.get();
|
|
1195
|
-
|
|
1196
|
-
const p = s.x - c.x, f = s.y - c.y,
|
|
1195
|
+
L.configureEnemy(u, "spore", c, s);
|
|
1196
|
+
const p = s.x - c.x, f = s.y - c.y, y = Math.atan2(f, p);
|
|
1197
1197
|
u.velocity = {
|
|
1198
|
-
x: Math.cos(
|
|
1199
|
-
y: Math.sin(
|
|
1198
|
+
x: Math.cos(y) * (50 + Math.random() * 20),
|
|
1199
|
+
y: Math.sin(y) * (50 + Math.random() * 20)
|
|
1200
1200
|
}, a.push(u);
|
|
1201
1201
|
}
|
|
1202
1202
|
return a;
|
|
1203
1203
|
}
|
|
1204
1204
|
static spawnSineSnake(t, e, i, s) {
|
|
1205
|
-
const a = [],
|
|
1205
|
+
const a = [], o = i * 0.2 + Math.random() * i * 0.6;
|
|
1206
1206
|
for (let n = 0; n < 12; n++) {
|
|
1207
|
-
const
|
|
1207
|
+
const r = {
|
|
1208
1208
|
x: -60 - n * 40,
|
|
1209
|
-
y:
|
|
1209
|
+
y: o + Math.sin(n * 0.45) * 70
|
|
1210
1210
|
}, h = t.get();
|
|
1211
|
-
|
|
1211
|
+
L.configureEnemy(h, "cluster", r, s), h.velocity = { x: 75, y: Math.cos(n * 0.45) * 30 }, a.push(h);
|
|
1212
1212
|
}
|
|
1213
1213
|
return a;
|
|
1214
1214
|
}
|
|
1215
1215
|
static spawnDoubleSpiral(t, e, i, s) {
|
|
1216
1216
|
const a = [];
|
|
1217
|
-
for (let
|
|
1218
|
-
const n =
|
|
1219
|
-
x: e + Math.cos(
|
|
1220
|
-
y: -60 + Math.sin(
|
|
1217
|
+
for (let o = 0; o < 14; o++) {
|
|
1218
|
+
const n = o / 14, r = n * Math.PI * 4, h = 120 + n * 450, c = {
|
|
1219
|
+
x: e + Math.cos(r) * h,
|
|
1220
|
+
y: -60 + Math.sin(r) * h
|
|
1221
1221
|
}, u = t.get();
|
|
1222
|
-
|
|
1222
|
+
L.configureEnemy(u, "parasite", c, s), a.push(u);
|
|
1223
1223
|
}
|
|
1224
1224
|
return a;
|
|
1225
1225
|
}
|
|
1226
1226
|
static spawnMarchingWall(t, e, i, s) {
|
|
1227
|
-
const a = [],
|
|
1227
|
+
const a = [], o = Math.random() > 0.5;
|
|
1228
1228
|
for (let n = 0; n < 12; n++) {
|
|
1229
|
-
const
|
|
1230
|
-
x:
|
|
1231
|
-
y:
|
|
1229
|
+
const r = n / 11 * i, h = {
|
|
1230
|
+
x: o ? -60 : e + 60,
|
|
1231
|
+
y: r
|
|
1232
1232
|
}, c = t.get();
|
|
1233
|
-
|
|
1234
|
-
x:
|
|
1233
|
+
L.configureEnemy(c, "piercer", h, s), c.velocity = {
|
|
1234
|
+
x: o ? 70 : -70,
|
|
1235
1235
|
y: 0
|
|
1236
1236
|
}, a.push(c);
|
|
1237
1237
|
}
|
|
@@ -1239,16 +1239,16 @@ class C {
|
|
|
1239
1239
|
}
|
|
1240
1240
|
static spawnCrossfireStreams(t, e, i, s) {
|
|
1241
1241
|
const a = [];
|
|
1242
|
-
for (let
|
|
1243
|
-
const n = { x: -50 -
|
|
1244
|
-
|
|
1245
|
-
const h = { x: e + 50 +
|
|
1246
|
-
|
|
1242
|
+
for (let o = 0; o < 10; o++) {
|
|
1243
|
+
const n = { x: -50 - o * 35, y: -50 - o * 35 }, r = t.get();
|
|
1244
|
+
L.configureEnemy(r, "spore", n, s), a.push(r);
|
|
1245
|
+
const h = { x: e + 50 + o * 35, y: i + 50 + o * 35 }, c = t.get();
|
|
1246
|
+
L.configureEnemy(c, "cluster", h, s), a.push(c);
|
|
1247
1247
|
}
|
|
1248
1248
|
return a;
|
|
1249
1249
|
}
|
|
1250
1250
|
}
|
|
1251
|
-
class
|
|
1251
|
+
class et {
|
|
1252
1252
|
wave = 1;
|
|
1253
1253
|
pool;
|
|
1254
1254
|
spawnTimer = 0;
|
|
@@ -1256,47 +1256,47 @@ class q {
|
|
|
1256
1256
|
patternCooldown = 0;
|
|
1257
1257
|
initialGracePeriod = 6;
|
|
1258
1258
|
constructor() {
|
|
1259
|
-
this.pool = new
|
|
1259
|
+
this.pool = new tt(500);
|
|
1260
1260
|
}
|
|
1261
1261
|
reset() {
|
|
1262
1262
|
this.wave = 1, this.spawnTimer = 0, this.waveTimer = 0, this.patternCooldown = 0;
|
|
1263
1263
|
}
|
|
1264
1264
|
update(t, e, i, s, a) {
|
|
1265
1265
|
this.waveTimer += t, this.spawnTimer += t, this.patternCooldown += t, this.applyFlockingBehaviors(e, t, a);
|
|
1266
|
-
const l = e.filter((
|
|
1266
|
+
const l = e.filter((r) => r.active).length, o = Math.max(0.9, 2.2 - (this.wave - 1) * 0.18);
|
|
1267
1267
|
if (this.waveTimer > this.initialGracePeriod && this.patternCooldown > Math.max(12 - this.wave, 6) && l < 35) {
|
|
1268
1268
|
this.patternCooldown = 0;
|
|
1269
|
-
const
|
|
1270
|
-
for (const h of
|
|
1269
|
+
const r = this.spawnPatternFormation(i, s, a);
|
|
1270
|
+
for (const h of r)
|
|
1271
1271
|
e.push(h);
|
|
1272
1272
|
}
|
|
1273
1273
|
const n = Math.min(18 + this.wave * 4, 80);
|
|
1274
|
-
return this.spawnTimer >=
|
|
1274
|
+
return this.spawnTimer >= o && l < n ? (this.spawnTimer = 0, this.spawnSingleEnemy(i, s, a)) : null;
|
|
1275
1275
|
}
|
|
1276
1276
|
spawnSingleEnemy(t, e, i) {
|
|
1277
|
-
const s =
|
|
1277
|
+
const s = w.getOffscreenPosition(t, e), a = Math.random();
|
|
1278
1278
|
let l = "piercer";
|
|
1279
1279
|
a > 0.75 ? l = "parasite" : a > 0.5 ? l = "cluster" : a > 0.25 && (l = "spore");
|
|
1280
|
-
const
|
|
1281
|
-
return
|
|
1280
|
+
const o = this.pool.get();
|
|
1281
|
+
return L.configureEnemy(o, l, s, i), o;
|
|
1282
1282
|
}
|
|
1283
1283
|
spawnPatternFormation(t, e, i) {
|
|
1284
1284
|
const s = Math.random();
|
|
1285
|
-
return s < 0.25 ?
|
|
1285
|
+
return s < 0.25 ? w.spawnCircleOfDeath(this.pool, i, t, e) : s < 0.5 ? w.spawnDenseCluster(this.pool, t, e, i) : s < 0.75 ? w.spawnSineSnake(this.pool, t, e, i) : w.spawnMarchingWall(this.pool, t, e, i);
|
|
1286
1286
|
}
|
|
1287
1287
|
applyFlockingBehaviors(t, e, i) {
|
|
1288
1288
|
for (let a = 0; a < t.length; a++) {
|
|
1289
1289
|
const l = t[a];
|
|
1290
1290
|
if (!l.active || l.isGrabbed || l.isThrown || l.isDying) continue;
|
|
1291
|
-
let
|
|
1291
|
+
let o = 0, n = 0, r = 0;
|
|
1292
1292
|
for (let p = 0; p < t.length; p++) {
|
|
1293
1293
|
if (a === p) continue;
|
|
1294
1294
|
const f = t[p];
|
|
1295
1295
|
if (!f.active || f.isGrabbed || f.isDying) continue;
|
|
1296
|
-
const
|
|
1297
|
-
m > 0 && m < 70 && (
|
|
1296
|
+
const y = l.position.x - f.position.x, d = l.position.y - f.position.y, m = Math.hypot(y, d);
|
|
1297
|
+
m > 0 && m < 70 && (o += y / m, n += d / m, r++);
|
|
1298
1298
|
}
|
|
1299
|
-
|
|
1299
|
+
r > 0 && (o /= r, n /= r, l.velocity.x += o * 60 * e, l.velocity.y += n * 60 * e);
|
|
1300
1300
|
const h = i.x - l.position.x, c = i.y - l.position.y, u = Math.hypot(h, c);
|
|
1301
1301
|
if (u > 0) {
|
|
1302
1302
|
const p = 80 + Math.min(this.wave * 4, 40);
|
|
@@ -1312,7 +1312,7 @@ class q {
|
|
|
1312
1312
|
}
|
|
1313
1313
|
}
|
|
1314
1314
|
}
|
|
1315
|
-
const
|
|
1315
|
+
const R = {
|
|
1316
1316
|
bioluminescent: {
|
|
1317
1317
|
bgInner: "#081220",
|
|
1318
1318
|
bgMid: "#050b16",
|
|
@@ -1361,31 +1361,35 @@ const N = {
|
|
|
1361
1361
|
tendrilMagenta: "#b5008c",
|
|
1362
1362
|
tendrilCyan: "#0077b6"
|
|
1363
1363
|
}
|
|
1364
|
-
},
|
|
1365
|
-
class
|
|
1366
|
-
currentTheme = "
|
|
1364
|
+
}, k = "axon_surge_theme";
|
|
1365
|
+
class it {
|
|
1366
|
+
currentTheme = "dark";
|
|
1367
1367
|
isExplicit = !1;
|
|
1368
1368
|
targetElement;
|
|
1369
1369
|
constructor(t, e) {
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
} catch {
|
|
1370
|
+
e !== void 0 && (this.targetElement = e);
|
|
1371
|
+
try {
|
|
1372
|
+
const i = localStorage.getItem(k);
|
|
1373
|
+
if (i && R[i]) {
|
|
1374
|
+
this.currentTheme = i, this.isExplicit = !0, this.applyThemeToDOM();
|
|
1375
|
+
return;
|
|
1377
1376
|
}
|
|
1378
|
-
|
|
1377
|
+
} catch {
|
|
1378
|
+
}
|
|
1379
|
+
if (t && R[t]) {
|
|
1380
|
+
this.currentTheme = t, this.isExplicit = !0, this.applyThemeToDOM();
|
|
1381
|
+
return;
|
|
1379
1382
|
}
|
|
1383
|
+
this.currentTheme = this.detectParentOrSystemTheme();
|
|
1380
1384
|
}
|
|
1381
1385
|
setTargetElement(t) {
|
|
1382
|
-
this.targetElement = t, this.isExplicit
|
|
1386
|
+
this.targetElement = t, this.isExplicit ? this.applyThemeToDOM() : this.currentTheme = this.detectParentOrSystemTheme();
|
|
1383
1387
|
}
|
|
1384
1388
|
setTheme(t) {
|
|
1385
|
-
if (
|
|
1389
|
+
if (R[t]) {
|
|
1386
1390
|
this.currentTheme = t, this.isExplicit = !0, this.applyThemeToDOM();
|
|
1387
1391
|
try {
|
|
1388
|
-
localStorage.setItem(
|
|
1392
|
+
localStorage.setItem(k, t);
|
|
1389
1393
|
} catch {
|
|
1390
1394
|
}
|
|
1391
1395
|
}
|
|
@@ -1393,28 +1397,54 @@ class j {
|
|
|
1393
1397
|
clearExplicitTheme() {
|
|
1394
1398
|
this.isExplicit = !1;
|
|
1395
1399
|
try {
|
|
1396
|
-
localStorage.removeItem(
|
|
1400
|
+
localStorage.removeItem(k);
|
|
1397
1401
|
} catch {
|
|
1398
1402
|
}
|
|
1399
|
-
this.removeThemeClasses();
|
|
1403
|
+
this.removeThemeClasses(), this.currentTheme = this.detectParentOrSystemTheme();
|
|
1400
1404
|
}
|
|
1401
1405
|
getTheme() {
|
|
1402
|
-
return this.currentTheme;
|
|
1406
|
+
return this.isExplicit || (this.currentTheme = this.detectParentOrSystemTheme()), this.currentTheme;
|
|
1403
1407
|
}
|
|
1404
1408
|
getPalette() {
|
|
1405
|
-
return
|
|
1409
|
+
return R[this.getTheme()] || R.dark;
|
|
1410
|
+
}
|
|
1411
|
+
detectParentOrSystemTheme() {
|
|
1412
|
+
try {
|
|
1413
|
+
const t = [
|
|
1414
|
+
this.targetElement || null,
|
|
1415
|
+
this.targetElement?.parentElement || null,
|
|
1416
|
+
document.body,
|
|
1417
|
+
document.documentElement
|
|
1418
|
+
];
|
|
1419
|
+
for (const e of t)
|
|
1420
|
+
if (e) {
|
|
1421
|
+
if (e.classList.contains("theme-light") || e.getAttribute("data-theme") === "light")
|
|
1422
|
+
return "light";
|
|
1423
|
+
if (e.classList.contains("theme-bioluminescent") || e.classList.contains("theme-bio") || e.getAttribute("data-theme") === "bioluminescent" || e.getAttribute("data-theme") === "bio")
|
|
1424
|
+
return "bioluminescent";
|
|
1425
|
+
if (e.classList.contains("theme-dark") || e.getAttribute("data-theme") === "dark")
|
|
1426
|
+
return "dark";
|
|
1427
|
+
}
|
|
1428
|
+
} catch {
|
|
1429
|
+
}
|
|
1430
|
+
try {
|
|
1431
|
+
if (window.matchMedia && window.matchMedia("(prefers-color-scheme: light)").matches)
|
|
1432
|
+
return "light";
|
|
1433
|
+
} catch {
|
|
1434
|
+
}
|
|
1435
|
+
return "dark";
|
|
1406
1436
|
}
|
|
1407
1437
|
removeThemeClasses() {
|
|
1408
1438
|
const t = ["theme-bioluminescent", "theme-dark", "theme-light"];
|
|
1409
|
-
this.targetElement && this.targetElement.classList.remove(...t)
|
|
1439
|
+
this.targetElement && this.targetElement.classList.remove(...t);
|
|
1410
1440
|
}
|
|
1411
1441
|
applyThemeToDOM() {
|
|
1412
|
-
if (this.removeThemeClasses(), !this.isExplicit) return;
|
|
1442
|
+
if (this.removeThemeClasses(), !this.isExplicit || !this.targetElement) return;
|
|
1413
1443
|
const t = `theme-${this.currentTheme}`;
|
|
1414
|
-
this.targetElement
|
|
1444
|
+
this.targetElement.classList.add(t);
|
|
1415
1445
|
}
|
|
1416
1446
|
}
|
|
1417
|
-
class
|
|
1447
|
+
class st {
|
|
1418
1448
|
maxDistance = 450;
|
|
1419
1449
|
maxThickness = 28;
|
|
1420
1450
|
minThickness = 4;
|
|
@@ -1423,47 +1453,57 @@ class Q {
|
|
|
1423
1453
|
render(t, e, i, s) {
|
|
1424
1454
|
for (const a of e) {
|
|
1425
1455
|
if (!a.active || a.isGrabbed || a.isDying) continue;
|
|
1426
|
-
const l = a.position.x,
|
|
1427
|
-
if (l >= 0 && l <= i &&
|
|
1428
|
-
const n = Math.min(i, Math.max(0, l)),
|
|
1456
|
+
const l = a.position.x, o = a.position.y;
|
|
1457
|
+
if (l >= 0 && l <= i && o >= 0 && o <= s) continue;
|
|
1458
|
+
const n = Math.min(i, Math.max(0, l)), r = Math.min(s, Math.max(0, o)), h = Math.hypot(l - n, o - r);
|
|
1429
1459
|
if (h <= 0 || h > this.maxDistance) continue;
|
|
1430
1460
|
const c = Math.min(1, Math.max(0, h / this.maxDistance)), u = this.minThickness + (this.maxThickness - this.minThickness) * c, p = this.minLength + (this.maxLength - this.minLength) * c, f = 0.35 + (1 - c) * 0.55;
|
|
1431
1461
|
if (t.save(), t.globalAlpha = f, t.shadowColor = a.color, t.shadowBlur = 12 + (1 - c) * 16, t.strokeStyle = a.color, t.lineWidth = u, t.lineCap = "round", t.beginPath(), n === 0 || n === i) {
|
|
1432
|
-
const
|
|
1433
|
-
t.moveTo(n,
|
|
1462
|
+
const y = Math.max(0, r - p / 2), d = Math.min(s, r + p / 2);
|
|
1463
|
+
t.moveTo(n, y), t.lineTo(n, d);
|
|
1434
1464
|
} else {
|
|
1435
|
-
const
|
|
1436
|
-
t.moveTo(
|
|
1465
|
+
const y = Math.max(0, n - p / 2), d = Math.min(i, n + p / 2);
|
|
1466
|
+
t.moveTo(y, r), t.lineTo(d, r);
|
|
1437
1467
|
}
|
|
1438
1468
|
t.stroke(), t.strokeStyle = "#ffffff", t.lineWidth = Math.max(1.5, u * 0.25), t.globalAlpha = f * 0.8, t.stroke(), t.restore();
|
|
1439
1469
|
}
|
|
1440
1470
|
}
|
|
1441
1471
|
}
|
|
1442
|
-
class
|
|
1443
|
-
render(t, e, i, s, a) {
|
|
1444
|
-
const
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1472
|
+
class at {
|
|
1473
|
+
render(t, e, i, s, a, l = !1) {
|
|
1474
|
+
const o = (210 + (a - 1) * 38 + Math.sin(s * 0.12) * 15) % 360;
|
|
1475
|
+
if (l) {
|
|
1476
|
+
const v = `hsl(${o}, 50%, 94%)`, b = `hsl(${(o + 25) % 360}, 45%, 89%)`, M = `hsl(${(o + 50) % 360}, 40%, 82%)`, E = t.createRadialGradient(e / 2, i / 2, 40, e / 2, i / 2, Math.max(e, i));
|
|
1477
|
+
E.addColorStop(0, v), E.addColorStop(0.55, b), E.addColorStop(1, M), t.fillStyle = E, t.fillRect(0, 0, e, i);
|
|
1478
|
+
const g = (o + 75) % 360, A = e * 0.35 + Math.sin(s * 0.25) * 70, I = i * 0.45 + Math.cos(s * 0.2) * 60, C = t.createRadialGradient(A, I, 20, A, I, 400);
|
|
1479
|
+
C.addColorStop(0, `hsla(${g}, 65%, 78%, 0.35)`), C.addColorStop(1, "rgba(255, 255, 255, 0)"), t.fillStyle = C, t.beginPath(), t.arc(A, I, 400, 0, Math.PI * 2), t.fill();
|
|
1480
|
+
const W = (o + 160) % 360, O = e * 0.68 + Math.cos(s * 0.28) * 60, D = i * 0.55 + Math.sin(s * 0.22) * 55, G = t.createRadialGradient(O, D, 20, O, D, 440);
|
|
1481
|
+
G.addColorStop(0, `hsla(${W}, 60%, 75%, 0.3)`), G.addColorStop(1, "rgba(255, 255, 255, 0)"), t.fillStyle = G, t.beginPath(), t.arc(O, D, 440, 0, Math.PI * 2), t.fill();
|
|
1482
|
+
return;
|
|
1483
|
+
}
|
|
1484
|
+
const n = `hsl(${o}, 45%, 8%)`, r = `hsl(${(o + 30) % 360}, 40%, 4%)`, h = `hsl(${(o + 60) % 360}, 50%, 2%)`, c = t.createRadialGradient(e / 2, i / 2, 40, e / 2, i / 2, Math.max(e, i));
|
|
1485
|
+
c.addColorStop(0, n), c.addColorStop(0.55, r), c.addColorStop(1, h), t.fillStyle = c, t.fillRect(0, 0, e, i);
|
|
1486
|
+
const u = (o + 75) % 360, p = e * 0.35 + Math.sin(s * 0.25) * 70, f = i * 0.45 + Math.cos(s * 0.2) * 60, y = t.createRadialGradient(p, f, 20, p, f, 400);
|
|
1487
|
+
y.addColorStop(0, `hsla(${u}, 65%, 12%, 0.35)`), y.addColorStop(1, "rgba(0, 0, 0, 0)"), t.fillStyle = y, t.beginPath(), t.arc(p, f, 400, 0, Math.PI * 2), t.fill();
|
|
1488
|
+
const d = (o + 160) % 360, m = e * 0.68 + Math.cos(s * 0.28) * 60, x = i * 0.55 + Math.sin(s * 0.22) * 55, S = t.createRadialGradient(m, x, 20, m, x, 440);
|
|
1489
|
+
S.addColorStop(0, `hsla(${d}, 60%, 10%, 0.3)`), S.addColorStop(1, "rgba(0, 0, 0, 0)"), t.fillStyle = S, t.beginPath(), t.arc(m, x, 440, 0, Math.PI * 2), t.fill();
|
|
1450
1490
|
}
|
|
1451
1491
|
}
|
|
1452
|
-
class
|
|
1492
|
+
class nt {
|
|
1453
1493
|
render(t, e, i) {
|
|
1454
1494
|
if (!e.isActive) return;
|
|
1455
1495
|
const s = e.getLauncher(), a = e.getTarget();
|
|
1456
1496
|
if (!s || !a || !s.active || !a.active) return;
|
|
1457
1497
|
const l = e.getStep();
|
|
1458
1498
|
if (t.save(), l === 1) {
|
|
1459
|
-
const
|
|
1460
|
-
t.shadowColor = "#00f0ff", t.shadowBlur = 20, t.fillStyle = "#00f0ff", t.beginPath(), t.moveTo(n,
|
|
1499
|
+
const o = Math.sin(i * 6) * 10, n = s.position.x, r = s.position.y - 65 + o;
|
|
1500
|
+
t.shadowColor = "#00f0ff", t.shadowBlur = 20, t.fillStyle = "#00f0ff", t.beginPath(), t.moveTo(n, r + 20), t.lineTo(n - 16, r - 12), t.lineTo(n - 6, r - 12), t.lineTo(n - 6, r - 32), t.lineTo(n + 6, r - 32), t.lineTo(n + 6, r - 12), t.lineTo(n + 16, r - 12), t.closePath(), t.fill();
|
|
1461
1501
|
const h = s.radius * (1.6 + Math.sin(i * 8) * 0.3);
|
|
1462
1502
|
t.strokeStyle = "rgba(0, 240, 255, 0.8)", t.lineWidth = 3, t.beginPath(), t.arc(s.position.x, s.position.y, h, 0, Math.PI * 2), t.stroke();
|
|
1463
1503
|
} else if (l === 2) {
|
|
1464
|
-
const
|
|
1465
|
-
if (Math.hypot(
|
|
1466
|
-
const h = Math.atan2(n,
|
|
1504
|
+
const o = a.position.x - s.position.x, n = a.position.y - s.position.y;
|
|
1505
|
+
if (Math.hypot(o, n) > 10) {
|
|
1506
|
+
const h = Math.atan2(n, o);
|
|
1467
1507
|
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([]);
|
|
1468
1508
|
const c = a.position.x - Math.cos(h) * (a.radius + 10), u = a.position.y - Math.sin(h) * (a.radius + 10);
|
|
1469
1509
|
t.fillStyle = "#ff00dd", t.beginPath(), t.moveTo(c, u), t.lineTo(c - Math.cos(h - 0.4) * 24, u - Math.sin(h - 0.4) * 24), t.lineTo(c - Math.cos(h + 0.4) * 24, u - Math.sin(h + 0.4) * 24), t.closePath(), t.fill();
|
|
@@ -1474,7 +1514,7 @@ class et {
|
|
|
1474
1514
|
t.restore();
|
|
1475
1515
|
}
|
|
1476
1516
|
}
|
|
1477
|
-
class
|
|
1517
|
+
class ot {
|
|
1478
1518
|
canvas;
|
|
1479
1519
|
ctx;
|
|
1480
1520
|
themeManager;
|
|
@@ -1482,34 +1522,34 @@ class it {
|
|
|
1482
1522
|
bgRenderer;
|
|
1483
1523
|
tutorialArrowRenderer;
|
|
1484
1524
|
constructor(t, e) {
|
|
1485
|
-
this.canvas = t, this.ctx = t.getContext("2d"), this.themeManager = e, this.indicatorRenderer = new
|
|
1525
|
+
this.canvas = t, this.ctx = t.getContext("2d"), this.themeManager = e, this.indicatorRenderer = new st(), this.bgRenderer = new at(), this.tutorialArrowRenderer = new nt();
|
|
1486
1526
|
}
|
|
1487
|
-
render(t, e, i, s, a, l,
|
|
1527
|
+
render(t, e, i, s, a, l, o, n, r, h, c = 1, u) {
|
|
1488
1528
|
if (!this.ctx) return;
|
|
1489
|
-
const p = this.themeManager.getPalette(), { width: f, height:
|
|
1490
|
-
this.ctx.save(), this.ctx.translate(d.x, d.y), this.bgRenderer.render(this.ctx, f,
|
|
1529
|
+
const p = this.themeManager.getPalette(), { width: f, height: y } = this.canvas, d = n.getShakeOffset();
|
|
1530
|
+
this.ctx.save(), this.ctx.translate(d.x, d.y), this.bgRenderer.render(this.ctx, f, y, t.pulsePhase, c, this.themeManager.getTheme() === "light"), this.drawToxicPools(i, t.pulsePhase), this.drawGravityVortices(s, t.pulsePhase), this.drawShockwaves(a), this.drawCoreFilaments(t, p), this.drawParticles(l), this.indicatorRenderer.render(this.ctx, e, f, y), 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, h, e, p), this.drawOrganicConsciousnessCore(t, p), this.drawFloatingTexts(o), n.flashAlpha > 0 && (this.ctx.fillStyle = `rgba(255, 255, 255, ${n.flashAlpha})`, this.ctx.fillRect(0, 0, f, y)), this.ctx.restore();
|
|
1491
1531
|
}
|
|
1492
1532
|
drawToxicPools(t, e) {
|
|
1493
1533
|
if (this.ctx)
|
|
1494
1534
|
for (const i of t) {
|
|
1495
|
-
const s = i.duration / i.maxDuration, a = Math.min(0.7, (1 - s) * 0.7), { x: l, y:
|
|
1535
|
+
const s = i.duration / i.maxDuration, a = Math.min(0.7, (1 - s) * 0.7), { x: l, y: o } = i.position;
|
|
1496
1536
|
this.ctx.save();
|
|
1497
|
-
const n = this.ctx.createRadialGradient(l,
|
|
1537
|
+
const n = this.ctx.createRadialGradient(l, o, 10, l, o, i.radius * 1.2);
|
|
1498
1538
|
n.addColorStop(0, `rgba(57, 255, 20, ${a * 0.9})`), n.addColorStop(0.4, `rgba(16, 185, 129, ${a * 0.65})`), n.addColorStop(0.8, `rgba(5, 80, 45, ${a * 0.35})`), n.addColorStop(1, "rgba(2, 35, 15, 0)"), this.ctx.fillStyle = n, this.ctx.shadowColor = "#39ff14", this.ctx.shadowBlur = 30, this.ctx.beginPath();
|
|
1499
|
-
const
|
|
1500
|
-
for (let h = 0; h <=
|
|
1501
|
-
const c = h * Math.PI * 2 /
|
|
1502
|
-
h === 0 ? this.ctx.moveTo(
|
|
1539
|
+
const r = 70;
|
|
1540
|
+
for (let h = 0; h <= r; h++) {
|
|
1541
|
+
const c = h * Math.PI * 2 / r, u = Math.sin(c * 5 + e * 3) * 14, p = Math.cos(c * 3 - e * 2) * 9, f = i.radius + u + p, y = l + Math.cos(c) * f, d = o + Math.sin(c) * f;
|
|
1542
|
+
h === 0 ? this.ctx.moveTo(y, d) : this.ctx.lineTo(y, d);
|
|
1503
1543
|
}
|
|
1504
1544
|
this.ctx.closePath(), this.ctx.fill(), this.ctx.strokeStyle = `rgba(57, 255, 20, ${a * 0.8})`, this.ctx.lineWidth = 2.5, this.ctx.beginPath();
|
|
1505
|
-
for (let h = 0; h <=
|
|
1506
|
-
const c = h * Math.PI * 2 /
|
|
1507
|
-
h === 0 ? this.ctx.moveTo(f,
|
|
1545
|
+
for (let h = 0; h <= r; h++) {
|
|
1546
|
+
const c = h * Math.PI * 2 / r, u = Math.sin(c * 6 + e * 4) * 8, p = i.radius * 0.75 + u, f = l + Math.cos(c) * p, y = o + Math.sin(c) * p;
|
|
1547
|
+
h === 0 ? this.ctx.moveTo(f, y) : this.ctx.lineTo(f, y);
|
|
1508
1548
|
}
|
|
1509
1549
|
this.ctx.closePath(), this.ctx.stroke();
|
|
1510
1550
|
for (let h = 0; h < 6; h++) {
|
|
1511
|
-
const c = h * Math.PI * 0.33 + e * 1.5, u = i.radius * 0.5 * (0.3 + Math.sin(e * 2 + h) * 0.3), p = l + Math.cos(c) * u, f =
|
|
1512
|
-
this.ctx.fillStyle = `rgba(255, 255, 255, ${a * 0.8})`, this.ctx.beginPath(), this.ctx.arc(p, f, Math.max(1,
|
|
1551
|
+
const c = h * Math.PI * 0.33 + e * 1.5, u = i.radius * 0.5 * (0.3 + Math.sin(e * 2 + h) * 0.3), p = l + Math.cos(c) * u, f = o + Math.sin(c) * u, y = 3 + Math.sin(e * 3 + h) * 2;
|
|
1552
|
+
this.ctx.fillStyle = `rgba(255, 255, 255, ${a * 0.8})`, this.ctx.beginPath(), this.ctx.arc(p, f, Math.max(1, y), 0, Math.PI * 2), this.ctx.fill();
|
|
1513
1553
|
}
|
|
1514
1554
|
this.ctx.restore();
|
|
1515
1555
|
}
|
|
@@ -1532,13 +1572,13 @@ class it {
|
|
|
1532
1572
|
drawGravityVortices(t, e) {
|
|
1533
1573
|
if (this.ctx)
|
|
1534
1574
|
for (const i of t) {
|
|
1535
|
-
const s = Math.min(0.85, (1 - i.duration / i.maxDuration) * 0.85), a = i.radius * (1 - i.duration / i.maxDuration * 0.1), { x: l, y:
|
|
1575
|
+
const s = Math.min(0.85, (1 - i.duration / i.maxDuration) * 0.85), a = i.radius * (1 - i.duration / i.maxDuration * 0.1), { x: l, y: o } = i.position;
|
|
1536
1576
|
this.ctx.save();
|
|
1537
|
-
const n = this.ctx.createRadialGradient(l,
|
|
1538
|
-
n.addColorStop(0, `rgba(0, 0, 0, ${s})`), n.addColorStop(0.7, `rgba(20, 0, 40, ${s})`), n.addColorStop(1, `rgba(157, 78, 221, ${s * 0.5})`), this.ctx.fillStyle = n, this.ctx.beginPath(), this.ctx.arc(l,
|
|
1539
|
-
for (let
|
|
1540
|
-
const h = a *
|
|
1541
|
-
this.ctx.beginPath(), this.ctx.arc(l,
|
|
1577
|
+
const n = this.ctx.createRadialGradient(l, o, 0, l, o, 60);
|
|
1578
|
+
n.addColorStop(0, `rgba(0, 0, 0, ${s})`), n.addColorStop(0.7, `rgba(20, 0, 40, ${s})`), n.addColorStop(1, `rgba(157, 78, 221, ${s * 0.5})`), this.ctx.fillStyle = n, this.ctx.beginPath(), this.ctx.arc(l, o, 60, 0, Math.PI * 2), this.ctx.fill(), this.ctx.strokeStyle = `rgba(157, 78, 221, ${s})`, this.ctx.lineWidth = 5, this.ctx.shadowColor = "#9d4edd", this.ctx.shadowBlur = 32;
|
|
1579
|
+
for (let r = 1; r <= 5; r++) {
|
|
1580
|
+
const h = a * r / 5, c = e * r * 2.2;
|
|
1581
|
+
this.ctx.beginPath(), this.ctx.arc(l, o, h, c, c + Math.PI * 1.5), this.ctx.stroke();
|
|
1542
1582
|
}
|
|
1543
1583
|
this.ctx.restore();
|
|
1544
1584
|
}
|
|
@@ -1547,29 +1587,29 @@ class it {
|
|
|
1547
1587
|
if (!this.ctx) return;
|
|
1548
1588
|
const a = this.ctx.createRadialGradient(t / 2, e / 2, 40, t / 2, e / 2, Math.max(t, e));
|
|
1549
1589
|
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);
|
|
1550
|
-
const l = t * 0.35 + Math.sin(i * 0.3) * 60,
|
|
1551
|
-
n.addColorStop(0, s.nebulaCyan), n.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.fillStyle = n, this.ctx.beginPath(), this.ctx.arc(l,
|
|
1552
|
-
const
|
|
1553
|
-
c.addColorStop(0, s.nebulaMagenta), c.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.fillStyle = c, this.ctx.beginPath(), this.ctx.arc(
|
|
1590
|
+
const l = t * 0.35 + Math.sin(i * 0.3) * 60, o = e * 0.45 + Math.cos(i * 0.25) * 50, n = this.ctx.createRadialGradient(l, o, 20, l, o, 380);
|
|
1591
|
+
n.addColorStop(0, s.nebulaCyan), n.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.fillStyle = n, this.ctx.beginPath(), this.ctx.arc(l, o, 380, 0, Math.PI * 2), this.ctx.fill();
|
|
1592
|
+
const r = t * 0.68 + Math.cos(i * 0.35) * 50, h = e * 0.55 + Math.sin(i * 0.3) * 45, c = this.ctx.createRadialGradient(r, h, 20, r, h, 420);
|
|
1593
|
+
c.addColorStop(0, s.nebulaMagenta), c.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.fillStyle = c, this.ctx.beginPath(), this.ctx.arc(r, h, 420, 0, Math.PI * 2), this.ctx.fill();
|
|
1554
1594
|
}
|
|
1555
1595
|
drawCoreFilaments(t, e) {
|
|
1556
1596
|
if (!this.ctx) return;
|
|
1557
1597
|
const i = 12;
|
|
1558
1598
|
this.ctx.lineWidth = 1.5, this.ctx.strokeStyle = e.nebulaCyan;
|
|
1559
1599
|
for (let s = 0; s < i; s++) {
|
|
1560
|
-
const a = s * Math.PI * 2 / i + t.pulsePhase * 0.12, l = 85 + Math.sin(t.pulsePhase * 1.5 + s) * 25,
|
|
1561
|
-
this.ctx.beginPath(), this.ctx.moveTo(t.position.x, t.position.y), this.ctx.quadraticCurveTo(
|
|
1600
|
+
const a = s * Math.PI * 2 / i + t.pulsePhase * 0.12, l = 85 + Math.sin(t.pulsePhase * 1.5 + s) * 25, o = t.position.x + Math.cos(a) * l, n = t.position.y + Math.sin(a) * l, r = t.position.x + Math.cos(a + 0.4) * 48, h = t.position.y + Math.sin(a + 0.4) * 48;
|
|
1601
|
+
this.ctx.beginPath(), this.ctx.moveTo(t.position.x, t.position.y), this.ctx.quadraticCurveTo(r, h, o, n), this.ctx.stroke(), this.ctx.fillStyle = e.sporeColor, this.ctx.beginPath(), this.ctx.arc(o, n, 3.5, 0, Math.PI * 2), this.ctx.fill();
|
|
1562
1602
|
}
|
|
1563
1603
|
}
|
|
1564
1604
|
drawOrganicConsciousnessCore(t, e) {
|
|
1565
1605
|
if (!this.ctx) return;
|
|
1566
1606
|
const { x: i, y: s } = t.position;
|
|
1567
|
-
for (let
|
|
1568
|
-
const n = t.radius + 16 +
|
|
1607
|
+
for (let o = 0; o < t.integrity; o++) {
|
|
1608
|
+
const n = t.radius + 16 + o * 12;
|
|
1569
1609
|
this.ctx.strokeStyle = e.corePrimary, this.ctx.lineWidth = 2.2, this.ctx.shadowColor = e.corePrimary, this.ctx.shadowBlur = 12, this.ctx.beginPath();
|
|
1570
|
-
const
|
|
1571
|
-
for (let h = 0; h <=
|
|
1572
|
-
const c = h * Math.PI * 2 /
|
|
1610
|
+
const r = 60;
|
|
1611
|
+
for (let h = 0; h <= r; h++) {
|
|
1612
|
+
const c = h * Math.PI * 2 / r, u = n + Math.sin(c * 4 + t.pulsePhase * 2 + o) * 3, p = i + Math.cos(c) * u, f = s + Math.sin(c) * u;
|
|
1573
1613
|
h === 0 ? this.ctx.moveTo(p, f) : this.ctx.lineTo(p, f);
|
|
1574
1614
|
}
|
|
1575
1615
|
this.ctx.closePath(), this.ctx.stroke();
|
|
@@ -1577,9 +1617,9 @@ class it {
|
|
|
1577
1617
|
const a = this.ctx.createRadialGradient(i, s, 5, i, s, t.radius * 2.2);
|
|
1578
1618
|
a.addColorStop(0, e.coreGlow), a.addColorStop(0.5, e.nebulaMagenta), a.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.fillStyle = a, 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 = e.corePrimary, this.ctx.lineWidth = 3, this.ctx.fillStyle = e.nebulaCyan, this.ctx.shadowColor = e.corePrimary, this.ctx.shadowBlur = 20, this.ctx.beginPath();
|
|
1579
1619
|
const l = 80;
|
|
1580
|
-
for (let
|
|
1581
|
-
const n =
|
|
1582
|
-
|
|
1620
|
+
for (let o = 0; o <= l; o++) {
|
|
1621
|
+
const n = o * Math.PI * 2 / l, r = t.getMembraneRadius(n), h = Math.cos(n) * r, c = Math.sin(n) * r;
|
|
1622
|
+
o === 0 ? this.ctx.moveTo(h, c) : this.ctx.lineTo(h, c);
|
|
1583
1623
|
}
|
|
1584
1624
|
this.ctx.closePath(), this.ctx.fill(), this.ctx.stroke(), this.ctx.fillStyle = "#ffffff", this.ctx.beginPath(), this.ctx.arc(0, 0, t.radius * 0.3, 0, Math.PI * 2), this.ctx.fill(), this.ctx.restore();
|
|
1585
1625
|
}
|
|
@@ -1588,10 +1628,10 @@ class it {
|
|
|
1588
1628
|
this.ctx.save();
|
|
1589
1629
|
const s = e.x - t.x, a = e.y - t.y;
|
|
1590
1630
|
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);
|
|
1591
|
-
const l = (t.x + e.x) / 2 + Math.sin(Date.now() * 0.02) * 16,
|
|
1592
|
-
this.ctx.quadraticCurveTo(l,
|
|
1631
|
+
const l = (t.x + e.x) / 2 + Math.sin(Date.now() * 0.02) * 16, o = (t.y + e.y) / 2 + Math.cos(Date.now() * 0.02) * 16;
|
|
1632
|
+
this.ctx.quadraticCurveTo(l, o, e.x, e.y), this.ctx.stroke(), this.ctx.strokeStyle = i.tendrilCyan, this.ctx.lineWidth = 3.5, this.ctx.shadowColor = i.tendrilCyan, this.ctx.shadowBlur = 12, this.ctx.beginPath(), this.ctx.moveTo(t.x, t.y), this.ctx.lineTo(e.x, e.y), this.ctx.stroke();
|
|
1593
1633
|
for (let n = 0; n < 6; n++) {
|
|
1594
|
-
const
|
|
1634
|
+
const r = Math.random(), h = t.x + s * r + (Math.random() - 0.5) * 24, c = t.y + a * r + (Math.random() - 0.5) * 24;
|
|
1595
1635
|
this.ctx.fillStyle = "#ffffff", this.ctx.beginPath(), this.ctx.arc(h, c, 2.5 + Math.random() * 2.5, 0, Math.PI * 2), this.ctx.fill();
|
|
1596
1636
|
}
|
|
1597
1637
|
this.ctx.restore();
|
|
@@ -1600,8 +1640,8 @@ class it {
|
|
|
1600
1640
|
if (this.ctx)
|
|
1601
1641
|
for (const a of i) {
|
|
1602
1642
|
if (!a.active || a.isGrabbed || a.isThrown || a.wasManipulated || a.isDying) continue;
|
|
1603
|
-
const l = e.x - a.position.x,
|
|
1604
|
-
if (Math.hypot(l,
|
|
1643
|
+
const l = e.x - a.position.x, o = e.y - a.position.y;
|
|
1644
|
+
if (Math.hypot(l, o) <= a.getHitRadius()) {
|
|
1605
1645
|
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();
|
|
1606
1646
|
break;
|
|
1607
1647
|
}
|
|
@@ -1613,16 +1653,16 @@ class it {
|
|
|
1613
1653
|
if (!s.active) continue;
|
|
1614
1654
|
let a = s.color;
|
|
1615
1655
|
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);
|
|
1616
|
-
const { x: l, y:
|
|
1617
|
-
if (this.ctx.save(), this.ctx.translate(l,
|
|
1656
|
+
const { x: l, y: o } = s.position;
|
|
1657
|
+
if (this.ctx.save(), this.ctx.translate(l, o), s.wasManipulated && !s.isDying) {
|
|
1618
1658
|
const n = s.radius * 1.5 + Math.sin(e * 6) * 4;
|
|
1619
1659
|
this.ctx.strokeStyle = i.tendrilMagenta, this.ctx.lineWidth = 2.5, this.ctx.shadowColor = i.tendrilMagenta, this.ctx.shadowBlur = 18, this.ctx.beginPath(), this.ctx.arc(0, 0, n, 0, Math.PI * 2), this.ctx.stroke();
|
|
1620
|
-
const
|
|
1621
|
-
this.ctx.strokeStyle = i.tendrilCyan, this.ctx.lineWidth = 1.5, this.ctx.beginPath(), this.ctx.arc(0, 0,
|
|
1660
|
+
const r = s.radius * 1.8 + Math.cos(e * 8) * 3;
|
|
1661
|
+
this.ctx.strokeStyle = i.tendrilCyan, this.ctx.lineWidth = 1.5, this.ctx.beginPath(), this.ctx.arc(0, 0, r, 0, Math.PI * 2), this.ctx.stroke();
|
|
1622
1662
|
}
|
|
1623
1663
|
if (s.isDying) {
|
|
1624
|
-
const n = s.deathTimer / s.maxDeathTimer,
|
|
1625
|
-
if (this.ctx.globalAlpha =
|
|
1664
|
+
const n = s.deathTimer / s.maxDeathTimer, r = Math.max(0, 1 - n);
|
|
1665
|
+
if (this.ctx.globalAlpha = r, s.deathType === "dissolve") {
|
|
1626
1666
|
const h = s.radius * (1 - n * 0.7);
|
|
1627
1667
|
this.ctx.fillStyle = i.sporeColor, this.ctx.shadowColor = i.sporeColor, this.ctx.shadowBlur = 20, this.ctx.beginPath(), this.ctx.arc(0, 0, h, 0, Math.PI * 2), this.ctx.fill();
|
|
1628
1668
|
for (let c = 0; c < 4; c++) {
|
|
@@ -1640,17 +1680,17 @@ class it {
|
|
|
1640
1680
|
if (this.ctx.shadowColor = a, this.ctx.shadowBlur = 16, this.ctx.fillStyle = a, s.type === "piercer") {
|
|
1641
1681
|
this.ctx.rotate(s.rotation), this.ctx.beginPath();
|
|
1642
1682
|
const n = 12;
|
|
1643
|
-
for (let
|
|
1644
|
-
const h =
|
|
1645
|
-
|
|
1683
|
+
for (let r = 0; r <= n; r++) {
|
|
1684
|
+
const h = r * Math.PI * 2 / n, c = s.radius * 1.6 + Math.sin(h * 3 + e * 4) * 3, u = s.radius * 0.6 + Math.cos(h * 2 + e * 3) * 2, p = Math.cos(h) * c, f = Math.sin(h) * u;
|
|
1685
|
+
r === 0 ? this.ctx.moveTo(p, f) : this.ctx.lineTo(p, f);
|
|
1646
1686
|
}
|
|
1647
1687
|
this.ctx.closePath(), this.ctx.fill(), this.ctx.fillStyle = "#ffffff", this.ctx.beginPath(), this.ctx.arc(4, 0, 4, 0, Math.PI * 2), this.ctx.fill();
|
|
1648
1688
|
} else if (s.type === "spore") {
|
|
1649
1689
|
this.ctx.beginPath();
|
|
1650
1690
|
const n = 8;
|
|
1651
|
-
for (let
|
|
1652
|
-
const h =
|
|
1653
|
-
|
|
1691
|
+
for (let r = 0; r < n; r++) {
|
|
1692
|
+
const h = r * Math.PI * 2 / n, c = s.radius + Math.sin(h * 4 + e * 3 + s.position.x) * 4, u = Math.cos(h) * c, p = Math.sin(h) * c;
|
|
1693
|
+
r === 0 ? this.ctx.moveTo(u, p) : this.ctx.lineTo(u, p);
|
|
1654
1694
|
}
|
|
1655
1695
|
this.ctx.closePath(), this.ctx.fill(), this.ctx.fillStyle = "rgba(255, 255, 255, 0.7)", 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();
|
|
1656
1696
|
} else if (s.type === "cluster") {
|
|
@@ -1660,9 +1700,9 @@ class it {
|
|
|
1660
1700
|
} else if (s.type === "parasite") {
|
|
1661
1701
|
this.ctx.beginPath();
|
|
1662
1702
|
const n = 14;
|
|
1663
|
-
for (let
|
|
1664
|
-
const h =
|
|
1665
|
-
|
|
1703
|
+
for (let r = 0; r <= n; r++) {
|
|
1704
|
+
const h = r * Math.PI * 2 / n, c = s.radius + Math.sin(h * 5 - e * 5) * 3, u = Math.cos(h) * c, p = Math.sin(h) * c;
|
|
1705
|
+
r === 0 ? this.ctx.moveTo(u, p) : this.ctx.lineTo(u, p);
|
|
1666
1706
|
}
|
|
1667
1707
|
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();
|
|
1668
1708
|
} else
|
|
@@ -1681,7 +1721,7 @@ class it {
|
|
|
1681
1721
|
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();
|
|
1682
1722
|
}
|
|
1683
1723
|
}
|
|
1684
|
-
class
|
|
1724
|
+
class rt {
|
|
1685
1725
|
container;
|
|
1686
1726
|
i18n;
|
|
1687
1727
|
waveLabelElement;
|
|
@@ -1713,7 +1753,7 @@ class st {
|
|
|
1713
1753
|
this.container.style.display = "none";
|
|
1714
1754
|
}
|
|
1715
1755
|
}
|
|
1716
|
-
class
|
|
1756
|
+
class ht {
|
|
1717
1757
|
container;
|
|
1718
1758
|
i18n;
|
|
1719
1759
|
onStartCallback;
|
|
@@ -1739,7 +1779,7 @@ class at {
|
|
|
1739
1779
|
this.container.style.display = "none";
|
|
1740
1780
|
}
|
|
1741
1781
|
}
|
|
1742
|
-
class
|
|
1782
|
+
class lt {
|
|
1743
1783
|
modal;
|
|
1744
1784
|
card;
|
|
1745
1785
|
i18n;
|
|
@@ -1750,8 +1790,8 @@ class nt {
|
|
|
1750
1790
|
hapticsEnabled = !0;
|
|
1751
1791
|
constructor(t, e, i, s, a, l) {
|
|
1752
1792
|
this.i18n = e, this.themeManager = i, this.platform = s, this.onLanguageChangedCallback = a, this.onCloseCallback = l;
|
|
1753
|
-
const
|
|
1754
|
-
|
|
1793
|
+
const o = localStorage.getItem("axon_surge_haptics");
|
|
1794
|
+
o !== null && (this.hapticsEnabled = o === "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", () => {
|
|
1755
1795
|
this.onCloseCallback && this.onCloseCallback();
|
|
1756
1796
|
}), this.renderContent();
|
|
1757
1797
|
}
|
|
@@ -1784,20 +1824,20 @@ class nt {
|
|
|
1784
1824
|
ko: "한국어 (KO)",
|
|
1785
1825
|
zh: "中文 (ZH)"
|
|
1786
1826
|
};
|
|
1787
|
-
for (const
|
|
1827
|
+
for (const E of K) {
|
|
1788
1828
|
const g = document.createElement("option");
|
|
1789
|
-
g.value =
|
|
1829
|
+
g.value = E, g.textContent = l[E], this.i18n.getLanguage() === E && (g.selected = !0), a.appendChild(g);
|
|
1790
1830
|
}
|
|
1791
1831
|
a.addEventListener("change", () => {
|
|
1792
|
-
const
|
|
1793
|
-
this.i18n.setLanguage(
|
|
1832
|
+
const E = a.value;
|
|
1833
|
+
this.i18n.setLanguage(E), this.onLanguageChangedCallback && this.onLanguageChangedCallback(E), this.renderContent();
|
|
1794
1834
|
});
|
|
1795
|
-
const
|
|
1796
|
-
|
|
1835
|
+
const o = document.createElement("span");
|
|
1836
|
+
o.className = "axon-select-arrow", o.textContent = "▼", s.appendChild(a), s.appendChild(o), e.appendChild(i), e.appendChild(s);
|
|
1797
1837
|
const n = document.createElement("div");
|
|
1798
1838
|
n.className = "axon-setting-row";
|
|
1799
|
-
const
|
|
1800
|
-
|
|
1839
|
+
const r = document.createElement("span");
|
|
1840
|
+
r.textContent = this.i18n.translate("themeLabel");
|
|
1801
1841
|
const h = document.createElement("div");
|
|
1802
1842
|
h.className = "axon-toggle-group";
|
|
1803
1843
|
const c = [
|
|
@@ -1805,27 +1845,27 @@ class nt {
|
|
|
1805
1845
|
{ id: "dark", label: "DARK" },
|
|
1806
1846
|
{ id: "light", label: "LIGHT" }
|
|
1807
1847
|
];
|
|
1808
|
-
for (const
|
|
1848
|
+
for (const E of c) {
|
|
1809
1849
|
const g = document.createElement("button");
|
|
1810
|
-
g.type = "button", g.className = `axon-toggle-btn ${this.themeManager.getTheme() ===
|
|
1811
|
-
this.themeManager.setTheme(
|
|
1850
|
+
g.type = "button", g.className = `axon-toggle-btn ${this.themeManager.getTheme() === E.id ? "active" : ""}`, g.textContent = E.label, g.addEventListener("click", () => {
|
|
1851
|
+
this.themeManager.setTheme(E.id), this.renderContent();
|
|
1812
1852
|
}), h.appendChild(g);
|
|
1813
1853
|
}
|
|
1814
|
-
n.appendChild(
|
|
1854
|
+
n.appendChild(r), n.appendChild(h);
|
|
1815
1855
|
const u = document.createElement("div");
|
|
1816
1856
|
u.className = "axon-setting-row";
|
|
1817
1857
|
const p = document.createElement("span");
|
|
1818
1858
|
p.textContent = this.i18n.translate("hapticsLabel");
|
|
1819
1859
|
const f = document.createElement("div");
|
|
1820
1860
|
f.className = "axon-toggle-group";
|
|
1821
|
-
const
|
|
1861
|
+
const y = [
|
|
1822
1862
|
{ enabled: !0, label: this.i18n.translate("hapticsOn") },
|
|
1823
1863
|
{ enabled: !1, label: this.i18n.translate("hapticsOff") }
|
|
1824
1864
|
];
|
|
1825
|
-
for (const
|
|
1865
|
+
for (const E of y) {
|
|
1826
1866
|
const g = document.createElement("button");
|
|
1827
|
-
g.type = "button", g.className = `axon-toggle-btn ${this.hapticsEnabled ===
|
|
1828
|
-
this.hapticsEnabled =
|
|
1867
|
+
g.type = "button", g.className = `axon-toggle-btn ${this.hapticsEnabled === E.enabled ? "active" : ""}`, g.textContent = E.label, g.addEventListener("click", () => {
|
|
1868
|
+
this.hapticsEnabled = E.enabled, localStorage.setItem("axon_surge_haptics", String(E.enabled)), this.hapticsEnabled && this.platform.haptics.selectionChanged(), this.renderContent();
|
|
1829
1869
|
}), f.appendChild(g);
|
|
1830
1870
|
}
|
|
1831
1871
|
u.appendChild(p), u.appendChild(f);
|
|
@@ -1835,14 +1875,14 @@ class nt {
|
|
|
1835
1875
|
m.textContent = this.i18n.translate("tutorialSettingLabel");
|
|
1836
1876
|
const x = document.createElement("div");
|
|
1837
1877
|
x.className = "axon-toggle-group";
|
|
1838
|
-
const
|
|
1878
|
+
const S = localStorage.getItem("axon_surge_show_tutorial") !== "false", v = [
|
|
1839
1879
|
{ enabled: !0, label: this.i18n.translate("hapticsOn") },
|
|
1840
1880
|
{ enabled: !1, label: this.i18n.translate("hapticsOff") }
|
|
1841
1881
|
];
|
|
1842
|
-
for (const
|
|
1882
|
+
for (const E of v) {
|
|
1843
1883
|
const g = document.createElement("button");
|
|
1844
|
-
g.type = "button", g.className = `axon-toggle-btn ${
|
|
1845
|
-
localStorage.setItem("axon_surge_show_tutorial", String(
|
|
1884
|
+
g.type = "button", g.className = `axon-toggle-btn ${S === E.enabled ? "active" : ""}`, g.textContent = E.label, g.addEventListener("click", () => {
|
|
1885
|
+
localStorage.setItem("axon_surge_show_tutorial", String(E.enabled)), this.renderContent();
|
|
1846
1886
|
}), x.appendChild(g);
|
|
1847
1887
|
}
|
|
1848
1888
|
d.appendChild(m), d.appendChild(x);
|
|
@@ -1863,8 +1903,8 @@ class nt {
|
|
|
1863
1903
|
this.modal.close();
|
|
1864
1904
|
}
|
|
1865
1905
|
}
|
|
1866
|
-
const
|
|
1867
|
-
class
|
|
1906
|
+
const B = "axon_surge_show_tutorial";
|
|
1907
|
+
class ct {
|
|
1868
1908
|
isActive = !1;
|
|
1869
1909
|
showWarning = !1;
|
|
1870
1910
|
dummyLauncher = null;
|
|
@@ -1873,14 +1913,14 @@ class ot {
|
|
|
1873
1913
|
initialTargetPos = { x: 0, y: 0 };
|
|
1874
1914
|
isTutorialEnabled() {
|
|
1875
1915
|
try {
|
|
1876
|
-
return localStorage.getItem(
|
|
1916
|
+
return localStorage.getItem(B) !== "false";
|
|
1877
1917
|
} catch {
|
|
1878
1918
|
return !0;
|
|
1879
1919
|
}
|
|
1880
1920
|
}
|
|
1881
1921
|
setTutorialEnabled(t) {
|
|
1882
1922
|
try {
|
|
1883
|
-
localStorage.setItem(
|
|
1923
|
+
localStorage.setItem(B, String(t));
|
|
1884
1924
|
} catch {
|
|
1885
1925
|
}
|
|
1886
1926
|
}
|
|
@@ -1898,11 +1938,11 @@ class ot {
|
|
|
1898
1938
|
this.isActive = !1;
|
|
1899
1939
|
return;
|
|
1900
1940
|
}
|
|
1901
|
-
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 =
|
|
1941
|
+
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 = L.createEnemy(
|
|
1902
1942
|
"piercer",
|
|
1903
1943
|
this.initialLauncherPos,
|
|
1904
1944
|
this.initialTargetPos
|
|
1905
|
-
), this.dummyLauncher.velocity = { x: 0, y: 0 }, this.dummyTarget =
|
|
1945
|
+
), this.dummyLauncher.velocity = { x: 0, y: 0 }, this.dummyTarget = L.createEnemy(
|
|
1906
1946
|
"spore",
|
|
1907
1947
|
this.initialTargetPos,
|
|
1908
1948
|
this.initialLauncherPos
|
|
@@ -1910,27 +1950,27 @@ class ot {
|
|
|
1910
1950
|
}
|
|
1911
1951
|
update(t, e, i, s, a, l) {
|
|
1912
1952
|
if (!this.isActive || !this.dummyLauncher || !this.dummyTarget) return;
|
|
1913
|
-
const
|
|
1914
|
-
e.includes(
|
|
1915
|
-
const
|
|
1916
|
-
if (
|
|
1917
|
-
if (this.showWarning = !1, c <=
|
|
1918
|
-
l && l(),
|
|
1953
|
+
const o = this.dummyLauncher, n = this.dummyTarget;
|
|
1954
|
+
e.includes(o) || e.push(o), e.includes(n) || e.push(n);
|
|
1955
|
+
const r = n.position.x - o.position.x, h = n.position.y - o.position.y, c = Math.hypot(r, h);
|
|
1956
|
+
if (o.isGrabbed) {
|
|
1957
|
+
if (this.showWarning = !1, c <= o.radius + n.radius + 60) {
|
|
1958
|
+
l && l(), o.isGrabbed = !1, this.showWarning = !0, this.resetDummies(o, n);
|
|
1919
1959
|
return;
|
|
1920
1960
|
}
|
|
1921
1961
|
return;
|
|
1922
1962
|
}
|
|
1923
|
-
if (
|
|
1924
|
-
const u = Math.hypot(
|
|
1925
|
-
if (!
|
|
1926
|
-
l && l(), this.showWarning = !0, this.resetDummies(
|
|
1963
|
+
if (o.wasManipulated) {
|
|
1964
|
+
const u = Math.hypot(o.velocity.x, o.velocity.y);
|
|
1965
|
+
if (!o.isThrown || u < 70) {
|
|
1966
|
+
l && l(), this.showWarning = !0, this.resetDummies(o, n);
|
|
1927
1967
|
return;
|
|
1928
1968
|
}
|
|
1929
|
-
if (c <=
|
|
1930
|
-
|
|
1969
|
+
if (c <= o.getHitRadius() + n.getHitRadius()) {
|
|
1970
|
+
o.triggerDissolveDeath(), n.triggerDissolveDeath(), this.showWarning = !1, this.isActive = !1, a();
|
|
1931
1971
|
return;
|
|
1932
1972
|
}
|
|
1933
|
-
(
|
|
1973
|
+
(o.position.x < -60 || o.position.x > i + 60 || o.position.y < -60 || o.position.y > s + 60 || u < 40) && (l && l(), this.showWarning = !0, this.resetDummies(o, n));
|
|
1934
1974
|
}
|
|
1935
1975
|
}
|
|
1936
1976
|
resetDummies(t, e) {
|
|
@@ -1940,7 +1980,7 @@ class ot {
|
|
|
1940
1980
|
this.isActive = !1, this.showWarning = !1;
|
|
1941
1981
|
}
|
|
1942
1982
|
}
|
|
1943
|
-
class
|
|
1983
|
+
class dt {
|
|
1944
1984
|
container;
|
|
1945
1985
|
i18n;
|
|
1946
1986
|
tutorialManager;
|
|
@@ -1976,7 +2016,7 @@ class rt {
|
|
|
1976
2016
|
this.container.style.display = "none";
|
|
1977
2017
|
}
|
|
1978
2018
|
}
|
|
1979
|
-
class
|
|
2019
|
+
class ut {
|
|
1980
2020
|
fillElement;
|
|
1981
2021
|
killsCount = 0;
|
|
1982
2022
|
currentLevel = 1;
|
|
@@ -2007,7 +2047,7 @@ class ht {
|
|
|
2007
2047
|
this.fillElement && this.fillElement.parentElement && (this.fillElement.parentElement.style.display = "none");
|
|
2008
2048
|
}
|
|
2009
2049
|
}
|
|
2010
|
-
class
|
|
2050
|
+
class pt {
|
|
2011
2051
|
haptics = {
|
|
2012
2052
|
impact: async (t) => {
|
|
2013
2053
|
if ("vibrate" in navigator) {
|
|
@@ -2047,7 +2087,7 @@ class lt {
|
|
|
2047
2087
|
}
|
|
2048
2088
|
};
|
|
2049
2089
|
}
|
|
2050
|
-
class
|
|
2090
|
+
class mt {
|
|
2051
2091
|
container;
|
|
2052
2092
|
canvas;
|
|
2053
2093
|
i18n;
|
|
@@ -2079,7 +2119,7 @@ class ct {
|
|
|
2079
2119
|
isRunning = !1;
|
|
2080
2120
|
isPaused = !1;
|
|
2081
2121
|
constructor(t) {
|
|
2082
|
-
this.container = t.root, this.container.classList.add("axon-game-root"), this.i18n = new
|
|
2122
|
+
this.container = t.root, this.container.classList.add("axon-game-root"), this.i18n = new $(t.language), this.themeManager = new it(t.theme, this.container), this.platform = t.platform || new pt(), 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 Y(this.canvas.width / 2, this.canvas.height / 2), this.inputManager = new J(this.canvas), this.physicsEngine = new Q(this.eventBus, this.i18n), this.waveDirector = new et(), this.renderer = new ot(this.canvas, this.themeManager), this.juice = new X(), this.settingsModal = new lt(
|
|
2083
2123
|
this.container,
|
|
2084
2124
|
this.i18n,
|
|
2085
2125
|
this.themeManager,
|
|
@@ -2088,11 +2128,11 @@ class ct {
|
|
|
2088
2128
|
() => {
|
|
2089
2129
|
this.isPaused = !1;
|
|
2090
2130
|
}
|
|
2091
|
-
), this.interactiveTutorial = new
|
|
2131
|
+
), this.interactiveTutorial = new ct(), this.tutorialOverlay = new dt(this.container, this.i18n, this.interactiveTutorial), this.hud = new rt(this.container, this.i18n, () => {
|
|
2092
2132
|
this.isPaused = !0, this.settingsModal.show();
|
|
2093
|
-
}), this.hud.show(), this.progressBar = new
|
|
2133
|
+
}), this.hud.show(), this.progressBar = new ut(this.hud.progressSlot, (e) => {
|
|
2094
2134
|
this.waveDirector.wave = e;
|
|
2095
|
-
}), this.startMenu = new
|
|
2135
|
+
}), this.startMenu = new ht(this.container, this.i18n, () => this.startGame()), this.initAmbientArena(), this.gameLoop = new F(
|
|
2096
2136
|
(e) => this.update(e),
|
|
2097
2137
|
() => this.render()
|
|
2098
2138
|
), this.setupEvents(), this.gameLoop.start();
|
|
@@ -2103,6 +2143,12 @@ class ct {
|
|
|
2103
2143
|
setTheme(t) {
|
|
2104
2144
|
this.themeManager.setTheme(t);
|
|
2105
2145
|
}
|
|
2146
|
+
getLanguage() {
|
|
2147
|
+
return this.i18n.getLanguage();
|
|
2148
|
+
}
|
|
2149
|
+
getTheme() {
|
|
2150
|
+
return this.themeManager.getTheme();
|
|
2151
|
+
}
|
|
2106
2152
|
onLanguageChanged(t) {
|
|
2107
2153
|
this.startMenu.renderContent(), this.hud.renderLabels(), this.tutorialOverlay.updateLanguage();
|
|
2108
2154
|
}
|
|
@@ -2113,11 +2159,11 @@ class ct {
|
|
|
2113
2159
|
const i = t[e % t.length], s = e * Math.PI * 2 / 16, a = 180 + Math.random() * 220, l = {
|
|
2114
2160
|
x: this.canvas.width / 2 + Math.cos(s) * a,
|
|
2115
2161
|
y: this.canvas.height / 2 + Math.sin(s) * a
|
|
2116
|
-
},
|
|
2162
|
+
}, o = L.createEnemy(i, l, {
|
|
2117
2163
|
x: l.x + Math.sin(s) * 100,
|
|
2118
2164
|
y: l.y - Math.cos(s) * 100
|
|
2119
2165
|
});
|
|
2120
|
-
this.ambientEnemies.push(
|
|
2166
|
+
this.ambientEnemies.push(o);
|
|
2121
2167
|
}
|
|
2122
2168
|
}
|
|
2123
2169
|
resizeCanvas() {
|
|
@@ -2207,15 +2253,18 @@ class ct {
|
|
|
2207
2253
|
this.interactiveTutorial.isActive ? this.interactiveTutorial : void 0
|
|
2208
2254
|
);
|
|
2209
2255
|
}
|
|
2256
|
+
destroy() {
|
|
2257
|
+
this.gameLoop.stop(), this.canvas.remove();
|
|
2258
|
+
}
|
|
2210
2259
|
}
|
|
2211
|
-
function
|
|
2212
|
-
return new
|
|
2260
|
+
function gt(T) {
|
|
2261
|
+
return new mt(T);
|
|
2213
2262
|
}
|
|
2214
2263
|
export {
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2264
|
+
pt as BrowserPlatform,
|
|
2265
|
+
mt as GameEngine,
|
|
2266
|
+
K as LANGUAGES,
|
|
2267
|
+
it as ThemeManager,
|
|
2268
|
+
gt as createAxonSurge,
|
|
2269
|
+
P as isLanguage
|
|
2221
2270
|
};
|