@adatechnology/game-items 0.8.0 → 0.9.1
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/index.d.ts +23 -7
- package/dist/index.global.js +958 -2
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +952 -3
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BodySlot, ItemTool, SealSpec, DeepPartial, ToolCondition, SealState, SealBlock } from '@adatechnology/game-contracts';
|
|
1
|
+
import { BodySlot, ItemTool, SealSpec, DeepPartial, ToolCondition, SealState, SealBlock, WashSurface } from '@adatechnology/game-contracts';
|
|
2
2
|
export { BodySlot } from '@adatechnology/game-contracts';
|
|
3
3
|
import { ItemDef as ItemDef$1, rng, ItemStack as ItemStack$1, SlotSpec, LootTables } from '@adatechnology/game-interactables';
|
|
4
4
|
export { ItemDef as BaseItemDef } from '@adatechnology/game-interactables';
|
|
@@ -910,16 +910,28 @@ declare const ARSENAL_CATEGORIES: readonly CategoryDef[];
|
|
|
910
910
|
*/
|
|
911
911
|
declare const itemsFromArsenal: (arsenal: ArsenalLike, options?: ArsenalItemsOptions) => ItemPack;
|
|
912
912
|
|
|
913
|
+
/**
|
|
914
|
+
* Uses of an item in the hand that holds no liquid (spec 015 R5): eating with the hand, taking a pill, putting on a dressing, rubbing soap in. A use is keys of where the
|
|
915
|
+
* item goes from the hand that holds it, in the frame of the eye (x to the right, y up, z back towards the eye; the mouth is near `[0, 0.02, -0.2]`), the same frame
|
|
916
|
+
* as the fluid uses of game-fluids, so a host moves the hand and the item alike for both. `body` tells the body which arms take part. Engine-agnostic and pure:
|
|
917
|
+
* the host reads `pose()` each frame and acts on the events (a bite shrinks the food, the end spends it). Data in `data/hand-uses.json`; a game adds its own.
|
|
918
|
+
*/
|
|
919
|
+
|
|
913
920
|
/**
|
|
914
921
|
* What happens at a key: a bite taken, a pill or a sip swallowed, the dressing pressed on, soap rubbed; a switch pressed (a flashlight), a flame struck (a lighter), a knob
|
|
915
|
-
* turned and words spoken (a radio), a key turned in its lock.
|
|
922
|
+
* turned and words spoken (a radio), a key turned in its lock. Washing: one `dose` of what the item spends taken (soap rubbed into the hands, shampoo poured in the
|
|
923
|
+
* palm, toothpaste squeezed on the brush), foam left on the key's `surface` (`lather`), the surface held under the water (`rinse`), the foam of the mouth spat out
|
|
924
|
+
* (`spit`) and the hands shaken dry (`dry`).
|
|
916
925
|
*/
|
|
917
|
-
type HandUseAction = 'bite' | 'swallow' | 'apply' | 'scrub' | 'switch' | 'ignite' | 'tune' | 'talk' | 'turn';
|
|
926
|
+
type HandUseAction = 'bite' | 'swallow' | 'apply' | 'scrub' | 'switch' | 'ignite' | 'tune' | 'talk' | 'turn' | 'dose' | 'lather' | 'rinse' | 'spit' | 'dry';
|
|
918
927
|
/**
|
|
919
|
-
* Which arms the use takes: the item to the `mouth`, both hands together in front of the body (`two_hands`), the one `hand` that holds it raised before the chest,
|
|
920
|
-
* that arm stretched out to `reach` something ahead (a lock)
|
|
928
|
+
* Which arms the use takes: the item to the `mouth`, both hands together in front of the body (`two_hands`), the one `hand` that holds it raised before the chest,
|
|
929
|
+
* that arm stretched out to `reach` something ahead (a lock), the hand that holds it going over the other forearm, the chest and the belly (`body`, soap in the
|
|
930
|
+
* shower), or both hands up rubbing the top of the head (`scalp`, shampoo).
|
|
921
931
|
*/
|
|
922
|
-
type HandUseBody = 'mouth' | 'two_hands' | 'hand' | 'reach';
|
|
932
|
+
type HandUseBody = 'mouth' | 'two_hands' | 'hand' | 'reach' | 'body' | 'scalp';
|
|
933
|
+
/** Where washing leaves foam or rinses it: the hands, the forearms, the chest and belly, the hair, the mouth, or the item itself (a toothbrush); the washing vocabulary of game-contracts. */
|
|
934
|
+
type HandUseSurface = WashSurface;
|
|
923
935
|
interface HandUseKey {
|
|
924
936
|
readonly t: number;
|
|
925
937
|
readonly position: readonly [number, number, number];
|
|
@@ -927,6 +939,8 @@ interface HandUseKey {
|
|
|
927
939
|
readonly action?: HandUseAction;
|
|
928
940
|
/** The item is at what the use reaches for at this key (a key in its lock): `aimHandUse` moves it there when the host has a target. */
|
|
929
941
|
readonly reach?: boolean;
|
|
942
|
+
/** The surface a `lather`, `rinse`, `spit` or `dry` acts on. */
|
|
943
|
+
readonly surface?: HandUseSurface;
|
|
930
944
|
}
|
|
931
945
|
interface HandUseDef {
|
|
932
946
|
readonly id: string;
|
|
@@ -939,6 +953,8 @@ interface HandUseDef {
|
|
|
939
953
|
interface HandUseEvent {
|
|
940
954
|
readonly action: HandUseAction;
|
|
941
955
|
readonly share: number;
|
|
956
|
+
/** The key's surface, when it names one. */
|
|
957
|
+
readonly surface?: HandUseSurface;
|
|
942
958
|
}
|
|
943
959
|
interface HandUsePlayer {
|
|
944
960
|
readonly def: HandUseDef;
|
|
@@ -1035,4 +1051,4 @@ declare const rinseFoam: (state: FoamState, water: FoamRinse, dt: number) => Foa
|
|
|
1035
1051
|
/** Share of a full layer still on it, 0..1. */
|
|
1036
1052
|
declare const foamLeft: (state: FoamState) => number;
|
|
1037
1053
|
|
|
1038
|
-
export { ARSENAL_CATEGORIES, type AgeOptions, type AgeState, type AmmoState, type ArsenalCaliberLike, type ArsenalItemRecord, type ArsenalItemsOptions, type ArsenalLike, type ArsenalWeaponLike, type AttackKind, BODY_SLOTS, type BagOption, type CarryEntry, type CategoryDef, type ConsumableForm, type ConsumableSpec, type ConsumableState, type ConsumableUnit, type Consumption, type ContainerDef, type CraftCheck, type CraftContext, type CraftOutcome, type CraftResult, DEFAULT_RULES, DURABILITY_KINDS, type DepletionRule, type DestructionObjectState, type DoseResult, type Durability, type DurabilityKind, FOAM_GONE, FOAM_RINSE_LITRES, type FindData, type FindStack, type FindState, type FindsProvider, type FindsProviderOptions, type FindsQuery, type FoamRinse, type FoamState, type Freshness, type FreshnessEffect, HAND_USES, HAND_USE_ARM, HAND_USE_SHOULDER, type HandUseAction, type HandUseBody, type HandUseDef, type HandUseEvent, type HandUseKey, type HandUsePlayer, ITEM_CATEGORIES, type Inventory, type InventoryFailure, type InventoryOptions, type InventoryResult, type InventorySlot, type InventoryTotals, type ItemCategory, type ItemDef, type ItemPack, type ItemRules, type ItemStack, type ItemState, type ItemsCatalog, type ItemsOptions, type LoadLevel, type LoadState, type LootTablesQuery, type NutritionResult, type PlaceDef, type PlaceTag, type PlacedFinds, type PoolEntry, type PoolPick, RARITIES, type Rarity, type RecipeDef, type RecipeInput, type RecipeMatch, type RecipeOutput, type RecipeTool, type Rng, type StorageId, type StorageRule, type StorageRules, type TakeOptions, type TakeParams, type TakeResult, type UseContext, type UseEffectDef, type UseResult, type WornPiece, addFoam, advanceAge, aimHandUse, bagOption, barScale, blockChance, canCraft, canTake, carriedKg, chargeLevel, checkItems, consumableMassKg, consumableOf, consumableProblems, craft, createFindsProvider, createHandUse, createInventory, createItems, depletionFactor, emptyFoam, failsToStart, fitsInside, foamLeft, freshness, fullConsumable, handUseOf, isSpent, itemLitres, itemsFromArsenal, loadState, maxLoadKg, moveToStorage, pieceBlock, placeFinds, remainingShare, repairPiece, resolveUse, rinseFoam, rollByCategory, rollExplicitPool, scaleCount, shelfRatio, spawnAgeDays, spawnData, storageMultiplier, takeDose, toLootTables, wearBlocked };
|
|
1054
|
+
export { ARSENAL_CATEGORIES, type AgeOptions, type AgeState, type AmmoState, type ArsenalCaliberLike, type ArsenalItemRecord, type ArsenalItemsOptions, type ArsenalLike, type ArsenalWeaponLike, type AttackKind, BODY_SLOTS, type BagOption, type CarryEntry, type CategoryDef, type ConsumableForm, type ConsumableSpec, type ConsumableState, type ConsumableUnit, type Consumption, type ContainerDef, type CraftCheck, type CraftContext, type CraftOutcome, type CraftResult, DEFAULT_RULES, DURABILITY_KINDS, type DepletionRule, type DestructionObjectState, type DoseResult, type Durability, type DurabilityKind, FOAM_GONE, FOAM_RINSE_LITRES, type FindData, type FindStack, type FindState, type FindsProvider, type FindsProviderOptions, type FindsQuery, type FoamRinse, type FoamState, type Freshness, type FreshnessEffect, HAND_USES, HAND_USE_ARM, HAND_USE_SHOULDER, type HandUseAction, type HandUseBody, type HandUseDef, type HandUseEvent, type HandUseKey, type HandUsePlayer, type HandUseSurface, ITEM_CATEGORIES, type Inventory, type InventoryFailure, type InventoryOptions, type InventoryResult, type InventorySlot, type InventoryTotals, type ItemCategory, type ItemDef, type ItemPack, type ItemRules, type ItemStack, type ItemState, type ItemsCatalog, type ItemsOptions, type LoadLevel, type LoadState, type LootTablesQuery, type NutritionResult, type PlaceDef, type PlaceTag, type PlacedFinds, type PoolEntry, type PoolPick, RARITIES, type Rarity, type RecipeDef, type RecipeInput, type RecipeMatch, type RecipeOutput, type RecipeTool, type Rng, type StorageId, type StorageRule, type StorageRules, type TakeOptions, type TakeParams, type TakeResult, type UseContext, type UseEffectDef, type UseResult, type WornPiece, addFoam, advanceAge, aimHandUse, bagOption, barScale, blockChance, canCraft, canTake, carriedKg, chargeLevel, checkItems, consumableMassKg, consumableOf, consumableProblems, craft, createFindsProvider, createHandUse, createInventory, createItems, depletionFactor, emptyFoam, failsToStart, fitsInside, foamLeft, freshness, fullConsumable, handUseOf, isSpent, itemLitres, itemsFromArsenal, loadState, maxLoadKg, moveToStorage, pieceBlock, placeFinds, remainingShare, repairPiece, resolveUse, rinseFoam, rollByCategory, rollExplicitPool, scaleCount, shelfRatio, spawnAgeDays, spawnData, storageMultiplier, takeDose, toLootTables, wearBlocked };
|