mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-03-09 08:20:55 -07:00
Added sounds for picking up and dropping payloads
This commit is contained in:
parent
8d16c1768e
commit
2fa5cf5dab
5 changed files with 9 additions and 0 deletions
BIN
core/assets/sounds/block/payloadDrop1.ogg
Normal file
BIN
core/assets/sounds/block/payloadDrop1.ogg
Normal file
Binary file not shown.
BIN
core/assets/sounds/block/payloadDrop2.ogg
Normal file
BIN
core/assets/sounds/block/payloadDrop2.ogg
Normal file
Binary file not shown.
BIN
core/assets/sounds/block/payloadDrop3.ogg
Normal file
BIN
core/assets/sounds/block/payloadDrop3.ogg
Normal file
Binary file not shown.
BIN
core/assets/sounds/block/payloadPickup.ogg
Normal file
BIN
core/assets/sounds/block/payloadPickup.ogg
Normal file
Binary file not shown.
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue