new toreterror sounds
This commit is contained in:
1 parent
303a56f7fc
commit
2c9fc4f11f
17 files changed
+82
-5
No files matched your search
@@ -126,6 +126,9 @@ public final class AntarchySoundEvents {
|
||||
public static Supplier<SoundEvent> TORETERROR_HURT = (Supplier<SoundEvent>) UNBOUND;
|
||||
public static Supplier<SoundEvent> TORETERROR_DEATH = (Supplier<SoundEvent>) UNBOUND;
|
||||
public static Supplier<SoundEvent> TORETERROR_BOMBER_FIRE = (Supplier<SoundEvent>) UNBOUND;
|
||||
public static Supplier<SoundEvent> TORETERROR_SPIN = (Supplier<SoundEvent>) UNBOUND;
|
||||
public static Supplier<SoundEvent> TORETERROR_RICOCHET = (Supplier<SoundEvent>) UNBOUND;
|
||||
public static Supplier<SoundEvent> WATER_CANNON_FIRE = (Supplier<SoundEvent>) UNBOUND;
|
||||
public static Supplier<SoundEvent> TORETERROR_JUMP_UP = (Supplier<SoundEvent>) UNBOUND;
|
||||
public static Supplier<SoundEvent> TORETERROR_JUMP_LAND = (Supplier<SoundEvent>) UNBOUND;
|
||||
public static Supplier<SoundEvent> STINKY_FLY = (Supplier<SoundEvent>) UNBOUND;
|
||||
@@ -259,6 +262,9 @@ public final class AntarchySoundEvents {
|
||||
Supplier<SoundEvent> toreterrorHurt,
|
||||
Supplier<SoundEvent> toreterrorDeath,
|
||||
Supplier<SoundEvent> toreterrorBomberFire,
|
||||
Supplier<SoundEvent> toreterrorSpin,
|
||||
Supplier<SoundEvent> toreterrorRicochet,
|
||||
Supplier<SoundEvent> waterCannonFire,
|
||||
Supplier<SoundEvent> toreterrorJumpUp,
|
||||
Supplier<SoundEvent> toreterrorJumpLand,
|
||||
Supplier<SoundEvent> stinkyFly,
|
||||
@@ -388,6 +394,9 @@ public final class AntarchySoundEvents {
|
||||
TORETERROR_HURT = toreterrorHurt;
|
||||
TORETERROR_DEATH = toreterrorDeath;
|
||||
TORETERROR_BOMBER_FIRE = toreterrorBomberFire;
|
||||
TORETERROR_SPIN = toreterrorSpin;
|
||||
TORETERROR_RICOCHET = toreterrorRicochet;
|
||||
WATER_CANNON_FIRE = waterCannonFire;
|
||||
TORETERROR_JUMP_UP = toreterrorJumpUp;
|
||||
TORETERROR_JUMP_LAND = toreterrorJumpLand;
|
||||
STINKY_FLY = stinkyFly;
|
||||
|
||||
@@ -122,6 +122,7 @@ public class ToreterrorEntity extends Monster implements GeoEntity {
|
||||
private int shootCooldown;
|
||||
private int jumpCooldown;
|
||||
private int spinCooldown;
|
||||
private int spinRicochetCooldown;
|
||||
private boolean jumpLaunched;
|
||||
private boolean jumpAirborne;
|
||||
private boolean shockwaveApplied;
|
||||
@@ -227,6 +228,7 @@ public class ToreterrorEntity extends Monster implements GeoEntity {
|
||||
if (this.shootCooldown > 0) this.shootCooldown--;
|
||||
if (this.jumpCooldown > 0) this.jumpCooldown--;
|
||||
if (this.spinCooldown > 0) this.spinCooldown--;
|
||||
if (this.spinRicochetCooldown > 0) this.spinRicochetCooldown--;
|
||||
if (this.jumpShakeTicks > 0) {
|
||||
this.jumpShakeTicks--;
|
||||
if (this.jumpShakeTicks <= 0) {
|
||||
@@ -575,6 +577,7 @@ public class ToreterrorEntity extends Monster implements GeoEntity {
|
||||
return true;
|
||||
}
|
||||
|
||||
this.playSpinRicochetSound();
|
||||
this.spinStrafeSign *= -1;
|
||||
Vec3 bounced = rotateHorizontal(direction, this.spinStrafeSign * 35.0D);
|
||||
if (this.trySpinMoves(bounced, true)) {
|
||||
@@ -590,6 +593,14 @@ public class ToreterrorEntity extends Monster implements GeoEntity {
|
||||
return this.trySpinMoves(reversedBounce, true);
|
||||
}
|
||||
|
||||
private void playSpinRicochetSound() {
|
||||
if (this.spinRicochetCooldown > 0) {
|
||||
return;
|
||||
}
|
||||
this.spinRicochetCooldown = 6;
|
||||
this.playSound(AntarchySoundEvents.TORETERROR_RICOCHET.get(), 1.0F, 0.95F + this.random.nextFloat() * 0.1F);
|
||||
}
|
||||
|
||||
private boolean trySpinMoves(Vec3 baseDirection, boolean bounced) {
|
||||
Vec3[] attempts = new Vec3[]{
|
||||
baseDirection,
|
||||
@@ -715,7 +726,7 @@ public class ToreterrorEntity extends Monster implements GeoEntity {
|
||||
if (!(this.level() instanceof ServerLevel serverLevel)) return;
|
||||
LivingEntity target = this.getTarget();
|
||||
if (target == null) return;
|
||||
this.playSound(AntarchySoundEvents.SQUIDZOOKA_FIRE.get(), 0.8F, 0.9F + this.random.nextFloat() * 0.2F);
|
||||
this.playSound(AntarchySoundEvents.WATER_CANNON_FIRE.get(), 0.8F, 0.9F + this.random.nextFloat() * 0.2F);
|
||||
Vec3 from = new Vec3(this.getX(), this.getEyeY(), this.getZ());
|
||||
Vec3 to = new Vec3(target.getX(), target.getEyeY(), target.getZ());
|
||||
Vec3 baseVel = calcLaunchVelocity(from, to, 1.5);
|
||||
@@ -917,6 +928,7 @@ public class ToreterrorEntity extends Monster implements GeoEntity {
|
||||
ToreterrorEntity.this.spinDirection = target == null
|
||||
? Vec3.ZERO
|
||||
: ToreterrorEntity.this.horizontalDirectionTo(target.position());
|
||||
ToreterrorEntity.this.playSound(AntarchySoundEvents.TORETERROR_SPIN.get(), 1.1F, 0.95F + ToreterrorEntity.this.random.nextFloat() * 0.1F);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -65,7 +65,7 @@ public class WaterCannonItem extends ProjectileWeaponItem implements GeoItem {
|
||||
if (usedTicks % FIRE_INTERVAL_TICKS != 0) return;
|
||||
|
||||
level.playSound(null, player.getX(), player.getY(), player.getZ(),
|
||||
AntarchySoundEvents.SQUIDZOOKA_FIRE.get(), SoundSource.PLAYERS,
|
||||
AntarchySoundEvents.WATER_CANNON_FIRE.get(), SoundSource.PLAYERS,
|
||||
0.8F, 0.9F + level.getRandom().nextFloat() * 0.2F);
|
||||
|
||||
if (!level.isClientSide()) {
|
||||
|
||||
Reference in new issue
Block a user