From c0d4e853b873a28e749ce84213db746fa2041974 Mon Sep 17 00:00:00 2001 From: Cameron Ewell Date: Tue, 8 Feb 2022 19:18:39 -0500 Subject: [PATCH 1/7] Added Stylist name Xsiana for donator --- NPCs/CalamityGlobalTownNPC.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index ec38aba6f8..ff90ccd651 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -129,6 +129,7 @@ namespace CalamityMod.NPCs { "Amber", // <@!114677116473180169> (Mishiro Usui#1295) "Faith", // <@!509050283871961123> (Toasty#1007) + "Xsiana", // <@!625780237489143839> (xiana.#0015) }; private const int TavernkeepVanillaNames = 16; private static readonly string[] TavernkeepNames = From dcc2477bdb94cb1798369aa395f0c72f27d4bc06 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Tue, 8 Feb 2022 19:07:01 -0600 Subject: [PATCH 2/7] SCal's forcefield is slightly less intense overall --- NPCs/SupremeCalamitas/SupremeCalamitas.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index ef92f526e8..44da26b456 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -2931,6 +2931,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!npc.dontTakeDamage && (willCharge || npc.ai[1] == 2f)) intensity = 1.1f; + // Dampen the opacity and intensity slightly, to allow SCal to be more easily visible inside of the forcefield. + intensity *= 0.75f; + opacity *= 0.75f; + Texture2D forcefieldTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/CalamitasShield"); GameShaders.Misc["CalamityMod:SupremeShield"].UseImage("Images/Misc/Perlin"); From 8dff4e384a10e354b1dc9cac66dba418f2b10ab2 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Tue, 8 Feb 2022 19:07:47 -0600 Subject: [PATCH 3/7] Update GeneralParticleHandler.cs --- Particles/GeneralParticleHandler.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Particles/GeneralParticleHandler.cs b/Particles/GeneralParticleHandler.cs index 53be50be67..99baea42fd 100644 --- a/Particles/GeneralParticleHandler.cs +++ b/Particles/GeneralParticleHandler.cs @@ -72,10 +72,15 @@ namespace CalamityMod.Particles } /// - /// Spawns the particle instance provided into the world. If the particle limit is reached but the particle is marked as important, it will try to replace a non important particle. - /// - public static void SpawnParticle(Particle particle) + /// Spawns the particle instance provided into the world. If the particle limit is reached but the particle is marked as important, it will try to replace a non important particle. + /// + public static void SpawnParticle(Particle particle) { + // Don't queue particles if the game is paused. + // This precedent is established with how Dust instances are created. + if (Main.gamePaused) + return; + if (particles.Count >= CalamityConfig.Instance.ParticleLimit && !particle.Important) return; From 1d0d06fa7818d8c8fe58255cc4286a1bbd82c1b2 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Tue, 8 Feb 2022 20:37:08 -0500 Subject: [PATCH 4/7] 1 - Reworked Soma Prime. It now works like Warframe, with supercrits, bleed, and supercritting bleed. 2 - Added a supercrit system. All projectiles can now benefit from over 100% crit if it is enabled for that projectile. 3 - Replaced the existing Shred debuff with a stacking bleed which scales with ranged damage and can supercrit. 4 - Removed Soma Prime's unique rarity color because it was getting confused with the default white rarity. --- Buffs/DamageOverTime/Shred.cs | 55 +++++++++++-- CalPlayer/CalamityPlayerOnHit.cs | 30 ++++--- Items/CalamityGlobalItemTooltip.cs | 2 - Items/Weapons/Ranged/SomaPrime.cs | 53 +++++++------ NPCs/CalamityGlobalNPC.cs | 101 ++++++++++++++++++------ Projectiles/CalamityGlobalProjectile.cs | 11 ++- Projectiles/Ranged/SlashRound.cs | 39 --------- 7 files changed, 186 insertions(+), 105 deletions(-) delete mode 100644 Projectiles/Ranged/SlashRound.cs diff --git a/Buffs/DamageOverTime/Shred.cs b/Buffs/DamageOverTime/Shred.cs index eab185a1f2..a8babd6dc4 100644 --- a/Buffs/DamageOverTime/Shred.cs +++ b/Buffs/DamageOverTime/Shred.cs @@ -1,3 +1,6 @@ +using CalamityMod.NPCs; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -5,10 +8,16 @@ namespace CalamityMod.Buffs.DamageOverTime { public class Shred : ModBuff { + internal const int StackFalloffFrames = 320; + + // 75 DPS (15x5) per stack may seem low, but it gets boosted by ranged stats and can supercrit. + internal static int BaseDamage = 15; + internal static int FramesPerDamageTick = 12; + public override void SetDefaults() { DisplayName.SetDefault("Shred"); - Description.SetDefault("Blood"); + Description.SetDefault("Someone built ten Tri-Tip Daggers..."); Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; @@ -17,10 +26,46 @@ namespace CalamityMod.Buffs.DamageOverTime public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().pShred < npc.buffTime[buffIndex]) - npc.Calamity().pShred = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + CalamityGlobalNPC cgn = npc.Calamity(); + if (cgn.somaShredStacks <= 0) + { + cgn.somaShredStacks = 1; + cgn.somaShredFalloff = StackFalloffFrames; + } + else + { + ++cgn.somaShredStacks; + } + + // As soon as the debuff is applied to the NPC, subsume it into Calamity's tracking system + npc.DelBuff(buffIndex); + buffIndex--; + } + + internal static void TickDebuff(NPC target, CalamityGlobalNPC cgn) + { + // Decrement the falloff counter every frame. + cgn.somaShredFalloff -= cgn.somaShredStacks; + if (cgn.somaShredFalloff <= 0) + { + cgn.somaShredFalloff += StackFalloffFrames; + --cgn.somaShredStacks; + } + + // If a valid player applied this debuff, then let it deal damage. + if (cgn.somaShredApplicator >= 0 && cgn.somaShredApplicator < Main.maxPlayers) + { + Player applicator = Main.player[cgn.somaShredApplicator]; + + // Only deal damage once every several frames. + if (applicator.miscCounter % FramesPerDamageTick == 0) + { + int dmg = (int)(BaseDamage * cgn.somaShredStacks * applicator.rangedDamage); + Projectile tick = Projectile.NewProjectileDirect(target.Center, Vector2.Zero, ModContent.ProjectileType(), dmg, 0f, applicator.whoAmI, target.whoAmI); + tick.ranged = true; // Uncommon for DirectStrikes, but it needs to be able to crit. + tick.Calamity().canSupercrit = true; + } + } } } } diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 7f75b85e40..0293aed201 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -2,13 +2,16 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor; +using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.NPCs; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.Projectiles; using CalamityMod.Projectiles.Healing; -using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Magic; +using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; @@ -19,12 +22,10 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; -using CalamityMod.Items.Accessories; -using CalamityMod.Items.VanillaArmorChanges; namespace CalamityMod.CalPlayer { - public partial class CalamityPlayer : ModPlayer + public partial class CalamityPlayer : ModPlayer { #region On Hit Anything public override void OnHitAnything(float x, float y, Entity victim) @@ -175,6 +176,7 @@ namespace CalamityMod.CalPlayer { if (player.whoAmI != Main.myPlayer) return; + CalamityGlobalNPC cgn = target.Calamity(); // Handle on-hit melee effects for the gem tech armor set. if (proj.melee) @@ -187,11 +189,9 @@ namespace CalamityMod.CalPlayer if (witheringWeaponEnchant) witheringDamageDone += (int)(damage * (crit ? 2D : 1D)); - target.Calamity().IncreasedHeatEffects = fireball || cinnamonRoll; - - target.Calamity().IncreasedColdEffects = eskimoSet; - - target.Calamity().IncreasedSicknessAndWaterEffects = evergreenGin; + cgn.IncreasedHeatEffects = fireball || cinnamonRoll; + cgn.IncreasedColdEffects = eskimoSet; + cgn.IncreasedSicknessAndWaterEffects = evergreenGin; switch (proj.type) { @@ -337,6 +337,7 @@ namespace CalamityMod.CalPlayer break; } + // TODO -- This should be removed, why is this here? if (ProjectileID.Sets.StardustDragon[proj.type]) target.immune[proj.owner] = 10; @@ -348,9 +349,18 @@ namespace CalamityMod.CalPlayer if (proj.type == ProjectileID.IchorArrow && player.ActiveItem().type == ItemType()) target.AddBuff(BuffID.Midas, 300, false); + // All projectiles fired from Soma Prime are marked using CalamityGlobalProjectile + CalamityGlobalProjectile cgp = proj.Calamity(); + if (cgp.appliesSomaShred) + { + target.AddBuff(BuffType(), 320); + // This information cannot be transferred through the buff, but is necessary to calculate damage + cgn.somaShredApplicator = player.whoAmI; + } + ProjLifesteal(target, proj, damage, crit); ProjOnHit(proj, target.Center, crit, (target.damage > 5 || target.boss) && !target.SpawnedFromStatue); - NPCDebuffs(target, proj.melee, proj.ranged, proj.magic, proj.IsSummon(), proj.Calamity().rogue, true); + NPCDebuffs(target, proj.melee, proj.ranged, proj.magic, proj.IsSummon(), cgp.rogue, true); // Shattered Community tracks all damage dealt with Rage Mode (ignoring dummies). if (target.type == NPCID.TargetDummy || target.type == NPCType()) diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 88fc42778c..ceca3c84bc 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -118,8 +118,6 @@ namespace CalamityMod.Items nameLine.overrideColor = new Color(129, 29, 149); if (item.type == ModContent.ItemType()) nameLine.overrideColor = new Color(220, 20, 60); - if (item.type == ModContent.ItemType()) - nameLine.overrideColor = new Color(254, 253, 235); if (item.type == ModContent.ItemType()) nameLine.overrideColor = new Color(207, 17, 117); if (item.type == ModContent.ItemType()) diff --git a/Items/Weapons/Ranged/SomaPrime.cs b/Items/Weapons/Ranged/SomaPrime.cs index d826ea3932..76da0f3d66 100644 --- a/Items/Weapons/Ranged/SomaPrime.cs +++ b/Items/Weapons/Ranged/SomaPrime.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Projectiles; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; @@ -10,37 +10,43 @@ namespace CalamityMod.Items.Weapons.Ranged { public class SomaPrime : ModItem { + private static readonly float XYInaccuracy = 0.32f; + public override void SetStaticDefaults() { DisplayName.SetDefault("Soma Prime"); - Tooltip.SetDefault("Converts musket balls into extremely powerful high velocity rounds that inflict a powerful bleed debuff"); + Tooltip.SetDefault(@"This weapon can supercrit if its crit chance is over 100% +All bullets fired inflict Shred, a stacking bleed debuff +Shred deals 75 DPS per stack and scales with your ranged stats +Damage ticks of Shred can also critically strike or supercrit +Replaces standard bullets with High Velocity Bullets +80% chance to not consume ammo"); } public override void SetDefaults() { - item.damage = 200; + item.damage = 130; item.ranged = true; item.width = 94; item.height = 34; - item.useTime = 2; - item.useAnimation = 2; + item.useTime = item.useAnimation = 5; item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2f; item.UseSound = SoundID.Item40; item.autoReuse = true; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 30f; + item.shoot = ProjectileID.BulletHighVelocity; + item.shootSpeed = 9f; item.useAmmo = AmmoID.Bullet; item.value = CalamityGlobalItem.Rarity16BuyPrice; item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; - item.Calamity().canFirePointBlankShots = true; - } + item.Calamity().canFirePointBlankShots = true; + } // Terraria seems to really dislike high crit values in SetDefaults - public override void GetWeaponCrit(Player player, ref int crit) => crit += 40; + public override void GetWeaponCrit(Player player, ref int crit) => crit += 30; public override Vector2? HoldoutOffset() => new Vector2(-25, 0); @@ -57,24 +63,21 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - for (int i = 0; i < 2; i++) - { - float SpeedX = speedX + Main.rand.Next(-10, 11) * 0.05f; - float SpeedY = speedY + Main.rand.Next(-10, 11) * 0.05f; + if (type == ProjectileID.Bullet) { + type = ProjectileID.BulletHighVelocity; + damage += 4; // in 1.4, HVBs deal 11 damage and Musket Balls deal 7 + } - if (type == ProjectileID.Bullet) - Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI); - else - Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - } + speedX += Main.rand.NextFloat(-XYInaccuracy, XYInaccuracy); + speedY += Main.rand.NextFloat(-XYInaccuracy, XYInaccuracy); + Vector2 vel = new Vector2(speedX, speedY); + Projectile shot = Projectile.NewProjectileDirect(position, vel, type, damage, knockBack, player.whoAmI); + CalamityGlobalProjectile cgp = shot.Calamity(); + cgp.canSupercrit = true; + cgp.appliesSomaShred = true; return false; } - public override bool ConsumeAmmo(Player player) - { - if (Main.rand.Next(0, 100) < 50) - return false; - return true; - } + public override bool ConsumeAmmo(Player player) => Main.rand.NextFloat() > 0.8f; } } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index d304a96f60..d85581dac6 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -203,7 +203,14 @@ namespace CalamityMod.NPCs public int hFlames = 0; public int pFlames = 0; public int aCrunch = 0; - public int pShred = 0; + + // Soma Prime Shred deals damage with DirectStrikes instead of with direct debuff damage + // It also stacks, scales with ranged damage, and can crit, meaning it needs to know who applied it most recently + public int somaShredStacks = 0; + public int somaShredApplicator = -1; + // Reduced by the number of active stacks every frame. If it hits zero, one stack disappears. + public int somaShredFalloff = Shred.StackFalloffFrames; + public int cDepth = 0; public int gsInferno = 0; public int astralInfection = 0; @@ -816,8 +823,8 @@ namespace CalamityMod.NPCs // Debuffs that aren't affected by weaknesses or resistances. if (vaporfied > 0) ApplyDPSDebuff(30, 6, ref npc.lifeRegen, ref damage); - if (pShred > 0) - ApplyDPSDebuff(1500, 300, ref npc.lifeRegen, ref damage); + if (somaShredStacks > 0) + Shred.TickDebuff(npc, this); if (bBlood > 0) ApplyDPSDebuff(50, 10, ref npc.lifeRegen, ref damage); @@ -3690,8 +3697,7 @@ namespace CalamityMod.NPCs pFlames--; if (aFlames > 0) aFlames--; - if (pShred > 0) - pShred--; + // Soma Prime's Shred stacks have a unique falloff mechanic in the debuff's own file. if (aCrunch > 0) aCrunch--; if (cDepth > 0) @@ -3911,6 +3917,36 @@ namespace CalamityMod.NPCs MakeTownNPCsTakeMoreDamage(npc, projectile, mod, ref damage); + // Supercrits + var cgp = projectile.Calamity(); + if (cgp.canSupercrit) + { + int critOver100 = 0; + if (projectile.melee) + critOver100 = player.meleeCrit - 100; + else if (projectile.ranged) + critOver100 = player.rangedCrit - 100; + else if (projectile.magic) + critOver100 = player.magicCrit - 100; + else if (projectile.thrown) // Also covers rogue + critOver100 = player.thrownCrit - 100; + + // Supercrits can "supercrit" over and over for each extra 100% critical strike chance. + // For example if you have 716% critical strike chance, you are guaranteed +700% damage and then have a 16% chance for +800% damage instead. + if (critOver100 > 0) + { + int supercritLayers = critOver100 / 100; + int lastLayerCritChance = critOver100 - supercritLayers; + // Roll for the remaining crit chance + if (Main.rand.Next(100) <= lastLayerCritChance) + ++supercritLayers; + + // Apply supercrit damage. This projectile is already guaranteed to be a crit, which will double its damage at the end. + // As such, only 50% damage is added per supercrit layer here. + damage = (int)(damage * (1f + 0.5f * supercritLayers)); + } + } + int bullseyeType = ProjectileType(); Projectile bullseye = null; for (int i = 0; i < Main.maxProjectiles; i++) @@ -4781,20 +4817,36 @@ namespace CalamityMod.NPCs Lighting.AddLight(npc.position, 0.025f, 0f, 0f); } - if (pShred > 0) + // Enemies suffering from Soma Prime's Shred spray blood like Violence + if (somaShredStacks > 0 && Main.netMode != NetmodeID.Server) { - if (Main.rand.Next(5) < 4) - { - int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, 5, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.5f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 1.1f; - Main.dust[dust].velocity.Y += 0.25f; - if (Main.rand.NextBool(2)) - { - Main.dust[dust].noGravity = false; - Main.dust[dust].scale *= 0.5f; - } - } + // The amount of blood particles spawned by Soma Prime's Shred scales loosely with the number of stacks. + float roughBloodCount = (float)Math.Sqrt(0.8f * somaShredStacks); + int exactBloodCount = (int)roughBloodCount; + // Chance for the final blood particle + if (Main.rand.NextFloat() < roughBloodCount - exactBloodCount) + ++exactBloodCount; + + // Velocity of the spurting blood also slightly increases with stacks. + float velStackMult = 1f + (float)Math.Log(somaShredStacks); + + // Code copied from Violence. + for (int i = 0; i < exactBloodCount; ++i) + { + int bloodLifetime = Main.rand.Next(22, 36); + float bloodScale = Main.rand.NextFloat(0.6f, 0.8f); + Color bloodColor = Color.Lerp(Color.Red, Color.DarkRed, Main.rand.NextFloat()); + bloodColor = Color.Lerp(bloodColor, new Color(51, 22, 94), Main.rand.NextFloat(0.65f)); + + if (Main.rand.NextBool(20)) + bloodScale *= 2f; + + float randomSpeedMultiplier = Main.rand.NextFloat(1.25f, 2.25f); + Vector2 bloodVelocity = Main.rand.NextVector2Unit() * velStackMult * randomSpeedMultiplier; + bloodVelocity.Y -= 5f; + BloodParticle blood = new BloodParticle(npc.Center, bloodVelocity, bloodLifetime, bloodScale, bloodColor); + GeneralParticleHandler.SpawnParticle(blood); + } } if (hFlames > 0 || banishingFire > 0) @@ -5029,7 +5081,7 @@ namespace CalamityMod.NPCs { if (CalamityConfig.Instance.DebuffDisplay && (npc.boss || BossHealthBarManager.MinibossHPBarList.Contains(npc.type) || BossHealthBarManager.OneToMany.ContainsKey(npc.type) || CalamityLists.needsDebuffIconDisplayList.Contains(npc.type))) { - List buffTextureList = new List(); + IList buffTextureList = new List(); // Damage over time debuffs if (aFlames > 0) @@ -5054,7 +5106,7 @@ namespace CalamityMod.NPCs buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/Plague")); if (shellfishVore > 0) buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/ShellfishEating")); - if (pShred > 0) + if (somaShredStacks > 0) buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/Shred")); if (clamDebuff > 0) buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/SnapClamDebuff")); @@ -5160,8 +5212,8 @@ namespace CalamityMod.NPCs // Max amount of buffs per row int buffDisplayRowLimit = 5; - /* The maximum length of a single row in the buff display - * Limited to 80 units, because every buff drawn here is half the size of a normal buff, 16 x 16, 16 * 5 = 80 units*/ + // The maximum length of a single row in the buff display + // Limited to 80 units, because every buff drawn here is half the size of a normal buff, 16 x 16, 16 * 5 = 80 units float drawPosX = totalLength >= 80f ? 40f : (float)(totalLength / 2); // The height of a single frame of the npc @@ -5189,7 +5241,10 @@ namespace CalamityMod.NPCs float additionalYOffset = 14f * (float)Math.Floor(i * 0.2); // Draw the display - spriteBatch.Draw(buffTextureList.ElementAt(i), drawPos - new Vector2(drawPosX, drawPosY + additionalYOffset), null, Color.White, 0f, default, 0.5f, SpriteEffects.None, 0f); + var tex = buffTextureList.ElementAt(i); + spriteBatch.Draw(tex, drawPos - new Vector2(drawPosX, drawPosY + additionalYOffset), null, Color.White, 0f, default, 0.5f, SpriteEffects.None, 0f); + + // TODO -- Show number of Shred stacks (how?) } } } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 8aeea1abe9..617b1776c8 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -4,7 +4,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.NPCs; -using CalamityMod.NPCs.NormalNPCs; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Melee.Yoyos; @@ -58,6 +57,16 @@ namespace CalamityMod.Projectiles public int spawnedPlayerMinionProjectileDamageValue = 0; public int defDamage = 0; + // Enables "supercrits". When crit is over 100%, projectiles with this bool enabled can "supercrit". + // For every 100% critical strike chance over 100%, "supercrit" projectiles do a guaranteed +100% damage. + // They then take the remainder (e.g. the remaining 16%) and roll against that for a final +100% (like normal crits). + // For example if you have 716% critical strike chance, you are guaranteed +700% damage and then have a 16% chance for +800% damage instead. + // These are currently only enabled for Soma Prime, but any bullet fired from that gun can supercrit. + public bool canSupercrit = false; + + // If true, this projectile can apply the infinitely-stacking Shred debuff iconic to Soma Prime. + public bool appliesSomaShred = false; + // Amount of extra updates that are set in SetDefaults. public int defExtraUpdates = -1; diff --git a/Projectiles/Ranged/SlashRound.cs b/Projectiles/Ranged/SlashRound.cs deleted file mode 100644 index e10e810451..0000000000 --- a/Projectiles/Ranged/SlashRound.cs +++ /dev/null @@ -1,39 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Ranged -{ - public class SlashRound : ModProjectile - { - public override string Texture => "CalamityMod/Projectiles/Ranged/AMRShot"; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Round"); - } - - public override void SetDefaults() - { - projectile.width = 4; - projectile.height = 4; - projectile.light = 0.5f; - projectile.alpha = 255; - projectile.extraUpdates = 7; - projectile.scale = 1.18f; - projectile.friendly = true; - projectile.ranged = true; - projectile.ignoreWater = true; - projectile.aiStyle = 1; - aiType = ProjectileID.BulletHighVelocity; - projectile.penetrate = 1; - projectile.timeLeft = 600; - projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 180); - } - } -} From f8b08b5061d69f96b0ae2b189b398cd16317327f Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Tue, 8 Feb 2022 22:36:13 -0600 Subject: [PATCH 5/7] Added secondary blood particles --- NPCs/CalamityGlobalNPC.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index d85581dac6..af7d99dd0a 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -4847,7 +4847,16 @@ namespace CalamityMod.NPCs BloodParticle blood = new BloodParticle(npc.Center, bloodVelocity, bloodLifetime, bloodScale, bloodColor); GeneralParticleHandler.SpawnParticle(blood); } - } + for (int i = 0; i < exactBloodCount / 3; ++i) + { + float bloodScale = Main.rand.NextFloat(0.2f, 0.33f); + Color bloodColor = Color.Lerp(Color.Red, Color.DarkRed, Main.rand.NextFloat(0.5f, 1f)); + Vector2 bloodVelocity = Main.rand.NextVector2Unit() * velStackMult * Main.rand.NextFloat(1f, 2f); + bloodVelocity.Y -= 2.3f; + BloodParticle2 blood = new BloodParticle2(npc.Center, bloodVelocity, 20, bloodScale, bloodColor); + GeneralParticleHandler.SpawnParticle(blood); + } + } if (hFlames > 0 || banishingFire > 0) { From fc0a5d05aabd2ba500e82d6e0b836a6fd941331a Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Tue, 8 Feb 2022 22:44:47 -0600 Subject: [PATCH 6/7] Main.myPlayer projectile spawn check --- Buffs/DamageOverTime/Shred.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Buffs/DamageOverTime/Shred.cs b/Buffs/DamageOverTime/Shred.cs index a8babd6dc4..a631ae11cb 100644 --- a/Buffs/DamageOverTime/Shred.cs +++ b/Buffs/DamageOverTime/Shred.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Buffs.DamageOverTime } // If a valid player applied this debuff, then let it deal damage. - if (cgn.somaShredApplicator >= 0 && cgn.somaShredApplicator < Main.maxPlayers) + if (cgn.somaShredApplicator >= 0 && cgn.somaShredApplicator < Main.maxPlayers && Main.myPlayer == cgn.somaShredApplicator) { Player applicator = Main.player[cgn.somaShredApplicator]; From 81daa5c1c227634616036a28269f795e82f7b5ee Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Wed, 9 Feb 2022 01:33:41 -0500 Subject: [PATCH 7/7] Re-added Soma Prime unique rarity by dedicatee request --- Items/CalamityGlobalItemTooltip.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index ceca3c84bc..14c29d4663 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -116,6 +116,8 @@ namespace CalamityMod.Items nameLine.overrideColor = CalamityUtils.ColorSwap(new Color(204, 86, 80), new Color(237, 69, 141), 4f); if (item.type == ModContent.ItemType()) nameLine.overrideColor = new Color(129, 29, 149); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = CalamityUtils.ColorSwap(new Color(255, 255, 255), new Color(0xD1, 0xCC, 0x6F), 4f); if (item.type == ModContent.ItemType()) nameLine.overrideColor = new Color(220, 20, 60); if (item.type == ModContent.ItemType())