diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 601b824f61..09fc053b22 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -8354,7 +8354,7 @@ namespace CalamityMod.CalPlayer // Bow and Book else if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || - item.type == ModContent.ItemType()) + item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) { Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/DeathwindGlow"); int offsetX = 10; @@ -8373,6 +8373,11 @@ namespace CalamityMod.CalPlayer texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/SubsumingVortexGlow"); offsetX = 9; } + else if (item.type == ModContent.ItemType()) + { + texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/AuroraBlazerGlow"); + offsetX = 44; + } Vector2 vector13 = new Vector2((float)(Main.itemTexture[item.type].Width / 2), (float)(Main.itemTexture[item.type].Height / 2)); Vector2 vector14 = vector13; diff --git a/Dusts/AstralBlue.png b/Dusts/AstralBlue.png index 691796f1c9..04b49e54e3 100644 Binary files a/Dusts/AstralBlue.png and b/Dusts/AstralBlue.png differ diff --git a/Dusts/AstralOrange.png b/Dusts/AstralOrange.png index 2802603a1e..13ad12079e 100644 Binary files a/Dusts/AstralOrange.png and b/Dusts/AstralOrange.png differ diff --git a/Items/TreasureBags/AstrageldonBag.cs b/Items/TreasureBags/AstrageldonBag.cs index 4acd405307..5a76c89f86 100644 --- a/Items/TreasureBags/AstrageldonBag.cs +++ b/Items/TreasureBags/AstrageldonBag.cs @@ -5,6 +5,7 @@ using CalamityMod.Items.Mounts; using CalamityMod.Items.PermanentBoosters; using CalamityMod.Items.Potions; using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.AstrumAureus; using CalamityMod.World; @@ -34,10 +35,7 @@ namespace CalamityMod.Items.TreasureBags item.rare = 9; } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() => true; public override void OpenBossBag(Player player) { @@ -50,6 +48,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 diff --git a/Items/Weapons/Ranged/AuroraBlazer.cs b/Items/Weapons/Ranged/AuroraBlazer.cs new file mode 100644 index 0000000000..3364382d01 --- /dev/null +++ b/Items/Weapons/Ranged/AuroraBlazer.cs @@ -0,0 +1,59 @@ +using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Ranged +{ + public class AuroraBlazer : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Aurora Blazer"); + Tooltip.SetDefault("Spews astral flames that travel in a star-shaped patterns\n" + + "60% chance to not consume gel"); + } + + public override void SetDefaults() + { + item.damage = 101; + item.ranged = true; + item.useTime = 15; + item.useAnimation = 15; + item.knockBack = 2f; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 7.5f; + item.useAmmo = AmmoID.Gel; + + item.width = 68; + item.height = 36; + item.useStyle = 5; + item.noMelee = true; + item.UseSound = SoundID.Item34; + item.value = CalamityGlobalItem.Rarity7BuyPrice; + item.rare = 7; + } + + 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 SpeedX = speedX + Main.rand.NextFloat(-15f, 15f) * 0.05f; + float SpeedY = speedY + Main.rand.NextFloat(-15f, 15f) * 0.05f; + Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, Main.rand.Next(4, 11), 0f); + return false; + } + + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/AuroraBlazerGlow"); + Vector2 origin = new Vector2(glowmask.Width / 2f, glowmask.Height / 2f - 2f); + spriteBatch.Draw(glowmask, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + } + + public override Vector2? HoldoutOffset() => new Vector2(-10, 0); + + public override bool ConsumeAmmo(Player player) => Main.rand.Next(100) >= 60; + } +} diff --git a/Items/Weapons/Ranged/AuroraBlazer.png b/Items/Weapons/Ranged/AuroraBlazer.png new file mode 100644 index 0000000000..567a768453 Binary files /dev/null and b/Items/Weapons/Ranged/AuroraBlazer.png differ diff --git a/Items/Weapons/Ranged/AuroraBlazerGlow.png b/Items/Weapons/Ranged/AuroraBlazerGlow.png new file mode 100644 index 0000000000..91533ab0b1 Binary files /dev/null and b/Items/Weapons/Ranged/AuroraBlazerGlow.png differ diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 93e95f268a..4749e0d6ca 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -357,7 +357,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("AstrumAureus", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemID.FallenStar, ItemType(), ItemType(), ItemType(), ItemType(), ItemID.HallowedKey, ItemID.FragmentSolar, ItemID.FragmentVortex, ItemID.FragmentNebula, ItemID.FragmentStardust, ItemType(), ItemID.GreaterHealingPotion }; + List loot = new List() { ItemType(), ItemType(), ItemID.FallenStar, ItemType(), ItemType(),ItemType(), ItemType(), ItemType(), ItemID.HallowedKey, ItemID.FragmentSolar, ItemID.FragmentVortex, ItemID.FragmentNebula, ItemID.FragmentStardust, ItemType(), ItemID.GreaterHealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}] at Night in the Astral Biome"; string despawn = CalamityUtils.ColorMessage("Astrum Aureus’ program has been executed. Initiate recall.", new Color(0xFF, 0xD7, 0x00)); diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index 4299c68e61..20b3e3f30b 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -8,6 +8,7 @@ using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.Potions; using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.TownNPCs; using CalamityMod.World; @@ -357,6 +358,7 @@ namespace CalamityMod.NPCs.AstrumAureus // Weapons DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); // Vanity diff --git a/Projectiles/Ranged/AuroraFire.cs b/Projectiles/Ranged/AuroraFire.cs new file mode 100644 index 0000000000..aae7dae614 --- /dev/null +++ b/Projectiles/Ranged/AuroraFire.cs @@ -0,0 +1,89 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class AuroraFire : ModProjectile + { + private const int framesBeforeTurning = 70; + private bool initialized = false; + private int radianAmt = 0; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Aurora"); + } + + public override void SetDefaults() + { + projectile.width = 12; + projectile.height = 12; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.ranged = true; + projectile.penetrate = -1; + projectile.extraUpdates = 3; + projectile.tileCollide = false; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 8; + } + + public override void AI() + { + if (projectile.ai[0] % 2 == 0) + projectile.ai[0]++; + + if (!initialized) + { + int pointCount = (int)projectile.ai[0]; + radianAmt = 180 + (int)(360 / (pointCount * 2)); + projectile.timeLeft = framesBeforeTurning * pointCount - 1; + initialized = true; + } + + //Velocity movement + projectile.localAI[1]++; + if (projectile.localAI[1] % framesBeforeTurning == 0) + { + projectile.velocity = projectile.velocity.RotatedBy(MathHelper.ToRadians(radianAmt)); + } + + //Dust behavior + projectile.localAI[0] += 1f; + if (projectile.localAI[0] > 4f) + { + int dustType = Utils.SelectRandom(Main.rand, new int[] + { + ModContent.DustType(), + ModContent.DustType() + }); + for (int i = 0; i < 5; i++) + { + int astral = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 0.8f); + Dust dust = Main.dust[astral]; + dust.noGravity = true; + dust.velocity *= 0f; + dust.scale *= Main.rand.NextFloat(); + } + } + + //rotation code for when sproot + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + } + + 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/Ranged/AuroraFire.png b/Projectiles/Ranged/AuroraFire.png new file mode 100644 index 0000000000..983260eb07 Binary files /dev/null and b/Projectiles/Ranged/AuroraFire.png differ