Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
956c9e32f9 | ||
|
|
547044892d | ||
|
|
81d65bc381 | ||
|
|
bdae0007a1 | ||
|
|
c052b086f8 | ||
|
|
c2a14bac7d | ||
|
|
0d269a6041 | ||
|
|
99e97e5208 |
@@ -34,9 +34,43 @@
|
||||
- IWT2 rendering can use a 2D canvas/game runtime, but renderer objects must not become the source of truth for saveable gameplay state.
|
||||
- IWT2 needs continuous movement input: left analog stick on AYN Thor and WASD on keyboard. Do not rely only on existing menu-style navigation actions for arena movement.
|
||||
- IWT2 menus, dialogs, inventory, collection log, pause overlays, and game-select screen must still follow controller navigation requirements.
|
||||
- IWT2 boss mechanics and indicators must be modular. Add reusable hit-shape, damage/status, telegraph/indicator, hazard, and marker primitives under `src/modes/iwt2/sim/` or `src/modes/iwt2/render/` instead of hardcoding boss-specific rules in Phaser scenes. Boss AI may compose these primitives, but renderer code should draw sim-owned indicators generically.
|
||||
- Every IWT2 boss must have a boss pet collection-log reward. Add the pet to IWT2 boss reward metadata when adding the boss, and keep boss kill pet drops at a rare 1 in 500 chance.
|
||||
- IWT2 boss and party movement must be built with crowding and hazard escape in mind from the first implementation. New bosses must not rely on straight-line chase or single-vector hazard avoidance if the boss can create ground effects, wall pressure, summons, or multi-boss overlap.
|
||||
- IWT2 AI-controlled party members must be able to route around nearby ground effects and telegraphs using deterministic local steering/path scoring. Avoidance should consider hazard damage radius, telegraph danger, boss collision radius, nearby party members, wall clearance, and a center-safe bias when escaping danger.
|
||||
- IWT2 bosses must not be allowed to pin the tank, DPS, or themselves in arena corners. Any boss that chases, charges, pounces, relocates, or creates persistent hazards needs wall-disengage/relocation behavior and must avoid sustained wall contact.
|
||||
- IWT2 collision resolution must run after both party movement and boss movement so party-vs-boss and party-vs-party overlaps do not persist into damage, projectile, or hazard ticks. When resolving boss overlap near walls, prefer pushing party members toward arena center instead of clamping them deeper into the wall/corner.
|
||||
- Any new IWT2 boss or boss-pair change must be verified with forced simulation for that boss alone and in at least one two-boss pairing. Sim checks should look for sustained boss wall contact, live party overlap, party members stuck near hazards with near-zero movement, and deaths caused by corner pileups rather than intended mechanics.
|
||||
- First IWT2 boss conversion target: Bulldrome. Bulldrome should have normal melee tank damage, a charge across the arena that damages and knocks down/stuns hit players for 0.75 seconds, and every 3rd charge should be followed by an AoE ground slam around the boss that also damages and knocks down/stuns hit players for 0.75 seconds.
|
||||
- IWT2 starter party fantasy: player-controlled healer plus visible party members moving in the arena. Paladin tank holds aggro; ranger fires arrows; mage fires fireballs; rogue flanks; warrior fights in melee. Each class should have a distinct icon and color scheme.
|
||||
|
||||
## IWT2 Boss Asset Requirements
|
||||
|
||||
- IWT2 gameplay boss sprites should use side-view cel-shaded PNG art by default, not top-down token art.
|
||||
- Boss sprites should face right in source art. Renderer may flip sprites horizontally for left-facing movement; avoid 360-degree rotation for side-view sprites.
|
||||
- Use original creature designs only. Do not copy franchise art, silhouettes, armor layouts, or exact monster designs.
|
||||
- Generate full-body sprites with generous padding, crisp inked outlines, simple shaded color blocks, and strong silhouettes readable on the Thor main viewport.
|
||||
- Keep gameplay sprites transparent after processing, cropped to content plus padding, and sized appropriately for Thor. Prefer final PNGs around 512 px wide unless a smaller asset remains crisp.
|
||||
- Store IWT2 boss gameplay sprites under `public/iwt2/bosses/` using `<boss-id>-side-cel.png`.
|
||||
- In boss metadata, set `spriteUrl`, `spriteView: 'side'`, `spriteWidthScale`, `spriteHeightScale`, and `spriteYOffsetScale` so the rendered sprite preserves its source aspect ratio and reads well near party members.
|
||||
- Use a flat chroma-key source background for generated sprites, then remove it locally. Use `#00ff00` unless the boss has green/teal body colors; use `#ff00ff` for green/teal bosses. The key color must not appear in the boss.
|
||||
- Validate every final sprite has transparent corners and renders nonblank in the 960 x 540 Thor main viewport.
|
||||
|
||||
Base prompt for future IWT2 boss sprites:
|
||||
|
||||
```text
|
||||
Use case: stylized-concept
|
||||
Asset type: production game boss sprite for I Want To Heal 2 arena gameplay
|
||||
Primary request: side-view cel-shaded sprite of an original <boss fantasy> boss, facing right, full body visible
|
||||
Subject: <distinct silhouette, body plan, role/mechanic cues, readable combat posture>; original design, not copied from any franchise
|
||||
Style/medium: clean 2D cel-shaded action-game sprite, crisp inked outline, simple shaded color blocks, readable at small size
|
||||
Composition/framing: centered single character, side-view with slight 3/4 depth, full body, generous padding, no cropping
|
||||
Lighting/mood: clear high-contrast game lighting, readable over dark arena grid
|
||||
Color palette: <boss palette and accent colors>
|
||||
Scene/backdrop: perfectly flat solid <#00ff00 or #ff00ff> chroma-key background for background removal
|
||||
Constraints: background must be one uniform <key color> with no shadows, gradients, texture, floor plane, reflection, or lighting variation; do not use <key color> anywhere in the boss; no cast shadow; no text; no watermark; no UI; no logos
|
||||
```
|
||||
|
||||
## Performance Requirements
|
||||
|
||||
- Treat CPU, GPU, memory, battery, and startup cost as first-class constraints.
|
||||
|
||||
@@ -7,8 +7,8 @@ android {
|
||||
applicationId "com.warren.iwanttoheal"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 93
|
||||
versionName "1.1.14"
|
||||
versionCode 101
|
||||
versionName "1.1.22"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
aaptOptions {
|
||||
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
||||
|
||||
@@ -164,6 +164,9 @@ public abstract class ControllerBridgeActivity extends BridgeActivity {
|
||||
}
|
||||
|
||||
Set<String> currentTokens = new HashSet<>();
|
||||
float leftStickX = event.getAxisValue(MotionEvent.AXIS_X);
|
||||
float leftStickY = event.getAxisValue(MotionEvent.AXIS_Y);
|
||||
dispatchNativeControllerMotion(leftStickX, leftStickY);
|
||||
addAxisTokens(
|
||||
currentTokens,
|
||||
event.getAxisValue(MotionEvent.AXIS_HAT_X),
|
||||
@@ -178,13 +181,13 @@ public abstract class ControllerBridgeActivity extends BridgeActivity {
|
||||
);
|
||||
addAxisTokens(
|
||||
currentTokens,
|
||||
event.getAxisValue(MotionEvent.AXIS_X),
|
||||
leftStickX,
|
||||
"Axis0-",
|
||||
"Axis0+"
|
||||
);
|
||||
addAxisTokens(
|
||||
currentTokens,
|
||||
event.getAxisValue(MotionEvent.AXIS_Y),
|
||||
leftStickY,
|
||||
"Axis1-",
|
||||
"Axis1+"
|
||||
);
|
||||
@@ -240,6 +243,19 @@ public abstract class ControllerBridgeActivity extends BridgeActivity {
|
||||
);
|
||||
}
|
||||
|
||||
private void dispatchNativeControllerMotion(float x, float y) {
|
||||
if (bridge == null || bridge.getWebView() == null) return;
|
||||
String script =
|
||||
"window.dispatchEvent(new CustomEvent('ashen-halls-native-controller-motion',"
|
||||
+ "{detail:{x:" + x + ",y:" + y + "}}));";
|
||||
bridge.getWebView().post(
|
||||
() -> {
|
||||
bridge.getWebView().requestFocus();
|
||||
bridge.getWebView().evaluateJavascript(script, null);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
private boolean shouldThrottleDpad(String token) {
|
||||
int buttonIndex = Integer.parseInt(token.substring("Button".length()));
|
||||
long now = SystemClock.uptimeMillis();
|
||||
|
||||
|
After Width: | Height: | Size: 314 KiB |
|
After Width: | Height: | Size: 328 KiB |
|
After Width: | Height: | Size: 302 KiB |
|
After Width: | Height: | Size: 536 KiB |
|
After Width: | Height: | Size: 358 KiB |
@@ -0,0 +1,183 @@
|
||||
# IWT2 Future Boss Concept Prompts
|
||||
|
||||
These are exploration-only concepts. They are not implemented encounters.
|
||||
|
||||
## Rimebastion
|
||||
|
||||
- Hook: Frost leviathan turtle-crab siege boss; plants jagged ice wall segments, boxes party into lanes, then shatters walls into cone shards.
|
||||
- Chroma key: `#00ff00`
|
||||
|
||||
```text
|
||||
Use case: stylized-concept
|
||||
Asset type: production game boss sprite for I Want To Heal 2 arena gameplay
|
||||
Primary request: side-view cel-shaded sprite of an original frost leviathan turtle-crab siege boss, facing right, full body visible
|
||||
Subject: massive turtle-crab hybrid with a low armored glacier shell, four heavy crab legs, broad claw-like siege forelimbs, frost-rimmed tusk mandibles, ice wall crystal growths along the shell edges, compact battering-ram posture, readable tanky wall-builder silhouette; original design, not copied from any franchise
|
||||
Style/medium: clean 2D cel-shaded action-game sprite, crisp inked outline, simple shaded color blocks, readable at small size
|
||||
Composition/framing: centered single character, side-view with slight 3/4 depth, full body, generous padding, no cropping
|
||||
Lighting/mood: clear high-contrast game lighting, readable over dark arena grid
|
||||
Color palette: deep blue shell plates, pale cyan ice crystals, white frost edges, dark slate claws, cold violet shadow accents
|
||||
Scene/backdrop: perfectly flat solid #00ff00 chroma-key background for background removal
|
||||
Constraints: background must be one uniform #00ff00 with no shadows, gradients, texture, floor plane, reflection, or lighting variation; do not use #00ff00 anywhere in the boss; no cast shadow; no text; no watermark; no UI; no logos
|
||||
```
|
||||
|
||||
## Ember Mantis Duelist
|
||||
|
||||
- Hook: Fast side-stepping mantis swordsman. Blade arms draw glowing line-slash telegraphs, then carve straight arena cuts that force party repositioning.
|
||||
- Chroma key: `#00ff00`
|
||||
|
||||
```text
|
||||
Use case: stylized-concept
|
||||
Asset type: production game boss sprite for I Want To Heal 2 arena gameplay
|
||||
Primary request: side-view cel-shaded sprite of an original ember mantis duelist boss, facing right, full body visible
|
||||
Subject: tall predatory mantis warrior with two long scythe-like blade arms, ember-cracked chitin plates, narrow duelist stance, swept horn-like antennae, glowing slash scars along forearms, agile line-slash mechanic cues; original design, not copied from any franchise
|
||||
Style/medium: clean 2D cel-shaded action-game sprite, crisp inked outline, simple shaded color blocks, readable at small size
|
||||
Composition/framing: centered single character, side-view with slight 3/4 depth, full body, generous padding, no cropping
|
||||
Lighting/mood: clear high-contrast game lighting, readable over dark arena grid
|
||||
Color palette: charcoal black chitin, deep crimson armor plates, molten orange cracks, pale bone blade edges, small yellow ember accents
|
||||
Scene/backdrop: perfectly flat solid #00ff00 chroma-key background for background removal
|
||||
Constraints: background must be one uniform #00ff00 with no shadows, gradients, texture, floor plane, reflection, or lighting variation; do not use #00ff00 anywhere in the boss; no cast shadow; no text; no watermark; no UI; no logos
|
||||
```
|
||||
|
||||
## Obsidian Ram Golem
|
||||
|
||||
- Hook: Living volcanic-stone ram construct. Charge cracks armor plates, quake sends fracture waves, shatter armor drops broken obsidian slabs as hazards.
|
||||
- Chroma key: `#00ff00`
|
||||
|
||||
```text
|
||||
Use case: stylized-concept
|
||||
Asset type: production game boss sprite for I Want To Heal 2 arena gameplay
|
||||
Primary request: side-view cel-shaded sprite of an original obsidian ram golem boss, facing right, full body visible
|
||||
Subject: massive quadruped ram-shaped stone construct with jagged obsidian armor plates, curled basalt horns, glowing ember cracks, heavy hooves, lowered charging posture, fractured shoulder plates suggesting shatter armor mechanics, quake-impact weight in stance; original design, not copied from any franchise
|
||||
Style/medium: clean 2D cel-shaded action-game sprite, crisp inked outline, simple shaded color blocks, readable at small size
|
||||
Composition/framing: centered single character, side-view with slight 3/4 depth, full body, generous padding, no cropping
|
||||
Lighting/mood: clear high-contrast game lighting, readable over dark arena grid
|
||||
Color palette: black obsidian, charcoal basalt, dark gray stone, lava-orange crack glow, muted red-hot horn accents
|
||||
Scene/backdrop: perfectly flat solid #00ff00 chroma-key background for background removal
|
||||
Constraints: background must be one uniform #00ff00 with no shadows, gradients, texture, floor plane, reflection, or lighting variation; do not use #00ff00 anywhere in the boss; no cast shadow; no text; no watermark; no UI; no logos
|
||||
```
|
||||
|
||||
## Stormcoil Wyrm
|
||||
|
||||
- Hook: Serpentine sky-eel boss. Loops body into charged rings, leaves arcing storm trails, chains lightning through clustered party members.
|
||||
- Chroma key: `#ff00ff`
|
||||
|
||||
```text
|
||||
Use case: stylized-concept
|
||||
Asset type: production game boss sprite for I Want To Heal 2 arena gameplay
|
||||
Primary request: side-view cel-shaded sprite of an original storm eel wyrm boss, facing right, full body visible
|
||||
Subject: long serpentine eel-wyrm with raised crested head, ribbon-like looping body forming two open coils, jagged fin spines, glowing storm nodes along its sides, forked whiskers acting as lightning conductors, readable chain-lightning mechanic cues, aggressive hovering combat posture; original design, not copied from any franchise
|
||||
Style/medium: clean 2D cel-shaded action-game sprite, crisp inked outline, simple shaded color blocks, readable at small size
|
||||
Composition/framing: centered single character, side-view with slight 3/4 depth, full body, generous padding, no cropping
|
||||
Lighting/mood: clear high-contrast game lighting, readable over dark arena grid
|
||||
Color palette: deep navy body, pale silver belly, electric cyan and white lightning accents, violet storm-glow details
|
||||
Scene/backdrop: perfectly flat solid #ff00ff chroma-key background for background removal
|
||||
Constraints: background must be one uniform #ff00ff with no shadows, gradients, texture, floor plane, reflection, or lighting variation; do not use #ff00ff anywhere in the boss; no cast shadow; no text; no watermark; no UI; no logos
|
||||
```
|
||||
|
||||
## Venom Orchid Hydra
|
||||
|
||||
- Hook: Three blossom-serpent heads sweep staggered poison cones while buried roots snare lanes and blooming pods leave toxic zones.
|
||||
- Chroma key: `#ff00ff`
|
||||
|
||||
```text
|
||||
Use case: stylized-concept
|
||||
Asset type: production game boss sprite for I Want To Heal 2 arena gameplay
|
||||
Primary request: side-view cel-shaded sprite of an original venom orchid hydra boss, facing right, full body visible
|
||||
Subject: massive root-bodied hydra with three long orchid-serpent heads, poisonous blossom crowns, thorny vine necks, exposed twisting roots used for snares, swollen toxin pods, readable cone-attack posture with heads angled at different heights; original design, not copied from any franchise
|
||||
Style/medium: clean 2D cel-shaded action-game sprite, crisp inked outline, simple shaded color blocks, readable at small size
|
||||
Composition/framing: centered single character, side-view with slight 3/4 depth, full body, generous padding, no cropping
|
||||
Lighting/mood: clear high-contrast game lighting, readable over dark arena grid
|
||||
Color palette: deep violet petals, pale bone-yellow stamens, dark bark roots, black-purple thorns, toxic lime-yellow venom accents; do not use magenta
|
||||
Scene/backdrop: perfectly flat solid #ff00ff chroma-key background for background removal
|
||||
Constraints: background must be one uniform #ff00ff with no shadows, gradients, texture, floor plane, reflection, or lighting variation; do not use #ff00ff anywhere in the boss; no cast shadow; no text; no watermark; no UI; no logos
|
||||
```
|
||||
|
||||
## Sandglass Scorpion
|
||||
|
||||
- Hook: Burrowing scorpion boss that leaves moving sand trails, plants delayed stinger eruptions, and flips hourglass sand zones between safe glass and sinking hazard.
|
||||
- Chroma key: `#00ff00`
|
||||
|
||||
```text
|
||||
Use case: stylized-concept
|
||||
Asset type: production game boss sprite for I Want To Heal 2 arena gameplay
|
||||
Primary request: side-view cel-shaded sprite of an original sandglass scorpion boss, facing right, full body visible
|
||||
Subject: massive desert scorpion with hourglass-shaped torso shell, glassy sand chambers in claws and tail, segmented legs built for burrowing, curved raised stinger with dripping golden sand, ridged shovel-like pincers, readable combat posture suggesting delayed underground strikes and arena sand zones; original design, not copied from any franchise
|
||||
Style/medium: clean 2D cel-shaded action-game sprite, crisp inked outline, simple shaded color blocks, readable at small size
|
||||
Composition/framing: centered single character, side-view with slight 3/4 depth, full body, generous padding, no cropping
|
||||
Lighting/mood: clear high-contrast game lighting, readable over dark arena grid
|
||||
Color palette: warm ochre sand armor, dark obsidian joints, amber glass chambers, pale bone claws, bright gold sand accents
|
||||
Scene/backdrop: perfectly flat solid #00ff00 chroma-key background for background removal
|
||||
Constraints: background must be one uniform #00ff00 with no shadows, gradients, texture, floor plane, reflection, or lighting variation; do not use #00ff00 anywhere in the boss; no cast shadow; no text; no watermark; no UI; no logos
|
||||
```
|
||||
|
||||
## Crystal Bat Matriarch
|
||||
|
||||
- Hook: Giant jeweled cave-bat queen. Sonic ring pulses force party spacing, mirror shards split/reflect danger lanes, swoop dives punish clustered players.
|
||||
- Chroma key: `#00ff00`
|
||||
|
||||
```text
|
||||
Use case: stylized-concept
|
||||
Asset type: production game boss sprite for I Want To Heal 2 arena gameplay
|
||||
Primary request: side-view cel-shaded sprite of an original crystal bat matriarch boss, facing right, full body visible
|
||||
Subject: towering bat queen with wide angular wings, faceted amethyst-and-obsidian crystal growths along crown, shoulders, wing fingers, and tail; open fanged mouth emitting visible pale sonic ring motifs around the head; several floating broken mirror shards orbiting near the wings; poised in a low forward swoop posture with claws extended; original creature design, not copied from any franchise
|
||||
Style/medium: clean 2D cel-shaded action-game sprite, crisp inked outline, simple shaded color blocks, readable at small size
|
||||
Composition/framing: centered single character, side-view with slight 3/4 depth, full body, generous padding, no cropping
|
||||
Lighting/mood: clear high-contrast game lighting, readable over dark arena grid
|
||||
Color palette: deep violet body, black wing membranes, icy blue crystal highlights, silver mirror shards, pale cyan sonic accents
|
||||
Scene/backdrop: perfectly flat solid #00ff00 chroma-key background for background removal
|
||||
Constraints: background must be one uniform #00ff00 with no shadows, gradients, texture, floor plane, reflection, or lighting variation; do not use #00ff00 anywhere in the boss; no cast shadow; no text; no watermark; no UI; no logos
|
||||
```
|
||||
|
||||
## Cinderback Ricochet
|
||||
|
||||
- Hook: Molten armadillo boss curls into plated lava wheel, ricochets off arena walls, leaves burning trails, then uncurls for armor-plate slam windows.
|
||||
- Chroma key: `#00ff00`
|
||||
|
||||
```text
|
||||
Use case: stylized-concept
|
||||
Asset type: production game boss sprite for I Want To Heal 2 arena gameplay
|
||||
Primary request: side-view cel-shaded sprite of an original molten armadillo boss, facing right, full body visible
|
||||
Subject: bulky low-slung armadillo-like beast with layered volcanic armor plates, glowing lava cracks, heavy clawed feet, curled rolling-combat silhouette cues, scorched tail, defensive plated brow, readable ricochet boss posture; original design, not copied from any franchise
|
||||
Style/medium: clean 2D cel-shaded action-game sprite, crisp inked outline, simple shaded color blocks, readable at small size
|
||||
Composition/framing: centered single character, side-view with slight 3/4 depth, full body, generous padding, no cropping
|
||||
Lighting/mood: clear high-contrast game lighting, readable over dark arena grid
|
||||
Color palette: charcoal obsidian plates, ember orange lava seams, dark red underbody, pale hot-yellow highlights
|
||||
Scene/backdrop: perfectly flat solid #00ff00 chroma-key background for background removal
|
||||
Constraints: background must be one uniform #00ff00 with no shadows, gradients, texture, floor plane, reflection, or lighting variation; do not use #00ff00 anywhere in the boss; no cast shadow; no text; no watermark; no UI; no logos
|
||||
```
|
||||
|
||||
## Hollowcrown Revenant
|
||||
|
||||
- Hook: Spectral stag boss leaves cursed hoof zones and fading dash trails; ghost antlers flare before line charges.
|
||||
- Chroma key: `#ff00ff`
|
||||
|
||||
```text
|
||||
Use case: stylized-concept
|
||||
Asset type: production game boss sprite for I Want To Heal 2 arena gameplay
|
||||
Primary request: side-view cel-shaded sprite of an original spectral stag revenant boss, facing right, full body visible
|
||||
Subject: gaunt undead stag spirit with cracked bone mask, tall translucent ghost antlers, torn shadowy hide, glowing pale blue curse runes on ribs and hooves, wispy dash-trail ribbons streaming backward, combat-ready lowered stance; original design, not copied from any franchise
|
||||
Style/medium: clean 2D cel-shaded action-game sprite, crisp inked outline, simple shaded color blocks, readable at small size
|
||||
Composition/framing: centered single character, side-view with slight 3/4 depth, full body, generous padding, no cropping
|
||||
Lighting/mood: clear high-contrast game lighting, eerie revenant glow, readable over dark arena grid
|
||||
Color palette: bone white, charcoal black, cold blue, pale cyan, muted violet accents
|
||||
Scene/backdrop: perfectly flat solid #ff00ff chroma-key background for background removal
|
||||
Constraints: background must be one uniform #ff00ff with no shadows, gradients, texture, floor plane, reflection, or lighting variation; do not use #ff00ff anywhere in the boss; no cast shadow; no text; no watermark; no UI; no logos
|
||||
```
|
||||
|
||||
## Tidejaw Behemoth
|
||||
|
||||
- Hook: Massive reef-backed crocodile boss. Blasts pressurized water jets, uses heavy tail sweeps to knock party members sideways, leaves spinning whirlpool puddles that pull players inward.
|
||||
- Chroma key: `#ff00ff`
|
||||
|
||||
```text
|
||||
Use case: stylized-concept
|
||||
Asset type: production game boss sprite for I Want To Heal 2 arena gameplay
|
||||
Primary request: side-view cel-shaded sprite of an original tide crocodile behemoth boss, facing right, full body visible
|
||||
Subject: enormous low-slung crocodilian sea monster with a broad armored skull, jagged coral-like back plates, heavy sweeping tail, webbed claws, pressure-jet water vents along shoulders and flanks, swirling puddle motifs around feet without shadows; original design, not copied from any franchise
|
||||
Style/medium: clean 2D cel-shaded action-game sprite, crisp inked outline, simple shaded color blocks, readable at small size
|
||||
Composition/framing: centered single character, side-view with slight 3/4 depth, full body, generous padding, no cropping
|
||||
Lighting/mood: clear high-contrast game lighting, readable over dark arena grid
|
||||
Color palette: deep swamp green body, dark navy shell plates, pale bone claws and teeth, bright cyan water accents, coral-orange warning marks
|
||||
Scene/backdrop: perfectly flat solid #ff00ff chroma-key background for background removal
|
||||
Constraints: background must be one uniform #ff00ff with no shadows, gradients, texture, floor plane, reflection, or lighting variation; do not use #ff00ff anywhere in the boss; no cast shadow; no text; no watermark; no UI; no logos
|
||||
```
|
||||
|
After Width: | Height: | Size: 341 KiB |
|
After Width: | Height: | Size: 300 KiB |
|
After Width: | Height: | Size: 335 KiB |
|
After Width: | Height: | Size: 301 KiB |
|
After Width: | Height: | Size: 357 KiB |
|
After Width: | Height: | Size: 411 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 38 KiB |
@@ -10,6 +10,7 @@
|
||||
"dependencies": {
|
||||
"@capacitor/android": "^8.4.0",
|
||||
"@capacitor/core": "^8.4.0",
|
||||
"phaser": "^4.2.0",
|
||||
"react": "^19.2.6",
|
||||
"react-dom": "^19.2.6"
|
||||
},
|
||||
@@ -2030,6 +2031,12 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eventemitter3": {
|
||||
"version": "5.0.4",
|
||||
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz",
|
||||
"integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/fast-deep-equal": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
||||
@@ -2969,6 +2976,15 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/phaser": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/phaser/-/phaser-4.2.0.tgz",
|
||||
"integrity": "sha512-9nSQZs4CJ9+V96i2mRC3BBStBcsQWGJJBRpdFYSbpL40/i/QM+wLofaCYMsxNyDk8WJOlHGZUh3uVRKa7lj6yg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"eventemitter3": "^5.0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/picocolors": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
"dependencies": {
|
||||
"@capacitor/android": "^8.4.0",
|
||||
"@capacitor/core": "^8.4.0",
|
||||
"phaser": "^4.2.0",
|
||||
"react": "^19.2.6",
|
||||
"react-dom": "^19.2.6"
|
||||
},
|
||||
|
||||
|
After Width: | Height: | Size: 173 KiB |
@@ -0,0 +1,12 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 144 144" role="img" aria-label="Barroth boss sprite">
|
||||
<path d="M20 80c6-31 35-49 68-42 31 6 48 27 43 52-5 26-34 41-68 34-30-6-48-24-43-44Z" fill="#8d714d"/>
|
||||
<path d="M44 49c16-15 49-17 72-1-28 0-53 6-76 20Z" fill="#d6bd80"/>
|
||||
<path d="M56 29h48l17 24-23 17H55L35 52Z" fill="#6a5137"/>
|
||||
<path d="M63 37h33l10 14-12 9H62L50 51Z" fill="#a48a61"/>
|
||||
<path d="M35 69 8 54l18 42 33 2Z" fill="#6a5137"/>
|
||||
<path d="m102 68 33-13-14 42-34 2Z" fill="#6a5137"/>
|
||||
<path d="M67 65c14 0 26 10 26 23s-12 23-26 23-26-10-26-23 12-23 26-23Z" fill="#5a412e"/>
|
||||
<path d="m94 82 32 7-31 10Z" fill="#3a2b21"/>
|
||||
<path d="M54 77h7v8h-7z" fill="#f3e2a5"/>
|
||||
<path d="M44 111h16l-8 18ZM90 111h16l-8 18Z" fill="#3a2b21"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 765 B |
|
After Width: | Height: | Size: 224 KiB |
@@ -0,0 +1,14 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 144 144" role="img" aria-label="Bulldrome boss sprite">
|
||||
<path d="M22 80c4-31 32-50 64-43 26 6 42 23 43 45 2 23-16 39-43 41-34 2-62-14-64-43Z" fill="#7a4b35"/>
|
||||
<path d="M42 91c11 15 42 22 67 10-9 16-28 24-52 18-13-4-23-13-28-24l13-4Z" fill="#3b2d28" opacity=".55"/>
|
||||
<path d="M42 51c11-12 31-17 52-12 14 3 25 10 31 21-25-9-53-11-83-9Z" fill="#b48762"/>
|
||||
<path d="M30 62 9 48l8 31 20-5Z" fill="#d6c8aa"/>
|
||||
<path d="m104 55 30-12-13 28-20-2Z" fill="#d6c8aa"/>
|
||||
<path d="M40 34 24 18h25l7 17Z" fill="#ad5632"/>
|
||||
<path d="m99 36 15-18 13 24-20 8Z" fill="#ad5632"/>
|
||||
<path d="M72 58c17 0 31 11 31 25S89 108 72 108 41 97 41 83s14-25 31-25Z" fill="#5b3b31"/>
|
||||
<path d="M73 63c9 0 17 7 17 16s-8 17-17 17-17-8-17-17 8-16 17-16Z" fill="#2c2422"/>
|
||||
<path d="M68 72h9v20h-9z" fill="#e8b068"/>
|
||||
<path d="M61 55c5-9 17-9 22 0-6-2-16-2-22 0Z" fill="#261b17"/>
|
||||
<path d="M42 110h16l-8 16ZM90 109h16l-8 16Z" fill="#2a211e"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 981 B |
|
After Width: | Height: | Size: 213 KiB |
|
After Width: | Height: | Size: 230 KiB |
|
After Width: | Height: | Size: 209 KiB |
|
After Width: | Height: | Size: 162 KiB |
@@ -0,0 +1,13 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 144 144" role="img" aria-label="Great Jaggi boss sprite">
|
||||
<path d="M21 78c8-28 38-42 69-32 24 8 36 27 27 49-9 23-38 32-66 20-22-9-35-21-30-37Z" fill="#3f8f73"/>
|
||||
<path d="M54 48c15-15 38-14 55 1-21 0-39 6-54 19Z" fill="#b8f0aa"/>
|
||||
<path d="M28 79 7 58l33 5Z" fill="#2a6e58"/>
|
||||
<path d="M97 66 137 46l-20 36Z" fill="#2a6e58"/>
|
||||
<path d="M92 91c16 2 30 9 41 22-24-5-43-8-58-6Z" fill="#326d59"/>
|
||||
<path d="M70 62c12 0 22 9 22 21S82 105 70 105s-22-10-22-22 10-21 22-21Z" fill="#245848"/>
|
||||
<path d="M60 32 48 15l26 13ZM82 32l14-17 6 27Z" fill="#b8f0aa"/>
|
||||
<circle cx="60" cy="74" r="4" fill="#f4ffd0"/>
|
||||
<circle cx="60" cy="74" r="2" fill="#111"/>
|
||||
<path d="m93 82 31 4-29 12Z" fill="#1f4539"/>
|
||||
<path d="M44 108h13l-7 18ZM80 111h13l-7 18Z" fill="#1f4539"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 825 B |
|
After Width: | Height: | Size: 238 KiB |
|
After Width: | Height: | Size: 168 KiB |
@@ -0,0 +1,12 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 144 144" role="img" aria-label="Khezu boss sprite">
|
||||
<path d="M27 82c2-28 27-43 55-40 25 3 45 20 45 44 0 23-21 39-50 39-30 0-52-18-50-43Z" fill="#d8d7c9"/>
|
||||
<path d="M42 55c14-13 47-13 66 0-23-2-45 2-68 16Z" fill="#fff4df"/>
|
||||
<path d="M37 70 10 55l15 40 30 2Z" fill="#b9b7aa"/>
|
||||
<path d="m102 68 31-15-13 40-30 4Z" fill="#b9b7aa"/>
|
||||
<path d="M49 72c8-16 32-21 45-8 13 14 8 39-13 46-21 7-42-4-43-21 0-6 4-12 11-17Z" fill="#efe9da"/>
|
||||
<path d="M64 61c17-32 40-43 57-32-22 10-33 27-34 51Z" fill="#d8d7c9"/>
|
||||
<path d="M89 35c8-18 23-24 40-21-14 8-22 18-25 31Z" fill="#fff4df"/>
|
||||
<path d="M60 84c11-5 26-4 36 4-9 8-27 8-36-4Z" fill="#7d4b55"/>
|
||||
<path d="M55 112h14l-8 17ZM88 112h14l-8 17Z" fill="#8d8a80"/>
|
||||
<path d="M105 69c9 1 15 5 19 13-10-3-17-3-25 2Z" fill="#77d9ff"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 839 B |
|
After Width: | Height: | Size: 245 KiB |
|
After Width: | Height: | Size: 199 KiB |
@@ -0,0 +1,13 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 144 144" role="img" aria-label="Rathian boss sprite">
|
||||
<path d="M26 77c6-30 35-48 66-40 27 7 42 30 36 55-6 24-34 38-64 29-26-8-43-25-38-44Z" fill="#4d9a58"/>
|
||||
<path d="M48 51c13-17 40-22 64-4-25 0-44 6-59 20Z" fill="#f0c24d"/>
|
||||
<path d="M35 69 5 38l13 54 36 10Z" fill="#3f7c4a"/>
|
||||
<path d="m100 65 38-28-15 56-35 9Z" fill="#3f7c4a"/>
|
||||
<path d="M30 63 6 37l31 14 18 36Z" fill="#78b861"/>
|
||||
<path d="m112 58 28-22-20 31-27 22Z" fill="#78b861"/>
|
||||
<path d="M77 22c17 8 30 21 38 39-18-12-37-18-59-18 5-10 12-17 21-21Z" fill="#2d693f"/>
|
||||
<path d="M70 61c13 0 24 10 24 23s-11 24-24 24-24-11-24-24 11-23 24-23Z" fill="#2f5f3c"/>
|
||||
<path d="m96 82 34 7-33 12Z" fill="#244c32"/>
|
||||
<path d="M57 75h6v8h-6z" fill="#f7ffd2"/>
|
||||
<path d="M44 110h15l-8 19ZM88 111h15l-8 19Z" fill="#244c32"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 844 B |
|
After Width: | Height: | Size: 230 KiB |
|
After Width: | Height: | Size: 207 KiB |
|
After Width: | Height: | Size: 211 KiB |
|
After Width: | Height: | Size: 181 KiB |
@@ -0,0 +1,13 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 144 144" role="img" aria-label="Tobi Kadachi boss sprite">
|
||||
<path d="M25 79c7-27 34-42 65-34 24 6 38 23 35 45-3 23-28 37-58 30-27-6-47-24-42-41Z" fill="#6a79bd"/>
|
||||
<path d="M49 50c13-14 38-18 61-3-21 1-40 8-56 22Z" fill="#a8f3ff"/>
|
||||
<path d="M40 69 8 49l20 46 34 5Z" fill="#515d9d"/>
|
||||
<path d="m95 66 38-18-20 48-34 4Z" fill="#515d9d"/>
|
||||
<path d="M92 89c20 3 34 14 41 32-22-10-42-14-62-12Z" fill="#dfeaff"/>
|
||||
<path d="M68 61c13 0 23 10 23 22s-10 23-23 23-23-11-23-23 10-22 23-22Z" fill="#414b87"/>
|
||||
<path d="M58 32 44 12l28 16ZM83 32l19-17 4 29Z" fill="#dfeaff"/>
|
||||
<path d="m82 55 7 12 13-4-11 11 7 13-14-7-11 11 3-15-14-7 15-2Z" fill="#a8f3ff"/>
|
||||
<circle cx="59" cy="74" r="4" fill="#f6ffff"/>
|
||||
<circle cx="59" cy="74" r="2" fill="#101425"/>
|
||||
<path d="M45 108h14l-8 18ZM82 110h14l-8 18Z" fill="#303869"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 877 B |
|
After Width: | Height: | Size: 282 KiB |
|
After Width: | Height: | Size: 200 KiB |
@@ -0,0 +1,14 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 144 144" role="img" aria-label="Yian Kut Ku boss sprite">
|
||||
<path d="M28 84c3-29 28-45 56-38 24 6 39 24 35 48-3 22-24 34-51 31-25-3-42-18-40-41Z" fill="#d66a35"/>
|
||||
<path d="M52 51c9-14 29-18 49-5-16 0-31 5-43 16Z" fill="#ffd166"/>
|
||||
<path d="M38 67 9 45l12 45 29 5Z" fill="#f28a3e"/>
|
||||
<path d="m99 71 36-20-16 45-30-1Z" fill="#f28a3e"/>
|
||||
<path d="M33 66 7 42l20 9 17 24Z" fill="#ffd166"/>
|
||||
<path d="m112 63 25-16-16 20-20 12Z" fill="#ffd166"/>
|
||||
<path d="M80 26c18 7 29 21 31 40-13-15-28-21-47-22 4-8 9-14 16-18Z" fill="#b6462d"/>
|
||||
<path d="M69 58c12 0 22 10 22 22s-10 22-22 22-22-10-22-22 10-22 22-22Z" fill="#812f25"/>
|
||||
<path d="m93 79 31 5-28 11Z" fill="#61241d"/>
|
||||
<circle cx="60" cy="73" r="5" fill="#fff2a5"/>
|
||||
<circle cx="60" cy="73" r="2" fill="#1f1511"/>
|
||||
<path d="M52 112h13l-8 18ZM86 111h14l-8 18Z" fill="#58251c"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 896 B |
|
After Width: | Height: | Size: 221 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 44 KiB |
@@ -1,4 +1,4 @@
|
||||
import { createReadStream, existsSync, mkdirSync, statSync, writeFileSync } from 'node:fs'
|
||||
import { createReadStream, existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs'
|
||||
import { createServer } from 'node:http'
|
||||
import { randomBytes } from 'node:crypto'
|
||||
import { extname, resolve, sep } from 'node:path'
|
||||
@@ -10,6 +10,7 @@ const port = Number(process.env.ADMIN_PORT ?? 4174)
|
||||
const databasePath = fileURLToPath(new URL('../data/game.db', import.meta.url))
|
||||
const distPath = fileURLToPath(new URL('../dist', import.meta.url))
|
||||
const adminOverridesPath = fileURLToPath(new URL('../db/admin-overrides.sql', import.meta.url))
|
||||
const iwt2BalanceOverridesPath = fileURLToPath(new URL('../src/modes/iwt2/content/balanceOverrides.ts', import.meta.url))
|
||||
const bossImageDirectory = fileURLToPath(new URL('../data/uploads/bosses/', import.meta.url))
|
||||
const itemImageDirectory = fileURLToPath(new URL('../data/uploads/items/', import.meta.url))
|
||||
const dungeonImageDirectory = fileURLToPath(new URL('../data/uploads/dungeons/', import.meta.url))
|
||||
@@ -248,6 +249,89 @@ function saveDungeonImage(database, dungeonId, payload) {
|
||||
return imageUrl
|
||||
}
|
||||
|
||||
function readIwt2BalanceOverrides() {
|
||||
if (!existsSync(iwt2BalanceOverridesPath)) return { bosses: {} }
|
||||
const source = readFileSync(iwt2BalanceOverridesPath, 'utf8')
|
||||
const exportIndex = source.indexOf('IWT2_BALANCE_OVERRIDES')
|
||||
const objectStart = source.indexOf('{', exportIndex)
|
||||
const objectEnd = source.lastIndexOf('}')
|
||||
if (exportIndex < 0 || objectStart < 0 || objectEnd <= objectStart) return { bosses: {} }
|
||||
try {
|
||||
const parsed = JSON.parse(source.slice(objectStart, objectEnd + 1))
|
||||
return sanitizeIwt2BalanceOverrides(parsed)
|
||||
} catch {
|
||||
return { bosses: {} }
|
||||
}
|
||||
}
|
||||
|
||||
function sanitizeIwt2BalanceOverrides(value) {
|
||||
const overrides = { bosses: {} }
|
||||
const bosses = value && typeof value === 'object' && value.bosses && typeof value.bosses === 'object'
|
||||
? value.bosses
|
||||
: {}
|
||||
for (const bossId of ['bulldrome', 'yian-kut-ku']) {
|
||||
const boss = bosses[bossId]
|
||||
if (!boss || typeof boss !== 'object') continue
|
||||
const nextBoss = {}
|
||||
if (Number.isFinite(Number(boss.maxHealth))) nextBoss.maxHealth = Math.max(1, Math.round(Number(boss.maxHealth)))
|
||||
if (bossId === 'yian-kut-ku' && Number.isFinite(Number(boss.birdHealth))) {
|
||||
nextBoss.birdHealth = Math.max(1, Math.round(Number(boss.birdHealth)))
|
||||
}
|
||||
if (Object.keys(nextBoss).length > 0) overrides.bosses[bossId] = nextBoss
|
||||
}
|
||||
return overrides
|
||||
}
|
||||
|
||||
function writeIwt2BalanceOverrides(overrides) {
|
||||
const source = [
|
||||
"import type { Iwt2BalanceOverrides } from './bosses'",
|
||||
'',
|
||||
'// Generated by local admin panel. Commit this file with intended IWT2 balance changes.',
|
||||
`export const IWT2_BALANCE_OVERRIDES: Iwt2BalanceOverrides = ${JSON.stringify(sanitizeIwt2BalanceOverrides(overrides), null, 2)}`,
|
||||
'',
|
||||
].join('\n')
|
||||
writeFileSync(iwt2BalanceOverridesPath, source, { mode: 0o644 })
|
||||
}
|
||||
|
||||
function updateIwt2EntityHp(entityId, payload) {
|
||||
const maxHealth = Number(payload.maxHealth)
|
||||
if (!Number.isFinite(maxHealth) || maxHealth <= 0) throw new Error('HP must be greater than zero.')
|
||||
const roundedHealth = Math.round(maxHealth)
|
||||
const overrides = readIwt2BalanceOverrides()
|
||||
const bosses = { ...(overrides.bosses ?? {}) }
|
||||
if (entityId === 'bulldrome' || entityId === 'yian-kut-ku') {
|
||||
bosses[entityId] = {
|
||||
...(bosses[entityId] ?? {}),
|
||||
maxHealth: roundedHealth,
|
||||
}
|
||||
} else if (entityId === 'yian-kut-ku:yian-bird' || entityId === 'yian-bird') {
|
||||
bosses['yian-kut-ku'] = {
|
||||
...(bosses['yian-kut-ku'] ?? {}),
|
||||
birdHealth: roundedHealth,
|
||||
}
|
||||
} else {
|
||||
throw new Error('IWT2 entity not found.')
|
||||
}
|
||||
const nextOverrides = sanitizeIwt2BalanceOverrides({ bosses })
|
||||
writeIwt2BalanceOverrides(nextOverrides)
|
||||
return nextOverrides
|
||||
}
|
||||
|
||||
function listIwt2BossAssets() {
|
||||
if (!existsSync(bossImageDirectory)) return []
|
||||
return readdirSync(bossImageDirectory, { withFileTypes: true })
|
||||
.filter((entry) => entry.isFile() && bossImageContentTypes[extname(entry.name).toLowerCase()])
|
||||
.map((entry) => {
|
||||
const imagePath = resolve(bossImageDirectory, entry.name)
|
||||
return {
|
||||
filename: entry.name,
|
||||
size: statSync(imagePath).size,
|
||||
url: `/api/boss-images/${entry.name}`,
|
||||
}
|
||||
})
|
||||
.sort((a, b) => a.filename.localeCompare(b.filename))
|
||||
}
|
||||
|
||||
function sendFile(response, filePath) {
|
||||
const contentTypes = {
|
||||
'.css': 'text/css; charset=utf-8',
|
||||
@@ -308,6 +392,22 @@ const server = createServer(async (request, response) => {
|
||||
return
|
||||
}
|
||||
|
||||
if (request.url === '/api/admin/iwt2/data' && request.method === 'GET') {
|
||||
sendJson(response, 200, {
|
||||
balanceOverrides: readIwt2BalanceOverrides(),
|
||||
bossAssets: listIwt2BossAssets(),
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
const iwt2HpMatch = request.url.match(/^\/api\/admin\/iwt2\/entities\/([^/]+)\/hp$/)
|
||||
if (iwt2HpMatch && request.method === 'PUT') {
|
||||
const payload = await readJson(request)
|
||||
const balanceOverrides = updateIwt2EntityHp(decodeURIComponent(iwt2HpMatch[1]), payload)
|
||||
sendJson(response, 200, { ok: true, balanceOverrides })
|
||||
return
|
||||
}
|
||||
|
||||
if (!existsSync(databasePath)) {
|
||||
sendJson(response, 503, { error: 'Database missing. Run npm run db:init.' })
|
||||
return
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import type { CSSProperties, Dispatch, SetStateAction } from 'react'
|
||||
import {
|
||||
IWT2_BOSS_METADATA,
|
||||
type Iwt2BalanceOverrides,
|
||||
type Iwt2BossId,
|
||||
type Iwt2BossMetadata,
|
||||
} from '../modes/iwt2/content/bosses'
|
||||
|
||||
type AdminItem = {
|
||||
id: number
|
||||
@@ -130,7 +136,38 @@ type AdminData = {
|
||||
classes: AdminClass[]
|
||||
}
|
||||
|
||||
type AdminTab = 'items' | 'dungeons' | 'encounters' | 'loot' | 'crafting' | 'upgrades' | 'classes'
|
||||
type Iwt2AdminAsset = {
|
||||
filename: string
|
||||
size: number
|
||||
url: string
|
||||
}
|
||||
|
||||
type Iwt2AdminData = {
|
||||
balanceOverrides: Iwt2BalanceOverrides
|
||||
bossAssets: Iwt2AdminAsset[]
|
||||
}
|
||||
|
||||
type Iwt2AdminAttack = {
|
||||
name: string
|
||||
frequency: string
|
||||
damage: string
|
||||
details: string
|
||||
}
|
||||
|
||||
type Iwt2AdminEntityRow = {
|
||||
id: string
|
||||
bossId: Iwt2BossId
|
||||
kind: 'boss' | 'mob'
|
||||
name: string
|
||||
slug: string
|
||||
icon: string
|
||||
color: string
|
||||
maxHealth: number
|
||||
attacks: Iwt2AdminAttack[]
|
||||
assets: Iwt2AdminAsset[]
|
||||
}
|
||||
|
||||
type AdminTab = 'items' | 'dungeons' | 'encounters' | 'loot' | 'crafting' | 'upgrades' | 'classes' | 'iwt2'
|
||||
type SavingState = Record<string, boolean>
|
||||
type SetData = Dispatch<SetStateAction<AdminData | null>>
|
||||
type SetSaving = Dispatch<SetStateAction<SavingState>>
|
||||
@@ -144,6 +181,7 @@ const tabs: { id: AdminTab; label: string }[] = [
|
||||
{ id: 'crafting', label: 'Crafting' },
|
||||
{ id: 'upgrades', label: 'Upgrades' },
|
||||
{ id: 'classes', label: 'Classes' },
|
||||
{ id: 'iwt2', label: 'IWT2' },
|
||||
]
|
||||
|
||||
async function fetchJson<T>(url: string, init?: RequestInit): Promise<T> {
|
||||
@@ -189,6 +227,7 @@ export function AdminScreen({ onBack }: { onBack: () => void }) {
|
||||
{tab === 'crafting' && <CraftingTab data={data} setData={setData} setSaving={setSaving} saving={saving} />}
|
||||
{tab === 'upgrades' && <UpgradesTab data={data} setData={setData} setSaving={setSaving} saving={saving} />}
|
||||
{tab === 'classes' && <ClassesTab data={data} />}
|
||||
{tab === 'iwt2' && <Iwt2AdminTab />}
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -1155,6 +1194,196 @@ function ClassesTab({ data }: { data: AdminData }) {
|
||||
)
|
||||
}
|
||||
|
||||
function Iwt2AdminTab() {
|
||||
const [metadata, setMetadata] = useState<Record<Iwt2BossId, Iwt2BossMetadata>>(IWT2_BOSS_METADATA)
|
||||
const [adminData, setAdminData] = useState<Iwt2AdminData | null>(null)
|
||||
const [error, setError] = useState('')
|
||||
const [selectedEntityId, setSelectedEntityId] = useState<string>('bulldrome')
|
||||
const [draftHp, setDraftHp] = useState<Record<string, string>>({})
|
||||
const [saving, setSaving] = useState<Record<string, boolean>>({})
|
||||
|
||||
useEffect(() => {
|
||||
fetchJson<Iwt2AdminData>(`${API}/iwt2/data`)
|
||||
.then((result) => {
|
||||
setAdminData(result)
|
||||
setMetadata(applyIwt2AdminOverrides(IWT2_BOSS_METADATA, result.balanceOverrides))
|
||||
})
|
||||
.catch((e: unknown) => {
|
||||
setError(e instanceof Error ? e.message : 'Failed to load IWT2 admin data')
|
||||
setAdminData({ balanceOverrides: { bosses: {} }, bossAssets: [] })
|
||||
})
|
||||
}, [])
|
||||
|
||||
const rows = createIwt2AdminRows(metadata, adminData?.bossAssets ?? [])
|
||||
const selectedRow = rows.find((row) => row.id === selectedEntityId) ?? rows[0]
|
||||
|
||||
async function saveHp(row: Iwt2AdminEntityRow) {
|
||||
const value = Number(draftHp[row.id] ?? row.maxHealth)
|
||||
if (!Number.isFinite(value) || value <= 0) {
|
||||
alert('HP must be greater than zero.')
|
||||
return
|
||||
}
|
||||
const nextHealth = Math.round(value)
|
||||
setSaving((prev) => ({ ...prev, [row.id]: true }))
|
||||
try {
|
||||
await fetchJson(`${API}/iwt2/entities/${encodeURIComponent(row.id)}/hp`, jsonRequest('PUT', { maxHealth: nextHealth }))
|
||||
setMetadata((current) => {
|
||||
const boss = current[row.bossId]
|
||||
return {
|
||||
...current,
|
||||
[row.bossId]: row.kind === 'boss'
|
||||
? { ...boss, maxHealth: nextHealth }
|
||||
: { ...boss, birdHealth: nextHealth },
|
||||
}
|
||||
})
|
||||
setDraftHp((prev) => {
|
||||
const next = { ...prev }
|
||||
delete next[row.id]
|
||||
return next
|
||||
})
|
||||
} catch (e: unknown) {
|
||||
alert(e instanceof Error ? e.message : 'Save failed')
|
||||
} finally {
|
||||
setSaving((prev) => ({ ...prev, [row.id]: false }))
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="admin-panel iwt2-admin-panel">
|
||||
{error && <p className="error-message">{error}</p>}
|
||||
<div className="iwt2-admin-summary">
|
||||
<span>{rows.length} mobs / bosses</span>
|
||||
<span>{adminData?.bossAssets.length ?? 0} uploaded boss assets</span>
|
||||
<span>HP edits write to IWT2 balance overrides</span>
|
||||
</div>
|
||||
<div className="iwt2-admin-layout">
|
||||
<aside className="iwt2-admin-entity-list" aria-label="IWT2 mobs and bosses">
|
||||
{rows.map((row) => (
|
||||
<button
|
||||
className={selectedRow?.id === row.id ? 'active' : ''}
|
||||
key={row.id}
|
||||
onClick={() => setSelectedEntityId(row.id)}
|
||||
type="button"
|
||||
>
|
||||
<span className="iwt2-admin-token" style={{ '--iwt2-entity-color': row.color } as CSSProperties}>{row.icon}</span>
|
||||
<span>
|
||||
<strong>{row.name}</strong>
|
||||
<small>{row.kind} · {row.maxHealth} hp · {row.attacks.length} attacks</small>
|
||||
</span>
|
||||
</button>
|
||||
))}
|
||||
</aside>
|
||||
{selectedRow && (
|
||||
<Iwt2AdminDetail
|
||||
draftHp={draftHp}
|
||||
row={selectedRow}
|
||||
saveHp={saveHp}
|
||||
saving={saving}
|
||||
setDraftHp={setDraftHp}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function Iwt2AdminDetail({
|
||||
draftHp,
|
||||
row,
|
||||
saveHp,
|
||||
saving,
|
||||
setDraftHp,
|
||||
}: {
|
||||
draftHp: Record<string, string>
|
||||
row: Iwt2AdminEntityRow
|
||||
saveHp: (row: Iwt2AdminEntityRow) => void
|
||||
saving: Record<string, boolean>
|
||||
setDraftHp: Dispatch<SetStateAction<Record<string, string>>>
|
||||
}) {
|
||||
const value = draftHp[row.id] ?? String(row.maxHealth)
|
||||
const changed = Number(value) !== row.maxHealth
|
||||
|
||||
return (
|
||||
<section className="iwt2-admin-detail">
|
||||
<header className="iwt2-admin-detail-hero">
|
||||
<span className="iwt2-admin-token" style={{ '--iwt2-entity-color': row.color } as CSSProperties}>{row.icon}</span>
|
||||
<div>
|
||||
<p className="eyebrow">{row.kind}</p>
|
||||
<h2>{row.name}</h2>
|
||||
<small>{row.slug} · source boss: {row.bossId}</small>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<label className="iwt2-admin-hp">
|
||||
HP
|
||||
<input
|
||||
min="1"
|
||||
step="1"
|
||||
type="number"
|
||||
value={value}
|
||||
onChange={(event) => setDraftHp((prev) => ({ ...prev, [row.id]: event.target.value }))}
|
||||
/>
|
||||
<button
|
||||
className="primary-button"
|
||||
disabled={!changed || saving[row.id]}
|
||||
onClick={() => saveHp(row)}
|
||||
type="button"
|
||||
>
|
||||
{saving[row.id] ? 'Saving...' : 'Save HP'}
|
||||
</button>
|
||||
</label>
|
||||
|
||||
<section className="iwt2-admin-section">
|
||||
<div className="iwt2-admin-section-heading">
|
||||
<h3>Assets</h3>
|
||||
<span>{row.assets.length} uploaded</span>
|
||||
</div>
|
||||
<div className="iwt2-admin-assets">
|
||||
<div className="iwt2-admin-swatch" style={{ '--iwt2-entity-color': row.color } as CSSProperties}>
|
||||
<span>{row.icon}</span>
|
||||
<strong>Runtime Token</strong>
|
||||
<small>Icon and color used by current arena renderer.</small>
|
||||
</div>
|
||||
{row.assets.length > 0 ? row.assets.map((asset) => {
|
||||
const label = iwt2AssetLabel(asset.filename)
|
||||
return (
|
||||
<a href={asset.url} key={asset.filename} target="_blank" rel="noreferrer">
|
||||
<img src={asset.url} alt={`${row.name} ${label}`} />
|
||||
<strong>{label}</strong>
|
||||
<small>{asset.filename}</small>
|
||||
</a>
|
||||
)
|
||||
}) : (
|
||||
<p className="admin-item-desc">No uploaded raster asset matched. Runtime uses shape, icon, and color.</p>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section className="iwt2-admin-section">
|
||||
<div className="iwt2-admin-section-heading">
|
||||
<h3>Attacks</h3>
|
||||
<span>{row.attacks.length} mechanics</span>
|
||||
</div>
|
||||
<div className="iwt2-admin-attacks">
|
||||
<div className="iwt2-admin-attack-head">
|
||||
<span>Attack</span>
|
||||
<span>Frequency</span>
|
||||
<span>Damage</span>
|
||||
</div>
|
||||
{row.attacks.map((attack) => (
|
||||
<div className="iwt2-admin-attack-row" key={`${row.id}-${attack.name}`}>
|
||||
<strong>{attack.name}</strong>
|
||||
<span>{attack.frequency}</span>
|
||||
<span>{attack.damage}</span>
|
||||
<small>{attack.details}</small>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
function jsonRequest(method: 'POST' | 'PUT', body: unknown): RequestInit {
|
||||
return {
|
||||
method,
|
||||
@@ -1163,6 +1392,133 @@ function jsonRequest(method: 'POST' | 'PUT', body: unknown): RequestInit {
|
||||
}
|
||||
}
|
||||
|
||||
function applyIwt2AdminOverrides(
|
||||
metadata: Record<Iwt2BossId, Iwt2BossMetadata>,
|
||||
overrides: Iwt2BalanceOverrides,
|
||||
): Record<Iwt2BossId, Iwt2BossMetadata> {
|
||||
return (Object.keys(metadata) as Iwt2BossId[]).reduce((nextMetadata, bossId) => ({
|
||||
...nextMetadata,
|
||||
[bossId]: {
|
||||
...metadata[bossId],
|
||||
...overrides.bosses?.[bossId],
|
||||
},
|
||||
}), {} as Record<Iwt2BossId, Iwt2BossMetadata>)
|
||||
}
|
||||
|
||||
function createIwt2AdminRows(
|
||||
metadata: Record<Iwt2BossId, Iwt2BossMetadata>,
|
||||
bossAssets: Iwt2AdminAsset[],
|
||||
): Iwt2AdminEntityRow[] {
|
||||
const bosses = Object.values(metadata).map((boss): Iwt2AdminEntityRow => ({
|
||||
assets: assetsForIwt2Boss(boss.id, bossAssets),
|
||||
attacks: bossAttacks(boss),
|
||||
bossId: boss.id,
|
||||
color: boss.color,
|
||||
icon: boss.icon,
|
||||
id: boss.id,
|
||||
kind: 'boss',
|
||||
maxHealth: boss.maxHealth,
|
||||
name: boss.name,
|
||||
slug: boss.id,
|
||||
}))
|
||||
const yian = metadata['yian-kut-ku']
|
||||
if (!yian.birdHealth) return bosses
|
||||
return [
|
||||
...bosses,
|
||||
{
|
||||
assets: [],
|
||||
attacks: yianBirdAttacks(yian),
|
||||
bossId: yian.id,
|
||||
color: '#f0b84f',
|
||||
icon: 'v',
|
||||
id: `${yian.id}:yian-bird`,
|
||||
kind: 'mob',
|
||||
maxHealth: yian.birdHealth,
|
||||
name: 'Yian Kut Ku Hatchling',
|
||||
slug: 'yian-bird',
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
function bossAttacks(boss: Iwt2BossMetadata): Iwt2AdminAttack[] {
|
||||
const attacks: Iwt2AdminAttack[] = [{
|
||||
damage: `${boss.meleeDamage}`,
|
||||
details: `Range ${boss.meleeRange}px`,
|
||||
frequency: `${formatSeconds(boss.meleeCooldown)} cooldown`,
|
||||
name: 'Melee',
|
||||
}]
|
||||
if (boss.chargeCooldown > 0) {
|
||||
attacks.push({
|
||||
damage: `${boss.chargeDamage}`,
|
||||
details: `${formatSeconds(boss.chargeWindup)} windup, ${formatSeconds(boss.chargeStunSeconds)} stun / knockdown`,
|
||||
frequency: `${formatSeconds(boss.chargeCooldown)} cooldown`,
|
||||
name: 'Charge',
|
||||
})
|
||||
}
|
||||
if (boss.slamDamage > 0) {
|
||||
attacks.push({
|
||||
damage: `${boss.slamDamage}`,
|
||||
details: `${boss.slamRadius}px radius, ${formatSeconds(boss.slamStunSeconds)} stun / knockdown`,
|
||||
frequency: 'Every 3rd charge',
|
||||
name: 'Ground Slam',
|
||||
})
|
||||
}
|
||||
if (boss.fireballCooldown && boss.fireballDamage) {
|
||||
attacks.push({
|
||||
damage: `${boss.fireballDamage} hit + ${boss.firePuddleDamage ?? 0}/tick puddle`,
|
||||
details: `${boss.firePuddleRadius ?? 0}px puddle for ${formatSeconds(boss.firePuddleSeconds ?? 0)}`,
|
||||
frequency: `${formatSeconds(boss.fireballCooldown)} cooldown`,
|
||||
name: 'Fireball',
|
||||
})
|
||||
}
|
||||
if (boss.birdWaveThresholds?.length) {
|
||||
attacks.push({
|
||||
damage: `${boss.birdContactDamage ?? 0} contact`,
|
||||
details: `${boss.birdWaveThresholds.map((threshold) => `${Math.round(threshold * 100)}%`).join(', ')} HP thresholds`,
|
||||
frequency: 'Health threshold',
|
||||
name: 'Bird Wave',
|
||||
})
|
||||
}
|
||||
return attacks
|
||||
}
|
||||
|
||||
function yianBirdAttacks(boss: Iwt2BossMetadata): Iwt2AdminAttack[] {
|
||||
return [
|
||||
{
|
||||
damage: `${boss.birdContactDamage ?? 0}`,
|
||||
details: `Contact radius ${boss.birdRadius ?? 0}px`,
|
||||
frequency: '1.15s cooldown',
|
||||
name: 'Peck',
|
||||
},
|
||||
{
|
||||
damage: '10',
|
||||
details: `${formatSeconds(boss.birdFlightWindup ?? 0)} windup, ${formatSeconds(boss.birdStunSeconds ?? 0)} stun`,
|
||||
frequency: `${formatSeconds(boss.birdFlightCooldown ?? 0)} cooldown`,
|
||||
name: 'Flight Lane',
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
function assetsForIwt2Boss(bossId: Iwt2BossId, bossAssets: Iwt2AdminAsset[]): Iwt2AdminAsset[] {
|
||||
const terms = bossId.split('-').filter((part) => part.length > 2)
|
||||
return bossAssets.filter((asset) => {
|
||||
const filename = asset.filename.toLowerCase()
|
||||
return filename.includes(bossId) || terms.some((term) => filename.includes(term))
|
||||
})
|
||||
}
|
||||
|
||||
function iwt2AssetLabel(filename: string) {
|
||||
const normalized = filename.toLowerCase()
|
||||
if (normalized.includes('approach')) return 'Approach Illustration'
|
||||
if (normalized.includes('guardians')) return 'Party Encounter Art'
|
||||
if (normalized.includes('boss')) return 'Boss Portrait'
|
||||
return 'Primary Boss Art'
|
||||
}
|
||||
|
||||
function formatSeconds(value: number) {
|
||||
return `${Number.isInteger(value) ? value.toFixed(0) : value.toFixed(2).replace(/0$/, '')}s`
|
||||
}
|
||||
|
||||
function fileToDataUrl(file: File) {
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
const reader = new FileReader()
|
||||
|
||||
@@ -109,7 +109,7 @@ export const PartyMemberFrame = memo(function PartyMemberFrame({
|
||||
].filter(Boolean).join(' ')
|
||||
const action = targetBinding ? {
|
||||
binding: targetBinding,
|
||||
iconStyle: controllerIconStyle ?? 'xbox',
|
||||
iconStyle: controllerIconStyle ?? 'playstation',
|
||||
} : null
|
||||
|
||||
return (
|
||||
|
||||
@@ -49,6 +49,11 @@ export type DualScreenCombatState = {
|
||||
opponentClassName?: string
|
||||
opponentParty?: PartyMember[]
|
||||
opponentEnemyHealth?: number
|
||||
opponentArena?: {
|
||||
bounds: { width: number, height: number }
|
||||
bosses: Array<{ id: string, name: string, icon: string, color: string, x: number, y: number, radius: number, health: number, maxHealth: number }>
|
||||
party: Array<{ id: string, icon: string, color: string, x: number, y: number, radius: number, health: number, maxHealth: number, isHealer: boolean }>
|
||||
}
|
||||
opponentResource?: number
|
||||
opponentMaxResource?: number
|
||||
opponentResourceName?: string
|
||||
@@ -638,6 +643,48 @@ export function DualScreenBottomDisplay() {
|
||||
</section>
|
||||
)}
|
||||
|
||||
{state.opponentArena && (
|
||||
<section className="dual-opponent-arena" aria-label="Opponent arena">
|
||||
<div
|
||||
className="dual-opponent-arena-field"
|
||||
style={{ aspectRatio: `${state.opponentArena.bounds.width} / ${state.opponentArena.bounds.height}` }}
|
||||
>
|
||||
{state.opponentArena.bosses.map((boss) => (
|
||||
<div
|
||||
className="dual-opponent-arena-entity boss"
|
||||
key={boss.id}
|
||||
style={{
|
||||
backgroundColor: boss.color,
|
||||
height: `${Math.max(8, (boss.radius / state.opponentArena!.bounds.height) * 100)}%`,
|
||||
left: `${(boss.x / state.opponentArena!.bounds.width) * 100}%`,
|
||||
top: `${(boss.y / state.opponentArena!.bounds.height) * 100}%`,
|
||||
width: `${Math.max(8, (boss.radius / state.opponentArena!.bounds.width) * 100)}%`,
|
||||
}}
|
||||
title={`${boss.name} ${Math.ceil(boss.health)} / ${boss.maxHealth}`}
|
||||
>
|
||||
{boss.icon}
|
||||
</div>
|
||||
))}
|
||||
{state.opponentArena.party.map((member) => (
|
||||
<div
|
||||
className={`dual-opponent-arena-entity party ${member.isHealer ? 'healer' : ''}`}
|
||||
key={member.id}
|
||||
style={{
|
||||
backgroundColor: member.color,
|
||||
height: `${Math.max(5, (member.radius / state.opponentArena!.bounds.height) * 100)}%`,
|
||||
left: `${(member.x / state.opponentArena!.bounds.width) * 100}%`,
|
||||
opacity: member.health > 0 ? 1 : 0.35,
|
||||
top: `${(member.y / state.opponentArena!.bounds.height) * 100}%`,
|
||||
width: `${Math.max(5, (member.radius / state.opponentArena!.bounds.width) * 100)}%`,
|
||||
}}
|
||||
>
|
||||
{member.icon}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
)}
|
||||
|
||||
<section className={`dual-opponent-party-grid ${state.opponentParty.length > 6 ? 'raid' : ''}`}>
|
||||
{state.opponentParty.map((member) => (
|
||||
<PartyMemberFrame
|
||||
|
||||
@@ -13,6 +13,10 @@ import { Capacitor } from '@capacitor/core'
|
||||
|
||||
export type InputDevice = 'pc' | 'controller'
|
||||
export type ControllerIconStyle = 'xbox' | 'playstation' | 'nintendo'
|
||||
export type MovementVector = {
|
||||
x: number
|
||||
y: number
|
||||
}
|
||||
|
||||
export const INPUT_ACTIONS = [
|
||||
'navigateUp',
|
||||
@@ -130,14 +134,16 @@ const STORAGE_KEY = 'ashen-halls-input-bindings-v1'
|
||||
const PREFERENCES_STORAGE_KEY = 'ashen-halls-input-preferences-v1'
|
||||
const GAME_ACTION_EVENT = 'ashen-halls-game-action'
|
||||
const NATIVE_CONTROLLER_EVENT = 'ashen-halls-native-controller'
|
||||
const NATIVE_CONTROLLER_MOTION_EVENT = 'ashen-halls-native-controller-motion'
|
||||
const FOCUSABLE_SELECTOR = 'button:not(:disabled):not([data-controller-nav="skip"]), input:not(:disabled):not([data-controller-nav="skip"]), select:not(:disabled):not([data-controller-nav="skip"]), textarea:not(:disabled):not([data-controller-nav="skip"]), [tabindex]:not([tabindex="-1"]):not([data-controller-nav="skip"])'
|
||||
const MAIN_CONTENT_SELECTOR = '.auth-shell, .menu-screen, .content-screen, .dungeon-run-screen, .dual-bottom-display'
|
||||
const MAIN_CONTENT_SELECTOR = '.auth-shell, .menu-screen, .content-screen, .dungeon-run-screen, .dual-bottom-display, .iwt2-bottom-display'
|
||||
const HEADER_CONTENT_SELECTOR = '.app-header'
|
||||
const GAMEPAD_COMBAT_POLL_MS = 1000 / 60
|
||||
const GAMEPAD_MENU_POLL_MS = 1000 / 30
|
||||
const GAMEPAD_BROWSER_DISCONNECTED_POLL_MS = 250
|
||||
const CONTROLLER_REPEAT_INITIAL_MS = 260
|
||||
const CONTROLLER_REPEAT_MS = 85
|
||||
const NATIVE_STICK_TIMEOUT_MS = 140
|
||||
const DPAD_NAV_ACTIONS: Partial<Record<string, InputAction>> = {
|
||||
Button12: 'navigateUp',
|
||||
Button13: 'navigateDown',
|
||||
@@ -235,13 +241,13 @@ function loadPreferences() {
|
||||
combatTouchLocked?: boolean
|
||||
}
|
||||
return {
|
||||
controllerIconStyle: saved.controllerIconStyle ?? 'xbox',
|
||||
controllerIconStyle: saved.controllerIconStyle ?? 'playstation',
|
||||
directPartyTargeting: saved.directPartyTargeting ?? false,
|
||||
combatTouchLocked: saved.combatTouchLocked ?? Capacitor.isNativePlatform(),
|
||||
}
|
||||
} catch {
|
||||
return {
|
||||
controllerIconStyle: 'xbox' as ControllerIconStyle,
|
||||
controllerIconStyle: 'playstation' as ControllerIconStyle,
|
||||
directPartyTargeting: false,
|
||||
combatTouchLocked: Capacitor.isNativePlatform(),
|
||||
}
|
||||
@@ -530,6 +536,10 @@ function isCombatActive() {
|
||||
return Boolean(document.querySelector('[data-combat-active="true"]'))
|
||||
}
|
||||
|
||||
function hasContinuousMovementActive() {
|
||||
return Boolean(document.querySelector('[data-continuous-movement-active="true"]'))
|
||||
}
|
||||
|
||||
function firstConnectedGamepad() {
|
||||
return Array.from(navigator.getGamepads?.() ?? []).find(Boolean) ?? null
|
||||
}
|
||||
@@ -686,6 +696,12 @@ export function InputProvider({ children }: { children: ReactNode }) {
|
||||
document.querySelector('[data-combat-active="true"]'),
|
||||
)
|
||||
const uiOverlay = hasUiOverlay()
|
||||
if (
|
||||
combatActive
|
||||
&& !uiOverlay
|
||||
&& hasContinuousMovementActive()
|
||||
&& (token.startsWith('Axis0') || token.startsWith('Axis1'))
|
||||
) return
|
||||
const uiPriority = [
|
||||
'navigateUp',
|
||||
'navigateDown',
|
||||
@@ -1046,6 +1062,92 @@ export function InputProvider({ children }: { children: ReactNode }) {
|
||||
)
|
||||
}
|
||||
|
||||
function normalizedVector(x: number, y: number): MovementVector {
|
||||
const magnitude = Math.hypot(x, y)
|
||||
if (magnitude <= 1) return { x, y }
|
||||
return { x: x / magnitude, y: y / magnitude }
|
||||
}
|
||||
|
||||
function applyStickDeadzone(x: number, y: number, deadzone = 0.18): MovementVector {
|
||||
const magnitude = Math.hypot(x, y)
|
||||
if (magnitude < deadzone) return { x: 0, y: 0 }
|
||||
const scaled = Math.min(1, (magnitude - deadzone) / (1 - deadzone))
|
||||
return {
|
||||
x: (x / magnitude) * scaled,
|
||||
y: (y / magnitude) * scaled,
|
||||
}
|
||||
}
|
||||
|
||||
export function useMovementVectorRef(enabled = true) {
|
||||
const movementRef = useRef<MovementVector>({ x: 0, y: 0 })
|
||||
|
||||
useEffect(() => {
|
||||
if (!enabled) {
|
||||
movementRef.current = { x: 0, y: 0 }
|
||||
return undefined
|
||||
}
|
||||
|
||||
let frame = 0
|
||||
const pressedKeys = new Set<string>()
|
||||
let nativeStick: MovementVector = { x: 0, y: 0 }
|
||||
let nativeStickUpdatedAt = 0
|
||||
const keyboardVector = () => normalizedVector(
|
||||
(pressedKeys.has('KeyD') ? 1 : 0) - (pressedKeys.has('KeyA') ? 1 : 0),
|
||||
(pressedKeys.has('KeyS') ? 1 : 0) - (pressedKeys.has('KeyW') ? 1 : 0),
|
||||
)
|
||||
const updateMovement = () => {
|
||||
const gamepad = firstConnectedGamepad()
|
||||
const stick = gamepad ? applyStickDeadzone(gamepad.axes[0] ?? 0, gamepad.axes[1] ?? 0) : { x: 0, y: 0 }
|
||||
const native = performance.now() - nativeStickUpdatedAt <= NATIVE_STICK_TIMEOUT_MS
|
||||
? applyStickDeadzone(nativeStick.x, nativeStick.y)
|
||||
: { x: 0, y: 0 }
|
||||
const keyboard = keyboardVector()
|
||||
movementRef.current = Math.hypot(native.x, native.y) > 0
|
||||
? native
|
||||
: Math.hypot(stick.x, stick.y) > 0
|
||||
? stick
|
||||
: keyboard
|
||||
frame = window.requestAnimationFrame(updateMovement)
|
||||
}
|
||||
const onNativeMotion = (event: Event) => {
|
||||
const detail = (event as CustomEvent<Partial<MovementVector>>).detail
|
||||
nativeStick = {
|
||||
x: Number(detail.x) || 0,
|
||||
y: Number(detail.y) || 0,
|
||||
}
|
||||
nativeStickUpdatedAt = performance.now()
|
||||
document.documentElement.dataset.inputDevice = 'controller'
|
||||
}
|
||||
const onKeyDown = (event: KeyboardEvent) => {
|
||||
if (isTextInput(document.activeElement)) return
|
||||
if (!['KeyW', 'KeyA', 'KeyS', 'KeyD'].includes(event.code)) return
|
||||
pressedKeys.add(event.code)
|
||||
document.documentElement.dataset.inputDevice = 'pc'
|
||||
event.preventDefault()
|
||||
}
|
||||
const onKeyUp = (event: KeyboardEvent) => {
|
||||
if (!['KeyW', 'KeyA', 'KeyS', 'KeyD'].includes(event.code)) return
|
||||
pressedKeys.delete(event.code)
|
||||
event.preventDefault()
|
||||
}
|
||||
|
||||
window.addEventListener(NATIVE_CONTROLLER_MOTION_EVENT, onNativeMotion)
|
||||
window.addEventListener('keydown', onKeyDown)
|
||||
window.addEventListener('keyup', onKeyUp)
|
||||
frame = window.requestAnimationFrame(updateMovement)
|
||||
|
||||
return () => {
|
||||
window.cancelAnimationFrame(frame)
|
||||
window.removeEventListener(NATIVE_CONTROLLER_MOTION_EVENT, onNativeMotion)
|
||||
window.removeEventListener('keydown', onKeyDown)
|
||||
window.removeEventListener('keyup', onKeyUp)
|
||||
movementRef.current = { x: 0, y: 0 }
|
||||
}
|
||||
}, [enabled])
|
||||
|
||||
return movementRef
|
||||
}
|
||||
|
||||
export function useInput() {
|
||||
const context = useContext(InputContext)
|
||||
if (!context) throw new Error('useInput must be used inside InputProvider')
|
||||
|
||||
@@ -2,13 +2,21 @@ import { StrictMode } from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import { Capacitor } from '@capacitor/core'
|
||||
import './index.css'
|
||||
import './App.css'
|
||||
import App from './App.tsx'
|
||||
import { InputProvider } from './input.tsx'
|
||||
import { DualScreenBottomDisplay, DualScreenProvider, DualScreenStartupPrompt } from './dualScreen.tsx'
|
||||
import { Iwt2BottomDisplay } from './modes/iwt2/Iwt2BottomDisplay.tsx'
|
||||
|
||||
const displayMode = new URLSearchParams(window.location.search).get('display')
|
||||
|
||||
createRoot(document.getElementById('root')!).render(
|
||||
<StrictMode>
|
||||
{new URLSearchParams(window.location.search).get('display') === 'bottom' ? (
|
||||
{displayMode === 'iwt2-bottom' ? (
|
||||
<InputProvider>
|
||||
<Iwt2BottomDisplay />
|
||||
</InputProvider>
|
||||
) : displayMode === 'bottom' ? (
|
||||
<InputProvider>
|
||||
<DualScreenBottomDisplay />
|
||||
</InputProvider>
|
||||
|
||||
@@ -0,0 +1,605 @@
|
||||
import { useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { useGameAction } from '../../input'
|
||||
import { getGameMode } from '../../gameRepository'
|
||||
import { startPvpQueueWithCpuFallback } from '../../pvpQueueLifecycle'
|
||||
import { summarizeChoiceStacks } from '../../combat/roguelikeUpgrades'
|
||||
import {
|
||||
useDualScreen,
|
||||
useDualScreenSetupPublisher,
|
||||
useDualScreenWorkshopPublisher,
|
||||
type DualScreenSetupState,
|
||||
type DualScreenWorkshopState,
|
||||
} from '../../dualScreen'
|
||||
import { BossArenaScreen } from './screens/BossArenaScreen'
|
||||
import {
|
||||
Iwt2CloudSaveScreen,
|
||||
Iwt2CustomizeCharacterScreen,
|
||||
Iwt2DungeonsScreen,
|
||||
Iwt2HunterProfileScreen,
|
||||
Iwt2ModeScreen,
|
||||
Iwt2RoguelikeScreen,
|
||||
Iwt2RoguelikeUpgradeScreen,
|
||||
Iwt2SettingsScreen,
|
||||
} from './screens/Iwt2ShellScreens'
|
||||
import {
|
||||
loadIwt2Save,
|
||||
writeIwt2Save,
|
||||
type Iwt2Save,
|
||||
} from './save/iwt2Repository'
|
||||
import { IWT2_BOSS_METADATA, type Iwt2BossId } from './content/bosses'
|
||||
import { abilitiesForHealer, IWT2_HEALER_METADATA } from './content/healerAbilities'
|
||||
import {
|
||||
buildIwt2OpponentDebuffChoices,
|
||||
buildIwt2SelfBuffChoices,
|
||||
IWT2_REVIVE_PARTY_CHOICE,
|
||||
type Iwt2RoguelikeChoice,
|
||||
type Iwt2RoguelikeContentType,
|
||||
type Iwt2RoguelikeOpponentDebuffId,
|
||||
type Iwt2RoguelikeSelfBuffId,
|
||||
type Iwt2RoguelikeVariant,
|
||||
} from './content/roguelike'
|
||||
|
||||
type Iwt2Screen =
|
||||
| 'menu'
|
||||
| 'arena'
|
||||
| 'cloud-save'
|
||||
| 'dungeons'
|
||||
| 'raids'
|
||||
| 'roguelike'
|
||||
| 'roguelike-arena'
|
||||
| 'roguelike-upgrade'
|
||||
| 'hunter-profile'
|
||||
| 'customize-character'
|
||||
| 'settings'
|
||||
|
||||
const IWT2_MENU_COLUMNS = 4
|
||||
const IWT2_ROGUELIKE_CHOICE_COUNT = 3
|
||||
|
||||
type Iwt2RoguelikeRunState = {
|
||||
bossIds: Iwt2BossId[]
|
||||
buffs: Iwt2RoguelikeSelfBuffId[]
|
||||
contentType: Iwt2RoguelikeContentType
|
||||
debuffs: Iwt2RoguelikeOpponentDebuffId[]
|
||||
debuffChoices: Array<Iwt2RoguelikeChoice<Iwt2RoguelikeOpponentDebuffId>>
|
||||
selfChoices: Array<Iwt2RoguelikeChoice<Iwt2RoguelikeSelfBuffId>>
|
||||
stage: number
|
||||
variant: Iwt2RoguelikeVariant
|
||||
}
|
||||
|
||||
const MENU_ITEMS: Array<{
|
||||
screen: Iwt2Screen
|
||||
title: string
|
||||
description: string
|
||||
glyph: string
|
||||
}> = [
|
||||
{
|
||||
screen: 'cloud-save',
|
||||
title: 'Backup Slot',
|
||||
description: 'Save or restore the isolated IWT2 progress slot.',
|
||||
glyph: 'C',
|
||||
},
|
||||
{
|
||||
screen: 'dungeons',
|
||||
title: 'Dungeons',
|
||||
description: 'Queue into seven modular IWT2 boss arenas.',
|
||||
glyph: 'D',
|
||||
},
|
||||
{
|
||||
screen: 'raids',
|
||||
title: 'Raids',
|
||||
description: 'Open raid assignments built from active IWT2 boss mechanics.',
|
||||
glyph: 'R',
|
||||
},
|
||||
{
|
||||
screen: 'roguelike',
|
||||
title: 'Roguelike',
|
||||
description: 'Draft upgrades through escalating random encounters.',
|
||||
glyph: 'L',
|
||||
},
|
||||
{
|
||||
screen: 'roguelike',
|
||||
title: 'PvP',
|
||||
description: 'Race another healer through roguelike encounters with buffs and sabotage.',
|
||||
glyph: 'P',
|
||||
},
|
||||
{
|
||||
screen: 'hunter-profile',
|
||||
title: 'Hunter Profile',
|
||||
description: 'IWT2 level, inventory summary, and collection log.',
|
||||
glyph: 'H',
|
||||
},
|
||||
{
|
||||
screen: 'customize-character',
|
||||
title: 'Customize Character',
|
||||
description: 'Choose healer kit, armor palette, and IWT2 hunter callsign.',
|
||||
glyph: 'K',
|
||||
},
|
||||
{
|
||||
screen: 'settings',
|
||||
title: 'Settings',
|
||||
description: 'IWT2 targeting preference and controller icon style.',
|
||||
glyph: 'S',
|
||||
},
|
||||
]
|
||||
|
||||
export function IWantToHeal2App({ onBackToGameSelect }: { onBackToGameSelect: () => void }) {
|
||||
const { enabled: dualScreenEnabled } = useDualScreen()
|
||||
const [screen, setScreen] = useState<Iwt2Screen>('menu')
|
||||
const [save, setSave] = useState<Iwt2Save>(loadIwt2Save)
|
||||
const [selectedIndex, setSelectedIndex] = useState(0)
|
||||
const [selectedBossId, setSelectedBossId] = useState<Iwt2BossId>('bulldrome')
|
||||
const [arenaModeLabel, setArenaModeLabel] = useState('Dungeon')
|
||||
const [roguelikeVariant, setRoguelikeVariant] = useState<Iwt2RoguelikeVariant>('pve')
|
||||
const [roguelikeContentType, setRoguelikeContentType] = useState<Iwt2RoguelikeContentType>('dungeon')
|
||||
const [roguelikeRun, setRoguelikeRun] = useState<Iwt2RoguelikeRunState | null>(null)
|
||||
const [pvpQueueMessage, setPvpQueueMessage] = useState('')
|
||||
const cancelPvpQueueRef = useRef<(() => void) | null>(null)
|
||||
|
||||
useEffect(() => {
|
||||
writeIwt2Save(save)
|
||||
}, [save])
|
||||
|
||||
useEffect(() => () => {
|
||||
cancelPvpQueueRef.current?.()
|
||||
}, [])
|
||||
|
||||
const setupDualScreenState = useMemo<DualScreenSetupState | null>(
|
||||
() => buildIwt2SetupDualScreenState(screen, selectedBossId, save),
|
||||
[save, screen, selectedBossId],
|
||||
)
|
||||
const workshopDualScreenState = useMemo<DualScreenWorkshopState | null>(
|
||||
() => buildIwt2WorkshopDualScreenState(screen, save),
|
||||
[save, screen],
|
||||
)
|
||||
|
||||
useDualScreenSetupPublisher(setupDualScreenState, dualScreenEnabled)
|
||||
useDualScreenWorkshopPublisher(workshopDualScreenState, dualScreenEnabled)
|
||||
|
||||
useGameAction((action, device) => {
|
||||
if (screen !== 'menu' || device !== 'controller') return
|
||||
if (action === 'back') {
|
||||
onBackToGameSelect()
|
||||
return
|
||||
}
|
||||
if (action === 'confirm') {
|
||||
openMenuItem(MENU_ITEMS[selectedIndex])
|
||||
return
|
||||
}
|
||||
if (action === 'navigateUp' || action === 'navigateLeft') {
|
||||
const offset = action === 'navigateUp' ? IWT2_MENU_COLUMNS : 1
|
||||
setSelectedIndex((current) => Math.max(0, current - offset))
|
||||
} else if (action === 'navigateDown' || action === 'navigateRight') {
|
||||
const offset = action === 'navigateDown' ? IWT2_MENU_COLUMNS : 1
|
||||
setSelectedIndex((current) => Math.min(MENU_ITEMS.length - 1, current + offset))
|
||||
}
|
||||
})
|
||||
|
||||
function openMenuItem(item: (typeof MENU_ITEMS)[number]) {
|
||||
if (item.title === 'PvP') {
|
||||
setRoguelikeVariant('pvp')
|
||||
setScreen('roguelike')
|
||||
return
|
||||
}
|
||||
if (item.title === 'Roguelike') {
|
||||
setRoguelikeVariant('pve')
|
||||
setRoguelikeContentType((current) => current === 'stadium' ? 'dungeon' : current)
|
||||
}
|
||||
setScreen(item.screen)
|
||||
}
|
||||
|
||||
if (screen === 'arena') {
|
||||
return (
|
||||
<BossArenaScreen
|
||||
bossId={selectedBossId}
|
||||
key={`arena-${selectedBossId}-${arenaModeLabel}`}
|
||||
modeLabel={arenaModeLabel}
|
||||
save={save}
|
||||
onBack={() => setScreen('menu')}
|
||||
onSaveUpdated={setSave}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
if (screen === 'roguelike-arena' && roguelikeRun) {
|
||||
return (
|
||||
<BossArenaScreen
|
||||
bossIds={roguelikeRun.bossIds}
|
||||
bossId={selectedBossId}
|
||||
key={`roguelike-${roguelikeRun.variant}-${roguelikeRun.contentType}-${roguelikeRun.stage}-${roguelikeRun.bossIds.join('-')}`}
|
||||
roguelikeRun={{
|
||||
buffs: roguelikeRun.buffs,
|
||||
contentType: roguelikeRun.contentType,
|
||||
debuffs: roguelikeRun.debuffs,
|
||||
onVictory: () => {
|
||||
setRoguelikeRun((current) => current
|
||||
? {
|
||||
...current,
|
||||
...buildRoguelikeChoices(save, current.variant),
|
||||
}
|
||||
: current)
|
||||
setScreen('roguelike-upgrade')
|
||||
},
|
||||
stage: roguelikeRun.stage,
|
||||
variant: roguelikeRun.variant,
|
||||
}}
|
||||
save={save}
|
||||
onBack={() => setScreen('roguelike')}
|
||||
onSaveUpdated={setSave}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
if (screen === 'roguelike-upgrade' && roguelikeRun) {
|
||||
return (
|
||||
<main className="game-shell iwt2-shell">
|
||||
<Iwt2Header save={save} onBackToGameSelect={onBackToGameSelect} />
|
||||
<Iwt2RoguelikeUpgradeScreen
|
||||
activeBuffSummary={summarizeIwt2Buffs(save, roguelikeRun.buffs)}
|
||||
activeDebuffSummary={summarizeIwt2Debuffs(save, roguelikeRun.debuffs)}
|
||||
contentType={roguelikeRun.contentType}
|
||||
debuffChoices={roguelikeRun.debuffChoices}
|
||||
selfChoices={roguelikeRun.selfChoices}
|
||||
stage={roguelikeRun.stage}
|
||||
variant={roguelikeRun.variant}
|
||||
onBack={() => setScreen('roguelike')}
|
||||
onChoose={(buffId, debuffId) => {
|
||||
const nextRun = applyRoguelikeChoice(roguelikeRun, buffId, debuffId, save)
|
||||
setRoguelikeRun(nextRun)
|
||||
setSelectedBossId(nextRun.bossIds[0] ?? 'bulldrome')
|
||||
setScreen('roguelike-arena')
|
||||
}}
|
||||
/>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
|
||||
if (screen === 'dungeons') {
|
||||
return (
|
||||
<main className="game-shell iwt2-shell">
|
||||
<Iwt2Header save={save} onBackToGameSelect={onBackToGameSelect} />
|
||||
<Iwt2DungeonsScreen
|
||||
onBack={() => setScreen('menu')}
|
||||
onOpenBoss={(bossId) => {
|
||||
setArenaModeLabel('Dungeon')
|
||||
setSelectedBossId(bossId)
|
||||
setScreen('arena')
|
||||
}}
|
||||
/>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
|
||||
if (screen === 'roguelike') {
|
||||
return (
|
||||
<main className="game-shell iwt2-shell">
|
||||
<Iwt2Header save={save} onBackToGameSelect={onBackToGameSelect} />
|
||||
<Iwt2RoguelikeScreen
|
||||
contentType={roguelikeContentType}
|
||||
variant={roguelikeVariant}
|
||||
onBack={() => setScreen('menu')}
|
||||
onContentTypeChange={setRoguelikeContentType}
|
||||
onStart={() => {
|
||||
startIwt2RoguelikeRun()
|
||||
}}
|
||||
onVariantChange={(nextVariant) => {
|
||||
cancelPvpQueueRef.current?.()
|
||||
cancelPvpQueueRef.current = null
|
||||
setPvpQueueMessage('')
|
||||
setRoguelikeVariant(nextVariant)
|
||||
if (nextVariant === 'pve' && roguelikeContentType === 'stadium') {
|
||||
setRoguelikeContentType('dungeon')
|
||||
}
|
||||
}}
|
||||
queueMessage={pvpQueueMessage}
|
||||
/>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
|
||||
if (screen === 'raids') {
|
||||
return (
|
||||
<main className="game-shell iwt2-shell">
|
||||
<Iwt2Header save={save} onBackToGameSelect={onBackToGameSelect} />
|
||||
<Iwt2ModeScreen
|
||||
mode="Raids"
|
||||
onBack={() => setScreen('menu')}
|
||||
onOpenBoss={(bossId) => {
|
||||
setArenaModeLabel('Raid')
|
||||
setSelectedBossId(bossId)
|
||||
setScreen('arena')
|
||||
}}
|
||||
/>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
|
||||
if (screen === 'hunter-profile') {
|
||||
return (
|
||||
<main className="game-shell iwt2-shell">
|
||||
<Iwt2HunterProfileScreen save={save} onBack={() => setScreen('menu')} />
|
||||
</main>
|
||||
)
|
||||
}
|
||||
|
||||
if (screen === 'customize-character') {
|
||||
return (
|
||||
<main className="game-shell iwt2-shell">
|
||||
<Iwt2Header save={save} onBackToGameSelect={onBackToGameSelect} />
|
||||
<Iwt2CustomizeCharacterScreen
|
||||
save={save}
|
||||
onBack={() => setScreen('menu')}
|
||||
onSaveUpdated={setSave}
|
||||
/>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
|
||||
if (screen === 'cloud-save') {
|
||||
return (
|
||||
<main className="game-shell iwt2-shell">
|
||||
<Iwt2Header save={save} onBackToGameSelect={onBackToGameSelect} />
|
||||
<Iwt2CloudSaveScreen
|
||||
save={save}
|
||||
onBack={() => setScreen('menu')}
|
||||
onSaveUpdated={setSave}
|
||||
/>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
|
||||
if (screen === 'settings') {
|
||||
return (
|
||||
<main className="game-shell iwt2-shell">
|
||||
<Iwt2Header save={save} onBackToGameSelect={onBackToGameSelect} />
|
||||
<Iwt2SettingsScreen onBack={() => setScreen('menu')} />
|
||||
</main>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<main className="game-shell iwt2-shell">
|
||||
<Iwt2Header save={save} onBackToGameSelect={onBackToGameSelect} />
|
||||
|
||||
{screen === 'menu' && (
|
||||
<section className="iwt2-menu-screen" data-game-nav-active="true">
|
||||
<div className="iwt2-menu-heading">
|
||||
<p className="eyebrow">I Want To Heal 2</p>
|
||||
<h1>Mode Select</h1>
|
||||
</div>
|
||||
<div className="iwt2-menu-grid">
|
||||
{MENU_ITEMS.map((item, index) => (
|
||||
<button
|
||||
className={`iwt2-menu-card ${selectedIndex === index ? 'game-selected' : ''}`}
|
||||
data-controller-nav="skip"
|
||||
data-game-selected={selectedIndex === index ? 'true' : undefined}
|
||||
key={`${item.screen}-${item.title}`}
|
||||
onClick={() => openMenuItem(item)}
|
||||
onPointerDown={() => setSelectedIndex(index)}
|
||||
type="button"
|
||||
>
|
||||
<span>{item.glyph}</span>
|
||||
<div>
|
||||
<strong>{item.title}</strong>
|
||||
<small>{item.description}</small>
|
||||
</div>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
)}
|
||||
</main>
|
||||
)
|
||||
|
||||
function startIwt2RoguelikeRun() {
|
||||
cancelPvpQueueRef.current?.()
|
||||
cancelPvpQueueRef.current = null
|
||||
setPvpQueueMessage('')
|
||||
if (roguelikeVariant !== 'pvp') {
|
||||
beginIwt2RoguelikeArena(roguelikeVariant, roguelikeContentType)
|
||||
return
|
||||
}
|
||||
const startStage = 1
|
||||
cancelPvpQueueRef.current = startPvpQueueWithCpuFallback<unknown>({
|
||||
contentType: roguelikeContentType,
|
||||
startStage,
|
||||
gameMode: getGameMode(),
|
||||
liveMatchActive: () => false,
|
||||
onSearching: setPvpQueueMessage,
|
||||
onCpuMatch: (_difficulty, message) => {
|
||||
cancelPvpQueueRef.current = null
|
||||
setPvpQueueMessage(message)
|
||||
beginIwt2RoguelikeArena('pvp', roguelikeContentType)
|
||||
},
|
||||
onLiveMatch: (...liveMatchArgs) => {
|
||||
const message = liveMatchArgs[2]
|
||||
cancelPvpQueueRef.current = null
|
||||
setPvpQueueMessage(message)
|
||||
beginIwt2RoguelikeArena('pvp', roguelikeContentType)
|
||||
},
|
||||
messages: {
|
||||
offline: (difficulty) => `Offline mode. CPU ${difficulty} enters IWT2 ${formatRoguelikeContentType(roguelikeContentType)}.`,
|
||||
searching: `Searching IWT2 ${formatRoguelikeContentType(roguelikeContentType)} queue for 5s.`,
|
||||
notFound: (difficulty) => `No IWT2 opponent found after 5s. CPU ${difficulty} steps in.`,
|
||||
unavailable: (difficulty) => `PvP server unavailable. CPU ${difficulty} steps in.`,
|
||||
liveFound: () => `Opponent found. Starting IWT2 ${formatRoguelikeContentType(roguelikeContentType)} race.`,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
function beginIwt2RoguelikeArena(
|
||||
variant: Iwt2RoguelikeVariant,
|
||||
contentType: Iwt2RoguelikeContentType,
|
||||
) {
|
||||
const nextRun = createRoguelikeRun(save, variant, contentType)
|
||||
setRoguelikeRun(nextRun)
|
||||
setSelectedBossId(nextRun.bossIds[0] ?? 'bulldrome')
|
||||
setScreen('roguelike-arena')
|
||||
}
|
||||
}
|
||||
|
||||
function formatRoguelikeContentType(contentType: Iwt2RoguelikeContentType) {
|
||||
if (contentType === 'raid') return 'Raid'
|
||||
if (contentType === 'stadium') return 'Stadium'
|
||||
return 'Dungeon'
|
||||
}
|
||||
|
||||
function createRoguelikeRun(
|
||||
save: Iwt2Save,
|
||||
variant: Iwt2RoguelikeVariant,
|
||||
contentType: Iwt2RoguelikeContentType,
|
||||
): Iwt2RoguelikeRunState {
|
||||
return {
|
||||
bossIds: createRandomRoguelikeBossPair(),
|
||||
buffs: [],
|
||||
contentType,
|
||||
debuffs: [],
|
||||
...buildRoguelikeChoices(save, variant),
|
||||
stage: 1,
|
||||
variant,
|
||||
}
|
||||
}
|
||||
|
||||
function buildRoguelikeChoices(save: Iwt2Save, variant: Iwt2RoguelikeVariant) {
|
||||
const abilities = abilitiesForHealer(save.character.healerStyle)
|
||||
const selfCatalog = [IWT2_REVIVE_PARTY_CHOICE, ...buildIwt2SelfBuffChoices(abilities)]
|
||||
const debuffCatalog = buildIwt2OpponentDebuffChoices(abilities)
|
||||
return {
|
||||
selfChoices: chooseRunChoices(selfCatalog, IWT2_ROGUELIKE_CHOICE_COUNT),
|
||||
debuffChoices: variant === 'pvp'
|
||||
? chooseRunChoices(debuffCatalog, IWT2_ROGUELIKE_CHOICE_COUNT)
|
||||
: [],
|
||||
}
|
||||
}
|
||||
|
||||
function summarizeIwt2Buffs(save: Iwt2Save, buffs: Iwt2RoguelikeSelfBuffId[]) {
|
||||
if (buffs.length === 0) return ''
|
||||
const abilities = abilitiesForHealer(save.character.healerStyle)
|
||||
return summarizeChoiceStacks(
|
||||
buffs,
|
||||
[IWT2_REVIVE_PARTY_CHOICE, ...buildIwt2SelfBuffChoices(abilities)],
|
||||
'None',
|
||||
)
|
||||
}
|
||||
|
||||
function summarizeIwt2Debuffs(save: Iwt2Save, debuffs: Iwt2RoguelikeOpponentDebuffId[]) {
|
||||
if (debuffs.length === 0) return ''
|
||||
const abilities = abilitiesForHealer(save.character.healerStyle)
|
||||
return summarizeChoiceStacks(
|
||||
debuffs,
|
||||
buildIwt2OpponentDebuffChoices(abilities),
|
||||
'None',
|
||||
)
|
||||
}
|
||||
|
||||
function applyRoguelikeChoice(
|
||||
run: Iwt2RoguelikeRunState,
|
||||
buffId: Iwt2RoguelikeSelfBuffId,
|
||||
debuffId: Iwt2RoguelikeOpponentDebuffId | undefined,
|
||||
save: Iwt2Save,
|
||||
): Iwt2RoguelikeRunState {
|
||||
const nextDebuffs = debuffId ? [...run.debuffs, debuffId] : run.debuffs
|
||||
const nextBase = buffId === IWT2_REVIVE_PARTY_CHOICE.id
|
||||
? {
|
||||
buffs: run.buffs,
|
||||
debuffs: nextDebuffs.slice(1),
|
||||
}
|
||||
: {
|
||||
buffs: [...run.buffs, buffId],
|
||||
debuffs: nextDebuffs,
|
||||
}
|
||||
return {
|
||||
...run,
|
||||
...nextBase,
|
||||
bossIds: createRandomRoguelikeBossPair(),
|
||||
...buildRoguelikeChoices(save, run.variant),
|
||||
stage: run.stage + 1,
|
||||
}
|
||||
}
|
||||
|
||||
function createRandomRoguelikeBossPair(): Iwt2BossId[] {
|
||||
const pool = Object.keys(IWT2_BOSS_METADATA) as Iwt2BossId[]
|
||||
return chooseRunChoices(pool, 2)
|
||||
}
|
||||
|
||||
function chooseRunChoices<T>(items: readonly T[], count: number): T[] {
|
||||
const pool = [...items]
|
||||
const choices: T[] = []
|
||||
while (pool.length > 0 && choices.length < count) {
|
||||
const index = Math.floor(Math.random() * pool.length)
|
||||
const [choice] = pool.splice(index, 1)
|
||||
if (choice) choices.push(choice)
|
||||
}
|
||||
return choices
|
||||
}
|
||||
|
||||
function Iwt2Header({
|
||||
onBackToGameSelect,
|
||||
save,
|
||||
}: {
|
||||
onBackToGameSelect: () => void
|
||||
save: Iwt2Save
|
||||
}) {
|
||||
return (
|
||||
<header className="topbar app-header">
|
||||
<button className="brand-button" onClick={onBackToGameSelect} type="button">
|
||||
<strong>Games</strong>
|
||||
</button>
|
||||
<div className="character-summary">
|
||||
<strong>{save.character.name}</strong>
|
||||
<small>IWT2 Level {save.character.level}</small>
|
||||
<small>{save.character.experience} XP</small>
|
||||
</div>
|
||||
</header>
|
||||
)
|
||||
}
|
||||
|
||||
function buildIwt2SetupDualScreenState(
|
||||
screen: Iwt2Screen,
|
||||
selectedBossId: Iwt2BossId,
|
||||
save: Iwt2Save,
|
||||
): DualScreenSetupState | null {
|
||||
if (screen !== 'dungeons' && screen !== 'raids') return null
|
||||
const boss = IWT2_BOSS_METADATA[selectedBossId]
|
||||
const raid = screen === 'raids'
|
||||
return {
|
||||
contentType: raid ? 'raid' : 'dungeon',
|
||||
description: raid
|
||||
? `${boss.name} raid assignment. Tank holds aggro while party moves around modular boss mechanics.`
|
||||
: `${boss.name} arena. Heal the party through melee pressure, telegraphs, hazards, and stun recovery.`,
|
||||
difficultyName: `IWT2 Level ${save.character.level}`,
|
||||
experience: 125,
|
||||
initials: boss.icon,
|
||||
itemLevel: save.character.level,
|
||||
stats: {
|
||||
damage: `${boss.meleeDamage}`,
|
||||
health: `${boss.maxHealth}`,
|
||||
loot: 'IWT2',
|
||||
xp: '125',
|
||||
},
|
||||
subtitle: `${raid ? 'Raid' : 'Dungeon'} | 6 Players | ${IWT2_HEALER_METADATA[save.character.healerStyle].name}`,
|
||||
title: raid ? `${boss.name} Raid` : `${boss.name} Arena`,
|
||||
}
|
||||
}
|
||||
|
||||
function buildIwt2WorkshopDualScreenState(
|
||||
screen: Iwt2Screen,
|
||||
save: Iwt2Save,
|
||||
): DualScreenWorkshopState | null {
|
||||
if (screen === 'customize-character') {
|
||||
const healer = IWT2_HEALER_METADATA[save.character.healerStyle]
|
||||
return {
|
||||
items: abilitiesForHealer(save.character.healerStyle).map((ability) => ({
|
||||
glyph: ability.icon,
|
||||
meta: `${ability.manaCost} Mana | ${ability.cooldownSeconds}s cooldown`,
|
||||
status: `Slot ${ability.slot}`,
|
||||
title: ability.name,
|
||||
})),
|
||||
mode: 'class',
|
||||
subtitle: healer.description,
|
||||
summary: healer.name,
|
||||
title: 'Customize Character',
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
import { ControllerBindingLabel } from '../../components/ControllerIcons'
|
||||
import { DEFAULT_BINDINGS, useInput } from '../../input'
|
||||
import { IWT2_CLASS_METADATA, IWT2_PARTY_ORDER } from './content/classes'
|
||||
import { IWT2_ABILITY_ACTIONS, IWT2_TARGET_ACTIONS } from './content/controls'
|
||||
import { abilitiesForHealer, IWT2_HEALER_METADATA } from './content/healerAbilities'
|
||||
import { loadIwt2Save } from './save/iwt2Repository'
|
||||
|
||||
export function Iwt2BottomDisplay() {
|
||||
const {
|
||||
bindings,
|
||||
directPartyTargeting,
|
||||
lastDevice,
|
||||
} = useInput()
|
||||
const activeBindings = lastDevice === 'controller'
|
||||
? bindings.controller
|
||||
: DEFAULT_BINDINGS.controller
|
||||
const save = loadIwt2Save()
|
||||
const abilities = abilitiesForHealer(save.character.healerStyle)
|
||||
const healer = IWT2_HEALER_METADATA[save.character.healerStyle]
|
||||
const partyTargets = IWT2_PARTY_ORDER.map((classId) => IWT2_CLASS_METADATA[classId])
|
||||
|
||||
return (
|
||||
<main className="dual-bottom-display iwt2-bottom-display">
|
||||
<section className="dual-controls-resource iwt2-bottom-resource">
|
||||
<div>
|
||||
<p className="eyebrow">I Want To Heal 2</p>
|
||||
<strong>{healer.name}</strong>
|
||||
</div>
|
||||
<div className="dual-controls-mana">
|
||||
<span>Mana 100 / 100</span>
|
||||
<div className="bar mana-bar"><span style={{ width: '100%' }} /></div>
|
||||
</div>
|
||||
</section>
|
||||
<section className={`dual-controls-targets ${directPartyTargeting ? 'direct' : ''}`} aria-label="Party targets">
|
||||
{directPartyTargeting ? (
|
||||
partyTargets.map((target, index) => {
|
||||
const action = IWT2_TARGET_ACTIONS[index] ?? 'targetParty1'
|
||||
const label = target.id === 'healer' ? 'Player' : target.name.replace(' Tank', '')
|
||||
return (
|
||||
<div className="dual-control-chip" key={target.id}>
|
||||
<ControllerBindingLabel
|
||||
binding={activeBindings[action]}
|
||||
iconStyle="playstation"
|
||||
/>{' '}
|
||||
{label}
|
||||
</div>
|
||||
)
|
||||
})
|
||||
) : (
|
||||
<>
|
||||
<div className="dual-control-chip">
|
||||
<ControllerBindingLabel binding="Button12" iconStyle="playstation" /> Previous Target
|
||||
</div>
|
||||
<div className="dual-control-chip">
|
||||
Next Target <ControllerBindingLabel binding="Button13" iconStyle="playstation" />
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</section>
|
||||
<section className="dual-controls-spells iwt2-bottom-spell-grid" aria-label="Spells and cooldowns">
|
||||
{abilities.map((ability, index) => {
|
||||
const action = IWT2_ABILITY_ACTIONS[index] ?? 'ability1'
|
||||
return (
|
||||
<div className="spell iwt2-bottom-spell" key={ability.id}>
|
||||
<kbd>
|
||||
<ControllerBindingLabel
|
||||
binding={activeBindings[action]}
|
||||
compact
|
||||
iconStyle="playstation"
|
||||
/>
|
||||
</kbd>
|
||||
<span className={`spell-icon spell-${ability.kind}`}>{ability.icon}</span>
|
||||
<strong>{ability.name}</strong>
|
||||
<small>{ability.manaCost} Mana</small>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</section>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import type { Iwt2HealerAbility } from '../content/healerAbilities'
|
||||
|
||||
export function AbilityBar({
|
||||
abilities,
|
||||
cooldowns,
|
||||
mana,
|
||||
onCast,
|
||||
}: {
|
||||
abilities: Iwt2HealerAbility[]
|
||||
cooldowns: Record<string, number>
|
||||
mana: number
|
||||
onCast: (ability: Iwt2HealerAbility) => void
|
||||
}) {
|
||||
return (
|
||||
<div className="iwt2-ability-bar">
|
||||
{abilities.map((ability) => {
|
||||
const remaining = cooldowns[ability.id] ?? 0
|
||||
const disabled = remaining > 0 || mana < ability.manaCost
|
||||
return (
|
||||
<button
|
||||
aria-label={`${ability.slot}. ${ability.name}`}
|
||||
className="iwt2-ability-button"
|
||||
disabled={disabled}
|
||||
key={ability.id}
|
||||
onClick={() => onCast(ability)}
|
||||
title={`${ability.name} - ${ability.manaCost} MP`}
|
||||
type="button"
|
||||
>
|
||||
<span>{ability.icon}</span>
|
||||
<strong>{ability.slot}</strong>
|
||||
<i>{remaining > 0 ? `${remaining.toFixed(1)}s` : `${ability.manaCost} MP`}</i>
|
||||
</button>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
export function ArenaBar({
|
||||
className = '',
|
||||
current,
|
||||
max,
|
||||
shield = 0,
|
||||
}: {
|
||||
className?: string
|
||||
current: number
|
||||
max: number
|
||||
shield?: number
|
||||
}) {
|
||||
const percent = max > 0 ? Math.max(0, Math.min(100, (current / max) * 100)) : 0
|
||||
const shieldPercent = max > 0 ? Math.max(0, Math.min(100, (shield / max) * 100)) : 0
|
||||
return (
|
||||
<div className={`iwt2-bar ${className}`}>
|
||||
<span style={{ width: `${percent}%` }} />
|
||||
{shieldPercent > 0 && <i style={{ width: `${shieldPercent}%` }} />}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import type { Iwt2BossEntityState } from '../sim'
|
||||
import { ArenaBar } from './ArenaBars'
|
||||
import { IWT2_BOSS_METADATA } from '../content/bosses'
|
||||
|
||||
export function BossHud({ boss, bosses }: { boss?: Iwt2BossEntityState, bosses?: Iwt2BossEntityState[] }) {
|
||||
const entries = bosses ?? (boss ? [boss] : [])
|
||||
return (
|
||||
<div className="iwt2-boss-hud">
|
||||
{entries.map((entry) => {
|
||||
const metadata = IWT2_BOSS_METADATA[entry.bossId]
|
||||
return (
|
||||
<div className="iwt2-boss-hud-row" key={entry.id}>
|
||||
<div>
|
||||
<strong>{metadata.name}</strong>
|
||||
<small>{Math.ceil(entry.health)} / {entry.maxHealth} HP</small>
|
||||
{entry.maxArmor > 0 && <small>{Math.ceil(entry.armor)} / {entry.maxArmor} Armor</small>}
|
||||
{entry.mechanicEnergyMax > 0 && <small>{Math.ceil(entry.mechanicEnergy)} / {entry.mechanicEnergyMax} Static</small>}
|
||||
</div>
|
||||
<small className="iwt2-boss-phase">{entry.attackPhase}</small>
|
||||
<ArenaBar className="boss" current={entry.health} max={entry.maxHealth} />
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
import { ControllerBindingLabel } from '../../../components/ControllerIcons'
|
||||
import type { ControllerIconStyle } from '../../../input'
|
||||
import { IWT2_CLASS_METADATA } from '../content/classes'
|
||||
import type { Iwt2EntityId, Iwt2PartyEntityState } from '../sim'
|
||||
import { ArenaBar } from './ArenaBars'
|
||||
|
||||
export function PartyFrames({
|
||||
party,
|
||||
selectedPartyId,
|
||||
targetBindings,
|
||||
controllerIconStyle,
|
||||
onTarget,
|
||||
}: {
|
||||
party: Iwt2PartyEntityState[]
|
||||
selectedPartyId: Iwt2EntityId
|
||||
targetBindings?: Array<string | null>
|
||||
controllerIconStyle?: ControllerIconStyle
|
||||
onTarget: (id: Iwt2EntityId) => void
|
||||
}) {
|
||||
return (
|
||||
<aside className="iwt2-party-list" data-game-nav-active="true">
|
||||
{party.map((member) => {
|
||||
const meta = IWT2_CLASS_METADATA[member.classId]
|
||||
const selected = member.id === selectedPartyId
|
||||
const targetBinding = targetBindings?.[party.indexOf(member)]
|
||||
return (
|
||||
<button
|
||||
className={`iwt2-party-row ${targetBinding ? 'has-target-binding' : ''} ${selected ? 'game-selected selected' : ''}`}
|
||||
data-controller-nav="skip"
|
||||
data-game-selected={selected ? 'true' : undefined}
|
||||
key={member.id}
|
||||
onClick={() => onTarget(member.id)}
|
||||
type="button"
|
||||
>
|
||||
{targetBinding && (
|
||||
<span className="iwt2-party-target-key">
|
||||
<ControllerBindingLabel
|
||||
binding={targetBinding}
|
||||
iconStyle={controllerIconStyle ?? 'playstation'}
|
||||
/>
|
||||
</span>
|
||||
)}
|
||||
<span style={{ background: meta.color }}>{meta.icon}</span>
|
||||
<div>
|
||||
<div className="iwt2-party-row-title">
|
||||
<strong>{meta.name}</strong>
|
||||
<small>{Math.ceil(member.health)}</small>
|
||||
</div>
|
||||
<ArenaBar className="hp" current={member.health} max={member.maxHealth} shield={member.shield} />
|
||||
{member.maxMana > 0 && (
|
||||
<ArenaBar className="mana" current={member.mana} max={member.maxMana} />
|
||||
)}
|
||||
<div className="iwt2-party-effects">
|
||||
{member.hotEffects.map((effect) => (
|
||||
<span className="iwt2-effect-badge hot" key={effect.id}>
|
||||
{effect.label} {Math.ceil(effect.remainingSeconds)}s
|
||||
</span>
|
||||
))}
|
||||
{member.shield > 0 && (
|
||||
<span className="iwt2-effect-badge shield">
|
||||
Shield {Math.ceil(member.shield)}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<small className="iwt2-party-damage">Damage {Math.round(member.damageDone)}</small>
|
||||
</div>
|
||||
</button>
|
||||
)
|
||||
})}
|
||||
</aside>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { Iwt2BalanceOverrides } from './bosses'
|
||||
|
||||
// Generated by local admin panel. Commit this file with intended IWT2 balance changes.
|
||||
export const IWT2_BALANCE_OVERRIDES: Iwt2BalanceOverrides = {
|
||||
bosses: {},
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import type { Iwt2BossId } from './bosses'
|
||||
|
||||
export const IWT2_BOSS_PET_DROP_RATE = 1 / 500
|
||||
|
||||
export type Iwt2BossMaterialReward = {
|
||||
id: string
|
||||
name: string
|
||||
}
|
||||
|
||||
export type Iwt2BossPetReward = {
|
||||
id: string
|
||||
name: string
|
||||
}
|
||||
|
||||
const IWT2_BOSS_MATERIAL_REWARDS: Record<Iwt2BossId, Iwt2BossMaterialReward> = {
|
||||
'barroth': { id: 'barroth-shell', name: 'Barroth Shell' },
|
||||
'bulldrome': { id: 'raw-bulldrome-coin', name: 'Raw Bulldrome Coin' },
|
||||
'cinderback-ricochet': { id: 'cinderback-plate', name: 'Cinderback Plate' },
|
||||
'crystal-bat-matriarch': { id: 'crystal-bat-fang', name: 'Crystal Bat Fang' },
|
||||
'ember-mantis-duelist': { id: 'ember-mantis-blade', name: 'Ember Mantis Blade' },
|
||||
'great-jaggi': { id: 'great-jaggi-hide', name: 'Great Jaggi Hide' },
|
||||
'hollowcrown-revenant': { id: 'hollowcrown-antler', name: 'Hollowcrown Antler' },
|
||||
'khezu': { id: 'khezu-pearl', name: 'Khezu Pearl' },
|
||||
'obsidian-ram-golem': { id: 'obsidian-ram-core', name: 'Obsidian Ram Core' },
|
||||
'rathian': { id: 'rathian-scale', name: 'Rathian Scale' },
|
||||
'rimebastion': { id: 'rimebastion-core', name: 'Rimebastion Core' },
|
||||
'sandglass-scorpion': { id: 'sandglass-stinger', name: 'Sandglass Stinger' },
|
||||
'stormcoil-wyrm': { id: 'stormcoil-conductor', name: 'Stormcoil Conductor' },
|
||||
'tobi-kadachi': { id: 'tobi-kadachi-pelt', name: 'Tobi Kadachi Pelt' },
|
||||
'venom-orchid-hydra': { id: 'venom-orchid-pod', name: 'Venom Orchid Pod' },
|
||||
'yian-kut-ku': { id: 'yian-kut-ku-scale', name: 'Yian Kut Ku Scale' },
|
||||
}
|
||||
|
||||
const IWT2_BOSS_PET_REWARDS: Record<Iwt2BossId, Iwt2BossPetReward> = {
|
||||
'barroth': { id: 'barroth-pet', name: 'Barroth Pet' },
|
||||
'bulldrome': { id: 'bulldrome-pet', name: 'Bulldrome Pet' },
|
||||
'cinderback-ricochet': { id: 'cinderback-ricochet-pet', name: 'Cinderback Ricochet Pet' },
|
||||
'crystal-bat-matriarch': { id: 'crystal-bat-matriarch-pet', name: 'Crystal Bat Matriarch Pet' },
|
||||
'ember-mantis-duelist': { id: 'ember-mantis-duelist-pet', name: 'Ember Mantis Duelist Pet' },
|
||||
'great-jaggi': { id: 'great-jaggi-pet', name: 'Great Jaggi Pet' },
|
||||
'hollowcrown-revenant': { id: 'hollowcrown-revenant-pet', name: 'Hollowcrown Revenant Pet' },
|
||||
'khezu': { id: 'khezu-pet', name: 'Khezu Pet' },
|
||||
'obsidian-ram-golem': { id: 'obsidian-ram-golem-pet', name: 'Obsidian Ram Golem Pet' },
|
||||
'rathian': { id: 'rathian-pet', name: 'Rathian Pet' },
|
||||
'rimebastion': { id: 'rimebastion-pet', name: 'Rimebastion Pet' },
|
||||
'sandglass-scorpion': { id: 'sandglass-scorpion-pet', name: 'Sandglass Scorpion Pet' },
|
||||
'stormcoil-wyrm': { id: 'stormcoil-wyrm-pet', name: 'Stormcoil Wyrm Pet' },
|
||||
'tobi-kadachi': { id: 'tobi-kadachi-pet', name: 'Tobi Kadachi Pet' },
|
||||
'venom-orchid-hydra': { id: 'venom-orchid-hydra-pet', name: 'Venom Orchid Hydra Pet' },
|
||||
'yian-kut-ku': { id: 'yian-kut-ku-pet', name: 'Yian Kut Ku Pet' },
|
||||
}
|
||||
|
||||
export function iwt2BossMaterialRewardFor(bossId: Iwt2BossId): Iwt2BossMaterialReward {
|
||||
return IWT2_BOSS_MATERIAL_REWARDS[bossId]
|
||||
}
|
||||
|
||||
export function iwt2BossPetRewardFor(bossId: Iwt2BossId): Iwt2BossPetReward {
|
||||
return IWT2_BOSS_PET_REWARDS[bossId]
|
||||
}
|
||||
@@ -0,0 +1,806 @@
|
||||
import { IWT2_BALANCE_OVERRIDES } from './balanceOverrides'
|
||||
|
||||
export type Iwt2BossId =
|
||||
| 'bulldrome'
|
||||
| 'yian-kut-ku'
|
||||
| 'great-jaggi'
|
||||
| 'khezu'
|
||||
| 'rathian'
|
||||
| 'barroth'
|
||||
| 'tobi-kadachi'
|
||||
| 'rimebastion'
|
||||
| 'ember-mantis-duelist'
|
||||
| 'cinderback-ricochet'
|
||||
| 'obsidian-ram-golem'
|
||||
| 'stormcoil-wyrm'
|
||||
| 'venom-orchid-hydra'
|
||||
| 'sandglass-scorpion'
|
||||
| 'crystal-bat-matriarch'
|
||||
| 'hollowcrown-revenant'
|
||||
|
||||
export type Iwt2BalanceOverrides = {
|
||||
bosses?: Partial<Record<Iwt2BossId, Partial<Pick<Iwt2BossMetadata, 'maxHealth' | 'birdHealth'>>>>
|
||||
}
|
||||
|
||||
export type Iwt2BossMetadata = {
|
||||
id: Iwt2BossId
|
||||
name: string
|
||||
icon: string
|
||||
spriteUrl: string
|
||||
spriteView?: 'topDown' | 'side'
|
||||
spriteWidthScale?: number
|
||||
spriteHeightScale?: number
|
||||
spriteYOffsetScale?: number
|
||||
color: string
|
||||
accentColor: string
|
||||
maxHealth: number
|
||||
radius: number
|
||||
moveSpeed: number
|
||||
meleeRange: number
|
||||
meleeDamage: number
|
||||
meleeCooldown: number
|
||||
chargeCooldown: number
|
||||
chargeWindup: number
|
||||
chargeSpeed: number
|
||||
chargeDamage: number
|
||||
chargeStunSeconds: number
|
||||
chargeLength: number
|
||||
chargeOvershoot: number
|
||||
chargeWidth: number
|
||||
slamWindup: number
|
||||
slamRadius: number
|
||||
slamDamage: number
|
||||
slamStunSeconds: number
|
||||
fireballCooldown?: number
|
||||
fireballWindup?: number
|
||||
fireballSpeed?: number
|
||||
fireballDamage?: number
|
||||
fireballRadius?: number
|
||||
firePuddleRadius?: number
|
||||
firePuddleDamage?: number
|
||||
firePuddleSeconds?: number
|
||||
birdWaveThresholds?: number[]
|
||||
birdFlightCooldown?: number
|
||||
birdFlightWindup?: number
|
||||
birdFlightSpeed?: number
|
||||
birdHealth?: number
|
||||
birdRadius?: number
|
||||
birdContactDamage?: number
|
||||
birdStunSeconds?: number
|
||||
packHowlCooldown?: number
|
||||
packHowlWindup?: number
|
||||
packLaneDamage?: number
|
||||
packLaneStunSeconds?: number
|
||||
packLaneWidth?: number
|
||||
packLaneCount?: number
|
||||
thunderRingCooldown?: number
|
||||
thunderRingWindup?: number
|
||||
thunderRingInnerRadius?: number
|
||||
thunderRingOuterRadius?: number
|
||||
thunderRingDamage?: number
|
||||
thunderRingStunSeconds?: number
|
||||
lightningStrikeCooldown?: number
|
||||
lightningStrikeWindup?: number
|
||||
lightningStrikeRadius?: number
|
||||
lightningStrikeDamage?: number
|
||||
lightningStrikeStunSeconds?: number
|
||||
lightningStrikeCount?: number
|
||||
poisonTailCooldown?: number
|
||||
tailSweepWindup?: number
|
||||
tailSweepRecover?: number
|
||||
tailSweepInnerRadius?: number
|
||||
tailSweepOuterRadius?: number
|
||||
tailSweepAngleRadians?: number
|
||||
tailSweepDamage?: number
|
||||
tailSweepStunSeconds?: number
|
||||
poisonSpitCooldown?: number
|
||||
poisonSpitWindup?: number
|
||||
poisonPuddleRadius?: number
|
||||
poisonPuddleDamage?: number
|
||||
poisonPuddleSeconds?: number
|
||||
mudArmor?: number
|
||||
mudSprayCooldown?: number
|
||||
mudSprayWindup?: number
|
||||
mudSprayRange?: number
|
||||
mudSprayAngleRadians?: number
|
||||
mudSprayDamage?: number
|
||||
mudSprayStunSeconds?: number
|
||||
mudPuddleRadius?: number
|
||||
mudPuddleSeconds?: number
|
||||
staticEnergyMax?: number
|
||||
staticEnergyPerSecond?: number
|
||||
staticEnergyPerMelee?: number
|
||||
staticPounceWindup?: number
|
||||
staticPounceSpeed?: number
|
||||
staticPounceDamage?: number
|
||||
staticPounceStunSeconds?: number
|
||||
staticPounceLength?: number
|
||||
staticPounceWidth?: number
|
||||
chainShockCooldown?: number
|
||||
chainShockWindup?: number
|
||||
chainShockRadius?: number
|
||||
chainShockDamage?: number
|
||||
chainShockStunSeconds?: number
|
||||
iceWallCooldown?: number
|
||||
iceWallWindup?: number
|
||||
iceWallActiveSeconds?: number
|
||||
iceWallCount?: number
|
||||
iceWallLength?: number
|
||||
iceWallWidth?: number
|
||||
iceWallDamage?: number
|
||||
iceShardDamage?: number
|
||||
iceShardStunSeconds?: number
|
||||
slashCooldown?: number
|
||||
slashWindup?: number
|
||||
slashDamage?: number
|
||||
slashStunSeconds?: number
|
||||
slashWidth?: number
|
||||
crossSlashAngleRadians?: number
|
||||
sidestepDistance?: number
|
||||
ricochetCooldown?: number
|
||||
ricochetWindup?: number
|
||||
ricochetSpeed?: number
|
||||
ricochetDamage?: number
|
||||
ricochetStunSeconds?: number
|
||||
ricochetSeconds?: number
|
||||
lavaTrailRadius?: number
|
||||
lavaTrailDamage?: number
|
||||
lavaTrailSeconds?: number
|
||||
armorSlamWindup?: number
|
||||
armorSlamRadius?: number
|
||||
armorSlamDamage?: number
|
||||
armorSlamStunSeconds?: number
|
||||
}
|
||||
|
||||
const DEFAULT_BULLDROME_BOSS_METADATA: Iwt2BossMetadata = {
|
||||
id: 'bulldrome',
|
||||
name: 'Bulldrome',
|
||||
icon: 'B',
|
||||
spriteUrl: '/iwt2/bosses/bulldrome-side-cel.png',
|
||||
spriteView: 'side',
|
||||
spriteWidthScale: 6.2,
|
||||
spriteHeightScale: 4.5,
|
||||
spriteYOffsetScale: -0.14,
|
||||
color: '#8f5a3c',
|
||||
accentColor: '#e6b17f',
|
||||
maxHealth: 950,
|
||||
radius: 31,
|
||||
moveSpeed: 128,
|
||||
meleeRange: 58,
|
||||
meleeDamage: 9,
|
||||
meleeCooldown: 1.05,
|
||||
chargeCooldown: 4.75,
|
||||
chargeWindup: 0.55,
|
||||
chargeSpeed: 510,
|
||||
chargeDamage: 32,
|
||||
chargeStunSeconds: 0.75,
|
||||
chargeLength: 560,
|
||||
chargeOvershoot: 120,
|
||||
chargeWidth: 62,
|
||||
slamWindup: 0.45,
|
||||
slamRadius: 104,
|
||||
slamDamage: 24,
|
||||
slamStunSeconds: 0.75,
|
||||
}
|
||||
|
||||
const DEFAULT_YIAN_KUT_KU_BOSS_METADATA: Iwt2BossMetadata = {
|
||||
id: 'yian-kut-ku',
|
||||
name: 'Yian Kut Ku',
|
||||
icon: 'Y',
|
||||
spriteUrl: '/iwt2/bosses/yian-kut-ku-side-cel.png',
|
||||
spriteView: 'side',
|
||||
spriteWidthScale: 5.9,
|
||||
spriteHeightScale: 4.7,
|
||||
spriteYOffsetScale: -0.1,
|
||||
color: '#d66a35',
|
||||
accentColor: '#ffd166',
|
||||
maxHealth: 400,
|
||||
radius: 29,
|
||||
moveSpeed: 118,
|
||||
meleeRange: 56,
|
||||
meleeDamage: 8,
|
||||
meleeCooldown: 1,
|
||||
chargeCooldown: 0,
|
||||
chargeWindup: 0,
|
||||
chargeSpeed: 0,
|
||||
chargeDamage: 0,
|
||||
chargeStunSeconds: 0,
|
||||
chargeLength: 0,
|
||||
chargeOvershoot: 0,
|
||||
chargeWidth: 0,
|
||||
slamWindup: 0,
|
||||
slamRadius: 0,
|
||||
slamDamage: 0,
|
||||
slamStunSeconds: 0,
|
||||
fireballCooldown: 3.6,
|
||||
fireballWindup: 0.55,
|
||||
fireballSpeed: 285,
|
||||
fireballDamage: 12,
|
||||
fireballRadius: 9,
|
||||
firePuddleRadius: 42,
|
||||
firePuddleDamage: 7,
|
||||
firePuddleSeconds: 8,
|
||||
birdWaveThresholds: [0.9, 0.4],
|
||||
birdFlightCooldown: 10,
|
||||
birdFlightWindup: 0.85,
|
||||
birdFlightSpeed: 360,
|
||||
birdHealth: 58,
|
||||
birdRadius: 16,
|
||||
birdContactDamage: 10,
|
||||
birdStunSeconds: 0.75,
|
||||
}
|
||||
|
||||
const DEFAULT_GREAT_JAGGI_BOSS_METADATA: Iwt2BossMetadata = {
|
||||
id: 'great-jaggi',
|
||||
name: 'Great Jaggi',
|
||||
icon: 'J',
|
||||
spriteUrl: '/iwt2/bosses/great-jaggi-side-cel.png',
|
||||
spriteView: 'side',
|
||||
spriteWidthScale: 5.9,
|
||||
spriteHeightScale: 4.1,
|
||||
spriteYOffsetScale: -0.09,
|
||||
color: '#3f8f73',
|
||||
accentColor: '#b8f0aa',
|
||||
maxHealth: 620,
|
||||
radius: 27,
|
||||
moveSpeed: 146,
|
||||
meleeRange: 52,
|
||||
meleeDamage: 7,
|
||||
meleeCooldown: 0.82,
|
||||
chargeCooldown: 0,
|
||||
chargeWindup: 0,
|
||||
chargeSpeed: 0,
|
||||
chargeDamage: 0,
|
||||
chargeStunSeconds: 0,
|
||||
chargeLength: 0,
|
||||
chargeOvershoot: 0,
|
||||
chargeWidth: 0,
|
||||
slamWindup: 0,
|
||||
slamRadius: 0,
|
||||
slamDamage: 0,
|
||||
slamStunSeconds: 0,
|
||||
packHowlCooldown: 5.8,
|
||||
packHowlWindup: 0.95,
|
||||
packLaneDamage: 15,
|
||||
packLaneStunSeconds: 0.45,
|
||||
packLaneWidth: 24,
|
||||
packLaneCount: 3,
|
||||
}
|
||||
|
||||
const DEFAULT_KHEZU_BOSS_METADATA: Iwt2BossMetadata = {
|
||||
id: 'khezu',
|
||||
name: 'Khezu',
|
||||
icon: 'K',
|
||||
spriteUrl: '/iwt2/bosses/khezu-side-cel.png',
|
||||
spriteView: 'side',
|
||||
spriteWidthScale: 5.9,
|
||||
spriteHeightScale: 4.4,
|
||||
spriteYOffsetScale: -0.12,
|
||||
color: '#d8d7c9',
|
||||
accentColor: '#77d9ff',
|
||||
maxHealth: 760,
|
||||
radius: 30,
|
||||
moveSpeed: 92,
|
||||
meleeRange: 58,
|
||||
meleeDamage: 10,
|
||||
meleeCooldown: 1.15,
|
||||
chargeCooldown: 0,
|
||||
chargeWindup: 0,
|
||||
chargeSpeed: 0,
|
||||
chargeDamage: 0,
|
||||
chargeStunSeconds: 0,
|
||||
chargeLength: 0,
|
||||
chargeOvershoot: 0,
|
||||
chargeWidth: 0,
|
||||
slamWindup: 0,
|
||||
slamRadius: 0,
|
||||
slamDamage: 0,
|
||||
slamStunSeconds: 0,
|
||||
thunderRingCooldown: 7.2,
|
||||
thunderRingWindup: 0.9,
|
||||
thunderRingInnerRadius: 70,
|
||||
thunderRingOuterRadius: 172,
|
||||
thunderRingDamage: 22,
|
||||
thunderRingStunSeconds: 0.7,
|
||||
lightningStrikeCooldown: 4.2,
|
||||
lightningStrikeWindup: 0.78,
|
||||
lightningStrikeRadius: 46,
|
||||
lightningStrikeDamage: 17,
|
||||
lightningStrikeStunSeconds: 0.55,
|
||||
lightningStrikeCount: 2,
|
||||
}
|
||||
|
||||
const DEFAULT_RATHIAN_BOSS_METADATA: Iwt2BossMetadata = {
|
||||
id: 'rathian',
|
||||
name: 'Rathian',
|
||||
icon: 'R',
|
||||
spriteUrl: '/iwt2/bosses/rathian-side-cel.png',
|
||||
spriteView: 'side',
|
||||
spriteWidthScale: 6.9,
|
||||
spriteHeightScale: 4.35,
|
||||
spriteYOffsetScale: -0.12,
|
||||
color: '#4d9a58',
|
||||
accentColor: '#f0c24d',
|
||||
maxHealth: 1120,
|
||||
radius: 34,
|
||||
moveSpeed: 118,
|
||||
meleeRange: 62,
|
||||
meleeDamage: 11,
|
||||
meleeCooldown: 1.08,
|
||||
chargeCooldown: 0,
|
||||
chargeWindup: 0,
|
||||
chargeSpeed: 0,
|
||||
chargeDamage: 0,
|
||||
chargeStunSeconds: 0,
|
||||
chargeLength: 0,
|
||||
chargeOvershoot: 0,
|
||||
chargeWidth: 0,
|
||||
slamWindup: 0,
|
||||
slamRadius: 0,
|
||||
slamDamage: 0,
|
||||
slamStunSeconds: 0,
|
||||
poisonTailCooldown: 5.4,
|
||||
tailSweepWindup: 0.72,
|
||||
tailSweepRecover: 0.48,
|
||||
tailSweepInnerRadius: 24,
|
||||
tailSweepOuterRadius: 118,
|
||||
tailSweepAngleRadians: Math.PI * 1.25,
|
||||
tailSweepDamage: 23,
|
||||
tailSweepStunSeconds: 0.55,
|
||||
poisonSpitCooldown: 6.2,
|
||||
poisonSpitWindup: 0.7,
|
||||
poisonPuddleRadius: 46,
|
||||
poisonPuddleDamage: 6,
|
||||
poisonPuddleSeconds: 8,
|
||||
}
|
||||
|
||||
const DEFAULT_BARROTH_BOSS_METADATA: Iwt2BossMetadata = {
|
||||
id: 'barroth',
|
||||
name: 'Barroth',
|
||||
icon: 'A',
|
||||
spriteUrl: '/iwt2/bosses/barroth-side-cel.png',
|
||||
spriteView: 'side',
|
||||
spriteWidthScale: 6.3,
|
||||
spriteHeightScale: 3.35,
|
||||
spriteYOffsetScale: -0.07,
|
||||
color: '#8d714d',
|
||||
accentColor: '#d6bd80',
|
||||
maxHealth: 1280,
|
||||
radius: 35,
|
||||
moveSpeed: 104,
|
||||
meleeRange: 60,
|
||||
meleeDamage: 12,
|
||||
meleeCooldown: 1.18,
|
||||
chargeCooldown: 0,
|
||||
chargeWindup: 0,
|
||||
chargeSpeed: 0,
|
||||
chargeDamage: 0,
|
||||
chargeStunSeconds: 0,
|
||||
chargeLength: 0,
|
||||
chargeOvershoot: 0,
|
||||
chargeWidth: 0,
|
||||
slamWindup: 0,
|
||||
slamRadius: 0,
|
||||
slamDamage: 0,
|
||||
slamStunSeconds: 0,
|
||||
mudArmor: 280,
|
||||
mudSprayCooldown: 5.8,
|
||||
mudSprayWindup: 0.82,
|
||||
mudSprayRange: 172,
|
||||
mudSprayAngleRadians: Math.PI * 0.58,
|
||||
mudSprayDamage: 13,
|
||||
mudSprayStunSeconds: 0.25,
|
||||
mudPuddleRadius: 40,
|
||||
mudPuddleSeconds: 7.5,
|
||||
}
|
||||
|
||||
const DEFAULT_TOBI_KADACHI_BOSS_METADATA: Iwt2BossMetadata = {
|
||||
id: 'tobi-kadachi',
|
||||
name: 'Tobi Kadachi',
|
||||
icon: 'T',
|
||||
spriteUrl: '/iwt2/bosses/tobi-kadachi-side-cel.png',
|
||||
spriteView: 'side',
|
||||
spriteWidthScale: 6.7,
|
||||
spriteHeightScale: 3.85,
|
||||
spriteYOffsetScale: -0.08,
|
||||
color: '#6a79bd',
|
||||
accentColor: '#a8f3ff',
|
||||
maxHealth: 920,
|
||||
radius: 28,
|
||||
moveSpeed: 160,
|
||||
meleeRange: 53,
|
||||
meleeDamage: 8,
|
||||
meleeCooldown: 0.78,
|
||||
chargeCooldown: 2.2,
|
||||
chargeWindup: 0,
|
||||
chargeSpeed: 0,
|
||||
chargeDamage: 0,
|
||||
chargeStunSeconds: 0,
|
||||
chargeLength: 0,
|
||||
chargeOvershoot: 0,
|
||||
chargeWidth: 0,
|
||||
slamWindup: 0,
|
||||
slamRadius: 0,
|
||||
slamDamage: 0,
|
||||
slamStunSeconds: 0,
|
||||
staticEnergyMax: 100,
|
||||
staticEnergyPerSecond: 16,
|
||||
staticEnergyPerMelee: 15,
|
||||
staticPounceWindup: 0.58,
|
||||
staticPounceSpeed: 560,
|
||||
staticPounceDamage: 24,
|
||||
staticPounceStunSeconds: 0.6,
|
||||
staticPounceLength: 520,
|
||||
staticPounceWidth: 46,
|
||||
chainShockCooldown: 5.2,
|
||||
chainShockWindup: 0.85,
|
||||
chainShockRadius: 86,
|
||||
chainShockDamage: 15,
|
||||
chainShockStunSeconds: 0.45,
|
||||
}
|
||||
|
||||
const DEFAULT_RIMEBASTION_BOSS_METADATA: Iwt2BossMetadata = {
|
||||
id: 'rimebastion',
|
||||
name: 'Rimebastion',
|
||||
icon: 'I',
|
||||
spriteUrl: '/iwt2/bosses/rimebastion-side-cel.png',
|
||||
spriteView: 'side',
|
||||
spriteWidthScale: 7.2,
|
||||
spriteHeightScale: 4.5,
|
||||
spriteYOffsetScale: -0.08,
|
||||
color: '#5f9fd6',
|
||||
accentColor: '#b8f3ff',
|
||||
maxHealth: 1380,
|
||||
radius: 37,
|
||||
moveSpeed: 86,
|
||||
meleeRange: 62,
|
||||
meleeDamage: 12,
|
||||
meleeCooldown: 1.2,
|
||||
chargeCooldown: 5.6,
|
||||
chargeWindup: 0,
|
||||
chargeSpeed: 0,
|
||||
chargeDamage: 0,
|
||||
chargeStunSeconds: 0,
|
||||
chargeLength: 0,
|
||||
chargeOvershoot: 0,
|
||||
chargeWidth: 0,
|
||||
slamWindup: 0,
|
||||
slamRadius: 0,
|
||||
slamDamage: 0,
|
||||
slamStunSeconds: 0,
|
||||
iceWallCooldown: 6.2,
|
||||
iceWallWindup: 0.9,
|
||||
iceWallActiveSeconds: 0.7,
|
||||
iceWallCount: 3,
|
||||
iceWallLength: 180,
|
||||
iceWallWidth: 22,
|
||||
iceWallDamage: 10,
|
||||
iceShardDamage: 22,
|
||||
iceShardStunSeconds: 0.55,
|
||||
}
|
||||
|
||||
const DEFAULT_EMBER_MANTIS_DUELIST_BOSS_METADATA: Iwt2BossMetadata = {
|
||||
id: 'ember-mantis-duelist',
|
||||
name: 'Ember Mantis Duelist',
|
||||
icon: 'M',
|
||||
spriteUrl: '/iwt2/bosses/ember-mantis-duelist-side-cel.png',
|
||||
spriteView: 'side',
|
||||
spriteWidthScale: 5.6,
|
||||
spriteHeightScale: 4.6,
|
||||
spriteYOffsetScale: -0.1,
|
||||
color: '#b94831',
|
||||
accentColor: '#ffb24a',
|
||||
maxHealth: 1040,
|
||||
radius: 29,
|
||||
moveSpeed: 168,
|
||||
meleeRange: 54,
|
||||
meleeDamage: 9,
|
||||
meleeCooldown: 0.78,
|
||||
chargeCooldown: 3.8,
|
||||
chargeWindup: 0,
|
||||
chargeSpeed: 0,
|
||||
chargeDamage: 0,
|
||||
chargeStunSeconds: 0,
|
||||
chargeLength: 0,
|
||||
chargeOvershoot: 0,
|
||||
chargeWidth: 0,
|
||||
slamWindup: 0,
|
||||
slamRadius: 0,
|
||||
slamDamage: 0,
|
||||
slamStunSeconds: 0,
|
||||
slashCooldown: 4.2,
|
||||
slashWindup: 0.48,
|
||||
slashDamage: 21,
|
||||
slashStunSeconds: 0.35,
|
||||
slashWidth: 24,
|
||||
crossSlashAngleRadians: Math.PI * 0.32,
|
||||
sidestepDistance: 94,
|
||||
}
|
||||
|
||||
const DEFAULT_CINDERBACK_RICOCHET_BOSS_METADATA: Iwt2BossMetadata = {
|
||||
id: 'cinderback-ricochet',
|
||||
name: 'Cinderback Ricochet',
|
||||
icon: 'C',
|
||||
spriteUrl: '/iwt2/bosses/cinderback-ricochet-side-cel.png',
|
||||
spriteView: 'side',
|
||||
spriteWidthScale: 6.6,
|
||||
spriteHeightScale: 3.8,
|
||||
spriteYOffsetScale: -0.06,
|
||||
color: '#9a4f2f',
|
||||
accentColor: '#ff8a3d',
|
||||
maxHealth: 1250,
|
||||
radius: 34,
|
||||
moveSpeed: 106,
|
||||
meleeRange: 60,
|
||||
meleeDamage: 11,
|
||||
meleeCooldown: 1.05,
|
||||
chargeCooldown: 5.4,
|
||||
chargeWindup: 0,
|
||||
chargeSpeed: 0,
|
||||
chargeDamage: 0,
|
||||
chargeStunSeconds: 0,
|
||||
chargeLength: 0,
|
||||
chargeOvershoot: 0,
|
||||
chargeWidth: 0,
|
||||
slamWindup: 0,
|
||||
slamRadius: 0,
|
||||
slamDamage: 0,
|
||||
slamStunSeconds: 0,
|
||||
ricochetCooldown: 6.6,
|
||||
ricochetWindup: 0.65,
|
||||
ricochetSpeed: 440,
|
||||
ricochetDamage: 24,
|
||||
ricochetStunSeconds: 0.45,
|
||||
ricochetSeconds: 1.45,
|
||||
lavaTrailRadius: 34,
|
||||
lavaTrailDamage: 6,
|
||||
lavaTrailSeconds: 5.5,
|
||||
armorSlamWindup: 0.42,
|
||||
armorSlamRadius: 86,
|
||||
armorSlamDamage: 18,
|
||||
armorSlamStunSeconds: 0.5,
|
||||
}
|
||||
|
||||
const DEFAULT_OBSIDIAN_RAM_GOLEM_BOSS_METADATA: Iwt2BossMetadata = {
|
||||
id: 'obsidian-ram-golem',
|
||||
name: 'Obsidian Ram Golem',
|
||||
icon: 'O',
|
||||
spriteUrl: '/iwt2/bosses/obsidian-ram-golem-side-cel.png',
|
||||
spriteView: 'side',
|
||||
spriteWidthScale: 6.5,
|
||||
spriteHeightScale: 4.25,
|
||||
spriteYOffsetScale: -0.08,
|
||||
color: '#2f3034',
|
||||
accentColor: '#ff7b32',
|
||||
maxHealth: 1420,
|
||||
radius: 36,
|
||||
moveSpeed: 98,
|
||||
meleeRange: 62,
|
||||
meleeDamage: 9,
|
||||
meleeCooldown: 1.12,
|
||||
chargeCooldown: 5.7,
|
||||
chargeWindup: 0,
|
||||
chargeSpeed: 0,
|
||||
chargeDamage: 0,
|
||||
chargeStunSeconds: 0,
|
||||
chargeLength: 0,
|
||||
chargeOvershoot: 0,
|
||||
chargeWidth: 0,
|
||||
slamWindup: 0,
|
||||
slamRadius: 0,
|
||||
slamDamage: 0,
|
||||
slamStunSeconds: 0,
|
||||
mudArmor: 240,
|
||||
}
|
||||
|
||||
const DEFAULT_STORMCOIL_WYRM_BOSS_METADATA: Iwt2BossMetadata = {
|
||||
id: 'stormcoil-wyrm',
|
||||
name: 'Stormcoil Wyrm',
|
||||
icon: 'S',
|
||||
spriteUrl: '/iwt2/bosses/stormcoil-wyrm-side-cel.png',
|
||||
spriteView: 'side',
|
||||
spriteWidthScale: 7.1,
|
||||
spriteHeightScale: 4.15,
|
||||
spriteYOffsetScale: -0.1,
|
||||
color: '#273b75',
|
||||
accentColor: '#78ecff',
|
||||
maxHealth: 1120,
|
||||
radius: 30,
|
||||
moveSpeed: 142,
|
||||
meleeRange: 58,
|
||||
meleeDamage: 8,
|
||||
meleeCooldown: 0.95,
|
||||
chargeCooldown: 5.1,
|
||||
chargeWindup: 0,
|
||||
chargeSpeed: 0,
|
||||
chargeDamage: 0,
|
||||
chargeStunSeconds: 0,
|
||||
chargeLength: 0,
|
||||
chargeOvershoot: 0,
|
||||
chargeWidth: 0,
|
||||
slamWindup: 0,
|
||||
slamRadius: 0,
|
||||
slamDamage: 0,
|
||||
slamStunSeconds: 0,
|
||||
chainShockCooldown: 5,
|
||||
chainShockWindup: 0.78,
|
||||
chainShockRadius: 94,
|
||||
chainShockDamage: 13,
|
||||
chainShockStunSeconds: 0.38,
|
||||
}
|
||||
|
||||
const DEFAULT_VENOM_ORCHID_HYDRA_BOSS_METADATA: Iwt2BossMetadata = {
|
||||
id: 'venom-orchid-hydra',
|
||||
name: 'Venom Orchid Hydra',
|
||||
icon: 'V',
|
||||
spriteUrl: '/iwt2/bosses/venom-orchid-hydra-side-cel.png',
|
||||
spriteView: 'side',
|
||||
spriteWidthScale: 7.2,
|
||||
spriteHeightScale: 4.6,
|
||||
spriteYOffsetScale: -0.1,
|
||||
color: '#5e316c',
|
||||
accentColor: '#d8f05b',
|
||||
maxHealth: 1320,
|
||||
radius: 35,
|
||||
moveSpeed: 84,
|
||||
meleeRange: 64,
|
||||
meleeDamage: 8,
|
||||
meleeCooldown: 1.15,
|
||||
chargeCooldown: 5.4,
|
||||
chargeWindup: 0,
|
||||
chargeSpeed: 0,
|
||||
chargeDamage: 0,
|
||||
chargeStunSeconds: 0,
|
||||
chargeLength: 0,
|
||||
chargeOvershoot: 0,
|
||||
chargeWidth: 0,
|
||||
slamWindup: 0,
|
||||
slamRadius: 0,
|
||||
slamDamage: 0,
|
||||
slamStunSeconds: 0,
|
||||
poisonSpitCooldown: 5.6,
|
||||
poisonSpitWindup: 0.75,
|
||||
poisonPuddleRadius: 42,
|
||||
poisonPuddleDamage: 5,
|
||||
poisonPuddleSeconds: 7,
|
||||
}
|
||||
|
||||
const DEFAULT_SANDGLASS_SCORPION_BOSS_METADATA: Iwt2BossMetadata = {
|
||||
id: 'sandglass-scorpion',
|
||||
name: 'Sandglass Scorpion',
|
||||
icon: 'G',
|
||||
spriteUrl: '/iwt2/bosses/sandglass-scorpion-side-cel.png',
|
||||
spriteView: 'side',
|
||||
spriteWidthScale: 6.4,
|
||||
spriteHeightScale: 4.25,
|
||||
spriteYOffsetScale: -0.07,
|
||||
color: '#9d7430',
|
||||
accentColor: '#ffd15a',
|
||||
maxHealth: 1180,
|
||||
radius: 33,
|
||||
moveSpeed: 126,
|
||||
meleeRange: 58,
|
||||
meleeDamage: 8,
|
||||
meleeCooldown: 0.98,
|
||||
chargeCooldown: 5.2,
|
||||
chargeWindup: 0,
|
||||
chargeSpeed: 0,
|
||||
chargeDamage: 0,
|
||||
chargeStunSeconds: 0,
|
||||
chargeLength: 0,
|
||||
chargeOvershoot: 0,
|
||||
chargeWidth: 0,
|
||||
slamWindup: 0,
|
||||
slamRadius: 0,
|
||||
slamDamage: 0,
|
||||
slamStunSeconds: 0,
|
||||
mudPuddleRadius: 44,
|
||||
mudPuddleSeconds: 6,
|
||||
}
|
||||
|
||||
const DEFAULT_CRYSTAL_BAT_MATRIARCH_BOSS_METADATA: Iwt2BossMetadata = {
|
||||
id: 'crystal-bat-matriarch',
|
||||
name: 'Crystal Bat Matriarch',
|
||||
icon: 'Q',
|
||||
spriteUrl: '/iwt2/bosses/crystal-bat-matriarch-side-cel.png',
|
||||
spriteView: 'side',
|
||||
spriteWidthScale: 6.8,
|
||||
spriteHeightScale: 4.75,
|
||||
spriteYOffsetScale: -0.12,
|
||||
color: '#4e2d76',
|
||||
accentColor: '#8eeaff',
|
||||
maxHealth: 1050,
|
||||
radius: 31,
|
||||
moveSpeed: 150,
|
||||
meleeRange: 56,
|
||||
meleeDamage: 7,
|
||||
meleeCooldown: 0.9,
|
||||
chargeCooldown: 5.1,
|
||||
chargeWindup: 0,
|
||||
chargeSpeed: 0,
|
||||
chargeDamage: 0,
|
||||
chargeStunSeconds: 0,
|
||||
chargeLength: 0,
|
||||
chargeOvershoot: 0,
|
||||
chargeWidth: 0,
|
||||
slamWindup: 0,
|
||||
slamRadius: 0,
|
||||
slamDamage: 0,
|
||||
slamStunSeconds: 0,
|
||||
}
|
||||
|
||||
const DEFAULT_HOLLOWCROWN_REVENANT_BOSS_METADATA: Iwt2BossMetadata = {
|
||||
id: 'hollowcrown-revenant',
|
||||
name: 'Hollowcrown Revenant',
|
||||
icon: 'H',
|
||||
spriteUrl: '/iwt2/bosses/hollowcrown-revenant-side-cel.png',
|
||||
spriteView: 'side',
|
||||
spriteWidthScale: 6.6,
|
||||
spriteHeightScale: 4.35,
|
||||
spriteYOffsetScale: -0.1,
|
||||
color: '#3c3f5e',
|
||||
accentColor: '#9be8ff',
|
||||
maxHealth: 1080,
|
||||
radius: 30,
|
||||
moveSpeed: 158,
|
||||
meleeRange: 56,
|
||||
meleeDamage: 8,
|
||||
meleeCooldown: 0.9,
|
||||
chargeCooldown: 4.8,
|
||||
chargeWindup: 0,
|
||||
chargeSpeed: 0,
|
||||
chargeDamage: 0,
|
||||
chargeStunSeconds: 0,
|
||||
chargeLength: 0,
|
||||
chargeOvershoot: 0,
|
||||
chargeWidth: 0,
|
||||
slamWindup: 0,
|
||||
slamRadius: 0,
|
||||
slamDamage: 0,
|
||||
slamStunSeconds: 0,
|
||||
}
|
||||
|
||||
function applyBossOverrides(metadata: Iwt2BossMetadata): Iwt2BossMetadata {
|
||||
const override = IWT2_BALANCE_OVERRIDES.bosses?.[metadata.id]
|
||||
if (!override) return metadata
|
||||
return {
|
||||
...metadata,
|
||||
...override,
|
||||
}
|
||||
}
|
||||
|
||||
export const BULLDROME_BOSS_METADATA: Iwt2BossMetadata = applyBossOverrides(DEFAULT_BULLDROME_BOSS_METADATA)
|
||||
export const YIAN_KUT_KU_BOSS_METADATA: Iwt2BossMetadata = applyBossOverrides(DEFAULT_YIAN_KUT_KU_BOSS_METADATA)
|
||||
export const GREAT_JAGGI_BOSS_METADATA: Iwt2BossMetadata = applyBossOverrides(DEFAULT_GREAT_JAGGI_BOSS_METADATA)
|
||||
export const KHEZU_BOSS_METADATA: Iwt2BossMetadata = applyBossOverrides(DEFAULT_KHEZU_BOSS_METADATA)
|
||||
export const RATHIAN_BOSS_METADATA: Iwt2BossMetadata = applyBossOverrides(DEFAULT_RATHIAN_BOSS_METADATA)
|
||||
export const BARROTH_BOSS_METADATA: Iwt2BossMetadata = applyBossOverrides(DEFAULT_BARROTH_BOSS_METADATA)
|
||||
export const TOBI_KADACHI_BOSS_METADATA: Iwt2BossMetadata = applyBossOverrides(DEFAULT_TOBI_KADACHI_BOSS_METADATA)
|
||||
export const RIMEBASTION_BOSS_METADATA: Iwt2BossMetadata = applyBossOverrides(DEFAULT_RIMEBASTION_BOSS_METADATA)
|
||||
export const EMBER_MANTIS_DUELIST_BOSS_METADATA: Iwt2BossMetadata = applyBossOverrides(DEFAULT_EMBER_MANTIS_DUELIST_BOSS_METADATA)
|
||||
export const CINDERBACK_RICOCHET_BOSS_METADATA: Iwt2BossMetadata = applyBossOverrides(DEFAULT_CINDERBACK_RICOCHET_BOSS_METADATA)
|
||||
export const OBSIDIAN_RAM_GOLEM_BOSS_METADATA: Iwt2BossMetadata = applyBossOverrides(DEFAULT_OBSIDIAN_RAM_GOLEM_BOSS_METADATA)
|
||||
export const STORMCOIL_WYRM_BOSS_METADATA: Iwt2BossMetadata = applyBossOverrides(DEFAULT_STORMCOIL_WYRM_BOSS_METADATA)
|
||||
export const VENOM_ORCHID_HYDRA_BOSS_METADATA: Iwt2BossMetadata = applyBossOverrides(DEFAULT_VENOM_ORCHID_HYDRA_BOSS_METADATA)
|
||||
export const SANDGLASS_SCORPION_BOSS_METADATA: Iwt2BossMetadata = applyBossOverrides(DEFAULT_SANDGLASS_SCORPION_BOSS_METADATA)
|
||||
export const CRYSTAL_BAT_MATRIARCH_BOSS_METADATA: Iwt2BossMetadata = applyBossOverrides(DEFAULT_CRYSTAL_BAT_MATRIARCH_BOSS_METADATA)
|
||||
export const HOLLOWCROWN_REVENANT_BOSS_METADATA: Iwt2BossMetadata = applyBossOverrides(DEFAULT_HOLLOWCROWN_REVENANT_BOSS_METADATA)
|
||||
|
||||
export const IWT2_BOSS_METADATA: Record<Iwt2BossId, Iwt2BossMetadata> = {
|
||||
bulldrome: BULLDROME_BOSS_METADATA,
|
||||
'yian-kut-ku': YIAN_KUT_KU_BOSS_METADATA,
|
||||
'great-jaggi': GREAT_JAGGI_BOSS_METADATA,
|
||||
khezu: KHEZU_BOSS_METADATA,
|
||||
rathian: RATHIAN_BOSS_METADATA,
|
||||
barroth: BARROTH_BOSS_METADATA,
|
||||
'tobi-kadachi': TOBI_KADACHI_BOSS_METADATA,
|
||||
rimebastion: RIMEBASTION_BOSS_METADATA,
|
||||
'ember-mantis-duelist': EMBER_MANTIS_DUELIST_BOSS_METADATA,
|
||||
'cinderback-ricochet': CINDERBACK_RICOCHET_BOSS_METADATA,
|
||||
'obsidian-ram-golem': OBSIDIAN_RAM_GOLEM_BOSS_METADATA,
|
||||
'stormcoil-wyrm': STORMCOIL_WYRM_BOSS_METADATA,
|
||||
'venom-orchid-hydra': VENOM_ORCHID_HYDRA_BOSS_METADATA,
|
||||
'sandglass-scorpion': SANDGLASS_SCORPION_BOSS_METADATA,
|
||||
'crystal-bat-matriarch': CRYSTAL_BAT_MATRIARCH_BOSS_METADATA,
|
||||
'hollowcrown-revenant': HOLLOWCROWN_REVENANT_BOSS_METADATA,
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
export type Iwt2PlayerClassId = 'healer' | 'paladin' | 'ranger' | 'mage' | 'rogue' | 'warrior'
|
||||
|
||||
export type Iwt2PlayerClassRole = 'healer' | 'tank' | 'damage'
|
||||
|
||||
export type Iwt2ClassMetadata = {
|
||||
id: Iwt2PlayerClassId
|
||||
name: string
|
||||
role: Iwt2PlayerClassRole
|
||||
icon: string
|
||||
color: string
|
||||
accentColor: string
|
||||
maxHealth: number
|
||||
moveSpeed: number
|
||||
radius: number
|
||||
attackRange: number
|
||||
attackDamage: number
|
||||
attackCooldown: number
|
||||
castTime: number
|
||||
projectileSpeed: number
|
||||
}
|
||||
|
||||
export const IWT2_CLASS_METADATA: Record<Iwt2PlayerClassId, Iwt2ClassMetadata> = {
|
||||
healer: {
|
||||
id: 'healer',
|
||||
name: 'Player Healer',
|
||||
role: 'healer',
|
||||
icon: '+',
|
||||
color: '#2fbf71',
|
||||
accentColor: '#b7f7cf',
|
||||
maxHealth: 125,
|
||||
moveSpeed: 210,
|
||||
radius: 15,
|
||||
attackRange: 0,
|
||||
attackDamage: 0,
|
||||
attackCooldown: 1,
|
||||
castTime: 0,
|
||||
projectileSpeed: 0,
|
||||
},
|
||||
paladin: {
|
||||
id: 'paladin',
|
||||
name: 'Paladin Tank',
|
||||
role: 'tank',
|
||||
icon: '🛡',
|
||||
color: '#f2c94c',
|
||||
accentColor: '#fff0a8',
|
||||
maxHealth: 190,
|
||||
moveSpeed: 165,
|
||||
radius: 17,
|
||||
attackRange: 44,
|
||||
attackDamage: 7,
|
||||
attackCooldown: 0.85,
|
||||
castTime: 0,
|
||||
projectileSpeed: 0,
|
||||
},
|
||||
ranger: {
|
||||
id: 'ranger',
|
||||
name: 'Ranger',
|
||||
role: 'damage',
|
||||
icon: '🏹',
|
||||
color: '#4aa3df',
|
||||
accentColor: '#b9e3ff',
|
||||
maxHealth: 115,
|
||||
moveSpeed: 185,
|
||||
radius: 14,
|
||||
attackRange: 245,
|
||||
attackDamage: 8,
|
||||
attackCooldown: 0.31,
|
||||
castTime: 0.16,
|
||||
projectileSpeed: 410,
|
||||
},
|
||||
mage: {
|
||||
id: 'mage',
|
||||
name: 'Mage',
|
||||
role: 'damage',
|
||||
icon: '⚚',
|
||||
color: '#c56cf0',
|
||||
accentColor: '#efc4ff',
|
||||
maxHealth: 100,
|
||||
moveSpeed: 175,
|
||||
radius: 14,
|
||||
attackRange: 220,
|
||||
attackDamage: 11,
|
||||
attackCooldown: 0.39,
|
||||
castTime: 0.21,
|
||||
projectileSpeed: 330,
|
||||
},
|
||||
rogue: {
|
||||
id: 'rogue',
|
||||
name: 'Rogue',
|
||||
role: 'damage',
|
||||
icon: '††',
|
||||
color: '#55efc4',
|
||||
accentColor: '#c8fff2',
|
||||
maxHealth: 110,
|
||||
moveSpeed: 230,
|
||||
radius: 14,
|
||||
attackRange: 38,
|
||||
attackDamage: 6,
|
||||
attackCooldown: 0.38,
|
||||
castTime: 0,
|
||||
projectileSpeed: 0,
|
||||
},
|
||||
warrior: {
|
||||
id: 'warrior',
|
||||
name: 'Warrior',
|
||||
role: 'damage',
|
||||
icon: '⚔',
|
||||
color: '#ff7675',
|
||||
accentColor: '#ffd0d0',
|
||||
maxHealth: 150,
|
||||
moveSpeed: 180,
|
||||
radius: 16,
|
||||
attackRange: 42,
|
||||
attackDamage: 9,
|
||||
attackCooldown: 0.52,
|
||||
castTime: 0,
|
||||
projectileSpeed: 0,
|
||||
},
|
||||
}
|
||||
|
||||
export const IWT2_PARTY_ORDER: Iwt2PlayerClassId[] = ['healer', 'paladin', 'ranger', 'mage', 'rogue', 'warrior']
|
||||
@@ -0,0 +1,19 @@
|
||||
import type { InputAction } from '../../../input'
|
||||
|
||||
export const IWT2_ABILITY_ACTIONS: InputAction[] = [
|
||||
'ability1',
|
||||
'ability2',
|
||||
'ability3',
|
||||
'ability4',
|
||||
'ability5',
|
||||
'ability6',
|
||||
]
|
||||
|
||||
export const IWT2_TARGET_ACTIONS: InputAction[] = [
|
||||
'targetParty1',
|
||||
'targetParty2',
|
||||
'targetParty3',
|
||||
'targetParty4',
|
||||
'targetParty5',
|
||||
'targetParty6',
|
||||
]
|
||||
@@ -0,0 +1,116 @@
|
||||
import type { Spell } from '../../../game'
|
||||
|
||||
export type Iwt2AbilityTarget = 'party-member' | 'self' | 'ground'
|
||||
export type Iwt2HealerId = 'dawnweaver' | 'lifebinder' | 'runesage'
|
||||
|
||||
export type Iwt2HealerMetadata = {
|
||||
id: Iwt2HealerId
|
||||
name: string
|
||||
icon: string
|
||||
description: string
|
||||
}
|
||||
|
||||
export type Iwt2HealerAbility = {
|
||||
id: string
|
||||
healerId: Iwt2HealerId
|
||||
slot: number
|
||||
name: string
|
||||
icon: string
|
||||
kind: Spell['kind']
|
||||
power: number
|
||||
effectType?: string
|
||||
manaCost: number
|
||||
cooldownSeconds: number
|
||||
target: Iwt2AbilityTarget
|
||||
extraTargets?: number
|
||||
}
|
||||
|
||||
export const IWT2_HEALER_METADATA: Record<Iwt2HealerId, Iwt2HealerMetadata> = {
|
||||
dawnweaver: {
|
||||
id: 'dawnweaver',
|
||||
name: 'Dawnweaver',
|
||||
icon: '+',
|
||||
description: 'Direct heals, radiant group recovery, shields, and cleanse.',
|
||||
},
|
||||
lifebinder: {
|
||||
id: 'lifebinder',
|
||||
name: 'Lifebinder',
|
||||
icon: '~',
|
||||
description: 'Verdant healing over time, barkskin shielding, and steady group recovery.',
|
||||
},
|
||||
runesage: {
|
||||
id: 'runesage',
|
||||
name: 'Runesage',
|
||||
icon: 'R',
|
||||
description: 'Rune-scripted mends, concordance healing, aegis shielding, and unraveling cleanse.',
|
||||
},
|
||||
}
|
||||
|
||||
export const IWT2_HEALER_ORDER: Iwt2HealerId[] = ['dawnweaver', 'lifebinder', 'runesage']
|
||||
|
||||
export const IWT2_HEALER_ABILITIES: Record<Iwt2HealerId, Iwt2HealerAbility[]> = {
|
||||
dawnweaver: [
|
||||
createAbility('dawnweaver', 1, 'mend', 'Mend', '+', 'direct', 30, 5, 0.5),
|
||||
createAbility('dawnweaver', 2, 'renew', 'Renew', '~', 'hot', 12, 7, 0.5, 'heal_over_time'),
|
||||
createAbility('dawnweaver', 3, 'radiance', 'Radiance', '*', 'group', 18, 12, 8),
|
||||
createAbility('dawnweaver', 4, 'sun-ward', 'Sun Ward', 'O', 'shield', 36, 8, 7, 'shield'),
|
||||
createAbility('dawnweaver', 5, 'purify', 'Purify', 'x', 'cleanse', 10, 5, 5, 'cleanse'),
|
||||
createAbility('dawnweaver', 6, 'dawn-burst', 'Dawn Burst', 'D', 'group', 28, 16, 12),
|
||||
],
|
||||
lifebinder: [
|
||||
createAbility('lifebinder', 1, 'verdant-touch', 'Verdant Touch', '+', 'direct', 24, 4, 0.55),
|
||||
createAbility('lifebinder', 2, 'seed-of-life', 'Seed of Life', '~', 'hot', 16, 9, 1, 'heal_over_time'),
|
||||
createAbility('lifebinder', 3, 'wild-growth', 'Wild Growth', '*', 'group', 15, 11, 7.5),
|
||||
createAbility('lifebinder', 4, 'barkskin', 'Barkskin', 'O', 'shield', 46, 10, 5.5, 'shield'),
|
||||
createAbility('lifebinder', 5, 'purging-sap', 'Purging Sap', 'x', 'cleanse', 12, 6, 4.5, 'cleanse'),
|
||||
createAbility('lifebinder', 6, 'ancient-grove', 'Ancient Grove', 'G', 'shield', 72, 18, 12, 'shield'),
|
||||
],
|
||||
runesage: [
|
||||
createAbility('runesage', 1, 'etched-mend', 'Etched Mend', '+', 'direct', 22, 3, 0.35),
|
||||
createAbility('runesage', 2, 'mending-rune', 'Mending Rune', '~', 'hot', 10, 5, 0.45, 'heal_over_time'),
|
||||
createAbility('runesage', 3, 'concordance', 'Concordance', '*', 'group', 16, 9, 5.5),
|
||||
createAbility('runesage', 4, 'aegis-script', 'Aegis Script', 'O', 'shield', 28, 6, 4.5, 'shield'),
|
||||
createAbility('runesage', 5, 'unravel', 'Unravel', 'x', 'cleanse', 8, 4, 3.5, 'cleanse'),
|
||||
createAbility('runesage', 6, 'grand-design', 'Grand Design', 'R', 'group', 22, 13, 8.5),
|
||||
],
|
||||
}
|
||||
|
||||
export function abilitiesForHealer(healerId: Iwt2HealerId | string) {
|
||||
return IWT2_HEALER_ABILITIES[asIwt2HealerId(healerId)]
|
||||
}
|
||||
|
||||
export function asIwt2HealerId(value: unknown): Iwt2HealerId {
|
||||
if (value === 'field_medic') return 'dawnweaver'
|
||||
if (value === 'ward_sage') return 'lifebinder'
|
||||
if (value === 'storm_chanter') return 'runesage'
|
||||
return IWT2_HEALER_ORDER.includes(value as Iwt2HealerId)
|
||||
? value as Iwt2HealerId
|
||||
: 'dawnweaver'
|
||||
}
|
||||
|
||||
function createAbility(
|
||||
healerId: Iwt2HealerId,
|
||||
slot: number,
|
||||
slug: string,
|
||||
name: string,
|
||||
icon: string,
|
||||
kind: Spell['kind'],
|
||||
power: number,
|
||||
manaCost: number,
|
||||
cooldownSeconds: number,
|
||||
effectType?: string,
|
||||
): Iwt2HealerAbility {
|
||||
return {
|
||||
id: `${healerId}-${slug}`,
|
||||
healerId,
|
||||
slot,
|
||||
name,
|
||||
icon,
|
||||
kind,
|
||||
power,
|
||||
effectType,
|
||||
manaCost,
|
||||
cooldownSeconds,
|
||||
target: 'party-member',
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
export {
|
||||
IWT2_CLASS_METADATA,
|
||||
IWT2_PARTY_ORDER,
|
||||
} from './classes'
|
||||
export type {
|
||||
Iwt2ClassMetadata,
|
||||
Iwt2PlayerClassId,
|
||||
Iwt2PlayerClassRole,
|
||||
} from './classes'
|
||||
|
||||
export {
|
||||
BULLDROME_BOSS_METADATA,
|
||||
IWT2_BOSS_METADATA,
|
||||
} from './bosses'
|
||||
export type {
|
||||
Iwt2BossId,
|
||||
Iwt2BossMetadata,
|
||||
} from './bosses'
|
||||
@@ -0,0 +1,65 @@
|
||||
import {
|
||||
buildOpponentSlotDebuffChoices,
|
||||
buildSelfSlotUpgradeChoices,
|
||||
} from '../../../combat/roguelikeUpgrades'
|
||||
import type { Spell } from '../../../game'
|
||||
import { type Iwt2HealerAbility } from './healerAbilities'
|
||||
|
||||
export type Iwt2RoguelikeVariant = 'pve' | 'pvp'
|
||||
export type Iwt2RoguelikeContentType = 'dungeon' | 'raid' | 'stadium'
|
||||
export type Iwt2RoguelikeSlot = '1' | '2' | '3' | '4' | '5'
|
||||
|
||||
export type Iwt2RoguelikeSelfBuffId =
|
||||
| 'revive-party-members'
|
||||
| `slot${Iwt2RoguelikeSlot}-extra-target`
|
||||
| `slot${Iwt2RoguelikeSlot}-cost-down`
|
||||
| `slot${Iwt2RoguelikeSlot}-cooldown-down`
|
||||
|
||||
export type Iwt2RoguelikeOpponentDebuffId =
|
||||
| `opp-slot${Iwt2RoguelikeSlot}-cost-up`
|
||||
| `opp-slot${Iwt2RoguelikeSlot}-cooldown-up`
|
||||
|
||||
export type Iwt2RoguelikeChoice<T extends string> = {
|
||||
id: T
|
||||
name: string
|
||||
description: string
|
||||
}
|
||||
|
||||
export const IWT2_ROGUELIKE_SLOTS: readonly Iwt2RoguelikeSlot[] = ['1', '2', '3', '4', '5']
|
||||
|
||||
export const IWT2_REVIVE_PARTY_CHOICE: Iwt2RoguelikeChoice<Iwt2RoguelikeSelfBuffId> = {
|
||||
id: 'revive-party-members',
|
||||
name: 'Revive Party Members',
|
||||
description: 'Revive fallen party members before the next IWT2 arena.',
|
||||
}
|
||||
|
||||
export function iwt2AbilityToSpell(ability: Iwt2HealerAbility): Spell {
|
||||
return {
|
||||
id: ability.id,
|
||||
key: String(ability.slot),
|
||||
name: ability.name,
|
||||
description: ability.name,
|
||||
cost: ability.manaCost,
|
||||
cooldown: ability.cooldownSeconds,
|
||||
power: ability.power,
|
||||
glyph: ability.icon,
|
||||
kind: ability.kind,
|
||||
effectType: ability.effectType,
|
||||
}
|
||||
}
|
||||
|
||||
export function buildIwt2SelfBuffChoices(abilities: Iwt2HealerAbility[]) {
|
||||
return buildSelfSlotUpgradeChoices<Iwt2RoguelikeSelfBuffId>({
|
||||
slots: IWT2_ROGUELIKE_SLOTS,
|
||||
spells: abilities.map(iwt2AbilityToSpell),
|
||||
labelMode: 'ability',
|
||||
})
|
||||
}
|
||||
|
||||
export function buildIwt2OpponentDebuffChoices(abilities: Iwt2HealerAbility[]) {
|
||||
return buildOpponentSlotDebuffChoices<Iwt2RoguelikeOpponentDebuffId>({
|
||||
slots: IWT2_ROGUELIKE_SLOTS,
|
||||
spells: abilities.map(iwt2AbilityToSpell),
|
||||
labelMode: 'ability',
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import { useEffect, useRef, type MutableRefObject } from 'react'
|
||||
import Phaser from 'phaser'
|
||||
import type { MovementVector } from '../../../input'
|
||||
import { BulldromeArenaScene } from './scenes/BulldromeArenaScene'
|
||||
import type { Iwt2ArenaState } from '../sim/arenaState'
|
||||
|
||||
type PhaserArenaProps = {
|
||||
movementRef: MutableRefObject<MovementVector>
|
||||
selectedPartyIdRef: MutableRefObject<string>
|
||||
stateRef: MutableRefObject<Iwt2ArenaState>
|
||||
onStep: (movement: MovementVector, dtSeconds: number) => Iwt2ArenaState
|
||||
}
|
||||
|
||||
export function PhaserArena({ movementRef, onStep, selectedPartyIdRef, stateRef }: PhaserArenaProps) {
|
||||
const hostRef = useRef<HTMLDivElement | null>(null)
|
||||
|
||||
useEffect(() => {
|
||||
if (!hostRef.current) return undefined
|
||||
const initialState = stateRef.current
|
||||
const scene = new BulldromeArenaScene({
|
||||
getMovement: () => movementRef.current,
|
||||
getSelectedPartyId: () => selectedPartyIdRef.current,
|
||||
getState: () => stateRef.current,
|
||||
step: onStep,
|
||||
})
|
||||
const game = new Phaser.Game({
|
||||
type: Phaser.AUTO,
|
||||
parent: hostRef.current,
|
||||
width: initialState.bounds.width,
|
||||
height: initialState.bounds.height,
|
||||
backgroundColor: '#10141b',
|
||||
pixelArt: false,
|
||||
scale: {
|
||||
mode: Phaser.Scale.FIT,
|
||||
autoCenter: Phaser.Scale.CENTER_BOTH,
|
||||
},
|
||||
scene,
|
||||
})
|
||||
|
||||
return () => {
|
||||
game.destroy(true)
|
||||
}
|
||||
}, [movementRef, onStep, selectedPartyIdRef, stateRef])
|
||||
|
||||
return <div className="iwt2-phaser-host" ref={hostRef} />
|
||||
}
|
||||