removed unused processesseessess
This commit is contained in:
parent
348f355eb2
commit
4fdc567e08
158 changed files with 1317 additions and 3351 deletions
|
|
@ -6,7 +6,7 @@
|
|||
// behavior. Prototype methods delegate here.
|
||||
(function (global) {
|
||||
function isPin(item) {
|
||||
return Boolean(global.TarinaiPinAttachmentSystem?.isPin?.(item) || (item && typeof global.isPinType === "function" && global.isPinType(item.type)));
|
||||
return Boolean(global.TarinaiPinAttachmentSystem.isPin(item) || (item && typeof global.isPinType === "function" && global.isPinType(item.type)));
|
||||
}
|
||||
|
||||
function ballById(worldRef, id) {
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
detach(item, worldRef, "ball-lost");
|
||||
return;
|
||||
}
|
||||
if (global.TarinaiPinAttachmentSystem?.applyBallPose?.(item, ball, worldRef)) return;
|
||||
if (global.TarinaiPinAttachmentSystem.applyBallPose(item, ball, worldRef)) return;
|
||||
const angle = (ball.spin || 0) + (item.pinBallOffsetAngle || 0);
|
||||
const distance = Math.max(4, Number(item.pinBallOffsetDistance || (ball.r || 18) * 0.55) || (ball.r || 18) * 0.55);
|
||||
item.prevX = item.x;
|
||||
|
|
@ -134,9 +134,9 @@
|
|||
updateBallLodged(item, dt, worldRef);
|
||||
return true;
|
||||
}
|
||||
if (global.TarinaiPhysics?.applyKinematicItemMotion) {
|
||||
if (global.TarinaiPhysics.applyKinematicItemMotion) {
|
||||
global.TarinaiPhysics.applyKinematicItemMotion(item, worldRef, dt, { padding: 26, bounce: 0.44, spinBounce: -0.68, frictionBase: 0.18, frictionRate: 0.85, spinFrictionBase: 0.38, spinRestDamp: 0.08, stopSpeed: 0.05, zeroBelow: 7.5 });
|
||||
global.TarinaiItemDynamicBallSystem?.resolveObstacleCollisions?.(item, dt, worldRef);
|
||||
global.TarinaiItemDynamicBallSystem.resolveObstacleCollisions(item, dt, worldRef);
|
||||
} else {
|
||||
item.prevX = item.x;
|
||||
item.prevY = item.y;
|
||||
|
|
@ -168,7 +168,7 @@
|
|||
}
|
||||
|
||||
function oshibyoAnchorFor(t, visualSide, item = { type: "oshibyo" }) {
|
||||
return global.TarinaiPinAttachmentSystem?.tarinaiAnchor?.(item, t, { visualSide }) || {
|
||||
return global.TarinaiPinAttachmentSystem.tarinaiAnchor(item, t, { visualSide }) || {
|
||||
x: t.x + visualSide * (t?.radius || 16) * 0.96,
|
||||
y: t.y + (t?.radius || 16) * 0.50,
|
||||
angle: visualSide * 0.48,
|
||||
|
|
@ -181,7 +181,7 @@
|
|||
function attach(item, t, worldRef, d = null) {
|
||||
if (!t || t.dead) return false;
|
||||
if (t.stuckPushpinId && t.stuckPushpinId !== item.id) return false;
|
||||
const behavior = typeof pinBehaviorFor === "function" ? pinBehaviorFor(item.type) : null;
|
||||
const behavior = pinBehaviorFor(item.type);
|
||||
const isOshibyo = Boolean(behavior?.blocksZunchi);
|
||||
const dx = item.x - t.x;
|
||||
const dy = item.y - t.y;
|
||||
|
|
@ -190,7 +190,7 @@
|
|||
item.deletable = false;
|
||||
item.pinTargetId = t.id;
|
||||
removeFromBall(item, worldRef);
|
||||
const sharedAnchor = global.TarinaiPinAttachmentSystem?.tarinaiAnchor?.(item, t, { dx, dy, distance: distToTarget });
|
||||
const sharedAnchor = global.TarinaiPinAttachmentSystem.tarinaiAnchor(item, t, { dx, dy, distance: distToTarget });
|
||||
const faceDir = t.facingDir ? t.facingDir() : (t.facing || 1);
|
||||
const faceSide = faceDir >= 0 ? 1 : -1;
|
||||
const visualSide = sharedAnchor?.visualSide ?? (isOshibyo ? -faceSide : faceSide);
|
||||
|
|
@ -238,11 +238,11 @@
|
|||
detach(item, worldRef, "owner-lost");
|
||||
return;
|
||||
}
|
||||
const behavior = typeof pinBehaviorFor === "function" ? pinBehaviorFor(item.type) : null;
|
||||
const behavior = pinBehaviorFor(item.type);
|
||||
const isOshibyo = Boolean(behavior?.blocksZunchi);
|
||||
t.stuckPushpinId = item.id;
|
||||
item.deletable = false;
|
||||
const sharedPose = global.TarinaiPinAttachmentSystem?.applyTarinaiPose?.(item, t, worldRef);
|
||||
const sharedPose = global.TarinaiPinAttachmentSystem.applyTarinaiPose(item, t, worldRef);
|
||||
if (!sharedPose) {
|
||||
const faceDir = t.facingDir ? t.facingDir() : (t.facing || 1);
|
||||
const faceSide = faceDir >= 0 ? 1 : -1;
|
||||
|
|
@ -290,7 +290,7 @@
|
|||
function detach(item, worldRef, reason = "released") {
|
||||
const carriedBall = removeFromBall(item, worldRef);
|
||||
const t = worldRef?.liveTarinaiById?.(item.pinTargetId) || null;
|
||||
const behavior = typeof pinBehaviorFor === "function" ? pinBehaviorFor(item.type) : null;
|
||||
const behavior = pinBehaviorFor(item.type);
|
||||
const wasOshibyo = Boolean(behavior?.blocksZunchi);
|
||||
const storedZunchi = wasOshibyo && t ? Math.max(0, Math.floor(t.oshiriByoZunchiStock || 0)) : 0;
|
||||
if (t && t.stuckPushpinId === item.id) t.stuckPushpinId = null;
|
||||
|
|
@ -352,14 +352,9 @@
|
|||
global.TarinaiItemDynamicPinSystem = Object.freeze({
|
||||
update,
|
||||
isPin,
|
||||
tryStick,
|
||||
attach,
|
||||
updateLodged,
|
||||
detach,
|
||||
attachToBall,
|
||||
transferFromBallToTarinai,
|
||||
transferBallPinsToTarinai,
|
||||
tryBallPickup,
|
||||
updateBallLodged,
|
||||
});
|
||||
})(typeof window !== "undefined" ? window : globalThis);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue