@moonwitness/ui 7.3.0 → 8.0.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.
Files changed (261) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/pixelfx-boundary.js +1 -1
  3. package/package.json +2 -3
  4. package/scripts/consumer-smoke.mjs +0 -45
  5. package/scripts/generate-icons.mjs +0 -110
  6. package/scripts/generate-token-artifacts.mjs +0 -90
  7. package/scripts/icon-svg-to-jsx.mjs +0 -249
  8. package/scripts/verification-diagnostics.mjs +0 -40
  9. package/scripts/verify-package.mjs +0 -412
  10. package/src/cartoon/anime-avatar.tsx +0 -628
  11. package/src/cartoon/anime-stage.tsx +0 -458
  12. package/src/cartoon/index.tsx +0 -542
  13. package/src/cartoon.tsx +0 -645
  14. package/src/characters.ts +0 -625
  15. package/src/components/accordion.tsx +0 -77
  16. package/src/components/alert.tsx +0 -139
  17. package/src/components/appearance-menu.tsx +0 -181
  18. package/src/components/artwork-frame.tsx +0 -49
  19. package/src/components/audio.tsx +0 -97
  20. package/src/components/avatar.tsx +0 -75
  21. package/src/components/badge.tsx +0 -94
  22. package/src/components/brand-mark.tsx +0 -73
  23. package/src/components/breadcrumbs.tsx +0 -98
  24. package/src/components/button.tsx +0 -340
  25. package/src/components/card.tsx +0 -171
  26. package/src/components/character-badge.tsx +0 -58
  27. package/src/components/character-preview.tsx +0 -104
  28. package/src/components/character-stage.tsx +0 -225
  29. package/src/components/chart.tsx +0 -481
  30. package/src/components/checkbox.tsx +0 -64
  31. package/src/components/comic-panel.tsx +0 -301
  32. package/src/components/comic-theater.tsx +0 -170
  33. package/src/components/command.tsx +0 -189
  34. package/src/components/confirm-dialog.tsx +0 -129
  35. package/src/components/copy-button.tsx +0 -62
  36. package/src/components/date-picker.tsx +0 -126
  37. package/src/components/dialog.tsx +0 -164
  38. package/src/components/dna-icon.tsx +0 -77
  39. package/src/components/dropdown-menu.tsx +0 -87
  40. package/src/components/effects.tsx +0 -1021
  41. package/src/components/empty-state.tsx +0 -93
  42. package/src/components/epistemic-branch-panel.tsx +0 -101
  43. package/src/components/error-state.tsx +0 -137
  44. package/src/components/field.tsx +0 -96
  45. package/src/components/filter-facet-bar.tsx +0 -91
  46. package/src/components/inbox-popover.tsx +0 -146
  47. package/src/components/input.tsx +0 -25
  48. package/src/components/kanban-board.tsx +0 -190
  49. package/src/components/label.tsx +0 -19
  50. package/src/components/layered-scene.tsx +0 -555
  51. package/src/components/log-console.tsx +0 -261
  52. package/src/components/metric-tile.tsx +0 -99
  53. package/src/components/mode-picker.tsx +0 -149
  54. package/src/components/motion-timeline.tsx +0 -848
  55. package/src/components/number-input.tsx +0 -104
  56. package/src/components/page-header.tsx +0 -123
  57. package/src/components/pagination.tsx +0 -83
  58. package/src/components/panel.tsx +0 -121
  59. package/src/components/paper-note.tsx +0 -77
  60. package/src/components/popover.tsx +0 -72
  61. package/src/components/progress.tsx +0 -127
  62. package/src/components/quest-card.tsx +0 -319
  63. package/src/components/radio-group.tsx +0 -50
  64. package/src/components/riot-sticker.tsx +0 -151
  65. package/src/components/scene-particles.tsx +0 -196
  66. package/src/components/scene-transitions.tsx +0 -130
  67. package/src/components/section-ribbon.tsx +0 -94
  68. package/src/components/select-field.tsx +0 -27
  69. package/src/components/select.tsx +0 -81
  70. package/src/components/separator.tsx +0 -58
  71. package/src/components/sheet.tsx +0 -96
  72. package/src/components/skeleton.tsx +0 -35
  73. package/src/components/sketch-annotation.tsx +0 -87
  74. package/src/components/smart-button-box.tsx +0 -114
  75. package/src/components/speech-bubble.tsx +0 -116
  76. package/src/components/spinner.tsx +0 -69
  77. package/src/components/sprite-player.tsx +0 -412
  78. package/src/components/status-bar.tsx +0 -63
  79. package/src/components/status-pill.tsx +0 -68
  80. package/src/components/switch.tsx +0 -76
  81. package/src/components/table.tsx +0 -163
  82. package/src/components/tabs.tsx +0 -101
  83. package/src/components/tag-input.tsx +0 -170
  84. package/src/components/textarea.tsx +0 -25
  85. package/src/components/toast.tsx +0 -14
  86. package/src/components/toolbar.tsx +0 -39
  87. package/src/components/tooltip.tsx +0 -49
  88. package/src/components/update-banner.tsx +0 -220
  89. package/src/components/xv-primitives.tsx +0 -256
  90. package/src/css-exports.ts +0 -142
  91. package/src/dna.tsx +0 -137
  92. package/src/game/boss-hud.tsx +0 -384
  93. package/src/game/index.tsx +0 -886
  94. package/src/game/tactical.tsx +0 -245
  95. package/src/game.tsx +0 -770
  96. package/src/icons/activity.tsx +0 -38
  97. package/src/icons/add.tsx +0 -38
  98. package/src/icons/addon.tsx +0 -37
  99. package/src/icons/anime-anger.tsx +0 -37
  100. package/src/icons/anime-shock.tsx +0 -37
  101. package/src/icons/anime-sparkle.tsx +0 -38
  102. package/src/icons/anime-sweatdrop.tsx +0 -38
  103. package/src/icons/archive.tsx +0 -37
  104. package/src/icons/arrow-left.tsx +0 -37
  105. package/src/icons/arrow-right.tsx +0 -37
  106. package/src/icons/attachment.tsx +0 -38
  107. package/src/icons/bank.tsx +0 -37
  108. package/src/icons/bolt.tsx +0 -37
  109. package/src/icons/book-open.tsx +0 -37
  110. package/src/icons/bookmark.tsx +0 -37
  111. package/src/icons/boss-skull.tsx +0 -40
  112. package/src/icons/calendar-clock.tsx +0 -40
  113. package/src/icons/calendar.tsx +0 -38
  114. package/src/icons/check-circle.tsx +0 -38
  115. package/src/icons/check-square.tsx +0 -38
  116. package/src/icons/check.tsx +0 -37
  117. package/src/icons/chevron-right.tsx +0 -37
  118. package/src/icons/chevrons-left.tsx +0 -37
  119. package/src/icons/chevrons-right.tsx +0 -37
  120. package/src/icons/clapperboard.tsx +0 -38
  121. package/src/icons/clock.tsx +0 -38
  122. package/src/icons/close.tsx +0 -37
  123. package/src/icons/code.tsx +0 -37
  124. package/src/icons/columns.tsx +0 -38
  125. package/src/icons/combo-flame.tsx +0 -38
  126. package/src/icons/company.tsx +0 -38
  127. package/src/icons/credit-card.tsx +0 -38
  128. package/src/icons/critical-star.tsx +0 -37
  129. package/src/icons/currency.tsx +0 -38
  130. package/src/icons/delete.tsx +0 -37
  131. package/src/icons/document.tsx +0 -38
  132. package/src/icons/download.tsx +0 -37
  133. package/src/icons/dpad.tsx +0 -38
  134. package/src/icons/edit.tsx +0 -38
  135. package/src/icons/element-fire.tsx +0 -37
  136. package/src/icons/element-ice.tsx +0 -38
  137. package/src/icons/element-solar.tsx +0 -38
  138. package/src/icons/element-void.tsx +0 -38
  139. package/src/icons/element-volt.tsx +0 -38
  140. package/src/icons/element-wind.tsx +0 -37
  141. package/src/icons/error.tsx +0 -38
  142. package/src/icons/external-link.tsx +0 -38
  143. package/src/icons/field.tsx +0 -38
  144. package/src/icons/file-spreadsheet.tsx +0 -38
  145. package/src/icons/filter.tsx +0 -37
  146. package/src/icons/gacha-ticket.tsx +0 -38
  147. package/src/icons/gamepad.tsx +0 -40
  148. package/src/icons/globe.tsx +0 -38
  149. package/src/icons/grid.tsx +0 -40
  150. package/src/icons/hash.tsx +0 -37
  151. package/src/icons/heart-hp.tsx +0 -38
  152. package/src/icons/history.tsx +0 -37
  153. package/src/icons/home.tsx +0 -37
  154. package/src/icons/image.tsx +0 -39
  155. package/src/icons/impact-slash.tsx +0 -38
  156. package/src/icons/inbox.tsx +0 -38
  157. package/src/icons/index.ts +0 -120
  158. package/src/icons/info.tsx +0 -38
  159. package/src/icons/jobs.tsx +0 -38
  160. package/src/icons/katana.tsx +0 -38
  161. package/src/icons/key.tsx +0 -38
  162. package/src/icons/keyboard.tsx +0 -38
  163. package/src/icons/keyframe-diamond.tsx +0 -38
  164. package/src/icons/knowledge.tsx +0 -38
  165. package/src/icons/language.tsx +0 -39
  166. package/src/icons/lock.tsx +0 -38
  167. package/src/icons/logout.tsx +0 -37
  168. package/src/icons/loot-chest.tsx +0 -39
  169. package/src/icons/mail.tsx +0 -38
  170. package/src/icons/mana-crystal.tsx +0 -38
  171. package/src/icons/map-pin.tsx +0 -38
  172. package/src/icons/mecha-helm.tsx +0 -38
  173. package/src/icons/menu.tsx +0 -37
  174. package/src/icons/message.tsx +0 -38
  175. package/src/icons/model.tsx +0 -38
  176. package/src/icons/moon.tsx +0 -37
  177. package/src/icons/notification.tsx +0 -38
  178. package/src/icons/partner.tsx +0 -41
  179. package/src/icons/pause.tsx +0 -37
  180. package/src/icons/phone.tsx +0 -37
  181. package/src/icons/play.tsx +0 -37
  182. package/src/icons/potion-flask.tsx +0 -40
  183. package/src/icons/quest-scroll.tsx +0 -39
  184. package/src/icons/radar-ping.tsx +0 -40
  185. package/src/icons/refresh.tsx +0 -38
  186. package/src/icons/relation.tsx +0 -40
  187. package/src/icons/save.tsx +0 -38
  188. package/src/icons/search.tsx +0 -38
  189. package/src/icons/security.tsx +0 -38
  190. package/src/icons/send.tsx +0 -38
  191. package/src/icons/settings.tsx +0 -39
  192. package/src/icons/shield-crest.tsx +0 -38
  193. package/src/icons/shuriken.tsx +0 -38
  194. package/src/icons/signal-off.tsx +0 -37
  195. package/src/icons/signal.tsx +0 -37
  196. package/src/icons/skill-node.tsx +0 -40
  197. package/src/icons/smartphone.tsx +0 -38
  198. package/src/icons/sort-ascending.tsx +0 -37
  199. package/src/icons/sort-descending.tsx +0 -37
  200. package/src/icons/sort.tsx +0 -37
  201. package/src/icons/sparkle.tsx +0 -38
  202. package/src/icons/speech-burst.tsx +0 -37
  203. package/src/icons/story.tsx +0 -37
  204. package/src/icons/sun.tsx +0 -38
  205. package/src/icons/tag.tsx +0 -38
  206. package/src/icons/team.tsx +0 -40
  207. package/src/icons/trophy-crown.tsx +0 -39
  208. package/src/icons/upload.tsx +0 -37
  209. package/src/icons/user.tsx +0 -38
  210. package/src/icons/users.tsx +0 -39
  211. package/src/icons/visibility-off.tsx +0 -38
  212. package/src/icons/visibility.tsx +0 -38
  213. package/src/icons/volume-off.tsx +0 -37
  214. package/src/icons/volume.tsx +0 -37
  215. package/src/icons/warning.tsx +0 -38
  216. package/src/icons/workflow.tsx +0 -40
  217. package/src/icons.tsx +0 -965
  218. package/src/index.ts +0 -89
  219. package/src/lib/asset-registry.ts +0 -534
  220. package/src/lib/audio-runtime.ts +0 -314
  221. package/src/lib/character-adapter.ts +0 -370
  222. package/src/lib/character-registry.ts +0 -2368
  223. package/src/lib/cn.ts +0 -6
  224. package/src/lib/compose-refs.ts +0 -16
  225. package/src/lib/sanitize-url.ts +0 -51
  226. package/src/lib/scene-camera.ts +0 -483
  227. package/src/lib/scene-playback.ts +0 -622
  228. package/src/lib/scene-soundscape.ts +0 -151
  229. package/src/lib/scene-test-harness.ts +0 -200
  230. package/src/lib/scene-timeline.ts +0 -398
  231. package/src/lib/use-animation-visibility.ts +0 -45
  232. package/src/lib/use-modal-focus.ts +0 -270
  233. package/src/lib/use-reduced-motion.ts +0 -37
  234. package/src/motion/easing-presets.ts +0 -262
  235. package/src/motion/index.tsx +0 -894
  236. package/src/motion/physics.ts +0 -259
  237. package/src/motion/timeline-math.ts +0 -358
  238. package/src/motion.tsx +0 -639
  239. package/src/pixelfx-boundary.ts +0 -188
  240. package/src/pixelfx-registry.ts +0 -1190
  241. package/src/pixelfx-types.d.ts +0 -73
  242. package/src/pixelfx.tsx +0 -1022
  243. package/src/provider.tsx +0 -63
  244. package/src/skin-catalog.ts +0 -306
  245. package/src/skin-tokens.ts +0 -425
  246. package/src/ssr/init-script.ts +0 -281
  247. package/src/ssr/resolve-skin.ts +0 -217
  248. package/src/ssr/theme-mismatch-dev.ts +0 -181
  249. package/src/templates/battle-arena.tsx +0 -688
  250. package/src/templates/index.tsx +0 -314
  251. package/src/templates.tsx +0 -225
  252. package/src/themes/dna-presets.ts +0 -119
  253. package/src/themes/index.ts +0 -56
  254. package/src/themes/provider.tsx +0 -183
  255. package/src/themes/types.ts +0 -111
  256. package/src/themes.ts +0 -9
  257. package/src/token-exporter.ts +0 -12
  258. package/src/token-exporters.ts +0 -343
  259. package/src/token-seeds.ts +0 -335
  260. package/src/token-snapshot.ts +0 -179
  261. package/src/utils.ts +0 -58
@@ -1,688 +0,0 @@
1
- "use client";
2
-
3
- import {
4
- useCallback,
5
- useEffect,
6
- useMemo,
7
- useState,
8
- type KeyboardEvent,
9
- } from "react";
10
- import { Badge } from "../components/badge.js";
11
- import { Button } from "../components/button.js";
12
- import {
13
- getBossCharacters,
14
- getCharacterById,
15
- getPlayableCharacters,
16
- rollGachaCharacter,
17
- } from "../lib/character-registry.js";
18
- import { MotionStage, ScreenFXOverlay, useMotion } from "../motion/index.js";
19
- import {
20
- AchievementToast,
21
- ActionHotbar,
22
- BossHealthBar,
23
- ComboCounter,
24
- DialogueBox,
25
- FloatingCombatText,
26
- InputPromptBadge,
27
- LootRevealCard,
28
- PauseMenuOverlay,
29
- RadialMenu,
30
- StatGauge,
31
- TacticalRadar,
32
- TurnOrderStrip,
33
- type CombatTextEvent,
34
- type HotbarSlotItem,
35
- type RadarBlip,
36
- type TurnOrderEntry,
37
- } from "../game/index.js";
38
- import {
39
- AnimeCutIn,
40
- CartoonRig,
41
- EpisodeTitleCard,
42
- SmearFrame,
43
- StoryboardPlayer,
44
- VisualNovelStage,
45
- type StoryboardBeat,
46
- type VisualNovelLine,
47
- } from "../cartoon/index.js";
48
- import { KatanaIcon } from "../icons/katana.js";
49
- import { CriticalStarIcon } from "../icons/critical-star.js";
50
- import { PotionFlaskIcon } from "../icons/potion-flask.js";
51
- import { ShieldCrestIcon } from "../icons/shield-crest.js";
52
-
53
- const PLAYABLE_HEROES = getPlayableCharacters();
54
- const ECLIPSE_BOSSES = getBossCharacters();
55
-
56
- const RADAR_BLIPS: readonly RadarBlip[] = [
57
- { id: "b1", label: "Boss", x: 0.45, y: -0.42, kind: "boss" },
58
- { id: "b2", label: "Ally", x: -0.35, y: 0.25, kind: "ally" },
59
- { id: "b3", label: "Relic", x: 0.12, y: 0.56, kind: "objective" },
60
- { id: "b4", label: "Drone", x: -0.52, y: -0.3, kind: "enemy" },
61
- ];
62
-
63
- export function GameBattleTemplate() {
64
- const { triggerSfx } = useMotion();
65
- const [heroId, setHeroId] = useState(PLAYABLE_HEROES[0]?.id ?? "kuro-signal");
66
- const [bossId, setBossId] = useState(ECLIPSE_BOSSES[0]?.id ?? "lord-null");
67
-
68
- const hero = getCharacterById(heroId) ?? PLAYABLE_HEROES[0]!;
69
- const boss = getCharacterById(bossId) ?? ECLIPSE_BOSSES[0]!;
70
-
71
- const [hp, setHp] = useState(92);
72
- const [mp, setMp] = useState(80);
73
- const [xp, setXp] = useState(45);
74
- const [bossHp, setBossHp] = useState(boss.stats.hp);
75
- const [stagger, setStagger] = useState(35);
76
- const [combo, setCombo] = useState(6);
77
- const [paused, setPaused] = useState(false);
78
- const [flashFx, setFlashFx] = useState(false);
79
- const [speedlinesFx, setSpeedlinesFx] = useState(false);
80
- const [shakeSeed, setShakeSeed] = useState(0);
81
- const [shakeIntensity, setShakeIntensity] = useState(0);
82
- const [hitstopMs, setHitstopMs] = useState(0);
83
- const [heroPose, setHeroPose] = useState<
84
- "idle" | "attack" | "victory" | "hurt"
85
- >("idle");
86
- const [cutInOpen, setCutInOpen] = useState(false);
87
- const [trophyOpen, setTrophyOpen] = useState(false);
88
- const [lootCharacterId, setLootCharacterId] = useState<string | null>(null);
89
- const [lootRevealed, setLootRevealed] = useState(false);
90
- const [dialogueStep, setDialogueStep] = useState(0);
91
- const [radialAction, setRadialAction] = useState("slash");
92
- const [events, setEvents] = useState<CombatTextEvent[]>([]);
93
- const [cooldowns, setCooldowns] = useState<Record<string, number>>({});
94
-
95
- useEffect(() => {
96
- setBossHp(boss.stats.hp);
97
- setStagger(25);
98
- setLootCharacterId(null);
99
- setLootRevealed(false);
100
- }, [boss.id, boss.stats.hp]);
101
-
102
- useEffect(() => {
103
- const activeIds = Object.keys(cooldowns).filter(
104
- (k) => (cooldowns[k] ?? 0) > 0,
105
- );
106
- if (activeIds.length === 0) return;
107
- const timer = window.setInterval(() => {
108
- setCooldowns((prev) => {
109
- const next: Record<string, number> = {};
110
- for (const [k, v] of Object.entries(prev)) {
111
- const updated = Math.max(0, Math.round((v - 0.2) * 10) / 10);
112
- if (updated > 0) next[k] = updated;
113
- }
114
- return next;
115
- });
116
- }, 200);
117
- return () => window.clearInterval(timer);
118
- }, [cooldowns]);
119
-
120
- const spawnCombatText = useCallback(
121
- (text: string, tone: CombatTextEvent["tone"]) => {
122
- const id = Date.now() + Math.random();
123
- const xPercent = 30 + Math.round(Math.random() * 38);
124
- setEvents((prev) => [
125
- ...prev.slice(-4),
126
- { id, text, tone, xPercent, yPercent: 28 },
127
- ]);
128
- window.setTimeout(() => {
129
- setEvents((prev) => prev.filter((item) => item.id !== id));
130
- }, 950);
131
- },
132
- [],
133
- );
134
-
135
- const triggerShake = useCallback((intensity: number, hitstop: number) => {
136
- setShakeIntensity(intensity);
137
- setHitstopMs(hitstop);
138
- setShakeSeed((s) => s + 1);
139
- }, []);
140
-
141
- const strikeBoss = useCallback(
142
- (damage: number, staggerGain: number, crit = false) => {
143
- const brokenBonus = stagger >= 100 ? 1.4 : 1;
144
- const finalDamage = Math.round(damage * brokenBonus);
145
- triggerSfx(crit ? "level-up" : "hit-impact", hero.voicePitch);
146
- setHeroPose("attack");
147
- window.setTimeout(() => setHeroPose("idle"), 260);
148
- setCombo((c) => c + (crit ? 4 : 2));
149
- setXp((x) => Math.min(100, x + (crit ? 16 : 9)));
150
- setStagger((s) => Math.min(100, s + staggerGain));
151
- setFlashFx(true);
152
- setSpeedlinesFx(crit);
153
- triggerShake(crit ? 9 : 4.5, crit ? 90 : 40);
154
- window.setTimeout(() => {
155
- setFlashFx(false);
156
- setSpeedlinesFx(false);
157
- }, 240);
158
- spawnCombatText(
159
- crit ? `-${finalDamage} CRIT!` : `-${finalDamage}`,
160
- crit ? "crit" : "damage",
161
- );
162
- setBossHp((prev) => {
163
- const next = Math.max(0, prev - finalDamage);
164
- if (next === 0 && prev > 0) {
165
- setHeroPose("victory");
166
- setTrophyOpen(true);
167
- setLootCharacterId(rollGachaCharacter(Date.now()).id);
168
- setLootRevealed(false);
169
- }
170
- return next;
171
- });
172
- },
173
- [hero.voicePitch, stagger, triggerSfx, triggerShake, spawnCombatText],
174
- );
175
-
176
- const triggerTakeHit = useCallback(
177
- (damage: number) => {
178
- triggerSfx("error-bonk");
179
- setHeroPose("hurt");
180
- window.setTimeout(() => setHeroPose("idle"), 260);
181
- setHp((prev) => Math.max(0, prev - damage));
182
- triggerShake(6, 55);
183
- spawnCombatText(`-${damage} HIT`, "damage");
184
- },
185
- [triggerSfx, triggerShake, spawnCombatText],
186
- );
187
-
188
- const triggerHeal = useCallback(() => {
189
- triggerSfx("success-chime");
190
- setHp((prev) => Math.min(100, prev + 24));
191
- setMp((prev) => Math.max(0, prev - 15));
192
- spawnCombatText("+24 HEAL", "heal");
193
- }, [triggerSfx, spawnCombatText]);
194
-
195
- const triggerUltimate = useCallback(() => {
196
- setCutInOpen(true);
197
- strikeBoss(hero.ultimate.power * 2, 45, true);
198
- window.setTimeout(() => setCutInOpen(false), 1850);
199
- }, [hero.ultimate.power, strikeBoss]);
200
-
201
- const resetBattle = useCallback(() => {
202
- triggerSfx("coin-pickup");
203
- setHp(100);
204
- setMp(100);
205
- setBossHp(boss.stats.hp);
206
- setStagger(0);
207
- setCombo(0);
208
- setHeroPose("idle");
209
- setLootCharacterId(null);
210
- setLootRevealed(false);
211
- setTrophyOpen(false);
212
- setPaused(false);
213
- spawnCombatText("RESET!", "status");
214
- }, [boss.stats.hp, spawnCombatText, triggerSfx]);
215
-
216
- const hotbarItems: HotbarSlotItem[] = [
217
- {
218
- id: "slash",
219
- label: "Slash",
220
- hotkey: "1",
221
- icon: <KatanaIcon size={18} aria-hidden="true" />,
222
- rarity: "common",
223
- cooldownProgress: (cooldowns.slash ?? 0) / 1.4,
224
- cooldownSeconds: cooldowns.slash,
225
- },
226
- {
227
- id: "nova",
228
- label: "Nova Crit",
229
- hotkey: "2",
230
- icon: <CriticalStarIcon size={18} aria-hidden="true" />,
231
- rarity: "legendary",
232
- cooldownProgress: (cooldowns.nova ?? 0) / 2.2,
233
- cooldownSeconds: cooldowns.nova,
234
- },
235
- {
236
- id: "med",
237
- label: "Med Pulse",
238
- hotkey: "3",
239
- icon: <PotionFlaskIcon size={18} aria-hidden="true" />,
240
- rarity: "rare",
241
- count: 3,
242
- cooldownProgress: (cooldowns.med ?? 0) / 1.6,
243
- cooldownSeconds: cooldowns.med,
244
- },
245
- {
246
- id: "guard",
247
- label: "Reset Arena",
248
- hotkey: "4",
249
- icon: <ShieldCrestIcon size={18} aria-hidden="true" />,
250
- rarity: "epic",
251
- },
252
- ];
253
-
254
- const handleHotbar = useCallback(
255
- (item: HotbarSlotItem) => {
256
- if (item.id === "slash") {
257
- setCooldowns((c) => ({ ...c, slash: 1.4 }));
258
- strikeBoss(28, 22, false);
259
- } else if (item.id === "nova") {
260
- setCooldowns((c) => ({ ...c, nova: 2.2 }));
261
- strikeBoss(54, 38, true);
262
- } else if (item.id === "med") {
263
- setCooldowns((c) => ({ ...c, med: 1.6 }));
264
- triggerHeal();
265
- } else {
266
- resetBattle();
267
- }
268
- },
269
- [resetBattle, strikeBoss, triggerHeal],
270
- );
271
-
272
- const handleArenaKeyDown = useCallback(
273
- (event: KeyboardEvent<HTMLDivElement>) => {
274
- const target = event.target as HTMLElement | null;
275
- if (
276
- target &&
277
- (target.tagName === "INPUT" ||
278
- target.tagName === "SELECT" ||
279
- target.tagName === "TEXTAREA")
280
- ) {
281
- return;
282
- }
283
- if (event.key === "1") handleHotbar(hotbarItems[0]!);
284
- else if (event.key === "2") handleHotbar(hotbarItems[1]!);
285
- else if (event.key === "3") handleHotbar(hotbarItems[2]!);
286
- else if (event.key === "4") handleHotbar(hotbarItems[3]!);
287
- else if (event.key.toLowerCase() === "u") triggerUltimate();
288
- else if (event.key === "Escape") setPaused((p) => !p);
289
- },
290
- [handleHotbar, hotbarItems, triggerUltimate],
291
- );
292
-
293
- const turnEntries: TurnOrderEntry[] = useMemo(
294
- () => [
295
- { id: "t1", characterId: hero.id, team: "ally", actionValue: 0 },
296
- { id: "t2", characterId: "vesper-ink", team: "ally", actionValue: 14 },
297
- { id: "t3", characterId: boss.id, team: "enemy", actionValue: 22 },
298
- { id: "t4", characterId: "akira-pulse", team: "ally", actionValue: 31 },
299
- ],
300
- [hero.id, boss.id],
301
- );
302
-
303
- const activeDialogueChar = dialogueStep % 2 === 0 ? hero : boss;
304
- const activeDialogueText =
305
- activeDialogueChar.dialogueLines[
306
- dialogueStep % activeDialogueChar.dialogueLines.length
307
- ] ?? activeDialogueChar.ultimate.quote;
308
-
309
- return (
310
- <MotionStage
311
- tabIndex={0}
312
- onKeyDown={handleArenaKeyDown}
313
- shakeIntensity={shakeIntensity}
314
- shakeSeed={shakeSeed}
315
- hitstopMs={hitstopMs}
316
- className="mw-ui-template-shell mw-ui-template-game"
317
- data-testid="template-game-battle"
318
- >
319
- <ScreenFXOverlay effect="flash" active={flashFx} />
320
- <ScreenFXOverlay effect="speedlines-burst" active={speedlinesFx} />
321
- <ScreenFXOverlay effect="vignette" active={hp > 0 && hp <= 25} />
322
- <FloatingCombatText events={events} />
323
-
324
- <PauseMenuOverlay
325
- open={paused}
326
- onResume={() => setPaused(false)}
327
- onRestart={resetBattle}
328
- >
329
- <p className="mw-ui-template-hero-lead">
330
- Battle paused. Press Esc or Resume to return with keyboard hotkeys
331
- (1-4, U).
332
- </p>
333
- </PauseMenuOverlay>
334
-
335
- <div className="mw-ui-template-battle-bar">
336
- <div className="mw-ui-template-battle-pickers">
337
- <label>
338
- HERO{" "}
339
- <select
340
- aria-label="Select battle hero"
341
- className="mw-ui-template-battle-select"
342
- value={hero.id}
343
- onChange={(e) => setHeroId(e.target.value)}
344
- >
345
- {PLAYABLE_HEROES.map((c) => (
346
- <option key={c.id} value={c.id}>
347
- {c.name} ({c.faction})
348
- </option>
349
- ))}
350
- </select>
351
- </label>
352
- <label>
353
- BOSS{" "}
354
- <select
355
- aria-label="Select raid boss"
356
- className="mw-ui-template-battle-select"
357
- value={boss.id}
358
- onChange={(e) => setBossId(e.target.value)}
359
- >
360
- {ECLIPSE_BOSSES.map((c) => (
361
- <option key={c.id} value={c.id}>
362
- {c.name} ({c.stats.hp} HP)
363
- </option>
364
- ))}
365
- </select>
366
- </label>
367
- </div>
368
- <div className="mw-ui-template-actions">
369
- <Button size="sm" variant="default" onClick={triggerUltimate}>
370
- Ultimate Cut-In (U)
371
- </Button>
372
- <Button
373
- size="sm"
374
- variant="destructive"
375
- onClick={() => triggerTakeHit(22)}
376
- >
377
- Take Hit (-22)
378
- </Button>
379
- <Button size="sm" variant="outline" onClick={() => setPaused(true)}>
380
- Pause HUD
381
- </Button>
382
- </div>
383
- </div>
384
-
385
- <BossHealthBar
386
- characterId={boss.id}
387
- hp={bossHp}
388
- maxHp={boss.stats.hp}
389
- phases={3}
390
- stagger={stagger}
391
- broken={stagger >= 100}
392
- />
393
-
394
- <TurnOrderStrip entries={turnEntries} activeId="t1" />
395
-
396
- <AnimeCutIn
397
- active={cutInOpen}
398
- characterId={hero.id}
399
- onDismiss={() => setCutInOpen(false)}
400
- />
401
-
402
- <AchievementToast
403
- open={trophyOpen}
404
- title={`${boss.name} Vanquished!`}
405
- description="Multi-phase Eclipse boss cleared. Reveal your mythic summon reward below."
406
- points={350}
407
- rarity="mythic"
408
- onDismiss={() => setTrophyOpen(false)}
409
- />
410
-
411
- <div className="mw-ui-template-game-top">
412
- <div className="mw-ui-template-game-gauges">
413
- <StatGauge
414
- label={`${hero.name.toUpperCase()} HP`}
415
- value={hp}
416
- max={100}
417
- tone="hp"
418
- variant="arcade-skew"
419
- />
420
- <StatGauge
421
- label="ENERGY MP"
422
- value={mp}
423
- max={100}
424
- tone="mp"
425
- variant="segmented"
426
- segments={8}
427
- />
428
- <StatGauge
429
- label="SYNC XP"
430
- value={xp}
431
- max={100}
432
- tone="xp"
433
- variant="straight"
434
- />
435
- </div>
436
- <div className="mw-ui-template-game-right">
437
- <ComboCounter
438
- count={combo}
439
- decayProgress={Math.min(1, 0.35 + combo * 0.06)}
440
- />
441
- <TacticalRadar zoneLabel="ROOFTOP ARENA" blips={RADAR_BLIPS} />
442
- </div>
443
- </div>
444
-
445
- <div className="mw-ui-template-battle-stage">
446
- <div className="mw-ui-template-battle-fighter">
447
- <CartoonRig
448
- characterId={hero.id}
449
- pose={heroPose}
450
- emote={hp <= 25 ? "sweatdrop" : combo >= 10 ? "sparkle" : undefined}
451
- size="md"
452
- />
453
- <div>
454
- <Badge size="sm" variant="primary">
455
- {hero.codename} · {hero.element.toUpperCase()}
456
- </Badge>
457
- <p className="mw-ui-template-hero-lead">
458
- <strong>{hero.name}</strong> — {hero.title}
459
- </p>
460
- </div>
461
- </div>
462
- {lootCharacterId ? (
463
- <LootRevealCard
464
- characterId={lootCharacterId}
465
- revealed={lootRevealed}
466
- onRevealChange={setLootRevealed}
467
- />
468
- ) : (
469
- <div className="mw-ui-template-game-radial-wrap">
470
- <RadialMenu
471
- activeId={radialAction}
472
- options={[
473
- { id: "slash", label: "Strike", badge: "ATK" },
474
- { id: "guard", label: "Guard", badge: "DEF" },
475
- { id: "dash", label: "Ultimate", badge: "ULT" },
476
- { id: "item", label: "Heal", badge: "MED" },
477
- ]}
478
- onSelect={(opt) => {
479
- setRadialAction(opt.id);
480
- if (opt.id === "slash") strikeBoss(30, 20, false);
481
- else if (opt.id === "dash") triggerUltimate();
482
- else if (opt.id === "item") triggerHeal();
483
- else spawnCombatText("GUARD UP!", "status");
484
- }}
485
- />
486
- <div className="mw-ui-template-prompts">
487
- <InputPromptBadge
488
- input="1-4"
489
- platform="keyboard"
490
- actionLabel="Skills"
491
- />
492
- <InputPromptBadge
493
- input="U"
494
- platform="keyboard"
495
- actionLabel="Ultimate"
496
- />
497
- <InputPromptBadge
498
- input="A"
499
- platform="xbox"
500
- actionLabel="Strike"
501
- />
502
- <InputPromptBadge
503
- input="✕"
504
- platform="playstation"
505
- actionLabel="Advance"
506
- />
507
- </div>
508
- </div>
509
- )}
510
- </div>
511
-
512
- <ActionHotbar items={hotbarItems} onActivate={handleHotbar} />
513
-
514
- <DialogueBox
515
- characterId={activeDialogueChar.id}
516
- text={activeDialogueText}
517
- instant={false}
518
- choices={[
519
- {
520
- id: "strike",
521
- label: `Launch ${hero.ultimate.name}`,
522
- hint: "Cut-In",
523
- },
524
- { id: "heal", label: "Cast Field Med (+24 HP)", hint: "-15 MP" },
525
- ]}
526
- onChoiceSelect={(choice) => {
527
- if (choice.id === "strike") triggerUltimate();
528
- else triggerHeal();
529
- setDialogueStep((s) => s + 1);
530
- }}
531
- onAdvance={() => setDialogueStep((s) => s + 1)}
532
- />
533
- </MotionStage>
534
- );
535
- }
536
-
537
- const SAMPLE_STORYBOARD: readonly StoryboardBeat[] = [
538
- {
539
- id: "beat-1",
540
- label: "Entrance",
541
- durationMs: 2600,
542
- characterId: "kuro-signal",
543
- speaker: "Kuro",
544
- line: "Hold tight! Launching the MoonWitness cel-shaded anime & cartoon cutscene engine!",
545
- mood: "happy",
546
- emote: "sparkle",
547
- sfxWord: "WHOOSH!",
548
- sfxTone: "speed",
549
- audioCue: "zip",
550
- cameraZoom: 1,
551
- cameraX: 0,
552
- },
553
- {
554
- id: "beat-2",
555
- label: "Impact",
556
- durationMs: 2400,
557
- characterId: "pip-bounce",
558
- speaker: "Pip",
559
- line: "BOOM! Spiky starburst SFX, eye blinks, lip-sync phonemes, and squash-stretch all synced!",
560
- mood: "surprised",
561
- emote: "shock",
562
- sfxWord: "BOOM!",
563
- sfxTone: "impact",
564
- audioCue: "boing",
565
- cameraZoom: 1.08,
566
- cameraX: -8,
567
- impactFlash: true,
568
- },
569
- {
570
- id: "beat-3",
571
- label: "Finale",
572
- durationMs: 2600,
573
- characterId: "aria-lumina",
574
- speaker: "Aria",
575
- line: "Every character in our 30-character registry plugs directly into rigs, cut-ins, and VN stages.",
576
- mood: "determined",
577
- emote: "exclaim",
578
- sfxWord: "ZAP!",
579
- sfxTone: "electric",
580
- audioCue: "rimshot",
581
- cameraZoom: 1.03,
582
- cameraX: 6,
583
- },
584
- ];
585
-
586
- const SAMPLE_VN_LINES: readonly VisualNovelLine[] = [
587
- {
588
- id: "vn-1",
589
- speakerId: "kuro-signal",
590
- position: "left",
591
- mood: "determined",
592
- emote: "exclaim",
593
- text: "Lord Null just breached the rooftop broadcast relay. Ready for a synchronized Anime Cut-In?",
594
- },
595
- {
596
- id: "vn-2",
597
- speakerId: "vesper-ink",
598
- position: "center",
599
- mood: "neutral",
600
- emote: "sparkle",
601
- text: "I already locked the stagger curve. Give me the call and we shatter all three boss bars.",
602
- choices: [
603
- { id: "rush", label: "Full Rush — Trigger Overdrive Cut-In!" },
604
- { id: "sync", label: "Wait for Akira to boost our ATB Speed" },
605
- ],
606
- },
607
- {
608
- id: "vn-3",
609
- speakerId: "akira-pulse",
610
- position: "right",
611
- mood: "happy",
612
- emote: "sparkle",
613
- text: "Unified audio bus at 100%! Every character speaks at their own signature voice pitch.",
614
- },
615
- ];
616
-
617
- export function CartoonStudioTemplate() {
618
- const { triggerSfx } = useMotion();
619
- const [smearActive, setSmearActive] = useState(false);
620
- const [cutInPreview, setCutInPreview] = useState(false);
621
- const [episodeReplay, setEpisodeReplay] = useState(0);
622
-
623
- const triggerSmear = () => {
624
- setSmearActive(true);
625
- triggerSfx("zip");
626
- window.setTimeout(() => setSmearActive(false), 420);
627
- };
628
-
629
- return (
630
- <div className="mw-ui-template-shell" data-testid="template-cartoon-studio">
631
- <div className="mw-ui-template-app-bar">
632
- <div>
633
- <Badge variant="primary" size="sm">
634
- ANIME &amp; 2D CARTOON CUTSCENE STUDIO
635
- </Badge>
636
- <h3 className="mw-ui-template-section-title">
637
- Episode Card, Visual Novel Stage &amp; Storyboard
638
- </h3>
639
- </div>
640
- <div className="mw-ui-template-actions">
641
- <Button
642
- size="sm"
643
- variant="default"
644
- onClick={() => setCutInPreview((v) => !v)}
645
- >
646
- {cutInPreview ? "Hide Cut-In" : "Trigger Anime Cut-In"}
647
- </Button>
648
- <Button
649
- size="sm"
650
- variant="outline"
651
- onClick={() => setEpisodeReplay((n) => n + 1)}
652
- >
653
- Replay Title Card
654
- </Button>
655
- <Button size="sm" variant="outline" onClick={triggerSmear}>
656
- Smear Burst
657
- </Button>
658
- </div>
659
- </div>
660
-
661
- <EpisodeTitleCard
662
- episodeLabel="EPISODE 01"
663
- jpSubtitle="第1話・シグナル暴走"
664
- title="SIGNAL OVERDRIVE: MOONWITNESS AWAKENS"
665
- replayKey={episodeReplay}
666
- />
667
-
668
- <AnimeCutIn
669
- active={cutInPreview}
670
- characterId="kuro-signal"
671
- onDismiss={() => setCutInPreview(false)}
672
- />
673
-
674
- <VisualNovelStage
675
- sceneTitle="SCENE 01 · SIGNAL TOWER ROOFTOP"
676
- castIds={["kuro-signal", "vesper-ink", "akira-pulse"]}
677
- lines={SAMPLE_VN_LINES}
678
- />
679
-
680
- <SmearFrame active={smearActive} direction="right">
681
- <StoryboardPlayer
682
- title="EP-01 · Signal Drop"
683
- beats={SAMPLE_STORYBOARD}
684
- />
685
- </SmearFrame>
686
- </div>
687
- );
688
- }