@adatechnology/game-items 0.8.0 → 0.9.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/index.js CHANGED
@@ -791,7 +791,7 @@ function createFindsProvider(catalog, options = {}) {
791
791
  }
792
792
 
793
793
  // src/finds/place-finds.ts
794
- import { fitsSize } from "@adatechnology/game-interactables";
794
+ import { fitsSize, laidSize } from "@adatechnology/game-interactables";
795
795
  var placeFinds = (stacks, slots, catalog) => {
796
796
  const contents = slots.map(() => null);
797
797
  const leftover = [];
@@ -800,7 +800,7 @@ var placeFinds = (stacks, slots, catalog) => {
800
800
  const stackMax = item.stack ?? 1;
801
801
  let remaining = stack.count;
802
802
  while (remaining > 0) {
803
- const index = slots.findIndex((slot, position) => contents[position] === null && fitsSize(item.size, slot.max));
803
+ const index = slots.findIndex((slot, position) => contents[position] === null && fitsSize(laidSize(item.size, slot.lay), slot.max));
804
804
  if (index < 0) break;
805
805
  const qty = Math.min(remaining, stackMax);
806
806
  contents[index] = { type: item.id, qty, ...stack.data ? { data: { ...stack.data } } : {} };
@@ -2373,6 +2373,849 @@ var hand_uses_default = [
2373
2373
  ]
2374
2374
  }
2375
2375
  ]
2376
+ },
2377
+ {
2378
+ id: "lather_body",
2379
+ body: "body",
2380
+ duration: 6.4,
2381
+ note: "bar soap rubbed between wet hands, then over the other forearm, the chest and the belly; foam left on each",
2382
+ keys: [
2383
+ {
2384
+ t: 0,
2385
+ position: [
2386
+ 0.22,
2387
+ -0.2,
2388
+ -0.4
2389
+ ],
2390
+ rotation: [
2391
+ 0,
2392
+ 0,
2393
+ 0
2394
+ ]
2395
+ },
2396
+ {
2397
+ t: 0.4,
2398
+ position: [
2399
+ 0.02,
2400
+ -0.22,
2401
+ -0.32
2402
+ ],
2403
+ rotation: [
2404
+ 0,
2405
+ 0,
2406
+ 1.5
2407
+ ]
2408
+ },
2409
+ {
2410
+ t: 0.7,
2411
+ position: [
2412
+ -0.04,
2413
+ -0.22,
2414
+ -0.32
2415
+ ],
2416
+ rotation: [
2417
+ 0,
2418
+ 0,
2419
+ 1.5
2420
+ ],
2421
+ action: "dose"
2422
+ },
2423
+ {
2424
+ t: 1,
2425
+ position: [
2426
+ 0.05,
2427
+ -0.22,
2428
+ -0.32
2429
+ ],
2430
+ rotation: [
2431
+ 0,
2432
+ 0,
2433
+ 1.5
2434
+ ],
2435
+ action: "lather",
2436
+ surface: "hands"
2437
+ },
2438
+ {
2439
+ t: 1.3,
2440
+ position: [
2441
+ -0.04,
2442
+ -0.22,
2443
+ -0.32
2444
+ ],
2445
+ rotation: [
2446
+ 0,
2447
+ 0,
2448
+ 1.5
2449
+ ]
2450
+ },
2451
+ {
2452
+ t: 1.75,
2453
+ position: [
2454
+ -0.2,
2455
+ -0.3,
2456
+ -0.3
2457
+ ],
2458
+ rotation: [
2459
+ 0,
2460
+ 0,
2461
+ 1.2
2462
+ ]
2463
+ },
2464
+ {
2465
+ t: 2.2,
2466
+ position: [
2467
+ -0.24,
2468
+ -0.2,
2469
+ -0.26
2470
+ ],
2471
+ rotation: [
2472
+ 0,
2473
+ 0,
2474
+ 1.2
2475
+ ],
2476
+ action: "lather",
2477
+ surface: "arms"
2478
+ },
2479
+ {
2480
+ t: 2.65,
2481
+ position: [
2482
+ -0.2,
2483
+ -0.3,
2484
+ -0.3
2485
+ ],
2486
+ rotation: [
2487
+ 0,
2488
+ 0,
2489
+ 1.2
2490
+ ]
2491
+ },
2492
+ {
2493
+ t: 3.1,
2494
+ position: [
2495
+ -0.24,
2496
+ -0.2,
2497
+ -0.26
2498
+ ],
2499
+ rotation: [
2500
+ 0,
2501
+ 0,
2502
+ 1.2
2503
+ ],
2504
+ action: "lather",
2505
+ surface: "arms"
2506
+ },
2507
+ {
2508
+ t: 3.55,
2509
+ position: [
2510
+ 0,
2511
+ -0.32,
2512
+ -0.24
2513
+ ],
2514
+ rotation: [
2515
+ 0,
2516
+ 0,
2517
+ 1.5
2518
+ ]
2519
+ },
2520
+ {
2521
+ t: 4,
2522
+ position: [
2523
+ -0.08,
2524
+ -0.34,
2525
+ -0.24
2526
+ ],
2527
+ rotation: [
2528
+ 0,
2529
+ 0,
2530
+ 1.5
2531
+ ],
2532
+ action: "lather",
2533
+ surface: "torso"
2534
+ },
2535
+ {
2536
+ t: 4.45,
2537
+ position: [
2538
+ 0.06,
2539
+ -0.32,
2540
+ -0.24
2541
+ ],
2542
+ rotation: [
2543
+ 0,
2544
+ 0,
2545
+ 1.5
2546
+ ]
2547
+ },
2548
+ {
2549
+ t: 4.9,
2550
+ position: [
2551
+ 0,
2552
+ -0.5,
2553
+ -0.26
2554
+ ],
2555
+ rotation: [
2556
+ 0,
2557
+ 0,
2558
+ 1.5
2559
+ ]
2560
+ },
2561
+ {
2562
+ t: 5.35,
2563
+ position: [
2564
+ -0.08,
2565
+ -0.52,
2566
+ -0.26
2567
+ ],
2568
+ rotation: [
2569
+ 0,
2570
+ 0,
2571
+ 1.5
2572
+ ],
2573
+ action: "lather",
2574
+ surface: "torso"
2575
+ },
2576
+ {
2577
+ t: 5.8,
2578
+ position: [
2579
+ 0.06,
2580
+ -0.5,
2581
+ -0.26
2582
+ ],
2583
+ rotation: [
2584
+ 0,
2585
+ 0,
2586
+ 1.5
2587
+ ]
2588
+ },
2589
+ {
2590
+ t: 6.4,
2591
+ position: [
2592
+ 0.22,
2593
+ -0.2,
2594
+ -0.4
2595
+ ],
2596
+ rotation: [
2597
+ 0,
2598
+ 0,
2599
+ 0
2600
+ ]
2601
+ }
2602
+ ]
2603
+ },
2604
+ {
2605
+ id: "shampoo_hair",
2606
+ body: "scalp",
2607
+ duration: 4.5,
2608
+ note: "shampoo poured from the bottle into the palm, then both hands rub the hair at the top of the head; foam left in the hair",
2609
+ keys: [
2610
+ {
2611
+ t: 0,
2612
+ position: [
2613
+ 0.22,
2614
+ -0.2,
2615
+ -0.4
2616
+ ],
2617
+ rotation: [
2618
+ 0,
2619
+ 0,
2620
+ 0
2621
+ ]
2622
+ },
2623
+ {
2624
+ t: 0.45,
2625
+ position: [
2626
+ 0.02,
2627
+ -0.16,
2628
+ -0.32
2629
+ ],
2630
+ rotation: [
2631
+ -2.4,
2632
+ 0,
2633
+ 0
2634
+ ]
2635
+ },
2636
+ {
2637
+ t: 0.8,
2638
+ position: [
2639
+ 0.02,
2640
+ -0.16,
2641
+ -0.32
2642
+ ],
2643
+ rotation: [
2644
+ -2.6,
2645
+ 0,
2646
+ 0
2647
+ ],
2648
+ action: "dose"
2649
+ },
2650
+ {
2651
+ t: 1.2,
2652
+ position: [
2653
+ 0.02,
2654
+ -0.2,
2655
+ -0.34
2656
+ ],
2657
+ rotation: [
2658
+ 0,
2659
+ 0,
2660
+ 0
2661
+ ]
2662
+ },
2663
+ {
2664
+ t: 1.65,
2665
+ position: [
2666
+ -0.05,
2667
+ 0.1,
2668
+ -0.06
2669
+ ],
2670
+ rotation: [
2671
+ 0,
2672
+ 0,
2673
+ 1.2
2674
+ ]
2675
+ },
2676
+ {
2677
+ t: 2.1,
2678
+ position: [
2679
+ 0.05,
2680
+ 0.1,
2681
+ -0.06
2682
+ ],
2683
+ rotation: [
2684
+ 0,
2685
+ 0,
2686
+ 1.2
2687
+ ],
2688
+ action: "lather",
2689
+ surface: "hair"
2690
+ },
2691
+ {
2692
+ t: 2.55,
2693
+ position: [
2694
+ -0.05,
2695
+ 0.1,
2696
+ -0.06
2697
+ ],
2698
+ rotation: [
2699
+ 0,
2700
+ 0,
2701
+ 1.2
2702
+ ]
2703
+ },
2704
+ {
2705
+ t: 3,
2706
+ position: [
2707
+ 0.05,
2708
+ 0.1,
2709
+ -0.06
2710
+ ],
2711
+ rotation: [
2712
+ 0,
2713
+ 0,
2714
+ 1.2
2715
+ ],
2716
+ action: "lather",
2717
+ surface: "hair"
2718
+ },
2719
+ {
2720
+ t: 3.45,
2721
+ position: [
2722
+ -0.05,
2723
+ 0.1,
2724
+ -0.06
2725
+ ],
2726
+ rotation: [
2727
+ 0,
2728
+ 0,
2729
+ 1.2
2730
+ ]
2731
+ },
2732
+ {
2733
+ t: 3.9,
2734
+ position: [
2735
+ 0.05,
2736
+ 0.1,
2737
+ -0.06
2738
+ ],
2739
+ rotation: [
2740
+ 0,
2741
+ 0,
2742
+ 1.2
2743
+ ],
2744
+ action: "lather",
2745
+ surface: "hair"
2746
+ },
2747
+ {
2748
+ t: 4.5,
2749
+ position: [
2750
+ 0.22,
2751
+ -0.2,
2752
+ -0.4
2753
+ ],
2754
+ rotation: [
2755
+ 0,
2756
+ 0,
2757
+ 0
2758
+ ]
2759
+ }
2760
+ ]
2761
+ },
2762
+ {
2763
+ id: "brush_teeth",
2764
+ body: "mouth",
2765
+ duration: 5.9,
2766
+ note: "toothpaste squeezed on the brush, the brush scrubbed side to side in the mouth, foam spat into the basin, the brush rinsed under the tap",
2767
+ keys: [
2768
+ {
2769
+ t: 0,
2770
+ position: [
2771
+ 0.22,
2772
+ -0.2,
2773
+ -0.4
2774
+ ],
2775
+ rotation: [
2776
+ 0,
2777
+ 0,
2778
+ 0
2779
+ ]
2780
+ },
2781
+ {
2782
+ t: 0.5,
2783
+ position: [
2784
+ 0.04,
2785
+ -0.2,
2786
+ -0.34
2787
+ ],
2788
+ rotation: [
2789
+ 0,
2790
+ 0,
2791
+ 1.5
2792
+ ]
2793
+ },
2794
+ {
2795
+ t: 0.9,
2796
+ position: [
2797
+ 0.04,
2798
+ -0.2,
2799
+ -0.34
2800
+ ],
2801
+ rotation: [
2802
+ 0,
2803
+ 0,
2804
+ 1.5
2805
+ ],
2806
+ action: "dose"
2807
+ },
2808
+ {
2809
+ t: 1.4,
2810
+ position: [
2811
+ 0.02,
2812
+ -0.06,
2813
+ -0.17
2814
+ ],
2815
+ rotation: [
2816
+ 0,
2817
+ 0,
2818
+ 1.5
2819
+ ]
2820
+ },
2821
+ {
2822
+ t: 1.7,
2823
+ position: [
2824
+ 0,
2825
+ -0.06,
2826
+ -0.17
2827
+ ],
2828
+ rotation: [
2829
+ 0,
2830
+ 0,
2831
+ 1.5
2832
+ ]
2833
+ },
2834
+ {
2835
+ t: 2,
2836
+ position: [
2837
+ 0.04,
2838
+ -0.06,
2839
+ -0.17
2840
+ ],
2841
+ rotation: [
2842
+ 0,
2843
+ 0,
2844
+ 1.5
2845
+ ],
2846
+ action: "lather",
2847
+ surface: "mouth"
2848
+ },
2849
+ {
2850
+ t: 2.3,
2851
+ position: [
2852
+ 0,
2853
+ -0.06,
2854
+ -0.17
2855
+ ],
2856
+ rotation: [
2857
+ 0,
2858
+ 0,
2859
+ 1.5
2860
+ ]
2861
+ },
2862
+ {
2863
+ t: 2.6,
2864
+ position: [
2865
+ 0.04,
2866
+ -0.06,
2867
+ -0.17
2868
+ ],
2869
+ rotation: [
2870
+ 0,
2871
+ 0,
2872
+ 1.5
2873
+ ],
2874
+ action: "lather",
2875
+ surface: "mouth"
2876
+ },
2877
+ {
2878
+ t: 2.9,
2879
+ position: [
2880
+ 0,
2881
+ -0.06,
2882
+ -0.17
2883
+ ],
2884
+ rotation: [
2885
+ 0,
2886
+ 0,
2887
+ 1.5
2888
+ ]
2889
+ },
2890
+ {
2891
+ t: 3.2,
2892
+ position: [
2893
+ 0.04,
2894
+ -0.06,
2895
+ -0.17
2896
+ ],
2897
+ rotation: [
2898
+ 0,
2899
+ 0,
2900
+ 1.5
2901
+ ],
2902
+ action: "lather",
2903
+ surface: "mouth"
2904
+ },
2905
+ {
2906
+ t: 3.5,
2907
+ position: [
2908
+ 0,
2909
+ -0.06,
2910
+ -0.17
2911
+ ],
2912
+ rotation: [
2913
+ 0,
2914
+ 0,
2915
+ 1.5
2916
+ ]
2917
+ },
2918
+ {
2919
+ t: 3.8,
2920
+ position: [
2921
+ 0.04,
2922
+ -0.06,
2923
+ -0.17
2924
+ ],
2925
+ rotation: [
2926
+ 0,
2927
+ 0,
2928
+ 1.5
2929
+ ],
2930
+ action: "lather",
2931
+ surface: "mouth"
2932
+ },
2933
+ {
2934
+ t: 4.2,
2935
+ position: [
2936
+ 0.02,
2937
+ -0.06,
2938
+ -0.2
2939
+ ],
2940
+ rotation: [
2941
+ 0,
2942
+ 0,
2943
+ 1.5
2944
+ ],
2945
+ action: "spit",
2946
+ surface: "mouth"
2947
+ },
2948
+ {
2949
+ t: 4.7,
2950
+ position: [
2951
+ 0.04,
2952
+ -0.34,
2953
+ -0.44
2954
+ ],
2955
+ rotation: [
2956
+ 0,
2957
+ 0,
2958
+ 1.5
2959
+ ]
2960
+ },
2961
+ {
2962
+ t: 5.3,
2963
+ position: [
2964
+ 0.04,
2965
+ -0.34,
2966
+ -0.44
2967
+ ],
2968
+ rotation: [
2969
+ 0,
2970
+ 0,
2971
+ 1.5
2972
+ ],
2973
+ action: "rinse",
2974
+ surface: "brush"
2975
+ },
2976
+ {
2977
+ t: 5.9,
2978
+ position: [
2979
+ 0.22,
2980
+ -0.2,
2981
+ -0.4
2982
+ ],
2983
+ rotation: [
2984
+ 0,
2985
+ 0,
2986
+ 0
2987
+ ]
2988
+ }
2989
+ ]
2990
+ },
2991
+ {
2992
+ id: "wash_hands",
2993
+ body: "two_hands",
2994
+ duration: 6.5,
2995
+ note: "hands wet under the tap, the bar rubbed between them into foam, rinsed under the water and shaken dry",
2996
+ keys: [
2997
+ {
2998
+ t: 0,
2999
+ position: [
3000
+ 0.22,
3001
+ -0.2,
3002
+ -0.4
3003
+ ],
3004
+ rotation: [
3005
+ 0,
3006
+ 0,
3007
+ 0
3008
+ ]
3009
+ },
3010
+ {
3011
+ t: 0.5,
3012
+ position: [
3013
+ 0,
3014
+ -0.34,
3015
+ -0.44
3016
+ ],
3017
+ rotation: [
3018
+ 0,
3019
+ 0,
3020
+ 1.5
3021
+ ]
3022
+ },
3023
+ {
3024
+ t: 1,
3025
+ position: [
3026
+ 0,
3027
+ -0.34,
3028
+ -0.44
3029
+ ],
3030
+ rotation: [
3031
+ 0,
3032
+ 0,
3033
+ 1.5
3034
+ ],
3035
+ action: "rinse",
3036
+ surface: "hands"
3037
+ },
3038
+ {
3039
+ t: 1.4,
3040
+ position: [
3041
+ 0.02,
3042
+ -0.26,
3043
+ -0.36
3044
+ ],
3045
+ rotation: [
3046
+ 0,
3047
+ 0,
3048
+ 1.5
3049
+ ],
3050
+ action: "dose"
3051
+ },
3052
+ {
3053
+ t: 1.7,
3054
+ position: [
3055
+ -0.04,
3056
+ -0.26,
3057
+ -0.36
3058
+ ],
3059
+ rotation: [
3060
+ 0,
3061
+ 0,
3062
+ 1.5
3063
+ ]
3064
+ },
3065
+ {
3066
+ t: 2,
3067
+ position: [
3068
+ 0.06,
3069
+ -0.26,
3070
+ -0.36
3071
+ ],
3072
+ rotation: [
3073
+ 0,
3074
+ 0,
3075
+ 1.5
3076
+ ],
3077
+ action: "lather",
3078
+ surface: "hands"
3079
+ },
3080
+ {
3081
+ t: 2.3,
3082
+ position: [
3083
+ -0.04,
3084
+ -0.26,
3085
+ -0.36
3086
+ ],
3087
+ rotation: [
3088
+ 0,
3089
+ 0,
3090
+ 1.5
3091
+ ]
3092
+ },
3093
+ {
3094
+ t: 2.6,
3095
+ position: [
3096
+ 0.06,
3097
+ -0.26,
3098
+ -0.36
3099
+ ],
3100
+ rotation: [
3101
+ 0,
3102
+ 0,
3103
+ 1.5
3104
+ ],
3105
+ action: "lather",
3106
+ surface: "hands"
3107
+ },
3108
+ {
3109
+ t: 2.9,
3110
+ position: [
3111
+ -0.04,
3112
+ -0.26,
3113
+ -0.36
3114
+ ],
3115
+ rotation: [
3116
+ 0,
3117
+ 0,
3118
+ 1.5
3119
+ ]
3120
+ },
3121
+ {
3122
+ t: 3.2,
3123
+ position: [
3124
+ 0.06,
3125
+ -0.26,
3126
+ -0.36
3127
+ ],
3128
+ rotation: [
3129
+ 0,
3130
+ 0,
3131
+ 1.5
3132
+ ],
3133
+ action: "lather",
3134
+ surface: "hands"
3135
+ },
3136
+ {
3137
+ t: 3.7,
3138
+ position: [
3139
+ 0,
3140
+ -0.34,
3141
+ -0.44
3142
+ ],
3143
+ rotation: [
3144
+ 0,
3145
+ 0,
3146
+ 1.5
3147
+ ]
3148
+ },
3149
+ {
3150
+ t: 4.6,
3151
+ position: [
3152
+ 0.04,
3153
+ -0.34,
3154
+ -0.44
3155
+ ],
3156
+ rotation: [
3157
+ 0,
3158
+ 0,
3159
+ 1.5
3160
+ ],
3161
+ action: "rinse",
3162
+ surface: "hands"
3163
+ },
3164
+ {
3165
+ t: 5.1,
3166
+ position: [
3167
+ 0.04,
3168
+ -0.24,
3169
+ -0.36
3170
+ ],
3171
+ rotation: [
3172
+ 0,
3173
+ 0,
3174
+ 1.5
3175
+ ]
3176
+ },
3177
+ {
3178
+ t: 5.5,
3179
+ position: [
3180
+ -0.02,
3181
+ -0.24,
3182
+ -0.36
3183
+ ],
3184
+ rotation: [
3185
+ 0,
3186
+ 0,
3187
+ 1.5
3188
+ ],
3189
+ action: "dry",
3190
+ surface: "hands"
3191
+ },
3192
+ {
3193
+ t: 5.9,
3194
+ position: [
3195
+ 0.04,
3196
+ -0.24,
3197
+ -0.36
3198
+ ],
3199
+ rotation: [
3200
+ 0,
3201
+ 0,
3202
+ 1.5
3203
+ ]
3204
+ },
3205
+ {
3206
+ t: 6.5,
3207
+ position: [
3208
+ 0.22,
3209
+ -0.2,
3210
+ -0.4
3211
+ ],
3212
+ rotation: [
3213
+ 0,
3214
+ 0,
3215
+ 0
3216
+ ]
3217
+ }
3218
+ ]
2376
3219
  }
2377
3220
  ];
2378
3221
 
@@ -2428,7 +3271,8 @@ var createHandUse = (def) => {
2428
3271
  const events = [];
2429
3272
  while (reached < actions.length && actions[reached].t <= time) {
2430
3273
  reached++;
2431
- events.push({ action: actions[reached - 1].action, share: reached / actions.length });
3274
+ const key = actions[reached - 1];
3275
+ events.push({ action: key.action, share: reached / actions.length, ...key.surface ? { surface: key.surface } : {} });
2432
3276
  }
2433
3277
  done = time >= def.duration;
2434
3278
  return events;