mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-27 06:51:30 -08:00
Merge pull request #3163 from summetdev/logic-bounded
"Controlled" property for logic
This commit is contained in:
commit
d11a03e7d8
3 changed files with 5 additions and 0 deletions
|
|
@ -29,6 +29,7 @@ import mindustry.logic.*;
|
|||
import mindustry.type.*;
|
||||
import mindustry.ui.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.*;
|
||||
import mindustry.world.blocks.ConstructBlock.*;
|
||||
import mindustry.world.blocks.environment.*;
|
||||
import mindustry.world.blocks.payloads.*;
|
||||
|
|
@ -1285,6 +1286,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||
case powerNetStored -> power == null ? 0 : power.graph.getLastPowerStored();
|
||||
case powerNetCapacity -> power == null ? 0 : power.graph.getLastCapacity();
|
||||
case enabled -> enabled ? 1 : 0;
|
||||
case controlled -> this instanceof ControlBlock c ? c.isControlled() ? 1 : 0 : 0;
|
||||
case payloadCount -> getPayload() != null ? 1 : 0;
|
||||
default -> 0;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import arc.scene.ui.layout.*;
|
|||
import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import mindustry.ai.*;
|
||||
import mindustry.ai.types.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.core.*;
|
||||
|
|
@ -105,6 +106,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||
case shootX -> World.conv(aimX());
|
||||
case shootY -> World.conv(aimY());
|
||||
case flag -> flag;
|
||||
case controlled -> controller instanceof LogicAI || controller instanceof Player ? 1 : 0;
|
||||
case payloadCount -> self() instanceof Payloadc pay ? pay.payloads().size : 0;
|
||||
default -> 0;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ public enum LAccess{
|
|||
team,
|
||||
type,
|
||||
flag,
|
||||
controlled,
|
||||
name,
|
||||
config,
|
||||
payloadCount,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue