h
This commit is contained in:
parent
e00bfd8879
commit
f941200504
70 changed files with 1856 additions and 429 deletions
|
|
@ -301,7 +301,7 @@ function evaluateConflictUrge(tarinai, world, maxDist = 96) {
|
|||
};
|
||||
}
|
||||
}
|
||||
return best && best.score > (best.forced ? 4 : 12) ? best : null;
|
||||
return best && best.score > (best.forced ? 4 : 8) ? best : null;
|
||||
}
|
||||
|
||||
function conflictTargetFor(tarinai, world, minScore = 34) {
|
||||
|
|
@ -323,6 +323,7 @@ function findOwnedStructure(world, tarinai, type = "", maxDist = Infinity) {
|
|||
let best = null, bestD = maxDist;
|
||||
for (const item of world?.items || []) {
|
||||
if (!item?.isStructure || item.dead || item.ownerId !== tarinai.id) continue;
|
||||
if (Number(item.unreachableUntil || 0) > Number(world?.time || 0)) continue;
|
||||
if (type && item.type !== type) continue;
|
||||
if (tarinaiTargetBlockedByObstacle(world, tarinai, item, "structure")) continue;
|
||||
const d = dist(tarinai, item);
|
||||
|
|
@ -335,6 +336,8 @@ function findUnownedStructure(world, tarinai, type = "", maxDist = Infinity) {
|
|||
let best = null, bestD = maxDist;
|
||||
for (const item of world?.items || []) {
|
||||
if (!item?.isStructure || item.dead || item.ownerId) continue;
|
||||
if (item.abandonedById && item.abandonedById === tarinai?.id && Number(item.abandonedUntil || 0) > Number(world?.time || 0)) continue;
|
||||
if (Number(item.unreachableUntil || 0) > Number(world?.time || 0)) continue;
|
||||
if (type && item.type !== type) continue;
|
||||
if (tarinai?.shouldAvoidTarget?.(item)) continue;
|
||||
if (tarinaiTargetBlockedByObstacle(world, tarinai, item, "structure")) continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue