Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -2,6 +2,7 @@ package mindustry.core;
|
||||
|
||||
import arc.*;
|
||||
import arc.assets.loaders.TextureLoader.*;
|
||||
import arc.audio.*;
|
||||
import arc.files.*;
|
||||
import arc.graphics.*;
|
||||
import arc.graphics.Texture.*;
|
||||
@@ -554,6 +555,11 @@ public class Renderer implements ApplicationListener{
|
||||
landTime = landCore.landDuration();
|
||||
launchCoreType = coreType;
|
||||
|
||||
Music music = landCore.launchMusic();
|
||||
music.stop();
|
||||
music.play();
|
||||
music.setVolume(settings.getInt("musicvol") / 100f);
|
||||
|
||||
landCore.beginLaunch(coreType);
|
||||
}
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ abstract class StatusComp implements Posc, Flyingc{
|
||||
}
|
||||
|
||||
void clearStatuses(){
|
||||
statuses.each(e -> e.effect.onRemoved(self()));
|
||||
statuses.clear();
|
||||
}
|
||||
|
||||
@@ -80,6 +81,7 @@ abstract class StatusComp implements Posc, Flyingc{
|
||||
void unapply(StatusEffect effect){
|
||||
statuses.remove(e -> {
|
||||
if(e.effect == effect){
|
||||
e.effect.onRemoved(self());
|
||||
Pools.free(e);
|
||||
return true;
|
||||
}
|
||||
@@ -189,6 +191,10 @@ abstract class StatusComp implements Posc, Flyingc{
|
||||
entry.time = Math.max(entry.time - Time.delta, 0);
|
||||
|
||||
if(entry.effect == null || (entry.time <= 0 && !entry.effect.permanent)){
|
||||
if(entry.effect != null){
|
||||
entry.effect.onRemoved(self());
|
||||
}
|
||||
|
||||
Pools.free(entry);
|
||||
index --;
|
||||
statuses.remove(index);
|
||||
|
||||
@@ -142,6 +142,11 @@ public class StatusEffect extends UnlockableContent{
|
||||
}
|
||||
}
|
||||
|
||||
/** Called when status effect is removed. */
|
||||
public void onRemoved(Unit unit){
|
||||
|
||||
}
|
||||
|
||||
protected void trans(StatusEffect effect, TransitionHandler handler){
|
||||
transitions.put(effect, handler);
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ public class ItemTurret extends Turret{
|
||||
|
||||
stats.remove(Stat.itemCapacity);
|
||||
stats.add(Stat.ammo, StatValues.ammo(ammoTypes));
|
||||
stats.add(Stat.ammoCapacity, maxAmmo / ammoPerShot, StatUnit.shots);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -51,6 +51,7 @@ public class CoreBlock extends StorageBlock{
|
||||
public UnitType unitType = UnitTypes.alpha;
|
||||
public float landDuration = 160f;
|
||||
public Music landMusic = Musics.land;
|
||||
public Music launchMusic = Musics.coreLaunch;
|
||||
public Effect launchEffect = Fx.launch;
|
||||
|
||||
public Interp landZoomInterp = Interp.pow3;
|
||||
@@ -333,6 +334,10 @@ public class CoreBlock extends StorageBlock{
|
||||
return landMusic;
|
||||
}
|
||||
|
||||
public Music launchMusic(){
|
||||
return launchMusic;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
//draw thrusters when just landed
|
||||
|
||||
@@ -86,6 +86,7 @@ public class Stat implements Comparable<Stat>{
|
||||
targetsGround = new Stat("targetsGround", StatCat.function),
|
||||
damage = new Stat("damage", StatCat.function),
|
||||
ammo = new Stat("ammo", StatCat.function),
|
||||
ammoCapacity = new Stat("ammoCapacity", StatCat.function),
|
||||
ammoUse = new Stat("ammoUse", StatCat.function),
|
||||
shieldHealth = new Stat("shieldHealth", StatCat.function),
|
||||
cooldownTime = new Stat("cooldownTime", StatCat.function),
|
||||
|
||||
@@ -24,6 +24,7 @@ public class StatUnit{
|
||||
degrees = new StatUnit("degrees"),
|
||||
seconds = new StatUnit("seconds"),
|
||||
minutes = new StatUnit("minutes"),
|
||||
shots = new StatUnit("shots"),
|
||||
perSecond = new StatUnit("perSecond", false),
|
||||
perMinute = new StatUnit("perMinute", false),
|
||||
perShot = new StatUnit("perShot", false),
|
||||
|
||||
Reference in New Issue
Block a user