Logic controller & dead`` sensors
This commit is contained in:
@@ -1312,7 +1312,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
return switch(sensor){
|
||||
case x -> World.conv(x);
|
||||
case y -> World.conv(y);
|
||||
//case dead -> !isValid(); //TODO 126
|
||||
case dead -> !isValid() ? 1 : 0;
|
||||
case team -> team.id;
|
||||
case health -> health;
|
||||
case maxHealth -> maxHealth;
|
||||
|
||||
@@ -128,7 +128,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
||||
case ammoCapacity -> type.ammoCapacity;
|
||||
case x -> World.conv(x);
|
||||
case y -> World.conv(y);
|
||||
//case dead -> dead || !isAdded(); //TODO 126
|
||||
case dead -> dead || !isAdded() ? 1 : 0;
|
||||
case team -> team.id;
|
||||
case shooting -> isShooting() ? 1 : 0;
|
||||
case range -> range() / tilesize;
|
||||
@@ -151,6 +151,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
||||
case type -> type;
|
||||
case name -> controller instanceof Player p ? p.name : null;
|
||||
case firstItem -> stack().amount == 0 ? null : item();
|
||||
case controller -> controller instanceof LogicAI log ? log.controller : controller instanceof FormationAI form ? form.leader : this;
|
||||
case payloadType -> self() instanceof Payloadc pay ?
|
||||
(pay.payloads().isEmpty() ? null :
|
||||
pay.payloads().peek() instanceof UnitPayload p1 ? p1.unit.type :
|
||||
|
||||
@@ -27,7 +27,7 @@ public enum LAccess{
|
||||
y,
|
||||
shootX,
|
||||
shootY,
|
||||
//dead, //TODO 126
|
||||
dead,
|
||||
range,
|
||||
shooting,
|
||||
mineX,
|
||||
@@ -42,6 +42,7 @@ public enum LAccess{
|
||||
config,
|
||||
payloadCount,
|
||||
payloadType,
|
||||
controller,
|
||||
|
||||
//values with parameters are considered controllable
|
||||
enabled("to"), //"to" is standard for single parameter access
|
||||
|
||||
Reference in New Issue
Block a user