@adatechnology/game-destruction 0.1.1 → 0.2.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.
@@ -1456,6 +1456,8 @@ var GameDestruction = (() => {
1456
1456
  var DMG_PER_J = 0.02;
1457
1457
  var BLAST_COUPLING = 0.1;
1458
1458
  var FLAMMABLE_FLUIDS = ["gas", "fuel"];
1459
+ var CUT_SLICE = 1;
1460
+ var cutFactorOf = (shape) => clamp2(Math.max(...shapeDims(shape)) / CUT_SLICE, 1, 50);
1459
1461
  var clamp2 = (v, a, b) => Math.max(a, Math.min(b, v));
1460
1462
  var isLost = (p) => p.st.status === "broken" || p.st.status === "melted" || p.st.status === "ashes";
1461
1463
  var clone = (v) => structuredClone(v);
@@ -1608,6 +1610,7 @@ var GameDestruction = (() => {
1608
1610
  fuel0,
1609
1611
  area: shapeArea(ps.shape),
1610
1612
  thickness: partThickness(ps),
1613
+ cutFactor: cutFactorOf(ps.shape),
1611
1614
  dims: shapeDims(ps.shape),
1612
1615
  bound: shapeBound(ps.shape),
1613
1616
  rt: c?.rt ?? { ...freshRuntime(), prevTemp: pst.temperature },
@@ -2129,7 +2132,7 @@ var GameDestruction = (() => {
2129
2132
  if (kind === "blunt") wearJoints(o, p, E * 0.3, void 0, 0, src);
2130
2133
  else wearJoints(o, p, E * 0.3, point, 0.06, src);
2131
2134
  const scale = mat.damageScale?.[kind] ?? 1;
2132
- return applyDamage(o, p, Ec * DMG_PER_J * scale, kind, point, d, E * 0.1, 12, src);
2135
+ return applyDamage(o, p, Ec * DMG_PER_J * scale * (kind === "slash" ? p.cutFactor : 1), kind, point, d, E * 0.1, 12, src);
2133
2136
  };
2134
2137
  const blastObject = (o, point, energy, radius, src) => {
2135
2138
  const start = cur.length;