Force projector heat sense
This commit is contained in:
@@ -338,17 +338,19 @@ public class LExecutor{
|
|||||||
@Nullable
|
@Nullable
|
||||||
public static LogicAI checkLogicAI(LExecutor exec, Object unitObj){
|
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(unitObj instanceof Unit unit && exec.obj(varUnit) == unit && unit.team == exec.team && !unit.isPlayer() && !(unit.controller() instanceof FormationAI)){
|
||||||
if(!(unit.controller() instanceof LogicAI)){
|
if(unit.controller() instanceof LogicAI la){
|
||||||
unit.controller(new LogicAI());
|
return la;
|
||||||
((LogicAI)unit.controller()).controller = exec.building(varThis);
|
}else{
|
||||||
|
var la = new LogicAI();
|
||||||
|
la.controller = exec.building(varThis);
|
||||||
|
|
||||||
|
unit.controller(la);
|
||||||
//clear old state
|
//clear old state
|
||||||
unit.mineTile = null;
|
unit.mineTile = null;
|
||||||
unit.clearBuilding();
|
unit.clearBuilding();
|
||||||
|
|
||||||
return (LogicAI)unit.controller();
|
return la;
|
||||||
}
|
}
|
||||||
return (LogicAI)unit.controller();
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,6 +178,12 @@ public class ForceProjector extends Block{
|
|||||||
return (radius + phaseHeat * phaseRadiusBoost) * radscl;
|
return (radius + phaseHeat * phaseRadiusBoost) * radscl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double sense(LAccess sensor){
|
||||||
|
if(sensor == LAccess.heat) return buildup;
|
||||||
|
return super.sense(sensor);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(){
|
public void draw(){
|
||||||
super.draw();
|
super.draw();
|
||||||
|
|||||||
Reference in New Issue
Block a user