y
This commit is contained in:
parent
61718e2981
commit
f657b6a4a4
94 changed files with 3970 additions and 1241 deletions
|
|
@ -121,7 +121,7 @@
|
|||
}
|
||||
function detectorItems(item, worldRef, width, height, type = "") {
|
||||
const radius = Math.hypot(width * 0.5, height * 0.5) + 48;
|
||||
return (worldRef.nearbyItems?.(item.x, item.y, radius, true) || worldRef.items || [])
|
||||
return (worldRef.nearbyNonGrassItems?.(item.x, item.y, radius, true) || worldRef.items || [])
|
||||
.filter(it => it && !it.dead && it !== item && !LINK_TYPES.has(it.type)
|
||||
&& (!type || it.type === type) && insideRect(item, it, width, height));
|
||||
}
|
||||
|
|
@ -345,6 +345,7 @@
|
|||
if (now < num(wire._shockCooldowns.get(target), -Infinity)) return false;
|
||||
wire._shockCooldowns.set(target, now + 0.38);
|
||||
const isAnt = target.kind === "worker" || target.kind === "queen" || (target.r && !target.radius && Number.isFinite(Number(target.hp)));
|
||||
if (!isAnt) global.TarinaiAchievements?.recordWireShock?.(wire, target, { world: worldRef, connected });
|
||||
if (isAnt) {
|
||||
globalThis.TarinaiAchievements?.recordAntDamageSource?.(target, wire, { world: worldRef, reason: "electric_wire" });
|
||||
target.hp = Math.max(0, num(target.hp, target.maxHp || 32) - 2.4);
|
||||
|
|
@ -366,7 +367,6 @@
|
|||
life: 0.28,
|
||||
color: "rgba(118,224,255,0.96)",
|
||||
});
|
||||
global.TarinaiAchievements?.recordWireShock?.(wire, target, { world: worldRef, connected });
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue