Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features
Conflicts: core/src/mindustry/entities/comp/FlyingComp.java
This commit is contained in:
@@ -48,6 +48,10 @@ abstract class FlyingComp implements Posc, Velc, Healthc, Hitboxc{
|
||||
return canDrown() ? floorOn() : null;
|
||||
}
|
||||
|
||||
boolean emitWalkSound(){
|
||||
return true;
|
||||
}
|
||||
|
||||
void landed(){
|
||||
|
||||
}
|
||||
@@ -59,7 +63,7 @@ abstract class FlyingComp implements Posc, Velc, Healthc, Hitboxc{
|
||||
|
||||
void moveAt(Vec2 vector, float acceleration){
|
||||
Vec2 t = tmp1.set(vector); //target vector
|
||||
tmp2.set(t).sub(vel).limit(acceleration * vector.len() * Time.delta * floorSpeedMultiplier()); //delta vector
|
||||
tmp2.set(t).sub(vel).limit(acceleration * vector.len() * Time.delta); //delta vector
|
||||
vel.add(tmp2);
|
||||
}
|
||||
|
||||
@@ -87,7 +91,7 @@ abstract class FlyingComp implements Posc, Velc, Healthc, Hitboxc{
|
||||
floor.walkEffect.at(x, y, hitSize() / 8f, floor.mapColor);
|
||||
splashTimer = 0f;
|
||||
|
||||
if(!(this instanceof WaterMovec)){
|
||||
if(emitWalkSound()){
|
||||
floor.walkSound.at(x, y, Mathf.random(floor.walkSoundPitchMin, floor.walkSoundPitchMax), floor.walkSoundVolume);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,15 +104,18 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
||||
return type.hasWeapons();
|
||||
}
|
||||
|
||||
/** @return speed with boost & floor multipliers factored in. */
|
||||
public float speed(){
|
||||
float strafePenalty = isGrounded() || !isPlayer() ? 1f : Mathf.lerp(1f, type.strafePenalty, Angles.angleDist(vel().angle(), rotation) / 180f);
|
||||
float boost = Mathf.lerp(1f, type.canBoost ? type.boostMultiplier : 1f, elevation);
|
||||
//limit speed to minimum formation speed to preserve formation
|
||||
return (isCommanding() ? minFormationSpeed * 0.98f : type.speed) * strafePenalty;
|
||||
return (isCommanding() ? minFormationSpeed * 0.98f : type.speed) * strafePenalty * boost * floorSpeedMultiplier();
|
||||
}
|
||||
|
||||
/** @return speed with boost multipliers factored in. */
|
||||
/** @deprecated use speed() instead */
|
||||
@Deprecated
|
||||
public float realSpeed(){
|
||||
return Mathf.lerp(1f, type.canBoost ? type.boostMultiplier : 1f, elevation) * speed() * floorSpeedMultiplier();
|
||||
return speed();
|
||||
}
|
||||
|
||||
/** Iterates through this unit and everything it is controlling. */
|
||||
|
||||
@@ -44,6 +44,13 @@ abstract class WaterMoveComp implements Posc, Velc, Hitboxc, Flyingc, Unitc{
|
||||
return Pathfinder.costNaval;
|
||||
}
|
||||
|
||||
//don't want obnoxious splashing
|
||||
@Override
|
||||
@Replace
|
||||
public boolean emitWalkSound(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(){
|
||||
tleft.clear();
|
||||
|
||||
@@ -238,7 +238,7 @@ public class AIController implements UnitController{
|
||||
|
||||
float length = circleLength <= 0.001f ? 1f : Mathf.clamp((unit.dst(target) - circleLength) / smooth, -1f, 1f);
|
||||
|
||||
vec.setLength(unit.realSpeed() * length);
|
||||
vec.setLength(unit.speed() * length);
|
||||
if(length < -0.5f){
|
||||
vec.rotate(180f);
|
||||
}else if(length < 0){
|
||||
|
||||
Reference in New Issue
Block a user