ss
This commit is contained in:
parent
091afc2b5c
commit
28591233f3
85 changed files with 946 additions and 267 deletions
|
|
@ -18,8 +18,62 @@
|
|||
return global.deterministicChance(worldRef, salt, chance, ...parts);
|
||||
}
|
||||
|
||||
const OCHIBI_HIGH_STRESS_SPEECHES = [
|
||||
{ id: "voice_acquired_stress_001", text: "パパずんはどこなのだ?" },
|
||||
{ id: "voice_acquired_stress_002", text: "ママずんはどこなのだ?" },
|
||||
{ id: "voice_acquired_stress_003", text: "こんなはずじゃなかったのだ" },
|
||||
{ id: "voice_acquired_stress_004", text: "どうして" },
|
||||
{ id: "voice_acquired_stress_005", text: "おまえをゆるさないのだ" },
|
||||
{ id: "voice_acquired_stress_006", text: "のろってやるのだ" },
|
||||
{ id: "voice_acquired_stress_007", text: "てあしをかえせなのだ" },
|
||||
{ id: "voice_acquired_stress_008", text: "すべすべしっぽしゃんが" },
|
||||
{ id: "voice_acquired_stress_009", text: "くちょにんげん" },
|
||||
{ id: "voice_ochibi_stress_008", text: "なんでぼくがこんなめに..." }
|
||||
];
|
||||
const OCHIBI_LOW_STRESS_SPEECHES = [
|
||||
{ id: "voice_ochibi_calm_001", text: "ぼくはゆうしゅうなのだ" },
|
||||
{ id: "voice_ochibi_calm_002", text: "しあわせなのだ" },
|
||||
{ id: "voice_ochibi_calm_003", text: "てあしがなくてもげんきなのだ" },
|
||||
{ id: "voice_ochibi_calm_004", text: "へこへこしたいのだ" },
|
||||
{ id: "voice_ochibi_calm_005", text: "のだのだのだ" },
|
||||
{ id: "voice_ochibi_calm_006", text: "くちょおやがいなくてもぼくはたたかえるのだ" },
|
||||
{ id: "voice_ochibi_calm_007", text: "ぼくはげんきいっぱいなのだ" },
|
||||
{ id: "voice_ochibi_calm_008", text: "かっきにみちみちしているのだ" },
|
||||
{ id: "voice_ochibi_calm_009", text: "ずんちでそう" }
|
||||
];
|
||||
|
||||
function maybePlayOchibiIdleSpeech(t) {
|
||||
if (!t || t.dead || !t.isAcquiredTarinai || String(t.state || "") !== "idle") return false;
|
||||
const now = Number(t.world?.time || 0) || 0;
|
||||
const stress = Number(t.stress || 0) || 0;
|
||||
const highStress = stress >= 68;
|
||||
const pool = highStress ? OCHIBI_HIGH_STRESS_SPEECHES : OCHIBI_LOW_STRESS_SPEECHES;
|
||||
if (!pool.length) return false;
|
||||
if (!Number.isFinite(t.acquiredStressSpeechAt)) t.acquiredStressSpeechAt = now + detRange(t.world, "ochibi-idle-speech-init", 2.8, 6.5, t);
|
||||
if ((t.acquiredStressSpeechCooldownUntil || 0) > now || (t.nextBubbleAt || 0) > now || now < t.acquiredStressSpeechAt) return false;
|
||||
const idx = Math.max(0, Math.min(pool.length - 1, Math.floor(detRange(t.world, highStress ? "ochibi-high-line" : "ochibi-low-line", 0, pool.length, t, Math.floor(now * 10)))));
|
||||
const line = pool[idx] || pool[0];
|
||||
if (!line) return false;
|
||||
const color = highStress ? "rgba(58,48,63,0.82)" : "rgba(62,84,45,0.78)";
|
||||
const bubbled = typeof t.bubble === "function" ? t.bubble(line.text, 5.8, color) : false;
|
||||
if (!bubbled) return false;
|
||||
const audio = global.TarinaiAudio;
|
||||
if (audio?.playSample) audio.playSample(line.id, 1.5, "voice") || audio.play(line.id, { category: "voice", minGap: 1.5 });
|
||||
else if (audio?.play) audio.play(line.id, { category: "voice", minGap: 1.5 });
|
||||
t.acquiredStressSpeechCooldownUntil = now + 1.5;
|
||||
t.acquiredStressSpeechAt = now + detRange(t.world, highStress ? "ochibi-high-next" : "ochibi-low-next", highStress ? 6.5 : 7.0, highStress ? 12.0 : 13.0, t, line.id, Math.floor(now));
|
||||
return true;
|
||||
}
|
||||
|
||||
function update(t, dt, context = {}) {
|
||||
if (!t || t.dead) return { done: true };
|
||||
if (t.isAcquiredTarinai && (t.state === "sunbath" || (t.sunbathTimer || 0) > 0.04)) {
|
||||
t.sunbathTimer = 0;
|
||||
t.sunbathLeisure = false;
|
||||
t.sunbathCooldown = Math.max(t.sunbathCooldown || 0, 18);
|
||||
t.visibleSpriteId = "";
|
||||
t.setActionState?.("idle", { target: null, reason: "おちびは日光浴をしない", sleeping: false, clearTarget: true }); // acquired-sunbath-cancel
|
||||
}
|
||||
t.prevX = t.x;
|
||||
t.prevY = t.y;
|
||||
|
||||
|
|
@ -47,6 +101,7 @@
|
|||
t._achievementLaxativeActiveThisFrame = Boolean(t.hasItemEffect?.("laxative"));
|
||||
if (t.updateBurning) t.updateBurning(dt);
|
||||
if (t.updateItemEffects) t.updateItemEffects(dt);
|
||||
global.TarinaiMamekusaredakeSystem?.updateTarinai?.(t, dt);
|
||||
if (t.hasItemEffect?.("sedative")) {
|
||||
t.fearTimer = Math.max(0, (t.fearTimer || 0) - dt * 1.8);
|
||||
t.intimidatedTimer = Math.max(0, (t.intimidatedTimer || 0) - dt * 1.4);
|
||||
|
|
@ -139,10 +194,11 @@
|
|||
t.setActionState?.("idle", { target: null, reason: "\u8db3\u3064\u307c\u306e\u7a81\u8d77\u306b\u3064\u307e\u3065\u3044\u305f\u3002", sleeping: false, clearTarget: false });
|
||||
if ((t.world?.time || 0) >= (t.nextBubbleAt || 0)) t.bubble?.("\u3046\u3063", 1.6, "rgba(86,70,96,0.78)");
|
||||
}
|
||||
if (t.stress > 92 && t.state !== "sleep" && t.state !== "fight" && t.state !== "eat" && detChance(t.world, "stress-breath-bubble", dt * 0.050, t)) {
|
||||
maybePlayOchibiIdleSpeech(t);
|
||||
if (!t.isAcquiredTarinai && t.stress > 92 && t.state !== "sleep" && t.state !== "fight" && t.state !== "eat" && detChance(t.world, "stress-breath-bubble", dt * 0.050, t)) {
|
||||
t.bubble("\u306f\u3063...\u306f\u3063...", 3.4, "rgba(58,48,63,0.80)");
|
||||
}
|
||||
if (t.state === "idle" && t.stress < 78 && detChance(t.world, "idle-bubble", dt * 0.018, t)) {
|
||||
if (!t.isAcquiredTarinai && t.state === "idle" && t.stress < 78 && detChance(t.world, "idle-bubble", dt * 0.018, t)) {
|
||||
t.bubble(pick(["\u306f\u3046", "\u306f\u3046\u3045", "\u306f\u3046\u3063", "\u306f\u3045"]), 4.2, "rgba(62,84,45,0.76)");
|
||||
}
|
||||
if (t.hurtTimer > 0 && detChance(t.world, "hurt-bleed-effect", dt * 5.2, t)) {
|
||||
|
|
@ -176,7 +232,14 @@
|
|||
const stressRate = excess * (0.66 + Math.min(20, excess) * 0.035);
|
||||
applyNeedShock(t, { safety: stressRate * dt, health: stressRate * dt * 0.42 });
|
||||
if ((t.world?.time || 0) >= (t.nextBubbleAt || 0) && detChance(t.world, "temperature-stress-bubble", dt * 0.18, t)) {
|
||||
t.bubble(tempStatus.direction === "cold" ? "\u3076\u308B\u3076\u308B" : "\u3042\u3061\u3085\u3044", 2.4, "rgba(76,62,72,0.78)");
|
||||
if (t.isAcquiredTarinai && tempStatus.direction === "hot" && Math.random() < 0.68) {
|
||||
if (t.bubble("おみじゅ...", 2.4, "rgba(76,62,72,0.78)")) {
|
||||
const a = global.TarinaiAudio;
|
||||
if (a?.playSample) a.playSample("voice_ochibi_hot_007", 1.2, "voice") || a.play?.("voice_ochibi_hot_007", { category: "voice", minGap: 1.2 });
|
||||
}
|
||||
} else {
|
||||
t.bubble(tempStatus.direction === "cold" ? "ぶるぶる" : "あちゅい", 2.4, "rgba(76,62,72,0.78)");
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((tempStatus.harmExcess || 0) > 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue