Fully implemented dart ship factory

This commit is contained in:
Anuken
2018-06-26 12:44:40 -04:00
parent 7a049d64d8
commit e407ba3ad3
14 changed files with 634 additions and 621 deletions

View File

@@ -59,7 +59,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait {
public float pointerX, pointerY;
public String name = "name";
public String uuid, usid;
public boolean isAdmin, isTransferring, isShooting, isBoosting;
public boolean isAdmin, isTransferring, isShooting, isBoosting, isMobile;
public float boostHeat;
public Color color = new Color();
public Mech mech;
@@ -76,7 +76,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait {
private Queue<BuildRequest> placeQueue = new ThreadQueue<>();
private Tile mining;
private CarriableTrait carrying;
private Trail trail = new Trail(16);
private Trail trail = new Trail(12);
private Vector2 movement = new Vector2();
private boolean moved;
@@ -317,11 +317,11 @@ public class Player extends Unit implements BuilderTrait, CarryTrait {
Draw.rect(mech.region, x, y, rotation -90);
for (int i : Mathf.signs) {
float tra = rotation - 90, trY = - mech.weapon.getRecoil(this, i > 0)*1.5f;
float tra = rotation - 90, trY = - mech.weapon.getRecoil(this, i > 0)*1.5f + mech.weaponOffsetY;
float w = i > 0 ? -12 : 12;
Draw.rect(mech.weapon.equipRegion,
x + Angles.trnsx(tra, 0, trY),
y + Angles.trnsy(tra, 0, trY), w, 12, rotation - 90);
x + Angles.trnsx(tra, mech.weaponOffsetX * i, trY),
y + Angles.trnsy(tra, mech.weaponOffsetX * i, trY), w, 12, rotation - 90);
}
float backTrns = 4f, itemSize = 5f;
@@ -347,7 +347,9 @@ public class Player extends Unit implements BuilderTrait, CarryTrait {
@Override
public void drawOver(){
if(!isShooting() && !dead) {
if(dead) return;
if(!isShooting()) {
drawBuilding(this);
}
@@ -469,7 +471,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait {
if(ui.chatfrag.chatOpen()) return;
float speed = isBoosting ? mech.boostSpeed : mech.speed;
float speed = isBoosting && !mech.flying ? mech.boostSpeed : mech.speed;
//fraction of speed when at max load
float carrySlowdown = 0.7f;
@@ -644,7 +646,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait {
}
public boolean isShooting(){
return isShooting && inventory.hasAmmo() && !isBoosting;
return isShooting && inventory.hasAmmo() && (!isBoosting || mech.flying);
}
public void setRespawning(){