diff --git a/Projectiles/Enemy/DraedonLaser.cs b/Projectiles/Enemy/DraedonLaser.cs index 9be5899a9b..e3a34531dc 100644 --- a/Projectiles/Enemy/DraedonLaser.cs +++ b/Projectiles/Enemy/DraedonLaser.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Enemy if (Projectile.localAI[0] == 0f) { // play a sound frame 1. changed this from space gun sound because that sound was way too annoying - var sound = SoundEngine.PlaySound(CommonCalamitySounds.LaserCannonSound with { Volume = CommonCalamitySounds.LaserCannonSound.Volume * 0.35f}, Projectile.Center); + var sound = SoundEngine.PlaySound(CommonCalamitySounds.LaserCannonSound with { Volume = CommonCalamitySounds.LaserCannonSound.Volume * 0.23f}, Projectile.Center); Projectile.localAI[0] = 1f; } diff --git a/Scenes/MusicScenes/BioLabMusicScene.cs b/Scenes/MusicScenes/BioLabMusicScene.cs new file mode 100644 index 0000000000..33ff0f9b3d --- /dev/null +++ b/Scenes/MusicScenes/BioLabMusicScene.cs @@ -0,0 +1,62 @@ +using CalamityMod.Systems; +using CalamityMod.Walls; +using CalamityMod.Walls.DraedonStructures; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Scenes.MusicScenes +{ + public class BioLabMusicScene : ModSceneEffect + { + public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("BioLab") ?? -1; + public override SceneEffectPriority Priority => SceneEffectPriority.Environment; + // This weight is here to ensure this theme plays over most other songs that use the Environment priority, as it's a smaller area and should take higher precedent + public override float GetWeight(Player player) => 0.6f; + + public override bool IsSceneEffectActive(Player player) + { + Tile backWall = Framing.GetTileSafely((int)(player.Center.X / 16), (int)(player.Center.Y / 16)); + Vector2 playerPosition = player.Center; + + float sunkenSeaLabDistance = Vector2.DistanceSquared(CalamityWorld.SunkenSeaLabCenter, playerPosition); + float planetoidLabDistance = Vector2.DistanceSquared(CalamityWorld.PlanetoidLabCenter, playerPosition); + float jungleLabDistance = Vector2.DistanceSquared(CalamityWorld.JungleLabCenter, playerPosition); + float hellLabDistance = Vector2.DistanceSquared(CalamityWorld.HellLabCenter, playerPosition); + float iceLabDistance = Vector2.DistanceSquared(CalamityWorld.IceLabCenter, playerPosition); + + // Checks if the player is behind any wall that naturally generates in Bio Labs + bool behindLabWall = + backWall.WallType == WallID.Glass || + backWall.WallType == WallID.SnowWallUnsafe || + backWall.WallType == WallID.IceUnsafe || + backWall.WallType == ModContent.WallType() || + backWall.WallType == ModContent.WallType() || + backWall.WallType == ModContent.WallType() || + backWall.WallType == ModContent.WallType() || + backWall.WallType == ModContent.WallType() || + backWall.WallType == ModContent.WallType() || + backWall.WallType == ModContent.WallType() || + backWall.WallType == ModContent.WallType() || + backWall.WallType == ModContent.WallType() || + backWall.WallType == ModContent.WallType() || + backWall.WallType == ModContent.WallType() || + backWall.WallType == ModContent.WallType() || + backWall.WallType == ModContent.WallType() || + backWall.WallType == ModContent.WallType() || + backWall.WallType == ModContent.WallType(); + + // Checks if the player is within an area from the center point of any Bio Lab + bool nearBioLabPoint = + sunkenSeaLabDistance <= 1020f * 1020f || + planetoidLabDistance <= 520f * 520f || + jungleLabDistance <= 620f * 620f || + hellLabDistance <= 700f * 700f || + iceLabDistance <= 720f * 720f; + + return BiomeTileCounterSystem.ArsenalLabTiles > 150 && behindLabWall && nearBioLabPoint; + } + } +} diff --git a/Sounds/Music/DraedonAmbience.ogg b/Sounds/Music/DraedonAmbience.ogg index 51e1ca952f..6985a18ac9 100644 Binary files a/Sounds/Music/DraedonAmbience.ogg and b/Sounds/Music/DraedonAmbience.ogg differ diff --git a/Systems/BiomeTileCounterSystem.cs b/Systems/BiomeTileCounterSystem.cs index 2014276dcf..600d738a0b 100644 --- a/Systems/BiomeTileCounterSystem.cs +++ b/Systems/BiomeTileCounterSystem.cs @@ -4,6 +4,7 @@ using CalamityMod.Tiles.Astral; using CalamityMod.Tiles.AstralDesert; using CalamityMod.Tiles.AstralSnow; using CalamityMod.Tiles.Crags; +using CalamityMod.Tiles.DraedonStructures; using CalamityMod.Tiles.Ores; using CalamityMod.Tiles.SunkenSea; using Terraria; @@ -18,6 +19,7 @@ namespace CalamityMod.Systems public static int AbyssTiles = 0; public static int AstralTiles = 0; public static int SunkenSeaTiles = 0; + public static int ArsenalLabTiles = 0; public override void ResetNearbyTileEffects() { @@ -26,6 +28,7 @@ namespace CalamityMod.Systems SunkenSeaTiles = 0; SulphurTiles = 0; AbyssTiles = 0; + ArsenalLabTiles = 0; } public override void TileCountsAvailable(ReadOnlySpan tileCounts) @@ -34,6 +37,7 @@ namespace CalamityMod.Systems SunkenSeaTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; AbyssTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; SulphurTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; + ArsenalLabTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; int astralDesertTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; int astralSnowTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; diff --git a/TileEntities/TEDraedonLabTurret.cs b/TileEntities/TEDraedonLabTurret.cs index 70d2c29c30..970961db54 100644 --- a/TileEntities/TEDraedonLabTurret.cs +++ b/TileEntities/TEDraedonLabTurret.cs @@ -16,11 +16,11 @@ namespace CalamityMod.TileEntities // Projectile variables public override int ProjectileType => ModContent.ProjectileType(); - public override int ProjectileDamage => Main.expertMode ? 14 : 20; + public override int ProjectileDamage => Main.expertMode ? 17 : 23; public override float ProjectileKnockback => 6.5f; public override float ShootSpeed => 5f; public override int FiringStartupDelay => 10; - public override int FiringUseTime => 20; + public override int FiringUseTime => 55; // Projectile spawn location variables public override Vector2 TurretCenterOffset => new Vector2(22f + 4f * Direction, -2f); diff --git a/Tiles/MusicBoxes/DraedonsAmbienceMusicBoxTile.cs b/Tiles/MusicBoxes/DraedonsAmbienceMusicBoxTile.cs index 433537839d..317df318a1 100644 --- a/Tiles/MusicBoxes/DraedonsAmbienceMusicBoxTile.cs +++ b/Tiles/MusicBoxes/DraedonsAmbienceMusicBoxTile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.MusicBoxes; +using CalamityMod.Items.Placeables.MusicBoxes; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -23,7 +23,7 @@ namespace CalamityMod.Tiles.MusicBoxes TileID.Sets.DisableSmartCursor[Type] = true; ModTranslation name = CreateMapEntryName(); name.SetDefault("Music Box"); - AddMapEntry(new Color(200, 200, 200), name); + AddMapEntry(new Color(191, 142, 111), name); } public override void KillMultiTile(int i, int j, int frameX, int frameY) @@ -39,6 +39,11 @@ namespace CalamityMod.Tiles.MusicBoxes player.cursorItemIconID = ModContent.ItemType(); } + public override bool CreateDust(int i, int j, ref int type) + { + return false; + } + public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) { if (Main.gamePaused || !Main.instance.IsActive || Lighting.UpdateEveryFrame && !Main.rand.NextBool(4))