diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 06e7287c0e..e20682e2ae 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1154,6 +1154,7 @@ namespace CalamityMod.CalPlayer stressPills = false; laudanum = false; fleshTotem = false; + fleshTotemCooldown = false; bloodPact = false; bloodflareCore = false; coreOfTheBloodGod = false; @@ -1273,6 +1274,7 @@ namespace CalamityMod.CalPlayer bloodyGlove = false; filthyGlove = false; sandCloak = false; + sandCloakCooldown = false; spectralVeil = false; plaguedFuelPack = false; camper = false; @@ -1345,6 +1347,7 @@ namespace CalamityMod.CalPlayer holyWrath = false; profanedRage = false; draconicSurge = false; + draconicSurgeCooldown = false; tesla = false; baguette = false; trippy = false; @@ -1490,7 +1493,6 @@ namespace CalamityMod.CalPlayer raiderCooldown = 0; gSabatonFall = 0; gSabatonCooldown = 0; - fleshTotemCooldown = false; astralStarRainCooldown = 0; bloodflareMageCooldown = 0; tarraMageHealCooldown = 0; @@ -1499,7 +1501,6 @@ namespace CalamityMod.CalPlayer theBeeDamage = 0; reforges = 0; polarisBoostCounter = 0; - sandCloakCooldown = false; spectralVeilImmunity = 0; plaguedFuelPackCooldown = 0; plaguedFuelPackDash = 0; @@ -1508,6 +1509,8 @@ namespace CalamityMod.CalPlayer moonCrownCooldown = 0; featherCrownCooldown = 0; nanoFlareCooldown = 0; + fleshTotemCooldown = false; + sandCloakCooldown = false; alcoholPoisoning = false; shadowflame = false; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index cdc407611f..7b004d273d 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -576,8 +576,6 @@ namespace CalamityMod.CalPlayer modPlayer.gaelRageCooldown--; if (modPlayer.projRefRareLifeRegenCounter > 0) modPlayer.projRefRareLifeRegenCounter--; - if (modPlayer.sandCloakCooldown && !player.HasBuff(ModContent.BuffType())) - modPlayer.sandCloakCooldown = false; // Silva invincibility effects if (modPlayer.silvaCountdown > 0 && modPlayer.hasSilvaEffect && modPlayer.silvaSet) diff --git a/Items/Weapons/Magic/HadopelagicEcho.cs b/Items/Weapons/Magic/HadopelagicEcho.cs new file mode 100644 index 0000000000..0a2e5e0632 --- /dev/null +++ b/Items/Weapons/Magic/HadopelagicEcho.cs @@ -0,0 +1,78 @@ +using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Items.Weapons.Magic +{ + public class HadopelagicEcho : ModItem + { + private int counter = 0; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hadopelagic Echo"); + Tooltip.SetDefault("Fires a string of bouncing sound waves\n" + + "Sound waves fired later in the chain deal more damage\n" + + "Sound waves echo additional sound waves on enemy hits"); + } + + public override void SetDefaults() + { + item.damage = 609; + item.magic = true; + item.mana = 15; + item.width = 60; + item.height = 60; + item.useTime = 8; + item.reuseDelay = 20; + item.useAnimation = 40; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 1.5f; + item.value = Item.buyPrice(2, 50, 0, 0); + item.rare = 10; + item.autoReuse = true; + item.shootSpeed = 20f; + item.shoot = ModContent.ProjectileType(); + item.Calamity().postMoonLordRarity = 15; + } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-5, 0); + } + + 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 damageMult = 1f; + if (counter == 1) + damageMult = 1.1f; + if (counter == 2) + damageMult = 1.2f; + if (counter == 3) + damageMult = 1.35f; + if (counter == 4) + damageMult = 1.5f; + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * damageMult), knockBack, player.whoAmI, (float)counter, 0f); + counter++; + if (counter >= 5) + counter = 0; + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 20); + recipe.AddIngredient(ModContent.ItemType(), 20); + recipe.AddIngredient(ModContent.ItemType(), 20); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Magic/HadopelagicEcho.png b/Items/Weapons/Magic/HadopelagicEcho.png new file mode 100644 index 0000000000..4784fa52fb Binary files /dev/null and b/Items/Weapons/Magic/HadopelagicEcho.png differ diff --git a/NPCs/TownNPCs/THIEF.cs b/NPCs/TownNPCs/THIEF.cs index 6a7276e927..0b96b20109 100644 --- a/NPCs/TownNPCs/THIEF.cs +++ b/NPCs/TownNPCs/THIEF.cs @@ -91,7 +91,7 @@ namespace CalamityMod.NPCs.TownNPCs } if (BirthdayParty.PartyIsUp) { - PossibleDialogs.Add("Where is my party hat? Well i stole it of course."); + PossibleDialogs.Add("Where is my party hat? Well, I stole it of course."); } if (npc.GivenName == "Laura") { diff --git a/Projectiles/Magic/HadopelagicEcho2.cs b/Projectiles/Magic/HadopelagicEcho2.cs new file mode 100644 index 0000000000..80f50a1998 --- /dev/null +++ b/Projectiles/Magic/HadopelagicEcho2.cs @@ -0,0 +1,110 @@ +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Magic +{ + public class HadopelagicEcho2 : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Echo"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 8; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 36; + projectile.height = 36; + projectile.scale = 0.85f; + projectile.alpha = 255; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.penetrate = -1; + projectile.magic = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = -1; + projectile.timeLeft = 30; + projectile.extraUpdates = 1; + projectile.tileCollide = false; + } + + public override void AI() + { + projectile.width = (int)(36f * projectile.scale); + projectile.height = (int)(36f * projectile.scale); + if (projectile.alpha > 100) + { + projectile.alpha -= 25; + } + if (projectile.alpha < 100) + projectile.alpha = 100; + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); + + if (projectile.ai[0] == 1f) + { + float num472 = projectile.Center.X; + float num473 = projectile.Center.Y; + float num474 = 500f; + bool flag17 = false; + + for (int num475 = 0; num475 < Main.projectile.Length; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false)) + { + float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); + float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); + float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + if (num478 < num474) + { + num474 = num478; + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + + if (flag17) + { + float num483 = 8f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = num472 - vector35.X; + float num485 = num473 - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; + projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; + } + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 600); + } + + public override Color? GetAlpha(Color lightColor) + { + if (projectile.timeLeft < 85) + { + byte b2 = (byte)(projectile.timeLeft * 3); + byte a2 = (byte)(100f * ((float)b2 / 255f)); + return new Color((int)b2, (int)b2, (int)b2, (int)a2); + } + return new Color(255, 255, 255, 100); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + } +} diff --git a/Projectiles/Magic/HadopelagicEcho2.png b/Projectiles/Magic/HadopelagicEcho2.png new file mode 100644 index 0000000000..e3d171c010 Binary files /dev/null and b/Projectiles/Magic/HadopelagicEcho2.png differ diff --git a/Projectiles/Magic/HadopelagicEchoSoundwave.cs b/Projectiles/Magic/HadopelagicEchoSoundwave.cs new file mode 100644 index 0000000000..74fae98c21 --- /dev/null +++ b/Projectiles/Magic/HadopelagicEchoSoundwave.cs @@ -0,0 +1,127 @@ +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Magic +{ + public class HadopelagicEchoSoundwave : ModProjectile + { + private int echoCooldown = 0; + private bool playedSound = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Echo"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 36; + projectile.height = 36; + projectile.scale = 0.005f; + projectile.alpha = 100; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.penetrate = -1; + projectile.magic = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 0; + projectile.timeLeft = 450; + } + + public override void AI() + { + if (projectile.ai[0] == 0f || projectile.ai[0] == 4f) + { + if (!playedSound) + { + Main.PlaySound(Main.rand.NextBool(100) ? mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/Sunskater") : mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/WyrmScream"), (int)projectile.Center.X, (int)projectile.Center.Y); + playedSound = true; + } + } + if (projectile.localAI[0] < 1f) + { + projectile.localAI[0] += 0.05f; + projectile.scale += 0.05f; + projectile.width = (int)(36f * projectile.scale); + projectile.height = (int)(36f * projectile.scale); + } + else + { + projectile.width = 36; + projectile.height = 36; + } + + if (echoCooldown > 0) + echoCooldown--; + + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y; + } + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 600); + target.AddBuff(BuffID.Ichor, 600); + target.AddBuff(BuffID.Electrified, 600); + projectile.velocity *= 0.85f; + + if (echoCooldown == 0 && projectile.ai[0] == 4f) + { + echoCooldown = 60; + int echoID = ModContent.ProjectileType(); + int echoDamage = (int)(0.2f * projectile.damage); + float echoKB = projectile.knockBack / 3; + int echos = 5; + for (int i = 0; i < echos; ++i) + { + float startDist = Main.rand.NextFloat(260f, 270f); + Vector2 startDir = Main.rand.NextVector2Unit(); + Vector2 startPoint = target.Center + (startDir * startDist); + + float echoSpeed = Main.rand.NextFloat(15f, 18f); + Vector2 velocity = startDir * (-echoSpeed); + + if (projectile.owner == Main.myPlayer) + { + Projectile.NewProjectile(startPoint, velocity, echoID, echoDamage, echoKB, projectile.owner, 0f, 0f); + } + } + } + } + + public override Color? GetAlpha(Color lightColor) + { + if (projectile.timeLeft < 85) + { + byte b2 = (byte)(projectile.timeLeft * 3); + byte a2 = (byte)(100f * ((float)b2 / 255f)); + return new Color((int)b2, (int)b2, (int)b2, (int)a2); + } + return new Color(255, 255, 255, 100); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + } +} diff --git a/Projectiles/Magic/HadopelagicEchoSoundwave.png b/Projectiles/Magic/HadopelagicEchoSoundwave.png new file mode 100644 index 0000000000..e3d171c010 Binary files /dev/null and b/Projectiles/Magic/HadopelagicEchoSoundwave.png differ diff --git a/Projectiles/Rogue/ExecutionersBladeProj.cs b/Projectiles/Rogue/ExecutionersBladeProj.cs index 5da670ec40..ebb9cc2dad 100644 --- a/Projectiles/Rogue/ExecutionersBladeProj.cs +++ b/Projectiles/Rogue/ExecutionersBladeProj.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Rogue Main.PlaySound(SoundID.Item73, projectile.position); for (int i = 0; i < 20; i++) { - Projectile.NewProjectile(new Vector2(position.X + (-600 + i * 60), position.Y - 800), new Vector2(0f, 5f), ModContent.ProjectileType(), (int)((double)damage * 1.4f), knockback, player.whoAmI); + Projectile.NewProjectile(new Vector2(position.X + (-600 + i * 60), position.Y - 800), new Vector2(0f, 5f), ModContent.ProjectileType(), (int)((double)projectile.damage * 1.2f), projectile.knockBack, player.whoAmI); } } }