Manual turret control
This commit is contained in:
32
core/src/mindustry/entities/comp/BlockUnitComp.java
Normal file
32
core/src/mindustry/entities/comp/BlockUnitComp.java
Normal file
@@ -0,0 +1,32 @@
|
||||
package mindustry.entities.comp;
|
||||
|
||||
import arc.util.ArcAnnotate.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
import static mindustry.Vars.tilesize;
|
||||
|
||||
@Component
|
||||
abstract class BlockUnitComp implements Unitc{
|
||||
@ReadOnly @NonNull Tilec tile;
|
||||
|
||||
public void tile(Tilec tile){
|
||||
this.tile = tile;
|
||||
|
||||
//sets up block stats
|
||||
maxHealth(tile.block().health);
|
||||
health(tile.health());
|
||||
hitSize(tile.block().size * tilesize);
|
||||
set(tile);
|
||||
}
|
||||
|
||||
@Replace
|
||||
public void kill(){
|
||||
tile.kill();
|
||||
}
|
||||
|
||||
@Replace
|
||||
public void damage(float v, boolean b){
|
||||
tile.damage(v, b);
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
|
||||
|
||||
private transient float timeScale = 1f, timeScaleDuration;
|
||||
|
||||
private transient @Nullable mindustry.audio.SoundLoop sound;
|
||||
private transient @Nullable SoundLoop sound;
|
||||
|
||||
private transient boolean sleeping;
|
||||
private transient float sleepTime;
|
||||
@@ -84,6 +84,8 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
|
||||
add();
|
||||
}
|
||||
|
||||
created();
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -296,6 +298,8 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
|
||||
|
||||
//endregion
|
||||
//region handler methods
|
||||
|
||||
public void created(){}
|
||||
|
||||
public boolean shouldConsume(){
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user