Simple mining AI

This commit is contained in:
Anuken
2020-08-12 00:08:23 -04:00
parent 8810cf037e
commit 925b1e3057
11 changed files with 150 additions and 68 deletions

View File

@@ -175,6 +175,7 @@ public abstract class Turret extends Block{
@Override
public double sense(LAccess sensor){
if(sensor == LAccess.rotation) return rotation;
if(sensor == LAccess.shootX) return targetPos.x;
if(sensor == LAccess.shootY) return targetPos.y;
if(sensor == LAccess.shooting) return (isControlled() ? unit.isShooting() : logicControlled() ? logicShooting : validateTarget()) ? 1 : 0;

View File

@@ -76,6 +76,7 @@ public class LogicBlock extends Block{
public void updateCodeVars(String str, Cons<LAssembler> assemble){
if(str != null){
if(str.length() >= Short.MAX_VALUE) str = str.substring(0, Short.MAX_VALUE - 1);
code = str;
try{