rr
This commit is contained in:
parent
2636d580a8
commit
d14550dad6
78 changed files with 2827 additions and 563 deletions
|
|
@ -91,8 +91,8 @@
|
|||
const searchRadius = Math.max(150, (item.r || 18) + speed * Math.max(dt || 0.016, 0.016) + 120);
|
||||
const items = worldRef.nearbyItems(item.x, item.y, searchRadius) || [];
|
||||
const seen = new Set(items);
|
||||
// 大きな機構は中心が近傍セル外でも当たる可能性がある。
|
||||
// 全item走査ではなく、機構type bucketだけを追加確認する。
|
||||
// \u5927\u304d\u306a\u6a5f\u69cb\u306f\u4e2d\u5fc3\u304c\u8fd1\u508d\u30bb\u30eb\u5916\u3067\u3082\u5f53\u305f\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u3002
|
||||
// \u5168item\u8d70\u67fb\u3067\u306f\u306a\u304f\u3001\u6a5f\u69cbtype bucket\u3060\u3051\u3092\u8ffd\u52a0\u78ba\u8a8d\u3059\u308b\u3002
|
||||
const mechanicalTypes = ["rotator", "poison_block", "reciprocator"];
|
||||
for (const type of mechanicalTypes) {
|
||||
const bucket = typeof worldRef.itemsOfType === "function" ? worldRef.itemsOfType(type) : (worldRef.items || []);
|
||||
|
|
@ -448,7 +448,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
const WATER_BALLOON_SURPRISE_TEXT = "水風船が割れておどろいている。";
|
||||
const WATER_BALLOON_SURPRISE_TEXT = "\u6c34\u98a8\u8239\u304c\u5272\u308c\u3066\u304a\u3069\u308d\u3044\u3066\u3044\u308b\u3002";
|
||||
|
||||
function tarinaiOpennessValue(t) {
|
||||
const v = (typeof global.effectivePersonalityValue === "function")
|
||||
|
|
@ -577,7 +577,7 @@
|
|||
const d = Math.max(1, distXY(balloon.x, balloon.y, t.x, t.y));
|
||||
const strength = clamp(1 - d / 165, 0, 1);
|
||||
t.surpriseTimer = Math.max(t.surpriseTimer || 0, 0.34 + strength * 0.44);
|
||||
if (typeof t.addStress === "function") t.addStress(0.18 + strength * 0.42, "水風船が割れて驚いた");
|
||||
if (typeof t.addStress === "function") t.addStress(0.18 + strength * 0.42, "\u6c34\u98a8\u8239\u304c\u5272\u308c\u3066\u9a5a\u3044\u305f");
|
||||
if (typeof t.spawnBubble === "function" && strength > 0.35) t.spawnBubble("!", { life: 0.72 });
|
||||
const awayX = (t.x - balloon.x) / d;
|
||||
const awayY = (t.y - balloon.y) / d;
|
||||
|
|
@ -628,13 +628,13 @@
|
|||
worldRef?.effects?.push(new Effect("fight", balloon.x, balloon.y, { size: deterministicRange(worldRef || balloon, "water-balloon-pop-size", 4, 10, balloon, i), life: 0.28, color: "rgba(95,204,246,0.72)", vx: Math.cos(a) * s, vy: Math.sin(a) * s }));
|
||||
}
|
||||
spawnWaterFromBalloon(balloon, worldRef);
|
||||
const sourceLabel = cause?.type === "fire" || cause?.type === "flame_firecracker" ? "火"
|
||||
: (cause?.type === "firecracker" ? "爆竹"
|
||||
: (cause?.type === "shoot" ? "射撃"
|
||||
: (cause?.type === "genkotsu" ? "げんこつ"
|
||||
: (cause && typeof isPinType === "function" && isPinType(cause.type) ? "鋲" : "強い衝撃"))));
|
||||
const sourceLabel = cause?.type === "fire" || cause?.type === "flame_firecracker" ? "\u706b"
|
||||
: (cause?.type === "firecracker" ? "\u7206\u7af9"
|
||||
: (cause?.type === "shoot" ? "\u5c04\u6483"
|
||||
: (cause?.type === "genkotsu" ? "\u3052\u3093\u3053\u3064"
|
||||
: (cause && typeof isPinType === "function" && isPinType(cause.type) ? "\u92f2" : "\u5f37\u3044\u885d\u6483"))));
|
||||
if (worldRef?.relationNotice?.(balloon.id || "balloon", cause?.id || sourceLabel, "water-balloon-pop", 1.4)) {
|
||||
worldRef.log?.(`水風船が${sourceLabel}に触れて割れた。`, "accident", { participants: [] });
|
||||
worldRef.log?.(`\u6c34\u98a8\u8239\u304c${sourceLabel}\u306b\u89e6\u308c\u3066\u5272\u308c\u305f\u3002`, "accident", { participants: [] });
|
||||
}
|
||||
applyWaterBalloonSurprise(balloon, worldRef);
|
||||
worldRef?.markSpatialDirty?.("water-balloon-pop");
|
||||
|
|
@ -643,6 +643,7 @@
|
|||
global.TarinaiItemDynamicBallSystem = Object.freeze({
|
||||
update,
|
||||
updateFan,
|
||||
fanWindAt,
|
||||
updateWaterDropMotion,
|
||||
resolveObstacleCollisions,
|
||||
popBalloon,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue