Bugfixes
This commit is contained in:
@@ -331,6 +331,11 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
//endregion
|
||||
//region handler methods
|
||||
|
||||
/** Called when this block is dropped as a payload. */
|
||||
public void dropped(){
|
||||
|
||||
}
|
||||
|
||||
/** This is for logic blocks. */
|
||||
public void handleString(Object value){
|
||||
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package mindustry.entities.comp;
|
||||
|
||||
import arc.func.*;
|
||||
import arc.math.geom.*;
|
||||
import arc.struct.*;
|
||||
import arc.util.ArcAnnotate.*;
|
||||
import mindustry.ai.formations.*;
|
||||
import mindustry.ai.types.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
@@ -12,6 +15,7 @@ import mindustry.gen.*;
|
||||
@Component
|
||||
abstract class CommanderComp implements Unitc{
|
||||
private static final Seq<FormationMember> members = new Seq<>();
|
||||
private static final Seq<Unit> units = new Seq<>();
|
||||
|
||||
@Import float x, y, rotation;
|
||||
|
||||
@@ -44,6 +48,28 @@ abstract class CommanderComp implements Unitc{
|
||||
clearCommand();
|
||||
}
|
||||
|
||||
void commandNearby(FormationPattern pattern){
|
||||
commandNearby(pattern, u -> true);
|
||||
}
|
||||
|
||||
void commandNearby(FormationPattern pattern, Boolf<Unit> include){
|
||||
Formation formation = new Formation(new Vec3(x, y, rotation), pattern);
|
||||
formation.slotAssignmentStrategy = new DistanceAssignmentStrategy(pattern);
|
||||
|
||||
units.clear();
|
||||
|
||||
Units.nearby(team(), x, y, 200f, u -> {
|
||||
if(u.isAI() && include.get(u) && u != base()){
|
||||
units.add(u);
|
||||
}
|
||||
});
|
||||
|
||||
units.sort(u -> u.dst2(this));
|
||||
units.truncate(type().commandLimit);
|
||||
|
||||
command(formation, units);
|
||||
}
|
||||
|
||||
void command(Formation formation, Seq<Unit> units){
|
||||
clearCommand();
|
||||
|
||||
|
||||
@@ -62,8 +62,8 @@ abstract class WaterMoveComp implements Posc, Velc, Hitboxc, Flyingc, Unitc{
|
||||
|
||||
Draw.z(Layer.debris);
|
||||
|
||||
Floor floor = floorOn();
|
||||
Color color = Tmp.c1.set(floor.mapColor).mul(1.5f);
|
||||
Floor floor = tileOn() == null ? Blocks.air.asFloor() : tileOn().floor();
|
||||
Color color = Tmp.c1.set(floor.mapColor.equals(Color.black) ? Blocks.water.mapColor : floor.mapColor).mul(1.5f);
|
||||
trailColor.lerp(color, Mathf.clamp(Time.delta * 0.04f));
|
||||
|
||||
tleft.draw(trailColor, type.trailScl);
|
||||
|
||||
Reference in New Issue
Block a user