silphius/resources/hoe/projection-check.js

15 lines
408 B
JavaScript
Raw Permalink Normal View History

2024-10-17 23:35:34 -05:00
export default function*({ecs, projected}) {
const layer0 = ecs.get(1).TileLayers.layer(0);
const layer1 = ecs.get(1).TileLayers.layer(1);
const filtered = [];
for (const position of projected) {
if (
2024-11-09 20:58:10 -06:00
[224, 225, 226, 227, 242, 243, 244, 245].includes(layer0.tile(position))
2024-10-17 23:35:34 -05:00
&& ![7].includes(layer1.tile(position))
) {
filtered.push(position);
}
2024-06-28 12:12:38 -05:00
}
2024-10-17 23:35:34 -05:00
return filtered;
2024-06-28 12:12:38 -05:00
}