Insect/leg unit step sound
This commit is contained in:
BIN
core/assets/sounds/walkerStep.ogg
Normal file
BIN
core/assets/sounds/walkerStep.ogg
Normal file
Binary file not shown.
@@ -59,8 +59,11 @@ public class SoundPriority{
|
|||||||
sound.setMinConcurrentInterrupt(Math.min(0.25f, sound.getLength() * 0.5f));
|
sound.setMinConcurrentInterrupt(Math.min(0.25f, sound.getLength() * 0.5f));
|
||||||
}
|
}
|
||||||
|
|
||||||
mechStep.setMinConcurrentInterrupt(0.3f);
|
mechStep.setMinConcurrentInterrupt(0.5f);
|
||||||
mechStep.setMaxConcurrent(3);
|
walkerStep.setMinConcurrentInterrupt(0.6f);
|
||||||
|
|
||||||
|
mechStep.setMaxConcurrent(4);
|
||||||
|
walkerStep.setMaxConcurrent(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void max(int max, Sound... sounds){
|
static void max(int max, Sound... sounds){
|
||||||
|
|||||||
@@ -551,6 +551,10 @@ public class UnitTypes{
|
|||||||
rotateSpeed = 1.5f;
|
rotateSpeed = 1.5f;
|
||||||
drownTimeMultiplier = 1.6f;
|
drownTimeMultiplier = 1.6f;
|
||||||
|
|
||||||
|
stepSound = Sounds.walkerStep;
|
||||||
|
stepSoundVolume = 1.1f;
|
||||||
|
stepSoundPitch = 0.9f;
|
||||||
|
|
||||||
legCount = 4;
|
legCount = 4;
|
||||||
legLength = 14f;
|
legLength = 14f;
|
||||||
legBaseOffset = 11f;
|
legBaseOffset = 11f;
|
||||||
@@ -778,6 +782,10 @@ public class UnitTypes{
|
|||||||
legSpeed = 0.2f;
|
legSpeed = 0.2f;
|
||||||
ammoType = new PowerAmmoType(2000);
|
ammoType = new PowerAmmoType(2000);
|
||||||
|
|
||||||
|
stepSound = Sounds.walkerStep;
|
||||||
|
stepSoundVolume = 0.75f;
|
||||||
|
stepSoundPitch = 1.1f;
|
||||||
|
|
||||||
legSplashDamage = 32;
|
legSplashDamage = 32;
|
||||||
legSplashRange = 30;
|
legSplashRange = 30;
|
||||||
|
|
||||||
@@ -865,6 +873,8 @@ public class UnitTypes{
|
|||||||
health = 22000;
|
health = 22000;
|
||||||
armor = 13f;
|
armor = 13f;
|
||||||
lightRadius = 140f;
|
lightRadius = 140f;
|
||||||
|
stepSound = Sounds.walkerStep;
|
||||||
|
stepSoundVolume = 1.1f;
|
||||||
|
|
||||||
rotateSpeed = 1.9f;
|
rotateSpeed = 1.9f;
|
||||||
|
|
||||||
@@ -3375,6 +3385,10 @@ public class UnitTypes{
|
|||||||
legMaxLength = 1.3f;
|
legMaxLength = 1.3f;
|
||||||
researchCostMultiplier = 0f;
|
researchCostMultiplier = 0f;
|
||||||
|
|
||||||
|
stepSound = Sounds.walkerStep;
|
||||||
|
stepSoundVolume = 1f;
|
||||||
|
stepSoundPitch = 1f;
|
||||||
|
|
||||||
abilities.add(new ShieldArcAbility(){{
|
abilities.add(new ShieldArcAbility(){{
|
||||||
region = "tecta-shield";
|
region = "tecta-shield";
|
||||||
radius = 45f;
|
radius = 45f;
|
||||||
@@ -3478,6 +3492,10 @@ public class UnitTypes{
|
|||||||
legStraightness = 0.6f;
|
legStraightness = 0.6f;
|
||||||
baseLegStraightness = 0.5f;
|
baseLegStraightness = 0.5f;
|
||||||
|
|
||||||
|
stepSound = Sounds.walkerStep;
|
||||||
|
stepSoundVolume = 1.1f;
|
||||||
|
stepSoundPitch = 0.9f;
|
||||||
|
|
||||||
legCount = 8;
|
legCount = 8;
|
||||||
legLength = 30f;
|
legLength = 30f;
|
||||||
legForwardScl = 2.1f;
|
legForwardScl = 2.1f;
|
||||||
|
|||||||
@@ -179,6 +179,7 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Unitc{
|
|||||||
floor.walkSound.at(x, y, 1f, floor.walkSoundVolume);
|
floor.walkSound.at(x, y, 1f, floor.walkSoundVolume);
|
||||||
}else{
|
}else{
|
||||||
Fx.unitLandSmall.at(l.base.x, l.base.y, type.rippleScale, floor.mapColor);
|
Fx.unitLandSmall.at(l.base.x, l.base.y, type.rippleScale, floor.mapColor);
|
||||||
|
type.stepSound.at(l.base.x, l.base.y, type.stepSoundPitch + Mathf.range(0.1f), type.stepSoundVolume);
|
||||||
}
|
}
|
||||||
|
|
||||||
//shake when legs contact ground
|
//shake when legs contact ground
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ abstract class MechComp implements Posc, Hitboxc, Unitc, Mechc, ElevationMovec{
|
|||||||
if(type.mechStepParticles){
|
if(type.mechStepParticles){
|
||||||
Effect.floorDust(cx, cy, hitSize/8f);
|
Effect.floorDust(cx, cy, hitSize/8f);
|
||||||
}
|
}
|
||||||
type.stepSound.at(cx, cy, 1f + Mathf.range(0.1f), type.stepSoundVolume);
|
type.stepSound.at(cx, cy, type.stepSoundPitch + Mathf.range(0.1f), type.stepSoundVolume);
|
||||||
}
|
}
|
||||||
|
|
||||||
walkExtension = extendScl;
|
walkExtension = extendScl;
|
||||||
|
|||||||
@@ -460,6 +460,8 @@ public abstract class SaveVersion extends SaveFileReader{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void readWorldEntities(DataInput stream, Prov[] mapping) throws IOException{
|
public void readWorldEntities(DataInput stream, Prov[] mapping) throws IOException{
|
||||||
|
IntSet used = new IntSet();
|
||||||
|
Seq<Entityc> reassign = new Seq<>();
|
||||||
|
|
||||||
int amount = stream.readInt();
|
int amount = stream.readInt();
|
||||||
for(int j = 0; j < amount; j++){
|
for(int j = 0; j < amount; j++){
|
||||||
@@ -476,10 +478,20 @@ public abstract class SaveVersion extends SaveFileReader{
|
|||||||
EntityGroup.checkNextId(id);
|
EntityGroup.checkNextId(id);
|
||||||
entity.id(id);
|
entity.id(id);
|
||||||
entity.read(in);
|
entity.read(in);
|
||||||
entity.add();
|
if(used.add(id)){
|
||||||
|
entity.add();
|
||||||
|
}else{
|
||||||
|
Log.warn("Duplicate entity ID in save: @ (@)", id, entity);
|
||||||
|
reassign.add(entity);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for(var ent : reassign){
|
||||||
|
ent.id(EntityGroup.nextId());
|
||||||
|
ent.add();
|
||||||
|
}
|
||||||
|
|
||||||
Groups.all.each(Entityc::afterReadAll);
|
Groups.all.each(Entityc::afterReadAll);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -300,10 +300,12 @@ public class UnitType extends UnlockableContent implements Senseable{
|
|||||||
public Sound loopSound = Sounds.none;
|
public Sound loopSound = Sounds.none;
|
||||||
/** volume of loop sound */
|
/** volume of loop sound */
|
||||||
public float loopSoundVolume = 0.5f;
|
public float loopSoundVolume = 0.5f;
|
||||||
/** sound played when this mech unit does a step */
|
/** sound played when this mech/insect unit does a step */
|
||||||
public Sound stepSound = Sounds.none;
|
public Sound stepSound = Sounds.none;
|
||||||
/** volume of step sound */
|
/** volume of step sound */
|
||||||
public float stepSoundVolume = 0.5f;
|
public float stepSoundVolume = 0.5f;
|
||||||
|
/** base pitch of step sound */
|
||||||
|
public float stepSoundPitch = 1f;
|
||||||
/** effect that this unit emits when falling */
|
/** effect that this unit emits when falling */
|
||||||
public Effect fallEffect = Fx.fallSmoke;
|
public Effect fallEffect = Fx.fallSmoke;
|
||||||
/** effect created at engine when unit falls. */
|
/** effect created at engine when unit falls. */
|
||||||
|
|||||||
Reference in New Issue
Block a user