diff --git a/Buffs/Pets/EidolonSnailBuff.cs b/Buffs/Pets/EidolonSnailBuff.cs deleted file mode 100644 index 08f49bd8e0..0000000000 --- a/Buffs/Pets/EidolonSnailBuff.cs +++ /dev/null @@ -1,28 +0,0 @@ -using CalamityMod.Projectiles.Pets; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs.Pets -{ - public class EidolonSnailBuff : ModBuff - { - public override void SetStaticDefaults() - { - Main.buffNoTimeDisplay[Type] = true; - Main.vanityPet[Type] = true; - } - - public override void Update(Player player, ref int buffIndex) - { - player.buffTime[buffIndex] = 18000; - player.Calamity().eidolonSnailPet = true; - - bool PetProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0; - if (PetProjectileNotSpawned && player.whoAmI == Main.myPlayer) - { - Projectile.NewProjectile(player.GetSource_Buff(buffIndex), player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI); - } - } - } -} diff --git a/Buffs/Pets/EidolonSnailBuff.png b/Buffs/Pets/EidolonSnailBuff.png deleted file mode 100644 index 6cc347ab66..0000000000 Binary files a/Buffs/Pets/EidolonSnailBuff.png and /dev/null differ diff --git a/Items/Pets/AbyssShellFossil.cs b/Items/Pets/AbyssShellFossil.cs deleted file mode 100644 index a7ae400135..0000000000 --- a/Items/Pets/AbyssShellFossil.cs +++ /dev/null @@ -1,41 +0,0 @@ -using CalamityMod.Buffs.Pets; -using CalamityMod.Projectiles.Pets; -using CalamityMod.Rarities; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Pets -{ - public class AbyssShellFossil : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Pets"; - public override void SetDefaults() - { - Item.damage = 0; - Item.width = 42; - Item.height = 30; - Item.useAnimation = 20; - Item.useTime = 20; - Item.useStyle = ItemUseStyleID.Swing; - Item.noMelee = true; - - Item.value = Item.sellPrice(platinum: 1); - Item.rare = ModContent.RarityType(); - Item.Calamity().devItem = true; - - Item.shoot = ModContent.ProjectileType(); - Item.buffType = ModContent.BuffType(); - Item.UseSound = SoundID.Item2; - } - - public override void UseStyle(Player player, Rectangle heldItemFrame) - { - if (player.whoAmI == Main.myPlayer && player.itemTime == 0) - { - player.AddBuff(Item.buffType, 15, true); - } - } - } -} diff --git a/Items/Pets/AbyssShellFossil.png b/Items/Pets/AbyssShellFossil.png deleted file mode 100644 index c8f41db315..0000000000 Binary files a/Items/Pets/AbyssShellFossil.png and /dev/null differ diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 33803350fd..28d2f1bf30 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -358,11 +358,6 @@ Dreamfog: { Description: Xi believes in Yuu } -EidolonSnailBuff: { - DisplayName: Escargidolon Snail - Description: What a silly little prehistoric snail -} - ElectricTroublemaker: { DisplayName: Electric Troublemaker Description: Lightning never strikes the same place twice diff --git a/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson b/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson index 347afbbe96..b71f3205a1 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson @@ -1,13 +1,3 @@ -AbyssShellFossil: { - DisplayName: Abyss Shell Fossil - Tooltip: - ''' - A fossil of a prehistoric creature, long forgotten in the deep abyss - Summons a pet Escargidolon Snail to follow you - Slightly reduces creatures' ability to detect you in the abyss while equipped - ''' -} - BearsEye: { DisplayName: Bear's Eye Tooltip: Summons a pet guardian angel diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Pets.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Pets.hjson index ec239a3ef7..f58b798e01 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Pets.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Pets.hjson @@ -8,7 +8,6 @@ ChibiiDoggo.DisplayName: Chibii Devourer ChibiiDoggoFly.DisplayName: Chibii Devourer (Flying) DaawnlightSpiritOriginMinion.DisplayName: Daawnlight DannyDevitoPet.DisplayName: Danny Devito -EidolonSnail.DisplayName: Escargidolon Snail FlakPet.DisplayName: Flak Hermit FoxPet.DisplayName: Fox GoldiePet.DisplayName: Goldie diff --git a/Projectiles/Pets/Akato.cs b/Projectiles/Pets/Akato.cs index e4a639f2b0..6b6deffa07 100644 --- a/Projectiles/Pets/Akato.cs +++ b/Projectiles/Pets/Akato.cs @@ -1,6 +1,8 @@ using CalamityMod.CalPlayer; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Pets { public class Akato : ModProjectile, ILocalizedModType @@ -10,6 +12,9 @@ namespace CalamityMod.Projectiles.Pets { Main.projFrames[Projectile.type] = 6; Main.projPet[Projectile.type] = true; + + ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6) + .WithOffset(-38f, 0f).WithSpriteDirection(1).WhenNotSelected(0, 0); } public override void SetDefaults() diff --git a/Projectiles/Pets/Astrophage.cs b/Projectiles/Pets/Astrophage.cs index 92606b0c88..b44752567f 100644 --- a/Projectiles/Pets/Astrophage.cs +++ b/Projectiles/Pets/Astrophage.cs @@ -1,7 +1,9 @@ using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Pets { public class Astrophage : ModProjectile, ILocalizedModType @@ -13,6 +15,9 @@ namespace CalamityMod.Projectiles.Pets { Main.projFrames[Projectile.type] = 5; Main.projPet[Projectile.type] = true; + + ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6) + .WithOffset(-10f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } public override void SetDefaults() diff --git a/Projectiles/Pets/Bear.cs b/Projectiles/Pets/Bear.cs index 5577af726f..f7d50f265c 100644 --- a/Projectiles/Pets/Bear.cs +++ b/Projectiles/Pets/Bear.cs @@ -2,7 +2,9 @@ using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Pets { public class Bear : ModProjectile, ILocalizedModType @@ -18,6 +20,9 @@ namespace CalamityMod.Projectiles.Pets { Main.projFrames[Projectile.type] = 22; Main.projPet[Projectile.type] = true; + + ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 13, 6) + .WithOffset(-20f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } public override void SetDefaults() diff --git a/Projectiles/Pets/BrimlingPet.cs b/Projectiles/Pets/BrimlingPet.cs index 039b854234..1510328fd7 100644 --- a/Projectiles/Pets/BrimlingPet.cs +++ b/Projectiles/Pets/BrimlingPet.cs @@ -3,7 +3,9 @@ using CalamityMod.Dusts; using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Pets { public class BrimlingPet : ModProjectile, ILocalizedModType @@ -13,6 +15,9 @@ namespace CalamityMod.Projectiles.Pets { Main.projFrames[Projectile.type] = 8; Main.projPet[Projectile.type] = true; + + ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 4, 5) + .WithOffset(-25f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } public override void SetDefaults() diff --git a/Projectiles/Pets/ChibiiDoggo.cs b/Projectiles/Pets/ChibiiDoggo.cs index 74c7662fbf..a24c0bf4ae 100644 --- a/Projectiles/Pets/ChibiiDoggo.cs +++ b/Projectiles/Pets/ChibiiDoggo.cs @@ -24,6 +24,9 @@ namespace CalamityMod.Projectiles.Pets Main.projPet[Projectile.type] = true; ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + + ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6) + .WithOffset(-7f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } public override void SetDefaults() diff --git a/Projectiles/Pets/DannyDevitoPet.cs b/Projectiles/Pets/DannyDevitoPet.cs index caf6efc850..ff95d0f76d 100644 --- a/Projectiles/Pets/DannyDevitoPet.cs +++ b/Projectiles/Pets/DannyDevitoPet.cs @@ -2,7 +2,9 @@ using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Pets { public class DannyDevitoPet : ModProjectile, ILocalizedModType @@ -15,6 +17,9 @@ namespace CalamityMod.Projectiles.Pets { Main.projFrames[Projectile.type] = 8; Main.projPet[Projectile.type] = true; + + ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(2, 5, 5) + .WithOffset(-12f, 2f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } public override void SetDefaults() diff --git a/Projectiles/Pets/EidolonSnail.cs b/Projectiles/Pets/EidolonSnail.cs deleted file mode 100644 index 1cb931d241..0000000000 --- a/Projectiles/Pets/EidolonSnail.cs +++ /dev/null @@ -1,328 +0,0 @@ -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ModLoader; -using System; - -namespace CalamityMod.Projectiles.Pets -{ - public class EidolonSnail : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Pets"; - private int playerStill = 0; - private bool fly = false; - - public override void SetStaticDefaults() - { - Main.projFrames[Projectile.type] = 8; - Main.projPet[Projectile.type] = true; - } - - public override void SetDefaults() - { - Projectile.netImportant = true; - Projectile.width = 54; - Projectile.height = 38; - Projectile.friendly = true; - Projectile.penetrate = -1; - Projectile.timeLeft *= 5; - Projectile.tileCollide = true; - Projectile.ignoreWater = true; - } - - public override bool PreDraw(ref Color lightColor) - { - Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Pets/EidolonSnail").Value; - - int height = texture.Height / Main.projFrames[Projectile.type]; - int frameHeight = height * Projectile.frame; - SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - - Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY + 2), - new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), lightColor, - Projectile.rotation, new Vector2(texture.Width / 2f, height / 2f), Projectile.scale, spriteEffects, 0); - - return false; - } - - public override void PostDraw(Color lightColor) - { - Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Pets/EidolonSnailGlow").Value; - - int height = texture.Height / Main.projFrames[Projectile.type]; - int frameHeight = height * Projectile.frame; - SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - - Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY + 2), - new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), Color.White, - Projectile.rotation, new Vector2(texture.Width / 2f, height / 2f), Projectile.scale, spriteEffects, 0); - } - - public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) - { - Player player = Main.player[Projectile.owner]; - Vector2 projCenter = Projectile.Center; - Vector2 playerDirection = player.Center - projCenter; - float playerDistance = playerDirection.Length(); - fallThrough = playerDistance > 200f; - return true; - } - - public override void AI() - { - Player player = Main.player[Projectile.owner]; - if (!player.active) - { - Projectile.active = false; - return; - } - CalamityPlayer modPlayer = player.Calamity(); - if (player.dead) - { - modPlayer.eidolonSnailPet = false; - } - if (modPlayer.eidolonSnailPet) - { - Projectile.timeLeft = 2; - } - - Vector2 projPos = Projectile.position; - if (!fly) - { - Projectile.rotation = 0; - Vector2 projCenter = Projectile.Center; - Vector2 playerDirection = player.Center - projCenter; - float playerDistance = playerDirection.Length(); - if (Projectile.velocity.Y == 0 && ((HoleBelow() && playerDistance > 150f) || (playerDistance > 150f && Projectile.position.X == Projectile.oldPosition.X))) - { - Projectile.velocity.Y = -8f; - } - Projectile.velocity.Y += 0.35f; - if (Projectile.velocity.Y > 15f) - { - Projectile.velocity.Y = 15f; - } - if (playerDistance > 520f) - { - fly = true; - Projectile.velocity.X = 0f; - Projectile.velocity.Y = 0f; - } - if (playerDistance > 100f) - { - if (player.position.X - Projectile.position.X > 0f) - { - Projectile.velocity.X += 0.12f; - if (Projectile.velocity.X > 6f) - { - Projectile.velocity.X = 6f; - } - } - else - { - Projectile.velocity.X -= 0.12f; - if (Projectile.velocity.X < -6f) - { - Projectile.velocity.X = -6f; - } - } - } - if (playerDistance < 100f) - { - if (Projectile.velocity.X != 0f) - { - if (Projectile.velocity.X > 0.8f) - { - Projectile.velocity.X -= 0.25f; - } - else if (Projectile.velocity.X < -0.8f) - { - Projectile.velocity.X += 0.25f; - } - else if (Projectile.velocity.X < 0.8f && Projectile.velocity.X > -0.8f) - { - Projectile.velocity.X = 0f; - } - } - } - if (playerDistance < 70f) - { - Projectile.velocity.X *= 0.5f; - } - - //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; - } - //falling frame - else if (Projectile.velocity.Y > 0.3f && Projectile.position.Y != Projectile.oldPosition.Y) - { - Projectile.frame = 4; - Projectile.frameCounter = 0; - } - else if (Projectile.velocity.X != 0) - { - //moving animation - Projectile.frameCounter++; - if (Projectile.frameCounter > 2) - { - Projectile.frame++; - Projectile.frameCounter = 0; - } - if (Projectile.frame > 4) - { - Projectile.frame = 1; - } - } - - if (Projectile.velocity.X > 0.8f) - { - Projectile.spriteDirection = 1; - } - else if (Projectile.velocity.X < -0.8f) - { - Projectile.spriteDirection = -1; - } - } - else if (fly) - { - float flySpeed = 0.5f; - Projectile.tileCollide = false; - Vector2 flyDirection = new Vector2(Projectile.position.X + (float)Projectile.width * 0.5f, Projectile.position.Y + (float)Projectile.height * 0.5f); - float horiPos = Main.player[Projectile.owner].position.X + (float)(Main.player[Projectile.owner].width / 2) - flyDirection.X; - float vertiPos = Main.player[Projectile.owner].position.Y + (float)(Main.player[Projectile.owner].height / 2) - flyDirection.Y; - vertiPos += (float)Main.rand.Next(-10, 21); - horiPos += (float)Main.rand.Next(-10, 21); - horiPos += (float)(60 * -(float)player.direction); - vertiPos -= 60f; - float playerDistance = (float)Math.Sqrt((double)(horiPos * horiPos + vertiPos * vertiPos)); - if (playerDistance > 1200f) - { - Projectile.position.X = player.Center.X - (float)(Projectile.width / 2); - Projectile.position.Y = player.Center.Y - (float)(Projectile.height / 2); - Projectile.netUpdate = true; - } - if (playerDistance < 100f) - { - flySpeed = 0.5f; - if (player.velocity.Y == 0f) - { - ++playerStill; - } - else - { - playerStill = 0; - } - if (playerStill > 10 && !Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height)) - { - fly = false; - Projectile.velocity *= 0.2f; - Projectile.tileCollide = true; - } - } - if (playerDistance < 50f) - { - if (Math.Abs(Projectile.velocity.X) > 2f || Math.Abs(Projectile.velocity.Y) > 2f) - { - Projectile.velocity *= 0.90f; - } - flySpeed = 0.02f; - } - else - { - if (playerDistance < 100f) - { - flySpeed = 0.35f; - } - if (playerDistance > 300f) - { - flySpeed = 1f; - } - playerDistance = 18f / playerDistance; - horiPos *= playerDistance; - vertiPos *= playerDistance; - } - if (Projectile.velocity.X <= horiPos) - { - Projectile.velocity.X = Projectile.velocity.X + flySpeed; - if (flySpeed > 0.05f && Projectile.velocity.X < 0f) - { - Projectile.velocity.X = Projectile.velocity.X + flySpeed; - } - } - if (Projectile.velocity.X > horiPos) - { - Projectile.velocity.X = Projectile.velocity.X - flySpeed; - if (flySpeed > 0.05f && Projectile.velocity.X > 0f) - { - Projectile.velocity.X = Projectile.velocity.X - flySpeed; - } - } - if (Projectile.velocity.Y <= vertiPos) - { - Projectile.velocity.Y = Projectile.velocity.Y + flySpeed; - if (flySpeed > 0.05f && Projectile.velocity.Y < 0f) - { - Projectile.velocity.Y = Projectile.velocity.Y + flySpeed * 2f; - } - } - if (Projectile.velocity.Y > vertiPos) - { - Projectile.velocity.Y = Projectile.velocity.Y - flySpeed; - if (flySpeed > 0.05f && Projectile.velocity.Y > 0f) - { - Projectile.velocity.Y = Projectile.velocity.Y - flySpeed * 2f; - } - } - - Projectile.rotation += (Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y)) * 0.01f * (float)Projectile.direction; - - if (Projectile.Center.X < Main.player[Projectile.owner].Center.X) - { - Projectile.spriteDirection = 1; - } - else if (Projectile.Center.X > Main.player[Projectile.owner].Center.X) - { - Projectile.spriteDirection = -1; - } - - //funny flying animation - Projectile.frameCounter++; - if (Projectile.frameCounter > 3) - { - Projectile.frame++; - Projectile.frameCounter = 0; - } - if (Projectile.frame > 7) - { - Projectile.frame = 5; - } - } - } - - private bool HoleBelow() - { - int tileWidth = 4; - int tileX = (int)(Projectile.Center.X / 16f) - tileWidth; - if (Projectile.velocity.X > 0) - { - tileX += tileWidth; - } - int tileY = (int)((Projectile.position.Y + Projectile.height) / 16f); - for (int y = tileY; y < tileY + 2; y++) - { - for (int x = tileX; x < tileX + tileWidth; x++) - { - if (Main.tile[x, y].HasTile && (Main.tile[x - 1, y].HasTile || Main.tile[x + 1, y].HasTile)) - { - return false; - } - } - } - return true; - } - } -} \ No newline at end of file diff --git a/Projectiles/Pets/EidolonSnail.png b/Projectiles/Pets/EidolonSnail.png deleted file mode 100644 index 6618499211..0000000000 Binary files a/Projectiles/Pets/EidolonSnail.png and /dev/null differ diff --git a/Projectiles/Pets/EidolonSnailGlow.png b/Projectiles/Pets/EidolonSnailGlow.png deleted file mode 100644 index 2097448bf6..0000000000 Binary files a/Projectiles/Pets/EidolonSnailGlow.png and /dev/null differ diff --git a/Projectiles/Pets/FlakPet.cs b/Projectiles/Pets/FlakPet.cs index ae63ae54d8..f40880c6c0 100644 --- a/Projectiles/Pets/FlakPet.cs +++ b/Projectiles/Pets/FlakPet.cs @@ -2,7 +2,9 @@ using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Pets { public class FlakPet : ModProjectile, ILocalizedModType @@ -17,6 +19,9 @@ namespace CalamityMod.Projectiles.Pets { Main.projFrames[Projectile.type] = 7; Main.projPet[Projectile.type] = true; + + ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(2, 4, 6) + .WithOffset(-7f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } public override void SetDefaults() diff --git a/Projectiles/Pets/FoxPet.cs b/Projectiles/Pets/FoxPet.cs index fba24a1948..3dafc5d4bd 100644 --- a/Projectiles/Pets/FoxPet.cs +++ b/Projectiles/Pets/FoxPet.cs @@ -2,6 +2,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Pets { public class FoxPet : ModProjectile, ILocalizedModType @@ -11,6 +12,9 @@ namespace CalamityMod.Projectiles.Pets { Main.projFrames[Projectile.type] = 11; Main.projPet[Projectile.type] = true; + + ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 7, 6) + .WithOffset(-35f, 0f).WithSpriteDirection(1).WhenNotSelected(0, 0); } public override void SetDefaults() diff --git a/Projectiles/Pets/KendraPet.cs b/Projectiles/Pets/KendraPet.cs index 2dfbb656b9..2b8cfd88f8 100644 --- a/Projectiles/Pets/KendraPet.cs +++ b/Projectiles/Pets/KendraPet.cs @@ -3,8 +3,10 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; + namespace CalamityMod.Projectiles.Pets { public class KendraPet : ModProjectile, ILocalizedModType @@ -22,6 +24,9 @@ namespace CalamityMod.Projectiles.Pets { Main.projFrames[Projectile.type] = 31; Main.projPet[Projectile.type] = true; + + ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 13, 6) + .WithOffset(-30f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } public override void SetDefaults() diff --git a/Projectiles/Pets/LadShark.cs b/Projectiles/Pets/LadShark.cs index 773fa8c408..89aa3b8e14 100644 --- a/Projectiles/Pets/LadShark.cs +++ b/Projectiles/Pets/LadShark.cs @@ -14,6 +14,9 @@ namespace CalamityMod.Projectiles.Pets public override void SetStaticDefaults() { Main.projPet[Projectile.type] = true; + + ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 0, 1) + .WithOffset(-12f, -12f).WithSpriteDirection(-1); } public override void SetDefaults() diff --git a/Projectiles/Pets/LeviPet.cs b/Projectiles/Pets/LeviPet.cs index 9d15ecd996..4a454c3263 100644 --- a/Projectiles/Pets/LeviPet.cs +++ b/Projectiles/Pets/LeviPet.cs @@ -1,6 +1,8 @@ using CalamityMod.CalPlayer; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Pets { public class LeviPet : ModProjectile, ILocalizedModType @@ -10,6 +12,9 @@ namespace CalamityMod.Projectiles.Pets { Main.projFrames[Projectile.type] = 5; Main.projPet[Projectile.type] = true; + + ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6) + .WithOffset(-18f, -12f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } public override void SetDefaults() diff --git a/Projectiles/Pets/MiniHiveMind.cs b/Projectiles/Pets/MiniHiveMind.cs index e039784ddd..b9b0b30c42 100644 --- a/Projectiles/Pets/MiniHiveMind.cs +++ b/Projectiles/Pets/MiniHiveMind.cs @@ -21,6 +21,9 @@ namespace CalamityMod.Projectiles.Pets Main.projPet[Projectile.type] = true; ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + + ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6) + .WithOffset(-12f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } public override void SetDefaults() diff --git a/Projectiles/Pets/PerforaMini.cs b/Projectiles/Pets/PerforaMini.cs index 2668ffe77b..990c79c4e9 100644 --- a/Projectiles/Pets/PerforaMini.cs +++ b/Projectiles/Pets/PerforaMini.cs @@ -2,7 +2,9 @@ using CalamityMod.Buffs.Pets; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Pets { public class PerforaMini : ModProjectile, ILocalizedModType @@ -12,6 +14,9 @@ namespace CalamityMod.Projectiles.Pets { Main.projFrames[Projectile.type] = 8; Main.projPet[Projectile.type] = true; + + ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6) + .WithOffset(-8f, -20f).WithSpriteDirection(1).WhenNotSelected(0, 0); } public override void SetDefaults() diff --git a/Projectiles/Pets/PineapplePetProj.cs b/Projectiles/Pets/PineapplePetProj.cs index b4ca791833..d93cf25849 100644 --- a/Projectiles/Pets/PineapplePetProj.cs +++ b/Projectiles/Pets/PineapplePetProj.cs @@ -1,7 +1,9 @@ using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Pets { public class PineapplePetProj : ModProjectile, ILocalizedModType @@ -11,6 +13,9 @@ namespace CalamityMod.Projectiles.Pets { Main.projFrames[Projectile.type] = 5; Main.projPet[Projectile.type] = true; + + ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6) + .WithOffset(-2f, -20f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } public override void SetDefaults() diff --git a/Projectiles/Pets/PlaguebringerBab.cs b/Projectiles/Pets/PlaguebringerBab.cs index 6e31efdff9..a746fdfc0c 100644 --- a/Projectiles/Pets/PlaguebringerBab.cs +++ b/Projectiles/Pets/PlaguebringerBab.cs @@ -1,6 +1,8 @@ using CalamityMod.CalPlayer; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Pets { public class PlaguebringerBab : ModProjectile, ILocalizedModType @@ -10,6 +12,9 @@ namespace CalamityMod.Projectiles.Pets { Main.projFrames[Projectile.type] = 6; Main.projPet[Projectile.type] = true; + + ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 4, 6) + .WithOffset(-25f, -20f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } public override void SetDefaults() diff --git a/Projectiles/Pets/RotomPet.cs b/Projectiles/Pets/RotomPet.cs index 1303017c7b..57ce683357 100644 --- a/Projectiles/Pets/RotomPet.cs +++ b/Projectiles/Pets/RotomPet.cs @@ -2,7 +2,9 @@ using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Pets { public class RotomPet : ModProjectile, ILocalizedModType @@ -26,6 +28,9 @@ namespace CalamityMod.Projectiles.Pets { Main.projFrames[Projectile.type] = 4; Main.projPet[Projectile.type] = true; + + ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6) + .WithOffset(-10f, 0f).WithSpriteDirection(1).WhenNotSelected(0, 0); } public override void SetDefaults() diff --git a/Projectiles/Pets/SCalPet.cs b/Projectiles/Pets/SCalPet.cs index e08ac134df..f308251071 100644 --- a/Projectiles/Pets/SCalPet.cs +++ b/Projectiles/Pets/SCalPet.cs @@ -1,7 +1,9 @@ using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Pets { public class SCalPet : ModProjectile, ILocalizedModType @@ -11,6 +13,9 @@ namespace CalamityMod.Projectiles.Pets { Main.projFrames[Projectile.type] = 6; Main.projPet[Projectile.type] = true; + + ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6) + .WithOffset(-12f, -18).WithSpriteDirection(-1).WhenNotSelected(0, 0); } public override void SetDefaults() diff --git a/Projectiles/Pets/ThirdSage.cs b/Projectiles/Pets/ThirdSage.cs index 442a6d659b..aa0e0b2790 100644 --- a/Projectiles/Pets/ThirdSage.cs +++ b/Projectiles/Pets/ThirdSage.cs @@ -13,6 +13,9 @@ namespace CalamityMod.Projectiles.Pets { Main.projPet[Projectile.type] = true; Main.projFrames[Projectile.type] = 7; + + ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 4, 6) + .WithOffset(-15f, -5f).WithSpriteDirection(1).WhenNotSelected(0, 0); } public override void SetDefaults() diff --git a/Projectiles/Pets/YharonSonPet.cs b/Projectiles/Pets/YharonSonPet.cs index 06e4ed3992..36c8943d1b 100644 --- a/Projectiles/Pets/YharonSonPet.cs +++ b/Projectiles/Pets/YharonSonPet.cs @@ -2,7 +2,9 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Pets { public class YharonSonPet : ModProjectile, ILocalizedModType @@ -28,6 +30,10 @@ namespace CalamityMod.Projectiles.Pets public override void SetStaticDefaults() { Main.projPet[Projectile.type] = true; + + //im crying how do i even make this use the correct animation + ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 0, 1) + .WithOffset(-25f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } public override void SetDefaults() diff --git a/Tiles/Abyss/AbyssFossilTile.cs b/Tiles/Abyss/AbyssFossilTile.cs deleted file mode 100644 index 9fbaf659eb..0000000000 --- a/Tiles/Abyss/AbyssFossilTile.cs +++ /dev/null @@ -1,30 +0,0 @@ -using CalamityMod.Items.Pets; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.GameContent; -using Terraria.ModLoader; -using Terraria.ObjectData; - -namespace CalamityMod.Tiles.Abyss -{ - public class AbyssFossilTile : ModTile - { - public override void SetStaticDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileLavaDeath[Type] = false; - Main.tileWaterDeath[Type] = false; - TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.addTile(Type); - AddMapEntry(new Color(29, 37, 58), CalamityUtils.GetItemName()); - DustType = 33; - RegisterItemDrop(ModContent.ItemType()); - FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 3; - } - } -} diff --git a/Tiles/Abyss/AbyssFossilTile.png b/Tiles/Abyss/AbyssFossilTile.png deleted file mode 100644 index a9ba92d6d7..0000000000 Binary files a/Tiles/Abyss/AbyssFossilTile.png and /dev/null differ diff --git a/World/Abyss.cs b/World/Abyss.cs index a93fc44c13..4cd21088ef 100644 --- a/World/Abyss.cs +++ b/World/Abyss.cs @@ -318,8 +318,6 @@ namespace CalamityMod.World else if (y > 1500) maxAbyssIslands = 16; //Medium World - PlaceSnailFossil(abyssChasmX, Main.remixWorld ? 145 : AbyssChasmBottom + 45); - //place a single abyss island under the terminus shrine AbyssIsland(abyssChasmX, Main.remixWorld ? 105 : AbyssChasmBottom + 5, 65, 75, 40, 45, ModContent.TileType(), false, false, false); @@ -1117,49 +1115,6 @@ namespace CalamityMod.World } } - public static void PlaceSnailFossil(int i, int j) - { - //place an island - AbyssIsland(i, j + 2, 55, 75, 35, 45, ModContent.TileType(), false, false, false); - - //clear decently big circular area where the chest will be - for (int clearX = i - 2; clearX <= i + 2; clearX++) - { - for (int clearY = j - 8; clearY <= j - 1; clearY++) - { - //clear area for the chest to place - ShapeData circle = new ShapeData(); - GenAction blotchMod = new Modifiers.Blotches(2, 0.4); - - int radius = (int)(WorldGen.genRand.Next(3, 5) * WorldGen.genRand.NextFloat(0.74f, 0.82f)); - - WorldUtils.Gen(new Point(clearX, clearY), new Shapes.Circle(radius), Actions.Chain(new GenAction[] - { - blotchMod.Output(circle) - })); - - WorldUtils.Gen(new Point(clearX, clearY), new ModShapes.All(circle), Actions.Chain(new GenAction[] - { - new Actions.ClearTile() - })); - } - } - - //place cluster where chest will spawn - WorldGen.TileRunner(i, j + 4, 8, 5, ModContent.TileType(), true, 0, 0, false, true); - - //clear another small square exactly around where the chest will be so it has a flat area to place on - for (int clearX = i - 7; clearX <= i + 7; clearX++) - { - for (int clearY = j - 1; clearY <= j + 5; clearY++) - { - WorldGen.PlaceTile(clearX, clearY, ModContent.TileType()); - } - } - - WorldGen.PlaceObject(i, j - 2, (ushort)ModContent.TileType()); - } - /// /// Unlocks all abyss chests, automatically synced across the server. /// Only run initally on the server.