Merge branch '1.4.4' into VolatileGelatinRework

This commit is contained in:
Xyk committed 2026-08-03 20:28:55 -07:00
commit 19a5c41093
2012 files changed
+24248 -35043

No files matched your search

-14
View File
@@ -1,14 +0,0 @@
using Terraria.ModLoader;
namespace CalamityMod.Backgrounds
{
public class FloralParadiseBGStyle : ModUndergroundBackgroundStyle
{
public override void FillTextureArray(int[] textureSlots)
{
// Corresponds to underground jungle backgrounds. Something custom could probably be made, but for what it is it works sufficiently for the minibiome.
for (int i = 0; i <= 3; i++)
textureSlots[i] = i + 153;
}
}
}
+9 -34
View File
@@ -10,49 +10,24 @@ namespace CalamityMod.Backgrounds
private int SSBG2;
private int SSBG3;
private int BGBG0;
private int BGBG1;
private int BGBG2;
private int BGBG3;
public override void SetStaticDefaults()
{
if (Main.dedServ)
return;
SSBG0 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
SSBG1 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
SSBG2 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
SSBG3 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
BGBG0 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
BGBG1 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BasaltGullyBG");
BGBG2 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
BGBG3 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BasaltGullyBG");
SSBG0 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG0");
SSBG1 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG1");
SSBG2 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG2");
SSBG3 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG3");
}
public override void FillTextureArray(int[] textureSlots)
{
if (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.RadiantReefsBiome>()) ||
Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.PolypForestBiome>()) ||
Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.TimelessShoresBiome>()) ||
Main.LocalPlayer.InModBiome<BiomeManagers.GleamingBurrowsBiome>())
{
textureSlots[0] = SSBG0;
textureSlots[1] = SSBG1;
textureSlots[2] = SSBG2;
textureSlots[3] = SSBG3;
}
if (!Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.RadiantReefsBiome>()) &&
!Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.PolypForestBiome>()) &&
!Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.TimelessShoresBiome>()) &&
!Main.LocalPlayer.InModBiome<BiomeManagers.GleamingBurrowsBiome>())
{
textureSlots[0] = BGBG0;
textureSlots[1] = BGBG1;
textureSlots[2] = BGBG2;
textureSlots[3] = BGBG3;
}
textureSlots[0] = SSBG0;
textureSlots[1] = SSBG1;
textureSlots[2] = SSBG2;
textureSlots[3] = SSBG3;
}
}
}
+11 -9
View File
@@ -182,15 +182,17 @@ namespace CalamityMod.Backgrounds
Main.spriteBatch.End();
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, Main.Rasterizer, distortionShader.Shader, CalamityUtils.BackgroundMatrix);
const float distortionXSpeed = -0.012f;
const float distortionYSpeed = 0.02f;
const float noiseScale = 0.075f;
const float noiseStrength = 0.035f;
Vector2 timeOffset = new Vector2(distortionXSpeed, distortionYSpeed) * Main.GlobalTimeWrappedHourly * noiseScale;
Vector2 noiseScaleStrength = new Vector2(noiseScale, noiseStrength);
distortionShader.Shader.Parameters["timeOffset"].SetValue(timeOffset);
distortionShader.Shader.Parameters["noiseScaleStrength"].SetValue(noiseScaleStrength);
distortionShader.SetShaderTexture(distortionTexture);
float distortionXSpeed = -0.012f;
float distortionYSpeed = 0.02f;
float noiseScale = 0.075f;
float noiseStrength = 0.035f;
distortionShader.Shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly);
distortionShader.Shader.Parameters["noiseScale"].SetValue(noiseScale);
distortionShader.Shader.Parameters["distortionStrength"].SetValue(noiseStrength);
distortionShader.Shader.Parameters["timeOffset"].SetValue(new Vector2(distortionXSpeed, distortionYSpeed));
Main.graphics.GraphicsDevice.Textures[1] = distortionTexture.Value;
Main.graphics.GraphicsDevice.SamplerStates[1] = SamplerState.LinearWrap;
Main.spriteBatch.Draw(WaterDistortionTarget.Target, new Rectangle(16, 16, Main.screenWidth, Main.screenHeight), Color.White);
}
+33 -27
View File
@@ -4,6 +4,7 @@ using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.NPCs.AstrumAureus;
using CalamityMod.NPCs.CeaselessVoid;
using CalamityMod.NPCs.Crabulon;
using CalamityMod.NPCs.NormalNPCs.HorribleHog;
using CalamityMod.NPCs.OldDuke;
using CalamityMod.NPCs.ProfanedGuardians;
using CalamityMod.NPCs.Providence;
@@ -54,12 +55,22 @@ namespace CalamityMod.Balancing
NPCSpecificBalancingChanges = new List<NPCBalancingChange>();
// ENEMIES
#region Horrible Hog
// Take 300% damage from Finch Staff.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<HorribleHog>(), Do(new ProjectileResistBalancingRule(3f, ProjectileID.BabyBird))));
#endregion
// BOSSES
#region Crabulon
// 20% resist to true melee.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<Crabulon>(), ResistTrueMelee(0.8f)));
#endregion
#region Eater of Worlds
// 55% resist to Lemon 'nade
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.EaterOfWorlds, Do(new ProjectileResistBalancingRule(0.45f, ProjectileType<LemonNadeProjectile>()))));
// 50% resist to Demon Scythe.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.EaterOfWorlds, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.DemonScythe))));
@@ -68,9 +79,6 @@ namespace CalamityMod.Balancing
// 25% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.EaterOfWorlds, Do(ResistTrueMelee(0.75f))));
// 40% resist to Lemon 'nade
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.EaterOfWorlds, Do(new ProjectileResistBalancingRule(0.60f, ProjectileType<LemonNadeProjectile>()))));
#endregion
#region Brain of Cthulhu: Creepers
@@ -87,8 +95,8 @@ namespace CalamityMod.Balancing
#endregion
#region Wall of Flesh
// 40% resist to Corro/Crimslime Staff.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.WallofFleshEye, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<CrimslimeMinion>(), ProjectileType<CorroslimeMinion>()))));
// 50% resist to Staff of Necrosteocytes.
NPCSpecificBalancingChanges.AddRange(Bundle(new List<int> { NPCID.WallofFlesh, NPCID.WallofFleshEye }, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<SmallSkeletonMinion>()))));
#endregion
#region Aquatic Scourge
@@ -145,6 +153,10 @@ namespace CalamityMod.Balancing
// 25% resist to The Ballista's greatarrows.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<AstrumAureus>(), Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<BallistaGreatArrow>()))));
// 15% resist to Dryad's Tears.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<AstrumAureus>(), Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<DryadsTearMain>(), ProjectileType<DryadsTearBurst>()))));
#endregion
#region Duke Fishron
@@ -198,6 +210,9 @@ namespace CalamityMod.Balancing
// 75% resist to Plaguenades.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.25f, ProjectileType<PlaguenadeBee>(), ProjectileType<PlaguenadeProj>()))));
// 70% resist to Stardust Dragon Staff.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.StardustDragon1, ProjectileID.StardustDragon2, ProjectileID.StardustDragon3, ProjectileID.StardustDragon4))));
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(ResistTrueMelee(0.5f))));
@@ -207,12 +222,9 @@ namespace CalamityMod.Balancing
// 50% resist to Charged Blaster Cannon.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.ChargedBlasterLaser))));
//45% resist to Duststorm in a Bottle
// 45% resist to Duststorm in a Bottle.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType<DuststormCloud>(), ProjectileType<DuststormCloudExplosion>(), ProjectileType<DuststormInABottleProj>()))));
// 40% resist to Stardust Dragon Staff.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.6f, ProjectileID.StardustDragon1, ProjectileID.StardustDragon2, ProjectileID.StardustDragon3, ProjectileID.StardustDragon4))));
// 35% resist to Aerial Bane.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2BetsyArrow))));
@@ -262,9 +274,6 @@ namespace CalamityMod.Balancing
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(ResistTrueMelee(0.5f))));
// 50% resist to Dazzling Stabber Staff.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<DazzlingStabber>()))));
// 50% resist to Last Prism.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.LastPrismLaser))));
@@ -279,11 +288,12 @@ namespace CalamityMod.Balancing
// 35% resist to Event Horizon.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<EventHorizonStar>(), ProjectileType<EventHorizonBlackhole>()))));
#endregion
#region Old Duke
// 20% resist to Time Bolt.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<OldDuke>(), new ProjectileResistBalancingRule(0.8f, ProjectileType<TimeBoltKnife>())));
// 35% resist to King of Constellations, Tenryu.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<BlackDragonHead>(), ProjectileType<BlackDragonBody>(), ProjectileType<BlackDragonTail>(), ProjectileType<WhiteDragonHead>(), ProjectileType<WhiteDragonBody>(), ProjectileType<WhiteDragonTail>()))));
// 20% resist to Dazzling Stabber Staff.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<DazzlingStabber>()))));
#endregion
#region The Devourer of Gods
@@ -292,25 +302,18 @@ namespace CalamityMod.Balancing
// 60% resist to Corinth Prime's grenades.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.4f, ProjectileType<CorinthPrimeAirburst>()))));
// 50% resist to Stratus Sphere
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<StratusBlackHole>()))));
// 35% resist to Sulphuric Acid Cannon's explosions.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<SulphuricAcidCannonExplosion>()))));
// 20% resist to Valediction's typhoons; will catch Nuclear Fury as well but that doesn't matter.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<NuclearFuryProjectile>()))));
// 15% vulnerability to Time Bolt stealth strikes.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new StealthStrikeBalancingRule(1.15f, ProjectileType<TimeBoltKnife>()))));
#endregion The Devourer of Gods
#region Yharon
// 15% resist to The Old Reaper's stealth strike rain.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<Yharon>(), Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<RadiationRain>()))));
// 15% resist to Time Bolt.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<Yharon>(), Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<TimeBoltKnife>()))));
#endregion
#region Exo Mechs: Ares
// 35% resist to Devil's Devastation's slash.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<DevilsDevastationHoldout>()))));
@@ -372,6 +375,9 @@ namespace CalamityMod.Balancing
// 45% resist to Wrathwing's stealth strike fireballs.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType<WrathwingCinder>()))));
// 40% resist to Eclipse's Fall
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<EclipsesFall_Javelin>()))));
// 40% resist to Omicron's beam.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<OmicronBeam>()))));
+1 -1
View File
@@ -9,7 +9,7 @@ namespace CalamityMod.BiomeManagers
{
public class PolypForestBiome : ModBiome
{
public override ModWaterStyle WaterStyle => SunkenSeaPolypWater.Instance;
public override ModWaterStyle WaterStyle => SunkenSeaBurrowsWater.Instance;
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/SunkenSeaBGStyle");
public override int BiomeTorchItemType => ModContent.ItemType<NavyPrismTorch>();
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.OceanNight;
+1 -1
View File
@@ -9,7 +9,7 @@ namespace CalamityMod.BiomeManagers
{
public class RadiantReefsBiome : ModBiome
{
public override ModWaterStyle WaterStyle => SunkenSeaReefsWater.Instance;
public override ModWaterStyle WaterStyle => SunkenSeaBurrowsWater.Instance;
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/SunkenSeaBGStyle");
public override int BiomeTorchItemType => ModContent.ItemType<NavyPrismTorch>();
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.OceanNight;
+4 -3
View File
@@ -4,6 +4,7 @@ using System;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using CalamityMod.Systems;
using Terraria.ID;
namespace CalamityMod.BiomeManagers
{
@@ -11,7 +12,7 @@ namespace CalamityMod.BiomeManagers
public class SunkenSeaBiome : ModBiome
{
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.OceanNight;
public override void Load()
{
//apply the drawblack edits here since all sunken sea biomes will have custom backgrounds
@@ -63,8 +64,8 @@ namespace CalamityMod.BiomeManagers
public override bool IsBiomeActive(Player player)
{
return BiomeTileCounterSystem.SunkenSeaBurrowsTiles > 1000 || BiomeTileCounterSystem.SunkenSeaPolypTiles > 1000 ||
BiomeTileCounterSystem.SunkenSeaReefsTiles > 1000 || BiomeTileCounterSystem.SunkenSeaShoresTiles > 1000;
return BiomeTileCounterSystem.SunkenSeaBurrowsTiles > 200 || BiomeTileCounterSystem.SunkenSeaPolypTiles > 200 ||
BiomeTileCounterSystem.SunkenSeaReefsTiles > 200 || BiomeTileCounterSystem.SunkenSeaShoresTiles > 200;
}
}
}
+1 -1
View File
@@ -9,7 +9,7 @@ namespace CalamityMod.BiomeManagers
{
public class TimelessShoresBiome : ModBiome
{
public override ModWaterStyle WaterStyle => SunkenSeaShoresWater.Instance;
public override ModWaterStyle WaterStyle => SunkenSeaBurrowsWater.Instance;
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/SunkenSeaBGStyle");
public override int BiomeTorchItemType => ModContent.ItemType<NavyPrismTorch>();
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.OceanNight;
-1
View File
@@ -18,7 +18,6 @@ namespace CalamityMod.Buffs.Alcohol
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
Main.persistentBuff[Type] = true;
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
-5
View File
@@ -40,11 +40,6 @@ namespace CalamityMod.Buffs
{
player.GetDamage<MagicDamageClass>() -= 0.1f;
}
else if (type == BuffID.Clairvoyance)
{
player.GetDamage<MagicDamageClass>() -= 0.02f;
player.GetCritChance<MagicDamageClass>() -= 2;
}
else if (type == BuffID.SugarRush)
{
player.moveSpeed -= 0.1f;
-1
View File
@@ -3,7 +3,6 @@ using CalamityMod.Projectiles.Summon;
using CalamityMod.Systems.Collections;
using Terraria;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
-171
View File
@@ -1,171 +0,0 @@
using System;
using CalamityMod.NPCs;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.DamageOverTime
{
public class SeaKingsAssurance : ModBuff
{
public static Color BaseColor => new Color(31, 78, 155);
public static Color LightColor => new Color(31, 108, 225);
public static void Apply(NPC npc, Vector2 orig)
{
int stacks = 1;
if (npc.HasBuff<SeaKingsAssurance>())
{
int buffTimer = npc.buffTime[npc.FindBuffIndex(ModContent.BuffType<SeaKingsAssurance>())];
npc.buffTime[npc.FindBuffIndex(ModContent.BuffType<SeaKingsAssurance>())] += FramesPerStack;
npc.buffTime[npc.FindBuffIndex(ModContent.BuffType<SeaKingsAssurance>())] = ((int)Math.Ceiling((double)buffTimer / FramesPerStack) + 1) * FramesPerStack;
buffTimer = npc.buffTime[npc.FindBuffIndex(ModContent.BuffType<SeaKingsAssurance>())];
stacks += ((int)Math.Ceiling((double)buffTimer / FramesPerStack));
}
else
{
npc.AddBuff(ModContent.BuffType<SeaKingsAssurance>(), FramesPerStack);
}
npc.GetGlobalNPC<SeaKingsAssuranceNPC>().StackGlow = 1f;
npc.GetGlobalNPC<SeaKingsAssuranceNPC>().StackScale = 1.2f;
SoundStyle style = new SoundStyle("CalamityMod/Sounds/Item/WaterSplash1");
SoundEngine.PlaySound(style.WithPitchOffset(1f + ((float)stacks / 6f)).WithVolumeScale(0.2f));
float sc = 0.05f + ((float)stacks * 0.06f);
for (int i = 0; i < 5; i++)
{
float rot = Main.rand.NextFloat(MathHelper.TwoPi) + MathHelper.PiOver2;
if (orig != Vector2.Zero)
{
rot = orig.AngleTo(npc.Center) + MathHelper.PiOver2;
}
GeneralParticleHandler.SpawnParticle(new CustomPulse(
npc.Center, (rot - MathHelper.PiOver2).ToRotationVector2() * 6f, Color.Lerp(BaseColor, LightColor, sc * 3f), "CalamityMod/Particles/ForwardSmear", new Vector2(Main.rand.NextFloat(0.015f, 0.1f), 0.1f),
rot, sc, sc * 2f, 8
));
}
float range = 20 + ((float)stacks * 15f);
if (orig == Vector2.Zero)
{
foreach (NPC npc2 in Main.npc)
{
if (npc2 != npc)
{
if (npc2.active && !npc2.friendly && !npc2.isLikeATownNPC)
{
if (npc2.Distance(npc.Center) < range)
{
Apply(npc2, npc.Center);
}
}
}
}
}
}
/// <summary>
/// The number of frames per stack of this buff.
/// For instance, if the buff has less than one of this number's worth of time left,
/// it will count as one stack.
/// </summary>
public static int FramesPerStack => 60;
public static SoundStyle ImpactSound => new SoundStyle("CalamityMod/Sounds/Item/WaterSplash1");
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
}
public override void Update(NPC npc, ref int buffIndex)
{
npc.buffTime[buffIndex] = Math.Min(npc.buffTime[buffIndex], 10 * FramesPerStack);
npc.GetGlobalNPC<SeaKingsAssuranceNPC>().assuredStacks = (int)Math.Ceiling((double)(npc.buffTime[buffIndex] / FramesPerStack));
}
}
public class SeaKingsAssuranceNPC : GlobalNPC
{
public static readonly Asset<Texture2D> Stacks = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/AmidiasTrident_Stacks");
public override bool InstancePerEntity => true;
public int assuredStacks = 0;
public int StackFrame = 0;
public float StackRotation = 0f;
public float StackScale = 0f;
public float StackGlow = 0f;
public override void ResetEffects(NPC npc)
{
if (assuredStacks == 0)
{
StackScale *= 0.5f;
}
else
{
StackScale = MathHelper.Lerp(StackScale, 1f, 0.2f);
}
StackGlow *= 0.7f;
assuredStacks = 0;
base.ResetEffects(npc);
}
public override void DrawEffects(NPC npc, ref Color drawColor)
{
base.DrawEffects(npc, ref drawColor);
}
public override void UpdateLifeRegen(NPC npc, ref int damage)
{
}
public override void PostDraw(NPC npc, SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
StackFrame = 0;
if (assuredStacks > 5) StackFrame = 1;
if (assuredStacks > 8) StackFrame = 2;
Rectangle frame = Stacks.Frame(3, 1, StackFrame);
if (StackFrame == 2)
{
StackRotation = MathHelper.Lerp(StackRotation, MathHelper.Pi, 0.2f);
}
else
{
StackRotation = MathHelper.Lerp(StackRotation, 0f, 0.1f);
}
float offset = -28;
for (int b = 0; b < CalamityGlobalNPC.moddedDebuffTextureList.Count; b++)
{
if (CalamityGlobalNPC.moddedDebuffTextureList[b].Item2.Invoke(npc))
{
offset = -48;
}
}
if (StackScale > 0.2f && assuredStacks > 2)
{
spriteBatch.Draw(Stacks.Value, npc.Top - Main.screenPosition + new Vector2(0, offset), frame, Color.White, StackRotation, frame.Size() / 2f, StackScale, SpriteEffects.None, 0f);
for (int i = 0; i < 4; i++)
{
spriteBatch.Draw(Stacks.Value, npc.Top - Main.screenPosition + new Vector2(0, offset), frame, Color.White.MultiplyRGBA(new(StackGlow, StackGlow, StackGlow, 0f)), StackRotation, frame.Size() / 2f, StackScale, SpriteEffects.None, 0f);
}
}
else
{
StackRotation = 0f;
}
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 596 B

+1 -6
View File
@@ -30,16 +30,11 @@ namespace CalamityMod.Buffs.DamageOverTime
{
owner = p.owner;
projectileCount++;
if (projectileCount >= 5)
{
projectileCount = 5;
break;
}
}
}
Item heldItem = Main.player[owner].HeldItem;
int totalDamage = (int)Main.player[owner].GetTotalDamage<SummonDamageClass>().ApplyTo(debuffData.EnemyLostRegen);
int totalDamage = (int)npc.Calamity().ActiveTypelessDebuffMultiplier.ApplyTo(Main.player[owner].GetTotalDamage<SummonDamageClass>().ApplyTo(debuffData.EnemyLostRegen));
if (CalamityUtils.ShouldTriggerSummonPenalty(Main.player[owner], heldItem))
totalDamage = (int)(totalDamage * BalancingConstants.SummonerCrossClassNerf);
+1
View File
@@ -72,6 +72,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Projectile tick = Projectile.NewProjectileDirect(target.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), bleedTickDamage, 0f, applicator.whoAmI, target.whoAmI);
tick.DamageType = DamageClass.Ranged; // Uncommon for DirectStrikes, but it needs to be able to crit.
tick.CritChance = (int)applicator.GetTotalCritChance(DamageClass.Ranged);
// All ticks of Shred have a 3x base crit multiplier and have supercrits enabled.
CalamityGlobalProjectile cgp = tick.Calamity();
@@ -8,7 +8,6 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
-2
View File
@@ -1,12 +1,10 @@
using CalamityMod.DataStructures;
using CalamityMod.NPCs;
using CalamityMod.Systems.Collections;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
-1
View File
@@ -8,7 +8,6 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -2,7 +2,7 @@
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Cooldowns
namespace CalamityMod.Buffs.DamageOverTime
{
public class Withered : ModBuff
{
File renamed without changes.

Before

Width:  |  Height:  |  Size: 586 B

After

Width:  |  Height:  |  Size: 586 B

+27
View File
@@ -0,0 +1,27 @@
using CalamityMod.Projectiles.Pets;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Pets
{
public class BeldumBuff : ModBuff
{
public override void SetStaticDefaults()
{
Main.buffNoTimeDisplay[Type] = true;
Main.vanityPet[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
player.buffTime[buffIndex] = 18000;
player.Calamity().beldum = true;
bool PetProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType<Beldum>()] <= 0;
if (PetProjectileNotSpawned && player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectile(player.GetSource_Buff(buffIndex), player.Center, Vector2.Zero, ModContent.ProjectileType<Beldum>(), 0, 0f, player.whoAmI, 0f, 0f);
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 644 B

After

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 686 B

After

Width:  |  Height:  |  Size: 804 B

+1 -1
View File
@@ -7,7 +7,7 @@ namespace CalamityMod.Buffs.Potions
{
public class Soaring : ModBuff
{
public override LocalizedText Description => base.Description.WithFormatArgs(SoaringPotion.FlightBoost.ToPercent());
public override LocalizedText Description => base.Description.WithFormatArgs(SoaringPotion.FlightTimeBoost.ToPercent());
public override void SetStaticDefaults()
{
+8 -2
View File
@@ -1,4 +1,5 @@
using CalamityMod.DataStructures;
using System;
using CalamityMod.DataStructures;
using CalamityMod.Items.Potions;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
@@ -16,6 +17,7 @@ namespace CalamityMod.Buffs.Potions
public class SwinesWrathBuff : ModBuff
{
public static readonly SoundStyle TimerSound = new("CalamityMod/Sounds/Custom/TickingTimer");
public static readonly SoundStyle TimerSound2 = new("CalamityMod/Sounds/Custom/TickingTimerReverb");
public override void SetStaticDefaults()
{
@@ -33,10 +35,14 @@ namespace CalamityMod.Buffs.Potions
{
player.KillMe(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SwinesWrath" + Main.rand.Next(1, 7 + 1)).ToNetworkText(player.name)), 1000, -1);
concoctionPlayer.swinesWrathCounter = -1;
concoctionPlayer.spamTimer = 0;
}
else if (concoctionPlayer.swinesWrathCounter % 60 == 59)
SoundEngine.PlaySound(TimerSound with { Volume = ((600f - concoctionPlayer.swinesWrathCounter) / 600f) }, player.Center); // Gets louder as time progresses
{
SoundEngine.PlaySound(TimerSound2 with { Volume = MathF.Pow((600f - concoctionPlayer.swinesWrathCounter) / 600f, 2) * 0.8f, MaxInstances = -1 }, player.Center); // Gets louder as time progresses
SoundEngine.PlaySound(TimerSound with { Volume = ((600f - concoctionPlayer.swinesWrathCounter) / 600f), MaxInstances = -1 }, player.Center); // Gets louder as time progresses
}
}
}
}
-48
View File
@@ -1,48 +0,0 @@
using CalamityMod.DataStructures;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.StatBuffs
{
public class FortunesFavor : ModBuff
{
public static int FortunesFavorRegenBoost = 3;
public override LocalizedText Description => base.Description.WithFormatArgs(FortunesFavorRegenBoost.ToRegenPerSecond());
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().fortunesFavor = true; // Draw FX handled in CalamityPlayerDrawEffects as is standard for regen buffs
}
public override void Update(NPC npc, ref int buffIndex)
{
npc.Calamity().fortunesFavor = true;
}
internal static void DrawEffects(NPC npc, ref Color drawColor)
{
Vector2 npcSize = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2));
if (Main.rand.NextBool(16))
{
Particle Plus = new HealingPlus(npcSize, Main.rand.NextFloat(0.3f, 0.5f), new Vector2(0, Main.rand.NextFloat(-2f, -3.5f)) + npc.velocity, Color.Gold, Color.Goldenrod, Main.rand.Next(9, 13));
GeneralParticleHandler.SpawnParticle(Plus);
}
Lighting.AddLight(npc.Center, Color.Gold.ToVector3() * 0.1f);
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 740 B

+21
View File
@@ -0,0 +1,21 @@
using CalamityMod.Items.Accessories;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.StatBuffs
{
public class FulfilledContract : ModBuff
{
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)
{
Main.buffNoTimeDisplay[Type] = false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

+13 -9
View File
@@ -1,10 +1,8 @@
using System;
using CalamityMod.DataStructures;
using CalamityMod.Items.Accessories;
using Terraria;
using Terraria.Localization;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.StatBuffs
{
@@ -12,7 +10,7 @@ namespace CalamityMod.Buffs.StatBuffs
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 40,
EnemyLostRegen = 160,
SicknessDebuffScaling = 1,
HeatDebuffScaling = 1,
ColdDebuffScaling = 1,
@@ -39,7 +37,14 @@ namespace CalamityMod.Buffs.StatBuffs
.CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveWaterDebuffMultiplier, debuffData.WaterDebuffScaling)
.CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveElectricDebuffMultiplier, debuffData.ElectricDebuffScaling)
))));
totalDPS = totalScaling.ApplyTo(totalDPS);
//Smashed Evil ignores Mult boosters for now to ignore weakness/resist. Once those systems are changed, return to using totalScaling instead of this mess.
StatModifier finalScaling = new();
finalScaling += totalScaling.Additive - 1;
finalScaling.Base = totalScaling.Base;
finalScaling.Flat = totalScaling.Flat;
totalDPS = finalScaling.ApplyTo(totalDPS);
var totalDPSAdjusted = totalDPS - debuffData.EnemyVanillaRegenToCancelOut;
npc.Calamity().ApplyDPSDebuff((int)(totalDPSAdjusted), (int)Math.Max(totalDPS * debuffData.MultiplierDamageTickSize, debuffData.MinimumDamageTickSize), ref npc.lifeRegen, ref damage);
}
@@ -53,9 +58,8 @@ namespace CalamityMod.Buffs.StatBuffs
public override void Update(Player player, ref int buffIndex)
{
player.lifeRegenTime += 2;
player.GetDamage<GenericDamageClass>() += 0.1f;
player.moveSpeed += 0.2f;
player.lifeRegenTime += 4;
player.GetDamage<GenericDamageClass>() += 0.20f;
}
public override void Update(NPC npc, ref int buffIndex)
-2
View File
@@ -1,10 +1,8 @@
using CalamityMod.DataStructures;
using CalamityMod.NPCs;
using CalamityMod.Systems.Collections;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.StatDebuffs
{
-2
View File
@@ -5,8 +5,6 @@ namespace CalamityMod.Buffs.StatDebuffs
{
public class MarkedforDeath : ModBuff
{
public static int DefenseReduction = 5;
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
@@ -3,10 +3,10 @@ using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class SeashineSwordBuff : BaseSummonBuff
public class BabyPaladinBuff : BaseSummonBuff
{
protected override int MinionProjectileType => ModContent.ProjectileType<SeashineSwordProj>();
protected override int MinionProjectileType => ModContent.ProjectileType<StatigelBlightedSlime>();
protected override ref bool MinionBool => ref BuffModdedOwner.seashineSwordBuff;
protected override ref bool MinionBool => ref BuffModdedOwner.sGod;
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 486 B

After

Width:  |  Height:  |  Size: 486 B

@@ -1,12 +1,12 @@
using CalamityMod.Projectiles.Summon;
using CalamityMod.Projectiles.Summon;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class BabySlimeGodBuff : BaseSummonBuff
public class BlightedSlime : BaseSummonBuff
{
protected override int MinionProjectileType => ModContent.ProjectileType<CrimsonSlimeGodMinion>();
protected override int MinionProjectileType => ModContent.ProjectileType<BlightedSlimeMinion>();
protected override ref bool MinionBool => ref BuffModdedOwner.sGod;
protected override ref bool MinionBool => ref BuffModdedOwner.blightedSlime;
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 547 B

After

Width:  |  Height:  |  Size: 547 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 543 B

-12
View File
@@ -1,12 +0,0 @@
using CalamityMod.Projectiles.Summon;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class Corroslime : BaseSummonBuff
{
protected override int MinionProjectileType => ModContent.ProjectileType<CorroslimeMinion>();
protected override ref bool MinionBool => ref BuffModdedOwner.cSlime;
}
}
-12
View File
@@ -1,12 +0,0 @@
using CalamityMod.Projectiles.Summon;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class Crimslime : BaseSummonBuff
{
protected override int MinionProjectileType => ModContent.ProjectileType<CrimslimeMinion>();
protected override ref bool MinionBool => ref BuffModdedOwner.cSlime2;
}
}
+1 -1
View File
@@ -16,7 +16,7 @@ namespace CalamityMod.Buffs.Summon
{
CalamityPlayer modPlayer = player.Calamity();
if (!modPlayer.allElementals)
if (!modPlayer.allElementals.HasValue)
{
player.DelBuff(buffIndex);
buffIndex--;
+29 -4
View File
@@ -1,12 +1,37 @@
using CalamityMod.Projectiles.Typeless;
using CalamityMod.CalPlayer;
using CalamityMod.Projectiles.Summon;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class SeaSnailBuff : BaseSummonBuff
public class SeaSnailBuff : ModBuff
{
protected override int MinionProjectileType => ModContent.ProjectileType<VictideSeaSnail>();
public override void SetStaticDefaults()
{
Main.buffNoTimeDisplay[Type] = true;
Main.buffNoSave[Type] = true;
}
protected override ref bool MinionBool => ref BuffModdedOwner.victideSnail;
public override void Update(Player player, ref int buffIndex)
{
CalamityPlayer modPlayer = player.Calamity();
if (player.ownedProjectileCounts[ModContent.ProjectileType<VictideSeaSnail>()] > 0)
{
modPlayer.victideSnail = true;
}
if (!modPlayer.victideSnail)
{
player.DelBuff(buffIndex);
buffIndex--;
}
else
{
player.buffTime[buffIndex] = 18000;
}
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 693 B

File diff suppressed because it is too large. Load diff
+2 -19
View File
@@ -40,14 +40,7 @@ namespace CalamityMod.CalPlayer
PlayerDrawLayers.Shoes.Hide();
}
if (drawInfo.drawPlayer.ownedProjectileCounts[ModContent.ProjectileType<VictideSpirit>()] > 0)
{
foreach (var layer in PlayerDrawLayerLoader.Layers)
{
layer.Hide();
}
}
else if (drawInfo.drawPlayer.Calamity().andromedaState != AndromedaPlayerState.Inactive)
if (drawInfo.drawPlayer.Calamity().andromedaState != AndromedaPlayerState.Inactive)
{
foreach (var layer in PlayerDrawLayerLoader.Layers)
{
@@ -438,7 +431,7 @@ namespace CalamityMod.CalPlayer
#region Armor Visuals
// Demonshade Armor
if (calamityPlayer.dsSetBonus && drawInfo.shadow == 0f)
if (calamityPlayer.demonshadeSet && drawInfo.shadow == 0f)
{
if (Player != null && !Player.dead)
{
@@ -589,16 +582,6 @@ namespace CalamityMod.CalPlayer
WindChilled.DrawEffects(drawInfo);
#endregion
if (calamityPlayer.fortunesFavor && drawInfo.shadow == 0f)
{
if (Main.rand.NextBool(12))
{
Vector2 plusPos = new Vector2(Player.position.X + Main.rand.NextFloat(-8f, 20f), Player.position.Y + Main.rand.NextFloat(-14f, 36f));
Particle Plus = new HealingPlus(plusPos, Main.rand.NextFloat(0.33f, 0.66f), new Vector2(0, Main.rand.NextFloat(-2f, -3.5f)) + Player.velocity, Color.Gold, Color.Goldenrod, Main.rand.Next(9, 13));
GeneralParticleHandler.SpawnParticle(Plus);
}
}
if (calamityPlayer.PinkJellyRegen && drawInfo.shadow == 0f)
{
if (Main.rand.NextBool(24))
+12 -13
View File
@@ -170,10 +170,6 @@ namespace CalamityMod.CalPlayer
else
itemDrop = ModContent.ItemType<CragBullhead>();
}
if (ZoneBasaltGully)
{
itemDrop = ModContent.ItemType<MoltenFishron>();
}
return;
}
@@ -327,6 +323,17 @@ namespace CalamityMod.CalPlayer
itemDrop = ModContent.ItemType<Shadowfish>();
}
// Lower chance of Spadefish in Hardmode and/or when already having a spadefish
if (underground) // Underground
{
bool validattempt = Player.HasItemInInventoryOrOpenVoidBag(ModContent.ItemType<Spadefish>()) ? attempt.veryrare : attempt.rare;
int chance = Main.hardMode ? 10 : 4;
if (validattempt && Main.rand.NextBool(chance))
{
itemDrop = ModContent.ItemType<Spadefish>();
}
}
if (ZoneAstral)
{
if (attempt.legendary)
@@ -360,14 +367,6 @@ namespace CalamityMod.CalPlayer
if (Player.ZoneDesert && Main.rand.NextBool())
return;
int commonCatch = ModContent.ItemType<CoralskinFoolfish>();
if (ZonePolypForest)
commonCatch = ModContent.ItemType<GleamingCucumber>();
else if (ZoneGleamingBurrows)
commonCatch = ModContent.ItemType<SpecularSturgeon>();
else if (ZoneTimelessShores)
commonCatch = ModContent.ItemType<Squidoom>();
if (attempt.legendary)
{
List<int> legendaryCatches =
@@ -401,7 +400,7 @@ namespace CalamityMod.CalPlayer
else if (Main.rand.NextBool()) // 50% chance the common fish is replaced with driftwood
itemDrop = ModContent.ItemType<Driftwood>();
else
itemDrop = commonCatch;
itemDrop = ModContent.ItemType<PrismaticGuppy>();
return;
}
// There is no complete fishing pool here, so most of it is vanilla default
+97 -135
View File
@@ -1,14 +1,12 @@
using System;
using System.Linq;
using CalamityMod.Balancing;
using CalamityMod.Buffs.Cooldowns;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.Placeables;
using CalamityMod.Buffs.StatBuffs;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.CalPlayer.Dashes;
using CalamityMod.Cooldowns;
using CalamityMod.DataStructures;
using CalamityMod.Dusts;
using CalamityMod.Enums;
using CalamityMod.Events;
@@ -25,7 +23,6 @@ using CalamityMod.Items.Armor.Reaver;
using CalamityMod.Items.Armor.Silva;
using CalamityMod.Items.Armor.Sulphurous;
using CalamityMod.Items.Armor.Tarragon;
using CalamityMod.Items.Armor.Victide;
using CalamityMod.Items.Armor.Wulfrum;
using CalamityMod.Items.Potions;
using CalamityMod.Items.Tools;
@@ -146,7 +143,7 @@ namespace CalamityMod.CalPlayer
NetMessage.SendData(MessageID.Dodge, -1, -1, null, Player.whoAmI, 1f, 0f, 0f, 0, 0, 0);
}
#endregion
#region Pre Kill
@@ -209,9 +206,9 @@ namespace CalamityMod.CalPlayer
chaliceBleedoutBuffer = 0D;
chaliceDamagePointPartialProgress = 0D;
}
Player.HealPlayer(100);
Player.HealPlayer(Items.Accessories.NebulousCore.HealLifeOnRevive);
Player.AddCooldown(Cooldowns.NebulousCore.ID, CalamityUtils.SecondsToFrames(90));
Player.AddCooldown(Cooldowns.NebulousCore.ID, Items.Accessories.NebulousCore.ReviveCooldown);
return false;
}
@@ -282,17 +279,11 @@ namespace CalamityMod.CalPlayer
// Custom Death Messages
#region DoT Sources
if (damage == 10.0 && hitDirection == 0 && damageSource.SourceOtherIndex == 8)
{
if (fishStocks && fishStockPower < 0)
{
string year = DateTime.Now.ToString("yy");
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.FishStocks" + Main.rand.Next(1, 6 + 1)).ToNetworkText(Player.name, year));
}
if (alcoholPoisoning)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AlcoholBig" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name));
}
if (vHex)
{
// Unique messages appear half the time during each individual stage of SCal's fight
@@ -314,13 +305,9 @@ namespace CalamityMod.CalPlayer
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText(vHexKeyToUse).ToNetworkText(Player.name));
}
if (ZoneCalamity && Player.lavaWet)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SearingLava" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name));
}
if (godSlayerInferno)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.GodSlayerInferno" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (sulphurPoison)
{
if (!Main.rand.NextBool(4)) // 75% custom
@@ -329,123 +316,84 @@ namespace CalamityMod.CalPlayer
damageSource = PlayerDeathReason.ByOther(9); // 25% generic Poisoned death text
}
if (dragonFire)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Dragonfire" + Main.rand.Next(1, 4 + 1)).ToNetworkText(Player.name));
}
if (vermillionFlux)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.VermillionFlux" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (auricRebuke)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AuricRebuke" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (staticDischarge)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.StaticDischarge" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (miracleBlight)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.MiracleBlight" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (holyInferno)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HolyInferno").ToNetworkText(Player.name));
}
if (holyFlames || banishingFire)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HolyFlames" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (shadowflame)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Shadowflame").ToNetworkText(Player.name));
}
if (daybroken)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Daybroken").ToNetworkText(Player.name));
}
if (burningBlood)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BurningBlood" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name));
}
if (brainRot)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BrainRot" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (heavybleeding)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HeavyBleeding" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (laceration)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Laceration" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (elementalMix)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ElementalMix" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name));
}
if (crushDepth)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.CrushDepth" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (riptide)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Riptide" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name));
}
if (hadopelagicPressure)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HadopelagicPressure" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (brimstoneFlames || weakBrimstoneFlames || demonicFlames)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BrimstoneFlames" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (plague)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Plague" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (astralInfection)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AstralInfection" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (nightwither)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Nightwither").ToNetworkText(Player.name));
}
if (vaporfied)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Vaporfied").ToNetworkText(Player.name));
}
if (manaOverloader || ManaBurn)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ManaBurn").ToNetworkText(Player.name));
}
if (witheredDebuff)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Withered").ToNetworkText(Player.name));
}
}
#endregion
#region Item Sources
if (profanedCrystalBuffs && Player.Transformation().Type == ModContent.ItemType<ProfanedSoulCrystal>())
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ProfanedSoulCrystal").ToNetworkText(Player.name));
if (fishStocks && fishStockPower < 0)
{
string year = DateTime.Now.ToString("yy");
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.FishStocks" + Main.rand.Next(1, 6 + 1)).ToNetworkText(Player.name, year));
}
// Leon Death Noise RE4
if (Main.zenithWorld)
SoundEngine.PlaySound(LeonDeathNoiseRE4_ForGFB, Player.Center);
if (damageSource.TryGetCausingEntity(out var Entity) && Entity is Projectile && (Entity as Projectile).type == ModContent.ProjectileType<LemonNadeProjectile>())
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Lemonnade" + Main.rand.Next(1, 4)).ToNetworkText(Player.name));
if (NorfleetCounter > 3 && NorfleetCounter < 1000)
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Norfleet").ToNetworkText(Player.name));
NorfleetCounter = 0;
#endregion
if (damageSource.TryGetCausingEntity(out var Entity) && Entity is NPC && (Entity as NPC).type == ModContent.NPCType<DevourerofGodsHead>())
#region NPC Sources
if (damageSource.TryGetCausingEntity(out var Entity2) && Entity2 is NPC && (Entity2 as NPC).type == ModContent.NPCType<DevourerofGodsHead>())
{
var npc = Main.npc[damageSource.SourceNPCIndex];
if (npc.ai[3] < 2) //Divinity Devourer
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.DivinityDevourer"+Main.rand.Next(1,4)).ToNetworkText(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.DivinityDevourer" + Main.rand.Next(1, 4)).ToNetworkText(Player.name));
}
else if (npc.ai[3] >= 3)
{
if (npc.life > npc.lifeMax / 4) //Dimensional Drive
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.DimensionalDrive").ToNetworkText(Player.name));
@@ -454,6 +402,7 @@ namespace CalamityMod.CalPlayer
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.UltracosmicMaelstrom" + Main.rand.Next(1, 3)).ToNetworkText(Player.name));
}
}
}
if (NPC.AnyNPCs(ModContent.NPCType<SupremeCalamitas>()))
@@ -461,6 +410,11 @@ namespace CalamityMod.CalPlayer
if (sCalDeathCount < 51)
sCalDeathCount++;
}
#endregion
// Leon Death Noise RE4
if (Main.zenithWorld)
SoundEngine.PlaySound(LeonDeathNoiseRE4_ForGFB, Player.Center);
return true;
}
@@ -470,9 +424,13 @@ namespace CalamityMod.CalPlayer
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (Player.Calamity().yharimsGift)
target.AddBuff(ModContent.BuffType<AuricRebuke>(),120);
target.AddBuff(ModContent.BuffType<AuricRebuke>(), 120);
int debuffSpreadProj = ModContent.ProjectileType<DebuffSpreadEffect>();
if (Player.HasBuff<FulfilledContract>())
target.AddBuff(ModContent.BuffType<Laceration>(), ThePact.DebuffInflictionDuration);
int debuffSpreadProj = ModContent.ProjectileType<DebuffSpreadEffect>();
if ((Player.Calamity().abaddon || Player.Calamity().apollyon) && (target.Calamity().abaddonEffected || target.Calamity().apollyonEffected) && hit.Crit && abaddonCooldown == 0 && Player.ownedProjectileCounts[debuffSpreadProj] == 0)
{
int maxTargetNum = target.Calamity().apollyonEffected ? 10 : 6;
@@ -599,7 +557,7 @@ namespace CalamityMod.CalPlayer
}
}
public override void ModifyHitNPCWithProj(Projectile proj, NPC target, ref NPC.HitModifiers modifiers)/* tModPorter If you don't need the Projectile, consider using ModifyHitNPC instead */
public override void ModifyHitNPCWithProj(Projectile proj, NPC target, ref NPC.HitModifiers modifiers)
{
if (proj.npcProj || proj.trap)
return;
@@ -938,11 +896,11 @@ namespace CalamityMod.CalPlayer
modifiers.Cancel();
bool isIgnoredTrap = (proj.type == ProjectileID.PoisonDartTrap) || (proj.type == ProjectileID.VenomDartTrap) || (proj.type == ProjectileID.PoisonDart);
if (Player.Calamity().trapProtection && isIgnoredTrap)
if (Player.Calamity().archaicPowder && isIgnoredTrap)
modifiers.Cancel();
bool isReducedTrap = (proj.trap || proj.type == ProjectileID.RollingCactusSpike || proj.type == ProjectileID.Landmine) && !isIgnoredTrap;
if (Player.Calamity().trapProtection && isReducedTrap)
if (Player.Calamity().archaicPowder && isReducedTrap)
modifiers.SourceDamage *= (1f - ArchaicPowder.TrapDamageReduction);
// Reduce damage dealt by rainbow trails
@@ -1163,9 +1121,7 @@ namespace CalamityMod.CalPlayer
{
if (sulphurSet)
Main.npc[proj.Calamity().ParentNPCIndex].AddBuff(BuffID.Poisoned, SulphurousHelmet.SetBonusPoisonDuration);
if (ilSpark)
Main.npc[proj.Calamity().ParentNPCIndex].Calamity().shocked = 120;
}
}
}
if (proj.hostile && hurtInfo.Damage > 0)
@@ -1450,7 +1406,8 @@ namespace CalamityMod.CalPlayer
bool sufficientDamageForDodging = actualDamageTaken >= dodgeDamageGateValue;
//This is in a method here so the logic below can call it in multiple places
void GenericDodgeEffects() {
void GenericDodgeEffects()
{
double maxCooldownDurationDamagePercent = 0.5;
int maxCooldownDurationDamageValue = (int)Math.Round(Player.statLifeMax2 * (maxCooldownDurationDamagePercent - dodgeDamageGateValuePercent));
@@ -1510,7 +1467,7 @@ namespace CalamityMod.CalPlayer
storedShadowDodge = false;
return true;
}
if (!Player.HasCooldown(GlobalDodge.ID) && sufficientDamageForDodging && DodgeEffects.Count > 0)
{
GenericDodgeEffects();
@@ -1533,6 +1490,14 @@ namespace CalamityMod.CalPlayer
#region Modify Hurt
public override void ModifyHurt(ref Player.HurtModifiers modifiers)
{
if (CanBeCritByThePact && Main.rand.NextFloat() < ThePact.ChanceToBeCrit)
{
modifiers.SourceDamage *= ThePact.CritDmgTaken;
Player.AddBuff(ModContent.BuffType<FulfilledContract>(), ThePact.BoostDuration);
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/BloodPactCrit"));
}
// Calcium Potion knockback reduction
if (calcium)
modifiers.Knockback *= (1f - CalciumPotion.KnockbackResistance);
@@ -1543,7 +1508,7 @@ namespace CalamityMod.CalPlayer
#region Custom Hurt Sounds
if (hurtSoundTimer == 0)
{
if(Player.Transformation().Type != -1 && Player.Transformation().currentTransformation.HurtSound(Player) != null)
if (Player.Transformation().Type != -1 && Player.Transformation().currentTransformation.HurtSound(Player) != null)
{
var hurtSound = Player.Transformation().currentTransformation.HurtSound(Player).Value;
modifiers.DisableSound();
@@ -1598,23 +1563,23 @@ namespace CalamityMod.CalPlayer
// It has not yet been mitigated by any means.
//
if (blazingCoreParry > 0) //check for active parry
if (divineProvParry > 0) //check for active parry
{
if (blazingCoreParry >= 12) //only the first 18 frames (0.3 seconds) counts for a valid parry
if (divineProvParry >= 12) //only the first 18 frames (0.3 seconds) counts for a valid parry
{
if (!Player.HasCooldown(ParryCooldown.ID))
{
// 17APR2024: Ozzatron: Blazing Core is a parry. It uses vanilla parry iframes and benefits from Cross Necklace.
int blazingCoreParryIFrames = Player.ComputeParryIFrames();
Player.GiveUniversalIFrames(blazingCoreParryIFrames, true);
// 17APR2024: Ozzatron: Divine Providence is a parry. It uses vanilla parry iframes and benefits from Cross Necklace.
int divineProvParryIFrames = Player.ComputeParryIFrames();
Player.GiveUniversalIFrames(divineProvParryIFrames, true);
blazingCoreEmpoweredParry = true;
divineProvEmpoweredParry = true;
modifiers.Cancel();
modifiers.DisableSound(); //prevents hurt sound from playing, had no idea this was a thing
}
SoundEngine.PlaySound(BlazingCore.ParrySuccessSound, Player.Center);
SoundEngine.PlaySound(DivineProvidence.ParrySuccessSound, Player.Center);
float power = 2;
for (int i = 0; i < (int)(20 * power); i++)
@@ -1644,12 +1609,12 @@ namespace CalamityMod.CalPlayer
Particle orb2 = new CustomPulse(Player.Center, Vector2.Zero, Color.Khaki, "CalamityMod/Particles/BloomRing", new Vector2(1f, 0.5f), 0, 0, 2.1f * power, 25);
GeneralParticleHandler.SpawnParticle(orb2);
blazingCoreSuccessfulParry = 60;
divineProvSuccessfulParry = 60;
Player.AddCooldown(ParryCooldown.ID, 60 * 30, false, "blazingcore"); //cooldown is frames in seconds multiplied by the desired amount of seconds
}
if (blazingCoreParry > 1)
blazingCoreParry = 1; //schedule parry to end next frame
if (divineProvParry > 1)
divineProvParry = 1; //schedule parry to end next frame
}
else if (flameLickedShellParry > 0)
{
@@ -1672,23 +1637,6 @@ namespace CalamityMod.CalPlayer
FlameLickedShell.handleParry(Player);
}
}
else if (shieldOfTheOceanParry >= 12)
{
if (!Player.HasCooldown(ParryCooldown.ID))
{
// Shield of the Ocean is a parry. It uses vanilla parry iframes and benefits from Cross Necklace.
int shieldParryIFrames = Player.ComputeParryIFrames();
Player.GiveUniversalIFrames(shieldParryIFrames, true);
shieldOfTheOceanEmpoweredParry = true;
modifiers.FinalDamage *= 0.4f; // 60% DR
modifiers.DisableSound();
}
SoundEngine.PlaySound(ShieldoftheOcean.ParrySound, Player.Center);
Player.AddCooldown(ParryCooldown.ID, 1200, false, "shieldoftheocean");
ShieldoftheOcean.ActivateParry(Player);
}
if (Player.Calamity().scionsCurio)
scionsCurioGotHit = true;
@@ -2142,12 +2090,6 @@ namespace CalamityMod.CalPlayer
}
}
if (victideBarrierSet && !Player.HasCooldown(WardingWave.ID))
{
int healAmt = (int)(hurtInfo.Damage * VictideHeadBarrier.BarrierDamageAbsorptionPercent);
victideBarrierHeal += healAmt;
}
if (daedalusAbsorb && Main.rand.NextBool(DaedalusHeadMagic.AbsorptionChanceDenominator))
{
int healAmt = (int)(hurtInfo.Damage * DaedalusHeadMagic.DamageAbsorptionPercent);
@@ -2288,12 +2230,13 @@ namespace CalamityMod.CalPlayer
}
}
if (fleshTotem && hurtInfo.Damage > 0)
if (fleshTotem && hurtInfo.Damage > 0 && fleshTotemManaStorage > 0)
{
SoundStyle Counter = new SoundStyle("CalamityMod/Sounds/Custom/BrainOfCthulhu/BoC_Rev_Shield_Down");
if (fleshTotemManaStorage >= 100 && fleshTotemVisual)
SoundEngine.PlaySound(Counter with { Volume = 0.75f}, Player.Center);
int lostSoulAmount = fleshTotemManaStorage / 25;
SoundEngine.PlaySound(Counter with { Volume = 0.75f }, Player.Center);
int lostSoulAmount = (fleshTotemManaStorage / 2) / 25;
int lostSoulDamage = (int)Player.GetTotalDamage<MagicDamageClass>().ApplyTo(FleshTotem.lostSoulDamage);
if (Player.ownedProjectileCounts[ModContent.ProjectileType<FleshTotemMinion>()] != 0)
{
for (int i = 0; i < Main.maxProjectiles; i++)
@@ -2303,13 +2246,13 @@ namespace CalamityMod.CalPlayer
{
for (int k = 0; k < lostSoulAmount; k++)
{
Projectile.NewProjectile(Player.GetSource_Accessory_OnHurt(FindAccessory<FleshTotem>(), hurtInfo.DamageSource), proj.Center, new Vector2(10, 10).RotatedByRandom(100) * Main.rand.NextFloat(0.4f, 0.55f), ModContent.ProjectileType<FleshTotemSoul>(), FleshTotem.lostSoulDamage, 0f, Main.myPlayer, 0f, 0f, 3f);
Projectile.NewProjectile(Player.GetSource_Accessory_OnHurt(FindAccessory<FleshTotem>(), hurtInfo.DamageSource), proj.Center, new Vector2(10, 10).RotatedByRandom(100) * Main.rand.NextFloat(0.4f, 0.55f), ModContent.ProjectileType<FleshTotemSoul>(), lostSoulDamage, 0f, Main.myPlayer, 0f, 0f, 3f);
}
break;
}
}
}
fleshTotemManaStorage = 0;
fleshTotemManaStorage = fleshTotemManaStorage / 2;
}
// By setting brainOfConfusionItem, these accessories have this code already,
@@ -2437,7 +2380,7 @@ namespace CalamityMod.CalPlayer
{
int deificProjDamage = (int)(Player.GetBestClassDamage().ApplyTo(DeificAmulet.StarDamage));
Projectile onHitProj = Main.projectile[Projectile.NewProjectile(source, Player.Center, new Vector2(0,-15 * (rampartOfDeities && n % 2 == 0 ? 0.75f: 1.25f)).RotatedBy(MathHelper.TwoPi/projAmount*n), ModContent.ProjectileType<AstralStar>(), deificProjDamage, 4f, Player.whoAmI)];
Projectile onHitProj = Main.projectile[Projectile.NewProjectile(source, Player.Center, new Vector2(0, -15 * (rampartOfDeities && n % 2 == 0 ? 0.75f : 1.25f)).RotatedBy(MathHelper.TwoPi / projAmount * n), ModContent.ProjectileType<AstralStar>(), deificProjDamage, 4f, Player.whoAmI)];
if (onHitProj.whoAmI.WithinBounds(Main.maxProjectiles))
{
onHitProj.DamageType = DamageClass.Generic;
@@ -2451,19 +2394,38 @@ namespace CalamityMod.CalPlayer
}
if (ilSpark)
{
SoundEngine.PlaySound(SoundID.Item93, Player.Center);
// Only visual effects are done here
// The actual spark spawning is now handled with the shocked variable in CalamityGlobalNPC
SeaFoamParticle boom = new(Player.Center, Vector2.Zero, new Color(89, 239, 247), new Color(56, 158, 209), 1f, 200f, Main.rand.NextBool() ? -1f : 1f);
GeneralParticleHandler.SpawnParticle(boom);
for (int e = 0; e < 6; e++)
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<HideofAstrumDeus>()));
if (hurtInfo.Damage > 0)
{
Vector2 dustVel = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(4.5f, 5.25f);
Dust electric = Dust.NewDustPerfect(Player.Center, DustID.Electric, dustVel, Scale: 0.75f);
electric.noGravity = true;
SoundEngine.PlaySound(SoundID.Item93, Player.Center);
float spread = 45f * 0.0174f;
double startAngle = Math.Atan2(Player.velocity.X, Player.velocity.Y) - spread / 2;
double deltaAngle = spread / 8f;
double offsetAngle;
// Start with base damage, then apply the best damage class you can
int sDamage = 6;
if (transformer)
sDamage += 42;
sDamage = (int)Player.GetBestClassDamage().ApplyTo(sDamage);
if (Player.whoAmI == Main.myPlayer)
{
for (int i = 0; i < 4; i++)
{
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
int spark1 = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<GenericElectricSpark>(), sDamage, 1.25f, Player.whoAmI, 0f, 1);
int spark2 = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<GenericElectricSpark>(), sDamage, 1.25f, Player.whoAmI, 0f, 1);
if (spark1.WithinBounds(Main.maxProjectiles))
{
Main.projectile[spark1].timeLeft = 120;
}
if (spark2.WithinBounds(Main.maxProjectiles))
{
Main.projectile[spark2].timeLeft = 120;
}
}
}
}
}
if (rBrain)
@@ -2533,7 +2495,7 @@ namespace CalamityMod.CalPlayer
}
}
}
else if (godSlayerDamage) //god slayer melee helm
else if (godSlayerMelee) //god slayer melee helm
{
var source = Player.GetSource_OnHurt(hurtInfo.DamageSource);
if (hurtInfo.Damage > GodSlayerHeadMelee.SetBonusHurtDamageThreshold)
@@ -2555,7 +2517,7 @@ namespace CalamityMod.CalPlayer
}
}
}
else if (dsSetBonus)
else if (demonshadeSet)
{
if (Player.whoAmI == Main.myPlayer)
{
+14 -13
View File
@@ -73,9 +73,9 @@ namespace CalamityMod.CalPlayer
if (Player.electrified)
{
totalVanillaDoT += eleResist ? 4 : 8;
totalVanillaDoT += 8;
if (Player.controlLeft || Player.controlRight)
totalVanillaDoT += eleResist ? 16 : 32;
totalVanillaDoT += 32;
}
// Tally up total current vanilla DoT so it can be added as extra DoT from Death Mode
@@ -109,7 +109,7 @@ namespace CalamityMod.CalPlayer
ApplyDoTDebuff(burningBlood, 8);
ApplyDoTDebuff(brainRot, 8);
ApplyDoTDebuff(vaporfied, 8);
int staticDoT = ((Player.controlLeft || Player.controlRight) ? 12 : 3) / (eleResist ? 2 : 1);
int staticDoT = ((Player.controlLeft || Player.controlRight) ? 12 : 3);
ApplyDoTDebuff(staticDischarge, staticDoT);
ApplyDoTDebuff(heavybleeding, 16);
ApplyDoTDebuff(crushDepth, 18);
@@ -130,7 +130,7 @@ namespace CalamityMod.CalPlayer
// Profaned Soul Crystal turns you into Providence, a God, and you take more damage from God Slayer Inferno
ApplyDoTDebuff(godSlayerInferno, profanedCrystalBuffs ? 50 : 40);
int fluxDoT = ((Player.controlLeft || Player.controlRight) ? 50 : 10) / (eleResist ? 2 : 1);
int fluxDoT = ((Player.controlLeft || Player.controlRight) ? 50 : 10);
ApplyDoTDebuff(vermillionFlux, fluxDoT);
ApplyDoTDebuff(elementalMix, 50); // Never inflicted on the player
ApplyDoTDebuff(trueVHex, 50);
@@ -138,7 +138,7 @@ namespace CalamityMod.CalPlayer
ApplyDoTDebuff(dragonFire, dragonfireDoT);
ApplyDoTDebuff(miracleBlight, 60);
ApplyDoTDebuff(banishingFire, 60); // Never inflicted on the player
int rebukeDoT = ((Player.controlLeft || Player.controlRight) ? 80 : 16) / (eleResist ? 2 : 1);
int rebukeDoT = ((Player.controlLeft || Player.controlRight) ? 80 : 16);
ApplyDoTDebuff(auricRebuke, rebukeDoT);
// Slowly increase the sulphuric water poisoning effect. Once it's high enough, the player takes damage and the meter resets.
@@ -275,7 +275,7 @@ namespace CalamityMod.CalPlayer
if (Player.statMana < 0 && Player.Calamity().ChaosStone)
{
totalNegativeLifeRegen -= Player.statMana/100f * Items.Accessories.ChaosStone.LostRegenPer100Mana;
totalNegativeLifeRegen -= (Player.statMana/100f * Items.Accessories.ChaosStone.LostRegenPer100Mana) + Items.Accessories.ChaosStone.BaseLostRegen;
}
//
@@ -493,9 +493,6 @@ namespace CalamityMod.CalPlayer
if (sRegen)
Player.lifeRegen += SpiritGlyph.RegenBoost;
if (fortunesFavor)
Player.lifeRegen += FortunesFavor.FortunesFavorRegenBoost;
if (PinkJellyRegen)
Player.lifeRegen += LifeJelly.AuraRegenBoost;
@@ -588,9 +585,8 @@ namespace CalamityMod.CalPlayer
if (community)
{
int regenBoost = 1 + (int)(TheCommunity.CalculatePower() * TheCommunity.RegenMultiplier);
bool lesserEffect = Player.buffType.Any(i => CalamityBuffSets.DebuffDataset[i] is not null && CalamityBuffSets.DebuffDataset[i].AlcoholLevel > 0);
if (Player.lifeRegen < 0)
Player.lifeRegen += lesserEffect ? 1 : regenBoost;
Player.lifeRegen += regenBoost;
}
if (manaOverloader)
@@ -681,7 +677,7 @@ namespace CalamityMod.CalPlayer
{
Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType<PlaguePulse>(), auraDamage, 0f, Player.whoAmI, 0, 0, 0);
pulseCounter = 0;
if (toxicHeartVisuals)
if (toxicHeartVisuals && !CalamityClientConfig.Instance.MisophoniaSupport)
{
float soundVolume = Utils.Remap(Player.lifeRegen, minLifeRegen, maxLifeRegen, 1f, 0.3f, true);
SoundStyle heartbeat = new("CalamityMod/Sounds/Item/Heartbeat");
@@ -698,6 +694,10 @@ namespace CalamityMod.CalPlayer
public override void NaturalLifeRegen(ref float regen)
{
if (Player.HasBuff<SmashedEvil>())
regen *= 1.5f;
// Honey Dew and its upgrades make natural regen more powerful
if (purity)
regen *= Radiance.NaturalRegenPower;
@@ -708,6 +708,8 @@ namespace CalamityMod.CalPlayer
else if (honeyDew)
regen *= HoneyDew.NaturalRegenPower;
if (Player.HasBuff<FulfilledContract>())
regen *= ThePact.NaturalRegenBoost;
// The Camper counteracts the regen loss while moving horizontally
if (camper && (Player.velocity.X != 0 && Player.grappling[0] <= 0))
{
@@ -739,7 +741,6 @@ namespace CalamityMod.CalPlayer
finalRegen += 4f;
regeneratorDamage = finalRegen * Regenerator.RegenToDamageRatio;
Player.GetDamage<GenericDamageClass>() += regeneratorDamage;
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
+76 -69
View File
@@ -340,7 +340,9 @@ namespace CalamityMod.CalPlayer
}
// Tabi/Master Ninja Gear dash change
if (lastDashWasTabi)
if (Player.dashDelay != -1)
lastDashWasTabi = false;
else if (lastDashWasTabi)
{
Player.dashType = 1;
}
@@ -1136,6 +1138,7 @@ namespace CalamityMod.CalPlayer
Asset<Texture2D> carpetAuric = ExtraTextureRefs.FlyingCarpetAuric;
Asset<Texture2D> carpetOriginal = ExtraTextureRefs.FlyingCarpetVanilla;
TextureAssets.FlyingCarpet = (auricSet ? carpetAuric : carpetOriginal);
TextureAssets.Buff[ModContent.BuffType<BlightedSlime>()] = WorldGen.crimson ? ExtraTextureRefs.BlightedSlimeCrimIcon : ExtraTextureRefs.BlightedSlimeCorroIcon;
for (int l = 0; l < Player.MaxBuffs; l++)
{
@@ -1455,7 +1458,6 @@ namespace CalamityMod.CalPlayer
}
// Death Mode effects
caveDarkness = 0f;
if (CalamityWorld.death || Main.getGoodWorld)
{
if (Player.whoAmI == Main.myPlayer)
@@ -1848,7 +1850,7 @@ namespace CalamityMod.CalPlayer
int numOfPigs = Player.ownedProjectileCounts[ModContent.ProjectileType<Pigion>()];
if (numOfPigs < Player.Calamity().friendlyMinions)
{
int pigDamage = 7;
int pigDamage = 12;
Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, new Vector2(0, -16).RotatedByRandom(MathHelper.Pi), ModContent.ProjectileType<Pigion>(), pigDamage, 0f, Player.whoAmI, 0, numOfPigs + 1);
}
}
@@ -2024,8 +2026,8 @@ namespace CalamityMod.CalPlayer
if (Player.velocity.Y == 0 && fallingBootVelCheckTimer > 10)
{
float power = Utils.Remap(fallingBootVelCheckTimer, 10, 40, 0.1f, 1);
float scaledPower = (float)Math.Pow(power, 3);
int damage = (int)Player.GetBestClassDamage().ApplyTo(1500 * scaledPower); // Damage scales down thrice
float scaledPower = (float)Math.Pow(power, 2);
int damage = (int)Player.GetBestClassDamage().ApplyTo(300 * scaledPower); // Damage scales down thrice
Vector2 playerFeet = Player.Center + Vector2.UnitY * 26 * Player.gravDir;
float blastSize = 120 * power;
@@ -2239,7 +2241,7 @@ namespace CalamityMod.CalPlayer
// First Shadowflame is +1, Statis' Blessing is +2, Statis' Curse inherits both for +3
if (shadowMinions)
Player.maxMinions++;
if (holyMinions)
if (statisMinions)
Player.maxMinions += 2;
if (starTaintedGenerator)
@@ -2332,6 +2334,8 @@ namespace CalamityMod.CalPlayer
arsenalCooldown--;
if (killModeCooldown > 0)
killModeCooldown--;
if (oblivionCooldown > 0)
oblivionCooldown--;
if (ascendantInsigniaCooldown > 0 && ascendantInsigniaBuffTime <= 0)
ascendantInsigniaCooldown--;
if (transformerCooldown > 0)
@@ -2356,8 +2360,6 @@ namespace CalamityMod.CalPlayer
phantomicHeartRegen--;
if (phantomicBulwarkCooldown > 0)
phantomicBulwarkCooldown--;
if (galileoCooldown > 0)
galileoCooldown--;
if (gladiatorTimer > 0)
gladiatorTimer--;
if (dragonRageCooldown > 0)
@@ -2370,8 +2372,6 @@ namespace CalamityMod.CalPlayer
raiderSoundCooldown--;
if (astralStarRainCooldown > 0)
astralStarRainCooldown--;
if (VoidCooldown > 0)
VoidCooldown--;
if (ursaSergeantCooldown > 0)
ursaSergeantCooldown--;
if (generalBandCooldown > 0)
@@ -2443,8 +2443,6 @@ namespace CalamityMod.CalPlayer
ataxiaDmg = 0f;
if (hydroHealTimer > 0f)
hydroHealTimer -= 0.05f;
if (ataxiaDmg < 0f)
ataxiaDmg = 0f;
if (xerocDmg > 0f)
xerocDmg -= 2f;
if (xerocDmg < 0f)
@@ -2537,15 +2535,15 @@ namespace CalamityMod.CalPlayer
if (auralisAuroraCooldown > 0)
auralisAuroraCooldown--;
if (blazingCore)
if (divineProvidence)
{
if (blazingCoreSuccessfulParry > 0)
BlazingCore.HandleStars(Player);
else if (blazingCoreParry > 0)
BlazingCore.HandleParryCountdown(Player);
if (divineProvSuccessfulParry > 0)
DivineProvidence.HandleStars(Player);
else if (divineProvParry > 0)
DivineProvidence.HandleParryCountdown(Player);
}
else if (blazingCoreParry > 0)
blazingCoreParry--;
else if (divineProvParry > 0)
divineProvParry--;
else if (flameLickedShellParry > 0)
{
if (flameLickedShell)
@@ -2553,13 +2551,6 @@ namespace CalamityMod.CalPlayer
else
flameLickedShellParry--;
}
if (shieldOfTheOceanParry > 0)
{
if (shieldOfTheOcean)
ShieldoftheOcean.HandleParryCountdown(Player);
else
shieldOfTheOceanParry--;
}
if (!flameLickedShell && flameLickedShellParry > 0)
flameLickedShellParry--;
@@ -2587,8 +2578,6 @@ namespace CalamityMod.CalPlayer
}
else
adamantiteSetDefenseBoostInterpolant = 0f;
if (ChlorophyteHealDelay > 0)
ChlorophyteHealDelay--;
if (monolithAccursedShader > 0)
monolithAccursedShader--;
if (monolithBossRushShader > 0)
@@ -2776,9 +2765,6 @@ namespace CalamityMod.CalPlayer
if (Player.buffTime[l] <= 2 && buffID == ModContent.BuffType<Buffs.StatBuffs.TarragonImmunity>())
if (Player.whoAmI == Main.myPlayer)
Player.AddCooldown(Cooldowns.TarragonImmunity.ID, TarragonHeadRogue.ImmunityCooldown);
if (CalamityBuffSets.IsDebuff[buffID])
Player.GetDamage<RogueDamageClass>() += TarragonHeadRogue.RogueDamageBoostWhileDebuffed;
}
}
@@ -2844,6 +2830,10 @@ namespace CalamityMod.CalPlayer
if (Player.ichor)
Player.statDefense += 5;
// Holding Walking Cane increases movement speed
if (Player.HeldItem.type == ModContent.ItemType<WalkingCane>())
Player.moveSpeed += WalkingCane.MoveSpeedBoost;
// Fairy Boots bonus
if (fairyBoots)
{
@@ -3207,11 +3197,7 @@ namespace CalamityMod.CalPlayer
// Nebula Headcrab darkness effect
if (!Player.headcovered)
{
float screenObstructionAmt = MathHelper.Clamp(caveDarkness, 0f, 0.95f);
float targetValue = MathHelper.Clamp(screenObstructionAmt * 0.7f, 0.1f, 0.3f);
ScreenObstruction.screenObstruction = MathHelper.Lerp(ScreenObstruction.screenObstruction, screenObstructionAmt, targetValue);
}
ScreenObstruction.screenObstruction = MathHelper.Lerp(ScreenObstruction.screenObstruction, 0f, 0.1f);
// Breath lost while at zero breath
double breathLoss = Main.remixWorld ? (point.Y < abyssLevel1 ? 1D : 0D) : (point.Y > abyssLevel1 ? 1D : 0D);
@@ -3251,7 +3237,7 @@ namespace CalamityMod.CalPlayer
(Player.arcticDivingGear ? 5D : 0D) +
(aquaticEmblem ? 5D : 0D) +
(Player.accMerman ? 8D : 0D) +
(victideBurrowHead ? 2D : 0D) +
(victideSet ? 2D : 0D) +
((aquaticHeart && NPC.downedBoss3) ? 8D : 0D) +
(abyssalDivingSuit ? 8D : 0D) +
externalBreathTickBoost;
@@ -3338,14 +3324,10 @@ namespace CalamityMod.CalPlayer
{
if (Vector2.Distance(Main.LocalPlayer.Center, Main.npc[CalamityGlobalNPC.signus].Center) <= 5200f)
{
float darkRatio = MathHelper.Clamp(caveDarkness, 0f, 1f);
float signusLifeRatio = 1f - (Main.npc[CalamityGlobalNPC.signus].life / Main.npc[CalamityGlobalNPC.signus].lifeMax);
// Reduce the power of Signus darkness based on your light level.
float multiplier = 1f;
float signusDarkness = signusLifeRatio * multiplier;
darkRatio = MathHelper.Clamp(signusDarkness, 0f, 1f);
float darkRatio = MathHelper.Clamp(signusLifeRatio, 0f, 1f);
ScreenObstruction.screenObstruction = MathHelper.Lerp(ScreenObstruction.screenObstruction, LightingEffectsSystem.MaxGFBSignusDarkness * -darkRatio, 0.3f);
}
}
@@ -3680,8 +3662,7 @@ namespace CalamityMod.CalPlayer
--bloodflareCoreRemainingHealOverTime;
}
// Reduce how slow Chilled makes the player, because it's cancerous right now
// Reduce how slow Chilled makes the player
// The moveSpeed multiplier for Chilled in vanilla is 0.75, so we just multiply by 1.166667 here to make it 0.875, effectively cutting the reduction in half
if (Player.chilled)
Player.moveSpeed *= 1f + (1f / 6f);
@@ -3689,7 +3670,7 @@ namespace CalamityMod.CalPlayer
if (purpleHazeStealthTimer > 0)
{
//this is so janky looking but it's the only way I could get it to work properly
if (!(StealthStrikeAvailable() && Player.HeldItem.DamageType == RogueDamageClass.Instance))
if (!(StealthStrikeAvailable() && Player.HeldItem.DamageType.CountsAsClass(RogueDamageClass.Instance)))
Player.GetDamage(DamageClass.Generic) += PurpleHaze.DamageBoost + ((dripPlayer.HasAlcohol(AlcoholType.PurpleHaze) && purpleHaze) ? PurpleHaze.DamageBoost : 0);
else
stealthDamage -= PurpleHaze.StealthDamageLoss + ((dripPlayer.HasAlcohol(AlcoholType.PurpleHaze) && purpleHaze) ? PurpleHaze.StealthDamageLoss : 0);
@@ -3774,10 +3755,7 @@ namespace CalamityMod.CalPlayer
continue;
float distance = (npc.Center - Player.Center).Length();
if (distance < GiantPearl.AuraRadius)
{
npc.AddBuff(ModContent.BuffType<PearlAura>(), 20, false);
npc.Calamity().pearlAuraOwner = Player.whoAmI;
}
}
}
}
@@ -3797,10 +3775,9 @@ namespace CalamityMod.CalPlayer
(reaverSpeed ? ReaverHeadMobility.SetBonusFlightBoost : 0D) +
(angelTreads ? AngelTreads.FlightTimeBoost : 0D) +
(blueCandle ? WeightlessCandle.WingTimeBoost : 0D) +
(soaring ? SoaringPotion.FlightBoost : 0D) +
(soaring ? SoaringPotion.FlightTimeBoost : 0D) +
(prismaticGreaves ? PrismaticGreaves.FlightTimeBoost : 0D) +
(plagueReaper ? PlagueReaperMask.SetBonusFlightTimeBoost : 0D) +
(ascendantInsignia ? AscendantInsignia.FlightTimeBoost : Player.empressBrooch ? 0.33D : 0D) +
externalFlightTimeMultBoost;
if (community)
@@ -3890,7 +3867,7 @@ namespace CalamityMod.CalPlayer
if (eutrophication)
Player.velocity = Vector2.Zero;
if (vaporfied || galvanicCorrosion)
if (vaporfied || galvanicCorrosion || windChilled)
Player.velocity *= 0.98f;
if (molluskHelmet)
@@ -3933,11 +3910,6 @@ namespace CalamityMod.CalPlayer
Player.GetDamage<MagicDamageClass>() += MathHelper.Lerp(0.05f, 0.15f, manaRatio);
}
if (bloodyWormTooth)
{
Player.GetDamage<MeleeDamageClass>() += 0.1f;
}
// While making the rogue update verify if we should allow these to stack again - Shade
if (filthyGlove)
{
@@ -3988,12 +3960,6 @@ namespace CalamityMod.CalPlayer
Player.AddBuff(BuffID.Inferno, 2);
}
if (bloodflareThrowing)
{
if (Player.statLife > (int)(Player.statLifeMax2 * BloodflareHeadRogue.DefenseBoostHealthThreshold))
Player.statDefense += BloodflareHeadRogue.DefenseBoostAboveHealthThreshold;
}
if (bloodflareSummon)
{
if (Player.statLife <= (int)(Player.statLifeMax2 * BloodflareHeadSummon.DefenseBoostHealthThreshold))
@@ -4195,9 +4161,9 @@ namespace CalamityMod.CalPlayer
Player.lavaImmune = true;
Player.fireWalk = true;
Player.buffImmune[ModContent.BuffType<HolyFlames>()] = true;
Player.buffImmune[ModContent.BuffType<Daybroken>()] = true;
Player.buffImmune[BuffID.OnFire] = true;
Player.buffImmune[BuffID.Burning] = true;
Player.buffImmune[BuffID.Daybreak] = true;
if (Player.wingTimeMax > 0)
Player.wingTimeMax = (int)(Player.wingTimeMax * 1.1D);
@@ -4422,12 +4388,6 @@ namespace CalamityMod.CalPlayer
Player.GetDamage<GenericDamageClass>() += beeBoost;
}
if (badgeOfBravery)
{
Player.GetDamage<MeleeDamageClass>() += 0.1f;
Player.GetCritChance<MeleeDamageClass>() += 10;
}
// Amalgam boosts
if (Main.myPlayer == Player.whoAmI)
{
@@ -5013,6 +4973,53 @@ namespace CalamityMod.CalPlayer
RecipeUnlockHandler.HasFoundIceSchematic = true;
shouldSync = true;
}
if (Main.mouseItem.type == ModContent.ItemType<LuxorsGift>() && !RecipeUnlockHandler.HasFoundLuxorsGift)
{
RecipeUnlockHandler.HasFoundLuxorsGift = true;
shouldSync = true;
}
if (Main.mouseItem.type == ModContent.ItemType<FungalSymbiote>() && !RecipeUnlockHandler.HasFoundFungalSymbiote)
{
RecipeUnlockHandler.HasFoundFungalSymbiote = true;
shouldSync = true;
}
if (Main.mouseItem.type == ModContent.ItemType<TrinketofChi>() && !RecipeUnlockHandler.HasFoundTrinketOfChi)
{
RecipeUnlockHandler.HasFoundTrinketOfChi = true;
shouldSync = true;
}
if (Main.mouseItem.type == ModContent.ItemType<FrozenCube>() && !RecipeUnlockHandler.HasFoundFrozenCube)
{
RecipeUnlockHandler.HasFoundFrozenCube = true;
shouldSync = true;
}
if (Main.mouseItem.type == ModContent.ItemType<GladiatorsLocket>() && !RecipeUnlockHandler.HasFoundGladiatorsLocket)
{
RecipeUnlockHandler.HasFoundGladiatorsLocket = true;
shouldSync = true;
}
if (Main.mouseItem.type == ModContent.ItemType<UnstableGraniteCore>() && !RecipeUnlockHandler.HasFoundUnstableGraniteCore)
{
RecipeUnlockHandler.HasFoundUnstableGraniteCore = true;
shouldSync = true;
}
if (Main.mouseItem.type == ModContent.ItemType<CrimsonEffigy>() && !RecipeUnlockHandler.HasFoundCrimsonEffigy)
{
RecipeUnlockHandler.HasFoundCrimsonEffigy = true;
shouldSync = true;
}
if (Main.mouseItem.type == ModContent.ItemType<CorruptionEffigy>() && !RecipeUnlockHandler.HasFoundCorruptionEffigy)
{
RecipeUnlockHandler.HasFoundCorruptionEffigy = true;
shouldSync = true;
}
}
if (shouldSync)
+12 -12
View File
@@ -62,7 +62,7 @@ namespace CalamityMod.CalPlayer
#endregion
#region On Hit NPC
public override void OnHitNPCWithItem(Item item, NPC target, NPC.HitInfo hit, int damageDone)/* tModPorter If you don't need the Item, consider using OnHitNPC instead */
public override void OnHitNPCWithItem(Item item, NPC target, NPC.HitInfo hit, int damageDone)
{
if (Player.whoAmI != Main.myPlayer)
return;
@@ -153,7 +153,7 @@ namespace CalamityMod.CalPlayer
if (cooldown < BlackGlassBand.cooldown)
cooldown = BlackGlassBand.cooldown;
}
if (protolithBangle && item.DamageType == DamageClass.Ranged)
if (protolithBangle && item.DamageType.CountsAsClass(DamageClass.Ranged))
{
int damage = (int)Player.GetBestClassDamage().ApplyTo(ProtolithBangle.damage);
Projectile band = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<ProtolithBangleProjectile>(), damage, -1, Player.whoAmI, target.whoAmI);
@@ -161,7 +161,7 @@ namespace CalamityMod.CalPlayer
if (cooldown < ProtolithBangle.cooldown)
cooldown = ProtolithBangle.cooldown;
}
if (batholithBangle && item.DamageType == DamageClass.Magic)
if (batholithBangle && item.DamageType.CountsAsClass(DamageClass.Magic))
{
int damage = (int)Player.GetBestClassDamage().ApplyTo(BatholithBangle.damage);
Projectile band = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<BatholithBangleProjectile>(), damage, -1, Player.whoAmI, target.whoAmI);
@@ -207,11 +207,16 @@ namespace CalamityMod.CalPlayer
#endregion
#region On Hit NPC With Proj
public override void OnHitNPCWithProj(Projectile proj, NPC target, NPC.HitInfo hit, int damageDone)/* tModPorter If you don't need the Projectile, consider using OnHitNPC instead */
public override void OnHitNPCWithProj(Projectile proj, NPC target, NPC.HitInfo hit, int damageDone)
{
if (Player.whoAmI != Main.myPlayer)
return;
// Don't activate for non-friendly projectiles (obviously).
// Override CanHitNPC if you want a hostile projectile that can also damage enemies.
if (!proj.friendly)
return;
//Undo raider crit after hit
if (!proj.Calamity().stealthStrike && !proj.Calamity().stealthStrikeSubProjectile && raiderCritLifespan > 0f)
{
@@ -363,7 +368,7 @@ namespace CalamityMod.CalPlayer
if (cooldown < BlackGlassBand.cooldown)
cooldown = BlackGlassBand.cooldown;
}
if (protolithBangle && proj.DamageType == DamageClass.Ranged)
if (protolithBangle && proj.DamageType.CountsAsClass(DamageClass.Ranged))
{
int damage = (int)Player.GetBestClassDamage().ApplyTo(ProtolithBangle.damage);
Projectile band = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<ProtolithBangleProjectile>(), damage, -1, Player.whoAmI, target.whoAmI);
@@ -371,7 +376,7 @@ namespace CalamityMod.CalPlayer
if (cooldown < ProtolithBangle.cooldown)
cooldown = ProtolithBangle.cooldown;
}
if (batholithBangle && proj.DamageType == DamageClass.Magic)
if (batholithBangle && proj.DamageType.CountsAsClass(DamageClass.Magic))
{
int damage = (int)Player.GetBestClassDamage().ApplyTo(BatholithBangle.damage);
Projectile band = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<BatholithBangleProjectile>(), damage, -1, Player.whoAmI, target.whoAmI);
@@ -613,7 +618,7 @@ namespace CalamityMod.CalPlayer
ProjLifesteal(target, proj, damageDone, hit.Crit);
ProjOnHit(proj, target, 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>(), hit.Crit, true, proj.noEnchantments);
NPCDebuffs(target, proj.CountsAsClass<MeleeDamageClass>(), proj.CountsAsClass<RangedDamageClass>(), proj.CountsAsClass<MagicDamageClass>(), proj.CountsAsClass<SummonDamageClass>(), proj.CountsAsClass<ThrowingDamageClass>(), proj.CountsAsClass<SummonMeleeSpeedDamageClass>() && /*This is for Pigion to not count as a whip*/!(proj.type == ModContent.ProjectileType<BasicBurst>() && proj.minion), hit.Crit, true, proj.noEnchantments);
// Shattered Community tracks all damage dealt with Rage Mode (ignoring dummies).
if (targetIsDummy)
@@ -1235,11 +1240,6 @@ namespace CalamityMod.CalPlayer
target.AddBuff(BuffType<HadopelagicPressure>(), 180);
if (sulphurSet)
target.AddBuff(BuffID.Poisoned, SulphurousHelmet.SetBonusPoisonDuration);
if (ilSpark && Player.Calamity().countsAsAnyWet)
{
int duration = 60;
target.AddBuff(BuffType<StaticDischarge>(), duration);
}
if (corrosiveSpine)
{
target.AddBuff(BuffType<Irradiated>(), 120);
+4 -12
View File
@@ -11,12 +11,11 @@ namespace CalamityMod.CalPlayer.DrawLayers
public enum EncasementType
{
BlazingCore,
FlameLickedShell,
ShieldoftheOcean
FlameLickedShell
}
public override Position GetDefaultPosition() => new BeforeParent(PlayerDrawLayers.FrontAccFront); //me when the player layer is called front acc front :skull:
public EncasementType GetEncasementTypeFor(CalamityPlayer modPlayer) => modPlayer.blazingCore ? EncasementType.BlazingCore : modPlayer.flameLickedShell ? EncasementType.FlameLickedShell : EncasementType.ShieldoftheOcean;
public EncasementType GetEncasementTypeFor(CalamityPlayer modPlayer) => modPlayer.divineProvidence ? EncasementType.BlazingCore : EncasementType.FlameLickedShell;
public override bool GetDefaultVisibility(PlayerDrawSet drawInfo)
{
@@ -26,9 +25,8 @@ namespace CalamityMod.CalPlayer.DrawLayers
bool visible = drawInfo.shadow == 0f && !drawPlayer.dead;
visible = encasement switch
{
EncasementType.BlazingCore => visible && modPlayer.blazingCoreParry > 0,
EncasementType.BlazingCore => visible && modPlayer.divineProvParry > 0,
EncasementType.FlameLickedShell => visible && modPlayer.flameLickedShellParry > 0,
EncasementType.ShieldoftheOcean => visible && modPlayer.shieldOfTheOceanParry > 0,
_ => false
};
return visible;
@@ -47,7 +45,7 @@ namespace CalamityMod.CalPlayer.DrawLayers
{
case EncasementType.BlazingCore:
tex += "BlazingCoreCrystal";
currentParry = calPlayer.blazingCoreParry;
currentParry = calPlayer.divineProvParry;
defaultOpacity = 0.725f;
scale = 1.15f;
break;
@@ -57,12 +55,6 @@ namespace CalamityMod.CalPlayer.DrawLayers
defaultOpacity = 0.875f;
scale = 1.2f;
break;
case EncasementType.ShieldoftheOcean:
tex += "OceanShieldBubble";
currentParry = calPlayer.shieldOfTheOceanParry;
defaultOpacity = 0.7f;
scale = 1.3f;
break;
default: //should never be this option
tex += "BlazingCoreCrystal";
currentParry = 0;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

+1 -1
View File
@@ -21,7 +21,7 @@ namespace CalamityMod.CalPlayer.DrawLayers
private Asset<Texture2D> springTexture;
private Asset<Texture2D> topTexture;
public override Position GetDefaultPosition() => new BeforeParent(PlayerDrawLayers.Leggings);
public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.PortableStool);
public override bool GetDefaultVisibility(PlayerDrawSet drawInfo)
{
+32 -31
View File
@@ -33,36 +33,37 @@ namespace CalamityMod
// Calamity Boss Flag conditions
//
public static readonly Condition DownedDesertScourge = Create("Drops.DownedDS", () => DownedBossSystem.downedDesertScourge);
public static readonly Condition DownedCrabulon = Create("Drops.DownedCrabulon", () => DownedBossSystem.downedCrabulon);
public static readonly Condition DownedHiveMind = Create("Drops.DownedHM", () => DownedBossSystem.downedHiveMind);
public static readonly Condition DownedPerforator = Create("Drops.DownedPerfs", () => DownedBossSystem.downedPerforator);
public static readonly Condition DownedSlimeGod = Create("Drops.DownedSG", () => DownedBossSystem.downedSlimeGod);
public static readonly Condition DownedCryogen = Create("Drops.DownedCryo", () => DownedBossSystem.downedCryogen);
public static readonly Condition DownedAquaticScourge = Create("Drops.DownedAS", () => DownedBossSystem.downedAquaticScourge);
public static readonly Condition DownedBrimstoneElemental = Create("Drops.DownedBrim", () => DownedBossSystem.downedBrimstoneElemental);
public static readonly Condition DownedCalamitasClone = Create("Drops.DownedCal", () => DownedBossSystem.downedCalamitasClone);
public static readonly Condition DownedLeviathan = Create("Drops.DownedLevi", () => DownedBossSystem.downedLeviathan);
public static readonly Condition DownedAstrumAureus = Create("Drops.DownedAureus", () => DownedBossSystem.downedAstrumAureus);
public static readonly Condition DownedPlaguebringer = Create("Drops.DownedPBG", () => DownedBossSystem.downedPlaguebringer);
public static readonly Condition DownedRavager = Create("Drops.DownedRav", () => DownedBossSystem.downedRavager);
public static readonly Condition DownedAstrumDeus = Create("Drops.DownedAD", () => DownedBossSystem.downedAstrumDeus);
public static readonly Condition DownedGuardians = Create("Drops.DownedGuard", () => DownedBossSystem.downedGuardians);
public static readonly Condition DownedBumblebird = Create("Drops.DownedBirb", () => DownedBossSystem.downedDragonfolly);
public static readonly Condition DownedProvidence = Create("Drops.DownedProv", () => DownedBossSystem.downedProvidence);
public static readonly Condition DownedSignus = Create("Drops.DownedSig", () => DownedBossSystem.downedSignus);
public static readonly Condition DownedStormWeaver = Create("Drops.DownedSW", () => DownedBossSystem.downedStormWeaver);
public static readonly Condition DownedCeaselessVoid = Create("Drops.DownedCV", () => DownedBossSystem.downedCeaselessVoid);
public static readonly Condition DownedPolterghast = Create("Drops.DownedPolter", () => DownedBossSystem.downedPolterghast);
public static readonly Condition DownedOldDuke = Create("Drops.DownedOD", () => DownedBossSystem.downedBoomerDuke);
public static readonly Condition DownedDevourerOfGods = Create("Drops.DownedDoG", () => DownedBossSystem.downedDoG);
public static readonly Condition DownedYharon = Create("Drops.DownedYharon", () => DownedBossSystem.downedYharon);
public static readonly Condition DownedExoMechs = Create("Drops.DownedExos", () => DownedBossSystem.downedExoMechs);
public static readonly Condition DownedSupremeCalamitas = Create("Drops.DownedSCal", () => DownedBossSystem.downedCalamitas);
public static readonly Condition DownedPrimordialWyrm = Create("Drops.DownedAEW", () => DownedBossSystem.downedPrimordialWyrm);
public static readonly Condition DownedClam = Create("Drops.DownedClam", () => DownedBossSystem.downedCLAM);
public static readonly Condition DownedBuffedClam = Create("Drops.DownedClamHM", () => DownedBossSystem.downedCLAMHardMode);
public static readonly Condition DownedGreatSandShark = Create("Drops.DownedGSS", () => DownedBossSystem.downedGSS);
public static readonly Condition DownedDesertScourge = Create("Drops.DownedDS", () => DownedBossSystem.downedDesertScourge);
public static readonly Condition DownedCrabulon = Create("Drops.DownedCrabulon", () => DownedBossSystem.downedCrabulon);
public static readonly Condition DownedHiveMind = Create("Drops.DownedHM", () => DownedBossSystem.downedHiveMind);
public static readonly Condition DownedPerforator = Create("Drops.DownedPerfs", () => DownedBossSystem.downedPerforator);
public static readonly Condition DownedSlimeGod = Create("Drops.DownedSG", () => DownedBossSystem.downedSlimeGod);
public static readonly Condition DownedCryogen = Create("Drops.DownedCryo", () => DownedBossSystem.downedCryogen);
public static readonly Condition DownedAquaticScourge = Create("Drops.DownedAS", () => DownedBossSystem.downedAquaticScourge);
public static readonly Condition DownedBrimstoneElemental = Create("Drops.DownedBrim", () => DownedBossSystem.downedBrimstoneElemental);
public static readonly Condition DownedCalamitasClone = Create("Drops.DownedCal", () => DownedBossSystem.downedCalamitasClone);
public static readonly Condition DownedLeviathan = Create("Drops.DownedLevi", () => DownedBossSystem.downedLeviathan);
public static readonly Condition DownedAstrumAureus = Create("Drops.DownedAureus", () => DownedBossSystem.downedAstrumAureus);
public static readonly Condition DownedPlaguebringer = Create("Drops.DownedPBG", () => DownedBossSystem.downedPlaguebringer);
public static readonly Condition DownedRavager = Create("Drops.DownedRav", () => DownedBossSystem.downedRavager);
public static readonly Condition DownedAstrumDeus = Create("Drops.DownedAD", () => DownedBossSystem.downedAstrumDeus);
public static readonly Condition DownedGuardians = Create("Drops.DownedGuard", () => DownedBossSystem.downedGuardians);
public static readonly Condition DownedBumblebird = Create("Drops.DownedBirb", () => DownedBossSystem.downedDragonfolly);
public static readonly Condition DownedProvidence = Create("Drops.DownedProv", () => DownedBossSystem.downedProvidence);
public static readonly Condition DownedSignus = Create("Drops.DownedSig", () => DownedBossSystem.downedSignus);
public static readonly Condition DownedStormWeaver = Create("Drops.DownedSW", () => DownedBossSystem.downedStormWeaver);
public static readonly Condition DownedCeaselessVoid = Create("Drops.DownedCV", () => DownedBossSystem.downedCeaselessVoid);
public static readonly Condition DownedPolterghast = Create("Drops.DownedPolter", () => DownedBossSystem.downedPolterghast);
public static readonly Condition DownedOldDuke = Create("Drops.DownedOD", () => DownedBossSystem.downedBoomerDuke);
public static readonly Condition DownedDevourerOfGods = Create("Drops.DownedDoG", () => DownedBossSystem.downedDoG);
public static readonly Condition DownedYharon = Create("Drops.DownedYharon", () => DownedBossSystem.downedYharon);
public static readonly Condition DownedExoMechs = Create("Drops.DownedExos", () => DownedBossSystem.downedExoMechs);
public static readonly Condition DownedSupremeCalamitas = Create("Drops.DownedSCal", () => DownedBossSystem.downedCalamitas);
public static readonly Condition DownedPrimordialWyrm = Create("Drops.DownedAEW", () => DownedBossSystem.downedPrimordialWyrm);
public static readonly Condition DownedHorribleHog = Create("Drops.DownedHorribleHog", () => DownedBossSystem.downedHorribleHog);
public static readonly Condition DownedClam = Create("Drops.DownedClam", () => DownedBossSystem.downedCLAM);
public static readonly Condition DownedBuffedClam = Create("Drops.DownedClamHM", () => DownedBossSystem.downedCLAMHardMode);
public static readonly Condition DownedGreatSandShark = Create("Drops.DownedGSS", () => DownedBossSystem.downedGSS);
// Mixed
public static readonly Condition DownedHiveMindOrPerforator = Create("Drops.DownedHMOrPerfs",() => DownedBossSystem.downedHiveMind || DownedBossSystem.downedPerforator);
@@ -70,7 +71,7 @@ namespace CalamityMod
// Vanilla
public static readonly Condition DownedBetsy = Create("Drops.DownedBetsy", () => DownedBossSystem.downedBetsy);
public static readonly Condition DownedDreadnautilus = Create("Drops.DownedDreadnautilus", () => DownedBossSystem.downedDreadnautilus);
//
// Calamity Biome conditions
//
+5 -6
View File
@@ -50,10 +50,6 @@ namespace CalamityMod
[DefaultValue(false)]
public bool BoCSpriteChange { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool EnableVanillaTextureEdits { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool SunkenSeaBackgroundDistortion { get; set; }
@@ -244,8 +240,8 @@ namespace CalamityMod
public float FlightBarPosY { get; set; }
#endregion
#region Music Toggles
[Header("MusicToggles")]
#region Audio Toggles
[Header("AudioToggles")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
@@ -259,6 +255,9 @@ namespace CalamityMod
[DefaultValue(false)]
public bool AbyssLayer3Alt { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(false)]
public bool MisophoniaSupport { get; set; }
#endregion
#region General Gameplay Changes
+190 -31
View File
@@ -1,72 +1,231 @@
using Terraria.ModLoader;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using CalamityMod.Systems.Collections;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.GameInput;
using Terraria.ModLoader;
namespace CalamityMod
{
public class CalamityKeybinds : ModSystem
{
public static ModKeybind AccessoryParryHotKey { get; private set; }
public static ModKeybind AdrenalineHotKey { get; private set; }
public static ModKeybind AmmoCycleHotkey { get; private set; }
public static ModKeybind AngelicAllianceHotKey { get; private set; }
public static ModKeybind ArmorSetBonusHotKey { get; private set; }
public static ModKeybind AscendantInsigniaHotKey { get; private set; }
public static ModKeybind BoosterDashHotKey { get; private set; }
public static ModKeybind DashHotkey { get; private set; }
public static ModKeybind ExoChairSlowdownHotkey { get; private set; }
public static ModKeybind GodSlayerDashHotKey { get; private set; }
public static ModKeybind GravistarSabatonHotkey { get; private set; }
public static ModKeybind NormalityRelocatorHotKey { get; private set; }
public static ModKeybind RageHotKey { get; private set; }
public static ModKeybind SpectralVeilHotKey { get; private set; }
public static ModKeybind SpringStoolJumpHotKey { get; private set; }
public static ModKeybind TransformerHotKey { get; private set; }
public static ModKeybind SwitchGravityHotkey {get; private set;}
public static ModKeybind SwitchGravityHotkey { get; private set; }
public static ModKeybind ExpandDebuffInfo { get; private set; }
public static ModKeybind ThePointerLock {get; private set;}
public static ModKeybind HeldItem { get; private set; }
public static ModKeybind Accessory1 { get; private set; }
public static ModKeybind Accessory2 { get; private set; }
public static ModKeybind Accessory3 { get; private set; }
public static ModKeybind Accessory4 { get; private set; }
public static ModKeybind Accessory5 { get; private set; }
public static ModKeybind Accessory6 { get; private set; }
public static ModKeybind Accessory7 { get; private set; }
public static ModKeybind[] AccessoryKeybinds = [];
public static List<int> RentedKeybinds = [];
/// <summary>
/// We store the keybind then move it to the main list at the end of the frame
/// This ensures that between frames has keybinds in the values needed for drawing
/// This does means there's a 1 frame delay when switching slots for item tooltips to update, but that's never important
/// </summary>
public static List<int> KeybindRentalQueue = [];
public override void Load()
{
// Register keybinds
AccessoryParryHotKey = KeybindLoader.RegisterKeybind(Mod, "ActivateAccessoryParry", "N");
AdrenalineHotKey = KeybindLoader.RegisterKeybind(Mod, "AdrenalineMode", "B");
AmmoCycleHotkey = KeybindLoader.RegisterKeybind(Mod, "AmmoCycle", "Mouse3");
AngelicAllianceHotKey = KeybindLoader.RegisterKeybind(Mod, "AngelicAllianceBlessing", "G");
ArmorSetBonusHotKey = KeybindLoader.RegisterKeybind(Mod, "ArmorSetBonus", "Y");
AscendantInsigniaHotKey = KeybindLoader.RegisterKeybind(Mod, "AscendantInsigniaHotKey", "K");
BoosterDashHotKey = KeybindLoader.RegisterKeybind(Mod, "BoosterDash", "Q");
DashHotkey = KeybindLoader.RegisterKeybind(Mod, "DashDoubleTapOverride", "F");
ExoChairSlowdownHotkey = KeybindLoader.RegisterKeybind(Mod, "ExoChairSlowDown", "RightShift");
GodSlayerDashHotKey = KeybindLoader.RegisterKeybind(Mod, "GodSlayerDash", "H");
GravistarSabatonHotkey = KeybindLoader.RegisterKeybind(Mod, "GravistarSabatonHotkey", "X");
NormalityRelocatorHotKey = KeybindLoader.RegisterKeybind(Mod, "NormalityRelocator", "Z");
RageHotKey = KeybindLoader.RegisterKeybind(Mod, "RageMode", "V");
SpectralVeilHotKey = KeybindLoader.RegisterKeybind(Mod, "SpectralVeilTeleport", "Z");
SpringStoolJumpHotKey = KeybindLoader.RegisterKeybind(Mod, "SpringStoolJumpHotKey", "U");
TransformerHotKey = KeybindLoader.RegisterKeybind(Mod, "TransformerHotKey", "K");
SwitchGravityHotkey = KeybindLoader.RegisterKeybind(Mod, "GravitySwapOverride", "T");
ExpandDebuffInfo = KeybindLoader.RegisterKeybind(Mod, "ExpandDebuffInfo", "LeftControl");
ThePointerLock = KeybindLoader.RegisterKeybind(Mod, "ThePointerLock", "N");
HeldItem = KeybindLoader.RegisterKeybind(Mod, "HeldItem", "NumPad0");
Accessory1 = KeybindLoader.RegisterKeybind(Mod, "Accessory1", "NumPad1");
Accessory2 = KeybindLoader.RegisterKeybind(Mod, "Accessory2", "NumPad2");
Accessory3 = KeybindLoader.RegisterKeybind(Mod, "Accessory3", "NumPad3");
Accessory4 = KeybindLoader.RegisterKeybind(Mod, "Accessory4", "NumPad4");
Accessory5 = KeybindLoader.RegisterKeybind(Mod, "Accessory5", "NumPad5");
Accessory6 = KeybindLoader.RegisterKeybind(Mod, "Accessory6", "NumPad6");
Accessory7 = KeybindLoader.RegisterKeybind(Mod, "Accessory7", "NumPad7");
AccessoryKeybinds = [
Accessory1,
Accessory2,
Accessory3,
Accessory4,
Accessory5,
Accessory6,
Accessory7
];
}
public override void Unload()
{
AccessoryParryHotKey = null;
AdrenalineHotKey = null;
AmmoCycleHotkey = null;
AngelicAllianceHotKey = null;
ArmorSetBonusHotKey = null;
AscendantInsigniaHotKey = null;
BoosterDashHotKey = null;
DashHotkey = null;
ExoChairSlowdownHotkey = null;
GodSlayerDashHotKey = null;
GravistarSabatonHotkey = null;
NormalityRelocatorHotKey = null;
RageHotKey = null;
SpectralVeilHotKey = null;
SpringStoolJumpHotKey = null;
TransformerHotKey = null;
ExpandDebuffInfo = null;
Accessory1 = null;
Accessory2 = null;
Accessory3 = null;
Accessory4 = null;
Accessory5 = null;
Accessory6 = null;
Accessory1 = null;
Accessory7 = null;
AccessoryKeybinds = null;
}
public override void PostUpdateEverything()
{
RentedKeybinds = KeybindRentalQueue.ToList();
KeybindRentalQueue.Clear();
}
}
public class AccessoryKeybindManager : GlobalItem
{
public override bool InstancePerEntity => true;
internal int KeybindId { get; set; }
public override void UpdateEquip(Item item, Player player)
{
if (CalamityItemSets.HasAccessoryKeybind[item.type])
CalamityKeybinds.KeybindRentalQueue.Add(item.type);
}
}
public static class CalamityKeybindsExtensions
{
/// <summary>
/// Gets if the Calamity keybind for the given item was just pressed. <br/>
/// Automatically adjusts between Held Item and Accessory Ability keybinds based on if the item is held and equip order of accessories
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
/// <exception cref="InvalidOperationException"></exception>
public static bool JustPressedKeybind(this Item item)
{
if (item == Main.LocalPlayer.HeldItem)
return CalamityKeybinds.HeldItem.JustPressed;
if (!CalamityItemSets.HasAccessoryKeybind[item.type])
Debug.Assert(false, "Item is not marked as having a Calamity keybind in the HasAccessoryKeybind item set, but is requesting an accessory keybind");
if (CalamityKeybinds.RentedKeybinds.Contains(item.type))
{
int index = CalamityKeybinds.RentedKeybinds.IndexOf(item.type);
if (CalamityKeybinds.AccessoryKeybinds.IndexInRange(index))
return CalamityKeybinds.AccessoryKeybinds[index].JustPressed;
}
return false;
}
/// <summary>
/// Gets if the Calamity keybind for the given item was just released. <br/>
/// Automatically adjusts between Held Item and Accessory Ability keybinds based on if the item is held and equip order of accessories
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
/// <exception cref="InvalidOperationException"></exception>
public static bool JustReleasedKeybind(this Item item)
{
if (item == Main.LocalPlayer.HeldItem)
return CalamityKeybinds.HeldItem.JustReleased;
if (!CalamityItemSets.HasAccessoryKeybind[item.type])
Debug.Assert(false, "Item is not marked as having a Calamity keybind in the HasAccessoryKeybind item set, but is requesting an accessory keybind");
if (CalamityKeybinds.RentedKeybinds.Contains(item.type))
{
int index = CalamityKeybinds.RentedKeybinds.IndexOf(item.type);
if (CalamityKeybinds.AccessoryKeybinds.IndexInRange(index))
return CalamityKeybinds.AccessoryKeybinds[index].JustReleased;
}
return false;
}
/// <summary>
/// Gets if the Calamity keybind for the given item is currently held down. <br/>
/// Automatically adjusts between Held Item and Accessory Ability keybinds based on if the item is held and equip order of accessories
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
/// <exception cref="InvalidOperationException"></exception>
public static bool CurrentlyPressingKeybind(this Item item)
{
if (item == Main.LocalPlayer.HeldItem)
return CalamityKeybinds.HeldItem.Current;
if (!CalamityItemSets.HasAccessoryKeybind[item.type])
Debug.Assert(false, "Item is not marked as having a Calamity keybind in the HasAccessoryKeybind item set, but is requesting an accessory keybind");
if (CalamityKeybinds.RentedKeybinds.Contains(item.type))
{
int index = CalamityKeybinds.RentedKeybinds.IndexOf(item.type);
if (CalamityKeybinds.AccessoryKeybinds.IndexInRange(index))
return CalamityKeybinds.AccessoryKeybinds[index].Current;
}
return false;
}
/// <summary>
/// Gets the Calamity keybind for the given item. <br/>
/// Automatically adjusts between Held Item and Accessory Ability keybinds based on if the item is held and equip order of accessories
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
/// <exception cref="InvalidOperationException"></exception>
public static ModKeybind? GetDynamicModHotkey(this Item item)
{
if (!CalamityItemSets.HasAccessoryKeybind[item.type])
return CalamityKeybinds.HeldItem;
if (CalamityKeybinds.RentedKeybinds.Contains(item.type))
{
int index = CalamityKeybinds.RentedKeybinds.IndexOf(item.type);
if (CalamityKeybinds.AccessoryKeybinds.IndexInRange(index))
return CalamityKeybinds.AccessoryKeybinds[index];
}
return null;
}
public static bool HasBoundDynamicHotkey(this Item item)
{
var h = item.GetDynamicModHotkey();
if (h == null) return false;
if (h?.GetAssignedKeysOrEmpty(PlayerInput.CurrentInputMode).Count == 0)
return false;
return true;
}
}
}
-6
View File
@@ -48,12 +48,6 @@ namespace CalamityMod
Main.QueueMainThreadAction(() => Main.OnPreDraw += PrepareRenderTargets);
}
}
public override void PostSetupContent()
{
// Force open certain ModMenus for various reasons and the added flair of "Hey! Something big has happened! Check it out!"
CalamityMainMenu_Sunken.ForceMenuStyle();
}
#endregion
#region Unload
+3
View File
@@ -1,4 +1,5 @@
using System;
using CalamityMod.Items.Accessories.Wings;
using CalamityMod.NPCs.DevourerofGods;
using CalamityMod.Rarities;
using CalamityMod.Utilities.Daybreak;
@@ -35,6 +36,8 @@ namespace CalamityMod.ChatTags
return new CalamityRed.CustomTextSnippet(text);
if (options.Equals("exo", StringComparison.OrdinalIgnoreCase))
return new ExoticRainbow.CustomTextSnippet(text);
if (options.Equals("doze", StringComparison.OrdinalIgnoreCase))
return new TiredTailTextEffects(text);
return new TextSnippet(text);
}
}
+53
View File
@@ -0,0 +1,53 @@
using System;
using CalamityMod.NPCs.DevourerofGods;
using CalamityMod.Rarities;
using CalamityMod.Utilities.Daybreak;
using CalamityMod.Utilities.Daybreak.Buffers;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Graphics;
using Terraria;
using Terraria.GameContent;
using Terraria.UI.Chat;
namespace CalamityMod.ChatTags
{
public sealed class SmallTextHandler : AbstractTagHandler<SmallTextHandler>
{
protected override string[] TagNames { get; } = ["scale"];
public override TextSnippet Parse(string text, Color baseColor = new(), string options = null)
{
if (float.TryParse(options, out float result))
return new SmallTextSnippet(text, baseColor,result);
return new SmallTextSnippet(text, baseColor);
}
}
public sealed class SmallTextSnippet(string text) : TextSnippet
{
public SmallTextSnippet( string text, Color color, float scale = 0.5f) : this(text)
{
textColor = color;
Scale = scale;
}
Color textColor = Color.White;
public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = new Vector2(), Color color = new Color(), float scale = 1)
{
color = textColor;
size = new Vector2(GetStringLength(FontAssets.MouseText.Value), FontAssets.MouseText.Value.MeasureString(" ").Y * Scale);
if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0) && Color != Color.Transparent)
{
ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, FontAssets.MouseText.Value, text, position, color, 0, Vector2.Zero, new Vector2(scale));
}
return true;
}
public override float GetStringLength(DynamicSpriteFont font)
{
float size = font.MeasureString(text).X;
return size * Scale;
}
}
}
-78
View File
@@ -1,78 +0,0 @@
using System;
using CalamityMod.Items.Armor.Victide;
using CalamityMod.UI;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.Localization;
using static Terraria.ModLoader.ModContent;
namespace CalamityMod.Cooldowns
{
public class BubblyBurrow : CooldownHandler
{
public bool PowerActive => instance.timeLeft > VictideHeadBurrow.BurrowCooldown;
public float PowerPercent => (instance.timeLeft - VictideHeadBurrow.BurrowCooldown) / (float)VictideHeadBurrow.BurrowDuration;
public static new string ID => "BubblyBurrow";
public override bool ShouldDisplay => true;
public override LocalizedText DisplayName => CalamityUtils.GetText("UI.Cooldowns.BubblyBurrow" + (PowerActive ? "Active" : "Cooldown"));
public override string Texture => PowerActive ? "CalamityMod/Cooldowns/BubblyBurrow" : "CalamityMod/Cooldowns/BubblyBurrowCooldown";
public override string OutlineTexture => "CalamityMod/Cooldowns/BubblyBurrowOutline";
public override string OverlayTexture => "CalamityMod/Cooldowns/BubblyBurrowOverlay";
public override Color OutlineColor => new Color(158, 158, 255);
public override Color CooldownStartColor => PowerActive ? Color.Lerp(new Color(255, 170, 204), new Color(72, 125, 204), PowerPercent) : new Color(72, 125, 204);
public override Color CooldownEndColor => PowerActive ? Color.Lerp(new Color(255, 170, 204), new Color(97, 255, 255), PowerPercent) : new Color(97, 255, 255);
public override SoundStyle? EndSound => SoundID.Item85;
public override void OnCompleted()
{
Vector2 playerVelocity = instance.player.velocity / 8f;
if (!Main.dedServ)
{
for (int i = 0; i < 16; i++)
{
Vector2 bubblePos = instance.player.MountedCenter + Main.rand.NextVector2Circular(50f, 50f);
Vector2 bubbleSpeed = Main.rand.NextVector2Circular(1f, 1f) + playerVelocity;
Gore bubble = Gore.NewGoreDirect(instance.player.GetSource_Misc("1"), bubblePos, bubbleSpeed, 411, Main.rand.NextFloat(0.8f, 1.6f));
bubble.timeLeft = 24 + Main.rand.Next(13);
bubble.type = 411;
}
}
}
//Charge down at first, and then charge back up
private float AdjustedCompletion => CooldownRackUI.DebugFullDisplay ? CooldownRackUI.DebugForceCompletion : PowerActive ? PowerPercent : 1 - (instance.timeLeft / (float)VictideHeadBurrow.BurrowCooldown);
public override void ApplyBarShaders(float opacity)
{
//Use the adjusted completion
GameShaders.Misc["CalamityMod:CircularBarShader"].UseOpacity(opacity);
GameShaders.Misc["CalamityMod:CircularBarShader"].UseSaturation(AdjustedCompletion);
GameShaders.Misc["CalamityMod:CircularBarShader"].UseColor(CooldownStartColor);
GameShaders.Misc["CalamityMod:CircularBarShader"].UseSecondaryColor(CooldownEndColor);
GameShaders.Misc["CalamityMod:CircularBarShader"].Apply();
}
public override void DrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale)
{
Texture2D sprite = Request<Texture2D>(Texture).Value;
Texture2D outline = Request<Texture2D>(OutlineTexture).Value;
Texture2D overlay = Request<Texture2D>(OverlayTexture).Value;
//Draw the outline
spriteBatch.Draw(outline, position, null, OutlineColor * opacity, 0, outline.Size() * 0.5f, scale, SpriteEffects.None, 0f);
//Draw the icon
spriteBatch.Draw(sprite, position, null, Color.White * opacity, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f);
//Draw the small overlay
int lostHeight = (int)Math.Ceiling(overlay.Height * AdjustedCompletion);
Rectangle crop = new Rectangle(0, lostHeight, overlay.Width, overlay.Height - lostHeight);
spriteBatch.Draw(overlay, position + Vector2.UnitY * lostHeight * scale, crop, OutlineColor * opacity * 0.9f, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f);
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 B

+17
View File
@@ -0,0 +1,17 @@
using Microsoft.Xna.Framework;
using Terraria.Localization;
namespace CalamityMod.Cooldowns
{
public class OblivionCooldown : CooldownHandler
{
public static new string ID => "OblivionCooldown";
public override bool ShouldDisplay => true;
public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}");
public override string Texture => "CalamityMod/Projectiles/Melee/Yoyos/OblivionYoyo";
public override string OutlineTexture => "CalamityMod/Cooldowns/OblivionCooldownOutline";
public override Color OutlineColor => Color.MediumVioletRed;
public override Color CooldownStartColor => Color.DarkRed;
public override Color CooldownEndColor => Color.Red;
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

+1 -1
View File
@@ -25,6 +25,6 @@ namespace CalamityMod.Cooldowns
public override Color CooldownStartColor => Color.Brown;
public override Color CooldownEndColor => Color.Khaki;
public override SoundStyle? EndSound => new("CalamityMod/Sounds/Item/AscendantOff");
public override SoundStyle? EndSound => new("CalamityMod/Sounds/Item/StooldownResolve");
}
}
+49
View File
@@ -18,6 +18,16 @@ namespace CalamityMod.CustomRecipes
public static bool HasFoundHellSchematic = false;
public static bool HasFoundIceSchematic = false;
public static bool HasFoundLuxorsGift = false;
public static bool HasFoundFungalSymbiote = false;
public static bool HasFoundTrinketOfChi = false;
public static bool HasFoundFrozenCube = false;
public static bool HasFoundGladiatorsLocket = false;
public static bool HasFoundUnstableGraniteCore = false;
public static bool HasFoundCrimsonEffigy = false;
public static bool HasFoundCorruptionEffigy = false;
public static void Save(List<string> boolTagContainer)
{
boolTagContainer.AddWithCondition("HasUnlockedT1ArsenalRecipes", HasUnlockedT1ArsenalRecipes);
@@ -31,6 +41,15 @@ namespace CalamityMod.CustomRecipes
boolTagContainer.AddWithCondition("HasFoundJungleSchematic", HasFoundJungleSchematic);
boolTagContainer.AddWithCondition("HasFoundHellSchematic", HasFoundHellSchematic);
boolTagContainer.AddWithCondition("HasFoundIceSchematic", HasFoundIceSchematic);
boolTagContainer.AddWithCondition("HasFoundLuxorsGift", HasFoundLuxorsGift);
boolTagContainer.AddWithCondition("HasFoundFungalSymbiote", HasFoundFungalSymbiote);
boolTagContainer.AddWithCondition("HasFoundTrinketOfChi", HasFoundTrinketOfChi);
boolTagContainer.AddWithCondition("HasFoundFrozenCube", HasFoundFrozenCube);
boolTagContainer.AddWithCondition("HasFoundGladiatorsLocket", HasFoundGladiatorsLocket);
boolTagContainer.AddWithCondition("HasFoundUnstableGraniteCore", HasFoundUnstableGraniteCore);
boolTagContainer.AddWithCondition("HasFoundCrimsonEffigy", HasFoundCrimsonEffigy);
boolTagContainer.AddWithCondition("HasFoundCorruptionEffigy", HasFoundCorruptionEffigy);
}
public static void Load(IList<string> boolTagContainer)
@@ -46,6 +65,16 @@ namespace CalamityMod.CustomRecipes
HasFoundJungleSchematic = boolTagContainer.Contains("HasFoundJungleSchematic");
HasFoundHellSchematic = boolTagContainer.Contains("HasFoundHellSchematic");
HasFoundIceSchematic = boolTagContainer.Contains("HasFoundIceSchematic");
HasFoundLuxorsGift = boolTagContainer.Contains("HasFoundLuxorsGift");
HasFoundFungalSymbiote = boolTagContainer.Contains("HasFoundFungalSymbiote");
HasFoundTrinketOfChi = boolTagContainer.Contains("HasFoundTrinketOfChi");
HasFoundFrozenCube = boolTagContainer.Contains("HasFoundFrozenCube");
HasFoundGladiatorsLocket = boolTagContainer.Contains("HasFoundGladiatorsLocket");
HasFoundUnstableGraniteCore = boolTagContainer.Contains("HasFoundUnstableGraniteCore");
HasFoundCrimsonEffigy = boolTagContainer.Contains("HasFoundCrimsonEffigy");
HasFoundCorruptionEffigy = boolTagContainer.Contains("HasFoundCorruptionEffigy");
}
public static void SendData(BinaryWriter writer)
@@ -63,9 +92,19 @@ namespace CalamityMod.CustomRecipes
BitsByte flags2 = new BitsByte();
flags2[0] = HasFoundHellSchematic;
flags2[1] = HasFoundIceSchematic;
flags2[2] = HasFoundLuxorsGift;
flags2[3] = HasFoundFungalSymbiote;
flags2[4] = HasFoundTrinketOfChi;
flags2[5] = HasFoundGladiatorsLocket;
flags2[6] = HasFoundUnstableGraniteCore;
flags2[7] = HasFoundCrimsonEffigy;
BitsByte flags3 = new BitsByte();
flags3[0] = HasFoundCorruptionEffigy;
writer.Write(flags);
writer.Write(flags2);
writer.Write(flags3);
}
public static void ReceiveData(BinaryReader reader)
@@ -83,6 +122,16 @@ namespace CalamityMod.CustomRecipes
BitsByte flags2 = reader.ReadByte();
HasFoundHellSchematic = flags2[0];
HasFoundIceSchematic = flags2[1];
HasFoundLuxorsGift = flags2[2];
HasFoundFungalSymbiote = flags2[3];
HasFoundTrinketOfChi = flags2[4];
HasFoundGladiatorsLocket = flags2[5];
HasFoundUnstableGraniteCore = flags2[6];
HasFoundCrimsonEffigy = flags2[7];
BitsByte flags3 = reader.ReadByte();
HasFoundCorruptionEffigy = flags3[0];
}
}
}
+18
View File
@@ -0,0 +1,18 @@
using Terraria.ModLoader;
namespace CalamityMod
{
public class AllClassDamageClass : DamageClass
{
internal static AllClassDamageClass Instance;
public override void Load() => Instance = this;
public override void Unload() => Instance = null;
public override StatInheritanceData GetModifierInheritance(DamageClass damageClass)
{
return StatInheritanceData.Full;
}
public override bool GetEffectInheritance(DamageClass damageClass) => true;
}
}
+24 -27
View File
@@ -1,4 +1,5 @@
using CalamityMod.Items.Weapons.Melee;
using System;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Projectiles.Melee;
using Microsoft.Xna.Framework;
using Terraria;
@@ -72,7 +73,12 @@ namespace CalamityMod.DataStructures
/// <param name="CanLunge">>Used by evil attunements to check if a regular dash is avaialble</param>
/// <param name="PowerLungeCounter">Used by evil attunements to check if a strong dash is avaialble</param>
/// <returns></returns>
public virtual bool Shoot(Player player, IEntitySource source, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack, ref int Combo, ref int CanLunge, ref int PowerLungeCounter) => true;
public virtual bool Shoot(Player player, IEntitySource source, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack, ref int Combo, ref int CanLunge, ref int PowerLungeCounter)
{
Projectile blade = Projectile.NewProjectileDirect(source, position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
blade.originalDamage = (int)MathF.Round(blade.originalDamage * DamageMultiplier);
return false;
}
public virtual void PassiveEffect(Player player, IEntitySource source, ref int UseTimer, ref bool Procced, Projectile projectile = null)
{
@@ -155,20 +161,14 @@ namespace CalamityMod.DataStructures
public override bool Shoot(Player player, IEntitySource source, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack, ref int Combo, ref int CanLunge, ref int PowerLungeCounter)
{
switch (Combo)
Projectile blade = Projectile.NewProjectileDirect(source, player.Center, new Vector2(speedX, speedY), ProjectileType<BitingEmbrace>(), damage, knockBack, player.whoAmI, 0, 15);
blade.originalDamage = (int)MathF.Round(blade.originalDamage * DamageMultiplier);
if (Combo > 0)
{
case 0:
Projectile.NewProjectile(source, player.Center, new Vector2(speedX, speedY), ProjectileType<BitingEmbrace>(), damage, knockBack, player.whoAmI, 0, 15);
break;
case 1:
Projectile.NewProjectile(source, player.Center, new Vector2(speedX, speedY), ProjectileType<BitingEmbrace>(), damage, knockBack, player.whoAmI, 1, 20);
break;
case 2:
Projectile.NewProjectile(source, player.Center, new Vector2(speedX, speedY), ProjectileType<BitingEmbrace>(), damage, knockBack, player.whoAmI, 2, 50);
break;
blade.ai[0] = Combo;
blade.ai[1] = (Combo == 2 ? 50 : 20);
}
Combo++;
if (Combo > 2)
Combo = 0;
@@ -202,7 +202,8 @@ namespace CalamityMod.DataStructures
public override bool Shoot(Player player, IEntitySource source, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack, ref int Combo, ref int CanLunge, ref int PowerLungeCounter)
{
Projectile.NewProjectile(source, player.Center, new Vector2(speedX, speedY), ProjectileType<DecaysRetort>(), damage, knockBack, player.whoAmI, 26, (float)CanLunge);
Projectile blade = Projectile.NewProjectileDirect(source, player.Center, new Vector2(speedX, speedY), ProjectileType<DecaysRetort>(), damage, knockBack, player.whoAmI, 26, (float)CanLunge);
blade.originalDamage = (int)MathF.Round(blade.originalDamage * DamageMultiplier);
CanLunge = 0;
return false;
}
@@ -283,20 +284,14 @@ namespace CalamityMod.DataStructures
public override bool Shoot(Player player, IEntitySource source, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack, ref int Combo, ref int CanLunge, ref int PowerLungeCounter)
{
switch (Combo)
Projectile blade = Projectile.NewProjectileDirect(source, player.Center, new Vector2(speedX, speedY), ProjectileType<TrueBitingEmbrace>(), damage, knockBack, player.whoAmI, 0, 15);
blade.originalDamage = (int)MathF.Round(blade.originalDamage * DamageMultiplier);
if (Combo > 0)
{
case 0:
Projectile.NewProjectile(source, player.Center, new Vector2(speedX, speedY), ProjectileType<TrueBitingEmbrace>(), damage, knockBack, player.whoAmI, 0, 15);
break;
case 1:
Projectile.NewProjectile(source, player.Center, new Vector2(speedX, speedY), ProjectileType<TrueBitingEmbrace>(), damage, knockBack, player.whoAmI, 1, 20);
break;
case 2:
Projectile.NewProjectile(source, player.Center, new Vector2(speedX, speedY), ProjectileType<TrueBitingEmbrace>(), damage, knockBack, player.whoAmI, 2, 50);
break;
blade.ai[0] = Combo;
blade.ai[1] = (Combo == 2 ? 50 : 20);
}
Combo++;
if (Combo > 2)
Combo = 0;
@@ -331,6 +326,7 @@ namespace CalamityMod.DataStructures
public override bool Shoot(Player player, IEntitySource source, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack, ref int Combo, ref int CanLunge, ref int PowerLungeCounter)
{
Projectile whipProj = Projectile.NewProjectileDirect(source, player.Center, new Vector2(speedX, speedY), ProjectileType<TrueGrovetendersTouch>(), damage, knockBack, player.whoAmI, 0, 0);
whipProj.originalDamage = (int)MathF.Round(whipProj.originalDamage * DamageMultiplier);
if (whipProj.ModProjectile is TrueGrovetendersTouch whip)
whip.flipped = Combo == 0 ? 1 : -1;
Combo++;
@@ -373,6 +369,7 @@ namespace CalamityMod.DataStructures
PowerLungeCounter = 0;
}
Projectile proj = Projectile.NewProjectileDirect(source, player.Center, new Vector2(speedX, speedY), ProjectileType<TrueDecaysRetort>(), damage, knockBack, player.whoAmI, 26f, CanLunge > 0 ? 1f : 0f);
proj.originalDamage = (int)MathF.Round(proj.originalDamage * DamageMultiplier);
if (proj.ModProjectile is TrueDecaysRetort rapier)
rapier.ChargedUp = powerLungeAvailable;
CanLunge--;
+48 -17
View File
@@ -1,7 +1,6 @@
using System;
using CalamityMod.Buffs.Alcohol;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Items.Accessories;
using CalamityMod.Systems.Collections;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
@@ -157,8 +156,8 @@ namespace CalamityMod.DataStructures
public static StatModifier ApplyScalingToStatModifer(StatModifier Modifer, float scaling)
{
StatModifier output = new();
output += (Modifer.Additive-1) * scaling;
output *= 1 + (Modifer.Multiplicative-1) * scaling;
output += (Modifer.Additive - 1) * scaling;
output *= 1 + (Modifer.Multiplicative - 1) * scaling;
output.Base = Modifer.Base * scaling;
output.Flat = Modifer.Flat * scaling;
return output;
@@ -172,9 +171,9 @@ namespace CalamityMod.DataStructures
public static StatModifier ForceModifierPositiveWithScaling(StatModifier Modifer, float scaling)
{
StatModifier output = new();
output += MathHelper.Max((Modifer.Additive - 1) * scaling,0);
output *= MathHelper.Max(1 + (Modifer.Multiplicative - 1) * scaling,1);
output.Base = MathHelper.Max(Modifer.Base * scaling,0);
output += MathHelper.Max((Modifer.Additive - 1) * scaling, 0);
output *= MathHelper.Max(1 + (Modifer.Multiplicative - 1) * scaling, 1);
output.Base = MathHelper.Max(Modifer.Base * scaling, 0);
output.Flat = MathHelper.Max(Modifer.Flat * scaling, 0);
return output;
}
@@ -185,7 +184,7 @@ namespace CalamityMod.DataStructures
/// </summary>
public void DefaultUpdateOnPlayer(Player player, int buffType, ref int buffIndex, ref int damage)
{
}
/// <summary>
@@ -206,17 +205,17 @@ namespace CalamityMod.DataStructures
))))
:
// Bane doesn't scale with debuff multipliers. This should be implemented as a default feature you can apply to debuffs at some point.
buffType == ModContent.BuffType<Bane>() ? cnpc.ActiveTypelessDebuffMultiplier : StatModifier.Default;
buffType == ModContent.BuffType<Bane>() ? StatModifier.Default : cnpc.ActiveTypelessDebuffMultiplier;
//Ensure at least 25% effectiveness
if (totalScaling.Multiplicative <= 0.25f)
totalScaling.Multiplicative = 0.25f;
totalScaling.Multiplicative = 0.25f;
if (totalScaling.Additive < 0.25f)
totalScaling.Additive = 0.25f;
totalDPS = totalScaling.ApplyTo(totalDPS);
var totalDPSAdjusted = totalDPS-EnemyVanillaRegenToCancelOut;
npc.Calamity().ApplyDPSDebuff((int)(totalDPSAdjusted), (int)Math.Max(totalDPS*MultiplierDamageTickSize,MinimumDamageTickSize), ref npc.lifeRegen, ref damage);
var totalDPSAdjusted = totalDPS - EnemyVanillaRegenToCancelOut;
npc.Calamity().ApplyDPSDebuff((int)(totalDPSAdjusted), (int)Math.Max(totalDPS * MultiplierDamageTickSize, MinimumDamageTickSize), ref npc.lifeRegen, ref damage);
}
/// <summary>
/// DoT functionality that takes into account Electric debuff's 4x DPS when moving
@@ -278,7 +277,7 @@ namespace CalamityMod.DataStructures
// If there are no Daybreak impaled spears, Daybroken has 1x potency (it was applied some other way)
int adjustedSpears = Math.Max(1, numImpaledSpears);
int baseDaybreakDoTValue = (int)(npc.Calamity().ActiveHeatDebuffMultiplier.ApplyTo(Daybroken.EnemyLostRegen) + (Daybroken.EnemyLostRegen * (adjustedSpears - 1)));
int totalDPSAdjusted = baseDaybreakDoTValue - Daybroken.EnemyVanillaRegenToCancelOut*numImpaledSpears;
int totalDPSAdjusted = baseDaybreakDoTValue - Daybroken.EnemyVanillaRegenToCancelOut * numImpaledSpears;
if (numImpaledSpears == 0)
{
totalDPSAdjusted -= Daybroken.EnemyVanillaRegenToCancelOut;
@@ -291,10 +290,10 @@ namespace CalamityMod.DataStructures
public static void OiledNPCMethod(NPC npc, int buffType, ref int buffIndex, ref int damage)
{
var cnpc = npc.Calamity();
double totalDPS = ApplyScalingToStatModifer(cnpc.ActiveHeatDebuffMultiplier,Oiled.HeatDebuffScaling).ApplyTo(Oiled.EnemyLostRegen);
double totalDPS = ApplyScalingToStatModifer(cnpc.ActiveHeatDebuffMultiplier, Oiled.HeatDebuffScaling).ApplyTo(Oiled.EnemyLostRegen);
if (totalDPS <= 0)
return;
npc.Calamity().ApplyDPSDebuff((int)(totalDPS), damage+(int)Math.Max(totalDPS * Oiled.MultiplierDamageTickSize, Oiled.MinimumDamageTickSize), ref npc.lifeRegen, ref damage);
npc.Calamity().ApplyDPSDebuff((int)(totalDPS), damage + (int)Math.Max(totalDPS * Oiled.MultiplierDamageTickSize, Oiled.MinimumDamageTickSize), ref npc.lifeRegen, ref damage);
}
/// <summary>
/// Has Dryad's Bane scale with Calamity's town NPC buffs
@@ -360,8 +359,8 @@ namespace CalamityMod.DataStructures
};
public static DebuffData Shadowflame = new DebuffData()
{
EnemyLostRegen = 60,
EnemyVanillaRegenToCancelOut = 60,
EnemyLostRegen = 40,
EnemyVanillaRegenToCancelOut = 30,
HeatDebuffScaling = 1
};
public static DebuffData Daybroken = new DebuffData()
@@ -419,5 +418,37 @@ namespace CalamityMod.DataStructures
NPCLifeRegenMethod = DryadsBaneNPCMethod
};
#endregion
#region Helpers
public static int GetDebuffRegenValue(NPC npc, int type)
{
var debuffData = CalamityBuffSets.DebuffDataset[type];
if (debuffData == null)
return 0;
var oldRegen = npc.lifeRegen;
var oldCount = npc.lifeRegenCount;
int dmg = 1;
npc.lifeRegenCount = 0;
npc.lifeRegen = 0;
int index = npc.FindBuffIndex(type);
if (debuffData == Oiled)
{
Oiled.NPCLifeRegenMethod(npc, BuffID.Oiled, ref index, ref dmg);
}
else {
debuffData.NPCLifeRegenMethod(npc, type, ref index, ref dmg);
npc.lifeRegen -= debuffData.EnemyVanillaRegenToCancelOut; //ensure vanilla dmg values aren't counted
}
int done = npc.lifeRegen;
npc.lifeRegen = oldRegen;
npc.lifeRegenCount = oldCount;
return done;
}
#endregion
}
}
+6 -4
View File
@@ -1,14 +1,16 @@
sampler baseTexture : register(s0);
sampler distortionTexture : register(s1);
float time;
float noiseScale;
float distortionStrength;
float2 timeOffset;
float2 noiseScaleStrength;
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR
{
float2 distortedCoords = coords * noiseScaleStrength.x + timeOffset;
float distortion = tex2D(distortionTexture, distortedCoords).r * noiseScaleStrength.y;
return tex2D(baseTexture, coords + distortion) * sampleColor.a;
float2 distortedCoords = coords + float2(time * timeOffset.x, time * timeOffset.y);
float distortion = tex2D(distortionTexture, distortedCoords * noiseScale).r;
return tex2D(baseTexture, coords + distortion * distortionStrength);
}
technique Technique1
Binary file not shown.
+2 -2
View File
@@ -3,7 +3,7 @@ sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uSaturation; // Saturation gets used as a "true" opacity
float uRotation;
float uTime;
float4 uSourceRect;
@@ -20,7 +20,7 @@ float4 Recolor(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
float4 color = tex2D(uImage0, coords);
float originalAlpha = color.a;
color.rbg = lerp(color.rbg, uColor, uOpacity);
return color * originalAlpha;
return color * originalAlpha * uSaturation;
}
Binary file not shown.
+30 -2
View File
@@ -129,10 +129,10 @@ namespace CalamityMod.Effects
// Used by Devourer of Gods. Renders the portal that he escapes through at the end of phase 1.
internal static Asset<Effect> DoGPortalShader;
// Used to render all-encompassing fog in the Floral Paradise biome.
// Unused, renders all-encompassing fog.
internal static Asset<Effect> FogShader;
// Used to render background water features in the Floral Paradise biome.
// Unused, renders background water features.
internal static Asset<Effect> WaterfallShader;
// Metaballs. See the MetaballManager class for comments on how this system works.
@@ -257,6 +257,18 @@ namespace CalamityMod.Effects
// The shader effect used for Voidragon's Abyssal Fire laser projectile.
internal static Asset<Effect> AbyssalFireShader;
// A simple chromatic abberation effect shader with support for custom abberation colors.
internal static Asset<Effect> ChromaticAbberationShader;
// Distorts a texture using a sine wave of specified amplitude and frequency either vertically or horizontally.
internal static Asset<Effect> SineWaveDistortionShader;
// The swirling aura effect seen around Horrible Hog while its idling.
internal static Asset<Effect> HorribleHogAuraShader;
// The shader effect for the primitive trails drawn for Providence's HolyBurnOrb/HolyLight projectiles.
internal static Asset<Effect> ProvidenceHolyOrbTrailShader;
#endregion
#region Big E's Shaders
@@ -264,6 +276,7 @@ namespace CalamityMod.Effects
internal static Asset<Effect> SeaPrismColorBlendingShader;
internal static Asset<Effect> Dissolve;
internal static Asset<Effect> PaletteSwap;
internal static Asset<Effect> BrainOfCthulhuForcefield;
#endregion
@@ -519,6 +532,18 @@ namespace CalamityMod.Effects
AbyssalFireShader = LoadShader("AbyssalFireShader");
RegisterMiscShader(AbyssalFireShader, "LaserPass", "AbyssalFire");
ChromaticAbberationShader = LoadShader("ChromaticAbberationShader");
RegisterMiscShader(ChromaticAbberationShader, "ChormaAbberationPass", "ChromaticAbberation");
SineWaveDistortionShader = LoadShader("SineWaveDistortionShader");
RegisterMiscShader(SineWaveDistortionShader, "SinePass", "SineWaveDistortion");
HorribleHogAuraShader = LoadShader("HorribleHogAuraShader");
RegisterMiscShader(HorribleHogAuraShader, "ScaryAuraPass", "HorribleHogAura");
ProvidenceHolyOrbTrailShader = LoadShader("ProvidenceHolyOrbTrailShader");
RegisterMiscShader(ProvidenceHolyOrbTrailShader, "TrailPass", "ProvidenceHolyOrbTrail");
#endregion
#region Loading Big E's Shaders
@@ -531,6 +556,9 @@ namespace CalamityMod.Effects
Dissolve = LoadShader("Dissolve");
RegisterMiscShader(Dissolve, "DissolvePass", "Dissolve");
PaletteSwap = LoadShader("PaletteSwap");
RegisterMiscShader(PaletteSwap, "PaletteSwapPass", "PaletteSwap");
BrainOfCthulhuForcefield = LoadShader("ScreenShaders/BrainOfCthulhuForcefield");
RegisterScreenShader(BrainOfCthulhuForcefield, "BoCShieldPass", "BrainOfCthulhuForcefield");
#endregion
+48
View File
@@ -0,0 +1,48 @@
sampler baseTexture : register(s0);
bool useCustomColors;
float abberationStrength;
float2 impactPosition;
float3 primaryAbberationColor;
float3 secondaryAbberationColor;
float3 tertiaryAbberationColor;
float3 ChromaticAbberation(sampler2D samplerTexture, float2 coords)
{
// Calculate the distortion level of each color.
float separation = abberationStrength / distance(coords, impactPosition);
float rColor = tex2D(samplerTexture, coords + float2(-1, -1) * separation).r;
float gColor = tex2D(samplerTexture, coords + float2(1, -1) * separation).g;
float bColor = tex2D(samplerTexture, coords + float2(0, 1) * separation).b;
// Return the three calculations as one singular color.
float3 returnColor = float3(rColor, gColor, bColor);
return returnColor;
}
float3 ChromaticAbberation_CustomColors(sampler2D samplerTexture, float2 coords)
{
// Calculate the distortion level of each color.
float separation = abberationStrength / distance(coords, impactPosition);
float4 pColor = tex2D(samplerTexture, coords + float2(-1, -1) * separation) * float4(primaryAbberationColor, 1);
float4 sColor = tex2D(samplerTexture, coords + float2(1, -1) * separation) * float4(primaryAbberationColor, 1);
float4 tColor = tex2D(samplerTexture, coords + float2(0, 1) * separation) * float4(primaryAbberationColor, 1);
// Return the three calculations as one singular color.
float3 returnColor = saturate(pColor + sColor + tColor);
return returnColor;
}
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float3 color = useCustomColors ? ChromaticAbberation_CustomColors(baseTexture, coords) : ChromaticAbberation(baseTexture, coords);
return sampleColor * float4(color, 1.0);
}
technique Technique1
{
pass ChormaAbberationPass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
Binary file not shown.
+68
View File
@@ -0,0 +1,68 @@
sampler vortexNoiseTexture : register(s0);
sampler vortexNoiseTexture2 : register(s1);
sampler distortionTexture : register(s2);
float time;
float colorPaletteLimit;
float spiralArms;
float spiralAdditionalAngle;
float minPixelFadeDistance;
float maxPixelFadeDistance;
float2 pixelatonFactor;
float2 spiralTimeOffset;
float2 pixelationFactor;
float3 vortexDarkColor;
float3 vortexBrightColor;
float inverseLerp(float from, float to, float x)
{
return saturate((x - from) / (to - from));
}
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
// Pixelate.
coords = round(coords * pixelationFactor) / pixelationFactor;
float2 centeredCoords = coords - 0.5;
float polarAngle = atan2(centeredCoords.y, centeredCoords.x) / 6.283;
float distanceToCenter = length(centeredCoords);
float2 polarCoords = float2(polarAngle, distanceToCenter);
// Define coordinates for creating the vortex effect.
float vortexRadius = pow(distanceToCenter, 0.6);
float vortexAngle = spiralArms * atan2(centeredCoords.y, centeredCoords.x) / 3.141 + spiralAdditionalAngle * vortexRadius;
float2 vortexPolarCoords = float2(vortexAngle, vortexRadius) * 0.5 + float2(time * spiralTimeOffset.x, time * spiralTimeOffset.y);
// Add some distortion over it.
float distortion1 = tex2D(distortionTexture, coords * 0.46 + float2(time * -0.02, time * 0.022)).r;
float distortion2 = tex2D(distortionTexture, coords * 0.32 + float2(time * 0.018, time * -0.03)).r;
float totalDistortion = (distortion1 * 0.5) + (distortion2 * 0.5);
float4 vortexNoiseColor1 = tex2D(vortexNoiseTexture, vortexPolarCoords + totalDistortion);
float4 vortexNoiseColor2 = tex2D(vortexNoiseTexture2, polarCoords + float2(time * -0.02, time * -0.092) + totalDistortion * 0.64);
float4 vortexNoiseColor = lerp(vortexNoiseColor1, vortexNoiseColor2, inverseLerp(0, maxPixelFadeDistance - 0.075, distanceToCenter));
// Apply coloration based on pixel brightness.
float brightness = (vortexNoiseColor.r + vortexNoiseColor.g + vortexNoiseColor.b) / 3.0;
vortexNoiseColor.rgb *= lerp(vortexDarkColor, vortexBrightColor, brightness);
// Quantization.
vortexNoiseColor = round(vortexNoiseColor * colorPaletteLimit) / colorPaletteLimit;
// Fade out at the edge of the texture.
float edgeFade = inverseLerp(0, minPixelFadeDistance - 0.016, distanceToCenter) * inverseLerp(maxPixelFadeDistance, minPixelFadeDistance, distanceToCenter);
// float edgeOffset = tex2D(edgeFadeTexture, vortexPolarCoords + float2(time * spiralTimeOffset.x, time * spiralTimeOffset.y)).r * 0.13;
// float edgeFade = smoothstep(0.5, opacityCutoffValue, polarCoords.y + edgeOffset);
return (vortexNoiseColor * edgeFade) * sampleColor.a;
}
technique Technique1
{
pass ScaryAuraPass
{
PixelShader = compile ps_3_0 PixelShaderFunction();
}
}
Binary file not shown.
+35
View File
@@ -0,0 +1,35 @@
sampler baseTexture : register(s0);
float4 sourcePalette[16];
float4 targetPalette[16];
float matchThreshold = 0.01;
int paletteSize;
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR
{
float4 color = tex2D(baseTexture, coords) * sampleColor;
// Check each color in the source palette
for (int i = 0; i < paletteSize; i++)
{
float3 diff = color.rgb - sourcePalette[i].rgb;
float distance = sqrt(dot(diff, diff));
// If color is close enough to this palette color, swap it
if (distance <= matchThreshold)
{
color.rgb = targetPalette[i].rgb;
break; // Stop checking once we find a match
}
}
return color;
}
technique Technique1
{
pass PaletteSwapPass
{
PixelShader = compile ps_3_0 PixelShaderFunction();
}
}
Binary file not shown.
+68
View File
@@ -0,0 +1,68 @@
// 29JUN2026: fryzahh
// Programmed to work under the use of SanePrimitiveRenderer.
// Never use this shader with PrimitveRenderer.
sampler baseStreakTexture : register(s0);
sampler distortionTexture : register(s1);
matrix uTransformMatrix;
float time;
float glowPower;
float pixelationFactor;
struct VertexShaderInput
{
float4 Position : POSITION0;
float4 Color : COLOR0;
float2 TextureCoordinates : TEXCOORD0;
};
struct VertexShaderOutput
{
float4 Position : SV_POSITION;
float4 Color : COLOR0;
float2 TextureCoordinates : TEXCOORD0;
};
VertexShaderOutput VertexShaderFunction(in VertexShaderInput input)
{
VertexShaderOutput output;
output.Position = mul(input.Position, uTransformMatrix);
output.Color = input.Color;
output.TextureCoordinates = input.TextureCoordinates;
return output;
}
float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
{
float4 color = input.Color;
float2 coords = input.TextureCoordinates;
// Fade out at the horizontal and vertical ends of the streak.
float horizonatalDistanceFromCenter = distance(0.5, coords.y);
float opacity = smoothstep(0.5, 0.5 - 0.486, horizonatalDistanceFromCenter);
// Glow from the center go out.
float glow = pow(0.1 / horizonatalDistanceFromCenter, glowPower);
float2 distortionCoords = coords + float2(time * -3.12, 0);
distortionCoords *= float2(0.25, 1);
float distortion = tex2D(distortionTexture, distortionCoords).r * 0.43;
float2 streakCoords = coords + float2(time * -2.34, 0);
streakCoords *= float2(1.25, 1);
float4 streakMapColor = tex2D(baseStreakTexture, streakCoords + distortion);
float4 returnColor = (streakMapColor * color * glow) * opacity;
returnColor = round(returnColor * 7) / 7;
return returnColor;
}
technique Technique1
{
pass TrailPass
{
VertexShader = compile vs_2_0 VertexShaderFunction();
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
Binary file not shown.
+7 -9
View File
@@ -1,9 +1,7 @@
float rotation; // The rotation of the sprite.
float4 color;
texture sampleTexture;
sampler2D Texture1Sampler = sampler_state { texture = <sampleTexture>; magfilter = LINEAR; minfilter = LINEAR; mipfilter = LINEAR; AddressU = wrap; AddressV = wrap; };
sampler baseTexture : register(s0);
float rotation; // The rotation of the sprite.
float2 spriteDimensions; // Dimensions of the sprite.
float4 spriteRectangle; // For use with animated sprites.
float realCos(float value)
{
@@ -11,7 +9,7 @@ float realCos(float value)
}
//This only works on square sprites.
float4 main(float2 uv : TEXCOORD) : COLOR
float4 main(float4 sampleColor : COLOR0, float2 uv : TEXCOORD0) : COLOR0
{
float2x2 rotate = float2x2(realCos(rotation), -sin(rotation), sin(rotation), realCos(rotation));
float spriteDiagonal = 1 / (sqrt(2) / 2);
@@ -19,14 +17,14 @@ float4 main(float2 uv : TEXCOORD) : COLOR
uv += float2(-0.5, -0.5); //remap the uv to (-0.5, -0.5) - (0.5, 0.5) for trig to work.
uv = mul(uv, rotate);
uv = mul(uv, downscale);
//uv = mul(uv, downscale);
uv += float2(0.5, 0.5); //remap the uv properly
//Crop (Attempting to sample a texture with coordinates that arent between 0 to 1 wraps it around
if (uv.x < 0 || uv.x >= 1 || uv.y < 0 || uv.y >= 1)
return float4(0, 0, 0, 0);
return tex2D(Texture1Sampler, uv) * color;
return tex2D(baseTexture, uv) * sampleColor;
}
technique Technique1
Binary file not shown.
+27
View File
@@ -0,0 +1,27 @@
sampler baseTexture : register(s0);
float time;
float waveAmplitude;
float waveFrequency;
bool distortHorizontally;
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 horizontalDistortion = sin(coords.x * waveFrequency + time) * waveAmplitude;
float2 verticalDistortion = sin(coords.y * waveFrequency + time) * waveAmplitude;
if (distortHorizontally)
coords.y += horizontalDistortion;
else
coords.x += verticalDistortion;
return tex2D(baseTexture, coords) * sampleColor;
}
technique Technique1
{
pass SinePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
Binary file not shown.
+17 -3
View File
@@ -586,12 +586,14 @@ namespace CalamityMod.Events
// Cooldown and boss spawn.
if (BossRushSpawnCountdown <= 0 && BossRushStage < Bosses.Count)
{
// Cooldown before next boss spawns.
// Cooldown before next boss spawns. Defaults to 1 second.
BossRushSpawnCountdown = 60;
// Increase cooldown post-Moon Lord.
// Cooldown increases to 3 seconds in tier 4 and 4 seconds in tier 5.
if (BossRushStage >= Bosses.FindIndex(boss => boss.EntityID == NPCID.MoonLordCore))
BossRushSpawnCountdown += 180;
BossRushSpawnCountdown += 120;
if (BossRushStage >= Bosses.FindIndex(boss => boss.EntityID == ModContent.NPCType<DevourerofGodsHead>()))
BossRushSpawnCountdown += 60;
// Override the spawn countdown if specified.
if (BossRushStage < Bosses.Count - 1 && Bosses[BossRushStage + 1].SpecialSpawnCountdown != -1)
@@ -691,6 +693,18 @@ namespace CalamityMod.Events
}
}
// Both Twins must be killed to progress.
else if (npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer)
{
int bossType = npc.type == NPCID.Spazmatism ? NPCID.Retinazer : NPCID.Spazmatism;
if (!NPC.AnyNPCs(bossType))
{
BossRushStage++;
CalamityUtils.KillAllHostileProjectiles();
HostileProjectileKillCounter = 3;
}
}
// Anahita and Leviathan manually check for each other (this probably isn't necessary).
else if (npc.type == ModContent.NPCType<Anahita>() || npc.type == ModContent.NPCType<Leviathan>())
{
Binary file not shown.

Before

Width:  |  Height:  |  Size: 459 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

+10 -13
View File
@@ -1,4 +1,5 @@
using Microsoft.Xna.Framework.Graphics;
using CalamityMod.Buffs.Summon;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
@@ -10,13 +11,7 @@ namespace CalamityMod.ExtraTextures
[Autoload(Side = ModSide.Client)]
public class ExtraTextureRefs : ModSystem
{
// Destroyer glowmasks
public static Asset<Texture2D> DestroyerHeadGlowmask;
public static Asset<Texture2D> DestroyerBodyGlowmask;
public static Asset<Texture2D> DestroyerTailGlowmask;
// WoF, These are not "exactly" the ExtraTextures. But
public static Asset<Texture2D> WallOfFleshEyeGlowmask;
// WoF, These are not "exactly" the ExtraTextures
public static Asset<Texture2D> WallOfFleshDemonSickleTexture;
// Flying Carpet Replacements
@@ -28,6 +23,10 @@ namespace CalamityMod.ExtraTextures
public static Asset<Texture2D> LuckIconVanilla;
public static Asset<Texture2D> LuckIconLesser;
// Blighted Slime Buff icons
public static Asset<Texture2D> BlightedSlimeCorroIcon;
public static Asset<Texture2D> BlightedSlimeCrimIcon;
// Particles
public static Asset<Texture2D> CircularSmear;
public static Asset<Texture2D> CircularSmearFire1;
@@ -38,11 +37,6 @@ namespace CalamityMod.ExtraTextures
// TODO: - Every other ExtraTextures Reference could be move in here
public override void OnModLoad()
{
DestroyerHeadGlowmask = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerHeadGlow", AssetRequestMode.AsyncLoad);
DestroyerBodyGlowmask = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerBodyGlow", AssetRequestMode.AsyncLoad);
DestroyerTailGlowmask = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerTailGlow", AssetRequestMode.AsyncLoad);
WallOfFleshEyeGlowmask = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/WallOfFleshEyeTelegraphGlow", AssetRequestMode.AsyncLoad);
WallOfFleshDemonSickleTexture = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Melee/ForbiddenOathbladeProjectile", AssetRequestMode.AsyncLoad);
FlyingCarpetVanilla = TextureAssets.FlyingCarpet;
@@ -52,6 +46,9 @@ namespace CalamityMod.ExtraTextures
LuckIconVanilla = TextureAssets.Buff[BuffID.Lucky];
LuckIconLesser = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBuffs/LuckyLesser", AssetRequestMode.AsyncLoad);
BlightedSlimeCorroIcon = ModContent.Request<Texture2D>("CalamityMod/Buffs/Summon/BlightedSlime");
BlightedSlimeCrimIcon = ModContent.Request<Texture2D>("CalamityMod/Buffs/Summon/BlightedSlimeCrimson");
CircularSmear = ModContent.Request<Texture2D>("CalamityMod/Particles/CircularSmear", AssetRequestMode.AsyncLoad);
CircularSmearFire1 = ModContent.Request<Texture2D>("CalamityMod/Particles/CircularSmearFire1", AssetRequestMode.AsyncLoad);
CircularSmearFire2 = ModContent.Request<Texture2D>("CalamityMod/Particles/CircularSmearFire2", AssetRequestMode.AsyncLoad);
Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

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