Merge branch 'CalamityTeam:1.4.4' into 1.4.4

This commit is contained in:
Habble53 authored and GitHub committed 2026-04-02 08:50:47 +03:00
commit fe337ef1d6
660 files changed
+8888 -4618

No files matched your search

+4 -4
View File
@@ -126,11 +126,11 @@
internal static readonly float LifeStealRecoveryRate_Classic = 0.6f;
internal static readonly float LifeStealRecoveryRate_Expert = 0.5f;
// Nerfs the life steal recovery rate in Classic from 0.6 to 0.2 (36 HP/s to 12 HP/s)
internal static readonly float LifeStealRecoveryRateReduction_Classic = 0.4f;
// Nerfs the life steal recovery rate in Classic from 0.6 to 0.15 (36 HP/s to 9 HP/s)
internal static readonly float LifeStealRecoveryRateReduction_Classic = 0.45f;
// Nerfs the life steal recovery rate in Expert from 0.5 to 0.15 (30 HP/s to 9 HP/s)
internal static readonly float LifeStealRecoveryRateReduction_Expert = 0.35f;
// Nerfs the life steal recovery rate in Expert from 0.5 to 0.1 (30 HP/s to 6 HP/s)
internal static readonly float LifeStealRecoveryRateReduction_Expert = 0.4f;
#endregion
#region Rogue Base Stats
+4 -2
View File
@@ -156,11 +156,13 @@ namespace CalamityMod.Buffs
}
}
if (type == BuffID.Frozen)
{
npc.Calamity().frozen = true;
}
if (type == BuffID.Webbed)
{
npc.Calamity().webbed = true;
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
}
if (type == BuffID.Electrified)
{
+118
View File
@@ -0,0 +1,118 @@
using System;
using CalamityMod.DataStructures;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.DamageOverTime
{
public class Bane : ModBuff
{
public static Color baneColor1 = new Color(217, 115, 0);
public static Color baneColor2 = new Color(0, 232, 146);
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 40,
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.apollyonEffected);
bool strong = cnpc.apollyonEffected;
int baseDoTValue = (int)debuffData.EnemyLostRegen;
if (effected)
{
foreach (var player in Main.ActivePlayers)
{
{
float improvedDamage = baseDoTValue * player.Calamity().playerBaneDebuffDamage;
if (improvedDamage > baseDoTValue && (player.Calamity().abaddon || player.Calamity().apollyon))
{
baseDoTValue = (int)improvedDamage;
}
}
}
}
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)
{
Player player = drawInfo.drawPlayer;
Vector3 light = baneColor1.ToVector3();
Lighting.AddLight(player.Center, light);
float sine = (float)Math.Sin((Main.GlobalTimeWrappedHourly * 9.0f) / MathHelper.Pi);
if (Main.rand.NextBool(20))
{
bool start = !Main.rand.NextBool(4);
Vector2 baneVel = Vector2.UnitY * Main.rand.NextFloat(-0.5f, -1.5f) * (Main.rand.NextBool(5) ? 2 : 1) + player.velocity * 0.35f;
Vector2 banePos = player.Center + Main.rand.NextVector2Circular(3, 8) + (Vector2.UnitY * 14) + Vector2.UnitY * ((1 - sine) * 2.3f);
Particle baneRunes = new BaneParticle(banePos, baneVel, false, 55, 1f, start ? baneColor1 : baneColor2, start ? baneColor2 : baneColor1, Vector2.One, true, Main.rand.NextBool(3) ? Main.rand.NextFloat(-0.2f, 0.2f) : 0, 0.95f, MathHelper.PiOver2 * Main.rand.Next(4 + 1), sineRate: Main.rand.NextFloat(0.2f, 1f), sineIntensity: Main.rand.Next(14, 19 + 1));
GeneralParticleHandler.SpawnParticle(baneRunes);
if (Main.rand.NextBool())
baneRunes.DrawLayer = Enums.GeneralDrawLayer.BeforeNPCs;
}
}
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 = baneColor1;
Color color2 = baneColor2;
float maxSizeMult = 10f;
float widthMult = MathF.Pow(Utils.Remap(npc.width, 10, 500, 1f, maxSizeMult, false), 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);
float clockSine = (float)Math.Sin((float)Math.Pow(Utils.GetLerpValue(0, 110, ((int)(Main.GlobalTimeWrappedHourly * 60) % 120)), 5));
for (int i = 0; i < 2; i++)
{
float sizeMult = (i == 0 ? 1 : 0.8f);
float colorMult = (i == 0 ? 1 : 0.7f);
Main.EntitySpriteDraw(bloom, drawPosition + (Vector2.UnitY * npc.height / 2f) + Vector2.UnitY * ((1 - sine) * 2.3f * MathF.Pow(widthMult, 0.55f)), null, Color.Lerp(color2, Color.White, i * 0.7f) with { A = 0 } * colorMult, 0, bloom.Size() / 2, new Vector2((sine * 0.09f + 1.2f) * widthMult, 0.9f) * 0.18f * MathF.Pow(randSize, 0.3f) * npc.Calamity().baneVisual, SpriteEffects.None);
Main.EntitySpriteDraw(center, drawPosition + (Vector2.UnitY * npc.height / 2f) + Vector2.UnitY * ((1 - sine2) * 3.3f * MathF.Pow(widthMult, 0.55f)), null, Color.Lerp(color, Color.White, i * 0.7f) with { A = 0 } * colorMult, 0, center.Size() / 2, new Vector2((sine2 * 0.09f + 1.2f) * widthMult, 0.6f) * 0.18f * randSize * npc.Calamity().baneVisual, SpriteEffects.None);
}
int chance = (int)(13 + 40 * (1 - npc.Calamity().baneVisual));
if (Main.rand.NextBool(chance))
{
bool start = !Main.rand.NextBool(4);
Vector2 baneVel = Vector2.UnitY * Main.rand.NextFloat(-0.5f, -1.5f) * widthMult * (Main.rand.NextBool(5) ? 2 : 1) + npc.velocity * 0.35f;
Vector2 banePos = npc.Center + Main.rand.NextVector2Circular(3 * widthMult, 8) + (Vector2.UnitY * npc.height / 3f) + Vector2.UnitY * ((1 - sine) * 2.3f);
Particle baneRunes = new BaneParticle(banePos, baneVel, false, 55, 1f * MathF.Pow(widthMult, 0.45f), start ? color : color2, start ? color2 : color, Vector2.One, true, Main.rand.NextBool(3) ? Main.rand.NextFloat(-0.2f, 0.2f) : 0, 0.95f, MathHelper.PiOver2 * Main.rand.Next(4 + 1), sineRate: Main.rand.NextFloat(0.2f, 1f), sineIntensity: Main.rand.Next(14, 19 + 1) * widthMult);
GeneralParticleHandler.SpawnParticle(baneRunes);
if (Main.rand.NextBool())
baneRunes.DrawLayer = Enums.GeneralDrawLayer.BeforeNPCs;
}
Lighting.AddLight(npc.Center, color.ToVector3() * 0.6f);
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

+3 -4
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()
@@ -30,7 +30,6 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+1 -1
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 400,
EnemyLostRegen = 350, //175 dps
WaterDebuffScaling = 1
};
public override void SetStaticDefaults()
+15 -4
View File
@@ -1,4 +1,5 @@
using CalamityMod.DataStructures;
using CalamityMod.Projectiles.Summon;
using CalamityMod.Systems.Collections;
using Terraria;
using Terraria.ModLoader;
@@ -17,8 +18,17 @@ namespace CalamityMod.Buffs.DamageOverTime
public static float ViridVanguardPoisonMultiplier => 2;
public static void SagePoisonPower(NPC npc, int buffType, ref int buffIndex, ref int damage)
{
// The base DoT is multiplied by the amount of Viral Sprouts you have when applied
// See SageNeedle.cs for details
int viralCount = 0;
int viridCount = 0;
foreach (var item in Main.ActiveProjectiles)
{
if (item.type == ModContent.ProjectileType<SageSpirit>())
viralCount++;
if (item.type == ModContent.ProjectileType<ViridVanguardBlade>())
viridCount++;
}
if ((viralCount + viridCount) <= 0)
return;
//Reduce power of weakness/resistances but leave sickness debuff boosters at full power
//We first need to apply Irradiated as that isn't included in SicknessDebuffMultiplier due to needing to dynamically update if Irradiated is applied
@@ -39,8 +49,9 @@ namespace CalamityMod.Buffs.DamageOverTime
multiplier *= NewResistanceEffectiveness;
//Apply the DOT
int baseSagePoisonDoTValue = (int)multiplier.ApplyTo(npc.Calamity().sagePoisonDamage);
npc.Calamity().ApplyDPSDebuff(baseSagePoisonDoTValue, baseSagePoisonDoTValue / 5, ref npc.lifeRegen, ref damage);
float SagePoisonRegen = (viralCount + ViridVanguardPoisonMultiplier * viridCount) * debuffData.EnemyLostRegen;
int totalDoT = (int)multiplier.ApplyTo(SagePoisonRegen);
npc.Calamity().ApplyDPSDebuff(totalDoT, totalDoT/(2*(viridCount+viralCount)), ref npc.lifeRegen, ref damage);
}
public override void SetStaticDefaults()
{
+5 -1
View File
@@ -1,4 +1,5 @@
using System;
using CalamityMod.DataStructures;
using CalamityMod.NPCs;
using CalamityMod.Particles;
using CalamityMod.Projectiles;
@@ -19,7 +20,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;
+1 -1
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 240,
EnemyLostRegen = 350, //175 dps
SicknessDebuffScaling = 1
};
public override void SetStaticDefaults()
+1 -4
View File
@@ -15,7 +15,7 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 3996, //6x the tick size
EnemyLostRegen = 2664, //4x the tick size
HeatDebuffScaling = 1,
MinimumDamageTickSize = 666, //Vhex should always have ticks of 666
MultiplierDamageTickSize = 0
@@ -41,9 +41,6 @@ namespace CalamityMod.Buffs.DamageOverTime
cgn.trueVulnerabilityHex = true;
if (cgn.VulnerabilityHexFireDrawer != null)
cgn.VulnerabilityHexFireDrawer.SetLifetime = cgn.VulnerabilityHexFireDrawer.LocalTimer + npc.buffTime[buffIndex];
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && cgn.debuffResistanceTimer <= 0)
cgn.debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
}
internal static void DrawEffects(NPC npc, ref Color drawColor)
-2
View File
@@ -34,8 +34,6 @@ namespace CalamityMod.Buffs.DamageOverTime
public override void Update(NPC npc, ref int buffIndex)
{
npc.Calamity().vaporfied = true;
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin +npc.buffTime[buffIndex];
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
+1 -1
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public static DebuffData debuffData = new DebuffData(DebuffData.DebuffBehavior.Electric)
{
EnemyLostRegen = 100,
EnemyLostRegen = 75, //150 dps when moving, 37.5 dps when stationary
ElectricDebuffScaling = 1
};
public override void SetStaticDefaults()
+1 -1
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 400,
EnemyLostRegen = 500, //250 dps is extra strong for its tier due to being difficult to inflict
ColdDebuffScaling = 1
};
public override void SetStaticDefaults()
-4
View File
@@ -46,10 +46,6 @@ namespace CalamityMod.Buffs.DamageOverTime
// Set the remaining time of the fire drawer to be exactly right.
if (cgn.VulnerabilityHexFireDrawer != null)
cgn.VulnerabilityHexFireDrawer.SetLifetime = cgn.VulnerabilityHexFireDrawer.LocalTimer + npc.buffTime[buffIndex];
// Apply immunity timer.
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && cgn.debuffResistanceTimer <= 0)
cgn.debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + +npc.buffTime[buffIndex];
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
{
+3 -2
View File
@@ -1,4 +1,5 @@
using Terraria;
using CalamityMod.Items.Accessories;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.StatBuffs
@@ -15,7 +16,7 @@ namespace CalamityMod.Buffs.StatBuffs
public override void Update(Player player, ref int buffIndex)
{
player.endurance += 0.08f;
player.endurance += TrinketofChi.ChiBuffDamageReductionBoost;
}
}
}
-1
View File
@@ -15,7 +15,6 @@ namespace CalamityMod.Buffs.StatBuffs
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
}
+64
View File
@@ -0,0 +1,64 @@
using System;
using CalamityMod.DataStructures;
using CalamityMod.Items.Accessories;
using Terraria;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.StatBuffs
{
public class SmashedEvil : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 40,
SicknessDebuffScaling = 1,
HeatDebuffScaling = 1,
ColdDebuffScaling = 1,
ElectricDebuffScaling = 1,
WaterDebuffScaling = 1,
NPCLifeRegenMethod = SmashedEvilNPCRegen
};
public static void SmashedEvilNPCRegen(NPC npc, int buffType, ref int buffIndex, ref int damage)
{
var cnpc = npc.Calamity();
float totalDPS = debuffData.EnemyLostRegen;
var heat = cnpc.ActiveHeatDebuffMultiplier;
var cold = cnpc.ActiveColdDebuffMultiplier;
var sick = cnpc.ActiveSicknessDebuffMultiplier;
var elec = cnpc.ActiveElectricDebuffMultiplier;
var water = cnpc.ActiveWaterDebuffMultiplier;
StatModifier totalScaling =
DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveHeatDebuffMultiplier, debuffData.HeatDebuffScaling)
.CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveColdDebuffMultiplier, debuffData.ColdDebuffScaling)
.CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveSicknessDebuffMultiplier, debuffData.SicknessDebuffScaling)
.CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveWaterDebuffMultiplier, debuffData.WaterDebuffScaling)
.CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveElectricDebuffMultiplier, debuffData.ElectricDebuffScaling)
))));
totalDPS = totalScaling.ApplyTo(totalDPS);
var totalDPSAdjusted = totalDPS - debuffData.EnemyVanillaRegenToCancelOut;
npc.Calamity().ApplyDPSDebuff((int)(totalDPSAdjusted), (int)Math.Max(totalDPS * debuffData.MultiplierDamageTickSize, debuffData.MinimumDamageTickSize), ref npc.lifeRegen, ref damage);
}
public override void SetStaticDefaults()
{
Main.debuff[Type] = false;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
{
player.lifeRegenTime += 2;
player.GetDamage<GenericDamageClass>() += 0.1f;
player.moveSpeed += 0.2f;
}
public override void Update(NPC npc, ref int buffIndex)
{
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 665 B

-2
View File
@@ -26,8 +26,6 @@ namespace CalamityMod.Buffs.StatDebuffs
public override void Update(NPC npc, ref int buffIndex)
{
npc.Calamity().eutrophication = true;
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
+8 -3
View File
@@ -1,4 +1,5 @@
using CalamityMod.NPCs;
using CalamityMod.DataStructures;
using CalamityMod.NPCs;
using CalamityMod.Systems.Collections;
using Terraria;
using Terraria.ID;
@@ -14,13 +15,17 @@ namespace CalamityMod.Buffs.StatDebuffs
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
// Purely to make it get electric color in tooltips
public static DebuffData debuffData = new DebuffData()
{
ElectricDebuffScaling = 1
};
public override void Update(NPC npc, ref int buffIndex)
{
npc.Calamity().galvanicCorrosion = true;
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
}
public override void Update(Player player, ref int buffIndex)
-28
View File
@@ -1,28 +0,0 @@
using CalamityMod.NPCs;
using CalamityMod.Systems.Collections;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.StatDebuffs
{
public class GlacialState : ModBuff
{
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
}
public override void Update(NPC npc, ref int buffIndex)
{
npc.Calamity().glacialState = true;
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 611 B

-2
View File
@@ -17,8 +17,6 @@ namespace CalamityMod.Buffs.StatDebuffs
public override void Update(NPC npc, ref int buffIndex)
{
npc.Calamity().temporalSadness = true;
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
}
}
}
-2
View File
@@ -19,8 +19,6 @@ namespace CalamityMod.Buffs.StatDebuffs
public override void Update(NPC npc, ref int buffIndex)
{
npc.Calamity().timeDistortion = true;
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
}
}
}
-12
View File
@@ -1,12 +0,0 @@
using CalamityMod.Projectiles.Typeless;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class DemonshadeSetDevilBuff : BaseSummonBuff
{
protected override int MinionProjectileType => ModContent.ProjectileType<DemonshadeRedDevil>();
protected override ref bool MinionBool => ref BuffModdedOwner.rDevil;
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 993 B

+4 -24
View File
@@ -1,34 +1,14 @@
using CalamityMod.CalPlayer;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.Projectiles.Summon;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class VoidConcentrationBuff : ModBuff
public class VoidConcentrationBuff : BaseSummonBuff
{
public override void SetStaticDefaults()
{
Main.buffNoTimeDisplay[Type] = true;
Main.buffNoSave[Type] = true;
//Main.persistentBuff[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
CalamityPlayer mp = player.Calamity();
int count = player.ownedProjectileCounts[ModContent.ProjectileType<VoidConcentrationAura>()];
player.GetDamage<SummonDamageClass>() += 0.05f; //5%
mp.voidConcentrationAura = true;
if (!mp.voidAuraDamage && count == 0)
{
player.DelBuff(buffIndex);
buffIndex--;
}
else
{
player.buffTime[buffIndex] = 18000;
}
}
protected override ref bool MinionBool => ref BuffModdedOwner.VoidConcentrationStaff;
protected override int MinionProjectileType => ModContent.ProjectileType<VoidConcentrationMinion>();
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 750 B

After

Width:  |  Height:  |  Size: 819 B

+111 -50
View File
@@ -132,6 +132,7 @@ namespace CalamityMod.CalPlayer
/// <summary> If set to true, completely disables ALL life regeneration effects. Used by Omega Blue armor. </summary>
public bool noLifeRegen = false;
public float ammoCost = 1f;
public float partialLifeRegen = 0f;
public float healingPotionMultiplier = 1f;
/// <summary>
/// Tracks whether or not the player is currently holding Gael's Greatsword.<br/>
@@ -311,6 +312,7 @@ namespace CalamityMod.CalPlayer
#endregion
#region Timer and Counter
public float partialLifeRegenCounter = 0f;
public int gaelSwipes = 0;
public int arsenalCooldown = 0;
public int killModeCooldown = 0;
@@ -326,15 +328,6 @@ namespace CalamityMod.CalPlayer
public int deadSunCounter = 6;
public int DragonsBreathAudioCooldown = 0;
public int DragonsBreathAudioCooldown2 = 0;
public int darklightEnergy = 0;
public int darklightEnergyTimer = 0;
public bool darklightEnergyPaused = false;
public bool darklightEnergyMaxFXPlayed = false;
private int lucreciaParticleTimer = 0;
public int elementalMastery = 0;
public int elementalMasteryTimer = 0;
public bool elementalMasteryPaused = false;
public bool elementalMasterySFXPlayed = false;
public float unstableCastersGauntletVis = 0;
public int unstableCastersGauntletVisTimer = 0;
public int PhotoAudioCooldown = 0;
@@ -343,11 +336,6 @@ namespace CalamityMod.CalPlayer
public int arpeggioCooldown = 0;
/// <summary> Cooldown variable which prevents using Burning Sea during its "burn-out" mechanic. </summary>
public int burningSeaBurnOut = 0;
/// <summary>
/// How many stacks of Evil Smasher's boost the player has. This increases the weapon's damage, use speed, and knockback.<br/>
/// Getting hit decreases this by 1. Switching to a different item resets this to 0.
/// </summary>
public int evilSmasherBoost = 0;
/// <summary> Cooldown variable for spawning Plague Tainted SMG's drones from left-click bullets. </summary>
public int plagueTaintedSMGDroneCooldown = 0;
/// <summary> Cooldown variable which prevents using Firestorm Cannon or Spectralstorm Cannon during their overheat periods. </summary>
@@ -375,6 +363,9 @@ namespace CalamityMod.CalPlayer
public int amputatorBuff = 0;
/// <summary> Variable used to track the current fuel amount for Pristine Fury's right-click. </summary>
public int furyFuel = 1800;
/// <summary> Variable to track the healing over time gained from Grand Dad. </summary>
public int grandDadHealPool = 0;
public int grandDadHealTimer = 0;
public const int FuryFuelMax = 1800;
public float furyRefuelTimer = 0;
/// <summary> Variable used to track if Auger can do its big slash attack. </summary>
@@ -454,6 +445,9 @@ namespace CalamityMod.CalPlayer
public int consecutiveCaughtFish = 0;
public float WeakTimeFreezeUseTimer = 0;
public bool WeakTimeFreezeInUse = false;
public int DemonAltarDialogueCounter = 0;
public int DemonAltarDialogueCooldown = 0;
#endregion
#region Sound
@@ -722,8 +716,8 @@ namespace CalamityMod.CalPlayer
public bool drawnAnyShieldThisFrame = false;
// TODO -- Some way to show the player their total shield points.
public int TotalEnergyShielding => RoverDriveShieldDurability + LunicCorpsShieldDurability + pSoulShieldDurability + SpongeShieldDurability;
public int TotalMaxShieldDurability => (roverDrive ? RoverDrive.ShieldDurabilityMax : 0) + (lunicCorpsSet ? LunicCorpsHelmet.ShieldDurabilityMax : 0) + (profanedCrystalBuffs ? ProfanedSoulCrystal.ShieldDurabilityMax : ((pSoulArtifact && !profanedCrystal) ? ProfanedSoulArtifact.ShieldDurabilityMax : 0)) + (sponge ? TheSponge.ShieldDurabilityMax : 0);
public int TotalEnergyShielding => RoverDriveShieldDurability + LunicCorpsShieldDurability + pSoulShieldDurability + SpongeShieldDurability + (Starshield > 0 ? StratusStarburst : 0);
public int TotalMaxShieldDurability => (roverDrive ? RoverDrive.ShieldDurabilityMax : 0) + (lunicCorpsSet ? LunicCorpsHelmet.ShieldDurabilityMax : 0) + (profanedCrystalBuffs ? ProfanedSoulCrystal.ShieldDurabilityMax : ((pSoulArtifact && !profanedCrystal) ? ProfanedSoulArtifact.ShieldDurabilityMax : 0)) + (sponge ? TheSponge.ShieldDurabilityMax : 0) + (Starshield > 0 ? 100 : 0);
public int RoverDriveShieldDurability = 0;
public int LunicCorpsShieldDurability = 0;
@@ -810,6 +804,7 @@ namespace CalamityMod.CalPlayer
#region Accessory
public bool shieldOfTheHighRulerDashVelocityBoosted = false;
public bool yharimsGift = false;
public bool luxorsGift = false;
public bool luxorHit = false;
public bool luxorsGiftVanity = false;
@@ -910,12 +905,16 @@ namespace CalamityMod.CalPlayer
public bool lAmbergrisVisual = false;
public bool tortShell = false;
public bool absorber = false;
/// <summary>
/// Used for detetcing life regen hindering debuffs
/// </summary>
bool _hasNoNaturalRegen = false;
public bool hadLifeRegenHinderingDebuff = false;
public bool alwaysHoneyRegen = false;
public float alwaysHoneyRegenAmount = 0;
public bool honeyTurboRegen = false;
public bool honeyDewHalveDebuffs = false;
public bool livingDewHalveDebuffs = false;
public bool honeyDew = false;
public bool livingDew = false;
public int jewelBonusDefense = 0;
/// <summary>
/// Counter variable for spawning Toxic Heart's pulses.<br/>
@@ -929,8 +928,6 @@ namespace CalamityMod.CalPlayer
public float pulseRate = 1;
public bool aAmpoule = false;
public bool rOoze = false;
public float radiantOozeRegen = 0;
public float purityRegen = 0;
public bool fBarrier = false;
public bool aBrain = false;
public bool amalgam = false;
@@ -951,8 +948,12 @@ namespace CalamityMod.CalPlayer
public bool seraphTracers = false;
public bool frostFlare = false;
public bool evolution = false;
public bool procDodgeEffects = true;
public bool v8Engine = false;
public bool v8000Engine = false;
public bool v8EngineFXPlayed = false;
public bool procDodgeEffects = false;
public bool nanotech = false;
public int nanotechHitCooldown = 0;
public bool deadshotBrooch = false;
public bool shadowMinions = false;
public bool holyMinions = false;
@@ -960,6 +961,9 @@ namespace CalamityMod.CalPlayer
public bool toxicHeart = false;
public bool toxicHeartVisuals = false;
public bool abaddon = false;
public int abaddonCooldown = 0;
public bool abaddonEffectVisual = false;
public float playerBaneDebuffDamage = 0;
public bool aeroStone = false;
public bool lifejelly = false;
@@ -970,6 +974,9 @@ namespace CalamityMod.CalPlayer
public bool community = false;
public bool shatteredCommunity = false;
public bool fleshTotem = false;
public bool fleshTotemMinion = false;
public bool fleshTotemVisual = false;
public int fleshTotemManaStorage = 0;
public bool bloodPact = false;
public bool bloodflareCore = false;
public int bloodflareCoreRemainingHealOverTime = 0;
@@ -987,7 +994,6 @@ namespace CalamityMod.CalPlayer
public bool purity = false;
/// <summary> If true, reduces the damage of electricity debuffs by 50%. </summary>
public bool eleResist = false;
public int PurityHealSlowdownFrames = 0;
public bool harpyRing = false;
public bool angelTreads = false;
/// <summary> Makes Flesh Knuckles and its upgrades increase the player's max health. </summary>
@@ -1032,7 +1038,7 @@ namespace CalamityMod.CalPlayer
public bool IsFirstDashFrame = true;
public int fallingBootVelCheckTimer = 0;
public bool voidOfCalamity = false;
public bool voidOfExtinction = false;
public bool apollyon = false;
public bool eArtifact = false;
public bool dArtifact = false;
public bool auricSArtifact = false;
@@ -1092,7 +1098,9 @@ namespace CalamityMod.CalPlayer
public bool eclipseMirror = false;
public bool featherCrown = false;
public bool moonCrown = false;
public int rogueCrownCooldown = 0;
public bool mageCrownVisibility = false;
public int mageCrownTimer = 0;
public int mageCrownCount = 0;
public bool dragonScales = false;
public bool gloveOfPrecision = false;
public bool gloveOfRecklessness = false;
@@ -1107,6 +1115,7 @@ namespace CalamityMod.CalPlayer
public int spectralVeilImmunity = 0;
/// <summary> Check for if the player has Plagued Fuel Pack OR Blunder Booster equipped. </summary>
public bool hasJetpack = false;
public bool hasEngineDash = false;
public bool plaguedFuelPack = false;
public bool blunderBooster = false;
public bool blunderBoosterVisibility = true;
@@ -1269,7 +1278,6 @@ namespace CalamityMod.CalPlayer
public int tailFrame = 0;
public bool astralStarRain = false;
public int astralStarRainCooldown = 0;
public int AbaddonCooldown = 0;
public int VoidCooldown = 0;
public int ursaSergeantCooldown = 0;
public int AlchFlaskCooldown = 0;
@@ -1277,6 +1285,7 @@ namespace CalamityMod.CalPlayer
public bool plaguebringerPatronSet = false;
public bool plaguebringerCarapace = false;
public float ataxiaDmg;
public float hydroHealTimer = 0;
public bool ataxiaMage = false;
public bool ataxiaGeyser = false;
public float xerocDmg;
@@ -1308,8 +1317,6 @@ namespace CalamityMod.CalPlayer
public bool daedalusCrystal = false;
/// <summary> Hydrothermic armor's summoner set bonus minion. </summary>
public bool chaosSpirit = false;
/// <summary> Demonshade armor's set bonus minion. </summary>
public bool redDevil = false;
public bool GemTechSet = false;
/// <summary> Calamity's Cobalt armor set bonus; increases damage and crit chance based on how fast the player is moving. </summary>
public bool CobaltSet = false;
@@ -1363,6 +1370,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;
@@ -1564,8 +1572,6 @@ namespace CalamityMod.CalPlayer
/// <summary> Pearl of Enthrallment. </summary>
public bool waterEleBuff = false;
public bool fClump = false;
/// <summary> Demonshade armor's Red Devil. </summary>
public bool rDevil = false;
/// <summary> Aerospec armor's Valkyrie. </summary>
public bool aValkyrie = false;
public bool apexShark = false;
@@ -1592,9 +1598,7 @@ namespace CalamityMod.CalPlayer
public bool plaguebringerMK2 = false;
public bool igneousExaltation = false;
public bool GlacialEmbrace = false;
public bool voidAura = false;
public bool voidAuraDamage = false;
public bool voidConcentrationAura = false;
public bool VoidConcentrationStaff = false;
public bool MutatedTruffleBool = false;
public bool virili = false;
public bool frostBlossom = false;
@@ -2350,6 +2354,7 @@ namespace CalamityMod.CalPlayer
blazingCursorDamage = false;
blazingCursorVisuals = false;
yharimsGift = false;
luxorsGift = false;
luxorsGiftVanity = false;
fungalSymbiote = false;
@@ -2396,18 +2401,19 @@ namespace CalamityMod.CalPlayer
lAmbergris = false;
tortShell = false;
absorber = false;
honeyDewHalveDebuffs = false;
livingDewHalveDebuffs = false;
honeyDew = false;
livingDew = false;
aAmpoule = false;
rOoze = false;
radiantOozeRegen = 0;
purityRegen = 0;
fBarrier = false;
aBrain = false;
amalgam = false;
frostFlare = false;
evolution = false;
v8Engine = false;
v8000Engine = false;
nanotech = false;
nanotechHitCooldown = 0;
deadshotBrooch = false;
tesla = false;
teslaVisuals = true;
@@ -2443,6 +2449,8 @@ namespace CalamityMod.CalPlayer
stressPills = false;
laudanum = false;
fleshTotem = false;
fleshTotemVisual = false;
fleshTotemMinion = false;
bloodPact = false;
bloodflareCore = false;
chaliceOfTheBloodGod = false;
@@ -2459,7 +2467,7 @@ namespace CalamityMod.CalPlayer
crawCarapace = false;
baroclaw = false;
voidOfCalamity = false;
voidOfExtinction = false;
apollyon = false;
eArtifact = false;
dArtifact = false;
auricSArtifact = false;
@@ -2523,6 +2531,7 @@ namespace CalamityMod.CalPlayer
lunicCorpsLegs = false;
ammoCost = 1f;
partialLifeRegen = 0f;
healingPotionMultiplier = 1f;
avertorBonus = false;
@@ -2548,6 +2557,8 @@ namespace CalamityMod.CalPlayer
spiritOrigin = false;
spiritOriginVanity = false;
critDamage = 0;
if (abaddonCooldown > 0)
abaddonCooldown--;
astralStarRain = false;
@@ -2625,6 +2636,7 @@ namespace CalamityMod.CalPlayer
eclipseMirror = false;
featherCrown = false;
moonCrown = false;
mageCrownVisibility = false;
dragonScales = false;
gloveOfPrecision = false;
gloveOfRecklessness = false;
@@ -2635,11 +2647,15 @@ namespace CalamityMod.CalPlayer
sandCloak = false;
spectralVeil = false;
hasJetpack = false;
hasEngineDash = false;
plaguedFuelPack = false;
blunderBooster = false;
blunderBoosterVisibility = true;
veneratedLocket = false;
if (DemonAltarDialogueCooldown > 0)
DemonAltarDialogueCooldown--;
alcoholPoisoning = false;
shadowflame = false;
daybroken = false;
@@ -2652,6 +2668,7 @@ namespace CalamityMod.CalPlayer
armorCrunch = false;
crumble = false;
irradiated = false;
bane = false;
brimstoneFlames = false;
witheredDebuff = false;
absorberAffliction = false;
@@ -2814,7 +2831,6 @@ namespace CalamityMod.CalPlayer
brimEleBuff = false;
waterEleBuff = false;
fClump = false;
rDevil = false;
aValkyrie = false;
sCrystal = false;
sGod = false;
@@ -2841,7 +2857,6 @@ namespace CalamityMod.CalPlayer
fungalClumpVanity = false;
howlsHeart = false;
howlsHeartVanity = false;
redDevil = false;
valkyrie = false;
slimeGod = false;
chaosSpirit = false;
@@ -2856,9 +2871,7 @@ namespace CalamityMod.CalPlayer
plaguebringerMK2 = false;
igneousExaltation = false;
GlacialEmbrace = false;
voidAura = false;
voidAuraDamage = false;
voidConcentrationAura = false;
VoidConcentrationStaff = false;
saros = false;
if (sarosEclipseBeamUsage > 300)
sarosEclipseBeamUsage = 300;
@@ -3056,6 +3069,7 @@ namespace CalamityMod.CalPlayer
if (Player.HeldItem.IsAir || Player.HeldItem.fishingPole == 0)
consecutiveCaughtFish = 0;
heldGaelsLastFrame = false;
partialLifeRegenCounter = 0f;
gaelSwipes = 0;
whitewaterHeal = 0;
luxorHit = false;
@@ -3090,7 +3104,6 @@ namespace CalamityMod.CalPlayer
gSabatonTempJumpSpeed = 0;
rOfDelivarenceRam = false;
astralStarRainCooldown = 0;
AbaddonCooldown = 0;
VoidCooldown = 0;
AlchFlaskCooldown = 0;
ascendantInsigniaCooldown = 0;
@@ -3118,7 +3131,7 @@ namespace CalamityMod.CalPlayer
andromedaCripple = 0;
theBeeCooldown = 0;
scuttlerCooldown = 0;
rogueCrownCooldown = 0;
mageCrownTimer = 0;
wingProjectileCooldown = 0;
hallowedRuneCooldown = 0;
sulphurBubbleCooldown = 0;
@@ -3139,6 +3152,7 @@ namespace CalamityMod.CalPlayer
armorCrunch = false;
crumble = false;
irradiated = false;
bane = false;
brimstoneFlames = false;
witheredDebuff = false;
absorberAffliction = false;
@@ -3175,7 +3189,6 @@ namespace CalamityMod.CalPlayer
vaporfied = false;
banishingFire = false;
wither = false;
PurityHealSlowdownFrames = 0;
ImmobilityDebuffImmunityTimer = 0;
TypelessDebuffMultiplier = new();
HeatDebuffMultiplier = new();
@@ -3291,6 +3304,7 @@ namespace CalamityMod.CalPlayer
healCounter = 300;
danceOfLightCharge = 0;
ammoCost = 1f;
partialLifeRegen = 0f;
healingPotionMultiplier = 1f;
avertorBonus = false;
divineBless = false;
@@ -3435,12 +3449,9 @@ namespace CalamityMod.CalPlayer
CurrentlyViewedHologramText = string.Empty;
#endregion
evilSmasherBoost = 0;
burningSeaBurnOut = 0;
flareGunOverheat = 0;
hellbornShots = 0;
darklightEnergy = 0;
elementalMastery = 0;
garandShots = 0;
persecutedEnchantSummonTimer = 0;
momentumCapacitorTime = 0;
@@ -4479,6 +4490,10 @@ namespace CalamityMod.CalPlayer
if (HasCustomDash && UsedDash.IsOmnidirectional)
Player.maxFallSpeed = 50f;
// If the player isn't moving yet is still dashing, disable the dash (prevents weird hook jank)
if (Player.velocity == Vector2.Zero && Player.dashDelay == -1)
Player.dashDelay = 0;
tailFrameUp++;
if (tailFrameUp == 8)
{
@@ -4839,6 +4854,29 @@ namespace CalamityMod.CalPlayer
}
#endregion
#region PreItemChecks
public override bool PreItemCheck()
{
//For use when the player runs out of mana. Currently only used for Feather and Moonstone Crown
if (Player.HeldItem.mana > 0 && Player.controlUseItem && Player.itemAnimation == 0)
{
if (!Player.CheckMana(Player.HeldItem, -1, false, true))
{
if (moonCrown || featherCrown)
{
if (mageCrownCount > 0)
{
mageCrownCount = 0;
mageCrownTimer = 300;
}
if (mageCrownCount < 0) mageCrownCount = 0;
}
}
}
return true;
}
#endregion
#region PostUpdateEquips
public override void PostUpdateEquips()
{
@@ -4998,6 +5036,13 @@ namespace CalamityMod.CalPlayer
else
scionsCurioDebuffDamage = 0;
if (Player.Calamity().abaddon || Player.Calamity().apollyon)
{
Player.Calamity().playerBaneDebuffDamage = (1 + Player.GetTotalCritChance(Player.GetBestClass()) * 0.01f * (Player.Calamity().apollyon ? Apollyon.critScaling : Abaddon.critScaling));
}
else
Player.Calamity().playerBaneDebuffDamage = 0;
// True melee damage from various vanilla equipment placed here.
// Titan Glove and ALL upgrades.
@@ -5014,6 +5059,9 @@ namespace CalamityMod.CalPlayer
if (gSabaton && Player.whoAmI == Main.myPlayer)
Player.jumpSpeedBoost += 2f;
}
//Update life regen that needs to happen before calculating debuffs
GeneralLifeRegen();
}
#endregion
@@ -5037,7 +5085,8 @@ namespace CalamityMod.CalPlayer
//Flashlight
//Due to being in postUpdate we need to adjust the mousepos for the player's movement that will have happened
var mouseworld = Main.MouseWorld + Player.position - Player.oldPosition;
mouseWorldListener = true;
var mouseworld = mouseWorld + Player.position - Player.oldPosition;
EnhancedDarknessSystem.lights.Add(new(center: Player.Center + Player.DirectionTo(mouseworld) * 750f, rotation: Player.DirectionTo(mouseworld).ToRotation() - MathHelper.PiOver2, vectorScale: new Vector2(0.85f * abyssFlashlightWidthMultiplier, 0.75f), texture: Request<Texture2D>("CalamityMod/Particles/BloomLineFade").Value));
}
@@ -5142,7 +5191,7 @@ namespace CalamityMod.CalPlayer
(dragonScales ? 0.1f : 0f) +
(CobaltSet ? CobaltArmorSetChange.SpeedBoostSetBonusPercentage * 0.01f : 0f) +
(silvaSet ? SilvaArmor.AccelerationBoost : 0f) +
(getSandCloakAccelBoost ? 0.75f : 0f) +
(getSandCloakAccelBoost ? Items.Accessories.SandCloak.SandVeilAccelerationBoost : 0f) +
(ascendantInsignia ? (AscendantInsignia.AccelerationBoost - 0.25f) : 0f) + // Subtracted 0.25 provided by Soaring Insignia
(statisNinjaBelt ? 0.6f : 0f) +
(statisVoidSash ? 0.85f : 0f) +
@@ -6278,6 +6327,18 @@ namespace CalamityMod.CalPlayer
life.noGravity = true;
}
}
if (modPlayer.fleshTotem)
{
if (Main.myPlayer == Player.whoAmI)
{
fleshTotemManaStorage += manaConsumed;
if (fleshTotemManaStorage >= FleshTotem.manaStorageMax)
{
fleshTotemManaStorage = FleshTotem.manaStorageMax;
}
}
}
}
#endregion
+6 -1
View File
@@ -3,6 +3,7 @@ using CalamityMod.Balancing;
using CalamityMod.CalPlayer.Dashes;
using CalamityMod.EntitySources;
using CalamityMod.Enums;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Mounts;
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
@@ -132,6 +133,10 @@ namespace CalamityMod.CalPlayer
dashDelayToApply = BalancingConstants.UniversalShieldBonkCooldown;
if (DashID == DeepDiverDash.ID || (evasionScarf && DashID == CounterScarfDash.ID))
dashDelayToApply = (int)(dashDelayToApply * 0.75f);
if (DashID == V8EngineDash.ID)
dashDelayToApply = (int)(dashDelayToApply * V8Engine.DashDelayModifier);
if (DashID == V8000EngineDash.ID)
dashDelayToApply = (int)(dashDelayToApply * V8000Engine.DashDelayModifier);
if (DashID == StatisNinjaBeltDash.ID || DashID == StatisVoidSashDash.ID || Player.dashType == 1)
dashDelayToApply = BalancingConstants.UniversalSashDashCooldown;
@@ -231,7 +236,7 @@ namespace CalamityMod.CalPlayer
}
// Handle first-frame effects.
else if (HasCustomDash && !Player.mount.Active)
else if (HasCustomDash && (!Player.mount.Active || DashID == V8EngineDash.ID || DashID == V8000EngineDash.ID))
{
UsedDash.dashTime = 0;
if (DoADash(UsedDash.CalculateDashSpeed(Player)))
+1 -2
View File
@@ -497,8 +497,7 @@ namespace CalamityMod.CalPlayer
if (calamityPlayer.brimstoneFlames && drawInfo.shadow == 0f)
{
bool resistsBrimstoneFlames = abaddon; // Looks weaker if you have Abaddon equipped
BrimstoneFlames.DrawEffects(drawInfo, resistsBrimstoneFlames);
BrimstoneFlames.DrawEffects(drawInfo);
}
if (calamityPlayer.brainRot && drawInfo.shadow == 0f)
+87 -25
View File
@@ -8,6 +8,7 @@ using CalamityMod.Buffs.StatBuffs;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.CalPlayer.Dashes;
using CalamityMod.Cooldowns;
using CalamityMod.DataStructures;
using CalamityMod.Dusts;
using CalamityMod.Enums;
using CalamityMod.Events;
@@ -27,7 +28,7 @@ using CalamityMod.Items.Armor.Tarragon;
using CalamityMod.Items.Armor.Victide;
using CalamityMod.Items.Armor.Wulfrum;
using CalamityMod.Items.Potions;
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.Items.Tools;
using CalamityMod.Items.VanillaArmorChanges;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Rogue;
@@ -40,6 +41,8 @@ using CalamityMod.NPCs.Providence;
using CalamityMod.NPCs.SupremeCalamitas;
using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Magic;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Projectiles.Ranged;
using CalamityMod.Projectiles.Rogue;
using CalamityMod.Projectiles.Typeless;
@@ -52,13 +55,11 @@ using Terraria;
using Terraria.Audio;
using Terraria.Chat;
using Terraria.DataStructures;
using Terraria.Graphics.Shaders;
using Terraria.GameContent.Creative;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Items.Tools;
namespace CalamityMod.CalPlayer
{
@@ -460,7 +461,53 @@ namespace CalamityMod.CalPlayer
}
#endregion
#region OnHitNPC
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (Player.Calamity().yharimsGift)
target.AddBuff(ModContent.BuffType<AuricRebuke>(),120);
int debuffSpreadProj = ModContent.ProjectileType<DebuffSpreadEffect>();
if ((Player.Calamity().abaddon || Player.Calamity().apollyon) && (target.Calamity().abaddonEffected || target.Calamity().apollyonEffected) && hit.Crit && abaddonCooldown == 0 && Player.ownedProjectileCounts[debuffSpreadProj] == 0)
{
int maxTargetNum = target.Calamity().apollyonEffected ? 10 : 6;
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, Vector2.Zero, debuffSpreadProj, 0, 0, Player.whoAmI, 0, target.whoAmI, maxTargetNum);
abaddonCooldown = -1; // Prevents multiple projectiles hitting on the same frame from spawning multiple of these
}
}
#endregion
#region Modify Hit NPC
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
if (target.HasBuff<SmashedEvil>())
{
//This is essentially 10 AP, but independent of armor amount
modifiers.FlatBonusDamage += 5;
}
if (Player.Calamity().apollyon)
{
target.Calamity().apollyonEffected = true;
// Check here for the amount of debuffs on enemy
int numOfDebuffs = 0;
for (int index = 0; index < target.buffType.Length; index++)
{
int type = target.buffType[index];
var debuffData = BuffDatasets.DebuffDataset[type];
if (debuffData != null)
numOfDebuffs++;
}
modifiers.CritDamage += Apollyon.critDamageBoostPerDebuff * numOfDebuffs;
}
else if (Player.Calamity().abaddon)
target.Calamity().abaddonEffected = true;
else
{
target.Calamity().abaddonEffected = false;
target.Calamity().apollyonEffected = false;
}
}
public override void ModifyHitNPCWithItem(Item item, NPC target, ref NPC.HitModifiers modifiers)
{
modifiers.CritDamage += critDamage;
@@ -744,10 +791,6 @@ namespace CalamityMod.CalPlayer
// The amount of damage that will be dealt is yet to be determined.
//
// Can't have any cooldowns here because dodges grrrrr....
if (fleshTotem && !Player.HasCooldown(Cooldowns.FleshTotem.ID) && TotalEnergyShielding <= 0)
modifiers.FinalDamage *= 0.5f;
if (tarragonCloak && tarraMelee && !Player.HasCooldown(Cooldowns.TarragonCloak.ID))
modifiers.FinalDamage *= (1f - TarragonHeadMelee.CloakContactDamageReduction);
@@ -848,7 +891,7 @@ namespace CalamityMod.CalPlayer
float cooldownDurationScalar = MathHelper.Clamp((actualProjDamage - dodgeDamageGateValue) / (float)maxCooldownDurationDamageValue, 0f, 1f);
// The Evolution
if (evolution)
if (evolution && !Player.HasBuff<SilvaRevival>())
{
if (Player.whoAmI == Main.myPlayer)
{
@@ -1037,10 +1080,9 @@ namespace CalamityMod.CalPlayer
if (!hasIFrames && !Player.creativeGodMode)
nextHitDealsDefenseDamage |= npc.Calamity().canBreakPlayerDefense;
// ModifyHit (Flesh Totem effect happens here) -> Hurt (includes dodges) -> OnHit
// ModifyHit -> Hurt (includes dodges) -> OnHit
// As such, to avoid cooldowns proccing from dodge hits, do it here
if (fleshTotem && !Player.HasCooldown(Cooldowns.FleshTotem.ID) && hurtInfo.Damage > 0)
Player.AddCooldown(Cooldowns.FleshTotem.ID, CalamityUtils.SecondsToFrames(20));
if (NPC.AnyNPCs(ModContent.NPCType<THELORDE>()))
Player.AddBuff(ModContent.BuffType<NOU>(), 15, true);
@@ -1887,10 +1929,6 @@ namespace CalamityMod.CalPlayer
Rectangle location = new Rectangle((int)Player.position.X, (int)Player.position.Y - 16, Player.width, Player.height);
CombatText.NewText(location, Color.LightBlue, Language.GetTextValue(shieldDamageText));
// Give the player iframes for taking a shield hit, regardless of whether or not the shields broke.
int shieldHitIFrames = Player.ComputeHitIFrames(info);
Player.GiveIFrames(info.CooldownCounter, shieldHitIFrames, true);
// Spawn particles when hit with the shields up, regardless of whether or not the shields broke.
// More particles spawn if a shield broke.
if (pSoulArtifact)
@@ -1961,6 +1999,10 @@ namespace CalamityMod.CalPlayer
// If the shields completely absorbed the hit, then delete the hit using reflection.
if (shieldsFullyAbsorbedHit)
{
// Give the player iframes for taking a shield hit
int shieldHitIFrames = Player.ComputeHitIFrames(info);
Player.GiveIFrames(info.CooldownCounter, shieldHitIFrames, true);
freeDodgeFromShieldAbsorption = true;
// Cancel defense damage, if it was going to occur this frame.
@@ -2174,9 +2216,6 @@ namespace CalamityMod.CalPlayer
LoseAdrenalineOnHurt(hurtInfo, false);
}
if (evilSmasherBoost > 0)
evilSmasherBoost -= 1;
if (trinketOfChi)
chiBuffTimer = 0;
@@ -2283,11 +2322,36 @@ namespace CalamityMod.CalPlayer
if (duration > 120)
duration = 120;
npc.AddBuff(ModContent.BuffType<GlacialState>(), (int)duration, false);
npc.AddBuff(BuffID.Frozen, (int)duration, false);
}
}
}
if (fleshTotem && hurtInfo.Damage > 0)
{
SoundStyle Counter = new SoundStyle("CalamityMod/Sounds/Custom/BrainOfCthulhu/BoC_Rev_Shield_Down");
if (fleshTotemManaStorage >= 100 && fleshTotemVisual)
SoundEngine.PlaySound(Counter with { Volume = 0.75f}, Player.Center);
int lostSoulAmount = fleshTotemManaStorage / 25;
if (Player.ownedProjectileCounts[ModContent.ProjectileType<FleshTotemMinion>()] != 0)
{
for (int i = 0; i < Main.maxProjectiles; i++)
{
Projectile proj = Main.projectile[i];
if (proj.active && proj.owner == Player.whoAmI && proj.type == ModContent.ProjectileType<FleshTotemMinion>())
{
for (int k = 0; k < lostSoulAmount; k++)
{
Projectile.NewProjectile(Player.GetSource_Accessory_OnHurt(FindAccessory<FleshTotem>(), hurtInfo.DamageSource), proj.Center, new Vector2(10, 10).RotatedByRandom(100) * Main.rand.NextFloat(0.4f, 0.55f), ModContent.ProjectileType<FleshTotemSoul>(), FleshTotem.lostSoulDamage, 0f, Main.myPlayer, 0f, 0f, 3f);
}
break;
}
}
}
fleshTotemManaStorage = 0;
}
// By setting brainOfConfusionItem, these accessories have this code already,
// but doing it again allows for increased duration + The Amalgam's other buffs,
// and also doesn't have random chance (why does Brain of Confusion not guarantee confusion on hit)
@@ -2366,7 +2430,7 @@ namespace CalamityMod.CalPlayer
Player.AddBuff(BuffID.Honey, 300, false);
// Handle hit effects from the gem tech armor set.
Player.Calamity().GemTechState.PlayerOnHitEffects((int)hurtInfo.Damage);
Player.Calamity().GemTechState.PlayerOnHitEffects(hurtInfo);
if (Player.whoAmI == Main.myPlayer)
{
@@ -2408,10 +2472,10 @@ namespace CalamityMod.CalPlayer
if (dAmulet)
{
var source = Player.GetSource_Accessory_OnHurt(FindAccessory<DeificAmulet>(), hurtInfo.DamageSource);
int projAmount = (rampartOfDeities ? 12 : 6);
var projAmount = (rampartOfDeities ? 12 : 6) * (Player.strongBees ? 1.5f : 1f);
for (int n = 0; n < projAmount; n++)
{
int deificProjDamage = (int)(Player.GetBestClassDamage().ApplyTo(DeificAmulet.StarDamage) * (Player.strongBees ? 0.85f : 1f));
int deificProjDamage = (int)(Player.GetBestClassDamage().ApplyTo(DeificAmulet.StarDamage));
Projectile onHitProj = Main.projectile[Projectile.NewProjectile(source, Player.Center, new Vector2(0,-15 * (rampartOfDeities && n % 2 == 0 ? 0.75f: 1.25f)).RotatedBy(MathHelper.TwoPi/projAmount*n), ModContent.ProjectileType<AstralStar>(), deificProjDamage, 4f, Player.whoAmI)];
if (onHitProj.whoAmI.WithinBounds(Main.maxProjectiles))
@@ -2422,8 +2486,6 @@ namespace CalamityMod.CalPlayer
onHitProj.tileCollide = false;
onHitProj.extraUpdates = 1;
onHitProj.Calamity().conditionalHomingRange = 600f;
if (Player.strongBees)
onHitProj.penetrate += 1;
}
}
}
+147 -191
View File
@@ -48,22 +48,22 @@ namespace CalamityMod.CalPlayer
{
int totalVanillaDoT = 0;
if (Player.poisoned && !purity)
if (Player.poisoned)
totalVanillaDoT += 4;
if (Player.onFire && !purity)
if (Player.onFire)
totalVanillaDoT += 8;
if (Player.tongued)
totalVanillaDoT += 100;
if (Player.venom && !purity)
if (Player.venom)
totalVanillaDoT += 12;
if (Player.onFrostBurn && !purity)
if (Player.onFrostBurn)
totalVanillaDoT += 12;
if (Player.onFire2 && !purity)
if (Player.onFire2)
totalVanillaDoT += 12;
if (Player.burned)
@@ -72,7 +72,7 @@ namespace CalamityMod.CalPlayer
if (Player.suffocating)
totalVanillaDoT += 40;
if (Player.electrified && !purity)
if (Player.electrified)
{
totalVanillaDoT += eleResist ? 4 : 8;
if (Player.controlLeft || Player.controlRight)
@@ -101,37 +101,38 @@ namespace CalamityMod.CalPlayer
// Whispering Death sets positive regen to zero but doesn't actually deal any damage
ApplyDoTDebuff(whisperingDeath, 0, laudanum);
ApplyDoTDebuff(irradiated, 4, purity);
ApplyDoTDebuff(irradiated, 4);
int sulphurDoT = 6 - (sulphurSet ? 2 : 0) - (sulphurskin ? 2 : 0) - (corrosiveSpine ? 2 : 0);
ApplyDoTDebuff(sulphurPoison, sulphurDoT, purity);
ApplyDoTDebuff(riptide, 6, purity);
ApplyDoTDebuff(sulphurPoison, sulphurDoT);
ApplyDoTDebuff(riptide, 6);
ApplyDoTDebuff(weakBrimstoneFlames, 7);
ApplyDoTDebuff(burningBlood, 8, purity);
ApplyDoTDebuff(brainRot, 8, purity);
ApplyDoTDebuff(vaporfied, 8, purity);
ApplyDoTDebuff(burningBlood, 8);
ApplyDoTDebuff(brainRot, 8);
ApplyDoTDebuff(vaporfied, 8);
int staticDoT = ((Player.controlLeft || Player.controlRight) ? 12 : 3) / (eleResist ? 2 : 1);
ApplyDoTDebuff(staticDischarge, staticDoT, purity);
ApplyDoTDebuff(heavybleeding, 16, purity);
ApplyDoTDebuff(crushDepth, 18, purity);
ApplyDoTDebuff(astralInfection, 24, infectedJewel || hideOfDeus || purity);
ApplyDoTDebuff(shadowflame, 30, purity);
ApplyDoTDebuff(brimstoneFlames, (int)MathF.Round(30 * (abaddon ? (1f - Abaddon.BrimstoneFlamesReduction) : 1f)), purity);
ApplyDoTDebuff(plague, (int)MathF.Round(30 * (abaddon ? (1f - AlchemicalDecanter.PlagueReduction) : 1f)), purity);
ApplyDoTDebuff(staticDischarge, staticDoT);
ApplyDoTDebuff(heavybleeding, 16);
ApplyDoTDebuff(crushDepth, 18);
ApplyDoTDebuff(astralInfection, 24, hideOfDeus);
ApplyDoTDebuff(shadowflame, 30);
ApplyDoTDebuff(brimstoneFlames, 30);
ApplyDoTDebuff(plague, (int)MathF.Round(30 * (alchFlask ? (1f - AlchemicalDecanter.PlagueReduction) : 1f)));
ApplyDoTDebuff(vHex, 30); // Has other effects
ApplyDoTDebuff(searingLava, 30);
ApplyDoTDebuff(demonicFlames, 33, purity); // Never inflicted on the player
ApplyDoTDebuff(laceration, 36, purity);
ApplyDoTDebuff(daybroken, 40, purity);
ApplyDoTDebuff(nightwither, 40, purity);
ApplyDoTDebuff(holyFlames, 40, purity);
ApplyDoTDebuff(voidfrost, 40, purity);
ApplyDoTDebuff(hadopelagicPressure, 40, purity);
ApplyDoTDebuff(demonicFlames, 33); // Never inflicted on the player
ApplyDoTDebuff(laceration, 36);
ApplyDoTDebuff(daybroken, 40);
ApplyDoTDebuff(bane, 40);
ApplyDoTDebuff(nightwither, 40);
ApplyDoTDebuff(holyFlames, 40);
ApplyDoTDebuff(voidfrost, 40);
ApplyDoTDebuff(hadopelagicPressure, 40);
// Profaned Soul Crystal turns you into Providence, a God, and you take more damage from God Slayer Inferno
ApplyDoTDebuff(godSlayerInferno, profanedCrystalBuffs ? 50 : 40);
int fluxDoT = ((Player.controlLeft || Player.controlRight) ? 50 : 10) / (eleResist ? 2 : 1);
ApplyDoTDebuff(vermillionFlux, fluxDoT);
ApplyDoTDebuff(elementalMix, 50, purity); // Never inflicted on the player
ApplyDoTDebuff(elementalMix, 50); // Never inflicted on the player
ApplyDoTDebuff(trueVHex, 50);
int dragonfireDoT = ((Player.name == "JFL" || Player.name == "MrJFL") ? 200 : 50) / (dynamoStemCells ? 2 : 1);
ApplyDoTDebuff(dragonFire, dragonfireDoT);
@@ -275,25 +276,23 @@ namespace CalamityMod.CalPlayer
bool hasLifeRegenHinderingDebuff = Player.lifeRegenTime == 0;
#region Life Regen That Works Even During DoT Debuffs
if (honeyDewHalveDebuffs)
{
// Tick down all sickness debuffs; this makes them expire 2x faster
// Upgrades increase the sets of debuffs which expire faster
for (int l = 0; l < Player.MaxBuffs; ++l)
{
int buffID = Player.buffType[l];
if (Player.buffTime[l] <= 2 || BuffDatasets.DebuffDataset[buffID] is null)
continue;
bool shouldHalveDuration = BuffDatasets.DebuffDataset[buffID].SicknessDebuffScaling > 0;
if (livingDewHalveDebuffs)
shouldHalveDuration |= BuffDatasets.DebuffDataset[buffID].HeatDebuffScaling > 0;
if (purity)
shouldHalveDuration |= CalamityBuffSets.IsDebuff[buffID];
if (shouldHalveDuration)
--Player.buffTime[l];
}
#region Life Regen That Works Even During DoT Debuffs
//Negation of debuffs. These all will not take life regen above 0
if (Player.lifeRegen < 0)
{
if (crownJewel)
Player.lifeRegen += CrownJewel.ReducedDoTAmount;
if (infectedJewel)
Player.lifeRegen += InfectedJewel.ReducedDoTAmount;
if (purity)
Player.lifeRegen += Radiance.ReducedDoTAmount;
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
}
if (divineBless)
@@ -307,19 +306,6 @@ namespace CalamityMod.CalPlayer
if (bloodfinBoost)
{
if (Player.lifeRegen < 0)
{
if (Player.lifeRegenTime < Bloodfin.DebuffedRegenTimeFloor)
Player.lifeRegenTime = Bloodfin.DebuffedRegenTimeFloor;
Player.lifeRegen += Bloodfin.DebuffedRegenBoost;
}
else
{
Player.lifeRegen += Bloodfin.RegenBoost;
Player.lifeRegenTime += Bloodfin.RegenTimeBoost;
}
if (bloodfinTimer > 0)
bloodfinTimer--;
@@ -327,124 +313,37 @@ namespace CalamityMod.CalPlayer
{
bloodfinTimer = Bloodfin.FramesForExtraRegen;
if (Player.statLife < (int)(Player.statLifeMax2 * Bloodfin.ExtraRegenHealthThreshold) && !noLifeRegen)
if (!noLifeRegen)
Player.HealPlayer(1, HealTextType.None);
}
}
// Permafrost's Concoction increases life regen while afflicted with a fire debuff
if (permafrostsConcoction && Player.buffType.Any(l => BuffDatasets.DebuffDataset[l] is not null && BuffDatasets.DebuffDataset[l].HeatDebuffScaling > 0))
{
if (Player.lifeRegenTime < 900)
Player.lifeRegenTime = 900;
Player.lifeRegen += 6;
}
// Grant life regen based on missing health for Radiant Ooze, Ambrosial Ampule, and purity
if (rOoze || aAmpoule || purity)
if (grandDadHealTimer == 0 && grandDadHealPool >= 7)
{
float missingLifeRatio = (Player.statLifeMax2 - Player.statLife) / (float)Player.statLifeMax2;
//Ambrosial Ampule and ooze give between 2 and 5 hp/s
int lifeRegenToGive = (int)Math.Round(MathHelper.Lerp(RadiantOoze.MinRegenBoost, RadiantOoze.MaxRegenBoost, missingLifeRatio));//Rounding is needed for it to ever actually give +5 hp/s, as the integer conversion would otherwise floor it.
Player.lifeRegen += lifeRegenToGive;
radiantOozeRegen += lifeRegenToGive / 2f;
purityRegen += lifeRegenToGive / 2f;
Player.HealPlayer(7, HealTextType.Broadcast);
grandDadHealPool -= 7;
grandDadHealTimer = (int)(30 * Utils.GetLerpValue(260, 60, grandDadHealPool, true));
}
else if (grandDadHealTimer > 0)
grandDadHealTimer--;
if (purity)
//Raising natural regen post-damaging-debuff
if (hadLifeRegenHinderingDebuff && !hasLifeRegenHinderingDebuff)
{
int intendedPurityDefense = 0;
int currentDebuffs = Player.buffType.Count(i => CalamityBuffSets.IsDebuff[i]);
if (currentDebuffs > 0)
{
// Healing rate is normally 5 HP/s (+1 every 12 frames)
// However, that 12 frames can and will slowly increase if you try to abuse this accessory
int healFrameCadence = 12;
if (infectedJewel)
Player.lifeRegenTime += InfectedJewel.PostDebuffRegenTimeBoost;
// Healing slows down after 5 seconds (300 frames) debuffed. For every 15 frames thereafter the cadence slows
// The upper limit to how slow it can get is after 15 seconds (900 frames)
int punishmentFrames = PurityHealSlowdownFrames - 300;
//lowest punishment is a little under a second between the one health heal
if (healFrameCadence < 52)
healFrameCadence += (punishmentFrames < 0) ? 0 : punishmentFrames / 15;
if (purity)
Player.lifeRegenTime += Radiance.PostDebuffRegenTimeBoost;
if (Player.miscCounter % healFrameCadence == healFrameCadence - 1)
Player.Heal(1);
intendedPurityDefense = 15 + (currentDebuffs - 1) * 5;
if (jewelBonusDefense < intendedPurityDefense)
jewelBonusDefense = intendedPurityDefense;
// Count up total frames spent healing for slowdown.
if (PurityHealSlowdownFrames < 900)
++PurityHealSlowdownFrames;
purityRegen += (60 / (float)healFrameCadence);
}
// If the defense should be ticking down to some lower value, do that.
// Purity loses 1 point of defense every second.
if (Player.miscCounter % 60 == 0 && jewelBonusDefense > intendedPurityDefense)
--jewelBonusDefense;
// If the player is clear of all debuffs then gradually reduce the slowdown frames
if (currentDebuffs <= 0)
{
--PurityHealSlowdownFrames;
if (PurityHealSlowdownFrames < 0)
PurityHealSlowdownFrames = 0;
}
// Actually apply defense bonus
Player.statDefense += jewelBonusDefense;
}
// Infected Jewel does not stack with Purity
else if (infectedJewel)
{
Player.lifeRegen += 2;
// If the player has any debuffs, give the extra life regen and defense
// More defense is given for each additional debuff
int intendedJewelDefense = 0;
int currentDebuffs = Player.buffType.Count(i => CalamityBuffSets.IsDebuff[i]);
if (currentDebuffs > 0)
{
Player.lifeRegen += 4;
intendedJewelDefense = 12 + (currentDebuffs - 1) * 4;
if (jewelBonusDefense < intendedJewelDefense)
jewelBonusDefense = intendedJewelDefense;
}
// If the defense should be ticking down to some lower value, do that.
// Infected Jewel loses 1 point of defense every 20 frames.
if (Player.miscCounter % 60 == 0 && jewelBonusDefense > intendedJewelDefense)
--jewelBonusDefense;
// Actually apply defense bonus
Player.statDefense += jewelBonusDefense;
}
// Crown Jewel does not stack with Purity or Infected Jewel
else if (crownJewel)
{
Player.lifeRegen += 2;
// If any debuff is detected, provide even more life regen
if (Player.buffType.Any(i => CalamityBuffSets.IsDebuff[i]))
Player.lifeRegen += 3;
}
//If a player had a life regen hindering debuff, add 30 seconds to their regen time when under Tequila Sunrise
//This stacks with all other post-debuff boosts due to Tequila Sunrise increasing DoT damage taken
if (tequilaSunrise)
{
if (hadLifeRegenHinderingDebuff && !hasLifeRegenHinderingDebuff)
{
if (tequilaSunrise)
Player.lifeRegenTime += 1800;
}
}
#endregion
// During Silva revive or God Slayer dash, all negative life regen is canceled
@@ -519,24 +418,43 @@ namespace CalamityMod.CalPlayer
// The bleedout is applied by directly reducing the player's health. It is not canceled by anything.
ChaliceOfTheBloodGod.HandleBleedout(Player);
//Finally, update the state of hadLifeRegenHinderingDebuff for next frame.
hadLifeRegenHinderingDebuff = hasLifeRegenHinderingDebuff;
//Finally, update the state of hadLifeRegenHinderingDebuff for next frame. Needs to check for 2 frames of 0 regen time to be sure they had a debuff
hadLifeRegenHinderingDebuff = hasLifeRegenHinderingDebuff && _hasNoNaturalRegen;
_hasNoNaturalRegen = hasLifeRegenHinderingDebuff;
}
#endregion
#region Update Life Regen
public override void UpdateLifeRegen()
//This method runs BEFORE UpdateBadLifeRegen. Put most effects here. Ran at the end of PostUpdateEquips
public void GeneralLifeRegen()
{
// Apply partial life regeneration
// Regenerator applies partial life regen as a part of its damage conversion straight up, so it will avoid this function
if (regenerator)
partialLifeRegenCounter = 0f;
else
{
partialLifeRegenCounter += partialLifeRegen;
if (partialLifeRegenCounter >= 1f || partialLifeRegenCounter <= -1f)
{
int flooredRegenAdded = (int)MathF.Floor(partialLifeRegenCounter);
Player.lifeRegen += flooredRegenAdded;
partialLifeRegenCounter -= flooredRegenAdded;
}
}
float lifeRatio = (Player.statLife) / (float)Player.statLifeMax2;
if (mushy)
Player.lifeRegen += Mushy.RegenBoost;
if (permafrostsConcoction)
{
if (Player.statLife < actualMaxLife / 2)
if (lifeRatio <= 0.5f)
Player.lifeRegen++;
if (Player.statLife < actualMaxLife / 4)
if (lifeRatio <= 0.25f)
Player.lifeRegen++;
if (Player.statLife < actualMaxLife / 10)
if (lifeRatio <= 0.1f)
Player.lifeRegen += 2;
}
@@ -552,6 +470,25 @@ namespace CalamityMod.CalPlayer
if (PinkJellyRegen)
Player.lifeRegen += LifeJelly.AuraRegenBoost;
if (rOoze)
Player.lifeRegen += (int)Math.Round(MathHelper.Lerp(RadiantOoze.MaxRegenBoost, RadiantOoze.MinRegenBoost, lifeRatio));
if (livingDew)
Player.lifeRegenTime += LivingDew.RegenTimeBoost;
if (aAmpoule)
{
Player.lifeRegen += (int)Math.Round(MathHelper.Lerp(AmbrosialAmpoule.MaxRegenBoost, AmbrosialAmpoule.MinRegenBoost, lifeRatio));
Player.lifeRegenTime += AmbrosialAmpoule.RegenTimeBoost;
}
if (purity)
{
Player.lifeRegen += (int)Math.Round(MathHelper.Lerp(Radiance.MaxRegenBoost, Radiance.MinRegenBoost, lifeRatio));
Player.lifeRegenTime += Radiance.RegenTimeBoost;
}
if (GreenJellyRegen)
Player.lifeRegen += Items.Accessories.GrandGelatin.AuraRegenBoost;
@@ -565,7 +502,7 @@ namespace CalamityMod.CalPlayer
Player.lifeRegen += Affliction.RegenBoost;
if (trinketOfChi || chiRegen)
Player.lifeRegen += 2;
Player.lifeRegen += TrinketofChi.RegenBoost;
if (darkSunRing)
{
@@ -576,6 +513,12 @@ namespace CalamityMod.CalPlayer
if (silvaSet)
Player.lifeRegen += SilvaArmor.SetBonusRegenBoost;
if (angelicAlliance)
{
if (Player.wingTime < Player.wingTimeMax)
Player.lifeRegen += AngelicAlliance.RegenBoostDuringFlight;
}
if (phantomicHeartRegen > 0 && phantomicHeartRegen < 1000)
{
Player.lifeRegen += PhantomicArtifact.RegenBoost;
@@ -591,6 +534,27 @@ namespace CalamityMod.CalPlayer
regen.position = Player.Center - velocity;
}
}
if (fearmongerSet && fearmongerRegenFrames > 0)
{
if (Player.lifeRegenTime < FearmongerGreathelm.MinionRegenTimeFloor)
Player.lifeRegenTime = FearmongerGreathelm.MinionRegenTimeFloor;
Player.lifeRegen += FearmongerGreathelm.MinionRegenBoost;
Player.lifeRegenTime += FearmongerGreathelm.MinionRegenTimeBoost;
}
if (handWarmer && eskimoSet)
{
Player.lifeRegen += 2;
}
}
//This method runs AFTER UpdateBadLifeRegen. Only put effects that should bypass debuff DoT canceling here.
public override void UpdateLifeRegen()
{
if (avertorBonus)
{
Player.lifeRegen += 4;
}
if (community)
{
@@ -605,22 +569,10 @@ namespace CalamityMod.CalPlayer
Player.lifeRegen += lesserEffect ? 1 : regenBoost;
}
if (handWarmer && eskimoSet)
if (manaOverloader)
{
Player.lifeRegen += 2;
}
if (avertorBonus)
{
Player.lifeRegen += 4;
}
if (fearmongerSet && fearmongerRegenFrames > 0)
{
if (Player.lifeRegenTime < FearmongerGreathelm.MinionRegenTimeFloor)
Player.lifeRegenTime = FearmongerGreathelm.MinionRegenTimeFloor;
Player.lifeRegen += FearmongerGreathelm.MinionRegenBoost;
Player.lifeRegenTime += FearmongerGreathelm.MinionRegenTimeBoost;
float manaRatio = Player.statMana / (float)Player.statManaMax2;
Player.lifeRegen += (int)(MathF.Round(MathHelper.Lerp(4f, -4f, manaRatio)) * (Player.HasBuff(BuffID.ManaSickness) ? 0.5f : 1f));
}
if (pinkCandle && !noLifeRegen)
@@ -637,12 +589,6 @@ namespace CalamityMod.CalPlayer
else
pinkCandleHealFraction = 0D;
if (manaOverloader)
{
float manaRatio = Player.statMana / (float)Player.statManaMax2;
Player.lifeRegen += (int)(MathF.Round(MathHelper.Lerp(4f, -4f, manaRatio)) * (Player.HasBuff(BuffID.ManaSickness) ? 0.5f : 1f));
}
#region Standing Still Life Regen
// Standing still healing bonuses (all are exclusive with vanilla Shiny Stone, but all function similarly)
if (!Player.shinyStone && Player.StandingStill() && Player.velocity.Y == 0 && Player.itemAnimation == 0 && (shadeRegen || cFreeze))
@@ -728,6 +674,16 @@ namespace CalamityMod.CalPlayer
public override void NaturalLifeRegen(ref float regen)
{
// Honey Dew and its upgrades make natural regen more powerful
if (purity)
regen *= Radiance.NaturalRegenPower;
else if (aAmpoule)
regen *= AmbrosialAmpoule.NaturalRegenPower;
else if (livingDew)
regen *= LivingDew.NaturalRegenPower;
else if (honeyDew)
regen *= HoneyDew.NaturalRegenPower;
// The Camper counteracts the regen loss while moving horizontally
if (camper && (Player.velocity.X != 0 && Player.grappling[0] <= 0))
{
@@ -750,13 +706,13 @@ namespace CalamityMod.CalPlayer
// Regenerator trades all positive regen for damage, and caps your health gain at 50%
if (regenerator)
{
int finalRegen = Player.lifeRegen + (int)Math.Round(regen * (Player.statLifeMax2 / 400f * 0.85f + 0.15f));
finalRegen = (int)Math.Max(finalRegen, 0);
float finalRegen = Player.lifeRegen + partialLifeRegen + MathF.Round(regen * (Player.statLifeMax2 / 400f * 0.85f + 0.15f));
finalRegen = MathF.Max(finalRegen, 0f);
// Rapid Healing increments RegenCount directly so it needs to be manually added
// It also works while debuffs are active so the same logic applies here
if (Player.palladiumRegen)
finalRegen += 4;
finalRegen += 4f;
regeneratorDamage = finalRegen * Regenerator.RegenToDamageRatio;
Player.GetDamage<GenericDamageClass>() += regeneratorDamage;
+168 -251
View File
@@ -45,6 +45,7 @@ using CalamityMod.Items.VanillaArmorChanges;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.NPCs;
using CalamityMod.NPCs.AcidRain;
using CalamityMod.NPCs.Astral;
@@ -69,6 +70,8 @@ using CalamityMod.Tiles.Abyss.AbyssAmbient;
using CalamityMod.Tiles.FurnitureAuric;
using CalamityMod.Tiles.Ores;
using CalamityMod.UI;
using CalamityMod.UI.DialogueDisplay;
using CalamityMod.UI.DialogueDisplay.DisplayEffects;
using CalamityMod.Utilities;
using CalamityMod.World;
using Microsoft.Xna.Framework;
@@ -152,9 +155,6 @@ namespace CalamityMod.CalPlayer
// Drawing parameters
UpdateDrawingParameters();
// Handle Lucrecia's passive energy effects
HandleLucreciaLineEffects();
// Update all particle sets for items.
// This must be done here instead of in the item logic because these sets are not properly instanced
// in the global classes. Attempting to update them there will cause multiple updates to one set for multiple items.
@@ -205,15 +205,29 @@ namespace CalamityMod.CalPlayer
if (Player.HeldItem.type != ModContent.ItemType<SaharaSlicers>())
saharaSlicersBolts = 0;
if (Player.whoAmI == Main.myPlayer && Player.HeldItem.type == ModContent.ItemType<Starfleet>() && (Player.ownedProjectileCounts[ModContent.ProjectileType<StarfleetHoldout>()] == 0) && !Player.dead && !Main.mapFullscreen && !Player.mouseInterface)
// Spawning for items that have holdouts active when held
if (Player.whoAmI == Main.myPlayer && !Player.dead && !Main.mapFullscreen && !Player.mouseInterface)
{
int damage = (int)Player.GetTotalDamage<RangedDamageClass>().ApplyTo(Player.HeldItem.damage);
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType<StarfleetHoldout>(), damage, Player.HeldItem.knockBack, Player.whoAmI);
}
if (Player.whoAmI == Main.myPlayer && Player.HeldItem.type == ModContent.ItemType<Starmada>() && (Player.ownedProjectileCounts[ModContent.ProjectileType<StarmadaHoldout>()] == 0) && !Player.dead && !Main.mapFullscreen && !Player.mouseInterface)
{
int damage = (int)Player.GetTotalDamage<RangedDamageClass>().ApplyTo(Player.HeldItem.damage);
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType<StarmadaHoldout>(), damage, Player.HeldItem.knockBack, Player.whoAmI);
if (Player.HeldItem.type == ModContent.ItemType<Starfleet>() && (Player.ownedProjectileCounts[ModContent.ProjectileType<StarfleetHoldout>()] == 0))
{
int damage = (int)Player.GetTotalDamage<RangedDamageClass>().ApplyTo(Player.HeldItem.damage);
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType<StarfleetHoldout>(), damage, Player.HeldItem.knockBack, Player.whoAmI);
}
if (Player.HeldItem.type == ModContent.ItemType<Starmada>() && (Player.ownedProjectileCounts[ModContent.ProjectileType<StarmadaHoldout>()] == 0))
{
int damage = (int)Player.GetTotalDamage<RangedDamageClass>().ApplyTo(Player.HeldItem.damage);
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType<StarmadaHoldout>(), damage, Player.HeldItem.knockBack, Player.whoAmI);
}
if (Player.HeldItem.type == ModContent.ItemType<Basher>() && (Player.ownedProjectileCounts[ModContent.ProjectileType<BasherHoldout>()] == 0))
{
int damage = (int)Player.GetTotalDamage<TrueMeleeDamageClass>().ApplyTo(Player.HeldItem.damage);
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType<BasherHoldout>(), damage, Player.HeldItem.knockBack, Player.whoAmI);
}
if (Player.HeldItem.type == ModContent.ItemType<GrandDad>() && (Player.ownedProjectileCounts[ModContent.ProjectileType<GrandDadHoldout>()] == 0))
{
int damage = (int)Player.GetTotalDamage<TrueMeleeDamageClass>().ApplyTo(Player.HeldItem.damage);
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType<GrandDadHoldout>(), damage, Player.HeldItem.knockBack, Player.whoAmI);
}
}
// De-equipping Gael's Greatsword deletes all rage.
@@ -291,7 +305,7 @@ namespace CalamityMod.CalPlayer
}
// First Frame dash effects
bool dashStart = (Player.dashDelay == -1 && ((!HasCustomDash && IsFirstDashFrame) || (HasCustomDash && UsedDash.DashTimeAdjustedForStartup == 1)));
bool dashStart = (Player.Calamity().DashID == DefaultDash.ID && Player.timeSinceLastDashStarted == 1 && Player.dashDelay != 0 ) || (Player.dashDelay == -1 && ((!HasCustomDash && IsFirstDashFrame) || (HasCustomDash && UsedDash.DashTimeAdjustedForStartup == 1)));
int dir = MathF.Sign(Player.velocity.X);
if (dashStart)
@@ -397,120 +411,6 @@ namespace CalamityMod.CalPlayer
Player.wingTime++;
}
if (Player.HeldItem.type == ModContent.ItemType<Lucrecia>() && darklightEnergy > 0)
{
if (darklightEnergy == Lucrecia.MaxEnergy && !darklightEnergyPaused)
{
darklightEnergyPaused = true;
darklightEnergyTimer = 0;
}
darklightEnergyTimer++;
// If the energy is at max, pause for 180 ticks
if (darklightEnergyPaused)
{
if (darklightEnergyTimer >= 1 && !darklightEnergyMaxFXPlayed)
{
SoundStyle maxEnergyReached = new("CalamityMod/Sounds/Custom/AbilitySounds/DarklightEnergyCharged");
SoundEngine.PlaySound(maxEnergyReached with { Volume = 0.9f }, Player.Center);
for (int i = 0; i < 10; i++) // Circular ring of particles burst from player
{
float angle = MathHelper.TwoPi * (i / 10f);
Vector2 spawnDirection = angle.ToRotationVector2();
Vector2 velocity = spawnDirection * 14f;
CritSpark spark = new CritSpark(Player.Center + spawnDirection * 3f, velocity, Color.Lerp(Color.CornflowerBlue, Color.MediumPurple, Main.rand.NextFloat(1f)), Color.White * 0.33f, 1.2f, 12, 0.3f, 1.2f);
GeneralParticleHandler.SpawnParticle(spark);
}
darklightEnergyMaxFXPlayed = true;
}
// If the pause is Done, resume decrementing.
if (darklightEnergyTimer >= 180)
{
darklightEnergyPaused = false;
darklightEnergyTimer = 0;
darklightEnergy--;
}
}
else // Decrementing
{
darklightEnergyMaxFXPlayed = false;
// Once every 20 ticks
if (darklightEnergyTimer >= 20)
{
darklightEnergy--;
darklightEnergyTimer = 0;
}
}
}
else
{
// Reset all energy variables when not holding the weapon
darklightEnergyTimer = 0;
darklightEnergyPaused = false;
darklightEnergy = 0;
}
if (Player.HeldItem.type == ModContent.ItemType<Lightspeed>() && elementalMastery > 0)
{
if (elementalMastery == Lightspeed.MaxEnergy && !elementalMasteryPaused)
{
elementalMasteryPaused = true;
elementalMasteryTimer = 0;
}
elementalMasteryTimer++;
// If the mastery is at max, pause for 180 ticks
if (elementalMasteryPaused)
{
if (elementalMasteryTimer >= 1 && !elementalMasterySFXPlayed)
{
SoundStyle maxEnergyReached = new("CalamityMod/Sounds/Custom/AbilitySounds/DarklightEnergyCharged");
SoundEngine.PlaySound(maxEnergyReached with { Volume = 0.9f }, Player.Center);
for (int i = 0; i < 10; i++) // Circular ring of particles burst from player
{
float angle = MathHelper.TwoPi * (i / 10f);
Vector2 spawnDirection = angle.ToRotationVector2();
Vector2 velocity = spawnDirection * 14f;
CritSpark spark = new CritSpark(Player.Center + spawnDirection * 3f, velocity, Color.Lerp(Color.CornflowerBlue, Color.MediumPurple, Main.rand.NextFloat(1f)), Color.White * 0.33f, 1.2f, 12, 0.3f, 1.2f);
GeneralParticleHandler.SpawnParticle(spark);
}
elementalMasterySFXPlayed = true;
}
// If the pause is Done, resume decrementing.
if (elementalMasteryTimer >= 180)
{
elementalMasteryPaused = false;
elementalMasteryTimer = 0;
elementalMastery--;
}
}
else // Decrementing
{
elementalMasterySFXPlayed = false;
// Once every 30 ticks
if (elementalMasteryTimer >= 30)
{
elementalMastery--;
elementalMasteryTimer = 0;
}
}
}
else
{
// Reset all EM variables when not holding the weapon
elementalMasteryTimer = 0;
elementalMasteryPaused = false;
elementalMastery = 0;
}
if (Player.HeldItem.type == ModContent.ItemType<UnstableCastersGauntlet>() && unstableCastersGauntletVis < 100)
{
@@ -558,6 +458,30 @@ namespace CalamityMod.CalPlayer
}
if (v8Engine || v8000Engine)
{
if (Player.dashDelay == 1 && !v8EngineFXPlayed)
{
SoundStyle maxEnergyReached = new("CalamityMod/Sounds/Custom/ScornJump");
SoundEngine.PlaySound(maxEnergyReached with { Volume = 0.7f }, Player.Center);
for (int i = 0; i < 10; i++) // Circular ring of particles burst from player
{
float angle = MathHelper.TwoPi * (i / 10f);
Vector2 spawnDirection = angle.ToRotationVector2();
Vector2 velocity = spawnDirection * 18f;
CritSpark spark = new CritSpark(Player.Center + spawnDirection * 3f, velocity, Color.Lerp(Player.Calamity().DashID == V8EngineDash.ID ? Color.OrangeRed : Color.Cyan, Color.White, Main.rand.NextFloat(1f)), Color.White * 0.5f, 1.2f, 12, 0.3f, 1.2f);
GeneralParticleHandler.SpawnParticle(spark);
}
v8EngineFXPlayed = true;
}
if (Player.dashDelay == -1)
v8EngineFXPlayed = false;
}
if (XykVisualsBlue || XykVisualsOrange)
{
bool Orange = XykVisualsOrange;
@@ -629,7 +553,7 @@ namespace CalamityMod.CalPlayer
// Spawn sand veil when dashing if it does not exist and you do not have the cooldown
if (!(CalamityUtils.AnyProjectiles(ModContent.ProjectileType<SandCloakVeil>()) || Player.HasCooldown(Cooldowns.SandCloak.ID)))
{
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType<SandCloakVeil>(), 13, 2.5f, Player.whoAmI);
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType<SandCloakVeil>(), 10, 2.5f, Player.whoAmI);
SoundEngine.PlaySound(SoundID.Item45, Player.Center);
}
}
@@ -672,17 +596,6 @@ namespace CalamityMod.CalPlayer
{
if (Player.whoAmI == Main.myPlayer)
{
// Hallowed Armor nerf
if (Player.onHitDodge)
{
for (int l = 0; l < Player.MaxBuffs; l++)
{
int hasBuff = Player.buffType[l];
if (Player.buffTime[l] > 600 && hasBuff == BuffID.ShadowDodge)
Player.buffTime[l] = 600;
}
}
// Immunity Frames nerf
int immuneTimeLimit = 150;
if (Player.immuneTime > immuneTimeLimit)
@@ -1110,12 +1023,17 @@ namespace CalamityMod.CalPlayer
// Incinerate the target with either Vulnerability Hex or True Vulnerability Hex, depending on current cursor focus.
// This adds 8 to the buff duration, which results in a net increase of 3 frames every time damage is dealt, due to damage occurring every 5 frames.
int buffToInflict = target.Calamity().trueVulnerabilityHex ? ModContent.BuffType<TrueVulnerabilityHex>() : ModContent.BuffType<VulnerabilityHex>();
if (!target.HasBuff(buffToInflict))
target.AddBuff(buffToInflict, 52);
target.buffTime[target.FindBuffIndex(buffToInflict)] += 8;
if (target.buffTime[target.FindBuffIndex(buffToInflict)] < VulnerabilityHex.CalamityDuration)
target.buffTime[target.FindBuffIndex(buffToInflict)] = VulnerabilityHex.CalamityDuration;
int buffToInflict = target.Calamity().trueVulnerabilityHex ? ModContent.BuffType<TrueVulnerabilityHex>() : ModContent.BuffType<VulnerabilityHex>();
if (!target.buffImmune[buffToInflict])
{
if (!target.HasBuff(buffToInflict))
target.AddBuff(buffToInflict, 52);
int index = target.FindBuffIndex(buffToInflict);
if (index != -1)
target.buffTime[index] = Math.Max(target.buffTime[index] + 8, VulnerabilityHex.CalamityDuration);
}
// Make some fancy dust to indicate damage is being done.
for (int j = 0; j < 12; j++)
@@ -1130,8 +1048,39 @@ namespace CalamityMod.CalPlayer
}
}
private void DemonAltarTalking()
{
for (var h = -15; h < 15; h++)
{
for (var j = -15; j < 15; j++)
{
var tilePos = Player.Center.ToTileCoordinates() + new Point(h, j);
if (Main.tile[tilePos.X, tilePos.Y].TileType == TileID.DemonAltar)
{
string type = WorldGen.crimson ? "Mods.CalamityMod.EvilSmasher.CrimsonAltar" : "Mods.CalamityMod.EvilSmasher.DemonAltar";
if (DialogueDisplaySystem.ContainsDialogueKey(type))
DialogueDisplaySystem.RemoveDialogue(DialogueDisplaySystem.GetSlot(type));
DialogueDisplaySystem.StartDialogueOnClient(type, new Vector2(tilePos.X * 16 + 16, tilePos.Y * 16), DemonAltarDialogueCounter, 180, false, new AltarText());
DemonAltarDialogueCounter++;
DemonAltarDialogueCooldown = 300;
if (DemonAltarDialogueCounter >= 4)
{
DemonAltarDialogueCooldown = 3600;
DemonAltarDialogueCounter = 0;
}
return;
}
}
}
}
private void MiscEffects()
{
if (Player.inventory.Any(x => x.type == ItemID.Pwnhammer) && !Player.inventory.Any(x => x.type == ModContent.ItemType<EvilSmasher>()) && Player.adjTile[TileID.DemonAltar] && DemonAltarDialogueCooldown <= 0 && Player.miscCounter % 30 == 0)
{
DemonAltarTalking();
}
//Mana Burn update
if (ManaBurnFireDrawer != null)
{
@@ -1300,7 +1249,7 @@ namespace CalamityMod.CalPlayer
}
if (brittleStar && brittleStarBuffMode)
Player.statDefense += 4 * Player.ownedProjectileCounts[ModContent.ProjectileType<BrittleStarMinion>()];
Player.statDefense += BrittleStarStaff.DefenseBoostPerBuffStar * Player.ownedProjectileCounts[ModContent.ProjectileType<BrittleStarMinion>()];
// Reduce the rate of recovery of the Lifesteal variable
// Classic Mode: 36 HP/s to 12 HP/s
@@ -1421,19 +1370,31 @@ namespace CalamityMod.CalPlayer
}
}
// Hydrothermal blue smoke effects but it doesn't work epicccccc
if (Player.whoAmI == Main.myPlayer)
{
if (hydrothermalSmoke)
if (hydrothermalSmoke && !Main.dedServ)
{
// Release effects when the player moves.
if (Math.Abs(Player.velocity.X) > 0.1f || Math.Abs(Player.velocity.Y) > 0.1f)
{
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
var source = Player.GetSource_FromThis(HydrothermicArmor.VanitySmokeEntitySourceContext);
Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType<HydrothermalSmoke>(), 0, 0f, Player.whoAmI);
if (Main.rand.NextBool(6))
{
int fieryDust = Dust.NewDust(Player.Top + Vector2.UnitY, 20, 42, DustID.Flare, 0f, 0f, 100, default, 0.7f);
if (Main.rand.NextBool(4))
{
Main.dust[fieryDust].scale *= 0.35f;
}
Main.dust[fieryDust].velocity *= 0f;
}
if (Main.rand.NextBool(2))
{
float upwardVariation = Main.rand.NextFloat(-4.5f, -8f);
MediumMistParticle mist = new MediumMistParticle(Player.Top + Vector2.UnitY, -Player.velocity + new Vector2(0.5f, upwardVariation), Main.rand.NextBool(3) ? Color.LightSteelBlue : Color.Black, Color.Black, Main.rand.NextFloat(0.4f, 0.65f), 130);
GeneralParticleHandler.SpawnParticle(mist);
}
}
}
// Trying to find a workaround because apparently putting the bool in ResetEffects prevents it from working
if (!Player.armorEffectDrawOutlines)
{
hydrothermalSmoke = false;
@@ -1644,7 +1605,7 @@ namespace CalamityMod.CalPlayer
if (Player.whoAmI == Main.myPlayer)
{
Player.HealPlayer(15);
Player.HealPlayer(10);
if (profanedCrystal)
{
@@ -1892,7 +1853,7 @@ namespace CalamityMod.CalPlayer
{
if (numOfEnergy < energyCap)
{
int energyDamage = (int)Player.GetBestClassDamage().ApplyTo(8);
int energyDamage = (int)Player.GetBestClassDamage().ApplyTo(12);
Projectile energy = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, (Vector2.One * 4).RotatedByRandom(MathHelper.TwoPi), ModContent.ProjectileType<AmuletEnergy>(), energyDamage, 0f, Player.whoAmI, 0, numOfEnergy);
if (numOfEnergy + 1 == energyCap && Player.Calamity().sSpiritAmuletVisual)
{
@@ -2069,6 +2030,42 @@ namespace CalamityMod.CalPlayer
if (Player.velocity.Length() < 6)
hookPullVisuals = 0;
}
if (featherCrown)
{
int MaxSigils = 4; //Starts at 0, so cap is 5
if (mageCrownTimer == 0)
{
if (mageCrownCount <= MaxSigils && Main.myPlayer == Player.whoAmI)
{
mageCrownCount += 1;
float start = 360f / mageCrownCount;
Projectile.NewProjectile(Player.GetSource_Accessory(FindAccessory<FeatherCrown>()), new Vector2((int)(Player.Center.X + (Math.Sin(0 * start) * 300)), (int)(Player.Center.Y + (Math.Cos(0 * start) * 300))), Vector2.Zero, ModContent.ProjectileType<SpectralFeather>(), 0, 0, Player.whoAmI, 0, mageCrownCount);
}
mageCrownTimer = 120;
}
else if (!Player.dead)
{
mageCrownTimer--;
}
}
if (moonCrown)
{
int MaxSigils = 9; //Starts at 0, so cap is 10
if (mageCrownTimer == 0)
{
if (mageCrownCount <= MaxSigils && Main.myPlayer == Player.whoAmI)
{
mageCrownCount += 1;
float start = 360f / mageCrownCount;
Projectile.NewProjectile(Player.GetSource_Accessory(FindAccessory<MoonstoneCrown>()), new Vector2((int)(Player.Center.X + (Math.Sin(0 * start) * 300)), (int)(Player.Center.Y + (Math.Cos(0 * start) * 300))), Vector2.Zero, ModContent.ProjectileType<MoonSigil>(), 0, 0, Player.whoAmI, 0, mageCrownCount);
}
mageCrownTimer = 120;
}
else if (!Player.dead)
{
mageCrownTimer--;
}
}
if (unstableGraniteCore)
{
@@ -2131,7 +2128,7 @@ namespace CalamityMod.CalPlayer
if (whitewaterHeal > 0)
{
if (whitewaterHeal % 15 == 0)
if (whitewaterHeal % 20 == 0)
Player.HealPlayer(1);
whitewaterHeal--;
@@ -2241,8 +2238,6 @@ namespace CalamityMod.CalPlayer
raiderSoundCooldown--;
if (astralStarRainCooldown > 0)
astralStarRainCooldown--;
if (AbaddonCooldown > 0)
AbaddonCooldown--;
if (VoidCooldown > 0)
VoidCooldown--;
if (ursaSergeantCooldown > 0)
@@ -2259,8 +2254,8 @@ namespace CalamityMod.CalPlayer
silvaMageCooldown--;
if (scuttlerCooldown > 0)
scuttlerCooldown--;
if (rogueCrownCooldown > 0)
rogueCrownCooldown--;
if (nanotechHitCooldown > 0)
nanotechHitCooldown--;
if (spectralVeilImmunity > 0)
spectralVeilImmunity--;
if (jetPackDash > 0)
@@ -2316,6 +2311,10 @@ namespace CalamityMod.CalPlayer
ataxiaDmg -= 1.5f;
if (ataxiaDmg < 0f)
ataxiaDmg = 0f;
if (hydroHealTimer > 0f)
hydroHealTimer -= 0.05f;
if (ataxiaDmg < 0f)
ataxiaDmg = 0f;
if (xerocDmg > 0f)
xerocDmg -= 2f;
if (xerocDmg < 0f)
@@ -2726,8 +2725,8 @@ namespace CalamityMod.CalPlayer
{
if (Player.isNearFairy())
{
Player.lifeRegen += 4;
Player.statDefense += 6;
Player.lifeRegen += 2;
Player.statDefense += 4;
Player.moveSpeed += 0.1f;
}
}
@@ -2804,10 +2803,10 @@ namespace CalamityMod.CalPlayer
Player.buffImmune[BuffID.Chilled] = true;
}
// Cosmic Discharge Cosmic Freeze buff, gives surrounding enemies the Glacial State debuff
// Cosmic Discharge Cosmic Freeze buff, gives surrounding enemies the Frozen debuff
if (cFreeze)
{
int buffType = ModContent.BuffType<GlacialState>();
int buffType = BuffID.Frozen;
float freezeDist = 200f;
if (Player.whoAmI == Main.myPlayer)
{
@@ -3421,14 +3420,13 @@ namespace CalamityMod.CalPlayer
if (graxDefense)
{
Player.statDefense += Grax.DefenseBoost;
Player.endurance += Grax.DamageReductionBoost;
Player.GetDamage<GenericDamageClass>() += Grax.DamageBoost;
}
// Trinket of Chi bonus
if (trinketOfChi)
{
if (chiBuffTimer < TrinketofChi.ChiBuffTimerMax)
if (chiBuffTimer < TrinketofChi.ChiBuffHitlessTime)
chiBuffTimer++;
else
Player.AddBuff(ModContent.BuffType<ChiBuff>(), 6);
@@ -3620,11 +3618,6 @@ namespace CalamityMod.CalPlayer
if (Player.HeldItem.type != ModContent.ItemType<PridefulHuntersPlanarRipper>())
planarSpeedBoost = 0;
}
if (evilSmasherBoost > 0)
{
if (Player.HeldItem.type != ModContent.ItemType<EvilSmasher>())
evilSmasherBoost = 0;
}
// Flight time boosts
double flightTimeMult = 1D +
@@ -3708,24 +3701,24 @@ namespace CalamityMod.CalPlayer
if (tarraSet)
Player.lifeMagnet = true;
if (whisperingDeath && !laudanum && !purity)
if (whisperingDeath && !laudanum)
Player.GetDamage<GenericDamageClass>() -= 0.2f;
if (armorCrunch && !laudanum && !purity)
if (armorCrunch && !laudanum)
{
Player.statDefense -= ArmorCrunch.DefenseReduction;
Player.endurance *= ArmorCrunch.MultiplicativeDamageReductionPlayer;
}
if (wither && !purity)
if (wither)
{
Player.statDefense -= RemsRevenge.WitherDefenseReduction;
}
if (eutrophication && !purity)
if (eutrophication)
Player.velocity = Vector2.Zero;
if ((vaporfied && !purity) || galvanicCorrosion)
if (vaporfied || galvanicCorrosion)
Player.velocity *= 0.98f;
if (molluskHelmet)
@@ -3735,7 +3728,7 @@ namespace CalamityMod.CalPlayer
if (molluskLegs)
Player.velocity.X *= 0.996f;
if ((warped) && !Player.slowFall && !Player.mount.Active)
if (warped && !Player.slowFall && !Player.mount.Active)
{
float velocityYMultiplier = 1.01f;
Player.velocity.Y *= velocityYMultiplier;
@@ -4426,82 +4419,6 @@ namespace CalamityMod.CalPlayer
}
#endregion
#region Lucrecia Line Effects
public void HandleLucreciaLineEffects()
{
int lucreciaItemID = ModContent.ItemType<Lucrecia>();
int lightspeedItemID = ModContent.ItemType<Lightspeed>();
if (Player.HeldItem.type == lucreciaItemID && darklightEnergy > 0)
{
lucreciaParticleTimer--;
// If the timer is at or below zero, spawn a particle.
if (lucreciaParticleTimer <= 0)
{
// Reset the timer (spawn rate depends on energy)
lucreciaParticleTimer = (int)(20 - 15 * (darklightEnergy / 60));
float radius = Main.rand.NextFloat(160f, 190f); // Distance from center
float spawnAngle = Main.rand.NextFloat(MathHelper.TwoPi); // Random angle along the whole radius
Vector2 spawnPosition = Player.Center + spawnAngle.ToRotationVector2() * radius;
// Scale opacity with energy
float opacity = darklightEnergy / (float)Lucrecia.MaxEnergy;
Color color = Main.rand.NextBool() ? Color.MediumPurple : Color.CornflowerBlue;
color *= opacity * 0.5f;
if (darklightEnergy >= 100)
{
color *= 2.4f; // Way brighter
}
Vector2 dummyVelocity = Vector2.Zero; // We dont want the argument where this is used to have influence on the actual path
float rotationSpeed = 0.04f;
var particle = new RoundedStarParticle(spawnPosition, dummyVelocity, color with { A = 0 }, Main.rand.NextFloat(0.05f, 0.065f), Main.rand.Next(30, 60), rotationSpeed, 1f, true, Player.Center, Player.whoAmI);
GeneralParticleHandler.SpawnParticle(particle);
}
}
if (Player.HeldItem.type == lightspeedItemID && elementalMastery > 0)
{
lucreciaParticleTimer--;
// If the timer is at or below zero, spawn a particle.
if (lucreciaParticleTimer <= 0)
{
// Reset the timer (spawn rate depends on energy)
lucreciaParticleTimer = (int)(20 - 15 * (elementalMastery / 60));
float radius = Main.rand.NextFloat(160f, 190f); // Distance from center
float spawnAngle = Main.rand.NextFloat(MathHelper.TwoPi); // Random angle along the whole radius
Vector2 spawnPosition = Player.Center + spawnAngle.ToRotationVector2() * radius;
// Scale opacity with energy
float opacity = elementalMastery / (float)Lightspeed.MaxEnergy;
Color color = Main.rand.NextBool() ? Color.Aqua : Color.OrangeRed;
color *= opacity * 0.5f;
if (elementalMastery >= 100)
{
color *= 2.4f; // Way brighter
}
Vector2 dummyVelocity = Vector2.Zero; // We dont want the argument where this is used to have influence on the actual path
float rotationSpeed = 0.04f;
var particle = new RoundedStarParticle(spawnPosition, dummyVelocity, color with { A = 0 }, Main.rand.NextFloat(0.05f, 0.065f), Main.rand.Next(30, 60), rotationSpeed, 1f, true, Player.Center, Player.whoAmI);
GeneralParticleHandler.SpawnParticle(particle);
}
}
}
#endregion
#region Energy Shields
private void EnergyShields()
{
+33 -74
View File
@@ -54,7 +54,7 @@ namespace CalamityMod.CalPlayer
if (AdamantiteSet)
{
adamantiteSetDefenseBoostInterpolant += 1.75f / AdamantiteArmorSetChange.TimeUntilBoostCompletelyDecays;
adamantiteSetDefenseBoostInterpolant += 1f / AdamantiteArmorSetChange.TimeUntilBoostCompletelyDecays;
adamantiteSetDefenseBoostInterpolant = MathHelper.Clamp(adamantiteSetDefenseBoostInterpolant, 0f, 1f);
AdamantiteSetDecayDelay = AdamantiteArmorSetChange.TimeUntilDecayBeginsAfterAttacking;
}
@@ -249,7 +249,7 @@ namespace CalamityMod.CalPlayer
if (proj.IsMinionOrSentryRelated)
center = proj.Center;
Vector2 launchVel = Utils.DirectionTo(center, target.Center);
target.MoveNPC(launchVel, proj.knockBack, true);
target.MoveNPC(launchVel, proj.knockBack, true, Player);
}
if (moscowMule || bloodyMary)
@@ -316,10 +316,6 @@ namespace CalamityMod.CalPlayer
target.AddBuff(BuffID.Venom, 60);
break;
case ProjectileID.BoneArrow:
target.AddBuff(BuffType<Crumbling>(), 300);
break;
case ProjectileID.NorthPoleWeapon:
target.AddBuff(BuffID.Frostburn, 300);
break;
@@ -695,14 +691,14 @@ namespace CalamityMod.CalPlayer
if (alchFlask && AlchFlaskCooldown == 0 && proj.type != ProjectileType<BasicPlagueBee>())
{
int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(10);
int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(Player.strongBees ? 15 : 10);
Vector2 seekerVelocity = new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.2f);
Projectile bee = Projectile.NewProjectileDirect(source, position, seekerVelocity, ProjectileType<BasicPlagueBee>(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2);
bee.ArmorPenetration = 20;
bee.penetrate = 2;
bee.extraUpdates = 1;
AlchFlaskCooldown = Player.strongBees ? 6 : 7;
AlchFlaskCooldown = 7;
}
bool lifeAndShieldCondition = Player.statLife >= Player.statLifeMax2 && (!HasAnyEnergyShield || TotalEnergyShielding >= TotalMaxShieldDurability);
@@ -733,20 +729,6 @@ namespace CalamityMod.CalPlayer
}
}
if (abaddon && crit && AbaddonCooldown <= 0 && !voidOfExtinction)
{
AbaddonCooldown = 15;
int AbaddonExploDamage = (int)Player.GetBestClassDamage().ApplyTo(Abaddon.AbaddonExploDamage);
Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType<AbaddonCrit>(), AbaddonExploDamage, 0f, Player.whoAmI);
}
if (voidOfExtinction && crit && VoidCooldown <= 0)
{
VoidCooldown = 15;
int VoidExploDamage = (int)Player.GetBestClassDamage().ApplyTo(VoidofExtinction.VoidExploDamage);
Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType<VoidofExtinctionCrit>(), VoidExploDamage, 0f, Player.whoAmI);
}
if (ursaSergeant && ursaSergeantCooldown <= 0)
{
ursaSergeantCooldown = UrsaSergeant.MaxCooldown;
@@ -776,7 +758,7 @@ namespace CalamityMod.CalPlayer
if (hideOfDeus && hideOfDeusTimer == 0)
{
hideOfDeusTimer = 10;
int bulwarkStarDamage = (int)Player.GetTotalDamage<MeleeDamageClass>().ApplyTo(320);
int bulwarkStarDamage = (int)Player.GetTotalDamage<MeleeDamageClass>().ApplyTo(HideofAstrumDeus.StarDamage);
for (int n = 0; n < 3; n++)
CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 29f, ProjectileType<AstralStar>(), bulwarkStarDamage, 5f, Player.whoAmI);
@@ -1072,10 +1054,9 @@ namespace CalamityMod.CalPlayer
break;
}
}
if (modProj.stealthStrike && rogueCrownCooldown <= 0 && modProj.stealthStrikeHitCount < 3)
if (modProj.stealthStrike && nanotechHitCooldown <= 0 && modProj.stealthStrikeHitCount < 3)
{
bool spawnedFeathers = false;
bool spawnedFlares = false;
if (nanotech)
{
for (int i = 0; i < 3; i++)
@@ -1086,41 +1067,7 @@ namespace CalamityMod.CalPlayer
Projectile.NewProjectile(spawnSource, source, velocity, ProjectileType<NanoFlare>(), damage, 3f, proj.owner);
}
}
else if (moonCrown)
{
int lunarFlareDamage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(MoonstoneCrown.BaseDamage);
float lunarFlareKB = 3f;
for (int i = 0; i < 3; i++)
{
Vector2 source = new Vector2(position.X + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50));
Vector2 velocity = (position - source) / 10f;
int flare = Projectile.NewProjectile(spawnSource, source, velocity, ProjectileID.LunarFlare, lunarFlareDamage, lunarFlareKB, proj.owner);
if (flare.WithinBounds(Main.maxProjectiles))
Main.projectile[flare].DamageType = DamageClass.Generic;
}
}
else if (featherCrown)
{
for (int i = 0; i < 3; i++)
{
Vector2 source = new Vector2(position.X + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50));
float speedX = (position.X - source.X) / 30f;
float speedY = (position.Y - source.Y) * 8;
Vector2 velocity = new Vector2(speedX, speedY);
int featherDamage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(25);
int feather = Projectile.NewProjectile(spawnSource, source, velocity, ProjectileType<StickyFeather>(), featherDamage, 3f, proj.owner);
if (feather.WithinBounds(Main.maxProjectiles))
{
Main.projectile[feather].DamageType = DamageClass.Generic;
Main.projectile[feather].extraUpdates += 3;
}
}
spawnedFeathers = true;
}
rogueCrownCooldown = spawnedFeathers ? 15 : 60;
nanotechHitCooldown = spawnedFlares ? 15 : 60;
}
if (titanHeartSet && modProj.stealthStrike && titanCooldown <= 0 && modProj.stealthStrikeHitCount < 3)
@@ -1235,12 +1182,25 @@ namespace CalamityMod.CalPlayer
target.AddBuff(BuffType<AstralInfectionDebuff>(), TitanHeartMask.OnHitDebuffDuration);
}
}
if (magic)
{
if (moonCrown && mageCrownCount == 10)
{
target.AddBuff(BuffType<Nightwither>(), 360);
}
if(featherCrown && mageCrownCount == 5)
{
target.AddBuff(BuffType<StaticDischarge>(), 120);
}
}
if (summon && !whip)
{
if (profanedCrystal && DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs)
if (profanedCrystal && (DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs))
{
target.AddBuff(BuffType<HolyFlames>(), 600);
}
else if (pSoulArtifact)
target.AddBuff(BuffType<HolyFlames>(), 300);
target.AddBuff(BuffType<HolyFlames>(), 300);
if (divineBless)
target.AddBuff(BuffType<BanishingFire>(), AngelicAlliance.BanishingFireDuration);
@@ -1266,10 +1226,10 @@ namespace CalamityMod.CalPlayer
}
if (amalgam)
{
target.AddBuff(BuffID.Daybreak, 120);
target.AddBuff(BuffType<Nightwither>(), 120);
target.AddBuff(BuffType<BrimstoneFlames>(), 120);
target.AddBuff(BuffID.Frostburn2, 120);
target.AddBuff(BuffType<Plague>(), 120);
target.AddBuff(BuffType<VermillionFlux>(), 120);
target.AddBuff(BuffID.Electrified, 120);
target.AddBuff(BuffType<CrushDepth>(), 120);
}
if (frostFlare)
@@ -1334,28 +1294,27 @@ namespace CalamityMod.CalPlayer
if (heal > 2)
heal = 2;
Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, heal, (raiderCritLifespan > 0 && !proj.Calamity().stealthStrike) ? 1.3f : 1.6f);
Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, heal, (raiderCritLifespan > 0 && !proj.Calamity().stealthStrike) ? 1.2f : 1.5f);
}
if (bloodyGlove && proj.CountsAsClass<RogueDamageClass>() && modProj.stealthStrike && proj.numHits < 1)
//Nanotech has the same heal as Electrician's glove
Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, electricianGlove ? 10 : 5, 2f);
if (bloodflareThrowing && proj.CountsAsClass<ThrowingDamageClass>() && crit)
Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, 2, 1.5f);
Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, electricianGlove ? 10 : 5, electricianGlove ? 2f : 3f);
if (proj.CountsAsClass<MagicDamageClass>() && Player.HeldItem.CountsAsClass<MagicDamageClass>())
{
if (manaOverloader)
{
double healMult = 0.1D - proj.numHits * 0.025D;
Player.SpawnLifeStealProjectile(target, proj, ProjectileType<ManaPolarizerHealOrb>(), (int)Math.Round(damage * healMult), 1.75f);
Player.SpawnLifeStealProjectile(target, proj, ProjectileType<ManaPolarizerHealOrb>(), (int)Math.Round(damage * healMult), 2f);
}
if (ataxiaMage)
if (ataxiaMage && hydroHealTimer <= 0)
{
double healMult = HydrothermicHeadMagic.OrbHealingRatio - proj.numHits * HydrothermicHeadMagic.OrbHealingRatioLossPerPierce;
Player.SpawnLifeStealProjectile(target, proj, ProjectileType<HydrothermicHealOrb>(), (int)Math.Round(damage * healMult), HydrothermicHeadMagic.OrbHealingCooldownMult);
var heal = (int)Math.Round(damage * healMult);
hydroHealTimer += heal;
Player.SpawnLifeStealProjectile(target, proj, ProjectileType<HydrothermicHealOrb>(), heal, HydrothermicHeadMagic.OrbHealingCooldownMult);
}
}
}
+190
View File
@@ -0,0 +1,190 @@
using System;
using CalamityMod.Dusts;
using CalamityMod.Enums;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Magic;
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.CalPlayer.Dashes
{
public class V8000EngineDash : PlayerDashEffect
{
public static new string ID { get; private set; }
public override DashCollisionType CollisionType => DashCollisionType.ShieldSlam;
public override bool IsOmnidirectional => false;
public int Time = 0;
public override void Load()
{
ID = DashID;
}
public override float CalculateDashSpeed(Player player) => 16f;
public override void DashStartupEffects(Player player)
{
player.velocity *= 0.9f;
}
public override void OnDashEffects(Player player)
{
Time = 0;
// Burst of evenly spaced but random velocity dusts
for (int m = 0; m < 6; m++)
{
float fxFade = Utils.GetLerpValue(5, 15, Math.Abs(player.velocity.X), true);
Vector2 trailPos = player.Center - (player.velocity * 2) + new Vector2(0, (18 - (m * 6)));
float trailScale = 1 * fxFade;
Color trailColor = Main.rand.NextBool(3) ? Color.DodgerBlue : Color.LightSkyBlue;
int dustStyle = ModContent.DustType<SquashDust>();
Dust dust2 = Dust.NewDustPerfect(trailPos, dustStyle, -player.velocity.SafeNormalize(Vector2.UnitX) * Main.rand.NextFloat(6, 21));
dust2.scale = Main.rand.NextFloat(0.8f, 1.4f);
dust2.color = trailColor;
dust2.noGravity = true;
dust2.fadeIn = 0.5f;
}
// Thruster prim
int beamCount = 3;
float maxAngle = MathHelper.ToRadians(10f);
Vector2 baseDir = -player.velocity.SafeNormalize(Vector2.UnitX);
for (int i = -1; i < beamCount; i++)
{
float t = i / (float)(beamCount - 1);
float centered = t * 2f - 1f;
float angleOffset = centered * maxAngle;
Vector2 dir = baseDir.RotatedBy(angleOffset);
float sizeFactor = 1f - Math.Abs(centered) * 0.7f;
ThrusterParticle particle = new ThrusterParticle(player, dir, 16, 120f * sizeFactor, 1);
GeneralParticleHandler.SpawnParticle(particle, false, GeneralDrawLayer.BeforeProjectiles);
}
SoundStyle sound = V8000Engine.DashSound;
SoundEngine.PlaySound(sound with { Volume = 0.5f, Pitch = Main.rand.NextFloat(-0.4f, -0.3f) }, player.Center);
}
public override void MidDashEffects(Player player, ref float dashSpeed, ref float dashSpeedDecelerationFactor, ref float runSpeedDecelerationFactor)
{
Time++; // For VFX
if (Time % 2 == 0 && Time < 10)
{
// Angled, consistently placed sparks
Vector2 dustVel = -player.velocity.RotatedBy(0.05f + MathHelper.Clamp(Time * 0.03f, 0, 0.55f)) * 0.75f;
Vector2 dustVel2 = -player.velocity.RotatedBy(-0.05f - MathHelper.Clamp(Time * 0.03f, 0, 0.55f)) * 0.75f;
PointParticle spark = new PointParticle(player.Center + new Vector2(0, -15 * player.direction) + dustVel, dustVel, false, 8, 1.25f, (Main.rand.NextBool() ? Color.DodgerBlue : Color.LightSkyBlue) * 0.66f);
GeneralParticleHandler.SpawnParticle(spark);
PointParticle spark2 = new PointParticle(player.Center + new Vector2(0, 15 * player.direction) + dustVel2, dustVel2, false, 8, 1.25f, (Main.rand.NextBool() ? Color.DodgerBlue : Color.LightSkyBlue) * 0.66f);
GeneralParticleHandler.SpawnParticle(spark2);
// Glow beam
float fadeInLerp = Utils.GetLerpValue(0, 12, Time, true);
Color primaryColor = Color.Lerp(Color.DodgerBlue, Color.LightSkyBlue, fadeInLerp);
Particle beamBody = new CustomSpark(player.Center, -player.velocity * 0.15f, "CalamityMod/Particles/BloomCircle", false, 7, 0.65f - 0.3f * fadeInLerp, primaryColor * 0.8f, new Vector2(1.1f - 0.4f * fadeInLerp, 0.8f + 0.6f * fadeInLerp), true, true, shrinkSpeed: 0.6f);
GeneralParticleHandler.SpawnParticle(beamBody);
Particle beamCore = new CustomSpark(player.Center, -player.velocity * 0.15f, "CalamityMod/Particles/BloomCircle", false, 5, 0.35f - 0.15f * fadeInLerp, Color.Lerp(primaryColor, Color.White, 0.6f), new Vector2(0.5f, 1.4f), true, true, shrinkSpeed: 0.6f);
GeneralParticleHandler.SpawnParticle(beamCore);
// Horizontal dust
float fxFade = Utils.GetLerpValue(5, 15, Math.Abs(player.velocity.X), true);
Vector2 trailPos = player.Center - (player.velocity * 2) + Main.rand.NextVector2Circular(10, 20);
float trailScale = 1 * fxFade;
Color trailColor = Main.rand.NextBool(3) ? Color.DodgerBlue : Color.LightSkyBlue;
int dustStyle = ModContent.DustType<SquashDust>();
Dust dust2 = Dust.NewDustPerfect(trailPos, dustStyle, -player.velocity.SafeNormalize(Vector2.UnitX) * Main.rand.NextFloat(6, 21));
dust2.scale = Main.rand.NextFloat(0.8f, 1.4f);
dust2.color = trailColor;
dust2.noGravity = true;
dust2.fadeIn = 0.5f;
}
// SHPS-esque souls
if (Time % 4 == 0)
{
if (player.whoAmI == Main.myPlayer)
{
Vector2 spawnPos = player.Center + Main.rand.NextVector2Circular(10, 10);
Vector2 trailVel = -player.velocity * 0.6f + Main.rand.NextVector2Circular(3f, 3f);
Projectile.NewProjectile(player.GetSource_FromThis(), spawnPos, trailVel, ModContent.ProjectileType<V8000SoulVisual>(), 0, 0, player.whoAmI);
}
}
dashSpeed = 14f;
}
public override void OnHitEffects(Player player, NPC npc, IEntitySource source, ref DashHitContext hitContext)
{
SoundStyle hit = new("CalamityMod/Sounds/Item/DoomsdayDeviceImpact");
SoundEngine.PlaySound(hit with { Pitch = -0.2f, Volume = 0.4f }, player.Center);
SoundEngine.PlaySound(SoundID.DD2_ExplosiveTrapExplode with { Volume = 1f, Pitch = -0.2f }, player.Center);
SoundEngine.PlaySound(SoundID.Item74 with { Volume = 0.7f, Pitch = 1f }, player.Center);
for (int i = 0; i <= 6; i++)
{
Dust dust = Dust.NewDustPerfect(player.Center, Main.rand.NextBool() ? 278 : 132, player.velocity.RotatedByRandom(0.7f) * Main.rand.NextFloat(0.5f, 1f) + new Vector2(0, -3f));
if (dust.type == 278)
{
dust.scale = 1.2f;
dust.color = Main.rand.NextBool() ? Color.DodgerBlue : Color.LightSkyBlue;
}
else
{
dust.scale = 0.9f;
}
dust.noGravity = false;
dust.shader = GameShaders.Armor.GetSecondaryShader(player.cShield, player);
}
Particle pulse = new DirectionalPulseRing(npc.Center, Vector2.Zero, Color.DodgerBlue * 0.8f, new Vector2(2f, 2f), 0, 0.05f, 1f, 24);
GeneralParticleHandler.SpawnParticle(pulse);
for (int i = 0; i < 14; i++)
{
Vector2 velocity = Vector2.One.RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(3f, 7f);
Color dustColor = Color.Lerp(Color.DodgerBlue, Color.White, Main.rand.NextFloat());
float scale = Main.rand.NextFloat(0.25f, .6f);
int lifetime = Main.rand.Next(30, 50);
SquishyLightParticle plasma = new(player.Center, velocity, scale, dustColor, lifetime);
GeneralParticleHandler.SpawnParticle(plasma);
}
// Define hit context variables.
int hitDirection = player.direction;
if (player.velocity.X != 0f)
hitDirection = Math.Sign(player.velocity.X);
hitContext.HitDirection = hitDirection;
hitContext.PlayerImmunityFrames = V8000Engine.ShieldSlamIFrames;
// Define damage parameters.
hitContext.damageClass = DamageClass.Melee;
hitContext.BaseDamage = V8000Engine.ShieldSlamDamage;
hitContext.BaseKnockback = V8000Engine.ShieldSlamKnockback;
}
}
}
+117
View File
@@ -0,0 +1,117 @@
using System;
using CalamityMod.Dusts;
using CalamityMod.Enums;
using CalamityMod.Graphics.Renderers;
using CalamityMod.Items.Accessories;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.GameContent.Drawing;
using Terraria.GameContent.Items;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.CalPlayer.Dashes
{
public class V8EngineDash : PlayerDashEffect
{
public static new string ID { get; private set; }
public override DashCollisionType CollisionType => DashCollisionType.NoCollision;
public override bool IsOmnidirectional => false;
public int Time = 0;
public override void Load()
{
ID = DashID;
}
public override float CalculateDashSpeed(Player player) => 6.5f;
public override void OnDashEffects(Player player)
{
Time = 0;
// Burst of evenly spaced but random velocity dusts
for (int m = 0; m < 6; m++)
{
float fxFade = Utils.GetLerpValue(5, 15, Math.Abs(player.velocity.X), true);
Vector2 trailPos = player.Center - (player.velocity * 2) + new Vector2(0, (18 - (m * 6)));
float trailScale = 1 * fxFade;
Color trailColor = Main.rand.NextBool(3) ? Color.Firebrick : Color.OrangeRed;
int dustStyle = ModContent.DustType<SquashDust>();
Dust dust2 = Dust.NewDustPerfect(trailPos, dustStyle, -player.velocity.SafeNormalize(Vector2.UnitX) * Main.rand.NextFloat(5, 16));
dust2.scale = Main.rand.NextFloat(0.8f, 1.3f);
dust2.color = trailColor;
dust2.noGravity = true;
dust2.fadeIn = 0.5f;
}
// Thruster prim
int beamCount = 3;
float maxAngle = MathHelper.ToRadians(10f);
Vector2 baseDir = -player.velocity.SafeNormalize(Vector2.UnitX);
for (int i = -1; i < beamCount; i++)
{
float t = i / (float)(beamCount - 1);
float centered = t * 2f - 1f;
float angleOffset = centered * maxAngle;
Vector2 dir = baseDir.RotatedBy(angleOffset);
float sizeFactor = 1f - Math.Abs(centered) * 0.7f;
ThrusterParticle particle = new ThrusterParticle(player, dir, 12, 100f * sizeFactor, 0);
GeneralParticleHandler.SpawnParticle(particle, false, GeneralDrawLayer.BeforeProjectiles);
}
SoundStyle sound = V8Engine.DashSound;
SoundEngine.PlaySound(sound with { Volume = 0.5f, Pitch = Main.rand.NextFloat(-0.4f, -0.3f) }, player.Center);
}
public override void MidDashEffects(Player player, ref float dashSpeed, ref float dashSpeedDecelerationFactor, ref float runSpeedDecelerationFactor)
{
player.velocity.X *= 0.925f;
Dust hFlameDust = Dust.NewDustPerfect(player.Center + new Vector2(Main.rand.NextFloat(-6f, 6f), Main.rand.NextFloat(-15f, 15f)) - (player.velocity * 5f), DustID.HeatRay, -player.velocity.RotatedByRandom(MathHelper.ToRadians(10f)) * Main.rand.NextFloat(0.1f, 0.8f), 0, Color.Firebrick, Main.rand.NextFloat(1.8f, 2.8f));
// Angled, consistently placed sparks
Vector2 dustVel = -player.velocity.RotatedBy(0.05f + MathHelper.Clamp(Time * 0.03f, 0, 0.55f)) * 0.75f;
Vector2 dustVel2 = -player.velocity.RotatedBy(-0.05f - MathHelper.Clamp(Time * 0.03f, 0, 0.55f)) * 0.75f;
PointParticle spark = new PointParticle(player.Center + new Vector2(0, -15 * player.direction) + dustVel, dustVel, false, 8, 1.25f, (Main.rand.NextBool() ? Color.Firebrick : Color.OrangeRed) * 0.66f);
GeneralParticleHandler.SpawnParticle(spark);
PointParticle spark2 = new PointParticle(player.Center + new Vector2(0, 15 * player.direction) + dustVel2, dustVel2, false, 8, 1.25f, (Main.rand.NextBool() ? Color.Firebrick : Color.OrangeRed) * 0.66f);
GeneralParticleHandler.SpawnParticle(spark2);
// Glow beam
float fadeInLerp = Utils.GetLerpValue(0, 12, Time, true);
Color primaryColor = Color.Lerp(Color.Firebrick, Color.OrangeRed, fadeInLerp);
Particle beamBody = new CustomSpark(player.Center, -player.velocity * 0.15f, "CalamityMod/Particles/BloomCircle", false, 7, 0.65f - 0.3f * fadeInLerp, primaryColor * 0.8f, new Vector2(1.1f - 0.4f * fadeInLerp, 0.8f + 0.6f * fadeInLerp), true, false, shrinkSpeed: 0.6f);
GeneralParticleHandler.SpawnParticle(beamBody);
Particle beamCore = new CustomSpark(player.Center, -player.velocity * 0.15f, "CalamityMod/Particles/BloomCircle", false, 5, 0.35f - 0.15f * fadeInLerp, Color.Lerp(primaryColor, Color.White, 0.6f), new Vector2(0.5f, 1.2f), true, false, shrinkSpeed: 0.6f);
GeneralParticleHandler.SpawnParticle(beamCore);
for (int i = 0; i < 2; i++)
{
// Fruit loop particles, also used by Elysian Aegis
Dust dust = Dust.NewDustPerfect(player.Center + Main.rand.NextVector2Circular(6, 6) - player.velocity * 2.2f, DustID.GoldFlame);
dust.velocity = -player.velocity * Main.rand.NextFloat(0.66f, 1.8f);
dust.scale = Main.rand.NextFloat(0.4f, 1.3f);
dust.noGravity = true;
Particle sparkler = new CustomSpark(player.Center + new Vector2(Main.rand.NextFloat(-6f, 6f), Main.rand.NextFloat(-15f, 15f)) - (player.velocity * 1.2f), -player.velocity.RotatedByRandom(MathHelper.ToRadians(10f)) * Main.rand.NextFloat(0.1f, 0.8f), "CalamityMod/Particles/ProvidenceMarkParticle", false, 17, Main.rand.NextFloat(1.15f, 1.25f), Main.rand.NextBool(4) ? Color.Khaki : Color.Orange, new Vector2(1.3f, 0.5f), true, false, 0, false, false, Main.rand.NextFloat(0.4f, 0.5f));
GeneralParticleHandler.SpawnParticle(sparkler);
}
}
}
}
@@ -14,7 +14,7 @@ namespace CalamityMod.CalPlayer.DrawLayers
{
Player drawPlayer = drawInfo.drawPlayer;
CalamityPlayer modPlayer = drawPlayer.Calamity();
return drawInfo.shadow == 0f && !drawPlayer.dead && (modPlayer.voidAura || modPlayer.voidAuraDamage);
return drawInfo.shadow == 0f && !drawPlayer.dead && modPlayer.VoidConcentrationStaff;
}
protected override void Draw(ref PlayerDrawSet drawInfo)
Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

+76
View File
@@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CalamityMod.ExtraJumps;
using CalamityMod.Items.Accessories;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.DataStructures;
using Terraria.ModLoader;
using static Terraria.ModLoader.PlayerDrawLayer;
namespace CalamityMod.CalPlayer.DrawLayers
{
public class SpringStoolLayer : PlayerDrawLayer
{
private Asset<Texture2D> stoolTexture;
private Asset<Texture2D> springTexture;
private Asset<Texture2D> topTexture;
public override Position GetDefaultPosition() => new BeforeParent(PlayerDrawLayers.Leggings);
public override bool GetDefaultVisibility(PlayerDrawSet drawInfo)
{
// Only draw if the player is holding Up and still
return drawInfo.drawPlayer.GetModPlayer<SpringStoolPlayer>().springStool &&
drawInfo.drawPlayer.portableStoolInfo.IsInUse;
}
protected override void Draw(ref PlayerDrawSet drawInfo)
{
Player drawPlayer = drawInfo.drawPlayer;
// Load textures if null
stoolTexture ??= ModContent.Request<Texture2D>("CalamityMod/CalPlayer/DrawLayers/SpringStoolBottom");
springTexture ??= ModContent.Request<Texture2D>("CalamityMod/CalPlayer/DrawLayers/SpringStoolSpring");
topTexture ??= ModContent.Request<Texture2D>("CalamityMod/CalPlayer/DrawLayers/SpringStoolTop");
Texture2D stoolTex = stoolTexture.Value;
Texture2D springTex = springTexture.Value;
Texture2D topTex = topTexture.Value;
// Bottom Position
Vector2 bottomPosition = new Vector2(
(int)(drawInfo.Position.X - Main.screenPosition.X + drawPlayer.width / 2f),
(int)(drawInfo.Position.Y - Main.screenPosition.Y + drawPlayer.height + drawPlayer.portableStoolInfo.HeightBoost)
);
Rectangle bottomSource = stoolTex.Frame();
Vector2 bottomOrigin = new Vector2(bottomSource.Width / 2f, bottomSource.Height - 2);
// Spring
Vector2 springPosition = bottomPosition - new Vector2(0, bottomSource.Height);
Rectangle springSource = springTex.Frame();
Vector2 springOrigin = new Vector2(springSource.Width / 2f, springSource.Height - 2);
// Top
Vector2 topPosition = springPosition - new Vector2(0, springSource.Height - 5);
Rectangle topSource = topTex.Frame();
Vector2 topOrigin = new Vector2(topSource.Width / 2f, topSource.Height);
// Add all to cache
DrawPart(ref drawInfo, stoolTex, bottomPosition, bottomSource, bottomOrigin);
DrawPart(ref drawInfo, springTex, springPosition, springSource, springOrigin);
DrawPart(ref drawInfo, topTex, topPosition, topSource, topOrigin);
}
private void DrawPart(ref PlayerDrawSet drawInfo, Texture2D tex, Vector2 pos, Rectangle src, Vector2 origin)
{
drawInfo.DrawDataCache.Add(new DrawData(tex, pos, src, drawInfo.colorArmorLegs, drawInfo.drawPlayer.bodyRotation, origin, 1f, drawInfo.playerEffect, 0)
{ shader = drawInfo.cPortableStool });
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

+4
View File
@@ -46,6 +46,10 @@ namespace CalamityMod
[DefaultValue(false)]
public bool Photosensitivity { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(false)]
public bool BoCSpriteChange { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool EnableVanillaTextureEdits { get; set; }
+3
View File
@@ -18,6 +18,7 @@ namespace CalamityMod
public static ModKeybind NormalityRelocatorHotKey { get; private set; }
public static ModKeybind RageHotKey { get; private set; }
public static ModKeybind SpectralVeilHotKey { get; private set; }
public static ModKeybind SpringStoolJumpHotKey { get; private set; }
public static ModKeybind TransformerHotKey { get; private set; }
public static ModKeybind SwitchGravityHotkey {get; private set;}
public static ModKeybind ExpandDebuffInfo { get; private set; }
@@ -40,6 +41,7 @@ namespace CalamityMod
NormalityRelocatorHotKey = KeybindLoader.RegisterKeybind(Mod, "NormalityRelocator", "Z");
RageHotKey = KeybindLoader.RegisterKeybind(Mod, "RageMode", "V");
SpectralVeilHotKey = KeybindLoader.RegisterKeybind(Mod, "SpectralVeilTeleport", "Z");
SpringStoolJumpHotKey = KeybindLoader.RegisterKeybind(Mod, "SpringStoolJumpHotKey", "U");
TransformerHotKey = KeybindLoader.RegisterKeybind(Mod, "TransformerHotKey", "K");
SwitchGravityHotkey = KeybindLoader.RegisterKeybind(Mod, "GravitySwapOverride", "T");
ExpandDebuffInfo = KeybindLoader.RegisterKeybind(Mod, "ExpandDebuffInfo", "LeftControl");
@@ -62,6 +64,7 @@ namespace CalamityMod
NormalityRelocatorHotKey = null;
RageHotKey = null;
SpectralVeilHotKey = null;
SpringStoolJumpHotKey = null;
TransformerHotKey = null;
ExpandDebuffInfo = null;
}
@@ -11,7 +11,7 @@ using Terraria.UI.Chat;
namespace CalamityMod.ChatTags
{
public sealed class CalamityBuffTagHandler : AbstractTagHandler<CalamityBuffTagHandler>
public sealed class BuffTagEnemyEffectHandler : AbstractTagHandler<BuffTagEnemyEffectHandler>
{
public sealed class Snippet(int buffId) : TextSnippet
{
+79
View File
@@ -0,0 +1,79 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Graphics;
using Terraria;
using Terraria.GameContent;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.UI.Chat;
namespace CalamityMod.ChatTags
{
public sealed class BuffTagPlayerEffectHandler : AbstractTagHandler<BuffTagPlayerEffectHandler>
{
public sealed class Snippet(int buffId) : TextSnippet
{
private const float IconSize = 26f;
public int BuffId => buffId;
public bool DrawIcon => true;
public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = default, Color color = default, float scale = 1)
{
size = new Vector2(GetStringLength(FontAssets.MouseText.Value), IconSize);
if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0))
{
// Avoid re-drawing the icon when drawing borders.
if (DrawIcon)
{
// Tomat: I would love to support
// BuffLoader.[Pre/Post]Draw here, but it's not vaible
// because:
// 1. Main.DrawBuffIcon relies on LocalPlayer's buffs,
// 2. we can't control the source or destination
// rectangles.
if (Main.netMode != NetmodeID.Server && !Main.dedServ)
{
var texture = TextureAssets.Buff[BuffId];
spriteBatch.Draw(texture.Value, new Rectangle((int)position.X, (int)position.Y - 2, (int)IconSize, (int)IconSize), null, Color.White);
}
position.X += IconSize;
}
var buffColor = CalamityUtils.GetDebuffTooltipNameColor(buffId);
var name = $"{(DrawIcon ? " " : "")}{Lang.GetBuffName(buffId)}";
ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.MouseText.Value, name, position, buffColor, 0f, Vector2.Zero, new Vector2(scale));
}
return true;
}
public override float GetStringLength(DynamicSpriteFont font)
{
float iconSize = !DrawIcon ? 0f : IconSize + font.MeasureString(" ").X;
float size = iconSize + font.MeasureString(Lang.GetBuffName(buffId)).X;
return size * Scale;
}
}
protected override string[] TagNames { get; } = ["cbuffplr"];
public override TextSnippet Parse(string text, Color baseColor = new(), string options = null)
{
if (int.TryParse(text, out int buffId) && buffId >= 0 && buffId < BuffLoader.BuffCount)
{
return new Snippet(buffId);
}
if (BuffID.Search.TryGetId(text, out buffId))
{
return new Snippet(buffId);
}
return new TextSnippet(text);
}
}
}
-1
View File
@@ -6,7 +6,6 @@ using Terraria.ModLoader;
namespace CalamityMod.Cooldowns
{
// TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks.
public sealed class CooldownRegistry : ModSystem
{
// Indexed by ushort netID. Contains every registered cooldown.
-17
View File
@@ -1,17 +0,0 @@
using Microsoft.Xna.Framework;
using Terraria.Localization;
namespace CalamityMod.Cooldowns
{
public class FleshTotem : CooldownHandler
{
public static new string ID => "FleshTotem";
public override bool ShouldDisplay => true;
public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}");
public override string Texture => "CalamityMod/Cooldowns/FleshTotem";
public override Color OutlineColor => new Color(157, 248, 234);
public override Color CooldownStartColor => new Color(111, 169, 241);
public override Color CooldownEndColor => new Color(111, 169, 241);
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 441 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 B

+30
View File
@@ -0,0 +1,30 @@
using System;
using CalamityMod.Items.Accessories;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Cooldowns
{
public class Stooldown : CooldownHandler
{
public static new string ID => "Stooldown";
public override bool ShouldDisplay => true;
public override bool CanTickDown => true;
public override void Tick()
{
base.Tick();
}
public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}");
public override string Texture => "CalamityMod/Cooldowns/Stooldown";
public override Color OutlineColor => Color.SandyBrown;
public override Color CooldownStartColor => Color.Brown;
public override Color CooldownEndColor => Color.Khaki;
public override SoundStyle? EndSound => new("CalamityMod/Sounds/Item/AscendantOff");
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

+6 -4
View File
@@ -1,9 +1,9 @@
using System;
using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.WorldBuilding;
namespace CalamityMod.DataStructures
{
@@ -224,7 +224,8 @@ namespace CalamityMod.DataStructures
.CombineWith(ApplyScalingToStatModifer(cnpc.ActiveElectricDebuffMultiplier, ElectricDebuffScaling)
))))
:
cnpc.ActiveTypelessDebuffMultiplier;
// Bane doesn't scale with debuff multipliers. This should be implemented as a default feature you can apply to debuffs at some point.
buffType == ModContent.BuffType<Bane>() ? cnpc.ActiveTypelessDebuffMultiplier : StatModifier.Default;
//Ensure at least 25% effectiveness
if (totalScaling.Multiplicative <= 0.25f)
@@ -257,7 +258,8 @@ namespace CalamityMod.DataStructures
.CombineWith(ApplyScalingToStatModifer(cnpc.ActiveElectricDebuffMultiplier, ElectricDebuffScaling)
))))
:
cnpc.ActiveTypelessDebuffMultiplier;
// Bane doesn't scale with debuff multipliers. This should be implemented as a default feature you can apply to debuffs at some point.
buffType == ModContent.BuffType<Bane>() ? cnpc.ActiveTypelessDebuffMultiplier : StatModifier.Default;
//Ensure at least 25% effectiveness
if (totalScaling.Multiplicative <= 0.25f)
@@ -419,7 +421,7 @@ namespace CalamityMod.DataStructures
};
public static DebuffData Electrified = new DebuffData(DebuffBehavior.Electric)
{
EnemyLostRegen = 21,
EnemyLostRegen = 30, // 15 dps stationary, 60 dps moving
EnemyVanillaRegenToCancelOut = 8,
ElectricDebuffScaling = 1
};
+3 -2
View File
@@ -202,7 +202,7 @@ namespace CalamityMod.DataStructures
PreviouslyUsedGem = usedGemType;
}
public void PlayerOnHitEffects(int hitDamage)
public void PlayerOnHitEffects(Player.HurtInfo hurtInfo)
{
// Don't do anything if the player is not wearing the Gem Tech set.
var cgp = Owner.Calamity();
@@ -211,6 +211,7 @@ namespace CalamityMod.DataStructures
bool gemWasLost = false;
int gemDamage = 0;
int hitDamage = (int)hurtInfo.Damage;
bool largeEnoughRegularHit = hitDamage >= GemTechHeadgear.GemBreakDamageLowerBound;
// 09FEB2024: Ozzatron: chalice of the blood god no longer protects you when using gem tech armor.
// It is now slightly anti-synergetic, in that taking tiny hits when you're already bleeding will make you keep losing gems.
@@ -275,7 +276,7 @@ namespace CalamityMod.DataStructures
gemDamage = CalamityUtils.DamageSoftCap(gemDamage, GemTechHeadgear.GemDamageSoftcapThreshold);
if (Main.myPlayer == OwnerIndex)
Projectile.NewProjectile(Owner.GetSource_ItemUse(Owner.HeldItem), gemPosition, Vector2.Zero, ModContent.ProjectileType<GemTechArmorGem>(), gemDamage, 0f, OwnerIndex, 0f, (int)GemThatShouldBeLost);
Projectile.NewProjectile(Owner.GetSource_OnHurt(hurtInfo.DamageSource), gemPosition, Vector2.Zero, ModContent.ProjectileType<GemTechArmorGem>(), gemDamage, 0f, OwnerIndex, 0f, (int)GemThatShouldBeLost);
}
}
@@ -0,0 +1,47 @@
{
"Revision": 1,
"DefaultColor": "FF0000",
"DefaultSpeaker": "DemonAltar",
"AlignType": 1,
"TextDelay": 2,
"BasePunctuationDelay": {
"Delay": 10,
"ForceSet": false,
"Locks": false
},
"PunctuationDelayCap": 30,
"PunctuationDelays": {
"!": {
"Delay": 20,
"ForceSet": true,
"Locks": true
},
"?": {
"Delay": 20,
"ForceSet": true,
"Locks": true
}
},
"Pages": [
{
"Lines": [
"You, slayer of the flesh tower...[Pause(0.25)] we have an offer fitting of your deeds."
]
},
{
"Lines": [
"We can bestow you might untold...[Pause(0.25)] [Shaking:to grind your enemies to dust!]"
]
},
{
"Lines": [
"Simply yield the holy hammer unto the altar."
]
},
{
"Lines": [
"Kneel, and we shall render you the strength."
]
}
]
}
@@ -0,0 +1,47 @@
{
"Revision": 1,
"DefaultColor": "FF00FF",
"DefaultSpeaker": "DemonAltar",
"AlignType": 1,
"TextDelay": 2,
"BasePunctuationDelay": {
"Delay": 10,
"ForceSet": false,
"Locks": false
},
"PunctuationDelayCap": 30,
"PunctuationDelays": {
"!": {
"Delay": 20,
"ForceSet": true,
"Locks": true
},
"?": {
"Delay": 20,
"ForceSet": true,
"Locks": true
}
},
"Pages": [
{
"Lines": [
"Bearer of the Holy Hammer...[Pause(0.25)] [Wavy:desirest thou to taste true power?]"
]
},
{
"Lines": [
"Thine eyes shall be opened...[Pause(0.25)] [Shaking:thou shalt be even as the gods!]"
]
},
{
"Lines": [
"Yield the hammer unto us upon the altar."
]
},
{
"Lines": [
"Surrender, and thou shalt surely receive our might."
]
}
]
}
+10 -2
View File
@@ -56,7 +56,11 @@ namespace CalamityMod.Dusts
public override bool PreDraw(Dust dust)
{
Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f));
Vector2 baseSize = Vector2.One;
if (dust.customData != null && dust.customData is Vector2)
baseSize = (Vector2)dust.customData;
Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1 * baseSize.X, 0.5f * baseSize.X), Utils.Remap(dust.velocity.Length(), 2, 7, 1 * baseSize.Y, 2.5f * baseSize.Y));
// Glow Orb
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
@@ -82,7 +86,11 @@ namespace CalamityMod.Dusts
private static void DrawPixelated(Dust dust)
{
Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f));
Vector2 baseSize = Vector2.One;
if (dust.customData != null && dust.customData is Vector2)
baseSize = (Vector2)dust.customData;
Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1 * baseSize.X, 0.5f * baseSize.X), Utils.Remap(dust.velocity.Length(), 2, 7, 1 * baseSize.Y, 2.5f * baseSize.Y));
// Glow Orb
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
+44 -11
View File
@@ -31,30 +31,51 @@ namespace CalamityMod.Dusts
public override bool Update(Dust dust)
{
dust.rotation += MathF.Sign(dust.velocity.X);
dust.velocity *= 0.98f;
float fade = (1 + dust.fadeIn);
dust.velocity *= 0.96f;
if (dust.noGravity)
dust.scale += 0.02f;
dust.scale -= 0.05f * fade;
else
dust.scale -= 0.01f;
dust.scale -= 0.065f * fade;
float light = MathHelper.Clamp(dust.scale * 0.8f, 0f, 1f);
if (!dust.noLightEmittence)
Lighting.AddLight(dust.position, dust.color.ToVector3() * light);
if (dust.scale <= 0)
dust.active = false;
return true;
dust.position += dust.velocity;
return false;
}
public override bool MidUpdate(Dust dust)
{
dust.rotation = dust.velocity.ToRotation() + MathHelper.PiOver2;
return false;
}
public override bool PreDraw(Dust dust)
{
dust.rotation = dust.velocity.ToRotation() + MathHelper.PiOver2;
Vector2 baseSize = Vector2.One;
bool useSquash = false;
float squashMaxSpeed = 0;
if (dust.customData != null && dust.customData is int)
{
useSquash = true;
squashMaxSpeed = (float)dust.customData;
}
Vector2 squash = useSquash ? new Vector2(Utils.Remap(dust.velocity.Length(), squashMaxSpeed / 4, squashMaxSpeed, 1 * baseSize.X, 0.5f * baseSize.X), Utils.Remap(dust.velocity.Length(), squashMaxSpeed / 4, squashMaxSpeed, 1 * baseSize.Y, 2.5f * baseSize.Y)) : baseSize;
if (!dust.noLight)
{
// Glow Orb
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.04f, SpriteEffects.None, 0);
}
Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0);
return false;
}
}
@@ -65,20 +86,32 @@ namespace CalamityMod.Dusts
public override bool PreDraw(Dust dust)
{
dust.rotation = dust.velocity.ToRotation() + MathHelper.PiOver2;
PixelationManager.AddPixelatedDrawer((_) => DrawPixelated(dust), GeneralDrawLayer.AfterDusts);
return false;
}
private static void DrawPixelated(Dust dust)
{
Vector2 baseSize = Vector2.One;
bool useSquash = false;
float squashMaxSpeed = 0;
if (dust.customData != null && dust.customData is int)
{
useSquash = true;
squashMaxSpeed = (int)dust.customData;
}
Vector2 squash = useSquash ? new Vector2(Utils.Remap(dust.velocity.Length(), squashMaxSpeed / 4, squashMaxSpeed, 1 * baseSize.X, 0.5f * baseSize.X), Utils.Remap(dust.velocity.Length(), squashMaxSpeed / 4, squashMaxSpeed, 1 * baseSize.Y, 2.5f * baseSize.Y)) : baseSize;
if (!dust.noLight)
{
// Glow Orb
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.04f, SpriteEffects.None, 0);
}
Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0);
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 445 B

After

Width:  |  Height:  |  Size: 786 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 401 B

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 B

After

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 834 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 647 B

After

Width:  |  Height:  |  Size: 407 B

+62
View File
@@ -686,5 +686,67 @@ namespace CalamityMod.ILEditing
return orig(self);
}
#endregion
#region Adjust lifesteal costs
/// <summary>
/// Reimplemnts our own implementation of Spectre Healing so we can customize effects
/// Also means it will no longer reduce lifesteal cooldown when hitting with non-magic attacks, and not proc if every player is full HP
/// </summary>
/// <param name="orig"></param>
/// <param name="self"></param>
/// <param name="dmg"></param>
/// <param name="Position"></param>
/// <param name="victim"></param>
private static void AdjustSpectreHealing(On_Projectile.orig_ghostHeal orig, Projectile self, int dmg, Vector2 Position, Entity victim)
{
float HealingMultiplier = 0.2f;
float LifestealCooldownMult = 0.66f;
var owner = Main.player[self.owner];
HealingMultiplier -= self.numHits * 0.05f;
int AmountToHeal = (int)Math.Round(dmg * HealingMultiplier);
if (!self.magic || AmountToHeal <= 0 || Main.player[Main.myPlayer].lifeSteal <= 0f)
{
return;
}
float MissingLifeGoal = 0f;
int targetPlayer = self.owner;
foreach (var player in Main.ActivePlayers)
{
if (!player.dead && ((!self.hostile && !owner.hostile) || owner.team == player.team) && self.Distance(player.Center) <= 3000f)
{
int MissingLife = player.statLifeMax2 - player.statLife;
if ((float)MissingLife > MissingLifeGoal)
{
MissingLifeGoal = MissingLife;
targetPlayer = player.whoAmI;
}
}
}
AmountToHeal = (int)MathHelper.Min(AmountToHeal, MissingLifeGoal);
if (AmountToHeal <= 0)
return;
owner.lifeSteal -= AmountToHeal * LifestealCooldownMult;
Projectile.NewProjectile(self.GetSource_OnHit(victim, ProjectileSourceID.ToContextString(ProjectileSourceID.SetBonus_GhostHeal)), Position.X, Position.Y, 0f, 0f, ProjectileID.SpiritHeal, 0, 0f, self.owner, targetPlayer, AmountToHeal);
}
/// <summary>
/// Adjust Vampire Knives implementation, stopping them from trying to heal when at full HP
/// </summary>
/// <param name="orig"></param>
/// <param name="self"></param>
/// <param name="dmg"></param>
/// <param name="Position"></param>
/// <param name="victim"></param>
private static void AdjustVampireHealing(On_Projectile.orig_vampireHeal orig, Projectile self, int dmg, Vector2 Position, Entity victim)
{
int healAmount = (int)(dmg * 0.075f);
float LifestealCooldownMult = 1f;
if ((int)healAmount != 0 && !(Main.player[Main.myPlayer].lifeSteal <= 0f) && Main.player[Main.myPlayer].statLifeMax2 > Main.player[Main.myPlayer].statLife)
{
Main.player[Main.myPlayer].lifeSteal -= healAmount * LifestealCooldownMult;
Projectile.NewProjectile(self.GetSource_OnHit(victim, ProjectileSourceID.ToContextString(ProjectileSourceID.VampireKnives)), Position.X, Position.Y, 0f, 0f, ProjectileID.VampireHeal, 0, 0f, self.owner, self.owner, healAmount);
}
}
#endregion
}
}
+2 -1
View File
@@ -3,7 +3,6 @@ using CalamityMod.Tiles.FurnitureExo;
using Terraria;
using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.GameContent.Biomes;
using Terraria.GameContent.Drawing;
using Terraria.GameContent.Events;
using Terraria.GameContent.ItemDropRules;
@@ -112,6 +111,8 @@ namespace CalamityMod.ILEditing
On_Projectile.IsDamageDodgable += GFBNurseMeteorUndodgeable;
IL_Player.UpdateBuffs += UpdateBuffsBalancingChanges;
IL_Player.ApplyVanillaHurtEffectModifiers += RemoveBeetleAndSolarFlareMultiplicativeDR;
On_Projectile.ghostHeal += AdjustSpectreHealing;
On_Projectile.vampireHeal += AdjustVampireHealing;
// Movement speed balance
IL_Player.UpdateJumpHeight += FixJumpHeightBoosts;
+11 -6
View File
@@ -1,4 +1,6 @@
using Terraria;
using System.Collections.Generic;
using CalamityMod.Buffs.DamageOverTime;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
@@ -10,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 int AbaddonExploDamage = 25;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost, BrimstoneFlamesReduction.ToPercent());
public static float critScaling = 3f; // How effective crit chance is at increasing debuff damage
public override void SetDefaults()
{
Item.width = 26;
@@ -27,7 +26,13 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.Calamity().abaddon = true;
player.GetCritChance<GenericDamageClass>() += CritBoost;
player.Calamity().abaddonEffectVisual = !hideVisual;
}
public override void ModifyTooltips(List<TooltipLine> list)
{
if (Main.LocalPlayer != null)
list.FindAndReplace("[DAMAGELINE]", Main.LocalPlayer.Calamity().abaddon ? this.GetLocalization("Equipped").Format(((int)(Bane.debuffData.EnemyLostRegen / 2 * Main.LocalPlayer.Calamity().playerBaneDebuffDamage)).ToString())
: this.GetLocalizedValue("Unequipped"));
}
}
}
+9 -16
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using CalamityMod.CalPlayer;
using CalamityMod.Items.Materials;
using Microsoft.Xna.Framework;
@@ -13,8 +14,11 @@ namespace CalamityMod.Items.Accessories
{
public new string LocalizationCategory => "Items.Accessories";
public static int MaxLifeBoost = 50;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxLifeBoost, RadiantOoze.MinRegenBoost.ToRegenPerSecond(), RadiantOoze.MaxRegenBoost.ToRegenPerSecond());
public static int MinRegenBoost => 2;
public static int MaxRegenBoost => 6;
public static float RegenTimeBoost => 1;
public static float NaturalRegenPower => 1.5f;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinRegenBoost.ToRegenPerSecond(), MaxRegenBoost.ToRegenPerSecond(), (NaturalRegenPower - 1f).ToPercent(), RegenTimeBoost.ToPercent());
public override void SetDefaults()
{
@@ -28,19 +32,8 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
player.statLifeMax2 += MaxLifeBoost;
if (!player.HasBuff(BuffID.Honey))
player.AddBuff(BuffID.Honey, 2);
// bool left in for abyss light purposes and life regen effects
modPlayer.aAmpoule = true;
// Inherits all effects of Honey Dew and Living Dew
modPlayer.honeyDewHalveDebuffs = true;
modPlayer.livingDewHalveDebuffs = true;
// Add light if the other accessories aren't equipped and visibility is turned on
if (!(modPlayer.rOoze || modPlayer.purity) && !hideVisual)
if (!modPlayer.purity && !hideVisual)
Lighting.AddLight(player.Center, new Vector3(1.2f, 1.2f, 0.72f));
}
@@ -49,7 +42,7 @@ namespace CalamityMod.Items.Accessories
var player = Main.LocalPlayer;
if (player != null)
{
list.FindAndReplace("[REGEN]", player.Calamity().radiantOozeRegen.ToString("0.##"));
list.FindAndReplace("[REGEN]", ((int)MathF.Round(MathHelper.Lerp(MaxRegenBoost, MinRegenBoost, (player.statLife / (float)player.statLifeMax2)))).ToRegenPerSecond());
}
}
-2
View File
@@ -48,8 +48,6 @@ namespace CalamityMod.Items.Accessories
player.GetDamage<GenericDamageClass>() += DamageBoost;
player.GetDamage<SummonDamageClass>() += TotalSummonDamageBoost - DamageBoost;
player.maxMinions += MinionSlotBoost;
if (player.wingTime < player.wingTimeMax)
player.lifeRegen += RegenBoostDuringFlight;
}
public override void AddRecipes()
@@ -1,20 +1,20 @@
using CalamityMod.CalPlayer;
using System.Collections.Generic;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.CalPlayer;
using CalamityMod.Items.Materials;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
public class VoidofExtinction : ModItem, ILocalizedModType
[LegacyName("VoidofExtinction")]
public class Apollyon : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public static int CritBoost = 13;
public static int VoidExploDamage = 40;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost, Abaddon.BrimstoneFlamesReduction.ToPercent());
public static float critScaling = 8f; // 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;
@@ -37,10 +37,14 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.voidOfExtinction = true;
modPlayer.abaddon = true;
player.GetCritChance<GenericDamageClass>() += CritBoost;
modPlayer.apollyon = true;
modPlayer.abaddonEffectVisual = !hideVisual;
}
public override void ModifyTooltips(List<TooltipLine> list)
{
if (Main.LocalPlayer != null)
list.FindAndReplace("[DAMAGELINE]", Main.LocalPlayer.Calamity().apollyon ? this.GetLocalization("Equipped").Format(((int)(Bane.debuffData.EnemyLostRegen / 2 * Main.LocalPlayer.Calamity().playerBaneDebuffDamage)).ToString())
: this.GetLocalizedValue("Unequipped"));
}
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 798 B

After

Width:  |  Height:  |  Size: 798 B

+1 -1
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories
{
public new string LocalizationCategory => "Items.Accessories";
public static int MaxDefenseBoost = 20;
public static int MaxDefenseBoost = 15;
public static float MaxMoveSpeedReduction = 0.1f;
public static int TimeToReachMaxBoost = CalamityUtils.SecondsToFrames(10);
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(TimeToReachMaxBoost.FramesToSeconds(), MaxDefenseBoost, MaxMoveSpeedReduction.ToPercent());
+1 -1
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories
public class ChaosStone : ModItem, ILocalizedModType
{
public static float LostRegenPer100Mana => 8;
public static float DamageMultPer100Mana => 0.04f;
public static float DamageMultPer100Mana => 0.05f;
public new string LocalizationCategory => "Items.Accessories";
public override void ModifyTooltips(List<TooltipLine> tooltips)
{
+6 -1
View File
@@ -1,6 +1,7 @@
using CalamityMod.CalPlayer;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
@@ -8,11 +9,14 @@ namespace CalamityMod.Items.Accessories
public class CrownJewel : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public static int RegenBoost = 1;
public static int ReducedDoTAmount = 4;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), ReducedDoTAmount.ToRegenPerSecond());
public override void SetDefaults()
{
Item.width = 26;
Item.height = 26;
Item.defense = 1;
Item.value = CalamityGlobalItem.RarityBlueBuyPrice;
Item.rare = ItemRarityID.Blue;
Item.accessory = true;
@@ -22,6 +26,7 @@ namespace CalamityMod.Items.Accessories
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.crownJewel = true;
player.lifeRegen += RegenBoost;
}
}
}
+7
View File
@@ -83,6 +83,13 @@ namespace CalamityMod.Items.Accessories
AddIngredient<AstralBar>(10).
AddTile(TileID.TinkerersWorkbench).
Register();
CreateRecipe().
AddIngredient(ItemID.BeeCloak).
AddIngredient(ItemID.CrossNecklace).
AddIngredient(ItemID.PanicNecklace).
AddIngredient<AstralBar>(10).
AddTile(TileID.TinkerersWorkbench).
Register();
}
}
}
+12 -2
View File
@@ -7,7 +7,7 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
[AutoloadEquip(EquipType.Face)]
public class FeatherCrown : ModItem, ILocalizedModType
public class FeatherCrown : ModItem, ILocalizedModType, IHoldShiftTooltipItem
{
public new string LocalizationCategory => "Items.Accessories";
public override void SetStaticDefaults()
@@ -28,12 +28,22 @@ namespace CalamityMod.Items.Accessories
Item.rare = ItemRarityID.Orange;
Item.accessory = true;
}
public override bool CanAccessoryBeEquippedWith(Item equippedItem, Item incomingItem, Player player)
{
return incomingItem.type != ModContent.ItemType<MoonstoneCrown>();
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.rogueVelocity += 0.15f;
modPlayer.featherCrown = true;
modPlayer.mageCrownVisibility = !hideVisual;
player.GetDamage<MagicDamageClass>() += (0.02f * modPlayer.mageCrownCount); //2% per feather, up to 10%
player.manaCost -= (0.01f * modPlayer.mageCrownCount); //1% per feather, up to 5%
if (modPlayer.mageCrownCount >= 5) //At 5 feathers, grant 5% crit. Static Discharge infliction is handed in CalPlayerOnHit
{
player.GetCritChance<MagicDamageClass>() += 5;
}
}
public override void AddRecipes()
+22
View File
@@ -1,4 +1,6 @@
using CalamityMod.CalPlayer;
using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -8,6 +10,10 @@ namespace CalamityMod.Items.Accessories
public class FleshTotem : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public static int manaStorageMax = 600;
public const int lostSoulDamage = 200;
public override void SetDefaults()
{
Item.width = 26;
@@ -21,6 +27,22 @@ namespace CalamityMod.Items.Accessories
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.fleshTotem = true;
modPlayer.fleshTotemMinion = true;
modPlayer.fleshTotemVisual = !hideVisual;
player.statManaMax2 += 30;
player.GetCritChance<MagicDamageClass>() += 5;
if (player.whoAmI == Main.myPlayer)
{
var source = player.GetSource_Accessory(Item);
if (player.ownedProjectileCounts[ModContent.ProjectileType<FleshTotemMinion>()] < 1)
{
int damage = (int)player.GetTotalDamage<MagicDamageClass>().ApplyTo(lostSoulDamage);
int effigy = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType<FleshTotemMinion>(), damage, 2f, Main.myPlayer);
if (Main.projectile.IndexInRange(effigy))
Main.projectile[effigy].originalDamage = lostSoulDamage;
}
}
}
}
}
+3 -2
View File
@@ -1,5 +1,6 @@
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
@@ -8,10 +9,10 @@ namespace CalamityMod.Items.Accessories
{
public new string LocalizationCategory => "Items.Accessories";
public static int RegenBoost = 3;
public static int RegenBoost = 2;
public static int DefenseBoost = 5;
public static float SummonDamageBoost = 0.1f;
public LocalizedText TooltipExtensionText => this.GetLocalization("HoldShiftTooltip").WithFormatArgs(SummonDamageBoost.ToPercent(), DefenseBoost, RegenBoost.ToRegenPerSecond());
public override void SetDefaults()
{
Item.width = 26;
+5 -4
View File
@@ -1,6 +1,7 @@
using CalamityMod.CalPlayer;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
@@ -8,6 +9,9 @@ namespace CalamityMod.Items.Accessories
public class HoneyDew : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public static float NaturalRegenPower => 1.5f;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((NaturalRegenPower - 1f).ToPercent());
public override void SetDefaults()
{
Item.width = 20;
@@ -19,11 +23,8 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.statLifeMax2 += 10;
if (!player.HasBuff(BuffID.Honey))
player.AddBuff(BuffID.Honey, 2);
CalamityPlayer modPlayer = player.Calamity();
modPlayer.honeyDewHalveDebuffs = true;
modPlayer.honeyDew = true;
}
public override void AddRecipes()
+7 -1
View File
@@ -3,6 +3,7 @@ using CalamityMod.Items.Materials;
using CalamityMod.Items.Potions;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
@@ -11,11 +12,15 @@ namespace CalamityMod.Items.Accessories
public class InfectedJewel : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public static int RegenBoost = 2;
public static int ReducedDoTAmount = 8;
public static int PostDebuffRegenTimeBoost = CalamityUtils.SecondsToFrames(10);
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), ReducedDoTAmount.ToRegenPerSecond(), PostDebuffRegenTimeBoost.FramesToSeconds());
public override void SetDefaults()
{
Item.width = 26;
Item.height = 26;
Item.defense = 4;
Item.value = CalamityGlobalItem.RarityLimeBuyPrice;
Item.rare = ItemRarityID.Lime;
Item.accessory = true;
@@ -25,6 +30,7 @@ namespace CalamityMod.Items.Accessories
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.infectedJewel = true;
player.lifeRegen += RegenBoost;
}
public override void AddRecipes()
+6 -7
View File
@@ -2,6 +2,7 @@
using CalamityMod.Items.Materials;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
@@ -9,6 +10,10 @@ namespace CalamityMod.Items.Accessories
public class LivingDew : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public static int RegenTimeBoost => 1;
public static float NaturalRegenPower => 1.5f;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((NaturalRegenPower - 1f).ToPercent(), RegenTimeBoost.ToPercent());
public override void SetDefaults()
{
Item.width = 34;
@@ -20,14 +25,8 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.statLifeMax2 += 25;
if (!player.HasBuff(BuffID.Honey))
player.AddBuff(BuffID.Honey, 2);
// Inherits all effects of Honey Dew
CalamityPlayer modPlayer = player.Calamity();
modPlayer.honeyDewHalveDebuffs = true;
modPlayer.livingDewHalveDebuffs = true;
modPlayer.livingDew = true;
}
public override void AddRecipes()
+1 -1
View File
@@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories
Item.rare = ItemRarityID.Blue;
Item.value = CalamityGlobalItem.RarityBlueBuyPrice;
Item.accessory = true;
Item.defense = 3;
Item.defense = 2;
}
public override void UpdateAccessory(Player player, bool hideVisual)
+17 -5
View File
@@ -7,15 +7,12 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
[AutoloadEquip(EquipType.Face)]
public class MoonstoneCrown : ModItem, ILocalizedModType
public class MoonstoneCrown : ModItem, ILocalizedModType, IHoldShiftTooltipItem
{
public new string LocalizationCategory => "Items.Accessories";
// Base damage of lunar flares on stealth strikes. Increased by rogue damage stats, but not stealth damage.
internal static int BaseDamage = 75;
public override void SetStaticDefaults()
{
if (!Main.dedServ)
{
int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Face);
@@ -31,12 +28,27 @@ namespace CalamityMod.Items.Accessories
Item.rare = ItemRarityID.Purple;
Item.accessory = true;
}
public override bool CanAccessoryBeEquippedWith(Item equippedItem, Item incomingItem, Player player)
{
return incomingItem.type != ModContent.ItemType<FeatherCrown>();
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.rogueVelocity += 0.15f;
modPlayer.moonCrown = true;
modPlayer.mageCrownVisibility = !hideVisual;
player.statManaMax2 += 70;
player.GetDamage<MagicDamageClass>() += (0.02f * modPlayer.mageCrownCount); //2% per moon sigil, up to 20%
player.manaCost -= (0.01f * modPlayer.mageCrownCount); //1% per moon sigil, up to 10%
if (modPlayer.mageCrownCount >= 5) //At 5 sigils, grant a mana regen bonus
{
player.manaRegenBonus += 10;
}
if (modPlayer.mageCrownCount >= 10) //At 10 sigils, grant 10% crit. Nightwither infliction is handed in CalPlayerOnHit
{
player.GetCritChance<MagicDamageClass>() += 10;
}
}
public override void AddRecipes()
-1
View File
@@ -35,7 +35,6 @@ namespace CalamityMod.Items.Accessories
{
CreateRecipe().
AddIngredient<RogueEmblem>().
AddIngredient<MoonstoneCrown>().
AddIngredient<ElectriciansGlove>().
AddIngredient<AscendantSpiritEssence>(4).
AddTile<CosmicAnvil>().
+3 -2
View File
@@ -8,6 +8,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
@@ -17,9 +18,9 @@ namespace CalamityMod.Items.Accessories
public new string LocalizationCategory => "Items.Accessories";
public static int RegenBoost = 2;
public static int DefenseBoost = 10;
public static int DefenseBoost = 8;
public static float SummonDamageBoost = 0.1f;
public LocalizedText TooltipExtensionText => this.GetLocalization("HoldShiftTooltip").WithFormatArgs(SummonDamageBoost.ToPercent(), DefenseBoost, RegenBoost.ToRegenPerSecond());
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 7));
+14 -17
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using CalamityMod.CalPlayer;
using CalamityMod.Items.Materials;
using CalamityMod.Rarities;
@@ -7,14 +8,23 @@ using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
[LegacyName("AstralArcanum", "Purity")]
public class Radiance : ModItem, ILocalizedModType, IHoldShiftTooltipItem
public class Radiance : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public static int MinRegenBoost => 2;
public static int MaxRegenBoost => 8;
public static int ReducedDoTAmount => 20;
public static int PostDebuffRegenTimeBoost => CalamityUtils.SecondsToFrames(10);
public static float RegenTimeBoost => 1;
public static float NaturalRegenPower => 1.5f;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinRegenBoost.ToRegenPerSecond(),MaxRegenBoost.ToRegenPerSecond(),ReducedDoTAmount.ToRegenPerSecond(), (NaturalRegenPower - 1f).ToPercent(),RegenTimeBoost.ToPercent());
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 7));
@@ -25,7 +35,6 @@ namespace CalamityMod.Items.Accessories
{
Item.width = 18;
Item.height = 44;
Item.defense = 5;
Item.accessory = true;
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
Item.rare = ModContent.RarityType<BurnishedAuric>();
@@ -34,19 +43,8 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
player.statLifeMax2 += 70;
if (!player.HasBuff(BuffID.Honey))
player.AddBuff(BuffID.Honey, 2);
// Abyss light, debuff near-immunity, life regen effects, and massively enhances debuff halving
modPlayer.purity = true;
// Inherits effects from Honey Dew and Living Dew
modPlayer.honeyDewHalveDebuffs = true;
modPlayer.livingDewHalveDebuffs = true;
// Add light if the other accessories aren't equipped and visibility is turned on
if (!(modPlayer.rOoze || modPlayer.aAmpoule) && !hideVisual)
if (!hideVisual)
Lighting.AddLight(player.Center, new Vector3(1.32f, 1.32f, 1.82f));
}
@@ -56,8 +54,7 @@ namespace CalamityMod.Items.Accessories
var player = Main.LocalPlayer;
if (player != null)
{
list.FindAndReplace("[REGEN]", player.Calamity().purityRegen.ToString("0.##"));
list.FindAndReplace("[DEFENSE]", player.Calamity().jewelBonusDefense.ToString());
list.FindAndReplace("[REGEN]", ((int)MathF.Round(MathHelper.Lerp(MaxRegenBoost, MinRegenBoost, (player.statLife / (float)player.statLifeMax2)))).ToRegenPerSecond());
}
}
+5 -7
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using CalamityMod.CalPlayer;
using CalamityMod.Items.Materials;
using Microsoft.Xna.Framework;
@@ -13,8 +14,8 @@ namespace CalamityMod.Items.Accessories
{
public new string LocalizationCategory => "Items.Accessories";
public static int MinRegenBoost = 4;
public static int MaxRegenBoost = 10;
public static int MinRegenBoost => 1;
public static int MaxRegenBoost => 5;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinRegenBoost.ToRegenPerSecond(), MaxRegenBoost.ToRegenPerSecond());
public override void SetDefaults()
@@ -29,11 +30,8 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
// bool left in for abyss light purposes and life regen effects
modPlayer.rOoze = true;
// Add light if the other accessories aren't equipped and visibility is turned on
if (!(modPlayer.aAmpoule || modPlayer.purity) && !hideVisual)
Lighting.AddLight(player.Center, new Vector3(1f, 1f, 0.6f));
}
@@ -43,7 +41,7 @@ namespace CalamityMod.Items.Accessories
var player = Main.LocalPlayer;
if (player != null)
{
list.FindAndReplace("[REGEN]", (player.Calamity().radiantOozeRegen).ToString("0.##"));
list.FindAndReplace("[REGEN]", ((int)MathF.Round(MathHelper.Lerp(MaxRegenBoost, MinRegenBoost, (player.statLife / (float)player.statLifeMax2)))).ToRegenPerSecond());
}
}
+6 -2
View File
@@ -1,5 +1,6 @@
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
@@ -8,8 +9,11 @@ namespace CalamityMod.Items.Accessories
{
public new string LocalizationCategory => "Items.Accessories";
public static int SandVeilDefenseBoost = 4;
public static int SandVeilDuration = CalamityUtils.SecondsToFrames(15);
public static int SandVeilDefenseBoost = 3;
public static float SandVeilAccelerationBoost = 0.75f;
public static int SandVeilCooldown = CalamityUtils.SecondsToFrames(15);
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(SandVeilDuration.FramesToSeconds(), SandVeilDefenseBoost, SandVeilAccelerationBoost.ToPercent(), SandVeilCooldown.FramesToSeconds());
public override void SetDefaults()
{
Item.width = 30;
+2 -2
View File
@@ -78,11 +78,11 @@ namespace CalamityMod.Items.Accessories
// If the NPC can be moved, violently shove them away. Make them susceptible to fall damage on empowered parries.
// Otherwise, simply deal a large amount of damage to them if empowered.
if (npc.CanBeMoved(true))
if (npc.CanBeMoved())
{
// The NPC has to actually have its velocity changed, because TileCollisionHarmNPC only changes its position. Not confusing at all!
Vector2 shoveVelocity = Utils.DirectionTo(player.Center, npc.Center) * (Main.zenithWorld ? 35f : 12.5f) - Vector2.UnitY * 6f;
npc.MoveNPC(Vector2.Normalize(shoveVelocity), shoveVelocity.Length(), true);
npc.MoveNPC(Vector2.Normalize(shoveVelocity), shoveVelocity.Length(), true, player);
int scaledFallDamage = CalamityUtils.ScaleWithDifficulty(ShoveFallBaseDamage);
var flungNPC = npc.GetGlobalNPC<CalamityTileCollisionHarmNPC>();
+2 -2
View File
@@ -14,8 +14,8 @@ namespace CalamityMod.Items.Accessories
public static int PauldronSlamDamage = 330;
public override void SetDefaults()
{
Item.width = 54;
Item.height = 56;
Item.width = 42;
Item.height = 34;
Item.value = CalamityGlobalItem.RarityLightRedBuyPrice;
Item.rare = ItemRarityID.LightRed;
Item.accessory = true;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

+4 -3
View File
@@ -1,6 +1,7 @@
using CalamityMod.CalPlayer;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
@@ -10,10 +11,10 @@ namespace CalamityMod.Items.Accessories
{
public new string LocalizationCategory => "Items.Accessories";
public static int RegenBoost = 2;
public static int DefenseBoost = 3;
public static int RegenBoost = 1;
public static int DefenseBoost = 2;
public static float SummonDamageBoost = 0.1f;
public LocalizedText TooltipExtensionText => this.GetLocalization("HoldShiftTooltip").WithFormatArgs(SummonDamageBoost.ToPercent(), DefenseBoost, RegenBoost.ToRegenPerSecond());
public override void SetDefaults()
{
Item.width = 24;
+226
View File
@@ -0,0 +1,226 @@
using System;
using System.Collections.Generic;
using CalamityMod.Cooldowns;
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
public class SpringStool : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public override void ModifyTooltips(List<TooltipLine> list) => list.IntegrateHotkey(CalamityKeybinds.SpringStoolJumpHotKey);
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((JumpCooldown).FramesToSeconds(), (CritRateBoostAboveTargets));
public static int JumpCooldown = CalamityUtils.SecondsToFrames(20);
public static int CritRateBoostAboveTargets = 5;
public override void SetDefaults()
{
Item.width = 30;
Item.height = 46;
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
Item.rare = ItemRarityID.Green;
Item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.GetModPlayer<SpringStoolPlayer>().springStool = true;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient(ItemID.PortableStool).
AddRecipeGroup("AnyCopperBar", 3).
AddTile(TileID.Anvils).
Register();
}
}
public class SpringStoolPlayer : ModPlayer
{
public bool springStool = false;
public int springStoolTimer = 0;
public bool hasGroundedSinceJump = true;
public override void Load()
{
// Hook directly into vanilla's stool drawing
On_PlayerDrawLayers.DrawPlayer_03_PortableStool += HandleStoolStacking;
// Used to apply the conditional crit chance boost
// Projectiles uses standard tML hooks
On_Player.ProcessHitAgainstNPC += HandleExtraMeleeHitboxCrit;
}
public override void PostUpdate()
{
bool theCollisionCheck = Collision.TileCollision(Player.position + Vector2.UnitY, Vector2.Zero, Player.width, Player.height, fallThrough: false, fall2: false).Y == 0f;
if ((Player.velocity.Y == 0 && theCollisionCheck) || Player.grappling[0] >= 0)
hasGroundedSinceJump = true;
}
public override void PostUpdateEquips()
{
if (CalamityKeybinds.SpringStoolJumpHotKey.JustPressed && springStool && Main.myPlayer == Player.whoAmI && !Player.HasCooldown(Stooldown.ID) && !Player.mount.Active && hasGroundedSinceJump)
{
springStoolTimer = 12;
Player.AddCooldown(Stooldown.ID, (int)SpringStool.JumpCooldown, true);
hasGroundedSinceJump = false;
Vector2 spawnPos = Player.Bottom + new Vector2(0f, -60f);
// Spawn stool with downward and randomly angled force
Projectile.NewProjectile(Player.GetSource_FromThis(), spawnPos, new Vector2(Main.rand.NextFloat(-1f, 1f), 1.2f), ModContent.ProjectileType<SpringStoolFX>(), 0, 0f, Player.whoAmI);
SoundEngine.PlaySound(SoundID.Item61 with { Pitch = 0.3f, Volume = 0.7f }, Player.Center);
if (IsVanillaStoolEquipped(Player))
{
// Spawn a step stool copy with a random velocity. Only works if step stool is equipped as well as spring stool.
Projectile.NewProjectile(Player.GetSource_FromThis(), spawnPos + new Vector2(0f, -4f), new Vector2(Main.rand.NextBool() ? Main.rand.NextFloat(6f, 7f) : Main.rand.NextFloat(-6f, -7f), Main.rand.NextFloat(-8f, -10f)), ModContent.ProjectileType<StepStoolBonusFX>(), 0, 0f, Player.whoAmI);
}
}
if (springStool)
{
bool holdingUp = Player.controlUp;
bool standingStill = Player.velocity.Y == 0 && Math.Abs(Player.velocity.X) < 0.1f;
if (holdingUp && standingStill && !Player.mount.Active)
{
int boost = 61;
if (IsVanillaStoolEquipped(Player))
boost += 24;
Player.portableStoolInfo.HasAStool = true;
Player.portableStoolInfo.IsInUse = true;
Player.portableStoolInfo.HeightBoost = boost;
Player.portableStoolInfo.VisualYOffset = boost;
Player.portableStoolInfo.MapYOffset = boost;
// Forces the player into the stool-standing frame
Player.UpdatePortableStoolUsage();
}
else
{
// Ensures the player can use the stool if they stop moving/hold up
Player.portableStoolInfo.HasAStool = true;
}
}
}
private void HandleStoolStacking(On_PlayerDrawLayers.orig_DrawPlayer_03_PortableStool orig, ref PlayerDrawSet drawInfo)
{
bool isUsingStool = drawInfo.drawPlayer.portableStoolInfo.IsInUse;
var modPlayer = drawInfo.drawPlayer.GetModPlayer<SpringStoolPlayer>();
bool hasSpring = modPlayer.springStool;
if (!isUsingStool)
{
orig(ref drawInfo);
return;
}
if (!hasSpring)
{
orig(ref drawInfo);
return;
}
if (IsVanillaStoolEquipped(drawInfo.drawPlayer))
{
orig(ref drawInfo);
return;
}
return;
}
private bool IsVanillaStoolEquipped(Player player)
{
for (int k = 3; k <= 12; k++)
{
if (player.armor[k].type == ItemID.PortableStool)
return true;
}
return false;
}
public override void PreUpdateMovement()
{
if (springStoolTimer > 0)
{
springStoolTimer--;
if (Player.whoAmI == Main.myPlayer)
{
float launchPower = 20f * Utils.GetLerpValue(0, 10, springStoolTimer, true);
Player.velocity.Y = -launchPower * Player.gravDir;
// Prevent vanilla jump logic from interfering
Player.jump = 0;
Player.fallStart = (int)(Player.position.Y / 16f);
}
}
}
// Adds crit to melee hitboxes
private static void HandleExtraMeleeHitboxCrit(On_Player.orig_ProcessHitAgainstNPC orig, Player self, Item sItem, Rectangle itemRectangle, int originalDamage, float knockback, int npcIndex)
{
bool getBoost = self.GetModPlayer<SpringStoolPlayer>().springStool && self.Top.Y < Main.npc[npcIndex].Top.Y;
if (getBoost)
sItem.crit += SpringStool.CritRateBoostAboveTargets;
orig(self, sItem, itemRectangle, originalDamage, knockback, npcIndex);
if (getBoost)
sItem.crit -= SpringStool.CritRateBoostAboveTargets;
}
// Scuffed implementation to add crit to projectiles, using one hook to add it and then a later hook to remove it
// There are two return statements in between these hooks that I would normally be nervous of, however neither actually affect this at all:
// * The first is Electrosphere Launcher's rockets dying on hit, which kills the projectile anyways and can just have a manual check against
// * The second is Abigail's Flower hit cooldown logic, which does nothing since it's a minion that doesn't crit
public override void ModifyHitNPCWithProj(Projectile proj, NPC target, ref NPC.HitModifiers modifiers)
{
if (springStool && proj.type != ProjectileID.ElectrosphereMissile)
{
if (Player.Top.Y < target.Top.Y)
proj.CritChance += SpringStool.CritRateBoostAboveTargets;
}
}
public override void OnHitNPCWithProj(Projectile proj, NPC target, NPC.HitInfo hit, int damageDone)
{
if (springStool && proj.type != ProjectileID.ElectrosphereMissile)
{
if (Player.Top.Y < target.Top.Y)
proj.CritChance -= SpringStool.CritRateBoostAboveTargets;
}
}
public override void ResetEffects()
{
springStool = false;
springStoolTimer = 0;
}
public override void UpdateDead()
{
springStool = false;
springStoolTimer = 0;
hasGroundedSinceJump = true;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 719 B

-1
View File
@@ -17,7 +17,6 @@ namespace CalamityMod.Items.Accessories
{
Item.width = 26;
Item.height = 26;
Item.defense = 4;
Item.value = CalamityGlobalItem.RarityOrangeBuyPrice;
Item.rare = ItemRarityID.Orange;
Item.accessory = true;
+8 -8
View File
@@ -39,11 +39,11 @@ namespace CalamityMod.Items.Accessories
modPlayer.rBrain = true; // Handles shaderain cloud spawning on hit
modPlayer.amalgam = true;
player.brainOfConfusionItem = Item;
modPlayer.HeatDebuffMultiplier += 2f;
modPlayer.ColdDebuffMultiplier += 2f;
modPlayer.SicknessDebuffMultiplier += 2f;
modPlayer.WaterDebuffMultiplier += 2f;
modPlayer.ElectricDebuffMultiplier += 2f;
modPlayer.HeatDebuffMultiplier += 3f;
modPlayer.ColdDebuffMultiplier += 3f;
modPlayer.SicknessDebuffMultiplier += 3f;
modPlayer.WaterDebuffMultiplier += 3f;
modPlayer.ElectricDebuffMultiplier += 3f;
}
public override void AddRecipes()
@@ -51,11 +51,11 @@ namespace CalamityMod.Items.Accessories
CreateRecipe().
AddIngredient<AmalgamatedBrain>().
AddIngredient<AscendantSpiritEssence>(4).
AddIngredient(ItemID.LunarBar, 10).
AddIngredient(ItemID.FragmentSolar, 10).
AddIngredient<AshesofCalamity>(12).
AddIngredient<EssenceofEleum>(15).
AddIngredient<PlagueCellCanister>(15).
AddIngredient<DepthCells>(15).
AddIngredient<EffulgentFeather>(8).
AddIngredient<ArmoredShell>(4).
AddTile<CosmicAnvil>().
Register();
}
+6 -1
View File
@@ -2,6 +2,7 @@
using CalamityMod.CalPlayer;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
@@ -9,7 +10,11 @@ namespace CalamityMod.Items.Accessories
public class TrinketofChi : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
internal const int ChiBuffTimerMax = 600;
public static float ChiBuffDamageReductionBoost = 0.2f;
public static int ChiBuffHitlessTime = CalamityUtils.SecondsToFrames(10);
public static int RegenBoost = 1;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ChiBuffDamageReductionBoost.ToPercent(), ChiBuffHitlessTime.FramesToSeconds(), RegenBoost.ToRegenPerSecond());
public override void SetDefaults()
{
+5 -4
View File
@@ -1,6 +1,7 @@
using CalamityMod.Buffs.DamageOverTime;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
@@ -9,6 +10,9 @@ namespace CalamityMod.Items.Accessories
public class UnholyTonic : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public static int DefenseBoostInCorruption = 3;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DefenseBoostInCorruption);
public override void SetDefaults()
{
Item.width = 20;
@@ -22,10 +26,7 @@ namespace CalamityMod.Items.Accessories
{
player.buffImmune[ModContent.BuffType<BrainRot>()] = true;
if (player.ZoneCorrupt)
{
player.statDefense += 6;
player.endurance += 0.04f;
}
player.statDefense += DefenseBoostInCorruption;
}
public override void AddRecipes()
Loaded 100 of 660 files, more files were not shown because too many files have changed in this diff. Show more