stable
This commit is contained in:
parent
86226ccc94
commit
077d4ab9ac
71 changed files with 2905 additions and 1063 deletions
|
|
@ -3,12 +3,10 @@
|
|||
// Layer: entity-runtime/tarinai/update-system
|
||||
// Owns active sunbath timer, sprite frame cycling, and recovery finish logic.
|
||||
(function (global) {
|
||||
function legacyMethod(dt) {
|
||||
function updateBody(dt) {
|
||||
if ((this.sunbathTimer || 0) <= 0) return;
|
||||
this.sunbathTimer = Math.max(0, (this.sunbathTimer || 0) - dt);
|
||||
this.sunbathFrameTimer = Math.max(0, (this.sunbathFrameTimer || 0) - dt);
|
||||
this.vx = 0;
|
||||
this.vy = 0;
|
||||
if ((this.sunbathFrameTimer || 0) <= 0) {
|
||||
const prev = this._activeSunbathSpriteId || (this.sunbathSpriteId ? this.sunbathSpriteId() : this.sunbathSpriteVariant);
|
||||
const next = this.randomSunbathSpriteId ? this.randomSunbathSpriteId(prev, { readyOnly: true }) : `sunbath_${1 + Math.floor(Math.random() * 3)}`;
|
||||
|
|
@ -40,12 +38,12 @@
|
|||
|
||||
function updateOne(tarinai, dt) {
|
||||
if (!tarinai || tarinai.dead) return false;
|
||||
legacyMethod.call(tarinai, dt);
|
||||
updateBody.call(tarinai, dt);
|
||||
return true;
|
||||
}
|
||||
|
||||
global.TarinaiSunbathSystem = Object.freeze({
|
||||
legacyMethod,
|
||||
updateBody,
|
||||
updateOne,
|
||||
});
|
||||
})(typeof window !== "undefined" ? window : globalThis);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue