Let Logic Sense Range (#4425)

Co-authored-by: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com>
This commit is contained in:
genNAowl
2021-01-24 06:23:12 -08:00
committed by GitHub
parent 6b6d52e2fd
commit 623b7ada11
3 changed files with 3 additions and 0 deletions

View File

@@ -1306,6 +1306,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
case health -> health;
case maxHealth -> maxHealth;
case efficiency -> efficiency();
case range -> this instanceof Ranged r ? r.range() / tilesize : 0;
case rotation -> rotation;
case totalItems -> items == null ? 0 : items.total();
case totalLiquids -> liquids == null ? 0 : liquids.total();

View File

@@ -130,6 +130,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
case y -> World.conv(y);
case team -> team.id;
case shooting -> isShooting() ? 1 : 0;
case range -> range() / tilesize;
case shootX -> World.conv(aimX());
case shootY -> World.conv(aimY());
case mining -> mining() ? 1 : 0;