This commit is contained in:
33333-33333 2026-06-30 22:30:37 +09:00
commit 7455d630fc
82 changed files with 2179 additions and 900 deletions

View file

@ -18,7 +18,63 @@
return true;
}
function tarinaiShadowsEnabled() {
return (global.TarinaiPerf?.shadowQualityTier?.() || "high") !== "off";
}
function drawTarinaiChampionCrown(ctx, tarinai, drawH, nestHideAlpha = 1, showDecor = true) {
if (!ctx || !tarinai?.isTarinaiChampion || tarinai.dead) return false;
const alpha = clamp(Number(nestHideAlpha ?? 1) || 0, 0, 1);
if (alpha <= 0.01) return false;
ctx.save();
ctx.globalAlpha = alpha;
const crownW = Math.max(24, tarinai.radius * 1.34);
const crownH = Math.max(14, tarinai.radius * 0.58);
const cx = tarinai.x;
const cy = tarinai.y - drawH * 0.64 - crownH * 0.55;
if (showDecor) {
ctx.shadowColor = "rgba(244, 184, 42, 0.78)";
ctx.shadowBlur = 12;
}
ctx.fillStyle = "rgba(248, 201, 55, 0.96)";
ctx.strokeStyle = "rgba(116, 78, 18, 0.92)";
ctx.lineWidth = Math.max(1.4, crownH * 0.10);
ctx.beginPath();
ctx.moveTo(cx - crownW * 0.48, cy + crownH * 0.26);
ctx.lineTo(cx - crownW * 0.38, cy - crownH * 0.22);
ctx.lineTo(cx - crownW * 0.17, cy + crownH * 0.05);
ctx.lineTo(cx, cy - crownH * 0.42);
ctx.lineTo(cx + crownW * 0.17, cy + crownH * 0.05);
ctx.lineTo(cx + crownW * 0.38, cy - crownH * 0.22);
ctx.lineTo(cx + crownW * 0.48, cy + crownH * 0.26);
ctx.closePath();
ctx.fill();
ctx.stroke();
ctx.shadowBlur = 0;
ctx.fillStyle = "rgba(255, 243, 154, 0.92)";
ctx.fillRect(cx - crownW * 0.38, cy + crownH * 0.16, crownW * 0.76, crownH * 0.16);
ctx.fillStyle = "rgba(151, 88, 38, 0.82)";
for (const px of [-0.28, 0, 0.28]) {
ctx.beginPath();
ctx.arc(cx + crownW * px, cy + crownH * 0.02, Math.max(1.4, crownH * 0.075), 0, Math.PI * 2);
ctx.fill();
}
ctx.restore();
return true;
}
Object.defineProperties(Tarinai.prototype, Object.getOwnPropertyDescriptors({
drawChampionCrown(ctx, t = 0, lighting = null) {
if (!this.isTarinaiChampion || this.dead) return false;
const nestHideAlpha = this.nestFade ? clamp(1 - this.nestFade, 0, 1) : 1;
if (nestHideAlpha <= 0.01) return false;
const sprite = this.visibleSpriteId || this.goodMode || this.type || "smile";
const metrics = getImageMetrics(sprite) || getImageMetrics("smile") || {};
const visualScale = this.effectiveScale ? this.effectiveScale() : this.scale;
const drawH = (metrics?.h || 512) * visualScale * 0.30;
return drawTarinaiChampionCrown(ctx, this, drawH, nestHideAlpha, shouldShowTarinaiDecor(this));
},
drawSunbathPose(ctx, t, lighting = null) {
if (this.dead) return true;
const active = this.state === "sunbath" || (this.sunbathTimer || 0) > 0.04;
@ -467,9 +523,11 @@
const zImg = getRenderableImage("zunchi", "zunchi");
if (zImg) {
ctx.save();
ctx.shadowColor = "rgba(46, 36, 24, 0.28)";
ctx.shadowBlur = 5;
ctx.shadowOffsetY = Math.max(1, drawH * 0.012);
if (tarinaiShadowsEnabled()) {
ctx.shadowColor = "rgba(46, 36, 24, 0.28)";
ctx.shadowBlur = 5;
ctx.shadowOffsetY = Math.max(1, drawH * 0.012);
}
const zw = Math.max(16, drawW * 0.42);
const zh = zw * 0.74;
ctx.drawImage(zImg, -zw * 0.78, -dh * 0.50 - zh * 0.28, zw, zh);
@ -481,42 +539,7 @@
ctx.restore();
if (this.isTarinaiChampion) {
ctx.save();
ctx.globalAlpha = nestHideAlpha;
const crownW = Math.max(24, this.radius * 1.34);
const crownH = Math.max(14, this.radius * 0.58);
const cx = this.x;
const cy = this.y - drawH * 0.64 - crownH * 0.55;
if (showDecor) {
ctx.shadowColor = "rgba(244, 184, 42, 0.78)";
ctx.shadowBlur = 12;
}
ctx.fillStyle = "rgba(248, 201, 55, 0.96)";
ctx.strokeStyle = "rgba(116, 78, 18, 0.92)";
ctx.lineWidth = Math.max(1.4, crownH * 0.10);
ctx.beginPath();
ctx.moveTo(cx - crownW * 0.48, cy + crownH * 0.26);
ctx.lineTo(cx - crownW * 0.38, cy - crownH * 0.22);
ctx.lineTo(cx - crownW * 0.17, cy + crownH * 0.05);
ctx.lineTo(cx, cy - crownH * 0.42);
ctx.lineTo(cx + crownW * 0.17, cy + crownH * 0.05);
ctx.lineTo(cx + crownW * 0.38, cy - crownH * 0.22);
ctx.lineTo(cx + crownW * 0.48, cy + crownH * 0.26);
ctx.closePath();
ctx.fill();
ctx.stroke();
ctx.shadowBlur = 0;
ctx.fillStyle = "rgba(255, 243, 154, 0.92)";
ctx.fillRect(cx - crownW * 0.38, cy + crownH * 0.16, crownW * 0.76, crownH * 0.16);
ctx.fillStyle = "rgba(151, 88, 38, 0.82)";
for (const px of [-0.28, 0, 0.28]) {
ctx.beginPath();
ctx.arc(cx + crownW * px, cy + crownH * 0.02, Math.max(1.4, crownH * 0.075), 0, Math.PI * 2);
ctx.fill();
}
ctx.restore();
}
// \u305F\u308A\u306A\u3044\u738B\u306E\u738B\u51A0\u306F\u3001\u643A\u884C\u306C\u3044\u3050\u308B\u307F\u3088\u308A\u524D\u9762\u306B\u51FA\u3059\u305F\u3081 render.js \u306E\u5F8C\u6BB5\u3067\u63CF\u753B\u3059\u308B\u3002
if (this.favorite) {
ctx.save();