diff --git a/Items/Accessories/BloomStone.cs b/Items/Accessories/BloomStone.cs index c2881e60f7..606b47fb51 100644 --- a/Items/Accessories/BloomStone.cs +++ b/Items/Accessories/BloomStone.cs @@ -16,13 +16,12 @@ namespace CalamityMod.Items.Accessories Tooltip.SetDefault("One of the ancient relics\n" + "Enemies that get near you take damage and all damage is increased by 3%\n" + "You grow flowers on the grass beneath you, chance to grow very random dye plants on grassless dirt"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(4, 7)); } public override void SetDefaults() { - item.width = 20; - item.height = 20; + item.width = 38; + item.height = 54; item.value = CalamityGlobalItem.Rarity8BuyPrice; item.rare = 8; item.accessory = true; @@ -33,37 +32,34 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); Lighting.AddLight((int)player.Center.X / 16, (int)player.Center.Y / 16, 0.25f, 0.4f, 0.2f); player.allDamage += 0.03f; - int bloomCounter = 0; - int num = 186; - float num2 = 150f; - bool flag = bloomCounter % 60 == 0; - int num3 = (int)(10 * player.AverageDamage()); - int random = Main.rand.Next(10); + int buffType = BuffID.DryadsWardDebuff; + float range = 150f; + bool shouldDealDmg = player.miscCounter % 60 == 0; + int dmg = (int)(10 * player.AverageDamage()); if (player.whoAmI == Main.myPlayer) { - if (random == 0) + if (Main.rand.NextBool(10)) { for (int l = 0; l < Main.maxNPCs; l++) { - NPC nPC = Main.npc[l]; - if (nPC.active && !nPC.friendly && nPC.damage > 0 && !nPC.dontTakeDamage && !nPC.buffImmune[num] && Vector2.Distance(player.Center, nPC.Center) <= num2) + NPC npc = Main.npc[l]; + if (npc.active && !npc.friendly && npc.damage > 0 && !npc.dontTakeDamage && !npc.buffImmune[buffType] && Vector2.Distance(player.Center, npc.Center) <= range) { - if (nPC.FindBuffIndex(num) == -1) + if (npc.FindBuffIndex(buffType) == -1) { - nPC.AddBuff(num, 120, false); + npc.AddBuff(buffType, 120, false); } - if (flag) + if (shouldDealDmg) { if (player.whoAmI == Main.myPlayer) { - Projectile p = Projectile.NewProjectileDirect(nPC.Center, Vector2.Zero, ModContent.ProjectileType(), num3, 0f, player.whoAmI, l); + Projectile.NewProjectile(npc.Center, Vector2.Zero, ModContent.ProjectileType(), dmg, 0f, player.whoAmI, l); } } } } } } - bloomCounter++; //Flower Boots code if (player.whoAmI == Main.myPlayer && player.velocity.Y == 0f && player.grappling[0] == -1) diff --git a/Items/Accessories/BloomStone.png b/Items/Accessories/BloomStone.png index 78d99275d2..acf9fdf04c 100644 Binary files a/Items/Accessories/BloomStone.png and b/Items/Accessories/BloomStone.png differ diff --git a/Items/Accessories/FrostBarrier.png b/Items/Accessories/FrostBarrier.png index 34c900609d..223d27f6da 100644 Binary files a/Items/Accessories/FrostBarrier.png and b/Items/Accessories/FrostBarrier.png differ diff --git a/Items/Weapons/Magic/AbyssalTome.png b/Items/Weapons/Magic/AbyssalTome.png index 3c233be4bb..30d307ced1 100644 Binary files a/Items/Weapons/Magic/AbyssalTome.png and b/Items/Weapons/Magic/AbyssalTome.png differ diff --git a/Items/Weapons/Magic/EldritchTome.png b/Items/Weapons/Magic/EldritchTome.png index d7e49af5cc..b0afadb411 100644 Binary files a/Items/Weapons/Magic/EldritchTome.png and b/Items/Weapons/Magic/EldritchTome.png differ diff --git a/Items/Weapons/Melee/PwnagehammerMelee.png b/Items/Weapons/Melee/PwnagehammerMelee.png index 7a6cb7bc22..acf7460cf9 100644 Binary files a/Items/Weapons/Melee/PwnagehammerMelee.png and b/Items/Weapons/Melee/PwnagehammerMelee.png differ diff --git a/Items/Weapons/Ranged/OpalStriker.png b/Items/Weapons/Ranged/OpalStriker.png index 72da079908..daa6d3fdb6 100644 Binary files a/Items/Weapons/Ranged/OpalStriker.png and b/Items/Weapons/Ranged/OpalStriker.png differ diff --git a/Items/Weapons/Ranged/StormSurge.png b/Items/Weapons/Ranged/StormSurge.png index 86f9b5ac18..0d8231258c 100644 Binary files a/Items/Weapons/Ranged/StormSurge.png and b/Items/Weapons/Ranged/StormSurge.png differ diff --git a/Items/Weapons/Rogue/CursedDagger.png b/Items/Weapons/Rogue/CursedDagger.png index 9a81c1fccc..c63bd26a6f 100644 Binary files a/Items/Weapons/Rogue/CursedDagger.png and b/Items/Weapons/Rogue/CursedDagger.png differ diff --git a/Items/Weapons/Rogue/GleamingDagger.png b/Items/Weapons/Rogue/GleamingDagger.png index 95e0b396b9..74fa7601a8 100644 Binary files a/Items/Weapons/Rogue/GleamingDagger.png and b/Items/Weapons/Rogue/GleamingDagger.png differ diff --git a/Items/Weapons/Rogue/Pwnagehammer.png b/Items/Weapons/Rogue/Pwnagehammer.png index 7a6cb7bc22..acf7460cf9 100644 Binary files a/Items/Weapons/Rogue/Pwnagehammer.png and b/Items/Weapons/Rogue/Pwnagehammer.png differ diff --git a/Items/Weapons/Rogue/SpearofDestiny.png b/Items/Weapons/Rogue/SpearofDestiny.png index b991524840..3dae694b7d 100644 Binary files a/Items/Weapons/Rogue/SpearofDestiny.png and b/Items/Weapons/Rogue/SpearofDestiny.png differ diff --git a/Items/Weapons/Summon/SunGodStaff.png b/Items/Weapons/Summon/SunGodStaff.png index eb6e2a4027..8141c56304 100644 Binary files a/Items/Weapons/Summon/SunGodStaff.png and b/Items/Weapons/Summon/SunGodStaff.png differ diff --git a/Items/Weapons/Summon/SunSpiritStaff.png b/Items/Weapons/Summon/SunSpiritStaff.png index 65e3a45f4f..c4f8e03d15 100644 Binary files a/Items/Weapons/Summon/SunSpiritStaff.png and b/Items/Weapons/Summon/SunSpiritStaff.png differ diff --git a/Projectiles/Hybrid/PwnagehammerProj.png b/Projectiles/Hybrid/PwnagehammerProj.png index 7a6cb7bc22..acf7460cf9 100644 Binary files a/Projectiles/Hybrid/PwnagehammerProj.png and b/Projectiles/Hybrid/PwnagehammerProj.png differ diff --git a/Projectiles/Rogue/CursedDaggerProj.png b/Projectiles/Rogue/CursedDaggerProj.png index 9a81c1fccc..c63bd26a6f 100644 Binary files a/Projectiles/Rogue/CursedDaggerProj.png and b/Projectiles/Rogue/CursedDaggerProj.png differ diff --git a/Projectiles/Rogue/GleamingDaggerProj.png b/Projectiles/Rogue/GleamingDaggerProj.png index 95e0b396b9..74fa7601a8 100644 Binary files a/Projectiles/Rogue/GleamingDaggerProj.png and b/Projectiles/Rogue/GleamingDaggerProj.png differ diff --git a/Projectiles/Rogue/SpearofDestinyGlow.png b/Projectiles/Rogue/SpearofDestinyGlow.png index ce935139cd..b6523b8969 100644 Binary files a/Projectiles/Rogue/SpearofDestinyGlow.png and b/Projectiles/Rogue/SpearofDestinyGlow.png differ diff --git a/Projectiles/Rogue/SpearofDestinyProjectile.cs b/Projectiles/Rogue/SpearofDestinyProjectile.cs index 685c5a4dc3..e7d5fb7594 100644 --- a/Projectiles/Rogue/SpearofDestinyProjectile.cs +++ b/Projectiles/Rogue/SpearofDestinyProjectile.cs @@ -47,11 +47,7 @@ namespace CalamityMod.Projectiles.Rogue { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 246, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; - if (projectile.spriteDirection == -1) - { - projectile.rotation -= 1.57f; - } + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver4; Vector2 center = projectile.Center; float maxDistance = 300f; diff --git a/Projectiles/Rogue/SpearofDestinyProjectile.png b/Projectiles/Rogue/SpearofDestinyProjectile.png index 52f7eefcf4..3dae694b7d 100644 Binary files a/Projectiles/Rogue/SpearofDestinyProjectile.png and b/Projectiles/Rogue/SpearofDestinyProjectile.png differ diff --git a/Projectiles/Rogue/StealthNimbus2.png b/Projectiles/Rogue/StealthNimbus2.png index 6f7be4f25a..093136e7b9 100644 Binary files a/Projectiles/Rogue/StealthNimbus2.png and b/Projectiles/Rogue/StealthNimbus2.png differ diff --git a/Projectiles/Rogue/StealthNimbusCloud2.png b/Projectiles/Rogue/StealthNimbusCloud2.png index be7e4a9284..93891649ae 100644 Binary files a/Projectiles/Rogue/StealthNimbusCloud2.png and b/Projectiles/Rogue/StealthNimbusCloud2.png differ diff --git a/Projectiles/Summon/SolarGod.cs b/Projectiles/Summon/SolarGod.cs index 25edbb53b3..1fc5c0e38d 100644 --- a/Projectiles/Summon/SolarGod.cs +++ b/Projectiles/Summon/SolarGod.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetDefaults() { - projectile.width = 54; - projectile.height = 54; + projectile.width = 74; + projectile.height = 90; projectile.netImportant = true; projectile.friendly = true; projectile.ignoreWater = true; @@ -33,12 +33,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { - Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0f / 255f); - bool flag64 = projectile.type == ModContent.ProjectileType(); Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); - if (flag64) + bool correctMinion = projectile.type == ModContent.ProjectileType(); + if (correctMinion) { if (player.dead) { @@ -61,19 +60,20 @@ namespace CalamityMod.Projectiles.Summon } projectile.position.X = (int)projectile.position.X; projectile.position.Y = (int)projectile.position.Y; - float num395 = (float)Main.mouseTextColor / 200f - 0.35f; - num395 *= 0.2f; - projectile.scale = num395 + 0.95f; + float sizeScale = (float)Main.mouseTextColor / 200f - 0.35f; + sizeScale *= 0.2f; + projectile.scale = sizeScale + 0.95f; + Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0f / 255f); if (projectile.localAI[0] == 0f) { projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; - int num501 = 50; - for (int num502 = 0; num502 < num501; num502++) + int dustAmt = 50; + for (int d = 0; d < dustAmt; d++) { - int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 244, 0f, 0f, 0, default, 1f); - Main.dust[num503].velocity *= 2f; - Main.dust[num503].scale *= 1.15f; + int fire = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 244, 0f, 0f, 0, default, 1f); + Main.dust[fire].velocity *= 2f; + Main.dust[fire].scale *= 1.15f; } projectile.localAI[0] += 1f; } @@ -91,56 +91,47 @@ namespace CalamityMod.Projectiles.Summon projectile.ai[0] -= 1f; return; } - float num396 = projectile.position.X; - float num397 = projectile.position.Y; - float num398 = 700f; - bool flag11 = false; + Vector2 targetPos = projectile.position; + float maxDistance = 700f; + bool foundTarget = false; if (player.HasMinionAttackTargetNPC) { NPC npc = Main.npc[player.MinionAttackTargetNPC]; if (npc.CanBeChasedBy(projectile, false)) { - float num539 = npc.position.X + (float)(npc.width / 2); - float num540 = npc.position.Y + (float)(npc.height / 2); - float num541 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num539) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num540); - if (num541 < num398 && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + float npcDist = Vector2.Distance(projectile.Center, npc.Center); + if (npcDist < maxDistance && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { - num396 = num539; - num397 = num540; - flag11 = true; + targetPos = npc.Center; + foundTarget = true; } } } - if (!flag11) + if (!foundTarget) { - for (int num399 = 0; num399 < Main.maxNPCs; num399++) + for (int i = 0; i < Main.maxNPCs; i++) { - if (Main.npc[num399].CanBeChasedBy(projectile, false)) + NPC npc = Main.npc[i]; + if (npc.CanBeChasedBy(projectile, false)) { - float num400 = Main.npc[num399].position.X + (float)(Main.npc[num399].width / 2); - float num401 = Main.npc[num399].position.Y + (float)(Main.npc[num399].height / 2); - float num402 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num400) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num401); - if (num402 < num398 && Collision.CanHit(projectile.position, projectile.width, projectile.height, Main.npc[num399].position, Main.npc[num399].width, Main.npc[num399].height)) + float npcDist = Vector2.Distance(projectile.Center, npc.Center); + if (npcDist < maxDistance && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { - num398 = num402; - num396 = num400; - num397 = num401; - flag11 = true; + maxDistance = npcDist; + targetPos = npc.Center; + foundTarget = true; } } } } - if (flag11) + if (foundTarget) { - float num403 = 15f; - Vector2 vector29 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num404 = num396 - vector29.X; - float num405 = num397 - vector29.Y; - float num406 = (float)Math.Sqrt((double)(num404 * num404 + num405 * num405)); - num406 = num403 / num406; - num404 *= num406; - num405 *= num406; - Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, num404, num405, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + float shootSpeed = 15f; + Vector2 source = projectile.Center; + Vector2 velocity = targetPos - source; + velocity.Normalize(); + velocity *= shootSpeed; + Projectile.NewProjectile(source, velocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); projectile.ai[0] = 30f; } } diff --git a/Projectiles/Summon/SolarGod.png b/Projectiles/Summon/SolarGod.png index 6be1a06822..741a5ba3b5 100644 Binary files a/Projectiles/Summon/SolarGod.png and b/Projectiles/Summon/SolarGod.png differ diff --git a/Projectiles/Summon/SolarPixie.cs b/Projectiles/Summon/SolarPixie.cs index 4a2288c4e2..1f1b922daa 100644 --- a/Projectiles/Summon/SolarPixie.cs +++ b/Projectiles/Summon/SolarPixie.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetDefaults() { - projectile.width = 46; - projectile.height = 46; + projectile.width = 50; + projectile.height = 50; projectile.netImportant = true; projectile.friendly = true; projectile.ignoreWater = true; @@ -33,12 +33,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { - Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.25f / 255f, (255 - projectile.alpha) * 0.25f / 255f, (255 - projectile.alpha) * 0f / 255f); - bool flag64 = projectile.type == ModContent.ProjectileType(); Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); - if (flag64) + bool correctMinion = projectile.type == ModContent.ProjectileType(); + if (correctMinion) { if (player.dead) { @@ -61,19 +60,20 @@ namespace CalamityMod.Projectiles.Summon } projectile.position.X = (int)projectile.position.X; projectile.position.Y = (int)projectile.position.Y; - float num395 = (float)Main.mouseTextColor / 200f - 0.35f; - num395 *= 0.2f; - projectile.scale = num395 + 0.95f; + float sizeScale = (float)Main.mouseTextColor / 200f - 0.35f; + sizeScale *= 0.2f; + projectile.scale = sizeScale + 0.95f; + Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.25f / 255f, (255 - projectile.alpha) * 0.25f / 255f, (255 - projectile.alpha) * 0f / 255f); if (projectile.localAI[0] == 0f) { projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; - int num501 = 25; - for (int num502 = 0; num502 < num501; num502++) + int dustAmt = 25; + for (int d = 0; d < dustAmt; d++) { - int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 244, 0f, 0f, 0, default, 1f); - Main.dust[num503].velocity *= 2f; - Main.dust[num503].scale *= 1.15f; + int fire = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 244, 0f, 0f, 0, default, 1f); + Main.dust[fire].velocity *= 2f; + Main.dust[fire].scale *= 1.15f; } projectile.localAI[0] += 1f; } @@ -91,72 +91,55 @@ namespace CalamityMod.Projectiles.Summon projectile.ai[0] -= 1f; return; } - float num396 = projectile.position.X; - float num397 = projectile.position.Y; - float num398 = 700f; - bool flag11 = false; + Vector2 targetPos = projectile.position; + float maxDistance = 700f; + bool foundTarget = false; if (player.HasMinionAttackTargetNPC) { NPC npc = Main.npc[player.MinionAttackTargetNPC]; if (npc.CanBeChasedBy(projectile, false)) { - float num539 = npc.position.X + (float)(npc.width / 2); - float num540 = npc.position.Y + (float)(npc.height / 2); - float num541 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num539) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num540); - if (num541 < num398 && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + float npcDist = Vector2.Distance(projectile.Center, npc.Center); + if (npcDist < maxDistance && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { - num396 = num539; - num397 = num540; - flag11 = true; + targetPos = npc.Center; + foundTarget = true; } } } - if (!flag11) + if (!foundTarget) { - for (int num399 = 0; num399 < Main.maxNPCs; num399++) + for (int i = 0; i < Main.maxNPCs; i++) { - if (Main.npc[num399].CanBeChasedBy(projectile, false)) + NPC npc = Main.npc[i]; + if (npc.CanBeChasedBy(projectile, false)) { - float num400 = Main.npc[num399].position.X + (float)(Main.npc[num399].width / 2); - float num401 = Main.npc[num399].position.Y + (float)(Main.npc[num399].height / 2); - float num402 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num400) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num401); - if (num402 < num398 && Collision.CanHit(projectile.position, projectile.width, projectile.height, Main.npc[num399].position, Main.npc[num399].width, Main.npc[num399].height)) + float npcDist = Vector2.Distance(projectile.Center, npc.Center); + if (npcDist < maxDistance && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { - num398 = num402; - num396 = num400; - num397 = num401; - flag11 = true; + maxDistance = npcDist; + targetPos = npc.Center; + foundTarget = true; } } } } - if (flag11) + if (foundTarget) { - float num403 = 30f; - Vector2 vector29 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num404 = num396 - vector29.X; - float num405 = num397 - vector29.Y; - float num406 = (float)Math.Sqrt((double)(num404 * num404 + num405 * num405)); - num406 = num403 / num406; - num404 *= num406; - num405 *= num406; - int beam = Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, num404, num405, ProjectileID.HeatRay, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - Main.projectile[beam].magic = false; - Main.projectile[beam].minion = true; - ProjectileID.Sets.MinionShot[Main.projectile[beam].type] = true; + float shootSpeed = 30f; + Vector2 source = projectile.Center; + Vector2 velocity = targetPos - source; + velocity.Normalize(); + velocity *= shootSpeed; + int beam = Projectile.NewProjectile(source, velocity, ProjectileID.HeatRay, projectile.damage, projectile.knockBack, projectile.owner); + Main.projectile[beam].Calamity().forceMinion = true; projectile.ai[0] = 50f; } } } - public override Color? GetAlpha(Color lightColor) - { - return new Color(200, 200, 200, 200); - } + public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 200); - public override bool CanDamage() - { - return false; - } + public override bool CanDamage() => false; } } diff --git a/Projectiles/Summon/SolarPixie.png b/Projectiles/Summon/SolarPixie.png index fcb995c6ca..2b3c4522b1 100644 Binary files a/Projectiles/Summon/SolarPixie.png and b/Projectiles/Summon/SolarPixie.png differ