Force projector heat sense

This commit is contained in:
Anuken 2021-02-10 14:42:30 -05:00
parent 949f5eccd7
commit ea2b57ec4b
2 changed files with 13 additions and 5 deletions

View file

@ -338,17 +338,19 @@ public class LExecutor{
@Nullable
public static LogicAI checkLogicAI(LExecutor exec, Object unitObj){
if(unitObj instanceof Unit unit && exec.obj(varUnit) == unit && unit.team == exec.team && !unit.isPlayer() && !(unit.controller() instanceof FormationAI)){
if(!(unit.controller() instanceof LogicAI)){
unit.controller(new LogicAI());
((LogicAI)unit.controller()).controller = exec.building(varThis);
if(unit.controller() instanceof LogicAI la){
return la;
}else{
var la = new LogicAI();
la.controller = exec.building(varThis);
unit.controller(la);
//clear old state
unit.mineTile = null;
unit.clearBuilding();
return (LogicAI)unit.controller();
return la;
}
return (LogicAI)unit.controller();
}
return null;
}

View file

@ -178,6 +178,12 @@ public class ForceProjector extends Block{
return (radius + phaseHeat * phaseRadiusBoost) * radscl;
}
@Override
public double sense(LAccess sensor){
if(sensor == LAccess.heat) return buildup;
return super.sense(sensor);
}
@Override
public void draw(){
super.draw();