@almadar/ui 5.105.0 → 5.107.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avl/index.cjs +1903 -4193
- package/dist/avl/index.js +998 -3288
- package/dist/components/core/atoms/index.d.ts +1 -1
- package/dist/components/core/molecules/index.d.ts +1 -1
- package/dist/components/core/organisms/index.d.ts +1 -1
- package/dist/components/core/templates/index.d.ts +2 -2
- package/dist/components/game/{2d/atoms → atoms}/ActionButton.d.ts +1 -1
- package/dist/components/game/{2d/atoms → atoms}/ChoiceButton.d.ts +1 -1
- package/dist/components/game/{2d/atoms → atoms}/ControlButton.d.ts +1 -1
- package/dist/components/game/atoms/DrawShape.d.ts +50 -0
- package/dist/components/game/atoms/DrawSprite.d.ts +47 -0
- package/dist/components/game/atoms/DrawText.d.ts +31 -0
- package/dist/components/game/{2d/atoms → atoms}/GameAudioToggle.d.ts +1 -1
- package/dist/components/game/{2d/atoms → atoms}/GameIcon.d.ts +1 -1
- package/dist/components/game/{2d/atoms → atoms}/ItemSlot.d.ts +1 -1
- package/dist/components/game/{2d/atoms → atoms}/MiniMap.d.ts +1 -1
- package/dist/components/game/{2d/atoms → atoms}/ResourceCounter.d.ts +2 -2
- package/dist/components/game/{2d/atoms → atoms}/ScoreDisplay.d.ts +1 -1
- package/dist/components/game/{2d/atoms → atoms}/Sprite.d.ts +1 -1
- package/dist/components/game/{2d/atoms → atoms}/StateIndicator.d.ts +1 -1
- package/dist/components/game/{2d/atoms → atoms}/StatusEffect.d.ts +1 -1
- package/dist/components/game/{2d/atoms → atoms}/WaypointMarker.d.ts +1 -1
- package/dist/components/game/{shared/hooks → hooks}/useCamera.d.ts +1 -1
- package/dist/components/game/{shared/hooks → hooks}/useUnitSpriteAtlas.d.ts +2 -2
- package/dist/components/game/{shared → lib}/index.d.ts +1 -2
- package/dist/components/game/{shared/lib → lib}/puzzleObject.d.ts +1 -1
- package/dist/components/game/{2d/molecules → molecules}/ActionTile.d.ts +1 -1
- package/dist/components/game/molecules/Canvas.d.ts +96 -0
- package/dist/components/game/molecules/Canvas2D.d.ts +120 -0
- package/dist/components/game/{2d/molecules → molecules}/ControlGrid.d.ts +1 -1
- package/dist/components/game/molecules/DrawShapeLayer.d.ts +19 -0
- package/dist/components/game/molecules/DrawSpriteLayer.d.ts +21 -0
- package/dist/components/game/molecules/DrawTextLayer.d.ts +22 -0
- package/dist/components/game/{2d/molecules → molecules}/GameHud.d.ts +1 -1
- package/dist/components/game/{2d/molecules → molecules}/InventoryGrid.d.ts +1 -1
- package/dist/components/game/{2d/molecules → molecules}/ResourceBar.d.ts +1 -1
- package/dist/components/game/{2d/molecules → molecules}/StatBadge.d.ts +1 -1
- package/dist/components/game/{2d/molecules → molecules}/StateNode.d.ts +1 -1
- package/dist/components/game/{2d/molecules → molecules}/TraitSlot.d.ts +1 -1
- package/dist/components/game/{2d/molecules → molecules}/TraitStateViewer.d.ts +1 -1
- package/dist/components/game/{2d/molecules → molecules}/TransitionArrow.d.ts +1 -1
- package/dist/components/game/{2d/molecules → molecules}/index.d.ts +9 -16
- package/dist/components/game/patterns.d.ts +20 -0
- package/dist/components/game/{shared/providers → providers}/GameAudioProvider.d.ts +1 -1
- package/dist/components/game/{2d/templates → templates}/GameTemplate.d.ts +1 -1
- package/dist/components/game/{3d → three}/atoms/SpriteBillboard3D.d.ts +1 -1
- package/dist/components/game/{shared → three}/hooks/useGameCanvas3DEvents.d.ts +4 -3
- package/dist/components/game/{3d → three}/index.cjs +766 -3008
- package/dist/components/game/{3d → three}/index.css +3 -3
- package/dist/components/game/{3d → three}/index.d.ts +0 -1
- package/dist/components/game/{3d → three}/index.js +622 -2863
- package/dist/components/game/{shared → three}/lib/game3dAssetManifest.d.ts +1 -1
- package/dist/components/game/three/molecules/GameCanvas3D.d.ts +175 -0
- package/dist/components/game/{3d → three}/molecules/index.d.ts +9 -12
- package/dist/components/game/{3d → three}/patterns.d.ts +0 -4
- package/dist/components/index.cjs +2315 -4418
- package/dist/components/index.js +1412 -3508
- package/dist/lib/drawable/Drawable3D.d.ts +20 -0
- package/dist/lib/drawable/contract.d.ts +68 -0
- package/dist/lib/drawable/hitTest.d.ts +23 -0
- package/dist/lib/drawable/mesh3d.d.ts +28 -0
- package/dist/lib/drawable/paintDispatch.d.ts +22 -0
- package/dist/lib/drawable/projector.d.ts +14 -0
- package/dist/lib/drawable/projector3d.d.ts +20 -0
- package/dist/lib/imageCache.d.ts +9 -0
- package/dist/lib/painter2d.d.ts +81 -0
- package/dist/lib/webPainter2d.d.ts +7 -0
- package/dist/marketing/index.cjs +10 -0
- package/dist/marketing/index.js +10 -0
- package/dist/providers/index.cjs +1748 -4042
- package/dist/providers/index.js +956 -3250
- package/dist/runtime/index.cjs +1758 -4048
- package/dist/runtime/index.js +972 -3262
- package/package.json +13 -13
- package/dist/components/game/2d/molecules/Canvas2D.d.ts +0 -175
- package/dist/components/game/2d/molecules/SideCanvas2D.d.ts +0 -36
- package/dist/components/game/2d/organisms/BuilderBoard.d.ts +0 -60
- package/dist/components/game/2d/organisms/ClassifierBoard.d.ts +0 -66
- package/dist/components/game/2d/organisms/DebuggerBoard.d.ts +0 -61
- package/dist/components/game/2d/organisms/EventHandlerBoard.d.ts +0 -42
- package/dist/components/game/2d/organisms/NegotiatorBoard.d.ts +0 -56
- package/dist/components/game/2d/organisms/SequencerBoard.d.ts +0 -69
- package/dist/components/game/2d/organisms/SimulatorBoard.d.ts +0 -58
- package/dist/components/game/2d/organisms/StateArchitectBoard.d.ts +0 -61
- package/dist/components/game/3d/atoms/EventMarker3D.d.ts +0 -17
- package/dist/components/game/3d/molecules/FeatureMesh3D.d.ts +0 -21
- package/dist/components/game/3d/molecules/GameCanvas3D.d.ts +0 -259
- package/dist/components/game/3d/molecules/SideScene3D.d.ts +0 -31
- package/dist/components/game/3d/molecules/TileMesh3D.d.ts +0 -28
- package/dist/components/game/3d/molecules/UnitMesh3D.d.ts +0 -29
- package/dist/components/game/3d/organisms/GameBoard3D.d.ts +0 -66
- package/dist/components/game/3d/templates/GameCanvas3DBattleTemplate.d.ts +0 -82
- package/dist/components/game/3d/templates/GameCanvas3DCastleTemplate.d.ts +0 -87
- package/dist/components/game/3d/templates/GameCanvas3DWorldMapTemplate.d.ts +0 -95
- package/dist/components/game/shared/effects.d.ts +0 -253
- /package/dist/components/game/{2d/atoms → atoms}/ComboCounter.d.ts +0 -0
- /package/dist/components/game/{2d/atoms → atoms}/DamageNumber.d.ts +0 -0
- /package/dist/components/game/{2d/atoms → atoms}/DialogueBubble.d.ts +0 -0
- /package/dist/components/game/{2d/atoms → atoms}/GameCard.d.ts +0 -0
- /package/dist/components/game/{2d/atoms → atoms}/HealthBar.d.ts +0 -0
- /package/dist/components/game/{2d/atoms → atoms}/TimerDisplay.d.ts +0 -0
- /package/dist/components/game/{2d/atoms → atoms}/TurnIndicator.d.ts +0 -0
- /package/dist/components/game/{shared/hooks → hooks}/useGameAudio.d.ts +0 -0
- /package/dist/components/game/{shared → hooks}/useImageCache.d.ts +0 -0
- /package/dist/components/game/{shared → lib}/boardEntity.d.ts +0 -0
- /package/dist/components/game/{shared/lib → lib}/editorUtils.d.ts +0 -0
- /package/dist/components/game/{shared → lib}/game.d.ts +0 -0
- /package/dist/components/game/{shared → lib}/isometric.d.ts +0 -0
- /package/dist/components/game/{shared → lib}/isometricTypes.d.ts +0 -0
- /package/dist/components/game/{shared → lib}/makeAsset.d.ts +0 -0
- /package/dist/components/game/{shared/lib → lib}/mechanics.d.ts +0 -0
- /package/dist/components/game/{shared/lib → lib}/physicsPresets.d.ts +0 -0
- /package/dist/components/game/{shared/lib → lib}/physicsTypes.d.ts +0 -0
- /package/dist/components/game/{shared → lib}/spriteAnimation.d.ts +0 -0
- /package/dist/components/game/{shared → lib}/spriteAnimationTypes.d.ts +0 -0
- /package/dist/components/game/{shared → lib}/spriteSheetConstants.d.ts +0 -0
- /package/dist/components/game/{2d/molecules → molecules}/ActionPalette.d.ts +0 -0
- /package/dist/components/game/{2d/molecules → molecules}/EventLog.d.ts +0 -0
- /package/dist/components/game/{2d/molecules → molecules}/GameMenu.d.ts +0 -0
- /package/dist/components/game/{2d/molecules → molecules}/ObjectRulePanel.d.ts +0 -0
- /package/dist/components/game/{2d/molecules → molecules}/RuleEditor.d.ts +0 -0
- /package/dist/components/game/{2d/molecules → molecules}/SequenceBar.d.ts +0 -0
- /package/dist/components/game/{2d/molecules → molecules}/StateGraph.d.ts +0 -0
- /package/dist/components/game/{2d/molecules → molecules}/StateJsonView.d.ts +0 -0
- /package/dist/components/game/{2d/molecules → molecules}/VariablePanel.d.ts +0 -0
- /package/dist/components/game/{2d/templates → templates}/GameShell.d.ts +0 -0
- /package/dist/components/game/{shared → three}/game3dTheme.d.ts +0 -0
- /package/dist/components/game/{shared → three}/hooks/useAssetLoader.d.ts +0 -0
- /package/dist/components/game/{shared → three}/hooks/useRaycaster.d.ts +0 -0
- /package/dist/components/game/{shared → three}/hooks/useSceneGraph.d.ts +0 -0
- /package/dist/components/game/{shared → three}/hooks/useThree.d.ts +0 -0
- /package/dist/components/game/{shared → three}/lib/AssetLoader.d.ts +0 -0
- /package/dist/components/game/{shared → three}/lib/culling.d.ts +0 -0
- /package/dist/components/game/{shared → three}/lib/grid3D.d.ts +0 -0
- /package/dist/components/game/{3d → three}/molecules/Camera3D.d.ts +0 -0
- /package/dist/components/game/{3d → three}/molecules/Canvas3DErrorBoundary.d.ts +0 -0
- /package/dist/components/game/{3d → three}/molecules/Canvas3DLoadingState.d.ts +0 -0
- /package/dist/components/game/{3d → three}/molecules/GameCamera3D.d.ts +0 -0
- /package/dist/components/game/{3d → three}/molecules/Lighting3D.d.ts +0 -0
- /package/dist/components/game/{3d → three}/molecules/ModelLoader.d.ts +0 -0
- /package/dist/components/game/{3d → three}/molecules/Scene3D.d.ts +0 -0
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GameCanvas3DCastleTemplate
|
|
3
|
-
*
|
|
4
|
-
* Declarative template for 3D castle/settlement view.
|
|
5
|
-
* Delegates interaction state (selectedUnitId, validMoves, attackTargets)
|
|
6
|
-
* to <GameBoard3D> so the model owns all gameplay state.
|
|
7
|
-
*
|
|
8
|
-
* Page: Castle3DPage, Settlement3DPage
|
|
9
|
-
* Entity: Castle3D / GameBoard3DItem
|
|
10
|
-
* ViewType: detail
|
|
11
|
-
*
|
|
12
|
-
* Events Emitted:
|
|
13
|
-
* - BUILDING_SELECTED - When a building is clicked
|
|
14
|
-
* - UNIT_SELECTED - When a garrison unit is clicked
|
|
15
|
-
* - BUILD - When building/upgrading
|
|
16
|
-
* - RECRUIT - When recruiting units
|
|
17
|
-
* - EXIT - When exiting castle view
|
|
18
|
-
*
|
|
19
|
-
* @packageDocumentation
|
|
20
|
-
*/
|
|
21
|
-
import React from 'react';
|
|
22
|
-
import type { IsometricTile, IsometricFeature } from '../../shared/isometricTypes';
|
|
23
|
-
import type { TemplateProps } from '../../../core/templates/types';
|
|
24
|
-
import { type Game3DAssetManifest } from '../../shared/lib/game3dAssetManifest';
|
|
25
|
-
export interface GameCanvas3DCastleTemplateProps extends TemplateProps {
|
|
26
|
-
/** Fallback tile data when no entity is present (layout only — model URLs resolve from assetManifest) */
|
|
27
|
-
tiles?: IsometricTile[];
|
|
28
|
-
/** Fallback feature data when no entity is present */
|
|
29
|
-
features?: IsometricFeature[];
|
|
30
|
-
/** GLB model URLs keyed by terrain — owns all asset choice (no hardcoded URLs in this template). */
|
|
31
|
-
assetManifest?: Game3DAssetManifest;
|
|
32
|
-
/** 3D camera mode */
|
|
33
|
-
cameraMode?: 'isometric' | 'perspective' | 'top-down';
|
|
34
|
-
/** Show grid helper */
|
|
35
|
-
showGrid?: boolean;
|
|
36
|
-
/** Enable shadows */
|
|
37
|
-
shadows?: boolean;
|
|
38
|
-
/** Background color */
|
|
39
|
-
backgroundColor?: string;
|
|
40
|
-
/** Event name for building (feature) clicks */
|
|
41
|
-
buildingClickEvent?: string;
|
|
42
|
-
/** Event name for unit clicks */
|
|
43
|
-
unitClickEvent?: string;
|
|
44
|
-
/** Event name for ending turn */
|
|
45
|
-
endTurnEvent?: string;
|
|
46
|
-
/** Event name for cancel/deselect */
|
|
47
|
-
cancelEvent?: string;
|
|
48
|
-
/** Event name for attack emission */
|
|
49
|
-
attackEvent?: string;
|
|
50
|
-
/** Event name for play again / reset */
|
|
51
|
-
playAgainEvent?: string;
|
|
52
|
-
/** Event name for game end detection */
|
|
53
|
-
gameEndEvent?: string;
|
|
54
|
-
/** Event name for build action */
|
|
55
|
-
buildEvent?: string;
|
|
56
|
-
/** Event name for recruit action */
|
|
57
|
-
recruitEvent?: string;
|
|
58
|
-
/** Event name for exit */
|
|
59
|
-
exitEvent?: string;
|
|
60
|
-
/** Show castle name header */
|
|
61
|
-
showHeader?: boolean;
|
|
62
|
-
/** Unit draw-size multiplier forwarded to GameBoard3D. Default 1. */
|
|
63
|
-
unitScale?: number;
|
|
64
|
-
/** Board zoom/group scale forwarded to GameBoard3D. Default 0.45. */
|
|
65
|
-
scale?: number;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* GameCanvas3DCastleTemplate Component
|
|
69
|
-
*
|
|
70
|
-
* Template for 3D castle/settlement management view.
|
|
71
|
-
* Interaction state lives in the entity (model), not in this component.
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* ```tsx
|
|
75
|
-
* <GameCanvas3DCastleTemplate
|
|
76
|
-
* entity={castleEntity}
|
|
77
|
-
* cameraMode="isometric"
|
|
78
|
-
* showHeader={true}
|
|
79
|
-
* buildingClickEvent="UNIT_CLICK"
|
|
80
|
-
* />
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
|
-
export declare function GameCanvas3DCastleTemplate({ entity, tiles: propTiles, features: propFeatures, assetManifest, cameraMode, backgroundColor, buildingClickEvent, unitClickEvent, endTurnEvent, cancelEvent, attackEvent, playAgainEvent, gameEndEvent, showHeader, unitScale, scale, className, }: GameCanvas3DCastleTemplateProps): React.JSX.Element | null;
|
|
84
|
-
export declare namespace GameCanvas3DCastleTemplate {
|
|
85
|
-
var displayName: string;
|
|
86
|
-
}
|
|
87
|
-
export default GameCanvas3DCastleTemplate;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GameCanvas3DWorldMapTemplate
|
|
3
|
-
*
|
|
4
|
-
* Declarative template for 3D world map.
|
|
5
|
-
* Delegates interaction state (selectedUnitId, validMoves, attackTargets)
|
|
6
|
-
* to <GameBoard3D> so the model owns all gameplay state.
|
|
7
|
-
*
|
|
8
|
-
* Page: WorldMap3DPage
|
|
9
|
-
* Entity: WorldMap3D / GameBoard3DItem
|
|
10
|
-
* ViewType: detail
|
|
11
|
-
*
|
|
12
|
-
* Events Emitted:
|
|
13
|
-
* - TILE_CLICK - When a tile is clicked ({ tileId, x, z, type })
|
|
14
|
-
* - UNIT_CLICK - When a unit is clicked ({ unitId, x, z, name })
|
|
15
|
-
* - FEATURE_CLICK - When a feature is clicked ({ featureId, x, z, type })
|
|
16
|
-
* - TILE_HOVER - When hovering over a tile ({ tileId, x, z })
|
|
17
|
-
* - TILE_LEAVE - When leaving a tile ({})
|
|
18
|
-
* - CAMERA_CHANGE - When camera position changes ({ position })
|
|
19
|
-
*
|
|
20
|
-
* @packageDocumentation
|
|
21
|
-
*/
|
|
22
|
-
import React from 'react';
|
|
23
|
-
import type { IsometricTile, IsometricFeature } from '../../shared/isometricTypes';
|
|
24
|
-
import type { TemplateProps } from '../../../core/templates/types';
|
|
25
|
-
import { type Game3DAssetManifest } from '../../shared/lib/game3dAssetManifest';
|
|
26
|
-
export interface GameCanvas3DWorldMapTemplateProps extends TemplateProps {
|
|
27
|
-
/** Fallback tile data when no entity is present (layout only — model URLs resolve from assetManifest) */
|
|
28
|
-
tiles?: IsometricTile[];
|
|
29
|
-
/** Fallback feature data when no entity is present */
|
|
30
|
-
features?: IsometricFeature[];
|
|
31
|
-
/** GLB model URLs keyed by terrain — owns all asset choice (no hardcoded URLs in this template). */
|
|
32
|
-
assetManifest?: Game3DAssetManifest;
|
|
33
|
-
/** 3D camera mode */
|
|
34
|
-
cameraMode?: 'isometric' | 'perspective' | 'top-down';
|
|
35
|
-
/** Show grid helper */
|
|
36
|
-
showGrid?: boolean;
|
|
37
|
-
/** Show coordinate overlay */
|
|
38
|
-
showCoordinates?: boolean;
|
|
39
|
-
/** Show tile info on hover */
|
|
40
|
-
showTileInfo?: boolean;
|
|
41
|
-
/** Enable shadows */
|
|
42
|
-
shadows?: boolean;
|
|
43
|
-
/** Background color */
|
|
44
|
-
backgroundColor?: string;
|
|
45
|
-
/** Event name for tile clicks — forwarded to the model */
|
|
46
|
-
tileClickEvent?: string;
|
|
47
|
-
/** Event name for unit clicks — forwarded to the model */
|
|
48
|
-
unitClickEvent?: string;
|
|
49
|
-
/** Event name for ending turn */
|
|
50
|
-
endTurnEvent?: string;
|
|
51
|
-
/** Event name for cancel/deselect */
|
|
52
|
-
cancelEvent?: string;
|
|
53
|
-
/** Event name for attack emission */
|
|
54
|
-
attackEvent?: string;
|
|
55
|
-
/** Event name for play again / reset */
|
|
56
|
-
playAgainEvent?: string;
|
|
57
|
-
/** Event name for game end detection */
|
|
58
|
-
gameEndEvent?: string;
|
|
59
|
-
/** Event name for feature clicks */
|
|
60
|
-
featureClickEvent?: string;
|
|
61
|
-
/** Event name for tile hover */
|
|
62
|
-
tileHoverEvent?: string;
|
|
63
|
-
/** Event name for tile leave */
|
|
64
|
-
tileLeaveEvent?: string;
|
|
65
|
-
/** Event name for camera changes */
|
|
66
|
-
cameraChangeEvent?: string;
|
|
67
|
-
/** Exit/back event name */
|
|
68
|
-
exitEvent?: string;
|
|
69
|
-
/** Unit draw-size multiplier forwarded to GameBoard3D. Default 1. */
|
|
70
|
-
unitScale?: number;
|
|
71
|
-
/** Board zoom/group scale forwarded to GameBoard3D. Default 0.45. */
|
|
72
|
-
scale?: number;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* GameCanvas3DWorldMapTemplate Component
|
|
76
|
-
*
|
|
77
|
-
* Template for 3D world map view.
|
|
78
|
-
* Interaction state lives in the entity (model), not in this component.
|
|
79
|
-
*
|
|
80
|
-
* @example
|
|
81
|
-
* ```tsx
|
|
82
|
-
* <GameCanvas3DWorldMapTemplate
|
|
83
|
-
* entity={worldMapEntity}
|
|
84
|
-
* cameraMode="isometric"
|
|
85
|
-
* tileClickEvent="TILE_CLICK"
|
|
86
|
-
* unitClickEvent="UNIT_CLICK"
|
|
87
|
-
* showCoordinates={true}
|
|
88
|
-
* />
|
|
89
|
-
* ```
|
|
90
|
-
*/
|
|
91
|
-
export declare function GameCanvas3DWorldMapTemplate({ entity, tiles: propTiles, features: propFeatures, assetManifest, cameraMode, backgroundColor, tileClickEvent, unitClickEvent, endTurnEvent, cancelEvent, attackEvent, playAgainEvent, gameEndEvent, unitScale, scale, className, }: GameCanvas3DWorldMapTemplateProps): React.JSX.Element | null;
|
|
92
|
-
export declare namespace GameCanvas3DWorldMapTemplate {
|
|
93
|
-
var displayName: string;
|
|
94
|
-
}
|
|
95
|
-
export default GameCanvas3DWorldMapTemplate;
|
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canvas Effect Types
|
|
3
|
-
*
|
|
4
|
-
* Type definitions for the canvas-based particle, sequence, and overlay
|
|
5
|
-
* effect system. Used by canvasEffects engine and combat presets.
|
|
6
|
-
*
|
|
7
|
-
* Ported from trait-wars and generalized for any almadar-ui client.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* A single particle in flight — rendered as a tinted sprite each frame.
|
|
11
|
-
*/
|
|
12
|
-
export interface CanvasParticle {
|
|
13
|
-
/** Sprite URL (white-on-transparent particle) */
|
|
14
|
-
spriteUrl: string;
|
|
15
|
-
/** Current position in screen pixels */
|
|
16
|
-
x: number;
|
|
17
|
-
y: number;
|
|
18
|
-
/** Velocity in pixels per second */
|
|
19
|
-
vx: number;
|
|
20
|
-
vy: number;
|
|
21
|
-
/** Downward acceleration in px/s² (positive = down) */
|
|
22
|
-
gravity: number;
|
|
23
|
-
/** Current rotation in radians */
|
|
24
|
-
rotation: number;
|
|
25
|
-
/** Rotation speed in radians per second */
|
|
26
|
-
rotationSpeed: number;
|
|
27
|
-
/** Current scale (1.0 = original size) */
|
|
28
|
-
scale: number;
|
|
29
|
-
/** Scale change per second (negative = shrink) */
|
|
30
|
-
scaleSpeed: number;
|
|
31
|
-
/** Current alpha (0-1) */
|
|
32
|
-
alpha: number;
|
|
33
|
-
/** Alpha change per second (negative = fade out) */
|
|
34
|
-
fadeRate: number;
|
|
35
|
-
/** RGB tint color (applied via offscreen canvas compositing) */
|
|
36
|
-
tint: {
|
|
37
|
-
r: number;
|
|
38
|
-
g: number;
|
|
39
|
-
b: number;
|
|
40
|
-
};
|
|
41
|
-
/** Canvas blend mode */
|
|
42
|
-
blendMode: GlobalCompositeOperation;
|
|
43
|
-
/** Time this particle was spawned (ms) */
|
|
44
|
-
spawnTime: number;
|
|
45
|
-
/** Maximum lifetime in ms (particle removed after) */
|
|
46
|
-
lifetime: number;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Configuration for spawning a burst of particles.
|
|
50
|
-
*/
|
|
51
|
-
export interface ParticleEmitterConfig {
|
|
52
|
-
/** Array of sprite URLs to randomly pick from */
|
|
53
|
-
spriteUrls: string[];
|
|
54
|
-
/** Number of particles to spawn */
|
|
55
|
-
count: number;
|
|
56
|
-
/** Spawn origin in screen pixels */
|
|
57
|
-
originX: number;
|
|
58
|
-
originY: number;
|
|
59
|
-
/** Random spread radius from origin (px) */
|
|
60
|
-
spread: number;
|
|
61
|
-
/** Velocity range (px/s) */
|
|
62
|
-
velocityMin: number;
|
|
63
|
-
velocityMax: number;
|
|
64
|
-
/** Emission angle range (radians, 0 = right, PI/2 = down) */
|
|
65
|
-
angleMin: number;
|
|
66
|
-
angleMax: number;
|
|
67
|
-
/** Gravity (px/s²) */
|
|
68
|
-
gravity: number;
|
|
69
|
-
/** RGB tint */
|
|
70
|
-
tint: {
|
|
71
|
-
r: number;
|
|
72
|
-
g: number;
|
|
73
|
-
b: number;
|
|
74
|
-
};
|
|
75
|
-
/** Scale range */
|
|
76
|
-
scaleMin: number;
|
|
77
|
-
scaleMax: number;
|
|
78
|
-
/** Scale speed (per second) */
|
|
79
|
-
scaleSpeed?: number;
|
|
80
|
-
/** Particle lifetime range (ms) */
|
|
81
|
-
lifetimeMin: number;
|
|
82
|
-
lifetimeMax: number;
|
|
83
|
-
/** Fade rate (alpha per second, negative = fade out) */
|
|
84
|
-
fadeRate?: number;
|
|
85
|
-
/** Starting alpha */
|
|
86
|
-
alpha?: number;
|
|
87
|
-
/** Canvas blend mode */
|
|
88
|
-
blendMode?: GlobalCompositeOperation;
|
|
89
|
-
/** Rotation speed range (radians/s) */
|
|
90
|
-
rotationSpeedMin?: number;
|
|
91
|
-
rotationSpeedMax?: number;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* A frame-sequence animation (e.g., explosion, smoke puff).
|
|
95
|
-
*/
|
|
96
|
-
export interface CanvasSequence {
|
|
97
|
-
/** Ordered array of frame sprite URLs */
|
|
98
|
-
frameUrls: string[];
|
|
99
|
-
/** Position in screen pixels (top-left of sprite) */
|
|
100
|
-
x: number;
|
|
101
|
-
y: number;
|
|
102
|
-
/** Duration per frame in ms */
|
|
103
|
-
frameDuration: number;
|
|
104
|
-
/** Time this sequence started (ms) */
|
|
105
|
-
startTime: number;
|
|
106
|
-
/** Whether to loop the animation */
|
|
107
|
-
loop: boolean;
|
|
108
|
-
/** Render scale */
|
|
109
|
-
scale: number;
|
|
110
|
-
/** RGB tint (null = no tinting) */
|
|
111
|
-
tint: {
|
|
112
|
-
r: number;
|
|
113
|
-
g: number;
|
|
114
|
-
b: number;
|
|
115
|
-
} | null;
|
|
116
|
-
/** Alpha (0-1) */
|
|
117
|
-
alpha: number;
|
|
118
|
-
/** Canvas blend mode */
|
|
119
|
-
blendMode: GlobalCompositeOperation;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Configuration for spawning a frame sequence.
|
|
123
|
-
*/
|
|
124
|
-
export interface SequenceConfig {
|
|
125
|
-
frameUrls: string[];
|
|
126
|
-
originX: number;
|
|
127
|
-
originY: number;
|
|
128
|
-
frameDuration: number;
|
|
129
|
-
loop?: boolean;
|
|
130
|
-
scale?: number;
|
|
131
|
-
tint?: {
|
|
132
|
-
r: number;
|
|
133
|
-
g: number;
|
|
134
|
-
b: number;
|
|
135
|
-
} | null;
|
|
136
|
-
alpha?: number;
|
|
137
|
-
blendMode?: GlobalCompositeOperation;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* A static/fading overlay image (e.g., ground scorch mark, shield circle).
|
|
141
|
-
*/
|
|
142
|
-
export interface CanvasOverlay {
|
|
143
|
-
/** Sprite URL */
|
|
144
|
-
spriteUrl: string;
|
|
145
|
-
/** Center position in screen pixels */
|
|
146
|
-
x: number;
|
|
147
|
-
y: number;
|
|
148
|
-
/** Current alpha (0-1) */
|
|
149
|
-
alpha: number;
|
|
150
|
-
/** Alpha change per second (negative = fade out) */
|
|
151
|
-
fadeRate: number;
|
|
152
|
-
/** Pulse amplitude (0 = no pulse, 0.3 = alpha oscillates ±0.3) */
|
|
153
|
-
pulseAmplitude: number;
|
|
154
|
-
/** Pulse frequency in Hz */
|
|
155
|
-
pulseFrequency: number;
|
|
156
|
-
/** Render scale */
|
|
157
|
-
scale: number;
|
|
158
|
-
/** Canvas blend mode */
|
|
159
|
-
blendMode: GlobalCompositeOperation;
|
|
160
|
-
/** Time this overlay was spawned (ms) */
|
|
161
|
-
spawnTime: number;
|
|
162
|
-
/** Maximum lifetime in ms */
|
|
163
|
-
lifetime: number;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Configuration for spawning an overlay.
|
|
167
|
-
*/
|
|
168
|
-
export interface OverlayConfig {
|
|
169
|
-
spriteUrl: string;
|
|
170
|
-
originX: number;
|
|
171
|
-
originY: number;
|
|
172
|
-
alpha?: number;
|
|
173
|
-
fadeRate?: number;
|
|
174
|
-
pulseAmplitude?: number;
|
|
175
|
-
pulseFrequency?: number;
|
|
176
|
-
scale?: number;
|
|
177
|
-
blendMode?: GlobalCompositeOperation;
|
|
178
|
-
lifetime?: number;
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Full state of all active effects on the canvas.
|
|
182
|
-
*/
|
|
183
|
-
export interface CanvasEffectState {
|
|
184
|
-
particles: CanvasParticle[];
|
|
185
|
-
sequences: CanvasSequence[];
|
|
186
|
-
overlays: CanvasOverlay[];
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Combat action types that map to effect compositions.
|
|
190
|
-
* Superset of trait-wars types + almadar-ui originals.
|
|
191
|
-
*/
|
|
192
|
-
export type CombatActionType = 'melee' | 'ranged' | 'magic' | 'heal' | 'defend' | 'hit' | 'death' | 'buff' | 'debuff' | 'shield' | 'aoe' | 'critical';
|
|
193
|
-
/**
|
|
194
|
-
* A combat preset composes multiple effect layers.
|
|
195
|
-
*/
|
|
196
|
-
export interface CombatPreset {
|
|
197
|
-
/** Particle emitter configs to spawn */
|
|
198
|
-
particles: ParticleEmitterConfig[];
|
|
199
|
-
/** Sequence configs to spawn */
|
|
200
|
-
sequences: SequenceConfig[];
|
|
201
|
-
/** Overlay configs to spawn */
|
|
202
|
-
overlays: OverlayConfig[];
|
|
203
|
-
/** Screen shake intensity in pixels (0 = none) */
|
|
204
|
-
screenShake: number;
|
|
205
|
-
/** Screen flash color and duration */
|
|
206
|
-
screenFlash: {
|
|
207
|
-
r: number;
|
|
208
|
-
g: number;
|
|
209
|
-
b: number;
|
|
210
|
-
duration: number;
|
|
211
|
-
} | null;
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Effect asset manifest — the sprites and animation frames available for
|
|
215
|
-
* the particle engine. This is the `assetManifest.effects` section.
|
|
216
|
-
*/
|
|
217
|
-
export interface EffectAssetManifest {
|
|
218
|
-
/** Base URL for all asset paths */
|
|
219
|
-
baseUrl: string;
|
|
220
|
-
/** Particle sprite groups (white-on-transparent, tinted at runtime) */
|
|
221
|
-
particles?: {
|
|
222
|
-
slash?: string[];
|
|
223
|
-
magic?: string[];
|
|
224
|
-
fire?: string[];
|
|
225
|
-
flame?: string[];
|
|
226
|
-
smoke?: string[];
|
|
227
|
-
scorch?: string[];
|
|
228
|
-
circle?: string[];
|
|
229
|
-
flare?: string;
|
|
230
|
-
spark?: string[];
|
|
231
|
-
muzzle?: string[];
|
|
232
|
-
star?: string[];
|
|
233
|
-
trace?: string[];
|
|
234
|
-
twirl?: string[];
|
|
235
|
-
light?: string[];
|
|
236
|
-
dirt?: string[];
|
|
237
|
-
scratch?: string[];
|
|
238
|
-
symbol?: string[];
|
|
239
|
-
};
|
|
240
|
-
/** Frame-sequence animations (array of frame image paths) */
|
|
241
|
-
animations?: {
|
|
242
|
-
explosion?: string[];
|
|
243
|
-
smokePuff?: string[];
|
|
244
|
-
flash?: string[];
|
|
245
|
-
blackSmoke?: string[];
|
|
246
|
-
gasSmoke?: string[];
|
|
247
|
-
smokeExplosion?: string[];
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Empty effect state constant.
|
|
252
|
-
*/
|
|
253
|
-
export declare const EMPTY_EFFECT_STATE: CanvasEffectState;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|