Merge Update 2.2.2 into release branch

This commit is contained in:
Ozzatron committed 2026-08-08 13:55:03 -04:00
commit 1a8cebd27e
929 files changed
+6960 -6291

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;
}
}
}
+19 -22
View File
@@ -95,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
@@ -153,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
@@ -206,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))));
@@ -215,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))));
@@ -270,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))));
@@ -287,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
@@ -300,23 +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 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>()))));
-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
{
-5
View File
@@ -30,11 +30,6 @@ namespace CalamityMod.Buffs.DamageOverTime
{
owner = p.owner;
projectileCount++;
if (projectileCount >= 5)
{
projectileCount = 5;
break;
}
}
}
+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

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()
{
+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;
@@ -1,11 +1,11 @@
using CalamityMod.Projectiles.Summon;
using CalamityMod.Projectiles.Summon;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class BabySlimeGodBuff : BaseSummonBuff
public class BabyPaladinBuff : BaseSummonBuff
{
protected override int MinionProjectileType => ModContent.ProjectileType<CrimsonSlimeGodMinion>();
protected override int MinionProjectileType => ModContent.ProjectileType<StatigelBlightedSlime>();
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 Corroslime : BaseSummonBuff
public class BlightedSlime : BaseSummonBuff
{
protected override int MinionProjectileType => ModContent.ProjectileType<CorroslimeMinion>();
protected override int MinionProjectileType => ModContent.ProjectileType<BlightedSlimeMinion>();
protected override ref bool MinionBool => ref BuffModdedOwner.cSlime;
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 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--;
+106 -131
View File
@@ -327,6 +327,7 @@ namespace CalamityMod.CalPlayer
public int arsenalCooldown = 0;
public int killModeCooldown = 0;
public bool demonSwordKillMode = false;
public int oblivionCooldown = 0;
public bool exaltedKillMode => (demonSwordKillMode && Player.HeldItem.type == ItemType<ExaltedOathblade>());
public bool devilsDevastationKillMode => (demonSwordKillMode && Player.HeldItem.type == ItemType<DevilsDevastation>());
/// <summary>
@@ -402,19 +403,15 @@ namespace CalamityMod.CalPlayer
/// </summary>
public int hInfernoBoost = 0;
public int packetTimer = 0;
public int navyRodAuraTimer = 0;
/// <summary> Timer variable used to time when Hydrothermic armor's set bonus inferno ring deals damage to targets. </summary>
public int hydrothermicInfernoTimer = 0;
/// <summary> Timer variable used to time when Tarragon armor's set bonus life aura deals damage to targets. </summary>
public int tarraLifeAuraTimer = 0;
public int bloodflareHeartTimer = 300;
/// <summary> Counter variable used to determine when to spawn Dragon Rage's fireballs. Fireballs are spawned after 10 hits. </summary>
public int dragonRageHits = 0;
/// <summary> Cooldown variable for Dragon Rage's fireball spawning to prevent spamming projectiles when hitting multiple enemies simultaneously. </summary>
public int dragonRageCooldown = 0;
/// <summary> Counter variable which controls Aquatic Emblem's stat boosts while underwater. </summary>
public float aquaticBoost = 0;
public int galileoCooldown = 0;
/// <summary> Used to track Prideful Hunter's Planar Ripper's movement speed boost, along with its visual effects. </summary>
public int planarSpeedBoost = 0;
public int profanedSoulWeaponUsage = 0;
@@ -844,15 +841,11 @@ namespace CalamityMod.CalPlayer
public bool shouldTriggerBeeCooldown = false;
public int theBeeCooldown = 0;
public bool aFossil = false;
public bool aPowder = false;
public bool fallingBlockProtection = false;
public bool trapProtection = false;
public bool archaicPowder = false;
public bool alluringBait = false;
public bool enchantedPearl = false;
public bool fishingStation = false;
public bool rBrain = false;
public bool bloodyWormTooth = false;
public bool ivDrip = false;
/// <summary> NOT the primary Affliction variable, used instead for the Afflicted buff which is given to teammates. </summary>
public bool afflicted = false;
public bool chiRegen = false;
@@ -866,13 +859,11 @@ namespace CalamityMod.CalPlayer
public bool vexation = false;
public bool dodgeScarf = false;
public bool evasionScarf = false;
public bool badgeOfBravery = false;
public bool WarbanneroftheRighteous = false;
public bool warbannerGlow = false;
public float warbannerDamageMult = 0;
public bool tesla = false;
public bool teslaVisuals = true;
public bool cryogenSoul = false;
public bool ascendantInsignia = false;
public int ascendantInsigniaBuffTime = 0;
public int ascendantInsigniaCooldown = 0;
@@ -886,13 +877,12 @@ namespace CalamityMod.CalPlayer
public bool eGauntlet = false;
/// <summary> <inheritdoc cref="magmaStoneVisuals"/> </summary>
public bool eGauntletVisuals = true;
public bool volatileGelatinVisuals = true;
/// <summary>
/// Used to prevent melee speed stacking with Feral Claws and its upgrades.<br/>
/// Feral Claws = 1, Power Glove = 2, Mechanical Glove = 3, Fire Gauntlet = 4, Elemental Gauntlet = 5
/// </summary>
public int gloveLevel = 0;
public bool alreadyHasFrogLeg = false; // Unused, intended to prevent Frog Leg tinker stacking
public bool eTalisman = false;
public bool lastDashWasTabi = false;
public bool statisNinjaBelt = false;
public bool voidSashVisuals = true;
@@ -930,12 +920,8 @@ namespace CalamityMod.CalPlayer
/// </summary>
bool _hasNoNaturalRegen = false;
public bool hadLifeRegenHinderingDebuff = false;
public bool alwaysHoneyRegen = false;
public float alwaysHoneyRegenAmount = 0;
public bool honeyTurboRegen = false;
public bool honeyDew = false;
public bool livingDew = false;
public int jewelBonusDefense = 0;
/// <summary>
/// Counter variable for spawning Toxic Heart's pulses.<br/>
/// Incremented on every frame by <see cref="pulseRate"/>, and when it reaches 420, it is reset and a pulse is spawned.
@@ -963,8 +949,6 @@ namespace CalamityMod.CalPlayer
public bool sGlyph = false;
public bool sRegen = false;
public bool tracersDust = false;
public bool moonWalkers = false;
public bool voidStriders = false;
public bool seraphTracers = false;
public bool frostFlare = false;
public bool evolution = false;
@@ -974,9 +958,9 @@ namespace CalamityMod.CalPlayer
public bool procDodgeEffects = false;
public bool nanotech = false;
public int nanotechHitCooldown = 0;
public bool deadshotBrooch = false;
public Item ammoCycleItem = null;
public bool shadowMinions = false;
public bool holyMinions = false;
public bool statisMinions = false;
public bool alchFlask = false;
public bool toxicHeart = false;
public bool toxicHeartVisuals = false;
@@ -998,6 +982,7 @@ namespace CalamityMod.CalPlayer
public bool fleshTotemVisual = false;
public int fleshTotemManaStorage = 0;
public bool bloodPact = false;
public bool CanBeCritByThePact = false;
public bool bloodflareCore = false;
public int bloodflareCoreRemainingHealOverTime = 0;
@@ -1008,12 +993,9 @@ namespace CalamityMod.CalPlayer
public int chaliceHitOriginalDamage = 0;
public bool chaliceHeartStyle = false;
public bool elementalHeart = false;
public bool crownJewel = false;
public bool infectedJewel = false;
public bool purity = false;
/// <summary> If true, reduces the damage of electricity debuffs by 50%. </summary>
public bool eleResist = false;
public bool harpyRing = false;
public bool angelTreads = false;
/// <summary> Makes Flesh Knuckles and its upgrades increase the player's max health. </summary>
@@ -1061,9 +1043,7 @@ namespace CalamityMod.CalPlayer
public bool baroclaw = false;
public bool IsFirstDashFrame = true;
public int fallingBootVelCheckTimer = 0;
public bool voidOfCalamity = false;
public bool apollyon = false;
public bool fragmentsOfAnotherWorld = false;
public bool crushingEgo = false;
public bool fadedIdolatry = false;
public bool pSoulArtifact = false;
@@ -1087,27 +1067,27 @@ namespace CalamityMod.CalPlayer
public bool ursaSergeant = false;
public bool ursaSergeantVisual = false;
public bool scuttlersJewel = false;
public int scuttlerCooldown = 0;
public bool thiefsDime = false;
public bool dynamoStemCells = false;
public bool etherealExtorter = false;
public bool blazingCore = false;
public int blazingCoreParry = 0;
public int blazingCoreSuccessfulParry = 0;
public bool blazingCoreEmpoweredParry = false;
public Item AccessoryParryItem = null;
public bool divineProvidence = false;
public int divineProvParry = 0;
public int divineProvSuccessfulParry = 0;
public bool divineProvEmpoweredParry = false;
public bool voltaicJelly = false;
public bool jellyChargedBattery = false;
/// <summary> General cooldown for accessories which spawn projectiles on minion hits. </summary>
public float summonProjCooldown;
public bool sandElemental = false;
public bool? sandElemental = null;
public bool sandElementalVanity = false;
public bool oasisElemental = false;
public bool? oasisElemental = null;
public bool oasisElementalVanity = false;
public bool cloudElemental = false;
public bool? cloudElemental = null;
public bool cloudElementalVanity = false;
public bool brimElemental = false;
public bool? brimElemental = null;
public bool brimElementalVanity = false;
public bool waterElemental = false;
public bool? waterElemental = null;
public bool waterElementalVanity = false;
public bool fungalClump = false;
public bool fungalClumpVanity = false;
@@ -1123,7 +1103,6 @@ namespace CalamityMod.CalPlayer
public int mageCrownTimer = 0;
public int mageCrownCount = 0;
public bool dragonScales = false;
public bool gloveOfPrecision = false;
public bool gloveOfRecklessness = false;
public bool vampiricTalisman = false;
public bool electricianGlove = false;
@@ -1135,7 +1114,7 @@ namespace CalamityMod.CalPlayer
public bool spectralVeil = false;
public int spectralVeilImmunity = 0;
/// <summary> Check for if the player has Plagued Fuel Pack OR Blunder Booster equipped. </summary>
public bool hasJetpack = false;
public Item rogueDashItem = null;
public bool hasEngineDash = false;
public bool plaguedFuelPack = false;
public bool blunderBooster = false;
@@ -1155,8 +1134,6 @@ namespace CalamityMod.CalPlayer
public float frozenCubeDebuffBoost = 0;
public float frozenCubeElumphantBoost = 0;
public int frozenCubeUsedDefense = 0;
public bool miniOldDuke = false;
public bool miniOldDukeVanity = false;
public bool starbusterCore = false;
public bool starTaintedGenerator = false;
public bool hallowedRune = false;
@@ -1176,6 +1153,7 @@ namespace CalamityMod.CalPlayer
public int voidFrameCounter = 0;
/// <summary> <inheritdoc cref="voidFrameCounter"/> </summary>
public int voidFrame = 0;
public int volatileGelHits = 0;
public bool rottenDogTooth = false;
public bool angelicAlliance = false;
public int angelicActivate = -1;
@@ -1228,15 +1206,13 @@ namespace CalamityMod.CalPlayer
public bool meteorSet = false;
/// <summary> Calamity's Necro armor set bonus; gives a temporary 10 second revive when the player is killed before actually dying. </summary>
public bool necroSet = false;
/// <summary> Calamity's Frost armor set bonus; gives a combined 20% damage boost split between melee and ranged based on distance from the closest enemy. </summary>
/// <summary> Calamity's Frost armor set bonus; gives a combined damage boost split between melee and ranged based on distance from the closest enemy. </summary>
public bool frostSet = false;
public bool victideSet = false;
public bool victideSummoner = false;
public bool sulphurSet = false;
public bool sulphurJump = false;
public int sulphurBubbleCooldown = 0;
public bool aeroSet = false;
public bool statigelSet = false;
public bool tarraSet = false;
public bool tarraMelee = false;
public bool tarragonCloak = false;
@@ -1254,13 +1230,12 @@ namespace CalamityMod.CalPlayer
public bool bloodflareFrenzy = false;
public int bloodflareMeleeHits = 0;
public bool bloodflareRanged = false;
public bool bloodflareThrowing = false;
public bool bloodflareMage = false;
public int bloodflareMageCooldown = 0;
public bool bloodflareSummon = false;
public int bloodflareSummonTimer = 0;
public bool godSlayer = false;
public bool godSlayerDamage = false;
public bool godSlayerMelee = false;
public bool godSlayerRanged = false;
public bool godSlayerThrowing = false;
public bool godSlayerDashHotKeyPressed = false;
@@ -1279,8 +1254,7 @@ namespace CalamityMod.CalPlayer
public bool shadeRegen = false;
/// <summary> Demonshade Greaves' movement speed boost. </summary>
public bool shadowSpeed = false;
public bool dsSetBonus = false;
public bool auricSetMelee = false;
public bool demonshadeSet = false;
public bool daedalusReflect = false;
public bool daedalusSplit = false;
public bool titanHeartSet = false;
@@ -1291,7 +1265,6 @@ namespace CalamityMod.CalPlayer
public bool reaverSpeed = false;
public bool reaverDefense = false;
public bool reaverExplore = false;
public bool fathomSwarmer = false;
public bool fathomSwarmerVisage = false;
public bool fathomSwarmerBreastplate = false;
public bool fathomSwarmerTail = false;
@@ -1301,7 +1274,6 @@ namespace CalamityMod.CalPlayer
public int tailFrame = 0;
public bool astralStarRain = false;
public int astralStarRainCooldown = 0;
public int VoidCooldown = 0;
public int ursaSergeantCooldown = 0;
public int AlchFlaskCooldown = 0;
public bool plagueReaper = false;
@@ -1349,7 +1321,6 @@ namespace CalamityMod.CalPlayer
/// <summary> Calamity's Adamantite armor set bonus; adds half of DR to crit chance, and makes landing hits give a stacking defense boost. </summary>
public bool AdamantiteSet = false;
public int AdamantiteSetDecayDelay = 0;
public int ChlorophyteHealDelay = 0;
/// <summary>
/// If true, the player is wearing a post-Moon Lord summoner armor set.<br/>
/// Currently unused.
@@ -1547,10 +1518,8 @@ namespace CalamityMod.CalPlayer
public bool CalamarisLament = false;
/// <summary> Entropy's Vigil. </summary>
public bool cEyes = false;
/// <summary> Corroslime Staff. </summary>
public bool cSlime = false;
/// <summary> Crimslime Staff. </summary>
public bool cSlime2 = false;
/// <summary> Blighted Slime Staff. </summary>
public bool blightedSlime = false;
/// <summary> Abandoned Slime Staff. </summary>
public bool aSlime = false;
public bool brittleStar = false;
@@ -1581,14 +1550,14 @@ namespace CalamityMod.CalPlayer
/// <summary> Enchanted Conch. </summary>
public bool hCrab = false;
/// <summary> Heart of the Elements. </summary>
public bool allElementals = false;
public bool? allElementals = null;
/// <summary> Heart of the Elements; however, the minions will not attack. </summary>
public bool allElementalsVanity = false;
/// <summary> Silva armor's Silva Crystal. </summary>
public bool sCrystal = false;
/// <summary> Elemental in a Bottle. </summary>
public bool sandEleBuff = false;
/// <summary> Rare Elemental in a Bottle. </summary>
/// <summary> Oasis Elemental in a Bottle. </summary>
public bool oasisEleBuff = false;
/// <summary> Eye of the Storm. </summary>
public bool cloudEleBuff = false;
@@ -1705,7 +1674,6 @@ namespace CalamityMod.CalPlayer
public bool abyssDeath = false;
public int abyssBreathCD;
public float caveDarkness = 0f;
#endregion
#region Transformation
@@ -1722,11 +1690,9 @@ namespace CalamityMod.CalPlayer
public bool aquaticHeartPrevious;
public bool aquaticHeart;
public bool snowmanNoseless;
public bool meldTransformationPrevious;
public bool meldTransformation;
public bool meldTransformationForce;
public bool meldTransformationPower;
public bool omegaBlueTransformationPrevious;
public bool omegaBlueTransformation;
public bool omegaBlueTransformationForce;
public bool omegaBlueTransformationPower;
@@ -2159,6 +2125,9 @@ namespace CalamityMod.CalPlayer
if (crimEffigy)
Player.statLifeMax2 = (int)(Player.statLifeMax2 * (1f - CrimsonEffigy.MaxHealthLossPercent));
if (CanBeCritByThePact)
Player.statLifeMax2 = (int)(Player.statLifeMax2 * ThePact.MaxLifeMult);
ResetRogueStealth();
calamityBonusLuck = 0f;
@@ -2318,8 +2287,6 @@ namespace CalamityMod.CalPlayer
rimehound = false;
crysthamyr = false;
ExoChair = false;
miniOldDuke = false;
miniOldDukeVanity = false;
aquaticHeartWaterBuff = false;
aquaticHeartIce = false;
@@ -2336,7 +2303,7 @@ namespace CalamityMod.CalPlayer
nebulousCore = false;
godSlayer = false;
godSlayerDamage = false;
godSlayerMelee = false;
godSlayerRanged = false;
godSlayerThrowing = false;
@@ -2345,8 +2312,6 @@ namespace CalamityMod.CalPlayer
silvaSummon = false;
auricSet = false;
auricSetMelee = false;
GemTechSet = false;
CobaltSet = false;
@@ -2373,7 +2338,7 @@ namespace CalamityMod.CalPlayer
shadeRegen = false;
shadowSpeed = false;
dsSetBonus = false;
demonshadeSet = false;
wearingRogueArmor = false;
blockAllDashes = false;
@@ -2399,17 +2364,12 @@ namespace CalamityMod.CalPlayer
protolithBangle = false; // Marble band
protolithBangleVisual = false;
aFossil = false;
aPowder = false;
fallingBlockProtection = false;
trapProtection = false;
archaicPowder = false;
alluringBait = false;
enchantedPearl = false;
fishingStation = false;
rBrain = false;
bloodyWormTooth = false;
ivDrip = false;
vexation = false;
badgeOfBravery = false;
// Clear the Warbanner "cooldown" if not wearing Warbanner. This has absolutely zero effect for a casual player, but is useful for resetting the cooldown's duration.
if (!WarbanneroftheRighteous)
cooldowns.Remove(WarbanneroftheRighteousBuff.ID);
@@ -2440,13 +2400,13 @@ namespace CalamityMod.CalPlayer
v8000Engine = false;
nanotech = false;
nanotechHitCooldown = 0;
deadshotBrooch = false;
ammoCycleItem = null;
tesla = false;
teslaVisuals = true;
cryogenSoul = false;
ascendantInsignia = false;
fishStocks = false;
magmaStoneVisuals = true;
volatileGelatinVisuals = true;
eGauntlet = false;
eGauntletVisuals = true;
gloveLevel = 0;
@@ -2454,14 +2414,12 @@ namespace CalamityMod.CalPlayer
statisNinjaBelt = false;
if (Player.dashDelay != -1)
statisVoidSash = false;
alreadyHasFrogLeg = false;
eTalisman = false;
nucleogenesis = false;
nuclearFuelRod = false;
heartOfDarkness = false;
profanedSoulRelicBuff = false;
shadowMinions = false;
holyMinions = false;
statisMinions = false;
alchFlask = false;
toxicHeart = false;
toxicHeartVisuals = false;
@@ -2479,11 +2437,11 @@ namespace CalamityMod.CalPlayer
fleshTotemVisual = false;
fleshTotemMinion = false;
bloodPact = false;
CanBeCritByThePact = false;
bloodflareCore = false;
chaliceOfTheBloodGod = false;
chaliceHeartStyle = false;
chaliceBleedoutToApplyOnHurt = 0; // Resets every frame so it doesn't improperly carry over between hits
elementalHeart = false;
crownJewel = false;
infectedJewel = false;
purity = false;
@@ -2493,9 +2451,7 @@ namespace CalamityMod.CalPlayer
darkSunRing = false;
crawCarapace = false;
baroclaw = false;
voidOfCalamity = false;
apollyon = false;
fragmentsOfAnotherWorld = false;
crushingEgo = false;
fadedIdolatry = false;
pSoulArtifact = false;
@@ -2517,8 +2473,6 @@ namespace CalamityMod.CalPlayer
hallowedRegen = false;
hallowedPower = false;
tracersDust = false;
moonWalkers = false;
voidStriders = false;
seraphTracers = false;
ursaSergeant = false;
ursaSergeantVisual = false;
@@ -2526,7 +2480,8 @@ namespace CalamityMod.CalPlayer
thiefsDime = false;
dynamoStemCells = false;
etherealExtorter = false;
blazingCore = false;
AccessoryParryItem = null;
divineProvidence = false;
voltaicJelly = false;
jellyChargedBattery = false;
starbusterCore = false;
@@ -2614,9 +2569,6 @@ namespace CalamityMod.CalPlayer
sulphurSet = false;
aeroSet = false;
statigelSet = false;
titanHeartSet = false;
titanHeartMask = false;
titanHeartMantle = false;
@@ -2624,7 +2576,6 @@ namespace CalamityMod.CalPlayer
plagueReaper = false;
plaguebringerPatronSet = false;
plaguebringerCarapace = false;
fathomSwarmer = false;
fathomSwarmerVisage = false;
fathomSwarmerBreastplate = false;
fathomSwarmerTail = false;
@@ -2646,7 +2597,6 @@ namespace CalamityMod.CalPlayer
bloodflareMelee = false;
bloodflareFrenzy = false;
bloodflareRanged = false;
bloodflareThrowing = false;
bloodflareMage = false;
bloodflareSummon = false;
@@ -2662,7 +2612,6 @@ namespace CalamityMod.CalPlayer
moonCrown = false;
mageCrownVisibility = false;
dragonScales = false;
gloveOfPrecision = false;
gloveOfRecklessness = false;
vampiricTalisman = false;
electricianGlove = false;
@@ -2670,7 +2619,7 @@ namespace CalamityMod.CalPlayer
filthyGlove = false;
sandCloak = false;
spectralVeil = false;
hasJetpack = false;
rogueDashItem = null;
hasEngineDash = false;
plaguedFuelPack = false;
blunderBooster = false;
@@ -2830,8 +2779,7 @@ namespace CalamityMod.CalPlayer
cosmicViper = false;
CalamarisLament = false;
cEyes = false;
cSlime = false;
cSlime2 = false;
blightedSlime = false;
aSlime = false;
brittleStar = false;
aquaticStar = false;
@@ -2866,17 +2814,17 @@ namespace CalamityMod.CalPlayer
cSpirit = false;
dCrystal = false;
MutatedTruffleBool = false;
sandElemental = false;
sandElemental = null;
sandElementalVanity = false;
oasisElemental = false;
oasisElemental = null;
oasisElementalVanity = false;
cloudElemental = false;
cloudElemental = null;
cloudElementalVanity = false;
brimElemental = false;
brimElemental = null;
brimElementalVanity = false;
waterElemental = false;
waterElemental = null;
waterElementalVanity = false;
allElementals = false;
allElementals = null;
allElementalsVanity = false;
fungalClump = false;
fungalClumpVanity = false;
@@ -2971,10 +2919,8 @@ namespace CalamityMod.CalPlayer
pscState = 0;
pscLerpColor = Color.White;
meldTransformationPrevious = meldTransformation;
meldTransformation = meldTransformationForce = meldTransformationPower = false;
omegaBlueTransformationPrevious = omegaBlueTransformation;
omegaBlueTransformation = omegaBlueTransformationForce = omegaBlueTransformationPower = false;
rageModeActive = false;
@@ -3036,6 +2982,9 @@ namespace CalamityMod.CalPlayer
#endregion
#region Screen Position Movements
float HalleyScopeLerp = 0;
bool HalleyToggle = false;
public override void ModifyScreenPosition()
{
// CIT 08FEB2025: Photosensitivity config also disables screenshake
@@ -3045,6 +2994,19 @@ namespace CalamityMod.CalPlayer
Main.screenPosition += Main.rand.NextVector2Circular(GeneralScreenShakePower * CalamityClientConfig.Instance.ScreenshakePower, GeneralScreenShakePower * CalamityClientConfig.Instance.ScreenshakePower);
GeneralScreenShakePower = MathHelper.Clamp(GeneralScreenShakePower - 0.185f, 0f, 20f * CalamityClientConfig.Instance.ScreenshakePower);
if (Player.HeldItem.type != ModContent.ItemType<HalleysInferno>())
HalleyToggle = false;
else if (Player.HeldItem.JustPressedKeybind())
HalleyToggle = !HalleyToggle;
HalleyScopeLerp = MathHelper.Clamp(HalleyScopeLerp + (HalleyToggle ? 0.05f : -0.05f), 0, 1);
if (HalleyScopeLerp > 0)
{
var screenSize = new Vector2(Main.screenWidth, Main.screenHeight);
Vector2 center = Main.screenPosition + screenSize * 0.5f;
Main.screenPosition -= (Vector2.Clamp((center - Main.MouseWorld) / screenSize, new(-0.5f), new(0.5f)) / Main.GameZoomTarget * MathHelper.SmoothStep(0, 1, HalleyScopeLerp)) * new Vector2(1920, 1200) * 0.9f;
}
}
#endregion
@@ -3102,7 +3064,6 @@ namespace CalamityMod.CalPlayer
arsenalCooldown = 0;
andromedaState = AndromedaPlayerState.Inactive;
planarSpeedBoost = 0;
galileoCooldown = 0;
soundCooldown = 0;
dogTextCooldown = 0;
auralisStealthCounter = 0f;
@@ -3131,7 +3092,6 @@ namespace CalamityMod.CalPlayer
gSabatonTempJumpSpeed = 0;
rOfDelivarenceRam = false;
astralStarRainCooldown = 0;
VoidCooldown = 0;
AlchFlaskCooldown = 0;
ascendantInsigniaCooldown = 0;
transformerCooldown = 0;
@@ -3150,14 +3110,12 @@ namespace CalamityMod.CalPlayer
externalColdImmunity = externalHeatImmunity = false;
externalDefenseDamageImmunity = false;
dragonRageHits = 0;
dragonRageCooldown = 0;
spectralVeilImmunity = 0;
jetPackDash = 0;
jetPackDirection = 0;
andromedaCripple = 0;
theBeeCooldown = 0;
scuttlerCooldown = 0;
mageCrownTimer = 0;
wingProjectileCooldown = 0;
hallowedRuneCooldown = 0;
@@ -3349,12 +3307,11 @@ namespace CalamityMod.CalPlayer
miningSetCooldown = 0;
shadowSpeed = false;
godSlayer = false;
godSlayerDamage = false;
godSlayerMelee = false;
godSlayerRanged = false;
godSlayerThrowing = false;
godSlayerDashHotKeyPressed = false;
SpeedBlasterDashStarted = false;
auricSetMelee = false;
silvaSet = false;
silvaMage = false;
silvaSummon = false;
@@ -3368,7 +3325,6 @@ namespace CalamityMod.CalPlayer
AdamantiteSet = false;
WearingPostMLSummonerSet = false;
AdamantiteSetDecayDelay = 0;
ChlorophyteHealDelay = 0;
omegaBlueChestplate = false;
omegaBlueSet = false;
molluskHelmet = false;
@@ -3387,13 +3343,12 @@ namespace CalamityMod.CalPlayer
reaverDefense = false;
reaverExplore = false;
shadeRegen = false;
dsSetBonus = false;
demonshadeSet = false;
titanHeartSet = false;
titanHeartMask = false;
titanHeartMantle = false;
titanCooldown = 0;
umbraphileSet = false;
fathomSwarmer = false;
fathomSwarmerVisage = false;
fathomSwarmerBreastplate = false;
fathomSwarmerTail = false;
@@ -3424,7 +3379,6 @@ namespace CalamityMod.CalPlayer
victideSet = false;
aeroSet = false;
sulphurSet = false;
statigelSet = false;
tarraSet = false;
tarraMelee = false;
tarragonCloak = false;
@@ -3440,7 +3394,6 @@ namespace CalamityMod.CalPlayer
bloodflareFrenzy = false;
bloodflareMeleeHits = 0;
bloodflareRanged = false;
bloodflareThrowing = false;
bloodflareMage = false;
bloodflareSummon = false;
bloodflareSummonTimer = 0;
@@ -3449,9 +3402,9 @@ namespace CalamityMod.CalPlayer
xerocSet = false;
tracersDust = false;
GemTechState.OnDeathEffects();
blazingCoreParry = 0;
blazingCoreEmpoweredParry = false;
blazingCoreSuccessfulParry = 0;
divineProvParry = 0;
divineProvEmpoweredParry = false;
divineProvSuccessfulParry = 0;
flameLickedShellParry = 0;
flameLickedShellEmpoweredParry = false;
profanedCrystalAnim = -1;
@@ -3535,7 +3488,7 @@ namespace CalamityMod.CalPlayer
if (Player.dead)
return;
if (ascendantInsignia && Main.myPlayer == Player.whoAmI && CalamityKeybinds.AscendantInsigniaHotKey.JustPressed && ascendantInsigniaCooldown <= 0)
if (ascendantInsignia && Main.myPlayer == Player.whoAmI && FindAccessory<AscendantInsignia>().JustPressedKeybind() && ascendantInsigniaCooldown <= 0)
{
var source = Player.GetSource_Accessory(FindAccessory<AscendantInsignia>());
Projectile.NewProjectile(source, Player.Center - Vector2.UnitY * 45f, Vector2.Zero, ProjectileType<AscendantAura>(), 0, 0f);
@@ -3545,7 +3498,7 @@ namespace CalamityMod.CalPlayer
}
int numOfBlobs = Player.ownedProjectileCounts[ProjectileType<TransformerBlob>()];
if (transformer && numOfBlobs > 0 && Main.myPlayer == Player.whoAmI && CalamityKeybinds.TransformerHotKey.JustPressed && transformerCooldown <= 0 && true) // Add check if projectiles are active
if (transformer && numOfBlobs > 0 && Main.myPlayer == Player.whoAmI && FindAccessory<TheTransformer>().JustPressedKeybind() && transformerCooldown <= 0 && true) // Add check if projectiles are active
{
// Go fire all the blobs
int cooldownTime = 300;
@@ -3572,7 +3525,8 @@ namespace CalamityMod.CalPlayer
}
//Only increment the slam if not on ground, not mounted, not on rope, not hooked, not tongued, otherwise reset slam time to zero
if (CalamityKeybinds.GravistarSabatonHotkey.JustPressed && gSabatonHotkeyFallWindup < 0)
if (gSabaton && FindAccessory<InterstellarStompers>().JustPressedKeybind() && gSabatonHotkeyFallWindup < 0)
gSabatonHotkeyFallWindup = 0;
if (gSabaton && gSabatonHotkeyFallWindup >= 0 && Main.myPlayer == Player.whoAmI && (Player.velocity.Y != 0) && !Player.pulley && !Player.mount.Active && Player.grappling[0] == -1 && !Player.tongued)
{
@@ -3618,7 +3572,7 @@ namespace CalamityMod.CalPlayer
}
}
}
if (CalamityKeybinds.AngelicAllianceHotKey.JustPressed && angelicAlliance && Main.myPlayer == Player.whoAmI && !divineBless && !Player.HasCooldown(Cooldowns.DivineBless.ID))
if (angelicAlliance && Main.myPlayer == Player.whoAmI && FindAccessory<AngelicAlliance>().JustPressedKeybind() && !divineBless && !Player.HasCooldown(Cooldowns.DivineBless.ID))
{
Player.AddBuff(BuffType<Buffs.StatBuffs.DivineBless>(), AngelicAlliance.DivineBlessDuration, false);
SoundEngine.PlaySound(AngelicAlliance.ActivationSound, Player.Center);
@@ -3628,7 +3582,7 @@ namespace CalamityMod.CalPlayer
for (int projIndex = 0; projIndex < Main.maxProjectiles; projIndex++)
{
Projectile proj = Main.projectile[projIndex];
if (proj.minionSlots <= 0f || !proj.CountsAsClass<SummonDamageClass>())
if ((proj.minionSlots <= 0f && proj.type != ModContent.ProjectileType<Pigion>()) || !proj.CountsAsClass<SummonDamageClass>())
continue;
if (proj.active && proj.owner == Player.whoAmI)
@@ -3645,7 +3599,7 @@ namespace CalamityMod.CalPlayer
Player.HealPlayer(AngelicAlliance.HealPerAngelSpawned);
}
}
if (CalamityKeybinds.SpectralVeilHotKey.JustPressed && spectralVeil && Main.myPlayer == Player.whoAmI && rogueStealth >= rogueStealthMax * 0.25f &&
if (spectralVeil && Main.myPlayer == Player.whoAmI && FindAccessory<SpectralVeil>().JustPressedKeybind() && rogueStealth >= rogueStealthMax * 0.25f &&
wearingRogueArmor && rogueStealthMax > 0)
{
if (!Player.chaosState)
@@ -3691,7 +3645,7 @@ namespace CalamityMod.CalPlayer
}
}
}
if (CalamityKeybinds.BoosterDashHotKey.JustPressed && hasJetpack && Main.myPlayer == Player.whoAmI && rogueStealth >= rogueStealthMax * 0.25f &&
if (rogueDashItem != null && Main.myPlayer == Player.whoAmI && rogueDashItem.JustPressedKeybind() && rogueStealth >= rogueStealthMax * 0.25f &&
wearingRogueArmor && rogueStealthMax > 0 && !Player.HasCooldown(RogueBooster.ID) && !Player.mount.Active)
{
jetPackDash = blunderBooster ? 15 : 10;
@@ -3702,7 +3656,7 @@ namespace CalamityMod.CalPlayer
SoundEngine.PlaySound(SoundID.Item34, Player.Center);
}
if (CalamityKeybinds.AmmoCycleHotkey.JustPressed && deadshotBrooch)
if (ammoCycleItem != null && ammoCycleItem.JustPressedKeybind())
{
SoundEngine.PlaySound(SoundID.Item149, Player.Center);
@@ -3801,9 +3755,9 @@ namespace CalamityMod.CalPlayer
else
ArmorSetBonusKeyHeldTimer = 0;
if (CalamityKeybinds.AccessoryParryHotKey.JustPressed)
if (AccessoryParryItem != null && AccessoryParryItem.JustPressedKeybind())
{
if (blazingCore && blazingCoreParry == 0 && blazingCoreSuccessfulParry == 0)
if (divineProvidence && divineProvParry == 0 && divineProvSuccessfulParry == 0)
{
//minor cheese prevention with standing on a spike with later game gear spamming parry :skull:
//because of ordering, if they do not have the cooldown, it will not check the projectile array. Likewise if there are no bosses alive.
@@ -3811,8 +3765,8 @@ namespace CalamityMod.CalPlayer
if (!Player.HasCooldown(ParryCooldown.ID) || Player.ownedProjectileCounts[ProjectileType<BlazingStarHeal>()] == 0)
{
Player.SetScreenshake(3.5f);
blazingCoreParry = 30;
SoundEngine.PlaySound(BlazingCore.ParryActivateSound, Player.Center);
divineProvParry = 30;
SoundEngine.PlaySound(DivineProvidence.ParryActivateSound, Player.Center);
var mySourceIsIMadeItUp = Player.GetSource_FromThis();
int blazingSun = Projectile.NewProjectile(mySourceIsIMadeItUp, Player.Center, Vector2.Zero, ProjectileType<BlazingSun>(), 0, 0f, Player.whoAmI, 0f, 0f);
Main.projectile[blazingSun].Center = Player.Center;
@@ -4099,7 +4053,7 @@ namespace CalamityMod.CalPlayer
dust.velocity *= 6.6f;
}
}
if (dsSetBonus)
if (demonshadeSet)
{
SoundEngine.PlaySound(DemonshadeHelm.ActivationSound, Player.Center);
for (int i = 0; i < 36; i++)
@@ -4882,7 +4836,7 @@ namespace CalamityMod.CalPlayer
Player.velocity.Y = 0.5f;
}
else
Player.velocity.Y = 0f;
Player.velocity.Y = 1E-05f;
if (CalamityKeybinds.ExoChairSlowdownHotkey.Current)
Player.velocity *= 0.5f;
@@ -5268,6 +5222,15 @@ namespace CalamityMod.CalPlayer
if (Player.chiselSpeed)
Player.pickSpeed += 0.1f;
// Prevent Archaic Powder mining speed from stacking with Ancient Chisel or Ancient Fossil
if (archaicPowder)
{
if (Player.chiselSpeed)
Player.pickSpeed += 0.15f;
if (aFossil)
Player.pickSpeed += AncientFossil.MiningSpeedBoost;
}
if (oceanCrest)
{
bool surface = Player.Center.Y < Main.worldSurface * 16.0;
@@ -5391,7 +5354,7 @@ namespace CalamityMod.CalPlayer
EnhancedDarknessSystem.lights.Add(new(lastDeerclopsPosition.Value, scale: DeerclopsAI.borderScale, texture: DeerclopsAI.ArenaTex.Value));
//we draw light around the player when far away so they have some visibility, although very small. This is especially nice in multiplayer. we scale opacity with distance bc it looks better
EnhancedDarknessSystem.lights.Add(new EnhancedDarknessSystem.LightSource(scale: 0.75f, opacity: MathHelper.Clamp(Main.LocalPlayer.DistanceSQ(lastDeerclopsPosition.Value) / (409600 /*640^2*/), 0, 1)));
EnhancedDarknessSystem.lights.Add(new EnhancedDarknessSystem.LightSource(scale: 0.75f, opacity: MathHelper.Clamp(Main.LocalPlayer.DistanceSQ(lastDeerclopsPosition.Value) / 409600, 0, 1)));
if (darknessIntensity == 0)
{
@@ -5495,7 +5458,6 @@ namespace CalamityMod.CalPlayer
(statisVoidSash ? 0.85f : 0f) +
(blueCandle ? WeightlessCandle.AccelerationBoost : 0f) +
(planarSpeedBoost > 0 ? (0.01f * planarSpeedBoost) : 0f) +
//(exaltedKillMode ? 7f : devilsDevastationKillMode ? 11f : 0) +
(hasteLevel * 0.05f);
float runSpeedMult = 1f +
@@ -5509,7 +5471,6 @@ namespace CalamityMod.CalPlayer
(CobaltSet ? CobaltArmorSetChange.SpeedBoostSetBonusPercentage * 0.01f : 0f) +
(silvaSet ? SilvaArmor.AccelerationBoost : 0f) +
(planarSpeedBoost > 0 ? (0.01f * planarSpeedBoost) : 0f) +
//(exaltedKillMode ? 0.4f : devilsDevastationKillMode ? 0.7f : 0) +
(hasteLevel * 0.05f);
if ((Player.slippy || Player.slippy2) && Player.iceSkate)
@@ -5528,6 +5489,17 @@ namespace CalamityMod.CalPlayer
else
momentumCapacitorBoost = 0f;
if (Player.HasBuff<SmashedEvil>())
{
runAccMult += 0.25f;
Player.runSlowdown *= 1.5f;
if (Player.accRunSpeed > 3)
Player.accRunSpeed += 1.1f;
if (Player.wingAccRunSpeed > 3)
Player.wingAccRunSpeed += 1.1f;
Player.maxRunSpeed += 1.1f;
}
Player.runAcceleration *= runAccMult;
Player.maxRunSpeed *= runSpeedMult;
}
@@ -5838,7 +5810,7 @@ namespace CalamityMod.CalPlayer
rainbow.noGravity = true;
}
}
if (dsSetBonus)
if (demonshadeSet)
{
if (Main.rand.NextBool(3))
{
@@ -6114,7 +6086,10 @@ namespace CalamityMod.CalPlayer
float scale = MathHelper.Max(Main.screenWidth, Main.screenHeight) / size * 0.4f;
if (ProfanedMoonlightAuroraDrawer is null || ProfanedMoonlightAuroraDrawer.Size != size)
{
ProfanedMoonlightAuroraDrawer?.Dispose();
ProfanedMoonlightAuroraDrawer = FluidFieldManager.CreateField(size, scale, 0.1f, 50f, 0.992f);
}
int sourceArea = (int)Math.Ceiling(6f / ProfanedMoonlightAuroraDrawer.Scale) + 1;
ProfanedMoonlightAuroraDrawer.ShouldUpdate = Player.miscCounter % 2 == 0;
+1 -1
View File
@@ -431,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)
{
+46 -36
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;
@@ -43,7 +40,6 @@ using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Magic;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Projectiles.Pets;
using CalamityMod.Projectiles.Ranged;
using CalamityMod.Projectiles.Rogue;
using CalamityMod.Projectiles.Typeless;
@@ -147,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
@@ -210,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;
}
@@ -394,7 +390,7 @@ namespace CalamityMod.CalPlayer
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)
{
@@ -428,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;
@@ -498,7 +498,7 @@ namespace CalamityMod.CalPlayer
//
// FinalDamage cannot be used for the intended effect because there is no way to access the actual damage of the hit
CalamityGlobalNPC cgn = target.Calamity();
if (yellowCandle && cgn.DR < 0.99f && target.takenDamageMultiplier > 0.05f)
if (yellowCandle && cgn.DR < 0.9f && target.takenDamageMultiplier > 0.05f)
modifiers.ModifyHitInfo += YellowCandleBuff.ModifyHitInfo_Spite;
if (Player.Calamity().scionsCurio && item.CountsAsClass<RangedDamageClass>())
@@ -557,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;
@@ -896,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
@@ -1121,7 +1121,7 @@ namespace CalamityMod.CalPlayer
{
if (sulphurSet)
Main.npc[proj.Calamity().ParentNPCIndex].AddBuff(BuffID.Poisoned, SulphurousHelmet.SetBonusPoisonDuration);
}
}
}
if (proj.hostile && hurtInfo.Damage > 0)
@@ -1406,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));
@@ -1466,7 +1467,7 @@ namespace CalamityMod.CalPlayer
storedShadowDodge = false;
return true;
}
if (!Player.HasCooldown(GlobalDodge.ID) && sufficientDamageForDodging && DodgeEffects.Count > 0)
{
GenericDodgeEffects();
@@ -1489,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);
@@ -1499,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();
@@ -1554,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++)
@@ -1600,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)
{
@@ -2221,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++)
@@ -2236,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,
@@ -2370,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;
@@ -2485,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)
@@ -2507,7 +2517,7 @@ namespace CalamityMod.CalPlayer
}
}
}
else if (dsSetBonus)
else if (demonshadeSet)
{
if (Player.whoAmI == Main.myPlayer)
{
+13 -8
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;
}
//
@@ -677,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");
@@ -694,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;
@@ -704,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))
{
@@ -735,7 +741,6 @@ namespace CalamityMod.CalPlayer
finalRegen += 4f;
regeneratorDamage = finalRegen * Regenerator.RegenToDamageRatio;
Player.GetDamage<GenericDamageClass>() += regeneratorDamage;
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
+50 -59
View File
@@ -1060,9 +1060,9 @@ namespace CalamityMod.CalPlayer
// Create a direct strike to hit this specific NPC.
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<Calamity>()));
Projectile sigilStrike = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), sigilDamage, 0f, Player.whoAmI, target.whoAmI, 255f);
// Enable crits by setting the sigil's damage class to be whatever the player's strongest damage class is.
sigilStrike.DamageType = Player.GetBestClass();
//Set crit chance so Calamity can crit with the proper chance, but don't make it count as those classes.
sigilStrike.CritChance = (int)Player.GetTotalCritChance(Player.GetBestClass());
sigilStrike.DamageType = AverageDamageClass.Instance;
// Incinerate the target with either Vulnerability Hex or True Vulnerability Hex, depending on current cursor focus.
// This adds 8 to the buff duration, which results in a net increase of 3 frames every time damage is dealt, due to damage occurring every 5 frames.
@@ -1138,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++)
{
@@ -1457,7 +1458,6 @@ namespace CalamityMod.CalPlayer
}
// Death Mode effects
caveDarkness = 0f;
if (CalamityWorld.death || Main.getGoodWorld)
{
if (Player.whoAmI == Main.myPlayer)
@@ -1850,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);
}
}
@@ -2026,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;
@@ -2241,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)
@@ -2334,6 +2334,8 @@ namespace CalamityMod.CalPlayer
arsenalCooldown--;
if (killModeCooldown > 0)
killModeCooldown--;
if (oblivionCooldown > 0)
oblivionCooldown--;
if (ascendantInsigniaCooldown > 0 && ascendantInsigniaBuffTime <= 0)
ascendantInsigniaCooldown--;
if (transformerCooldown > 0)
@@ -2358,8 +2360,6 @@ namespace CalamityMod.CalPlayer
phantomicHeartRegen--;
if (phantomicBulwarkCooldown > 0)
phantomicBulwarkCooldown--;
if (galileoCooldown > 0)
galileoCooldown--;
if (gladiatorTimer > 0)
gladiatorTimer--;
if (dragonRageCooldown > 0)
@@ -2372,8 +2372,6 @@ namespace CalamityMod.CalPlayer
raiderSoundCooldown--;
if (astralStarRainCooldown > 0)
astralStarRainCooldown--;
if (VoidCooldown > 0)
VoidCooldown--;
if (ursaSergeantCooldown > 0)
ursaSergeantCooldown--;
if (generalBandCooldown > 0)
@@ -2445,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)
@@ -2539,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)
@@ -2582,8 +2578,6 @@ namespace CalamityMod.CalPlayer
}
else
adamantiteSetDefenseBoostInterpolant = 0f;
if (ChlorophyteHealDelay > 0)
ChlorophyteHealDelay--;
if (monolithAccursedShader > 0)
monolithAccursedShader--;
if (monolithBossRushShader > 0)
@@ -2771,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;
}
}
@@ -2839,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)
{
@@ -2946,6 +2941,29 @@ namespace CalamityMod.CalPlayer
}
}
if (Player.volatileGelatin)
{
Player.volatileGelatinCounter++;
int npcCount = 0;
int npcType = ModContent.NPCType<VolatileSlime>();
for (int x = 0; x < Main.maxNPCs; x++)
{
NPC npc = Main.npc[x];
if (npc.active && npc.type == npcType && npc.ai[1] == Player.whoAmI && npc.ai[3] == 0)
npcCount++;
}
int wingFlatBoost = 15; // 0.3 seconds of flight
float jumpSpeedBoost = 0.25f; // 5% jump speed
if (Player.wingTimeMax > 0)
Player.wingTimeMax += (wingFlatBoost * npcCount);
Player.jumpSpeedBoost += (jumpSpeedBoost * npcCount);
}
else
volatileGelHits = 0;
// Vortex Armor nerf
if (Player.vortexStealthActive && Player.HeldItem.type != ItemID.PsychoKnife)
{
@@ -3179,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);
@@ -3310,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);
}
}
@@ -3652,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);
@@ -3661,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);
@@ -3766,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)
@@ -3902,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)
{
@@ -3957,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))
@@ -4164,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);
@@ -4391,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)
{
+7 -9
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,7 +207,7 @@ 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;
@@ -358,8 +358,6 @@ namespace CalamityMod.CalPlayer
if (generalBandCooldown == 0)
{
int cooldown = 0;
// NOTE: Apparently Pulse Pistol/Pulse Rifle projectiles will set spawned projectiles here to inherit the proj ID???
// No clue why this happens or how to fix it, but it just breaks using multiple band types together on these two weapons
if (bGlassBand)
{
int damage = (int)Player.GetBestClassDamage().ApplyTo(BlackGlassBand.damage);
@@ -368,7 +366,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);
@@ -376,7 +374,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);
@@ -618,7 +616,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)
+3 -3
View File
@@ -15,7 +15,7 @@ namespace CalamityMod.CalPlayer.DrawLayers
}
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 : EncasementType.FlameLickedShell;
public EncasementType GetEncasementTypeFor(CalamityPlayer modPlayer) => modPlayer.divineProvidence ? EncasementType.BlazingCore : EncasementType.FlameLickedShell;
public override bool GetDefaultVisibility(PlayerDrawSet drawInfo)
{
@@ -25,7 +25,7 @@ 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,
_ => false
};
@@ -45,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;
+1 -1
View File
@@ -71,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;
}
}
}
+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);
}
}
+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.

After

Width:  |  Height:  |  Size: 2.8 KiB

+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--;
+18
View File
@@ -289,6 +289,24 @@ namespace CalamityMod.DataStructures
/// </summary>
public static void OiledNPCMethod(NPC npc, int buffType, ref int buffIndex, ref int damage)
{
// Exclude Oiled itself from counting as an applicable debuff
bool valid = false;
for (int i = 0; i < npc.buffType.Length; i++)
{
int activeBuff = npc.buffType[i];
if (activeBuff > 0 && activeBuff != BuffID.Oiled)
{
var data = CalamityBuffSets.DebuffDataset[activeBuff];
if (data != null && data.HeatDebuffScaling > 0)
{
valid = true;
break;
}
}
}
if (!valid && !(npc.onFrostBurn || npc.onFrostBurn2 || npc.onFire || npc.onFire2 || npc.onFire3 || npc.shadowFlame))
return;
var cnpc = npc.Calamity();
double totalDPS = ApplyScalingToStatModifer(cnpc.ActiveHeatDebuffMultiplier, Oiled.HeatDebuffScaling).ApplyTo(Oiled.EnemyLostRegen);
if (totalDPS <= 0)
+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.
+12 -9
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.
@@ -219,10 +219,6 @@ namespace CalamityMod.Effects
/// </summary>
internal static Asset<Effect> DozeLightingShader;
/// <summary>
/// Flips the screen. Used for Gravity Globe.
/// </summary>
internal static Asset<Effect> FlipScreenShader;
/// <summary>
/// Distorts a texture towards the center based on a provided noisemap. Meant to emulate the Terraria Otherworld barrier effects.
/// Opacity is the intensity of this distortion, and Saturation is the speed the noisemap moves at.
/// </summary>
@@ -266,6 +262,9 @@ namespace CalamityMod.Effects
// 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
@@ -273,6 +272,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
@@ -497,9 +497,6 @@ namespace CalamityMod.Effects
DozeLightingShader = LoadShader("DozeLightingShader");
RegisterMiscShader(DozeLightingShader, "ShadowPass", "DozeLightingShader");
FlipScreenShader = LoadShader("ScreenShaders/FlipScreen");
RegisterScreenShader(FlipScreenShader, "FlipTheScreen", "FlipScreen",EffectPriority.VeryHigh);
OtherworldBarrierDistortionShader = LoadShader("OtherworldBarrierDistortion");
RegisterMiscShader(OtherworldBarrierDistortionShader, "DistortionPass", "OtherworldBarrierDistortion");
#endregion
@@ -537,6 +534,9 @@ namespace CalamityMod.Effects
HorribleHogAuraShader = LoadShader("HorribleHogAuraShader");
RegisterMiscShader(HorribleHogAuraShader, "ScaryAuraPass", "HorribleHogAura");
ProvidenceHolyOrbTrailShader = LoadShader("ProvidenceHolyOrbTrailShader");
RegisterMiscShader(ProvidenceHolyOrbTrailShader, "TrailPass", "ProvidenceHolyOrbTrail");
#endregion
#region Loading Big E's Shaders
@@ -549,6 +549,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
+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.
-38
View File
@@ -1,38 +0,0 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
sampler uImage2 : register(s2);
sampler uImage3 : register(s3);
float3 uColor;
float3 uSecondaryColor;
float2 uScreenResolution;
float2 uScreenPosition;
float2 uTargetPosition;
float2 uDirection;
float uOpacity;
float uTime;
float uIntensity;
float uProgress;
float2 uImageSize1;
float2 uImageSize2;
float2 uImageSize3;
float2 uImageOffset;
float uSaturation;
float4 uSourceRect;
float2 uZoom;
float4 FilterMyShader(float2 coords : TEXCOORD0) : COLOR0
{
float2 newCoords;
newCoords.x = coords.x;
newCoords.y = 1 - coords.y;
float4 color = tex2D(uImage0, newCoords);
return color;
}
technique Technique1
{
pass FlipTheScreen
{
PixelShader = compile ps_2_0 FilterMyShader();
}
}
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>())
{
+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.

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 714 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 809 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 672 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 516 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 742 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 B

+3 -5
View File
@@ -63,6 +63,7 @@ namespace CalamityMod.ILEditing
// Mechanics / features
On_NPC.ApplyTileCollision += AllowFusionFeederToDigThroughSand;
On_NPC.RerollVariation += AllowPatronNameRerollsOnLicenseUse;
IL_Player.ApplyEquipFunctional += ScopesRequireVisibilityToZoom;
IL_Player.Hurt_PlayerDeathReason_int_int_refHurtInfo_bool_bool_int_bool_float_float_float += DodgeMechanicAdjustments;
On_Player.PutHallowedArmorSetBonusOnCooldown += AddHolyProtectionCooldown;
@@ -141,6 +142,8 @@ namespace CalamityMod.ILEditing
IL_UIWorldCreation.AddWorldSizeOptions += SwapSmallDescriptionKey;
On_WorldGen.MakeDungeon += LimitDungeonEntranceXPosition;
IL_WorldGen.DungeonHalls += LimitDungeonHallsXPosition;
IL_WorldGen.IslandHouse += MakeFledgingWingsMoreCommon;
IL_WorldGen.AddBuriedChest_int_int_int_bool_int_bool_ushort += DisableFledglingWingsSecondary;
// Removal of vanilla stupidity
IL_Player.StatusFromNPC += RemoveExpertBrainRandomDebuffs;
@@ -170,11 +173,6 @@ namespace CalamityMod.ILEditing
IL_Main.DrawInfoAccs += RemoveDamageConditionFromRadar;
//On_ShopHelper.ApplyNpcRelationshipEffect += AllowMultipleLikedNPCs;
On_Player.UpdateControlHolds += DelayGravity;
On_PlayerInput.SetZoom_MouseInWorld += GravityMouse;
On_Main.DrawPlayerChatBubbles += UI_Unflip_Start;
On_Main.DrawInterface += UI_Unflip_End;
// Fix vanilla not accounting for spritebatch modification in held projectile drawing
On_PlayerDrawLayers.DrawHeldProj += FixHeldProjectileBlendState;
+114 -18
View File
@@ -30,6 +30,7 @@ using CalamityMod.Tiles;
using CalamityMod.Utilities.Daybreak;
using CalamityMod.Walls;
using CalamityMod.Walls.UnsafeWalls;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Mono.Cecil.Cil;
@@ -236,14 +237,6 @@ namespace CalamityMod.ILEditing
dir = self.direction;
dashing = true;
// CIT 16OCT2024: Commented this code out, as there's no reason for custom dash hotkey to use Player.dashTime
// and was causing the return of Celestial Starboard's dash bug from early 1.4 versions
/*if ((self.dashTime <= 0 && self.direction == -1) || (self.dashTime >= 0 && self.direction == 1))
{
self.dashTime = 15;
return;
}*/
dashing = true;
self.dashTime = 0;
self.timeSinceLastDashStarted = 0;
@@ -251,7 +244,7 @@ namespace CalamityMod.ILEditing
return;
}
if (CalamityKeybinds.DashHotkey.GetAssignedKeysOrEmpty().Count == 0)
if (CalamityKeybinds.DashHotkey.GetAssignedKeysOrEmpty(PlayerInput.CurrentInputMode).Count == 0)
orig(self, out dir, out dashing, dashStartAction);
else
{
@@ -326,6 +319,27 @@ namespace CalamityMod.ILEditing
}
#endregion
#region Allow Patron Name Rerolls on License Use
private static bool AllowPatronNameRerollsOnLicenseUse(On_NPC.orig_RerollVariation orig, NPC self)
{
bool success = orig(self);
if (success)
{
if (self.type == NPCID.TownBunny)
CalamityWorld.bunnyName = false;
if (self.type == NPCID.TownCat)
CalamityWorld.catName = false;
if (self.type == NPCID.TownDog)
CalamityWorld.dogName = false;
if (!self.TryGetGlobalNPC<CalamityGlobalTownNPC>(out var calGlobalTownNPC))
return success;
calGlobalTownNPC.setNewName = true;
}
return success;
}
#endregion
#region Prevent Diabolists from Dropping Stuff in GFB Before Plantera
private static void PreventDiabolistLootLogic(On_NPC.orig_NPCLoot orig, NPC self)
{
@@ -639,8 +653,14 @@ namespace CalamityMod.ILEditing
{
if (self.Calamity().ChaosStone)
{
if (amount <= -1)
amount = self.GetManaCost(item);
if (pay)
{
self.statMana -= item.mana;
CombinedHooks.OnConsumeMana(self, item, amount);
}
if (self.statMana < -self.statManaMax2)
self.statMana = -self.statManaMax2;
return true;
@@ -695,7 +715,10 @@ namespace CalamityMod.ILEditing
ref FluidField calamityFireDrawer = ref player.Calamity().CalamityFireDrawer;
ref Vector2 firePosition = ref player.Calamity().FireDrawerPosition;
if (calamityFireDrawer is null || calamityFireDrawer.Size != size)
{
calamityFireDrawer?.Dispose();
calamityFireDrawer = FluidFieldManager.CreateField(size, scale, 0.1f, 50f, 0.992f);
}
// Update the fire draw position.
firePosition = new Vector2(Main.screenWidth, Main.screenHeight) * 0.5f;
@@ -1118,19 +1141,92 @@ namespace CalamityMod.ILEditing
{
// If an Abyss wall is detected, try to find another teleportation location
bool canSpawn = false;
int teleportStartX = 100;
int halfWorldWidth = Main.maxTilesX / 2;
int teleportStartX = Abyss.AtLeftSideOfWorld ? halfWorldWidth - (halfWorldWidth - 175) + 35 : halfWorldWidth + (halfWorldWidth - 175) - 35;
int teleportRangeX = Main.maxTilesX - 200;
int teleportStartY = 100;
int underworldLayer = Main.UnderworldLayer;
Vector2 newerPos = self.CheckForGoodTeleportationSpot(ref canSpawn, teleportStartX, teleportRangeX, teleportStartY, underworldLayer, new Player.RandomTeleportationAttemptSettings
int teleportRangeY = Main.UnderworldLayer;
int attempts = 0;
int maxAttempts = 1000;
int teleportPositionX = 0;
int teleportPositionY = 0;
Vector2 teleportPosition = new Vector2(teleportPositionX, teleportPositionY) * 16f - new Vector2(self.width * 0.5f + 8, self.height);
while (!canSpawn && attempts < maxAttempts)
{
avoidLava = true,
avoidHurtTiles = true,
maximumFallDistanceFromOrignalPoint = 100,
attemptsBeforeGivingUp = 1000
});
attempts++;
if (Abyss.AtLeftSideOfWorld)
teleportPositionX = teleportStartX + Main.rand.Next(teleportRangeX);
else
teleportPositionX = teleportStartX - Main.rand.Next(teleportRangeX);
teleportPositionY = teleportStartY + Main.rand.Next(teleportRangeY);
teleportPositionX = MathHelper.Clamp(teleportPositionX, 5, Main.maxTilesX - 5);
teleportPositionY = MathHelper.Clamp(teleportPositionY, 5, Main.maxTilesY - 5);
teleportPosition = new Vector2(teleportPositionX, teleportPositionY) * 16f - new Vector2(self.width * 0.5f + 8, self.height);
if (Collision.SolidCollision(teleportPosition, self.width, self.height))
continue;
Tile tile = Framing.GetTileSafely(new Point(teleportPositionX, teleportPositionY));
bool behindTempleWalls = tile.WallType == WallID.LihzahrdBrickUnsafe && teleportPositionY > Main.worldSurface && !NPC.downedPlantBoss;
bool behindDungeonWalls = Main.wallDungeon[tile.WallType] && teleportPositionY > Main.worldSurface && !NPC.downedBoss3;
if (behindTempleWalls || behindDungeonWalls)
continue;
int distanceToGround = 0;
int maxFallDistance = 100;
while (distanceToGround < maxFallDistance)
{
Tile groundTile = Framing.GetTileSafely(new Point(teleportPositionX, teleportPositionY + distanceToGround));
teleportPosition = new Vector2(teleportPositionX, teleportPositionY + distanceToGround) * 16f - new Vector2(self.width * 0.5f + 8, self.height);
Collision.SlopeCollision(teleportPosition, self.velocity, self.width, self.height, self.gravDir);
if (!Collision.SolidCollision(teleportPosition, self.width, self.height))
{
distanceToGround++;
continue;
}
if (groundTile.HasUnactuatedTile && Main.tileSolid[groundTile.TileType])
break;
distanceToGround++;
}
teleportPosition.Y -= 16f;
bool inLava = Collision.LavaCollision(teleportPosition, self.width, self.height);
bool onHurtingTile = Collision.AnyHurtingTiles(teleportPosition, self.width, self.height);
bool insideBlocks = Collision.SolidCollision(teleportPosition, self.width, self.height);
bool reachedMaxFallDistance = distanceToGround >= maxFallDistance;
if (inLava || onHurtingTile || insideBlocks || reachedMaxFallDistance)
continue;
Vector2 checkDirection = Vector2.UnitX * 16f;
if (Collision.TileCollision(teleportPosition - checkDirection, checkDirection, self.width, self.height, false, false, (int)self.gravDir) != checkDirection)
continue;
checkDirection = Vector2.UnitX * -16f;
if (Collision.TileCollision(teleportPosition - checkDirection, checkDirection, self.width, self.height, false, false, (int)self.gravDir) != checkDirection)
continue;
checkDirection = Vector2.UnitY * 16f;
if (Collision.TileCollision(teleportPosition - checkDirection, checkDirection, self.width, self.height, false, false, (int)self.gravDir) == checkDirection)
{
checkDirection = Vector2.UnitY * -16f;
if (Collision.TileCollision(teleportPosition - checkDirection, checkDirection, self.width, self.height, false, false, (int)self.gravDir) == checkDirection)
{
canSpawn = true;
teleportPositionY += distanceToGround;
teleportPosition = new Vector2(teleportPositionX, teleportPositionY) * 16f - new Vector2(self.width * 0.5f + 8, self.height);
break;
}
}
}
// Attempt teleporting again with the new location
orig(self, newerPos, Style, extraInfo);
orig(self, teleportPosition, Style, extraInfo);
}
else
{
+2 -89
View File
@@ -18,7 +18,9 @@ using Terraria.DataStructures;
using Terraria.GameContent.Drawing;
using Terraria.GameContent.ItemDropRules;
using Terraria.GameInput;
using Terraria.Graphics;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Renderers;
using Terraria.ID;
using Terraria.ModLoader;
@@ -713,95 +715,6 @@ namespace CalamityMod.ILEditing
}*/
#endregion
#region Allow Disabling Gravity Swap Visual and Allow Gravity Keybind
private static void DelayGravity(On_Player.orig_UpdateControlHolds orig, Player Player)
{
var cplay = Player.Calamity();
if (CalamityKeybinds.SwitchGravityHotkey.GetAssignedKeysOrEmpty().Count != 0 && (Player.gravControl || Player.gravControl2) && !Player.mount.Active)
{
if (Player.controlUp && Player.releaseUp)
{
Player.gravDir *= -1;
}
if (CalamityKeybinds.SwitchGravityHotkey.JustPressed)
{
Player.gravDir *= -1;
Player.fallStart = (int)(Player.position.Y / 16f);
Player.jump = 0;
SoundEngine.PlaySound(SoundID.Item8, Player.position);
}
if (Player.forcedGravity > 0)
{
Player.gravDir = -1f;
}
}
if (cplay.justChangedGravity)
{
Player.gravDir = cplay.oldGravDir;
}
cplay.justChangedGravity = cplay.oldGravDir != Player.gravDir;
cplay.oldGravDir = Player.gravDir;
if (Main.netMode != NetmodeID.Server && !Main.gameMenu && CalamityClientConfig.Instance.DisableGravityScreenSwap)
{
if (Player.gravDir == -1)
{
if (!Filters.Scene["CalamityMod:FlipScreen"].IsActive())
{
Filters.Scene.Activate("CalamityMod:FlipScreen");
Filters.Scene["CalamityMod:FlipScreen"].Opacity = 1f;
}
}
else
{
if (Filters.Scene["CalamityMod:FlipScreen"].IsActive())
{
Filters.Scene["CalamityMod:FlipScreen"].Opacity = 0f;
Filters.Scene.Deactivate("CalamityMod:FlipScreen");
}
}
}
if (cplay.justChangedGravity)
{
Player.gravDir *= -1;
}
orig(Player);
}
private static void GravityMouse(On_PlayerInput.orig_SetZoom_MouseInWorld orig)
{
orig();
if (!Main.gameMenu && Filters.Scene["CalamityMod:FlipScreen"].IsActive())//((Main.LocalPlayer.gravDir == -1 && !Main.LocalPlayer.Calamity().justChangedGravity) || (Main.LocalPlayer.Calamity().oldGravDir == -1 && Main.LocalPlayer.Calamity().justChangedGravity))
{
var center = Main.screenHeight / 2;
Main.mouseY = center - (Main.mouseY - center);
}
;
}
private static void UI_Unflip_Start(On_Main.orig_DrawPlayerChatBubbles orig, Main self)
{
if (!Main.gameMenu && (Filters.Scene["CalamityMod:FlipScreen"].IsActive() || Main.LocalPlayer.Calamity().justChangedGravity))
{
Main.LocalPlayer.Calamity().tempGravDir = Main.LocalPlayer.gravDir;
Main.LocalPlayer.gravDir = 1;
}
orig(self);
}
private static void UI_Unflip_End(On_Main.orig_DrawInterface orig, Main self, GameTime gameTime)
{
orig(self, gameTime);
if (!Main.gameMenu && Filters.Scene["CalamityMod:FlipScreen"].IsActive())
{
Main.LocalPlayer.gravDir = Main.LocalPlayer.Calamity().tempGravDir;
}
}
#endregion
// 02JUN2024: Ozzatron: The below code is being kept in its initial state for historic value.
#region Store The Stupid Fucking Private Wind Map In Public Property
[/*TotallyNot*/Obsolete("This function serves no purpose and is included in the Calamity source code for historic value.", error: true)]
+67
View File
@@ -208,5 +208,72 @@ namespace CalamityMod.ILEditing
}
#endregion Prevent Abyss/Dungeon Interactions
#region Fledgling Wings Loot Changes
/// <summary>
/// Changes the primary loot of Floating Island chests to include Fledging Wings
/// </summary>
private static void MakeFledgingWingsMoreCommon(ILContext il)
{
var cursor = new ILCursor(il);
// How the code we are moving to works:
// Set num13 equal to the number of islands generated. If greater than 3, set to a random number between 0-3 inclusive. Then use that value in a 4-branch switch statement.
// This makes num13 always be a value between 0-3, for the 4 primary items in island loot.
// To accomodate for Fledgling Wings, we must change this to check for being greater than 4, then to set to a random number between 0-4 inclusive, then make the switch have 5 branches.
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchStloc(13)))
{
LogFailure("Fledgling Wings", "Could not move to the location of determining Floating Island primary loot 1.");
return;
}
// Emit a delegate which reimplements the logic for choosing the primary loot of floating islands with Fledgling Wings, then return the ID of the item.
var label = il.DefineLabel();
cursor.EmitDelegate<Func<int>>(() =>
{
int island = GenVars.skyIslandHouseCount;
if (island > 4)
island = Main.rand.Next(5);
return island switch
{
1 => 65, // Starfury
2 => 158, // Lucky Horseshoe
3 => 2219, // Celestial Magnet
4 => 4978, // Fledgling Wings
_ => 159, // Shiny Red Balloon
};
});
// Store this value in the variable which holds the ID of the item, then branch past the original logic.
cursor.Emit(OpCodes.Stloc, 13);
cursor.Emit(OpCodes.Br, label);
if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdsfld<WorldGen>("getGoodWorldGen")))
{
LogFailure("Fledgling Wings", "Could not move after the switch statement.");
return;
}
cursor.MarkLabel(label);
}
/// <summary>
/// Disables Fledgling Wings being added as secondary loot in floating island chests
/// </summary>
private static void DisableFledglingWingsSecondary(ILContext il)
{
var cursor = new ILCursor(il);
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdloc(9)))
{
LogFailure("Fledgling Wings", "Could not move to the code adding Fledgling Wings as secondary loot.");
return;
}
// AND with 0 (false) so that the code to add Fledgling Wings as secondary loot never runs.
cursor.Emit(OpCodes.Ldc_I4_0);
cursor.Emit(OpCodes.And);
}
#endregion
}
}
+2 -2
View File
@@ -49,8 +49,8 @@ namespace CalamityMod.Items.Accessories
CreateRecipe().
AddIngredient(ItemID.ArcticDivingGear).
AddIngredient<DepthCharm>().
AddIngredient<DepthCells>(10).
AddIngredient<Lumenyl>(10).
AddIngredient<DepthCells>(20).
AddIngredient<Lumenyl>(15).
AddTile(TileID.MythrilAnvil).
Register();
}
+2 -2
View File
@@ -73,8 +73,8 @@ namespace CalamityMod.Items.Accessories
CreateRecipe().
AddIngredient<MirageMirror>().
AddIngredient<InkBomb>().
AddIngredient<DepthCells>(5).
AddIngredient<Lumenyl>(5).
AddIngredient<DepthCells>(20).
AddIngredient<Lumenyl>(15).
AddTile(TileID.MythrilAnvil).
Register();
}
-1
View File
@@ -30,7 +30,6 @@ namespace CalamityMod.Items.Fishing
CreateRecipe().
AddIngredient(ItemID.FishingBobber).
AddIngredient<AerialiteBar>(5).
AddIngredient(ItemID.Feather).
AddTile(TileID.Anvils).
Register();
}
Loaded 100 of 929 files, more files were not shown because too many files have changed in this diff. Show more