diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 8aef4084d0..466d115280 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -846,6 +846,8 @@ namespace CalamityMod.Items tt2.overrideColor = new Color(Main.DiscoR, 100, 255); if (item.type == ModContent.ItemType()) tt2.overrideColor = new Color(0, 0, 255); + if (item.type == ModContent.ItemType()) + tt2.overrideColor = new Color(1f, 0.5f + 0.35f * Main.DiscoG / 255f, 1f); if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) tt2.overrideColor = new Color(0.34f, 0.34f + 0.66f * Main.DiscoG / 255f, 0.34f + 0.5f * Main.DiscoG / 255f); if (item.type == ModContent.ItemType()) diff --git a/Items/Weapons/Magic/Judgement.cs b/Items/Weapons/Magic/Judgement.cs deleted file mode 100644 index 98db41677a..0000000000 --- a/Items/Weapons/Magic/Judgement.cs +++ /dev/null @@ -1,101 +0,0 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Magic; -using CalamityMod.Tiles.Furniture.CraftingStations; -using Microsoft.Xna.Framework; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Magic -{ - public class Judgement : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Dance of Light"); - Tooltip.SetDefault("Casts a swarm of white flames from the sky"); - } - - public override void SetDefaults() - { - item.damage = 700; - item.magic = true; - item.mana = 9; - item.width = 28; - item.height = 30; - item.useTime = 10; - item.useAnimation = 10; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 4f; - item.value = Item.buyPrice(5, 0, 0, 0); - item.rare = 10; - item.UseSound = SoundID.Item88; - item.autoReuse = true; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 30f; - item.Calamity().customRarity = CalamityRarity.Developer; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.LunarFlareBook); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddTile(ModContent.TileType()); - recipe.SetResult(this); - recipe.AddRecipe(); - } - - 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 num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - - int num107 = 3; - for (int num108 = 0; num108 < num107; num108++) - { - vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - vector2.Y -= (float)(100 * num108); - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) - { - num79 *= -1f; - } - if (num79 < 20f) - { - num79 = 20f; - } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - float speedX4 = num78 + (float)Main.rand.Next(-20, 21) * 0.02f; - float speedY5 = num79 + (float)Main.rand.Next(-20, 21) * 0.02f; - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, damage, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(15)); - } - return false; - } - } -} diff --git a/Items/Weapons/Magic/Judgement.png b/Items/Weapons/Magic/Judgement.png deleted file mode 100644 index e0678d8cc0..0000000000 Binary files a/Items/Weapons/Magic/Judgement.png and /dev/null differ diff --git a/Items/Weapons/Magic/TheDanceofLight.cs b/Items/Weapons/Magic/TheDanceofLight.cs new file mode 100644 index 0000000000..16dac68191 --- /dev/null +++ b/Items/Weapons/Magic/TheDanceofLight.cs @@ -0,0 +1,83 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Melee; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Magic +{ + public class TheDanceofLight : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Dance of Light"); + Tooltip.SetDefault("'Show them the wrath of a Lightbearer'"); + } + + public override void SetDefaults() + { + item.width = 40; + item.height = 42; + item.damage = 500; + item.knockBack = 4f; + item.magic = true; + item.mana = 4; + + item.useStyle = ItemUseStyleID.HoldingOut; + item.useTime = 4; + item.useAnimation = 4; + item.UseSound = SoundID.Item105; + item.autoReuse = true; + item.noMelee = true; + + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 14f; + + item.value = Item.buyPrice(platinum: 5); + item.rare = 10; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; + } + + public override Vector2? HoldoutOffset() + { + return Vector2.Zero; + } + + 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 intendedSpeed = (float)Math.Sqrt(speedX * speedX + speedY * speedY); + Vector2 target = Main.MouseWorld; + float minOffsetX = -40f; + float maxOffsetX = 40f; + if (target.X > player.Center.X) + minOffsetX = -120f; + else + maxOffsetX = 120f; + + int numProjectiles = 3; + for (int i = 0; i < numProjectiles; ++i) + { + float speed = Main.rand.NextFloat(0.94f, 1.02f) * intendedSpeed; + Vector2 deviation = new Vector2(Main.rand.NextFloat(minOffsetX, maxOffsetX), Main.rand.NextFloat(-1400f, -1200f)); + Vector2 startPos = target + deviation; + Vector2 vel = Vector2.Normalize(-deviation) * speed; + Projectile.NewProjectileDirect(startPos, vel, type, damage, knockBack, player.whoAmI); + } + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.LunarFlareBook); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Magic/TheDanceofLight.png b/Items/Weapons/Magic/TheDanceofLight.png new file mode 100644 index 0000000000..d7fc87853d Binary files /dev/null and b/Items/Weapons/Magic/TheDanceofLight.png differ diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 5ea4671edb..9e64f16e48 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -534,7 +534,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("SupremeCalamitas", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; List collection = new List() { ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}]"; string despawn = CalamityUtils.ColorMessage("Please don't waste my time.", new Color(0xFF, 0xA5, 0x00)); diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 069587dbf2..8470366d9b 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -2165,7 +2165,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), // Staff of Blushie ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), // The Dance of Light + ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), // Voidragon ModContent.ItemType(), ModContent.ItemType(), diff --git a/Projectiles/Magic/WhiteFlame.cs b/Projectiles/Magic/WhiteFlame.cs deleted file mode 100644 index a47b226707..0000000000 --- a/Projectiles/Magic/WhiteFlame.cs +++ /dev/null @@ -1,65 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Magic -{ - public class WhiteFlame : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Flame"); - } - - public override void SetDefaults() - { - projectile.width = 12; - projectile.height = 12; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.penetrate = 1; - projectile.timeLeft = 120; - projectile.magic = true; - projectile.extraUpdates = 3; - } - - public override void AI() - { - if (projectile.timeLeft % 6f == 0f) - { - for (int num457 = 0; num457 < Main.rand.Next(3,6); num457++) - { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 91, 0f, 0f, 100, default, 1f); - Main.dust[num458].noGravity = true; - Main.dust[num458].velocity *= 0.5f; - Main.dust[num458].velocity += projectile.velocity * 0.1f; - } - } - } - - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 122); - int num251 = 4; - if (projectile.owner == Main.myPlayer) - { - for (int num252 = 0; num252 < num251; num252++) - { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value15.X, value15.Y, ModContent.ProjectileType(), projectile.damage, 0f, projectile.owner, 0f, 0f); - } - } - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 360); - } - } -} diff --git a/Projectiles/Magic/WhiteFlame.png b/Projectiles/Magic/WhiteFlame.png deleted file mode 100644 index 04c5646fde..0000000000 Binary files a/Projectiles/Magic/WhiteFlame.png and /dev/null differ diff --git a/Projectiles/Magic/WhiteFlame2.cs b/Projectiles/Magic/WhiteFlame2.cs deleted file mode 100644 index 7e58c62ae1..0000000000 --- a/Projectiles/Magic/WhiteFlame2.cs +++ /dev/null @@ -1,51 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using Microsoft.Xna.Framework; -using System; -using Terraria; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Magic -{ - public class WhiteFlame2 : ModProjectile - { - float homeTimer = 100; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Flame"); - } - - public override void SetDefaults() - { - projectile.width = 6; - projectile.height = 6; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.tileCollide = false; - projectile.penetrate = 3; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 1; - projectile.timeLeft = 120; - projectile.magic = true; - } - - public override void AI() - { - if (projectile.timeLeft % 2f == 0f) - { - for (int num457 = 0; num457 < Main.rand.Next(3,6); num457++) - { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 91, 0f, 0f, 100, default, 0.5f); - Main.dust[num458].noGravity = true; - } - } - - homeTimer += 5f; - CalamityGlobalProjectile.HomeInOnNPC(projectile, false, homeTimer, 25f, 20f); - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 360); - } - } -} diff --git a/Projectiles/Magic/WhiteFlame2.png b/Projectiles/Magic/WhiteFlame2.png deleted file mode 100644 index a3192f9461..0000000000 Binary files a/Projectiles/Magic/WhiteFlame2.png and /dev/null differ