Added sounds for picking up and dropping payloads
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package mindustry.entities.comp;
|
||||
|
||||
import arc.*;
|
||||
import arc.audio.*;
|
||||
import arc.math.*;
|
||||
import arc.scene.ui.layout.*;
|
||||
import arc.struct.*;
|
||||
@@ -105,6 +106,7 @@ abstract class PayloadComp implements Posc, Rotc, Hitboxc, Unitc{
|
||||
if(Vars.net.client()){
|
||||
Vars.netClient.clearRemovedEntity(unit.id);
|
||||
}
|
||||
Sounds.payloadPickup.at(self(), Mathf.random(0.9f, 1.1f));
|
||||
Events.fire(new PickupEvent(self(), unit));
|
||||
}
|
||||
|
||||
@@ -114,6 +116,7 @@ abstract class PayloadComp implements Posc, Rotc, Hitboxc, Unitc{
|
||||
tile.afterPickedUp();
|
||||
addPayload(new BuildPayload(tile));
|
||||
Fx.unitPickup.at(tile);
|
||||
Sounds.payloadPickup.at(self());
|
||||
Events.fire(new PickupEvent(self(), tile));
|
||||
}
|
||||
|
||||
@@ -177,6 +180,11 @@ abstract class PayloadComp implements Posc, Rotc, Hitboxc, Unitc{
|
||||
if(!u.isAdded()) u.team.data().updateCount(u.type, -1);
|
||||
u.add();
|
||||
u.unloaded();
|
||||
Sound dropSound =
|
||||
payload.size() <= 12f ? Sounds.payloadDrop1 :
|
||||
payload.size() <= 20f ? Sounds.payloadDrop2 :
|
||||
Sounds.payloadDrop3;
|
||||
dropSound.at(self(), Mathf.random(0.9f, 1.1f));
|
||||
Events.fire(new PayloadDropEvent(self(), u));
|
||||
|
||||
return true;
|
||||
@@ -197,6 +205,7 @@ abstract class PayloadComp implements Posc, Rotc, Hitboxc, Unitc{
|
||||
|
||||
Fx.unitDrop.at(tile);
|
||||
on.block().placeEffect.at(on.drawx(), on.drawy(), on.block().size);
|
||||
on.block().placeSound.at(tile);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user