New unit death, wreck and creation noises

This commit is contained in:
Anuken
2025-12-08 19:30:09 -05:00
parent 6d2b324f81
commit cae67b7897
19 changed files with 50 additions and 5 deletions

View File

@@ -854,7 +854,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
Effect.scorch(x, y, (int)(hitSize / 5));
}
Effect.shake(shake, shake, this);
type.deathSound.at(this);
type.deathSound.at(this, 1f, type.deathSoundVolume);
Events.fire(new UnitDestroyEvent(self()));
@@ -935,6 +935,8 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
//don't waste time when the unit is already on the ground, just destroy it
if(!type.flying || !type.createWreck){
destroy();
}else{
type.wreckSound.at(this, 1f, type.wreckSoundVolume);
}
}

View File

@@ -380,7 +380,7 @@ public class AIController implements UnitController{
if(arrive && length > 0){
Tmp.v3.set(-unit.vel.x / unit.type.accel * 2f, -unit.vel.y / unit.type.accel * 2f).add((target.getX() - unit.x), (target.getY() - unit.y));
if(unit.type.omniMovement){
if(unit.type.omniMovement || unit.type.rotateMoveFirst){
vec.add(Tmp.v3).limit(speed * length);
}else{
//directly move the unit to prevent a backwards movement vector from messing things up