This commit is contained in:
Anuken 2020-07-30 19:00:19 -04:00
parent 01e3599c7d
commit a297d11023
6 changed files with 9 additions and 9 deletions

View File

@ -63,15 +63,15 @@ public class Fx{
}),
unitDespawn = new Effect(100f, e -> {
if(!(e.data instanceof Unitc)) return;
if(!(e.data instanceof Unit) || e.<Unit>data().type() == null) return;
Unitc select = (Unitc)e.data;
Unit select = e.data();
float scl = e.fout(Interp.pow2Out);
float p = Draw.scl;
Draw.scl *= scl;
mixcol(Pal.accent, 1f);
rect(select.type().icon(Cicon.full), select.x(), select.y(), select.rotation() - 90f);
rect(select.type().icon(Cicon.full), select.x, select.y, select.rotation - 90f);
reset();
Draw.scl = p;

View File

@ -114,7 +114,7 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc, Dra
//update some basic state to sync things
if(unit.type().canBoost){
Tile tile = unit.tileOn();
unit.elevation(Mathf.approachDelta(unit.elevation, (tile != null && tile.solid()) || boosting ? 1f : 0f, 0.08f));
unit.elevation = Mathf.approachDelta(unit.elevation, (tile != null && tile.solid()) || boosting ? 1f : 0f, 0.08f);
}
}else if(core != null){
//have a small delay before death to prevent the camera from jumping around too quickly

View File

@ -130,7 +130,6 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
this.type = type;
this.maxHealth = type.health;
this.drag = type.drag;
this.elevation = type.flying ? 1f : 0;
this.armor = type.armor;
this.hitSize = type.hitsize;
this.hovering = type.hovering;

View File

@ -570,7 +570,7 @@ public class DesktopInput extends InputHandler{
boolean legs = unit.isGrounded();
float strafePenalty = legs ? 1f : Mathf.lerp(1f, unit.type().strafePenalty, Angles.angleDist(unit.vel().angle(), unit.rotation()) / 180f);
float speed = unit.type().speed * Mathf.lerp(1f, unit.type().canBoost ? unit.type().boostMultiplier : 1f, unit.elevation()) * strafePenalty;
float speed = unit.type().speed * Mathf.lerp(1f, unit.type().canBoost ? unit.type().boostMultiplier : 1f, unit.elevation) * strafePenalty;
float xa = Core.input.axis(Binding.move_x);
float ya = Core.input.axis(Binding.move_y);
boolean boosted = (unit instanceof Mechc && unit.isFlying());

View File

@ -806,7 +806,7 @@ public class MobileInput extends InputHandler implements GestureListener{
targetPos.set(Core.camera.position);
float attractDst = 15f;
float strafePenalty = legs ? 1f : Mathf.lerp(1f, type.strafePenalty, Angles.angleDist(unit.vel.angle(), unit.rotation) / 180f);
float speed = type.speed * Mathf.lerp(1f, type.canBoost ? type.boostMultiplier : 1f, unit.elevation()) * strafePenalty;
float speed = type.speed * Mathf.lerp(1f, type.canBoost ? type.boostMultiplier : 1f, unit.elevation) * strafePenalty;
float range = unit.hasWeapons() ? unit.range() : 0f;
float bulletSpeed = unit.hasWeapons() ? type.weapons.first().bullet.speed : 0f;
float mouseAngle = unit.angleTo(unit.aimX(), unit.aimY());

View File

@ -101,9 +101,10 @@ public class UnitType extends UnlockableContent{
public Unit create(Team team){
Unit unit = constructor.get();
unit.team(team);
unit.team = team;
unit.type(this);
unit.ammo(ammoCapacity); //fill up on ammo upon creation
unit.ammo = ammoCapacity; //fill up on ammo upon creation
unit.elevation = flying ? 1f : 0;
unit.heal();
return unit;
}