Legs -> Mech
This commit is contained in:
@@ -19,8 +19,8 @@ public class GroundAI extends AIController{
|
|||||||
target = null;
|
target = null;
|
||||||
|
|
||||||
//TODO this is hacky, cleanup
|
//TODO this is hacky, cleanup
|
||||||
if(unit instanceof Legsc && unit.moving()){
|
if(unit instanceof Mechc && unit.moving()){
|
||||||
unit.lookAt(((Legsc)unit).baseRotation());
|
unit.lookAt(((Mechc)unit).baseRotation());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ import mindustry.type.*;
|
|||||||
public class UnitTypes implements ContentList{
|
public class UnitTypes implements ContentList{
|
||||||
|
|
||||||
//ground
|
//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
|
//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
|
//air
|
||||||
public static @EntityDef({Unitc.class}) UnitType wraith, reaper, ghoul, revenant, lich;
|
public static @EntityDef({Unitc.class}) UnitType wraith, reaper, ghoul, revenant, lich;
|
||||||
|
|||||||
@@ -569,7 +569,7 @@ public class NetClient implements ApplicationListener{
|
|||||||
unit.x(), unit.y(),
|
unit.x(), unit.y(),
|
||||||
player.unit().aimX(), player.unit().aimY(),
|
player.unit().aimX(), player.unit().aimY(),
|
||||||
unit.rotation(),
|
unit.rotation(),
|
||||||
unit instanceof Legsc ? ((Legsc)unit).baseRotation() : 0,
|
unit instanceof Mechc ? ((Mechc)unit).baseRotation() : 0,
|
||||||
unit.vel().x, unit.vel().y,
|
unit.vel().x, unit.vel().y,
|
||||||
player.miner().mineTile(),
|
player.miner().mineTile(),
|
||||||
control.input.isBoosting, control.input.isShooting, ui.chatfrag.shown(),
|
control.input.isBoosting, control.input.isShooting, ui.chatfrag.shown(),
|
||||||
|
|||||||
@@ -640,7 +640,7 @@ public class NetServer implements ApplicationListener{
|
|||||||
fbuffer.position(0);
|
fbuffer.position(0);
|
||||||
|
|
||||||
//now, put the new position, rotation and baserotation into the buffer so it can be read
|
//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(rotation); //rotation is always there
|
||||||
fbuffer.put(newx);
|
fbuffer.put(newx);
|
||||||
fbuffer.put(newy);
|
fbuffer.put(newy);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import mindustry.annotations.Annotations.*;
|
|||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
|
|
||||||
@Component
|
@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;
|
@SyncField(false) @SyncLocal float baseRotation;
|
||||||
transient float walkTime;
|
transient float walkTime;
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ public class UnitType extends UnlockableContent{
|
|||||||
//region drawing
|
//region drawing
|
||||||
|
|
||||||
public void draw(Unitc unit){
|
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;
|
float z = unit.elevation() > 0.5f ? (lowAltitude ? Layer.flyingUnitLow : Layer.flyingUnit) : Layer.groundUnit;
|
||||||
|
|
||||||
if(unit.controller().isBeingControlled(player.unit())){
|
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.reset();
|
||||||
|
|
||||||
Draw.mixcol(Color.white, unit.hitTime());
|
Draw.mixcol(Color.white, unit.hitTime());
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ public class Generators{
|
|||||||
|
|
||||||
Image image = ImagePacker.get(type.region);
|
Image image = ImagePacker.get(type.region);
|
||||||
|
|
||||||
if(type.constructor.get() instanceof Legsc){
|
if(type.constructor.get() instanceof Mechc){
|
||||||
image.drawCenter(type.baseRegion);
|
image.drawCenter(type.baseRegion);
|
||||||
image.drawCenter(type.legRegion);
|
image.drawCenter(type.legRegion);
|
||||||
image.drawCenter(type.legRegion, true, false);
|
image.drawCenter(type.legRegion, true, false);
|
||||||
|
|||||||
Reference in New Issue
Block a user