Finished and Polished

Fixed many issues and made Demon Flames work again
This commit is contained in:
Xyk committed 2026-01-06 18:17:54 -08:00
1 parent a581506930
commit a9b122b11b
9 files changed
+64 -34

No files matched your search

+4 -3
View File
@@ -16,11 +16,11 @@ namespace CalamityMod.Buffs.DamageOverTime
{
EnemyLostRegen = 60, //Unused in the method, this is the amount of DoT from Forbidden Oathblade demon flames
HeatDebuffScaling = 1, //Unused in the method, but kept so other things can know this is a heat debuff
NPCLifeRegenMethod = DemonFlamesNPCLifeRegen
NPCLifeRegenMethod = DemonicFlamesNPCLifeRegen
};
public static void DemonFlamesNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage)
public static void DemonicFlamesNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage)
{
int baseDemonicFlamesDoTValue = (int)Math.Max(npc.Calamity().ActiveHeatDebuffMultiplier.ApplyTo(npc.Calamity().demonicFlamesBonusDamage), npc.Calamity().demonicFlamesBonusDamage);
int baseDemonicFlamesDoTValue = (int)Math.Max(Math.Max(npc.Calamity().ActiveHeatDebuffMultiplier.ApplyTo(npc.Calamity().demonicFlamesBonusDamage), npc.Calamity().demonicFlamesBonusDamage), (int)debuffData.EnemyLostRegen);
npc.Calamity().ApplyDPSDebuff(baseDemonicFlamesDoTValue, baseDemonicFlamesDoTValue / 15, ref npc.lifeRegen, ref damage);
}
public override void SetStaticDefaults()
@@ -29,6 +29,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+5 -1
View File
@@ -1,4 +1,5 @@
using System;
using CalamityMod.DataStructures;
using CalamityMod.NPCs;
using CalamityMod.Particles;
using CalamityMod.Projectiles;
@@ -18,7 +19,10 @@ namespace CalamityMod.Buffs.DamageOverTime
// This deals 600 DPS per stack, is boosted by ranged stats and can supercrit.
internal static int BaseDamage = 120;
internal static int FramesPerDamageTick = 12;
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = BaseDamage
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+35 -17
View File
@@ -762,25 +762,28 @@ namespace CalamityMod.CalPlayer
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
NPC npc = target;
if ((target.Calamity().abaddonEffected || target.Calamity().voidOfExtinctionEffected) && hit.Crit && abaddonCooldown == 0)
if ((npc.Calamity().abaddonEffected || npc.Calamity().voidOfExtinctionEffected) && hit.Crit && abaddonCooldown == 0)
{
bool strong = target.Calamity().voidOfExtinctionEffected;
abaddonCooldown = 60;
float areaOfEffect = (strong ? 1000 : 500);
bool strong = npc.Calamity().voidOfExtinctionEffected;
float areaOfEffect = (strong ? 1200 : 600);
if (Main.netMode != NetmodeID.MultiplayerClient)
{
Color color1 = Color.Crimson;
Color color2 = Color.OrangeRed;
int debuffTime = (strong ? 180 : 90);
int targetNum = 0;
int maxTargetNum = strong ? 12 : 8;
int maxTargetNum = strong ? 8 : 5;
int startDir = Main.rand.NextBool() ? 1 : -1;
for (int r = 0; r < Main.maxNPCs; r++)
{
NPC targeted = Main.npc[r];
if (targeted != null && targeted.CanBeChasedBy() && Vector2.Distance(targeted.Center, npc.Center) <= areaOfEffect && targetNum < maxTargetNum)
if (targeted != null && targeted != npc && targeted.CanBeChasedBy() && Vector2.Distance(targeted.Center, npc.Center) <= areaOfEffect && targetNum < maxTargetNum)
{
Vector2 start = npc.Center;
targeted.Calamity().voidOfExtinctionEffected = npc.Calamity().voidOfExtinctionEffected;
targeted.Calamity().abaddonEffected = npc.Calamity().abaddonEffected;
Vector2 start = npc.Center + Main.rand.NextVector2Circular(npc.width / 2, npc.height / 2);
Vector2 end = targeted.Center;
Color color = Main.rand.NextBool() ? color2 : color1;
@@ -808,10 +811,10 @@ namespace CalamityMod.CalPlayer
if (dustDivisor < 2)
dustDivisor = 2;
Vector2 dustLineStart = targeted.Center;
Vector2 dustLineEnd = npc.Center;
Vector2 dustLineStart = start;
Vector2 dustLineEnd = end;
Vector2 currentDustPos = default;
Vector2 dustVel = npc.Center.DirectionTo(targeted.Center);
Vector2 dustVel = start.DirectionTo(end);
int startingPoint = Main.rand.Next(0, 400 + 1);
Vector2 lastDustPos = default;
for (int i = 0; i < maxDusts; i++)
@@ -844,9 +847,7 @@ namespace CalamityMod.CalPlayer
u++;
}
int debuffTime = (strong ? 180 : 90);
npc.AddBuff(ModContent.BuffType<BrimstoneFlames>(), debuffTime);
float bestDamage = 0;
// Find all the debuffs on the enemy
@@ -854,7 +855,11 @@ namespace CalamityMod.CalPlayer
{
int type = npc.buffType[index];
var debuffData = BuffDatasets.DebuffDataset[type];
if (debuffData != null)
// Calculate the brimstone flames damage to see if the debuffs can be transfered
int bFlamesDamage = Math.Max((int)(BrimstoneFlames.debuffData.EnemyLostRegen * bestDamage), (int)BrimstoneFlames.debuffData.EnemyLostRegen);
if (CalamityBuffSets.IsDebuff[type])
{
// Find the player who has the accessory
for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++)
@@ -866,16 +871,29 @@ namespace CalamityMod.CalPlayer
bestDamage = player.Calamity().abaddonFlameDamage;
}
}
// Calculate the brimstone flames damage to see if the debuffs can be transfered
int bFlamesDamage = Math.Max((int)(60 * bestDamage), 60);
if (debuffData.EnemyLostRegen <= bFlamesDamage)
if (debuffData == null || debuffData.EnemyLostRegen <= bFlamesDamage)
targeted.AddBuff(type, debuffTime);
}
// Edge case fixes for Shred and Demonic Flames
if (npc.Calamity().somaShredStacks > 0 && Shred.BaseDamage <= bFlamesDamage)
targeted.AddBuff(ModContent.BuffType<Shred>(), debuffTime);
int demonicFlames = ModContent.GetModBuff(ModContent.BuffType<DemonicFlames>()).Type;
if (npc.HasBuff(demonicFlames))
targeted.Calamity().demonicFlamesBonusDamage = npc.Calamity().demonicFlamesBonusDamage;
}
targetNum++;
}
}
if (targetNum == 0)
{
npc.AddBuff(ModContent.BuffType<BrimstoneFlames>(), debuffTime);
Color color = Main.rand.NextBool() ? color2 : color1;
Particle spark2 = new CustomSpark(npc.Center, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 18, 0.55f, color * (Player.Calamity().abaddonEffectVisual ? 1 : 0.3f), Vector2.One, true, true, glowOpacity: 0.85f);
GeneralParticleHandler.SpawnParticle(spark2);
}
abaddonCooldown = targetNum * 12;
}
}
}
-2
View File
@@ -2237,8 +2237,6 @@ namespace CalamityMod.CalPlayer
raiderSoundCooldown--;
if (astralStarRainCooldown > 0)
astralStarRainCooldown--;
if (AbaddonCooldown > 0)
AbaddonCooldown--;
if (VoidCooldown > 0)
VoidCooldown--;
if (ursaSergeantCooldown > 0)
+1 -1
View File
@@ -36,7 +36,7 @@ namespace CalamityMod.Items.Accessories
{
Player player = Main.LocalPlayer;
if (Main.LocalPlayer != null)
list.FindAndReplace("[DAMAGE]", ((int)(BrimstoneFlames.debuffData.EnemyLostRegen / 2 * player.Calamity().abaddonFlameDamage)).ToString() + " DPS");
list.FindAndReplace("[DAMAGE]", ((int)(BrimstoneFlames.debuffData.EnemyLostRegen / 2 * player.Calamity().abaddonFlameDamage)).ToString());
}
}
}
+2 -2
View File
@@ -13,9 +13,9 @@ namespace CalamityMod.Items.Accessories
{
public new string LocalizationCategory => "Items.Accessories";
public static int CritBoost = 13;
public static int CritBoost = 8;
public static float critScaling = 7; // How effective crit chance is at increasing debuff damage
public static float critDamageBoostPerDebuff = 0.03f; // 3% increased crit damage per debuff
public static float critDamageBoostPerDebuff = 0.02f; // 2% increased crit damage per debuff
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost, Abaddon.BrimstoneFlamesReduction.ToPercent());
public override void SetDefaults()
@@ -4,9 +4,9 @@ Abaddon: {
'''
{$CommonItemTooltip.PercentIncreasedCritChance}
Critical strikes burn enemies with [cbuff:CalamityMod/BrimstoneFlames] that scales off of your crit chance
When crit, enemies spread all debuffs thay are afflicted with that are weaker than your [cbuff:CalamityMod/BrimstoneFlames] to nearby enemies
When crit, enemies spread all debuffs they are afflicted with that are weaker than your [cbuff:CalamityMod/BrimstoneFlames] to nearby enemies
Reduces damage taken from [cbuff:CalamityMod/BrimstoneFlames] by {1}%
Current [cbuff:CalamityMod/BrimstoneFlames] damage: [DAMAGE]
Current [cbuff:CalamityMod/BrimstoneFlames] damage: [DAMAGE] DPS
'''
}
@@ -2064,10 +2064,10 @@ VoidofExtinction: {
'''
{$CommonItemTooltip.PercentIncreasedCritChance}
Critical strikes burn enemies with [cbuff:CalamityMod/BrimstoneFlames] that greatly scales off of your crit chance
When crit, enemies spread all debuffs thay are afflicted with that are weaker than your [cbuff:CalamityMod/BrimstoneFlames] to nearby enemies
When crit, enemies spread all debuffs they are afflicted with that are weaker than your [cbuff:CalamityMod/BrimstoneFlames] to nearby enemies
Crits deal an additional 2% damage per debuff on the enemy
Reduces damage taken from [cbuff:CalamityMod/BrimstoneFlames] by {1}%
Current [cbuff:CalamityMod/BrimstoneFlames] damage: [DAMAGE]
Current [cbuff:CalamityMod/BrimstoneFlames] damage: [DAMAGE] DPS
'''
}
+10 -2
View File
@@ -292,6 +292,7 @@ namespace CalamityMod.NPCs
public bool brimstoneFlames = false;
public bool demonicFlames = false;
public int demonicFlamesBonusDamage = 0;
public int demonicFlamesClearTimer = 0;
public bool holyFlames = false;
public bool plague = false;
public bool armorCrunch = false;
@@ -570,6 +571,7 @@ namespace CalamityMod.NPCs
myClone.brimstoneFlames = brimstoneFlames;
myClone.demonicFlames = demonicFlames;
myClone.demonicFlamesBonusDamage = demonicFlamesBonusDamage;
myClone.demonicFlamesClearTimer = demonicFlamesClearTimer;
myClone.holyFlames = holyFlames;
myClone.plague = plague;
myClone.armorCrunch = armorCrunch;
@@ -773,8 +775,6 @@ namespace CalamityMod.NPCs
if (scionsCurioEffected)
irradiatedContactBoost = 2f;
brimstoneFlames = false;
if (!demonicFlames)
demonicFlamesBonusDamage = 0;
demonicFlames = false;
holyFlames = false;
plague = false;
@@ -3377,6 +3377,14 @@ namespace CalamityMod.NPCs
if (!Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].head))
npc.ai[3] = 0f;
}
if (demonicFlames)
demonicFlamesClearTimer = 0;
else
demonicFlamesClearTimer++;
if (demonicFlamesClearTimer >= 2)
demonicFlamesBonusDamage = 0;
if (warbannerBurnTimer > 0)
warbannerBurnTimer--;
if (warbannerBurnTimer == 0 && warbannerBurnMarked)
+3 -2
View File
@@ -57,13 +57,14 @@ namespace CalamityMod.Systems.Collections
public static bool[] IsDebuff = Factory.CreateBoolSet(BuffID.Poisoned, BuffID.Darkness, BuffID.Cursed, BuffID.OnFire, BuffID.Bleeding, BuffID.Confused, BuffID.Slow, BuffID.Weak,
BuffID.Silenced, BuffID.BrokenArmor, BuffID.CursedInferno, BuffID.Frostburn, BuffID.Chilled, BuffID.Frozen, BuffID.Burning, BuffID.Suffocation, BuffID.Ichor,
BuffID.Venom, BuffID.Blackout, BuffID.Electrified, BuffID.Rabies, BuffID.Webbed, BuffID.Stoned, BuffID.Dazed, BuffID.VortexDebuff, BuffID.WitheredArmor, BuffID.WitheredWeapon,
BuffID.OgreSpit, BuffID.BetsysCurse, BuffType<SulphuricPoisoning>(), BuffType<Shadowflame>(), BuffType<Daybroken>(), BuffType<BrimstoneFlames>(), BuffType<BurningBlood>(),
BuffID.OgreSpit, BuffID.BetsysCurse, BuffID.Wet, BuffID.Slimed, BuffID.OnFire3, BuffID.Frostburn2, BuffType<SulphuricPoisoning>(), BuffType<Shadowflame>(), BuffType<Daybroken>(), BuffType<BrimstoneFlames>(), BuffType<BurningBlood>(),
BuffType<BrainRot>(), BuffType<ElementalMix>(), BuffType<GlacialState>(), BuffType<GodSlayerInferno>(), BuffType<AstralInfectionDebuff>(), BuffType<HolyFlames>(),
BuffType<Irradiated>(), BuffType<Plague>(), BuffType<CrushDepth>(), BuffType<HadopelagicPressure>(), BuffType<RiptideDebuff>(), BuffType<MarkedforDeath>(),
BuffType<HeavyBleeding>(), BuffType<Laceration>(), BuffType<AbsorberAffliction>(), BuffType<ArmorCrunch>(), BuffType<Crumbling>(), BuffType<Vaporfied>(), BuffType<Eutrophication>(),
BuffType<Dragonfire>(), BuffType<VermillionFlux>(), BuffType<AuricRebuke>(), BuffType<StaticDischarge>(), BuffType<Nightwither>(), BuffType<Voidfrost>(),
BuffType<VulnerabilityHex>(), BuffType<MiracleBlight>(), BuffType<WhisperingDeath>(), BuffType<FrozenLungs>(), BuffType<FishAlert>(), BuffType<HolyInferno>(),
BuffType<IcarusFolly>(), BuffType<DoGExtremeGravity>(), BuffType<PopoNoselessBuff>(), BuffType<SearingLava>(), BuffType<WeakBrimstoneFlames>(), BuffType<Withered>(), BuffType<ManaBurn>());
BuffType<IcarusFolly>(), BuffType<DoGExtremeGravity>(), BuffType<PopoNoselessBuff>(), BuffType<SearingLava>(), BuffType<WeakBrimstoneFlames>(), BuffType<Withered>(), BuffType<ManaBurn>(),
BuffType<DemonicFlames>(), BuffType<Shred>());
/// <summary>
/// If <see langword="true"/> for a buff type, then that buff is a whip tag buff on the player.<br/>