This commit is contained in:
doze-zoze committed 2025-11-17 12:27:36 -06:00
commit a1dd1d28d7
418 files changed
+27500 -25237

No files matched your search

+1 -1
View File
@@ -50,7 +50,7 @@ namespace CalamityMod.Balancing
p.type == ProjectileType<ArkoftheCosmosSwungBlade>() && (p.ai[0] == 2 || p.ai[0] == 3);
bool HiveBeeFilter(Projectile p) =>
p.type == ProjectileType<BasicPlagueBee>() && Main.player[p.owner].ActiveItem().type == ItemType<TheHive>();
p.type == ProjectileType<BasicPlagueBee>() && Main.player[p.owner].HeldItem.type == ItemType<TheHive>();
NPCSpecificBalancingChanges = new List<NPCBalancingChange>();
+1 -1
View File
@@ -32,7 +32,7 @@ namespace CalamityMod.Buffs.DamageOverTime
}
}
Item heldItem = Main.player[owner].ActiveItem();
Item heldItem = Main.player[owner].HeldItem;
int totalDamage = (int)Main.player[owner].GetTotalDamage<SummonDamageClass>().ApplyTo(debuffData.EnemyLostRegen);
if (CalamityUtils.ShouldTriggerSummonPenalty(Main.player[owner], heldItem))
+1 -1
View File
@@ -1,4 +1,4 @@
using CalamityMod.Projectiles.Summon;
using CalamityMod.Projectiles.Summon;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
+3 -3
View File
@@ -1,12 +1,12 @@
using CalamityMod.Projectiles.Summon;
using CalamityMod.Projectiles.Summon;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class SolarGodSpiritBuff : BaseSummonBuff
{
protected override int MinionProjectileType => ModContent.ProjectileType<SolarGod>();
protected override int MinionProjectileType => ModContent.ProjectileType<VengefulSunSpiritMinion>();
protected override ref bool MinionBool => ref BuffModdedOwner.SPG;
protected override ref bool MinionBool => ref BuffModdedOwner.vengefulSunMinion;
}
}
+3 -3
View File
@@ -1,12 +1,12 @@
using CalamityMod.Projectiles.Summon;
using CalamityMod.Projectiles.Summon;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class SolarSpirit : BaseSummonBuff
{
protected override int MinionProjectileType => ModContent.ProjectileType<SolarPixie>();
protected override int MinionProjectileType => ModContent.ProjectileType<SunSpiritMinion>();
protected override ref bool MinionBool => ref BuffModdedOwner.SP;
protected override ref bool MinionBool => ref BuffModdedOwner.sunSpirit;
}
}
+19 -14
View File
@@ -298,8 +298,8 @@ namespace CalamityMod.CalPlayer
public int arsenalCooldown = 0;
public int killModeCooldown = 0;
public bool demonSwordKillMode = false;
public bool exaltedKillMode => (demonSwordKillMode && Player.ActiveItem().type == ItemType<ExaltedOathblade>());
public bool devilsDevastationKillMode => (demonSwordKillMode && Player.ActiveItem().type == ItemType<DevilsDevastation>());
public bool exaltedKillMode => (demonSwordKillMode && Player.HeldItem.type == ItemType<ExaltedOathblade>());
public bool devilsDevastationKillMode => (demonSwordKillMode && Player.HeldItem.type == ItemType<DevilsDevastation>());
/// <summary>
/// Tracks Dragoon Drizzlefish's "gel feed" mechanic in Get fixed boi.<br/>
/// Consuming Gel adds 1 to this counter, up to a maximum of 6, and using the weapon has a random chance to decrement the counter.<br/>
@@ -1461,12 +1461,12 @@ namespace CalamityMod.CalPlayer
public bool brittleStar = false;
public bool aquaticStar = false;
/// <summary> Sun Spirit Staff. </summary>
public bool SP = false;
public bool sunSpirit = false;
public bool dCreeper = false;
public bool eAxe = false;
public bool endoCooper = false;
/// <summary> Vengeful Sun Staff. </summary>
public bool SPG = false;
public bool vengefulSunMinion = false;
public bool sirius = false;
/// <summary> Yharon's Kindle Staff. </summary>
public bool aChicken = false;
@@ -1525,6 +1525,7 @@ namespace CalamityMod.CalPlayer
public bool providenceStabber = false;
public bool seashineSwordBuff = false;
public bool saros = false;
public int sarosEclipseBeamUsage = 0;
/// <summary> Fuel Cell Bundle. </summary>
public bool plaguebringerMK2 = false;
public bool igneousExaltation = false;
@@ -2710,7 +2711,7 @@ namespace CalamityMod.CalPlayer
aSlime = false;
brittleStar = false;
aquaticStar = false;
SP = false;
sunSpirit = false;
dCreeper = false;
eAxe = false;
endoCooper = false;
@@ -2718,7 +2719,7 @@ namespace CalamityMod.CalPlayer
gastricBelcher = false;
hauntedDishes = false;
stormjaw = false;
SPG = false;
vengefulSunMinion = false;
sirius = false;
aChicken = false;
cLamp = false;
@@ -2777,6 +2778,10 @@ namespace CalamityMod.CalPlayer
voidAuraDamage = false;
voidConcentrationAura = false;
saros = false;
if (sarosEclipseBeamUsage > 300)
sarosEclipseBeamUsage = 300;
if (sarosEclipseBeamUsage > 0 && Player.ownedProjectileCounts[ModContent.ProjectileType<SarosEclipseBeam>()] <= 0)
sarosEclipseBeamUsage--;
virili = false;
frostBlossom = false;
cinderBlossom = false;
@@ -2881,7 +2886,7 @@ namespace CalamityMod.CalPlayer
disablePerfCystSpawns = false;
disableVoodooSpawns = false;
EnchantHeldItemEffects(Player, Player.Calamity(), Player.ActiveItem());
EnchantHeldItemEffects(Player, Player.Calamity(), Player.HeldItem);
}
#endregion
@@ -3732,7 +3737,7 @@ namespace CalamityMod.CalPlayer
if (Player.Calamity().SpeedBlasterDashStarted || (Player.dashDelay != 0 && (Player.Calamity().LastUsedDashID == SuperradiantSawDash.ID || Player.Calamity().LastUsedDashID == SpeedBlasterDash.ID)))
{
Player.Calamity().DeferredDashID = Player.ActiveItem().type == ItemType<SuperradiantSlaughterer>() ? SuperradiantSawDash.ID : SpeedBlasterDash.ID;
Player.Calamity().DeferredDashID = Player.HeldItem.type == ItemType<SuperradiantSlaughterer>() ? SuperradiantSawDash.ID : SpeedBlasterDash.ID;
Player.dash = 0;
}
@@ -3740,7 +3745,7 @@ namespace CalamityMod.CalPlayer
if (CalamityKeybinds.RageHotKey.JustPressed)
{
// Gael's Greatsword replaces Rage Mode with an uber skull attack
if (!(Player.HasCooldown(Cooldowns.GaelsRage.ID)) && Player.ActiveItem().type == ItemType<GaelsGreatsword>() && rage > 0f)
if (!(Player.HasCooldown(Cooldowns.GaelsRage.ID)) && Player.HeldItem.type == ItemType<GaelsGreatsword>() && rage > 0f)
{
SoundEngine.PlaySound(SilvaArmor.DispelSound, Player.Center);
@@ -3759,7 +3764,7 @@ namespace CalamityMod.CalPlayer
}
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
var source = Player.GetSource_ItemUse(Player.ActiveItem(), GaelsGreatsword.SkullsplosionEntitySourceContext);
var source = Player.GetSource_ItemUse(Player.HeldItem, GaelsGreatsword.SkullsplosionEntitySourceContext);
float rageRatio = rage / rageMax;
float baseDamage = rageRatio * GaelsGreatsword.SkullsplosionDamageMultiplier * GaelsGreatsword.BaseDamage;
int damage = (int)Player.GetTotalDamage<MeleeDamageClass>().ApplyTo(baseDamage);
@@ -5325,7 +5330,7 @@ namespace CalamityMod.CalPlayer
#region Anomaly's Nanogun Kill Sound
public override void Kill(double damage, int hitDirection, bool pvp, PlayerDeathReason damageSource)
{
if (Player.whoAmI == Main.myPlayer && Player.ActiveItem().type == ItemType<TheAnomalysNanogun>())
if (Player.whoAmI == Main.myPlayer && Player.HeldItem.type == ItemType<TheAnomalysNanogun>())
{
if (Main.rand.NextBool(20))
SoundEngine.PlaySound(IjiDeathSound, Player.Center);
@@ -5497,7 +5502,7 @@ namespace CalamityMod.CalPlayer
// This doesn't trigger stealth strike effects (ConsumeStealthStrike instead of StealthStrike)
// so non-rogue weapons can't call lasers down from the sky and such.
// Using any item which deals no damage or is a tool doesn't consume stealth.
Item it = Player.ActiveItem();
Item it = Player.HeldItem;
bool hasDamage = it.damage > 0;
bool hasHitboxes = !it.noMelee || it.shoot > ProjectileID.None;
bool isPickaxe = it.pick > 0;
@@ -5545,7 +5550,7 @@ namespace CalamityMod.CalPlayer
return;
// Hovering over an item will adjust the stealth bonus dynamically so that you see the correct damage for an item you put your cursor on.
Item it = !Main.HoverItem.IsAir ? Main.HoverItem : Player.ActiveItem();
Item it = !Main.HoverItem.IsAir ? Main.HoverItem : Player.HeldItem;
// The potential damage bonus from stealth is a complex equation based on the item's use time,
// the player's averaged-together stealth generation stats, and max stealth.
@@ -5692,7 +5697,7 @@ namespace CalamityMod.CalPlayer
internal void rollBabSpears(int randAmt, bool chaseable)
{
var source = Player.GetSource_ItemUse(Player.ActiveItem());
var source = Player.GetSource_ItemUse(Player.HeldItem);
if (Player.whoAmI == Main.myPlayer && !endoCooper && randAmt > 0 && Main.rand.NextBool(randAmt) && chaseable)
{
int spearsFired = 0;
+1 -1
View File
@@ -702,7 +702,7 @@ namespace CalamityMod.CalPlayer
return;
Player drawPlayer = drawInfo.drawPlayer;
Item item = drawPlayer.ActiveItem();
Item item = drawPlayer.HeldItem;
if (!drawPlayer.frozen &&
(item.IsAir || item.type > ItemID.None) &&
+3 -3
View File
@@ -733,7 +733,7 @@ namespace CalamityMod.CalPlayer
bool isSummon = proj.CountsAsClass<SummonDamageClass>();
if (isSummon)
{
Item heldItem = Player.ActiveItem();
Item heldItem = Player.HeldItem;
if (CalamityUtils.ShouldTriggerSummonPenalty(Player, heldItem) && !CalamityProjectileSets.MinionWhichIgnoresSummonerNerf[proj.type])
modifiers.FinalDamage *= BalancingConstants.SummonerCrossClassNerf;
@@ -841,7 +841,7 @@ namespace CalamityMod.CalPlayer
if (bloodflareMelee && bloodflareFrenzy && !Player.HasCooldown(BloodflareFrenzy.ID))
modifiers.FinalDamage *= (1f - BloodflareHeadMelee.FrenzyContactDamageReduction);
if (Player.ownedProjectileCounts[ModContent.ProjectileType<EnergyShell>()] > 0 && Player.ActiveItem().type == ModContent.ItemType<LionHeart>())
if (Player.ownedProjectileCounts[ModContent.ProjectileType<EnergyShell>()] > 0 && Player.HeldItem.type == ModContent.ItemType<LionHeart>())
modifiers.FinalDamage *= 0.5f;
bool lifeAndShieldCondition = Player.statLife >= Player.statLifeMax2 && (!HasAnyEnergyShield || TotalEnergyShielding >= TotalMaxShieldDurability);
@@ -1053,7 +1053,7 @@ namespace CalamityMod.CalPlayer
modifiers.FinalDamage *= 0.75f;
}
if (Player.ownedProjectileCounts[ModContent.ProjectileType<EnergyShell>()] > 0 && Player.ActiveItem().type == ModContent.ItemType<LionHeart>())
if (Player.ownedProjectileCounts[ModContent.ProjectileType<EnergyShell>()] > 0 && Player.HeldItem.type == ModContent.ItemType<LionHeart>())
modifiers.FinalDamage *= 0.5f;
bool lifeAndShieldCondition = Player.statLife >= Player.statLifeMax2 && (!HasAnyEnergyShield || TotalEnergyShielding >= TotalMaxShieldDurability);
+12 -16
View File
@@ -188,7 +188,7 @@ namespace CalamityMod.CalPlayer
}
}
if (Player.ActiveItem().type != ModContent.ItemType<SaharaSlicers>())
if (Player.HeldItem.type != ModContent.ItemType<SaharaSlicers>())
saharaSlicersBolts = 0;
if (Player.whoAmI == Main.myPlayer && Player.HeldItem.type == ModContent.ItemType<Starfleet>() && (Player.ownedProjectileCounts[ModContent.ProjectileType<StarfleetHoldout>()] == 0) && !Player.dead)
@@ -203,7 +203,7 @@ namespace CalamityMod.CalPlayer
}
// De-equipping Gael's Greatsword deletes all rage.
if (Player.ActiveItem().type == ModContent.ItemType<GaelsGreatsword>())
if (Player.HeldItem.type == ModContent.ItemType<GaelsGreatsword>())
heldGaelsLastFrame = true;
else if (heldGaelsLastFrame)
{
@@ -452,8 +452,8 @@ namespace CalamityMod.CalPlayer
else // Decrementing
{
elementalMasterySFXPlayed = false;
// Once every 20 ticks
if (elementalMasteryTimer >= 20)
// Once every 30 ticks
if (elementalMasteryTimer >= 30)
{
elementalMastery--;
elementalMasteryTimer = 0;
@@ -1160,7 +1160,7 @@ namespace CalamityMod.CalPlayer
DoGCartSegments = new DoGCartSegment[DoGCartSegments.Length];
// Dust on hand when holding the phosphorescent gauntlet.
if (Player.ActiveItem().type == ModContent.ItemType<PhosphorescentGauntlet>())
if (Player.HeldItem.type == ModContent.ItemType<PhosphorescentGauntlet>())
PhosphorescentGauntletPunches.GenerateDustOnOwnerHand(Player);
if (stealthUIAlpha > 0f && (rogueStealth <= 0f || rogueStealthMax <= 0f))
@@ -2807,7 +2807,7 @@ namespace CalamityMod.CalPlayer
}
// Vortex Armor nerf
if (Player.vortexStealthActive && Player.ActiveItem().type != ItemID.PsychoKnife)
if (Player.vortexStealthActive && Player.HeldItem.type != ItemID.PsychoKnife)
{
Player.GetDamage<RangedDamageClass>() -= (1f - Player.stealth) * 0.4f; // Change 80 to 40
Player.GetCritChance<RangedDamageClass>() -= (int)((1f - Player.stealth) * 5f); // Change 20 to 15
@@ -2982,7 +2982,7 @@ namespace CalamityMod.CalPlayer
}
bool hasKillMode = cooldowns.TryGetValue(KillMode.ID, out CooldownInstance killModeCD);
if (hasKillMode && killModeCD.timeLeft > KillMode.cooldownMax && !(Player.ActiveItem().type == ModContent.ItemType<ForbiddenOathblade>() || Player.ActiveItem().type == ModContent.ItemType<ExaltedOathblade>() || Player.ActiveItem().type == ModContent.ItemType<DevilsDevastation>()))
if (hasKillMode && killModeCD.timeLeft > KillMode.cooldownMax && !(Player.HeldItem.type == ModContent.ItemType<ForbiddenOathblade>() || Player.HeldItem.type == ModContent.ItemType<ExaltedOathblade>() || Player.HeldItem.type == ModContent.ItemType<DevilsDevastation>()))
{
killModeCD.timeLeft = KillMode.cooldownMax - 1;
Player.Calamity().killModeCooldown = KillMode.cooldownMax - 1;
@@ -3342,7 +3342,7 @@ namespace CalamityMod.CalPlayer
else
aquaticBoost = AquaticBoostMax;
if (Player.ActiveItem().type == ModContent.ItemType<Auralis>() && Player.StandingStill(0.1f))
if (Player.HeldItem.type == ModContent.ItemType<Auralis>() && Player.StandingStill(0.1f))
{
if (auralisStealthCounter < 300f)
auralisStealthCounter++;
@@ -3696,22 +3696,22 @@ namespace CalamityMod.CalPlayer
}
}
if (CalamityItemSets.FishingPoleThatNeverBreaks[Player.ActiveItem().type])
if (CalamityItemSets.FishingPoleThatNeverBreaks[Player.HeldItem.type])
Player.accFishingLine = true;
if (planarSpeedBoost != 0)
{
if (Player.ActiveItem().type != ModContent.ItemType<PridefulHuntersPlanarRipper>())
if (Player.HeldItem.type != ModContent.ItemType<PridefulHuntersPlanarRipper>())
planarSpeedBoost = 0;
}
if (evilSmasherBoost > 0)
{
if (Player.ActiveItem().type != ModContent.ItemType<EvilSmasher>())
if (Player.HeldItem.type != ModContent.ItemType<EvilSmasher>())
evilSmasherBoost = 0;
}
if (searedPanCounter > 0)
{
if (Player.ActiveItem().type != ModContent.ItemType<SearedPan>())
if (Player.HeldItem.type != ModContent.ItemType<SearedPan>())
{
searedPanCounter = 0;
searedPanTimer = 0;
@@ -4370,10 +4370,6 @@ namespace CalamityMod.CalPlayer
Player.GetCritChance<MeleeDamageClass>() += 10;
}
if (Player.portableStoolInfo.IsInUse)
Player.GetCritChance(DamageClass.Generic) += 5;
// Amalgam boosts
if (Main.myPlayer == Player.whoAmI)
{
+3 -11
View File
@@ -102,10 +102,6 @@ namespace CalamityMod.CalPlayer
switch (item.type)
{
case ItemID.DeathSickle:
target.AddBuff(BuffType<WhisperingDeath>(), 120);
break;
case ItemID.InfluxWaver:
target.AddBuff(BuffID.Electrified, 300);
break;
@@ -276,10 +272,6 @@ namespace CalamityMod.CalPlayer
target.AddBuff(BuffType<ArmorCrunch>(), 180);
break;
case ProjectileID.DeathSickle:
target.AddBuff(BuffType<WhisperingDeath>(), 60);
break;
case ProjectileID.ButchersChainsaw:
case ProjectileID.MechanicalPiranha:
target.AddBuff(BuffType<HeavyBleeding>(), 180);
@@ -762,7 +754,7 @@ namespace CalamityMod.CalPlayer
private void MeleeOnHit(Projectile proj, CalamityGlobalProjectile modProj, Vector2 position, bool crit, bool npcCheck, bool targetIsDummy)
{
var source = proj.GetSource_FromThis();
Item heldItem = Player.ActiveItem();
Item heldItem = Player.HeldItem;
if (proj.IsTrueMelee())
{
@@ -1338,7 +1330,7 @@ namespace CalamityMod.CalPlayer
if (bloodflareThrowing && proj.CountsAsClass<ThrowingDamageClass>() && crit)
Projectile.NewProjectile(proj.GetSource_OnHit(target), proj.Center, proj.velocity.SafeNormalize(Vector2.Zero) * Math.Min(((proj.velocity.Length() * proj.MaxUpdates) / 4f), 4f) * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType<BloodstoneHealOrb>(), 4, 0f, proj.owner);
if (proj.CountsAsClass<MagicDamageClass>() && Player.ActiveItem().CountsAsClass<MagicDamageClass>())
if (proj.CountsAsClass<MagicDamageClass>() && Player.HeldItem.CountsAsClass<MagicDamageClass>())
{
if (manaOverloader)
{
@@ -1413,7 +1405,7 @@ namespace CalamityMod.CalPlayer
Vector2 velocity = Main.npc[targetIdx].DirectionFrom(spawnPos);
velocity *= speed;
var source = player.GetSource_ItemUse(player.ActiveItem());
var source = player.GetSource_ItemUse(player.HeldItem);
int projectile = Projectile.NewProjectile(source, spawnPos, velocity, type, damage, knockback, player.whoAmI, targetIdx, 0f);
Main.projectile[projectile].extraUpdates += extraUpdateAmt;
}
+11 -11
View File
@@ -67,17 +67,17 @@ namespace CalamityMod.DataStructures
// Calculate the gem that should be lost.
// The accessory check is to catch the edge-case of the Shield of Cthulhu
// having melee damage for some godforsaken reason.
if (!Owner.ActiveItem().IsAir && !Owner.ActiveItem().accessory)
if (!Owner.HeldItem.IsAir && !Owner.HeldItem.accessory)
{
if (Owner.ActiveItem().CountsAsClass<MeleeDamageClass>())
if (Owner.HeldItem.CountsAsClass<MeleeDamageClass>())
GemThatShouldBeLost = GemTechArmorGemType.Melee;
if (Owner.ActiveItem().CountsAsClass<RangedDamageClass>())
if (Owner.HeldItem.CountsAsClass<RangedDamageClass>())
GemThatShouldBeLost = GemTechArmorGemType.Ranged;
if (Owner.ActiveItem().CountsAsClass<MagicDamageClass>())
if (Owner.HeldItem.CountsAsClass<MagicDamageClass>())
GemThatShouldBeLost = GemTechArmorGemType.Magic;
if (Owner.ActiveItem().CountsAsClass<SummonDamageClass>())
if (Owner.HeldItem.CountsAsClass<SummonDamageClass>())
GemThatShouldBeLost = GemTechArmorGemType.Summoner;
if (Owner.ActiveItem().CountsAsClass<ThrowingDamageClass>())
if (Owner.HeldItem.CountsAsClass<ThrowingDamageClass>())
GemThatShouldBeLost = GemTechArmorGemType.Rogue;
}
@@ -128,7 +128,7 @@ namespace CalamityMod.DataStructures
MeleeCrystalCountdown--;
// Make the crystal fire countdown go down faster if holding a true melee item.
if (Owner.ActiveItem().IsTrueMelee())
if (Owner.HeldItem.IsTrueMelee())
MeleeCrystalCountdown--;
// Ensure the crystal cooldown does not go below 0 due to the second decrement.
@@ -153,7 +153,7 @@ namespace CalamityMod.DataStructures
for (int i = 0; i < 14; i++)
{
Vector2 shootVelocity = Main.rand.NextVector2Unit() * Main.rand.NextFloat(0.5f, 3.25f);
Projectile.NewProjectile(Owner.GetSource_ItemUse(Owner.ActiveItem()), target.Center, shootVelocity, ModContent.ProjectileType<GemTechYellowShard>(), damage, 0f, OwnerIndex);
Projectile.NewProjectile(Owner.GetSource_ItemUse(Owner.HeldItem), target.Center, shootVelocity, ModContent.ProjectileType<GemTechYellowShard>(), damage, 0f, OwnerIndex);
}
MeleeCrystalCountdown = GemTechHeadgear.MeleeShardDelay;
@@ -173,7 +173,7 @@ namespace CalamityMod.DataStructures
shootVelocity = shootVelocity.SafeNormalize(Vector2.UnitY) * 6f;
spawnPosition -= shootVelocity.SafeNormalize(Vector2.Zero) * Main.rand.NextFloat(15f, 50f);
Projectile.NewProjectile(Owner.GetSource_ItemUse(Owner.ActiveItem()), spawnPosition, shootVelocity, ModContent.ProjectileType<GemTechGreenFlechette>(), damage, 0f, OwnerIndex);
Projectile.NewProjectile(Owner.GetSource_ItemUse(Owner.HeldItem), spawnPosition, shootVelocity, ModContent.ProjectileType<GemTechGreenFlechette>(), damage, 0f, OwnerIndex);
}
public void OnItemUseEffects(Item item)
@@ -277,7 +277,7 @@ namespace CalamityMod.DataStructures
gemDamage = CalamityUtils.DamageSoftCap(gemDamage, GemTechHeadgear.GemDamageSoftcapThreshold);
if (Main.myPlayer == OwnerIndex)
Projectile.NewProjectile(Owner.GetSource_ItemUse(Owner.ActiveItem()), gemPosition, Vector2.Zero, ModContent.ProjectileType<GemTechArmorGem>(), gemDamage, 0f, OwnerIndex, 0f, (int)GemThatShouldBeLost);
Projectile.NewProjectile(Owner.GetSource_ItemUse(Owner.HeldItem), gemPosition, Vector2.Zero, ModContent.ProjectileType<GemTechArmorGem>(), gemDamage, 0f, OwnerIndex, 0f, (int)GemThatShouldBeLost);
}
}
@@ -349,7 +349,7 @@ namespace CalamityMod.DataStructures
Owner.lifeRegen += GemTechHeadgear.AllGemsWeaponUseLifeRegenBoost;
}
if (!Owner.ActiveItem().IsAir && !Owner.ActiveItem().CountsAsClass<MagicDamageClass>())
if (!Owner.HeldItem.IsAir && !Owner.HeldItem.CountsAsClass<MagicDamageClass>())
Owner.manaRegen += GemTechHeadgear.NonMagicItemManaRegenBoost;
}
+44 -8
View File
@@ -1,5 +1,7 @@
using Microsoft.Xna.Framework;
using CalamityMod.Systems.Graphic.PixelationSystem;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.ModLoader;
@@ -7,7 +9,16 @@ namespace CalamityMod.Dusts
{
public class DiamondDust : ModDust
{
public static Asset<Texture2D> GlowDiamond { get; private set; }
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void Load()
{
if (!Main.dedServ)
GlowDiamond = ModContent.Request<Texture2D>("CalamityMod/Particles/SquareRotated");
}
public override void OnSpawn(Dust dust)
{
dust.scale *= Main.rand.NextFloat(0.8f, 1f);
@@ -38,26 +49,51 @@ namespace CalamityMod.Dusts
return false;
}
public override bool PreDraw(Dust dust)
{
Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f);
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/SquareRotated").Value;
// dust.fadeIn is used to determine how intense the squash is, 1 is no squash, 0 is normal squash
float squashLerp = Utils.GetLerpValue(10, 25, dust.fadeIn, true);
Vector2 squash = new Vector2(MathHelper.Lerp(1, 0.3f, squashLerp), MathHelper.Lerp(1, 7f, squashLerp));
// Glow Orb
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(GlowDiamond.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowDiamond.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.2f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(GlowDiamond.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.2f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowDiamond.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0);
if (!dust.noLight)
{
for (int i = 0; i < 2; i++)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.4f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha) * (i == 0 ? 1f : 0.7f), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.08f * (i == 0 ? 0.7f : 1), SpriteEffects.None, 0);
Main.spriteBatch.Draw(GlowDiamond.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.4f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha) * (i == 0 ? 1f : 0.7f), dust.rotation, GlowDiamond.Size() * 0.5f, squash * dust.scale * 0.08f * (i == 0 ? 0.7f : 1), SpriteEffects.None, 0);
}
return false;
}
}
public class DiamondDustPixelated : DiamondDust
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override bool PreDraw(Dust dust)
{
PixelationManager.AddPixelatedDrawer((_) => DrawPixelated(dust), Enums.GeneralDrawLayer.AfterDusts);
return false;
}
public static void DrawPixelated(Dust dust)
{
// dust.fadeIn is used to determine how intense the squash is, 1 is no squash, 0 is normal squash
float squashLerp = Utils.GetLerpValue(10, 25, dust.fadeIn, true);
Vector2 squash = new Vector2(MathHelper.Lerp(1, 0.3f, squashLerp), MathHelper.Lerp(1, 7f, squashLerp));
// Glow Orb
Main.spriteBatch.Draw(GlowDiamond.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowDiamond.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.spriteBatch.Draw(GlowDiamond.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.2f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowDiamond.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0);
if (!dust.noLight)
{
for (int i = 0; i < 2; i++)
Main.spriteBatch.Draw(GlowDiamond.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.4f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha) * (i == 0 ? 1f : 0.7f), dust.rotation, GlowDiamond.Size() * 0.5f, squash * dust.scale * 0.08f * (i == 0 ? 0.7f : 1), SpriteEffects.None, 0);
}
}
}
}
+41 -9
View File
@@ -1,6 +1,9 @@
using System;
using CalamityMod.Enums;
using CalamityMod.Systems.Graphic.PixelationSystem;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.ModLoader;
@@ -8,6 +11,19 @@ namespace CalamityMod.Dusts
{
public class LightDust : ModDust
{
public static Asset<Texture2D> SolidCircle { get; private set; }
public static Asset<Texture2D> BloomCircle { get; private set; }
public override void Load()
{
if (Main.dedServ)
return;
SolidCircle = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/BasicCircle");
BloomCircle = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle");
}
public override void OnSpawn(Dust dust)
{
dust.scale *= Main.rand.NextFloat(0.8f, 1f);
@@ -28,21 +44,37 @@ namespace CalamityMod.Dusts
return true;
}
public override bool PreDraw(Dust dust)
{
Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f);
Texture2D solidCenter = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/BasicCircle").Value;
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
// Glow Orb
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0);
if (!dust.noLight)
{
Main.EntitySpriteDraw(solidCenter, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, solidCenter.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0);
}
Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0);
return false;
}
}
public class LightDustPixelated : LightDust
{
public override string Texture => "CalamityMod/Dusts/LightDust";
public override bool PreDraw(Dust dust)
{
PixelationManager.AddPixelatedDrawer((_) => DrawPixelated(dust), GeneralDrawLayer.AfterDusts);
return false;
}
private static void DrawPixelated(Dust dust)
{
// Glow Orb
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0);
if (!dust.noLight)
Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0);
}
}
}
+40 -7
View File
@@ -1,6 +1,8 @@
using System;
using CalamityMod.Systems.Graphic.PixelationSystem;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.ModLoader;
@@ -8,7 +10,16 @@ namespace CalamityMod.Dusts
{
public class SquareDust : ModDust
{
public static Asset<Texture2D> GlowSquare { get; private set; }
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void Load()
{
if (!Main.dedServ)
GlowSquare = ModContent.Request<Texture2D>("CalamityMod/Particles/GlowSquareParticleThick");
}
public override void OnSpawn(Dust dust)
{
dust.scale *= Main.rand.NextFloat(0.8f, 1f);
@@ -42,22 +53,44 @@ namespace CalamityMod.Dusts
}
public override bool PreDraw(Dust dust)
{
Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f);
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/GlowSquareParticleThick").Value;
Vector2 squash = Vector2.One;
// Glow Orb
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(GlowSquare.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowSquare.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0f);
if (dust.alpha < 1)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.095f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(GlowSquare.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowSquare.Size() * 0.5f, squash * dust.scale * 0.095f, SpriteEffects.None, 0f);
if (!dust.noLight)
{
for (int i = 0; i < 2; i++)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(GlowSquare.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowSquare.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0f);
}
return false;
}
}
public class SquareDustPixelated : SquareDust
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override bool PreDraw(Dust dust)
{
PixelationManager.AddPixelatedDrawer((_) => DrawPixelated(dust), Enums.GeneralDrawLayer.AfterDusts);
return false;
}
private static void DrawPixelated(Dust dust)
{
Vector2 squash = Vector2.One;
// Glow Orb
Main.spriteBatch.Draw(GlowSquare.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowSquare.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0f);
if (dust.alpha < 1)
Main.spriteBatch.Draw(GlowSquare.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowSquare.Size() * 0.5f, squash * dust.scale * 0.095f, SpriteEffects.None, 0f);
if (!dust.noLight)
{
for (int i = 0; i < 2; i++)
Main.spriteBatch.Draw(GlowSquare.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowSquare.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0f);
}
}
}
}
+46 -9
View File
@@ -1,5 +1,7 @@
using Microsoft.Xna.Framework;
using CalamityMod.Systems.Graphic.PixelationSystem;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.ModLoader;
@@ -7,7 +9,21 @@ namespace CalamityMod.Dusts
{
public class SquashDust : ModDust
{
public static Asset<Texture2D> SolidCircle { get; private set; }
public static Asset<Texture2D> BloomCircle { get; private set; }
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void Load()
{
if (Main.dedServ)
return;
SolidCircle = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/BasicCircle");
BloomCircle = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle");
}
public override void OnSpawn(Dust dust)
{
dust.scale *= Main.rand.NextFloat(0.8f, 1f);
@@ -37,24 +53,45 @@ namespace CalamityMod.Dusts
return false;
}
public override bool PreDraw(Dust dust)
{
Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f);
Texture2D solidCenter = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/BasicCircle").Value;
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f));
// Glow Orb
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.04f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.04f, SpriteEffects.None, 0);
if (!dust.noLight)
{
Main.EntitySpriteDraw(solidCenter, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, solidCenter.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0);
}
return false;
}
}
public class SquashDustPixelated : SquashDust
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override bool PreDraw(Dust dust)
{
PixelationManager.AddPixelatedDrawer((_) => DrawPixelated(dust), Enums.GeneralDrawLayer.AfterDusts);
return false;
}
private static void DrawPixelated(Dust dust)
{
Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f));
// Glow Orb
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.04f, SpriteEffects.None, 0);
if (!dust.noLight)
{
Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0);
}
}
}
}
+43 -8
View File
@@ -1,5 +1,7 @@
using Microsoft.Xna.Framework;
using CalamityMod.Systems.Graphic.PixelationSystem;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.ModLoader;
@@ -7,7 +9,16 @@ namespace CalamityMod.Dusts
{
public class SquashDustHollow : ModDust
{
public static Asset<Texture2D> BloomRing { get; private set; }
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void Load()
{
if (!Main.dedServ)
BloomRing = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomRing");
}
public override void OnSpawn(Dust dust)
{
dust.scale *= Main.rand.NextFloat(0.8f, 1f);
@@ -36,25 +47,49 @@ namespace CalamityMod.Dusts
return false;
}
public override bool PreDraw(Dust dust)
{
Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f);
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomRing").Value;
// dust.fadeIn is used to determine how intense the squash is, 1 is no squash, 0 is normal squash
Vector2 squash = Vector2.Lerp(new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f)), Vector2.One, dust.fadeIn);
// Glow Orb
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
Main.EntitySpriteDraw(BloomRing.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomRing.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.2f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0);
Main.EntitySpriteDraw(BloomRing.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.2f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomRing.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0);
if (!dust.noLight)
{
for (int i = 0; i < 2; i++)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.4f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0);
Main.EntitySpriteDraw(BloomRing.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.4f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomRing.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0);
}
return false;
}
}
public class SquashDustHollowPixelated : SquashDustHollow
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override bool PreDraw(Dust dust)
{
PixelationManager.AddPixelatedDrawer((_) => DrawPixelated(dust), Enums.GeneralDrawLayer.AfterDusts);
return false;
}
private static void DrawPixelated(Dust dust)
{
// dust.fadeIn is used to determine how intense the squash is, 1 is no squash, 0 is normal squash
Vector2 squash = Vector2.Lerp(new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f)), Vector2.One, dust.fadeIn);
// Glow Orb
Main.EntitySpriteDraw(BloomRing.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomRing.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(BloomRing.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.2f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomRing.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0);
if (!dust.noLight)
{
for (int i = 0; i < 2; i++)
Main.EntitySpriteDraw(BloomRing.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.4f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomRing.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0);
}
}
}
}
+21 -11
View File
@@ -1,13 +1,15 @@
using Microsoft.Xna.Framework;
using CalamityMod.Systems.Graphic.PixelationSystem;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Dusts
{
public class SquashDustTileTouch : ModDust
public class SquashDustTileTouch : SquashDust
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void OnSpawn(Dust dust)
{
dust.scale *= Main.rand.NextFloat(0.8f, 1f);
@@ -16,12 +18,14 @@ namespace CalamityMod.Dusts
public override bool Update(Dust dust)
{
bool touchedTiles = false;
int size = (int)(2);
int size = 2;
if (Collision.SolidCollision(dust.position, size, size))
{
touchedTiles = true;
dust.velocity = Vector2.Zero;
}
float fadeSpeed = (dust.fadeIn + 1); // For this dust, fadeIn is used to increase the power of gravity if it's active, otherwise it makes it's lifetime change
dust.rotation = dust.velocity.ToRotation() + MathHelper.PiOver2;
dust.velocity *= 0.96f;
@@ -45,24 +49,30 @@ namespace CalamityMod.Dusts
return false;
}
}
public class SquashDustTileTouchPixelated : SquashDustTileTouch
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override bool PreDraw(Dust dust)
{
Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f);
Texture2D solidCenter = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/BasicCircle").Value;
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
PixelationManager.AddPixelatedDrawer((_) => DrawPixelated(dust), Enums.GeneralDrawLayer.AfterDusts);
return false;
}
private static void DrawPixelated(Dust dust)
{
Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f));
// Glow Orb
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.04f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.04f, SpriteEffects.None, 0);
if (!dust.noLight)
{
Main.EntitySpriteDraw(solidCenter, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, solidCenter.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0);
}
return false;
}
}
}
+40 -7
View File
@@ -1,6 +1,8 @@
using System;
using CalamityMod.Systems.Graphic.PixelationSystem;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.ModLoader;
@@ -8,7 +10,16 @@ namespace CalamityMod.Dusts
{
public class UnstableDust : ModDust
{
public static Asset<Texture2D> GlowStar { get; private set; }
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void Load()
{
if (!Main.dedServ)
GlowStar = ModContent.Request<Texture2D>("CalamityMod/Particles/FullStar");
}
public override void OnSpawn(Dust dust)
{
dust.scale *= Main.rand.NextFloat(0.8f, 1f);
@@ -41,23 +52,45 @@ namespace CalamityMod.Dusts
return false;
}
public override bool PreDraw(Dust dust)
{
Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f);
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/FullStar").Value;
Vector2 squash = new Vector2(0.4f, 1);
float texScaling = 6;
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.1f * texScaling, SpriteEffects.None, 0);
Main.spriteBatch.Draw(GlowStar.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowStar.Size() * 0.5f, squash * dust.scale * 0.1f * texScaling, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.04f * texScaling, SpriteEffects.None, 0);
Main.spriteBatch.Draw(GlowStar.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowStar.Size() * 0.5f, squash * dust.scale * 0.04f * texScaling, SpriteEffects.None, 0);
if (!dust.noLight)
{
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.025f * texScaling, SpriteEffects.None, 0);
Main.spriteBatch.Draw(GlowStar.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowStar.Size() * 0.5f, squash * dust.scale * 0.025f * texScaling, SpriteEffects.None, 0);
}
return false;
}
}
public class UnstableDustPixelated : UnstableDust
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override bool PreDraw(Dust dust)
{
PixelationManager.AddPixelatedDrawer((_) => DrawPixelated(dust), Enums.GeneralDrawLayer.AfterDusts);
return false;
}
private static void DrawPixelated(Dust dust)
{
Vector2 squash = new Vector2(0.4f, 1);
float texScaling = 6;
Main.spriteBatch.Draw(GlowStar.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowStar.Size() * 0.5f, squash * dust.scale * 0.1f * texScaling, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.spriteBatch.Draw(GlowStar.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowStar.Size() * 0.5f, squash * dust.scale * 0.04f * texScaling, SpriteEffects.None, 0);
if (!dust.noLight)
{
Main.spriteBatch.Draw(GlowStar.Value, dust.position - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, GlowStar.Size() * 0.5f, squash * dust.scale * 0.025f * texScaling, SpriteEffects.None, 0);
}
}
}
}
+43 -6
View File
@@ -1,6 +1,9 @@
using System;
using CalamityMod.Enums;
using CalamityMod.Systems.Graphic.PixelationSystem;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.ModLoader;
@@ -8,6 +11,19 @@ namespace CalamityMod.Dusts
{
public class VoidDust : ModDust
{
public static Asset<Texture2D> SolidCircle { get; private set; }
public static Asset<Texture2D> BloomCircle { get; private set; }
public override void Load()
{
if (Main.dedServ)
return;
SolidCircle = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/BasicCircle");
BloomCircle = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle");
}
public override void OnSpawn(Dust dust)
{
dust.scale *= Main.rand.NextFloat(0.8f, 1f);
@@ -28,20 +44,41 @@ namespace CalamityMod.Dusts
return true;
}
public override bool PreDraw(Dust dust)
{
Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f);
Texture2D solidCenter = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/BasicCircle").Value;
if (!dust.noLight)
{
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
// Glow Orb
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0);
}
Main.EntitySpriteDraw(solidCenter, dustCenter - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, solidCenter.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0);
return false;
}
}
public class VoidDustPixelated : VoidDust
{
public override string Texture => "CalamityMod/Dusts/VoidDust";
public override bool PreDraw(Dust dust)
{
PixelationManager.AddPixelatedDrawer((_) => DrawPixelated(dust), GeneralDrawLayer.AfterDusts);
return false;
}
private static void DrawPixelated(Dust dust)
{
if (!dust.noLight)
{
// Glow Orb
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0);
}
Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0);
}
}
}
+46 -11
View File
@@ -1,6 +1,9 @@
using System;
using CalamityMod.Enums;
using CalamityMod.Systems.Graphic.PixelationSystem;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.ModLoader;
@@ -8,6 +11,22 @@ namespace CalamityMod.Dusts
{
public class VoidDustInverted : ModDust
{
public static Asset<Texture2D> SolidCircle { get; private set; }
public static Asset<Texture2D> BloomCircle { get; private set; }
public static Asset<Texture2D> SmallBloomCircle { get; private set; }
public override void Load()
{
if (Main.dedServ)
return;
SolidCircle = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/BasicCircle");
BloomCircle = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle");
SmallBloomCircle = ModContent.Request<Texture2D>("CalamityMod/Particles/SmallBloom");
}
public override void OnSpawn(Dust dust)
{
dust.scale *= Main.rand.NextFloat(0.8f, 1f);
@@ -28,23 +47,39 @@ namespace CalamityMod.Dusts
return true;
}
public override bool PreDraw(Dust dust)
{
Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f);
Texture2D solidCenter = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/BasicCircle").Value;
Texture2D bloom2 = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/SmallBloom").Value;
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Black * 0.4f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, dust.scale * 0.068f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(SmallBloomCircle.Value, dust.position - Main.screenPosition, null, Color.Black * 0.4f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SmallBloomCircle.Size() * 0.5f, dust.scale * 0.068f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, dust.scale * 0.057f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(SmallBloomCircle.Value, dust.position - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SmallBloomCircle.Size() * 0.5f, dust.scale * 0.057f, SpriteEffects.None, 0);
Main.EntitySpriteDraw(bloom2, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom2.Size() * 0.5f, dust.scale * 0.07f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.07f, SpriteEffects.None, 0);
if (!dust.noLight)
Main.EntitySpriteDraw(solidCenter, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.75f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, solidCenter.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.75f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0);
return false;
}
}
public class VoidDustInvertedPixelated : VoidDustInverted
{
public override string Texture => "CalamityMod/Dusts/VoidDustInverted";
public override bool PreDraw(Dust dust)
{
PixelationManager.AddPixelatedDrawer((_) => DrawPixelated(dust), GeneralDrawLayer.AfterDusts);
return false;
}
private static void DrawPixelated(Dust dust)
{
Main.spriteBatch.Draw(SmallBloomCircle.Value, dust.position - Main.screenPosition, null, Color.Black * 0.4f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SmallBloomCircle.Size() * 0.5f, dust.scale * 0.068f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.spriteBatch.Draw(SmallBloomCircle.Value, dust.position - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SmallBloomCircle.Size() * 0.5f, dust.scale * 0.057f, SpriteEffects.None, 0);
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.07f, SpriteEffects.None, 0);
if (!dust.noLight)
Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.75f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0);
}
}
}
+21
View File
@@ -0,0 +1,21 @@
using System;
namespace CalamityMod.Enums
{
/// <summary>
/// A general collection of points in Terraria's overall draw order that graphical systems in the mod draw to.
/// </summary>
[Flags]
public enum GeneralDrawLayer
{
BeforeAllTiles = 0,
BeforeSolidTiles = 1,
BeforeNPCs = 2,
AfterNPCs = 4,
BeforeProjectiles = 8,
AfterProjectiles = 16,
AfterPlayers = 32,
AfterDusts = 64,
AfterEverything = 128,
}
}
+2 -1
View File
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
@@ -77,7 +78,7 @@ namespace CalamityMod.Graphics.Metaballs
// Load the layer asset wrapper.
LayerAsset = ModContent.Request<Texture2D>($"CalamityMod/Graphics/Metaballs/BigRipLayer", AssetRequestMode.ImmediateLoad);
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeProjectiles;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.BeforeProjectiles;
public override Color EdgeColor => new Color(239, 111, 85) * 0.5f;
+2 -1
View File
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Effects;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -48,7 +49,7 @@ namespace CalamityMod.Graphics.Metaballs
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles;
public override Color EdgeColor => Color.Red with { A = 0 };
+2 -1
View File
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Effects;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -48,7 +49,7 @@ namespace CalamityMod.Graphics.Metaballs
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles;
public override Color EdgeColor => Color.Red with { A = 0 };
+2 -1
View File
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
@@ -79,7 +80,7 @@ namespace CalamityMod.Graphics.Metaballs
// Load the layer asset wrapper.
LayerAsset = ModContent.Request<Texture2D>($"CalamityMod/Graphics/Metaballs/BloodLayer", AssetRequestMode.ImmediateLoad);
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeProjectiles;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.BeforeProjectiles;
public override Color EdgeColor => new Color(67, 17, 17);
+2 -2
View File
@@ -1,11 +1,11 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.ModLoader;
using static CalamityMod.Graphics.Metaballs.StreamGougeMetaball;
namespace CalamityMod.Graphics.Metaballs
{
@@ -71,7 +71,7 @@ namespace CalamityMod.Graphics.Metaballs
// Load the layer asset wrapper.
LayerAsset = ModContent.Request<Texture2D>($"CalamityMod/Graphics/Metaballs/CalamitasLayer", AssetRequestMode.ImmediateLoad);
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeProjectiles;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.BeforeProjectiles;
public override Color EdgeColor => Color.Lerp(Color.Crimson, Color.Black, 0f);
+2 -2
View File
@@ -1,11 +1,11 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.ModLoader;
using static CalamityMod.Graphics.Metaballs.StreamGougeMetaball;
namespace CalamityMod.Graphics.Metaballs
{
@@ -71,7 +71,7 @@ namespace CalamityMod.Graphics.Metaballs
// Load the layer asset wrapper.
LayerAsset = ModContent.Request<Texture2D>($"CalamityMod/Graphics/Metaballs/CataclysmLayer", AssetRequestMode.ImmediateLoad);
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeProjectiles;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.BeforeProjectiles;
public override Color EdgeColor => new Color(255,0,229);
+2 -2
View File
@@ -1,11 +1,11 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.ModLoader;
using static CalamityMod.Graphics.Metaballs.StreamGougeMetaball;
namespace CalamityMod.Graphics.Metaballs
{
@@ -73,7 +73,7 @@ namespace CalamityMod.Graphics.Metaballs
// Load the layer asset wrapper.
LayerAsset = ModContent.Request<Texture2D>($"CalamityMod/Graphics/Metaballs/CatastropheLayer", AssetRequestMode.ImmediateLoad);
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeProjectiles;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.BeforeProjectiles;
public override Color EdgeColor => new Color(0,255,255);
+2 -1
View File
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using CalamityMod.Effects;
using CalamityMod.Enums;
using CalamityMod.Projectiles.Boss;
using CalamityMod.Systems.Graphic;
using Microsoft.Xna.Framework;
@@ -33,7 +34,7 @@ namespace CalamityMod.Graphics.Metaballs
public static List<DistortionParticle> Particles { get; private set; } = [];
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles;
public override bool AnythingToDraw => Particles.Count > 0 || CalamityUtils.AnyProjectiles(ModContent.ProjectileType<DoGRiftCrack>());
+2 -1
View File
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Effects;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -68,7 +69,7 @@ namespace CalamityMod.Graphics.Metaballs
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles;
public override void Update()
{
+2 -1
View File
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Effects;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -68,7 +69,7 @@ namespace CalamityMod.Graphics.Metaballs
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles;
public override void Update()
{
+2 -1
View File
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
@@ -56,7 +57,7 @@ namespace CalamityMod.Graphics.Metaballs
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeNPCs;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.BeforeNPCs;
public override Color EdgeColor => Color.Lerp(Color.DarkBlue, Color.Black, 0.75f);
+2 -1
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Enums;
using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -56,7 +57,7 @@ namespace CalamityMod.Graphics.Metaballs
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles;
public override Color EdgeColor => new(61, 6, 2);
+2 -1
View File
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Effects;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -33,7 +34,7 @@ namespace CalamityMod.Graphics.Metaballs
/// <summary>
/// The draw layer in which metaballs should be drawn.
/// </summary>
public abstract MetaballDrawLayer DrawContext
public abstract GeneralDrawLayer DrawLayer
{
get;
}
-9
View File
@@ -1,9 +0,0 @@
namespace CalamityMod.Graphics.Metaballs
{
public enum MetaballDrawLayer
{
BeforeNPCs,
BeforeProjectiles,
AfterProjectiles,
}
}
+6 -38
View File
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -15,8 +16,6 @@ namespace CalamityMod.Graphics.Metaballs
{
// Prepare event subscribers.
RenderTargetManager.RenderTargetUpdateLoopEvent += PrepareMetaballTargets;
On_Main.DrawProjectiles += DrawMetaballsAfterProjectiles;
On_Main.DrawNPCs += DrawMetaballsBeforeNPCs;
}
public override void OnModUnload()
@@ -86,51 +85,20 @@ namespace CalamityMod.Graphics.Metaballs
Main.spriteBatch.End();
}
private void DrawMetaballsAfterProjectiles(On_Main.orig_DrawProjectiles orig, Main self)
{
if (AnyActiveMetaballsAtLayer(MetaballDrawLayer.BeforeProjectiles))
{
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
DrawMetaballs(MetaballDrawLayer.BeforeProjectiles);
Main.spriteBatch.End();
}
orig(self);
if (AnyActiveMetaballsAtLayer(MetaballDrawLayer.AfterProjectiles))
{
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
DrawMetaballs(MetaballDrawLayer.AfterProjectiles);
Main.spriteBatch.End();
}
}
private void DrawMetaballsBeforeNPCs(On_Main.orig_DrawNPCs orig, Main self, bool behindTiles)
{
if (!behindTiles && AnyActiveMetaballsAtLayer(MetaballDrawLayer.BeforeNPCs))
{
Main.spriteBatch.End();
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
DrawMetaballs(MetaballDrawLayer.BeforeNPCs);
Main.spriteBatch.ExitShaderRegion();
}
orig(self, behindTiles);
}
/// <summary>
/// Checks if a metaball of a given layering type is currently in use. This is used to minimize needless <see cref="SpriteBatch"/> restarts when there is nothing to draw.
/// </summary>
/// <param name="layerType">The metaball layer type to check against.</param>
internal static bool AnyActiveMetaballsAtLayer(MetaballDrawLayer layerType) =>
metaballs.Any(m => m.AnythingToDraw && m.DrawContext == layerType);
internal static bool AnyActiveMetaballsAtLayer(GeneralDrawLayer layerType) =>
metaballs.Any(m => m.AnythingToDraw && m.DrawLayer == layerType);
/// <summary>
/// Draws all metaballs of a given <see cref="MetaballDrawLayer"/>. Used for layer ordering reasons.
/// Draws all metaballs of a given <see cref="GeneralDrawLayer"/>. Used for layer ordering reasons.
/// </summary>
/// <param name="layerType">The layer type to draw with.</param>
public static void DrawMetaballs(MetaballDrawLayer layerType)
internal static void DrawMetaballs(GeneralDrawLayer layerType)
{
foreach (Metaball metaball in metaballs.Where(m => m.DrawContext == layerType && m.AnythingToDraw))
foreach (Metaball metaball in metaballs.Where(m => m.DrawLayer == layerType && m.AnythingToDraw))
{
for (int i = 0; i < metaball.LayerTargets.Count; i++)
{
+2 -1
View File
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Effects;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -64,7 +65,7 @@ namespace CalamityMod.Graphics.Metaballs
public override bool AnythingToDraw => Particles.Any();
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles;
public override IEnumerable<Texture2D> Layers
{
+2 -2
View File
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Effects;
using CalamityMod.Rarities;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -54,7 +54,7 @@ namespace CalamityMod.Graphics.Metaballs
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles;
public Color sparkColor;
public int Time = 0;
+2 -2
View File
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Effects;
using CalamityMod.Rarities;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -54,7 +54,7 @@ namespace CalamityMod.Graphics.Metaballs
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles;
public Color sparkColor;
public int Time;
+2 -2
View File
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Effects;
using CalamityMod.Rarities;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -47,7 +47,7 @@ namespace CalamityMod.Graphics.Metaballs
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles;
public Color sparkColor;
public int Time = 0;
+2 -2
View File
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Effects;
using CalamityMod.Rarities;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -47,7 +47,7 @@ namespace CalamityMod.Graphics.Metaballs
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles;
public Color sparkColor;
public int Time;
+2 -1
View File
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Effects;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -44,7 +45,7 @@ namespace CalamityMod.Graphics.Metaballs
public override bool AnythingToDraw => Particles.Any();
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles;
public override IEnumerable<Texture2D> Layers
{
+2 -7
View File
@@ -1,18 +1,13 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using CalamityMod.NPCs;
using CalamityMod.Enums;
using CalamityMod.NPCs.SupremeCalamitas;
using CalamityMod.Systems.Mechanic;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.ModLoader;
using static CalamityMod.Graphics.Metaballs.StreamGougeMetaball;
using static CalamityMod.Systems.LavaRenderingSystem;
namespace CalamityMod.Graphics.Metaballs
{
@@ -82,7 +77,7 @@ namespace CalamityMod.Graphics.Metaballs
WavyLineLayer = ModContent.Request<Texture2D>($"CalamityMod/Graphics/Metaballs/ScalArenaLayerWave", AssetRequestMode.ImmediateLoad).Value;
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeNPCs;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.BeforeNPCs;
public override Color EdgeColor => SupremeCalamitas.CurrentColor;
+2 -2
View File
@@ -1,11 +1,11 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.ModLoader;
using static CalamityMod.Graphics.Metaballs.StreamGougeMetaball;
namespace CalamityMod.Graphics.Metaballs
{
@@ -73,7 +73,7 @@ namespace CalamityMod.Graphics.Metaballs
// Load the layer asset wrapper.
LayerAsset = ModContent.Request<Texture2D>($"CalamityMod/Graphics/Metaballs/SeekersLayer", AssetRequestMode.ImmediateLoad);
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeProjectiles;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.BeforeProjectiles;
public override Color EdgeColor => new Color(255,106,0);
+2 -2
View File
@@ -1,11 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Graphics.Metaballs
@@ -77,7 +77,7 @@ namespace CalamityMod.Graphics.Metaballs
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeNPCs;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.BeforeNPCs;
public override void Load()
{
if (Main.dedServ)
+2 -3
View File
@@ -1,12 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Particles;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Graphics.Metaballs
@@ -80,7 +79,7 @@ namespace CalamityMod.Graphics.Metaballs
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeNPCs;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.BeforeNPCs;
public override void Load()
{
if (Main.dedServ)
+2 -2
View File
@@ -1,10 +1,10 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Graphics.Metaballs
@@ -56,7 +56,7 @@ namespace CalamityMod.Graphics.Metaballs
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.AfterProjectiles;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.AfterProjectiles;
public override Color EdgeColor => Color.Lerp(Color.DarkBlue, Color.Black, 0.75f);
+2 -1
View File
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -26,7 +27,7 @@ namespace CalamityMod.Graphics.Metaballs
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeProjectiles;
public override GeneralDrawLayer DrawLayer => GeneralDrawLayer.BeforeProjectiles;
public override Color EdgeColor => Color.Lerp(Color.Purple, Color.Black, 0.75f);
@@ -1,4 +1,5 @@
using Microsoft.Xna.Framework.Graphics;
using CalamityMod.Enums;
using Microsoft.Xna.Framework.Graphics;
namespace CalamityMod.Graphics.Primitives
{
@@ -10,11 +11,11 @@ namespace CalamityMod.Graphics.Primitives
/// <summary>
/// The layer to render the primitive(s) to.
/// </summary>
PixelationPrimitiveLayer LayerToRenderTo => PixelationPrimitiveLayer.BeforeProjectiles;
GeneralDrawLayer LayerToRenderTo => GeneralDrawLayer.BeforeProjectiles;
/// <summary>
/// Render primitives that use pixelation here.
/// </summary>
void RenderPixelatedPrimitives(SpriteBatch spriteBatch, PixelationPrimitiveLayer layer);
void RenderPixelatedPrimitives(SpriteBatch spriteBatch, GeneralDrawLayer layer);
}
}
@@ -1,17 +0,0 @@
using System;
namespace CalamityMod.Graphics.Primitives
{
/// <summary>
/// Controls what layer the <see cref="IPixelatedPrimitiveRenderer.RenderPixelatedPrimitives"/> renders to.
/// </summary>
[Flags]
public enum PixelationPrimitiveLayer
{
BeforeNPCs = 1,
AfterNPCs = 2,
BeforeProjectiles = 4,
AfterProjectiles = 8,
AfterPlayers = 16
}
}
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -10,6 +11,10 @@ namespace CalamityMod.Graphics.Primitives
public class PrimitivePixelationSystem : ModSystem
{
#region Fields/Properties
private static ManagedRenderTarget PixelationTarget_BeforeAllTiles;
private static ManagedRenderTarget PixelationTarget_BeforeSolidTiles;
private static ManagedRenderTarget PixelationTarget_BeforeNPCs;
private static ManagedRenderTarget PixelationTarget_AfterNPCs;
@@ -20,6 +25,10 @@ namespace CalamityMod.Graphics.Primitives
private static ManagedRenderTarget PixelationTarget_AfterPlayers;
private static ManagedRenderTarget PixelationTarget_AfterDusts;
private static ManagedRenderTarget PixelationTarget_AfterEverything;
private static RenderTarget2D CreatePixelTarget(int width, int height) => new(Main.instance.GraphicsDevice, width / 2, height / 2);
/// <summary>
@@ -35,22 +44,38 @@ namespace CalamityMod.Graphics.Primitives
#region Loading
public override void Load()
{
On_Main.CheckMonoliths += DrawToTargets;
On_Main.DoDraw_DrawNPCsOverTiles += DrawTarget_NPCs;
On_Main.DrawProjectiles += DrawTarget_Projectiles;
On_Main.DrawPlayers_AfterProjectiles += DrawTarget_Players;
if (Main.dedServ)
return;
PixelationTarget_BeforeNPCs = new(true, CreatePixelTarget);
PixelationTarget_AfterNPCs = new(true, CreatePixelTarget);
PixelationTarget_BeforeProjectiles = new(true, CreatePixelTarget);
PixelationTarget_AfterProjectiles = new(true, CreatePixelTarget);
PixelationTarget_AfterPlayers = new(true, CreatePixelTarget);
Main.QueueMainThreadAction(() =>
{
PixelationTarget_BeforeAllTiles = new(true, CreatePixelTarget);
PixelationTarget_BeforeSolidTiles = new(true, CreatePixelTarget);
PixelationTarget_BeforeNPCs = new(true, CreatePixelTarget);
PixelationTarget_AfterNPCs = new(true, CreatePixelTarget);
PixelationTarget_BeforeProjectiles = new(true, CreatePixelTarget);
PixelationTarget_AfterProjectiles = new(true, CreatePixelTarget);
PixelationTarget_AfterPlayers = new(true, CreatePixelTarget);
PixelationTarget_AfterDusts = new(true, CreatePixelTarget);
PixelationTarget_AfterEverything = new(true, CreatePixelTarget);
});
On_Main.CheckMonoliths += DrawToTargets;
//On_Main.DrawBackgroundBlackFill += DrawTarget_BeforeAllTiles;
//On_Main.DoDraw_Tiles_Solid += DrawTarget_BeforeSolidTiles;
//On_Main.DoDraw_DrawNPCsOverTiles += DrawTarget_NPCs;
//On_Main.DrawProjectiles += DrawTarget_Projectiles;
//On_Main.DrawPlayers_AfterProjectiles += DrawTarget_Players;
//On_Main.DrawDust += DrawTarget_AfterDusts;
//On_Main.DrawInfernoRings += DrawTarget_AfterEverything;
}
public override void Unload()
{
if (Main.dedServ)
return;
On_Main.CheckMonoliths -= DrawToTargets;
On_Main.DoDraw_DrawNPCsOverTiles -= DrawTarget_NPCs;
}
#endregion
@@ -63,11 +88,15 @@ namespace CalamityMod.Graphics.Primitives
return;
}
var beforeAllTiles = new List<IPixelatedPrimitiveRenderer>();
var beforeSolidTiles = new List<IPixelatedPrimitiveRenderer>();
var beforeNPCs = new List<IPixelatedPrimitiveRenderer>();
var afterNPCs = new List<IPixelatedPrimitiveRenderer>();
var beforeProjectiles = new List<IPixelatedPrimitiveRenderer>();
var afterProjectiles = new List<IPixelatedPrimitiveRenderer>();
var afterPlayers = new List<IPixelatedPrimitiveRenderer>();
var afterDusts = new List<IPixelatedPrimitiveRenderer>();
var afterEverything = new List<IPixelatedPrimitiveRenderer>();
// Check every active projectile.
foreach (Projectile projectile in Main.ActiveProjectiles)
@@ -75,14 +104,24 @@ namespace CalamityMod.Graphics.Primitives
// If the projectile is active, a mod projectile, and uses the interface, add it to the list of primitives to draw this frame.
if (projectile.ModProjectile != null && projectile.ModProjectile is IPixelatedPrimitiveRenderer pixelPrimitiveProjectile)
{
if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.BeforeNPCs))
if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(GeneralDrawLayer.BeforeAllTiles))
beforeAllTiles.Add(pixelPrimitiveProjectile);
if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(GeneralDrawLayer.BeforeSolidTiles))
beforeSolidTiles.Add(pixelPrimitiveProjectile);
if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(GeneralDrawLayer.BeforeNPCs))
beforeNPCs.Add(pixelPrimitiveProjectile);
if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.AfterNPCs))
if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(GeneralDrawLayer.AfterNPCs))
afterNPCs.Add(pixelPrimitiveProjectile);
if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.BeforeProjectiles))
if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(GeneralDrawLayer.BeforeProjectiles))
beforeProjectiles.Add(pixelPrimitiveProjectile);
if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.AfterPlayers))
if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(GeneralDrawLayer.AfterProjectiles))
afterProjectiles.Add(pixelPrimitiveProjectile);
if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(GeneralDrawLayer.AfterPlayers))
afterPlayers.Add(pixelPrimitiveProjectile);
if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(GeneralDrawLayer.AfterDusts))
afterDusts.Add(pixelPrimitiveProjectile);
if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(GeneralDrawLayer.AfterEverything))
afterEverything.Add(pixelPrimitiveProjectile);
}
}
@@ -92,24 +131,38 @@ namespace CalamityMod.Graphics.Primitives
// If the NPC is active, a mod NPC, and uses the interface, add it to the list of primitives to draw this frame.
if (npc.ModNPC != null && npc.ModNPC is IPixelatedPrimitiveRenderer pixelPrimitiveNPC)
{
if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.BeforeNPCs))
if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(GeneralDrawLayer.BeforeAllTiles))
beforeAllTiles.Add(pixelPrimitiveNPC);
if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(GeneralDrawLayer.BeforeSolidTiles))
beforeSolidTiles.Add(pixelPrimitiveNPC);
if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(GeneralDrawLayer.BeforeNPCs))
beforeNPCs.Add(pixelPrimitiveNPC);
if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.AfterNPCs))
if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(GeneralDrawLayer.AfterNPCs))
afterNPCs.Add(pixelPrimitiveNPC);
if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.BeforeProjectiles))
if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(GeneralDrawLayer.BeforeProjectiles))
beforeProjectiles.Add(pixelPrimitiveNPC);
if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.AfterPlayers))
if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(GeneralDrawLayer.AfterProjectiles))
afterProjectiles.Add(pixelPrimitiveNPC);
if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(GeneralDrawLayer.AfterPlayers))
afterPlayers.Add(pixelPrimitiveNPC);
if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(GeneralDrawLayer.AfterDusts))
afterDusts.Add(pixelPrimitiveNPC);
if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(GeneralDrawLayer.AfterEverything))
afterEverything.Add(pixelPrimitiveNPC);
}
}
CurrentlyRendering = true;
DrawPrimsToRenderTarget(PixelationTarget_BeforeNPCs, PixelationPrimitiveLayer.BeforeNPCs, beforeNPCs);
DrawPrimsToRenderTarget(PixelationTarget_AfterNPCs, PixelationPrimitiveLayer.AfterNPCs, afterNPCs);
DrawPrimsToRenderTarget(PixelationTarget_BeforeProjectiles, PixelationPrimitiveLayer.BeforeProjectiles, beforeProjectiles);
DrawPrimsToRenderTarget(PixelationTarget_AfterProjectiles, PixelationPrimitiveLayer.AfterProjectiles, afterProjectiles);
DrawPrimsToRenderTarget(PixelationTarget_AfterPlayers, PixelationPrimitiveLayer.AfterPlayers, afterPlayers);
DrawPrimsToRenderTarget(PixelationTarget_BeforeAllTiles, GeneralDrawLayer.BeforeAllTiles, beforeAllTiles);
DrawPrimsToRenderTarget(PixelationTarget_BeforeSolidTiles, GeneralDrawLayer.BeforeSolidTiles, beforeSolidTiles);
DrawPrimsToRenderTarget(PixelationTarget_BeforeNPCs, GeneralDrawLayer.BeforeNPCs, beforeNPCs);
DrawPrimsToRenderTarget(PixelationTarget_AfterNPCs, GeneralDrawLayer.AfterNPCs, afterNPCs);
DrawPrimsToRenderTarget(PixelationTarget_BeforeProjectiles, GeneralDrawLayer.BeforeProjectiles, beforeProjectiles);
DrawPrimsToRenderTarget(PixelationTarget_AfterProjectiles, GeneralDrawLayer.AfterProjectiles, afterProjectiles);
DrawPrimsToRenderTarget(PixelationTarget_AfterPlayers, GeneralDrawLayer.AfterPlayers, afterPlayers);
DrawPrimsToRenderTarget(PixelationTarget_AfterDusts, GeneralDrawLayer.AfterDusts, afterDusts);
DrawPrimsToRenderTarget(PixelationTarget_AfterEverything, GeneralDrawLayer.AfterEverything, afterEverything);
Main.instance.GraphicsDevice.SetRenderTarget(null);
@@ -117,7 +170,7 @@ namespace CalamityMod.Graphics.Primitives
orig();
}
private static void DrawPrimsToRenderTarget(RenderTarget2D renderTarget, PixelationPrimitiveLayer layer, List<IPixelatedPrimitiveRenderer> pixelPrimitives)
private static void DrawPrimsToRenderTarget(RenderTarget2D renderTarget, GeneralDrawLayer layer, List<IPixelatedPrimitiveRenderer> pixelPrimitives)
{
// Swap to the target regardless, in order to clear any leftover content from last frame. Not doing this results in the final frame lingering once it stops rendering.
renderTarget.SwapTo();
@@ -135,31 +188,31 @@ namespace CalamityMod.Graphics.Primitives
#endregion
#region Target Drawing
private void DrawTarget_NPCs(On_Main.orig_DoDraw_DrawNPCsOverTiles orig, Main self)
internal static void DrawTargetScaled(GeneralDrawLayer drawLayer, bool startSpritebatch = true)
{
DrawTargetScaled(PixelationTarget_BeforeNPCs);
orig(self);
DrawTargetScaled(PixelationTarget_AfterNPCs);
if (startSpritebatch)
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
Main.spriteBatch.Draw(ReturnAssociatedRenderTarget(drawLayer), Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f);
if (startSpritebatch)
Main.spriteBatch.End();
}
private void DrawTarget_Projectiles(On_Main.orig_DrawProjectiles orig, Main self)
private static RenderTarget2D ReturnAssociatedRenderTarget(GeneralDrawLayer drawLayer)
{
DrawTargetScaled(PixelationTarget_BeforeProjectiles);
orig(self);
DrawTargetScaled(PixelationTarget_AfterProjectiles);
}
private void DrawTarget_Players(On_Main.orig_DrawPlayers_AfterProjectiles orig, Main self)
{
orig(self);
DrawTargetScaled(PixelationTarget_AfterPlayers);
}
private static void DrawTargetScaled(ManagedRenderTarget target)
{
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
Main.spriteBatch.Draw(target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f);
Main.spriteBatch.End();
return drawLayer switch
{
GeneralDrawLayer.BeforeAllTiles => PixelationTarget_BeforeAllTiles,
GeneralDrawLayer.BeforeSolidTiles => PixelationTarget_BeforeSolidTiles,
GeneralDrawLayer.BeforeNPCs => PixelationTarget_BeforeNPCs,
GeneralDrawLayer.AfterNPCs => PixelationTarget_AfterNPCs,
GeneralDrawLayer.BeforeProjectiles => PixelationTarget_BeforeProjectiles,
GeneralDrawLayer.AfterProjectiles => PixelationTarget_AfterProjectiles,
GeneralDrawLayer.AfterPlayers => PixelationTarget_AfterPlayers,
GeneralDrawLayer.AfterDusts => PixelationTarget_AfterDusts,
_ => PixelationTarget_AfterEverything
};
}
#endregion
}
+1 -1
View File
@@ -18,7 +18,7 @@ namespace CalamityMod.Graphics.Primitives
/// <item>The third controls how many points are created for the trail, and the fourth determines whether the primitive is subsequently rendered.</item>
/// </list>
/// If you wish to use pixelation, you <b>MUST</b> make the NPC/Projectile inherit <see cref="IPixelatedPrimitiveRenderer"/> and use <see cref="IPixelatedPrimitiveRenderer.RenderPixelatedPrimitives"/> instead of predraw..<br/>
/// You can also optionally specify a render layer with <see cref="IPixelatedPrimitiveRenderer.LayerToRenderTo"/>. It is <see cref="PixelationPrimitiveLayer.BeforeNPCs"/> by default.
/// You can also optionally specify a render layer with <see cref="IPixelatedPrimitiveRenderer.LayerToRenderTo"/>. It is <see cref="Enums.GeneralDrawLayer.BeforeNPCs"/> by default.
/// </summary>
[Autoload(Side = ModSide.Client)]
public sealed class PrimitiveRenderer : ModSystem
+2 -1
View File
@@ -1,4 +1,5 @@
using System;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria.ModLoader;
@@ -14,7 +15,7 @@ namespace CalamityMod.Graphics.Renderers
/// <summary>
/// The layer that the target should be drawn at.
/// </summary>
public abstract DrawLayer Layer { get; }
public abstract GeneralDrawLayer Layer { get; }
/// <summary>
/// Whether the target should draw and be drawn to this frame.
@@ -1,4 +1,5 @@
using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses;
using CalamityMod.Enums;
using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -11,7 +12,7 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers
{
#region Fields/Properties
public override DrawLayer Layer => DrawLayer.AfterEverything;
public override GeneralDrawLayer Layer => GeneralDrawLayer.AfterEverything;
public static NPC Deerclops => Main.npc[NPC.deerclopsBoss];
@@ -1,4 +1,5 @@
using CalamityMod.NPCs;
using CalamityMod.Enums;
using CalamityMod.NPCs;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -18,7 +19,7 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers
private set;
}
public override DrawLayer Layer => DrawLayer.NPC;
public override GeneralDrawLayer Layer => GeneralDrawLayer.AfterNPCs;
public override bool ShouldDraw => !Main.gameMenu && CalamityDrawParameterNPC.DoGDeathAnimationTimer > 0;
@@ -3,6 +3,7 @@ using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using CalamityMod.DataStructures;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -28,7 +29,7 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers
private static List<IDyeableShaderRenderer> RenderersToDrawThisFrame;
public override DrawLayer Layer => DrawLayer.Player;
public override GeneralDrawLayer Layer => GeneralDrawLayer.AfterPlayers;
// This ignores MainTarget, and handles its own targets, so always call the draw methods.
public override bool ShouldDraw => true;
@@ -1,4 +1,5 @@
using CalamityMod.NPCs;
using CalamityMod.Enums;
using CalamityMod.NPCs;
using CalamityMod.NPCs.Providence;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -13,7 +14,7 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers
{
#region Fields/Properties
public override DrawLayer Layer => DrawLayer.BeforeTiles;
public override GeneralDrawLayer Layer => GeneralDrawLayer.BeforeAllTiles;
public static Providence Provi
{
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using CalamityMod.Enums;
using CalamityMod.NPCs;
using CalamityMod.NPCs.ExoMechs.Ares;
using Microsoft.Xna.Framework;
@@ -42,7 +43,7 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers
private set;
}
public override DrawLayer Layer => DrawLayer.NPC;
public override GeneralDrawLayer Layer => GeneralDrawLayer.AfterNPCs;
// Unsure whether its more performant to always draw, or to check if any NPC actually has the debuff.
public override bool ShouldDraw => true;
+16 -99
View File
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -24,16 +25,8 @@ namespace CalamityMod.Graphics.Renderers
if (Main.dedServ)
return;
Main.QueueMainThreadAction(() =>
{
// This hooks here, because doing it any sooner causes the screen position to be a frame behind.
On_Main.CheckMonoliths += DrawToTargets;
On_Main.DrawNPCs += DrawNPCRenderers;
On_Main.DrawProjectiles += DrawProjectileRenderers;
On_Main.DrawPlayers_AfterProjectiles += DrawPlayerRenderers;
On_Main.DrawBackgroundBlackFill += DrawBeforeTileRenderers;
On_Main.DrawInfernoRings += DrawAfterEverythingRenderers;
});
// This hooks here, because doing it any sooner causes the screen position to be a frame behind.
Main.QueueMainThreadAction(() => On_Main.CheckMonoliths += DrawToTargets);
}
public override void Unload()
@@ -43,24 +36,13 @@ namespace CalamityMod.Graphics.Renderers
// Clear the cached renderers, so they can be readded on mod loading when initialized.
Renderers.Clear();
Main.QueueMainThreadAction(() =>
{
// Supposed to be auto-unloaded, but considering TMods poor track record with actually doing this, manually unload them.
On_Main.CheckMonoliths -= DrawToTargets;
On_Main.DrawNPCs -= DrawNPCRenderers;
On_Main.DrawProjectiles -= DrawProjectileRenderers;
On_Main.DrawPlayers_AfterProjectiles -= DrawPlayerRenderers;
On_Main.DrawBackgroundBlackFill -= DrawBeforeTileRenderers;
On_Main.DrawInfernoRings -= DrawAfterEverythingRenderers;
});
}
#endregion
#region Updating
public override void PreUpdateEntities()
{
if (Main.netMode is NetmodeID.Server)
if (Main.dedServ)
return;
foreach (var renderer in Renderers)
@@ -69,7 +51,7 @@ namespace CalamityMod.Graphics.Renderers
public override void PostUpdateEverything()
{
if (Main.netMode is NetmodeID.Server)
if (Main.dedServ)
return;
foreach (var renderer in Renderers)
@@ -78,6 +60,17 @@ namespace CalamityMod.Graphics.Renderers
#endregion
#region Drawing
internal static void DrawRendererAtLayer(GeneralDrawLayer drawLayer)
{
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise);
var renderers = Renderers.Where(renderer => renderer.ShouldDraw && renderer.Layer == drawLayer);
foreach (var renderer in renderers)
renderer.DrawTarget(Main.spriteBatch);
Main.spriteBatch.End();
}
private void DrawToTargets(On_Main.orig_CheckMonoliths orig)
{
orig();
@@ -106,82 +99,6 @@ namespace CalamityMod.Graphics.Renderers
Main.instance.GraphicsDevice.SetRenderTarget(null);
}
private void DrawNPCRenderers(On_Main.orig_DrawNPCs orig, Main self, bool behindTiles)
{
orig(self, behindTiles);
if (behindTiles)
return;
var renderers = Renderers.Where(renderer => renderer.ShouldDraw && renderer.Layer is DrawLayer.NPC);
Main.spriteBatch.End();
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise);
foreach (var renderer in renderers)
renderer.DrawTarget(Main.spriteBatch);
Main.spriteBatch.ExitShaderRegion();
}
private void DrawProjectileRenderers(On_Main.orig_DrawProjectiles orig, Main self)
{
orig(self);
var renderers = Renderers.Where(renderer => renderer.ShouldDraw && renderer.Layer is DrawLayer.Projectile);
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise);
foreach (var renderer in renderers)
renderer.DrawTarget(Main.spriteBatch);
Main.spriteBatch.End();
}
private void DrawPlayerRenderers(On_Main.orig_DrawPlayers_AfterProjectiles orig, Main self)
{
orig(self);
var renderers = Renderers.Where(renderer => renderer.ShouldDraw && renderer.Layer is DrawLayer.Player);
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise);
foreach (var renderer in renderers)
renderer.DrawTarget(Main.spriteBatch);
Main.spriteBatch.End();
}
private void DrawBeforeTileRenderers(On_Main.orig_DrawBackgroundBlackFill orig, Main self)
{
var renderers = Renderers.Where(renderer => renderer.ShouldDraw && renderer.Layer is DrawLayer.BeforeTiles);
Main.spriteBatch.End();
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise);
foreach (var renderer in renderers)
renderer.DrawTarget(Main.spriteBatch);
Main.spriteBatch.End();
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Main.Transform);
orig(self);
}
private void DrawAfterEverythingRenderers(On_Main.orig_DrawInfernoRings orig, Main self)
{
var renderers = Renderers.Where(renderer => renderer.ShouldDraw && renderer.Layer is DrawLayer.AfterEverything);
Main.spriteBatch.End();
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise);
foreach (var renderer in renderers)
renderer.DrawTarget(Main.spriteBatch);
Main.spriteBatch.End();
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Main.Transform);
orig(self);
}
#endregion
}
}
+9 -1
View File
@@ -43,7 +43,6 @@ namespace CalamityMod.ILEditing
IL_Main.DoDraw += CustomDoDrawChanges;
On_Main.DrawCursor += UseCoolFireCursorEffect;
On_Main.SortDrawCacheWorms += DrawFusableParticles;
On_Main.DrawInfernoRings += DrawForegroundParticles;
On_TileDrawing.Draw += ClearTilePings;
On_CommonCode.ModifyItemDropFromNPC += ColorBlightedGel;
On_MoonlordDeathDrama.RequestLight += DisableFlashesWithPhotosensitivityConfig;
@@ -59,6 +58,15 @@ namespace CalamityMod.ILEditing
IL_TileDrawing.DrawTrees += DrawTreeGlowMask;
On_TileDrawing.DrawBasicTile += DrawTreeTrunkAndCactusGlowMask;
// Graphics (GeneralDrawLayer detours)
On_Main.DrawBackgroundBlackFill += GeneralDrawLayer_DrawToLayer_BeforeAllTiles;
On_Main.DoDraw_Tiles_Solid += GeneralDrawLayer_DrawToLayer_BeforeSolidTiles;
On_Main.DoDraw_DrawNPCsOverTiles += GeneralDrawLayer_DrawToLayer_NPCs;
On_Main.DrawProjectiles += GeneralDrawLayer_DrawToLayer_Projectiles;
On_Main.DrawPlayers_AfterProjectiles += GeneralDrawLayer_DrawToLayer_AfterPlayers;
On_Main.DrawDust += GeneralDrawLayer_DrawToLayer_AfterDusts;
On_Main.DrawInfernoRings += GeneralDrawLayer_DrawToLayer_AfterEverything;
// NPC behavior
IL_Main.UpdateTime += PermitNighttimeTownNPCSpawning;
On_Main.UpdateTime_SpawnTownNPCs += AlterTownNPCSpawnRate;
+81 -6
View File
@@ -8,6 +8,9 @@ using CalamityMod.DataStructures;
using CalamityMod.Enums;
using CalamityMod.Events;
using CalamityMod.FluidSimulation;
using CalamityMod.Graphics.Metaballs;
using CalamityMod.Graphics.Primitives;
using CalamityMod.Graphics.Renderers;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Accessories.Vanity;
using CalamityMod.Items.Armor.Wulfrum;
@@ -26,6 +29,7 @@ using CalamityMod.Projectiles;
using CalamityMod.Projectiles.Ranged;
using CalamityMod.Projectiles.Typeless;
using CalamityMod.Systems;
using CalamityMod.Systems.Graphic.PixelationSystem;
using CalamityMod.Systems.Mechanic;
using CalamityMod.Tiles;
using CalamityMod.Walls;
@@ -591,7 +595,7 @@ namespace CalamityMod.ILEditing
// This only applies to minions spawned by weapon uses, preventing other minions such as Luxor's Gift from exploding
if (projectile.minion && spawnSource is EntitySource_ItemUse useSource && useSource.Item is Item weapon && weapon.useAnimation > 0)
{
CalamityPlayer.EnchantHeldItemEffects(player, player.Calamity(), player.ActiveItem());
CalamityPlayer.EnchantHeldItemEffects(player, player.Calamity(), player.HeldItem);
if (player.Calamity().explosiveMinionsEnchant)
calProj.ExplosiveEnchantCountdown = CalamityGlobalProjectile.ExplosiveEnchantTime;
}
@@ -908,6 +912,82 @@ namespace CalamityMod.ILEditing
}
#endregion
#region GeneralDrawLayer Systems Drawing
private static void GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer drawLayer)
{
Main.spriteBatch.SafeAction(() =>
{
Main.spriteBatch.TryEnd();
GeneralParticleHandler.DrawParticleCollectionsAtSpecificLayer(drawLayer);
});
Main.spriteBatch.SafeAction(() =>
{
Main.spriteBatch.TryEnd();
Main.spriteBatch.TryBegin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
MetaballManager.DrawMetaballs(drawLayer);
});
Main.spriteBatch.SafeAction(() =>
{
Main.spriteBatch.TryEnd();
PrimitivePixelationSystem.DrawTargetScaled(drawLayer);
});
PixelationManager.DrawPixelatedTargets(drawLayer);
Main.spriteBatch.SafeAction(() =>
{
Main.spriteBatch.TryEnd();
RendererManager.DrawRendererAtLayer(drawLayer);
});
}
private static void GeneralDrawLayer_DrawToLayer_BeforeAllTiles(On_Main.orig_DrawBackgroundBlackFill orig, Main self)
{
GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer.BeforeAllTiles);
orig(self);
}
private static void GeneralDrawLayer_DrawToLayer_BeforeSolidTiles(On_Main.orig_DoDraw_Tiles_Solid orig, Main self)
{
GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer.BeforeSolidTiles);
orig(self);
}
private static void GeneralDrawLayer_DrawToLayer_NPCs(On_Main.orig_DoDraw_DrawNPCsOverTiles orig, Main self)
{
GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer.BeforeNPCs);
orig(self);
GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer.AfterNPCs);
}
private static void GeneralDrawLayer_DrawToLayer_Projectiles(On_Main.orig_DrawProjectiles orig, Main self)
{
GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer.BeforeProjectiles);
orig(self);
GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer.AfterProjectiles);
}
private static void GeneralDrawLayer_DrawToLayer_AfterPlayers(On_Main.orig_DrawPlayers_AfterProjectiles orig, Main self)
{
orig(self);
GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer.AfterPlayers);
}
private static void GeneralDrawLayer_DrawToLayer_AfterDusts(On_Main.orig_DrawDust orig, Main self)
{
orig(self);
GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer.AfterDusts);
}
private static void GeneralDrawLayer_DrawToLayer_AfterEverything(On_Main.orig_DrawInfernoRings orig, Main self)
{
orig(self);
GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer.AfterEverything);
}
#endregion
#region General Particle Rendering
private static void DrawFusableParticles(On_Main.orig_SortDrawCacheWorms orig, Main self)
{
@@ -919,11 +999,6 @@ namespace CalamityMod.ILEditing
orig(self);
}
private static void DrawForegroundParticles(On_Main.orig_DrawInfernoRings orig, Main self)
{
GeneralParticleHandler.DrawAllParticles(Main.spriteBatch);
orig(self);
}
#endregion
#region Disable Moon Lord Style Flashes With Photosensitivity Config
+1 -1
View File
@@ -9,7 +9,7 @@ namespace CalamityMod.Items.Accessories
{
public new string LocalizationCategory => "Items.Accessories";
public static int AbaddonExploDamage = 90;
public static int AbaddonExploDamage = 25;
public override void SetDefaults()
{
Item.width = 26;
+1
View File
@@ -19,6 +19,7 @@ namespace CalamityMod.Items.Accessories
Item.accessory = true;
Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice;
Item.rare = ModContent.RarityType<PureGreen>();
Item.expert = true;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
+1
View File
@@ -15,6 +15,7 @@ namespace CalamityMod.Items.Accessories
Item.value = CalamityGlobalItem.RarityPinkBuyPrice;
Item.rare = ItemRarityID.Pink;
Item.accessory = true;
Item.expert = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1
View File
@@ -18,6 +18,7 @@ namespace CalamityMod.Items.Accessories
Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
Item.rare = ModContent.RarityType<Turquoise>();
Item.accessory = true;
Item.expert = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1
View File
@@ -35,6 +35,7 @@ namespace CalamityMod.Items.Accessories
Item.accessory = true;
Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
Item.rare = ModContent.RarityType<Turquoise>();
Item.expert = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1
View File
@@ -16,6 +16,7 @@ namespace CalamityMod.Items.Accessories
Item.rare = ItemRarityID.Yellow;
Item.value = CalamityGlobalItem.RarityYellowBuyPrice;
Item.accessory = true;
Item.expert = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1
View File
@@ -16,6 +16,7 @@ namespace CalamityMod.Items.Accessories
Item.value = CalamityGlobalItem.RarityOrangeBuyPrice;
Item.rare = ItemRarityID.Orange;
Item.accessory = true;
Item.expert = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1
View File
@@ -33,6 +33,7 @@ namespace CalamityMod.Items.Accessories
Item.rare = ModContent.RarityType<BurnishedAuric>();
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
Item.accessory = true;
Item.expert = true;
}
public override void UpdateVanity(Player player)
+1
View File
@@ -45,6 +45,7 @@ namespace CalamityMod.Items.Accessories
Item.defense = 20;
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
Item.rare = ModContent.RarityType<BurnishedAuric>();
Item.expert = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1
View File
@@ -28,6 +28,7 @@ namespace CalamityMod.Items.Accessories
Item.value = CalamityGlobalItem.RarityPurpleBuyPrice;
Item.rare = ItemRarityID.Purple;
Item.accessory = true;
Item.expert = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1
View File
@@ -26,6 +26,7 @@ namespace CalamityMod.Items.Accessories
Item.value = CalamityGlobalItem.RarityPinkBuyPrice;
Item.rare = ItemRarityID.Pink;
Item.accessory = true;
Item.expert = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1
View File
@@ -20,6 +20,7 @@ namespace CalamityMod.Items.Accessories
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
Item.rare = ItemRarityID.Green;
Item.accessory = true;
Item.expert = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1
View File
@@ -20,6 +20,7 @@ namespace CalamityMod.Items.Accessories
Item.value = CalamityGlobalItem.RarityCyanBuyPrice;
Item.rare = ItemRarityID.Cyan;
Item.accessory = true;
Item.expert = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
@@ -21,6 +21,7 @@ namespace CalamityMod.Items.Accessories
Item.value = CalamityGlobalItem.RarityLimeBuyPrice;
Item.accessory = true;
Item.rare = ItemRarityID.Lime;
Item.expert = true;
}
public override void ModifyTooltips(List<TooltipLine> list) => list.IntegrateHotkey(CalamityKeybinds.GravistarSabatonHotkey);
+1
View File
@@ -18,6 +18,7 @@ namespace CalamityMod.Items.Accessories
Item.value = CalamityGlobalItem.RarityLimeBuyPrice;
Item.accessory = true;
Item.rare = ItemRarityID.Lime;
Item.expert = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1
View File
@@ -16,6 +16,7 @@ namespace CalamityMod.Items.Accessories
Item.value = CalamityGlobalItem.RarityLightRedBuyPrice;
Item.rare = ItemRarityID.LightRed;
Item.accessory = true;
Item.expert = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1
View File
@@ -19,6 +19,7 @@ namespace CalamityMod.Items.Accessories
Item.accessory = true;
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
Item.rare = ModContent.RarityType<CosmicPurple>();
Item.expert = true;
}
public override void Update(ref float gravity, ref float maxFallSpeed)
+1
View File
@@ -15,6 +15,7 @@ namespace CalamityMod.Items.Accessories
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
Item.rare = ItemRarityID.Green;
Item.accessory = true;
Item.expert = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1
View File
@@ -23,6 +23,7 @@ namespace CalamityMod.Items.Accessories
Item.accessory = true;
Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice;
Item.rare = ModContent.RarityType<PureGreen>();
Item.expert = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1
View File
@@ -19,6 +19,7 @@ namespace CalamityMod.Items.Accessories
Item.value = CalamityGlobalItem.RarityOrangeBuyPrice;
Item.rare = ItemRarityID.Orange;
Item.accessory = true;
Item.expert = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1
View File
@@ -21,6 +21,7 @@ namespace CalamityMod.Items.Accessories
Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
Item.rare = ModContent.RarityType<Turquoise>();
Item.accessory = true;
Item.expert = true;
}
public override void ModifyTooltips(List<TooltipLine> list) => list.IntegrateHotkey(CalamityKeybinds.SpectralVeilHotKey);
+1 -1
View File
@@ -36,7 +36,7 @@ namespace CalamityMod.Items.Accessories
Item heldItem = null;
if (player.selectedItem >= 0 && player.selectedItem < Main.InventorySlotsTotal)
heldItem = player.ActiveItem();
heldItem = player.HeldItem;
static string OnePlace(float f) => f.ToString("n1");
static string TwoPlaces(float f) => f.ToString("n2");
+6 -6
View File
@@ -67,13 +67,13 @@ namespace CalamityMod.Items.Accessories
}
}
}
if (player.ActiveItem() != null && !player.ActiveItem().IsAir && player.ActiveItem().stack > 0)
if (player.HeldItem != null && !player.HeldItem.IsAir && player.HeldItem.stack > 0)
{
bool summon = player.ActiveItem().CountsAsClass<SummonDamageClass>();
bool rogue = player.ActiveItem().CountsAsClass<ThrowingDamageClass>();
bool melee = player.ActiveItem().CountsAsClass<MeleeDamageClass>();
bool ranged = player.ActiveItem().CountsAsClass<RangedDamageClass>();
bool magic = player.ActiveItem().CountsAsClass<MagicDamageClass>();
bool summon = player.HeldItem.CountsAsClass<SummonDamageClass>();
bool rogue = player.HeldItem.CountsAsClass<ThrowingDamageClass>();
bool melee = player.HeldItem.CountsAsClass<MeleeDamageClass>();
bool ranged = player.HeldItem.CountsAsClass<RangedDamageClass>();
bool magic = player.HeldItem.CountsAsClass<MagicDamageClass>();
if (summon)
{
player.GetKnockback<SummonDamageClass>() += 0.1f;
+1
View File
@@ -23,6 +23,7 @@ namespace CalamityMod.Items.Accessories
Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
Item.rare = ModContent.RarityType<Turquoise>();
Item.accessory = true;
Item.expert = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1
View File
@@ -21,6 +21,7 @@ namespace CalamityMod.Items.Accessories
Item.value = CalamityGlobalItem.RarityYellowBuyPrice;
Item.rare = ItemRarityID.Yellow;
Item.accessory = true;
Item.expert = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1
View File
@@ -18,6 +18,7 @@ namespace CalamityMod.Items.Accessories
Item.value = CalamityGlobalItem.RarityLimeBuyPrice;
Item.rare = ItemRarityID.Lime;
Item.accessory = true;
Item.expert = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1 -1
View File
@@ -15,7 +15,7 @@ namespace CalamityMod.Items.Accessories
public const int FireProjectiles = 2;
public const float FireAngleSpread = 120;
public int FireCountdown = 0;
public static int VoidExploDamage = 150;
public static int VoidExploDamage = 40;
public override void SetDefaults()
{
@@ -42,6 +42,7 @@ namespace CalamityMod.Items.Accessories
Item.value = CalamityGlobalItem.RarityPurpleBuyPrice;
Item.rare = ItemRarityID.Purple;
Item.accessory = true;
Item.expert = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1
View File
@@ -29,6 +29,7 @@ namespace CalamityMod.Items.Accessories.Wings
Item.height = 26;
Item.value = CalamityGlobalItem.RarityPinkBuyPrice;
Item.rare = ItemRarityID.Pink;
Item.expert = true;
}
public override void Update(ref float gravity, ref float maxFallSpeed)
+2 -1
View File
@@ -18,10 +18,11 @@ namespace CalamityMod.Items.Accessories
{
Item.width = 20;
Item.height = 22;
Item.defense = 12; // Why did this give 30 defense? This thing really needs a rework lol
Item.defense = 12;
Item.accessory = true;
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
Item.rare = ModContent.RarityType<BurnishedAuric>();
Item.expert = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1 -1
View File
@@ -41,7 +41,7 @@ namespace CalamityMod.Items.Armor.Victide
Item.height = 18;
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
Item.rare = ItemRarityID.Green;
Item.defense = 5;
Item.defense = 4;
}
public override void UpdateEquip(Player player)
+1 -1
View File
@@ -31,7 +31,7 @@ namespace CalamityMod.Items.Armor.Victide
Item.height = 18;
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
Item.rare = ItemRarityID.Green;
Item.defense = 4;
Item.defense = 3;
}
public override void UpdateEquip(Player player)
+2 -2
View File
@@ -23,7 +23,7 @@ namespace CalamityMod.Items.Armor.Victide
// Set Bonus
public static int BarrierCooldown = CalamityUtils.SecondsToFrames(8);
public static int BarrierDefenseBoost = 5;
public static int BarrierDefenseBoost = 6;
public static float BarrierDamageAbsorptionPercent = 0.1f;
public static int BarrierFramesPerHeal = 15;
public static int BarrierDamage = 50;
@@ -35,7 +35,7 @@ namespace CalamityMod.Items.Armor.Victide
Item.height = 18;
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
Item.rare = ItemRarityID.Green;
Item.defense = 6; // 15
Item.defense = 5; // 12
}
public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType<VictideBreastplate>() && legs.type == ModContent.ItemType<VictideGreaves>();
+1 -1
View File
@@ -31,7 +31,7 @@ namespace CalamityMod.Items.Armor.Victide
Item.height = 18;
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
Item.rare = ItemRarityID.Green;
Item.defense = 5; // 14
Item.defense = 3; // 10
}
public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType<VictideBreastplate>() && legs.type == ModContent.ItemType<VictideGreaves>();
+1 -1
View File
@@ -30,7 +30,7 @@ namespace CalamityMod.Items.Armor.Victide
Item.height = 18;
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
Item.rare = ItemRarityID.Green;
Item.defense = 1; // 10
Item.defense = 1; // 8
}
public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType<VictideBreastplate>() && legs.type == ModContent.ItemType<VictideGreaves>();
+9 -9
View File
@@ -90,8 +90,8 @@ namespace CalamityMod.Items.BaseItems
internal TransformationAccessory currentTransformation = null;
internal TransformationAccessory previousTransformation = null;
int previousHighest = -1;
int currentHighest = -1;
internal int previousHighest = -1;
internal int currentHighest = -1;
public int Type
{
@@ -124,10 +124,10 @@ namespace CalamityMod.Items.BaseItems
}
}
private void Reset(Player p)
private static void Reset(Player p)
{
previousHighest = currentHighest;
currentHighest = -1;
p.Transformation().previousHighest = p.Transformation().currentHighest;
p.Transformation().currentHighest = -1;
if (p.Transformation().currentTransformation != null && !p.Transformation().currentTransformation.IsForced)
{
@@ -139,17 +139,17 @@ namespace CalamityMod.Items.BaseItems
private void SetTransformationItem(On_Player.orig_UpdateVisibleAccessory orig, Player self, int itemSlot, Item item, bool modded)
{
orig(self, itemSlot, item, modded);
if (self.Transformation().currentTransformation == null || !self.Transformation().currentTransformation.IsForced)
{
if (item.ModItem is TransformationAccessory transformation && transformation.ShouldTransform.Invoke(self) && (currentTransformation == null || transformation.Priority >= currentTransformation.Priority))
self.Transformation().currentTransformation = transformation;
}
if (currentHighest < itemSlot)
currentHighest = itemSlot;
if (self.Transformation().currentHighest < itemSlot)
self.Transformation().currentHighest = itemSlot;
if (self.Transformation().currentTransformation != null && itemSlot == previousHighest) // last item slot, can set equip slots to our transformation if one is equipped
if (self.Transformation().currentTransformation != null && itemSlot == self.Transformation().previousHighest) // last item slot, can set equip slots to our transformation if one is equipped
{
TransformationAccessory trans = self.Transformation().currentTransformation;
EquipTransformation(trans, self, Mod);
+33 -86
View File
@@ -262,8 +262,8 @@ namespace CalamityMod.Items
if (item.type == ItemID.Zenith)
item.rare = RarityType<BurnishedAuric>();
// Make most expert items no longer expert because they drop in all modes now.
switch (item.type)
// CIT 16OCT2025: Following overwhelming dev vote, Expert+ drops are NOT available in Classic
/*switch (item.type)
{
case ItemID.RoyalGel:
case ItemID.EoCShield:
@@ -288,7 +288,7 @@ namespace CalamityMod.Items
case ItemID.LongRainbowTrailWings:
item.expert = false;
break;
}
}*/
// Allow Souls to be used as ammo for SHPC.
if (item.type == ItemID.SoulofLight || item.type == ItemID.SoulofNight || item.type == ItemID.SoulofFlight || item.type == ItemID.SoulofMight || item.type == ItemID.SoulofSight || item.type == ItemID.SoulofFright)
@@ -613,7 +613,7 @@ namespace CalamityMod.Items
// Prevent Mana Stars from being picked up while wielding Ion Blaster or Apoctosis Array
if (item.type == ItemID.Star || item.type == ItemID.SoulCake || item.type == ItemID.SugarPlum)
{
if (player.ActiveItem().type == ItemType<IonBlaster>() || player.ActiveItem().type == ItemType<ApoctosisArray>())
if (player.HeldItem.type == ItemType<IonBlaster>() || player.HeldItem.type == ItemType<ApoctosisArray>())
return false;
}
return base.CanPickup(item, player);
@@ -724,7 +724,7 @@ namespace CalamityMod.Items
{
return false;
}
if (player.ActiveItem().type == ItemType<VoidConcentrationStaff>() && player.ownedProjectileCounts[ProjectileType<VoidConcentrationBlackhole>()] == 0)
if (player.HeldItem.type == ItemType<VoidConcentrationStaff>() && player.ownedProjectileCounts[ProjectileType<VoidConcentrationBlackhole>()] == 0)
{
foreach (Projectile p in Main.ActiveProjectiles)
{
@@ -739,7 +739,7 @@ namespace CalamityMod.Items
}
return false;
}
if (player.ActiveItem().type == ItemType<GlacialEmbrace>())
if (player.HeldItem.type == ItemType<GlacialEmbrace>())
{
bool canContinue = true;
int count = 0;
@@ -769,7 +769,7 @@ namespace CalamityMod.Items
float angleVariance = MathHelper.TwoPi / pointyThingyAmount;
float angle = 0f;
var source = player.GetSource_ItemUse(player.ActiveItem());
var source = player.GetSource_ItemUse(player.HeldItem);
for (int i = 0; i < pointyThingyAmount; i++)
{
if (Main.projectile.Length == Main.maxProjectiles)
@@ -1009,18 +1009,6 @@ namespace CalamityMod.Items
return "MagicHat";
if (head.type == ItemID.CrystalNinjaHelmet && body.type == ItemID.CrystalNinjaChestplate && legs.type == ItemID.CrystalNinjaLeggings)
return "CrystalAssassin";
if (head.type == ItemID.SquireGreatHelm && body.type == ItemID.SquirePlating && legs.type == ItemID.SquireGreaves)
return "SquireTier2";
if (head.type == ItemID.HuntressWig && body.type == ItemID.HuntressJerkin && legs.type == ItemID.HuntressPants)
return "HuntressTier2";
if (head.type == ItemID.ApprenticeHat && body.type == ItemID.ApprenticeRobe && legs.type == ItemID.ApprenticeTrousers)
return "ApprenticeTier2";
if (head.type == ItemID.SquireAltHead && body.type == ItemID.SquireAltShirt && legs.type == ItemID.SquireAltPants)
return "SquireTier3";
if (head.type == ItemID.HuntressAltHead && body.type == ItemID.HuntressAltShirt && legs.type == ItemID.HuntressAltPants)
return "HuntressTier3";
if (head.type == ItemID.ApprenticeAltHead && body.type == ItemID.ApprenticeAltShirt && legs.type == ItemID.ApprenticeAltPants)
return "ApprenticeTier3";
if (head.type == ItemID.SpectreHood && body.type == ItemID.SpectreRobe && legs.type == ItemID.SpectrePants)
return "SpectreHealing";
if (head.type == ItemID.SolarFlareHelmet && body.type == ItemID.SolarFlareBreastplate && legs.type == ItemID.SolarFlareLeggings)
@@ -1050,44 +1038,6 @@ namespace CalamityMod.Items
modPlayer.rogueStealthMax += 0.9f;
modPlayer.wearingRogueArmor = true;
}
else if (set == "SquireTier2")
{
player.lifeRegen += 3;
player.GetDamage<SummonDamageClass>() += 0.15f;
player.GetCritChance<MeleeDamageClass>() += 10;
player.setBonus += $"\n{CalamityUtils.GetTextValue("Vanilla.Armor.SetBonus.SquireTier2")}";
}
else if (set == "HuntressTier2")
{
player.GetDamage<SummonDamageClass>() += 0.1f;
player.GetDamage<RangedDamageClass>() += 0.1f;
player.setBonus += $"\n{CalamityUtils.GetTextValue("Vanilla.Armor.SetBonus.HuntressTier2")}";
}
else if (set == "ApprenticeTier2")
{
player.GetDamage<SummonDamageClass>() += 0.1f;
player.GetCritChance<MagicDamageClass>() += 10;
player.setBonus += $"\n{CalamityUtils.GetTextValue("Vanilla.Armor.SetBonus.ApprenticeTier2")}";
}
else if (set == "SquireTier3")
{
player.lifeRegen += 6;
player.GetDamage<SummonDamageClass>() += 0.1f;
player.GetCritChance<MeleeDamageClass>() += 15;
player.setBonus += $"\n{CalamityUtils.GetTextValue("Vanilla.Armor.SetBonus.SquireTier3")}";
}
else if (set == "HuntressTier3")
{
player.GetDamage<SummonDamageClass>() += 0.1f;
player.GetDamage<RangedDamageClass>() += 0.1f;
player.setBonus += $"\n{CalamityUtils.GetTextValue("Vanilla.Armor.SetBonus.HuntressTier3")}";
}
else if (set == "ApprenticeTier3")
{
player.GetDamage<SummonDamageClass>() += 0.15f;
player.GetCritChance<MagicDamageClass>() += 15;
player.setBonus += $"\n{CalamityUtils.GetTextValue("Vanilla.Armor.SetBonus.ApprenticeTier3")}";
}
else if (set == "SpectreHealing")
{
player.GetDamage<MagicDamageClass>() += 0.4f;
@@ -1151,35 +1101,30 @@ namespace CalamityMod.Items
player.GetAttackSpeed<MeleeDamageClass>() += 0.05f;
break;
case ItemID.SquireGreatHelm:
player.lifeRegen -= 3;
break;
case ItemID.SquirePlating:
player.GetDamage<SummonDamageClass>() -= 0.1f;
break;
case ItemID.SquireGreaves:
player.GetDamage<SummonDamageClass>() -= 0.1f;
player.GetCritChance<MeleeDamageClass>() -= 10;
player.GetDamage<SummonDamageClass>() -= 0.05f;
break;
case ItemID.HuntressWig:
player.GetCritChance<RangedDamageClass>() += 5;
break;
case ItemID.HuntressJerkin:
player.GetDamage<SummonDamageClass>() -= 0.1f;
player.GetDamage<RangedDamageClass>() -= 0.15f;
player.GetCritChance<RangedDamageClass>() += 5;
break;
case ItemID.HuntressPants:
player.GetDamage<RangedDamageClass>() -= 0.05f;
player.GetDamage<SummonDamageClass>() -= 0.05f;
break;
case ItemID.ApprenticeHat:
player.GetDamage<MagicDamageClass>() -= 0.05f;
player.GetDamage<MagicDamageClass>() -= 0.1f;
break;
case ItemID.ApprenticeRobe:
player.GetDamage<SummonDamageClass>() -= 0.1f;
break;
case ItemID.ApprenticeTrousers:
player.GetDamage<SummonDamageClass>() -= 0.05f;
player.GetCritChance<MagicDamageClass>() -= 15;
player.GetDamage<MagicDamageClass>() += 0.05f;
break;
case ItemID.ApprenticeTrousers:
player.GetCritChance<MagicDamageClass>() -= 5;
break;
case ItemID.ShroomiteBreastplate:
@@ -1191,34 +1136,36 @@ namespace CalamityMod.Items
player.GetDamage<MeleeDamageClass>() += 0.05f;
player.GetDamage<SummonDamageClass>() += 0.05f;
break;
case ItemID.SquireAltShirt:
player.lifeRegen -= 6;
player.GetDamage<SummonDamageClass>() -= 0.15f;
break;
case ItemID.SquireAltPants:
player.GetDamage<SummonDamageClass>() -= 0.1f;
player.GetCritChance<MeleeDamageClass>() -= 20;
break;
case ItemID.SquireAltPants:
player.GetCritChance<MeleeDamageClass>() -= 5;
player.GetDamage<SummonDamageClass>() -= 0.05f;
break;
case ItemID.HuntressAltShirt:
player.GetDamage<SummonDamageClass>() -= 0.15f;
player.GetDamage<RangedDamageClass>() -= 0.15f;
player.GetDamage<RangedDamageClass>() -= 0.05f;
player.GetDamage<SummonDamageClass>() -= 0.05f;
break;
case ItemID.HuntressAltPants:
player.GetDamage<SummonDamageClass>() -= 0.05f;
player.GetCritChance<RangedDamageClass>() -= 5;
break;
case ItemID.ApprenticeAltHead:
player.GetDamage<MagicDamageClass>() -= 0.05f;
player.GetDamage<SummonDamageClass>() -= 0.05f;
break;
case ItemID.ApprenticeAltShirt:
player.GetDamage<SummonDamageClass>() -= 0.1f;
player.GetDamage<SummonDamageClass>() -= 0.05f;
break;
case ItemID.ApprenticeAltPants:
player.GetDamage<SummonDamageClass>() -= 0.1f;
player.GetCritChance<MagicDamageClass>() -= 25;
player.GetCritChance<MagicDamageClass>() -= 10;
break;
case ItemID.SolarFlareHelmet:
+1 -1
View File
@@ -4,7 +4,7 @@ using CalamityMod.Items.Accessories;
using CalamityMod.Items.Fishing;
using CalamityMod.Items.Materials;
using CalamityMod.Items.PermanentBoosters;
using CalamityMod.Items.Placeables.Furniture.DevPaintings;
using CalamityMod.Items.Placeables.Furniture.Paintings;
using CalamityMod.Items.Placeables.Ores;
using CalamityMod.Items.Potions;
using CalamityMod.Items.Weapons.Melee;
+309 -374
View File
@@ -564,7 +564,7 @@ namespace CalamityMod.Items
LocalizedText GetAddedTooltip(string key) => CalamityUtils.GetText($"Vanilla.AddedTooltip.{key}");
#endregion
// Exact life regen descriptions
// Applies to various item categories to clarify exact regen effects
#region Life Regen Clarity Tooltips
bool isCampfire = item.type == ItemID.Campfire || item.type == ItemID.CursedCampfire || item.type == ItemID.DemonCampfire || item.type == ItemID.FrozenCampfire || item.type == ItemID.IchorCampfire || item.type == ItemID.RainbowCampfire || item.type == ItemID.UltraBrightCampfire || item.type == ItemID.BoneCampfire || item.type == ItemID.DesertCampfire || item.type == ItemID.CoralCampfire || item.type == ItemID.CorruptCampfire || item.type == ItemID.CrimsonCampfire || item.type == ItemID.HallowedCampfire || item.type == ItemID.JungleCampfire || item.type == ItemID.MushroomCampfire || item.type == ItemID.ShimmerCampfire;
if (isCampfire)
@@ -594,97 +594,58 @@ namespace CalamityMod.Items
if (item.type == ItemID.HamBat)
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("HamBat"));
if (item.type == ItemID.AegisCrystal)
if (item.type == ItemID.AegisCrystal) // Vital Crystal
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("AegisCrystal"));
if (item.type == ItemID.SquireGreatHelm)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("SquireGreatHelm"));
if (item.type == ItemID.SquireAltShirt) // Valhalla Knight's Breastplate
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("SquireAltShirt"));
if (item.type == ItemID.SolarFlareHelmet || item.type == ItemID.SolarFlareBreastplate || item.type == ItemID.SolarFlareLeggings)
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("SolarFlarePieces"));
#endregion
// Numerous random tooltip edits which don't fit into another category
#region Various Tooltip Edits
// Applies to various item categories which carry their light/breath effects into the Abyss
#region Abyss Light/Breath
// +1 to Abyss light level
if (item.type == ItemID.CrimsonHeart || item.type == ItemID.ShadowOrb || item.type == ItemID.MagicLantern || item.type == ItemID.JellyfishNecklace ||
item.type == ItemID.MiningHelmet || item.type == ItemID.UltrabrightHelmet)
EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel1"));
if (item.type == ItemID.JellyfishDivingGear || item.type == ItemID.Magiluminescence)
EditTooltipByNum(1, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel1"));
// Apparently 612 is a homestuck reference
if (item.type == ModContent.ItemType<Respiteblock>())
EditTooltipByName("AxePower", (line) => line.Text = line.Text.Replace("610%", "612%"));
// +2 to Abyss light level
if (item.type == ItemID.ShinePotion)
EditTooltipByName("BuffTime", (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel2"));
if (item.type == ItemID.FairyBell || item.type == ItemID.DD2PetGhost)
EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel2"));
// Master Mode items also drop in Revengeance
// Only affects vanilla and Calamity items
if (item.master && (item.type < ItemID.Count || item.ModItem?.Mod is CalamityMod))
EditTooltipByName("Master", (line) => line.Text = EditedTooltip("MasterExclusive"));
// +3 to Abyss light level
if (item.type == ItemID.WispinaBottle || item.type == ItemID.PumpkingPetItem || item.type == ItemID.GolemPetItem || item.type == ItemID.FairyQueenPetItem)
EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel3"));
if (item.type == ItemID.SuspiciousLookingTentacle)
EditTooltipByNum(1, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel3"));
// Add a tooltip about Slimed's effects
if (item.type == ItemID.SlimeGun)
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("SlimeGun"));
// Replace the meme tooltip with a useful one.
if (item.type == ItemID.GelBalloon)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("GelBalloon"));
// Moderate breath boost
if (item.type == ItemID.DivingHelmet)
EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssBreathLevel2"));
if (item.type == ItemID.ArcticDivingGear)
EditTooltipByNum(1, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel1") + "\n" + CalamityUtils.GetTextValue("Common.AbyssBreathLevel2"));
// Flesh Knuckles giving extra max life.
if (item.type == ItemID.FleshKnuckles || item.type == ItemID.HeroShield || item.type == ItemID.BerserkerGlove)
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("FleshKnucklesLine"));
// Great breath boost
if (item.type == ItemID.GillsPotion)
EditTooltipByName("BuffTime", (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssBreathLevel3"));
// Rod of Discord cannot be used multiple times to hurt yourself
if (item.type == ItemID.RodofDiscord)
EditTooltipByNum(1, (line) => line.Text += AddedTooltip("RodofDiscord"));
// Indicate that the Ankh Shield provides sandstorm wind push immunity
if (item.type == ItemID.AnkhShield)
{
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("AnkhShield1"));
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("AnkhShield2"));
}
// If Early Hardmode Rework is enabled: Remind users that ores will NOT spawn when an altar is smashed.
if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && (item.type == ItemID.Pwnhammer || item.type == ItemID.Hammush))
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("Pwnhammer"));
// Nerfed Archery Potion tooltip
if (item.type == ItemID.ArcheryPotion)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ArcheryPotion"));
// Nerfed Swiftness Potion tooltip
if (item.type == ItemID.SwiftnessPotion)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%"));
// Hand Warmer has a side bonus with Snow armor
if (item.type == ItemID.HandWarmer)
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("HandWarmer"));
// Golden Fishing Rod inherently contains High Test Fishing Line
if (item.type == ItemID.GoldenFishingRod)
EditTooltipByName("NeedsBait", (line) => line.Text += AddedTooltip("GoldenFishingRod"));
// Information about graveyards
// There are no item sets for tombstones wtf
if (item.type == ItemID.Tombstone || item.type == ItemID.GraveMarker || item.type == ItemID.CrossGraveMarker || item.type == ItemID.Headstone || item.type == ItemID.Gravestone || item.type == ItemID.Obelisk
|| item.type == ItemID.RichGravestone1 || item.type == ItemID.RichGravestone2 || item.type == ItemID.RichGravestone3 || item.type == ItemID.RichGravestone4 || item.type == ItemID.RichGravestone5)
EditTooltipByName("Material", (line) => line.Text += AddedTooltip("Tombstones"));
// Modify item speed tooltips to use a new scale designed to more accurately reflect practical distributions of item speeds.
// Due to the higher complexity of the action, the actual logic is delegated to its own method.
// I think this fits the miscellaneous category? Not seeing anything like this elsewhere. - Tomat
EditTooltipByName("Speed", (line) => RedistributeSpeedTooltips(item, line));
if (item.healLife > 0 && Main.LocalPlayer.Calamity().healingPotionMultiplier != 1f)
EditTooltipByName("HealLife", (line) => line.Text = Language.GetOrRegister("CommonItemTooltip.RestoresLife").Format((int)(item.healLife * Main.LocalPlayer.Calamity().healingPotionMultiplier)));
// Ancient Manipulator also crafts stuff with Astral Bars
if (item.type == ItemID.LunarCraftingStation)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("LunarCraftingStation"));
// Reworked Gravity Globe
if (item.type == ItemID.GravityGlobe)
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("GravityGlobe"));
// "Buffed" Step Stool
if (item.type == ItemID.PortableStool)
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("PortableStool"));
// Replace the double tap line if double tap dash is overridden
if ((item.type == ItemID.EoCShield || item.type == ItemID.Tabi) && CalamityKeybinds.DashHotkey.GetAssignedKeysOrEmpty().Count != 0)
EditTooltipByNum(1, (line) => line.Text = CalamityUtils.GetText("Vanilla.DashKey").Format(CalamityKeybinds.DashHotkey.TooltipHotkeyString()));
if (item.type == ItemID.NeptunesShell || item.type == ItemID.MoonShell)
EditTooltipByNum(1, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssBreathLevel3"));
if (item.type == ItemID.CelestialShell)
EditTooltipByNum(4, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssBreathLevel3"));
#endregion
// For boss summon item clarity
#region Boss Summon Clarity Tooltips
// Spawn, despawn, and enrage conditions + Non-consumable line
#region Boss Summons
if (item.type == ItemID.Abeemination)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("Abeemination"));
@@ -723,17 +684,10 @@ namespace CalamityMod.Items
if (item.type == ItemID.WormFood)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("WormFood"));
#endregion
// Brain of Confusion, Black Belt and Master Ninja Gear have guaranteed dodges with a fixed cooldown.
#region Guaranteed Dodge Tooltips
if (item.type == ItemID.BlackBelt)
EditTooltipByNum(0, (line) => line.Text = CalamityUtils.GetText("Vanilla.DodgeInfo").Format(BalancingConstants.BeltDodgeCooldownMin / 60, BalancingConstants.BeltDodgeCooldownMax / 60));
if (item.type == ItemID.MasterNinjaGear)
EditTooltipByNum(1, (line) => line.Text = CalamityUtils.GetText("Vanilla.DodgeInfo").Format(BalancingConstants.BeltDodgeCooldownMin / 60, BalancingConstants.BeltDodgeCooldownMax / 60));
if (item.type == ItemID.BrainOfConfusion)
EditTooltipByNum(0, (line) => line.Text = CalamityUtils.GetText("Vanilla.DodgeInfo").Format(BalancingConstants.BrainDodgeCooldownMin / 60, BalancingConstants.BrainDodgeCooldownMax / 60));
if (item.type == ItemID.SlimeCrown || item.type == ItemID.SuspiciousLookingEye || item.type == ItemID.WormFood || item.type == ItemID.BloodySpine || item.type == ItemID.Abeemination || item.type == ItemID.DeerThing
|| item.type == ItemID.QueenSlimeCrystal || item.type == ItemID.MechanicalEye || item.type == ItemID.MechanicalWorm || item.type == ItemID.MechanicalSkull || item.type == ItemID.CelestialSigil)
EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.NotConsumable"));
#endregion
// Whip tag is dynamically generated for all whips based on the SummonTagDebuffDict, so we'll remove the vanilla tag tootlips.
@@ -761,109 +715,22 @@ namespace CalamityMod.Items
}
#endregion
// Other weapon changes
#region Other weapon changes
// Aerial Bane is no longer the real bane of aerial enemies (50% dmg bonus removed)
if (item.type == ItemID.DD2BetsyBow)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("DD2BetsyBow"));
// Death Sickle inflict Whispering Death
if (item.type == ItemID.DeathSickle)
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("DeathSickle"));
#endregion
// Light pets, accessories, and other items which boost the player's Abyss light stat
#region Abyss Light Tooltips
// +1 to Abyss light level
if (item.type == ItemID.CrimsonHeart || item.type == ItemID.ShadowOrb || item.type == ItemID.MagicLantern || item.type == ItemID.JellyfishNecklace ||
item.type == ItemID.MiningHelmet || item.type == ItemID.UltrabrightHelmet)
EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel1"));
if (item.type == ItemID.JellyfishDivingGear || item.type == ItemID.Magiluminescence)
EditTooltipByNum(1, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel1"));
// +2 to Abyss light level
if (item.type == ItemID.ShinePotion)
EditTooltipByName("BuffTime", (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel2"));
if (item.type == ItemID.FairyBell || item.type == ItemID.DD2PetGhost)
EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel2"));
// +3 to Abyss light level
if (item.type == ItemID.WispinaBottle || item.type == ItemID.PumpkingPetItem || item.type == ItemID.GolemPetItem || item.type == ItemID.FairyQueenPetItem)
EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel3"));
if (item.type == ItemID.SuspiciousLookingTentacle)
EditTooltipByNum(1, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel3"));
#endregion
// Accessories and other items which boost the player's ability to breathe in the Abyss
#region Abyss Breath Tooltips
// Moderate breath boost
if (item.type == ItemID.DivingHelmet)
EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssBreathLevel2"));
if (item.type == ItemID.ArcticDivingGear)
EditTooltipByNum(1, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel1") + "\n" + CalamityUtils.GetTextValue("Common.AbyssBreathLevel2"));
// Great breath boost
if (item.type == ItemID.GillsPotion)
EditTooltipByName("BuffTime", (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssBreathLevel3"));
if (item.type == ItemID.NeptunesShell || item.type == ItemID.MoonShell)
EditTooltipByNum(1, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssBreathLevel3"));
if (item.type == ItemID.CelestialShell)
EditTooltipByNum(4, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssBreathLevel3"));
#endregion
// Flasks apply to Rogue weapons
#region Rogue Flask Tooltips
if (item.type == ItemID.FlaskofCursedFlames)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofCursedFlames"));
if (item.type == ItemID.FlaskofFire)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofFire"));
if (item.type == ItemID.FlaskofGold)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofGold"));
if (item.type == ItemID.FlaskofIchor)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofIchor"));
if (item.type == ItemID.FlaskofNanites)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofNanites"));
// party flask is unique because it affects ALL projectiles in Calamity, not just "also rogue ones"
if (item.type == ItemID.FlaskofParty)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofParty"));
if (item.type == ItemID.FlaskofPoison)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofPoison"));
if (item.type == ItemID.FlaskofVenom)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofVenom"));
#endregion
// Rebalances to vanilla item stats
#region Vanilla Item Rebalance Tooltips
// Various mining speed nerfs
if (item.type == ItemID.MiningPotion)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%"));
#region Accessories
// Brain of Confusion, Black Belt and Master Ninja Gear have guaranteed dodges with a fixed cooldown.
if (item.type == ItemID.BlackBelt)
EditTooltipByNum(0, (line) => line.Text = CalamityUtils.GetText("Vanilla.DodgeInfo").Format(BalancingConstants.BeltDodgeCooldownMin / 60, BalancingConstants.BeltDodgeCooldownMax / 60));
if (item.type == ItemID.MasterNinjaGear)
EditTooltipByNum(1, (line) => line.Text = CalamityUtils.GetText("Vanilla.DodgeInfo").Format(BalancingConstants.BeltDodgeCooldownMin / 60, BalancingConstants.BeltDodgeCooldownMax / 60));
if (item.type == ItemID.BrainOfConfusion)
EditTooltipByNum(0, (line) => line.Text = CalamityUtils.GetText("Vanilla.DodgeInfo").Format(BalancingConstants.BrainDodgeCooldownMin / 60, BalancingConstants.BrainDodgeCooldownMax / 60));
// Nerfed Ancient Chisel and its upgrade.
if (item.type == ItemID.AncientChisel)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%"));
if (item.type == ItemID.HandOfCreation)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%"));
// Ale and Sake rebalance and Alcohol Poisoning.
if (item.type == ItemID.Ale || item.type == ItemID.Sake)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("AleSake"));
// Flame Waker Boots buff.
if (item.type == ItemID.FlameWakerBoots)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlameWakerBoots"));
// Hellfire Treads buff.
if (item.type == ItemID.HellfireTreads)
EditTooltipByNum(2, (line) => line.Text += AddedTooltip("HellfireTreads"));
// Fairy Boots buff.
if (item.type == ItemID.FairyBoots)
EditTooltipByNum(2, (line) => line.Text += AddedTooltip("FairyBoots"));
// Melee speed removal.
// Melee speed removed from the Celestial Stone line.
if (item.type == ItemID.MoonStone)
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("SunMoonStones"));
if (item.type == ItemID.SunStone)
@@ -873,51 +740,46 @@ namespace CalamityMod.Items
if (item.type == ItemID.CelestialShell)
EditTooltipByNum(2, (line) => line.Text = EditedTooltip("CelestialStoneShell"));
// Mana Flower tinker buffs.
if (item.type == ItemID.MagnetFlower)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MagnetFlower"));
if (item.type == ItemID.ArcaneFlower || item.type == ItemID.ManaCloak)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ArcaneFlowerManaCloak"));
if (item.type == ItemID.ArcaneFlower)
EditTooltipByNum(2, (line) => line.Text += AddedTooltip("ArcaneFlower"));
// Magiluminescence nerf and clear explanation of what it actually does.
if (item.type == ItemID.Magiluminescence)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("Magiluminescence"));
// Frog Leg and all upgrades get clear explanations of what they actually do.
if (item.type == ItemID.FrogLeg)
EditTooltipByNum(0, (line) => line.Text = GetEditedTooltip("FrogLeg").Format(BalancingConstants.VanillaFrogLegJumpSpeedBoost.ToJumpSpeedPercent()));
if (item.type == ItemID.FrogFlipper || item.type == ItemID.FrogWebbing)
EditTooltipByNum(1, (line) => line.Text = GetEditedTooltip("FrogLeg").Format(BalancingConstants.VanillaFrogLegJumpSpeedBoost.ToJumpSpeedPercent()));
if (item.type == ItemID.FrogGear)
EditTooltipByNum(2, (line) => line.Text = GetEditedTooltip("FrogLeg").Format(BalancingConstants.VanillaFrogLegJumpSpeedBoost.ToJumpSpeedPercent()));
if (item.type == ItemID.AmphibianBoots)
EditTooltipByNum(1, (line) => line.Text = GetEditedTooltip("FrogLeg").Format(BalancingConstants.AmphibianBootsJumpSpeedBoost.ToJumpSpeedPercent()));
// Soaring Insignia nerf and clear explanation of what it actually does.
if (item.type == ItemID.EmpressFlightBooster)
// Feral Claws line melee speed and true melee damage changes
if (item.type == ItemID.FeralClaws)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("12%", "10%"));
if (item.type == ItemID.TitanGlove)
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("TitanGloveLine"));
if (item.type == ItemID.PowerGlove)
{
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("EmpressFlightBooster1"));
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("EmpressFlightBooster2"));
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("PowerGlove"));
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("TitanGloveLine"));
}
if (item.type == ItemID.BerserkerGlove)
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("BerserkerGlove"));
if (item.type == ItemID.MechanicalGlove)
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("MechanicalGlove") + AddedTooltip("TitanGloveLine"));
if (item.type == ItemID.FireGauntlet)
{
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FireGauntlet1"));
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("FireGauntlet2") + AddedTooltip("TitanGloveLine"));
}
// Yoyo Glove/Bag apply a 0.5x damage multiplier on the second yoyo
if (item.type == ItemID.YoyoBag || item.type == ItemID.YoYoGlove)
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("YoyoGlove"));
// Molten Quiver sets Hellfire on all arrows.
if (item.type == ItemID.MoltenQuiver)
EditTooltipByNum(2, (line) => line.Text = EditedTooltip("MoltenQuiver"));
// Eye of the Golem gains a new effect, also applies to specifically Sniper Scope.
if (item.type == ItemID.EyeoftheGolem)
{
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("EyeoftheGolem"));
}
// Rifle Scope visibility change
// Scope effects can now be visibility toggled.
if (item.type == ItemID.RifleScope)
{
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("RifleScope1"));
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("RifleScope2"));
}
// Sniper Scope rebalance and visibility change
if (item.type == ItemID.ReconScope)
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("RifleScope"));
if (item.type == ItemID.SniperScope)
{
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("SniperScope"));
@@ -925,21 +787,90 @@ namespace CalamityMod.Items
EditTooltipByNum(1, (line) => line.Text += AddedTooltip("EyeoftheGolem"));
}
// Recon Scope visibility change
if (item.type == ItemID.ReconScope)
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("RifleScope"));
// Mana Flower tinker buffs.
if (item.type == ItemID.MagnetFlower)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("8%", "10%"));
if (item.type == ItemID.ArcaneFlower || item.type == ItemID.ManaCloak)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("8%", "12%"));
if (item.type == ItemID.ArcaneFlower)
EditTooltipByNum(2, (line) => line.Text += AddedTooltip("ArcaneFlower"));
// Molten Quiver
if (item.type == ItemID.MoltenQuiver)
EditTooltipByNum(2, (line) => line.Text = EditedTooltip("MoltenQuiver"));
// Magiluminescence nerf and clarify the movement effects given.
if (item.type == ItemID.Magiluminescence)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("Magiluminescence"));
// Magic Power Potion nerf
if (item.type == ItemID.MagicPowerPotion)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("20%", "10%"));
// Frog Leg and its upgrades clarify the amount of jump speed given.
if (item.type == ItemID.FrogLeg)
EditTooltipByNum(0, (line) => line.Text = GetEditedTooltip("FrogLeg").Format(BalancingConstants.VanillaFrogLegJumpSpeedBoost.ToJumpSpeedPercent()));
if (item.type == ItemID.FrogFlipper || item.type == ItemID.FrogWebbing)
EditTooltipByNum(1, (line) => line.Text = GetEditedTooltip("FrogLeg").Format(BalancingConstants.VanillaFrogLegJumpSpeedBoost.ToJumpSpeedPercent()));
if (item.type == ItemID.FrogGear)
EditTooltipByNum(2, (line) => line.Text = GetEditedTooltip("FrogLeg").Format(BalancingConstants.VanillaFrogLegJumpSpeedBoost.ToJumpSpeedPercent()));
if (item.type == ItemID.AmphibianBoots)
EditTooltipByNum(1, (line) => line.Text = GetEditedTooltip("FrogLeg").Format(BalancingConstants.AmphibianBootsJumpSpeedBoost.ToJumpSpeedPercent()));
// Featherfall Potion being stupid broken with Aero Stone
if (item.type == ItemID.FeatherfallPotion)
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("FeatherfallPotion"));
// Soaring Insignia nerf and clarify the movement effects given.
if (item.type == ItemID.EmpressFlightBooster)
{
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("EmpressFlightBooster1"));
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("EmpressFlightBooster2"));
}
// Reworked Gravity Globe
if (item.type == ItemID.GravityGlobe)
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("GravityGlobe"));
// Flame Waker Boots now has a functional effect which inherits to Hellfire Treads.
if (item.type == ItemID.FlameWakerBoots)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlameWakerBoots"));
if (item.type == ItemID.HellfireTreads)
EditTooltipByNum(2, (line) => line.Text += AddedTooltip("HellfireTreads"));
// Fairy Boots gains a new functional effect.
if (item.type == ItemID.FairyBoots)
EditTooltipByNum(2, (line) => line.Text += AddedTooltip("FairyBoots"));
// Ankh Shield now provides sandstorm wind push immunity.
if (item.type == ItemID.AnkhShield)
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("AnkhShield"));
// Flesh Knuckles now gives increased max life.
if (item.type == ItemID.FleshKnuckles || item.type == ItemID.HeroShield || item.type == ItemID.BerserkerGlove)
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("FleshKnucklesLine"));
// Hand Warmer now has a side bonus with Snow armor.
if (item.type == ItemID.HandWarmer)
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("HandWarmer"));
#endregion
#region Pre-Hardmode Armor
// Gladiator
if (item.type == ItemID.GladiatorHelmet)
EditTooltipByName("Defense", (line) => line.Text += "\n" + CalamityUtils.GetText("Common.RogueDamage").Format(GladiatorArmorSetChange.HelmetRogueDamageBoostPercent));
if (item.type == ItemID.GladiatorBreastplate)
EditTooltipByName("Defense", (line) => line.Text += "\n" + CalamityUtils.GetText("Common.RogueCrit").Format(GladiatorArmorSetChange.ChestplateRogueCritBoostPercent));
if (item.type == ItemID.GladiatorLeggings)
EditTooltipByName("Defense", (line) => line.Text += "\n" + CalamityUtils.GetText("Common.RogueVelocity").Format(GladiatorArmorSetChange.LeggingRogueVelocityBoostPercent));
// Jungle
if (item.type == ItemID.JungleHat || item.type == ItemID.AncientCobaltHelmet)
{
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("40", "20"));
EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("6%", "3%"));
}
if (item.type == ItemID.JunglePants || item.type == ItemID.AncientCobaltLeggings)
EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("6%", "3%"));
// Crimson
if (item.type == ItemID.CrimsonHelmet || item.type == ItemID.CrimsonScalemail || item.type == ItemID.CrimsonGreaves)
{
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("3%", "6%"));
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("CrimsonArmorPieces"));
}
// Meteor
if (item.type == ItemID.MeteorHelmet || item.type == ItemID.MeteorSuit || item.type == ItemID.MeteorLeggings)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("9%", "8%"));
// Magic Hat nerf
if (item.type == ItemID.MagicHat)
@@ -968,77 +899,11 @@ namespace CalamityMod.Items
EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("15%", "9%"));
}
// Feral Claws line melee speed and true melee damage changes
if (item.type == ItemID.FeralClaws)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("12%", "10%"));
if (item.type == ItemID.TitanGlove)
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("TitanGloveLine"));
if (item.type == ItemID.PowerGlove)
{
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("PowerGlove"));
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("TitanGloveLine"));
}
if (item.type == ItemID.BerserkerGlove)
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("BerserkerGlove"));
if (item.type == ItemID.MechanicalGlove)
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("MechanicalGlove") + AddedTooltip("TitanGloveLine"));
if (item.type == ItemID.FireGauntlet)
{
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FireGauntlet1"));
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("FireGauntlet2") + AddedTooltip("TitanGloveLine"));
}
// Yoyo Glove/Bag apply a 0.5x damage multiplier on the second yoyo
if (item.type == ItemID.YoyoBag || item.type == ItemID.YoYoGlove)
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("YoyoGlove"));
//Gi 10% melee speed into 10% jump speed replacement
if (item.type == ItemID.Gi)
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("Gi"));
#endregion
// Pre-Hardmode armor tooltip edits
#region Pre-Hardmode Armor
// Gladiator
if (item.type == ItemID.GladiatorHelmet)
EditTooltipByName("Defense", (line) => line.Text += "\n" + CalamityUtils.GetText("Common.RogueDamage").Format(GladiatorArmorSetChange.HelmetRogueDamageBoostPercent));
if (item.type == ItemID.GladiatorBreastplate)
EditTooltipByName("Defense", (line) => line.Text += "\n" + CalamityUtils.GetText("Common.RogueCrit").Format(GladiatorArmorSetChange.ChestplateRogueCritBoostPercent));
if (item.type == ItemID.GladiatorLeggings)
EditTooltipByName("Defense", (line) => line.Text += "\n" + CalamityUtils.GetText("Common.RogueVelocity").Format(GladiatorArmorSetChange.LeggingRogueVelocityBoostPercent));
// Jungle
if (item.type == ItemID.JungleHat || item.type == ItemID.AncientCobaltHelmet)
{
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("40", "20"));
EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("6%", "3%"));
}
if (item.type == ItemID.JunglePants || item.type == ItemID.AncientCobaltLeggings)
EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("6%", "3%"));
// Crimson
if (item.type == ItemID.CrimsonHelmet || item.type == ItemID.CrimsonScalemail || item.type == ItemID.CrimsonGreaves)
{
EditTooltipByNum(0, (line) =>
{
string newTooltip = line.Text.Replace("3%", "6%");
// Chest piece has 2 regen instead of 1
newTooltip += item.type == ItemID.CrimsonScalemail ? AddedTooltip("CrimsonBreastplate") : AddedTooltip("CrimsonOtherPieces");
line.Text = newTooltip;
});
}
// Meteor
if (item.type == ItemID.MeteorHelmet || item.type == ItemID.MeteorSuit || item.type == ItemID.MeteorLeggings)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("9%", "8%"));
#endregion
// Hardmode armor tooltip edits
#region Hardmode Armor
// Cobalt
if (item.type == ItemID.CobaltHat)
@@ -1073,8 +938,6 @@ namespace CalamityMod.Items
// Solar Flare
if (item.type == ItemID.SolarFlareHelmet)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("26%", "20%"));
if (item.type == ItemID.SolarFlareHelmet || item.type == ItemID.SolarFlareBreastplate || item.type == ItemID.SolarFlareLeggings)
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("SolarFlarePieces"));
// Vortex
if (item.type == ItemID.VortexHelmet)
@@ -1084,35 +947,16 @@ namespace CalamityMod.Items
}
#endregion
// DD2 armor tooltip edits
#region DD2 Armor
// Reduce DD2 armor piece bonuses because they're overpowered, and clarify life regen boosts
// Squire armor
if (item.type == ItemID.SquireGreatHelm)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("SquireGreatHelm"));
if (item.type == ItemID.SquirePlating)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("SquirePlating"));
// Nerf sets that are too strong
if (item.type == ItemID.SquireGreaves)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("SquireGreaves"));
// Monk armor
if (item.type == ItemID.MonkBrows)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MonkBrows"));
if (item.type == ItemID.MonkShirt)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MonkShirt"));
if (item.type == ItemID.MonkPants)
{
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MonkPants1"));
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("MonkPants2"));
}
// Huntress armor
if (item.type == ItemID.HuntressWig)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("10%", "15%"));
if (item.type == ItemID.HuntressJerkin)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("HuntressJerkin"));
if (item.type == ItemID.HuntressPants)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("HuntressPants"));
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("20%", "15%"));
// Apprentice armor
if (item.type == ItemID.ApprenticeHat)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ApprenticeHat"));
if (item.type == ItemID.ApprenticeRobe)
@@ -1120,13 +964,33 @@ namespace CalamityMod.Items
if (item.type == ItemID.ApprenticeTrousers)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ApprenticeTrousers"));
// Valhalla Knight armor
if (item.type == ItemID.SquireAltHead)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("SquireAltHead"));
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("10%", "15%"));
if (item.type == ItemID.SquireAltShirt)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("SquireAltShirt"));
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("30%", "20%"));
if (item.type == ItemID.SquireAltPants)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("SquireAltPants"));
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("20%", "15%"));
if (item.type == ItemID.HuntressAltShirt)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "20%"));
if (item.type == ItemID.HuntressAltPants)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "20%"));
if (item.type == ItemID.ApprenticeAltHead)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("15%", "10%"));
if (item.type == ItemID.ApprenticeAltShirt)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "20%"));
if (item.type == ItemID.ApprenticeAltPants)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%"));
// Tweaks into Rogue
// Monk armor
if (item.type == ItemID.MonkBrows)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MonkBrows"));
if (item.type == ItemID.MonkShirt)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MonkShirt"));
if (item.type == ItemID.MonkPants)
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("MonkPants"));
// Shinobi Infiltrator armor
if (item.type == ItemID.MonkAltHead)
@@ -1138,47 +1002,9 @@ namespace CalamityMod.Items
}
if (item.type == ItemID.MonkAltPants)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MonkAltPants"));
// Red Riding armor
if (item.type == ItemID.HuntressAltShirt)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("HuntressAltShirt"));
if (item.type == ItemID.HuntressAltPants)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("HuntressAltPants"));
// Dark Artist armor
if (item.type == ItemID.ApprenticeAltHead)
EditTooltipByNum(1, (line) => line.Text = EditedTooltip("ApprenticeAltHead"));
if (item.type == ItemID.ApprenticeAltShirt)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ApprenticeAltShirt"));
if (item.type == ItemID.ApprenticeAltPants)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ApprenticeAltPants"));
#endregion
// Non-consumable boss summon items
#region Vanilla Boss Summon Non-consumable Tooltips
if (item.type == ItemID.SlimeCrown || item.type == ItemID.SuspiciousLookingEye || item.type == ItemID.WormFood || item.type == ItemID.BloodySpine || item.type == ItemID.Abeemination || item.type == ItemID.DeerThing
|| item.type == ItemID.QueenSlimeCrystal || item.type == ItemID.MechanicalEye || item.type == ItemID.MechanicalWorm || item.type == ItemID.MechanicalSkull || item.type == ItemID.CelestialSigil)
EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.NotConsumable"));
#endregion
// Add mentions of what Calamity ores vanilla pickaxes can mine
#region Pickaxe New Ore Tooltips
if (item.type == ItemID.GoldPickaxe || item.type == ItemID.PlatinumPickaxe)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("GoldPickaxe"));
if (item.type == ItemID.Picksaw)
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("Picksaw"));
if (item.type == ItemID.SolarFlarePickaxe || item.type == ItemID.VortexPickaxe || item.type == ItemID.NebulaPickaxe || item.type == ItemID.StardustPickaxe)
EditTooltipByName("Material", (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.CanMineUelibloom"));
if (item.type == ItemID.SolarFlareDrill || item.type == ItemID.VortexDrill || item.type == ItemID.NebulaDrill || item.type == ItemID.StardustDrill)
EditTooltipByName("TileBoost", (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.CanMineUelibloom"));
#endregion
// Rebalances and information about vanilla set bonuses
#region Vanilla Set Bonus Tooltips
EditTooltipByName("SetBonus", (line) => VanillaArmorChangeManager.ApplySetBonusTooltipChanges(item, ref line.Text));
// Forbidden (UNLESS you are wearing the Circlet, which is Summon/Rogue and does not get this line)
@@ -1191,7 +1017,50 @@ namespace CalamityMod.Items
EditTooltipByName("SetBonus", (line) => line.Text = CalamityUtils.GetText($"Vanilla.Armor.SetBonus.Vortex").Format(CalamityUtils.GetArmorSetBonusKey()));
#endregion
// Provide the full stats of every vanilla yoyo
#region Potions
// Nerfed Archery Potion
if (item.type == ItemID.ArcheryPotion)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ArcheryPotion"));
// Nerfed Swiftness Potion
if (item.type == ItemID.SwiftnessPotion)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%"));
// Nerfed Magic Power Potion
if (item.type == ItemID.MagicPowerPotion)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("20%", "10%"));
// Nerfed Mining Potion
if (item.type == ItemID.MiningPotion)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%"));
// Ale and Sake rebalance and Alcohol Poisoning.
if (item.type == ItemID.Ale || item.type == ItemID.Sake)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("AleSake"));
// Featherfall Potion being stupid broken with Aero Stone
if (item.type == ItemID.FeatherfallPotion)
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("FeatherfallPotion"));
// Flasks apply to Rogue weapons (Party applies to all)
if (item.type == ItemID.FlaskofCursedFlames)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofCursedFlames"));
if (item.type == ItemID.FlaskofFire)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofFire"));
if (item.type == ItemID.FlaskofGold)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofGold"));
if (item.type == ItemID.FlaskofIchor)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofIchor"));
if (item.type == ItemID.FlaskofNanites)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofNanites"));
if (item.type == ItemID.FlaskofParty)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofParty"));
if (item.type == ItemID.FlaskofPoison)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofPoison"));
if (item.type == ItemID.FlaskofVenom)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofVenom"));
#endregion
#region Yoyo Stat Tooltips
// This function is shorthand for appending a stat sheet to a yoyo.
void AddYoyoStats(float d, float r, float s)
@@ -1244,7 +1113,6 @@ namespace CalamityMod.Items
AddYoyoStats(-1f, 400f, 36f);
#endregion
// Provide the full stats of every vanilla set of wings
#region Wing Stat Tooltips
// This function produces a "stat sheet" for a pair of wings from the raw stats.
@@ -1390,7 +1258,6 @@ namespace CalamityMod.Items
AddWingStats(item.wingSlot, 0.95f, 0.15f, 1f, 4.5f, 0.1f);
#endregion
// Provide the full stats of every vanilla grappling hook
#region Grappling Hook Stat Tooltips
// This function is shorthand for appending a stat sheet to a grappling hook.
@@ -1507,9 +1374,77 @@ namespace CalamityMod.Items
#endregion
// Beyond this point all code only applies to accessories. Skip it all if the item is not an accessory.
if (!item.accessory)
return;
// Add mentions of what Calamity ores vanilla pickaxes can mine
#region Pickaxe New Ore Tooltips
if (item.type == ItemID.GoldPickaxe || item.type == ItemID.PlatinumPickaxe)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("GoldPickaxe"));
if (item.type == ItemID.Picksaw)
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("Picksaw"));
if (item.type == ItemID.SolarFlarePickaxe || item.type == ItemID.VortexPickaxe || item.type == ItemID.NebulaPickaxe || item.type == ItemID.StardustPickaxe)
EditTooltipByName("Material", (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.CanMineUelibloom"));
if (item.type == ItemID.SolarFlareDrill || item.type == ItemID.VortexDrill || item.type == ItemID.NebulaDrill || item.type == ItemID.StardustDrill)
EditTooltipByName("TileBoost", (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.CanMineUelibloom"));
#endregion
// Numerous random tooltip edits which don't fit into another category
#region Miscellaneous Tooltip Edits
// Apparently 612 is a homestuck reference
if (item.type == ModContent.ItemType<Respiteblock>())
EditTooltipByName("AxePower", (line) => line.Text = line.Text.Replace("610%", "612%"));
// Master Mode items also drop in Revengeance
// Only affects vanilla and Calamity items
if (item.master && (item.type < ItemID.Count || item.ModItem?.Mod is CalamityMod))
EditTooltipByName("Master", (line) => line.Text = EditedTooltip("MasterExclusive"));
// Add a tooltip about Slimed's effects
if (item.type == ItemID.SlimeGun)
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("SlimeGun"));
// Replace the meme tooltip with a useful one.
if (item.type == ItemID.GelBalloon)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("GelBalloon"));
// Aerial Bane is no longer the real bane of aerial enemies (50% dmg bonus removed)
if (item.type == ItemID.DD2BetsyBow)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("DD2BetsyBow"));
// Rod of Discord cannot be used multiple times to hurt yourself
if (item.type == ItemID.RodofDiscord)
EditTooltipByNum(1, (line) => line.Text += AddedTooltip("RodofDiscord"));
// If Early Hardmode Rework is enabled: Remind users that ores will NOT spawn when an altar is smashed.
if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && (item.type == ItemID.Pwnhammer || item.type == ItemID.Hammush))
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("Pwnhammer"));
// Golden Fishing Rod inherently contains High Test Fishing Line
if (item.type == ItemID.GoldenFishingRod)
EditTooltipByName("NeedsBait", (line) => line.Text += AddedTooltip("GoldenFishingRod"));
// Information about graveyards
// There are no item sets for tombstones wtf
if (item.type == ItemID.Tombstone || item.type == ItemID.GraveMarker || item.type == ItemID.CrossGraveMarker || item.type == ItemID.Headstone || item.type == ItemID.Gravestone || item.type == ItemID.Obelisk
|| item.type == ItemID.RichGravestone1 || item.type == ItemID.RichGravestone2 || item.type == ItemID.RichGravestone3 || item.type == ItemID.RichGravestone4 || item.type == ItemID.RichGravestone5)
EditTooltipByName("Material", (line) => line.Text += AddedTooltip("Tombstones"));
// Modify item speed tooltips to use a new scale designed to more accurately reflect practical distributions of item speeds.
// Due to the higher complexity of the action, the actual logic is delegated to its own method.
// I think this fits the miscellaneous category? Not seeing anything like this elsewhere. - Tomat
EditTooltipByName("Speed", (line) => RedistributeSpeedTooltips(item, line));
if (item.healLife > 0 && Main.LocalPlayer.Calamity().healingPotionMultiplier != 1f)
EditTooltipByName("HealLife", (line) => line.Text = Language.GetOrRegister("CommonItemTooltip.RestoresLife").Format((int)(item.healLife * Main.LocalPlayer.Calamity().healingPotionMultiplier)));
// Ancient Manipulator also crafts stuff with Astral Bars
if (item.type == ItemID.LunarCraftingStation)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("LunarCraftingStation"));
// Replace the double tap line if double tap dash is overridden
if ((item.type == ItemID.EoCShield || item.type == ItemID.Tabi) && CalamityKeybinds.DashHotkey.GetAssignedKeysOrEmpty().Count != 0)
EditTooltipByNum(1, (line) => line.Text = CalamityUtils.GetText("Vanilla.DashKey").Format(CalamityKeybinds.DashHotkey.TooltipHotkeyString()));
#endregion
}
#endregion
Loaded 100 of 418 files, more files were not shown because too many files have changed in this diff. Show more