diff --git a/core/assets/shoot.ogg b/core/assets/shoot.ogg new file mode 100644 index 0000000000..271e540dd9 Binary files /dev/null and b/core/assets/shoot.ogg differ diff --git a/core/assets/sounds/bang.mp3 b/core/assets/sounds/bang.mp3 new file mode 100644 index 0000000000..d859b89aab Binary files /dev/null and b/core/assets/sounds/bang.mp3 differ diff --git a/core/assets/sounds/bang2.mp3 b/core/assets/sounds/bang2.mp3 new file mode 100644 index 0000000000..71e3deffa4 Binary files /dev/null and b/core/assets/sounds/bang2.mp3 differ diff --git a/core/assets/sounds/bigshot.mp3 b/core/assets/sounds/bigshot.mp3 new file mode 100644 index 0000000000..2139d15232 Binary files /dev/null and b/core/assets/sounds/bigshot.mp3 differ diff --git a/core/assets/sounds/blast.mp3 b/core/assets/sounds/blast.mp3 new file mode 100644 index 0000000000..f05f080eae Binary files /dev/null and b/core/assets/sounds/blast.mp3 differ diff --git a/core/assets/sounds/bloop.mp3 b/core/assets/sounds/bloop.mp3 new file mode 100644 index 0000000000..c77f53d7fe Binary files /dev/null and b/core/assets/sounds/bloop.mp3 differ diff --git a/core/assets/sounds/break.mp3 b/core/assets/sounds/break.mp3 new file mode 100644 index 0000000000..56487e4af1 Binary files /dev/null and b/core/assets/sounds/break.mp3 differ diff --git a/core/assets/sounds/corexplode.mp3 b/core/assets/sounds/corexplode.mp3 new file mode 100644 index 0000000000..2ee50fb405 Binary files /dev/null and b/core/assets/sounds/corexplode.mp3 differ diff --git a/core/assets/sounds/die.mp3 b/core/assets/sounds/die.mp3 new file mode 100644 index 0000000000..ae87ef7aa9 Binary files /dev/null and b/core/assets/sounds/die.mp3 differ diff --git a/core/assets/sounds/enemyshoot.mp3 b/core/assets/sounds/enemyshoot.mp3 new file mode 100644 index 0000000000..7deb792726 Binary files /dev/null and b/core/assets/sounds/enemyshoot.mp3 differ diff --git a/core/assets/sounds/explosion.mp3 b/core/assets/sounds/explosion.mp3 new file mode 100644 index 0000000000..f5f6e08fa7 Binary files /dev/null and b/core/assets/sounds/explosion.mp3 differ diff --git a/core/assets/sounds/flame.mp3 b/core/assets/sounds/flame.mp3 new file mode 100644 index 0000000000..a49ae44245 Binary files /dev/null and b/core/assets/sounds/flame.mp3 differ diff --git a/core/assets/sounds/flame2.mp3 b/core/assets/sounds/flame2.mp3 new file mode 100644 index 0000000000..c0d71a7b1d Binary files /dev/null and b/core/assets/sounds/flame2.mp3 differ diff --git a/core/assets/sounds/laser.mp3 b/core/assets/sounds/laser.mp3 new file mode 100644 index 0000000000..f0b2398aef Binary files /dev/null and b/core/assets/sounds/laser.mp3 differ diff --git a/core/assets/sounds/lasershot.mp3 b/core/assets/sounds/lasershot.mp3 new file mode 100644 index 0000000000..1db62aa08a Binary files /dev/null and b/core/assets/sounds/lasershot.mp3 differ diff --git a/core/assets/sounds/missile.mp3 b/core/assets/sounds/missile.mp3 new file mode 100644 index 0000000000..89af9f5157 Binary files /dev/null and b/core/assets/sounds/missile.mp3 differ diff --git a/core/assets/sounds/ping.mp3 b/core/assets/sounds/ping.mp3 new file mode 100644 index 0000000000..b9692a37fc Binary files /dev/null and b/core/assets/sounds/ping.mp3 differ diff --git a/core/assets/sounds/place.mp3 b/core/assets/sounds/place.mp3 new file mode 100644 index 0000000000..3f5369e4fa Binary files /dev/null and b/core/assets/sounds/place.mp3 differ diff --git a/core/assets/sounds/purchase.mp3 b/core/assets/sounds/purchase.mp3 new file mode 100644 index 0000000000..6edc48eebd Binary files /dev/null and b/core/assets/sounds/purchase.mp3 differ diff --git a/core/assets/sounds/railgun.mp3 b/core/assets/sounds/railgun.mp3 new file mode 100644 index 0000000000..a9bb203a7c Binary files /dev/null and b/core/assets/sounds/railgun.mp3 differ diff --git a/core/assets/sounds/resonate.mp3 b/core/assets/sounds/resonate.mp3 new file mode 100644 index 0000000000..ea456660de Binary files /dev/null and b/core/assets/sounds/resonate.mp3 differ diff --git a/core/assets/sounds/respawn.mp3 b/core/assets/sounds/respawn.mp3 new file mode 100644 index 0000000000..56e6fff2fc Binary files /dev/null and b/core/assets/sounds/respawn.mp3 differ diff --git a/core/assets/sounds/shoot.mp3 b/core/assets/sounds/shoot.mp3 new file mode 100644 index 0000000000..4a826fdfdd Binary files /dev/null and b/core/assets/sounds/shoot.mp3 differ diff --git a/core/assets/sounds/shoot.ogg b/core/assets/sounds/shoot.ogg new file mode 100644 index 0000000000..271e540dd9 Binary files /dev/null and b/core/assets/sounds/shoot.ogg differ diff --git a/core/assets/sounds/shoot_old.mp3 b/core/assets/sounds/shoot_old.mp3 new file mode 100644 index 0000000000..bfe18e8806 Binary files /dev/null and b/core/assets/sounds/shoot_old.mp3 differ diff --git a/core/assets/sounds/spawn.mp3 b/core/assets/sounds/spawn.mp3 new file mode 100644 index 0000000000..c0235b640c Binary files /dev/null and b/core/assets/sounds/spawn.mp3 differ diff --git a/core/assets/sounds/tesla.mp3 b/core/assets/sounds/tesla.mp3 new file mode 100644 index 0000000000..c8f053fbd3 Binary files /dev/null and b/core/assets/sounds/tesla.mp3 differ diff --git a/core/assets/sounds/waveend.mp3 b/core/assets/sounds/waveend.mp3 new file mode 100644 index 0000000000..60a48c0ba4 Binary files /dev/null and b/core/assets/sounds/waveend.mp3 differ diff --git a/core/src/io/anuke/mindustry/type/Weapon.java b/core/src/io/anuke/mindustry/type/Weapon.java index 7d2a22c98f..0e0ccddbb8 100644 --- a/core/src/io/anuke/mindustry/type/Weapon.java +++ b/core/src/io/anuke/mindustry/type/Weapon.java @@ -1,22 +1,18 @@ package io.anuke.mindustry.type; -import io.anuke.annotations.Annotations.Loc; -import io.anuke.annotations.Annotations.Remote; -import io.anuke.arc.Core; -import io.anuke.arc.graphics.g2d.TextureRegion; -import io.anuke.arc.math.Angles; -import io.anuke.arc.math.Mathf; -import io.anuke.arc.util.Time; -import io.anuke.arc.util.Tmp; -import io.anuke.mindustry.Vars; -import io.anuke.mindustry.content.Fx; -import io.anuke.mindustry.entities.Effects; -import io.anuke.mindustry.entities.Effects.Effect; -import io.anuke.mindustry.entities.bullet.Bullet; -import io.anuke.mindustry.entities.bullet.BulletType; -import io.anuke.mindustry.entities.traits.ShooterTrait; -import io.anuke.mindustry.entities.type.Player; -import io.anuke.mindustry.gen.Call; +import io.anuke.annotations.Annotations.*; +import io.anuke.arc.*; +import io.anuke.arc.graphics.g2d.*; +import io.anuke.arc.math.*; +import io.anuke.arc.util.*; +import io.anuke.mindustry.*; +import io.anuke.mindustry.content.*; +import io.anuke.mindustry.entities.*; +import io.anuke.mindustry.entities.Effects.*; +import io.anuke.mindustry.entities.bullet.*; +import io.anuke.mindustry.entities.traits.*; +import io.anuke.mindustry.entities.type.*; +import io.anuke.mindustry.gen.*; import io.anuke.mindustry.net.Net; public class Weapon{ @@ -56,6 +52,8 @@ public class Weapon{ /** whether shooter rotation is ignored when shooting. */ public boolean ignoreRotation = false; + // public Sound sound = Core.audio.newSound(Core.files.internal("sounds/shoot.ogg")); + public TextureRegion region; protected Weapon(String name){ @@ -69,6 +67,7 @@ public class Weapon{ @Remote(targets = Loc.server, called = Loc.both, unreliable = true) public static void onPlayerShootWeapon(Player player, float x, float y, float rotation, boolean left){ + if(player == null) return; //clients do not see their own shoot events: they are simulated completely clientside to prevent laggy visuals //messing with the firerate or any other stats does not affect the server (take that, script kiddies!) @@ -91,6 +90,7 @@ public class Weapon{ float baseX = shooter.getX(), baseY = shooter.getY(); Weapon weapon = shooter.getWeapon(); + //weapon.sound.play(1f); sequenceNum = 0; if(weapon.shotDelay > 0.01f){