Update Healer Man server
This commit is contained in:
1 parent
9d7e0e2f9e
commit
35dfdaed61
94 files changed
+17034
-418
No files matched your search
@@ -22,12 +22,15 @@ export function healingRecipientIds(
|
||||
if (!center) return [];
|
||||
const candidates = Object.values(actors)
|
||||
.filter(actor => actor.kind !== "enemy" && actor.alive && actor.health > 0)
|
||||
.filter(actor => !effect.excludeCaster || actor.id !== sourceId)
|
||||
.filter(actor => {
|
||||
const position = positionFor(actor.id);
|
||||
return position && position.reduce((sum, value, index) => sum + (value - center[index]) ** 2, 0) <= (effect.radius ?? 30) ** 2
|
||||
&& hasLineOfSight(center, position);
|
||||
})
|
||||
.sort((a, b) => a.health / a.maxHealth - b.health / b.maxHealth || a.id.localeCompare(b.id));
|
||||
.sort((a, b) => effect.selection === "lowest-max-health"
|
||||
? a.maxHealth - b.maxHealth || a.id.localeCompare(b.id)
|
||||
: a.health / a.maxHealth - b.health / b.maxHealth || a.id.localeCompare(b.id));
|
||||
if (effect.selection === "random" && candidates.length > 0) {
|
||||
let hash = 2166136261;
|
||||
for (const value of `${seed}:${sourceId}:${targetId}`) hash = Math.imul(hash ^ value.charCodeAt(0), 16777619);
|
||||
|
||||
Reference in new issue
Block a user