From b66cbb8059582d1113c430ed152a3cad9a0189d4 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Fri, 15 Dec 2023 09:30:18 +0700 Subject: [PATCH 01/18] spelunker effects on wall paintings --- Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson | 2 +- Tiles/Furniture/DevPaintings/ThankYouPaintingTile.cs | 1 + Utilities/FurnitureSetupUtils.cs | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index 99fe11434d..822eecb526 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -237,7 +237,7 @@ DivineRetribution: { Downpour: { DisplayName: Downpour - Tooltip: + Tooltip: ''' Fires an explosive stream of sand that falls after hitting an enemy The explosion only occurs when the projectile expires diff --git a/Tiles/Furniture/DevPaintings/ThankYouPaintingTile.cs b/Tiles/Furniture/DevPaintings/ThankYouPaintingTile.cs index 91e9ae72b5..281b074902 100644 --- a/Tiles/Furniture/DevPaintings/ThankYouPaintingTile.cs +++ b/Tiles/Furniture/DevPaintings/ThankYouPaintingTile.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Tiles.Furniture.DevPaintings { Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; + Main.tileSpelunker[Type] = true; Main.tileWaterDeath[Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3Wall); TileObjectData.newTile.Width = 6; diff --git a/Utilities/FurnitureSetupUtils.cs b/Utilities/FurnitureSetupUtils.cs index 093fbf5073..029275f00b 100644 --- a/Utilities/FurnitureSetupUtils.cs +++ b/Utilities/FurnitureSetupUtils.cs @@ -1531,6 +1531,7 @@ namespace CalamityMod Main.tileFrameImportant[mt.Type] = true; Main.tileLavaDeath[mt.Type] = true; + Main.tileSpelunker[mt.Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3Wall); TileObjectData.addTile(mt.Type); TileID.Sets.DisableSmartCursor[mt.Type] = true; @@ -1578,6 +1579,7 @@ namespace CalamityMod { Main.tileFrameImportant[mt.Type] = true; Main.tileLavaDeath[mt.Type] = !lavaImmune; + Main.tileSpelunker[mt.Type] = true; Main.tileWaterDeath[mt.Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3Wall); TileObjectData.newTile.Width = 6; From cc8a2936968de0e2da8b43249d0ddfdeed16240b Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Fri, 15 Dec 2023 09:42:03 +0700 Subject: [PATCH 02/18] hive pack now boosts pb armor bees damage --- Projectiles/Summon/PlaguebringerSummon.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Summon/PlaguebringerSummon.cs b/Projectiles/Summon/PlaguebringerSummon.cs index 0638710da8..93e76fd58c 100644 --- a/Projectiles/Summon/PlaguebringerSummon.cs +++ b/Projectiles/Summon/PlaguebringerSummon.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Summon for (int i = 0; i < beeCount; i++) { int beeType = Main.rand.NextBool(4) ? ModContent.ProjectileType() : Owner.beeType(); // 25% chance for plague bee, otherwise depends if Hive Pack or not - Projectile bee = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Main.rand.NextVector2Circular(0.25f, 0.25f), beeType, Projectile.damage, Owner.beeKB(0f), Projectile.owner); + Projectile bee = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Main.rand.NextVector2Circular(0.25f, 0.25f), beeType, Owner.beeDamage(Projectile.damage), Owner.beeKB(0f), Projectile.owner); bee.usesLocalNPCImmunity = true; bee.localNPCHitCooldown = 10; bee.penetrate = 2; From a43811946e60e562a37b6ced811ef474b8407c58 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Fri, 15 Dec 2023 10:28:04 +0700 Subject: [PATCH 03/18] devil's sunrise is actually affected by melee damage minor rebalancing included (needs retest) there's some other archaic code here im not willing to look at --- Items/Weapons/Melee/DevilsSunrise.cs | 6 +-- Projectiles/Melee/DevilsSunriseCyclone.cs | 31 +++++++------- Projectiles/Melee/DevilsSunriseProj.cs | 49 ++++++++++------------- 3 files changed, 39 insertions(+), 47 deletions(-) diff --git a/Items/Weapons/Melee/DevilsSunrise.cs b/Items/Weapons/Melee/DevilsSunrise.cs index 1282205f1e..da08fa16d1 100644 --- a/Items/Weapons/Melee/DevilsSunrise.cs +++ b/Items/Weapons/Melee/DevilsSunrise.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Melee public class DevilsSunrise : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; - public static int BaseDamage = 480; + public static int BaseDamage = 420; public override void SetDefaults() { @@ -42,8 +42,8 @@ namespace CalamityMod.Items.Weapons.Melee public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0f); - Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); return false; } diff --git a/Projectiles/Melee/DevilsSunriseCyclone.cs b/Projectiles/Melee/DevilsSunriseCyclone.cs index 8a418a3c09..cf11e3c878 100644 --- a/Projectiles/Melee/DevilsSunriseCyclone.cs +++ b/Projectiles/Melee/DevilsSunriseCyclone.cs @@ -34,22 +34,19 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { - if (Projectile.ai[1] < 510f && Projectile.ai[1] != -1f) - Projectile.ai[1] += 1f; + Player Owner = Main.player[Projectile.owner]; + if (Projectile.ai[1] < 480f && Projectile.ai[1] != -1f) + Projectile.ai[1]++; if (Main.myPlayer == Projectile.owner) { - if (!Main.player[Projectile.owner].channel) - { + if (!Owner.channel) Projectile.ai[1] = -1f; - Projectile.damage = Projectile.originalDamage; - } } - if (Projectile.ai[1] >= 255f) - Projectile.damage = 2 * Projectile.originalDamage; + Projectile.damage = (int)(Owner.GetTotalDamage(Projectile.DamageType).ApplyTo(Projectile.originalDamage) * (1f + Utils.GetLerpValue(0f, 300f, Projectile.ai[1], true))); - red = 64 + (int)(Projectile.ai[1] * 0.75f); + red = 30 + (int)(Projectile.ai[1] * 0.75f); if (red > 255) red = 255; @@ -58,8 +55,8 @@ namespace CalamityMod.Projectiles.Melee Main.dust[dust].noGravity = true; Vector2 projDirection = new Vector2(Projectile.position.X + (float)Projectile.width * 0.5f, Projectile.position.Y + (float)Projectile.height * 0.5f); - float x = Main.player[Projectile.owner].position.X + (float)(Main.player[Projectile.owner].width / 2) - projDirection.X; - float y = Main.player[Projectile.owner].position.Y + (float)(Main.player[Projectile.owner].height / 2) - projDirection.Y; + float x = Owner.position.X + (float)(Owner.width / 2) - projDirection.X; + float y = Owner.position.Y + (float)(Owner.height / 2) - projDirection.Y; float distanceFromOwner = (float)Math.Sqrt((double)(x * x + y * y)); float speed = 25f; @@ -68,7 +65,7 @@ namespace CalamityMod.Projectiles.Melee if (speed < 2f) speed = 2f; - if (speed <= 2f || Projectile.ai[1] >= 510f || Projectile.ai[1] == -1f) + if (speed <= 2f || Projectile.ai[1] >= 480f || Projectile.ai[1] == -1f) { float returnSpeedMax = 30f; float returnSpeed = 6f; @@ -104,20 +101,20 @@ namespace CalamityMod.Projectiles.Melee if (Main.myPlayer == Projectile.owner) { Rectangle rectangle = new Rectangle((int)Projectile.position.X, (int)Projectile.position.Y, Projectile.width, Projectile.height); - Rectangle playerPos = new Rectangle((int)Main.player[Projectile.owner].position.X, (int)Main.player[Projectile.owner].position.Y, Main.player[Projectile.owner].width, Main.player[Projectile.owner].height); + Rectangle playerPos = new Rectangle((int)Owner.position.X, (int)Owner.position.Y, Owner.width, Owner.height); if (rectangle.Intersects(playerPos)) Projectile.Kill(); } } else if (Main.myPlayer == Projectile.owner && Projectile.ai[0] <= 0f) { - if (Main.player[Projectile.owner].channel) + if (Owner.channel) { Vector2 projTravel = new Vector2(Projectile.position.X + (float)Projectile.width * 0.5f, Projectile.position.Y + (float)Projectile.height * 0.5f); float mouseDestX = (float)Main.mouseX + Main.screenPosition.X - projTravel.X; float mouseDestY = (float)Main.mouseY + Main.screenPosition.Y - projTravel.Y; - if (Main.player[Projectile.owner].gravDir == -1f) + if (Owner.gravDir == -1f) mouseDestY = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - projTravel.Y; if (Projectile.ai[0] < 0f) @@ -162,13 +159,13 @@ namespace CalamityMod.Projectiles.Melee float miceX = (float)Main.mouseX + Main.screenPosition.X - projDirect.X; float miceY = (float)Main.mouseY + Main.screenPosition.Y - projDirect.Y; - if (Main.player[Projectile.owner].gravDir == -1f) + if (Owner.gravDir == -1f) miceY = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - projDirect.Y; float miceDistancing = (float)Math.Sqrt((double)(miceX * miceX + miceY * miceY)); if (miceDistancing == 0f || Projectile.ai[0] < 0f) { - projDirect = new Vector2(Main.player[Projectile.owner].position.X + (float)(Main.player[Projectile.owner].width / 2), Main.player[Projectile.owner].position.Y + (float)(Main.player[Projectile.owner].height / 2)); + projDirect = new Vector2(Owner.position.X + (float)(Owner.width / 2), Owner.position.Y + (float)(Owner.height / 2)); miceX = Projectile.position.X + (float)Projectile.width * 0.5f - projDirect.X; miceY = Projectile.position.Y + (float)Projectile.height * 0.5f - projDirect.Y; miceDistancing = (float)Math.Sqrt((double)(miceX * miceX + miceY * miceY)); diff --git a/Projectiles/Melee/DevilsSunriseProj.cs b/Projectiles/Melee/DevilsSunriseProj.cs index 4f05159cff..c8153a182d 100644 --- a/Projectiles/Melee/DevilsSunriseProj.cs +++ b/Projectiles/Melee/DevilsSunriseProj.cs @@ -36,23 +36,16 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { - if (Projectile.ai[1] < 255f) - Projectile.ai[1] += 1f; + Player Owner = Main.player[Projectile.owner]; + if (Projectile.ai[1] < 300f) + Projectile.ai[1]++; + + Projectile.damage = (int)(Owner.GetTotalDamage(Projectile.DamageType).ApplyTo(Projectile.originalDamage) * (1f + Utils.GetLerpValue(0f, 300f, Projectile.ai[1], true))); - if (Projectile.ai[1] == 255f) - Projectile.damage = 2 * Projectile.originalDamage; - - red = 64 + (int)(Projectile.ai[1] * 0.75f); + red = 30 + (int)(Projectile.ai[1] * 0.75f); if (red > 255) red = 255; - Player player = Main.player[Projectile.owner]; - float pi = 0f; - Vector2 playerRotate = player.RotatedRelativePoint(player.MountedCenter, true); - - if (Projectile.spriteDirection == -1) - pi = 3.14159274f; - if (++Projectile.frame >= Main.projFrames[Projectile.type]) Projectile.frame = 0; @@ -65,17 +58,17 @@ namespace CalamityMod.Projectiles.Melee if (Main.myPlayer == Projectile.owner) { - if (player.channel && !player.noItems && !player.CCed) + if (Owner.channel && !Owner.noItems && !Owner.CCed) { float scaleFactor6 = 1f; - if (player.ActiveItem().shoot == Projectile.type) - scaleFactor6 = player.ActiveItem().shootSpeed * Projectile.scale; + if (Owner.ActiveItem().shoot == Projectile.type) + scaleFactor6 = Owner.ActiveItem().shootSpeed * Projectile.scale; - Vector2 slashDirection = Main.MouseWorld - playerRotate; + Vector2 slashDirection = Main.MouseWorld - Owner.RotatedRelativePoint(Owner.MountedCenter, true); slashDirection.Normalize(); if (slashDirection.HasNaNs()) - slashDirection = Vector2.UnitX * (float)player.direction; + slashDirection = Vector2.UnitX * (float)Owner.direction; slashDirection *= scaleFactor6; if (slashDirection.X != Projectile.velocity.X || slashDirection.Y != Projectile.velocity.Y) @@ -88,24 +81,26 @@ namespace CalamityMod.Projectiles.Melee } Vector2 dustSpawn = Projectile.Center + Projectile.velocity * 3f; - Lighting.AddLight(dustSpawn, (float)((double)red * 0.001), 0.1f, 0.1f); + Lighting.AddLight(dustSpawn, red * 0.001f, 0.1f, 0.1f); if (Main.rand.NextBool(3)) { - int dust = Dust.NewDust(dustSpawn - Projectile.Size / 2f, Projectile.width, Projectile.height, 66, Projectile.velocity.X, Projectile.velocity.Y, 100, new Color(red, greenAndBlue, greenAndBlue), 1f); + int dust = Dust.NewDust(dustSpawn - Projectile.Size * 0.5f, Projectile.width, Projectile.height, 66, Projectile.velocity.X, Projectile.velocity.Y, 100, new Color(red, greenAndBlue, greenAndBlue), 1f); Main.dust[dust].noGravity = true; Main.dust[dust].position -= Projectile.velocity; } - Projectile.position = player.RotatedRelativePoint(player.MountedCenter, true) - Projectile.Size / 2f; - Projectile.rotation = Projectile.velocity.ToRotation() + pi; + Projectile.position = Owner.RotatedRelativePoint(Owner.MountedCenter, true) - Projectile.Size * 0.5f; + Projectile.rotation = Projectile.velocity.ToRotation(); + if (Projectile.spriteDirection == -1) + Projectile.rotation += MathHelper.Pi; Projectile.spriteDirection = Projectile.direction; Projectile.timeLeft = 2; - player.ChangeDir(Projectile.direction); - player.heldProj = Projectile.whoAmI; - player.itemTime = 2; - player.itemAnimation = 2; - player.itemRotation = (float)Math.Atan2((double)(Projectile.velocity.Y * (float)Projectile.direction), (double)(Projectile.velocity.X * (float)Projectile.direction)); + Owner.ChangeDir(Projectile.direction); + Owner.heldProj = Projectile.whoAmI; + Owner.itemTime = 2; + Owner.itemAnimation = 2; + Owner.itemRotation = (Projectile.velocity * Projectile.direction).ToRotation(); } public override Color? GetAlpha(Color lightColor) From dd61c6ee06d8e94f4ac7afa48a53f465e1cf6700 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 15 Dec 2023 21:19:53 -0500 Subject: [PATCH 04/18] Stygian Shield changes --- Items/Weapons/Melee/StygianShield.cs | 4 ++-- Projectiles/Melee/StygianShieldAttack.cs | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Items/Weapons/Melee/StygianShield.cs b/Items/Weapons/Melee/StygianShield.cs index c9a676e7ca..b24ec9360e 100644 --- a/Items/Weapons/Melee/StygianShield.cs +++ b/Items/Weapons/Melee/StygianShield.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; - Item.damage = 250; + Item.damage = 222; Item.DamageType = DamageClass.MeleeNoSpeed; Item.useAnimation = Item.useTime = 40; // This is only for the "Very slow" tooltip. The real use time should be faster Item.shoot = ModContent.ProjectileType(); @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Melee } // Can only throw a shield if none is active - public override bool AltFunctionUse(Player player) => player.ownedProjectileCounts[ThrownShieldID] <= 0; + public override bool AltFunctionUse(Player player) => player.ownedProjectileCounts[ThrownShieldID] <= 1; public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Projectiles/Melee/StygianShieldAttack.cs b/Projectiles/Melee/StygianShieldAttack.cs index 48381f102e..f9a62b24bb 100644 --- a/Projectiles/Melee/StygianShieldAttack.cs +++ b/Projectiles/Melee/StygianShieldAttack.cs @@ -19,12 +19,12 @@ namespace CalamityMod.Projectiles.Melee // Bull Rush stats public const float MinChargeTime = 15f; - public const float MaxChargeTime = 60f; + public const float MaxChargeTime = 50f; public const float MaxChargeDistance = 800f; // 50 blocks - public const float MaxChargeDamageMult = 4f; + public const float MaxChargeDamageMult = 4.5f; public const float PiercingDamageMult = 0.6f; public const float DashDuration = 21f; - public const float IFrameRatio = 0.35f; // Amount given = Ratio * Charge, rounded down + public const int IFrameAmount = 12; public Player Owner => Main.player[Projectile.owner]; public ref float Charge => ref Projectile.ai[0]; @@ -122,13 +122,6 @@ namespace CalamityMod.Projectiles.Melee { SoundEngine.PlaySound(DashSound, Owner.Center); - // Give immunity frames - Owner.immune = true; - Owner.immuneNoBlink = true; - Owner.immuneTime = (int)(IFrameRatio * Charge); - for (int k = 0; k < Owner.hurtCooldowns.Length; k++) - Owner.hurtCooldowns[k] = Owner.immuneTime; - // Reset the trail for (int i = 0; i < Projectile.oldPos.Length; i++) { @@ -179,6 +172,13 @@ namespace CalamityMod.Projectiles.Melee float rotation = Projectile.velocity.ToRotation() - MathHelper.Pi; Particle redSlash = new SlashThrough(Color.Red * 0.9f, Owner.Center, rotation, 15, target); GeneralParticleHandler.SpawnParticle(redSlash); + + // Give immunity frames + Owner.immune = true; + Owner.immuneNoBlink = true; + Owner.immuneTime = IFrameAmount; + for (int k = 0; k < Owner.hurtCooldowns.Length; k++) + Owner.hurtCooldowns[k] = Owner.immuneTime; } internal Color ColorFunction(float completionRatio) From 7b3bb077d5cc6ecba9a969ca2ac81f5d33db0d46 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 16 Dec 2023 11:05:08 +0700 Subject: [PATCH 05/18] Stygian Shield changes changes --- Items/Weapons/Melee/StygianShield.cs | 6 ++++-- Projectiles/Melee/StygianShieldAttack.cs | 21 ++++++++++----------- Projectiles/Melee/StygianShieldThrown.cs | 2 +- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Items/Weapons/Melee/StygianShield.cs b/Items/Weapons/Melee/StygianShield.cs index b24ec9360e..e1d1cb661c 100644 --- a/Items/Weapons/Melee/StygianShield.cs +++ b/Items/Weapons/Melee/StygianShield.cs @@ -22,6 +22,8 @@ namespace CalamityMod.Items.Weapons.Melee public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(HeldDefense, (DisableDashDuration / 60D).ToString("N1")); + public override void SetStaticDefaults() => ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + public override void SetDefaults() { Item.width = 74; @@ -30,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; - Item.damage = 222; + Item.damage = 180; Item.DamageType = DamageClass.MeleeNoSpeed; Item.useAnimation = Item.useTime = 40; // This is only for the "Very slow" tooltip. The real use time should be faster Item.shoot = ModContent.ProjectileType(); @@ -42,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.UseSound = null; } - // Can only throw a shield if none is active + // Can only throw a shield if there's two or less public override bool AltFunctionUse(Player player) => player.ownedProjectileCounts[ThrownShieldID] <= 1; public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Projectiles/Melee/StygianShieldAttack.cs b/Projectiles/Melee/StygianShieldAttack.cs index f9a62b24bb..3e80cc65e5 100644 --- a/Projectiles/Melee/StygianShieldAttack.cs +++ b/Projectiles/Melee/StygianShieldAttack.cs @@ -19,12 +19,11 @@ namespace CalamityMod.Projectiles.Melee // Bull Rush stats public const float MinChargeTime = 15f; - public const float MaxChargeTime = 50f; - public const float MaxChargeDistance = 800f; // 50 blocks - public const float MaxChargeDamageMult = 4.5f; + public const float MaxChargeTime = 45f; + public const float MaxChargeDistance = 720f; // 45 blocks + public const float MaxChargeDamageMult = 6f; public const float PiercingDamageMult = 0.6f; public const float DashDuration = 21f; - public const int IFrameAmount = 12; public Player Owner => Main.player[Projectile.owner]; public ref float Charge => ref Projectile.ai[0]; @@ -122,6 +121,13 @@ namespace CalamityMod.Projectiles.Melee { SoundEngine.PlaySound(DashSound, Owner.Center); + // Give immunity frames + Owner.immune = true; + Owner.immuneNoBlink = true; + Owner.immuneTime = (int)DashDuration; + for (int k = 0; k < Owner.hurtCooldowns.Length; k++) + Owner.hurtCooldowns[k] = Owner.immuneTime; + // Reset the trail for (int i = 0; i < Projectile.oldPos.Length; i++) { @@ -172,13 +178,6 @@ namespace CalamityMod.Projectiles.Melee float rotation = Projectile.velocity.ToRotation() - MathHelper.Pi; Particle redSlash = new SlashThrough(Color.Red * 0.9f, Owner.Center, rotation, 15, target); GeneralParticleHandler.SpawnParticle(redSlash); - - // Give immunity frames - Owner.immune = true; - Owner.immuneNoBlink = true; - Owner.immuneTime = IFrameAmount; - for (int k = 0; k < Owner.hurtCooldowns.Length; k++) - Owner.hurtCooldowns[k] = Owner.immuneTime; } internal Color ColorFunction(float completionRatio) diff --git a/Projectiles/Melee/StygianShieldThrown.cs b/Projectiles/Melee/StygianShieldThrown.cs index bea6327383..fc81cbd30e 100644 --- a/Projectiles/Melee/StygianShieldThrown.cs +++ b/Projectiles/Melee/StygianShieldThrown.cs @@ -146,7 +146,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.tileCollide = false; // Swiftly move back towards the player - Projectile.velocity = Projectile.SafeDirectionTo(Owner.Center) * 15f; + Projectile.velocity = Projectile.SafeDirectionTo(Owner.Center) * 20f; // Delete the projectile if it touches its owner or too far away. if (Projectile.Hitbox.Intersects(Owner.Hitbox) || Vector2.Distance(Projectile.Center, Owner.Center) >= 3000f) From 88f87e18d8f05a509f619b7b0fd8e1e29589b21a Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sat, 16 Dec 2023 00:22:52 -0500 Subject: [PATCH 06/18] Conference Call and Disseminator can hit stuff now Also has long overdue Bubonic Round nerfs --- Items/Ammo/BubonicRound.cs | 2 +- Items/Weapons/Ranged/ConferenceCall.cs | 14 +++++++------- Items/Weapons/Ranged/Disseminator.cs | 12 ++++++------ Projectiles/Ranged/BubonicRoundProj.cs | 10 +++++----- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Items/Ammo/BubonicRound.cs b/Items/Ammo/BubonicRound.cs index de2def4611..dcf2d581b6 100644 --- a/Items/Ammo/BubonicRound.cs +++ b/Items/Ammo/BubonicRound.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Ammo public override void SetDefaults() { - Item.damage = 20; + Item.damage = 18; Item.DamageType = DamageClass.Ranged; Item.width = 8; Item.height = 8; diff --git a/Items/Weapons/Ranged/ConferenceCall.cs b/Items/Weapons/Ranged/ConferenceCall.cs index 87052ebb5e..30f1352b5f 100644 --- a/Items/Weapons/Ranged/ConferenceCall.cs +++ b/Items/Weapons/Ranged/ConferenceCall.cs @@ -12,12 +12,12 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 36; + Item.damage = 53; Item.DamageType = DamageClass.Ranged; Item.width = 66; Item.height = 26; - Item.useTime = 32; - Item.useAnimation = 32; + Item.useTime = 42; + Item.useAnimation = 42; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 4.5f; @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Ranged Main.projectile[proj].extraUpdates += 2; } - int maxTargets = 12; + int maxTargets = 7; int[] targets = new int[maxTargets]; int targetArrayIndex = 0; Rectangle rectangle = new Rectangle((int)player.Center.X - 960, (int)player.Center.Y - 540, 1920, 1080); @@ -88,10 +88,10 @@ namespace CalamityMod.Items.Weapons.Ranged targetPosition.X = (targetPosition.X + player.Center.X) / 2f + Main.rand.Next(-200, 201); targetPosition.Y -= 100 * j; - Vector2 extraBulletVel = CalamityUtils.CalculatePredictiveAimToTarget(targetPosition, Main.npc[targets[j]], Item.shootSpeed); + Vector2 extraBulletVel = Vector2.Normalize(Main.npc[targets[j]].Center - targetPosition) * Item.shootSpeed; int proj = Projectile.NewProjectile(source, targetPosition, extraBulletVel, type, extraBulletDamage, knockback, player.whoAmI); - Main.projectile[proj].extraUpdates += 2; + Main.projectile[proj].extraUpdates += 14; Main.projectile[proj].tileCollide = false; Main.projectile[proj].timeLeft /= 2; } @@ -111,7 +111,7 @@ namespace CalamityMod.Items.Weapons.Ranged Vector2 extraBulletVel = Vector2.Normalize(Main.npc[targets[randomTarget]].Center - targetPosition) * Item.shootSpeed; int proj = Projectile.NewProjectile(source, targetPosition, extraBulletVel, type, extraBulletDamage, knockback, player.whoAmI); - Main.projectile[proj].extraUpdates += 2; + Main.projectile[proj].extraUpdates += 14; Main.projectile[proj].tileCollide = false; Main.projectile[proj].timeLeft /= 2; } diff --git a/Items/Weapons/Ranged/Disseminator.cs b/Items/Weapons/Ranged/Disseminator.cs index d96ddb02bd..b5f1296001 100644 --- a/Items/Weapons/Ranged/Disseminator.cs +++ b/Items/Weapons/Ranged/Disseminator.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 48; + Item.damage = 58; Item.DamageType = DamageClass.Ranged; Item.width = 66; Item.height = 24; @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Ranged Main.projectile[proj].extraUpdates += 2; } - int maxTargets = 8; + int maxTargets = 7; int[] targets = new int[maxTargets]; int targetArrayIndex = 0; Rectangle rectangle = new Rectangle((int)player.Center.X - 960, (int)player.Center.Y - 540, 1920, 1080); @@ -91,7 +91,7 @@ namespace CalamityMod.Items.Weapons.Ranged Vector2 extraBulletVel = Vector2.Normalize(Main.npc[targets[j]].Center - targetPosition) * Item.shootSpeed; int proj = Projectile.NewProjectile(source, targetPosition, extraBulletVel, type, extraBulletDamage, knockback, player.whoAmI); - Main.projectile[proj].extraUpdates += 2; + Main.projectile[proj].extraUpdates += 14; Main.projectile[proj].tileCollide = false; Main.projectile[proj].timeLeft /= 2; @@ -102,7 +102,7 @@ namespace CalamityMod.Items.Weapons.Ranged extraBulletVel = Vector2.Normalize(Main.npc[targets[j]].Center - targetPosition) * Item.shootSpeed; proj = Projectile.NewProjectile(source, targetPosition, extraBulletVel, type, extraBulletDamage, knockback, player.whoAmI); - Main.projectile[proj].extraUpdates += 2; + Main.projectile[proj].extraUpdates += 14; Main.projectile[proj].tileCollide = false; Main.projectile[proj].timeLeft /= 2; } @@ -122,7 +122,7 @@ namespace CalamityMod.Items.Weapons.Ranged Vector2 extraBulletVel = Vector2.Normalize(Main.npc[targets[randomTarget]].Center - targetPosition) * Item.shootSpeed; int proj = Projectile.NewProjectile(source, targetPosition, extraBulletVel, type, extraBulletDamage, knockback, player.whoAmI); - Main.projectile[proj].extraUpdates += 2; + Main.projectile[proj].extraUpdates += 14; Main.projectile[proj].tileCollide = false; Main.projectile[proj].timeLeft /= 2; @@ -133,7 +133,7 @@ namespace CalamityMod.Items.Weapons.Ranged extraBulletVel = Vector2.Normalize(Main.npc[targets[randomTarget]].Center - targetPosition) * Item.shootSpeed; proj = Projectile.NewProjectile(source, targetPosition, extraBulletVel, type, extraBulletDamage, knockback, player.whoAmI); - Main.projectile[proj].extraUpdates += 2; + Main.projectile[proj].extraUpdates += 14; Main.projectile[proj].tileCollide = false; Main.projectile[proj].timeLeft /= 2; } diff --git a/Projectiles/Ranged/BubonicRoundProj.cs b/Projectiles/Ranged/BubonicRoundProj.cs index ee35e71365..cc89b67632 100644 --- a/Projectiles/Ranged/BubonicRoundProj.cs +++ b/Projectiles/Ranged/BubonicRoundProj.cs @@ -66,12 +66,12 @@ namespace CalamityMod.Projectiles.Ranged return new Color(1f, 1f, 1f, 0f); } - // Ignores 25% of armor - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.ScalingArmorPenetration += 0.25f; - public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers) => modifiers.ScalingArmorPenetration += 0.25f; + // Ignores 20% of armor + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.ScalingArmorPenetration += 0.2f; + public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers) => modifiers.ScalingArmorPenetration += 0.2f; - // Inflicts Plague for 3 seconds - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); + // Inflicts Plague for 0.75 seconds + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 45); public override void OnKill(int timeLeft) { From 52d98b5cf0f50da2a63fa48cd45e2ca339ea7968 Mon Sep 17 00:00:00 2001 From: Done2222 Date: Sat, 16 Dec 2023 16:08:31 +0200 Subject: [PATCH 07/18] Rebalanced (cute word its a nerf) NERFED broken biome blade. --- Items/Weapons/Melee/BrokenBiomeBlade.cs | 21 +++++++++---------- .../Melee/BrokenBiomeBlade_BitingEmbrace.cs | 1 - 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Items/Weapons/Melee/BrokenBiomeBlade.cs b/Items/Weapons/Melee/BrokenBiomeBlade.cs index 929f33f405..0c26e33194 100644 --- a/Items/Weapons/Melee/BrokenBiomeBlade.cs +++ b/Items/Weapons/Melee/BrokenBiomeBlade.cs @@ -32,22 +32,21 @@ namespace CalamityMod.Items.Weapons.Melee #region stats public static int BaseDamage = 47; - public static int DefaultAttunement_BaseDamage = 47; + public static int DefaultAttunement_BaseDamage = 38; - public static int EvilAttunement_BaseDamage = 63; + public static int EvilAttunement_BaseDamage = 50; public static int EvilAttunement_Lifesteal = 2; public static int EvilAttunement_BounceIFrames = 10; - public static int ColdAttunement_BaseDamage = 58; - public static float ColdAttunement_SecondSwingBoost = 1.14f; - public static float ColdAttunement_ThirdSwingBoost = 1.4f; + public static int ColdAttunement_BaseDamage = 40; + public static float ColdAttunement_ThirdSwingBoost = 1.15f; - public static int HotAttunement_BaseDamage = 70; - public static int HotAttunement_FullChargeDamage = 105; - public static int HotAttunement_ShredIFrames = 8; - public static int HotAttunement_LocalIFrames = 30; //Be warned its got one extra update so all the iframes should be divided in 2 - public static int HotAttunement_LocalIFramesCharged = 16; - public static float HotAttunement_ShredDecayRate = 0.7f; //How much charge is lost per frame. + public static int HotAttunement_BaseDamage = 35; + public static int HotAttunement_FullChargeDamage = 60; + public static int HotAttunement_ShredIFrames = 16; + public static int HotAttunement_LocalIFrames = 40; //Be warned its got one extra update so all the iframes should be divided in 2 + public static int HotAttunement_LocalIFramesCharged = 25; + public static float HotAttunement_ShredDecayRate = 1f; //How much charge is lost per frame. public static int TropicalAttunement_BaseDamage = 65; public static float TropicalAttunement_ChainDamageReduction = 0.6f; diff --git a/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs b/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs index 53e79d75f0..75080634f3 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs @@ -119,7 +119,6 @@ namespace CalamityMod.Projectiles.Melee case 1: Projectile.width = Projectile.height = 140; SoundEngine.PlaySound(SoundID.DD2_OgreSpit, Projectile.Center); - Projectile.damage = (int)(Projectile.damage * BrokenBiomeBlade.ColdAttunement_SecondSwingBoost); break; case 2: Projectile.width = Projectile.height = 130; From 7e211216cf664db6c92f4933cbbd4dacab90fd7b Mon Sep 17 00:00:00 2001 From: Done2222 Date: Sat, 16 Dec 2023 16:10:50 +0200 Subject: [PATCH 08/18] forgot to change the "base" damage (it doesnt actually change the weapon's damage, its just best to be same with the default attunement) --- Items/Weapons/Melee/BrokenBiomeBlade.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Melee/BrokenBiomeBlade.cs b/Items/Weapons/Melee/BrokenBiomeBlade.cs index 0c26e33194..3c7e6cc3cc 100644 --- a/Items/Weapons/Melee/BrokenBiomeBlade.cs +++ b/Items/Weapons/Melee/BrokenBiomeBlade.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Melee public int CanLunge = 1; #region stats - public static int BaseDamage = 47; + public static int BaseDamage = 38; public static int DefaultAttunement_BaseDamage = 38; From 684b4aebabe9389fb9b129ab0a4be815fc715cb5 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <142704082+CongratsIsTrash@users.noreply.github.com> Date: Sat, 16 Dec 2023 11:23:38 -0500 Subject: [PATCH 09/18] Updated Bubonic Round's tooltip --- Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson b/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson index d33e0a3686..93ca02be64 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson @@ -44,8 +44,8 @@ BubonicRound: { DisplayName: Bubonic Round Tooltip: ''' - Bursts into virulent plague on contact - Ignores 25% of enemy defense + Spreads the plague on hit + Ignores 20% of enemy defense ''' } From a79f221633316c40640c6c1e9e8128effc131d7d Mon Sep 17 00:00:00 2001 From: Done2222 Date: Sat, 16 Dec 2023 18:58:50 +0200 Subject: [PATCH 10/18] arid grandeur iframe fix (oops) --- Items/Weapons/Melee/BrokenBiomeBlade.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Melee/BrokenBiomeBlade.cs b/Items/Weapons/Melee/BrokenBiomeBlade.cs index 3c7e6cc3cc..f865455fe6 100644 --- a/Items/Weapons/Melee/BrokenBiomeBlade.cs +++ b/Items/Weapons/Melee/BrokenBiomeBlade.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Melee public static int HotAttunement_BaseDamage = 35; public static int HotAttunement_FullChargeDamage = 60; - public static int HotAttunement_ShredIFrames = 16; + public static int HotAttunement_ShredIFrames = 6; public static int HotAttunement_LocalIFrames = 40; //Be warned its got one extra update so all the iframes should be divided in 2 public static int HotAttunement_LocalIFramesCharged = 25; public static float HotAttunement_ShredDecayRate = 1f; //How much charge is lost per frame. From d653ff8af3e9bc1715b2f94e387474b49ded8f60 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sat, 16 Dec 2023 14:55:17 -0500 Subject: [PATCH 11/18] Aurora Blazer adjustments --- Balancing/BalancingChangesManager.cs | 7 +++++-- CalamityLists.cs | 1 + Items/Weapons/Ranged/AuroraBlazer.cs | 2 +- Projectiles/Ranged/AuroraFire.cs | 8 ++++---- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index 338820b1f8..1256b3441a 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -162,6 +162,9 @@ namespace CalamityMod.Balancing // 40% resist to Flying Dragon. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileID.DD2SquireSonicBoom)))); + // 30% resist to Aurora Blazer. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + #endregion #region Duke Fishron @@ -192,8 +195,8 @@ namespace CalamityMod.Balancing // 70% resist to the Stardust Dragon. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.StardustDragon1, ProjectileID.StardustDragon2, ProjectileID.StardustDragon3, ProjectileID.StardustDragon4)))); - // 70% resist to Aurora Blazer. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.3f, ProjectileType())))); + // 60% resist to Aurora Blazer. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.4f, ProjectileType())))); // 50% resist to true melee. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(ResistTrueMelee(0.5f)))); diff --git a/CalamityLists.cs b/CalamityLists.cs index 542979c4d3..e6f59e750d 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -2052,6 +2052,7 @@ namespace CalamityMod ProjectileID.PiercingStarlight, ProjectileID.Terragrim, ProjectileType(), + ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), diff --git a/Items/Weapons/Ranged/AuroraBlazer.cs b/Items/Weapons/Ranged/AuroraBlazer.cs index d647b2d5e4..79b5115960 100644 --- a/Items/Weapons/Ranged/AuroraBlazer.cs +++ b/Items/Weapons/Ranged/AuroraBlazer.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.damage = 71; + Item.damage = 74; Item.DamageType = DamageClass.Ranged; Item.useTime = 5; Item.useAnimation = 30; diff --git a/Projectiles/Ranged/AuroraFire.cs b/Projectiles/Ranged/AuroraFire.cs index 03b7dec8d9..05a25acdcd 100644 --- a/Projectiles/Ranged/AuroraFire.cs +++ b/Projectiles/Ranged/AuroraFire.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override string Texture => "CalamityMod/Projectiles/Magic/RancorFog"; - public static int Lifetime => 450; - public static int Fadetime => 420; + public static int Lifetime => 480; + public static int Fadetime => 450; public ref float Time => ref Projectile.ai[0]; public ref float LightPower => ref Projectile.ai[1]; @@ -35,10 +35,10 @@ namespace CalamityMod.Projectiles.Ranged Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Ranged; Projectile.penetrate = -1; - Projectile.MaxUpdates = 3; + Projectile.MaxUpdates = 4; Projectile.timeLeft = Lifetime; Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 7; + Projectile.idStaticNPCHitCooldown = 8; } public override void AI() From e76adf6107d5488bb340ad647a8d227cb81558b0 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Sat, 9 Dec 2023 20:56:07 -0800 Subject: [PATCH 12/18] Added The Dark Master --- Items/Weapons/Melee/TheDarkMaster.cs | 174 ++++++++++++++++++ Items/Weapons/Melee/TheDarkMaster.png | Bin 0 -> 1217 bytes ...Mods.CalamityMod.Items.Weapons.Melee.hjson | 12 ++ .../Mods.CalamityMod.Projectiles.Melee.hjson | 2 + Projectiles/Melee/DarkMasterBeam.cs | 80 ++++++++ Projectiles/Melee/DarkMasterBeam.png | Bin 0 -> 1582 bytes Projectiles/Melee/DarkMasterClone.cs | 133 +++++++++++++ 7 files changed, 401 insertions(+) create mode 100644 Items/Weapons/Melee/TheDarkMaster.cs create mode 100644 Items/Weapons/Melee/TheDarkMaster.png create mode 100644 Projectiles/Melee/DarkMasterBeam.cs create mode 100644 Projectiles/Melee/DarkMasterBeam.png create mode 100644 Projectiles/Melee/DarkMasterClone.cs diff --git a/Items/Weapons/Melee/TheDarkMaster.cs b/Items/Weapons/Melee/TheDarkMaster.cs new file mode 100644 index 0000000000..ba99f1d226 --- /dev/null +++ b/Items/Weapons/Melee/TheDarkMaster.cs @@ -0,0 +1,174 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Items.Tools; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Melee; +using CalamityMod.Rarities; +using Microsoft.Xna.Framework; +using Mono.Cecil; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Melee +{ + public class TheDarkMaster : ModItem, ILocalizedModType + { + public const float DamagePerHealth = 0.001f; // 0.1 damage per additional health. 100 health = 10% damage. + public new string LocalizationCategory => "Items.Weapons.Melee"; + + BloomRing ring; + + public override void SetStaticDefaults() + { + Item.staff[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + } + + public override void SetDefaults() + { + Item.width = 60; + Item.height = 60; + Item.damage = 60; + Item.DamageType = DamageClass.Melee; + Item.useAnimation = Item.useTime = 26; + Item.useStyle = ItemUseStyleID.Swing; + Item.useTurn = true; + Item.knockBack = 7f; + Item.autoReuse = true; + Item.value = CalamityGlobalItem.Rarity4BuyPrice; + Item.rare = ItemRarityID.LightRed; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 16f; + Item.Calamity().donorItem = true; + } + + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + if (player.altFunctionUse != 2) + { + // only fire beams at max health + if (player.statLife >= player.statLifeMax2) + { + SoundEngine.PlaySound(SoundID.Item71, player.position); + // increase the beam's damage by the player's additional health starting from the vanilla maximum amount with just life crystals + int baseMaxHealth = 400; + int bonusHealth = player.statLifeMax2 - baseMaxHealth; + float bonusDamage = DamagePerHealth * bonusHealth; + Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, (int)(damage * (1 + bonusDamage)), knockback, player.whoAmI); + } + // still play the sound if the clones are out since they always fire beams + else if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + { + SoundEngine.PlaySound(SoundID.Item71, player.position); + } + } + else + { + if (player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0) + { + // spawn a growing red ring + ring = new BloomRing(player.Center, Vector2.Zero, Color.Red, 0.4f, 10); + GeneralParticleHandler.SpawnParticle(ring); + // summon the clones. position is determined by ai[0] + for (int i = 0; i < 3; i++) + { + Projectile.NewProjectile(Item.GetSource_FromThis(), player.Center.X, player.Center.Y, 0, 0, ModContent.ProjectileType(), damage, knockback, player.whoAmI, i); + } + } + } + return false; + } + + public override bool AltFunctionUse(Player player) => true; + + public override bool CanUseItem(Player player) + { + // only allow right clicking if the player doesn't have clones out + if (player.altFunctionUse == 2) + { + if (player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0) + { + Item.UseSound = SoundID.Item104; + Item.useStyle = ItemUseStyleID.Shoot; + Item.useTurn = false; + Item.autoReuse = true; + Item.noMelee = true; + Item.channel = true; + } + else + { + return false; + } + } + else + { + Item.UseSound = SoundID.Item1; + Item.useStyle = ItemUseStyleID.Swing; + Item.useTurn = true; + Item.autoReuse = true; + Item.noMelee = false; + Item.channel = false; + } + return base.CanUseItem(player); + } + + /* public override void UseItemFrame(Player player) + { + // spawn clones once the item's animation has ended + if (player.altFunctionUse == 2) + { + /*if (player.itemAnimation > 1) + { + Vector2 itemRot = player.itemRotation.ToRotationVector2(); + if (player.direction == -1) + itemRot *= -1; + float animationCompletion = 1 - ((float)player.itemAnimation / (float)player.itemAnimationMax); + Vector2 dustSpawnBase = (Vector2)player.HandPosition + itemRot * (1 + animationCompletion) * 40; + for (int i = 0; i < 6; i++) + { + Vector2 spawnPos = dustSpawnBase + Main.rand.NextVector2Circular(64, 64); + Vector2 speed = dustSpawnBase - spawnPos; + speed.SafeNormalize(spawnPos); + Dust d = Dust.NewDustPerfect(spawnPos, 109, speed * 0.2f, Scale: 1f); + d.noGravity = true; + } + } + else*/ + /*{ + if (player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0) + { + ring = new BloomRing(player.Center, Vector2.Zero, Color.Red, 0.4f, 10); + GeneralParticleHandler.SpawnParticle(ring); + for (int i = 0; i < 3; i++) + { + Projectile.NewProjectile(Item.GetSource_FromThis(), player.Center.X, player.Center.Y, 0, 0, ModContent.ProjectileType(), Item.damage, Item.knockBack, player.whoAmI, i); + } + } + } + } + }*/ + + // make the ring grow if it exists + public override void UpdateInventory(Player player) + { + if (ring != null) + { + ring.Scale *= 1.3f; + } + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(ItemID.BeamSword). + AddIngredient(ItemID.LightsBane). + AddIngredient(ItemID.SoulofNight, 20). + AddIngredient(3). + AddIngredient(ItemID.Ruby). // as long as you have enough... + AddTile(TileID.Anvils). + Register(); + } + } +} diff --git a/Items/Weapons/Melee/TheDarkMaster.png b/Items/Weapons/Melee/TheDarkMaster.png new file mode 100644 index 0000000000000000000000000000000000000000..fe2788ed50b9b55d3e2ead31fc43c33f56f0b19e GIT binary patch literal 1217 zcmV;y1U~zTP)F(37hoA3FCGNo$Kf3S?Cecy0OvAUz=wu6d<<7I`^m>20+8?g0I{c6#*yi;4)g=?#o_faD+Gqu8|Qg(d#5scVe)+0m=&{f%4qeoYcneZhMhzrjjLL4 zY3T;w-p5{;IuF3n(W8LX&vtjK`K4ynNyS>t3cfR3aUX7t#Q?azbj`SzwZ!oA&%OY_ z?EFPrADheN04rv_GAjgz1&Q5g%N79ihDHP6wf%bl_g53dcBfJrz<4_C$rtvW;fh%r)8N3s!2d3k&*uTlth|Ajw|DYHZ13*T z0Cc?pfZ6$rK=or+2n-8iIA&H_g+jr$pKjgO2Efz3+X1-w>mL9dYi$N#M}5dPE>FPB z%#7-5^K&)%!oD-?nx&;CE))uKNdst(Mgh1qH){Z#H3#=b9|0`060`Y7TL8#rRc#y& zhk?>AOg^vL1cu$%)SwJrU0k$fZHdjFE~|NB)~dLaS!YFd7oMJ+28Nx4BTazS4@-8I zic7Mvn3QoRjgcn9{0rDBHBSi)3z9{9Z`}l7$~3q4#&rOWTwMTQ%rw;;jcQi^T zq-y}V+v>WTk$Zhp;gwM*{xckjG} to summon three dark clones which fire beams regardless of your current health + The clones disappear while the weapon isn't being held + 'The blade by which the shadows levy their foes with a terrible fate' + ''' +} + TheEnforcer: { DisplayName: The Enforcer Tooltip: Spawns essence flames on hit diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index fa544b5594..0d08ff7edf 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -74,6 +74,8 @@ Cyclone.DisplayName: Cyclone DarkBall.DisplayName: Dark Ball DarkBeam.DisplayName: Dark Beam DarkIceZero.DisplayName: Dark Ice +DarkMasterBeam.DisplayName: Dark Master Beam +DarkMasterClone.DisplayName: Dark Terrarian DeathsAscensionProjectile.DisplayName: Ascended Scythe DecaysRetort.DisplayName: Decay's Retort DecaysRetortDash.DisplayName: Evisceration Lunge diff --git a/Projectiles/Melee/DarkMasterBeam.cs b/Projectiles/Melee/DarkMasterBeam.cs new file mode 100644 index 0000000000..2ab3ae700f --- /dev/null +++ b/Projectiles/Melee/DarkMasterBeam.cs @@ -0,0 +1,80 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Audio; +namespace CalamityMod.Projectiles.Melee +{ + public class DarkMasterBeam : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + + private int tileCounter = 5; // assure that the beams don't instantly die due to their size + + public override void SetStaticDefaults() + { + Main.projFrames[Projectile.type] = 6; + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; + ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + } + + public override void SetDefaults() + { + Projectile.width = 32; + Projectile.height = 32; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.DamageType = DamageClass.Melee; + Projectile.timeLeft = 300; + Projectile.penetrate = 2; + Projectile.tileCollide = false; + } + + public override void AI() + { + if (tileCounter > 0) + tileCounter--; + if (tileCounter <= 0 && Projectile.ai[1] == 0) + Projectile.tileCollide = true; + + Projectile.velocity *= 1.03f; + + Projectile.frameCounter++; + if (Projectile.frameCounter > 4) + { + Projectile.frame++; + Projectile.frameCounter = 0; + if (Projectile.frame > 5) + { + Projectile.frame = 0; + } + } + Lighting.AddLight(Projectile.Center, TorchID.Red); // til there's a torch id + } + + public override void OnKill(int timeLeft) + { + SoundEngine.PlaySound(SoundID.Item10, Projectile.Center); + + for (int i = 0; i < 30; i++) + { + float angle = MathHelper.TwoPi * Main.rand.NextFloat(0f, 1f); + Vector2 angleVec = angle.ToRotationVector2(); + float distance = Main.rand.NextFloat(7f, 18f); + Vector2 off = angleVec * distance; + off.Y *= (float)Projectile.height / Projectile.width; + Vector2 pos = Projectile.Center + off; + Dust d = Dust.NewDustPerfect(pos, DustID.GemRuby, angleVec * Main.rand.NextFloat(2f, 4f)); + d.customData = true; + } + } + + public override bool PreDraw(ref Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + return false; + } + } +} diff --git a/Projectiles/Melee/DarkMasterBeam.png b/Projectiles/Melee/DarkMasterBeam.png new file mode 100644 index 0000000000000000000000000000000000000000..9e73ffe7ad2f6c19dbbffad143ff1fbbf9c79382 GIT binary patch literal 1582 zcmV+}2GRM6P)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^00n$WL_t(|+U=dOauYug#=na_o}nNW zC8;P~QKrg6koX~>udQOXMvoV+b*;gfAePW3uaeW z0D#TyEr9%HgW?rXZHzHMYkA?Js)vBZ+qd#({&_k%j2Q8g? z&5#Q4jSjn3SZt)Ww2k5w;EWF2p7JCfV6L#7s-G1 z&}AxxPyyOEnrnwLYs_zM>Mwfv5&-afwPIw5kbKA{IxNhV%L;JsRbqySl9+pky-?>J zDzn2}ePWiFg&2E>dr^CcRrKlIY;V=qKW2(H%melgA8@pqthBIpR3E_A-d;rr#Vg=w zO;C$zahs)M&)b5+FB$C5Id_cI97Tp)w3auX^CepR*hGs>o@&KM>#=ecXz*5m2{S}8 zCqx0PA@VOUIyx-mYI&h}1)QP&EuTc@cB>G^`|*x&f()v0or-B~Ssj3#=$f2q6U! zEjrw(Fga;-Slebshm}N+4tv)UiBwO>)h9-WEj-2E;Xxwg8LIo(g>iv~zBNH#i;r4O zl3AluowgTIh&C3f=+8mEK=BIbjsZbc{WeyS`_$&nGx& zm(($SsH%f~45A3%v7vYcWET&x?Qt3l6_C0CV~LgBMg^p9KqzCg+=Sv45S$;7G4uq1 zj1}OqgT;io!d>$&?E4Wzve( z^aCs;e-;Sc|2MXed=_X(t^gZaWeilhR`r<*NZkNmtkv&~9j$_^f)y2zx&dPmB}laR z@%Hvm34$ZXsCWfryCNj>_^+nIwUs9OOlAvH2~kh%e5 zky$`0T#tncNZkNmT2HX4WcmBuyZ-s##PAS7Pq1?rP7zxTQ}d*0t>t;{u!Up_aGqgm zIaAzse*w=Oc5n)-!d~YbwK!^-^W0%2*+qt)t=AO*?0)iu8>SsLv;|U{;u* z0>;j#+OtG$xFSG8sKr~3#{fo$fsk{DBUOQmW?>tQ4i6LW+~HG!(P2M=&m9)LD@ppI z%mQb0*puL@vh93+aRC6>uGf=Rpp5OI7OwzOI{yO-UqXhc@PO|C000tnMObu2SV=}Y gPjYExZggREX>V=-F@#v`?*IS*07*qoM6N<$f?^iP^Z)<= literal 0 HcmV?d00001 diff --git a/Projectiles/Melee/DarkMasterClone.cs b/Projectiles/Melee/DarkMasterClone.cs new file mode 100644 index 0000000000..58271a0fad --- /dev/null +++ b/Projectiles/Melee/DarkMasterClone.cs @@ -0,0 +1,133 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Audio; +using static Humanizer.In; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; +using System; +using Microsoft.Xna.Framework.Graphics; + +namespace CalamityMod.Projectiles.Melee +{ + public class DarkMasterClone : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void SetDefaults() + { + Projectile.width = 20; + Projectile.height = 42; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.DamageType = DamageClass.Melee; + Projectile.timeLeft = 300; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + } + + public override void AI() + { + // if the velocity is not zero, the visuals get offset weirdly + Projectile.velocity = Vector2.Zero; + Player owner = Main.player[Projectile.owner]; + // how far the clone should move from the player + Vector2 moveTo = new Vector2(0, -160); + switch (Projectile.ai[0]) + { + case 1: + moveTo = new Vector2(-180, 120); + break; + case 2: + moveTo = new Vector2(180, 120); + break; + default: + moveTo = new Vector2(0, -160); + break; + } + // if the player isn't holding the sword, DIE. + if (owner.HeldItem.type != ModContent.ItemType() || !owner.active || owner.CCed || owner == null || Projectile.type != ModContent.ProjectileType()) + { + Projectile.Kill(); + } + // if all conditions above aren't met, the clone can stick around forever + Projectile.timeLeft = 30; + // move the clone to the desired position + Projectile.Center = Vector2.Lerp(Projectile.Center, owner.Center + moveTo, 0.4f); + // assure that the clones only shoot at the owner's cursor + if (Main.myPlayer != Projectile.owner) + return; + // shoot beams while the player is left clicking + if (owner.itemTime == owner.itemTimeMax && owner.altFunctionUse != 2) + { + Vector2 direction = Projectile.Center.DirectionTo(Main.MouseWorld); + Projectile.direction = Math.Sign(direction.X); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + // ai[1] not being 0 determines if the projectile should always ignore tiles + Projectile.NewProjectile(Projectile.GetSource_FromAI(), Projectile.Center, direction * owner.HeldItem.shootSpeed, ModContent.ProjectileType(), (int)(Projectile.damage * 0.3f), Projectile.knockBack, Projectile.owner, ai1: 1); + } + } + } + + public override void OnKill(int timeLeft) + { + SoundEngine.PlaySound(SoundID.NPCDeath6, Projectile.Center); + + for (int i = 0; i < 8; i++) + { + float angle = MathHelper.TwoPi * Main.rand.NextFloat(0f, 1f); + Vector2 angleVec = angle.ToRotationVector2(); + Particle smoke = new HeavySmokeParticle(Projectile.Center, angleVec * Main.rand.NextFloat(2f, 4f), Color.Black, 60, Main.rand.NextFloat(0.45f, 1.22f), 0.6f, 0.1f); + GeneralParticleHandler.SpawnParticle(smoke); + } + } + + public override bool PreDraw(ref Color lightColor) + { + // make a player visual clone. it inherits the player's hair type and clothes style and is otherwise all black with red pupils + Main.playerVisualClone[Projectile.owner] ??= new(); + Player owner = Main.player[Projectile.owner]; + + Player player = Main.playerVisualClone[Projectile.owner]; + //player.CopyVisuals(Main.player[Projectile.owner]); + player.hair = owner.hair; + player.skinVariant = owner.skinVariant; + player.skinColor = Color.Black; + player.shirtColor = Color.Black; + player.underShirtColor = Color.Black; + player.pantsColor = Color.Black; + player.shoeColor = Color.Black; + player.hairColor = Color.Black; + player.eyeColor = Color.Red; + player.PlayerFrame(); + // copy the player's arm movements while swinging, otherwise idle + if (owner.ItemAnimationActive && owner.altFunctionUse != 2) + player.bodyFrame = owner.bodyFrame; + else + player.bodyFrame.Y = 0; + // legs never jump or walk + player.legFrame.Y = 0; + // face towards the player's cursor + player.direction = Math.Sign(Projectile.DirectionTo(Main.MouseWorld).X); + Main.PlayerRenderer.DrawPlayer(Main.Camera, player, Projectile.position, 0f, player.fullRotationOrigin, 0f, 1f); + // draw the sword + if (owner.ItemAnimationActive && owner.altFunctionUse != 2) + { + Texture2D Sword = ModContent.Request("CalamityMod/Items/Weapons/Melee/TheDarkMaster").Value; + Vector2 distToPlayer = Projectile.position - owner.position; + Main.EntitySpriteDraw(Sword, (Vector2)owner.HandPosition + distToPlayer - Main.screenPosition, null, lightColor, owner.direction == player.direction ? owner.itemRotation : -owner.itemRotation, new Vector2(player.direction == 1 ? 0 : Sword.Width, Sword.Height), 1f, player.direction == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally); + } + return false; + } + + public override bool? CanDamage() + { + return false; + } + } +} From b9b52df7adf4d6df63e1a72045c0c690ddfd3694 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Sat, 9 Dec 2023 21:18:07 -0800 Subject: [PATCH 13/18] mp fix --- Projectiles/Melee/DarkMasterClone.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Projectiles/Melee/DarkMasterClone.cs b/Projectiles/Melee/DarkMasterClone.cs index 58271a0fad..c3b50b528c 100644 --- a/Projectiles/Melee/DarkMasterClone.cs +++ b/Projectiles/Melee/DarkMasterClone.cs @@ -58,15 +58,12 @@ namespace CalamityMod.Projectiles.Melee Projectile.timeLeft = 30; // move the clone to the desired position Projectile.Center = Vector2.Lerp(Projectile.Center, owner.Center + moveTo, 0.4f); - // assure that the clones only shoot at the owner's cursor - if (Main.myPlayer != Projectile.owner) - return; // shoot beams while the player is left clicking if (owner.itemTime == owner.itemTimeMax && owner.altFunctionUse != 2) { Vector2 direction = Projectile.Center.DirectionTo(Main.MouseWorld); Projectile.direction = Math.Sign(direction.X); - if (Main.netMode != NetmodeID.MultiplayerClient) + if (Projectile.owner == Main.myPlayer) { // ai[1] not being 0 determines if the projectile should always ignore tiles Projectile.NewProjectile(Projectile.GetSource_FromAI(), Projectile.Center, direction * owner.HeldItem.shootSpeed, ModContent.ProjectileType(), (int)(Projectile.damage * 0.3f), Projectile.knockBack, Projectile.owner, ai1: 1); From 3123153303d6fdff16ebff100dfa922516e93b77 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Sun, 10 Dec 2023 02:04:53 -0800 Subject: [PATCH 14/18] tooltip update --- .../en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index cd3c63a477..59240bb4f3 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -1195,10 +1195,12 @@ TheDarkMaster: { DisplayName: The Dark Master Tooltip: ''' - Fires whirling red beams while at full health - The damage of the beams increases based on your maximum health - to summon three dark clones which fire beams regardless of your current health - The clones disappear while the weapon isn't being held + Fires red echo slash projectiles at full health + Projectile damage increases for every point of HP above 400 + Press to spawn three shadow clones in a Delta formation + The clones will mirror your sword swings and release projectiles + The clones will always fire projectiles regardless of your own HP + The clones may only exist while holding this weapon 'The blade by which the shadows levy their foes with a terrible fate' ''' } From 97c7848ceb11e438d47f7056b2302c4451ca2c12 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Thu, 14 Dec 2023 22:59:44 -0800 Subject: [PATCH 15/18] player equipment now copies --- Projectiles/Melee/DarkMasterClone.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Projectiles/Melee/DarkMasterClone.cs b/Projectiles/Melee/DarkMasterClone.cs index c3b50b528c..bc1d893a49 100644 --- a/Projectiles/Melee/DarkMasterClone.cs +++ b/Projectiles/Melee/DarkMasterClone.cs @@ -10,6 +10,7 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Particles; using System; using Microsoft.Xna.Framework.Graphics; +using Terraria.Graphics.Shaders; namespace CalamityMod.Projectiles.Melee { @@ -91,7 +92,7 @@ namespace CalamityMod.Projectiles.Melee Player owner = Main.player[Projectile.owner]; Player player = Main.playerVisualClone[Projectile.owner]; - //player.CopyVisuals(Main.player[Projectile.owner]); + player.CopyVisuals(Main.player[Projectile.owner]); player.hair = owner.hair; player.skinVariant = owner.skinVariant; player.skinColor = Color.Black; @@ -101,6 +102,20 @@ namespace CalamityMod.Projectiles.Melee player.shoeColor = Color.Black; player.hairColor = Color.Black; player.eyeColor = Color.Red; + // become one with the shadows + for (int i = 0; i < player.dye.Length; i++) + { + if (player.dye[i].type != ItemID.ShadowDye) + { + player.dye[i].SetDefaults(ItemID.ShadowDye); + } + } + // update everything for our little dummy player + player.ResetEffects(); + player.ResetVisibleAccessories(); + player.DisplayDollUpdate(); + player.UpdateSocialShadow(); + player.UpdateDyes(); player.PlayerFrame(); // copy the player's arm movements while swinging, otherwise idle if (owner.ItemAnimationActive && owner.altFunctionUse != 2) From 383c93f321bf33a3cdbc257b03474e4af20ad080 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Thu, 14 Dec 2023 23:20:45 -0800 Subject: [PATCH 16/18] smoke trail --- Projectiles/Melee/DarkMasterBeam.cs | 5 ++--- Projectiles/Melee/DarkMasterClone.cs | 22 +++++++++++++++------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Projectiles/Melee/DarkMasterBeam.cs b/Projectiles/Melee/DarkMasterBeam.cs index 2ab3ae700f..957699be24 100644 --- a/Projectiles/Melee/DarkMasterBeam.cs +++ b/Projectiles/Melee/DarkMasterBeam.cs @@ -1,10 +1,9 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; + namespace CalamityMod.Projectiles.Melee { public class DarkMasterBeam : ModProjectile, ILocalizedModType diff --git a/Projectiles/Melee/DarkMasterClone.cs b/Projectiles/Melee/DarkMasterClone.cs index bc1d893a49..410db8fd7a 100644 --- a/Projectiles/Melee/DarkMasterClone.cs +++ b/Projectiles/Melee/DarkMasterClone.cs @@ -1,16 +1,12 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; -using static Humanizer.In; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Particles; using System; using Microsoft.Xna.Framework.Graphics; -using Terraria.Graphics.Shaders; namespace CalamityMod.Projectiles.Melee { @@ -51,7 +47,7 @@ namespace CalamityMod.Projectiles.Melee break; } // if the player isn't holding the sword, DIE. - if (owner.HeldItem.type != ModContent.ItemType() || !owner.active || owner.CCed || owner == null || Projectile.type != ModContent.ProjectileType()) + if (owner.HeldItem.type != ModContent.ItemType() || !owner.active || owner.CCed || owner == null) { Projectile.Kill(); } @@ -59,8 +55,20 @@ namespace CalamityMod.Projectiles.Melee Projectile.timeLeft = 30; // move the clone to the desired position Projectile.Center = Vector2.Lerp(Projectile.Center, owner.Center + moveTo, 0.4f); + // produce smoke during initial move + if (Projectile.Distance(owner.Center + moveTo) < 16) + { + Projectile.ai[2] = 1; + } + if (Projectile.ai[2] == 0) + { + float angle = MathHelper.TwoPi * Main.rand.NextFloat(0f, 1f); + Vector2 angleVec = angle.ToRotationVector2(); + Particle smoke = new HeavySmokeParticle(Projectile.Center, angleVec * Main.rand.NextFloat(1f, 2f), Color.Black, 30, Main.rand.NextFloat(0.25f, 1f), 0.5f, 0.1f); + GeneralParticleHandler.SpawnParticle(smoke); + } // shoot beams while the player is left clicking - if (owner.itemTime == owner.itemTimeMax && owner.altFunctionUse != 2) + if (owner.itemTime == owner.itemTimeMax && owner.altFunctionUse != 2 && owner.HeldItem.type == ModContent.ItemType()) { Vector2 direction = Projectile.Center.DirectionTo(Main.MouseWorld); Projectile.direction = Math.Sign(direction.X); From c8b9648ec59a155e361875e11d0f24e218000d09 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Thu, 14 Dec 2023 23:23:59 -0800 Subject: [PATCH 17/18] final cleanup --- Items/Weapons/Melee/TheDarkMaster.cs | 40 ---------------------------- 1 file changed, 40 deletions(-) diff --git a/Items/Weapons/Melee/TheDarkMaster.cs b/Items/Weapons/Melee/TheDarkMaster.cs index ba99f1d226..5c13113db9 100644 --- a/Items/Weapons/Melee/TheDarkMaster.cs +++ b/Items/Weapons/Melee/TheDarkMaster.cs @@ -93,9 +93,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.UseSound = SoundID.Item104; Item.useStyle = ItemUseStyleID.Shoot; Item.useTurn = false; - Item.autoReuse = true; Item.noMelee = true; - Item.channel = true; } else { @@ -107,49 +105,11 @@ namespace CalamityMod.Items.Weapons.Melee Item.UseSound = SoundID.Item1; Item.useStyle = ItemUseStyleID.Swing; Item.useTurn = true; - Item.autoReuse = true; Item.noMelee = false; - Item.channel = false; } return base.CanUseItem(player); } - /* public override void UseItemFrame(Player player) - { - // spawn clones once the item's animation has ended - if (player.altFunctionUse == 2) - { - /*if (player.itemAnimation > 1) - { - Vector2 itemRot = player.itemRotation.ToRotationVector2(); - if (player.direction == -1) - itemRot *= -1; - float animationCompletion = 1 - ((float)player.itemAnimation / (float)player.itemAnimationMax); - Vector2 dustSpawnBase = (Vector2)player.HandPosition + itemRot * (1 + animationCompletion) * 40; - for (int i = 0; i < 6; i++) - { - Vector2 spawnPos = dustSpawnBase + Main.rand.NextVector2Circular(64, 64); - Vector2 speed = dustSpawnBase - spawnPos; - speed.SafeNormalize(spawnPos); - Dust d = Dust.NewDustPerfect(spawnPos, 109, speed * 0.2f, Scale: 1f); - d.noGravity = true; - } - } - else*/ - /*{ - if (player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0) - { - ring = new BloomRing(player.Center, Vector2.Zero, Color.Red, 0.4f, 10); - GeneralParticleHandler.SpawnParticle(ring); - for (int i = 0; i < 3; i++) - { - Projectile.NewProjectile(Item.GetSource_FromThis(), player.Center.X, player.Center.Y, 0, 0, ModContent.ProjectileType(), Item.damage, Item.knockBack, player.whoAmI, i); - } - } - } - } - }*/ - // make the ring grow if it exists public override void UpdateInventory(Player player) { From 81e47ca4a3ba8abe770fe9cc1534a86e97c255bb Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Thu, 14 Dec 2023 23:28:17 -0800 Subject: [PATCH 18/18] iphrames --- Items/Weapons/Melee/TheDarkMaster.cs | 3 --- Projectiles/Melee/DarkMasterBeam.cs | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Items/Weapons/Melee/TheDarkMaster.cs b/Items/Weapons/Melee/TheDarkMaster.cs index 5c13113db9..d3e73135ea 100644 --- a/Items/Weapons/Melee/TheDarkMaster.cs +++ b/Items/Weapons/Melee/TheDarkMaster.cs @@ -1,10 +1,7 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Tools; using CalamityMod.Particles; using CalamityMod.Projectiles.Melee; -using CalamityMod.Rarities; using Microsoft.Xna.Framework; -using Mono.Cecil; using Terraria; using Terraria.Audio; using Terraria.DataStructures; diff --git a/Projectiles/Melee/DarkMasterBeam.cs b/Projectiles/Melee/DarkMasterBeam.cs index 957699be24..c8d5db3307 100644 --- a/Projectiles/Melee/DarkMasterBeam.cs +++ b/Projectiles/Melee/DarkMasterBeam.cs @@ -29,6 +29,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.timeLeft = 300; Projectile.penetrate = 2; Projectile.tileCollide = false; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 30; } public override void AI()