@roost2d/chikn-rigs 0.5.0 → 0.6.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/README.md +6 -2
- package/dist/actions.d.ts +24 -4
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +311 -101
- package/dist/actions.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/trait-profiles.d.ts +16 -0
- package/dist/trait-profiles.d.ts.map +1 -0
- package/dist/trait-profiles.js +344 -0
- package/dist/trait-profiles.js.map +1 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -40,11 +40,15 @@ Trait-aware brawler actions are resolved from the same recipe:
|
|
|
40
40
|
|
|
41
41
|
```ts
|
|
42
42
|
const choices = listAvailableChiknActions(recipe, definition);
|
|
43
|
-
const action = resolveChiknAction(recipe, definition, choices[0].id
|
|
43
|
+
const action = resolveChiknAction(recipe, definition, choices[0].id, {
|
|
44
|
+
targetOffset: { x: 210, y: -24 }, // fighter-local; positive X is current forward
|
|
45
|
+
});
|
|
44
46
|
const playback = new RigActionController(rig).play(action.clip, { controlled: true });
|
|
45
47
|
playback.advance(frameMs);
|
|
46
48
|
```
|
|
47
49
|
|
|
48
|
-
Every attachment group receives
|
|
50
|
+
Every attachment group receives one checked-in immutable profile with its supported actions, driver attachments, calibrated offsets and timing, functional preset, and explicit rigid/soft/dangling/cloth/feather/bulky/elastic secondary motion. Weapons replace Punch with their own draw, slash, thrust, golf, pickaxe, shot, swing, or casting motion. Feet select tailored paired or combined kicks, and `listChiknSpecials` returns only specials granted by equipped traits.
|
|
51
|
+
|
|
52
|
+
Golden Egg and Very Fresh Egg use a dedicated 1,000 ms action: the inner `pose` bone turns away while game-owned root facing stays untouched, the bird bends, the displayed egg releases at 400 ms, and a texture-identical detached clone follows an aimed arc until presentation contact at 800 ms. The equipped egg regrows and the setup pose returns at 1,000 ms. Floppy Disk and Omelette also launch exact equipped art; Omelette uses its pan motion and is never classified as an egg.
|
|
49
53
|
|
|
50
54
|
Resolve each `definition.attachments[].texture.assetId` through a separately hosted Chikn runtime manifest before creating the display factory. [Chikn integration tutorial](https://github.com/Roost2D/roost2d/blob/main/docs/chikn-assets.md).
|
package/dist/actions.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AnimationClipV1, RigDefinitionV1 } from '@roost2d/contracts';
|
|
2
|
-
import type { ProceduralEffectDescriptor } from '@roost2d/effects';
|
|
2
|
+
import type { EffectOrigin, EffectPoint, ProceduralEffectDescriptor } from '@roost2d/effects';
|
|
3
|
+
import { type ChiknKickPreset, type ChiknPunchPreset, type ChiknSecondaryMotion, type ChiknSpecialPreset } from './trait-profiles.js';
|
|
3
4
|
export type ChiknMotionFamily = 'accent' | 'footwear' | 'blade' | 'blunt' | 'ranged' | 'casting' | 'tail';
|
|
4
5
|
export type ChiknActionInput = 'punch' | 'kick' | 'special';
|
|
5
6
|
export interface ChiknTraitAnimationProfile {
|
|
@@ -9,13 +10,25 @@ export interface ChiknTraitAnimationProfile {
|
|
|
9
10
|
motionFamily: ChiknMotionFamily;
|
|
10
11
|
readonly attachmentTargets: readonly string[];
|
|
11
12
|
readonly supportedActions: readonly ChiknActionInput[];
|
|
13
|
+
secondaryMotion: ChiknSecondaryMotion;
|
|
12
14
|
amplitude: number;
|
|
13
15
|
speed: number;
|
|
16
|
+
gripOffset: EffectPoint;
|
|
17
|
+
tipOffset: EffectPoint;
|
|
18
|
+
originOffset: EffectPoint;
|
|
19
|
+
timing: {
|
|
20
|
+
anticipationMs: number;
|
|
21
|
+
releaseMs: number;
|
|
22
|
+
recoveryMs: number;
|
|
23
|
+
};
|
|
24
|
+
punchPreset?: ChiknPunchPreset;
|
|
25
|
+
kickPreset?: ChiknKickPreset;
|
|
14
26
|
special?: {
|
|
15
27
|
id: string;
|
|
16
28
|
label: string;
|
|
17
29
|
family: 'beam' | 'projectile' | 'cast' | 'burst' | 'tail';
|
|
18
|
-
|
|
30
|
+
preset: ChiknSpecialPreset;
|
|
31
|
+
origin: EffectOrigin;
|
|
19
32
|
};
|
|
20
33
|
}
|
|
21
34
|
export interface ChiknActionChoice {
|
|
@@ -24,25 +37,32 @@ export interface ChiknActionChoice {
|
|
|
24
37
|
label: string;
|
|
25
38
|
sourceTraitGroupId?: string;
|
|
26
39
|
}
|
|
40
|
+
export interface ChiknActionContext {
|
|
41
|
+
targetOffset?: EffectPoint;
|
|
42
|
+
}
|
|
27
43
|
export interface ResolvedChiknEffect extends ProceduralEffectDescriptor {
|
|
28
44
|
cueId: string;
|
|
45
|
+
/** @deprecated Prefer origin. Kept for v0.5 consumers. */
|
|
29
46
|
socketId: string;
|
|
30
47
|
}
|
|
31
48
|
export interface ResolvedChiknAction extends ChiknActionChoice {
|
|
32
49
|
motionFamily: string;
|
|
33
50
|
clip: AnimationClipV1;
|
|
34
51
|
effects: ResolvedChiknEffect[];
|
|
52
|
+
targetOffset: EffectPoint;
|
|
35
53
|
}
|
|
36
54
|
export interface ChiknActionRecipe {
|
|
37
55
|
species: 'chikn' | 'roostr';
|
|
38
56
|
traitGroupIds: readonly string[];
|
|
57
|
+
/** Informational only. Facing remains owned by the consuming game. */
|
|
58
|
+
mirrored?: boolean;
|
|
39
59
|
}
|
|
40
|
-
/** Returns one immutable motion profile for every attachment group in a rig. */
|
|
60
|
+
/** Returns one checked-in, immutable motion profile for every attachment group in a rig. */
|
|
41
61
|
export declare function createChiknTraitAnimationProfiles(definition: RigDefinitionV1): readonly ChiknTraitAnimationProfile[];
|
|
42
62
|
export declare function validateChiknTraitAnimationProfiles(definition: RigDefinitionV1, profiles: readonly ChiknTraitAnimationProfile[]): string[];
|
|
43
63
|
export declare function listChiknSpecials(recipe: ChiknActionRecipe, definition: RigDefinitionV1): ChiknActionChoice[];
|
|
44
64
|
export declare function listAvailableChiknActions(recipe: ChiknActionRecipe, definition: RigDefinitionV1): ChiknActionChoice[];
|
|
45
|
-
export declare function resolveChiknAction(recipe: ChiknActionRecipe, definition: RigDefinitionV1, actionId: string): ResolvedChiknAction;
|
|
65
|
+
export declare function resolveChiknAction(recipe: ChiknActionRecipe, definition: RigDefinitionV1, actionId: string, context?: ChiknActionContext): ResolvedChiknAction;
|
|
46
66
|
/** Species-specific brawler and attack foundations generated from the rig setup pose. */
|
|
47
67
|
export declare function createChiknActionClips(definition: RigDefinitionV1): readonly AnimationClipV1[];
|
|
48
68
|
//# sourceMappingURL=actions.d.ts.map
|
package/dist/actions.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAyD,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAClI,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAoB,0BAA0B,EAAwB,MAAM,kBAAkB,CAAC;AACtI,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACxB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAC1G,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAE5D,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,iBAAiB,CAAC;IAChC,QAAQ,CAAC,iBAAiB,EAAE,SAAS,MA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