Closes Anuken/Mindustry-Suggestions/issues/6060
This commit is contained in:
@@ -2687,6 +2687,7 @@ laccess.displaywidth = Width of a display block in pixels.
|
|||||||
laccess.displayheight = Height of a display block in pixels.
|
laccess.displayheight = Height of a display block in pixels.
|
||||||
laccess.buffersize = For messages: Length of the contents.\nFor displays: Number of unprocessed graphics commands.
|
laccess.buffersize = For messages: Length of the contents.\nFor displays: Number of unprocessed graphics commands.
|
||||||
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
|
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
|
||||||
|
laccess.maxunits = Maximum units that a team can have.\nCan only be sensed from cores.
|
||||||
|
|
||||||
lcategory.unknown = Unknown
|
lcategory.unknown = Unknown
|
||||||
lcategory.unknown.description = Uncategorized instructions.
|
lcategory.unknown.description = Uncategorized instructions.
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ public enum LAccess{
|
|||||||
payloadType,
|
payloadType,
|
||||||
totalPayload,
|
totalPayload,
|
||||||
payloadCapacity,
|
payloadCapacity,
|
||||||
|
maxUnits,
|
||||||
id,
|
id,
|
||||||
|
|
||||||
//values with parameters are considered controllable
|
//values with parameters are considered controllable
|
||||||
|
|||||||
@@ -550,9 +550,16 @@ public class CoreBlock extends StorageBlock{
|
|||||||
@Override
|
@Override
|
||||||
public double sense(LAccess sensor){
|
public double sense(LAccess sensor){
|
||||||
if(sensor == LAccess.itemCapacity) return storageCapacity;
|
if(sensor == LAccess.itemCapacity) return storageCapacity;
|
||||||
|
if(sensor == LAccess.maxUnits) return Units.getCap(team);
|
||||||
return super.sense(sensor);
|
return super.sense(sensor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double sense(Content content){
|
||||||
|
if(content instanceof UnitType type) return team.data().countType(type);
|
||||||
|
return super.sense(content);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canControlSelect(Unit player){
|
public boolean canControlSelect(Unit player){
|
||||||
return player.isPlayer();
|
return player.isPlayer();
|
||||||
|
|||||||
Reference in New Issue
Block a user