mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-26 14:32:06 -08:00
Merge pull request #2863 from MEEPofFaith/patch-2
If units can have `chargeSound`, why not `chargeTurret`s too?
This commit is contained in:
commit
fbda1fb7cf
2 changed files with 7 additions and 2 deletions
|
|
@ -1,10 +1,13 @@
|
|||
package mindustry.world.blocks.defense.turrets;
|
||||
|
||||
import arc.audio.*;
|
||||
import arc.math.*;
|
||||
import arc.util.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.entities.bullet.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
|
|
@ -14,6 +17,7 @@ public class ChargeTurret extends PowerTurret{
|
|||
public float chargeMaxDelay = 10f;
|
||||
public Effect chargeEffect = Fx.none;
|
||||
public Effect chargeBeginEffect = Fx.none;
|
||||
public Sound chargeSound = Sounds.none;
|
||||
|
||||
public ChargeTurret(String name){
|
||||
super(name);
|
||||
|
|
@ -28,7 +32,8 @@ public class ChargeTurret extends PowerTurret{
|
|||
|
||||
tr.trns(rotation, size * tilesize / 2f);
|
||||
chargeBeginEffect.at(x + tr.x, y + tr.y, rotation);
|
||||
|
||||
chargeSound.at(x + tr.x, y + tr.y, 1);
|
||||
|
||||
for(int i = 0; i < chargeEffects; i++){
|
||||
Time.run(Mathf.random(chargeMaxDelay), () -> {
|
||||
if(!isValid()) return;
|
||||
|
|
|
|||
|
|
@ -434,7 +434,7 @@ public abstract class Turret extends Block{
|
|||
|
||||
fshootEffect.at(x + tr.x, y + tr.y, rotation);
|
||||
fsmokeEffect.at(x + tr.x, y + tr.y, rotation);
|
||||
shootSound.at(tile, Mathf.random(0.9f, 1.1f));
|
||||
shootSound.at(x + tr.x, y + tr.y, Mathf.random(0.9f, 1.1f));
|
||||
|
||||
if(shootShake > 0){
|
||||
Effect.shake(shootShake, shootShake, this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue