If units can have chargeSound, why not chargeTurrets too?

This commit is contained in:
MEEP of Faith
2020-10-07 18:24:30 -07:00
committed by GitHub
parent 29ccc5010a
commit 3d4ace6ca8

View File

@@ -1,5 +1,6 @@
package mindustry.world.blocks.defense.turrets;
import arc.audio.*;
import arc.math.*;
import arc.util.*;
import mindustry.content.*;
@@ -14,6 +15,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 +30,8 @@ public class ChargeTurret extends PowerTurret{
tr.trns(rotation, size * tilesize / 2f);
chargeBeginEffect.at(x + tr.x, y + tr.y, rotation);
chargeSound.at(tile, Mathf.random(0.9f, 1.1f));
for(int i = 0; i < chargeEffects; i++){
Time.run(Mathf.random(chargeMaxDelay), () -> {
if(!isValid()) return;