purple
|
Before Width: | Height: | Size: 874 B After Width: | Height: | Size: 812 B |
|
Before Width: | Height: | Size: 836 B After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 411 B After Width: | Height: | Size: 581 B |
|
Before Width: | Height: | Size: 783 B After Width: | Height: | Size: 784 B |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 183 KiB After Width: | Height: | Size: 189 KiB |
|
Before Width: | Height: | Size: 385 KiB After Width: | Height: | Size: 385 KiB |
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 1.8 MiB After Width: | Height: | Size: 1.8 MiB |
|
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 190 KiB |
|
Before Width: | Height: | Size: 391 KiB After Width: | Height: | Size: 392 KiB |
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
@@ -1169,6 +1169,8 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double sense(LAccess sensor){
|
public double sense(LAccess sensor){
|
||||||
|
if(sensor == LAccess.x) return x;
|
||||||
|
if(sensor == LAccess.y) return y;
|
||||||
if(sensor == LAccess.health) return health;
|
if(sensor == LAccess.health) return health;
|
||||||
if(sensor == LAccess.efficiency) return efficiency();
|
if(sensor == LAccess.efficiency) return efficiency();
|
||||||
if(sensor == LAccess.rotation) return rotation;
|
if(sensor == LAccess.rotation) return rotation;
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
public double sense(LAccess sensor){
|
public double sense(LAccess sensor){
|
||||||
if(sensor == LAccess.totalItems) return stack().amount;
|
if(sensor == LAccess.totalItems) return stack().amount;
|
||||||
if(sensor == LAccess.health) return health;
|
if(sensor == LAccess.health) return health;
|
||||||
|
if(sensor == LAccess.x) return x;
|
||||||
|
if(sensor == LAccess.y) return y;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ public enum LAccess{
|
|||||||
heat,
|
heat,
|
||||||
efficiency,
|
efficiency,
|
||||||
rotation,
|
rotation,
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
|
||||||
//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
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import arc.util.*;
|
|||||||
import arc.util.ArcAnnotate.*;
|
import arc.util.ArcAnnotate.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
|
import mindustry.logic.LStatements.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
import mindustry.ui.dialogs.*;
|
import mindustry.ui.dialogs.*;
|
||||||
|
|
||||||
@@ -45,6 +46,7 @@ public class LCanvas extends Table{
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
for(Prov<LStatement> prov : LogicIO.allStatements){
|
for(Prov<LStatement> prov : LogicIO.allStatements){
|
||||||
LStatement example = prov.get();
|
LStatement example = prov.get();
|
||||||
|
if(example instanceof InvalidStatement) continue;
|
||||||
t.button(example.name(), Styles.cleart, () -> {
|
t.button(example.name(), Styles.cleart, () -> {
|
||||||
add(prov.get());
|
add(prov.get());
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ public class LStatements{
|
|||||||
|
|
||||||
table.left();
|
table.left();
|
||||||
|
|
||||||
table.add(" set ");
|
table.add("set ");
|
||||||
|
|
||||||
table.button(b -> {
|
table.button(b -> {
|
||||||
b.label(() -> type.name());
|
b.label(() -> type.name());
|
||||||
@@ -274,8 +274,7 @@ public class LStatements{
|
|||||||
type = t;
|
type = t;
|
||||||
rebuild(table);
|
rebuild(table);
|
||||||
}, 2, cell -> cell.size(100, 50)));
|
}, 2, cell -> cell.size(100, 50)));
|
||||||
}, Styles.logict, () -> {
|
}, Styles.logict, () -> {}).size(90, 40).color(table.color).left().padLeft(2);
|
||||||
}).size(90, 40).color(table.color).left().padLeft(2);
|
|
||||||
|
|
||||||
table.add(" of ");
|
table.add(" of ");
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package mindustry.logic;
|
package mindustry.logic;
|
||||||
|
|
||||||
|
import arc.math.*;
|
||||||
|
|
||||||
public enum UnaryOp{
|
public enum UnaryOp{
|
||||||
negate("-", a -> -a),
|
negate("-", a -> -a),
|
||||||
not("not", a -> ~(int)(a)),
|
not("not", a -> ~(int)(a)),
|
||||||
@@ -12,6 +14,7 @@ public enum UnaryOp{
|
|||||||
floor("floor", Math::floor),
|
floor("floor", Math::floor),
|
||||||
ceil("ceil", Math::ceil),
|
ceil("ceil", Math::ceil),
|
||||||
sqrt("sqrt", Math::sqrt),
|
sqrt("sqrt", Math::sqrt),
|
||||||
|
rand("rand", d -> Mathf.rand.nextDouble() * d),
|
||||||
;
|
;
|
||||||
|
|
||||||
public static final UnaryOp[] all = values();
|
public static final UnaryOp[] all = values();
|
||||||
|
|||||||