Simple mining AI
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user