Merge branch '1.4.4' of https://github.com/CalamityTeam/CalamityMod into debuff-refactor

This commit is contained in:
Doze-Zoze committed 2025-08-01 14:30:25 -05:00
commit 559beb1a53
2137 files changed
+29062 -31700

No files matched your search

+142 -2
View File
@@ -56,6 +56,55 @@ namespace CalamityMod.Backgrounds
}
}
}
if (!Main.dedServ && (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.TimelessShoresBiome>())))
{
int drawLimitX = Main.screenWidth / 16;
int drawLimitY = Main.screenHeight / 16;
Point drawPoint = (Main.screenPosition / 16).ToPoint();
for (int i = 0; i < drawLimitX; i++)
{
for (int j = 0; j < drawLimitY; j++)
{
Point pos = drawPoint + new Point(i, j);
if (!Main.tile[pos.X, pos.Y].HasTile &&
Main.tile[pos.X, pos.Y].WallType == 0 &&
Main.tile[pos.X, pos.Y].LiquidAmount == 0)
Lighting.AddLight(pos.X, pos.Y, TorchID.White, 0.2f);
}
}
}
if (!Main.dedServ && (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.PolypForestBiome>())))
{
int drawLimitX = Main.screenWidth / 16;
int drawLimitY = Main.screenHeight / 16;
Point drawPoint = (Main.screenPosition / 16).ToPoint();
for (int i = 0; i < drawLimitX; i++)
{
for (int j = 0; j < drawLimitY; j++)
{
Point pos = drawPoint + new Point(i, j);
if (!Main.tile[pos.X, pos.Y].HasTile &&
Main.tile[pos.X, pos.Y].WallType == 0)
Lighting.AddLight(pos.X, pos.Y, TorchID.White, 0.2f);
}
}
}
if (!Main.dedServ && (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.RadiantReefsBiome>())))
{
int drawLimitX = Main.screenWidth / 16;
int drawLimitY = Main.screenHeight / 16;
Point drawPoint = (Main.screenPosition / 16).ToPoint();
for (int i = 0; i < drawLimitX; i++)
{
for (int j = 0; j < drawLimitY; j++)
{
Point pos = drawPoint + new Point(i, j);
if (!Main.tile[pos.X, pos.Y].HasTile &&
Main.tile[pos.X, pos.Y].WallType == 0)
Lighting.AddLight(pos.X, pos.Y, TorchID.White, 0.2f);
}
}
}
}
private void DrawToTarget(On_Main.orig_CheckMonoliths orig)
@@ -73,6 +122,7 @@ namespace CalamityMod.Backgrounds
// Leaving this here for other programmers, in case I don't get to doing this myself.
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, Main.Rasterizer, null, CalamityUtils.BackgroundMatrix);
DrawShoresBG();
DrawBurrowsBG();
Main.spriteBatch.End();
@@ -97,6 +147,7 @@ namespace CalamityMod.Backgrounds
// rendering code if that setting is on.
if (Main.WaveQuality > 0 || !CalamityClientConfig.Instance.SunkenSeaBackgroundDistortion)
{
DrawShoresBG();
DrawBurrowsBG();
}
else
@@ -123,14 +174,103 @@ namespace CalamityMod.Backgrounds
}
public static float Transparency;
public static float TransitionSpeed => 0.02f;
private static void DrawShoresBG()
{
if (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.TimelessShoresBiome>()))
{
Transparency += 1f;
if (Transparency > 1f)
Transparency = 1f;
}
else
{
// Make transparency immediately go down so it doesnt look weird, since vanilla underground backgrounds dont have the fade-in effect this background has.
Transparency -= 1f;
if (Transparency < 0f)
Transparency = 0f;
}
// Don't bother running any of the background drawing if the transparency is zero (meaning the background isnt actually active).
// Also do not run any of the background drawing if you have the vanilla background config option turned off.
if (Transparency > 0f && Main.BackgroundEnabled)
{
Vector2 vector = Main.screenPosition + new Vector2((Main.screenWidth >> 1), (Main.screenHeight >> 1));
float num = (Main.GameViewMatrix.Zoom.Y - 1f) * 0.5f * 200f;
float Scale = 1.5f;
float playerDrawPosition = ((Main.LocalPlayer.Center.Y / 16f) - 90) * 16f;
for (int Layers = 4; Layers >= 0; Layers--)
{
// Get each background texture.
Texture2D BGTexture = ModContent.Request<Texture2D>("CalamityMod/Backgrounds/SunkenSeaShoresBG" + Layers).Value;
Vector2 vector2 = new Vector2(BGTexture.Width, BGTexture.Height) * 0.5f;
float num2 = (Layers * 2 + 3f);
Vector2 vector3 = new Vector2(1f / num2);
Rectangle rectangle = new Rectangle(0, 0, BGTexture.Width, BGTexture.Height);
Vector2 zero = Vector2.Zero;
switch (Layers)
{
case 0:
{
zero.Y += 200f;
break;
}
case 1:
{
zero.Y += 0f;
break;
}
case 2:
{
zero.Y += 0f;
break;
}
case 3:
{
zero.Y += 0f;
break;
}
case 4:
{
zero.Y += 0f;
break;
}
}
vector2 *= Scale;
zero.Y -= num;
float LoopWidth = Scale * rectangle.Width;
float LoopHeight = Scale * rectangle.Height;
int LoopX = (int)((vector.X * vector3.X - vector2.X + zero.X - (Main.screenWidth >> 1)) / LoopWidth);
int LoopY = (int)((vector.Y * vector3.Y - vector2.Y + zero.Y - (Main.screenWidth >> 1)) / LoopWidth);
for (int i = LoopY - 2; i < LoopY + 4 + (int)(Main.screenWidth / LoopHeight); i++)
{
for (int j = LoopX - 2; j < LoopX + 4 + (int)(Main.screenWidth / LoopWidth); j++)
{
Vector2 drawPosition = (new Vector2(j * Scale * (rectangle.Width / vector3.X), playerDrawPosition) + vector2 - vector) * vector3 + vector - Main.screenPosition - vector2 + zero;
var frame = rectangle;
var color = Color.White * Transparency;
Main.spriteBatch.Draw(BGTexture, drawPosition, frame, color, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f);
}
}
}
}
}
private static void DrawBurrowsBG()
{
if (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.GleamingBurrowsBiome>()))
{
Transparency += TransitionSpeed;
Transparency += 1f;
if (Transparency > 1f)
Transparency = 1f;
Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

+32 -81
View File
@@ -27,7 +27,6 @@ namespace CalamityMod.Balancing
{
public sealed class BalancingChangesManager : ModSystem
{
internal static List<IBalancingRule[]> UniversalBalancingChanges = null;
internal static List<NPCBalancingChange> NPCSpecificBalancingChanges = null;
// Balancing changes in this method are sorted based on place in progression, NPC name (from A-Z), and strength of resistance in ascending order, in that level of priority.
@@ -37,6 +36,7 @@ namespace CalamityMod.Balancing
public override void SetStaticDefaults()
{
// Dirty shorthand for true melee resists, because they're super common and other class resists aren't.
// If you add/change a true melee resist here, be sure to add/change the resist in CalamityGlobalNPC ModifyHitByItem as well.
IBalancingRule ResistTrueMelee(float f) => new ClassResistBalancingRule(f, TrueMeleeDamageClass.Instance);
// Declare specific filters.
@@ -46,50 +46,12 @@ namespace CalamityMod.Balancing
bool DragonRageFilter(Projectile p) =>
p.type == ProjectileType<DragonRageStaff>() || p.type == ProjectileType<DragonRageFireball>() || (p.type == ProjectileType<FuckYou>() && p.CountsAsClass<MeleeDamageClass>());
// bool MonkStaffT3Filter(Projectile p) =>
// p.type == ProjectileID.MonkStaffT3_AltShot || (p.type == ProjectileID.Electrosphere && Main.player[p.owner].ActiveItem().type == ItemID.MonkStaffT3);
bool MushroomSpearFilter(Projectile p) =>
p.type == ProjectileID.Mushroom && Main.player[p.owner].ActiveItem().type == ItemID.MushroomSpear;
bool OrichalcumPetalFilter(Projectile p) =>
p.type == ProjectileID.FlowerPetal && Main.player[p.owner].onHitPetal;
bool SpectreMaskSetBonusFilter(Projectile p) =>
p.type == ProjectileID.SpectreWrath && Main.player[p.owner].ghostHurt;
bool AotCThrowCombo(Projectile p) =>
p.type == ProjectileType<ArkoftheCosmosSwungBlade>() && (p.ai[0] == 2 || p.ai[0] == 3);
bool HiveBeeFilter(Projectile p) =>
p.type == ProjectileType<BasicPlagueBee>() && Main.player[p.owner].ActiveItem().type == ItemType<TheHive>();
UniversalBalancingChanges = new List<IBalancingRule[]>()
{
// Nerf Crystal bullet shards by 45%
// Currently crystal bullet projectiles deal 50% of the bullet's damage which is absurd in vanilla, this nerfs them to 27.5%
Do(new ProjectileResistBalancingRule(0.55f, ProjectileID.CrystalShard)),
// Nerf Luminite Arrow trails by 50%.
Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.MoonlordArrowTrail)),
// Nerf Seedler seeds by 25%.
Do(new ProjectileResistBalancingRule(0.75f, ProjectileID.SeedlerNut, ProjectileID.SeedlerThorn)),
// Nerf Cursed Dart flames by 50%.
Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CursedDartFlame)),
// Nerf Mushroom Spear projectiles by 50%.
Do(new ProjectileSpecificRequirementBalancingRule(0.5f, MushroomSpearFilter)),
// Nerf Orichalcum armor set bonus petals by 25%.
Do(new ProjectileSpecificRequirementBalancingRule(0.75f, OrichalcumPetalFilter)),
// Nerf Spectre Mask set bonus projectiles by 50%.
Do(new ProjectileSpecificRequirementBalancingRule(0.5f, SpectreMaskSetBonusFilter)),
};
NPCSpecificBalancingChanges = new List<NPCBalancingChange>();
#region Crabulon
@@ -97,23 +59,23 @@ namespace CalamityMod.Balancing
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<Crabulon>(), ResistTrueMelee(0.8f)));
#endregion
#region Brain of Cthulhu: Creepers
// 50% resist to true melee.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.Creeper, Do(ResistTrueMelee(0.5f))));
// 50% resist to Demon Scythe.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.Creeper, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.DemonScythe))));
#endregion
#region Eater of Worlds
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(EaterOfWorldsIDList.List, Do(ResistTrueMelee(0.5f))));
// 50% resist to Demon Scythe.
NPCSpecificBalancingChanges.AddRange(Bundle(EaterOfWorldsIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.DemonScythe))));
// 40% resist to Sky Glaze.
NPCSpecificBalancingChanges.AddRange(Bundle(EaterOfWorldsIDList.List, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<StickyFeather>()))));
// 25% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(EaterOfWorldsIDList.List, Do(ResistTrueMelee(0.75f))));
#endregion
#region Brain of Cthulhu: Creepers
// 50% resist to Demon Scythe.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.Creeper, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.DemonScythe))));
// 25% resist to true melee.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.Creeper, Do(ResistTrueMelee(0.75f))));
#endregion
#region The Perforators
@@ -175,8 +137,11 @@ namespace CalamityMod.Balancing
#endregion
#region Astrum Aureus
// 30% resist to The Ballista's greatarrows.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<AstrumAureus>(), Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<BallistaGreatArrow>()))));
// 25% resist to true melee.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<AstrumAureus>(), ResistTrueMelee(0.75f)));
// 25% resist to The Ballista's greatarrows.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<AstrumAureus>(), Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<BallistaGreatArrow>()))));
#endregion
#region Duke Fishron
@@ -202,21 +167,18 @@ namespace CalamityMod.Balancing
// 50% resist to Aegis Blade's explosions because the true melee resist ain't enough.
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<AegisBlast>()))));
// 50% resist to Icicle Arrows.
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<IcicleArrowProj>()))));
// 40% resist to Icicle Arrows.
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<IcicleArrowProj>()))));
// 35% resist to Flying Dragon.
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2SquireSonicBoom))));
// 30% resist to Aurora Blazer.
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<AuroraFire>()))));
// 30% resist to Flak Kraken.
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<FlakKrakenProjectile>()))));
// 25% resist to Lucrecia.
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<DNA>()))));
// 20% resist to Aurora Blazer.
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<AuroraFire>()))));
// 20% resist to The Hive.
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<HiveNuke>(), ProjectileType<HiveMissile>()))));
#endregion
@@ -245,27 +207,27 @@ namespace CalamityMod.Balancing
// 70% resist to Stardust Dragon Staff.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.StardustDragon1, ProjectileID.StardustDragon2, ProjectileID.StardustDragon3, ProjectileID.StardustDragon4))));
// 55% resist to Flak Kraken.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.45f, ProjectileType<FlakKrakenProjectile>()))));
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(ResistTrueMelee(0.5f))));
// 50% resist to Atlantis (Atlantis gaming!).
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<AtlantisSpear>()))));
// 50% resist to Aurora Blazer.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<AuroraFire>()))));
// 35% resist to Aerial Bane.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2BetsyArrow))));
// 35% resist to Ballistic Poison Bomb's clouds.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<BallisticPoisonCloud>()))));
// 35% resist to Icicle Arrows.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<IcicleArrowProj>()))));
// 30% resist to Aurora Blazer.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<AuroraFire>()))));
// 30% resist to Flak Kraken.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<FlakKrakenProjectile>()))));
// 20% resist to Ballistic Poison Bomb's clouds.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<BallisticPoisonCloud>()))));
// 20% resist to Cluster Rocket fragments.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.ClusterFragmentsI, ProjectileID.ClusterFragmentsII))));
#endregion
@@ -511,23 +473,12 @@ namespace CalamityMod.Balancing
public override void Unload()
{
UniversalBalancingChanges = null;
NPCSpecificBalancingChanges = null;
}
public static void ApplyFromProjectile(NPC npc, ref NPC.HitModifiers modifiers, Projectile proj)
{
// Apply universal balancing rules.
foreach (IBalancingRule[] balancingRules in UniversalBalancingChanges)
{
foreach (IBalancingRule balancingRule in balancingRules)
{
if (balancingRule.AppliesTo(npc, modifiers, proj))
balancingRule.ApplyBalancingChange(npc, ref modifiers);
}
}
// As well as rules specific to NPCs.
// Apply NPC-specific balancing rules.
foreach (NPCBalancingChange balanceChange in NPCSpecificBalancingChanges)
{
if (npc.type != balanceChange.NPCType)
+6 -38
View File
@@ -117,54 +117,22 @@
#endregion
#region Life Steal
// Life steal cap
// Life steal cap (Maximum HP healed per instance of lifesteal)
internal static readonly int LifeStealCap = 100;
// Life steal accessories require a more strict cooldown due to their ease of use and global application
internal static readonly float LifeStealAccessoryCooldownMultiplier = 3f;
// Life steal cooldown multipliers used for armor set bonuses
internal static readonly float LifeStealSetBonusCooldownMultiplier = 2f;
internal static readonly float LifeStealReaverTankCooldownMultiplier = 4f;
// The range was buffed in vanilla from 1200 to 3000 in 1.4.4, and I agree with that decision
internal static readonly float LifeStealRange = 3000f;
// Life steal caps (aka, how much life steal the player is allowed before it goes on cooldown)
internal static readonly float LifeStealCap_Classic = 60f;
internal static readonly float LifeStealCap_Expert = 50f;
internal static readonly float LifeStealCap_Revengeance = 40f;
internal static readonly float LifeStealCap_Death = 30f;
// Master nerfs the life steal cap by 10, resulting in 40 in non-Rev Master, 30 in Rev Master, and 20 in Death Master
internal static readonly float LifeStealCapReduction_Master = 10f;
// Base life steal caps from vanilla (aka, how much life steal the player is allowed before it goes on cooldown)
internal static readonly float LifeStealCap_Classic = 80f;
internal static readonly float LifeStealCap_Expert = 70f;
// The base life steal cooldowns from vanilla
internal static readonly float LifeStealRecoveryRate_Classic = 0.6f;
internal static readonly float LifeStealRecoveryRate_Expert = 0.5f;
// The calculations below show the time (in frames) for 10 life steal cooldown to recover in each difficulty
// Classic: 10 / 0.2 = 50
// Expert: 10 / 0.15 = 66.667
// Revengeance: 10 / 0.125 = 80
// Death: 10 / 0.1 = 100
// Master: 10 / 0.1 = 100
// Revengeance Master: 10 / 0.075 = 133.333
// Death Master: 10 / 0.05 = 200
// Nerfs the life steal recovery rate in Classic from 0.6/s to 0.2/s
// 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 Expert from 0.5/s to 0.15/s
// 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 Revengeance from 0.5/s to 0.125/s
internal static readonly float LifeStealRecoveryRateReduction_Revengeance = 0.375f;
// Nerfs the life steal recovery rate in Death from 0.5/s to 0.1/s
internal static readonly float LifeStealRecoveryRateReduction_Death = 0.4f;
// Nerfs the life steal recovery rate in Master by 0.05/s, resulting in 0.1/s in non-Rev Master, 0.075/s in Rev Master, and 0.05/s in Death Master
internal static readonly float LifeStealRecoveryRateReduction_Master = 0.05f;
#endregion
#region Rogue Base Stats
+17 -18
View File
@@ -36,10 +36,6 @@ namespace CalamityMod.Buffs
{
player.arrowDamage *= 0.955f;
}
else if (type == BuffID.Ironskin)
{
player.statDefense += CalamityUtils.GetScalingDefense(-1) - 8;
}
else if (type == BuffID.MagicPower)
{
player.GetDamage<MagicDamageClass>() -= 0.1f;
@@ -93,10 +89,6 @@ namespace CalamityMod.Buffs
{
player.Calamity().shine = true;
}
else if (type == BuffID.IceBarrier)
{
player.endurance -= 0.1f;
}
// Beetle Shell DR is a full compensation, as the vanilla multiplicative DR is removed entirely.
else if (type >= BuffID.BeetleEndurance1 && type <= BuffID.BeetleEndurance3 && player.beetleDefense)
@@ -115,6 +107,19 @@ namespace CalamityMod.Buffs
else if (type == BuffID.Rabies)
{
player.GetDamage<GenericDamageClass>() -= 0.2f;
// Reimplementation of random debuff infliction; now occurs on a consistent timer and with a different debuff list
if (player.buffTime[buffIndex] % 600 == 300)
{
int debuffType = Main.rand.Next(4) switch
{
0 => BuffID.Weak,
1 => BuffID.Bleeding,
2 => BuffID.Darkness,
_ => BuffID.BrokenArmor,
};
player.AddBuff(debuffType, Main.rand.Next(90, 211));
}
}
else if (type == BuffID.Werewolf)
{
@@ -148,12 +153,6 @@ namespace CalamityMod.Buffs
if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
}
else if (type == BuffID.Slow)
{
npc.Calamity().slowed = true;
if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
}
if (type == BuffID.Electrified)
{
npc.Calamity().electrified = true;
@@ -201,10 +200,6 @@ namespace CalamityMod.Buffs
tip = tip.Replace("25", "15");
break;
case BuffID.Ironskin:
tip = tip.Replace("8", CalamityUtils.GetScalingDefense(-1).ToString());
break;
case BuffID.LeafCrystal:
tip = CalamityUtils.GetTextValue("Vanilla.BuffDescription.LeafCrystal");
break;
@@ -242,6 +237,10 @@ namespace CalamityMod.Buffs
tip = tip.Replace("45", "22.5");
break;
case BuffID.Rabies:
tip = CalamityUtils.GetTextValue("Vanilla.BuffDescription.Rabies");
break;
case BuffID.SugarRush:
tip = tip.Replace("20", "10");
break;
+2 -5
View File
@@ -1,4 +1,5 @@
using CalamityMod.CalPlayer;
using CalamityMod.Items.Accessories.Vanity;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -18,11 +19,7 @@ namespace CalamityMod.Buffs
public override void Update(Player player, ref int buffIndex)
{
CalamityPlayer modPlayer = player.Calamity();
if (modPlayer.snowmanPrevious)
{
modPlayer.snowmanPower = true;
}
else
if (player.Transformation().Type != ModContent.ItemType<Popo>())
{
player.DelBuff(buffIndex);
buffIndex--;
+2 -4
View File
@@ -1,4 +1,5 @@
using CalamityMod.CalPlayer;
using CalamityMod.Items.Accessories.Vanity;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -17,11 +18,8 @@ namespace CalamityMod.Buffs
public override void Update(Player player, ref int buffIndex)
{
CalamityPlayer modPlayer = player.Calamity();
if (modPlayer.snowmanPrevious)
{
modPlayer.snowmanPower = true;
if (player.Transformation().Type == ModContent.ItemType<Popo>())
modPlayer.snowmanNoseless = true;
}
else
{
player.DelBuff(buffIndex);
Binary file not shown.

Before

Width:  |  Height:  |  Size: 531 B

After

Width:  |  Height:  |  Size: 573 B

-1
View File
@@ -26,7 +26,6 @@ namespace CalamityMod.Buffs.StatBuffs
player.maxFallSpeed = 9f;
player.gills = true;
}
modPlayer.abyssalDivingSuitPower = true;
modPlayer.depthCharm = true;
modPlayer.jellyfishNecklace = true;
modPlayer.anechoicPlating = true;
+1 -2
View File
@@ -20,14 +20,13 @@ namespace CalamityMod.Buffs.StatBuffs
CalamityPlayer modPlayer = player.Calamity();
if (modPlayer.aquaticHeartPrevious)
{
modPlayer.aquaticHeartPower = true;
player.ignoreWater = NPC.downedBoss3;
player.accFlipper = true;
if (player.breath <= player.breathMax + 2 && !modPlayer.ZoneAbyss && NPC.downedBoss3)
{
player.breath = player.breathMax + 3;
}
if (Main.myPlayer == player.whoAmI && player.wet && NPC.downedBoss3)
if (Main.myPlayer == player.whoAmI && player.Calamity().countsAsAnyWet && NPC.downedBoss3)
{
player.AddBuff(ModContent.BuffType<AquaticHeartWaterSpeed>(), 360);
}
-24
View File
@@ -1,24 +0,0 @@
using Terraria;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.StatBuffs
{
public class BrutalCarnage : ModBuff
{
public static float MeleeDamageBoost = 0.2f;
public override LocalizedText Description => base.Description.WithFormatArgs(MeleeDamageBoost.ToPercent());
public override void SetStaticDefaults()
{
Main.debuff[Type] = false;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().brutalCarnage = true;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 625 B

+1 -1
View File
@@ -8,7 +8,7 @@ namespace CalamityMod.Buffs.StatBuffs
{
public class Mushy : ModBuff
{
public static int DefenseBoost = 8;
public static int DefenseBoost = 5;
public static int RegenBoost = 2;
public override LocalizedText Description => base.Description.WithFormatArgs(DefenseBoost, RegenBoost.ToRegenPerSecond());
+1 -2
View File
@@ -7,7 +7,7 @@ namespace CalamityMod.Buffs.StatBuffs
{
public class SpiritDefense : ModBuff
{
public override LocalizedText Description => base.Description.WithFormatArgs(SpiritGlyph.DefenseBoost, SpiritGlyph.DamageReductionBoost.ToPercent());
public override LocalizedText Description => base.Description.WithFormatArgs(SpiritGlyph.DefenseBoost);
public override void SetStaticDefaults()
{
@@ -20,7 +20,6 @@ namespace CalamityMod.Buffs.StatBuffs
public override void Update(Player player, ref int buffIndex)
{
player.statDefense += SpiritGlyph.DefenseBoost;
player.endurance += SpiritGlyph.DamageReductionBoost; // TODO -- is this applied too late to be affected by the DR softcap?
}
}
}
+3 -21
View File
@@ -18,31 +18,13 @@ namespace CalamityMod.Buffs.StatDebuffs
BuffID.Sets.LongerExpertDebuff[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().glacialState = true;
}
public override void Update(NPC npc, ref int buffIndex)
{
npc.Calamity().glacialState = true;
if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
{
Player Player = drawInfo.drawPlayer;
if (Main.rand.NextBool(4))
{
Dust d = Dust.NewDustDirect(Player.Center - 10 * Vector2.One, 20, 20, DustID.IcyMerman);
d.noGravity = Main.rand.NextBool();
d.noLight = false;
d.velocity *= 0.2f;
d.velocity.Y -= Main.rand.NextFloat(0.4f, 0.6f);
d.scale = Main.rand.NextFloat(0.4f, 0.7f);
}
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().gState;
npc.DelBuff(buffIndex);
buffIndex--;
}
}
}
+67 -230
View File
@@ -21,6 +21,7 @@ using CalamityMod.Items.Armor.Bloodflare;
using CalamityMod.Items.Armor.Brimflame;
using CalamityMod.Items.Armor.Daedalus;
using CalamityMod.Items.Armor.Demonshade;
using CalamityMod.Items.Armor.DesertProwler;
using CalamityMod.Items.Armor.Empyrean;
using CalamityMod.Items.Armor.LunicCorps;
using CalamityMod.Items.Armor.OmegaBlue;
@@ -28,7 +29,9 @@ using CalamityMod.Items.Armor.PlagueReaper;
using CalamityMod.Items.Armor.Silva;
using CalamityMod.Items.Armor.SnowRuffian;
using CalamityMod.Items.Armor.Victide;
using CalamityMod.Items.Armor.Wulfrum;
using CalamityMod.Items.Dyes;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Mounts;
using CalamityMod.Items.Mounts.Minecarts;
using CalamityMod.Items.PermanentBoosters;
@@ -176,6 +179,8 @@ namespace CalamityMod.CalPlayer
/// <summary> A multiplier on the player's movement speed applied while using Momentum Capacitor. </summary>
public float momentumCapacitorBoost = 0f;
public bool countsAsAnyWet => (Player.armor[0].type == ItemID.FishBowl || Player.wetCount > 0 || Player.wet || Player.honeyWet || Player.lavaWet);
public StatModifier TypelessDebuffMultiplier = new();
public StatModifier HeatDebuffMultiplier = new();
public StatModifier ColdDebuffMultiplier = new();
@@ -205,7 +210,6 @@ namespace CalamityMod.CalPlayer
#region External variables -- Not used by Calamity, only via Mod.Call or reflection
public int externalAbyssLight = 0;
public float externalBreathLossMultBoost = 0f;
public float externalBreathTickBoost = 0f;
public float externalFlightTimeMultBoost = 0f;
@@ -284,6 +288,8 @@ namespace CalamityMod.CalPlayer
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>
public int flareGunOverheat = 0;
/// <summary>
/// If true, this player's Brittle Star Staff minions are in their orbiting mode.<br/>
/// While in this mode, they orbit around the player, do not break on hits, and increase defense.
@@ -309,6 +315,9 @@ namespace CalamityMod.CalPlayer
public int furyFuelMax = 1800;
public int furyFuel = 1800;
public float furyRefuelTimer = 0;
/// <summary> Variable used to track if Auger can do a big slash </summary>
public bool buffedAuger = false;
public int rOfResilienceCooldown = 0;
public int rOfResilienceEffect = 0;
public int rOfResilienceOrbitOffset = 0;
@@ -462,7 +471,7 @@ namespace CalamityMod.CalPlayer
/// This is obtained from a formula derived from the player's current stealth, the weapon's use time, and the player's stealth generation boosts.
/// </summary>
public float stealthDamage = 0f;
/// <summary> An additional damage multiplier applied to rogue stealth strikes. Used by Filthy Glove and its upgrades, and Rotten Dogtooth. </summary>
/// <summary> An additional damage multiplier applied to rogue stealth strikes. Used by Filthy Glove, Rotten Dogtooth and their upgrades. </summary>
public double bonusStealthDamage = 0;
public float rogueVelocity = 1f;
#endregion
@@ -667,8 +676,6 @@ namespace CalamityMod.CalPlayer
#endregion
#region Abyss
/// <summary> The amount of breath lost on each tick while in the Abyss. </summary>
public float abyssBreathLossStat = 0;
/// <summary> The rate at which breath is lost while in the Abyss. </summary>
public float abyssBreathLossRateStat = 0;
/// <summary> The rate at which health is decreased after running out of breath while in the Abyss. </summary>
@@ -725,8 +732,8 @@ namespace CalamityMod.CalPlayer
public bool gladiatorSword = false;
public int gladiatorTimer = 0;
public bool unstableGraniteCore = false;
public bool regenator = false;
public float regenatorDamage = 0;
public bool regenerator = false;
public float regeneratorDamage = 0;
public bool theBee = false;
public bool arcFlashRing = false;
public bool arcFlashRingVisual = false;
@@ -964,6 +971,8 @@ namespace CalamityMod.CalPlayer
public bool XykVisualsBlue = false;
public bool XykVisualsOrange = false;
public Color XykFXColor = Color.Black;
public int XykWingTimer = 0;
public Color lightRGB = Color.Black;
public bool manaOverloader = false;
/// <summary> Used for allowing Calamity slimes to be affected by Royal Gel. </summary>
public bool royalGel = false;
@@ -1068,6 +1077,8 @@ namespace CalamityMod.CalPlayer
/// <summary> Calamity's Silver armor set bonus; taking over 20 damage heals 10 health if the player avoids damage for 2 seconds. </summary>
public bool silverMedkit = false;
public int silverMedkitTimer = 0;
/// <summary> Calamity's Tungsten armor set bonus; makes grappling hooks fly and retract faster. </summary>
public bool tungstenArmorHookBoost = false;
/// <summary> Calamity's Gold armor set bonus; makes enemies drop Gold Coins. </summary>
public bool goldArmorGoldDrops = false;
/// <summary> Calamity's Mining armor set bonus; gives a chance for extra items to drop when mining ores. </summary>
@@ -1150,8 +1161,6 @@ namespace CalamityMod.CalPlayer
public int titanCooldown = 0;
public bool umbraphileSet = false;
public bool reaverSpeed = false;
public bool reaverRegen = false;
public int reaverRegenCooldown = 0;
public bool reaverDefense = false;
public bool reaverExplore = false;
public bool fathomSwarmer = false;
@@ -1269,7 +1278,6 @@ namespace CalamityMod.CalPlayer
public bool plague = false;
public bool holyFlames = false;
public bool holyInferno = false;
public bool glacialState = false;
public bool burningBlood = false;
public bool brainRot = false;
public bool heavybleeding = false;
@@ -1326,7 +1334,6 @@ namespace CalamityMod.CalPlayer
public bool xWrath = false;
public bool graxDefense = false;
public bool encased = false;
public bool brutalCarnage = false;
public bool omniscience = false;
public bool zerg = false;
public bool zen = false;
@@ -1584,33 +1591,19 @@ namespace CalamityMod.CalPlayer
#endregion
#region Transformation
public bool abyssalDivingSuitPrevious;
public bool abyssalDivingSuit;
public bool abyssalDivingSuitHide;
public bool abyssalDivingSuitForce;
public bool abyssalDivingSuitPower;
public bool abyssalDivingSuitPrevious;
public bool profanedCrystal;
public int profanedCrystalStatePrevious;
public bool profanedCrystalPrevious;
public int profanedCrystalAnim;
public bool profanedCrystalForce;
public bool profanedCrystalBuffs;
public bool profanedCrystalHide;
public KeyValuePair<int, int> profanedCrystalWingCounter = new KeyValuePair<int, int>(0, 10);
public KeyValuePair<int, int> profanedCrystalAnimCounter = new KeyValuePair<int, int>(0, 10);
public int pscState;
public Color pscLerpColor = Color.White;
public bool aquaticHeartPrevious;
public bool aquaticHeart;
public bool aquaticHeartHide;
public bool aquaticHeartForce;
public bool aquaticHeartPower;
public bool snowmanPrevious;
public bool snowman;
public bool snowmanHide;
public bool snowmanForce;
public bool snowmanNoseless;
public bool snowmanPower;
public bool meldTransformationPrevious;
public bool meldTransformation;
public bool meldTransformationForce;
@@ -1619,8 +1612,6 @@ namespace CalamityMod.CalPlayer
public bool omegaBlueTransformation;
public bool omegaBlueTransformationForce;
public bool omegaBlueTransformationPower;
public bool ghostBracelet;
public bool punchCard;
#endregion
#region Calamitas Enchant Effects
@@ -2005,10 +1996,9 @@ namespace CalamityMod.CalPlayer
public override void ResetEffects()
{
if (fleshKnuckles)
Player.statLifeMax2 += 45;
Player.statLifeMax2 += 25;
int percentMaxLifeIncrease = 0;
// Blood Pact and Chalice of the Blood God stack their HP bonuses if you want to equip both
if (bloodPact)
percentMaxLifeIncrease += 25;
@@ -2048,7 +2038,6 @@ namespace CalamityMod.CalPlayer
DashID = string.Empty;
externalAbyssLight = 0;
externalBreathLossMultBoost = 0f;
externalBreathTickBoost = 0f;
externalFlightTimeMultBoost = 0f;
externalRageEnabled = externalAdrenalineEnabled = null;
@@ -2179,7 +2168,7 @@ namespace CalamityMod.CalPlayer
trinketOfChi = false;
gladiatorSword = false;
unstableGraniteCore = false;
regenator = false;
regenerator = false;
deepDiver = false;
theBee = false;
arcFlashRing = false;
@@ -2354,7 +2343,6 @@ namespace CalamityMod.CalPlayer
avertorBonus = false;
reaverRegen = false;
reaverSpeed = false;
reaverDefense = false;
reaverExplore = false;
@@ -2386,6 +2374,7 @@ namespace CalamityMod.CalPlayer
forbiddenCirclet = false;
silverMedkit = false;
tungstenArmorHookBoost = false;
goldArmorGoldDrops = false;
miningSet = false;
@@ -2487,7 +2476,6 @@ namespace CalamityMod.CalPlayer
plague = false;
holyFlames = false;
holyInferno = false;
glacialState = false;
burningBlood = false;
brainRot = false;
heavybleeding = false;
@@ -2534,7 +2522,6 @@ namespace CalamityMod.CalPlayer
xWrath = false;
graxDefense = false;
encased = false;
brutalCarnage = false;
omniscience = false;
zerg = false;
zen = false;
@@ -2740,29 +2727,22 @@ namespace CalamityMod.CalPlayer
*/
abyssalDivingSuitPrevious = abyssalDivingSuit;
abyssalDivingSuit = abyssalDivingSuitHide = abyssalDivingSuitForce = abyssalDivingSuitPower = false;
abyssalDivingSuit = false;
aquaticHeartPrevious = aquaticHeart;
aquaticHeart = aquaticHeartHide = aquaticHeartForce = aquaticHeartPower = false;
aquaticHeart = false;
profanedCrystalStatePrevious = pscState;
profanedCrystalPrevious = profanedCrystal;
profanedCrystal = profanedCrystalBuffs = profanedCrystalForce = profanedCrystalHide = false;
profanedCrystal = profanedCrystalBuffs = false;
pscState = 0;
pscLerpColor = Color.White;
snowmanPrevious = snowman;
snowman = snowmanHide = snowmanForce = snowmanPower = false;
meldTransformationPrevious = meldTransformation;
meldTransformation = meldTransformationForce = meldTransformationPower = false;
omegaBlueTransformationPrevious = omegaBlueTransformation;
omegaBlueTransformation = omegaBlueTransformationForce = omegaBlueTransformationPower = false;
ghostBracelet = false;
punchCard = false;
rageModeActive = false;
adrenalineModeActive = false;
AdrenalineTrail = false;
@@ -2916,7 +2896,6 @@ namespace CalamityMod.CalPlayer
demonSwordKillMode = false;
externalAbyssLight = 0;
externalBreathLossMultBoost = 0f;
externalBreathTickBoost = 0f;
externalFlightTimeMultBoost = 0f;
externalColdImmunity = externalHeatImmunity = false;
@@ -2963,7 +2942,6 @@ namespace CalamityMod.CalPlayer
plague = false;
holyFlames = false;
holyInferno = false;
glacialState = false;
burningBlood = false;
brainRot = false;
heavybleeding = false;
@@ -3043,7 +3021,6 @@ namespace CalamityMod.CalPlayer
xWrath = false;
graxDefense = false;
encased = false;
brutalCarnage = false;
omniscience = false;
zerg = false;
zen = false;
@@ -3120,6 +3097,7 @@ namespace CalamityMod.CalPlayer
#region Armor Set Bonuses
silverMedkit = false;
silverMedkitTimer = 0;
tungstenArmorHookBoost = false;
goldArmorGoldDrops = false;
miningSet = false;
miningSetCooldown = 0;
@@ -3161,8 +3139,6 @@ namespace CalamityMod.CalPlayer
lunicCorpsSet = false;
lunicCorpsLegs = false;
reaverSpeed = false;
reaverRegen = false;
reaverRegenCooldown = 0;
reaverDefense = false;
reaverExplore = false;
shadeRegen = false;
@@ -3260,6 +3236,7 @@ namespace CalamityMod.CalPlayer
ascendantTrail = false;
evilSmasherBoost = 0;
burningSeaBurnOut = 0;
flareGunOverheat = 0;
hellbornShots = 0;
searedPanCounter = 0;
searedPanTimer = 0;
@@ -3569,19 +3546,16 @@ namespace CalamityMod.CalPlayer
{
PlayerLoader.ArmorSetBonusActivated(Player);
if (CalamityClientConfig.Instance.CalamityArmorSetBonusDoubleTap)
// Activate vanilla set bonuses
if (Player.setVortex && !Player.mount.Active)
Player.vortexStealthActive = !Player.vortexStealthActive;
if (Player.setForbidden)
{
// Activate vanilla set bonuses
if (Player.setVortex && !Player.mount.Active)
Player.vortexStealthActive = !Player.vortexStealthActive;
Player.MinionRestTargetAim();
if (Player.setForbidden)
{
Player.MinionRestTargetAim();
if (!Player.setForbiddenCooldownLocked)
Player.CommandForbiddenStorm();
}
if (!Player.setForbiddenCooldownLocked)
Player.CommandForbiddenStorm();
}
}
@@ -3794,10 +3768,6 @@ namespace CalamityMod.CalPlayer
public override void ArmorSetBonusActivated()
{
// Don't trigger set bonuses if the config is disabled and the double-tap hotkey was triggered
if (!(CalamityKeybinds.ArmorSetBonusHotKey.JustPressed || CalamityClientConfig.Instance.CalamityArmorSetBonusDoubleTap))
return;
// TODO -- It would be nice if triggerable set bonuses used interfaces instead of having to go through this large if chain.
if (brimflameSet && !Player.HasCooldown(BrimflameFrenzy.ID))
{
@@ -3966,6 +3936,30 @@ namespace CalamityMod.CalPlayer
}
if (prismaticSet && !Player.HasCooldown(PrismaticLaser.ID) && prismaticLasers <= 0)
prismaticLasers = CalamityUtils.SecondsToFrames(35f);
if (WulfrumHat.HasArmorSet(Player))
{
//Only activate if no cooldown & available scrap.
if (cooldowns.TryGetValue(WulfrumBastion.ID, out CooldownInstance cd))
{
// Quick dismount if activated again
if (cd.timeLeft > WulfrumHat.BastionCooldown && cd.timeLeft < WulfrumHat.BastionCooldown + WulfrumHat.BastionTime - 60 * 3)
{
cd.timeLeft = WulfrumHat.BastionCooldown + 1;
SyncCooldownDictionary(false);
}
}
else if (Player.HasItem(ItemType<WulfrumMetalScrap>()))
{
Player.ConsumeItem(ItemType<WulfrumMetalScrap>());
//I Thiiiinnnk there's no need to add mp syncing packets since cooldowns get auto synced right
Player.AddCooldown(WulfrumBastion.ID, WulfrumHat.BastionCooldown + WulfrumHat.BastionTime);
//Though do I need to sync that or is the player inventory auto synced?
WulfrumHat.DummyCannon.SetDefaults(ItemType<WulfrumFusionCannon>());
}
}
if (DesertProwlerHat.HasArmorSet(Player) && !Player.HasCooldown(SandsmokeBomb.ID))
Player.AddCooldown(SandsmokeBomb.ID, DesertProwlerHat.SmokeCooldown + DesertProwlerHat.SmokeDuration);
}
#endregion
@@ -4075,6 +4069,11 @@ namespace CalamityMod.CalPlayer
// Putting this in GlobalItem will run multiple times for each slot, which this system already does, creating a slew of problems.
VanillaArmorChangeManager.ApplyPotentialEffectsTo(Player);
// Nerf to the proc rate of Spectre Mask's set bonus souls
// Vanilla subtracts 6.6666665 from this counter per frame, this reduces it to 4
if (Player.ghostDmg > 0)
Player.ghostDmg += 2.6666665f;
// If the config is enabled, vastly increase the player's base tile and wall placement speeds
// This stacks with the Brick Layer and Portable Cement Mixer
if (CalamityServerConfig.Instance.FasterTilePlacement)
@@ -4105,7 +4104,7 @@ namespace CalamityMod.CalPlayer
if (timePotionSick == 1 && Player.whoAmI == Main.myPlayer && absorber)
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ProjectileType<AbsorberAura>(), 0, 0, Player.whoAmI);
if (snowman)
if (Player.Transformation().Type == ModContent.ItemType<Popo>())
{
if (Player.whoAmI == Main.myPlayer && !snowmanNoseless)
Player.AddBuff(BuffType<PopoBuff>(), 60, true);
@@ -4381,15 +4380,7 @@ namespace CalamityMod.CalPlayer
if (Player.whoAmI == Main.myPlayer)
{
float baseRecoveryRate = Main.expertMode ? BalancingConstants.LifeStealRecoveryRate_Expert : BalancingConstants.LifeStealRecoveryRate_Classic;
float lifeStealRecoveryRateReduction =
CalamityWorld.death ? BalancingConstants.LifeStealRecoveryRateReduction_Death :
CalamityWorld.revenge ? BalancingConstants.LifeStealRecoveryRateReduction_Revengeance :
Main.expertMode ? BalancingConstants.LifeStealRecoveryRateReduction_Expert :
BalancingConstants.LifeStealRecoveryRateReduction_Classic;
if (Main.masterMode)
lifeStealRecoveryRateReduction += BalancingConstants.LifeStealRecoveryRateReduction_Master;
float lifeStealRecoveryRateReduction = Main.expertMode ? BalancingConstants.LifeStealRecoveryRateReduction_Expert : BalancingConstants.LifeStealRecoveryRateReduction_Classic;
float lifeStealRecoveryRate = baseRecoveryRate - lifeStealRecoveryRateReduction;
if (Player.lifeSteal < -lifeStealRecoveryRate)
@@ -4914,37 +4905,6 @@ namespace CalamityMod.CalPlayer
&& Player.armor[1].type == ModContent.ItemType<SnowRuffianChestplate>()
&& Player.armor[2].type == ModContent.ItemType<SnowRuffianGreaves>())
snowRuffianSet = true;
// Accessories
for (int i = 3; i < 8; i++)
{
Item vanity = Player.armor[i];
if (vanity.type == ModContent.ItemType<AbandonedWulfrumHelmet>())
Player.GetModPlayer<WulfrumTransformationPlayer>().transformationActive = true;
if (vanity.type == ModContent.ItemType<AbyssalDivingSuit>())
abyssalDivingSuitForce = true;
if (vanity.type == ModContent.ItemType<AquaticHeart>())
aquaticHeartForce = true;
if (vanity.type == ModContent.ItemType<GhostBracelet>())
ghostBracelet = true;
if (vanity.type == ModContent.ItemType<HapuFruit>())
Player.GetModPlayer<HapuFruitPlayer>().vanityEquipped = true;
if (vanity.type == ModContent.ItemType<OracleHeadphones>())
Player.GetModPlayer<OracleHeadphonesPlayer>().vanityEquipped = true;
if (vanity.type == ModContent.ItemType<Popo>())
snowmanForce = true;
if (vanity.type == ModContent.ItemType<ProfanedSoulCrystal>())
profanedCrystalForce = true;
if (vanity.type == ModContent.ItemType<PunchCard>())
punchCard = true;
if (vanity.type == ModContent.ItemType<SharkyPlush>())
Player.GetModPlayer<SharkyPlushPlayer>().vanityEquipped = true;
if (vanity.type == ModContent.ItemType<XyksBlessingBlue>())
Player.GetModPlayer<XyksBlessingBluePlayer>().vanityEquipped = true;
if (vanity.type == ModContent.ItemType<XyksBlessingOrange>())
Player.GetModPlayer<XyksBlessingOrangePlayer>().vanityEquipped = true;
}
}
if (Player.Calamity().andromedaState == AndromedaPlayerState.LargeRobot ||
@@ -4952,58 +4912,8 @@ namespace CalamityMod.CalPlayer
{
Player.head = EquipLoader.GetEquipSlot(Mod, "HeadlessEquipTexture", EquipType.Head); // To make the head invisible on the map. The map was having a hissy fit because of hitbox changes.
}
else if ((profanedCrystal || profanedCrystalForce) && !profanedCrystalHide)
{
Player.legs = EquipLoader.GetEquipSlot(Mod, Main.dayTime ? "ProfanedSoulCrystal" : "PscNightLegs", EquipType.Legs);
Player.body = EquipLoader.GetEquipSlot(Mod, "ProfanedSoulCrystal", EquipType.Body);
Player.head = EquipLoader.GetEquipSlot(Mod, Main.dayTime ? "ProfanedSoulCrystal" : "PscNightHead", EquipType.Head);
Player.wings = EquipLoader.GetEquipSlot(Mod, Main.dayTime ? "ProfanedSoulCrystal" : "PscNightWings", EquipType.Wings);
Player.face = -1;
bool enrage = pscState >= (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Enraged;
if (profanedCrystalWingCounter.Value == 0)
{
int key = profanedCrystalWingCounter.Key;
profanedCrystalWingCounter = new KeyValuePair<int, int>(key == 3 ? 0 : key + 1, enrage ? 5 : 8);
}
Player.wingFrame = profanedCrystalWingCounter.Key;
profanedCrystalWingCounter = new KeyValuePair<int, int>(profanedCrystalWingCounter.Key, profanedCrystalWingCounter.Value - 1);
Player.armorEffectDrawOutlines = true;
if (profanedCrystalBuffs)
{
Player.armorEffectDrawShadow = true;
if (enrage)
{
Player.armorEffectDrawOutlinesForbidden = true;
}
}
}
else if ((snowmanPower || snowmanForce) && !snowmanHide)
{
Player.legs = EquipLoader.GetEquipSlot(Mod, "Popo", EquipType.Legs);
Player.body = EquipLoader.GetEquipSlot(Mod, "Popo", EquipType.Body);
Player.head = EquipLoader.GetEquipSlot(Mod, snowmanNoseless ? "PopoNoseless" : "Popo", EquipType.Head);
Player.face = -1;
}
else if (AresExoskeleton.ArmExists(Player))
Player.body = EquipLoader.GetEquipSlot(Mod, "AresExoskeleton", EquipType.Body);
else if ((abyssalDivingSuitPower || abyssalDivingSuitForce) && !abyssalDivingSuitHide)
{
Player.legs = EquipLoader.GetEquipSlot(Mod, "AbyssalDivingSuit", EquipType.Legs);
Player.body = EquipLoader.GetEquipSlot(Mod, "AbyssalDivingSuit", EquipType.Body);
Player.head = EquipLoader.GetEquipSlot(Mod, "AbyssalDivingSuit", EquipType.Head);
Player.face = -1;
}
else if ((aquaticHeartPower || aquaticHeartForce) && !aquaticHeartHide)
{
Player.legs = EquipLoader.GetEquipSlot(Mod, "AquaticHeart", EquipType.Legs);
Player.body = EquipLoader.GetEquipSlot(Mod, "AquaticHeart", EquipType.Body);
Player.head = EquipLoader.GetEquipSlot(Mod, "AquaticHeart", EquipType.Head);
Player.face = -1;
}
else if (meldTransformationPower || meldTransformationForce)
{
Player.legs = EquipLoader.GetEquipSlot(Mod, "MeldTransformation", EquipType.Legs);
@@ -5018,26 +4928,7 @@ namespace CalamityMod.CalPlayer
if (hasOmegaBlueCooldown && cd.timeLeft > 1500)
Player.head = EquipLoader.GetEquipSlot(Mod, "OmegaBlueTransformation", EquipType.Head);
}
else
{
if (profanedCrystalWingCounter.Key != 1)
profanedCrystalWingCounter = new KeyValuePair<int, int>(1, 7);
if (profanedCrystalAnimCounter.Key != 0)
profanedCrystalAnimCounter = new KeyValuePair<int, int>(0, 10);
}
if (ghostBracelet)
{
Player.legs = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Legs);
Player.body = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Body);
Player.head = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Head);
}
if (punchCard)
{
Player.legs = EquipLoader.GetEquipSlot(Mod, "PunchCard", EquipType.Legs);
Player.body = EquipLoader.GetEquipSlot(Mod, "PunchCard", EquipType.Body);
Player.head = EquipLoader.GetEquipSlot(Mod, "PunchCard", EquipType.Head);
}
if (snowRuffianSet)
{
@@ -5047,7 +4938,7 @@ namespace CalamityMod.CalPlayer
{
if (!Player.mount.Active)
{
Player.velocity.Y *= 0.9f;
Player.velocity.Y *= SnowRuffianMask.GlideFallSpeedMult;
Player.wingFrame = 3;
}
Player.noFallDmg = true;
@@ -5635,60 +5526,6 @@ namespace CalamityMod.CalPlayer
}
}
private bool IsValidTransitionFrame(AnimationType currentAnim, AnimationType newAnim, int frame, int counter) //this exists so it doesn't loop through the entire walk/idle anim just to find one frame for switching.
{
bool result = newAnim != AnimationType.Jump && currentAnim != AnimationType.Jump;
if (currentAnim == AnimationType.Walk && newAnim == AnimationType.Idle)
{
result = counter <= 0 && (frame == 11 || frame == 15 || frame == 19);
}
else if (currentAnim == AnimationType.Idle && newAnim == AnimationType.Walk)
{
result = counter <= 0 && (frame == 2 || frame == 6);
}
return currentAnim != newAnim && result; //swapping to jumps should be instant, no need to check the counter here
}
private int HandlePSCAnimationFrames(AnimationType newType)
{
int key = profanedCrystalAnimCounter.Key; //0-based indexing
int value = profanedCrystalAnimCounter.Value - 1;
AnimationType currentType = key < 8 ? AnimationType.Idle : key == 8 ? AnimationType.Jump : AnimationType.Walk;
bool isInvalidTransFrame = !IsValidTransitionFrame(currentType, newType, key, value); //to make the transition between walk and idle frames less jarring and smoother
AnimationType type = isInvalidTransFrame ? newType : currentType;
int frameCount = type == AnimationType.Walk || (!profanedCrystalForce && Player.statLife <= (int)(Player.statLifeMax2 * 0.5)) ? 7 : 10;
int lowerRange = type == AnimationType.Idle ? 0 : type == AnimationType.Jump ? 8 : 9;
int upperRange = type == AnimationType.Idle ? 7 : type == AnimationType.Jump ? 8 : 22;
if (value <= 0 || !isInvalidTransFrame)
{
value = frameCount;
if (key >= lowerRange && key < upperRange)
key++;
else
key = lowerRange;
}
profanedCrystalAnimCounter = new KeyValuePair<int, int>(key, value);
return profanedCrystalAnimCounter.Key;
}
public override void PostUpdate() //needs to be here else it doesn't work properly, otherwise i'd have stuck it with the wing anim stuffs
{
bool validEquipSlot = Player.legs == EquipLoader.GetEquipSlot(Mod, "ProfanedSoulCrystal", EquipType.Legs) ||
Player.legs == EquipLoader.GetEquipSlot(Mod, "PscNightLegs", EquipType.Legs);
if (!profanedCrystalHide && (profanedCrystal || profanedCrystalForce) && validEquipSlot)
{
bool usingCarpet = Player.carpetTime > 0 && Player.controlJump; //doesn't make sense for carpet to use jump frame since you have solid ground
AnimationType animType = AnimationType.Walk;
if ((Player.sliding || Player.velocity.Y != 0 || Player.mount.Active || (Player.grappling[0] != -1 || !Player.CheckSolidGround()) || Player.GoingDownWithGrapple) && !usingCarpet)
animType = AnimationType.Jump;
else if (Player.velocity.X == 0 || usingCarpet)
animType = AnimationType.Idle;
int frame = HandlePSCAnimationFrames(animType);
Player.legFrame.Y = Player.legFrame.Height * frame;
}
}
#endregion
#region Misc Stuff
-55
View File
@@ -230,15 +230,6 @@ namespace CalamityMod.CalPlayer
if (calamityPlayer.eutrophication && drawInfo.shadow == 0f)
Eutrophication.DrawEffects(drawInfo);
if (calamityPlayer.glacialState && drawInfo.shadow == 0f)
{
// These lines cannot be moved to Glacial State's own file
r *= 0.13f;
g *= 0.66f;
GlacialState.DrawEffects(drawInfo);
}
if (calamityPlayer.godSlayerInferno && drawInfo.shadow == 0f)
GodSlayerInferno.DrawEffects(drawInfo);
@@ -451,52 +442,6 @@ namespace CalamityMod.CalPlayer
Player drawPlayer = drawInfo.drawPlayer;
Item item = drawPlayer.ActiveItem();
// Vanity accessory effects, allows them to draw while the game is paused
if (drawPlayer.Calamity().ghostBracelet)
{
drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Legs);
drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Body);
drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Head);
}
else if ((drawPlayer.Calamity().snowmanPower || drawPlayer.Calamity().snowmanForce) && !drawPlayer.Calamity().snowmanHide)
{
drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "Popo", EquipType.Legs);
drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "Popo", EquipType.Body);
drawPlayer.head = EquipLoader.GetEquipSlot(Mod, snowmanNoseless ? "PopoNoseless" : "Popo", EquipType.Head);
drawPlayer.face = -1;
}
else if (drawPlayer.Calamity().punchCard)
{
drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "PunchCard", EquipType.Legs);
drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "PunchCard", EquipType.Body);
drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "PunchCard", EquipType.Head);
}
else if ((drawPlayer.Calamity().abyssalDivingSuitPower || drawPlayer.Calamity().abyssalDivingSuitForce) && !drawPlayer.Calamity().abyssalDivingSuitHide)
{
drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "AbyssalDivingSuit", EquipType.Legs);
drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "AbyssalDivingSuit", EquipType.Body);
drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "AbyssalDivingSuit", EquipType.Head);
drawPlayer.face = -1;
}
else if ((drawPlayer.Calamity().aquaticHeartPower || drawPlayer.Calamity().aquaticHeartForce) && !drawPlayer.Calamity().aquaticHeartHide)
{
drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "AquaticHeart", EquipType.Legs);
drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "AquaticHeart", EquipType.Body);
drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "AquaticHeart", EquipType.Head);
drawPlayer.face = -1;
}
// Need to set all of these so that certain vanity pieces like Capricorn Tail don't screw it up
if (drawPlayer.Calamity().ghostBracelet || ((drawPlayer.Calamity().snowmanPower || drawPlayer.Calamity().snowmanForce) && !drawPlayer.Calamity().snowmanHide) ||
drawPlayer.Calamity().punchCard || ((drawPlayer.Calamity().abyssalDivingSuitPower || drawPlayer.Calamity().abyssalDivingSuitForce) && !drawPlayer.Calamity().abyssalDivingSuitHide) ||
((drawPlayer.Calamity().aquaticHeartPower || drawPlayer.Calamity().aquaticHeartForce) && !drawPlayer.Calamity().aquaticHeartHide))
{
drawInfo.legsGlowMask = -1;
drawInfo.legsOffset = Vector2.Zero;
drawInfo.bodyGlowMask = -1;
drawInfo.headGlowMask = -1;
drawInfo.helmetOffset = Vector2.Zero;
}
if (!drawPlayer.frozen &&
(item.IsAir || item.type > ItemID.None) &&
!drawPlayer.dead &&
+1 -1
View File
@@ -370,7 +370,7 @@ namespace CalamityMod.CalPlayer
if (ZoneAbyss || ZoneSulphur)
canSulphurFish = true;
Item item = Player.ActiveItem();
Item item = Player.HeldItem;
if (!canSulphurFish || item.fishingPole <= 0 || item.holdStyle != 1)
fishingLevel = -1;
+83 -152
View File
@@ -17,6 +17,7 @@ using CalamityMod.Items.Armor.Aerospec;
using CalamityMod.Items.Armor.Demonshade;
using CalamityMod.Items.Armor.LunicCorps;
using CalamityMod.Items.Armor.Silva;
using CalamityMod.Items.Armor.Sulphurous;
using CalamityMod.Items.Armor.Wulfrum;
using CalamityMod.Items.Mounts;
using CalamityMod.Items.Placeables.Furniture;
@@ -31,6 +32,7 @@ using CalamityMod.NPCs.Other;
using CalamityMod.NPCs.ProfanedGuardians;
using CalamityMod.NPCs.Providence;
using CalamityMod.NPCs.SupremeCalamitas;
using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Projectiles.Ranged;
@@ -485,7 +487,7 @@ namespace CalamityMod.CalPlayer
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Withered").ToNetworkText(Player.name));
}
}
if (profanedCrystalBuffs && !profanedCrystalHide)
if (profanedCrystalBuffs && Player.Transformation().Type == ModContent.ItemType<ProfanedSoulCrystal>())
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ProfanedSoulCrystal").ToNetworkText(Player.name));
}
@@ -635,11 +637,6 @@ namespace CalamityMod.CalPlayer
modifiers.ScalingBonusDamage += Screwdriver.PiercingDamageBuff;
}
// Calamity buffs Inferno Fork by 20%. This is multiplicative because it's supposed to be a buff to the weapon's base damage.
// However, because the weapon is coded like spaghetti, you have to multiply the explosion's damage too.
if (proj.type == ProjectileID.InfernoFriendlyBlast)
modifiers.SourceDamage *= 1.2f;
if (Player.Calamity().scionsCurio && proj.CountsAsClass<RangedDamageClass>())
target.Calamity().scionsCurioEffected = true;
@@ -885,7 +882,7 @@ namespace CalamityMod.CalPlayer
contactDamageReduction *= (double)Crumbling.MultiplicativeDamageReductionPlayer;
// Contact damage reduction is reduced by DR Damage, which itself is proportional to defense damage
// In GFB, as defense damage is uncapped, DR damage is also uncapped.
// In FTW, as defense damage is uncapped, DR damage is also uncapped.
int currentDefense = Player.GetCurrentDefense(false);
if (totalDefenseDamage > 0 && currentDefense > 0)
{
@@ -987,30 +984,23 @@ namespace CalamityMod.CalPlayer
// Reduce damage from vanilla traps
// Explosives
// 350 in normal, 450 in expert
// 350 damage
if (proj.type == ProjectileID.Explosives)
modifiers.SourceDamage *= (Main.expertMode ? 0.225f : 0.35f);
modifiers.SourceDamage *= 0.7f;
// Rolling Cacti
// 45 in normal, 65 in expert for cactus
// 30 in normal, 36 in expert for spikes
// 42 in normal, 84 in expert for cactus
// 36 in normal, 72 in expert for spikes
else if (proj.type == ProjectileID.RollingCactus || proj.type == ProjectileID.RollingCactusSpike)
modifiers.SourceDamage *= (Main.expertMode ? 0.3f : 0.5f);
modifiers.SourceDamage *= 0.6f;
// Normal Boulders and Temple traps
if (Main.expertMode)
// Boulders
if (Main.expertMode && !areThereAnyDamnBosses)
{
// 140 in normal, 182 in expert, 273 in master
if (proj.type == ProjectileID.Boulder || proj.type == ProjectileID.MiniBoulder)
modifiers.SourceDamage *= 0.65f;
// 80 in normal, 100 in expert, 150 in master
else if (proj.type == ProjectileID.SpikyBallTrap || proj.type == ProjectileID.FlamethrowerTrap || proj.type == ProjectileID.FlamesTrap || proj.type == ProjectileID.PoisonDartTrap)
modifiers.SourceDamage *= 0.625f;
// 120 in normal, 144 in expert, 216 in master
else if (proj.type == ProjectileID.SpearTrap)
modifiers.SourceDamage *= 0.6f;
// 140 in normal, 210 in expert, 315 in master for boulder
// 104 in normal, 156 in expert, 234 in master for mini boulder
if (proj.type == ProjectileID.Boulder || proj.type == ProjectileID.MiniBoulder || proj.type == ProjectileID.BouncyBoulder || proj.type == ProjectileID.LifeCrystalBoulder)
modifiers.SourceDamage *= 0.75f;
}
bool isFallingBlock = (proj.type == ProjectileID.SandBallFalling) || (proj.type == ProjectileID.SiltBall) || (proj.type == ProjectileID.AshBallFalling) ||
@@ -1027,7 +1017,7 @@ namespace CalamityMod.CalPlayer
if (Player.Calamity().trapProtection && isReducedTrap)
modifiers.SourceDamage *= 0.35f;
// Reduce damage dealt by rainbow trails depending on how faded they are.
// Reduce damage dealt by rainbow trails
if (proj.type == ProjectileID.HallowBossLastingRainbow)
{
// Find the oldPos of the projectile that is intersecting the player hitbox.
@@ -1042,11 +1032,10 @@ namespace CalamityMod.CalPlayer
hitbox.X = (int)trailHitbox.X;
hitbox.Y = (int)trailHitbox.Y;
// Adjust damage based on what part of the trail intersected the player hitbox.
if (hitbox.Intersects(Player.Hitbox))
{
if (k > startOfDamageFalloff)
modifiers.SourceDamage *= MathHelper.Lerp(0.4f, 1f, 1f - (k - startOfDamageFalloff) / (float)(trailLength - startOfDamageFalloff));
modifiers.SourceDamage *= EmpressofLightAI.EverlastingRainbowTrailDamageMult;
break;
}
@@ -1312,7 +1301,7 @@ namespace CalamityMod.CalPlayer
if (Main.npc[proj.Calamity().ParentNPCIndex].active)
{
if (sulphurSet)
Main.npc[proj.Calamity().ParentNPCIndex].AddBuff(BuffID.Poisoned, 60);
Main.npc[proj.Calamity().ParentNPCIndex].AddBuff(BuffID.Poisoned, SulphurousHelmet.SetBonusPoisonDuration);
if (ilSpark)
Main.npc[proj.Calamity().ParentNPCIndex].Calamity().shocked = 120;
}
@@ -1375,90 +1364,10 @@ namespace CalamityMod.CalPlayer
{
Player.AddBuff(BuffID.BrokenArmor, 600);
}
else if (proj.type == ProjectileID.DeathLaser || proj.type == ProjectileID.RocketSkeleton || proj.type == ProjectileID.BombSkeletronPrime)
{
Player.AddBuff(BuffID.OnFire, 180);
}
else if (proj.type == ProjectileID.Skull)
{
Player.AddBuff(BuffID.Weak, 180);
}
else if (proj.type == ProjectileID.CursedFlameHostile || proj.type == ProjectileID.EyeFire)
{
// Guaranteed Cursed Inferno for 1 second (vanilla also has a 68.75% chance of Cursed Inferno for 2 to 3 seconds)
Player.AddBuff(BuffID.CursedInferno, 60);
}
else if (proj.type == ProjectileID.DesertDjinnCurse)
{
Player.AddBuff(BuffID.Cursed, 180);
}
else if (proj.type == ProjectileID.Stinger || proj.type == ProjectileID.QueenBeeStinger)
{
// 66.6% chance of Poison for 5 seconds, 2 guaranteed seconds of Poison otherwise (vanilla also has a 33.3% chance of Poison for 10 seconds)
if (Main.rand.Next(3) > 0)
Player.AddBuff(BuffID.Poisoned, 300);
else
Player.AddBuff(BuffID.Poisoned, 120);
}
else if (proj.type == ProjectileID.PoisonSeedPlantera)
{
// 75% chance of Poison for 3 to 5 seconds, guaranteed Poison for 2 seconds (vanilla also has a 50% chance of Poison for 3 to 7 seconds)
if (Main.rand.Next(4) > 0)
Player.AddBuff(BuffID.Poisoned, Main.rand.Next(180, 301));
else
Player.AddBuff(BuffID.Poisoned, 120);
}
else if (proj.type == ProjectileID.ThornBall)
{
Player.AddBuff(BuffID.Poisoned, 420);
}
else if (proj.type == ProjectileID.CultistBossFireBall)
{
Player.AddBuff(ModContent.BuffType<Daybroken>(), 180);
}
else if (proj.type == ProjectileID.CultistBossIceMist)
{
if (!Player.frozen)
Player.AddBuff(BuffID.Frozen, 60);
Player.AddBuff(BuffID.Chilled, 180);
}
else if (proj.type == ProjectileID.CultistBossLightningOrbArc)
{
Player.AddBuff(BuffID.Electrified, 180);
}
else if (proj.type == ProjectileID.AncientDoomProjectile)
{
Player.AddBuff(ModContent.BuffType<Shadowflame>(), 120);
}
else if (proj.type == ProjectileID.CultistBossFireBallClone)
{
Player.AddBuff(ModContent.BuffType<Shadowflame>(), 180);
}
else if (proj.type == ProjectileID.PhantasmalBolt || proj.type == ProjectileID.PhantasmalEye)
{
Player.AddBuff(ModContent.BuffType<Nightwither>(), 120);
}
else if (proj.type == ProjectileID.PhantasmalSphere)
{
Player.AddBuff(ModContent.BuffType<Nightwither>(), 210);
}
else if (proj.type == ProjectileID.PhantasmalDeathray)
{
Player.AddBuff(ModContent.BuffType<Nightwither>(), 300);
}
else if ((proj.type == ProjectileID.FairyQueenLance || proj.type == ProjectileID.HallowBossRainbowStreak || proj.type == ProjectileID.HallowBossSplitShotCore) && NPC.ShouldEmpressBeEnraged())
{
Player.AddBuff(ModContent.BuffType<Daybroken>(), 120);
}
else if (proj.type == ProjectileID.HallowBossLastingRainbow && NPC.ShouldEmpressBeEnraged())
{
Player.AddBuff(ModContent.BuffType<Daybroken>(), 210);
}
else if (proj.type == ProjectileID.FairyQueenSunDance && NPC.ShouldEmpressBeEnraged())
{
Player.AddBuff(ModContent.BuffType<Daybroken>(), 300);
}
else if (proj.type == ProjectileID.BloodNautilusShot)
{
Player.AddBuff(ModContent.BuffType<BurningBlood>(), 240);
@@ -1471,6 +1380,47 @@ namespace CalamityMod.CalPlayer
{
Player.AddBuff(ModContent.BuffType<MiracleBlight>(), 600);
}
if (CalamityWorld.revenge)
{
if (proj.type == ProjectileID.CursedFlameHostile || proj.type == ProjectileID.EyeFire)
{
// Guaranteed Cursed Inferno for 1 second (vanilla also has a 68.75% chance of Cursed Inferno for 2 to 3 seconds)
Player.AddBuff(BuffID.CursedInferno, 60);
}
else if (proj.type == ProjectileID.ThornBall)
{
Player.AddBuff(BuffID.Venom, 120);
}
else if (proj.type == ProjectileID.CultistBossFireBall)
{
Player.AddBuff(ModContent.BuffType<Daybroken>(), 180);
}
else if (proj.type == ProjectileID.CultistBossIceMist && proj.ai[1] == 1f) // Main ice mists only; no shards
{
Player.AddBuff(BuffID.Chilled, 180);
}
else if (proj.type == ProjectileID.CultistBossLightningOrbArc)
{
Player.AddBuff(BuffID.Electrified, 180);
}
else if (proj.type == ProjectileID.CultistBossFireBallClone)
{
Player.AddBuff(ModContent.BuffType<Shadowflame>(), 240);
}
else if (proj.type == ProjectileID.PhantasmalBolt || proj.type == ProjectileID.PhantasmalEye)
{
Player.AddBuff(ModContent.BuffType<Nightwither>(), 120);
}
else if (proj.type == ProjectileID.PhantasmalSphere)
{
Player.AddBuff(ModContent.BuffType<Nightwither>(), 180);
}
else if (proj.type == ProjectileID.PhantasmalDeathray)
{
Player.AddBuff(ModContent.BuffType<Nightwither>(), 240);
}
}
}
// As these reflects do not cancel damage, they need to be in OnHit rather than ModifyHit
@@ -1750,11 +1700,17 @@ namespace CalamityMod.CalPlayer
// Handles energy shields and Boss Rush, in that order
modifiers.ModifyHurtInfo += ModifyHurtInfo_Calamity;
// TODO -- At some point it'd be nice to have a "TransformationPlayer" that has all the transformation sfx and visuals so their priorities can be more easily managed.
#region Custom Hurt Sounds
if (hurtSoundTimer == 0)
{
if (roverDrive && RoverDriveShieldDurability > 0)
if(Player.Transformation().Type != -1 && Player.Transformation().currentTransformation.HurtSound(Player) != null)
{
var hurtSound = Player.Transformation().currentTransformation.HurtSound(Player).Value;
modifiers.DisableSound();
SoundEngine.PlaySound(hurtSound.sound, Player.Center);
hurtSoundTimer = hurtSound.delay;
}
else if (roverDrive && RoverDriveShieldDurability > 0)
{
modifiers.DisableSound();
SoundEngine.PlaySound(RoverDrive.ShieldHurtSound, Player.Center);
@@ -1772,42 +1728,12 @@ namespace CalamityMod.CalPlayer
SoundEngine.PlaySound(TheSponge.ShieldHurtSound, Player.Center);
hurtSoundTimer = 20;
}
else if (((pSoulArtifact && !profanedCrystal) || profanedCrystalBuffs) && pSoulShieldDurability > 0)
{
modifiers.DisableSound();
SoundEngine.PlaySound(ProfanedGuardianDefender.ShieldDeathSound);
hurtSoundTimer = 20;
}
else if ((profanedCrystal || profanedCrystalForce) && !profanedCrystalHide)
{
modifiers.DisableSound();
SoundEngine.PlaySound(Providence.HurtSound, Player.Center);
hurtSoundTimer = 20;
}
else if ((abyssalDivingSuitPower || abyssalDivingSuitForce) && !abyssalDivingSuitHide)
{
modifiers.DisableSound();
SoundEngine.PlaySound(SoundID.NPCHit4, Player.Center); //metal hit noise
hurtSoundTimer = 10;
}
else if ((aquaticHeartPower || aquaticHeartForce) && !aquaticHeartHide)
{
modifiers.DisableSound();
SoundEngine.PlaySound(SoundID.FemaleHit, Player.Center); //female hit noise
hurtSoundTimer = 10;
}
else if (titanHeartSet)
{
modifiers.DisableSound();
SoundEngine.PlaySound(NPCs.Astral.Atlas.HurtSound, Player.Center);
hurtSoundTimer = 10;
}
else if (Player.GetModPlayer<WulfrumTransformationPlayer>().transformationActive)
{
modifiers.DisableSound();
SoundEngine.PlaySound(SoundID.NPCHit4, Player.Center);
hurtSoundTimer = 10;
}
else if (Player.GetModPlayer<WulfrumArmorPlayer>().wulfrumSet && (Player.name.ToLower() == "wagstaff" || Player.name.ToLower() == "john wulfrum"))
{
modifiers.DisableSound();
@@ -2304,8 +2230,8 @@ namespace CalamityMod.CalPlayer
if (RageEnabled)
rageCombatFrames = BalancingConstants.RageCombatDelayTime;
// Regenator has been CANCLED on TWITTER.COM!!!! (Just keeping this here since it's a neat effect and I'll probably yoink it for something else later)
if (regenator && false)
// Regenerator has been CANCLED on TWITTER.COM!!!! (Just keeping this here since it's a neat effect and I'll probably yoink it for something else later)
if (regenerator && false)
{
// Projectile damage and count is based on source damage of the hit
float hitPower = (hurtInfo.SourceDamage / (Player.statLifeMax2 * 0.5f));
@@ -2622,13 +2548,13 @@ namespace CalamityMod.CalPlayer
if (!canTriggerHitEffects)
return;
if (aeroSet && hurtInfo.Damage > 25)
if (aeroSet && hurtInfo.Damage > AerospecBreastplate.SetBonusHurtDamageThreshold)
{
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
var source = Player.GetSource_OnHurt(hurtInfo.DamageSource, AerospecBreastplate.FeatherEntitySourceContext);
for (int n = 0; n < 4; n++)
{
int featherDamage = (int)Player.GetBestClassDamage().ApplyTo(30);
int featherDamage = (int)Player.GetBestClassDamage().ApplyTo(AerospecBreastplate.SetBonusFeatherDamage);
CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 20f, ModContent.ProjectileType<StickyFeatherAero>(), featherDamage, 1f, Player.whoAmI);
}
@@ -2702,15 +2628,20 @@ namespace CalamityMod.CalPlayer
}
if (inkBomb && !abyssalMirror && !eclipseMirror)
{
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<Items.Accessories.InkBomb>()));
if (Player.whoAmI == Main.myPlayer && !Player.HasCooldown(Cooldowns.InkBomb.ID))
if (Player.whoAmI == Main.myPlayer)
{
Player.AddCooldown(Cooldowns.InkBomb.ID, CalamityUtils.SecondsToFrames(20));
rogueStealth += 0.5f;
if (!Player.HasCooldown(Cooldowns.InkBomb.ID))
{
Player.AddCooldown(Cooldowns.InkBomb.ID, CalamityUtils.SecondsToFrames(20));
rogueStealth += 0.5f;
SoundEngine.PlaySound(SoundID.NPCDeath28 with { Volume = 2f }, Player.Center);
}
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<Items.Accessories.InkBomb>()));
SoundEngine.PlaySound(SoundID.Item1, Player.Center);
for (int i = 0; i < 3; i++)
{
SoundEngine.PlaySound(SoundID.Item61, Player.Center);
int ink = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-0f, -4f), ModContent.ProjectileType<InkBombProjectile>(), 0, 0, Player.whoAmI);
int ink = Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.One.RotatedByRandom(MathHelper.TwoPi) * 2f, ModContent.ProjectileType<InkBombProjectile>(), 0, 0, Player.whoAmI);
if (ink.WithinBounds(Main.maxProjectiles))
Main.projectile[ink].DamageType = DamageClass.Generic;
}
@@ -2742,7 +2673,7 @@ namespace CalamityMod.CalPlayer
if (Player.whoAmI == Main.myPlayer)
{
for (int i = 0; i < 16; i++)
for (int i = 0; i < 10; i++)
{
Vector2 circleVel = (MathHelper.TwoPi * i / 16f).ToRotationVector2() * Main.rand.NextFloat(5f, 8f);
int shard = Projectile.NewProjectile(source, Player.Center, circleVel, ProjectileID.CrystalShard, sDamage, 1f, Player.whoAmI);
+45 -91
View File
@@ -106,37 +106,37 @@ namespace CalamityMod.CalPlayer
ApplyDoTDebuff(weakBrimstoneFlames, 7);
ApplyDoTDebuff(burningBlood, 8, purity);
ApplyDoTDebuff(brainRot, 8, purity);
ApplyDoTDebuff(heavybleeding, 16, purity);
ApplyDoTDebuff(laceration, 24, purity);
ApplyDoTDebuff(vaporfied, 8, purity);
int staticDoT = ((Player.controlLeft || Player.controlRight) ? 12 : 3) / (eleResist ? 2 : 1);
ApplyDoTDebuff(staticDischarge, staticDoT, purity);
ApplyDoTDebuff(brimstoneFlames, abaddon ? 10 : 20, purity);
ApplyDoTDebuff(demonicFlames, 33, purity); // Never inflicted on the player
ApplyDoTDebuff(daybroken, reducedDaybrokenDamage ? 15 : 30, purity);
ApplyDoTDebuff(nightwither, reducedNightwitherDamage ? 15 : 30, purity);
ApplyDoTDebuff(holyFlames, 24, purity);
ApplyDoTDebuff(voidfrost, 30, purity);
ApplyDoTDebuff(vHex, 24);
ApplyDoTDebuff(trueVHex, 36);
ApplyDoTDebuff(crushDepth, 15, purity);
ApplyDoTDebuff(astralInfection, 18, infectedJewel || hideOfDeus || purity);
ApplyDoTDebuff(hadopelagicPressure, 30, purity);
ApplyDoTDebuff(plague, alchFlask ? 12 : 24, purity);
ApplyDoTDebuff(searingLava, 30); // Being literally submerged in crags lava should do more than brimstone flames
ApplyDoTDebuff(heavybleeding, 16, purity);
ApplyDoTDebuff(crushDepth, 18, purity);
ApplyDoTDebuff(astralInfection, 24, infectedJewel || hideOfDeus || purity);
ApplyDoTDebuff(shadowflame, 30, purity);
ApplyDoTDebuff(elementalMix, 50, purity); // Never inflicted on the player
ApplyDoTDebuff(banishingFire, 60); // Never inflicted on the player
ApplyDoTDebuff(brimstoneFlames, abaddon ? 15 : 30, purity);
ApplyDoTDebuff(plague, alchFlask ? 15 : 30, purity);
ApplyDoTDebuff(vHex, 30); // Has other effects
ApplyDoTDebuff(cragsLava, 30);
ApplyDoTDebuff(demonicFlames, 33, purity); // Never inflicted on the player
ApplyDoTDebuff(laceration, 36, purity);
ApplyDoTDebuff(daybroken, reducedDaybrokenDamage ? 20 : 40, purity);
ApplyDoTDebuff(nightwither, reducedNightwitherDamage ? 20 : 40, purity);
ApplyDoTDebuff(holyFlames, 40, purity);
ApplyDoTDebuff(voidfrost, 40, purity);
ApplyDoTDebuff(hadopelagicPressure, 40, purity);
// Profaned Soul Crystal turns you into Providence, a God, and you take more damage from God Slayer Inferno
ApplyDoTDebuff(godSlayerInferno, profanedCrystalBuffs ? 45 : 35);
ApplyDoTDebuff(godSlayerInferno, profanedCrystalBuffs ? 50 : 40);
int fluxDoT = ((Player.controlLeft || Player.controlRight) ? 50 : 10) / (eleResist ? 2 : 1);
ApplyDoTDebuff(vermillionFlux, fluxDoT);
int dragonfireDoT = ((Player.name == "JFL" || Player.name == "MrJFL") ? 240 : 40) / (dynamoStemCells ? 2 : 1);
ApplyDoTDebuff(elementalMix, 50, purity); // Never inflicted on the player
ApplyDoTDebuff(trueVHex, 50);
int dragonfireDoT = ((Player.name == "JFL" || Player.name == "MrJFL") ? 200 : 50) / (dynamoStemCells ? 2 : 1);
ApplyDoTDebuff(dragonFire, dragonfireDoT);
int rebukeDoT = ((Player.controlLeft || Player.controlRight) ? 75 : 15) / (eleResist ? 2 : 1);
ApplyDoTDebuff(miracleBlight, 60);
ApplyDoTDebuff(banishingFire, 60); // Never inflicted on the player
int rebukeDoT = ((Player.controlLeft || Player.controlRight) ? 80 : 16) / (eleResist ? 2 : 1);
ApplyDoTDebuff(auricRebuke, rebukeDoT);
ApplyDoTDebuff(miracleBlight, 50);
// Slowly increase the sulphuric water poisoning effect. Once it's high enough, the player takes damage and the meter resets.
bool nearSafeZone = false;
@@ -381,8 +381,8 @@ namespace CalamityMod.CalPlayer
// Permafrost's Concoction increases life regen while afflicted with a fire debuff
if (permafrostsConcoction && Player.buffType.Any(FireDebuffsList.Includes))
{
if (Player.lifeRegenTime < 1800)
Player.lifeRegenTime = 1800;
if (Player.lifeRegenTime < 900)
Player.lifeRegenTime = 900;
Player.lifeRegen += 6;
}
@@ -419,10 +419,10 @@ namespace CalamityMod.CalPlayer
if (Player.miscCounter % healFrameCadence == healFrameCadence - 1)
Player.Heal(1);
if (Player.lifeRegenTime < 1800)
Player.lifeRegenTime = 1800;
if (Player.lifeRegenTime < 900)
Player.lifeRegenTime = 900;
intendedPurityDefense = 20 + (currentDebuffs - 1) * 8;
intendedPurityDefense = 15 + (currentDebuffs - 1) * 5;
if (jewelBonusDefense < intendedPurityDefense)
jewelBonusDefense = intendedPurityDefense;
@@ -461,10 +461,10 @@ namespace CalamityMod.CalPlayer
if (currentDebuffs > 0)
{
Player.lifeRegen += 4;
if (Player.lifeRegenTime < 1800)
Player.lifeRegenTime = 1800;
if (Player.lifeRegenTime < 900)
Player.lifeRegenTime = 900;
intendedJewelDefense = 16 + (currentDebuffs - 1) * 5;
intendedJewelDefense = 12 + (currentDebuffs - 1) * 4;
if (jewelBonusDefense < intendedJewelDefense)
jewelBonusDefense = intendedJewelDefense;
}
@@ -487,8 +487,8 @@ namespace CalamityMod.CalPlayer
if (Player.buffType.Any(DebuffsList.List.Contains))
{
Player.lifeRegen += 3;
if (Player.lifeRegenTime < 1800)
Player.lifeRegenTime = 1800;
if (Player.lifeRegenTime < 900)
Player.lifeRegenTime = 900;
}
}
#endregion
@@ -625,6 +625,9 @@ namespace CalamityMod.CalPlayer
Player.lifeRegen += Main.eclipse ? 2 : 4;
}
if (silvaSet)
Player.lifeRegen += 6;
if (phantomicHeartRegen <= 720 && phantomicHeartRegen >= 600)
{
Player.lifeRegen += PhantomicArtifact.RegenBoost;
@@ -673,8 +676,8 @@ namespace CalamityMod.CalPlayer
{
Player.lifeRegen += 7;
if (Player.lifeRegenTime < 1800)
Player.lifeRegenTime = 1800;
if (Player.lifeRegenTime < 900)
Player.lifeRegenTime = 900;
Player.lifeRegenTime += 4;
}
@@ -693,14 +696,6 @@ namespace CalamityMod.CalPlayer
else
pinkCandleHealFraction = 0D;
if (reaverRegen && reaverRegenCooldown >= 60)
{
reaverRegenCooldown = 0;
if (Player.statLife != Player.statLifeMax2 && !noLifeRegen)
Player.HealPlayer(1, HealTextType.None);
}
if (BloomStoneRegen)
{
float dayTimeCompletion = !Main.dayTime ? 1f : (float)(Main.time / Main.dayLength);
@@ -753,9 +748,9 @@ namespace CalamityMod.CalPlayer
if (turboRegenPower > 0)
{
// After a brief delay determined by your form of standing still regen, min-cap life regen time at 1800 / 3600.
if (Player.lifeRegenTime > regenTimeNeededForTurboRegen && Player.lifeRegenTime < 1800f)
Player.lifeRegenTime = 1800f;
// After a brief delay determined by your form of standing still regen, min-cap life regen time at 900 / 3600.
if (Player.lifeRegenTime > regenTimeNeededForTurboRegen && Player.lifeRegenTime < 900f)
Player.lifeRegenTime = 900f;
Player.lifeRegen += turboRegenPower;
Player.lifeRegenTime += turboRegenPower;
@@ -766,48 +761,7 @@ namespace CalamityMod.CalPlayer
}
#endregion
// Life regen soft cap.
if (Player.statLife < actualMaxLife)
{
// The soft cap doesn't apply if the player is not moving and not using a weapon while having any of the following:
// Shiny Stone, Cosmic Freeze buff from the Cosmic Discharge, Demonshade Armor, Regenator, or The Camper.
int baseLifeRegenBoost = 4;
bool noLifeRegenCap = (Player.shinyStone || cFreeze || shadeRegen || camper || regenator) &&
Player.StandingStill() && Player.itemAnimation == 0;
if (!noLifeRegenCap)
{
// Calculate the % of HP the player has left.
float maxLifeRatio = Player.statLife / (float)actualMaxLife;
// Calculate the ratio of the player's current max life relative to the starting HP of 100.
// This makes the soft cap far less harsh at lower amounts of max life.
// Ranges from 20 (at 100 max life) to 4 (at 500 max life) to 2 (at 1000 max life) to 1 (at greater than 2000 max life).
int lifeRegenSoftCapMax = 20;
int lifeRegenSoftCapMin = (int)Math.Round(100f / actualMaxLife * lifeRegenSoftCapMax);
// The soft cap for life regen which ranges from 20 (at less than 5% HP) to 1 (at greater than or equal to 95% HP).
// This value is capped at a min and max amount.
int lifeRegenSoftCap = (int)MathHelper.Clamp((int)Math.Round((1f - maxLifeRatio) * lifeRegenSoftCapMax), lifeRegenSoftCapMin, lifeRegenSoftCapMax);
// If life regen is greater than the calculated soft cap, reduce it.
if (Player.lifeRegen - baseLifeRegenBoost > lifeRegenSoftCap)
{
// The scalar used to calculate how much the life regen stat should be reduced by.
// Ranges from 1 (at 0% HP) to 2 (at 100% HP).
float lifeRegenScalar = 1f + maxLifeRatio;
// Calculate the amount of life regen the player should get according to the soft cap and their current % HP remaining.
// The higher the player's % HP remaining the less life regen they get and vice versa.
int defLifeRegen = (int)((Player.lifeRegen - baseLifeRegenBoost) / lifeRegenScalar);
// Set the player's life regen to the scaled amount.
Player.lifeRegen = baseLifeRegenBoost + defLifeRegen;
}
}
}
if (regenator) // Gives special regen of it's own, but disables all regular life regen
if (regenerator) // Gives special regen of it's own, but disables all regular life regen
{
if (Player.miscCounter % 7 == 0 && Player.statLife < (int)(Player.statLifeMax2 * 0.5f))
Player.HealPlayer(1, HealTextType.None);
@@ -818,7 +772,7 @@ namespace CalamityMod.CalPlayer
Player.lifeRegenTime += 10;
}
else
regenatorDamage = 0;
regeneratorDamage = 0;
if (toxicHeart) // Since it needs to know your life regen, it must be placed here
{
@@ -873,8 +827,8 @@ namespace CalamityMod.CalPlayer
}
}
// Regenator trades all positive regen for damage, and caps your health gain at 50%
if (regenator)
// 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);
@@ -884,8 +838,8 @@ namespace CalamityMod.CalPlayer
if (Player.palladiumRegen)
finalRegen += 4;
regenatorDamage = (finalRegen * 1.75f) * 0.01f;
Player.GetDamage<GenericDamageClass>() += regenatorDamage;
regeneratorDamage = (finalRegen * 1.75f) * 0.01f;
Player.GetDamage<GenericDamageClass>() += regeneratorDamage;
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
+100 -170
View File
@@ -17,6 +17,7 @@ using CalamityMod.ExtraTextures;
using CalamityMod.Items;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Ammo;
using CalamityMod.Items.Armor.Aerospec;
using CalamityMod.Items.Armor.Bloodflare;
using CalamityMod.Items.Armor.Brimflame;
using CalamityMod.Items.Armor.DesertProwler;
@@ -221,11 +222,6 @@ namespace CalamityMod.CalPlayer
// Apply stealth damage to rogue.
Player.GetDamage<RogueDamageClass>() += stealthDamage;
//Slow the player down after any other speed modifiers might have been applied.
//Todo - Move this back to the wulfrum set class whenever statmodifiers are implemented for stats other than damage
if (WulfrumHat.PowerModeEngaged(Player, out _))
Player.moveSpeed *= 0.8f;
if ((XykVisualsBlue || XykVisualsOrange))
{
bool Orange = XykVisualsOrange;
@@ -254,12 +250,21 @@ namespace CalamityMod.CalPlayer
foreach (Projectile p in Main.ActiveProjectiles)
if (p.type == ModContent.ProjectileType<XykWings>() && p.owner == Player.whoAmI && p.ai[1] == 0)
numOfActiveWings++;
bool spawnWings = numOfActiveWings < maxWingPieces && !Player.dead && Player.wingsLogic > 0 && !(Player.wingTime == Player.wingTimeMax && Player.velocity.Y == 0) && Player.wingTime > 0;
bool spawnWings = numOfActiveWings < maxWingPieces && !Player.dead && Player.wingsLogic > 0 && ((!(Player.wingTime == Player.wingTimeMax && Player.velocity.Y == 0) && Player.wingTime > 0) || XykWingTimer >= 3);
if (spawnWings)
{
int wingCount = numOfActiveWings;
Projectile wings = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType<XykWings>(), 0, 0f, Player.whoAmI, wingCount);
if (XykWingTimer >= 3)
{
int wingCount = numOfActiveWings;
Projectile wings = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType<XykWings>(), 0, 0f, Player.whoAmI, wingCount);
if (numOfActiveWings + 1 == maxWingPieces)
XykWingTimer = 0;
}
else
XykWingTimer++;
}
else
XykWingTimer = 0;
}
// First Frame dash effects
@@ -470,13 +475,17 @@ namespace CalamityMod.CalPlayer
IsFirstDashFrame = false;
else
IsFirstDashFrame = true;
// THIS MUST BE NEAR THE END OF PostUpdateMiscEffects SO ALL OTHER RUN SPEED IS DONE FIRST. DO NOT PUT ANY RUN SPEED AFTER THIS
// Multiplies movement speed by 1.5x so that you don't feel like a snail in the early game.
// This applies to movement speed boosts as well as base speed to ensure they are actually worth their listed value compared to base speed
//
// Disabled while Overhaul is enabled, because Overhaul does very similar things to make movement more snappy
if (ExternalMods.overhaul is null && CalamityServerConfig.Instance.FasterBaseSpeed)
// 22JUN2025: Ozzatron: Disabled while Remnants is enabled, because Remnants has its own move speed reworks.
bool ignoreSpeedConfig = ExternalMods.overhaul is not null || ExternalMods.remnants is not null;
if (!ignoreSpeedConfig && CalamityServerConfig.Instance.FasterBaseSpeed)
Player.moveSpeed *= BalancingConstants.DefaultMoveSpeedBoost;
// This is used to increase horizontal velocity based on the player's movement speed stat.
@@ -497,8 +506,8 @@ namespace CalamityMod.CalPlayer
for (int l = 0; l < Player.MaxBuffs; l++)
{
int hasBuff = Player.buffType[l];
if (Player.buffTime[l] > 360 && hasBuff == BuffID.ShadowDodge)
Player.buffTime[l] = 360;
if (Player.buffTime[l] > 600 && hasBuff == BuffID.ShadowDodge)
Player.buffTime[l] = 600;
}
}
@@ -568,6 +577,22 @@ namespace CalamityMod.CalPlayer
if (heldGaelsLastFrame)
rageDiff += rageMax * GaelsGreatsword.RagePerSecond / 60f;
float rate = Main.GlobalTimeWrappedHourly * 29;
List<Color> eColors = new List<Color>()
{
Color.PaleVioletRed,
Color.Coral,
Color.Khaki,
Color.PaleGreen,
Color.Turquoise,
Color.Violet
};
int colorIndex = (int)(rate / 2 % eColors.Count);
Color currentColor = eColors[colorIndex];
Color nextColor = eColors[(colorIndex + 1) % eColors.Count];
lightRGB = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f);
// Calculate and grant proximity rage.
// Regular enemies can give up to 1x proximity rage. Bosses can give up to 3x. Multiple regular enemies don't stack.
// Proximity rage is maxed out when within 10 blocks (160 pixels) of the enemy's hitbox.
@@ -1099,34 +1124,11 @@ namespace CalamityMod.CalPlayer
}
}
// Life Steal nerf in difficulties above Expert
// Reduces the max possible life steal before the cooldown occurs (this mostly just nerfs how much life steal the player can get in bursts)
// Master Mode nerfs this by an additional 10
float lifeStealCap =
CalamityWorld.death ? BalancingConstants.LifeStealCap_Death :
CalamityWorld.revenge ? BalancingConstants.LifeStealCap_Revengeance :
Main.expertMode ? BalancingConstants.LifeStealCap_Expert :
BalancingConstants.LifeStealCap_Classic;
if (Main.masterMode)
lifeStealCap -= BalancingConstants.LifeStealCapReduction_Master;
if (Player.lifeSteal > lifeStealCap)
Player.lifeSteal = lifeStealCap;
// Normal Mode life steal recovery rate is 0.2/s
// Expert Mode life steal recovery rate is 0.15/s
// Revengeance Mode life steal recovery rate is 0.125/s
// Death Mode life steal recovery rate is 0.1/s
// Master Mode life steal recovery rate is nerfed by an additional 0.05/s
float lifeStealRecoveryRateReduction =
CalamityWorld.death ? BalancingConstants.LifeStealRecoveryRateReduction_Death :
CalamityWorld.revenge ? BalancingConstants.LifeStealRecoveryRateReduction_Revengeance :
Main.expertMode ? BalancingConstants.LifeStealRecoveryRateReduction_Expert :
BalancingConstants.LifeStealRecoveryRateReduction_Classic;
if (Main.masterMode)
lifeStealRecoveryRateReduction += BalancingConstants.LifeStealRecoveryRateReduction_Master;
// Reduce the rate of recovery of the Lifesteal variable
// Classic Mode: 36 HP/s to 12 HP/s
// Expert Mode: 30 HP/s to 9 HP/s
float lifeStealRecoveryRateReduction = Main.expertMode ? BalancingConstants.LifeStealRecoveryRateReduction_Expert : BalancingConstants.LifeStealRecoveryRateReduction_Classic;
float lifeStealCap = Main.expertMode ? BalancingConstants.LifeStealCap_Expert : BalancingConstants.LifeStealCap_Classic;
if (Player.lifeSteal < lifeStealCap)
Player.lifeSteal -= lifeStealRecoveryRateReduction;
@@ -1294,7 +1296,7 @@ namespace CalamityMod.CalPlayer
if (!Player.wet)
{
if (aeroSet)
Player.maxFallSpeed = 15f;
Player.maxFallSpeed = AerospecBreastplate.SetBonusFallSpeed;
if (Player.PortalPhysicsEnabled)
Player.maxFallSpeed = 20f;
}
@@ -1805,7 +1807,7 @@ namespace CalamityMod.CalPlayer
{
if (dOfTheDeepDefenseBuffTimer > 0)
{
int maxDefense = 15;
int maxDefense = 10;
int givenDefense = (int)Utils.Remap(dOfTheDeepDefenseBuffTimer, 0, dOfTheDeepDefenseBuffMax * 0.5f, 0, maxDefense);
Player.statDefense += givenDefense;
dOfTheDeepDefenseBuffTimer--;
@@ -1992,7 +1994,7 @@ namespace CalamityMod.CalPlayer
SyncCooldownRemoval(Main.dedServ, expiredCooldowns);
// Grant the player 5 seconds of immunity to immobilizing debuffs after an immobilizing debuff wears off.
if (Player.stoned || Player.frozen || Player.webbed || glacialState)
if (Player.stoned || Player.frozen || Player.webbed)
{
ImmobilityDebuffImmunityTimer = ImmobilityDebuffImmunityTimerMax;
}
@@ -2002,7 +2004,6 @@ namespace CalamityMod.CalPlayer
Player.buffImmune[BuffID.Stoned] = true;
Player.buffImmune[BuffID.Frozen] = true;
Player.buffImmune[BuffID.Webbed] = true;
Player.buffImmune[ModContent.BuffType<GlacialState>()] = true;
}
if (arsenalCooldown > 0)
@@ -2027,6 +2028,8 @@ namespace CalamityMod.CalPlayer
--fullRageSoundCountdownTimer;
if (plagueTaintedSMGDroneCooldown > 0)
plagueTaintedSMGDroneCooldown--;
if (flareGunOverheat > 0)
flareGunOverheat--;
if (momentumCapacitorTime > 0)
--momentumCapacitorTime;
if (phantomicHeartRegen > 0 && phantomicHeartRegen < 1000)
@@ -2207,10 +2210,6 @@ namespace CalamityMod.CalPlayer
canFireGodSlayerRangedProjectile = true;
canFireBloodflareRangedProjectile = true;
}
if (reaverRegenCooldown < 60 && reaverRegen)
reaverRegenCooldown++;
else
reaverRegenCooldown = 0;
if (auralisAurora > 0)
auralisAurora--;
if (auralisAuroraCooldown > 0)
@@ -2520,7 +2519,7 @@ namespace CalamityMod.CalPlayer
if (Player.isNearFairy())
{
Player.lifeRegen += 4;
Player.statDefense += 10;
Player.statDefense += 6;
Player.moveSpeed += 0.1f;
}
}
@@ -2544,7 +2543,7 @@ namespace CalamityMod.CalPlayer
if (affliction || afflicted)
{
Player.endurance += 0.07f;
Player.statDefense += 13;
Player.statDefense += 9;
Player.GetDamage<GenericDamageClass>() += 0.1f;
}
@@ -2584,7 +2583,7 @@ namespace CalamityMod.CalPlayer
// Permafrost's Concoction bonuses/debuffs
if (permafrostsConcoction)
{
Player.manaCost *= 0.85f;
Player.manaCost -= 0.15f;
Player.statManaMax2 += 50;
}
@@ -2601,7 +2600,6 @@ namespace CalamityMod.CalPlayer
Player.buffImmune[BuffID.Frozen] = true;
Player.buffImmune[BuffID.Chilled] = true;
Player.buffImmune[ModContent.BuffType<GlacialState>()] = true;
}
// Cosmic Discharge Cosmic Freeze buff, gives surrounding enemies the Glacial State debuff
@@ -2714,23 +2712,19 @@ namespace CalamityMod.CalPlayer
// Plagued Fuel Pack and Blunder Booster effects
if (jetPackDash > 0 && Player.whoAmI == Main.myPlayer)
{
int velocityAmt = blunderBooster ? 35 : 25;
int velocityMult = jetPackDash > 1 ? velocityAmt : 5;
Player.velocity = new Vector2(jetPackDirection, -1) * velocityMult;
int velocityMult = (int)((blunderBooster ? 35 : 25) * Utils.GetLerpValue(-4, 5, jetPackDash, true));
Player.velocity = new Vector2(jetPackDirection, -1f) * velocityMult;
if (blunderBooster)
{
int lightningCount = Main.rand.Next(5, 7);
int lightningCount = 4;
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<BlunderBooster>()));
for (int i = 0; i < lightningCount; i++)
{
Vector2 lightningVel = new Vector2(Main.rand.NextFloat(-1, 1), Main.rand.NextFloat(-1, 1));
lightningVel.Normalize();
lightningVel *= Main.rand.NextFloat(1f, 2f);
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(30);
Vector2 lightningVel = Player.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.3f) * Main.rand.NextFloat(7f, 10f);
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(35);
int projectile = Projectile.NewProjectile(source, Player.Center, lightningVel, ModContent.ProjectileType<BlunderBoosterLightning>(), damage, 0, Player.whoAmI, Main.rand.Next(2), 0f);
Main.projectile[projectile].timeLeft = Main.rand.Next(180, 240);
if (projectile.WithinBounds(Main.maxProjectiles))
Main.projectile[projectile].DamageType = DamageClass.Generic;
}
@@ -2745,17 +2739,14 @@ namespace CalamityMod.CalPlayer
}
else if (plaguedFuelPack)
{
int numClouds = Main.rand.Next(8, 10);
int numClouds = 3;
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<PlaguedFuelPack>()));
for (int i = 0; i < numClouds; i++)
{
Vector2 cloudVelocity = new Vector2(Main.rand.NextFloat(-1, 1), Main.rand.NextFloat(-1, 1));
cloudVelocity.Normalize();
cloudVelocity *= Main.rand.NextFloat(0f, 1f);
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(20);
Vector2 cloudVelocity = Player.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.3f) * Main.rand.NextFloat(5f, 7f);
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(30);
int projectile = Projectile.NewProjectile(source, Player.Center, cloudVelocity, ModContent.ProjectileType<PlaguedFuelPackCloud>(), damage, 0, Player.whoAmI, 0, 0);
Main.projectile[projectile].timeLeft = Main.rand.Next(180, 240);
if (projectile.WithinBounds(Main.maxProjectiles))
Main.projectile[projectile].DamageType = DamageClass.Generic;
}
@@ -2935,36 +2926,7 @@ namespace CalamityMod.CalPlayer
}
// Breath lost while at zero breath
double breathLoss = Main.remixWorld ? (point.Y < abyssLevel1 ? 50D * depthRatioFromAbyssLayer1 : 0D) : (point.Y > abyssLevel1 ? 50D * depthRatioFromAbyssLayer1 : 0D);
// Breath Loss Multiplier, depending on gear
// 27AUG2024: Ozzatron: fixed this being subtractive like mining speed. now doesn't stack exponentially
// It is now a multiplier for the time it takes to lose any unit amount of breath
double breathLossTimeMult = 1D +
(Player.gills ? 0.2 : 0D) + // 1.2
(oceanCrest ? 0.2 : 0D) + // 1.2
(victideSet ? 0.2 : 0D) + // 1.2
(Player.accDivingHelm ? 0.25 : 0D) + // 1.25
(Player.arcticDivingGear ? 0.25 : 0D) + // 1.25
(aquaticEmblem ? 0.25 : 0D) + // 1.25
(Player.accMerman ? 0.3 : 0D) + // 1.3
(reaverExplore ? 0.3 : 0D) + // 1.3
((aquaticHeart && NPC.downedBoss3) ? 0.3 : 0D) + // 1.3
(abyssalDivingSuit ? 0.3 : 0D) + // 1.3
externalBreathLossMultBoost;
// Invert the breath loss time multiplier, to get the multiplier for the speed at which breath is actually lost
double breathLossMult = 1D / breathLossTimeMult;
// Limit the multiplier to 5%
if (breathLossMult < 0.05)
breathLossMult = 0.05;
// Reduce breath lost while at zero breath, depending on gear
breathLoss *= breathLossTimeMult;
// Record the final breath loss for the stat meter
abyssBreathLossStat = (float)breathLoss;
double breathLoss = Main.remixWorld ? (point.Y < abyssLevel1 ? 1D : 0D) : (point.Y > abyssLevel1 ? 1D : 0D);
// Defense loss
int defenseLoss = (int)(120D * depthRatio);
@@ -2985,24 +2947,8 @@ namespace CalamityMod.CalPlayer
// Record the final defense reduction for the stat meter
abyssDefenseLossStat = defenseLoss;
// Bleed effect based on abyss layer
if (ZoneAbyssLayer4)
{
Player.bleed = true;
}
else if (ZoneAbyssLayer3)
{
if (!abyssalDivingSuit)
Player.bleed = true;
}
else if (ZoneAbyssLayer2)
{
if (!depthCharm)
Player.bleed = true;
}
// Ticks (frames) until breath is deducted from the breath meter
double tick = 12D * (1D - depthRatio);
double tick = 10D * (1D - depthRatio);
// Prevent 0
if (tick < 1D)
@@ -3010,16 +2956,16 @@ namespace CalamityMod.CalPlayer
// Tick (frame) multiplier, depending on gear
double tickMult = 1D +
(Player.gills ? 4D : 0D) + // 5
(oceanCrest ? 4D : 0D) + // 5
(Player.ignoreWater ? 5D : 0D) + // 10
(Player.accDivingHelm ? 10D : 0D) + // 20
(Player.arcticDivingGear ? 10D : 0D) + // 30
(aquaticEmblem ? 10D : 0D) + // 40
(Player.accMerman ? 15D : 0D) + // 55
(victideSet ? 5D : 0D) + // 60
((aquaticHeart && NPC.downedBoss3) ? 15D : 0D) + // 75
(abyssalDivingSuit ? 15D : 0D) + // 90
(Player.gills ? 2D : 0D) +
(oceanCrest ? 2D : 0D) +
(Player.ignoreWater ? 3D : 0D) +
(Player.accDivingHelm ? 5D : 0D) +
(Player.arcticDivingGear ? 5D : 0D) +
(aquaticEmblem ? 5D : 0D) +
(Player.accMerman ? 8D : 0D) +
(victideSet ? 2D : 0D) +
((aquaticHeart && NPC.downedBoss3) ? 8D : 0D) +
(abyssalDivingSuit ? 8D : 0D) +
externalBreathTickBoost;
// Limit the multiplier to 50
@@ -3033,6 +2979,8 @@ namespace CalamityMod.CalPlayer
abyssBreathLossRateStat = (float)tick;
float resistanceSlowdownFactor = 1f;
if (hPressure)
resistanceSlowdownFactor -= abyssalDivingSuit ? 0.2f : 0.5f;
// Reduce breath over ticks (frames)
abyssBreathCD++;
@@ -3045,16 +2993,13 @@ namespace CalamityMod.CalPlayer
if (Player.breath > 0)
{
Player.breath -= (int)(crushDepth && !depthCharm ? breathLoss + 1D : breathLoss);
if (hadopelagicPressure)
resistanceSlowdownFactor -= (int)(!abyssalDivingSuit ? 1.2f : 0.5f);
}
}
// If breath is greater than 0 and player has gills or is merfolk, balance out the effects by reducing breath
if (Player.breath > 0)
{
if (Player.gills || Player.merman)
if (Player.gills || Player.merman || Player.accMerman)
Player.breath -= 3;
}
@@ -3063,8 +3008,8 @@ namespace CalamityMod.CalPlayer
// Resistance to life loss at zero breath
int lifeLossAtZeroBreathResist = 0 +
(depthCharm ? 3 : 0) +
(abyssalDivingSuit ? 6 : 0);
(depthCharm ? 4 : 0) +
(abyssalDivingSuit ? 5 : 0);
// Reduce life loss, depending on gear
lifeLossAtZeroBreath -= lifeLossAtZeroBreathResist;
@@ -3097,7 +3042,7 @@ namespace CalamityMod.CalPlayer
abyssDeath = false;
// Signus headcrab darkness
if (CalamityWorld.LegendaryMode && CalamityWorld.revenge)
if (CalamityWorld.LegendaryMode)
{
if (CalamityGlobalNPC.signus != -1)
{
@@ -3188,7 +3133,7 @@ namespace CalamityMod.CalPlayer
// Aquatic Emblem bonus
if (aquaticEmblem)
{
if (Player.IsUnderwater() && Player.wet && !Player.lavaWet && !Player.honeyWet &&
if (countsAsAnyWet && !Player.lavaWet && !Player.honeyWet &&
!Player.mount.Active)
{
if (aquaticBoost > 0f)
@@ -3211,7 +3156,7 @@ namespace CalamityMod.CalPlayer
aquaticBoost = aquaticBoostMax;
}
Player.statDefense += (int)((1f - aquaticBoost * 0.0001f) * 50f);
Player.statDefense += (int)((1f - aquaticBoost * 0.0001f) * 20f);
Player.moveSpeed -= (1f - aquaticBoost * 0.0001f) * 0.1f;
}
else
@@ -3343,12 +3288,12 @@ namespace CalamityMod.CalPlayer
if (AdamantiteSet)
Player.statDefense += AdamantiteSetDefenseBoost;
// Warmth makes Chilled, Frozen, and Glacial State tick down 3x as fast
// Warmth makes Chilled and Frozen tick down 3x as fast
if (Player.HasBuff(BuffID.Warmth))
{
for (int b = 0; b < Player.MaxBuffs; b++)
{
if (Player.buffType[b] == BuffID.Chilled || Player.buffType[b] == BuffID.Frozen || Player.buffType[b] == ModContent.BuffType<GlacialState>())
if (Player.buffType[b] == BuffID.Chilled || Player.buffType[b] == BuffID.Frozen)
{
if (Player.buffTime[b] > 3)
{
@@ -3388,11 +3333,6 @@ namespace CalamityMod.CalPlayer
Player.GetDamage<GenericDamageClass>() += Grax.DamageBoost;
}
if (brutalCarnage)
{
Player.GetDamage<MeleeDamageClass>() += BrutalCarnage.MeleeDamageBoost;
}
// Trinket of Chi bonus
if (trinketOfChi)
{
@@ -3410,7 +3350,7 @@ namespace CalamityMod.CalPlayer
Player.GetDamage<GenericDamageClass>() += 0.12f;
Player.GetKnockback<SummonDamageClass>() += 1.2f;
if (Main.eclipse || !Main.dayTime)
Player.statDefense += Main.eclipse ? 10 : 20;
Player.statDefense += Main.eclipse ? 8 : 16;
}
if (AbsorberRegen)
@@ -3457,7 +3397,7 @@ namespace CalamityMod.CalPlayer
if (tortShellPostHit > 0)
{
Player.statDefense -= 8;
Player.statDefense -= 6;
tortShellPostHit--;
}
else
@@ -3575,7 +3515,7 @@ namespace CalamityMod.CalPlayer
if (starBeamRye)
{
Player.GetDamage<MagicDamageClass>() += StarBeamRye.MagicDamageBoost;
Player.manaCost *= (1f - StarBeamRye.ManaCostReduction);
Player.manaCost -= StarBeamRye.ManaCostReduction;
Player.statManaMax2 += StarBeamRye.MaxManaBoost;
}
@@ -3713,23 +3653,11 @@ namespace CalamityMod.CalPlayer
}
if (tarraSet)
{
if (!tarraMelee)
Player.calmed = true;
Player.lifeMagnet = true;
}
if (whisperingDeath && !laudanum && !purity)
Player.GetDamage<GenericDamageClass>() -= 0.2f;
if (astralInfection && !(infectedJewel || hideOfDeus || purity))
Player.GetDamage<GenericDamageClass>() -= 0.1f;
if (plague && !purity)
{
Player.GetDamage<GenericDamageClass>() -= 0.1f;
}
if (armorCrunch && !laudanum && !purity)
{
Player.statDefense -= ArmorCrunch.DefenseReduction;
@@ -3741,14 +3669,6 @@ namespace CalamityMod.CalPlayer
Player.statDefense -= RemsRevenge.WitherDefenseReduction;
}
if (glacialState)
{
Player.velocity.X *= 0.5f;
Player.velocity.Y += 0.05f;
if (Player.velocity.Y > 15f)
Player.velocity.Y = 15f;
}
if (eutrophication && !purity)
Player.velocity = Vector2.Zero;
@@ -3800,20 +3720,30 @@ namespace CalamityMod.CalPlayer
Player.GetDamage<MeleeDamageClass>() += 0.1f;
}
// While making the rogue update verify if we should allow these to stack again - Shade
if (filthyGlove)
{
bonusStealthDamage += nanotech ? 0.05f : 0.08f;
}
if (rottenDogTooth && !nanotech)
{
bonusStealthDamage += 0.08f;
}
if (sandsWindBuff)
{
Player.GetDamage<GenericDamageClass>() += PrimordialEarth.BuffDamageBoost;
Player.statDefense += PrimordialEarth.BuffDefenseBoost;
Player.manaRegenDelayBonus += 1;
Player.manaRegenBonus += 50 + (int)(400 * (float)Math.Pow((1 - ((float)Player.statMana / (float)Player.statManaMax2)), 2));
}
if (aeolianEarthBuff)
{
Player.GetDamage<GenericDamageClass>() += PrimordialAncient.BuffDamageBoost;
Player.endurance += PrimordialAncient.BuffDamageReductionBoost;
Player.manaRegenDelayBonus += 1;
Player.manaRegenBonus += 75 + (int)(600 * (float)Math.Pow((1 - ((float)Player.statMana / (float)Player.statManaMax2)), 2));
}
if (frostFlare)
@@ -3826,7 +3756,7 @@ namespace CalamityMod.CalPlayer
if (Player.statLife > (int)(Player.statLifeMax2 * 0.5))
Player.GetDamage<GenericDamageClass>() += 0.1f;
if (Player.statLife <= (int)(Player.statLifeMax2 * 0.5))
Player.statDefense += 20;
Player.statDefense += 15;
}
if (vexation)
@@ -4047,7 +3977,7 @@ namespace CalamityMod.CalPlayer
if (eArtifact)
{
Player.manaCost *= 0.75f;
Player.manaCost -= 0.25f;
Player.maxMinions++;
}
@@ -4453,7 +4383,7 @@ namespace CalamityMod.CalPlayer
// Also gives acceleration, which is done in PostUpdateRunSpeeds
break;
case BuffID.Ichor:
Player.statDefense += 40; // +25 net defense
Player.statDefense += 20; // +10 net defense
break;
case BuffID.Bleeding:
Player.bleed = false;
@@ -4471,7 +4401,7 @@ namespace CalamityMod.CalPlayer
case BuffID.Weak:
Player.GetDamage<MeleeDamageClass>() += 0.051f; // Cancel melee damage nerf, add 10% all damage
Player.GetDamage<GenericDamageClass>() += 0.1f;
Player.statDefense += 14; // +10 net defense
Player.statDefense += 10; // +6 net defense
Player.moveSpeed += 0.25f; // +15% net move speed
break;
case BuffID.Slow:
@@ -4480,7 +4410,7 @@ namespace CalamityMod.CalPlayer
break;
case BuffID.Confused:
Player.confused = false;
Player.statDefense += 50;
Player.statDefense += 15;
break;
case BuffID.Cursed:
Player.cursed = false;
@@ -4898,7 +4828,7 @@ namespace CalamityMod.CalPlayer
}
if (DesertProwlerHat.ShroudedInSmoke(Player, out _))
Player.statDefense -= (int)(Player.statDefense * 0.75);
Player.statDefense -= (int)(Player.statDefense * DesertProwlerHat.SmokeDefenseMult);
}
#endregion
+83 -245
View File
@@ -8,7 +8,10 @@ using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Cooldowns;
using CalamityMod.Dusts;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Armor.Astral;
using CalamityMod.Items.Armor.Reaver;
using CalamityMod.Items.Armor.SnowRuffian;
using CalamityMod.Items.Armor.Sulphurous;
using CalamityMod.Items.Fishing.AstralCatches;
using CalamityMod.Items.VanillaArmorChanges;
using CalamityMod.NPCs;
@@ -103,7 +106,7 @@ namespace CalamityMod.CalPlayer
break;
case ItemID.FieryGreatsword:
target.AddBuff(BuffID.OnFire3, 180);
target.AddBuff(BuffID.OnFire3, 90);
break;
case ItemID.IceSickle:
@@ -138,7 +141,7 @@ namespace CalamityMod.CalPlayer
ItemLifesteal(target, item, damageDone);
ItemOnHit(item, damageDone, target.Center, hit.Crit, target.IsAnEnemy(false, true), targetIsDummy);
NPCDebuffs(target, item.CountsAsClass<MeleeDamageClass>(), item.CountsAsClass<RangedDamageClass>(), item.CountsAsClass<MagicDamageClass>(), item.CountsAsClass<SummonDamageClass>(), item.CountsAsClass<ThrowingDamageClass>(), item.CountsAsClass<SummonMeleeSpeedDamageClass>());
NPCDebuffs(target, item.CountsAsClass<MeleeDamageClass>(), item.CountsAsClass<RangedDamageClass>(), item.CountsAsClass<MagicDamageClass>(), item.CountsAsClass<SummonDamageClass>(), item.CountsAsClass<ThrowingDamageClass>(), item.CountsAsClass<SummonMeleeSpeedDamageClass>(), hit.Crit);
// Ursa Sergeant slash cooldown is reset on kill
if (ursaSergeant && target.life <= 0 && target.realLife == -1)
@@ -193,13 +196,14 @@ namespace CalamityMod.CalPlayer
// Arc Flash Ring lightning strike (Remember to change the one for projectile hits if applicable when you change this one!)
// This one has a lot less limits than the projectile one, but that's because vanilla broadsword code is limiting (wow so surprising)
if (arcFlashRing && (Main.rand.Next(0, 100) < 6))
bool spawnChance = (Main.rand.Next(0, 100) < 6);
if (arcFlashRing && spawnChance)
{
var source = item.GetSource_FromThis();
int damage = (int)((hit.Damage * 4f) * (hit.Crit ? 0.5f : 1)); // 400% damage (uneffected by crits)
Vector2 position = target.Center + new Vector2(0, -750);
int damage = (int)(((hit.Damage * 4f) * (hit.Crit ? 0.5f : 1)) / (Player.Calamity().adrenalineModeActive ? Player.Calamity().GetAdrenalineDamage() + 1 : 1)); // 400% damage (uneffected by crits and adrenaline)
Projectile.NewProjectile(source, position, new Vector2(0, 10), ProjectileType<FlashBolt>(), damage, 0f, Player.whoAmI, target.whoAmI);
Projectile bolt = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<FlashBolt>(), damage, 0f, Player.whoAmI, target.whoAmI);
bolt.DamageType = hit.DamageType;
}
// Shattered Community tracks all damage dealt with Rage Mode (ignoring dummies).
@@ -383,22 +387,20 @@ namespace CalamityMod.CalPlayer
CalamityGlobalProjectile globalProj = proj.Calamity();
// Arc Flash Ring lightning strike (Remember to change the one for item hits if applicable when you change this one!)
// Minions ignore the chance penalty on penetration
bool spawnChance = (Main.rand.Next(0, 100) < MathHelper.Clamp(6 - proj.numHits, (proj.minion ? 6 : 1), 6));
if (arcFlashRing && spawnChance && proj.type != ProjectileType<FlashBolt>() && globalProj.spawnArcFlash)
bool spawnChance = (Main.rand.Next(0, 100) < 6);
if (arcFlashRing && spawnChance && proj.type != ProjectileType<FlashBolt>())
{
proj.active = true; // Okay so if a projectile manually kills itself on hit, it totally breaks the bolts. to prevent this we set them to active
var source = proj.GetSource_FromThis();
int damage = (int)((hit.Damage * 4f) * (hit.Crit ? 0.5f : 1)); // 400% damage (uneffected by crits)
Vector2 position = target.Center + new Vector2(0, -750);
int damage = (int)(((hit.Damage * 4f) * (hit.Crit ? 0.5f : 1)) / (Player.Calamity().adrenalineModeActive ? Player.Calamity().GetAdrenalineDamage() + 1 : 1)); // 400% damage (uneffected by crits and adrenaline)
Projectile bolt = Projectile.NewProjectileDirect(source, position, new Vector2(0, 10), ProjectileType<FlashBolt>(), damage, 0f, Player.whoAmI, target.whoAmI);
Projectile bolt = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<FlashBolt>(), damage, 0f, Player.whoAmI, target.whoAmI, (globalProj.showArcFlash ? 0 : 1));
bolt.DamageType = hit.DamageType;
globalProj.spawnArcFlash = false;
// This is really only used for long lasting projectiles and contact damage minions
globalProj.arcFlashCooldown = 90;
globalProj.showArcFlash = false;
// This is really only used for piercing and long lasting projectiles so they dont flood the screen with bolts
globalProj.arcFlashCooldown = 30;
}
if (!proj.npcProj && !proj.trap && proj.friendly)
@@ -561,11 +563,7 @@ namespace CalamityMod.CalPlayer
GeneralParticleHandler.SpawnParticle(orb);
}
int heal = (int)Math.Round(hit.Damage * 0.035);
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ProjectileType<AltTransfusionTrail>(), BalancingConstants.LifeStealRange);
Main.player[proj.owner].SpawnLifeStealProjectile(target, proj, ProjectileType<AltTransfusionTrail>(), (int)Math.Round(hit.Damage * 0.035));
}
if ((cgp.betterLifeBullet1 || cgp.betterLifeBullet2) && proj.numHits == 0)
@@ -581,13 +579,9 @@ namespace CalamityMod.CalPlayer
GeneralParticleHandler.SpawnParticle(orb);
}
int heal = (int)Math.Round(hit.Damage * 0.01);
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
return;
for (int i = 0; i <= 2; i++)
{
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ProjectileType<AltTransfusionTrail>(), BalancingConstants.LifeStealRange);
Main.player[proj.owner].SpawnLifeStealProjectile(target, proj, ProjectileType<AltTransfusionTrail>(), (int)Math.Round(hit.Damage * 0.01), 0.75f);
}
}
@@ -595,7 +589,7 @@ namespace CalamityMod.CalPlayer
ProjLifesteal(target, proj, damageDone, hit.Crit);
ProjOnHit(proj, target.Center, hit.Crit, target.IsAnEnemy(false), targetIsDummy);
NPCDebuffs(target, proj.CountsAsClass<MeleeDamageClass>(), proj.CountsAsClass<RangedDamageClass>(), proj.CountsAsClass<MagicDamageClass>(), proj.CountsAsClass<SummonDamageClass>(), proj.CountsAsClass<ThrowingDamageClass>(), proj.CountsAsClass<SummonMeleeSpeedDamageClass>(), true, proj.noEnchantments);
NPCDebuffs(target, proj.CountsAsClass<MeleeDamageClass>(), proj.CountsAsClass<RangedDamageClass>(), proj.CountsAsClass<MagicDamageClass>(), proj.CountsAsClass<SummonDamageClass>(), proj.CountsAsClass<ThrowingDamageClass>(), proj.CountsAsClass<SummonMeleeSpeedDamageClass>(), hit.Crit, true, proj.noEnchantments);
// Shattered Community tracks all damage dealt with Rage Mode (ignoring dummies).
if (targetIsDummy)
@@ -614,9 +608,6 @@ namespace CalamityMod.CalPlayer
if (!item.CountsAsClass<MeleeDamageClass>() && Player.meleeEnchant == 7)
Projectile.NewProjectile(source, position, Player.velocity, ProjectileID.ConfettiMelee, 0, 0f, Player.whoAmI);
if (reaverDefense)
Player.lifeRegenTime += 1;
if (npcCheck)
{
if (item.CountsAsClass<MeleeDamageClass>() && hideOfDeus && hideOfDeusTimer == 0)
@@ -629,7 +620,7 @@ namespace CalamityMod.CalPlayer
}
if (astralStarRain && crit && astralStarRainCooldown <= 0)
{
astralStarRainCooldown = 60;
astralStarRainCooldown = AstralHelm.StarRainCooldown;
for (int n = 0; n < 3; n++)
{
int projectileType = Utils.SelectRandom(Main.rand, new int[]
@@ -640,7 +631,7 @@ namespace CalamityMod.CalPlayer
ProjectileID.StarCannonStar
});
int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(120);
int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(AstralHelm.StarDamage);
Projectile star = CalamityUtils.ProjectileRain(source, position, 400f, 100f, 500f, 800f, 12f, projectileType, astralStarDamage, 5f, Player.whoAmI);
if (star.whoAmI.WithinBounds(Main.maxProjectiles))
@@ -695,14 +686,11 @@ namespace CalamityMod.CalPlayer
if (theBee && lifeAndShieldCondition)
SoundEngine.PlaySound(SoundID.Item110, proj.Center);
if (reaverDefense)
Player.lifeRegenTime += 1;
if (npcCheck)
{
if (astralStarRain && crit && astralStarRainCooldown <= 0)
{
astralStarRainCooldown = 60;
astralStarRainCooldown = AstralHelm.StarRainCooldown;
for (int n = 0; n < 3; n++)
{
int projectileType = Utils.SelectRandom(Main.rand, new int[]
@@ -713,7 +701,7 @@ namespace CalamityMod.CalPlayer
ProjectileID.StarCannonStar
});
int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(120);
int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(AstralHelm.StarDamage);
Projectile star = CalamityUtils.ProjectileRain(source, position, 400f, 100f, 500f, 800f, 25f, projectileType, astralStarDamage, 5f, Player.whoAmI);
if (star.whoAmI.WithinBounds(Main.maxProjectiles))
@@ -825,8 +813,9 @@ namespace CalamityMod.CalPlayer
if (dynamoStemCells && MiniSwarmerCooldown <= 0 && proj.CountsAsClass<RangedDamageClass>())
{
MiniSwarmerCooldown = DynamoStemCells.MiniSwarmerCooldown;
Vector2 velocity = proj.velocity.SafeNormalize(Vector2.UnitY) * 19;
Vector2 directionToMouse = Main.MouseWorld - Player.Center;
directionToMouse.Normalize();
Vector2 velocity = directionToMouse * 19;
int MiniSwamerDamage = (int)Player.GetTotalDamage<RangedDamageClass>().ApplyTo(DynamoStemCells.MiniSwamerDamage);
Projectile.NewProjectile(source, Player.Center, velocity, ProjectileType<MiniatureFolly>(), MiniSwamerDamage, 2f, proj.owner);
}
@@ -1135,9 +1124,9 @@ namespace CalamityMod.CalPlayer
Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType<TitanHeartBoom>(), damage, proj.knockBack, proj.owner, 1f, 0f);
SoundEngine.PlaySound(SoundID.Item14, proj.Center);
for (int dustexplode = 0; dustexplode < 180; dustexplode++)
for (int dustexplode = 0; dustexplode < 120; dustexplode++)
{
Vector2 dustd = Vector2.One.RotatedBy(MathHelper.ToRadians(dustexplode * 2)) * 1.7f;
Vector2 dustd = Vector2.One.RotatedBy(MathHelper.ToRadians(dustexplode * 3)) * 1.7f;
Dust dust = Dust.NewDustPerfect(proj.Center, Main.rand.NextBool() ? DustType<AstralBlue>() : DustType<AstralOrange>(), dustd, Alpha: 100);
dust.noGravity = true;
}
@@ -1147,6 +1136,7 @@ namespace CalamityMod.CalPlayer
if (raiderTalisman && modProj.stealthStrike)
{
raiderCritLifespan = CalamityUtils.SecondsToFrames(RaidersTalisman.RaiderCooldown);
// TO DO: Add nanotech here
Player.AddCooldown(RaiderBoost.ID, raiderCritLifespan, true, vampiricTalisman ? "Bloodfeast" : "default");
if (raiderSoundCooldown <= 0)
{
@@ -1187,7 +1177,7 @@ namespace CalamityMod.CalPlayer
#endregion
#region Debuffs
public void NPCDebuffs(NPC target, bool melee, bool ranged, bool magic, bool summon, bool rogue, bool whip, bool proj = false, bool noFlask = false)
public void NPCDebuffs(NPC target, bool melee, bool ranged, bool magic, bool summon, bool rogue, bool whip, bool crit, bool proj = false, bool noFlask = false)
{
if (melee && !noFlask) // Prevents Deep Sea Dumbell from snagging true melee debuff memes
{
@@ -1293,8 +1283,8 @@ namespace CalamityMod.CalPlayer
if (omegaBlueChestplate)
target.AddBuff(BuffType<HadopelagicPressure>(), 180);
if (sulphurSet)
target.AddBuff(BuffID.Poisoned, 60);
if (ilSpark && Player.IsUnderwater())
target.AddBuff(BuffID.Poisoned, SulphurousHelmet.SetBonusPoisonDuration);
if (ilSpark && Player.Calamity().countsAsAnyWet)
{
int duration = 60;
target.AddBuff(BuffType<StaticDischarge>(), duration);
@@ -1309,7 +1299,11 @@ namespace CalamityMod.CalPlayer
}
if (vexation)
{
target.AddBuff(BuffID.Venom, 120, false);
target.AddBuff(BuffID.Venom, 120, false);
}
if (snowRuffianSet && ranged && crit)
{
target.AddBuff(BuffID.Frostburn, SnowRuffianMask.SetBonusFrostburnDuration, false);
}
}
#endregion
@@ -1318,148 +1312,56 @@ namespace CalamityMod.CalPlayer
public void ProjLifesteal(NPC target, Projectile proj, int damage, bool crit)
{
CalamityGlobalProjectile modProj = proj.Calamity();
if (bloodflareSet && !target.IsAnEnemy(false) && !Player.moonLeech && target.lifeMax > 5)
if (target.IsAnEnemy(false))
{
if ((target.life < target.lifeMax * 0.5) && bloodflareHeartTimer <= 0)
if (bloodflareSet && !Player.moonLeech)
{
bloodflareHeartTimer = 300;
Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.Heart);
}
}
if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill && target.lifeMax > 5)
{
float healPower = 10 * Utils.GetLerpValue(300, 0, gladiatorTimer, true);
target.Calamity().gladiatorOnKill = false;
if (healPower >= 1)
{
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType<GladiatorHealOrb>(), 0, 0, -1, (int)healPower);
gladiatorTimer = 300;
}
}
if (Main.LocalPlayer.lifeSteal > 0f && !Player.moonLeech && target.lifeMax > 5)
{
// Increases the degree to which Spectre Healing set contributes to the lifesteal cap
if (Player.ghostHeal && proj.CountsAsClass<MagicDamageClass>())
{
// This doesn't use Math.Round because it doesn't in vanilla
float cooldownMult = 0.2f;
cooldownMult -= proj.numHits * 0.05f;
if (cooldownMult < 0f)
cooldownMult = 0f;
float cooldown = damage * cooldownMult;
Main.LocalPlayer.lifeSteal -= cooldown;
}
if (vampiricTalisman && proj.CountsAsClass<RogueDamageClass>() && crit)
{
int heal = (int)Math.Round(damage * (Main.zenithWorld ? 0.01 : 0.008));
if (proj.Calamity().stealthStrike)
if ((target.life < target.lifeMax * 0.5) && bloodflareHeartTimer <= 0)
{
heal /= 2; //stealth strikes heal half due to generally dealing far more dmg
if (Main.zenithWorld)
heal *= -2; // IT YEARNS FOR MORE BLOOD
bloodflareHeartTimer = 300;
Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.Heart);
}
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
// Heals more if the ability is active
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile((raiderCritLifespan > 0) ? 1.5f : 1f, heal))
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange, BalancingConstants.LifeStealAccessoryCooldownMultiplier);
}
if (bloodyGlove && proj.CountsAsClass<RogueDamageClass>() && modProj.stealthStrike)
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, 2, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange, BalancingConstants.LifeStealAccessoryCooldownMultiplier);
if (target.IsAnEnemy(false))
if (gladiatorSword && target.life <= 0 && target.Calamity().gladiatorOnKill)
{
if (bloodflareThrowing && proj.CountsAsClass<ThrowingDamageClass>() && crit)
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, 2, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier);
if (bloodflareMelee && proj.IsTrueMelee())
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, 2, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier);
float healPower = 10 * Utils.GetLerpValue(300, 0, gladiatorTimer, true);
target.Calamity().gladiatorOnKill = false;
if (healPower >= 1)
{
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType<GladiatorHealOrb>(), 0, 0, -1, (int)healPower);
gladiatorTimer = 300;
}
}
if (vampiricTalisman && proj.CountsAsClass<RogueDamageClass>() && crit && proj.numHits <1)
{
int heal = (int)Math.Round(damage * 0.008);
if (heal > 2)
heal = 2;
Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, heal, (raiderCritLifespan > 0 && !proj.Calamity().stealthStrike) ? 1.3f : 1.6f);
}
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)
Projectile.NewProjectile(proj.GetSource_OnHit(target), proj.Center, proj.velocity.SafeNormalize(Vector2.Zero) * Math.Min(((proj.velocity.Length() * proj.MaxUpdates) / 4f), 4f) * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType<BloodstoneHealOrb>(), 4, 0f, proj.owner);
if (proj.CountsAsClass<MagicDamageClass>() && Player.ActiveItem().CountsAsClass<MagicDamageClass>())
{
if (manaOverloader)
{
double healMult = 0.1;
healMult -= proj.numHits * healMult * 0.25;
int heal = (int)Math.Round(damage * healMult);
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<ManaPolarizerHealOrb>(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealAccessoryCooldownMultiplier);
double healMult = 0.1D - proj.numHits * 0.025D;
Player.SpawnLifeStealProjectile(target, proj, ProjectileType<ManaPolarizerHealOrb>(), (int)Math.Round(damage * healMult), 1.5f);
}
}
if (silvaSet)
{
double healMult = 0.1;
healMult -= proj.numHits * healMult * 0.5;
int heal = (int)Math.Round(damage * healMult);
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<SilvaOrb>(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier);
}
else if (proj.CountsAsClass<MagicDamageClass>() && Player.ActiveItem().CountsAsClass<MagicDamageClass>())
{
if (tarraMage)
if (ataxiaMage)
{
double healMult = 0.1;
healMult -= proj.numHits * healMult * 0.5;
int heal = (int)Math.Round(damage * healMult);
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<ReaverHealOrb>(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier);
}
else if (ataxiaMage)
{
double healMult = 0.1;
healMult -= proj.numHits * healMult * 0.5;
int heal = (int)Math.Round(damage * healMult);
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<HydrothermicHealOrb>(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier);
}
}
if (reaverDefense)
{
double healMult = 0.1;
healMult -= proj.numHits * healMult * 0.5;
int heal = (int)Math.Round(damage * healMult);
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<ReaverHealOrb>(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealReaverTankCooldownMultiplier);
}
if (proj.CountsAsClass<ThrowingDamageClass>())
{
if (xerocSet && xerocDmg <= 0 && Player.ownedProjectileCounts[ProjectileType<EmpyreanEmber>()] < 3 && Player.ownedProjectileCounts[ProjectileType<EmpyreanBlast>()] < 3)
{
double healMult = 0.1;
healMult -= proj.numHits * healMult * 0.5;
int heal = (int)Math.Round(damage * healMult);
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<EmpyreanHealOrb>(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier);
double healMult = 0.1D - proj.numHits * 0.05D;
Player.SpawnLifeStealProjectile(target, proj, ProjectileType<HydrothermicHealOrb>(), (int)Math.Round(damage * healMult), 1.25f);
}
}
}
@@ -1467,89 +1369,25 @@ namespace CalamityMod.CalPlayer
public void ItemLifesteal(NPC target, Item item, int damage)
{
if (bloodflareSet && target.IsAnEnemy(false) && target.lifeMax > 5)
if (target.IsAnEnemy(false))
{
if ((target.life < target.lifeMax * 0.5) && bloodflareHeartTimer <= 0)
if (bloodflareSet)
{
bloodflareHeartTimer = 300;
Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.Heart);
}
}
if (bloodflareMelee && item.CountsAsClass<MeleeDamageClass>() && target.lifeMax > 5)
{
if (target.IsAnEnemy(false) && Main.LocalPlayer.lifeSteal > 0f && !Player.moonLeech)
{
int heal = 4;
if (!Main.LocalPlayer.moonLeech)
if ((target.life < target.lifeMax * 0.5) && bloodflareHeartTimer <= 0)
{
Main.LocalPlayer.lifeSteal -= heal * BalancingConstants.LifeStealSetBonusCooldownMultiplier;
float lowestHealthCheck = 0f;
int healTarget = Player.whoAmI;
foreach (Player otherPlayer in Main.ActivePlayers)
{
if (!otherPlayer.dead && ((!Player.hostile && !otherPlayer.hostile) || Player.team == otherPlayer.team))
{
float playerDist = Vector2.Distance(target.Center, otherPlayer.Center);
if (playerDist < BalancingConstants.LifeStealRange && (otherPlayer.statLifeMax2 - otherPlayer.statLife) > lowestHealthCheck)
{
lowestHealthCheck = otherPlayer.statLifeMax2 - otherPlayer.statLife;
healTarget = otherPlayer.whoAmI;
}
}
}
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
var source = Player.GetSource_FromThis(ReaverHeadTank.HealOrbEntitySourceContext);
Projectile.NewProjectile(source, target.Center, Vector2.Zero, ProjectileID.VampireHeal, 0, 0f, Player.whoAmI, healTarget, heal);
bloodflareHeartTimer = 300;
Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.Heart);
}
}
}
if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill && target.lifeMax > 5)
{
float healPower = 10 * Utils.GetLerpValue(300, 0, gladiatorTimer, true);
target.Calamity().gladiatorOnKill = false;
if (healPower >= 1)
if (gladiatorSword && target.life <= 0 && target.Calamity().gladiatorOnKill)
{
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType<GladiatorHealOrb>(), 0, 0, -1, (int)healPower);
gladiatorTimer = 300;
}
}
if (reaverDefense)
{
if (Main.LocalPlayer.lifeSteal > 0f && !Player.moonLeech && target.lifeMax > 5)
{
double healMult = 0.1;
int heal = (int)Math.Round(damage * healMult);
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (heal > 0 && !Main.LocalPlayer.moonLeech)
float healPower = 10 * Utils.GetLerpValue(300, 0, gladiatorTimer, true);
target.Calamity().gladiatorOnKill = false;
if (healPower >= 1)
{
Main.LocalPlayer.lifeSteal -= heal * BalancingConstants.LifeStealReaverTankCooldownMultiplier;
float lowestHealthCheck = 0f;
int healTarget = Player.whoAmI;
for (int i = 0; i < Main.maxPlayers; i++)
{
Player otherPlayer = Main.player[i];
if (otherPlayer.active && !otherPlayer.dead && ((!Player.hostile && !otherPlayer.hostile) || Player.team == otherPlayer.team))
{
float playerDist = Vector2.Distance(target.Center, otherPlayer.Center);
if (playerDist < BalancingConstants.LifeStealRange && (otherPlayer.statLifeMax2 - otherPlayer.statLife) > lowestHealthCheck)
{
lowestHealthCheck = otherPlayer.statLifeMax2 - otherPlayer.statLife;
healTarget = otherPlayer.whoAmI;
}
}
}
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
var source = Player.GetSource_FromThis(ReaverHeadTank.HealOrbEntitySourceContext);
Projectile.NewProjectile(source, target.Center, Vector2.Zero, ProjectileType<ReaverHealOrb>(), 0, 0f, Player.whoAmI, healTarget, heal);
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType<GladiatorHealOrb>(), 0, 0, -1, (int)healPower);
gladiatorTimer = 300;
}
}
}
+1 -2
View File
@@ -61,8 +61,7 @@ namespace CalamityMod.CalPlayer.Dashes
// Constantly update the player's velocity direction.
Vector2 dashVel = Main.MouseWorld - player.Center;
dashVel = dashVel.SafeNormalize(Vector2.UnitX) * CalculateDashSpeed(player);
player.velocity = dashVel;
player.velocity = player.velocity.ToRotation().AngleTowards(dashVel.ToRotation(), 0.175f).ToRotationVector2() * CalculateDashSpeed(player);
// Fall way, way, faster than usual.
player.maxFallSpeed = 50f;
+6 -2
View File
@@ -60,10 +60,14 @@ namespace CalamityMod.CalPlayer.DrawLayers
{
for (int j = TopRange; j <= BottomRange; j++)
{
Tile tile = Main.tile[i, j];
if (!tile.HasTile || !TileID.Sets.IsAContainer[tile.TileType] || TileID.Sets.BasicDresser[tile.TileType])
continue;
int PotentialChest = Chest.FindChestByGuessing(i, j);
if (PotentialChest != -1 && !TileID.Sets.BasicDresser[Main.tile[i, j].TileType])
if (PotentialChest != -1)
{
// Adjust position ot the center of the chest
// Adjust position to the center of the chest
Chest chest = Main.chest[PotentialChest];
Vector2 chestCenter = new Vector2(chest.x + 1, chest.y + 1) * 16f;
float distance = Vector2.Distance(chestCenter, drawPlayer.MountedCenter);
@@ -35,6 +35,8 @@ namespace CalamityMod.CalPlayer.DrawLayers
if (itemType < ItemID.Count)
return;
Color color = new Color(250, 250, 250, heldItem.alpha);
// This is ugly and I don't give a fuck.
// If you want it to look better, do it yourself.
Texture2D glowMask = default;
@@ -62,8 +64,6 @@ namespace CalamityMod.CalPlayer.DrawLayers
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Summon/EtherealSubjugatorGlow").Value;
else if (itemType == ModContent.ItemType<Excelsus>())
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Melee/ExcelsusGlow").Value;
else if (itemType == ModContent.ItemType<IridescentExcalibur>())
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Melee/IridescentExcaliburGlow").Value;
else if (itemType == ModContent.ItemType<FatesReveal>())
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Magic/FatesRevealGlow").Value;
else if (itemType == ModContent.ItemType<GreatswordofJudgement>())
@@ -75,7 +75,10 @@ namespace CalamityMod.CalPlayer.DrawLayers
else if (itemType == ModContent.ItemType<NecroplasmicBeacon>())
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/SummonItems/NecroplasmicBeaconGlow").Value;
else if (itemType == ModContent.ItemType<Orderbringer>())
{
color = Color.Lerp(Color.White, drawPlayer.Calamity().lightRGB, 0.75f) with { A = 0 };
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Melee/OrderbringerGlow").Value;
}
else if (itemType == ModContent.ItemType<Photosynthesis>())
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Magic/PhotosynthesisGlow").Value;
else if (itemType == ModContent.ItemType<PlantationStaff>())
@@ -140,7 +143,6 @@ namespace CalamityMod.CalPlayer.DrawLayers
if (drawInfo.shadow != 0f || drawPlayer.frozen || !(inUse || visuallyHeld) || itemType <= 0 || drawPlayer.dead || heldItem.noUseGraphic || (drawPlayer.wet && heldItem.noWet) || (drawPlayer.happyFunTorchTime && drawPlayer.inventory[drawPlayer.selectedItem].createTile == TileID.Torches && drawPlayer.itemAnimation == 0))
return;
Color color = new Color(250, 250, 250, heldItem.alpha);
Vector2 originOffset = Vector2.Zero;
// Use to adjust glow mask draw offset and color.
-1
View File
@@ -21,7 +21,6 @@ namespace CalamityMod
public static readonly Condition PlayerHasRogueArmor = Create("HasRogueArmor", () => Main.LocalPlayer.Calamity().rogueStealthMax > 0f && Main.LocalPlayer.Calamity().wearingRogueArmor);
public static readonly Condition PlayerHasWings = Create("HasWings", () => Main.LocalPlayer.wingTimeMax > 0);
public static readonly Condition PlayerAlcoholPoisoned = Create("AlcoholPoison", () => Main.LocalPlayer.Calamity().alcoholPoisoning);
//
// Calamity Event Flag conditions
+5 -32
View File
@@ -1,6 +1,7 @@
using System.ComponentModel;
using System.Reflection;
using System.Runtime.Serialization;
using CalamityMod.Enums;
using CalamityMod.UI;
using CalamityMod.UI.DraedonsArsenal;
using CalamityMod.UI.Rippers;
@@ -27,36 +28,6 @@ namespace CalamityMod
ParticleLimit = (int)Utils.Clamp(ParticleLimit, MinParticleLimit, MaxParticleLimit);
}
internal static void SaveConfig()
{
// There is no current way to manually save a mod configuration file in tModLoader.
// The method which saves mod config files is private in ConfigManager, so reflection is used to invoke it.
try
{
MethodInfo saveMethodInfo = typeof(ConfigManager).GetMethod("Save", BindingFlags.Static | BindingFlags.NonPublic);
if (saveMethodInfo is not null)
saveMethodInfo.Invoke(null, [Instance]);
else
CalamityMod.Instance.Logger.Error("TML ConfigManager.Save reflection failed. Method signature has changed. Notify Calamity Devs if you see this in your log.");
}
catch
{
CalamityMod.Instance.Logger.Error("An error occurred while manually saving Calamity mod configuration. This may be due to a complex mod conflict. It is safe to ignore this error.");
}
}
#region Multi-Threading Settings
[Header("Multithreading")]
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 2f)]
[DefaultValue(0f)]
[Increment(1f)]
[DrawTicks]
public float SunkenSeaMultiThreading { get; set; }
#endregion
#region Graphics Changes
[Header("Graphics")]
@@ -299,8 +270,10 @@ namespace CalamityMod
public bool FasterFallHotkey { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool CalamityArmorSetBonusDoubleTap { get; set; }
[SliderColor(224, 165, 56, 128)]
[DrawTicks]
[DefaultValue(SetBonusDoubleTapOptions.Auto)]
public SetBonusDoubleTapOptions SetBonusDoubleTap { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(false)]
+2 -2
View File
@@ -34,7 +34,7 @@ namespace CalamityMod
public override void Load()
{
// Initialize the EnemyStats struct as early as it is safe to do so
NPCStats.Load();
NPCStats.LoadDebuffs();
// Initialize Calamity Balance, since it is tightly coupled with the remaining systems
CalamityGlobalItem.LoadTweaks();
@@ -58,7 +58,7 @@ namespace CalamityMod
#region Unload
public override void Unload()
{
NPCStats.Unload();
NPCStats.UnloadDebuffs();
CalamityGlobalItem.UnloadTweaks();
CalamityGlobalProjectile.UnloadTweaks();
+1 -5
View File
@@ -508,11 +508,7 @@ namespace CalamityMod.DataStructures
{
if (Procced)
{
if (!player.moonLeech)
{
player.HealPlayer(OmegaBiomeBlade.SuperPogoAttunement_PassiveLifeSteal);
}
player.DoLifestealDirect(null, OmegaBiomeBlade.SuperPogoAttunement_PassiveLifeSteal);
Procced = false;
}
}
-880
View File
@@ -1,880 +0,0 @@
using System;
using System.Collections.Generic;
using CalamityMod.NPCs.AcidRain;
using CalamityMod.NPCs.AquaticScourge;
using CalamityMod.NPCs.AstrumAureus;
using CalamityMod.NPCs.AstrumDeus;
using CalamityMod.NPCs.BrimstoneElemental;
using CalamityMod.NPCs.Bumblebirb;
using CalamityMod.NPCs.CalClone;
using CalamityMod.NPCs.CeaselessVoid;
using CalamityMod.NPCs.Crabulon;
using CalamityMod.NPCs.Cryogen;
using CalamityMod.NPCs.DesertScourge;
using CalamityMod.NPCs.DevourerofGods;
using CalamityMod.NPCs.ExoMechs.Apollo;
using CalamityMod.NPCs.ExoMechs.Ares;
using CalamityMod.NPCs.ExoMechs.Artemis;
using CalamityMod.NPCs.ExoMechs.Thanatos;
using CalamityMod.NPCs.HiveMind;
using CalamityMod.NPCs.Leviathan;
using CalamityMod.NPCs.NormalNPCs;
using CalamityMod.NPCs.OldDuke;
using CalamityMod.NPCs.Perforator;
using CalamityMod.NPCs.PlaguebringerGoliath;
using CalamityMod.NPCs.Polterghast;
using CalamityMod.NPCs.PrimordialWyrm;
using CalamityMod.NPCs.ProfanedGuardians;
using CalamityMod.NPCs.Providence;
using CalamityMod.NPCs.Ravager;
using CalamityMod.NPCs.Signus;
using CalamityMod.NPCs.SlimeGod;
using CalamityMod.NPCs.StormWeaver;
using CalamityMod.NPCs.SupremeCalamitas;
using CalamityMod.NPCs.Yharon;
using CalamityMod.Projectiles.Boss;
using CalamityMod.Projectiles.Enemy;
using CalamityMod.World;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod
{
// TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks.
public static partial class NPCStats
{
private const double ExpertContactVanillaMultiplier = 2D;
private const double MasterContactVanillaMultiplier = 3D;
private const double NormalProjectileVanillaMultiplier = 2D;
private const double ExpertProjectileVanillaMultiplier = 4D;
private const double MasterProjectileVanillaMultiplier = 6D;
#region Enemy Stats Container Struct
internal partial struct EnemyStats
{
public static SortedDictionary<int, double> ExpertDamageMultiplier;
public static SortedDictionary<int, int[]> ContactDamageValues;
public static SortedDictionary<Tuple<int, int>, int[]> ProjectileDamageValues;
};
#endregion
#region Stat Retrieval Methods
public static void GetNPCDamage(this NPC npc)
{
double damageAdjustment = GetExpertDamageMultiplier(npc) * (Main.masterMode ? MasterContactVanillaMultiplier : ExpertContactVanillaMultiplier);
// Safety check: If for some reason the contact damage array is not initialized yet, set the NPC's damage to 1.
bool exists = EnemyStats.ContactDamageValues.TryGetValue(npc.type, out int[] contactDamage);
if (!exists)
npc.damage = 1;
int normalDamage = contactDamage[0];
int expertDamage = contactDamage[1] == -1 ? -1 : (int)Math.Round(contactDamage[1] / damageAdjustment);
int revengeanceDamage = contactDamage[2] == -1 ? -1 : (int)Math.Round(contactDamage[2] / damageAdjustment);
int deathDamage = contactDamage[3] == -1 ? -1 : (int)Math.Round(contactDamage[3] / damageAdjustment);
int masterDamage = contactDamage[4] == -1 ? -1 : (int)Math.Round(contactDamage[4] / damageAdjustment);
// If the assigned value would be -1, don't actually assign it. This allows for conditionally disabling the system.
int damageToUse = Main.masterMode ? masterDamage : CalamityWorld.death ? deathDamage : CalamityWorld.revenge ? revengeanceDamage : Main.expertMode ? expertDamage : normalDamage;
if (damageToUse != -1)
npc.damage = damageToUse;
}
// Gets the amount of damage a given projectile should do from this NPC.
// Automatically compensates for Terraria's internal spaghetti scaling.
public static int GetProjectileDamage(this NPC npc, int projType)
{
double damageAdjustment = Main.masterMode ? MasterProjectileVanillaMultiplier : Main.expertMode ? ExpertProjectileVanillaMultiplier : NormalProjectileVanillaMultiplier;
// Safety check: If for some reason the projectile damage array is not initialized yet, return 1.
bool exists = EnemyStats.ProjectileDamageValues.TryGetValue(new Tuple<int, int>(npc.type, projType), out int[] projectileDamage);
if (!exists)
return 1;
int normalDamage = (int)Math.Round(projectileDamage[0] / damageAdjustment);
int expertDamage = (int)Math.Round(projectileDamage[1] / damageAdjustment);
int revengeanceDamage = (int)Math.Round(projectileDamage[2] / damageAdjustment);
int deathDamage = (int)Math.Round(projectileDamage[3] / damageAdjustment);
int masterDamage = (int)Math.Round(projectileDamage[4] / damageAdjustment);
int damageToUse = Main.masterMode ? masterDamage : CalamityWorld.death ? deathDamage : CalamityWorld.revenge ? revengeanceDamage : Main.expertMode ? expertDamage : normalDamage;
return damageToUse;
}
// Gets the amount of damage this projectile should do from a given NPC.
// Automatically compensates for Terraria's internal spaghetti scaling.
public static int GetProjectileDamage(this Projectile projectile, int npcType)
{
double damageAdjustment = Main.masterMode ? MasterProjectileVanillaMultiplier : Main.expertMode ? ExpertProjectileVanillaMultiplier : NormalProjectileVanillaMultiplier;
// Safety check: If for some reason the projectile damage array is not initialized yet, return 1.
bool exists = EnemyStats.ProjectileDamageValues.TryGetValue(new Tuple<int, int>(npcType, projectile.type), out int[] projectileDamage);
if (!exists)
return 1;
int normalDamage = (int)Math.Round(projectileDamage[0] / damageAdjustment);
int expertDamage = (int)Math.Round(projectileDamage[1] / damageAdjustment);
int revengeanceDamage = (int)Math.Round(projectileDamage[2] / damageAdjustment);
int deathDamage = (int)Math.Round(projectileDamage[3] / damageAdjustment);
int masterDamage = (int)Math.Round(projectileDamage[4] / damageAdjustment);
int damageToUse = Main.masterMode ? masterDamage : CalamityWorld.death ? deathDamage : CalamityWorld.revenge ? revengeanceDamage : Main.expertMode ? expertDamage : normalDamage;
return damageToUse;
}
// Gets the raw amount of damage a projectile should do from this NPC.
// That is, this doesn't adjust the value to compensate for Terraria's internal spaghetti scaling.
public static int GetProjectileDamageNoScaling(this NPC npc, int projType)
{
bool exists = EnemyStats.ProjectileDamageValues.TryGetValue(new Tuple<int, int>(npc.type, projType), out int[] projectileDamage);
return !exists ? 1 // Base case for safety, in case the array is not initialized yet.
: Main.masterMode ? projectileDamage[4]
: CalamityWorld.death ? projectileDamage[3]
: CalamityWorld.revenge ? projectileDamage[2]
: Main.expertMode ? projectileDamage[1]
: projectileDamage[0];
}
/// <summary>
/// Gets the Expert/Master Mode damage multiplier for the specified boss NPC.
/// Useful for determining the base damage a boss NPC should have prior to being run through the Expert/Master scaling code.
/// </summary>
/// <param name="npc">The NPC you want to get the damage multiplier for</param>
/// <param name="master">Whether Master Mode is enabled or not</param>
/// <returns></returns>
public static double GetExpertDamageMultiplier(this NPC npc, bool? master = null)
{
bool exists = EnemyStats.ExpertDamageMultiplier.TryGetValue(npc.type, out double damageMult);
return exists ? damageMult : 1D;
}
#endregion
#region Load/Unload
internal static void Load()
{
LoadEnemyStats();
LoadDebuffs();
}
internal static void Unload()
{
UnloadEnemyStats();
UnloadDebuffs();
}
// A static function, called exactly once, which initializes the EnemyStats struct at a predictable time.
// This is necessary to ensure this dictionary is populated as early as possible.
internal static void LoadEnemyStats()
{
EnemyStats.ExpertDamageMultiplier = new SortedDictionary<int, double>
{
{ NPCID.KingSlime, 0.8 },
{ ModContent.NPCType<DesertScourgeHead>(), 1.1 },
{ ModContent.NPCType<Crabulon>(), 0.8 },
{ NPCID.EaterofWorldsHead, 1.1 },
{ NPCID.EaterofWorldsBody, 0.8 },
{ NPCID.EaterofWorldsTail, 0.8 },
{ NPCID.BrainofCthulhu, 0.9 },
{ ModContent.NPCType<HiveMind>(), 0.9 },
{ ModContent.NPCType<PerforatorHive>(), 0.9 },
{ NPCID.QueenBee, 0.9 },
{ NPCID.Bee, 0.6 },
{ NPCID.BeeSmall, 0.6 },
{ NPCID.SkeletronHead, 1.1 },
{ NPCID.SkeletronHand, 1.1 },
{ NPCID.WallofFlesh, 1.5 },
{ NPCID.WallofFleshEye, 1.5 },
{ ModContent.NPCType<Cryogen>(), 1.15 },
{ NPCID.Spazmatism, 0.85 },
{ NPCID.Retinazer, 0.85 },
{ ModContent.NPCType<Foveanator>(), 0.85 },
{ ModContent.NPCType<AquaticScourgeHead>(), 1.1 },
{ ModContent.NPCType<AquaticScourgeBody>(), 0.8 },
{ ModContent.NPCType<AquaticScourgeBodyAlt>(), 0.8 },
{ ModContent.NPCType<AquaticScourgeTail>(), 0.8 },
{ NPCID.TheDestroyer, 2 },
{ NPCID.TheDestroyerBody, 0.85 },
{ NPCID.TheDestroyerTail, 0.85 },
{ ModContent.NPCType<BrimstoneElemental>(), 0.8 },
{ NPCID.SkeletronPrime, 0.85 },
{ ModContent.NPCType<SkeletronPrime2>(), 0.85 },
{ NPCID.PrimeCannon, 0.85 },
{ NPCID.PrimeLaser, 0.85 },
{ NPCID.PrimeSaw, 0.85 },
{ NPCID.PrimeVice, 0.85 },
{ ModContent.NPCType<CalamitasClone>(), 0.8 },
{ NPCID.Plantera, 1.15 },
{ NPCID.PlanterasTentacle, 1.15 },
{ ModContent.NPCType<PlanterasFreeTentacle>(), 1.15 },
{ NPCID.HallowBoss, 0.6875 },
{ ModContent.NPCType<Leviathan>(), 1.2 },
{ ModContent.NPCType<Anahita>(), 0.8 },
{ NPCID.DetonatingBubble, 0.75 },
{ ModContent.NPCType<AstrumAureus>(), 1.1 },
{ NPCID.Golem, 0.8 },
{ NPCID.GolemHead, 0.8 },
{ NPCID.GolemFistLeft, 0.8 },
{ NPCID.GolemFistRight, 0.8 },
{ ModContent.NPCType<PlaguebringerGoliath>(), 0.9 },
{ NPCID.DukeFishron, 0.7 },
{ NPCID.Sharkron, 0.75 },
{ NPCID.Sharkron2, 0.75 },
{ ModContent.NPCType<RavagerBody>(), 0.8 },
{ NPCID.CultistDragonHead, 0.75 },
{ NPCID.CultistDragonBody1, 0.75 },
{ NPCID.CultistDragonBody2, 0.75 },
{ NPCID.CultistDragonBody3, 0.75 },
{ NPCID.CultistDragonBody4, 0.75 },
{ NPCID.CultistDragonTail, 0.75 },
{ NPCID.AncientDoom, 0.75 },
{ NPCID.AncientLight, 0.75 },
{ ModContent.NPCType<AstrumDeusBody>(), 0.8 },
{ ModContent.NPCType<AstrumDeusTail>(), 0.8 },
{ ModContent.NPCType<ProfanedGuardianCommander>(), 0.8 },
{ ModContent.NPCType<Bumblefuck>(), 0.8 },
{ ModContent.NPCType<StormWeaverBody>(), 0.8 },
{ ModContent.NPCType<StormWeaverTail>(), 0.8 },
{ ModContent.NPCType<Signus>(), 0.9 },
{ ModContent.NPCType<Polterghast>(), 0.8 },
{ ModContent.NPCType<PolterPhantom>(), 0.8 },
{ ModContent.NPCType<OldDuke>(), 0.9 },
{ ModContent.NPCType<OldDukeToothBall>(), 0.8 },
{ ModContent.NPCType<SulphurousSharkron>(), 0.8 },
{ ModContent.NPCType<DevourerofGodsBody>(), 0.85 },
{ ModContent.NPCType<DevourerofGodsTail>(), 0.85 },
{ ModContent.NPCType<Yharon>(), 0.8 },
{ ModContent.NPCType<SupremeCalamitas>(), 0.8 },
{ ModContent.NPCType<Apollo>(), 0.8 },
{ ModContent.NPCType<Artemis>(), 0.8 },
{ ModContent.NPCType<ThanatosHead>(), 0.8 },
{ ModContent.NPCType<ThanatosBody1>(), 0.8 },
{ ModContent.NPCType<ThanatosBody2>(), 0.8 },
{ ModContent.NPCType<ThanatosTail>(), 0.8 },
{ ModContent.NPCType<PrimordialWyrmHead>(), 0.8 }
};
EnemyStats.ContactDamageValues = new SortedDictionary<int, int[]>
{
{ NPCID.KingSlime, new int[] { 40, 64, 80, 96, 144 } },
{ ModContent.NPCType<KingSlimeJewelEmerald>(), new int[] { 30, 44, 60, 76, 114 } },
{ ModContent.NPCType<DesertScourgeHead>(), new int[] { 45, 66, 88, 110, 165 } },
{ ModContent.NPCType<DesertScourgeBody>(), new int[] { 24, 32, 40, 48, 72 } },
{ ModContent.NPCType<DesertScourgeTail>(), new int[] { 18, 24, 30, 36, 54 } },
{ ModContent.NPCType<DesertNuisanceHead>(), new int[] { 30, 44, 60, 76, 114 } },
{ ModContent.NPCType<DesertNuisanceBody>(), new int[] { 21, 28, 32, 36, 63 } },
{ ModContent.NPCType<DesertNuisanceTail>(), new int[] { 12, 16, 20, 24, 36 } },
{ ModContent.NPCType<DesertNuisanceHeadYoung>(), new int[] { 30, 44, 60, 76, 114 } },
{ ModContent.NPCType<DesertNuisanceBodyYoung>(), new int[] { 21, 28, 32, 36, 63 } },
{ ModContent.NPCType<DesertNuisanceTailYoung>(), new int[] { 12, 16, 20, 24, 36 } },
{ NPCID.EyeofCthulhu, new int[] {
24, // 36 in phase 2
30, // 45 in phase 2
40, // 48 in phase 2, 56 in phase 3
50, // 60 in phase 2, 70 in phase 3
75 } }, // Vanilla: 113 in phase 2; Rev+: 90 in phase 2, 105 in phase 3
{ NPCID.ServantofCthulhu, new int[] { 18, 24, 30, 36, 54 } },
{ ModContent.NPCType<BloodlettingServant>(), new int[] { 20, 26, 34, 42, 63 } }, // In phase 2: 26, 34, 44, 55, 82
{ ModContent.NPCType<Crabulon>(), new int[] { 40, 64, 80, 96, 144 } },
{ ModContent.NPCType<CrabShroom>(), new int[] { 25, 50, 62, 74, 111 } },
{ NPCID.EaterofWorldsHead, new int[] { 38, 55, 77, 99, 165 } },
{ NPCID.EaterofWorldsBody, new int[] { 18, 24, 32, 40, 60 } },
{ NPCID.EaterofWorldsTail, new int[] { 12, 16, 24, 32, 48 } },
{ NPCID.VileSpitEaterOfWorlds, new int[] { -1, 64, 64, 64, 96 } },
{ NPCID.BrainofCthulhu, new int[] { 36, 54, 81, 108, 162 } },
{ NPCID.Creeper, new int[] { 24, 36, 66, 96, 144 } },
{ ModContent.NPCType<HiveMind>(), new int[] { 42, 63, 81, 99, 162 } },
{ ModContent.NPCType<DankCreeper>(), new int[] { 30, 50, 62, 74, 111 } },
{ ModContent.NPCType<PerforatorHive>(), new int[] { 36, 54, 63, 72, 108 } },
{ ModContent.NPCType<PerforatorHeadLarge>(), new int[] { 54, 90, 108, 126, 189 } },
{ ModContent.NPCType<PerforatorBodyLarge>(), new int[] { 28, 48, 56, 64, 96 } },
{ ModContent.NPCType<PerforatorTailLarge>(), new int[] { 22, 36, 42, 48, 72 } },
{ ModContent.NPCType<PerforatorHeadMedium>(), new int[] { 42, 70, 84, 98, 147 } },
{ ModContent.NPCType<PerforatorBodyMedium>(), new int[] { 24, 42, 50, 58, 87 } },
{ ModContent.NPCType<PerforatorTailMedium>(), new int[] { 18, 28, 34, 40, 60 } },
{ ModContent.NPCType<PerforatorHeadSmall>(), new int[] { 36, 60, 72, 84, 126 } },
{ ModContent.NPCType<PerforatorBodySmall>(), new int[] { 20, 36, 42, 48, 72 } },
{ ModContent.NPCType<PerforatorTailSmall>(), new int[] { 14, 20, 26, 32, 48 } },
{ NPCID.QueenBee, new int[] { 36, 54, 81, 108, 162 } },
{ NPCID.Bee, new int[] { 20, 24, 48, 72, 108 } },
{ NPCID.BeeSmall, new int[] { 15, 18, 36, 54, 81 } },
{ NPCID.SkeletronHead, new int[] {
42, // 55 while spinning
77, // 100 while spinning
88, // 114 while spinning
99, // 128 while spinning
165 } }, // 215 while spinning
{ NPCID.SkeletronHand, new int[] { 32, 44, 77, 110, 165 } },
{ NPCID.Deerclops, new int[] { 20, 40, 50, 60, 90 } },
{ ModContent.NPCType<SlimeGodCore>(), new int[] { 48, 80, 96, 112, 168 } },
{ ModContent.NPCType<EbonianPaladin>(), new int[] { 54, 90, 108, 126, 189 } },
{ ModContent.NPCType<SplitEbonianPaladin>(), new int[] { 48, 80, 96, 112, 168 } },
{ ModContent.NPCType<CrimulanPaladin>(), new int[] { 60, 100, 120, 140, 210 } },
{ ModContent.NPCType<SplitCrimulanPaladin>(), new int[] { 54, 90, 108, 126, 189 } },
{ ModContent.NPCType<CorruptSlimeSpawn>(), new int[] { 36, 60, 72, 84, 126 } },
{ ModContent.NPCType<CorruptSlimeSpawn2>(), new int[] { 24, 40, 48, 56, 84 } },
{ ModContent.NPCType<CrimsonSlimeSpawn>(), new int[] { 42, 70, 84, 98, 147 } },
{ ModContent.NPCType<CrimsonSlimeSpawn2>(), new int[] { 30, 50, 60, 70, 105 } },
{ NPCID.WallofFlesh, new int[] { 100, 150, 180, 210, 315 } },
{ NPCID.WallofFleshEye, new int[] { 100, 150, 180, 210, 315 } },
{ NPCID.TheHungry, new int[] {
30, // Ranges from 30 to 75 depending on WoF life
60, // Ranges from 60 to 150 depending on WoF life
60, // Ranges from 60 to 150 depending on WoF life
60, // Ranges from 60 to 150 depending on WoF life
90 } }, // Ranges from 90 to 225 depending on WoF life
{ NPCID.TheHungryII, new int[] { 30, 60, 74, 88, 132 } },
{ NPCID.LeechHead, new int[] { 26, 52, 62, 72, 108 } },
{ NPCID.LeechBody, new int[] { 22, 44, 52, 60, 90 } },
{ NPCID.LeechTail, new int[] { 18, 36, 42, 48, 72 } },
{ NPCID.QueenSlimeBoss, new int[] { 80, 120, 150, 180, 270 } },
{ NPCID.QueenSlimeMinionBlue, new int[] { 60, 80, 100, 120, 180 } },
{ NPCID.QueenSlimeMinionPink, new int[] { 60, 80, 100, 120, 180 } },
{ NPCID.QueenSlimeMinionPurple, new int[] { 70, 100, 120, 140, 210 } },
{ ModContent.NPCType<Cryogen>(), new int[] { 90, 138, 161, 184, 276 } },
{ ModContent.NPCType<CryogenShield>(), new int[] { 80, 120, 138, 156, 240 } },
{ NPCID.Spazmatism, new int[] {
70, // 105 in phase 2
102, // 153 in phase 2
119, // 178 in phase 2
136, // 204 in phase 2
204 } }, // 306 in phase 2
{ NPCID.Retinazer, new int[] {
55, // 83 in phase 2
85, // 127 in phase 2
102, // 153 in phase 2
119, // 178 in phase 2
153 } }, // 229 in phase 2
{ ModContent.NPCType<Foveanator>(), new int[] {
62, // 93 in phase 2
94, // 141 in phase 2
110, // 165 in phase 2
128, // 192 in phase 2
178 } }, // 267 in phase 2
{ ModContent.NPCType<AquaticScourgeHead>(), new int[] { 110, 176, 187, 198, 330 } },
{ ModContent.NPCType<AquaticScourgeBody>(), new int[] { 75, 112, 136, 160, 240 } },
{ ModContent.NPCType<AquaticScourgeBodyAlt>(), new int[] { 70, 104, 112, 120, 192 } },
{ ModContent.NPCType<AquaticScourgeTail>(), new int[] { 65, 96, 104, 112, 168 } },
{ NPCID.TheDestroyer, new int[] { 140, 280, 300, 320, 480 } },
{ NPCID.TheDestroyerBody, new int[] { 70, 102, 136, 170, 255 } },
{ NPCID.TheDestroyerTail, new int[] { 45, 68, 102, 136, 204 } },
{ ModContent.NPCType<BrimstoneElemental>(), new int[] { 75, 112, 136, 160, 240 } },
{ NPCID.SkeletronPrime, new int[] {
50, // 100 while spinning
85, // 170 while spinning
102, // 204 while spinning
119, // 238 while spinning
153 } }, // 306 while spinning
{ ModContent.NPCType<SkeletronPrime2>(), new int[] {
50, // 100 while spinning
85, // 170 while spinning
102, // 204 while spinning
119, // 238 while spinning
153 } }, // 306 while spinning
{ NPCID.PrimeVice, new int[] { 70, 102, 136, 170, 255 } },
{ NPCID.PrimeSaw, new int[] { 70, 102, 136, 170, 255 } },
{ NPCID.PrimeCannon, new int[] { 30, 51, 68, 85, 102 } },
{ NPCID.PrimeLaser, new int[] { 30, 51, 68, 85, 102 } },
{ ModContent.NPCType<CalamitasClone>(), new int[] { 95, 144, 168, 192, 288 } },
{ ModContent.NPCType<Cataclysm>(), new int[] { 80, 120, 138, 156, 240 } },
{ ModContent.NPCType<Catastrophe>(), new int[] { 85, 130, 150, 170, 255 } },
{ NPCID.Plantera, new int[] {
70, // 98 in phase 2
100, // 140 in phase 2
138, // 193 in phase 2
176, // 246 in phase 2
276 } }, // 386 in phase 2
{ NPCID.PlanterasTentacle, new int[] { 90, 138, 161, 184, 276 } },
{ ModContent.NPCType<PlanterasFreeTentacle>(), new int[] { 90, 138, 161, 184, 276 } },
{ NPCID.Spore, new int[] { 90, 140, 160, 180, 270 } },
{ NPCID.HallowBoss, new int[] { 80, // 120 during charge
110, // 165 during charge
143, // 215 during charge
176, // 264 during charge
264 } }, // 396 during charge
{ ModContent.NPCType<Leviathan>(), new int[] { 140, 216, 240, 264, 414 } },
{ ModContent.NPCType<Anahita>(), new int[] {
75, // 113 during charge
112, // 168 during charge
136, // 204 during charge
160, // 240 during charge
240 } }, // 360 during charge
{ ModContent.NPCType<AnahitasIceShield>(), new int[] { 70, 110, 126, 142, 210 } },
{ NPCID.DetonatingBubble, new int[] { 100, 150, 180, 210, 315 } },
{ ModContent.NPCType<AquaticAberration>(), new int[] { 90, 140, 160, 180, 270 } },
{ ModContent.NPCType<AstrumAureus>(), new int[] { 145, 220, 242, 264, 429 } },
{ ModContent.NPCType<AureusSpawn>(), new int[] { 75, 112, 128, 144, 225 } },
{ NPCID.Golem, new int[] { 95, 144, 176, 208, 312 } },
{ NPCID.GolemHead, new int[] { 85, 128, 144, 160, 240 } },
{ NPCID.GolemFistLeft, new int[] { 75, 112, 144, 176, 264 } },
{ NPCID.GolemFistRight, new int[] { 75, 112, 144, 176, 264 } },
{ ModContent.NPCType<PlaguebringerGoliath>(), new int[] { 120, 180, 216, 252, 378 } },
{ ModContent.NPCType<PlagueHomingMissile>(), new int[] { 120, 180, 210, 240, 360 } },
{ ModContent.NPCType<PlagueMine>(), new int[] { 130, 200, 240, 280, 420 } },
{ NPCID.DukeFishron, new int[] {
100, // 120 in phase 2
140, // 202 in phase 2, 185 in phase 3
168, // 242 in phase 2, 222 in phase 3
196, // 282 in phase 2, 259 in phase 3
294 } }, // 423 in phase 2, 388 in phase 3
{ NPCID.Sharkron, new int[] { 100, 150, 180, 210, 315 } },
{ NPCID.Sharkron2, new int[] { 120, 180, 210, 240, 360 } },
{ ModContent.NPCType<RavagerBody>(), new int[] { 130, 192, 224, 256, 384 } },
{ ModContent.NPCType<RavagerClawLeft>(), new int[] { 105, 160, 180, 200, 315 } },
{ ModContent.NPCType<RavagerClawRight>(), new int[] { 105, 160, 180, 200, 315 } },
{ ModContent.NPCType<RockPillar>(), new int[] { 130, 192, 224, 256, 390 } },
{ ModContent.NPCType<FlamePillar>(), new int[] { 105, 160, 192, 224, 336 } },
{ NPCID.CultistDragonHead, new int[] { 120, 180, 210, 240, 360 } },
{ NPCID.CultistDragonBody1, new int[] { 60, 90, 105, 120, 180 } },
{ NPCID.CultistDragonBody2, new int[] { 60, 90, 105, 120, 180 } },
{ NPCID.CultistDragonBody3, new int[] { 60, 90, 105, 120, 180 } },
{ NPCID.CultistDragonBody4, new int[] { 60, 90, 105, 120, 180 } },
{ NPCID.CultistDragonTail, new int[] { 60, 90, 105, 120, 180 } },
{ NPCID.AncientCultistSquidhead, new int[] { 120, 180, 210, 240, 360 } },
{ NPCID.AncientLight, new int[] { 120, 180, 210, 240, 360 } },
{ ModContent.NPCType<AstrumDeusHead>(), new int[] { 160, 240, 268, 296, 480 } },
{ ModContent.NPCType<AstrumDeusBody>(), new int[] { 105, 160, 192, 224, 336 } },
{ ModContent.NPCType<AstrumDeusTail>(), new int[] { 85, 128, 160, 192, 288 } },
{ ModContent.NPCType<ProfanedGuardianCommander>(), new int[] { 150, 224, 256, 288, 444 } },
{ ModContent.NPCType<ProfanedGuardianDefender>(), new int[] { 160, 240, 264, 288, 405 } },
{ ModContent.NPCType<ProfanedGuardianHealer>(), new int[] { 100, 200, 220, 240, 300 } },
{ ModContent.NPCType<ProfanedRocks>(), new int[] { 100, 200, 220, 232, 300 } },
{ ModContent.NPCType<Bumblefuck>(), new int[] { 170, 256, 288, 320, 504 } },
{ ModContent.NPCType<Bumblefuck2>(), new int[] { 145, 220, 242, 264, 435 } },
{ ModContent.NPCType<CeaselessVoid>(), new int[] { 240, 360, 396, 432, 720 } },
{ ModContent.NPCType<DarkEnergy>(), new int[] { 175, 260, 288, 316, 525 } },
{ ModContent.NPCType<StormWeaverHead>(), new int[] { 240, 360, 396, 432, 720 } },
{ ModContent.NPCType<StormWeaverBody>(), new int[] { 125, 192, 224, 256, 372 } },
{ ModContent.NPCType<StormWeaverTail>(), new int[] { 105, 160, 192, 224, 312 } },
{ ModContent.NPCType<Signus>(), new int[] { 210, 315, 351, 387, 621 } },
{ ModContent.NPCType<CosmicLantern>(), new int[] { 175, 260, 288, 316, 525 } },
{ ModContent.NPCType<CosmicMine>(), new int[] { 190, 280, 300, 320, 570 } },
{ ModContent.NPCType<Polterghast>(), new int[] {
160, // 192 in phase 2, 224 in phase 3
240, // 288 in phase 2, 336 in phase 3
264, // 317 in phase 2, 370 in phase 3
288, // 346 in phase 2, 403 in phase 3
480 } }, // 576 in phase 2, 672 in phase 3
{ ModContent.NPCType<PolterPhantom>(), new int[] { 224, 336, 370, 403, 672 } },
{ ModContent.NPCType<OldDuke>(), new int[] {
192, // 211 in phase 2, 230 in phase 3
288, // 317 in phase 2, 346 in phase 3
324, // 356 in phase 2, 389 in phase 3
360, // 396 in phase 2, 432 in phase 3
567 } }, // 624 in phase 2, 680 in phase 3
{ ModContent.NPCType<OldDukeToothBall>(), new int[] { 192, 288, 328, 368, 576 } },
{ ModContent.NPCType<SulphurousSharkron>(), new int[] { 192, 288, 328, 368, 576 } },
{ ModContent.NPCType<DevourerofGodsHead>(), new int[] { 470, 700, 750, 800, 1410 } },
{ ModContent.NPCType<DevourerofGodsBody>(), new int[] { 250, 374, 425, 476, 714 } },
{ ModContent.NPCType<DevourerofGodsTail>(), new int[] { 204, 306, 340, 374, 612 } },
{ ModContent.NPCType<CosmicGuardianHead>(), new int[] { 240, 360, 396, 432, 720 } },
{ ModContent.NPCType<CosmicGuardianBody>(), new int[] { 175, 260, 290, 320, 525 } },
{ ModContent.NPCType<CosmicGuardianTail>(), new int[] { 135, 200, 230, 260, 405 } },
{ ModContent.NPCType<Yharon>(), new int[] { 300, 448, 480, 512, 900 } },
{ ModContent.NPCType<SupremeCalamitas>(), new int[] { 340, 512, 544, 576, 1020 } },
{ ModContent.NPCType<Apollo>(), new int[] { 340, 512, 544, 576, 1020 } },
{ ModContent.NPCType<Artemis>(), new int[] { 320, 480, 512, 544, 960 } },
{ ModContent.NPCType<ThanatosHead>(), new int[] { 375, 560, 592, 624, 1116 } },
{ ModContent.NPCType<ThanatosBody1>(), new int[] { 320, 480, 512, 544, 960 } },
{ ModContent.NPCType<ThanatosBody2>(), new int[] { 320, 480, 512, 544, 960 } },
{ ModContent.NPCType<ThanatosTail>(), new int[] { 270, 400, 424, 448, 804 } },
{ ModContent.NPCType<PrimordialWyrmHead>(), new int[] { 535, 800, 850, 900, 1596 } }
};
EnemyStats.ProjectileDamageValues = new SortedDictionary<Tuple<int, int>, int[]>
{
{ new Tuple<int, int>(ModContent.NPCType<KingSlimeJewelRuby>(), ModContent.ProjectileType<JewelProjectile>()), new int[] { 26, 36, 44, 52, 84 } },
{ new Tuple<int, int>(ModContent.NPCType<DesertScourgeHead>(), ModContent.ProjectileType<DesertScourgeSpit>()), new int[] { 26, 36, 44, 52, 84 } },
{ new Tuple<int, int>(ModContent.NPCType<DesertNuisanceHeadYoung>(), ModContent.ProjectileType<DesertScourgeSpit>()), new int[] { 26, 36, 44, 52, 84 } },
{ new Tuple<int, int>(NPCID.EyeofCthulhu, ProjectileID.BloodNautilusShot), new int[] { 26, 44, 60, 76, 114 } },
{ new Tuple<int, int>(ModContent.NPCType<BloodlettingServant>(), ProjectileID.BloodShot), new int[] { 26, 36, 44, 52, 84 } },
{ new Tuple<int, int>(ModContent.NPCType<Crabulon>(), ModContent.ProjectileType<MushBomb>()), new int[] { 32, 48, 60, 72, 108 } },
{ new Tuple<int, int>(ModContent.NPCType<Crabulon>(), ModContent.ProjectileType<MushBombFall>()), new int[] { 32, 48, 60, 72, 108 } },
{ new Tuple<int, int>(ModContent.NPCType<Crabulon>(), ModContent.ProjectileType<MushBombGround>()), new int[] { 32, 48, 60, 72, 108 } },
{ new Tuple<int, int>(NPCID.EaterofWorldsHead, ProjectileID.CursedFlameHostile), new int[] { 26, 44, 60, 76, 114 } },
{ new Tuple<int, int>(NPCID.EaterofWorldsHead, ModContent.ProjectileType<ShadowflameFireball>()), new int[] { 26, 36, 44, 52, 84 } },
{ new Tuple<int, int>(NPCID.BrainofCthulhu, ProjectileID.BloodNautilusShot), new int[] { 36, 56, 68, 80, 120 } },
{ new Tuple<int, int>(NPCID.BrainofCthulhu, ProjectileID.BloodShot), new int[] { 26, 44, 60, 76, 114 } },
{ new Tuple<int, int>(NPCID.Creeper, ProjectileID.BloodShot), new int[] { 26, 44, 60, 76, 114 } },
{ new Tuple<int, int>(ModContent.NPCType<HiveMind>(), ModContent.ProjectileType<ShadeNimbusHostile>()), new int[] { 36, 56, 68, 80, 120 } },
{ new Tuple<int, int>(ModContent.NPCType<DankCreeper>(), ModContent.ProjectileType<ShadeNimbusHostile>()), new int[] { 36, 56, 68, 80, 120 } },
{ new Tuple<int, int>(ModContent.NPCType<DarkHeart>(), ModContent.ProjectileType<ShaderainHostile>()), new int[] { 36, 56, 68, 80, 120 } },
{ new Tuple<int, int>(ModContent.NPCType<HiveBlob>(), ModContent.ProjectileType<VileClot>()), new int[] { 30, 48, 60, 72, 108 } },
{ new Tuple<int, int>(ModContent.NPCType<HiveBlob2>(), ModContent.ProjectileType<VileClot>()), new int[] { 30, 48, 60, 72, 108 } },
{ new Tuple<int, int>(ModContent.NPCType<PerforatorHive>(), ModContent.ProjectileType<BloodGeyser>()), new int[] { 36, 56, 68, 80, 120 } },
{ new Tuple<int, int>(ModContent.NPCType<PerforatorHive>(), ModContent.ProjectileType<IchorShot>()), new int[] { 36, 56, 68, 80, 120 } },
{ new Tuple<int, int>(ModContent.NPCType<PerforatorHive>(), ModContent.ProjectileType<IchorBlob>()), new int[] { 36, 56, 68, 80, 120 } },
{ new Tuple<int, int>(ModContent.NPCType<PerforatorHeadMedium>(), ModContent.ProjectileType<IchorBlob>()), new int[] { 36, 56, 68, 80, 120 } },
{ new Tuple<int, int>(ModContent.NPCType<PerforatorBodyMedium>(), ModContent.ProjectileType<IchorBlob>()), new int[] { 36, 56, 68, 80, 120 } },
{ new Tuple<int, int>(ModContent.NPCType<PerforatorTailMedium>(), ModContent.ProjectileType<IchorBlob>()), new int[] { 36, 56, 68, 80, 120 } },
{ new Tuple<int, int>(ModContent.NPCType<PerforatorHeadLarge>(), ModContent.ProjectileType<BloodGeyser>()), new int[] { 36, 56, 68, 80, 120 } },
{ new Tuple<int, int>(ModContent.NPCType<PerforatorHeadLarge>(), ModContent.ProjectileType<IchorShot>()), new int[] { 36, 56, 68, 80, 120 } },
{ new Tuple<int, int>(ModContent.NPCType<PerforatorHeadLarge>(), ModContent.ProjectileType<IchorBlob>()), new int[] { 36, 56, 68, 80, 120 } },
{ new Tuple<int, int>(ModContent.NPCType<PerforatorHeadLarge>(), ModContent.ProjectileType<DoGDeath>()), new int[] { 22, 36, 44, 52, 84 } },
{ new Tuple<int, int>(NPCID.QueenBee, ProjectileID.QueenBeeStinger), new int[] { 22, 44, 64, 84, 126 } },
{ new Tuple<int, int>(NPCID.QueenBee, ModContent.ProjectileType<QueenBeenade>()), new int[] { 46, 72, 84, 96, 144 } }, // Beenade Bees: 122 (death mode-exclusive)
{ new Tuple<int, int>(NPCID.SkeletronHead, ProjectileID.Skull), new int[] { 46, 72, 84, 96, 144 } },
{ new Tuple<int, int>(NPCID.SkeletronHead, ProjectileID.Shadowflames), new int[] { 36, 72, 88, 104, 156 } },
{ new Tuple<int, int>(NPCID.SkeletronHand, ProjectileID.Skull), new int[] { 36, 56, 68, 80, 120 } },
{ new Tuple<int, int>(NPCID.Deerclops, ProjectileID.DeerclopsIceSpike), new int[] { 26, 52, 76, 100, 150 } },
{ new Tuple<int, int>(NPCID.Deerclops, ProjectileID.DeerclopsRangedProjectile), new int[] { 36, 72, 88, 104, 156 } },
{ new Tuple<int, int>(NPCID.Deerclops, ProjectileID.InsanityShadowHostile), new int[] { 20, 40, 60, 80, 120 } },
{ new Tuple<int, int>(ModContent.NPCType<SlimeGodCore>(), ModContent.ProjectileType<UnstableEbonianGlob>()), new int[] { 42, 68, 84, 100, 150 } },
{ new Tuple<int, int>(ModContent.NPCType<SlimeGodCore>(), ModContent.ProjectileType<UnstableCrimulanGlob>()), new int[] { 38, 60, 76, 92, 138 } },
{ new Tuple<int, int>(ModContent.NPCType<EbonianPaladin>(), ModContent.ProjectileType<UnstableEbonianGlob>()), new int[] { 42, 68, 84, 100, 150 } },
{ new Tuple<int, int>(ModContent.NPCType<CrimulanPaladin>(), ModContent.ProjectileType<UnstableCrimulanGlob>()), new int[] { 38, 60, 76, 92, 138 } },
{ new Tuple<int, int>(ModContent.NPCType<CrimulanPaladin>(), ModContent.ProjectileType<CrimulanSpike>()), new int[] { 42, 68, 84, 100, 150 } },
{ new Tuple<int, int>(ModContent.NPCType<SplitEbonianPaladin>(), ModContent.ProjectileType<UnstableEbonianGlob>()), new int[] { 38, 60, 76, 92, 138 } },
{ new Tuple<int, int>(ModContent.NPCType<SplitCrimulanPaladin>(), ModContent.ProjectileType<UnstableCrimulanGlob>()), new int[] { 34, 52, 68, 80, 120 } },
{ new Tuple<int, int>(ModContent.NPCType<CorruptSlimeSpawn>(), ModContent.ProjectileType<ShadeNimbusHostile>()), new int[] { 36, 56, 68, 80, 120 } },
{ new Tuple<int, int>(ModContent.NPCType<CrimsonSlimeSpawn2>(), ModContent.ProjectileType<CrimsonSpike>()), new int[] { 24, 48, 60, 72, 108 } },
{ new Tuple<int, int>(NPCID.WallofFleshEye, ProjectileID.EyeLaser), new int[] { 36, 72, 88, 104, 156 } },
{ new Tuple<int, int>(NPCID.WallofFlesh, ProjectileID.DemonSickle), new int[] { 52, 92, 112, 132, 198 } },
{ new Tuple<int, int>(NPCID.WallofFlesh, ProjectileID.Fireball), new int[] { 36, 72, 88, 104, 156 } },
{ new Tuple<int, int>(NPCID.QueenSlimeBoss, ProjectileID.QueenSlimeGelAttack), new int[] { 60, 120, 136, 152, 228 } },
{ new Tuple<int, int>(NPCID.QueenSlimeBoss, ProjectileID.QueenSlimeSmash), new int[] { 80, 160, 188, 216, 324 } },
{ new Tuple<int, int>(NPCID.QueenSlimeBoss, ProjectileID.QueenSlimeMinionBlueSpike), new int[] { 52, 92, 112, 132, 198 } },
{ new Tuple<int, int>(NPCID.QueenSlimeMinionBlue, ProjectileID.QueenSlimeMinionBlueSpike), new int[] { 52, 92, 112, 132, 198 } },
{ new Tuple<int, int>(NPCID.QueenSlimeMinionPink, ProjectileID.QueenSlimeMinionPinkBall), new int[] { 52, 92, 112, 132, 198 } },
{ new Tuple<int, int>(ModContent.NPCType<Cryogen>(), ModContent.ProjectileType<IceBlast>()), new int[] { 52, 92, 112, 132, 198 } },
{ new Tuple<int, int>(ModContent.NPCType<Cryogen>(), ModContent.ProjectileType<IceBomb>()), new int[] { 70, 120, 136, 152, 228 } },
{ new Tuple<int, int>(ModContent.NPCType<Cryogen>(), ModContent.ProjectileType<IceRain>()), new int[] { 60, 100, 120, 140, 210 } },
{ new Tuple<int, int>(ModContent.NPCType<CryogenShield>(), ModContent.ProjectileType<IceBlast>()), new int[] { 52, 92, 112, 132, 198 } },
{ new Tuple<int, int>(NPCID.Retinazer, ProjectileID.EyeLaser), new int[] { 40, 92, 116, 140, 210 } },
{ new Tuple<int, int>(NPCID.Retinazer, ProjectileID.DeathLaser), new int[] {
50, // 38 in rapid fire
108, // 81 in rapid fire
132, // 99 in rapid fire
156, // 117 in rapid fire
234 } }, // 176 in rapid fire
{ new Tuple<int, int>(NPCID.Retinazer, ModContent.ProjectileType<HomingLaserDart>()), new int[] { 70, 120, 136, 152, 228 } },
{ new Tuple<int, int>(NPCID.Spazmatism, ProjectileID.CursedFlameHostile), new int[] { 50, 100, 120, 140, 210 } },
{ new Tuple<int, int>(NPCID.Spazmatism, ModContent.ProjectileType<CursedFire>()), new int[] { 60, 120, 148, 176, 264 } },
{ new Tuple<int, int>(NPCID.Spazmatism, ModContent.ProjectileType<Shadowflamethrower>()), new int[] { 70, 120, 148, 176, 264 } },
{ new Tuple<int, int>(NPCID.Spazmatism, ModContent.ProjectileType<ShadowflameFireball>()), new int[] { 60, 100, 128, 156, 234 } },
{ new Tuple<int, int>(ModContent.NPCType<Foveanator>(), ModContent.ProjectileType<FoveanatorLaser>()), new int[] { 50, 108, 132, 156, 234 } },
{ new Tuple<int, int>(ModContent.NPCType<Foveanator>(), ModContent.ProjectileType<FoveanatorEnergyBomb>()), new int[] { 70, 120, 148, 176, 264 } },
{ new Tuple<int, int>(ModContent.NPCType<Foveanator>(), ModContent.ProjectileType<FoveanatorFlamethrower>()), new int[] { 70, 120, 148, 176, 264 } },
{ new Tuple<int, int>(ModContent.NPCType<AquaticScourgeHead>(), ModContent.ProjectileType<SulphuricAcidMist>()), new int[] { 60, 100, 120, 140, 210 } },
{ new Tuple<int, int>(ModContent.NPCType<AquaticScourgeHead>(), ModContent.ProjectileType<SandPoisonCloud>()), new int[] { 70, 120, 136, 152, 228 } },
{ new Tuple<int, int>(ModContent.NPCType<AquaticScourgeHead>(), ModContent.ProjectileType<ToxicCloud>()), new int[] { 80, 140, 160, 180, 270 } },
{ new Tuple<int, int>(ModContent.NPCType<AquaticScourgeBody>(), ModContent.ProjectileType<SandTooth>()), new int[] { 66, 112, 128, 144, 216 } },
{ new Tuple<int, int>(NPCID.TheDestroyer, ProjectileID.DeathLaser), new int[] { 44, 96, 116, 136, 204 } },
{ new Tuple<int, int>(NPCID.TheDestroyer, ModContent.ProjectileType<DestroyerCursedLaser>()), new int[] { 46, 108, 128, 148, 222 } },
{ new Tuple<int, int>(NPCID.TheDestroyer, ModContent.ProjectileType<DestroyerElectricLaser>()), new int[] { 48, 116, 136, 156, 234 } },
{ new Tuple<int, int>(NPCID.TheDestroyerBody, ProjectileID.DeathLaser), new int[] { 44, 96, 116, 136, 204 } },
{ new Tuple<int, int>(NPCID.TheDestroyerBody, ModContent.ProjectileType<DestroyerCursedLaser>()), new int[] { 46, 108, 128, 148, 222 } },
{ new Tuple<int, int>(NPCID.TheDestroyerBody, ModContent.ProjectileType<DestroyerElectricLaser>()), new int[] { 48, 116, 136, 156, 234 } },
{ new Tuple<int, int>(NPCID.Probe, ProjectileID.PinkLaser), new int[] { 50, 88, 100, 112, 168 } },
{ new Tuple<int, int>(ModContent.NPCType<BrimstoneElemental>(), ModContent.ProjectileType<BrimstoneHellfireball>()), new int[] { 80, 140, 160, 180, 270 } },
{ new Tuple<int, int>(ModContent.NPCType<BrimstoneElemental>(), ModContent.ProjectileType<BrimstoneBarrage>()), new int[] { 70, 112, 128, 144, 216 } },
{ new Tuple<int, int>(ModContent.NPCType<BrimstoneElemental>(), ModContent.ProjectileType<BrimstoneHellblast>()), new int[] { 80, 140, 160, 180, 270 } },
{ new Tuple<int, int>(ModContent.NPCType<BrimstoneElemental>(), ModContent.ProjectileType<BrimstoneRay>()), new int[] { 120, 200, 240, 280, 420 } }, // Split shots: 72, 120, 144, 168, 252
{ new Tuple<int, int>(ModContent.NPCType<Brimling>(), ModContent.ProjectileType<BrimstoneHellfireball>()), new int[] { 80, 140, 160, 180, 270 } },
{ new Tuple<int, int>(ModContent.NPCType<Brimling>(), ModContent.ProjectileType<BrimstoneBarrage>()), new int[] { 70, 112, 128, 144, 216 } },
{ new Tuple<int, int>(NPCID.SkeletronPrime, ProjectileID.Skull), new int[] { 50, 108, 124, 140, 210 } },
{ new Tuple<int, int>(NPCID.SkeletronPrime, ProjectileID.DeathLaser), new int[] { 50, 108, 124, 140, 210 } },
{ new Tuple<int, int>(NPCID.SkeletronPrime, ProjectileID.RocketSkeleton), new int[] { 60, 120, 148, 176, 264 } },
{ new Tuple<int, int>(ModContent.NPCType<SkeletronPrime2>(), ProjectileID.Skull), new int[] { 50, 108, 124, 140, 210 } },
{ new Tuple<int, int>(ModContent.NPCType<SkeletronPrime2>(), ProjectileID.BombSkeletronPrime), new int[] { 80, 160, 180, 200, 300 } },
{ new Tuple<int, int>(ModContent.NPCType<SkeletronPrime2>(), ProjectileID.FrostBeam), new int[] { 50, 108, 124, 140, 210 } },
{ new Tuple<int, int>(NPCID.PrimeCannon, ProjectileID.RocketSkeleton), new int[] { 60, 120, 148, 176, 264 } },
{ new Tuple<int, int>(NPCID.PrimeCannon, ProjectileID.BombSkeletronPrime), new int[] { 80, 160, 0, 0, 300 } },
{ new Tuple<int, int>(NPCID.PrimeLaser, ProjectileID.DeathLaser), new int[] { 50, 108, 124, 140, 210 } },
{ new Tuple<int, int>(ModContent.NPCType<CalamitasClone>(), ModContent.ProjectileType<BrimstoneHellblast>()), new int[] { 80, 140, 160, 180, 270 } },
{ new Tuple<int, int>(ModContent.NPCType<CalamitasClone>(), ModContent.ProjectileType<BrimstoneHellfireball>()), new int[] { 80, 140, 160, 180, 270 } },
{ new Tuple<int, int>(ModContent.NPCType<CalamitasClone>(), ModContent.ProjectileType<BrimstoneHellblast2>()), new int[] { 80, 140, 160, 180, 270 } },
{ new Tuple<int, int>(ModContent.NPCType<CalamitasClone>(), ModContent.ProjectileType<SCalBrimstoneFireblast>()), new int[] { 80, 140, 160, 180, 270 } },
{ new Tuple<int, int>(ModContent.NPCType<CalamitasClone>(), ModContent.ProjectileType<BrimstoneBarrage>()), new int[] { 70, 112, 128, 144, 216 } },
{ new Tuple<int, int>(ModContent.NPCType<Cataclysm>(), ModContent.ProjectileType<BrimstoneFire>()), new int[] { 80, 140, 160, 180, 270 } },
{ new Tuple<int, int>(ModContent.NPCType<Catastrophe>(), ModContent.ProjectileType<BrimstoneBall>()), new int[] { 70, 112, 128, 144, 216 } },
{ new Tuple<int, int>(ModContent.NPCType<SoulSeeker>(), ModContent.ProjectileType<BrimstoneBarrage>()), new int[] { 70, 112, 128, 144, 216 } },
{ new Tuple<int, int>(NPCID.Plantera, ProjectileID.SeedPlantera), new int[] { 52, 96, 128, 160, 240 } },
{ new Tuple<int, int>(NPCID.Plantera, ProjectileID.PoisonSeedPlantera), new int[] { 62, 116, 144, 172, 258 } },
{ new Tuple<int, int>(NPCID.Plantera, ProjectileID.ThornBall), new int[] { 72, 132, 160, 188, 282 } },
{ new Tuple<int, int>(NPCID.Plantera, ModContent.ProjectileType<SporeGasPlantera>()), new int[] { 80, 140, 160, 180, 270 } },
{ new Tuple<int, int>(NPCID.Plantera, ModContent.ProjectileType<HomingGasBulb>()), new int[] { 80, 140, 160, 180, 270 } },
{ new Tuple<int, int>(NPCID.HallowBoss, ProjectileID.HallowBossRainbowStreak), new int[] { 100, 152, 172, 192, 300 } },
{ new Tuple<int, int>(NPCID.HallowBoss, ProjectileID.FairyQueenSunDance), new int[] { 120, 180, 204, 228, 360 } },
{ new Tuple<int, int>(NPCID.HallowBoss, ProjectileID.HallowBossLastingRainbow), new int[] { 100, 152, 172, 192, 300 } },
{ new Tuple<int, int>(NPCID.HallowBoss, ProjectileID.FairyQueenLance), new int[] { 130, 196, 216, 236, 390 } },
{ new Tuple<int, int>(ModContent.NPCType<Leviathan>(), ModContent.ProjectileType<LeviathanBomb>()), new int[] { 100, 172, 208, 244, 366 } },
{ new Tuple<int, int>(ModContent.NPCType<Anahita>(), ModContent.ProjectileType<WaterSpear>()), new int[] { 80, 140, 160, 180, 270 } },
{ new Tuple<int, int>(ModContent.NPCType<Anahita>(), ModContent.ProjectileType<FrostMist>()), new int[] { 84, 148, 172, 196, 294 } },
{ new Tuple<int, int>(ModContent.NPCType<Anahita>(), ModContent.ProjectileType<SirenSong>()), new int[] { 88, 156, 184, 212, 318 } },
{ new Tuple<int, int>(ModContent.NPCType<AstrumAureus>(), ModContent.ProjectileType<AstralLaser>()), new int[] { 88, 156, 184, 212, 318 } },
{ new Tuple<int, int>(ModContent.NPCType<AstrumAureus>(), ModContent.ProjectileType<AstralFlame>()), new int[] { 100, 172, 208, 244, 366 } },
{ new Tuple<int, int>(ModContent.NPCType<AureusSpawn>(), ModContent.ProjectileType<AstralLaser>()), new int[] { 88, 156, 184, 212, 318 } },
{ new Tuple<int, int>(NPCID.Golem, ProjectileID.Fireball), new int[] { 60, 120, 140, 180, 270 } },
{ new Tuple<int, int>(NPCID.Golem, ProjectileID.EyeBeam), new int[] { 80, 140, 172, 204, 306 } },
{ new Tuple<int, int>(NPCID.GolemHead, ProjectileID.Fireball), new int[] { 60, 120, 140, 180, 270 } },
{ new Tuple<int, int>(NPCID.GolemHead, ProjectileID.EyeBeam), new int[] { 80, 140, 172, 204, 306 } },
{ new Tuple<int, int>(NPCID.GolemFistLeft, ProjectileID.InfernoHostileBolt), new int[] { 88, 156, 184, 212, 318 } },
{ new Tuple<int, int>(NPCID.GolemFistRight, ProjectileID.InfernoHostileBolt), new int[] { 88, 156, 184, 212, 318 } },
{ new Tuple<int, int>(NPCID.GolemHeadFree, ProjectileID.Fireball), new int[] { 60, 120, 140, 180, 270 } },
{ new Tuple<int, int>(NPCID.GolemHeadFree, ProjectileID.EyeBeam), new int[] { 80, 140, 172, 204, 306 } },
{ new Tuple<int, int>(NPCID.GolemHeadFree, ProjectileID.InfernoHostileBolt), new int[] { 88, 156, 184, 212, 318 } },
{ new Tuple<int, int>(ModContent.NPCType<PlaguebringerGoliath>(), ModContent.ProjectileType<PlagueStingerGoliath>()), new int[] { 88, 156, 184, 212, 318 } },
{ new Tuple<int, int>(ModContent.NPCType<PlaguebringerGoliath>(), ModContent.ProjectileType<PlagueStingerGoliathV2>()), new int[] { 88, 156, 184, 212, 318 } },
{ new Tuple<int, int>(ModContent.NPCType<PlaguebringerGoliath>(), ModContent.ProjectileType<HiveBombGoliath>()), new int[] { 120, 192, 220, 248, 372 } },
{ new Tuple<int, int>(NPCID.DukeFishron, ProjectileID.Sharknado), new int[] { 80, 100, 150, 200, 300 } },
{ new Tuple<int, int>(NPCID.DukeFishron, ProjectileID.Cthulunado), new int[] { 160, 200, 232, 264, 480 } },
{ new Tuple<int, int>(ModContent.NPCType<RavagerBody>(), ModContent.ProjectileType<RavagerBlaster>()), new int[] { 120, 180, 208, 236, 360 } },
{ new Tuple<int, int>(ModContent.NPCType<RavagerHead>(), ModContent.ProjectileType<RavagerNuke>()), new int[] { 120, 180, 208, 236, 360 } },
{ new Tuple<int, int>(ModContent.NPCType<RavagerHead2>(), ModContent.ProjectileType<HomingLaserDart>()), new int[] { 90, 144, 172, 200, 300 } },
{ new Tuple<int, int>(ModContent.NPCType<RavagerHead2>(), ModContent.ProjectileType<RavagerNuke>()), new int[] { 120, 180, 208, 236, 360 } },
{ new Tuple<int, int>(ModContent.NPCType<FlamePillar>(), ModContent.ProjectileType<RavagerFlame>()), new int[] { 90, 144, 172, 200, 300 } },
{ new Tuple<int, int>(NPCID.CultistBoss, ProjectileID.CultistBossFireBall), new int[] { 88, 156, 184, 212, 318 } },
{ new Tuple<int, int>(NPCID.CultistBoss, ProjectileID.CultistBossIceMist), new int[] { 120, 180, 208, 236, 360 } },
{ new Tuple<int, int>(NPCID.CultistBoss, ProjectileID.CultistBossLightningOrb), new int[] { 120, 192, 220, 248, 372 } },
{ new Tuple<int, int>(NPCID.CultistBossClone, ProjectileID.CultistBossFireBallClone), new int[] { 90, 144, 172, 200, 300 } },
{ new Tuple<int, int>(NPCID.AncientDoom, ProjectileID.AncientDoomProjectile), new int[] { 88, 156, 184, 212, 318 } },
{ new Tuple<int, int>(ModContent.NPCType<AstrumDeusBody>(), ModContent.ProjectileType<AstralShot2>()), new int[] { 90, 152, 176, 200, 300 } },
{ new Tuple<int, int>(ModContent.NPCType<AstrumDeusBody>(), ModContent.ProjectileType<DeusMine>()), new int[] { 120, 180, 208, 236, 360 } },
{ new Tuple<int, int>(ModContent.NPCType<AstrumDeusBody>(), ModContent.ProjectileType<AstralGodRay>()), new int[] { 100, 172, 192, 212, 318 } },
{ new Tuple<int, int>(NPCID.MoonLordHead, ProjectileID.PhantasmalDeathray), new int[] { 200, 300, 380, 460, 690 } },
{ new Tuple<int, int>(NPCID.MoonLordHead, ProjectileID.PhantasmalBolt), new int[] { 90, 120, 160, 200, 300 } },
{ new Tuple<int, int>(NPCID.MoonLordHand, ProjectileID.PhantasmalEye), new int[] { 90, 120, 160, 200, 300 } },
{ new Tuple<int, int>(NPCID.MoonLordHand, ProjectileID.PhantasmalSphere), new int[] { 120, 160, 220, 280, 420 } },
{ new Tuple<int, int>(NPCID.MoonLordHand, ProjectileID.PhantasmalBolt), new int[] { 90, 120, 160, 200, 300 } },
{ new Tuple<int, int>(NPCID.MoonLordFreeEye, ProjectileID.PhantasmalBolt), new int[] { 100, 140, 180, 220, 330 } },
{ new Tuple<int, int>(NPCID.MoonLordFreeEye, ProjectileID.PhantasmalEye), new int[] { 100, 140, 180, 220, 330 } },
{ new Tuple<int, int>(NPCID.MoonLordFreeEye, ProjectileID.PhantasmalSphere), new int[] { 132, 176, 220, 264, 396 } },
{ new Tuple<int, int>(NPCID.MoonLordFreeEye, ProjectileID.PhantasmalDeathray), new int[] { 150, 200, 260, 320, 480 } },
{ new Tuple<int, int>(ModContent.NPCType<ProfanedGuardianCommander>(), ModContent.ProjectileType<ProfanedSpear>()), new int[] { 140, 220, 244, 268, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<ProfanedGuardianCommander>(), ModContent.ProjectileType<HolySpear>()), new int[] { 140, 220, 244, 268, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<ProfanedGuardianCommander>(), ModContent.ProjectileType<HolyBlast>()), new int[] { 140, 220, 244, 268, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<ProfanedGuardianCommander>(), ModContent.ProjectileType<HolyFire>()), new int[] { 120, 192, 220, 248, 360 } },
{ new Tuple<int, int>(ModContent.NPCType<ProfanedGuardianCommander>(), ModContent.ProjectileType<HolyFire2>()), new int[] { 120, 192, 220, 248, 360 } },
{ new Tuple<int, int>(ModContent.NPCType<ProfanedGuardianCommander>(), ModContent.ProjectileType<ProvidenceHolyRay>()), new int[] { 160, 320, 352, 384, 480 } },
{ new Tuple<int, int>(ModContent.NPCType<ProfanedGuardianDefender>(), ModContent.ProjectileType<HolyBomb>()), new int[] { 140, 220, 244, 268, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<ProfanedGuardianDefender>(), ModContent.ProjectileType<HolyFlare>()), new int[] { 105, 171, 189, 207, 315 } },
{ new Tuple<int, int>(ModContent.NPCType<ProfanedGuardianDefender>(), ModContent.ProjectileType<MoltenBlast>()), new int[] { 140, 228, 252, 276, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<ProfanedGuardianDefender>(), ModContent.ProjectileType<MoltenBlob>()), new int[] { 105, 171, 189, 207, 315 } },
{ new Tuple<int, int>(ModContent.NPCType<ProfanedGuardianHealer>(), ModContent.ProjectileType<ProvidenceCrystalShard>()), new int[] { 140, 220, 244, 268, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<ProfanedGuardianHealer>(), ModContent.ProjectileType<HolyBurnOrb>()), new int[] { 120, 192, 220, 248, 360 } },
{ new Tuple<int, int>(ModContent.NPCType<ProfanedGuardianHealer>(), ModContent.ProjectileType<HolyLight>()), new int[] { 35, 50, 50, 0, 0 } },
{ new Tuple<int, int>(ModContent.NPCType<Bumblefuck>(), ModContent.ProjectileType<RedLightningFeather>()), new int[] { 140, 220, 244, 268, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<Bumblefuck>(), ModContent.ProjectileType<BirbAuraFlare>()), new int[] { 200, 300, 332, 364, 600 } },
{ new Tuple<int, int>(ModContent.NPCType<Providence>(), ModContent.ProjectileType<HolyBlast>()), new int[] { 150, 264, 288, 312, 450 } }, // Split holy fire does: 113, 198, 216, 234, 338
{ new Tuple<int, int>(ModContent.NPCType<Providence>(), ModContent.ProjectileType<HolyFire>()), new int[] { 120, 192, 220, 248, 360 } },
{ new Tuple<int, int>(ModContent.NPCType<Providence>(), ModContent.ProjectileType<HolyFire2>()), new int[] { 120, 192, 220, 248, 360 } },
{ new Tuple<int, int>(ModContent.NPCType<Providence>(), ModContent.ProjectileType<HolyBurnOrb>()), new int[] { 140, 220, 244, 268, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<Providence>(), ModContent.ProjectileType<HolyLight>()), new int[] { 35, 50, 50, 0, 0 } },
{ new Tuple<int, int>(ModContent.NPCType<Providence>(), ModContent.ProjectileType<MoltenBlast>()), new int[] { 140, 228, 252, 276, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<Providence>(), ModContent.ProjectileType<MoltenBlob>()), new int[] { 105, 171, 189, 207, 315 } },
{ new Tuple<int, int>(ModContent.NPCType<Providence>(), ModContent.ProjectileType<HolyBomb>()), new int[] { 140, 228, 252, 276, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<Providence>(), ModContent.ProjectileType<HolyFlare>()), new int[] { 105, 171, 189, 207, 315 } },
{ new Tuple<int, int>(ModContent.NPCType<Providence>(), ModContent.ProjectileType<HolySpear>()), new int[] { 140, 220, 244, 268, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<Providence>(), ModContent.ProjectileType<ProvidenceCrystal>()), new int[] { 140, 228, 252, 276, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<Providence>(), ModContent.ProjectileType<ProvidenceCrystalShard>()), new int[] { 140, 228, 252, 276, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<Providence>(), ModContent.ProjectileType<ProvidenceHolyRay>()), new int[] { 200, 400, 440, 480, 600 } },
{ new Tuple<int, int>(ModContent.NPCType<CeaselessVoid>(), ModContent.ProjectileType<DoGBeamPortal>()), new int[] { 140, 240, 264, 288, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<CeaselessVoid>(), ModContent.ProjectileType<DarkEnergyBall>()), new int[] { 140, 240, 264, 288, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<CeaselessVoid>(), ModContent.ProjectileType<DarkEnergyBall2>()), new int[] { 140, 240, 264, 288, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<StormWeaverHead>(), ProjectileID.CultistBossLightningOrbArc), new int[] { 150, 264, 288, 312, 450 } },
{ new Tuple<int, int>(ModContent.NPCType<StormWeaverHead>(), ProjectileID.FrostWave), new int[] { 150, 264, 288, 312, 450 } },
{ new Tuple<int, int>(ModContent.NPCType<StormWeaverHead>(), ModContent.ProjectileType<StormMarkHostile>()), new int[] { 160, 276, 304, 332, 480 } },
{ new Tuple<int, int>(ModContent.NPCType<StormWeaverBody>(), ModContent.ProjectileType<DestroyerElectricLaser>()), new int[] { 140, 240, 264, 288, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<StormWeaverTail>(), ProjectileID.CultistBossLightningOrb), new int[] { 150, 264, 288, 312, 450 } },
{ new Tuple<int, int>(ModContent.NPCType<Signus>(), ModContent.ProjectileType<SignusScythe>()), new int[] { 140, 240, 264, 288, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<Signus>(), ModContent.ProjectileType<EssenceDust>()), new int[] { 140, 240, 264, 288, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<Polterghast>(), ModContent.ProjectileType<PhantomShot>()), new int[] { 140, 240, 264, 288, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<Polterghast>(), ModContent.ProjectileType<PhantomShot2>()), new int[] { 150, 264, 288, 312, 450 } },
{ new Tuple<int, int>(ModContent.NPCType<Polterghast>(), ModContent.ProjectileType<PhantomBlast>()), new int[] { 150, 264, 288, 312, 450 } },
{ new Tuple<int, int>(ModContent.NPCType<Polterghast>(), ModContent.ProjectileType<PhantomBlast2>()), new int[] { 160, 276, 304, 332, 480 } },
{ new Tuple<int, int>(ModContent.NPCType<PolterghastHook>(), ModContent.ProjectileType<PhantomHookShot>()), new int[] { 140, 240, 264, 288, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<PhantomFuckYou>(), ModContent.ProjectileType<PhantomMine>()), new int[] { 170, 296, 324, 352, 510 } },
{ new Tuple<int, int>(ModContent.NPCType<PhantomSpiritL>(), ModContent.ProjectileType<PhantomGhostShot>()), new int[] { 150, 264, 288, 312, 450 } },
{ new Tuple<int, int>(ModContent.NPCType<Mauler>(), ModContent.ProjectileType<MaulerAcidBubble>()), new int[] { 140, 220, 244, 264, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<Mauler>(), ModContent.ProjectileType<MaulerAcidDrop>()), new int[] { 140, 220, 244, 264, 420 } },
{ new Tuple<int, int>(ModContent.NPCType<OldDuke>(), ModContent.ProjectileType<OldDukeGore>()), new int[] { 170, 296, 324, 352, 510 } },
{ new Tuple<int, int>(ModContent.NPCType<OldDuke>(), ModContent.ProjectileType<OldDukeVortex>()), new int[] { 280, 420, 460, 500, 840 } },
{ new Tuple<int, int>(ModContent.NPCType<OldDukeToothBall>(), ModContent.ProjectileType<OldDukeToothBallSpike>()), new int[] { 170, 296, 324, 352, 510 } },
{ new Tuple<int, int>(ModContent.NPCType<OldDukeToothBall>(), ModContent.ProjectileType<SandPoisonCloudOldDuke>()), new int[] { 180, 316, 348, 380, 540 } },
{ new Tuple<int, int>(ModContent.NPCType<SulphurousSharkron>(), ModContent.ProjectileType<OldDukeGore>()), new int[] { 170, 296, 324, 352, 510 } },
{ new Tuple<int, int>(ModContent.NPCType<DevourerofGodsHead>(), ModContent.ProjectileType<DoGDeath>()), new int[] { 180, 316, 348, 380, 540 } },
{ new Tuple<int, int>(ModContent.NPCType<DevourerofGodsHead>(), ModContent.ProjectileType<DoGFire>()), new int[] { 200, 340, 376, 412, 600 } },
{ new Tuple<int, int>(ModContent.NPCType<Yharon>(), ModContent.ProjectileType<SkyFlareRevenge>()), new int[] { 300, 520, 548, 576, 900 } },
{ new Tuple<int, int>(ModContent.NPCType<Yharon>(), ModContent.ProjectileType<FlareBomb>()), new int[] { 220, 384, 424, 464, 660 } },
{ new Tuple<int, int>(ModContent.NPCType<Yharon>(), ModContent.ProjectileType<Flarenado>()), new int[] { 250, 440, 464, 488, 750 } },
{ new Tuple<int, int>(ModContent.NPCType<Yharon>(), ModContent.ProjectileType<Infernado>()), new int[] { 250, 440, 464, 488, 750 } },
{ new Tuple<int, int>(ModContent.NPCType<Yharon>(), ModContent.ProjectileType<Infernado2>()), new int[] { 250, 440, 464, 488, 750 } },
{ new Tuple<int, int>(ModContent.NPCType<Yharon>(), ModContent.ProjectileType<FlareDust>()), new int[] { 220, 384, 424, 464, 660 } },
{ new Tuple<int, int>(ModContent.NPCType<Yharon>(), ModContent.ProjectileType<FlareDust2>()), new int[] { 220, 384, 424, 464, 660 } },
{ new Tuple<int, int>(ModContent.NPCType<Yharon>(), ModContent.ProjectileType<YharonFireball>()), new int[] { 220, 384, 424, 464, 660 } },
{ new Tuple<int, int>(ModContent.NPCType<Yharon>(), ModContent.ProjectileType<YharonBulletHellVortex>()), new int[] { 250, 440, 464, 488, 750 } },
{ new Tuple<int, int>(ModContent.NPCType<SupremeCalamitas>(), ModContent.ProjectileType<BrimstoneHellblast2>()), new int[] { 280, 468, 484, 500, 840 } },
{ new Tuple<int, int>(ModContent.NPCType<SupremeCalamitas>(), ModContent.ProjectileType<SCalBrimstoneFireblast>()), new int[] { 280, 468, 484, 500, 840 } },
{ new Tuple<int, int>(ModContent.NPCType<SupremeCalamitas>(), ModContent.ProjectileType<SCalBrimstoneGigablast>()), new int[] { 300, 508, 528, 548, 900 } },
{ new Tuple<int, int>(ModContent.NPCType<SupremeCalamitas>(), ModContent.ProjectileType<BrimstoneMonster>()), new int[] { 350, 592, 624, 656, 1050 } },
{ new Tuple<int, int>(ModContent.NPCType<SupremeCalamitas>(), ModContent.ProjectileType<BrimstoneWave>()), new int[] { 280, 468, 484, 500, 840 } },
{ new Tuple<int, int>(ModContent.NPCType<SupremeCalamitas>(), ModContent.ProjectileType<BrimstoneBarrage>()), new int[] { 250, 440, 464, 488, 750 } },
{ new Tuple<int, int>(ModContent.NPCType<SupremeCalamitas>(), ModContent.ProjectileType<BrimstoneHellblast>()), new int[] { 280, 468, 484, 500, 840 } },
{ new Tuple<int, int>(ModContent.NPCType<SepulcherBodyEnergyBall>(), ModContent.ProjectileType<BrimstoneBarrage>()), new int[] { 250, 440, 464, 488, 750 } },
{ new Tuple<int, int>(ModContent.NPCType<SoulSeekerSupreme>(), ModContent.ProjectileType<BrimstoneBarrage>()), new int[] { 250, 440, 464, 488, 750 } },
{ new Tuple<int, int>(ModContent.NPCType<SupremeCataclysm>(), ModContent.ProjectileType<SupremeCataclysmFist>()), new int[] { 280, 468, 484, 500, 840 } },
{ new Tuple<int, int>(ModContent.NPCType<SupremeCataclysm>(), ModContent.ProjectileType<BrimstoneBarrage>()), new int[] { 250, 440, 464, 488, 750 } },
{ new Tuple<int, int>(ModContent.NPCType<SupremeCatastrophe>(), ModContent.ProjectileType<SupremeCatastropheSlash>()), new int[] { 280, 468, 484, 500, 840 } },
{ new Tuple<int, int>(ModContent.NPCType<SupremeCatastrophe>(), ModContent.ProjectileType<BrimstoneBarrage>()), new int[] { 250, 440, 464, 488, 750 } },
{ new Tuple<int, int>(ModContent.NPCType<Artemis>(), ModContent.ProjectileType<ArtemisSpinLaserbeam>()), new int[] { 300, 508, 528, 548, 900 } },
{ new Tuple<int, int>(ModContent.NPCType<Artemis>(), ModContent.ProjectileType<ArtemisLaser>()), new int[] { 240, 408, 432, 456, 720 } },
{ new Tuple<int, int>(ModContent.NPCType<Apollo>(), ModContent.ProjectileType<ApolloFireball>()), new int[] { 240, 408, 432, 456, 720 } },
{ new Tuple<int, int>(ModContent.NPCType<Apollo>(), ModContent.ProjectileType<ApolloRocket>()), new int[] { 280, 468, 484, 500, 840 } },
{ new Tuple<int, int>(ModContent.NPCType<ThanatosHead>(), ModContent.ProjectileType<ThanatosBeamStart>()), new int[] { 350, 592, 624, 656, 1050 } },
{ new Tuple<int, int>(ModContent.NPCType<ThanatosHead>(), ModContent.ProjectileType<ThanatosLaser>()), new int[] { 240, 408, 432, 456, 720 } },
{ new Tuple<int, int>(ModContent.NPCType<ThanatosBody1>(), ModContent.ProjectileType<ThanatosLaser>()), new int[] { 240, 408, 432, 456, 720 } },
{ new Tuple<int, int>(ModContent.NPCType<ThanatosBody2>(), ModContent.ProjectileType<ThanatosLaser>()), new int[] { 240, 408, 432, 456, 720 } },
{ new Tuple<int, int>(ModContent.NPCType<ThanatosTail>(), ModContent.ProjectileType<ThanatosLaser>()), new int[] { 240, 408, 432, 456, 720 } },
{ new Tuple<int, int>(ModContent.NPCType<AresBody>(), ModContent.ProjectileType<AresDeathBeamStart>()), new int[] { 300, 508, 528, 548, 900 } },
{ new Tuple<int, int>(ModContent.NPCType<AresLaserCannon>(), ModContent.ProjectileType<AresLaserBeamStart>()), new int[] { 300, 508, 528, 548, 900 } },
{ new Tuple<int, int>(ModContent.NPCType<AresLaserCannon>(), ModContent.ProjectileType<ThanatosLaser>()), new int[] { 240, 408, 432, 456, 720 } },
{ new Tuple<int, int>(ModContent.NPCType<AresPlasmaFlamethrower>(), ModContent.ProjectileType<AresPlasmaFireball>()), new int[] { 240, 408, 432, 456, 720 } },
{ new Tuple<int, int>(ModContent.NPCType<AresTeslaCannon>(), ModContent.ProjectileType<AresTeslaOrb>()), new int[] { 240, 408, 432, 456, 720 } },
{ new Tuple<int, int>(ModContent.NPCType<AresGaussNuke>(), ModContent.ProjectileType<AresGaussNukeProjectile>()), new int[] { 400, 608, 640, 672, 1200 } },
{ new Tuple<int, int>(ModContent.NPCType<PrimordialWyrmHead>(), ProjectileID.CultistBossIceMist), new int[] { 400, 600, 632, 664, 1200 } },
{ new Tuple<int, int>(ModContent.NPCType<PrimordialWyrmHead>(), ProjectileID.CultistBossLightningOrbArc), new int[] { 500, 752, 788, 824, 1500 } },
{ new Tuple<int, int>(ModContent.NPCType<PrimordialWyrmHead>(), ProjectileID.AncientDoomProjectile), new int[] { 400, 600, 632, 664, 1200 } },
{ new Tuple<int, int>(ModContent.NPCType<PrimordialWyrmBodyAlt>(), ProjectileID.CultistBossFireBallClone), new int[] { 400, 600, 632, 664, 1200 } }
};
}
// Destroys the EnemyStats struct to save memory because mod assemblies will not be fully unloaded until TML 1.4.
internal static void UnloadEnemyStats()
{
EnemyStats.ExpertDamageMultiplier = null;
EnemyStats.ContactDamageValues = null;
EnemyStats.ProjectileDamageValues = null;
}
#endregion
}
}
+178
View File
@@ -0,0 +1,178 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics.PackedVector;
using System;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Dusts.WaterSplash
{
public class BasaltGullyLavaSplash : ModDust
{
public override void OnSpawn(Dust dust)
{
dust.velocity *= 0.1f;
dust.velocity.Y = -0.5f;
}
public override bool Update(Dust dust)
{
if (dust.scale > 10f)
{
dust.active = false;
}
Dust.lavaBubbles++;
dust.position += dust.velocity;
if (!dust.noGravity)
{
dust.velocity.Y += 0.1f;
}
if (dust.noGravity)
{
dust.scale += 0.03f;
if (dust.scale < 1f)
{
dust.velocity.Y += 0.075f;
}
dust.velocity.X *= 1.08f;
if (dust.velocity.X > 0f)
{
dust.rotation += 0.01f;
}
else
{
dust.rotation -= 0.01f;
}
float num109 = dust.scale * 0.6f;
if (num109 > 1f)
{
num109 = 1f;
}
Lighting.AddLight((int)(dust.position.X / 16f), (int)(dust.position.Y / 16f + 1f), num109 * (2.5f / 4), num109 * (1.3f / 4), num109 * (0.1f / 4));
}
else
{
if (!Collision.WetCollision(new Vector2(dust.position.X, dust.position.Y - 8f), 4, 4))
{
dust.scale = 0f;
}
else
{
dust.alpha += Main.rand.Next(2);
if (dust.alpha > 255)
{
dust.scale = 0f;
}
dust.velocity.Y = -0.5f;
dust.alpha++;
dust.scale -= 0.01f;
dust.velocity.Y = -0.2f;
dust.velocity.X += (float)Main.rand.Next(-10, 10) * 0.002f;
if ((double)dust.velocity.X < -0.25)
{
dust.velocity.X = -0.25f;
}
if ((double)dust.velocity.X > 0.25)
{
dust.velocity.X = 0.25f;
}
}
float num3 = dust.scale * 0.3f + 0.4f;
if (num3 > 1f)
{
num3 = 1f;
}
Lighting.AddLight((int)(dust.position.X / 16f), (int)(dust.position.Y / 16f), num3 * (2.5f / 4), num3 * (1.3f / 4), num3 * (0.1f / 4));
}
dust.rotation += dust.velocity.X * 0.5f;
if (dust.fadeIn > 0f && dust.fadeIn < 100f)
{
dust.scale += 0.03f;
if (dust.scale > dust.fadeIn)
{
dust.fadeIn = 0f;
}
}
dust.scale -= 0.01f;
if (dust.noGravity)
{
dust.velocity *= 0.92f;
if (dust.fadeIn == 0f)
{
dust.scale -= 0.04f;
}
}
if (dust.position.Y > Main.screenPosition.Y + (float)Main.screenHeight)
{
dust.active = false;
}
float num17 = 0.1f;
if ((double)Dust.dCount == 0.5)
{
dust.scale -= 0.001f;
}
if ((double)Dust.dCount == 0.6)
{
dust.scale -= 0.0025f;
}
if ((double)Dust.dCount == 0.7)
{
dust.scale -= 0.005f;
}
if ((double)Dust.dCount == 0.8)
{
dust.scale -= 0.01f;
}
if ((double)Dust.dCount == 0.9)
{
dust.scale -= 0.02f;
}
if ((double)Dust.dCount == 0.5)
{
num17 = 0.11f;
}
if ((double)Dust.dCount == 0.6)
{
num17 = 0.13f;
}
if ((double)Dust.dCount == 0.7)
{
num17 = 0.16f;
}
if ((double)Dust.dCount == 0.8)
{
num17 = 0.22f;
}
if ((double)Dust.dCount == 0.9)
{
num17 = 0.25f;
}
if (dust.scale < num17)
{
dust.active = false;
}
return false;
}
public override Color? GetAlpha(Dust dust, Color lightColor)
{
float num = (float)(255 - dust.alpha) / 255f;
int num4;
int num3;
int num2;
num = (num + 3f) / 4f;
num4 = (int)((int)lightColor.R * num);
num3 = (int)((int)lightColor.G * num);
num2 = (int)((int)lightColor.B * num);
int num6 = lightColor.A - dust.alpha;
if (num6 < 0)
{
num6 = 0;
}
if (num6 > 255)
{
num6 = 255;
}
return new Color(num4, num3, num2, num6);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

+33
View File
@@ -0,0 +1,33 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
float2 uTargetPosition;
float4 uLegacyArmorSourceRect;
float2 uLegacyArmorSheetSize;
float4 PixelShaderFunction(float2 coords : TEXCOORD0) : COLOR0
{
float4 color = tex2D(uImage0, coords);
color.rgb *= 0;
color.a = 0;
return color;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
Binary file not shown.
+14
View File
@@ -0,0 +1,14 @@
using Terraria.ModLoader.Config;
namespace CalamityMod.Enums
{
public enum SetBonusDoubleTapOptions
{
[LabelKey("$Mods.CalamityMod.Configs.CalamityClientConfig.SetBonusDoubleTap.Options.On")]
On,
[LabelKey("$Mods.CalamityMod.Configs.CalamityClientConfig.SetBonusDoubleTap.Options.Auto")]
Auto,
[LabelKey("$Mods.CalamityMod.Configs.CalamityClientConfig.SetBonusDoubleTap.Options.Off")]
Off
}
}
+4 -5
View File
@@ -164,7 +164,7 @@ namespace CalamityMod.Events
ModContent.NPCType<DesertNuisanceBody>(), ModContent.NPCType<DesertNuisanceTail>(), ModContent.NPCType<DesertNuisanceHeadYoung>(),
ModContent.NPCType<DesertNuisanceBodyYoung>(), ModContent.NPCType<DesertNuisanceTailYoung>() }),
new Boss(NPCID.EyeofCthulhu, TimeChangeContext.Night, permittedNPCs: new int[] { NPCID.ServantofCthulhu, ModContent.NPCType<BloodlettingServant>() }),
new Boss(NPCID.EyeofCthulhu, TimeChangeContext.Night, permittedNPCs: new int[] { NPCID.ServantofCthulhu }),
new Boss(ModContent.NPCType<Crabulon>(), TimeChangeContext.Day, type =>
{
@@ -213,8 +213,7 @@ namespace CalamityMod.Events
{
NPC.SpawnOnPlayer(ClosestPlayerToWorldCenter, NPCID.Spazmatism);
NPC.SpawnOnPlayer(ClosestPlayerToWorldCenter, NPCID.Retinazer);
NPC.SpawnOnPlayer(ClosestPlayerToWorldCenter, ModContent.NPCType<Foveanator>());
}, permittedNPCs: new int[] { NPCID.Retinazer, ModContent.NPCType<Foveanator>() }),
}, permittedNPCs: new int[] { NPCID.Retinazer }),
new Boss(ModContent.NPCType<AquaticScourgeHead>(), TimeChangeContext.Day, permittedNPCs: new int[] { ModContent.NPCType<AquaticScourgeBody>(), ModContent.NPCType<AquaticScourgeBodyAlt>(), ModContent.NPCType<AquaticScourgeTail>() }),
@@ -222,7 +221,7 @@ namespace CalamityMod.Events
new Boss(ModContent.NPCType<BrimstoneElemental>(), TimeChangeContext.Day, permittedNPCs: ModContent.NPCType<Brimling>()),
new Boss(NPCID.SkeletronPrime, TimeChangeContext.Night, permittedNPCs: new int[] { ModContent.NPCType<SkeletronPrime2>(), NPCID.PrimeCannon, NPCID.PrimeSaw, NPCID.PrimeVice, NPCID.PrimeLaser, NPCID.Probe }),
new Boss(NPCID.SkeletronPrime, TimeChangeContext.Night, permittedNPCs: new int[] { NPCID.PrimeCannon, NPCID.PrimeSaw, NPCID.PrimeVice, NPCID.PrimeLaser }),
new Boss(ModContent.NPCType<CalamitasClone>(), TimeChangeContext.Night, permittedNPCs: new int[] { ModContent.NPCType<Cataclysm>(), ModContent.NPCType<Catastrophe>(),
ModContent.NPCType<SoulSeeker>() }),
@@ -309,7 +308,7 @@ namespace CalamityMod.Events
NPC.SpawnOnPlayer(ClosestPlayerToWorldCenter, type);
}, permittedNPCs: new int[] { ModContent.NPCType<ProfanedGuardianDefender>(), ModContent.NPCType<ProfanedGuardianHealer>(), ModContent.NPCType<ProfanedRocks>() }),
new Boss(ModContent.NPCType<Bumblefuck>(), permittedNPCs: new int[] { ModContent.NPCType<Bumblefuck2>() }),
new Boss(ModContent.NPCType<Dragonfolly>(), permittedNPCs: new int[] { ModContent.NPCType<DraconicSwarmer>() }),
new Boss(ModContent.NPCType<Providence>(), TimeChangeContext.Day, type =>
{
+2 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.CalPlayer;
using CalamityMod.Items.Armor.Sulphurous;
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Typeless;
@@ -46,7 +47,7 @@ namespace CalamityMod.ExtraJumps
if (modPlayer.sulphurBubbleCooldown <= 0)
{
var source = player.GetSource_Misc("0");
int damage = (int)player.GetTotalDamage<RogueDamageClass>().ApplyTo(20);
int damage = (int)player.GetTotalDamage<RogueDamageClass>().ApplyTo(SulphurousHelmet.BubbleDamage);
int bubble = Projectile.NewProjectile(source, new Vector2(player.position.X, player.position.Y + (player.gravDir == -1f ? 20 : -20)), Vector2.Zero, ModContent.ProjectileType<SulphuricAcidBubbleFriendly>(), damage, 0f, player.whoAmI, 1f, 0f);
if (bubble.WithinBounds(Main.maxProjectiles))
Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 493 B

-20
View File
@@ -19,11 +19,6 @@ namespace CalamityMod.ExtraTextures
public static Asset<Texture2D> DestroyerHeadGlowmask;
public static Asset<Texture2D> DestroyerBodyGlowmask;
public static Asset<Texture2D> DestroyerTailGlowmask;
public static Asset<Texture2D> ProbeGlowmask;
// Master Rev+ Skeletron Prime
public static Asset<Texture2D> ChadPrime;
public static Asset<Texture2D> ChadPrimeEyeGlowmask;
// WoF, These are not "exactly" the ExtraTextures. But
public static Asset<Texture2D> WallOfFleshEyeGlowmask;
@@ -44,16 +39,6 @@ namespace CalamityMod.ExtraTextures
public static Asset<Texture2D> CircularSmearFire2;
public static Asset<Texture2D> CircularSmearFire3;
// Boss Heads
// I know it's not exactly a Texture2D but it belongs to ExtraTextures.
public static int BossHeadIndex_ChadPrime;
public override void Load()
{
string chadPrimeIconPath = "CalamityMod/ExtraTextures/ChadPrime_Head_Boss";
BossHeadIndex_ChadPrime = CalamityMod.Instance.AddBossHeadTexture(chadPrimeIconPath, -1);
}
// TODO: - Every other ExtraTextures Reference could be move in here
public override void OnModLoad()
@@ -62,11 +47,6 @@ namespace CalamityMod.ExtraTextures
DestroyerBodyGlowmask = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerBodyGlow", AssetRequestMode.AsyncLoad);
DestroyerTailGlowmask = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerTailGlow", AssetRequestMode.AsyncLoad);
ProbeGlowmask = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/ProbeGlow", AssetRequestMode.AsyncLoad);
ChadPrime = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/ChadPrime", AssetRequestMode.AsyncLoad);
ChadPrimeEyeGlowmask = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/ChadPrimeHeadGlow", AssetRequestMode.AsyncLoad);
WallOfFleshEyeGlowmask = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/WallOfFleshEyeTelegraphGlow", AssetRequestMode.AsyncLoad);
WallOfFleshDemonSickleTexture = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Melee/ForbiddenOathbladeProjectile", AssetRequestMode.AsyncLoad);
Binary file not shown.

Before

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 594 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 573 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

@@ -0,0 +1,11 @@
using Microsoft.Xna.Framework;
namespace CalamityMod.Gores.WaterDroplet
{
public class BasaltGullyLavaDroplet : LiquidDropletGore
{
public override bool lavaDroplet => true;
public override Vector3 lavaColor => new Vector3(2.5f, 1.3f, 0.1f);
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

+81 -156
View File
@@ -1,6 +1,8 @@
using System;
using CalamityMod.Balancing;
using CalamityMod.Enums;
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using Terraria;
@@ -79,17 +81,6 @@ namespace CalamityMod.ILEditing
}
cursor.Remove();
cursor.Emit(OpCodes.Ldc_R4, 0.5f); // Decrease to 0.5f.
// CIT 22SEP2024: Removed the edit intended to decrease Frog Leg's jump speed boost,
// as it was not doing anything due to vanilla changing how Frog Leg's jump speed boost is applied.
// Remove the jump height addition from the Werewolf buff (Moon Charm).
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcI4(2)))
{
LogFailure("Jump Height Boost Fixes", "Could not locate Moon Charm jump height boost value.");
return;
}
cursor.Next.Operand = 0;
}
private const float VanillaBaseJumpSpeed = 5.01f;
@@ -115,16 +106,12 @@ namespace CalamityMod.ILEditing
private static void RunSpeedAdjustments(ILContext il)
{
var cursor = new ILCursor(il);
float asphaltTopSpeedMultiplier = 1.75f; // +75%. Vanilla is +250%
float asphaltTopSpeedMultiplier = 2.25f; // +125%. Vanilla is +250%
float asphaltSlowdown = 1f; // Vanilla is 2f. This should actually make asphalt faster.
// Dunerider Boots multiply all run stats by 1.75f in vanilla
float duneRiderBootsMultiplier = 1.25f; // Change to 1.25f
// Multiplied by 0.6 on frozen slime, for +26% acceleration
// Multiplied by 0.7 on ice, for +47% acceleration
float iceSkateAcceleration = 2.1f;
float iceSkateTopSpeed = 1f; // no boost at all
//
// ASPHALT
@@ -153,22 +140,6 @@ namespace CalamityMod.ILEditing
cursor.Emit(OpCodes.Ldc_R4, asphaltSlowdown);
}
//
// DUNERIDER BOOTS + SAND BLOCKS
//
{
// Find the multiplier for Dunerider Boots on Sand Blocks.
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(1.75f)))
{
LogFailure("Run Speed Adjustments", "Could not locate the Dunerdier Boots multiplier.");
return;
}
// Massively reduce the increased speed of Dunerider Boots while on Sand Blocks.
cursor.Remove();
cursor.Emit(OpCodes.Ldc_R4, duneRiderBootsMultiplier);
}
//
// ICE SKATES + FROZEN SLIME BLOCKS
//
@@ -183,17 +154,6 @@ namespace CalamityMod.ILEditing
// Massively reduce the acceleration bonus of Ice Skates on Frozen Slime Blocks.
cursor.Remove();
cursor.Emit(OpCodes.Ldc_R4, iceSkateAcceleration);
// Find the top speed multiplier of Ice Skates on Frozen Slime Blocks.
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(1.25f)))
{
LogFailure("Run Speed Adjustments", "Could not locate Ice Skates + Frozen Slime Block top speed multiplier.");
return;
}
// Make Ice Skates give no top speed boost whatsoever on Frozen Slime Blocks.
cursor.Remove();
cursor.Emit(OpCodes.Ldc_R4, iceSkateTopSpeed);
}
//
@@ -210,17 +170,6 @@ namespace CalamityMod.ILEditing
// Massively reduce the acceleration bonus of Ice Skates on Ice Blocks.
cursor.Remove();
cursor.Emit(OpCodes.Ldc_R4, iceSkateAcceleration);
// Find the top speed multiplier of Ice Skates on Ice Blocks.
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(1.25f)))
{
LogFailure("Run Speed Adjustments", "Could not locate Ice Skates + Ice Block top speed multiplier.");
return;
}
// Make Ice Skates give no top speed boost whatsoever on Ice Blocks.
cursor.Remove();
cursor.Emit(OpCodes.Ldc_R4, iceSkateTopSpeed);
}
}
@@ -241,18 +190,7 @@ namespace CalamityMod.ILEditing
}
cursor.Next.Operand = BalancingConstants.SoaringInsigniaRunAccelerationMultiplier;
// Second: Magiluminescence. Find the check for whether it's equipped for run speeds.
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdfld<Player>("hasMagiluminescence")))
{
LogFailure("Run Acceleration Nerfs", "Could not locate the Magiluminescence bool.");
return;
}
//
// Don't actually do anything. Magiluminescence is not intended to be nerfed by Calamity.
//
// Third: Shadow Armor. Find the check for whether it's equipped for run speeds.
// Second: Shadow Armor. Find the check for whether it's equipped for run speeds.
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdfld<Player>("shadowArmor")))
{
LogFailure("Run Acceleration Nerfs", "Could not locate the Shadow Armor bool.");
@@ -398,73 +336,15 @@ namespace CalamityMod.ILEditing
orig(self, item);
// Hard / Guarding / Armored / Warding give 0.25% / 0.5% / 0.75% / 1% DR
if (item.prefix == PrefixID.Hard)
{
/* Prehardmode = 1
* Hardmode = 2
* Post-Moon Lord = 3
* Post-DoG = 4
*/
if (DownedBossSystem.downedDoG)
self.statDefense += 3;
else if (NPC.downedMoonlord)
self.statDefense += 2;
else if (Main.hardMode)
self.statDefense += 1;
self.endurance += 0.0025f;
}
if (item.prefix == PrefixID.Guarding)
{
/* Prehardmode = 2
* Hardmode = 3
* Post-Moon Lord = 4
* Post-DoG = 5
*/
if (DownedBossSystem.downedDoG)
self.statDefense += 3;
else if (NPC.downedMoonlord)
self.statDefense += 2;
else if (Main.hardMode)
self.statDefense += 1;
self.endurance += 0.005f;
}
if (item.prefix == PrefixID.Armored)
{
/* Prehardmode = 3
* Hardmode = 4
* Post-Moon Lord = 5
* Post-DoG = 6
*/
if (DownedBossSystem.downedDoG)
self.statDefense += 3;
else if (NPC.downedMoonlord)
self.statDefense += 2;
else if (Main.hardMode)
self.statDefense += 1;
self.endurance += 0.0075f;
}
if (item.prefix == PrefixID.Warding)
{
/* Prehardmode = 4
* Hardmode = 5
* Post-Moon Lord = 6
* Post-DoG = 7
*/
if (DownedBossSystem.downedDoG)
self.statDefense += 3;
else if (NPC.downedMoonlord)
self.statDefense += 2;
else if (Main.hardMode)
self.statDefense += 1;
self.endurance += 0.01f;
}
// Lucky prefix increases luck
if (item.prefix == PrefixID.Lucky)
self.Calamity().calamityBonusLuck += 0.05f;
}
@@ -501,7 +381,7 @@ namespace CalamityMod.ILEditing
private static void VanillaBossResistChanges(ILContext il)
{
// This IL edit accomplishes two things:
// 1. Reduces Expert+ Eater of Worlds' resist to explosives from 80% to 60%.
// 1. Reduces Expert+ Eater of Worlds' resist to explosives from 80% to 66%.
// 2. Effectively removes Lunatic Cultist's resistance to homing projectiles.
var cursor = new ILCursor(il);
@@ -514,17 +394,15 @@ namespace CalamityMod.ILEditing
return;
}
}
if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchDiv()))
if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdcR4(5f)))
{
LogFailure("Reduce EoW Grenade Resist", "Could not move to the resist factor.");
return;
}
// Remove the division instruction, then pop the 5 off the stack to destroy it. Replace it with loading a 0.4 and then multiplying by it.
cursor.Remove();
// Pop the 5 off the stack, and replace it with a 3.
cursor.EmitPop();
cursor.EmitLdcR4(0.4f);
cursor.EmitMul();
cursor.EmitLdcR4(3f);
// Now, move to the Cultist resist which is right below it.
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdsfld(typeof(ProjectileID.Sets), "CultistIsResistantTo")))
@@ -563,30 +441,13 @@ namespace CalamityMod.ILEditing
#region UpdateBuffs Balancing Changes
private static void UpdateBuffsBalancingChanges(ILContext il)
{
// This IL edit accomplishes four things:
// 1. Nerf Sharpening Station's armor penetration boost from 12 to 5.
// 2. Nerf Beetle Scale Mail's set bonus Beetle Might melee speed from 10% per stack to 5%.
// 3. Nerf Nebula armor's Damage and Life Boosters (Mana Boosters are not handled in this method).
// 4. Remove the ability for Feral Bite to randomly inflict debuffs.
// This IL edit accomplishes three things:
// 1. Nerf Beetle Scale Mail's set bonus Beetle Might melee speed from 10% per stack to 5%.
// 2. Nerf Nebula armor's Damage and Life Boosters (Mana Boosters are not handled in this method).
// 3. Remove the vanilla implementation of Feral Bite inflicting random debuffs.
var cursor = new ILCursor(il);
// First, find the code which applies Sharpened's armor penetration buff.
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdcI4(BuffID.Sharpened)))
{
LogFailure("Sharpening Station Nerf", "Could not locate the Sharpened buff ID.");
return;
}
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(12f))) // The amount of armor penetration to grant.
{
LogFailure("Sharpening Station Nerf", "Could not locate the amount of armor penetration granted.");
return;
}
// Replace the value entirely.
cursor.Remove();
cursor.Emit(OpCodes.Ldc_R4, BalancingConstants.SharpeningStationArmorPenetration);
// Next, move to Beetle Scale Mail's melee speed boost from Beetle Might buff.
// First, move to Beetle Scale Mail's melee speed boost from Beetle Might buff.
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdcI4(BuffID.BeetleMight1)))
{
LogFailure("Beetle Scale Mail Nerf", "Could not locate the Beetle Might buff ID.");
@@ -642,7 +503,7 @@ namespace CalamityMod.ILEditing
// There are multiple branches pointing to this instruction, so it cannot be removed. Instead, swap its value directly.
cursor.Next.Operand = BalancingConstants.NebulaDamagePerBooster;
// Finally, removing Feral Bite's debuffs.
// Finally, removing Feral Bite's vanilla debuff infliction.
// Find the random debuff duration multiplier for the debuffs inflicted by Feral Bite.
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(0.01f))) // The 0.01f random debuff duration multiplier.
{
@@ -651,14 +512,78 @@ namespace CalamityMod.ILEditing
}
// Remove and change to 0f, this makes the random debuffs from Feral Bite have 0 duration.
// Calamity reimplements a different version of this in CalamityGlobalBuff.Update
cursor.Remove();
cursor.Emit(OpCodes.Ldc_R4, 0f);
}
#endregion
#region Vortex Booster Keeps Vortex Stealth When Dashing
private static void VortexBoosterKeepsVortexStealthWhenDashing(On_Player.orig_DashMovement orig, Player self)
#region SoC Buffs & Vortex Booster Keeping Stealth
private static void DashMovementEdits(On_Player.orig_DashMovement orig, Player self)
{
//This is a modified version of Vanilla's Shield of Cthulhu dash collision checks
//This is done to be able to adjust values as needed. Here we change the iframe amount and recoil velocity
if (self.dash == 2 && self.eocDash > 0 && self.eocHit < 0)
{
Rectangle DashHitbox = new Rectangle((int)(self.position.X + self.velocity.X * 0.5 - 4.0), (int)(self.position.Y + self.velocity.Y * 0.5 - 4.0), self.width + 8, self.height + 8);
for (int i = 0; i < 200; i++)
{
NPC hitNPC = Main.npc[i];
if (!hitNPC.active || hitNPC.dontTakeDamage || hitNPC.friendly || (hitNPC.aiStyle == 112 && !(hitNPC.ai[2] <= 1f)) || !self.CanNPCBeHitByPlayerOrPlayerProjectile(hitNPC))
{
continue;
}
Rectangle npcHitbox = hitNPC.getRect();
if (DashHitbox.Intersects(npcHitbox) && (hitNPC.noTileCollide || self.CanHit(hitNPC)))
{
float dmg = self.GetTotalDamage(DamageClass.Melee).ApplyTo(self.Calamity().copyrightInfringementShield ? 300f : 30f);
float kb = self.GetTotalKnockback(DamageClass.Melee).ApplyTo(self.Calamity().copyrightInfringementShield ? 12f : 9f);
bool crit = false;
if (Main.rand.Next(100) < self.GetTotalCritChance(DamageClass.Melee))
{
crit = true;
}
int direction = self.direction;
if (self.velocity.X < 0f)
{
direction = -1;
}
if (self.velocity.X > 0f)
{
direction = 1;
}
self.eocHit = i;
if (self.whoAmI == Main.myPlayer)
{
self.ApplyDamageToNPC(hitNPC, (int)dmg, kb, direction, crit, DamageClass.Melee);
}
self.eocDash = 10;
self.dashDelay = BalancingConstants.OnShieldBonkCooldown;
self.velocity.X = -direction * 9;
self.velocity.Y = -4f;
self.GiveImmuneTimeForCollisionAttack(8); //This is normally 4 in vanilla
int heldDir = 0;
if (self.controlLeft)
heldDir--;
if (self.controlRight)
heldDir++;
int dirSum = Math.Abs(direction + heldDir);
switch (dirSum)
{
case 0: //Holding in direction of recoil
self.velocity.X *= 1.75f;
break;
case 1: //Neutral direction
self.velocity.X *= 1.5f;
break;
case 2: //Holding in direction of enemy
self.velocity.X *= 1.25f;
break;
}
}
}
}
// Allows for Vortex Booster to automatically re-engage Vortex armor's stealth after a delay when dashing
bool vortexStealth = self.vortexStealthActive;
orig(self);
+5 -10
View File
@@ -65,18 +65,18 @@ namespace CalamityMod.ILEditing
// NPC behavior
IL_Main.UpdateTime += PermitNighttimeTownNPCSpawning;
On_Main.UpdateTime_SpawnTownNPCs += AlterTownNPCSpawnRate;
On_NPC.ShouldEmpressBeEnraged += AllowEmpressToEnrageInBossRush;
On_NPC.DoDeathEvents += PreventVanillaBossDeathsInBossRush;
IL_NPC.DoDeathEvents += PreventVanillaBossDeathsInBossRush;
IL_Player.CollectTaxes += MakeTaxCollectorUseful;
// Mechanics / features
On_NPC.ApplyTileCollision += AllowTriggeredFallthrough;
On_NPC.ApplyTileCollision += AllowFusionFeederToDigThroughSand;
IL_Player.ApplyEquipFunctional += ScopesRequireVisibilityToZoom;
IL_Player.Hurt_PlayerDeathReason_int_int_refHurtInfo_bool_bool_int_bool_float_float_float += DodgeMechanicAdjustments;
On_Player.PutHallowedArmorSetBonusOnCooldown += AddHolyProtectionCooldown;
IL_Player.DashMovement += FixAllDashMechanics;
On_Player.DashMovement += VortexBoosterKeepsVortexStealthWhenDashing;
On_Player.DashMovement += DashMovementEdits;
On_Player.DoCommonDashHandle += ApplyDashKeybind;
On_Player.KeyDoubleTap += DisableDoubleTapOnConfig;
IL_Player.GiveImmuneTimeForCollisionAttack += MakeShieldSlamIFramesConsistent;
IL_Player.Update_NPCCollision += NerfShieldOfCthulhuBonkSafety;
On_WorldGen.OpenDoor += OpenDoor_LabDoorOverride;
@@ -84,16 +84,11 @@ namespace CalamityMod.ILEditing
On_Item.AffixName += IncorporateEnchantmentInAffix;
On_Projectile.NewProjectile_IEntitySource_float_float_float_float_int_int_float_int_float_float_float += IncorporateExtraProjectileVariables;
On_Player.ApplyDamageToNPC += ApplyOldFashionedDamageToMiscHits;
// TODO -- This should be unnecessary. There is now a TML hook for platform collision for ModNPCs.
On_NPC.Collision_DecideFallThroughPlatforms += EnableCalamityBossPlatformCollision;
IL_Wiring.HitWireSingle += AddTwinklersToStatue;
On_Player.UpdateItemDye += FindCalamityItemDyeShader;
On_AWorldListItem.GetDifficulty += GetDifficultyOverride;
On_Item.GetShimmered += ShimmerEffectEdits;
On_Player.Teleport += TPOverride;
On_NPC.SpawnBoss += TripletsSpawnTextOverride;
On_NPC.DoDeathEvents_BeforeLoot += PreventFoveanatorDefeatMessageIfNotKilledLast;
On_NPC.DoDeathEvents_CelebrateBossDeath += TripletsDefeatTextOverride;
On_TileDrawing.DrawSingleTile += GlowMaskTileRender;
On_Main.DoUpdate_HandleChat += SpawnPunchCard;
On_Player.PlaceThing_CannonBall += AllowCannonJellyfishUse;
@@ -177,7 +172,6 @@ namespace CalamityMod.ILEditing
IL_Projectile.StatusPlayer += RemoveFrozenInflictionFromDeerclopsIceSpikes;
// World generation
IL_WorldGen.Pyramid += ReplacePharaohSetInPyramids;
IL_WorldGen.GrowLivingTree += BlockLivingTreesNearOcean;
On_WorldGen.SmashAltar += PreventSmashAltarCode;
IL_WorldGen.hardUpdateWorld += AdjustChlorophyteSpawnRate;
@@ -192,6 +186,7 @@ namespace CalamityMod.ILEditing
// Removal of vanilla stupidity
IL_Player.StatusFromNPC += RemoveExpertBrainRandomDebuffs;
IL_NPC.StrikeNPC_HitInfo_bool_bool += LetDetonatingBubblesTakeDamage;
IL_Player.ItemCheck_EmitUseVisuals += MakeMagmaStoneFireGauntletDustToggleable;
IL_Projectile.EmitEnchantmentVisualsAt += MakeMagmaStoneFireGauntletProjectileDustToggleable;
IL_Sandstorm.HasSufficientWind += DecreaseSandstormWindSpeedRequirement;
+83 -212
View File
@@ -6,6 +6,7 @@ using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.CalPlayer;
using CalamityMod.Cooldowns;
using CalamityMod.DataStructures;
using CalamityMod.Enums;
using CalamityMod.Events;
using CalamityMod.FluidSimulation;
using CalamityMod.Items.Accessories;
@@ -79,7 +80,7 @@ namespace CalamityMod.ILEditing
//private static readonly MethodInfo textureGetValueMethod = typeof(Asset<Texture2D>).GetMethod("get_Value", BindingFlags.Public | BindingFlags.Instance);
#region Punch Card Spawning Command
private static void SpawnPunchCard(Terraria.On_Main.orig_DoUpdate_HandleChat orig)
private static void SpawnPunchCard(On_Main.orig_DoUpdate_HandleChat orig)
{
// Any of these conditions should result in normal behaviour
if (!Main.drawingPlayerChat || Main.CurrentInputTextTakerOverride != null || Main.editSign || PlayerInput.UsingGamepad)
@@ -161,26 +162,7 @@ namespace CalamityMod.ILEditing
// This will occur precisely when the player has no vanilla OR Calamity dash items equipped.
cursor.Emit(OpCodes.Or);
//
// SHIELD OF CTHULHU
//
// Move to Shield of Cthulhu's code by finding its function call for iframes.
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchCall<Player>("GiveImmuneTimeForCollisionAttack")))
{
LogFailure("Vanilla Dash Fixes", "Could not locate function call for Shield of Cthulhu iframes.");
return;
}
if (!cursor.TryGotoPrev(MoveType.AfterLabel, i => i.MatchLdcI4(30)))
{
LogFailure("Vanilla Dash Fixes", "Could not locate amount of frames of dash cooldown applied on impact with Shield of Cthulhu.");
return;
}
// Remove the instruction and replace it with one which gives Calamity's (customizable) amount of dash cooldown.
cursor.Remove();
cursor.Emit(OpCodes.Ldc_I4, BalancingConstants.OnShieldBonkCooldown);
// CIT 22JUL2025: Shield of Cthulhu bonk is reimplemented in a separate On edit; removed the change made to it via this IL edit.
//
// SOLAR FLARE ARMOR
@@ -282,7 +264,7 @@ namespace CalamityMod.ILEditing
cursor.Emit(OpCodes.Ldc_I4, 10 - BalancingConstants.ShieldOfCthulhuBonkNoCollideFrames);
}
private static void ApplyDashKeybind(Terraria.On_Player.orig_DoCommonDashHandle orig, Player self, out int dir, out bool dashing, Player.DashStartAction dashStartAction)
private static void ApplyDashKeybind(On_Player.orig_DoCommonDashHandle orig, Player self, out int dir, out bool dashing, Player.DashStartAction dashStartAction)
{
// we feasting multiplayer bugs
if (self.whoAmI != Main.myPlayer)
@@ -331,46 +313,68 @@ namespace CalamityMod.ILEditing
self.dashTime = 0;
}
}
#endregion
#region Allow Empress to Enrage in Boss Rush
private static bool AllowEmpressToEnrageInBossRush(Terraria.On_NPC.orig_ShouldEmpressBeEnraged orig)
private static void DisableDoubleTapOnConfig(On_Player.orig_KeyDoubleTap orig, Player self, int keyDir)
{
if (BossRushEvent.BossRushActive)
return true;
if (self.whoAmI != Main.myPlayer)
{
orig(self, keyDir);
return;
}
return orig();
if ((CalamityKeybinds.ArmorSetBonusHotKey.GetAssignedKeys().Count != 0 && CalamityClientConfig.Instance.SetBonusDoubleTap == SetBonusDoubleTapOptions.Auto) || CalamityClientConfig.Instance.SetBonusDoubleTap == SetBonusDoubleTapOptions.Off)
return;
orig(self, keyDir);
}
#endregion
#region Prevent Vanilla Bosses From Being Marked as Defeated in Boss Rush
private static void PreventVanillaBossDeathsInBossRush(On_NPC.orig_DoDeathEvents orig, NPC self, Player closestPlayer)
private static void PreventVanillaBossDeathsInBossRush(ILContext il)
{
// Aside from setting the boss' downed bool, DoDeathEvents also handles the following tasks:
// Advancing Slime Rain, spawning Dungeon Spirits, advancing invasion kills, spawning Wall of Flesh's loot box, dropping boss potions and hearts, and sending the boss defeated message.
// The first three do not matter at all in Boss Rush. Wall of Flesh's loot box not spawning is also a positive, so that it doesn't clutter the Underworld.
// Dropping potions is worthless at this point, and Boss Rush is already a horribly balanced hellscape as is, so I'm not worried about hearts.
// As for the last one, well, if anyone actually notices that and cares about it, then I suppose we could make a more sophisticated IL edit.
if (BossRushEvent.BossRushActive)
// GOAL: Prevent vanilla boss defeated flags from getting set during Boss Rush.
// All of this is handled within a switch case directly in the DoDeathEvents function.
// Thus, the objective here is to add a branch past the entire switch case if it is Boss Rush.
var cursor = new ILCursor(il);
// Move to the point right before the switch case.
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchCall<NPC>("SpawnOnPlayer")))
{
LogFailure("Prevent Vanilla Defeated Flags in Boss Rush", "Could not move to before the switch case.");
return;
}
orig(self, closestPlayer);
// Define a branch label, load the Boss Rush check, and create the branch if it is true.
var label = il.DefineLabel();
cursor.Emit(OpCodes.Ldsfld, typeof(BossRushEvent).GetField("BossRushActive"));
cursor.Emit(OpCodes.Brtrue, label);
// Move to after the switch case to place the label.
for (int i = 0; i < 2; i++)
{
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchCall<NPC>("SpawnBoss")))
{
LogFailure("Prevent Vanilla Defeated Flags in Boss Rush", "Could not move to after the switch case.");
return;
}
}
if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdarg0()))
{
LogFailure("Prevent Vanilla Defeated Flags in Boss Rush", "Could not move to after the switch case.");
return;
}
cursor.MarkLabel(label);
}
#endregion Prevent Vanilla Bosses From Being Marked as Defeated in Boss Rush
#endregion
#region Enabling of Triggered NPC Platform Fallthrough
// Why this isn't a mechanism provided by TML itself or vanilla itself is beyond me.
private static void AllowTriggeredFallthrough(Terraria.On_NPC.orig_ApplyTileCollision orig, NPC self, bool fall, Vector2 cPosition, int cWidth, int cHeight)
#region Enabling of Fusion Feeder Sand Digging
private static void AllowFusionFeederToDigThroughSand(On_NPC.orig_ApplyTileCollision orig, NPC self, bool fall, Vector2 cPosition, int cWidth, int cHeight)
{
if (self.active && self.type == ModContent.NPCType<FusionFeeder>())
{
self.velocity = Collision.AdvancedTileCollision(TileID.Sets.ForAdvancedCollision.ForSandshark, cPosition, self.velocity, cWidth, cHeight, fall, fall, 1);
return;
}
var isNpcValid = self.TryGetGlobalNPC(out CalamityGlobalNPC npc); //why the fuck this errors is anybody's guess, it absolutely shouldn't and yet it does
if (isNpcValid && self.active && npc.ShouldFallThroughPlatforms)
fall = true;
orig(self, fall, cPosition, cWidth, cHeight);
}
#endregion
@@ -398,7 +402,7 @@ namespace CalamityMod.ILEditing
cursor.Emit(OpCodes.Ret);
}
private static void AlterTownNPCSpawnRate(Terraria.On_Main.orig_UpdateTime_SpawnTownNPCs orig)
private static void AlterTownNPCSpawnRate(On_Main.orig_UpdateTime_SpawnTownNPCs orig)
{
double oldWorldRate = Main.desiredWorldTilesUpdateRate;
Main.desiredWorldTilesUpdateRate *= CalamityServerConfig.Instance.TownNPCSpawnRateMultiplier;
@@ -483,7 +487,7 @@ namespace CalamityMod.ILEditing
#endregion
#region Custom Gate Door Logic
private static bool OpenDoor_LabDoorOverride(Terraria.On_WorldGen.orig_OpenDoor orig, int i, int j, int direction)
private static bool OpenDoor_LabDoorOverride(On_WorldGen.orig_OpenDoor orig, int i, int j, int direction)
{
Tile tile = Main.tile[i, j];
@@ -499,7 +503,7 @@ namespace CalamityMod.ILEditing
return orig(i, j, direction);
}
private static bool CloseDoor_LabDoorOverride(Terraria.On_WorldGen.orig_CloseDoor orig, int i, int j, bool forced)
private static bool CloseDoor_LabDoorOverride(On_WorldGen.orig_CloseDoor orig, int i, int j, bool forced)
{
Tile tile = Main.tile[i, j];
@@ -516,20 +520,8 @@ namespace CalamityMod.ILEditing
}
#endregion
#region Platform Collision Checks for Grounded Bosses
private static bool EnableCalamityBossPlatformCollision(Terraria.On_NPC.orig_Collision_DecideFallThroughPlatforms orig, NPC self)
{
if ((self.type == ModContent.NPCType<AstrumAureus>() || self.type == ModContent.NPCType<Crabulon>() || self.type == ModContent.NPCType<RavagerBody>() ||
self.type == ModContent.NPCType<RockPillar>() || self.type == ModContent.NPCType<FlamePillar>()) &&
self.target >= 0 && Main.player[self.target].position.Y > self.position.Y + self.height)
return true;
return orig(self);
}
#endregion
#region Incorporate Enchantments in Item Names
private static string IncorporateEnchantmentInAffix(Terraria.On_Item.orig_AffixName orig, Item self)
private static string IncorporateEnchantmentInAffix(On_Item.orig_AffixName orig, Item self)
{
string result = orig(self);
@@ -545,7 +537,7 @@ namespace CalamityMod.ILEditing
#endregion
#region Apply Projectile Variables Upon Creation
private static int IncorporateExtraProjectileVariables(Terraria.On_Projectile.orig_NewProjectile_IEntitySource_float_float_float_float_int_int_float_int_float_float_float orig, IEntitySource spawnSource, float x, float y, float xSpeed, float ySpeed, int type, int damage, float knockback, int owner, float ai0, float ai1, float ai2)
private static int IncorporateExtraProjectileVariables(On_Projectile.orig_NewProjectile_IEntitySource_float_float_float_float_int_int_float_int_float_float_float orig, IEntitySource spawnSource, float x, float y, float xSpeed, float ySpeed, int type, int damage, float knockback, int owner, float ai0, float ai1, float ai2)
{
// This is unfortunately not something that can be done via SetDefaults since owner is set
// after that method is called. Doing it directly when the projectile is spawned appears to be the only reasonable way.
@@ -613,7 +605,7 @@ namespace CalamityMod.ILEditing
#endregion
#region Apply Old Fashioned Damage to Miscellanous Hits
private static void ApplyOldFashionedDamageToMiscHits(Terraria.On_Player.orig_ApplyDamageToNPC orig, Player self, NPC npc, int damage, float knockback, int direction, bool crit = false, DamageClass? damageType = null, bool damageVariation = false)
private static void ApplyOldFashionedDamageToMiscHits(On_Player.orig_ApplyDamageToNPC orig, Player self, NPC npc, int damage, float knockback, int direction, bool crit = false, DamageClass? damageType = null, bool damageVariation = false)
{
if (self.Calamity().oldFashioned)
damage = (int)(damage * OldFashioned.DamageBoostMultiplier);
@@ -699,7 +691,7 @@ namespace CalamityMod.ILEditing
#endregion
#region Fire Cursor Effect for the Calamity Accessory
private static void UseCoolFireCursorEffect(Terraria.On_Main.orig_DrawCursor orig, Vector2 bonus, bool smart)
private static void UseCoolFireCursorEffect(On_Main.orig_DrawCursor orig, Vector2 bonus, bool smart)
{
Player player = Main.LocalPlayer;
@@ -911,7 +903,7 @@ namespace CalamityMod.ILEditing
#endregion
#region General Particle Rendering
private static void DrawFusableParticles(Terraria.On_Main.orig_SortDrawCacheWorms orig, Main self)
private static void DrawFusableParticles(On_Main.orig_SortDrawCacheWorms orig, Main self)
{
DeathAshParticle.DrawAll();
@@ -921,7 +913,7 @@ namespace CalamityMod.ILEditing
orig(self);
}
private static void DrawForegroundParticles(Terraria.On_Main.orig_DrawInfernoRings orig, Main self)
private static void DrawForegroundParticles(On_Main.orig_DrawInfernoRings orig, Main self)
{
GeneralParticleHandler.DrawAllParticles(Main.spriteBatch);
orig(self);
@@ -1483,88 +1475,28 @@ namespace CalamityMod.ILEditing
#endregion
#region Statue Additions
/// <summary>
/// Change the following code sequence in Wiring.HitWireSingle
/// num8 = (int) Utils.SelectRandom<short>(Main.rand, new short[2]
/// {
/// 355,
/// 358
/// });
///
/// to
///
/// var arr = new short[2]
/// {
/// 355,
/// 358
/// });
/// arr = arr.ToList().Add(id).ToArray();
/// num8 = Utils.SelectRandom(Main.rand, arr);
///
/// </summary>
/// <param name="il"></param>
private static void AddTwinklersToStatue(ILContext il)
{
// obtain a cursor positioned before the first instruction of the method
// the cursor is used for navigating and modifying the il
var c = new ILCursor(il);
// Allow Twinklers to be spawned by the Firefly Statue.
var cursor = new ILCursor(il);
// the exact location for this hook is very complex to search for due to the hook instructions not being unique, and buried deep in control flow
// switch statements are sometimes compiled to if-else chains, and debug builds litter the code with no-ops and redundant locals
// in general you want to search using structure and function rather than numerical constants which may change across different versions or compile settings
// using local variable indices is almost always a bad idea
// we can search for
// switch (*)
// case 54:
// Utils.SelectRandom *
// in general you'd want to look for a specific switch variable, or perhaps the containing switch (type) { case 105:
// but the generated IL is really variable and hard to match in this case
// we'll just use the fact that there are no other switch statements with case 54, followed by a SelectRandom
ILLabel[] targets = null;
while (c.TryGotoNext(i => i.MatchSwitch(out targets)))
// Move to the method which randomly selects an NPC for the Statue to spawn. This is the second call of the method in this function.
for (int i = 0; i < 2; i++)
{
// some optimising compilers generate a sub so that all the switch cases start at 0
// ldc.i4.s 51
// sub
// switch
int offset = 0;
if (c.Prev.MatchSub() && c.Prev.Previous.MatchLdcI4(out offset))
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchCall(typeof(Utils), nameof(Utils.SelectRandom))))
{
;
LogFailure("Add Twinkler to Firefly Statue", "Could not move to the SelectRandom method.");
return;
}
// get the label for case 54: if it exists
int case54Index = 54 - offset;
if (case54Index < 0 || case54Index >= targets.Length || !(targets[case54Index] is ILLabel target))
{
continue;
}
// move the cursor to case 54:
c.GotoLabel(target);
// there's lots of extra checks we could add here to make sure we're at the right spot, such as not encountering any branching instructions
c.GotoNext(i => i.MatchCall(typeof(Utils), nameof(Utils.SelectRandom)));
// goto next positions us before the instruction we searched for, so we can insert our array modifying code right here
c.EmitDelegate<Func<short[], short[]>>(arr =>
{
// resize the array and add our custom firefly
Array.Resize(ref arr, arr.Length + 1);
arr[arr.Length - 1] = (short)ModContent.NPCType<Twinkler>();
return arr;
});
// hook applied successfully
return;
}
// couldn't find the right place to insert
throw new Exception("Hook location not found, switch(*) { case 54: ...");
// Emit a delegate which resizes the array and adds Twinkler to it.
cursor.EmitDelegate<Func<short[], short[]>>(arr =>
{
Array.Resize(ref arr, arr.Length + 1);
arr[arr.Length - 1] = (short)ModContent.NPCType<Twinkler>();
return arr;
});
}
#endregion
@@ -1624,7 +1556,7 @@ namespace CalamityMod.ILEditing
/// <summary>
/// Determines if the custom grapple movement should take place or not. Useful for hooks that only do movement tricks in some cases
/// </summary>
private static void CustomGrappleMovementCheck(Terraria.On_Player.orig_GrappleMovement orig, Player self)
private static void CustomGrappleMovementCheck(On_Player.orig_GrappleMovement orig, Player self)
{
WulfrumPackPlayer mp = self.GetModPlayer<WulfrumPackPlayer>();
@@ -1637,7 +1569,7 @@ namespace CalamityMod.ILEditing
/// <summary>
/// This is called right before the game decides wether or not to update the players velocity based on "real" physics (aka not tongued or hooked or with a pulley)
/// </summary>
private static void CustomGrapplePreDefaultMovement(Terraria.On_Player.orig_UpdatePettingAnimal orig, Player self)
private static void CustomGrapplePreDefaultMovement(On_Player.orig_UpdatePettingAnimal orig, Player self)
{
orig(self);
@@ -1661,7 +1593,7 @@ namespace CalamityMod.ILEditing
/// Used before the player steps up a half tile. If we don't do that, players that are grappled but don't use hook movement won't be able to go over tiles.
/// The hook cache is reset in PreUpdateMovement
/// </summary>
private static void CustomGrapplePreStepUp(Terraria.On_Player.orig_SlopeDownMovement orig, Player self)
private static void CustomGrapplePreStepUp(On_Player.orig_SlopeDownMovement orig, Player self)
{
orig(self);
@@ -1675,9 +1607,9 @@ namespace CalamityMod.ILEditing
}
/// <summary>
/// This is done to put the hook if it was cacehd during the frame instruction.
/// This is done to put the hook if it was cached during the frame instruction.
/// </summary>
private static void CustomGrapplePostFrame(Terraria.On_Player.orig_PlayerFrame orig, Player self)
private static void CustomGrapplePostFrame(On_Player.orig_PlayerFrame orig, Player self)
{
orig(self);
WulfrumPackPlayer mp = self.GetModPlayer<WulfrumPackPlayer>();
@@ -1694,7 +1626,7 @@ namespace CalamityMod.ILEditing
#region Find Calamity Item Dye Shader
internal static void FindCalamityItemDyeShader(Terraria.On_Player.orig_UpdateItemDye orig, Player self, bool isNotInVanitySlot, bool isSetToHidden, Item armorItem, Item dyeItem)
internal static void FindCalamityItemDyeShader(On_Player.orig_UpdateItemDye orig, Player self, bool isNotInVanitySlot, bool isSetToHidden, Item armorItem, Item dyeItem)
{
orig(self, isNotInVanitySlot, isSetToHidden, armorItem, dyeItem);
if (armorItem.type == ModContent.ItemType<Calamity>())
@@ -1727,7 +1659,7 @@ namespace CalamityMod.ILEditing
#endregion
#region Custom world selection difficulties
internal static void GetDifficultyOverride(Terraria.GameContent.UI.Elements.On_AWorldListItem.orig_GetDifficulty orig, AWorldListItem self, out string expertText, out Color gameModeColor)
internal static void GetDifficultyOverride(On_AWorldListItem.orig_GetDifficulty orig, AWorldListItem self, out string expertText, out Color gameModeColor)
{
// Run the original code and pull out the original text and text color
orig(self, out expertText, out gameModeColor);
@@ -1762,7 +1694,7 @@ namespace CalamityMod.ILEditing
#endregion
#region Shimmer effect edits
public static void ShimmerEffectEdits(Terraria.On_Item.orig_GetShimmered orig, Item self)
public static void ShimmerEffectEdits(On_Item.orig_GetShimmered orig, Item self)
{
// Make Plagued Containment Bricks turn into Plagued Nanodroids if shimmered before defeating Golem
if (self.type == ModContent.ItemType<PlaguedContainmentBrick>())
@@ -1805,7 +1737,7 @@ namespace CalamityMod.ILEditing
#region Block Abyss from Teleportation Potions
public static void TPOverride(Terraria.On_Player.orig_Teleport orig, Player self, Vector2 newPos, int Style = 0, int extraInfo = 0)
public static void TPOverride(On_Player.orig_Teleport orig, Player self, Vector2 newPos, int Style = 0, int extraInfo = 0)
{
// Grab the tile from where the potion wants to teleport
Tile t = CalamityUtils.ParanoidTileRetrieval(newPos.ToTileCoordinates().X, newPos.ToTileCoordinates().Y);
@@ -1849,67 +1781,6 @@ namespace CalamityMod.ILEditing
}
#endregion
#region Revengeance Master Mode Twins Shenanigans
public static void TripletsSpawnTextOverride(Terraria.On_NPC.orig_SpawnBoss orig, int x, int y, int type, int targetPlayerIndex)
{
if (CalamityWorld.death && type == NPCID.Retinazer)
{
int retinazerIndex = NPC.NewNPC(NPC.GetBossSpawnSource(targetPlayerIndex), x, y, type, 1);
if (retinazerIndex == 200)
{
return;
}
Main.npc[retinazerIndex].target = targetPlayerIndex;
Main.npc[retinazerIndex].timeLeft *= 20;
if (Main.dedServ && retinazerIndex < 200)
{
NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, retinazerIndex);
}
AchievementsHelper.CheckMechaMayhem();
CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Status.Boss.TripletsBossText", new Color(175, 75, 255));
return;
}
else
{
orig(x, y, type, targetPlayerIndex);
}
}
public static void PreventFoveanatorDefeatMessageIfNotKilledLast(On_NPC.orig_DoDeathEvents_BeforeLoot orig, NPC self, Player closestPlayer)
{
if (CalamityWorld.death && self.type == ModContent.NPCType<Foveanator>() && (NPC.AnyNPCs(NPCID.Spazmatism) || NPC.AnyNPCs(NPCID.Retinazer)))
{
self.value = 0f;
self.boss = false;
return;
}
else
{
orig(self, closestPlayer);
}
}
public static void TripletsDefeatTextOverride(On_NPC.orig_DoDeathEvents_CelebrateBossDeath orig, NPC self, string typeName)
{
bool correctNPCType = self.type == NPCID.Retinazer || self.type == NPCID.Spazmatism || self.type == ModContent.NPCType<Foveanator>();
if (CalamityWorld.death && correctNPCType)
{
if (Main.netMode == NetmodeID.SinglePlayer)
Main.NewText(Language.GetTextValue("Announcement.HasBeenDefeated_Plural", CalamityUtils.GetTextValue("Status.Boss.TripletsDefeatName")), 175, 75, 255);
else if (Main.dedServ)
ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasBeenDefeated_Plural", NetworkText.FromKey("Mods.CalamityMod.Status.Boss.TripletsDefeatName")), new Color(175, 75, 255));
return;
}
else
{
orig(self, typeName);
}
}
#endregion
#region Optimized GlowMask Rendering on Tile
private static void GlowMaskTileRender(On_TileDrawing.orig_DrawSingleTile orig, TileDrawing self, TileDrawInfo drawData, bool solidLayer, int waterStyleOverride, Vector2 screenPosition, Vector2 screenOffset, int tileX, int tileY)
{
@@ -1974,7 +1845,7 @@ namespace CalamityMod.ILEditing
#endregion
#region Allow Cannons to use jellyfish
public static void AllowCannonJellyfishUse(Terraria.On_Player.orig_PlaceThing_CannonBall orig, Player self)
public static void AllowCannonJellyfishUse(On_Player.orig_PlaceThing_CannonBall orig, Player self)
{
// Check if the player is holding a jelly
if (self.HeldItem.type == ModContent.ItemType<BabyCannonballJellyfishItem>())
@@ -2085,7 +1956,7 @@ namespace CalamityMod.ILEditing
#endregion
#region Add Stohne to the Jungle
public static void AddStohne(Terraria.GameContent.Biomes.On_JunglePass.orig_GenerateFinishingTouches orig, JunglePass self, GenerationProgress progress, int oldX, int oldY)
public static void AddStohne(On_JunglePass.orig_GenerateFinishingTouches orig, JunglePass self, GenerationProgress progress, int oldX, int oldY)
{
int anchorX = oldX;
int anchorY = oldY;
@@ -2629,7 +2500,7 @@ namespace CalamityMod.ILEditing
#endregion
#region Make Celestial Onion give the Master Mode slot
public static bool MasterModeCelestialOnionCheck(Terraria.On_Player.orig_IsItemSlotUnlockedAndUsable orig, Player self, int slot)
public static bool MasterModeCelestialOnionCheck(On_Player.orig_IsItemSlotUnlockedAndUsable orig, Player self, int slot)
{
if ((slot == 9 || slot == 19) && self.Calamity().extraAccessoryML && !Main.gameMenu)
{
+49 -15
View File
@@ -9,6 +9,7 @@ using CalamityMod.NPCs.AcidRain;
using CalamityMod.NPCs.NormalNPCs;
using CalamityMod.NPCs.TownNPCs;
using CalamityMod.Walls;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Mono.Cecil.Cil;
using MonoMod.Cil;
@@ -17,7 +18,7 @@ using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.GameContent.Drawing;
using Terraria.GameContent.Personalities;
using Terraria.GameContent.ItemDropRules;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Graphics.Effects;
@@ -153,7 +154,7 @@ namespace CalamityMod.ILEditing
#endregion
#region Prevention of Slime Rain Spawns When Near Bosses
private static void PreventBossSlimeRainSpawns(Terraria.On_NPC.orig_SlimeRainSpawns orig, int plr)
private static void PreventBossSlimeRainSpawns(On_NPC.orig_SlimeRainSpawns orig, int plr)
{
if (!Main.player[plr].Calamity().isNearbyBoss && CalamityServerConfig.Instance.BossZen)
orig(plr);
@@ -174,12 +175,47 @@ namespace CalamityMod.ILEditing
}
// Remove the Expert Mode check, and in its place put a check for the Zenith seed (Get fixed boi).
// Note from CIT: I originally removed these entirely;
cursor.Emit(OpCodes.Pop);
cursor.Emit(OpCodes.Ldsfld, typeof(Main).GetField("zenithWorld"));
}
#endregion
#region Disable Detonating Bubble StrikeNPC Hardcoded Override
private static void LetDetonatingBubblesTakeDamage(ILContext il)
{
// In vanilla's StrikeNPC function, Detonating Bubbles have a hardcoded type check which sets the damage of the strike to 0.
// This IL edit disables that type check in Death Mode.
var cursor = new ILCursor(il);
// Go to the point after the check for the Detonating Bubble NPC ID.
if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdcR8(0.0)))
{
LogFailure("Let Detonating Bubbles Take Damage in Death", "Could not move after the NPC type check.");
return;
}
// Define the label.
var label = il.DefineLabel();
// Add a branch if it is Death Mode.
cursor.Emit(OpCodes.Ldsfld, typeof(CalamityWorld).GetField("death"));
cursor.Emit(OpCodes.Brtrue, label);
// Move to the point after Detonating Bubble changes are implemented to place the branch label.
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchStfld<NPC>("dontTakeDamage")))
{
LogFailure("Let Detonating Bubbles Take Damage in Death", "Could not move to after the Detonating Bubble logic.");
return;
}
if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdarg0()))
{
LogFailure("Let Detonating Bubbles Take Damage in Death", "Could not move to after the Detonating Bubble logic.");
return;
}
cursor.MarkLabel(label);
}
#endregion
#region Make Meteorite Explodable
private static void MakeMeteoriteExplodable(ILContext il)
{
@@ -271,13 +307,15 @@ namespace CalamityMod.ILEditing
LogFailure("Prevent Fossil Shattering", "Could not locate the Desert Fossil Tile ID variable.");
return;
}
// Remove this value and replace it with a large number that will never be a valid tile ID.
cursor.Remove();
cursor.Emit(OpCodes.Ldc_I4, TileID.PixelBox); // Change to Pixel Box because it cannot be obtained in-game without cheating.
cursor.Emit(OpCodes.Ldc_I4, 40000);
}
#endregion
#region Remove Hellforge Pickaxe Requirement
private static int RemoveHellforgePickaxeRequirement(Terraria.On_Player.orig_GetPickaxeDamage orig, Player self, int x, int y, int pickPower, int hitBufferIndex, Tile tileTarget)
private static int RemoveHellforgePickaxeRequirement(On_Player.orig_GetPickaxeDamage orig, Player self, int x, int y, int pickPower, int hitBufferIndex, Tile tileTarget)
{
if (tileTarget.TileType == TileID.Hellforge)
pickPower = 65;
@@ -295,10 +333,6 @@ namespace CalamityMod.ILEditing
}
#endregion
#region Fix Chlorophyte Crystal Attacking Where it Shouldn't
// TODO -- Finish this
#endregion Fix Chlorophyte Crystal Attacking Where it Shouldn't
#region Prevent UFO Mount from Dismounting in Water
private static void PreventUFODismountInWater(ILContext il)
{
@@ -331,7 +365,7 @@ namespace CalamityMod.ILEditing
#endregion Prevent UFO Mount from Dismounting in Water
#region Color Blighted Gel
private static void ColorBlightedGel(Terraria.GameContent.ItemDropRules.On_CommonCode.orig_ModifyItemDropFromNPC orig, NPC npc, int itemIndex)
private static void ColorBlightedGel(On_CommonCode.orig_ModifyItemDropFromNPC orig, NPC npc, int itemIndex)
{
orig(npc, itemIndex);
@@ -357,7 +391,7 @@ namespace CalamityMod.ILEditing
#endregion Color Blighted Gel
#region Improve Angler Quest Rewards
private static void ImproveAnglerRewards(Terraria.On_Player.orig_GetAnglerReward orig, Player self, NPC angler, int questItemType)
private static void ImproveAnglerRewards(On_Player.orig_GetAnglerReward orig, Player self, NPC angler, int questItemType)
{
orig(self, angler, questItemType);
@@ -1046,7 +1080,7 @@ namespace CalamityMod.ILEditing
var cursor = new ILCursor(il);
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdfld<Player>("magmaStone"))) // Flag for if Magma Stone is equipped. Fire Gauntlet also uses this.
{
LogFailure("Make Magma Stone & Fire Gauntlet Dust Toggleable", "Could not locate the magma stone variable.");
LogFailure("Make Magma Stone & Fire Gauntlet Dust Toggleable", "Could not locate the Magma Stone variable.");
return;
}
// Load the player itself onto the stack so that it becomes an argument for the following delegate.
@@ -1091,7 +1125,7 @@ namespace CalamityMod.ILEditing
}
// Remove the instruction and replace with 1 (true). This effectively removes the requirement for defeating Plantera.
// The only requirements for summoning Golems with Power Cells are now: 1) Golem is not alive, and 2) The world is in Hardmode.
// The only requirements for summoning Golem with Power Cells are now: 1) Golem is not alive, and 2) The world is in Hardmode.
cursor.EmitPop();
cursor.Emit(OpCodes.Ldc_I4_1);
}
@@ -1144,7 +1178,7 @@ namespace CalamityMod.ILEditing
return;
}
// branch is used for exit condition. So setting ble.s opcode to nop will remove the condition
// Branch is used for exit condition. So setting ble.s opcode to nop will remove the condition
cursor.Prev.OpCode = OpCodes.Nop;
// After that we pop NPC.damage and 0 from stack
@@ -1188,7 +1222,7 @@ namespace CalamityMod.ILEditing
}*/
#endregion
#region Allow disabling gravity swap visual && allow gravity keybind
#region Allow Disabling Gravity Swap Visual and Allow Gravity Keybind
private static void DelayGravity(On_Player.orig_UpdateControlHolds orig, Player Player)
{
var cplay = Player.Calamity();
+4 -29
View File
@@ -8,6 +8,7 @@ using MonoMod.Cil;
using Terraria;
using Terraria.GameContent.UI.States;
using Terraria.ID;
using Terraria.IO;
using Terraria.WorldBuilding;
namespace CalamityMod.ILEditing
@@ -33,28 +34,6 @@ namespace CalamityMod.ILEditing
set;
}
#region Replacement of Pharaoh Set in Pyramids
// Note: There is no need to replace the other Pharaoh piece, due to how the vanilla code works.
// The other Pharaoh vanity piece is added automatically if the mask is found in the chest.
private static void ReplacePharaohSetInPyramids(ILContext il)
{
var cursor = new ILCursor(il);
// Find the instruction which loads in the item ID of the Pharaoh's Mask.
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcI4(ItemID.PharaohsMask)))
{
LogFailure("Pharaoh Set Pyramid Replacement", "Could not locate the Pharaoh's Mask item ID.");
return;
}
// Replace the Pharaoh's Mask with the Amber Hook.
// THIS INT CAST IS MANDATORY. DO NOT REMOVE IT.
// In TML's DLL, despite item IDs being shorts (16 bits), the hardcoded 848 here is a 32-bit integer literal.
// As such, it must be replaced with a 32-bit integer literal or the branches of the switch will misalign and the IL edit fails.
cursor.Next.Operand = (int)ItemID.AmberHook;
}
#endregion Replacement of Pharaoh Set in Pyramids
#region Fixing of Living Tree/Sulphurous Sea Interactions
private static void BlockLivingTreesNearOcean(ILContext il)
{
@@ -66,7 +45,7 @@ namespace CalamityMod.ILEditing
#endregion Fixing of Living Tree/Sulphurous Sea Interactions
#region Removal of Hardmode Ore Generation from Evil Altars
private static void PreventSmashAltarCode(Terraria.On_WorldGen.orig_SmashAltar orig, int i, int j)
private static void PreventSmashAltarCode(On_WorldGen.orig_SmashAltar orig, int i, int j)
{
if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework)
return;
@@ -135,10 +114,8 @@ namespace CalamityMod.ILEditing
return;
}
// Pop original value off.
// Pop original value off. Push '2' to the stack.
c.Emit(OpCodes.Pop);
// Push '2' to the stack.
c.Emit(OpCodes.Ldc_I4_2);
// OBJECTIVE 2
@@ -181,13 +158,11 @@ namespace CalamityMod.ILEditing
// Emit our new string "Mods.CalamityMod.UI.SmallWorldWarning".
c.Emit(OpCodes.Ldstr, "Mods.CalamityMod.UI.SmallWorldWarning");
}
#endregion
#region Clear temporary modded tiles
private static void ClearModdedTempTiles(Terraria.IO.On_WorldFile.orig_ClearTempTiles orig)
private static void ClearModdedTempTiles(On_WorldFile.orig_ClearTempTiles orig)
{
orig();
+14 -38
View File
@@ -1,30 +1,29 @@
using CalamityMod.CalPlayer;
using CalamityMod.Items.BaseItems;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
public class AbyssalDivingSuit : ModItem, ILocalizedModType
public class AbyssalDivingSuit : TransformationAccessory, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public static double PlatesAllDamageReduction = 0.15D;
public static double PlatesHitDecay = 0.03D;
public override void Load()
{
// All code below runs only if we're not loading on a server
if (!Main.dedServ)
{
// Add equip textures
EquipLoader.AddEquipTexture(Mod, $"{Texture}_{EquipType.Head}", EquipType.Head, this);
EquipLoader.AddEquipTexture(Mod, $"{Texture}_{EquipType.Body}", EquipType.Body, this);
EquipLoader.AddEquipTexture(Mod, $"{Texture}_{EquipType.Legs}", EquipType.Legs, this);
}
}
public override string AssetPath => "CalamityMod/Items/Accessories/";
public override (EquipType, string, string)[] EquipSlots =>
[
(EquipType.Head, "AbyssalDivingSuit", null),
(EquipType.Body, "AbyssalDivingSuit", null),
(EquipType.Legs, "AbyssalDivingSuit", null),
(EquipType.Face, null, null), //results in setting this equip slot to -1
];
public override (SoundStyle sound, int delay)? HurtSound(Player p) => (SoundID.NPCHit4, 10);
public override void SetDefaults()
{
@@ -33,32 +32,9 @@ namespace CalamityMod.Items.Accessories
Item.accessory = true;
Item.value = CalamityGlobalItem.RarityPurpleBuyPrice;
Item.rare = ItemRarityID.Purple;
if (!Main.dedServ)
{
int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head);
int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body);
int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs);
ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false;
ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true;
ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true;
ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true;
}
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.abyssalDivingSuit = true;
if (hideVisual)
modPlayer.abyssalDivingSuitHide = true;
}
public override void UpdateVanity(Player player)
{
player.Calamity().abyssalDivingSuitHide = false;
player.Calamity().abyssalDivingSuitForce = true;
}
public override void UpdateAccessory(Player player, bool hideVisual) => player.Calamity().abyssalDivingSuit = true;
public override void AddRecipes()
{
+14 -41
View File
@@ -1,45 +1,30 @@
using System;
using System.Collections.Generic;
using CalamityMod.CalPlayer;
using System.Collections.Generic;
using CalamityMod.Items.BaseItems;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
[LegacyName("SirensHeart")]
public class AquaticHeart : ModItem, ILocalizedModType
public class AquaticHeart : TransformationAccessory, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public static float WaterSpeedBoost = 0.15f;
public static double IceShieldAllDamageReduction = 0.2D;
public override void Load()
{
// All code below runs only if we're not loading on a server
if (!Main.dedServ)
{
// Add equip textures
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/AquaticTrans_Head", EquipType.Head, this);
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/AquaticTrans_Body", EquipType.Body, this);
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/AquaticTrans_Legs", EquipType.Legs, this);
}
}
public override string AssetPath => "CalamityMod/Items/Accessories/";
public override (EquipType, string, string)[] EquipSlots =>
[
(EquipType.Head, "AquaticTrans", null),
(EquipType.Body, "AquaticTrans", null),
(EquipType.Legs, "AquaticTrans", null),
(EquipType.Face, null, null), //results in setting this equip slot to -1
];
public override void SetStaticDefaults()
{
if (!Main.dedServ)
{
int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head);
int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body);
int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs);
ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false;
ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true;
ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true;
ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true;
}
}
public override (SoundStyle sound, int delay)? HurtSound(Player p) => (SoundID.FemaleHit, 10);
public override void SetDefaults()
{
@@ -50,19 +35,7 @@ namespace CalamityMod.Items.Accessories
Item.rare = ItemRarityID.LightRed;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.aquaticHeart = true;
if (hideVisual)
modPlayer.aquaticHeartHide = true;
}
public override void UpdateVanity(Player player)
{
player.Calamity().aquaticHeartHide = false;
player.Calamity().aquaticHeartForce = true;
}
public override void UpdateAccessory(Player player, bool hideVisual) => player.Calamity().aquaticHeart = true;
public override void ModifyTooltips(List<TooltipLine> tooltips)
{
+1 -1
View File
@@ -31,7 +31,7 @@ namespace CalamityMod.Items.Accessories
Item.width = 60;
Item.height = 54;
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
Item.defense = 12;
Item.defense = 6;
Item.accessory = true;
Item.rare = ModContent.RarityType<CosmicPurple>();
}
+1 -1
View File
@@ -26,7 +26,7 @@ namespace CalamityMod.Items.Accessories
Item.height = 48;
Item.value = CalamityGlobalItem.RarityLimeBuyPrice;
Item.rare = ItemRarityID.Lime;
Item.defense = 8; // we buff Ankh Shield to 8
Item.defense = 4;
Item.accessory = true;
}
-10
View File
@@ -24,15 +24,5 @@ namespace CalamityMod.Items.Accessories
CalamityPlayer modPlayer = player.Calamity();
modPlayer.bloodyGlove = true;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient(ItemID.CrimtaneBar, 2).
AddIngredient<BloodSample>(6).
AddIngredient(ItemID.Vertebrae, 2).
AddTile(TileID.DemonAltar).
Register();
}
}
}
+1 -1
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories
{
Item.width = 26;
Item.height = 42;
Item.defense = 7;
Item.defense = 3;
Item.value = CalamityGlobalItem.RarityLightRedBuyPrice;
Item.rare = ItemRarityID.LightRed;
Item.accessory = true;
+1 -1
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories
{
Item.width = 12;
Item.height = 15;
Item.defense = 7;
Item.defense = 3;
Item.value = CalamityGlobalItem.RarityOrangeBuyPrice;
Item.rare = ItemRarityID.Orange;
Item.accessory = true;
-1
View File
@@ -16,7 +16,6 @@ namespace CalamityMod.Items.Accessories
Item.height = 46;
Item.value = CalamityGlobalItem.RarityPinkBuyPrice;
Item.rare = ItemRarityID.Pink;
Item.defense = 4;
Item.accessory = true;
}
+1 -1
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories
{
Item.width = 26;
Item.height = 26;
Item.defense = 4;
Item.defense = 1;
Item.value = CalamityGlobalItem.RarityBlueBuyPrice;
Item.rare = ItemRarityID.Blue;
Item.accessory = true;
+1 -1
View File
@@ -29,7 +29,7 @@ namespace CalamityMod.Items.Accessories
Item.width = 42;
Item.height = 60;
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
Item.defense = 10;
Item.defense = 4;
Item.lifeRegen = 1;
Item.accessory = true;
Item.rare = ModContent.RarityType<CosmicPurple>();
+1 -1
View File
@@ -42,7 +42,7 @@ namespace CalamityMod.Items.Accessories
Item.width = 52;
Item.height = 68;
Item.accessory = true;
Item.defense = 48;
Item.defense = 20;
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
Item.rare = ModContent.RarityType<BurnishedAuric>();
}
+1 -1
View File
@@ -29,7 +29,7 @@ namespace CalamityMod.Items.Accessories
Item.height = 42;
Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
Item.rare = ModContent.RarityType<Turquoise>();
Item.defense = 10;
Item.defense = 5;
Item.accessory = true;
}
+1 -1
View File
@@ -31,7 +31,7 @@ namespace CalamityMod.Items.Accessories
player.statManaMax2 += 150;
player.GetDamage<MagicDamageClass>() += 0.15f;
player.manaCost *= 0.9f;
player.manaCost -= 0.1f;
player.GetCritChance<MagicDamageClass>() += 5;
}
-10
View File
@@ -24,15 +24,5 @@ namespace CalamityMod.Items.Accessories
CalamityPlayer modPlayer = player.Calamity();
modPlayer.filthyGlove = true;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient(ItemID.DemoniteBar, 2).
AddIngredient<RottenMatter>(6).
AddIngredient(ItemID.RottenChunk, 2).
AddTile(TileID.DemonAltar).
Register();
}
}
}
+1 -1
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories
{
Item.width = 30;
Item.height = 28;
Item.defense = 6;
Item.defense = 5;
Item.value = CalamityGlobalItem.RarityBlueBuyPrice;
Item.rare = ItemRarityID.Blue;
Item.accessory = true;
+1 -1
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories
{
Item.width = 46;
Item.height = 30;
Item.defense = 15;
Item.defense = 10;
Item.value = CalamityGlobalItem.RarityLightRedBuyPrice;
Item.rare = ItemRarityID.LightRed;
Item.accessory = true;
+1 -1
View File
@@ -23,7 +23,7 @@ namespace CalamityMod.Items.Accessories
CalamityPlayer modPlayer = player.Calamity();
modPlayer.gloveOfPrecision = true;
player.GetDamage<RogueDamageClass>() += 0.10f;
player.GetCritChance<RogueDamageClass>() += 15;
player.GetCritChance<RogueDamageClass>() += 10;
modPlayer.rogueVelocity += 0.15f;
player.GetAttackSpeed<RogueDamageClass>() -= 0.15f;
}
+1 -1
View File
@@ -9,7 +9,7 @@ namespace CalamityMod.Items.Accessories
public new string LocalizationCategory => "Items.Accessories";
public static int RegenBoost = 3;
public static int DefenseBoost = 8;
public static int DefenseBoost = 4;
public static float DamageReductionBoost = 0.04f;
public static float SummonDamageBoost = 0.1f;
+1 -1
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.statLifeMax2 += 30;
player.statLifeMax2 += 10;
CalamityPlayer modPlayer = player.Calamity();
modPlayer.alwaysHoneyRegen = true;
modPlayer.honeyTurboRegen = true;
+1 -1
View File
@@ -15,7 +15,7 @@ namespace CalamityMod.Items.Accessories
{
Item.width = 26;
Item.height = 26;
Item.defense = 6;
Item.defense = 4;
Item.value = CalamityGlobalItem.RarityLimeBuyPrice;
Item.rare = ItemRarityID.Lime;
Item.accessory = true;
+3
View File
@@ -21,6 +21,9 @@ namespace CalamityMod.Items.Accessories
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.inkBomb = true;
modPlayer.rogueStealthMax += 0.1f;
player.Calamity().stealthGenStandstill += 0.07f;
player.Calamity().stealthGenMoving += 0.07f;
}
}
}
+1 -1
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.statLifeMax2 += 50;
player.statLifeMax2 += 25;
// Inherits all effects of Honey Dew
CalamityPlayer modPlayer = player.Calamity();
+1 -1
View File
@@ -27,7 +27,7 @@ namespace CalamityMod.Items.Accessories
Item.rare = ItemRarityID.Blue;
Item.value = CalamityGlobalItem.RarityBlueBuyPrice;
Item.accessory = true;
Item.defense = 4;
Item.defense = 3;
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1
View File
@@ -10,6 +10,7 @@ namespace CalamityMod.Items.Accessories
{
public class Nanotech : ModItem, ILocalizedModType
{
//The stealth damage boost is handled in CalamityPlayer for some reason, maybe someone didn't want em to stack?
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
{
+1 -1
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories
Item.height = 32;
Item.value = CalamityGlobalItem.RarityPinkBuyPrice;
Item.rare = ItemRarityID.Pink;
Item.defense = 4; // This has a ram dash, it should give a bit less defense due to how good it is
Item.defense = 2; // This has a ram dash, it should give a bit less defense due to how good it is
Item.accessory = true;
}
+130 -37
View File
@@ -5,7 +5,9 @@ using CalamityMod.Buffs.StatBuffs;
using CalamityMod.Buffs.Summon.Whips;
using CalamityMod.CalPlayer;
using CalamityMod.DataStructures;
using CalamityMod.Items.BaseItems;
using CalamityMod.Items.Materials;
using CalamityMod.NPCs.ProfanedGuardians;
using CalamityMod.NPCs.Providence;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Summon;
@@ -23,10 +25,10 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
//Developer item, dedicatee: Mishiro Usui/Amber Sienna
public class ProfanedSoulCrystal : ModItem, ILocalizedModType, IDyeableShaderRenderer
public class ProfanedSoulCrystal : TransformationAccessory, ILocalizedModType, IDyeableShaderRenderer
{
public static string[] contributorNames = new[] { "IbanPlay", "Chen", "Nincity", "Amber", "Mishiro", "LordMetarex", "Memes" };
public static int ShieldDurabilityMax = 125;
public static int ShieldDurabilityMax = 100;
public new string LocalizationCategory => "Items.Accessories";
public static int ShieldRechargeDelay = CalamityUtils.SecondsToFrames(5);
@@ -104,7 +106,7 @@ namespace CalamityMod.Items.Accessories
if (ignoreNoBuffs &&
(!DownedBossSystem.downedCalamitas || !DownedBossSystem.downedExoMechs ||
(player.maxMinions - player.slotsMinions) < maxMinionRequirement) ||
player.Calamity().profanedCrystalForce || !player.HasBuff<ProfanedCrystalBuff>())
player.Transformation().Type == ModContent.ItemType<ProfanedSoulCrystal>() || !player.HasBuff<ProfanedCrystalBuff>())
{
return ProfanedSoulCrystalState.Vanity; //failsafe for vanity
}
@@ -178,28 +180,22 @@ namespace CalamityMod.Items.Accessories
* Projectiles transformed are ONLY affected by alldamage and summon damage bonuses, likewise the weapon's base damage/usetime is NOT taken into account.
* The on-hit effect for the whip is in globalnpc
*/
public override void Load()
public override string AssetPath => "CalamityMod/Items/Accessories/";
public override (EquipType Type, string AssetName, string EquipName)[] EquipSlots =>
[
(EquipType.Head, "ProfanedSoulTrans", null),
(EquipType.Body, "ProfanedSoulTrans", null),
(EquipType.Legs, "ProfanedSoulTrans", null),
(EquipType.Wings, "ProfanedSoulTrans", null),
(EquipType.Head, "ProfanedSoulTransNight", "PscNightHead"),
(EquipType.Legs, "ProfanedSoulTransNight", "PscNightLegs"),
(EquipType.Wings, "ProfanedSoulTransNight", "PscNightWings"),
(EquipType.Face, null, null), //results in setting this equip slot to -1
];
public override void ArmorIDSets()
{
if (Main.dedServ)
return;
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/ProfanedSoulTransHead", EquipType.Head, this);
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/ProfanedSoulTransHeadNight", EquipType.Head, this, "PscNightHead");
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/ProfanedSoulTransBody", EquipType.Body, this);
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/ProfanedSoulTransLegs", EquipType.Legs, this);
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/ProfanedSoulTransLegsNight", EquipType.Legs, this, "PscNightLegs");
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Wings/ProfanedSoulTransWings", EquipType.Wings, this);
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Wings/ProfanedSoulTransWingsNight", EquipType.Wings, this, "PscNightWings");
}
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(8, 4));
ItemID.Sets.AnimatesAsSoul[Type] = true;
if (Main.dedServ)
return;
int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body);
ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true;
ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true;
@@ -213,6 +209,16 @@ namespace CalamityMod.Items.Accessories
ArmorIDs.Legs.Sets.OverridesLegs[equipSlotNightLegs] = true;
}
public override (SoundStyle sound, int delay)? HurtSound(Player p) => (p.Calamity().pSoulShieldDurability > 0 ? ProfanedGuardianDefender.ShieldDeathSound : Providence.HurtSound, 20);
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(8, 4));
ItemID.Sets.AnimatesAsSoul[Type] = true;
base.SetStaticDefaults();
}
public override void SetDefaults()
{
SummonTag.TagItem = Item.type;
@@ -225,10 +231,7 @@ namespace CalamityMod.Items.Accessories
Item.Calamity().devItem = true;
}
public override bool CanAccessoryBeEquippedWith(Item equippedItem, Item incomingItem, Player player)
{
return incomingItem.type != ModContent.ItemType<ProfanedSoulArtifact>();
}
public override bool CanAccessoryBeEquippedWith(Item equippedItem, Item incomingItem, Player player) => incomingItem.type != ModContent.ItemType<ProfanedSoulArtifact>();
public override void ModifyTooltips(List<TooltipLine> tooltips)
{
@@ -260,12 +263,30 @@ namespace CalamityMod.Items.Accessories
}
}
public override bool CustomSetEquipType(Player player, EquipType type, Mod mod, string name)
{
switch (type)
{
case EquipType.Legs:
player.legs = EquipLoader.GetEquipSlot(Mod, Main.dayTime ? "ProfanedSoulCrystal" : "PscNightLegs", type);
return true;
case EquipType.Head:
player.head = EquipLoader.GetEquipSlot(Mod, Main.dayTime ? "ProfanedSoulCrystal" : "PscNightHead", type);
return true;
case EquipType.Wings:
player.wings = EquipLoader.GetEquipSlot(Mod, Main.dayTime ? "ProfanedSoulCrystal" : "PscNightWings", type);
return true;
}
return false;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.pSoulArtifact = true;
modPlayer.profanedCrystal = true;
if (!modPlayer.profanedCrystalPrevious && player.ownedProjectileCounts[ModContent.ProjectileType<PscTransformAnimation>()] == 0)
{
modPlayer.pSoulShieldDurability = 1;
@@ -275,23 +296,15 @@ namespace CalamityMod.Items.Accessories
if (DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs)
player.Calamity().profanedSoulRelicBuff = true;
modPlayer.profanedCrystalHide = hideVisual || modPlayer.profanedCrystalAnim > 0;
modPlayer.pSoulShieldVisible = !hideVisual;
DetermineTransformationEligibility(player);
}
public override void UpdateVanity(Player player)
{
player.Calamity().profanedCrystalHide = false;
player.Calamity().profanedCrystalForce = true;
}
internal static void DetermineTransformationEligibility(Player player)
{
//short circuit immediately if profanedcrystalbuffs has already been set
if (!player.Calamity().profanedCrystalBuffs && player.Calamity().profanedCrystalAnim == -1 && DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs && (player.maxMinions - player.slotsMinions) >= maxMinionRequirement && !player.Calamity().profanedCrystalForce && player.HasBuff<ProfanedCrystalBuff>())
if (!player.Calamity().profanedCrystalBuffs && player.Calamity().profanedCrystalAnim == -1 && DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs && (player.maxMinions - player.slotsMinions) >= maxMinionRequirement && player.HasBuff<ProfanedCrystalBuff>())
{
player.Calamity().profanedCrystalBuffs = true;
player.Calamity().pscState = (int)GetPscStateFor(player); //update psc state, default is 0 which is the same as the int value of vanity
@@ -535,6 +548,86 @@ namespace CalamityMod.Items.Accessories
return false;
}
public override void TransformFrameEffects(Player player)
{
bool enrage = player.Calamity().pscState >= (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Enraged;
if (profanedCrystalWingCounter.Value == 0)
{
int key = profanedCrystalWingCounter.Key;
profanedCrystalWingCounter = new KeyValuePair<int, int>(key == 3 ? 0 : key + 1, enrage ? 5 : 8);
}
player.wingFrame = profanedCrystalWingCounter.Key;
profanedCrystalWingCounter = new KeyValuePair<int, int>(profanedCrystalWingCounter.Key, profanedCrystalWingCounter.Value - 1);
player.armorEffectDrawOutlines = true;
if (player.Calamity().profanedCrystalBuffs)
{
player.armorEffectDrawShadow = true;
if (enrage)
{
player.armorEffectDrawOutlinesForbidden = true;
}
}
}
public KeyValuePair<int, int> profanedCrystalWingCounter = new KeyValuePair<int, int>(1, 10);
public KeyValuePair<int, int> profanedCrystalAnimCounter = new KeyValuePair<int, int>(0, 10);
private bool IsValidTransitionFrame(AnimationType currentAnim, AnimationType newAnim, int frame, int counter) //this exists so it doesn't loop through the entire walk/idle anim just to find one frame for switching.
{
bool result = newAnim != AnimationType.Jump && currentAnim != AnimationType.Jump;
if (currentAnim == AnimationType.Walk && newAnim == AnimationType.Idle)
{
result = counter <= 0 && (frame == 11 || frame == 15 || frame == 19);
}
else if (currentAnim == AnimationType.Idle && newAnim == AnimationType.Walk)
{
result = counter <= 0 && (frame == 2 || frame == 6);
}
return currentAnim != newAnim && result; //swapping to jumps should be instant, no need to check the counter here
}
private int HandlePSCAnimationFrames(Player player, AnimationType newType)
{
int key = profanedCrystalAnimCounter.Key; //0-based indexing
int value = profanedCrystalAnimCounter.Value - 1;
AnimationType currentType = key < 8 ? AnimationType.Idle : key == 8 ? AnimationType.Jump : AnimationType.Walk;
bool isInvalidTransFrame = !IsValidTransitionFrame(currentType, newType, key, value); //to make the transition between walk and idle frames less jarring and smoother
AnimationType type = isInvalidTransFrame ? newType : currentType;
int frameCount = type == AnimationType.Walk || (player.Calamity().profanedCrystal && player.statLife <= (int)(player.statLifeMax2 * 0.5)) ? 7 : 10;
int lowerRange = type == AnimationType.Idle ? 0 : type == AnimationType.Jump ? 8 : 9;
int upperRange = type == AnimationType.Idle ? 7 : type == AnimationType.Jump ? 8 : 22;
if (value <= 0 || !isInvalidTransFrame)
{
value = frameCount;
if (key >= lowerRange && key < upperRange)
key++;
else
key = lowerRange;
}
profanedCrystalAnimCounter = new KeyValuePair<int, int>(key, value);
return profanedCrystalAnimCounter.Key;
}
public override void TransformPostUpdate(Player player)
{
bool validEquipSlot = player.legs == EquipLoader.GetEquipSlot(Mod, "ProfanedSoulCrystal", EquipType.Legs) ||
player.legs == EquipLoader.GetEquipSlot(Mod, "PscNightLegs", EquipType.Legs);
if (player.Transformation().Type == ModContent.ItemType<ProfanedSoulCrystal>() && validEquipSlot)
{
bool usingCarpet = player.carpetTime > 0 && player.controlJump; //doesn't make sense for carpet to use jump frame since you have solid ground
AnimationType animType = AnimationType.Walk;
if ((player.sliding || player.velocity.Y != 0 || player.mount.Active || (player.grappling[0] != -1 || !player.CheckSolidGround()) || player.GoingDownWithGrapple) && !usingCarpet)
animType = AnimationType.Jump;
else if (player.velocity.X == 0 || usingCarpet)
animType = AnimationType.Idle;
int frame = HandlePSCAnimationFrames(player, animType);
player.legFrame.Y = player.legFrame.Height * frame;
}
}
public override void AddRecipes()
{
CreateRecipe().
File renamed without changes.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

+1 -1
View File
@@ -25,7 +25,7 @@ namespace CalamityMod.Items.Accessories
{
Item.width = 18;
Item.height = 44;
Item.defense = 8;
Item.defense = 5;
Item.accessory = true;
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
Item.rare = ModContent.RarityType<BurnishedAuric>();
+1 -1
View File
@@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories
Item.width = 64;
Item.height = 62;
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
Item.defense = 12;
Item.defense = 8;
Item.accessory = true;
Item.rare = ModContent.RarityType<BurnishedAuric>();
}
@@ -9,7 +9,8 @@ using System;
namespace CalamityMod.Items.Accessories
{
public class Regenator : ModItem, ILocalizedModType
[LegacyName("Regenator")]
public class Regenerator : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
@@ -24,14 +25,14 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.regenator = true;
modPlayer.regenerator = true;
player.longInvince = true; // Gives better iframes because god help you if you end up getting hit twice
}
public override void ModifyTooltips(List<TooltipLine> list)
{
if (Main.LocalPlayer != null)
list.FindAndReplace("[DAMAGE]", (Main.LocalPlayer.Calamity().regenatorDamage).ToPercent());
list.FindAndReplace("[DAMAGE]", (Main.LocalPlayer.Calamity().regeneratorDamage).ToPercent());
}
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Loaded 100 of 2137 files, more files were not shown because too many files have changed in this diff. Show more