Implemented dynamic ground unit spawning

This commit is contained in:
Anuken
2018-06-20 20:23:43 -04:00
parent 1c80314cfd
commit 45da578756
7 changed files with 121 additions and 17 deletions
@@ -251,7 +251,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
drownTime = Mathf.clamp(drownTime);
if(drownTime >= 1f){
damage(health + 1, false);
damage(health + 1);
}
float px = x, py = y;
@@ -111,6 +111,7 @@ public abstract class GroundUnit extends BaseUnit {
protected void moveToCore(){
Tile tile = world.tileWorld(x, y);
if(tile == null) return;
Tile targetTile = world.pathfinder().getTargetTile(team, tile);
if(tile == targetTile) return;
@@ -150,7 +151,7 @@ public abstract class GroundUnit extends BaseUnit {
}
//TODO move toward resupply point
if(inventory.totalAmmo() + 10 >= inventory.ammoCapacity()){
if(isWave || inventory.totalAmmo() + 10 >= inventory.ammoCapacity()){
state.set(attack);
}
}