@adatechnology/game-weapons 0.14.0 → 0.15.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.js CHANGED
@@ -16682,15 +16682,30 @@ var melee_families_default = {
16682
16682
  reset: 1.2
16683
16683
  },
16684
16684
  {
16685
- id: "two_hand_swing",
16686
- note: "a long weapon in both hands (bat, pipe, crowbar, axe, sledgehammer, katana): swung flat from the right shoulder across the body, the hips leading, as the shovel's swing",
16685
+ id: "bat_swing",
16686
+ note: "a club in both hands (bat, pipe, crowbar, sledgehammer): drawn back behind the right shoulder, swung level through the chest with the hips and shoulders turning, and carried round over the left shoulder (follow-through)",
16687
16687
  weapons: [
16688
16688
  "baseball_bat",
16689
16689
  "nail_bat",
16690
16690
  "iron_pipe",
16691
16691
  "crowbar",
16692
+ "sledgehammer"
16693
+ ],
16694
+ blows: [
16695
+ {
16696
+ clip: "bat_swing",
16697
+ motion: "bat_swing",
16698
+ seconds: 0.7
16699
+ }
16700
+ ],
16701
+ reset: 1.2,
16702
+ contactLength: 0.3
16703
+ },
16704
+ {
16705
+ id: "two_hand_swing",
16706
+ note: "a long weapon in both hands with its weight at the head or an edge (axe, pickaxe, katana): swung flat and low from the right shoulder across the body, the hips leading, as the shovel's swing",
16707
+ weapons: [
16692
16708
  "axe",
16693
- "sledgehammer",
16694
16709
  "pickaxe",
16695
16710
  "katana"
16696
16711
  ],
@@ -16723,6 +16738,22 @@ var createMeleeBlowCycle = (families = MELEE_FAMILIES) => {
16723
16738
  }
16724
16739
  };
16725
16740
  };
16741
+ var MOTION_SWEEPS = {
16742
+ slash: { right: -0.7, up: -0.7 },
16743
+ chop: { right: -0.15, up: -1 },
16744
+ bat_swing: { right: -1, up: 0 },
16745
+ swing: { right: -0.95, up: -0.3 }
16746
+ };
16747
+ var sweepOf = (motion, forward) => {
16748
+ const share = motion ? MOTION_SWEEPS[motion] : void 0;
16749
+ if (!share) return void 0;
16750
+ const right = [-forward[2], 0, forward[0]];
16751
+ const flat = Math.hypot(right[0], right[2]);
16752
+ if (flat < 1e-6) return void 0;
16753
+ const v = [right[0] / flat * share.right, share.up, right[2] / flat * share.right];
16754
+ const length2 = Math.hypot(v[0], v[1], v[2]);
16755
+ return [v[0] / length2, v[1] / length2, v[2] / length2];
16756
+ };
16726
16757
  export {
16727
16758
  AMMO,
16728
16759
  ARCHETYPE_IDS,
@@ -16734,6 +16765,7 @@ export {
16734
16765
  ExplosiveBody,
16735
16766
  GALLERY_HEAT,
16736
16767
  MELEE_FAMILIES,
16768
+ MOTION_SWEEPS,
16737
16769
  MUZZLE_SMOKE,
16738
16770
  RELOAD_STAGES,
16739
16771
  SLING_SWING_DEFAULTS,
@@ -16771,6 +16803,7 @@ export {
16771
16803
  roundsToWarningOf,
16772
16804
  sampleFuse,
16773
16805
  sweepGround,
16806
+ sweepOf,
16774
16807
  tripwireSegment,
16775
16808
  weaponHandsOf,
16776
16809
  weaponMenu