This commit is contained in:
33333-33333 2026-06-25 14:51:58 +09:00
commit 434f07cc4e
103 changed files with 8387 additions and 8152 deletions

View file

@ -3,6 +3,21 @@
(function (global) {
const Tarinai = global.Tarinai;
if (!Tarinai) throw new Error("Tarinai is not available for mixin: tarinai_render.js");
function shouldShowTarinaiDecor(tarinai) {
const worldRef = tarinai?.world;
if (!tarinai || !worldRef) return true;
if (worldRef.selected === tarinai || tarinai.favorite) return true;
if ((tarinai.hurtTimer || 0) > 0.04 || (tarinai.eatTimer || 0) > 0.02 || (tarinai.pokeFlashTimer || 0) > 0.03) return true;
if ((tarinai.focusPulseTimer || 0) > 0.04 || tarinai.state === "cursor_friend" || tarinai.state === "cursor_enemy") return true;
const tier = window.TarinaiPerf?.renderQualityTier?.() || "high";
if (tier === "low") return false;
if (tier === "mid") {
const p = worldRef.pointer;
return Boolean(p?.inside && typeof distXY === "function" && distXY(tarinai.x, tarinai.y, p.x, p.y) < tarinai.radius * 2.0);
}
return true;
}
Object.defineProperties(Tarinai.prototype, Object.getOwnPropertyDescriptors({
drawSunbathPose(ctx, t, lighting = null) {
if (this.dead) return true;
@ -85,7 +100,7 @@
if (nestHideAlpha <= 0.01) return true;
const lightState = lighting || getLightingState(this.world);
const showDecor = true || this.world.selected === this;
const showDecor = shouldShowTarinaiDecor(this);
if (showDecor) {
const shadow = projectedShadowParams(lightState, 0.95 + visualScale * 0.8);
drawProjectedShadow(ctx, drawX, drawY + drawH * 0.30, drawW * 0.58, drawH * 0.13, { ...shadow, alpha: shadow.alpha * 0.90 * nestHideAlpha });
@ -134,7 +149,7 @@
this.visibleSpriteId = "";
this.spriteLockUntil = 0;
}
const showDecor = true || this.world.selected === this;
const showDecor = shouldShowTarinaiDecor(this);
if (sunbathActive) this.preloadSunbathSprites?.();
let sprite = this.spriteId();
if (!sunbathActive && String(sprite || "").startsWith("sunbath")) {