more sounds

This commit is contained in:
Anuken
2019-08-13 11:42:01 -04:00
parent a818da5eb7
commit bff9d89232
35 changed files with 104 additions and 48 deletions

Binary file not shown.

BIN
core/assets/sounds/beam.ogg Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
core/assets/sounds/thruster.ogg Normal file → Executable file

Binary file not shown.

Binary file not shown.

View File

@@ -1374,6 +1374,7 @@ public class Blocks implements ContentList{
shootEffect = Fx.shootLiquid; shootEffect = Fx.shootLiquid;
range = 110f; range = 110f;
health = 250 * size * size; health = 250 * size * size;
shootSound = Sounds.splash;
drawer = (tile, entity) -> { drawer = (tile, entity) -> {
Draw.rect(region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90); Draw.rect(region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
@@ -1405,7 +1406,7 @@ public class Blocks implements ContentList{
size = 2; size = 2;
health = 280 * size * size; health = 280 * size * size;
targetAir = false; targetAir = false;
shootSound = Sounds.phaser; shootSound = Sounds.laser;
}}; }};
arc = new PowerTurret("arc"){{ arc = new PowerTurret("arc"){{
@@ -1422,7 +1423,7 @@ public class Blocks implements ContentList{
recoil = 1f; recoil = 1f;
size = 1; size = 1;
health = 260; health = 260;
shootSound = Sounds.shock; shootSound = Sounds.spark;
}}; }};
swarmer = new BurstTurret("swarmer"){{ swarmer = new BurstTurret("swarmer"){{
@@ -1464,7 +1465,8 @@ public class Blocks implements ContentList{
burstSpacing = 3f; burstSpacing = 3f;
shots = 4; shots = 4;
ammoUseEffect = Fx.shellEjectBig; ammoUseEffect = Fx.shellEjectBig;
health = 240 * size * size;; health = 240 * size * size;
shootSound = Sounds.shootBig;
}}; }};
fuse = new ItemTurret("fuse"){{ fuse = new ItemTurret("fuse"){{
@@ -1561,6 +1563,7 @@ public class Blocks implements ContentList{
rotatespeed = 10f; rotatespeed = 10f;
inaccuracy = 10f; inaccuracy = 10f;
shootCone = 30f; shootCone = 30f;
shootSound = Sounds.shootSnap;
health = 145 * size * size; health = 145 * size * size;
}}; }};
@@ -1585,6 +1588,7 @@ public class Blocks implements ContentList{
shots = 2; shots = 2;
size = 4; size = 4;
shootCone = 24f; shootCone = 24f;
shootSound = Sounds.shootBig;
health = 155 * size * size; health = 155 * size * size;
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 2f)).update(false).optional(true, true); consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 2f)).update(false).optional(true, true);
@@ -1603,6 +1607,9 @@ public class Blocks implements ContentList{
firingMoveFract = 0.5f; firingMoveFract = 0.5f;
shootDuration = 220f; shootDuration = 220f;
powerUse = 14f; powerUse = 14f;
shootSound = Sounds.laserbig;
idleSound = Sounds.beam;
idleSoundVolume = 2f;
health = 200 * size * size; health = 200 * size * size;
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 0.5f)).update(false); consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 0.5f)).update(false);

View File

@@ -1,22 +1,18 @@
package io.anuke.mindustry.content; package io.anuke.mindustry.content;
import io.anuke.arc.Core; import io.anuke.arc.*;
import io.anuke.arc.graphics.Blending; import io.anuke.arc.graphics.*;
import io.anuke.arc.graphics.Color; import io.anuke.arc.graphics.g2d.*;
import io.anuke.arc.graphics.g2d.Draw; import io.anuke.arc.math.*;
import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.arc.util.*;
import io.anuke.arc.math.Mathf; import io.anuke.mindustry.entities.*;
import io.anuke.arc.util.Time; import io.anuke.mindustry.entities.bullet.*;
import io.anuke.mindustry.entities.Effects; import io.anuke.mindustry.entities.effect.*;
import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.entities.type.*;
import io.anuke.mindustry.entities.bullet.BombBulletType; import io.anuke.mindustry.game.*;
import io.anuke.mindustry.entities.effect.Lightning; import io.anuke.mindustry.gen.*;
import io.anuke.mindustry.entities.type.Player; import io.anuke.mindustry.graphics.*;
import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.type.*;
import io.anuke.mindustry.graphics.Pal;
import io.anuke.mindustry.graphics.Shaders;
import io.anuke.mindustry.type.Mech;
import io.anuke.mindustry.type.Weapon;
public class Mechs implements ContentList{ public class Mechs implements ContentList{
public static Mech alpha, delta, tau, omega, dart, javelin, trident, glaive; public static Mech alpha, delta, tau, omega, dart, javelin, trident, glaive;
@@ -79,6 +75,7 @@ public class Mechs implements ContentList{
inaccuracy = 0f; inaccuracy = 0f;
ejectEffect = Fx.none; ejectEffect = Fx.none;
bullet = Bullets.lightning; bullet = Bullets.lightning;
shootSound = Sounds.spark;
}}; }};
} }
@@ -122,6 +119,7 @@ public class Mechs implements ContentList{
ejectEffect = Fx.none; ejectEffect = Fx.none;
recoil = 2f; recoil = 2f;
bullet = Bullets.healBullet; bullet = Bullets.healBullet;
shootSound = Sounds.pew;
}}; }};
} }
@@ -173,6 +171,7 @@ public class Mechs implements ContentList{
ejectEffect = Fx.none; ejectEffect = Fx.none;
shake = 3f; shake = 3f;
bullet = Bullets.missileSwarm; bullet = Bullets.missileSwarm;
shootSound = Sounds.shootBig;
}}; }};
} }
@@ -267,6 +266,7 @@ public class Mechs implements ContentList{
velocityRnd = 0.2f; velocityRnd = 0.2f;
spacing = 1f; spacing = 1f;
bullet = Bullets.missileJavelin; bullet = Bullets.missileJavelin;
shootSound = Sounds.missile;
}}; }};
} }
@@ -337,6 +337,7 @@ public class Mechs implements ContentList{
hitEffect = Fx.flakExplosion; hitEffect = Fx.flakExplosion;
shootEffect = Fx.none; shootEffect = Fx.none;
smokeEffect = Fx.none; smokeEffect = Fx.none;
shootSound = Sounds.artillery;
}}; }};
}}; }};
} }
@@ -366,6 +367,7 @@ public class Mechs implements ContentList{
roundrobin = true; roundrobin = true;
ejectEffect = Fx.shellEjectSmall; ejectEffect = Fx.shellEjectSmall;
bullet = Bullets.standardGlaive; bullet = Bullets.standardGlaive;
shootSound = Sounds.shootSnap;
}}; }};
} }
}; };

View File

@@ -5,6 +5,7 @@ import io.anuke.mindustry.entities.bullet.*;
import io.anuke.mindustry.entities.type.*; import io.anuke.mindustry.entities.type.*;
import io.anuke.mindustry.entities.type.base.*; import io.anuke.mindustry.entities.type.base.*;
import io.anuke.mindustry.game.*; import io.anuke.mindustry.game.*;
import io.anuke.mindustry.gen.*;
import io.anuke.mindustry.type.*; import io.anuke.mindustry.type.*;
public class UnitTypes implements ContentList{ public class UnitTypes implements ContentList{
@@ -47,6 +48,7 @@ public class UnitTypes implements ContentList{
ejectEffect = Fx.none; ejectEffect = Fx.none;
recoil = 2f; recoil = 2f;
bullet = Bullets.healBullet; bullet = Bullets.healBullet;
shootSound = Sounds.pew;
}}; }};
}}; }};
@@ -131,6 +133,7 @@ public class UnitTypes implements ContentList{
health = 460; health = 460;
immunities.add(StatusEffects.burning); immunities.add(StatusEffects.burning);
weapon = new Weapon("flamethrower"){{ weapon = new Weapon("flamethrower"){{
shootSound = Sounds.flame;
length = 1f; length = 1f;
reload = 14f; reload = 14f;
range = 30f; range = 30f;
@@ -159,6 +162,7 @@ public class UnitTypes implements ContentList{
shake = 2f; shake = 2f;
ejectEffect = Fx.shellEjectMedium; ejectEffect = Fx.shellEjectMedium;
bullet = Bullets.artilleryUnit; bullet = Bullets.artilleryUnit;
shootSound = Sounds.artillery;
}}; }};
}}; }};
@@ -180,6 +184,7 @@ public class UnitTypes implements ContentList{
bullet = Bullets.eruptorShot; bullet = Bullets.eruptorShot;
recoil = 1f; recoil = 1f;
width = 7f; width = 7f;
shootSound = Sounds.flame;
}}; }};
}}; }};
@@ -203,6 +208,7 @@ public class UnitTypes implements ContentList{
shotDelay = 5; shotDelay = 5;
ejectEffect = Fx.shellEjectMedium; ejectEffect = Fx.shellEjectMedium;
bullet = Bullets.flakSurge; bullet = Bullets.flakSurge;
shootSound = Sounds.shootBig;
}}; }};
}}; }};
@@ -268,6 +274,7 @@ public class UnitTypes implements ContentList{
inaccuracy = 40f; inaccuracy = 40f;
ignoreRotation = true; ignoreRotation = true;
bullet = Bullets.bombExplosive; bullet = Bullets.bombExplosive;
shootSound = Sounds.release;
}}; }};
}}; }};
@@ -297,6 +304,7 @@ public class UnitTypes implements ContentList{
ejectEffect = Fx.none; ejectEffect = Fx.none;
velocityRnd = 0.2f; velocityRnd = 0.2f;
spacing = 1f; spacing = 1f;
shootSound = Sounds.missile;
bullet = Bullets.missileRevenant; bullet = Bullets.missileRevenant;
}}; }};
}}; }};
@@ -330,6 +338,7 @@ public class UnitTypes implements ContentList{
velocityRnd = 0.2f; velocityRnd = 0.2f;
spacing = 1f; spacing = 1f;
bullet = Bullets.missileRevenant; bullet = Bullets.missileRevenant;
shootSound = Sounds.missile;
}}; }};
}}; }};
@@ -360,6 +369,7 @@ public class UnitTypes implements ContentList{
roundrobin = true; roundrobin = true;
ejectEffect = Fx.none; ejectEffect = Fx.none;
bullet = Bullets.standardDenseBig; bullet = Bullets.standardDenseBig;
shootSound = Sounds.shootBig;
}}; }};
}}; }};
} }

View File

@@ -152,6 +152,7 @@ public class Renderer implements ApplicationListener{
try{ try{
if(bloom != null){ if(bloom != null){
bloom.dispose(); bloom.dispose();
bloom = null;
} }
bloom = new Bloom(true); bloom = new Bloom(true);
bloom.setClearColor(0f, 0f, 0f, 0f); bloom.setClearColor(0f, 0f, 0f, 0f);

View File

@@ -1,9 +1,10 @@
package io.anuke.mindustry.entities.bullet; package io.anuke.mindustry.entities.bullet;
import io.anuke.arc.graphics.g2d.Draw; import io.anuke.arc.graphics.g2d.*;
import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.content.*;
import io.anuke.mindustry.entities.Effects; import io.anuke.mindustry.entities.*;
import io.anuke.mindustry.entities.Effects.Effect; import io.anuke.mindustry.entities.Effects.*;
import io.anuke.mindustry.gen.*;
//TODO scale velocity depending on fslope() //TODO scale velocity depending on fslope()
public class ArtilleryBulletType extends BasicBulletType{ public class ArtilleryBulletType extends BasicBulletType{
@@ -15,6 +16,7 @@ public class ArtilleryBulletType extends BasicBulletType{
collides = false; collides = false;
collidesAir = false; collidesAir = false;
hitShake = 1f; hitShake = 1f;
hitSound = Sounds.explosion;
} }
@Override @Override

View File

@@ -1,5 +1,7 @@
package io.anuke.mindustry.entities.bullet; package io.anuke.mindustry.entities.bullet;
import io.anuke.mindustry.gen.*;
public class BombBulletType extends BasicBulletType{ public class BombBulletType extends BasicBulletType{
public BombBulletType(float damage, float radius, String sprite){ public BombBulletType(float damage, float radius, String sprite){
@@ -13,5 +15,6 @@ public class BombBulletType extends BasicBulletType{
drag = 0.05f; drag = 0.05f;
keepVelocity = false; keepVelocity = false;
collidesAir = false; collidesAir = false;
hitSound = Sounds.explosion;
} }
} }

View File

@@ -1,18 +1,17 @@
package io.anuke.mindustry.entities.bullet; package io.anuke.mindustry.entities.bullet;
import io.anuke.arc.math.Angles; import io.anuke.arc.audio.*;
import io.anuke.arc.math.Mathf; import io.anuke.arc.math.*;
import io.anuke.mindustry.content.Fx; import io.anuke.mindustry.content.*;
import io.anuke.mindustry.content.StatusEffects;
import io.anuke.mindustry.entities.*; import io.anuke.mindustry.entities.*;
import io.anuke.mindustry.entities.Effects.Effect; import io.anuke.mindustry.entities.Effects.*;
import io.anuke.mindustry.entities.effect.Lightning; import io.anuke.mindustry.entities.effect.*;
import io.anuke.mindustry.entities.traits.TargetTrait; import io.anuke.mindustry.entities.traits.*;
import io.anuke.mindustry.game.Content; import io.anuke.mindustry.game.*;
import io.anuke.mindustry.graphics.Pal; import io.anuke.mindustry.gen.*;
import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.graphics.*;
import io.anuke.mindustry.type.StatusEffect; import io.anuke.mindustry.type.*;
import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.*;
public abstract class BulletType extends Content{ public abstract class BulletType extends Content{
public float lifetime; public float lifetime;
@@ -28,6 +27,8 @@ public abstract class BulletType extends Content{
public Effect shootEffect = Fx.shootSmall; public Effect shootEffect = Fx.shootSmall;
/** Extra smoke effect created when shooting. */ /** Extra smoke effect created when shooting. */
public Effect smokeEffect = Fx.shootSmallSmoke; public Effect smokeEffect = Fx.shootSmallSmoke;
/** Sound made when hitting something or getting removed.*/
public Sound hitSound = Sounds.none;
/** Extra inaccuracy when firing. */ /** Extra inaccuracy when firing. */
public float inaccuracy = 0f; public float inaccuracy = 0f;
/** How many bullets get created per ammo item/liquid. */ /** How many bullets get created per ammo item/liquid. */
@@ -105,6 +106,7 @@ public abstract class BulletType extends Content{
public void hit(Bullet b, float x, float y){ public void hit(Bullet b, float x, float y){
Effects.effect(hitEffect, x, y, b.rot()); Effects.effect(hitEffect, x, y, b.rot());
hitSound.at(b);
Effects.shake(hitShake, hitShake, b); Effects.shake(hitShake, hitShake, b);
@@ -127,6 +129,7 @@ public abstract class BulletType extends Content{
public void despawned(Bullet b){ public void despawned(Bullet b){
Effects.effect(despawnEffect, b.x, b.y, b.rot()); Effects.effect(despawnEffect, b.x, b.y, b.rot());
hitSound.at(b);
if(fragBullet != null || splashDamageRadius > 0){ if(fragBullet != null || splashDamageRadius > 0){
hit(b); hit(b);

View File

@@ -16,9 +16,8 @@ import io.anuke.mindustry.Vars;
import io.anuke.mindustry.content.*; import io.anuke.mindustry.content.*;
import io.anuke.mindustry.entities.*; import io.anuke.mindustry.entities.*;
import io.anuke.mindustry.entities.traits.*; import io.anuke.mindustry.entities.traits.*;
import io.anuke.mindustry.game.Team; import io.anuke.mindustry.game.*;
import io.anuke.mindustry.game.TypeID; import io.anuke.mindustry.gen.*;
import io.anuke.mindustry.gen.Call;
import io.anuke.mindustry.graphics.Pal; import io.anuke.mindustry.graphics.Pal;
import io.anuke.mindustry.input.Binding; import io.anuke.mindustry.input.Binding;
import io.anuke.mindustry.input.InputHandler.PlaceDraw; import io.anuke.mindustry.input.InputHandler.PlaceDraw;
@@ -71,6 +70,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
private Tile mining; private Tile mining;
private Vector2 movement = new Vector2(); private Vector2 movement = new Vector2();
private boolean moved; private boolean moved;
private SoundLoop sound = new SoundLoop(Sounds.thruster, 2f);
//endregion //endregion
@@ -110,6 +110,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
dead = false; dead = false;
spawner = null; spawner = null;
respawns --; respawns --;
Sounds.respawn.at(tile);
setNet(tile.drawx(), tile.drawy()); setNet(tile.drawx(), tile.drawy());
clearItem(); clearItem();
@@ -130,6 +131,11 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
} }
} }
@Override
public void removed(){
sound.stop();
}
@Override @Override
public float drag(){ public float drag(){
return mech.drag; return mech.drag;
@@ -507,6 +513,8 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
destructTime = 0f; destructTime = 0f;
} }
sound.update(x, y, isBoosting && !isDead() && !mech.flying);
if(isDead()){ if(isDead()){
isBoosting = false; isBoosting = false;
boostHeat = 0f; boostHeat = 0f;

View File

@@ -383,18 +383,21 @@ public class Bloom{
* Call this when application is exiting. * Call this when application is exiting.
*/ */
public void dispose(){ public void dispose(){
if(disposeFBO) try{
frameBuffer.dispose(); if(disposeFBO)
frameBuffer.dispose();
fullScreenQuad.dispose(); fullScreenQuad.dispose();
pingPongBuffer1.dispose(); pingPongBuffer1.dispose();
pingPongBuffer2.dispose(); pingPongBuffer2.dispose();
blurShader.dispose(); blurShader.dispose();
bloomShader.dispose(); bloomShader.dispose();
tresholdShader.dispose(); tresholdShader.dispose();
}catch(Exception ignored){
}
} }
private static Mesh createFullScreenQuad(){ private static Mesh createFullScreenQuad(){

View File

@@ -62,7 +62,7 @@ public abstract class GenerateFilter{
} }
protected float chance(){ protected float chance(){
return Mathf.randomSeed(Pack.longInt(in.x, in.y + (int)o)); return Mathf.randomSeed(Pack.longInt(in.x, in.y + (int)seed));
} }
/** an input for generating at a certain coordinate. should only be instantiated once. */ /** an input for generating at a certain coordinate. should only be instantiated once. */

View File

@@ -104,6 +104,13 @@ public class LaserTurret extends PowerTurret{
return new LaserTurretEntity(); return new LaserTurretEntity();
} }
@Override
public boolean shouldIdleSound(Tile tile){
LaserTurretEntity entity = tile.entity();
return entity.bulletLife > 0 && entity.bullet != null;
}
class LaserTurretEntity extends TurretEntity{ class LaserTurretEntity extends TurretEntity{
Bullet bullet; Bullet bullet;
float bulletLife; float bulletLife;

View File

@@ -79,6 +79,7 @@ public abstract class LiquidTurret extends Turret{
Effects.effect(type.shootEffect, entity.liquids.current().color, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation); Effects.effect(type.shootEffect, entity.liquids.current().color, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
Effects.effect(type.smokeEffect, entity.liquids.current().color, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation); Effects.effect(type.smokeEffect, entity.liquids.current().color, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
shootSound.at(tile);
if(shootShake > 0){ if(shootShake > 0){
Effects.shake(shootShake, shootShake, tile.entity); Effects.shake(shootShake, shootShake, tile.entity);

View File

@@ -30,6 +30,8 @@ public class CoreBlock extends StorageBlock{
update = true; update = true;
hasItems = true; hasItems = true;
flags = EnumSet.of(BlockFlag.target, BlockFlag.producer); flags = EnumSet.of(BlockFlag.target, BlockFlag.producer);
idleSound = Sounds.respawning;
idleSoundVolume = 1f;
} }
@Remote(called = Loc.server) @Remote(called = Loc.server)
@@ -152,6 +154,13 @@ public class CoreBlock extends StorageBlock{
} }
} }
@Override
public boolean shouldIdleSound(Tile tile){
CoreEntity entity = tile.entity();
return entity.spawnPlayer != null;
}
@Override @Override
public TileEntity newEntity(){ public TileEntity newEntity(){
return new CoreEntity(); return new CoreEntity();