diff --git a/Backgrounds/SunkenSeaBGStyle.cs b/Backgrounds/SunkenSeaBGStyle.cs index 7079491989..a4a2b399c3 100644 --- a/Backgrounds/SunkenSeaBGStyle.cs +++ b/Backgrounds/SunkenSeaBGStyle.cs @@ -1,4 +1,5 @@ -using Terraria.ModLoader; +using Terraria; +using Terraria.ModLoader; namespace CalamityMod.Backgrounds { @@ -7,7 +8,10 @@ namespace CalamityMod.Backgrounds public override void FillTextureArray(int[] textureSlots) { for (int i = 0; i <= 3; i++) - textureSlots[i] = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG" + i.ToString()); + { + textureSlots[i] = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel"); + //textureSlots[i] = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG" + i.ToString()); + } } } } \ No newline at end of file diff --git a/Backgrounds/SunkenSeaBurrowsBG.cs b/Backgrounds/SunkenSeaBurrowsBG.cs new file mode 100644 index 0000000000..e096f3fdfd --- /dev/null +++ b/Backgrounds/SunkenSeaBurrowsBG.cs @@ -0,0 +1,128 @@ +using Terraria; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; + +namespace CalamityMod.Backgrounds +{ + internal static class SunkenSeaBurrowsBG + { + public static void Load() + { + if (Main.dedServ) + { + return; + } + + On_Main.DrawBackgroundBlackFill += DrawBurrowsBG; + } + + public static float Transparency; + + public static float TransitionSpeed => 0.02f; + + private static void DrawBurrowsBG(On_Main.orig_DrawBackgroundBlackFill orig, Main self) + { + if (Main.gameMenu || Main.screenPosition.Y + Main.screenHeight < ((int)Main.worldSurface) * 16f) + { + orig(self); + + return; + } + + orig(self); + + if (Main.LocalPlayer.InModBiome(ModContent.GetInstance())) + { + Transparency += TransitionSpeed; + + if (Transparency > 1f) + { + Transparency = 1f; + } + } + else + { + //make transparency immediately go down so it doesnt look weird, since vanilla underground backgrounds dont have the fade-in effect this background has + Transparency -= 1f; + + if (Transparency < 0f) + { + Transparency = 0f; + } + } + + //dont bother running any of the background drawing if the transparency is zero (meaning the background isnt actually active) + //also do not run any of the background drawing if you have the vanilla background config option turned off + if (Transparency > 0f && Main.BackgroundEnabled) + { + Vector2 vector = Main.screenPosition + new Vector2((Main.screenWidth >> 1), (Main.screenHeight >> 1)); + float num = (Main.GameViewMatrix.Zoom.Y - 1f) * 0.5f * 200f; + float Scale = 1.5f; + + for (int Layers = 4; Layers >= 0; Layers--) + { + //get each background texture + Texture2D BGTexture = ModContent.Request("CalamityMod/Backgrounds/SunkenSeaBurrowsBG" + Layers).Value; + + Vector2 vector2 = new Vector2(BGTexture.Width, BGTexture.Height) * 0.5f; + float num2 = (Layers * 2 + 3f); + Vector2 vector3 = new Vector2(1f / num2); + Rectangle rectangle = new Rectangle(0, 0, BGTexture.Width, BGTexture.Height); + Vector2 zero = Vector2.Zero; + + switch (Layers) + { + case 0: + { + zero.Y += 800f; + break; + } + case 1: + { + zero.Y += 200f; + break; + } + case 2: + { + zero.Y += 450f; + break; + } + case 3: + { + zero.Y += 45f; + break; + } + case 4: + { + zero.Y += 45f; + break; + } + } + + vector2 *= Scale; + + zero.Y -= num; + float LoopWidth = Scale * rectangle.Width; + //float LoopHeight = Scale * rectangle.Height; + int LoopX = (int)((vector.X * vector3.X - vector2.X + zero.X - (Main.screenWidth >> 1)) / LoopWidth); + //int LoopY = (int)((vector.Y * vector3.Y - vector2.Y + zero.Y - (Main.screenWidth >> 1)) / LoopWidth); + + //for (int i = LoopY - 2; i < LoopY + 4 + (int)(Main.screenWidth / LoopHeight); i++) + //{ + for (int j = LoopX - 2; j < LoopX + 4 + (int)(Main.screenWidth / LoopWidth); j++) + { + Vector2 drawPosition = (new Vector2(j * Scale * (rectangle.Width / vector3.X), ((Main.LocalPlayer.Center.Y / 16f) - 90) * 16f) + vector2 - vector) * vector3 + vector - Main.screenPosition - vector2 + zero; + + var frame = rectangle; + var color = Color.MediumTurquoise * Transparency; + + Main.spriteBatch.Draw(BGTexture, drawPosition, frame, color, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f); + } + //} + } + } + } + } +} \ No newline at end of file diff --git a/Backgrounds/SunkenSeaBurrowsBG0.png b/Backgrounds/SunkenSeaBurrowsBG0.png new file mode 100644 index 0000000000..26ad2b3f50 Binary files /dev/null and b/Backgrounds/SunkenSeaBurrowsBG0.png differ diff --git a/Backgrounds/SunkenSeaBurrowsBG1.png b/Backgrounds/SunkenSeaBurrowsBG1.png new file mode 100644 index 0000000000..452e46c78c Binary files /dev/null and b/Backgrounds/SunkenSeaBurrowsBG1.png differ diff --git a/Backgrounds/SunkenSeaBurrowsBG2.png b/Backgrounds/SunkenSeaBurrowsBG2.png new file mode 100644 index 0000000000..3eb8e53eb6 Binary files /dev/null and b/Backgrounds/SunkenSeaBurrowsBG2.png differ diff --git a/Backgrounds/SunkenSeaBurrowsBG3.png b/Backgrounds/SunkenSeaBurrowsBG3.png new file mode 100644 index 0000000000..13524864b4 Binary files /dev/null and b/Backgrounds/SunkenSeaBurrowsBG3.png differ diff --git a/Backgrounds/SunkenSeaBurrowsBG4.png b/Backgrounds/SunkenSeaBurrowsBG4.png new file mode 100644 index 0000000000..33a816d561 Binary files /dev/null and b/Backgrounds/SunkenSeaBurrowsBG4.png differ diff --git a/BiomeManagers/SunkenSeaBiome.cs b/BiomeManagers/SunkenSeaBiome.cs index 4fee2917f0..d1f135f472 100644 --- a/BiomeManagers/SunkenSeaBiome.cs +++ b/BiomeManagers/SunkenSeaBiome.cs @@ -1,15 +1,65 @@ -using CalamityMod.Items.Placeables.Furniture; -using CalamityMod.Systems; -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Graphics.Light; +using Microsoft.Xna.Framework; +using System; +using Mono.Cecil.Cil; +using MonoMod.Cil; +using CalamityMod.Items.Placeables.Furniture; +using CalamityMod.Systems; namespace CalamityMod.BiomeManagers { + //this is just a global sunken sea biome to check if you are in any of the existing biomes public class SunkenSeaBiome : ModBiome { - //this is just a global sunken sea biome to check if you are in any of the existing biomes public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; + + public override void Load() + { + //apply the drawblack edits here since all sunken sea biomes will have custom backgrounds + IL_Main.DrawBlack += ChangeBlackThreshold; + On_Main.DrawBlack += ForceDrawBlack; + } + + private void ForceDrawBlack(On_Main.orig_DrawBlack orig, Main self, bool force) + { + if (Main.LocalPlayer.InModBiome(ModContent.GetInstance()) && Main.BackgroundEnabled) + { + orig(self, true); + } + else + { + orig(self, force); + } + } + + private float NewThreshold(float orig) + { + if (Main.LocalPlayer.InModBiome(ModContent.GetInstance()) && Main.BackgroundEnabled) + { + return 0.1f; + } + else + { + return orig; + } + } + + private void ChangeBlackThreshold(ILContext il) + { + if (Main.BackgroundEnabled) + { + var c = new ILCursor(il); + c.TryGotoNext(n => n.MatchLdloc(6), n => n.MatchStloc(13)); //beginning of the loop, local 11 is a looping variable + c.Index++; //this is kinda goofy since I dont think you could actually ever write c# to compile to the resulting IL from emitting here. + c.Emit(OpCodes.Ldloc, 3); //pass the original value so we can set that instead if we dont want to change the threshold + c.EmitDelegate>(NewThreshold); //check if were in the biome to set, else set the original value + c.Emit(OpCodes.Stloc, 3); //num2 in vanilla, controls minimum threshold to turn a tile black + } + } + public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon"; // Placeholder until we get a dedicated Sunken Sea background public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1"; @@ -17,7 +67,8 @@ namespace CalamityMod.BiomeManagers public override bool IsBiomeActive(Player player) { - return BiomeTileCounterSystem.SunkenSeaTiles > 150; + return BiomeTileCounterSystem.SunkenSeaBurrowsTiles > 500 || BiomeTileCounterSystem.SunkenSeaPolypTiles > 500 || + BiomeTileCounterSystem.SunkenSeaReefsTiles > 500 || BiomeTileCounterSystem.SunkenSeaShoresTiles > 500; } } } diff --git a/BiomeManagers/SunkenSeaBurrowsBiome.cs b/BiomeManagers/SunkenSeaBurrowsBiome.cs index 74ddf4df06..a0980ce333 100644 --- a/BiomeManagers/SunkenSeaBurrowsBiome.cs +++ b/BiomeManagers/SunkenSeaBurrowsBiome.cs @@ -23,7 +23,7 @@ namespace CalamityMod.BiomeManagers bool MoreThanReefs = BiomeTileCounterSystem.SunkenSeaBurrowsTiles > BiomeTileCounterSystem.SunkenSeaReefsTiles; bool MoreThanPolyp = BiomeTileCounterSystem.SunkenSeaBurrowsTiles > BiomeTileCounterSystem.SunkenSeaPolypTiles; - return BiomeTileCounterSystem.SunkenSeaBurrowsTiles > 150 && MoreThanReefs && MoreThanPolyp; + return BiomeTileCounterSystem.SunkenSeaBurrowsTiles > 500 && MoreThanReefs && MoreThanPolyp; } } } diff --git a/BiomeManagers/SunkenSeaPolypBiome.cs b/BiomeManagers/SunkenSeaPolypBiome.cs index 92add24977..3c2fdeaeda 100644 --- a/BiomeManagers/SunkenSeaPolypBiome.cs +++ b/BiomeManagers/SunkenSeaPolypBiome.cs @@ -23,7 +23,7 @@ namespace CalamityMod.BiomeManagers bool MoreThanReefs = BiomeTileCounterSystem.SunkenSeaPolypTiles > BiomeTileCounterSystem.SunkenSeaReefsTiles; bool MoreThanBurrows = BiomeTileCounterSystem.SunkenSeaPolypTiles > BiomeTileCounterSystem.SunkenSeaBurrowsTiles; - return BiomeTileCounterSystem.SunkenSeaPolypTiles > 150 && MoreThanReefs && MoreThanBurrows; + return BiomeTileCounterSystem.SunkenSeaPolypTiles > 500 && MoreThanReefs && MoreThanBurrows; } } } diff --git a/BiomeManagers/SunkenSeaReefsBiome.cs b/BiomeManagers/SunkenSeaReefsBiome.cs index b63a75aa92..d9d7fe0c79 100644 --- a/BiomeManagers/SunkenSeaReefsBiome.cs +++ b/BiomeManagers/SunkenSeaReefsBiome.cs @@ -23,7 +23,7 @@ namespace CalamityMod.BiomeManagers bool MoreThanBurrows = BiomeTileCounterSystem.SunkenSeaReefsTiles > BiomeTileCounterSystem.SunkenSeaBurrowsTiles; bool MoreThanPolyp = BiomeTileCounterSystem.SunkenSeaReefsTiles > BiomeTileCounterSystem.SunkenSeaPolypTiles; - return BiomeTileCounterSystem.SunkenSeaReefsTiles > 150 && MoreThanBurrows && MoreThanPolyp; + return BiomeTileCounterSystem.SunkenSeaReefsTiles > 500 && MoreThanBurrows && MoreThanPolyp; } } } diff --git a/BiomeManagers/SunkenSeaShoresBiome.cs b/BiomeManagers/SunkenSeaShoresBiome.cs index 08579ece75..4f6252a37b 100644 --- a/BiomeManagers/SunkenSeaShoresBiome.cs +++ b/BiomeManagers/SunkenSeaShoresBiome.cs @@ -20,7 +20,7 @@ namespace CalamityMod.BiomeManagers public override bool IsBiomeActive(Player player) { - return BiomeTileCounterSystem.SunkenSeaShoresTiles > 150; + return BiomeTileCounterSystem.SunkenSeaShoresTiles > 500; } } } diff --git a/Buffs/Pets/EidolonSnailBuff.png b/Buffs/Pets/EidolonSnailBuff.png index 6cc347ab66..d237231cbd 100644 Binary files a/Buffs/Pets/EidolonSnailBuff.png and b/Buffs/Pets/EidolonSnailBuff.png differ diff --git a/CalamityMod.cs b/CalamityMod.cs index 20d439a315..7922f114bd 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -218,11 +218,12 @@ namespace CalamityMod BaseIdleHoldoutProjectile.LoadAll(); PlayerDashManager.Load(); - //load all the detours for the custom surface backgrounds + //load all the detours for the custom backgrounds Backgrounds.AstralSurfaceBG.Load(); Backgrounds.AstralDesertBG.Load(); Backgrounds.AstralSnowBG.Load(); Backgrounds.SulphurSeaBG.Load(); + Backgrounds.SunkenSeaBurrowsBG.Load(); } private void LoadClient() diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 112ac89f94..fb30501147 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -1014,7 +1014,7 @@ namespace CalamityMod.ILEditing } if (Main.waterStyle == SunkenSeaBurrowsWater.Type) { - waterGlowColor = new Color(76, 211, 231); + waterGlowColor = new Color(44, 123, 135); } if (Main.waterStyle == BasaltGullyWater.Type) { @@ -1040,7 +1040,7 @@ namespace CalamityMod.ILEditing float wave5angle = 0.55f + 0.45f * (float)Math.Sin(MathHelper.ToRadians(wave5)); float wave6angle = 0.55f + 0.45f * (float)Math.Sin(MathHelper.ToRadians(wave6)); float bigwaveangle = 0.55f + 0.80f * (float)Math.Sin(MathHelper.ToRadians(bigwave)); - outputColor = Vector3.Lerp(outputColor, waterGlowColor.ToVector3(), 0.07f + wave1angle + wave2angle + wave3angle + wave4angle + wave5angle + wave6angle + bigwaveangle); + outputColor = Vector3.Lerp(outputColor, Color.DarkSlateGray.ToVector3(), 0.07f + wave1angle + wave2angle + wave3angle + wave4angle + wave5angle + wave6angle + bigwaveangle); outputColor *= brightness; } } diff --git a/Items/Armor/Vanity/AbyssHood.cs b/Items/Armor/Vanity/AbyssHood.cs deleted file mode 100644 index ab6f97d03a..0000000000 --- a/Items/Armor/Vanity/AbyssHood.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -using CalamityMod.Items.Placeables; -using CalamityMod.Items.Materials; - -namespace CalamityMod.Items.Armor.Vanity -{ - [AutoloadEquip(EquipType.Head)] - public class AbyssHood : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Armor.Vanity"; - - public override void SetStaticDefaults() - { - if (Main.netMode != NetmodeID.Server) - { - ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; - } - } - - public override void SetDefaults() - { - Item.width = 32; - Item.height = 22; - Item.rare = ItemRarityID.Cyan; - Item.vanity = true; - Item.Calamity().devItem = true; - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(10). - AddIngredient(18). - AddIngredient(ItemID.Silk, 20). - AddTile(TileID.Loom). - Register(); - } - } -} diff --git a/Items/Armor/Vanity/AbyssHood.png b/Items/Armor/Vanity/AbyssHood.png deleted file mode 100644 index 22a2002aa4..0000000000 Binary files a/Items/Armor/Vanity/AbyssHood.png and /dev/null differ diff --git a/Items/Armor/Vanity/AbyssHood_Head.png b/Items/Armor/Vanity/AbyssHood_Head.png deleted file mode 100644 index bc360ce6e0..0000000000 Binary files a/Items/Armor/Vanity/AbyssHood_Head.png and /dev/null differ diff --git a/Items/Armor/Vanity/AbyssRobe.cs b/Items/Armor/Vanity/AbyssRobe.cs deleted file mode 100644 index 2cf43909a3..0000000000 --- a/Items/Armor/Vanity/AbyssRobe.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -using CalamityMod.Items.Placeables; -using CalamityMod.Items.Materials; - -namespace CalamityMod.Items.Armor.Vanity -{ - [AutoloadEquip(EquipType.Body)] - public class AbyssRobe : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Armor.Vanity"; - - public override void Load() - { - if (Main.netMode != NetmodeID.Server) - { - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/Vanity/AbyssRobe_Legs", EquipType.Legs, this); - } - } - - public override void SetDefaults() - { - Item.width = 38; - Item.height = 30; - Item.vanity = true; - Item.Calamity().devItem = true; - Item.rare = ItemRarityID.Cyan; - } - - public override void SetMatch(bool male, ref int equipSlot, ref bool robes) - { - robes = true; - equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(22). - AddIngredient(25). - AddIngredient(ItemID.Silk, 25). - AddTile(TileID.Loom). - Register(); - } - } -} diff --git a/Items/Armor/Vanity/AbyssRobe.png b/Items/Armor/Vanity/AbyssRobe.png deleted file mode 100644 index 41b58da833..0000000000 Binary files a/Items/Armor/Vanity/AbyssRobe.png and /dev/null differ diff --git a/Items/Armor/Vanity/AbyssRobe_Body.png b/Items/Armor/Vanity/AbyssRobe_Body.png deleted file mode 100644 index 20739d0742..0000000000 Binary files a/Items/Armor/Vanity/AbyssRobe_Body.png and /dev/null differ diff --git a/Items/Armor/Vanity/AbyssRobe_Legs.png b/Items/Armor/Vanity/AbyssRobe_Legs.png deleted file mode 100644 index 1d14db1b22..0000000000 Binary files a/Items/Armor/Vanity/AbyssRobe_Legs.png and /dev/null differ diff --git a/Items/Pets/AbyssShellFossil.cs b/Items/Pets/AbyssShellFossil.cs index 69567f3de8..7cea1f4122 100644 --- a/Items/Pets/AbyssShellFossil.cs +++ b/Items/Pets/AbyssShellFossil.cs @@ -20,8 +20,9 @@ namespace CalamityMod.Items.Pets Item.useTime = 20; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; - Item.Calamity().devItem = true; + Item.value = Item.sellPrice(platinum: 1); Item.rare = ItemRarityID.Cyan; + Item.Calamity().devItem = true; Item.shoot = ModContent.ProjectileType(); Item.buffType = ModContent.BuffType(); Item.UseSound = SoundID.Item2; diff --git a/Items/Pets/AbyssShellFossil.png b/Items/Pets/AbyssShellFossil.png index c8f41db315..327ace4d86 100644 Binary files a/Items/Pets/AbyssShellFossil.png and b/Items/Pets/AbyssShellFossil.png differ diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 02f90564d5..fb9cc2eee1 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -354,7 +354,7 @@ Dreamfog: { } EidolonSnailBuff: { - DisplayName: Escargidolon Snail + DisplayName: Eidolon Snail Description: What a silly little snail } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.Vanity.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.Vanity.hjson index 626498de15..eaefebe6e8 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.Vanity.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.Vanity.hjson @@ -242,13 +242,3 @@ YharonMask: { DisplayName: Yharon Mask Tooltip: "" } - -AbyssHood: { - DisplayName: Abyss Cultist Hood - Tooltip: Turns your face into tentacles -} - -AbyssRobe: { - DisplayName: Abyss Cultist Robe - Tooltip: It feels cold, but very cozy -} diff --git a/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson b/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson index b1c24a615a..5e81f1ab43 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson @@ -1,9 +1,9 @@ AbyssShellFossil: { - DisplayName: Abyssal Shell Fossil + DisplayName: Abyss Shell Fossil Tooltip: ''' - Summons an escargidolon snail to follow you - Slightly reduces creatures' ability to detect you in the abyss + Summons a pet Eidolon Snail to follow you + Slightly reduces creatures' ability to detect you in the abyss while equipped ''' } diff --git a/Projectiles/Pets/EidolonSnail.cs b/Projectiles/Pets/EidolonSnail.cs index 1cb931d241..f8cf227e44 100644 --- a/Projectiles/Pets/EidolonSnail.cs +++ b/Projectiles/Pets/EidolonSnail.cs @@ -1,9 +1,10 @@ -using CalamityMod.CalPlayer; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ModLoader; using System; +using CalamityMod.CalPlayer; namespace CalamityMod.Projectiles.Pets { @@ -11,12 +12,16 @@ namespace CalamityMod.Projectiles.Pets { public new string LocalizationCategory => "Projectiles.Pets"; private int playerStill = 0; + private bool idleAnimation = false; private bool fly = false; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 8; + Main.projFrames[Projectile.type] = 12; Main.projPet[Projectile.type] = true; + + ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 4, 5) + .WithOffset(-18f, 0f).WithSpriteDirection(1).WhenNotSelected(0, 0); } public override void SetDefaults() @@ -77,6 +82,7 @@ namespace CalamityMod.Projectiles.Pets Projectile.active = false; return; } + CalamityPlayer modPlayer = player.Calamity(); if (player.dead) { @@ -154,27 +160,54 @@ namespace CalamityMod.Projectiles.Pets //set frames when idle if (Projectile.position.X == Projectile.oldPosition.X && Projectile.position.Y == Projectile.oldPosition.Y && Projectile.velocity.X == 0) { - Projectile.frame = 0; - Projectile.frameCounter = 0; + if (Main.rand.NextBool(200) && !idleAnimation) + { + idleAnimation = true; + } + + if (idleAnimation) + { + Projectile.frameCounter++; + if (Projectile.frameCounter > 8) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + if (Projectile.frame > 4) + { + Projectile.frame = 0; + idleAnimation = false; + } + } + else + { + Projectile.frame = 0; + Projectile.frameCounter = 0; + } } //falling frame else if (Projectile.velocity.Y > 0.3f && Projectile.position.Y != Projectile.oldPosition.Y) { - Projectile.frame = 4; + Projectile.frame = 3; Projectile.frameCounter = 0; } else if (Projectile.velocity.X != 0) { + if (Projectile.frame < 4) + { + Projectile.frame = 4; + } + //moving animation Projectile.frameCounter++; - if (Projectile.frameCounter > 2) + if (Projectile.frameCounter > 7 - (Projectile.velocity.X > 0 ? Projectile.velocity.X : -Projectile.velocity.X)) { Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame > 4) + if (Projectile.frame > 8) { - Projectile.frame = 1; + Projectile.frame = 4; } } @@ -291,14 +324,14 @@ namespace CalamityMod.Projectiles.Pets //funny flying animation Projectile.frameCounter++; - if (Projectile.frameCounter > 3) + if (Projectile.frameCounter > 4) { Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame > 7) + if (Projectile.frame > 11) { - Projectile.frame = 5; + Projectile.frame = 9; } } } diff --git a/Projectiles/Pets/EidolonSnail.png b/Projectiles/Pets/EidolonSnail.png index 6618499211..fbc4874883 100644 Binary files a/Projectiles/Pets/EidolonSnail.png and b/Projectiles/Pets/EidolonSnail.png differ diff --git a/Projectiles/Pets/EidolonSnailGlow.png b/Projectiles/Pets/EidolonSnailGlow.png index 2097448bf6..0e9057803c 100644 Binary files a/Projectiles/Pets/EidolonSnailGlow.png and b/Projectiles/Pets/EidolonSnailGlow.png differ diff --git a/Systems/BiomeTileCounterSystem.cs b/Systems/BiomeTileCounterSystem.cs index 75f7648fef..9993e67f64 100644 --- a/Systems/BiomeTileCounterSystem.cs +++ b/Systems/BiomeTileCounterSystem.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Systems public override void TileCountsAvailable(ReadOnlySpan tileCounts) { BrimstoneCragTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; - SunkenSeaTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + + tileCounts[ModContent.TileType()]; + SunkenSeaTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; SunkenSeaShoresTiles = tileCounts[ModContent.TileType()] + + tileCounts[ModContent.TileType()]; SunkenSeaPolypTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; SunkenSeaReefsTiles = tileCounts[ModContent.TileType()] + tileCounts[ModContent.TileType()]; diff --git a/Tiles/Abyss/AbyssCoral.cs b/Tiles/Abyss/AbyssCoral.cs index beb50b9a0a..6520fc2686 100644 --- a/Tiles/Abyss/AbyssCoral.cs +++ b/Tiles/Abyss/AbyssCoral.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Tiles.Abyss TileID.Sets.ChecksForMerge[Type] = true; HitSound = SoundID.Dig; DustType = 119; - AddMapEntry(new Color(139, 206, 56)); + AddMapEntry(new Color(70, 115, 144)); Main.tileShine2[Type] = true; TileID.Sets.CanBeDugByShovel[Type] = true; diff --git a/Tiles/SunkenSea/Ambient/WallCoral.cs b/Tiles/SunkenSea/Ambient/WallCoral.cs index c8db58f060..634fe16177 100644 --- a/Tiles/SunkenSea/Ambient/WallCoral.cs +++ b/Tiles/SunkenSea/Ambient/WallCoral.cs @@ -19,9 +19,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.None, 0, 0); TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.AnchorLeft = new AnchorData(AnchorType.SolidTile, 3, 0); + TileObjectData.newAlternate.AnchorLeft = new AnchorData(AnchorType.SolidTile, 2, 0); TileObjectData.addAlternate(1); - TileObjectData.newTile.AnchorRight = new AnchorData(AnchorType.SolidTile, 3, 0); + TileObjectData.newTile.AnchorRight = new AnchorData(AnchorType.SolidTile, 2, 0); TileObjectData.addTile(Type); DustType = 253; AddMapEntry(new Color(54, 69, 72)); diff --git a/Tiles/SunkenSea/Basalt.cs b/Tiles/SunkenSea/Basalt.cs index bad7a87615..1c1ad976d8 100644 --- a/Tiles/SunkenSea/Basalt.cs +++ b/Tiles/SunkenSea/Basalt.cs @@ -32,6 +32,8 @@ namespace CalamityMod.Tiles.SunkenSea AddMapEntry(new Color(58, 55, 70)); + MinPick = 100; + TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); TileFraming.SetUpUniversalMerge(Type, TileID.Sandstone, out secondTileAdjacency); TileFraming.SetUpUniversalMerge(Type, TileID.Sand, out thirdTileAdjacency); diff --git a/World/SulphurousSea.cs b/World/SulphurousSea.cs index fa42696412..aafa44f860 100644 --- a/World/SulphurousSea.cs +++ b/World/SulphurousSea.cs @@ -214,7 +214,7 @@ namespace CalamityMod.World CreateBeach(); ClearOutStrayTiles(); ClearAloneTiles(); - PlaceSulphurReef(); + //PlaceSulphurReef(); var scrapPilePositions = PlaceScrapPiles(); GenerateColumnsInCaverns(); GenerateHardenedSandstone(); @@ -671,6 +671,7 @@ namespace CalamityMod.World } } + /* public static void PlaceSulphurReef() { int beachWidth = WorldGen.genRand.Next(150, 190 + 1); @@ -810,6 +811,7 @@ namespace CalamityMod.World return distance <= distanceConstant; } + */ public static void CreateBeach() { diff --git a/World/SunkenSea.cs b/World/SunkenSea.cs index a7e9937ef9..98b5fd2d78 100644 --- a/World/SunkenSea.cs +++ b/World/SunkenSea.cs @@ -26,6 +26,38 @@ namespace CalamityMod.World -Make sunken sea walls produce water */ + public static void PlaceTimelessShores(int startPosX, int startPosY) + { + int biomeSize = 180 + (Main.maxTilesX / 180); + + for (int X = startPosX - biomeSize; X <= startPosX + biomeSize; X++) + { + for (int Y = startPosY - 50; Y <= startPosY + 50; Y++) + { + if ((X == startPosX - biomeSize || X == startPosX + biomeSize) && (Y == startPosY - 50 || Y == startPosY + 50)) + { + ShapeData circle = new ShapeData(); + GenAction blotchMod = new Modifiers.Blotches(2, 0.4); + + WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(60), Actions.Chain(new GenAction[] + { + blotchMod.Output(circle) + })); + WorldUtils.Gen(new Point(X, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] + { + new Actions.Clear(), + new Actions.PlaceTile((ushort)ModContent.TileType()) + })); + } + else + { + Main.tile[X, Y].ClearEverything(); + WorldGen.PlaceTile(X, Y, (ushort)ModContent.TileType()); + } + } + } + } + //sides of the sunken sea (radiant reefs) public static void PlaceRadiantReefs(int startPosX, int startPosY, bool LeftSideBarrier) { @@ -65,16 +97,16 @@ namespace CalamityMod.World { if (LeftSideBarrier) { - if (X <= origin.X && Main.tile[X, Y].TileType != ModContent.TileType()) + if (X <= origin.X && Main.tile[X - 40, Y].TileType != ModContent.TileType()) { ShapeData circle = new ShapeData(); GenAction blotchMod = new Modifiers.Blotches(2, 0.4); - WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(60), Actions.Chain(new GenAction[] + WorldUtils.Gen(new Point(X - 40, Y), new Shapes.Circle(60), Actions.Chain(new GenAction[] { blotchMod.Output(circle) })); - WorldUtils.Gen(new Point(X, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] + WorldUtils.Gen(new Point(X - 40, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] { new Actions.Clear(), new Actions.PlaceTile((ushort)ModContent.TileType()) @@ -83,16 +115,16 @@ namespace CalamityMod.World } else { - if (X >= origin.X && Main.tile[X, Y].TileType != ModContent.TileType()) + if (X >= origin.X && Main.tile[X + 40, Y].TileType != ModContent.TileType()) { ShapeData circle = new ShapeData(); GenAction blotchMod = new Modifiers.Blotches(2, 0.4); - WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(60), Actions.Chain(new GenAction[] + WorldUtils.Gen(new Point(X + 40, Y), new Shapes.Circle(60), Actions.Chain(new GenAction[] { blotchMod.Output(circle) })); - WorldUtils.Gen(new Point(X, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] + WorldUtils.Gen(new Point(X + 40, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] { new Actions.Clear(), new Actions.PlaceTile((ushort)ModContent.TileType()) @@ -549,7 +581,7 @@ namespace CalamityMod.World float cavePerlinValueWalls = CalamityUtils.PerlinNoise2D(X / 375f, Y / 375f, 5, cavePerlinSeedWalls) + 0.5f + horizontalOffsetNoiseWalls; float cavePerlinValue2Walls = CalamityUtils.PerlinNoise2D(X / 375f, Y / 375f, 5, unchecked(cavePerlinSeedWalls - 1)) + 0.5f; float caveNoiseMapWalls = (cavePerlinValueWalls + cavePerlinValue2Walls) * 0.5f; - float caveCreationThresholdWalls = horizontalOffsetNoiseWalls * 3.5f + 0.235f; + float caveCreationThresholdWalls = horizontalOffsetNoiseWalls * 5.5f + 0.235f; if (caveNoiseMapWalls * caveNoiseMapWalls > caveCreationThresholdWalls) { @@ -657,50 +689,67 @@ namespace CalamityMod.World } //basalt biome underneath the sunken sea + //TODO: this generation is horribly optimized, redo this to place a rectangle of basalt with side dithering that goes down to hell instead of a loop of circles public static void PlaceBasaltGully(int startPosX, int startPosY) { int biomeSize = 230 + (Main.maxTilesX / 180); - //place area of basalt all the way down to hell - for (int X = startPosX - biomeSize; X <= startPosX + biomeSize; X += 20) + int XLeft = GenVars.UndergroundDesertLocation.Left; + int XRight = GenVars.UndergroundDesertLocation.Right; + + for (int Y = startPosY - 30; Y <= Main.maxTilesY - 230; Y += 20) { - for (int Y = startPosY + 20; Y <= Main.maxTilesY - 250; Y += 20) + if (Main.tile[XLeft, Y].TileType != ModContent.TileType()) { - if (Main.tile[X, Y].TileType != ModContent.TileType()) + ShapeData circle = new ShapeData(); + GenAction blotchMod = new Modifiers.Blotches(2, 0.4); + + int radius = WorldGen.genRand.Next(30, 45); + int RandomX = Main.rand.Next(-25, 25); + + WorldUtils.Gen(new Point(XLeft, Y), new Shapes.Circle(60), Actions.Chain(new GenAction[] { - ShapeData circle = new ShapeData(); - GenAction blotchMod = new Modifiers.Blotches(2, 0.4); - - WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(60), Actions.Chain(new GenAction[] - { - blotchMod.Output(circle) - })); - WorldUtils.Gen(new Point(X, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] - { - new Actions.Clear(), - new Actions.PlaceTile((ushort)ModContent.TileType()) - })); + blotchMod.Output(circle) + })); - //place a giant area of basalt below the sunken sea - for (int j = Y; j <= Main.maxTilesY - 250; j += 15) - { - int radius = WorldGen.genRand.Next(30, 45); - int RandomX = Main.rand.Next(-25, 25); + WorldUtils.Gen(new Point(XLeft, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] + { + new Actions.Clear(), + new Actions.PlaceTile((ushort)ModContent.TileType()), + new Actions.PlaceWall(WallID.LavaUnsafe1) + })); + } - WorldUtils.Gen(new Point(X + RandomX, j), new Shapes.Circle(radius), Actions.Chain(new GenAction[] - { - blotchMod.Output(circle) - })); + if (Main.tile[XRight, Y].TileType != ModContent.TileType()) + { + ShapeData circle = new ShapeData(); + GenAction blotchMod = new Modifiers.Blotches(2, 0.4); - //place blocks - WorldUtils.Gen(new Point(X + RandomX, j), new ModShapes.All(circle), Actions.Chain(new GenAction[] - { - new Actions.Clear(), - new Actions.PlaceTile((ushort)ModContent.TileType()), - new Actions.PlaceWall(WallID.LavaUnsafe1) - })); - } - } + int radius = WorldGen.genRand.Next(30, 45); + int RandomX = Main.rand.Next(-25, 25); + + WorldUtils.Gen(new Point(XRight, Y), new Shapes.Circle(60), Actions.Chain(new GenAction[] + { + blotchMod.Output(circle) + })); + + WorldUtils.Gen(new Point(XRight, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] + { + new Actions.Clear(), + new Actions.PlaceTile((ushort)ModContent.TileType()), + new Actions.PlaceWall(WallID.LavaUnsafe1) + })); + } + } + + //place area of basalt all the way down to hell + for (int X = startPosX - biomeSize - 25; X <= startPosX + biomeSize + 25; X++) + { + for (int Y = startPosY - 30; Y <= Main.maxTilesY - 210; Y++) + { + Main.tile[X, Y].ClearEverything(); + WorldGen.PlaceTile(X, Y, (ushort)ModContent.TileType()); + WorldGen.PlaceWall(X, Y, WallID.LavaUnsafe1); } }