diff --git a/Buffs/Summon/DormantBrimseekerBuff.cs b/Buffs/Summon/DormantBrimseekerBuff.cs new file mode 100644 index 0000000000..ba461e80fe --- /dev/null +++ b/Buffs/Summon/DormantBrimseekerBuff.cs @@ -0,0 +1,36 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Summon; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Summon +{ + public class DormantBrimseekerBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Dormant Brimseeker"); + Description.SetDefault("Does it want something from you?"); + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.Calamity(); + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + { + modPlayer.brimseeker = true; + } + if (!modPlayer.brimseeker) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } + } +} diff --git a/Buffs/Summon/DormantBrimseekerBuff.png b/Buffs/Summon/DormantBrimseekerBuff.png new file mode 100644 index 0000000000..b4ef01bb0d Binary files /dev/null and b/Buffs/Summon/DormantBrimseekerBuff.png differ diff --git a/Items/TreasureBags/BrimstoneWaifuBag.cs b/Items/TreasureBags/BrimstoneWaifuBag.cs index 27a400ae65..a46041fddd 100644 --- a/Items/TreasureBags/BrimstoneWaifuBag.cs +++ b/Items/TreasureBags/BrimstoneWaifuBag.cs @@ -6,6 +6,7 @@ using CalamityMod.Items.Mounts; using CalamityMod.Items.Pets; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.BrimstoneElemental; using CalamityMod.World; using Terraria; @@ -51,6 +52,7 @@ namespace CalamityMod.Items.TreasureBags // Weapons DropHelper.DropItemChance(player, ModContent.ItemType(), 3); DropHelper.DropItemChance(player, ModContent.ItemType(), 3); + DropHelper.DropItemChance(player, ModContent.ItemType(), 3); // Equipment DropHelper.DropItem(player, ModContent.ItemType()); diff --git a/Items/Weapons/Summon/DormantBrimseeker.cs b/Items/Weapons/Summon/DormantBrimseeker.cs new file mode 100644 index 0000000000..b617a29f4f --- /dev/null +++ b/Items/Weapons/Summon/DormantBrimseeker.cs @@ -0,0 +1,58 @@ +using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Summon +{ + public class DormantBrimseeker : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dormant Brimseeker"); + Tooltip.SetDefault("Summons a brimseeker to keep you company\n" + + "'You could’ve sworn that they turned even scarier when you looked at their reflections in a mirror'"); + } + + public override void SetDefaults() + { + item.damage = 97; + item.mana = 12; + item.width = item.height = 32; + item.useTime = item.useAnimation = 25; + item.useStyle = ItemUseStyleID.SwingThrow; + item.noMelee = true; + item.noUseGraphic = true; + item.knockBack = 3f; + item.UseSound = SoundID.Item20; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 10f; + item.summon = true; + + item.value = Item.buyPrice(0, 36, 0, 0); + item.rare = 5; + } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + float totalSlots = 0f; + for (int i = 0; i < Main.projectile.Length; i++) + { + if (Main.projectile[i].minion && Main.projectile[i].active && Main.projectile[i].owner == player.whoAmI) + { + totalSlots += Main.projectile[i].minionSlots; + } + } + if (totalSlots < player.maxMinions) + { + Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + } + else if (player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0f) + { + Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + } + return false; + } + } +} diff --git a/Items/Weapons/Summon/DormantBrimseeker.png b/Items/Weapons/Summon/DormantBrimseeker.png new file mode 100644 index 0000000000..05cc154fbb Binary files /dev/null and b/Items/Weapons/Summon/DormantBrimseeker.png differ diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 744ecf9316..d7087cf1f2 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -273,7 +273,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("BrimstoneElemental", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemID.SoulofFright, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.GreaterHealingPotion }; + List loot = new List() { ItemType(), ItemID.SoulofFright, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.GreaterHealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}] in the Brimstone Crag"; string despawn = CalamityUtils.ColorMessage("Brimstone Elemental withdraws to the ruins of her shrine.", new Color(0xDC, 0x14, 0x3C)); @@ -741,6 +741,7 @@ namespace CalamityMod sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); + sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), new List() { ProjectileType(), ProjectileType(), ProjectileType()}, new List() {1f-0.6666666f, 0.3333333f, 0.3333333f}); //Entropy's Vigil is a bruh moment diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index a1922433af..c652f756b7 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -9,6 +9,7 @@ using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -192,6 +193,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental // Weapons DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); // Equipment DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); diff --git a/Projectiles/Summon/BrimseekerAuraBall.cs b/Projectiles/Summon/BrimseekerAuraBall.cs new file mode 100644 index 0000000000..76cac58488 --- /dev/null +++ b/Projectiles/Summon/BrimseekerAuraBall.cs @@ -0,0 +1,82 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class BrimseekerAuraBall : ModProjectile + { + public static float MovementSpeed = 4f; + public static float RotationalSpeed = 0.08f; + public bool initialized = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Seeker"); + ProjectileID.Sets.MinionShot[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = 8; + projectile.height = 8; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.minion = true; + projectile.minionSlots = 0f; + projectile.tileCollide = false; + } + + public override void AI() + { + if (!initialized) + { + projectile.rotation = Main.rand.NextFloat(0f, MathHelper.TwoPi); + projectile.localAI[1] = Main.rand.NextFloat(-RotationalSpeed, RotationalSpeed); + initialized = true; + } + projectile.tileCollide = false; + + Projectile parent = Main.projectile[(int)projectile.ai[0]]; + + if (parent.active) + { + Vector2 positionDelta = new Vector2(0, projectile.localAI[0]); + positionDelta = positionDelta.RotatedBy(projectile.rotation); + + projectile.Center = parent.Center + positionDelta; + projectile.rotation += projectile.localAI[1]; + + if (projectile.timeLeft % 200 / MovementSpeed < 100 / MovementSpeed) + { + projectile.localAI[0] += MovementSpeed; + } + else + { + projectile.localAI[0] -= MovementSpeed; + } + } + else + { + projectile.Kill(); + } + + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity.Y = -0.15f; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 240); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 240); + } + } +} diff --git a/Projectiles/Summon/BrimseekerAuraBall.png b/Projectiles/Summon/BrimseekerAuraBall.png new file mode 100644 index 0000000000..896fc18810 Binary files /dev/null and b/Projectiles/Summon/BrimseekerAuraBall.png differ diff --git a/Projectiles/Summon/DormantBrimseekerAura.cs b/Projectiles/Summon/DormantBrimseekerAura.cs new file mode 100644 index 0000000000..772531f5d7 --- /dev/null +++ b/Projectiles/Summon/DormantBrimseekerAura.cs @@ -0,0 +1,115 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class DormantBrimseekerAura : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dormant Brimseeker Aura Projecter"); + ProjectileID.Sets.MinionShot[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.friendly = true; + projectile.width = 30; + projectile.height = 30; + projectile.minion = true; + projectile.minionSlots = 0f; + projectile.ignoreWater = true; + projectile.tileCollide = true; + } + + public override void AI() + { + projectile.rotation = projectile.rotation.AngleLerp(-MathHelper.PiOver4, 0.045f); + projectile.velocity *= 0.975f; + if (Math.Abs(projectile.rotation + MathHelper.PiOver4) < 0.04f) + { + if (projectile.localAI[0] == 0f) + { + Main.PlaySound(SoundID.DD2_EtherianPortalOpen, projectile.Center); + for (int i = 0; i < 30; i++) + { + float angle = 1.4f * (i / 30f) - 0.7f; + Dust dust = Dust.NewDustPerfect(projectile.Center, (int)CalamityDusts.Brimstone); + dust.velocity = new Vector2(0f, -14f).RotatedBy(angle); + dust.noGravity = true; + } + for (int i = 0; i < 50; i++) + { + float angle = 2.4f * (i / 50f) - 1.2f; + Dust dust = Dust.NewDustPerfect(projectile.Center, (int)CalamityDusts.Brimstone); + dust.velocity = new Vector2(0f, 8f).RotatedBy(angle); + } + projectile.timeLeft = 820; + projectile.localAI[0] = 1f; + } + else + { + if (projectile.localAI[1] < 400f) + { + projectile.localAI[1] += 6f; + } + projectile.ai[1] += MathHelper.ToRadians(1.2f); + for (int i = 0; i < 85; i++) + { + float angle = MathHelper.TwoPi / 85f * i + projectile.ai[1]; + Dust dust = Dust.NewDustPerfect(projectile.Center + angle.ToRotationVector2() * projectile.localAI[1], (int)CalamityDusts.Brimstone); + dust.noGravity = true; + dust.velocity = Vector2.Zero; + if (Main.rand.NextBool(360)) + dust.scale = 1.5f; + } + for (int i = 0; i < Main.projectile.Length; i++) + { + if (Main.projectile[i].active && Main.projectile[i].type == ModContent.ProjectileType() && + Main.projectile[i].owner == projectile.owner && Main.projectile[i].localAI[1] == 0f) + { + if (Main.projectile[i].Distance(projectile.Center) < projectile.localAI[1]) + { + for (int j = 0; j < 30; j++) + { + Dust dust = Dust.NewDustPerfect(Main.projectile[i].Center, (int)CalamityDusts.Brimstone); + dust.velocity = Vector2.One.RotatedByRandom(MathHelper.TwoPi) * 7f; + } + Main.projectile[i].localAI[1] = 1f; + Main.PlaySound(SoundID.Item45, Main.projectile[i].Center); + } + } + } + + if (Main.rand.NextBool(50)) + { + int idx = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), 120, + 3f, projectile.owner, projectile.whoAmI); + Main.projectile[idx].timeLeft = projectile.timeLeft; + } + } + } + } + public override void Kill(int timeLeft) + { + for (int i = 0; i < Main.projectile.Length; i++) + { + if (Main.projectile[i].active && Main.projectile[i].type == ModContent.ProjectileType() && + Main.projectile[i].owner == projectile.owner && Main.projectile[i].localAI[1] == 1f) + { + for (int j = 0; j < 30; j++) + { + Dust dust = Dust.NewDustPerfect(projectile.Center, (int)CalamityDusts.Brimstone); + dust.velocity = Vector2.One.RotatedByRandom(MathHelper.TwoPi) * 7f; + } + Main.PlaySound(SoundID.Item29, Main.projectile[i].Center); + Main.projectile[i].localAI[1] = 0f; + } + } + } + } +} diff --git a/Projectiles/Summon/DormantBrimseekerAura.png b/Projectiles/Summon/DormantBrimseekerAura.png new file mode 100644 index 0000000000..05cc154fbb Binary files /dev/null and b/Projectiles/Summon/DormantBrimseekerAura.png differ diff --git a/Projectiles/Summon/DormantBrimseekerBab.cs b/Projectiles/Summon/DormantBrimseekerBab.cs new file mode 100644 index 0000000000..3cf448ce68 --- /dev/null +++ b/Projectiles/Summon/DormantBrimseekerBab.cs @@ -0,0 +1,227 @@ +using CalamityMod.Buffs.Summon; +using CalamityMod.CalPlayer; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class DormantBrimseekerBab : ModProjectile + { + public const float DistanceToCheck = 1600f; + public const float TurnTime = 25f; + public bool SeekingTarget = false; + public float MaxChargeTime + { + get + { + return (projectile.localAI[1] == 1f) ? 21 : 38; + } + } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dormant Brimseeker"); + + Main.projFrames[projectile.type] = 8; + + ProjectileID.Sets.TrailCacheLength[projectile.type] = 7; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = 46; + projectile.height = 36; + projectile.netImportant = true; + projectile.friendly = true; + projectile.minion = true; + projectile.minionSlots = 1f; + projectile.ignoreWater = true; + projectile.timeLeft = 18000; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.timeLeft *= 5; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 6; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + if (projectile.localAI[0] == 0f) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + projectile.localAI[0] = 1f; + } + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int trueDamage = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * + player.MinionDamage()); + projectile.damage = trueDamage; + } + bool isProperProjectile = projectile.type == ModContent.ProjectileType(); + player.AddBuff(ModContent.BuffType(), 3600); + if (isProperProjectile) + { + if (player.dead) + { + modPlayer.brimseeker = false; + } + if (modPlayer.brimseeker) + { + projectile.timeLeft = 2; + } + } + + NPC potentialTarget = projectile.Center.MinionHoming(DistanceToCheck, player); + if (potentialTarget == null) + { + projectile.rotation = projectile.rotation.AngleTowards(0f, 0.1f); + projectile.direction = projectile.spriteDirection = (projectile.velocity.X < 0).ToDirectionInt(); + projectile.ai[1] += MathHelper.ToRadians(3f); + if (projectile.ai[1] >= MathHelper.Pi * 4f) + { + projectile.ai[1] = 0f; + } + Vector2 destination = player.Center + projectile.ai[1].ToRotationVector2() * new Vector2(1f, (float)Math.Cos(projectile.ai[1])) * 200f; + + projectile.velocity = (projectile.velocity * 18f + projectile.DirectionTo(destination) * 14f) / 20f; + + projectile.frameCounter++; + if (projectile.frameCounter >= 6) + { + projectile.frameCounter = 0; + projectile.frame++; + } + if (projectile.frame >= 4 + (projectile.localAI[1] == 1f).ToInt() * 4) + { + projectile.frame = (projectile.localAI[1] == 1f).ToInt() * 4; + } + + float acceleration = 0.1f; + for (int index = 0; index < Main.projectile.Length; index++) + { + Projectile proj = Main.projectile[index]; + if (index != projectile.whoAmI && + proj.active && proj.owner == projectile.owner && + proj.type == projectile.type && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < projectile.width) + { + if (projectile.position.X < proj.position.X) + { + projectile.velocity.X -= acceleration; + } + else + { + projectile.velocity.X += acceleration; + } + if (projectile.position.Y < proj.position.Y) + { + projectile.velocity.Y -= acceleration; + } + else + { + projectile.velocity.Y += acceleration; + } + } + } + } + else + { + if (projectile.Distance(potentialTarget.Center) < 1100f && projectile.ai[0] == 0f) + { + Main.PlaySound(SoundID.DD2_DrakinShot, projectile.Center); + projectile.ai[0]++; + float acceleration = (projectile.localAI[1] == 1f) ? 1.6f : 0.8f; + float minSpeed = (projectile.localAI[1] == 1f) ? 13f : 8f; + float maxSpeed = (projectile.localAI[1] == 1f) ? 21f : 18f; + projectile.velocity = projectile.DirectionTo(potentialTarget.Center) * MathHelper.Clamp(projectile.velocity.Length() + acceleration, minSpeed, maxSpeed); + projectile.rotation = projectile.AngleTo(potentialTarget.Center) + (projectile.spriteDirection == 1).ToInt() * MathHelper.Pi; + } + else if (projectile.ai[0] > 0) + { + projectile.ai[0]++; + SeekingTarget = false; + } + else if (projectile.Distance(potentialTarget.Center) >= 1100f) + { + projectile.rotation = projectile.rotation.AngleTowards(projectile.AngleTo(potentialTarget.Center) + (projectile.spriteDirection == 1).ToInt() * MathHelper.Pi, 0.1f); + projectile.velocity = projectile.DirectionTo(potentialTarget.Center) * MathHelper.Clamp(projectile.velocity.Length() + 2f, 6f, 15f); + SeekingTarget = true; + projectile.ai[0] = 0f; + } + + if (projectile.ai[0] >= MaxChargeTime) + { + projectile.rotation = projectile.rotation.AngleTowards(projectile.AngleTo(potentialTarget.Center) + (projectile.spriteDirection == 1).ToInt() * MathHelper.Pi, 0.1f); + } + + projectile.frameCounter++; + if (projectile.frameCounter >= 6) + { + projectile.frameCounter = 0; + projectile.frame++; + } + if (projectile.frame >= 8) + { + projectile.frame = 4; + } + + if (projectile.ai[0] >= MaxChargeTime + TurnTime) + projectile.ai[0] = 0f; + } + Lighting.AddLight(projectile.Center, Color.Red.ToVector3()); + } + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + if ((projectile.ai[0] > 0f && projectile.ai[0] <= MaxChargeTime && projectile.velocity.Length() >= 8f) || SeekingTarget) + { + Texture2D projectileTexture = ModContent.GetTexture(Texture); + Texture2D flameTexture = Main.extraTexture[55]; + SpriteEffects spriteEffects = SpriteEffects.None; + if (projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + + float completionRatio = projectile.ai[0] / 30f; + if (projectile.ai[0] > 30f) + completionRatio = 1f - (30f - projectile.ai[0]) / 30f; + + Vector2 modifiedProjectileTexture = new Vector2(projectileTexture.Width / 2,projectileTexture.Height / Main.projFrames[projectile.type] / 2); + for (int oldPositionDrawIndex = 6; oldPositionDrawIndex >= 0; oldPositionDrawIndex--) + { + Color drawColor = Color.Lerp(Color.LightGoldenrodYellow, new Color(142, 24, 67), completionRatio); + drawColor = Color.Lerp(drawColor, new Color(142, 24, 67), oldPositionDrawIndex / 9.7f); + drawColor.A = (byte)(64f * completionRatio); + drawColor.R = (byte)(drawColor.R * (10 - oldPositionDrawIndex) / 20); + drawColor.G = (byte)(drawColor.G * (10 - oldPositionDrawIndex) / 20); + drawColor.B = (byte)(drawColor.B * (10 - oldPositionDrawIndex) / 20); + drawColor.A = (byte)(drawColor.A * (10 - oldPositionDrawIndex) / 20); + drawColor *= completionRatio; + int yFrame = ((int)projectile.ai[0] / 2 - oldPositionDrawIndex) % 4; + if (yFrame < 0) + { + yFrame += 4; + } + Rectangle flameFrameRectangle = flameTexture.Frame(1, 4, 0, yFrame); + Vector2 flameOrigin = new Vector2(flameTexture.Width / 2, flameTexture.Height / 8 + 14); + spriteBatch.Draw(flameTexture, + new Vector2(projectile.oldPos[oldPositionDrawIndex].X - Main.screenPosition.X + projectile.width / 2 - projectileTexture.Width * projectile.scale / 2f + modifiedProjectileTexture.X * projectile.scale, projectile.oldPos[oldPositionDrawIndex].Y - Main.screenPosition.Y + projectile.height - projectileTexture.Height * projectile.scale / Main.projFrames[projectile.type] + 4f + modifiedProjectileTexture.Y * projectile.scale + projectile.gfxOffY), + new Rectangle?(flameFrameRectangle), + drawColor, + projectile.oldRot[oldPositionDrawIndex] + projectile.oldSpriteDirection[oldPositionDrawIndex] * MathHelper.PiOver2, + flameOrigin, + MathHelper.Lerp(0.1f, 1.2f, (10f - oldPositionDrawIndex) / 10f), + spriteEffects, + 0f); + } + } + } + } +} diff --git a/Projectiles/Summon/DormantBrimseekerBab.png b/Projectiles/Summon/DormantBrimseekerBab.png new file mode 100644 index 0000000000..2413c37fc8 Binary files /dev/null and b/Projectiles/Summon/DormantBrimseekerBab.png differ diff --git a/Projectiles/Summon/DormantBrimseekerSummoner.cs b/Projectiles/Summon/DormantBrimseekerSummoner.cs new file mode 100644 index 0000000000..9c82495d12 --- /dev/null +++ b/Projectiles/Summon/DormantBrimseekerSummoner.cs @@ -0,0 +1,54 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class DormantBrimseekerSummoner : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dormant Brimseeker"); + ProjectileID.Sets.MinionShot[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.friendly = true; + projectile.width = 30; + projectile.height = 30; + projectile.minion = true; + projectile.minionSlots = 0f; + projectile.ignoreWater = true; + projectile.tileCollide = true; + } + + public override void AI() + { + projectile.rotation = projectile.rotation.AngleLerp(-MathHelper.PiOver4, 0.045f); + projectile.velocity *= 0.975f; + if (projectile.ai[0]++ == 110f) + { + Main.PlaySound(SoundID.Item100, projectile.Center); + } + if (projectile.ai[0]++ >= 90f) + { + for (int i = 0; i < (180 - (int)projectile.ai[0]) / 2; i++) + { + Dust dust = Dust.NewDustPerfect(projectile.Center, (int)CalamityDusts.Brimstone); + dust.velocity = Vector2.One.RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(1f, 4f); + dust.noGravity = true; + } + projectile.alpha = (int)(255 * (projectile.ai[0] - 90f) / 90f); + } + if (projectile.ai[0] >= 180f) + { + Projectile.NewProjectile(projectile.Center, Vector2.UnitY * 7f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, + projectile.owner); + projectile.Kill(); + } + } + } +} diff --git a/Projectiles/Summon/DormantBrimseekerSummoner.png b/Projectiles/Summon/DormantBrimseekerSummoner.png new file mode 100644 index 0000000000..05cc154fbb Binary files /dev/null and b/Projectiles/Summon/DormantBrimseekerSummoner.png differ