Legs -> Mech
This commit is contained in:
@@ -19,8 +19,8 @@ public class GroundAI extends AIController{
|
||||
target = null;
|
||||
|
||||
//TODO this is hacky, cleanup
|
||||
if(unit instanceof Legsc && unit.moving()){
|
||||
unit.lookAt(((Legsc)unit).baseRotation());
|
||||
if(unit instanceof Mechc && unit.moving()){
|
||||
unit.lookAt(((Mechc)unit).baseRotation());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,10 +12,10 @@ import mindustry.type.*;
|
||||
public class UnitTypes implements ContentList{
|
||||
|
||||
//ground
|
||||
public static @EntityDef({Unitc.class, Legsc.class}) UnitType titan, dagger, crawler, fortress, eruptor, chaosArray, eradicator;
|
||||
public static @EntityDef({Unitc.class, Mechc.class}) UnitType titan, dagger, crawler, fortress, eruptor, chaosArray, eradicator;
|
||||
|
||||
//ground + builder
|
||||
public static @EntityDef({Unitc.class, Legsc.class, Builderc.class}) UnitType oculon, tau;
|
||||
public static @EntityDef({Unitc.class, Mechc.class, Builderc.class}) UnitType oculon, tau;
|
||||
|
||||
//air
|
||||
public static @EntityDef({Unitc.class}) UnitType wraith, reaper, ghoul, revenant, lich;
|
||||
|
||||
@@ -569,7 +569,7 @@ public class NetClient implements ApplicationListener{
|
||||
unit.x(), unit.y(),
|
||||
player.unit().aimX(), player.unit().aimY(),
|
||||
unit.rotation(),
|
||||
unit instanceof Legsc ? ((Legsc)unit).baseRotation() : 0,
|
||||
unit instanceof Mechc ? ((Mechc)unit).baseRotation() : 0,
|
||||
unit.vel().x, unit.vel().y,
|
||||
player.miner().mineTile(),
|
||||
control.input.isBoosting, control.input.isShooting, ui.chatfrag.shown(),
|
||||
|
||||
@@ -640,7 +640,7 @@ public class NetServer implements ApplicationListener{
|
||||
fbuffer.position(0);
|
||||
|
||||
//now, put the new position, rotation and baserotation into the buffer so it can be read
|
||||
if(unit instanceof Legsc) fbuffer.put(baseRotation); //base rotation is optional
|
||||
if(unit instanceof Mechc) fbuffer.put(baseRotation); //base rotation is optional
|
||||
fbuffer.put(rotation); //rotation is always there
|
||||
fbuffer.put(newx);
|
||||
fbuffer.put(newy);
|
||||
|
||||
@@ -6,7 +6,7 @@ import mindustry.annotations.Annotations.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
@Component
|
||||
abstract class LegsComp implements Posc, Flyingc, Hitboxc, Unitc, Legsc, ElevationMovec{
|
||||
abstract class MechComp implements Posc, Flyingc, Hitboxc, Unitc, Mechc, ElevationMovec{
|
||||
@SyncField(false) @SyncLocal float baseRotation;
|
||||
transient float walkTime;
|
||||
|
||||
@@ -125,7 +125,7 @@ public class UnitType extends UnlockableContent{
|
||||
//region drawing
|
||||
|
||||
public void draw(Unitc unit){
|
||||
Legsc legs = unit instanceof Legsc ? (Legsc)unit : null;
|
||||
Mechc legs = unit instanceof Mechc ? (Mechc)unit : null;
|
||||
float z = unit.elevation() > 0.5f ? (lowAltitude ? Layer.flyingUnitLow : Layer.flyingUnit) : Layer.groundUnit;
|
||||
|
||||
if(unit.controller().isBeingControlled(player.unit())){
|
||||
@@ -309,7 +309,7 @@ public class UnitType extends UnlockableContent{
|
||||
}
|
||||
}
|
||||
|
||||
public void drawLegs(Legsc unit){
|
||||
public void drawLegs(Mechc unit){
|
||||
Draw.reset();
|
||||
|
||||
Draw.mixcol(Color.white, unit.hitTime());
|
||||
|
||||
Reference in New Issue
Block a user