Logic controller & dead`` sensors

This commit is contained in:
Anuken
2021-02-21 09:22:02 -05:00
parent 8257fb5e11
commit 544828d9fb
6 changed files with 11 additions and 4 deletions
+2
View File
@@ -1544,6 +1544,8 @@ lenum.configure = Building configuration, e.g. sorter item.
lenum.enabled = Whether the block is enabled. lenum.enabled = Whether the block is enabled.
laccess.color = Illuminator color. laccess.color = Illuminator color.
laccess.controller = Unit controller. If processor controlled, returns processor.\nIf in a formation, returns leader.\nOtherwise, returns the unit itself.
laccess.dead = Whether a unit/building is dead or no longer valid.
graphicstype.clear = Fill the display with a color. graphicstype.clear = Fill the display with a color.
graphicstype.color = Set color for next drawing operations. graphicstype.color = Set color for next drawing operations.
@@ -1312,7 +1312,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
return switch(sensor){ return switch(sensor){
case x -> World.conv(x); case x -> World.conv(x);
case y -> World.conv(y); case y -> World.conv(y);
//case dead -> !isValid(); //TODO 126 case dead -> !isValid() ? 1 : 0;
case team -> team.id; case team -> team.id;
case health -> health; case health -> health;
case maxHealth -> maxHealth; case maxHealth -> maxHealth;
@@ -128,7 +128,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
case ammoCapacity -> type.ammoCapacity; case ammoCapacity -> type.ammoCapacity;
case x -> World.conv(x); case x -> World.conv(x);
case y -> World.conv(y); case y -> World.conv(y);
//case dead -> dead || !isAdded(); //TODO 126 case dead -> dead || !isAdded() ? 1 : 0;
case team -> team.id; case team -> team.id;
case shooting -> isShooting() ? 1 : 0; case shooting -> isShooting() ? 1 : 0;
case range -> range() / tilesize; case range -> range() / tilesize;
@@ -151,6 +151,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
case type -> type; case type -> type;
case name -> controller instanceof Player p ? p.name : null; case name -> controller instanceof Player p ? p.name : null;
case firstItem -> stack().amount == 0 ? null : item(); 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 ? case payloadType -> self() instanceof Payloadc pay ?
(pay.payloads().isEmpty() ? null : (pay.payloads().isEmpty() ? null :
pay.payloads().peek() instanceof UnitPayload p1 ? p1.unit.type : pay.payloads().peek() instanceof UnitPayload p1 ? p1.unit.type :
+2 -1
View File
@@ -27,7 +27,7 @@ public enum LAccess{
y, y,
shootX, shootX,
shootY, shootY,
//dead, //TODO 126 dead,
range, range,
shooting, shooting,
mineX, mineX,
@@ -42,6 +42,7 @@ public enum LAccess{
config, config,
payloadCount, payloadCount,
payloadType, payloadType,
controller,
//values with parameters are considered controllable //values with parameters are considered controllable
enabled("to"), //"to" is standard for single parameter access enabled("to"), //"to" is standard for single parameter access
+1 -1
View File
@@ -1,3 +1,3 @@
org.gradle.daemon=true org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=7e4bc7e1c7c25bdf4321a22356f6ddb1943f6d60 archash=26a96b2eb63608f200e5b93873013dd85c31e39f
+3
View File
@@ -42,6 +42,9 @@ task dist(type: Jar, dependsOn: configurations.runtimeClasspath){
exclude("zones/**") exclude("zones/**")
exclude("icons/**") exclude("icons/**")
exclude("bundles/**") exclude("bundles/**")
exclude("cubemaps/**")
exclude("cursors/**")
exclude("shaders/**")
manifest{ manifest{
attributes 'Main-Class': project.mainClassName attributes 'Main-Class': project.mainClassName