e
This commit is contained in:
parent
f657b6a4a4
commit
d163ceb291
76 changed files with 1385 additions and 524 deletions
14
js/ants.js
14
js/ants.js
|
|
@ -100,7 +100,7 @@ class AntActor {
|
|||
this.targetRef = null;
|
||||
this.burnWanderAngle = rand(0, Math.PI * 2);
|
||||
this.hpBarTimer = Math.max(this.hpBarTimer || 0, 1.0);
|
||||
this.world?.effects?.push(new Effect("ring", this.x, this.y, { size: Math.max(10, this.r * 2.8), life: 0.18, color: "rgba(255,110,36,0.56)" }));
|
||||
this.world?.queueEffect?.("ring", this.x, this.y, { size: Math.max(10, this.r * 2.8), life: 0.18, color: "rgba(255,110,36,0.56)" });
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -108,7 +108,7 @@ class AntActor {
|
|||
if (!this.burning && !(this.burnTimer > 0)) return false;
|
||||
this.burning = false;
|
||||
this.burnTimer = 0;
|
||||
this.world?.effects?.push(new Effect("ring", this.x, this.y, { size: Math.max(9, this.r * 2.2), life: 0.16, color: "rgba(108,192,236,0.58)" }));
|
||||
this.world?.queueEffect?.("ring", this.x, this.y, { size: Math.max(9, this.r * 2.2), life: 0.16, color: "rgba(108,192,236,0.58)" });
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -158,7 +158,7 @@ class AntActor {
|
|||
if (distXY(this.x, this.y, it.x, it.y) <= contactRadius + Math.max(it.r || 16, 12)) globalThis.TarinaiItemDynamicToolSystem?.igniteGrassByFire?.(it, this, this.world, dt);
|
||||
}
|
||||
if (deterministicChance(this.world, "ant-fire-effect", dt * 2.0, this)) {
|
||||
this.world?.effects?.push(new Effect("flame", this.x, this.y - this.r, { vx: rand(-2, 2), vy: rand(-14, -6), size: Math.max(4, this.r * 1.0), life: 0.22, color: "rgba(236,46,24,0.72)" }));
|
||||
this.world?.queueEffect?.("flame", this.x, this.y - this.r, { vx: rand(-2, 2), vy: rand(-14, -6), size: Math.max(4, this.r * 1.0), life: 0.22, color: "rgba(236,46,24,0.72)" });
|
||||
}
|
||||
if (this.burnTimer <= 0.01) this.extinguishFire("timeout");
|
||||
return true;
|
||||
|
|
@ -300,6 +300,7 @@ class AntActor {
|
|||
updateSearch(dt, home) {
|
||||
const target = this.chooseTarget(52);
|
||||
if (target) {
|
||||
const alreadyCaptured = Boolean((target.antDraggedTimer || 0) > 0 && target.antDraggedBy);
|
||||
this.state = "drag";
|
||||
this.targetId = target.id;
|
||||
this.targetToken = target.liveToken || 0;
|
||||
|
|
@ -310,6 +311,7 @@ class AntActor {
|
|||
target.fearTimer = Math.max(target.fearTimer || 0, 0.55);
|
||||
target.thought = "\u30a2\u30ea\u306b\u904b\u3070\u308c\u3066\u3044\u308b";
|
||||
target.recordChangeCause?.("\u30a2\u30ea\u306b\u904b\u3070\u308c\u305f", "\u72b6\u614b");
|
||||
if (!alreadyCaptured) this.world?.log?.(`${target.name}\u304c\u30a2\u30ea\u306b\u6355\u307e\u3063\u305f\u3002`, "event", { participants: [target] });
|
||||
audio.antDrag?.();
|
||||
this.world.drawListDirty = true;
|
||||
return;
|
||||
|
|
@ -416,10 +418,6 @@ class AntActor {
|
|||
globalThis.TarinaiAchievements?.recordAntDamageSource?.(this, target, { world: this.world, reason: "tarinai_struggle" });
|
||||
this.hp -= dt * struggle;
|
||||
|
||||
if ((this.world.time || 0) - (this.carryLogAt || -999) > 8 && Math.random() < dt * 0.04) {
|
||||
this.carryLogAt = this.world.time || 0;
|
||||
this.world.log(`${target.name}\u304c\u30a2\u30ea\u306b\u5f15\u3063\u5f35\u3089\u308c\u3066\u3044\u308b\u3002`, "event", { participants: [target] });
|
||||
}
|
||||
if (this.hp <= 0) this.dieAsCorpse(home);
|
||||
}
|
||||
|
||||
|
|
@ -431,7 +429,7 @@ class AntActor {
|
|||
const corpse = new Item("ant_corpse", this.x, this.y);
|
||||
corpse.amount = 24;
|
||||
this.world.addItem?.(corpse, "ant-corpse");
|
||||
this.world.effects?.push(new Effect("zunchi_miasma", this.x, this.y - 4, { size: 10, life: 0.44, color: "rgba(82,61,42,0.28)" }));
|
||||
this.world.queueEffect?.("zunchi_miasma", this.x, this.y - 4, { size: 10, life: 0.44, color: "rgba(82,61,42,0.28)" });
|
||||
if (home) syncAntNestCount(this.world, home);
|
||||
this.world.ensureItemBuckets?.("ant-corpse");
|
||||
this.world.drawListDirty = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue