@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.
@@ -127,6 +127,8 @@ var GameItems = (() => {
127
127
  };
128
128
  var MUST_DRAIN_QUEUE_IDS = /* @__PURE__ */ new Set([DEFERRED_QUEUE_ID.DESTRUCTION_EVENTS, DEFERRED_QUEUE_ID.BREACH_CUT]);
129
129
  var ITEM_TOOLS = ["plunger"];
130
+ var BODY_FOAM_SURFACES = ["hands", "arms", "torso", "hair", "mouth"];
131
+ var WASH_SURFACES = [...BODY_FOAM_SURFACES, "brush"];
130
132
  var WARNED_KEY = /* @__PURE__ */ Symbol.for("@adatechnology/game-contracts.warned");
131
133
  var warnedKeys = () => {
132
134
  const holder = globalThis;
@@ -1019,6 +1021,11 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
1019
1021
  if (size[1] > max[1] + eps) return false;
1020
1022
  return size[0] <= max[0] + eps && size[2] <= max[2] + eps || size[2] <= max[0] + eps && size[0] <= max[2] + eps;
1021
1023
  }
1024
+ function laidSize(size, lay) {
1025
+ if (lay === "x") return [size[1], size[0], size[2]];
1026
+ if (lay === "z") return [size[0], size[2], size[1]];
1027
+ return size;
1028
+ }
1022
1029
  var pose = new Float64Array(7);
1023
1030
  var pose2 = new Float64Array(7);
1024
1031
 
@@ -1031,7 +1038,7 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
1031
1038
  const stackMax = item.stack ?? 1;
1032
1039
  let remaining = stack.count;
1033
1040
  while (remaining > 0) {
1034
- const index = slots.findIndex((slot, position) => contents[position] === null && fitsSize(item.size, slot.max));
1041
+ const index = slots.findIndex((slot, position) => contents[position] === null && fitsSize(laidSize(item.size, slot.lay), slot.max));
1035
1042
  if (index < 0) break;
1036
1043
  const qty = Math.min(remaining, stackMax);
1037
1044
  contents[index] = { type: item.id, qty, ...stack.data ? { data: { ...stack.data } } : {} };
@@ -2604,6 +2611,849 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
2604
2611
  ]
2605
2612
  }
2606
2613
  ]
2614
+ },
2615
+ {
2616
+ id: "lather_body",
2617
+ body: "body",
2618
+ duration: 6.4,
2619
+ note: "bar soap rubbed between wet hands, then over the other forearm, the chest and the belly; foam left on each",
2620
+ keys: [
2621
+ {
2622
+ t: 0,
2623
+ position: [
2624
+ 0.22,
2625
+ -0.2,
2626
+ -0.4
2627
+ ],
2628
+ rotation: [
2629
+ 0,
2630
+ 0,
2631
+ 0
2632
+ ]
2633
+ },
2634
+ {
2635
+ t: 0.4,
2636
+ position: [
2637
+ 0.02,
2638
+ -0.22,
2639
+ -0.32
2640
+ ],
2641
+ rotation: [
2642
+ 0,
2643
+ 0,
2644
+ 1.5
2645
+ ]
2646
+ },
2647
+ {
2648
+ t: 0.7,
2649
+ position: [
2650
+ -0.04,
2651
+ -0.22,
2652
+ -0.32
2653
+ ],
2654
+ rotation: [
2655
+ 0,
2656
+ 0,
2657
+ 1.5
2658
+ ],
2659
+ action: "dose"
2660
+ },
2661
+ {
2662
+ t: 1,
2663
+ position: [
2664
+ 0.05,
2665
+ -0.22,
2666
+ -0.32
2667
+ ],
2668
+ rotation: [
2669
+ 0,
2670
+ 0,
2671
+ 1.5
2672
+ ],
2673
+ action: "lather",
2674
+ surface: "hands"
2675
+ },
2676
+ {
2677
+ t: 1.3,
2678
+ position: [
2679
+ -0.04,
2680
+ -0.22,
2681
+ -0.32
2682
+ ],
2683
+ rotation: [
2684
+ 0,
2685
+ 0,
2686
+ 1.5
2687
+ ]
2688
+ },
2689
+ {
2690
+ t: 1.75,
2691
+ position: [
2692
+ -0.2,
2693
+ -0.3,
2694
+ -0.3
2695
+ ],
2696
+ rotation: [
2697
+ 0,
2698
+ 0,
2699
+ 1.2
2700
+ ]
2701
+ },
2702
+ {
2703
+ t: 2.2,
2704
+ position: [
2705
+ -0.24,
2706
+ -0.2,
2707
+ -0.26
2708
+ ],
2709
+ rotation: [
2710
+ 0,
2711
+ 0,
2712
+ 1.2
2713
+ ],
2714
+ action: "lather",
2715
+ surface: "arms"
2716
+ },
2717
+ {
2718
+ t: 2.65,
2719
+ position: [
2720
+ -0.2,
2721
+ -0.3,
2722
+ -0.3
2723
+ ],
2724
+ rotation: [
2725
+ 0,
2726
+ 0,
2727
+ 1.2
2728
+ ]
2729
+ },
2730
+ {
2731
+ t: 3.1,
2732
+ position: [
2733
+ -0.24,
2734
+ -0.2,
2735
+ -0.26
2736
+ ],
2737
+ rotation: [
2738
+ 0,
2739
+ 0,
2740
+ 1.2
2741
+ ],
2742
+ action: "lather",
2743
+ surface: "arms"
2744
+ },
2745
+ {
2746
+ t: 3.55,
2747
+ position: [
2748
+ 0,
2749
+ -0.32,
2750
+ -0.24
2751
+ ],
2752
+ rotation: [
2753
+ 0,
2754
+ 0,
2755
+ 1.5
2756
+ ]
2757
+ },
2758
+ {
2759
+ t: 4,
2760
+ position: [
2761
+ -0.08,
2762
+ -0.34,
2763
+ -0.24
2764
+ ],
2765
+ rotation: [
2766
+ 0,
2767
+ 0,
2768
+ 1.5
2769
+ ],
2770
+ action: "lather",
2771
+ surface: "torso"
2772
+ },
2773
+ {
2774
+ t: 4.45,
2775
+ position: [
2776
+ 0.06,
2777
+ -0.32,
2778
+ -0.24
2779
+ ],
2780
+ rotation: [
2781
+ 0,
2782
+ 0,
2783
+ 1.5
2784
+ ]
2785
+ },
2786
+ {
2787
+ t: 4.9,
2788
+ position: [
2789
+ 0,
2790
+ -0.5,
2791
+ -0.26
2792
+ ],
2793
+ rotation: [
2794
+ 0,
2795
+ 0,
2796
+ 1.5
2797
+ ]
2798
+ },
2799
+ {
2800
+ t: 5.35,
2801
+ position: [
2802
+ -0.08,
2803
+ -0.52,
2804
+ -0.26
2805
+ ],
2806
+ rotation: [
2807
+ 0,
2808
+ 0,
2809
+ 1.5
2810
+ ],
2811
+ action: "lather",
2812
+ surface: "torso"
2813
+ },
2814
+ {
2815
+ t: 5.8,
2816
+ position: [
2817
+ 0.06,
2818
+ -0.5,
2819
+ -0.26
2820
+ ],
2821
+ rotation: [
2822
+ 0,
2823
+ 0,
2824
+ 1.5
2825
+ ]
2826
+ },
2827
+ {
2828
+ t: 6.4,
2829
+ position: [
2830
+ 0.22,
2831
+ -0.2,
2832
+ -0.4
2833
+ ],
2834
+ rotation: [
2835
+ 0,
2836
+ 0,
2837
+ 0
2838
+ ]
2839
+ }
2840
+ ]
2841
+ },
2842
+ {
2843
+ id: "shampoo_hair",
2844
+ body: "scalp",
2845
+ duration: 4.5,
2846
+ 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",
2847
+ keys: [
2848
+ {
2849
+ t: 0,
2850
+ position: [
2851
+ 0.22,
2852
+ -0.2,
2853
+ -0.4
2854
+ ],
2855
+ rotation: [
2856
+ 0,
2857
+ 0,
2858
+ 0
2859
+ ]
2860
+ },
2861
+ {
2862
+ t: 0.45,
2863
+ position: [
2864
+ 0.02,
2865
+ -0.16,
2866
+ -0.32
2867
+ ],
2868
+ rotation: [
2869
+ -2.4,
2870
+ 0,
2871
+ 0
2872
+ ]
2873
+ },
2874
+ {
2875
+ t: 0.8,
2876
+ position: [
2877
+ 0.02,
2878
+ -0.16,
2879
+ -0.32
2880
+ ],
2881
+ rotation: [
2882
+ -2.6,
2883
+ 0,
2884
+ 0
2885
+ ],
2886
+ action: "dose"
2887
+ },
2888
+ {
2889
+ t: 1.2,
2890
+ position: [
2891
+ 0.02,
2892
+ -0.2,
2893
+ -0.34
2894
+ ],
2895
+ rotation: [
2896
+ 0,
2897
+ 0,
2898
+ 0
2899
+ ]
2900
+ },
2901
+ {
2902
+ t: 1.65,
2903
+ position: [
2904
+ -0.05,
2905
+ 0.1,
2906
+ -0.06
2907
+ ],
2908
+ rotation: [
2909
+ 0,
2910
+ 0,
2911
+ 1.2
2912
+ ]
2913
+ },
2914
+ {
2915
+ t: 2.1,
2916
+ position: [
2917
+ 0.05,
2918
+ 0.1,
2919
+ -0.06
2920
+ ],
2921
+ rotation: [
2922
+ 0,
2923
+ 0,
2924
+ 1.2
2925
+ ],
2926
+ action: "lather",
2927
+ surface: "hair"
2928
+ },
2929
+ {
2930
+ t: 2.55,
2931
+ position: [
2932
+ -0.05,
2933
+ 0.1,
2934
+ -0.06
2935
+ ],
2936
+ rotation: [
2937
+ 0,
2938
+ 0,
2939
+ 1.2
2940
+ ]
2941
+ },
2942
+ {
2943
+ t: 3,
2944
+ position: [
2945
+ 0.05,
2946
+ 0.1,
2947
+ -0.06
2948
+ ],
2949
+ rotation: [
2950
+ 0,
2951
+ 0,
2952
+ 1.2
2953
+ ],
2954
+ action: "lather",
2955
+ surface: "hair"
2956
+ },
2957
+ {
2958
+ t: 3.45,
2959
+ position: [
2960
+ -0.05,
2961
+ 0.1,
2962
+ -0.06
2963
+ ],
2964
+ rotation: [
2965
+ 0,
2966
+ 0,
2967
+ 1.2
2968
+ ]
2969
+ },
2970
+ {
2971
+ t: 3.9,
2972
+ position: [
2973
+ 0.05,
2974
+ 0.1,
2975
+ -0.06
2976
+ ],
2977
+ rotation: [
2978
+ 0,
2979
+ 0,
2980
+ 1.2
2981
+ ],
2982
+ action: "lather",
2983
+ surface: "hair"
2984
+ },
2985
+ {
2986
+ t: 4.5,
2987
+ position: [
2988
+ 0.22,
2989
+ -0.2,
2990
+ -0.4
2991
+ ],
2992
+ rotation: [
2993
+ 0,
2994
+ 0,
2995
+ 0
2996
+ ]
2997
+ }
2998
+ ]
2999
+ },
3000
+ {
3001
+ id: "brush_teeth",
3002
+ body: "mouth",
3003
+ duration: 5.9,
3004
+ 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",
3005
+ keys: [
3006
+ {
3007
+ t: 0,
3008
+ position: [
3009
+ 0.22,
3010
+ -0.2,
3011
+ -0.4
3012
+ ],
3013
+ rotation: [
3014
+ 0,
3015
+ 0,
3016
+ 0
3017
+ ]
3018
+ },
3019
+ {
3020
+ t: 0.5,
3021
+ position: [
3022
+ 0.04,
3023
+ -0.2,
3024
+ -0.34
3025
+ ],
3026
+ rotation: [
3027
+ 0,
3028
+ 0,
3029
+ 1.5
3030
+ ]
3031
+ },
3032
+ {
3033
+ t: 0.9,
3034
+ position: [
3035
+ 0.04,
3036
+ -0.2,
3037
+ -0.34
3038
+ ],
3039
+ rotation: [
3040
+ 0,
3041
+ 0,
3042
+ 1.5
3043
+ ],
3044
+ action: "dose"
3045
+ },
3046
+ {
3047
+ t: 1.4,
3048
+ position: [
3049
+ 0.02,
3050
+ -0.06,
3051
+ -0.17
3052
+ ],
3053
+ rotation: [
3054
+ 0,
3055
+ 0,
3056
+ 1.5
3057
+ ]
3058
+ },
3059
+ {
3060
+ t: 1.7,
3061
+ position: [
3062
+ 0,
3063
+ -0.06,
3064
+ -0.17
3065
+ ],
3066
+ rotation: [
3067
+ 0,
3068
+ 0,
3069
+ 1.5
3070
+ ]
3071
+ },
3072
+ {
3073
+ t: 2,
3074
+ position: [
3075
+ 0.04,
3076
+ -0.06,
3077
+ -0.17
3078
+ ],
3079
+ rotation: [
3080
+ 0,
3081
+ 0,
3082
+ 1.5
3083
+ ],
3084
+ action: "lather",
3085
+ surface: "mouth"
3086
+ },
3087
+ {
3088
+ t: 2.3,
3089
+ position: [
3090
+ 0,
3091
+ -0.06,
3092
+ -0.17
3093
+ ],
3094
+ rotation: [
3095
+ 0,
3096
+ 0,
3097
+ 1.5
3098
+ ]
3099
+ },
3100
+ {
3101
+ t: 2.6,
3102
+ position: [
3103
+ 0.04,
3104
+ -0.06,
3105
+ -0.17
3106
+ ],
3107
+ rotation: [
3108
+ 0,
3109
+ 0,
3110
+ 1.5
3111
+ ],
3112
+ action: "lather",
3113
+ surface: "mouth"
3114
+ },
3115
+ {
3116
+ t: 2.9,
3117
+ position: [
3118
+ 0,
3119
+ -0.06,
3120
+ -0.17
3121
+ ],
3122
+ rotation: [
3123
+ 0,
3124
+ 0,
3125
+ 1.5
3126
+ ]
3127
+ },
3128
+ {
3129
+ t: 3.2,
3130
+ position: [
3131
+ 0.04,
3132
+ -0.06,
3133
+ -0.17
3134
+ ],
3135
+ rotation: [
3136
+ 0,
3137
+ 0,
3138
+ 1.5
3139
+ ],
3140
+ action: "lather",
3141
+ surface: "mouth"
3142
+ },
3143
+ {
3144
+ t: 3.5,
3145
+ position: [
3146
+ 0,
3147
+ -0.06,
3148
+ -0.17
3149
+ ],
3150
+ rotation: [
3151
+ 0,
3152
+ 0,
3153
+ 1.5
3154
+ ]
3155
+ },
3156
+ {
3157
+ t: 3.8,
3158
+ position: [
3159
+ 0.04,
3160
+ -0.06,
3161
+ -0.17
3162
+ ],
3163
+ rotation: [
3164
+ 0,
3165
+ 0,
3166
+ 1.5
3167
+ ],
3168
+ action: "lather",
3169
+ surface: "mouth"
3170
+ },
3171
+ {
3172
+ t: 4.2,
3173
+ position: [
3174
+ 0.02,
3175
+ -0.06,
3176
+ -0.2
3177
+ ],
3178
+ rotation: [
3179
+ 0,
3180
+ 0,
3181
+ 1.5
3182
+ ],
3183
+ action: "spit",
3184
+ surface: "mouth"
3185
+ },
3186
+ {
3187
+ t: 4.7,
3188
+ position: [
3189
+ 0.04,
3190
+ -0.34,
3191
+ -0.44
3192
+ ],
3193
+ rotation: [
3194
+ 0,
3195
+ 0,
3196
+ 1.5
3197
+ ]
3198
+ },
3199
+ {
3200
+ t: 5.3,
3201
+ position: [
3202
+ 0.04,
3203
+ -0.34,
3204
+ -0.44
3205
+ ],
3206
+ rotation: [
3207
+ 0,
3208
+ 0,
3209
+ 1.5
3210
+ ],
3211
+ action: "rinse",
3212
+ surface: "brush"
3213
+ },
3214
+ {
3215
+ t: 5.9,
3216
+ position: [
3217
+ 0.22,
3218
+ -0.2,
3219
+ -0.4
3220
+ ],
3221
+ rotation: [
3222
+ 0,
3223
+ 0,
3224
+ 0
3225
+ ]
3226
+ }
3227
+ ]
3228
+ },
3229
+ {
3230
+ id: "wash_hands",
3231
+ body: "two_hands",
3232
+ duration: 6.5,
3233
+ note: "hands wet under the tap, the bar rubbed between them into foam, rinsed under the water and shaken dry",
3234
+ keys: [
3235
+ {
3236
+ t: 0,
3237
+ position: [
3238
+ 0.22,
3239
+ -0.2,
3240
+ -0.4
3241
+ ],
3242
+ rotation: [
3243
+ 0,
3244
+ 0,
3245
+ 0
3246
+ ]
3247
+ },
3248
+ {
3249
+ t: 0.5,
3250
+ position: [
3251
+ 0,
3252
+ -0.34,
3253
+ -0.44
3254
+ ],
3255
+ rotation: [
3256
+ 0,
3257
+ 0,
3258
+ 1.5
3259
+ ]
3260
+ },
3261
+ {
3262
+ t: 1,
3263
+ position: [
3264
+ 0,
3265
+ -0.34,
3266
+ -0.44
3267
+ ],
3268
+ rotation: [
3269
+ 0,
3270
+ 0,
3271
+ 1.5
3272
+ ],
3273
+ action: "rinse",
3274
+ surface: "hands"
3275
+ },
3276
+ {
3277
+ t: 1.4,
3278
+ position: [
3279
+ 0.02,
3280
+ -0.26,
3281
+ -0.36
3282
+ ],
3283
+ rotation: [
3284
+ 0,
3285
+ 0,
3286
+ 1.5
3287
+ ],
3288
+ action: "dose"
3289
+ },
3290
+ {
3291
+ t: 1.7,
3292
+ position: [
3293
+ -0.04,
3294
+ -0.26,
3295
+ -0.36
3296
+ ],
3297
+ rotation: [
3298
+ 0,
3299
+ 0,
3300
+ 1.5
3301
+ ]
3302
+ },
3303
+ {
3304
+ t: 2,
3305
+ position: [
3306
+ 0.06,
3307
+ -0.26,
3308
+ -0.36
3309
+ ],
3310
+ rotation: [
3311
+ 0,
3312
+ 0,
3313
+ 1.5
3314
+ ],
3315
+ action: "lather",
3316
+ surface: "hands"
3317
+ },
3318
+ {
3319
+ t: 2.3,
3320
+ position: [
3321
+ -0.04,
3322
+ -0.26,
3323
+ -0.36
3324
+ ],
3325
+ rotation: [
3326
+ 0,
3327
+ 0,
3328
+ 1.5
3329
+ ]
3330
+ },
3331
+ {
3332
+ t: 2.6,
3333
+ position: [
3334
+ 0.06,
3335
+ -0.26,
3336
+ -0.36
3337
+ ],
3338
+ rotation: [
3339
+ 0,
3340
+ 0,
3341
+ 1.5
3342
+ ],
3343
+ action: "lather",
3344
+ surface: "hands"
3345
+ },
3346
+ {
3347
+ t: 2.9,
3348
+ position: [
3349
+ -0.04,
3350
+ -0.26,
3351
+ -0.36
3352
+ ],
3353
+ rotation: [
3354
+ 0,
3355
+ 0,
3356
+ 1.5
3357
+ ]
3358
+ },
3359
+ {
3360
+ t: 3.2,
3361
+ position: [
3362
+ 0.06,
3363
+ -0.26,
3364
+ -0.36
3365
+ ],
3366
+ rotation: [
3367
+ 0,
3368
+ 0,
3369
+ 1.5
3370
+ ],
3371
+ action: "lather",
3372
+ surface: "hands"
3373
+ },
3374
+ {
3375
+ t: 3.7,
3376
+ position: [
3377
+ 0,
3378
+ -0.34,
3379
+ -0.44
3380
+ ],
3381
+ rotation: [
3382
+ 0,
3383
+ 0,
3384
+ 1.5
3385
+ ]
3386
+ },
3387
+ {
3388
+ t: 4.6,
3389
+ position: [
3390
+ 0.04,
3391
+ -0.34,
3392
+ -0.44
3393
+ ],
3394
+ rotation: [
3395
+ 0,
3396
+ 0,
3397
+ 1.5
3398
+ ],
3399
+ action: "rinse",
3400
+ surface: "hands"
3401
+ },
3402
+ {
3403
+ t: 5.1,
3404
+ position: [
3405
+ 0.04,
3406
+ -0.24,
3407
+ -0.36
3408
+ ],
3409
+ rotation: [
3410
+ 0,
3411
+ 0,
3412
+ 1.5
3413
+ ]
3414
+ },
3415
+ {
3416
+ t: 5.5,
3417
+ position: [
3418
+ -0.02,
3419
+ -0.24,
3420
+ -0.36
3421
+ ],
3422
+ rotation: [
3423
+ 0,
3424
+ 0,
3425
+ 1.5
3426
+ ],
3427
+ action: "dry",
3428
+ surface: "hands"
3429
+ },
3430
+ {
3431
+ t: 5.9,
3432
+ position: [
3433
+ 0.04,
3434
+ -0.24,
3435
+ -0.36
3436
+ ],
3437
+ rotation: [
3438
+ 0,
3439
+ 0,
3440
+ 1.5
3441
+ ]
3442
+ },
3443
+ {
3444
+ t: 6.5,
3445
+ position: [
3446
+ 0.22,
3447
+ -0.2,
3448
+ -0.4
3449
+ ],
3450
+ rotation: [
3451
+ 0,
3452
+ 0,
3453
+ 0
3454
+ ]
3455
+ }
3456
+ ]
2607
3457
  }
2608
3458
  ];
2609
3459
 
@@ -2659,7 +3509,8 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
2659
3509
  const events = [];
2660
3510
  while (reached < actions.length && actions[reached].t <= time) {
2661
3511
  reached++;
2662
- events.push({ action: actions[reached - 1].action, share: reached / actions.length });
3512
+ const key = actions[reached - 1];
3513
+ events.push({ action: key.action, share: reached / actions.length, ...key.surface ? { surface: key.surface } : {} });
2663
3514
  }
2664
3515
  done = time >= def.duration;
2665
3516
  return events;