This commit is contained in:
Xyk committed 2026-02-14 16:52:45 -08:00
1 parent fefcf58aac
commit e00b40cd99
17 files changed
+276 -84

No files matched your search

+105
View File
@@ -0,0 +1,105 @@
using System;
using CalamityMod.DataStructures;
using CalamityMod.Dusts;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Utilities.Terraria.Utilities;
namespace CalamityMod.Buffs.DamageOverTime
{
public class Bane : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 90,
NPCLifeRegenMethod = BaneNPCLifeRegen
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public static void BaneNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage)
{
var cnpc = npc.Calamity();
bool effected = (cnpc.abaddonEffected || cnpc.voidOfExtinctionEffected);
bool strong = cnpc.voidOfExtinctionEffected;
int baseDoTValue = (int)debuffData.EnemyLostRegen;
if (effected && cnpc.checkPlayerBaneDamage)
{
for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++)
{
Player player = Main.player[playerIndex];
if (player.active)
{
float improvedDamage = baseDoTValue * player.Calamity().abaddonDebuffDamage;
if (improvedDamage > baseDoTValue && (player.Calamity().abaddon || player.Calamity().voidOfExtinction))
{
baseDoTValue = (int)improvedDamage;
}
}
}
cnpc.checkPlayerBaneDamage = false;
}
cnpc.ApplyDPSDebuff(baseDoTValue, baseDoTValue / 20, ref npc.lifeRegen, ref damage);
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().bane = true;
}
public override void Update(NPC npc, ref int buffIndex)
{
npc.Calamity().bane = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo, bool hasDebuffResistance = false)
{
// This shouldn't be on players, like ever
Player Player = drawInfo.drawPlayer;
Vector3 light = Color.Lavender.ToVector3();
Lighting.AddLight(Player.Center, light * 2);
if (Main.rand.NextBool(6))
{
Dust dust = Dust.NewDustPerfect(Player.Calamity().RandomDebuffVisualSpot, ModContent.DustType<LightDust>(), new Vector2(0, Main.rand.NextFloat(-3f, -5f)) + Player.velocity, 0, default, hasDebuffResistance ? 1.1f : 1.6f);
dust.noGravity = true;
dust.color = Color.PaleTurquoise;
}
}
internal static void DrawEffects(NPC npc, ref Color drawColor)
{
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomRingAngled").Value;
Texture2D center = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
Vector2 drawPosition = npc.Center - Main.screenPosition;
Color color = Color.PaleTurquoise;
Color color2 = Color.Khaki;
float maxSizeMult = 10f;
float widthMult = MathF.Pow(Utils.Remap(npc.width, 10, 500, 1f, maxSizeMult), 0.8f);
float sine = (float)Math.Sin((Main.GlobalTimeWrappedHourly * 9.0f) / MathHelper.Pi);
float sine2 = (float)Math.Sin((Main.GlobalTimeWrappedHourly * 11.0f) / MathHelper.Pi);
float randSize = Main.rand.NextFloat(0.82f, 1.08f);
Main.EntitySpriteDraw(bloom, drawPosition + (Vector2.UnitY * npc.height / 2f) + Vector2.UnitY * ((1 - sine) * 2.3f), null, color with { A = 0 }, 0, bloom.Size() / 2, new Vector2((sine * 0.09f + 1.2f) * widthMult, 0.9f) * 0.18f * MathF.Pow(randSize, 0.3f), SpriteEffects.None);
Main.EntitySpriteDraw(center, drawPosition + (Vector2.UnitY * npc.height / 2f) + Vector2.UnitY * ((1 - sine2) * 3.3f), null, Color.Lerp(color, color2, 0.7f) with { A = 0 }, 0, center.Size() / 2, new Vector2((sine2 * 0.09f + 1.2f) * widthMult, 0.6f) * 0.18f * randSize, SpriteEffects.None);
if (Main.rand.NextBool(9))
{
bool start = Main.rand.NextBool();
Particle baneRunes = new BaneParticle(npc.Center + Main.rand.NextVector2Circular(18 * widthMult, 8) + (Vector2.UnitY * npc.height / 3f) + Vector2.UnitY * ((1 - sine) * 2.3f), Vector2.UnitY * Main.rand.NextFloat(-2.5f, -4.5f) * widthMult, false, 30, 1f, start ? color : color2, start ? color2 : color, Vector2.One, true, Main.rand.NextBool(3) ? Main.rand.NextFloat(-0.2f, 0.2f) : 0, 0.85f, MathHelper.PiOver2 * Main.rand.Next(4 + 1));
GeneralParticleHandler.SpawnParticle(baneRunes);
}
Lighting.AddLight(npc.Center, color.ToVector3() * 0.6f);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

+2 -27
View File
@@ -12,9 +12,8 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 60, // This can be adjusted by a few sources
HeatDebuffScaling = 1,
NPCLifeRegenMethod = BrimstoneFlamesNPCLifeRegen
EnemyLostRegen = 60,
HeatDebuffScaling = 1
};
public override void SetStaticDefaults()
{
@@ -24,30 +23,6 @@ namespace CalamityMod.Buffs.DamageOverTime
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public static void BrimstoneFlamesNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage)
{
var cnpc = npc.Calamity();
bool effected = (cnpc.abaddonEffected || cnpc.voidOfExtinctionEffected);
bool strong = cnpc.voidOfExtinctionEffected;
int baseBrimstoneFlamesDoTValue = (int)debuffData.EnemyLostRegen;
if (effected && cnpc.checkPlayerBflameDamage)
{
for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++)
{
Player player = Main.player[playerIndex];
if (player.active)
{
float improvedDamage = baseBrimstoneFlamesDoTValue * player.Calamity().abaddonFlameDamage;
if (improvedDamage > baseBrimstoneFlamesDoTValue && (player.Calamity().abaddon || player.Calamity().voidOfExtinction))
{
baseBrimstoneFlamesDoTValue = (int)improvedDamage;
}
}
}
cnpc.checkPlayerBflameDamage = false;
}
cnpc.ApplyDPSDebuff(baseBrimstoneFlamesDoTValue, baseBrimstoneFlamesDoTValue / 20, ref npc.lifeRegen, ref damage);
}
public override void Update(Player player, ref int buffIndex)
{
+4 -3
View File
@@ -960,7 +960,7 @@ namespace CalamityMod.CalPlayer
public bool abaddon = false;
public int abaddonCooldown = 0;
public bool abaddonEffectVisual = false;
public float abaddonFlameDamage = 0;
public float abaddonDebuffDamage = 0;
public bool aeroStone = false;
public bool lifejelly = false;
@@ -1362,6 +1362,7 @@ namespace CalamityMod.CalPlayer
public bool armorCrunch = false;
public bool crumble = false;
public bool irradiated = false;
public bool bane = false;
public bool brimstoneFlames = false;
public bool weakBrimstoneFlames = false;
public bool demonicFlames = false;
@@ -4987,10 +4988,10 @@ namespace CalamityMod.CalPlayer
if (Player.Calamity().abaddon || Player.Calamity().voidOfExtinction)
{
Player.Calamity().abaddonFlameDamage = (1 + Player.GetTotalCritChance(Player.GetBestClass()) * 0.01f * (Player.Calamity().voidOfExtinction ? VoidofExtinction.critScaling : Abaddon.critScaling));
Player.Calamity().abaddonDebuffDamage = (1 + Player.GetTotalCritChance(Player.GetBestClass()) * 0.01f * (Player.Calamity().voidOfExtinction ? VoidofExtinction.critScaling : Abaddon.critScaling));
}
else
Player.Calamity().abaddonFlameDamage = 0;
Player.Calamity().abaddonDebuffDamage = 0;
// True melee damage from various vanilla equipment placed here.
+1 -2
View File
@@ -497,8 +497,7 @@ namespace CalamityMod.CalPlayer
if (calamityPlayer.brimstoneFlames && drawInfo.shadow == 0f)
{
bool resistsBrimstoneFlames = (abaddon || voidOfExtinction); // Looks weaker if you have Abaddon or VoE equipped
BrimstoneFlames.DrawEffects(drawInfo, resistsBrimstoneFlames);
BrimstoneFlames.DrawEffects(drawInfo);
}
if (calamityPlayer.brainRot && drawInfo.shadow == 0f)
+1 -1
View File
@@ -115,7 +115,7 @@ namespace CalamityMod.CalPlayer
ApplyDoTDebuff(crushDepth, 18, purity);
ApplyDoTDebuff(astralInfection, 24, infectedJewel || hideOfDeus || purity);
ApplyDoTDebuff(shadowflame, 30, purity);
ApplyDoTDebuff(brimstoneFlames, (int)MathF.Round(30 * ((abaddon || voidOfExtinction) ? (1f - Abaddon.BrimstoneFlamesReduction) : 1f)), purity);
ApplyDoTDebuff(brimstoneFlames, 30, purity);
ApplyDoTDebuff(plague, (int)MathF.Round(30 * (alchFlask ? (1f - AlchemicalDecanter.PlagueReduction) : 1f)), purity);
ApplyDoTDebuff(vHex, 30); // Has other effects
ApplyDoTDebuff(searingLava, 30);
+1 -5
View File
@@ -12,11 +12,8 @@ namespace CalamityMod.Items.Accessories
{
public new string LocalizationCategory => "Items.Accessories";
public static int CritBoost = 8;
public static float BrimstoneFlamesReduction = 0.5f;
public static float critScaling = 2; // How effective crit chance is at increasing debuff damage
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost, BrimstoneFlamesReduction.ToPercent());
public override void SetDefaults()
{
Item.width = 26;
@@ -30,13 +27,12 @@ namespace CalamityMod.Items.Accessories
{
player.Calamity().abaddon = true;
player.Calamity().abaddonEffectVisual = !hideVisual;
player.GetCritChance<GenericDamageClass>() += CritBoost;
}
public override void ModifyTooltips(List<TooltipLine> list)
{
Player player = Main.LocalPlayer;
if (Main.LocalPlayer != null)
list.FindAndReplace("[DAMAGE]", ((int)(BrimstoneFlames.debuffData.EnemyLostRegen / 2 * player.Calamity().abaddonFlameDamage)).ToString());
list.FindAndReplace("[DAMAGE]", ((int)(Bane.debuffData.EnemyLostRegen / 2 * player.Calamity().abaddonDebuffDamage)).ToString());
}
}
}
+3 -7
View File
@@ -13,11 +13,8 @@ namespace CalamityMod.Items.Accessories
{
public new string LocalizationCategory => "Items.Accessories";
public static int CritBoost = 8;
public static float critScaling = 7; // How effective crit chance is at increasing debuff damage
public static float critDamageBoostPerDebuff = 0.02f; // 2% increased crit damage per debuff
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost, Abaddon.BrimstoneFlamesReduction.ToPercent());
public static float critScaling = 6; // How effective crit chance is at increasing debuff damage
public static float critDamageBoostPerDebuff = 0.03f; // 3% increased crit damage per debuff
public override void SetDefaults()
{
Item.width = 26;
@@ -42,13 +39,12 @@ namespace CalamityMod.Items.Accessories
CalamityPlayer modPlayer = player.Calamity();
modPlayer.voidOfExtinction = true;
modPlayer.abaddonEffectVisual = !hideVisual;
player.GetCritChance<GenericDamageClass>() += CritBoost;
}
public override void ModifyTooltips(List<TooltipLine> list)
{
Player player = Main.LocalPlayer;
if (Main.LocalPlayer != null)
list.FindAndReplace("[DAMAGE]", ((int)(BrimstoneFlames.debuffData.EnemyLostRegen / 2 * player.Calamity().abaddonFlameDamage)).ToString());
list.FindAndReplace("[DAMAGE]", ((int)(Bane.debuffData.EnemyLostRegen / 2 * player.Calamity().abaddonDebuffDamage)).ToString());
}
}
}
@@ -1691,3 +1691,8 @@ CnidarianSummonTagBuff: {
DisplayName: Cnidarian Summon Tag Buff
Description: you are not seeing this
}
Bane: {
DisplayName: Bane
Description: Mods.CalamityMod.Buffs.Bane.Description
}
@@ -2,11 +2,9 @@ Abaddon: {
DisplayName: Abaddon
Tooltip:
'''
{$CommonItemTooltip.PercentIncreasedCritChance}
Critical strikes burn enemies with [cbuff:CalamityMod/BrimstoneFlames] that scales off of your critical strike chance
When critically hit, 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] DPS
Critical strikes curse enemies with [cbuff:CalamityMod/Bane] that scales off of your critical strike chance
When critically hit, enemies spread all debuffs they are afflicted with that are weaker than your [cbuff:CalamityMod/Bane] to nearby enemies
Current [cbuff:CalamityMod/Bane] damage: [DAMAGE] DPS
'''
}
@@ -2064,12 +2062,10 @@ VoidofExtinction: {
DisplayName: Void of Extinction
Tooltip:
'''
{$CommonItemTooltip.PercentIncreasedCritChance}
Critical strikes burn enemies with [cbuff:CalamityMod/BrimstoneFlames] that greatly scales off of your critical strike chance
When critically hit, enemies spread all debuffs they are afflicted with that are weaker than your [cbuff:CalamityMod/BrimstoneFlames] to nearby enemies
Critical strikes 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] DPS
Critical strikes curse enemies with [cbuff:CalamityMod/Bane] that greatly scales off of your critical strike chance
When critically hit, enemies spread all debuffs they are afflicted with that are weaker than your [cbuff:CalamityMod/Bane] to nearby enemies
Critical strikes deal an additional 3% damage per debuff on the enemy
Current [cbuff:CalamityMod/Bane] damage: [DAMAGE] DPS
'''
}
+11 -4
View File
@@ -290,6 +290,7 @@ namespace CalamityMod.NPCs
public bool absorberAffliction = false;
public bool irradiated = false;
public double irradiatedContactBoost = 1.5;
public bool bane = false;
public bool brimstoneFlames = false;
public bool demonicFlames = false;
public int demonicFlamesBonusDamage = 0;
@@ -303,7 +304,7 @@ namespace CalamityMod.NPCs
public bool scionsCurioEffected = false;
public bool abaddonEffected = false;
public bool voidOfExtinctionEffected = false;
public bool checkPlayerBflameDamage = false;
public bool checkPlayerBaneDamage = false;
public int warbannerBurnTime = 0; // Determines the rate that the enemy is damaged
public int warbannerBurnTimer = 0; // The duration of the debuff
public int warbannerBurnStacks = 0; // The stacks increase how fast the debuff hits
@@ -570,6 +571,7 @@ namespace CalamityMod.NPCs
myClone.absorberAffliction = absorberAffliction;
myClone.irradiated = irradiated;
myClone.irradiatedContactBoost = irradiatedContactBoost;
myClone.bane = bane;
myClone.brimstoneFlames = brimstoneFlames;
myClone.demonicFlames = demonicFlames;
myClone.demonicFlamesBonusDamage = demonicFlamesBonusDamage;
@@ -583,7 +585,7 @@ namespace CalamityMod.NPCs
myClone.scionsCurioEffected = scionsCurioEffected;
myClone.abaddonEffected = abaddonEffected;
myClone.voidOfExtinctionEffected = voidOfExtinctionEffected;
myClone.checkPlayerBflameDamage = checkPlayerBflameDamage;
myClone.checkPlayerBaneDamage = checkPlayerBaneDamage;
myClone.warbannerBurnTime = warbannerBurnTime;
myClone.warbannerBurnTimer = warbannerBurnTimer;
myClone.warbannerBurnStacks = warbannerBurnStacks;
@@ -777,6 +779,7 @@ namespace CalamityMod.NPCs
irradiated = false;
if (scionsCurioEffected)
irradiatedContactBoost = 2f;
bane = false;
brimstoneFlames = false;
demonicFlames = false;
holyFlames = false;
@@ -3138,8 +3141,8 @@ 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 (!brimstoneFlames && !checkPlayerBflameDamage)
checkPlayerBflameDamage = true;
if (!bane && !checkPlayerBaneDamage)
checkPlayerBaneDamage = true;
if (demonicFlames)
demonicFlamesClearTimer = 0;
else
@@ -4676,6 +4679,9 @@ namespace CalamityMod.NPCs
if (astralInfection)
AstralInfectionDebuff.DrawEffects(npc, ref drawColor);
if (bane)
Bane.DrawEffects(npc, ref drawColor);
// Brimstone Flames and Demonshade Enrage set bonus share the same visual effects
// TODO -- change this when Demonshade is reworked
if (brimstoneFlames || npc.HasBuff<Enraged>())
@@ -4943,6 +4949,7 @@ namespace CalamityMod.NPCs
// All Calamity DoTs in alphabetical order
("CalamityMod/Buffs/DamageOverTime/AstralInfectionDebuff", NPC => NPC.Calamity().astralInfection),
("CalamityMod/Buffs/DamageOverTime/AuricRebuke", NPC => NPC.Calamity().auricRebuke),
("CalamityMod/Buffs/DamageOverTime/Bane", NPC => NPC.Calamity().bane),
("CalamityMod/Buffs/DamageOverTime/BanishingFire", NPC => NPC.Calamity().banishingFire),
("CalamityMod/Buffs/DamageOverTime/BrainRot", NPC => NPC.Calamity().brainRot),
("CalamityMod/Buffs/DamageOverTime/BrimstoneFlames", NPC => NPC.Calamity().brimstoneFlames),
+114
View File
@@ -0,0 +1,114 @@
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Particles
{
public class BaneParticle : Particle
{
public override string Texture => "CalamityMod/Particles/BaneParticle";
public Color InitialColor;
public Color EndColor;
public bool AffectedByGravity;
public bool FadeIn = false;
public float FadeInScale = 0f;
public string NewTexture;
public float ActiveRotation;
public float AddedRotation = 0;
public float SpeedReduction = 0.95f;
public float ExtraRotation = 0;
public Vector2 Stretch = Vector2.One;
public float ShrinkSpeed = 0;
public bool AltVisual = false;
public override bool UseAdditiveBlend => AltVisual;
public override bool SetLifetime => true;
public override bool UseCustomDraw => true;
public override int FrameVariants => 5;
public BaneParticle(Vector2 relativePosition, Vector2 velocity, bool affectedByGravity, int lifetime, float scale, Color color, Color colorEnd, Vector2 stretch, bool useAddativeBlend = false, float activeRotation = 0, float speedReduction = 0.95f, float extraRotation = 0, bool fadeIn = false, bool affectedByLight = true, float shrinkSpeed = 0)
{
Position = relativePosition;
Velocity = velocity;
ActiveRotation = activeRotation;
AffectedByGravity = affectedByGravity;
AffectedByLight = affectedByLight;
Scale = scale;
Stretch = stretch;
FadeInScale = scale;
Lifetime = lifetime;
Color = InitialColor = color;
EndColor = colorEnd;
ShrinkSpeed = shrinkSpeed;
SpeedReduction = speedReduction;
ExtraRotation = extraRotation;
AltVisual = useAddativeBlend;
FadeIn = fadeIn;
if (FadeIn)
Scale = 0f;
Variant = Main.rand.Next(FrameVariants);
}
public override void Update()
{
if (!FadeIn)
{
Scale *= 0.95f;
InitialColor = Color.Lerp(InitialColor, EndColor, (float)Math.Pow(LifetimeCompletion, 3D));
Color = Color.Lerp(InitialColor, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D));
}
else
{
if ((float)Time / (float)Lifetime < 0.5f)
{
Scale = MathHelper.Lerp(Scale, FadeInScale, 0.2f);
}
else
{
Scale = MathHelper.Lerp(Scale, FadeInScale, -0.21f);
}
}
Velocity *= SpeedReduction;
if (Velocity.Length() < 12f && AffectedByGravity)
{
Velocity.X *= 0.94f;
Velocity.Y += 0.25f;
}
float velRot = ActiveRotation == 0 ? (Velocity.ToRotation() + MathHelper.PiOver2) : ActiveRotation;
Rotation = velRot + AddedRotation;
AddedRotation += ActiveRotation;
ActiveRotation *= 0.975f;
Stretch.X *= (1 - 0.2f * ShrinkSpeed);
Stretch.Y *= (1 + 0.2f * ShrinkSpeed);
}
public override void CustomDraw(SpriteBatch spriteBatch)
{
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Particles/BaneParticleGlow").Value;
int frameWidth = 18;
int frameHeight = 18;
int frameSpacing = frameHeight + 2;
Rectangle frame = new Rectangle(0, frameSpacing * Variant, frameWidth, frameHeight);
Vector2 scale = Stretch * Scale;
Color col = Color;
if (AffectedByLight)
{
col = Lighting.GetColor((Position / 16).ToPoint()).MultiplyRGB(Color);
}
spriteBatch.Draw(texture, Position - Main.screenPosition, frame, col, Rotation + ExtraRotation, frame.Size() * 0.5f, scale, 0, 0f);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

+20 -22
View File
@@ -2,17 +2,12 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.CalPlayer;
using CalamityMod.DataStructures;
using CalamityMod.Dusts;
using CalamityMod.Particles;
using CalamityMod.Systems.Collections;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using MonoMod.Core.Platforms;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Typeless
@@ -25,8 +20,9 @@ namespace CalamityMod.Projectiles.Typeless
public List<int> listNPCs = new List<int>();
public NPC lastNPC;
public int minCooldown = 48;
public Color startingColor = Color.PaleTurquoise;
public Color mainColor = Color.White;
public Color subColor = Color.White;
public Color subColor = Color.PaleTurquoise; // Once static, set to staring color
public Color extraColor = Color.White;
public ref float spreadCount => ref Projectile.ai[2];
public override void SetDefaults()
@@ -55,9 +51,12 @@ namespace CalamityMod.Projectiles.Typeless
Color color1 = Color.Crimson;
Color color2 = Color.OrangeRed;
Color color3 = Color.Red;
int debuffTime = (strong ? 120 : 90);
int debuffTime = (strong ? 180 : 120);
int startDir = Main.rand.NextBool() ? 1 : -1;
// Initial infliction lasts longer, hopefully reduces the power imbalance between this accessory with fast weapons vs slow weapons
npc.AddBuff(ModContent.BuffType<Bane>(), debuffTime * 2);
float distanceFromCenter = areaOfEffect;
NPC targeted = null;
// Get closest valid target
@@ -80,9 +79,7 @@ namespace CalamityMod.Projectiles.Typeless
targeted.Calamity().voidOfExtinctionEffected = npc.Calamity().voidOfExtinctionEffected;
targeted.Calamity().abaddonEffected = npc.Calamity().abaddonEffected;
//npc.AddBuff(ModContent.BuffType<BrimstoneFlames>(), debuffTime);
float bestDamage = Owner.Calamity().abaddonFlameDamage;
float bestDamage = Owner.Calamity().abaddonDebuffDamage;
int heat = 0;
Color heatClr = Color.OrangeRed;
int sick = 0;
@@ -95,22 +92,24 @@ namespace CalamityMod.Projectiles.Typeless
Color waterClr = Color.DarkTurquoise;
// Find all the debuffs on the enemy
int debuffNum = 0;
for (int index = 0; index < npc.buffType.Length; index++)
{
int type = npc.buffType[index];
var debuffData = BuffDatasets.DebuffDataset[type];
// 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);
// Calculate the Bane damage to see if the debuffs can be transfered
int bDamage = Math.Max((int)(Bane.debuffData.EnemyLostRegen * bestDamage), (int)Bane.debuffData.EnemyLostRegen);
if (CalamityBuffSets.IsDebuff[type])
{
if (debuffData == null || debuffData.EnemyLostRegen <= bFlamesDamage)
if (debuffData == null || debuffData.EnemyLostRegen <= bDamage)
{
debuffNum++;
targeted.AddBuff(type, debuffTime);
float timeMult = debuffData == null ? 1 : Utils.Remap(debuffData.EnemyLostRegen, 0, bDamage, 5, 1);
targeted.AddBuff(type, (int)(debuffTime * timeMult));
}
if (debuffData != null && debuffData != BrimstoneFlames.debuffData)
if (debuffData != null)
{
if (debuffData.HeatDebuffScaling > 0) { mainColor = Color.Lerp(mainColor, heatClr, 0.65f); heat++; }
if (debuffData.SicknessDebuffScaling > 0) { mainColor = Color.Lerp(mainColor, sickClr, 0.65f); sick++; }
@@ -121,7 +120,7 @@ namespace CalamityMod.Projectiles.Typeless
}
// Edge case fixes for Shred and Demonic Flames
// Not ideal but not sure how else to do it
if (npc.Calamity().somaShredStacks > 0 && Shred.BaseDamage <= bFlamesDamage)
if (npc.Calamity().somaShredStacks > 0 && Shred.BaseDamage <= bDamage)
targeted.AddBuff(ModContent.BuffType<Shred>(), debuffTime);
int demonicFlames = ModContent.GetModBuff(ModContent.BuffType<DemonicFlames>()).Type;
if (npc.HasBuff(demonicFlames))
@@ -138,11 +137,11 @@ namespace CalamityMod.Projectiles.Typeless
if (highest != 0)
{
// Ideally these lines would run in a random order, so that fire isn't prioritsed as an extra color, but I don't know how to do that!
if (heat == highest && extraColor == Color.White) { if (subColor != Color.White) { extraColor = heatClr; } else { subColor = heatClr; } }
if (sick == highest && extraColor == Color.White) { if (subColor != Color.White) { extraColor = sickClr; } else { subColor = sickClr; } }
if (cold == highest && extraColor == Color.White) { if (subColor != Color.White) { extraColor = coldClr; } else { subColor = coldClr; } }
if (shock == highest && extraColor == Color.White) { if (subColor != Color.White) { extraColor = shockClr; } else { subColor = shockClr; } }
if (water == highest && extraColor == Color.White) { if (subColor != Color.White) { extraColor = waterClr; } else { subColor = waterClr; } }
if (heat == highest && extraColor == Color.White) { if (subColor != startingColor) { extraColor = heatClr; } else { subColor = heatClr; } }
if (sick == highest && extraColor == Color.White) { if (subColor != startingColor) { extraColor = sickClr; } else { subColor = sickClr; } }
if (cold == highest && extraColor == Color.White) { if (subColor != startingColor) { extraColor = coldClr; } else { subColor = coldClr; } }
if (shock == highest && extraColor == Color.White) { if (subColor != startingColor) { extraColor = shockClr; } else { subColor = shockClr; } }
if (water == highest && extraColor == Color.White) { if (subColor != startingColor) { extraColor = waterClr; } else { subColor = waterClr; } }
}
VisualEffects(npc, targeted, startDir, 1 + (best.Sum() * 0.12f));
@@ -157,7 +156,6 @@ namespace CalamityMod.Projectiles.Typeless
return;
}
//npc.AddBuff(ModContent.BuffType<BrimstoneFlames>(), debuffTime);
Color colorAgain = Main.rand.NextBool() ? color2 : color1;
Particle spark2 = new CustomSpark(npc.Center, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 18, 0.55f, colorAgain * (Owner.Calamity().abaddonEffectVisual ? 1 : 0.3f), Vector2.One, true, true, glowOpacity: 0.85f);
GeneralParticleHandler.SpawnParticle(spark2);
+2 -2
View File
@@ -59,7 +59,7 @@ namespace CalamityMod.Systems.Collections
/// </summary>
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.Venom, BuffID.Blackout, BuffID.Electrified, BuffID.Rabies, BuffID.Webbed, BuffID.Stoned, BuffID.Dazed, BuffID.VortexDebuff, BuffID.WitheredArmor, BuffID.WitheredWeapon, BuffID.ShadowFlame,
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>(),
@@ -67,7 +67,7 @@ namespace CalamityMod.Systems.Collections
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<DemonicFlames>(), BuffType<Shred>());
BuffType<DemonicFlames>(), BuffType<Bane>(), BuffType<Shred>());
/// <summary>
/// If <see langword="true"/> for a buff type, then that buff is a whip tag buff on the player.<br/>