Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/ai/petra/baseManager.js
Show First 20 Lines • Show All 164 Lines • ▼ Show 20 Lines | for (let type of dropsite.resourceDropsiteTypes()) | ||||
resources.forEach(function(supply) | resources.forEach(function(supply) | ||||
{ | { | ||||
if (!supply.position()) | if (!supply.position()) | ||||
return; | return; | ||||
if (supply.hasClass("Animal")) // moving resources are treated differently | if (supply.hasClass("Animal")) // moving resources are treated differently | ||||
return; | return; | ||||
if (supply.hasClass("Field")) // fields are treated separately | if (supply.hasClass("Field")) // fields are treated separately | ||||
return; | return; | ||||
if (supply.resourceSupplyType().generic == "treasure") // treasures are treated separately | |||||
return; | |||||
// quick accessibility check | // quick accessibility check | ||||
if (PETRA.getLandAccess(gameState, supply) != accessIndex) | if (PETRA.getLandAccess(gameState, supply) != accessIndex) | ||||
return; | return; | ||||
let dist = API3.SquareVectorDistance(supply.position(), dropsitePos); | let dist = API3.SquareVectorDistance(supply.position(), dropsitePos); | ||||
if (dist < maxDistResourceSquare) | if (dist < maxDistResourceSquare) | ||||
{ | { | ||||
if (dist < maxDistResourceSquare/16) // distmax/4 | if (dist < maxDistResourceSquare/16) // distmax/4 | ||||
▲ Show 20 Lines • Show All 911 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator