mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-27 23:11:12 -08:00
Force projector heat sense
This commit is contained in:
parent
949f5eccd7
commit
ea2b57ec4b
2 changed files with 13 additions and 5 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue