Added basic enemy spawning, fixed turret base sprite, input place lag
This commit is contained in:
@@ -92,7 +92,6 @@ public class Player extends Unit implements BlockBuilder {
|
||||
|
||||
@Override
|
||||
public void damage(float amount){
|
||||
//if(debug || mech.flying) return;
|
||||
hitTime = hitDuration;
|
||||
if(!debug) {
|
||||
health -= amount;
|
||||
@@ -111,6 +110,7 @@ public class Player extends Unit implements BlockBuilder {
|
||||
@Override
|
||||
public void onDeath(){
|
||||
dead = true;
|
||||
placeQueue.clear();
|
||||
if(Net.active()){
|
||||
NetEvents.handleUnitDeath(this);
|
||||
}
|
||||
@@ -215,7 +215,7 @@ public class Player extends Unit implements BlockBuilder {
|
||||
|
||||
@Override
|
||||
public void drawOver(){
|
||||
if(!isShooting() && getCurrentRequest() != null) {
|
||||
if(!isShooting() && getCurrentRequest() != null && !dead) {
|
||||
drawBuilding(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,12 +15,17 @@ public class UnitInventory {
|
||||
private int totalAmmo;
|
||||
private ItemStack item;
|
||||
private int capacity, ammoCapacity;
|
||||
private boolean infiniteAmmo;
|
||||
|
||||
public UnitInventory(int capacity, int ammoCapacity) {
|
||||
this.capacity = capacity;
|
||||
this.ammoCapacity = ammoCapacity;
|
||||
}
|
||||
|
||||
public void setInfiniteAmmo(boolean infinite){
|
||||
infiniteAmmo = infinite;
|
||||
}
|
||||
|
||||
public void write(DataOutputStream stream) throws IOException {
|
||||
stream.writeInt(item == null ? 0 : item.amount);
|
||||
stream.writeByte(item == null ? 0 : item.item.id);
|
||||
@@ -57,6 +62,7 @@ public class UnitInventory {
|
||||
}
|
||||
|
||||
public void useAmmo(){
|
||||
if(infiniteAmmo) return;
|
||||
AmmoEntry entry = ammos.peek();
|
||||
entry.amount --;
|
||||
if(entry.amount == 0) ammos.pop();
|
||||
|
||||
@@ -52,6 +52,12 @@ public class FlyingUnitType extends UnitType {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public UnitState getStartState(){
|
||||
return attack;
|
||||
}
|
||||
|
||||
protected void circle(BaseUnit unit, float circleLength){
|
||||
vec.set(unit.target.x - unit.x, unit.target.y - unit.y);
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import io.anuke.mindustry.content.fx.UnitFx;
|
||||
import io.anuke.mindustry.entities.Unit;
|
||||
import io.anuke.mindustry.entities.units.BaseUnit;
|
||||
import io.anuke.mindustry.entities.units.FlyingUnitType;
|
||||
import io.anuke.mindustry.entities.units.UnitState;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
@@ -66,9 +65,4 @@ public class Vtol extends FlyingUnitType {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public UnitState getStartState(){
|
||||
return resupply;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user