range marking

This commit is contained in:
the me 2022-08-18 13:47:07 -07:00
parent d8e6a82fdb
commit 26eabf966d
58 changed files with 774 additions and 76 deletions

View file

@ -36,4 +36,17 @@ function c_colortile(x, y, color) {
array_push(global.map[x][y].overlays, color);
}
return true;
}
function c_markunit(unitobject) {
var i, j;
var mov = unitobject.data.mov.val;
for (i=-mov; i<=mov; i++) {
for (j=-mov; j<=mov; j++) {
if abs(i)+abs(j) <= mov {
(unitobject.marked ? c_decolor : c_colortile)(unitobject.pos.x+i, unitobject.pos.y+j, c_maroon);
}
}
}
unitobject.marked = !unitobject.marked;
}