refactor
This commit is contained in:
parent
0a6148c73f
commit
e8f1d1db1e
60 changed files with 2417 additions and 612 deletions
|
|
@ -85,9 +85,7 @@
|
|||
this.sleepDiseaseCooldown = 8;
|
||||
this.sleepDiseaseAnchorX = this.x;
|
||||
this.sleepDiseaseAnchorY = this.y;
|
||||
this.state = "sleep";
|
||||
this.target = null;
|
||||
this.sleeping = true;
|
||||
this.startSleeping(null, "ねむり病で眠り続けている");
|
||||
this.fightTimer = 0;
|
||||
this.intimidateTimer = 0;
|
||||
this.fightTargetIds = [];
|
||||
|
|
@ -106,10 +104,9 @@
|
|||
this.sleepDiseaseCooldown = 14;
|
||||
this.sleepDiseaseAnchorX = null;
|
||||
this.sleepDiseaseAnchorY = null;
|
||||
this.state = "idle";
|
||||
this.goIdle(reason || "ねむり病が治った");
|
||||
this.sleeping = false;
|
||||
this.awakeLockTimer = Math.max(this.awakeLockTimer || 0, 10);
|
||||
this.thought = reason || "\u306d\u3080\u308a\u75c5\u304c\u6cbb\u3063\u305f";
|
||||
audio.heal?.();
|
||||
this.surpriseTimer = Math.max(this.surpriseTimer || 0, 0.65);
|
||||
this.world?.spawnBubble?.(this.x, this.y - this.radius * 1.18, "!", "rgba(72,76,120,0.76)");
|
||||
|
|
@ -184,9 +181,7 @@
|
|||
const beingDraggedByAnt = Boolean((this.antDraggedTimer || 0) > 0 && this.antDraggedBy);
|
||||
if (!Number.isFinite(this.sleepDiseaseAnchorX)) this.sleepDiseaseAnchorX = this.x;
|
||||
if (!Number.isFinite(this.sleepDiseaseAnchorY)) this.sleepDiseaseAnchorY = this.y;
|
||||
this.state = "sleep";
|
||||
this.sleeping = true;
|
||||
this.target = null;
|
||||
this.startSleeping(null, beingDraggedByAnt ? "眠ったままアリに運ばれている" : "ねむり病で眠り続けている");
|
||||
this.vx = 0;
|
||||
this.vy = 0;
|
||||
if (beingDraggedByAnt) {
|
||||
|
|
@ -233,7 +228,7 @@
|
|||
}
|
||||
this.insideNestBoxId = box.id;
|
||||
this.target = box;
|
||||
if (this.state === "seek_bed") this.state = "sleep";
|
||||
if (this.state === "seek_bed") this.startSleeping(box, "巣箱の中で眠っている");
|
||||
if (this.state === "sleep") this.sleeping = true;
|
||||
const inner = this.world?.nestBoxInnerPoint ? this.world.nestBoxInnerPoint(box, this) : { x: box.x, y: box.y };
|
||||
const pull = clamp(dt * (alreadyInside ? 10.0 : 13.5), 0, 1);
|
||||
|
|
@ -284,7 +279,7 @@
|
|||
|
||||
if (currentBox) {
|
||||
if ((this.world?.time || 0) < (this.nestBoxStayUntil || -Infinity)) {
|
||||
this.state = "sleep";
|
||||
this.startSleeping(box, "巣箱の中で眠っている");
|
||||
this.sleeping = true;
|
||||
this.target = currentBox;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue