mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-27 06:51:30 -08:00
Added repair point range display
This commit is contained in:
parent
6971a76c8e
commit
4ffe233321
2 changed files with 15 additions and 2 deletions
|
|
@ -14,7 +14,9 @@ import io.anuke.mindustry.entities.type.Unit;
|
|||
import io.anuke.mindustry.graphics.*;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.meta.BlockFlag;
|
||||
import io.anuke.mindustry.world.meta.*;
|
||||
|
||||
import static io.anuke.mindustry.Vars.tilesize;
|
||||
|
||||
public class RepairPoint extends Block{
|
||||
private static Rectangle rect = new Rectangle();
|
||||
|
|
@ -48,6 +50,12 @@ public class RepairPoint extends Block{
|
|||
laserEnd = Core.atlas.find("laser-end");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStats(){
|
||||
super.setStats();
|
||||
stats.add(BlockStat.range, repairRadius / tilesize, StatUnit.blocks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(){
|
||||
consumes.powerCond(powerUse, entity -> ((RepairPointEntity)entity).target != null);
|
||||
|
|
@ -59,6 +67,11 @@ public class RepairPoint extends Block{
|
|||
Drawf.dashCircle(tile.drawx(), tile.drawy(), repairRadius, Pal.accent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||
Drawf.dashCircle(x * tilesize + offset(), y * tilesize + offset(), repairRadius, Pal.accent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Tile tile){
|
||||
Draw.rect(baseRegion, tile.drawx(), tile.drawy());
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
org.gradle.daemon=true
|
||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||
archash=678dca4153074fd4eea29e217e8d8cb1fc56a98f
|
||||
archash=2db5436d41081362f15d1cf2175293a521d16e6f
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue