asdfg
This commit is contained in:
parent
f6d7412744
commit
091afc2b5c
77 changed files with 4405 additions and 8223 deletions
|
|
@ -53,6 +53,10 @@
|
|||
return "food";
|
||||
}
|
||||
|
||||
function randomRange(min, max) {
|
||||
return min + Math.random() * (max - min);
|
||||
}
|
||||
|
||||
function spawnFoodGiftHearts(tarinai, nutrition = 0) {
|
||||
const worldRef = tarinai?.world;
|
||||
if (!worldRef?.effects || typeof global.TarinaiEffect !== "function") return false;
|
||||
|
|
@ -61,12 +65,12 @@
|
|||
for (let i = 0; i < count; i += 1) {
|
||||
const side = i % 2 ? 1 : -1;
|
||||
worldRef.queueEffect?.("heart",
|
||||
tarinai.x + side * global.rand(radius * 0.06, radius * 0.82),
|
||||
tarinai.y - global.rand(radius * 0.38, radius * 1.72), {
|
||||
vx: side * global.rand(9, 30) + global.rand(-9, 9),
|
||||
vy: global.rand(-76, -30),
|
||||
size: global.rand(9, 17),
|
||||
life: global.rand(0.82, 1.36),
|
||||
tarinai.x + side * randomRange(radius * 0.06, radius * 0.82),
|
||||
tarinai.y - randomRange(radius * 0.38, radius * 1.72), {
|
||||
vx: side * randomRange(9, 30) + randomRange(-9, 9),
|
||||
vy: randomRange(-76, -30),
|
||||
size: randomRange(9, 17),
|
||||
life: randomRange(0.82, 1.36),
|
||||
color: "rgba(240,91,135,0.94)",
|
||||
});
|
||||
}
|
||||
|
|
@ -129,8 +133,9 @@
|
|||
if (foodGift) {
|
||||
tarinai.affection = Number(tarinai.affection || 0) + 1.8 + Math.max(0, Number(nutrition) || 0) * 0.035;
|
||||
applyFoodGiftPersonality(tarinai, nutrition);
|
||||
spawnFoodGiftHearts(tarinai, nutrition);
|
||||
tarinai.bubble?.("\u2661", 2.2, "rgba(190,82,132,0.80)");
|
||||
// Cosmetic feedback must never interrupt consumption, removal, or achievement recording.
|
||||
try { spawnFoodGiftHearts(tarinai, nutrition); } catch (_) {}
|
||||
try { tarinai.bubble?.("\u2661", 2.2, "rgba(190,82,132,0.80)"); } catch (_) {}
|
||||
global.TarinaiAchievements?.recordDirectFeed?.({ world: worldRef, tarinai, item, type, source: options.source || "direct" });
|
||||
} else {
|
||||
tarinai.focusPulseTimer = Math.max(Number(tarinai.focusPulseTimer || 0) || 0, 0.72);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue