aa
This commit is contained in:
parent
f941200504
commit
ad2cc76429
34 changed files with 616 additions and 365 deletions
|
|
@ -186,7 +186,7 @@
|
|||
const intimidateShake = this.intimidateTimer > 0.04 ? Math.sin(t * 44 + this.age) * this.radius * 0.09 : 0;
|
||||
const fearShakeY = this.intimidatedTimer > 0.04 ? Math.sin(t * 52 + this.age * 0.7) * this.radius * 0.11 : 0;
|
||||
const birthShake = this.birthRitualTimer > 0.04 ? Math.sin(t * 34 + this.age) * this.radius * 0.07 : 0;
|
||||
const coldStatus = this.temperatureStatus || this.world?.temperatureStatusFor?.(this.feltTemperature ?? this.tempComfort ?? (CONFIG.standardTemperature ?? 15)) || null;
|
||||
const coldStatus = this.temperatureStatus || this.world?.temperatureStatusFor?.(this.feltTemperature ?? this.tempComfort ?? (CONFIG.standardTemperature ?? 15), this) || null;
|
||||
const coldShakeActive = Boolean(coldStatus && coldStatus.direction === "cold" && (coldStatus.discomfort || 0) > 0.5 && this.state !== "sunbath");
|
||||
const coldShakeStrength = coldShakeActive ? clamp((coldStatus.discomfort || 0) / 12, 0.25, 1.25) : 0;
|
||||
const coldShakeX = coldShakeActive ? (Math.sin(t * 46 + this.age * 0.9) + Math.sin(t * 71 + this.age * 0.31) * 0.55) * this.radius * 0.035 * coldShakeStrength : 0;
|
||||
|
|
@ -328,29 +328,6 @@
|
|||
ctx.restore();
|
||||
}
|
||||
|
||||
if (showDecor && coldShakeActive) {
|
||||
ctx.save();
|
||||
ctx.globalAlpha = 0.22 * nestHideAlpha * clamp(coldShakeStrength, 0.25, 1.15);
|
||||
ctx.strokeStyle = "rgba(108, 166, 220, 0.86)";
|
||||
ctx.lineWidth = Math.max(1.0, this.radius * 0.045);
|
||||
ctx.lineCap = "round";
|
||||
const side = Math.max(10, drawW * 0.36);
|
||||
const top = -drawH * 0.28;
|
||||
const amp = Math.max(2, this.radius * 0.08);
|
||||
for (const dir of [-1, 1]) {
|
||||
for (let i = 0; i < 2; i++) {
|
||||
const ox = dir * (side + i * drawW * 0.055);
|
||||
const oy = top + i * drawH * 0.22 + Math.sin(t * 24 + i + this.age) * amp * 0.35;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(ox, oy - amp);
|
||||
ctx.lineTo(ox + dir * amp * 0.55, oy);
|
||||
ctx.lineTo(ox, oy + amp);
|
||||
ctx.stroke();
|
||||
}
|
||||
}
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
if (this.world.selected === this) {
|
||||
ctx.save();
|
||||
const pulse = 0.5 + 0.5 * Math.sin(this.world.time * 7.5);
|
||||
|
|
@ -600,7 +577,7 @@
|
|||
},
|
||||
|
||||
contains(x, y) {
|
||||
if (this.insideNestBoxId || (this.nestFade || 0) >= 0.92) return false;
|
||||
if (this.insideNestBoxId || (this.nestFade || 0) > 0.05) return false;
|
||||
const hit = this.world.screenSizeToWorld ? this.world.screenSizeToWorld(this.radius * 1.9) : this.radius * 1.9;
|
||||
return distXY(this.x, this.y, x, y) < hit;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue