This commit is contained in:
doze-zoze committed 2025-11-14 17:23:55 -06:00
commit d3393fdf3b
306 files changed
+2992 -2798

No files matched your search

-2
View File
@@ -7,8 +7,6 @@ namespace CalamityMod.Buffs.Alcohol
{
public class Trippy : ModBuff
{
public override LocalizedText Description => base.Description.WithFormatArgs(OddMushroom.DamageBoost.ToPercent());
public override void SetStaticDefaults()
{
Main.debuff[Type] = false;
@@ -1,27 +0,0 @@
using CalamityMod.Items.Accessories;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.StatBuffs
{
public class AbyssalDivingSuitPlates : ModBuff
{
public override void SetStaticDefaults()
{
Main.buffNoTimeDisplay[Type] = true;
Main.debuff[Type] = false;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
}
public override void ModifyBuffText(ref string buffName, ref string tip, ref int rare)
{
tip = base.Description.Format((AbyssalDivingSuit.PlatesAllDamageReduction - Main.LocalPlayer.Calamity().abyssalDivingSuitPlateHits * AbyssalDivingSuit.PlatesHitDecay).ToPercent());
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().abyssalDivingSuitPlates = true;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 B

+1 -1
View File
@@ -15,7 +15,7 @@ namespace CalamityMod.Buffs.StatBuffs
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().trinketOfChiBuff = true;
player.endurance += 0.08f;
}
}
}
+1 -1
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.Buffs.StatBuffs
{
public class Encased : ModBuff
{
public override LocalizedText Description => base.Description.WithFormatArgs(PermafrostsConcoction.EncasedDefenseBoost, PermafrostsConcoction.EncasedAllDamageReduction.ToPercent());
public override LocalizedText Description => base.Description.WithFormatArgs(PermafrostsConcoction.EncasedDefenseBoost, PermafrostsConcoction.EncasedDamageReductionBoost.ToPercent());
public override void SetStaticDefaults()
{
+1 -1
View File
@@ -7,7 +7,7 @@ namespace CalamityMod.Buffs.StatBuffs
{
public class IceShieldBuff : ModBuff
{
public override LocalizedText Description => base.Description.WithFormatArgs(AquaticHeart.IceShieldAllDamageReduction.ToPercent());
public override LocalizedText Description => base.Description.WithFormatArgs(AquaticHeart.IceShieldDamageReductionBoost.ToPercent());
public override void SetStaticDefaults()
{
+6 -42
View File
@@ -114,8 +114,6 @@ namespace CalamityMod.CalPlayer
public int garandShots = 0;
public int searedPanCounter = 0;
public int searedPanTimer = 0;
/// <summary> Used to get around the hardcoded Potion Sickness duration to allow Hadal Stew's reduced duration. </summary>
public int potionTimer = 0;
/// <summary> If set to true, prevents all player dashes. Used by Ball and Chain, and Stygian Shield. </summary>
public bool blockAllDashes = false;
/// <summary> Used by Flamsteed Ring to reset the player's hitbox size after dismounting. </summary>
@@ -827,8 +825,6 @@ namespace CalamityMod.CalPlayer
public bool nuclearFuelRod = false;
public bool nebulousCore = false;
public bool deepDiver = false;
public bool abyssalDivingSuitPlates = false;
public int abyssalDivingSuitPlateHits = 0;
public bool aquaticHeartWaterBuff = false;
public bool aquaticHeartIce = false;
public bool ilSpark = false;
@@ -885,9 +881,9 @@ namespace CalamityMod.CalPlayer
public bool sGlyph = false;
public bool sRegen = false;
public bool tracersDust = false;
public bool tracersCelestial = false;
public bool tracersElysian = false;
public bool tracersSeraph = false;
public bool moonWalkers = false;
public bool voidStriders = false;
public bool seraphTracers = false;
public bool frostFlare = false;
public bool evolution = false;
public int evolutionLifeRegenCounter = 0;
@@ -1333,7 +1329,6 @@ namespace CalamityMod.CalPlayer
#endregion
#region Buff
public bool trinketOfChiBuff = false;
public bool sandsWindBuff = false;
public bool aeolianEarthBuff = false;
public int chiBuffTimer = 0;
@@ -1405,11 +1400,6 @@ namespace CalamityMod.CalPlayer
public bool yellowCandle = false;
/// <summary> If true, the player has consumed Odd Mushroom. Controls drawing its rainbow fake clones of NPCs and projectiles. </summary>
public bool trippy = false;
/// <summary>
/// Used to control the number and position of Odd Mushroom's fake clones. There are three levels of severity.<br/>
/// The first draws 4 clones in diagonals. The second draws 12 clones, 4 on diagonals and the other 8 surrounding them. The third draws 16 clones, arranged entirely around the player.
/// </summary>
public int trippyLevel = 1;
public bool amidiasBlessing = false;
public bool bloodfinBoost = false;
public int bloodfinTimer = 30;
@@ -2132,8 +2122,6 @@ namespace CalamityMod.CalPlayer
miniOldDuke = false;
miniOldDukeVanity = false;
abyssalDivingSuitPlates = false;
aquaticHeartWaterBuff = false;
aquaticHeartIce = false;
@@ -2325,9 +2313,9 @@ namespace CalamityMod.CalPlayer
hallowedRegen = false;
hallowedPower = false;
tracersDust = false;
tracersCelestial = false;
tracersElysian = false;
tracersSeraph = false;
moonWalkers = false;
voidStriders = false;
seraphTracers = false;
ursaSergeant = false;
ursaSergeantVisual = false;
scuttlersJewel = false;
@@ -2537,7 +2525,6 @@ namespace CalamityMod.CalPlayer
WaterDebuffMultiplier = new();
ElectricDebuffMultiplier = new();
trinketOfChiBuff = false;
sandsWindBuff = false;
aeolianEarthBuff = false;
corrEffigy = false;
@@ -2986,7 +2973,6 @@ namespace CalamityMod.CalPlayer
clamity = false;
NOU = false;
snowmanNoseless = false;
abyssalDivingSuitPlateHits = 0;
sulphurPoison = false;
nightwither = false;
voidfrost = false;
@@ -3035,10 +3021,8 @@ namespace CalamityMod.CalPlayer
rimehound = false;
crysthamyr = false;
ExoChair = false;
abyssalDivingSuitPlates = false;
aquaticHeartWaterBuff = false;
aquaticHeartIce = false;
trinketOfChiBuff = false;
sandsWindBuff = false;
aeolianEarthBuff = false;
chiBuffTimer = 0;
@@ -3107,7 +3091,6 @@ namespace CalamityMod.CalPlayer
pinkCandleHealFraction = 0D;
yellowCandle = false;
trippy = false;
trippyLevel = 1;
amidiasBlessing = false;
bloodfinBoost = false;
bloodfinTimer = 0;
@@ -3268,7 +3251,6 @@ namespace CalamityMod.CalPlayer
garandShots = 0;
searedPanCounter = 0;
searedPanTimer = 0;
potionTimer = 0;
persecutedEnchantSummonTimer = 0;
momentumCapacitorTime = 0;
momentumCapacitorBoost = 0f;
@@ -4184,25 +4166,7 @@ namespace CalamityMod.CalPlayer
}
if (abyssalDivingSuit)
{
Player.AddBuff(BuffType<AbyssalDivingSuitBuff>(), 60, true);
if (Player.whoAmI == Main.myPlayer && !Player.HasCooldown(DivingPlatesBroken.ID))
Player.AddBuff(BuffType<AbyssalDivingSuitPlates>(), 2);
if (Player.whoAmI == Main.myPlayer && Player.active && abyssalDivingSuitPlateHits < 3)
{
if (!Player.HasCooldown(DivingPlatesBreaking.ID))
{
CooldownInstance plates = Player.AddCooldown(DivingPlatesBreaking.ID, 3);
plates.timeLeft = abyssalDivingSuitPlateHits;
}
else
{
CooldownInstance plates = cooldowns[DivingPlatesBreaking.ID];
plates.timeLeft = abyssalDivingSuitPlateHits;
}
}
}
if (aquaticHeart)
Player.AddBuff(BuffType<AquaticHeartBuff>(), 60, true);
+7 -7
View File
@@ -1,6 +1,5 @@
using System;
using CalamityMod.Balancing;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.CalPlayer.Dashes;
using CalamityMod.EntitySources;
using CalamityMod.Enums;
@@ -71,9 +70,10 @@ namespace CalamityMod.CalPlayer
UsedDash.DashStartupEffects(Player);
UsedDash.dashTime++;
return;
} else if (HasCustomDash && UsedDash.dashStartup > 0 && Player.dashDelay < 0 && UsedDash.dashTime == UsedDash.dashStartup )
}
else if (HasCustomDash && UsedDash.dashStartup > 0 && Player.dashDelay < 0 && UsedDash.dashTime == UsedDash.dashStartup)
{
if (DoADash(UsedDash.CalculateDashSpeed(Player),true))
if (DoADash(UsedDash.CalculateDashSpeed(Player), true))
UsedDash.OnDashEffects(Player);
}
@@ -102,7 +102,7 @@ namespace CalamityMod.CalPlayer
// Duplicated from the way TML edits vanilla ram dash damage (and Shield of Cthulhu)
int dashDamage = (int)Player.GetTotalDamage(hitContext.damageClass).ApplyTo(hitContext.BaseDamage);
Projectile ram = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), n.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), dashDamage, 0f, Player.whoAmI, n.whoAmI);
ram.DamageType = hitContext.damageClass;
@@ -199,7 +199,7 @@ namespace CalamityMod.CalPlayer
}
// Dash delay depends on the type of dash used.
if (!(HasCustomDash && UsedDash.dashStartup > 0 && Player.dashDelay < 0 && UsedDash.dashTime <= UsedDash.dashStartup+10))
if (!(HasCustomDash && UsedDash.dashStartup > 0 && Player.dashDelay < 0 && UsedDash.dashTime <= UsedDash.dashStartup + 10))
Player.dashDelay = dashDelayToApply;
if (UsedDash.IsOmnidirectional)
@@ -251,7 +251,7 @@ namespace CalamityMod.CalPlayer
bool dashWasExecuted = false;
// If the manual hotkey is bound, standard Terraria dashes cannot be triggered by double tapping.
var manualDashHotkeys = CalamityKeybinds.DashHotkey.GetAssignedKeys();
var manualDashHotkeys = CalamityKeybinds.DashHotkey.GetAssignedKeysOrEmpty();
bool manualHotkeyBound = (manualDashHotkeys?.Count ?? 0) > 0;
bool pressedManualHotkey = manualHotkeyBound && (CalamityKeybinds.DashHotkey.JustPressed || forceDash);
@@ -595,7 +595,7 @@ namespace CalamityMod.CalPlayer
if (myRect.Intersects(npcHitbox) && (n.noTileCollide || Collision.CanHit(Player.position, Player.width, Player.height, n.position, n.width, n.height)))
{
int hitDirection = Math.Sign(Player.velocity.X);
// Use the player's facing direction as a fallback if they are not making any horizontal movement.
if (hitDirection == 0)
hitDirection = Player.direction;
+106 -5
View File
@@ -134,11 +134,12 @@ namespace CalamityMod.CalPlayer
//GeneralParticleHandler.SpawnParticle(new DirectionalPulseRing(player.Center + Vector2.UnitX.RotatedBy(player.itemRotation) * (48 + scale*96), Vector2.Zero, Color.Cyan, Vector2.One, 0, scale, scale, 3));
}
// Dust modifications while high.
// Drawing for Odd Mushroom's clone effects
if (calamityPlayer.trippy)
{
if (Main.myPlayer == Player.whoAmI)
{
// Dust
Rectangle screenArea = new Rectangle((int)Main.screenPosition.X - 500, (int)Main.screenPosition.Y - 50, Main.screenWidth + 1000, Main.screenHeight + 100);
int dustDrawn = 0;
float maxShroomDust = Main.maxDustToDraw / 2;
@@ -182,12 +183,112 @@ namespace CalamityMod.CalPlayer
}
}
}
// NPCs
foreach (NPC n in Main.ActiveNPCs)
{
Color rainbow = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Main.DiscoR);
Color alphaColor = n.GetAlpha(rainbow);
float RGBMult = 0.99f;
alphaColor.R = (byte)(alphaColor.R * RGBMult);
alphaColor.G = (byte)(alphaColor.G * RGBMult);
alphaColor.B = (byte)(alphaColor.B * RGBMult);
alphaColor.A = (byte)(alphaColor.A * RGBMult);
for (int i = 0; i < 4; i++)
{
Vector2 position = n.position;
float distanceFromTargetX = Math.Abs(n.Center.X - Main.LocalPlayer.Center.X);
float distanceFromTargetY = Math.Abs(n.Center.Y - Main.LocalPlayer.Center.Y);
switch (i)
{
case 0:
position.X = Main.LocalPlayer.Center.X - distanceFromTargetX;
position.Y = Main.LocalPlayer.Center.Y - distanceFromTargetY;
break;
case 1:
position.X = Main.LocalPlayer.Center.X + distanceFromTargetX;
position.Y = Main.LocalPlayer.Center.Y - distanceFromTargetY;
break;
case 2:
position.X = Main.LocalPlayer.Center.X + distanceFromTargetX;
position.Y = Main.LocalPlayer.Center.Y + distanceFromTargetY;
break;
case 3:
position.X = Main.LocalPlayer.Center.X - distanceFromTargetX;
position.Y = Main.LocalPlayer.Center.Y + distanceFromTargetY;
break;
default:
break;
}
Vector2 posDiff = n.Center - position;
Main.instance.DrawNPCDirect(Main.spriteBatch, n, n.behindTiles, Main.screenPosition + posDiff);
}
}
// Projectiles
foreach (Projectile p in Main.ActiveProjectiles)
{
Texture2D texture = TextureAssets.Projectile[p.type].Value;
Color rainbow = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Main.DiscoR);
Color alphaColor = p.GetAlpha(rainbow);
float RGBMult = 0.99f;
alphaColor.R = (byte)(alphaColor.R * RGBMult);
alphaColor.G = (byte)(alphaColor.G * RGBMult);
alphaColor.B = (byte)(alphaColor.B * RGBMult);
alphaColor.A = (byte)(alphaColor.A * RGBMult);
Vector2 storedProjPos = p.Center;
for (int i = 0; i < 4; i++)
{
Vector2 position = p.position;
float distanceFromTargetX = Math.Abs(p.Center.X - Main.LocalPlayer.Center.X);
float distanceFromTargetY = Math.Abs(p.Center.Y - Main.LocalPlayer.Center.Y);
switch (i)
{
case 0:
position.X = Main.LocalPlayer.Center.X - distanceFromTargetX;
position.Y = Main.LocalPlayer.Center.Y - distanceFromTargetY;
break;
case 1:
position.X = Main.LocalPlayer.Center.X + distanceFromTargetX;
position.Y = Main.LocalPlayer.Center.Y - distanceFromTargetY;
break;
case 2:
position.X = Main.LocalPlayer.Center.X + distanceFromTargetX;
position.Y = Main.LocalPlayer.Center.Y + distanceFromTargetY;
break;
case 3:
position.X = Main.LocalPlayer.Center.X - distanceFromTargetX;
position.Y = Main.LocalPlayer.Center.Y + distanceFromTargetY;
break;
default:
break;
}
// Unfortunately unlike NPCs, there is no public function for drawing a projectile with a position parameter to spoof.
// So we have to spoof it by directly changing the projectile's position, then resetting it at the end.
p.Center = position;
Main.instance.DrawProjDirect(p);
}
p.Center = storedProjPos;
}
}
}
else // This is such a stupid way to reset this but you can't just put it in ResetEffects
else
{
calamityPlayer.trippyLevel = 1;
// Mana Burn VFX disabled when hih
if (Player.statMana < 0)
{
@@ -222,7 +323,7 @@ namespace CalamityMod.CalPlayer
}
#region Flight Visuals
// Celestial Tracers, Elysian Tracers, Seraph Tracers
// Moon Walkers, Void Striders, Seraph Tracers
if (calamityPlayer.tracersDust && drawInfo.shadow == 0f)
{
if (!Player.StandingStill() && !Player.mount.Active)
+11 -6
View File
@@ -159,6 +159,10 @@ namespace CalamityMod.CalPlayer
else
itemDrop = ModContent.ItemType<CragBullhead>();
}
if (ZoneBasaltGully)
{
itemDrop = ModContent.ItemType<MoltenFishron>();
}
return;
}
@@ -303,12 +307,13 @@ namespace CalamityMod.CalPlayer
if (Player.ZoneDesert && Main.rand.NextBool())
return;
int commonCatch = Utils.SelectRandom(Main.rand, new int[]
{
ModContent.ItemType<PrismaticGuppyItem>(),
ModContent.ItemType<PrismaticGuppyPinkItem>(),
ModContent.ItemType<PrismaticGuppyGreenItem>()
});
int commonCatch = ModContent.ItemType<CoralskinFoolfish>();
if (ZonePolypForest)
commonCatch = ModContent.ItemType<GleamingCucumber>();
else if (ZoneGleamingBurrows)
commonCatch = ModContent.ItemType<SpecularSturgeon>();
else if (ZoneTimelessShores)
commonCatch = ModContent.ItemType<Squidoom>();
if (attempt.legendary)
{
+13 -170
View File
@@ -833,42 +833,21 @@ namespace CalamityMod.CalPlayer
// Can't have any cooldowns here because dodges grrrrr....
if (fleshTotem && !Player.HasCooldown(Cooldowns.FleshTotem.ID) && TotalEnergyShielding <= 0)
contactDamageReduction += 0.5;
modifiers.FinalDamage *= 0.5f;
if (tarragonCloak && tarraMelee && !Player.HasCooldown(Cooldowns.TarragonCloak.ID))
contactDamageReduction += TarragonHeadMelee.CloakContactDamageReduction;
modifiers.FinalDamage *= (1f - TarragonHeadMelee.CloakContactDamageReduction);
if (bloodflareMelee && bloodflareFrenzy && !Player.HasCooldown(BloodflareFrenzy.ID))
contactDamageReduction += BloodflareHeadMelee.FrenzyContactDamageReduction;
if (npc.Calamity().temporalSadness)
contactDamageReduction += 0.5;
if (eskimoSet)
{
if (npc.coldDamage)
contactDamageReduction += 0.1;
}
if (trinketOfChiBuff)
contactDamageReduction += 0.08;
if (abyssalDivingSuitPlates)
contactDamageReduction += AbyssalDivingSuit.PlatesAllDamageReduction - abyssalDivingSuitPlateHits * AbyssalDivingSuit.PlatesHitDecay;
if (aquaticHeartIce)
contactDamageReduction += AquaticHeart.IceShieldAllDamageReduction;
if (encased)
contactDamageReduction += PermafrostsConcoction.EncasedAllDamageReduction;
modifiers.FinalDamage *= (1f - BloodflareHeadMelee.FrenzyContactDamageReduction);
if (Player.ownedProjectileCounts[ModContent.ProjectileType<EnergyShell>()] > 0 && Player.ActiveItem().type == ModContent.ItemType<LionHeart>())
contactDamageReduction += 0.5;
modifiers.FinalDamage *= 0.5f;
bool lifeAndShieldCondition = Player.statLife >= Player.statLifeMax2 && (!HasAnyEnergyShield || TotalEnergyShielding >= TotalMaxShieldDurability);
if (theBee && theBeeCooldown <= 0 && lifeAndShieldCondition)
{
contactDamageReduction += 0.5;
modifiers.FinalDamage *= 0.5f;
shouldTriggerBeeCooldown = true;
}
@@ -883,49 +862,7 @@ namespace CalamityMod.CalPlayer
// If the shield never breaks, you never lose full Adrenaline, meaning you keep the DR forever and are functionally immortal.
// This intentionally gives Adrenaline much-needed anti-synergy with energy shields, because they make gaining Adrenaline much safer.
if ((fullAdrenWithoutDH || usingNanomachinesWithDH) && TotalEnergyShielding <= 0)
contactDamageReduction += this.GetAdrenalineDR();
}
if (Player.mount.Active && (Player.mount.Type == ModContent.MountType<RimehoundMount>() || Player.mount.Type == ModContent.MountType<OnyxExcavator>()) && Math.Abs(Player.velocity.X) > Player.mount.RunSpeed / 2f)
contactDamageReduction += 0.1;
if (vHex)
contactDamageReduction -= 0.1;
if (irradiated)
contactDamageReduction -= 0.1;
if (corrEffigy)
contactDamageReduction -= CorruptionEffigy.DamageReductionLoss;
// 10% is converted to 9%, 25% is converted to 20%, 50% is converted to 33%, 75% is converted to 43%, 100% is converted to 50%
if (contactDamageReduction > 0D)
{
if (armorCrunch)
contactDamageReduction *= (double)ArmorCrunch.MultiplicativeDamageReductionPlayer;
if (crumble)
contactDamageReduction *= (double)Crumbling.MultiplicativeDamageReductionPlayer;
// Contact damage reduction is reduced by DR Damage, which itself is proportional to defense damage
// In FTW, as defense damage is uncapped, DR damage is also uncapped.
int currentDefense = Player.GetCurrentDefense(false);
if (totalDefenseDamage > 0 && currentDefense > 0)
{
double drDamageRatio = CurrentDefenseDamage / (double)currentDefense;
if (!Main.getGoodWorld && drDamageRatio > 1D)
drDamageRatio = 1D;
contactDamageReduction *= 1D - drDamageRatio;
if (!Main.getGoodWorld && contactDamageReduction < 0D)
contactDamageReduction = 0D;
}
// Scale with base damage reduction
if (Player.endurance > 0)
contactDamageReduction *= 1f - Player.endurance;
contactDamageReduction = 1D / (1D + contactDamageReduction);
modifiers.SourceDamage *= (float)contactDamageReduction;
modifiers.IncomingDamageMultiplier *= (1f - this.GetAdrenalineDR());
}
if (Main.hardMode && Main.expertMode)
@@ -1025,7 +962,7 @@ namespace CalamityMod.CalPlayer
Projectile pro = Main.projectile.AsEnumerable().Where(projectile => projectile.friendly && projectile.owner == Player.whoAmI && projectile.type == ModContent.ProjectileType<Projectiles.Summon.PhantomicShield>()).First();
phantomicBulwarkCooldown = 1800; // 30 second cooldown
pro.Kill();
projectileDamageReduction += 0.2;
modifiers.FinalDamage *= 0.8f;
}
if (trueVHex)
@@ -1113,28 +1050,16 @@ namespace CalamityMod.CalPlayer
if (evolution)
{
if (proj.type == projTypeJustHitBy)
projectileDamageReduction += 0.25;
modifiers.FinalDamage *= 0.75f;
}
if (trinketOfChiBuff)
projectileDamageReduction += 0.08;
if (abyssalDivingSuitPlates)
projectileDamageReduction += AbyssalDivingSuit.PlatesAllDamageReduction - abyssalDivingSuitPlateHits * AbyssalDivingSuit.PlatesHitDecay;
if (aquaticHeartIce)
projectileDamageReduction += AquaticHeart.IceShieldAllDamageReduction;
if (encased)
projectileDamageReduction += PermafrostsConcoction.EncasedAllDamageReduction;
if (Player.ownedProjectileCounts[ModContent.ProjectileType<EnergyShell>()] > 0 && Player.ActiveItem().type == ModContent.ItemType<LionHeart>())
projectileDamageReduction += 0.5;
modifiers.FinalDamage *= 0.5f;
bool lifeAndShieldCondition = Player.statLife >= Player.statLifeMax2 && (!HasAnyEnergyShield || TotalEnergyShielding >= TotalMaxShieldDurability);
if (theBee && theBeeCooldown <= 0 && lifeAndShieldCondition)
{
projectileDamageReduction += 0.5;
modifiers.FinalDamage *= 0.5f;
shouldTriggerBeeCooldown = true;
}
@@ -1149,12 +1074,9 @@ namespace CalamityMod.CalPlayer
// If the shield never breaks, you never lose full Adrenaline, meaning you keep the DR forever and are functionally immortal.
// This intentionally gives Adrenaline much-needed anti-synergy with energy shields, because they make gaining Adrenaline much safer.
if ((fullAdrenWithoutDH || usingNanomachinesWithDH) && TotalEnergyShielding <= 0)
projectileDamageReduction += this.GetAdrenalineDR();
modifiers.IncomingDamageMultiplier *= (1f - this.GetAdrenalineDR());
}
if (Player.mount.Active && (Player.mount.Type == ModContent.MountType<RimehoundMount>() || Player.mount.Type == ModContent.MountType<OnyxExcavator>()) && Math.Abs(Player.velocity.X) > Player.mount.RunSpeed / 2f)
projectileDamageReduction += 0.1;
// Damage reduction from Shield of the High Ruler if facing the projectile that just hit.
// If the projectile is in the exact center of the player on the X axis YOU GET NOTHING, GOOD DAY, SIR!
if (copyrightInfringementShield)
@@ -1164,53 +1086,14 @@ namespace CalamityMod.CalPlayer
if (Player.direction == 1)
{
if (projectileRight)
projectileDamageReduction += 0.15;
modifiers.FinalDamage *= 0.85f;
}
else
{
if (projectileLeft)
projectileDamageReduction += 0.15;
modifiers.FinalDamage *= 0.85f;
}
}
if (vHex)
projectileDamageReduction -= 0.1;
if (irradiated)
projectileDamageReduction -= 0.1;
if (corrEffigy)
projectileDamageReduction -= CorruptionEffigy.DamageReductionLoss;
// 10% is converted to 9%, 25% is converted to 20%, 50% is converted to 33%, 75% is converted to 43%, 100% is converted to 50%
if (projectileDamageReduction > 0D)
{
if (armorCrunch)
projectileDamageReduction *= (double)ArmorCrunch.MultiplicativeDamageReductionPlayer;
if (crumble)
projectileDamageReduction *= (double)Crumbling.MultiplicativeDamageReductionPlayer;
// Projectile damage reduction is reduced by DR Damage, which itself is proportional to defense damage
int currentDefense = Player.GetCurrentDefense(false);
if (totalDefenseDamage > 0 && currentDefense > 0)
{
double drDamageRatio = CurrentDefenseDamage / (double)currentDefense;
if (drDamageRatio > 1D)
drDamageRatio = 1D;
projectileDamageReduction *= 1D - drDamageRatio;
if (projectileDamageReduction < 0D)
projectileDamageReduction = 0D;
}
// Scale with base damage reduction
if (Player.endurance > 0)
projectileDamageReduction *= 1f - Player.endurance;
projectileDamageReduction = 1D / (1D + projectileDamageReduction);
modifiers.SourceDamage *= (float)projectileDamageReduction;
}
}
#endregion
@@ -2375,46 +2258,6 @@ namespace CalamityMod.CalPlayer
tortShellPostHit = 180;
}
if (abyssalDivingSuitPlates && hurtInfo.Damage > 50)
{
if (abyssalDivingSuitPlateHits < 3)
abyssalDivingSuitPlateHits++;
bool plateCDExists = cooldowns.TryGetValue(DivingPlatesBreaking.ID, out CooldownInstance plateDurability);
if (plateCDExists)
plateDurability.timeLeft = abyssalDivingSuitPlateHits;
if (abyssalDivingSuitPlateHits >= 3)
{
SoundEngine.PlaySound(SoundID.NPCDeath14, Player.Center);
if (plateCDExists)
cooldowns.Remove(DivingPlatesBreaking.ID);
Player.AddCooldown(DivingPlatesBroken.ID, 10830);
for (int d = 0; d < 20; d++)
{
Dust dust = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.Smoke, 0f, 0f, 100, default, 2f);
dust.velocity *= 3f;
if (Main.rand.NextBool())
{
dust.scale = 0.5f;
dust.fadeIn = 1f + Main.rand.Next(10) * 0.1f;
}
}
for (int d = 0; d < 35; d++)
{
Dust fire = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.Torch, 0f, 0f, 100, default, 3f);
fire.noGravity = true;
fire.velocity *= 5f;
fire = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.Torch, 0f, 0f, 100, default, 2f);
fire.velocity *= 2f;
}
}
}
if (aquaticHeartIce)
{
SoundEngine.PlaySound(SoundID.NPCDeath7, Player.Center);
+6 -23
View File
@@ -938,7 +938,7 @@ namespace CalamityMod.CalPlayer
// Ores below here
// Seraph Tracers give immunity to block contact effects
if (!tracersSeraph)
if (!seraphTracers)
{
// Astral Ore inflicts Astral Infection briefly on contact
if (tile.TileType == astralOreID)
@@ -953,7 +953,7 @@ namespace CalamityMod.CalPlayer
// Auric Rejection causes an electrical explosion that yeets the player a considerable distance
// CIT 17AUG2024: Despite providing full invulnerability, Silva armor revive intentionally does not prevent Auric rejection's yeeting.
// 25FEB2025 Ozzatron: Added external bool to control Auric Rejection immunity from the ore.
bool rejectionImmunity = auricSet || tracersSeraph || Player.creativeGodMode || externalAuricRejectionImmunity;
bool rejectionImmunity = auricSet || seraphTracers || Player.creativeGodMode || externalAuricRejectionImmunity;
bool oreRejection = (tile.TileType == auricOreID) && !rejectionImmunity;
// Repulsers always perform this effect because they are player-placed tiles made for this exact purpose
@@ -2734,6 +2734,7 @@ namespace CalamityMod.CalPlayer
}
if (aquaticHeartIce)
{
Player.endurance += AquaticHeart.IceShieldDamageReductionBoost;
light[0] += 0.35f;
light[1] += 1f;
light[2] += 1.25f;
@@ -2768,6 +2769,7 @@ namespace CalamityMod.CalPlayer
if (encased)
{
Player.statDefense += PermafrostsConcoction.EncasedDefenseBoost;
Player.endurance += PermafrostsConcoction.EncasedDamageReductionBoost;
Player.frozen = true;
Player.velocity.X = 0f;
Player.velocity.Y = -0.4f; // Should negate gravity
@@ -3983,8 +3985,7 @@ namespace CalamityMod.CalPlayer
if (abyssalDivingSuit && !Player.IsUnderwater())
{
float moveSpeedLoss = (3 - abyssalDivingSuitPlateHits) * 0.2f;
Player.moveSpeed -= moveSpeedLoss;
Player.moveSpeed -= 0.6f;
}
if (godSlayerThrowing)
@@ -4073,9 +4074,6 @@ namespace CalamityMod.CalPlayer
Player.npcTypeNoAggro[ModContent.NPCType<GammaSlime>()] = true;
}
if (trippy)
Player.GetDamage<GenericDamageClass>() += OddMushroom.DamageBoost;
if (eArtifact)
{
Player.manaCost -= 0.25f;
@@ -5221,28 +5219,13 @@ namespace CalamityMod.CalPlayer
#region Potion Handling
private void HandlePotions()
{
// Hadal Stew
if (potionTimer > 0)
potionTimer--;
if (potionTimer > 0 && Player.potionDelay == 0)
Player.potionDelay = potionTimer;
if (potionTimer == 1)
{
// Reduced duration than normal
int duration = HadalStew.SicknessDuration;
if (Player.pStone)
duration = (int)(duration * 0.75);
Player.ClearBuff(BuffID.PotionSickness);
Player.AddBuff(BuffID.PotionSickness, duration);
}
if (PlayerInput.Triggers.JustPressed.QuickBuff)
{
for (int i = 0; i < Main.InventorySlotsTotal; ++i)
{
Item item = Player.inventory[i];
if (Player.potionDelay > 0 || potionTimer > 0)
if (Player.potionDelay > 0)
break;
if (item is null || item.stack <= 0)
continue;
+2 -8
View File
@@ -108,12 +108,8 @@ namespace CalamityMod
public bool DebuffDisplay { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 2f)]
[DefaultValue(2f)]
[Increment(1f)]
[DrawTicks]
public float CooldownDisplay { get; set; }
[DefaultValue(CooldownDisplayOptions.Full)]
public CooldownDisplayOptions CooldownDisplay { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
@@ -264,8 +260,6 @@ namespace CalamityMod
public bool FasterFallHotkey { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[DrawTicks]
[DefaultValue(SetBonusDoubleTapOptions.Auto)]
public SetBonusDoubleTapOptions SetBonusDoubleTap { get; set; }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

-69
View File
@@ -1,69 +0,0 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.GameContent;
using Terraria.Localization;
using static CalamityMod.CalamityUtils;
using static Terraria.ModLoader.ModContent;
namespace CalamityMod.Cooldowns
{
public class DivingPlatesBreaking : CooldownHandler
{
private static Color phase0Color = new Color(147, 218, 183);
private static Color phase1Color = new Color(233, 190, 134);
private static Color phase2Color = new Color(220, 111, 94);
private static Color ringColorLerpStart = new Color(160, 174, 174);
private static Color ringColorLerpEnd = new Color(192, 11, 107);
public static new string ID => "DivingPlatesBreaking";
public override bool CanTickDown => !instance.player.Calamity().abyssalDivingSuit;
public override bool ShouldDisplay => instance.player.Calamity().abyssalDivingSuit;
public override LocalizedText DisplayName => GetText($"UI.Cooldowns.{ID}");
public override string Texture => "CalamityMod/Cooldowns/DivingSuitBreakingPlates";
public override string OutlineTexture => "CalamityMod/Cooldowns/DivingSuitBrokenPlatesOutline";
public override string OverlayTexture => "CalamityMod/Cooldowns/DivingSuitBrokenPlatesOverlay";
public override Color OutlineColor
{
get
{
if (instance.timeLeft == 0)
return phase0Color;
else if (instance.timeLeft == 1)
return phase1Color;
return phase2Color;
}
}
public override Color CooldownStartColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion);
public override Color CooldownEndColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion);
public override void DrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale)
{
Texture2D sprite = Request<Texture2D>(Texture).Value;
Texture2D outline = Request<Texture2D>(OutlineTexture).Value;
//Draw the outline
spriteBatch.Draw(outline, position, null, OutlineColor * opacity, 0, outline.Size() * 0.5f, scale, SpriteEffects.None, 0f);
//Draw the icon
spriteBatch.Draw(sprite, position, null, Color.White * opacity, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f);
DrawBorderStringEightWay(spriteBatch, FontAssets.MouseText.Value, (3 - instance.timeLeft).ToString(), position + new Vector2(-3, -3) * scale, CooldownStartColor, Color.Black, scale);
}
}
public class DivingPlatesBroken : CooldownHandler
{
private static Color ringColorLerpStart = new Color(91, 121, 150);
private static Color ringColorLerpEnd = new Color(30, 50, 77);
public static new string ID => "DivingPlatesBroken";
public override bool ShouldDisplay => true;
public override LocalizedText DisplayName => GetText($"UI.Cooldowns.{ID}");
public override string Texture => "CalamityMod/Cooldowns/DivingSuitBrokenPlates";
public override Color OutlineColor => new Color(194, 173, 146);
public override Color CooldownStartColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion);
public override Color CooldownEndColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion);
public override void OnCompleted() => instance.player.Calamity().abyssalDivingSuitPlateHits = 0;
}
}
+94 -77
View File
@@ -16,7 +16,7 @@ namespace CalamityMod.Effects
internal const string CalamityShaderPrefix = "CalamityMod:";
// made by boffin. Source code not available. Creates fog in the astral infection
internal static Effect AstralFogShader;
internal static Asset<Effect> AstralFogShader;
//
// All below shaders created by Lucille Karma
@@ -24,115 +24,115 @@ namespace CalamityMod.Effects
#region Lucille's Shaders
// The Dance of Light's Blinding Light
internal static Effect DanceOfLightBlindingShader;
internal static Asset<Effect> DanceOfLightBlindingShader;
// Calamity accessory
internal static Effect CalamityAccessoryMouseShader;
internal static Asset<Effect> CalamityAccessoryMouseShader;
// Subsuming Vortex tentacles
internal static Effect SubsumingVortexTentacleShader;
internal static Asset<Effect> SubsumingVortexTentacleShader;
// Draedon teleporting shader
internal static Effect DraedonTeleportShader;
internal static Asset<Effect> DraedonTeleportShader;
// UNKNOWN -- PROBABLY UNUSED
internal static Effect LightDistortionShader;
internal static Asset<Effect> LightDistortionShader;
// Phaseslayer red energy trail
internal static Effect PhaseslayerRipShader;
internal static Asset<Effect> PhaseslayerRipShader;
// Generic UV-fade streak trail shader. Used by many things?
internal static Effect FadedUVMapStreakShader;
internal static Asset<Effect> FadedUVMapStreakShader;
// Generic flaming streak trail shader. Used by many things?
internal static Effect FlameStreakShader;
internal static Asset<Effect> FlameStreakShader;
// Generic solid trail shader. Used by many things?
internal static Effect FadingSolidTrailShader;
internal static Asset<Effect> FadingSolidTrailShader;
// Typical projectile javelin glowing trail. BEWARE: Is used by many items!
internal static Effect ScarletDevilShader;
internal static Asset<Effect> ScarletDevilShader;
// Yharon border flame pillar trail.
internal static Effect BordernadoFireShader;
internal static Asset<Effect> BordernadoFireShader;
// Photon Ripper hardlight teeth trail shader
internal static Effect PrismCrystalShader;
internal static Asset<Effect> PrismCrystalShader;
// Generic flame trail. BEWARE: Reused by Apollo, Artemis, Cosmilamp, Gem Tech broken gems, and Persecuted enchant portal demons
internal static Effect ImpFlameTrailShader;
internal static Asset<Effect> ImpFlameTrailShader;
// Supreme Witch, Calamitas' force field (which is her visual hitbox)
internal static Effect SCalShieldShader;
internal static Asset<Effect> SCalShieldShader;
// Rancor's alchemical / satanic circle which floats near the player. The laser is emitted from here
internal static Effect RancorMagicCircleShader;
internal static Asset<Effect> RancorMagicCircleShader;
// Generic colored glow shader. BEWARE: Used by about a billion things, including Ares telegraphs, the Biome Blade line, etc.
internal static Effect BasicTintShader;
internal static Asset<Effect> BasicTintShader;
// Generic "pie chart" shader that renders only certain arc sectors of things. Used for the Cooldown Rack and various other visuals.
internal static Effect CircularBarShader;
internal static Asset<Effect> CircularBarShader;
// Cooldown Rack shader used to draw the cooldown's icon appropriately.
internal static Effect CircularBarSpriteShader;
internal static Asset<Effect> CircularBarSpriteShader;
// Devourer of Gods' death animation where he disintegrates into purple energy stuff.
internal static Effect DoGDisintegrationShader;
internal static Asset<Effect> DoGDisintegrationShader;
// Art Attack's main projectile trail shader (Visually designed to match Paper Mario)
internal static Effect ArtAttackTrailShader;
internal static Asset<Effect> ArtAttackTrailShader;
// Generic AoE telegraph. Used for Ares' nukes to denote their area of effect.
internal static Effect CircularAoETelegraph;
internal static Asset<Effect> CircularAoETelegraph;
// Clips a sprite along a fixed plane. Used by Stream Gouge to have half-spears come out of portals.
internal static Effect IntersectionClipShader;
internal static Asset<Effect> IntersectionClipShader;
// Was previously used by Dom's Bladecrest Oathsword. Appears to govern the swing animation.
internal static Effect LocalLinearTransformationShader;
internal static Asset<Effect> LocalLinearTransformationShader;
// UNUSED -- Probably leftover from Lucille's experiments with applying shaders to primitives (arbitrary GPU-rendered triangles)
internal static Effect BasicPrimitiveShader;
internal static Asset<Effect> BasicPrimitiveShader;
// Artemis Ohio Beam. Also used by get fixed boi Nuclear Terror's "G-FUEL BEAM"
internal static Effect ArtemisLaserShader;
internal static Asset<Effect> ArtemisLaserShader;
// Exoblade's melee slash trails. Also used by Terratomere
internal static Effect ExobladeSlashShader;
internal static Asset<Effect> ExobladeSlashShader;
// Exoblade's projectile on-hit "anime slash marks". Also used by Terratomere
internal static Effect ExobladePierceShader;
internal static Asset<Effect> ExobladePierceShader;
// Used by Subsuming Vortex's various vortices. Draws the main vortices. BEWARE: Reused by Burning Sea's fireball.
internal static Effect ExoVortexShader;
internal static Asset<Effect> ExoVortexShader;
// Used by Subsuming Vortex's small vortices. Draws the trailing energy tendrils.
internal static Effect SideStreakTrailShader;
internal static Asset<Effect> SideStreakTrailShader;
// Used by Heavenly Gale's hardlight arrows.
internal static Effect HeavenlyGaleTrailShader;
internal static Asset<Effect> HeavenlyGaleTrailShader;
// Used by Heavenly Gale's exo lightning strikes. Also used by Stormfront Razor lightning.
internal static Effect HeavenlyGaleLightningShader;
internal static Asset<Effect> HeavenlyGaleLightningShader;
// Used in the Codebreaker on Draedon's sprite while communicating with him.
internal static Effect BlueStaticShader;
internal static Asset<Effect> BlueStaticShader;
// Used by Acid Eels, presumably to have their snaking movements look more smooth.
internal static Effect PrimTextureOverlayShader;
internal static Asset<Effect> PrimTextureOverlayShader;
// Used as a default for primitive drawing when no specific shader is supplied. This shader simply renders the vertex color data without modification.
internal static Effect StandardPrimitiveShader;
internal static Asset<Effect> StandardPrimitiveShader;
// Used by Devourer of Gods. Renders the portal that he escapes through at the end of phase 1.
internal static Effect DoGPortalShader;
internal static Asset<Effect> DoGPortalShader;
// Used to render all-encompassing fog in the Floral Paradise biome.
internal static Effect FogShader;
internal static Asset<Effect> FogShader;
// Used to render background water features in the Floral Paradise biome.
internal static Effect WaterfallShader;
internal static Asset<Effect> WaterfallShader;
// Metaballs. See the MetaballManager class for comments on how this system works.
// These shaders are leveraged to render the results of the metaball simulation to the screen.
@@ -140,17 +140,17 @@ namespace CalamityMod.Effects
// The "Additive" shader actually FUSES the particles into their blobby mess.
//
// Backing textures vary. The primary use of this system is Gruesome Eminence.
internal static Effect MetaballEdgeShader;
internal static Effect AdditiveMetaballEdgeShader;
internal static Asset<Effect> MetaballEdgeShader;
internal static Asset<Effect> AdditiveMetaballEdgeShader;
// Used to render the results of Navier-Stokes fluid simulations.
internal static Effect FluidShaders;
internal static Asset<Effect> FluidShaders;
// Used by projectiles fired by the Sylvestaff.
internal static Effect SylvestaffProjectileShader;
internal static Asset<Effect> SylvestaffProjectileShader;
// Used by the ribbons on the Sylvestaff.
internal static Effect SylvestaffRibbonShader;
internal static Asset<Effect> SylvestaffRibbonShader;
#endregion
//
@@ -160,25 +160,25 @@ namespace CalamityMod.Effects
#region Iban's Shaders
// Used by Coral Spout and Titanium Railgun while charging to indicate current projectile spread.
internal static Effect SpreadTelegraph;
internal static Asset<Effect> SpreadTelegraph;
// Used by Wulfrum Screwdriver and Titanium Railgun. Renders a pixelly "laser sight".
internal static Effect PixelatedSightLine;
internal static Asset<Effect> PixelatedSightLine;
// Used by the Wulfrum Treasure Pinger to highlight tiles in range
internal static Effect WulfrumTilePing;
internal static Asset<Effect> WulfrumTilePing;
// Used by the Wulfrum Scaffold Kit to highlight locations where Scaffold tiles will be placed
internal static Effect WulfrumScaffoldSelection;
internal static Asset<Effect> WulfrumScaffoldSelection;
// Used to render the Rover Drive's force field around the player
internal static Effect RoverDriveShield;
internal static Asset<Effect> RoverDriveShield;
// UNUSED -- Probably leftover from Iban's work on the Biome Blade and Ark lines.
internal static Effect RotateSprite;
internal static Asset<Effect> RotateSprite;
// Used on Exoblade to draw the sword swinging dramatically. This was the edit Iban made to Dom's Exoblade.
internal static Effect SwingSprite;
internal static Asset<Effect> SwingSprite;
#endregion
//
@@ -187,14 +187,14 @@ namespace CalamityMod.Effects
#region Ozz's Shaders
// Used on players and NPCs when they have the Miracle Blight debuff.
internal static Effect MiracleBlight;
internal static Asset<Effect> MiracleBlight;
#endregion
#region Aqua's Shaders
internal static Effect CircularGradientWithEdge;
internal static Effect GaleforceArrowTrailShader;
internal static Effect WavyOpacity;
internal static Effect HellBall;
internal static Asset<Effect> CircularGradientWithEdge;
internal static Asset<Effect> GaleforceArrowTrailShader;
internal static Asset<Effect> WavyOpacity;
internal static Asset<Effect> HellBall;
#endregion
//
@@ -203,17 +203,25 @@ namespace CalamityMod.Effects
//
#region Amber's Shaders
internal static Effect PrimitiveClearShader;
internal static Effect HolyInfernoShader;
internal static Effect DeerclopsShadowShader;
internal static Asset<Effect> PrimitiveClearShader;
internal static Asset<Effect> HolyInfernoShader;
internal static Asset<Effect> DeerclopsShadowShader;
#endregion
#region YuH's Shaders
internal static Effect TeslaTrailShader;
internal static Asset<Effect> TeslaTrailShader;
#endregion
#region Doze's Shaders
internal static Effect FlipScreenShader;
/// <summary>
/// Flips the screen. Used for Gravity Globe.
/// </summary>
internal static Asset<Effect> FlipScreenShader;
/// <summary>
/// Distorts a texture towards the center based on a provided noisemap. Meant to emulate the Terraria Otherworld barrier effects.
/// Opacity is the intensity of this distortion, and Saturation is the speed the noisemap moves at.
/// </summary>
internal static Asset<Effect> OtherworldBarrierDistortionShader;
#endregion
//
@@ -221,26 +229,30 @@ namespace CalamityMod.Effects
//
#region fryzahh's Shaders
// A simple shader which distorts an image using a provided texture of choice.
internal static Effect BasicTextureDistortionShader;
internal static Asset<Effect> BasicTextureDistortionShader;
// The underwater rays seen at the top of the Sunken Sea Mod Menu.
internal static Effect UnderwaterRaysShader;
internal static Asset<Effect> UnderwaterRaysShader;
// The blowing wind-like effect seen in the background during DoG's fight.
internal static Effect DoGDistortionWindsShader;
internal static Asset<Effect> DoGDistortionWindsShader;
// The rolling fog clouds seen behind the Distortion Winds effect during DoG's fight.
internal static Effect DoGBackgroundFogShader;
internal static Asset<Effect> DoGBackgroundFogShader;
// Allows a texture to control its opacity from the edges to the center in the shape of a circle.
internal static Effect CircularOpacityShader;
internal static Asset<Effect> CircularOpacityShader;
// The shader effect imposed onto the static crack textures seen during DoG's fight. Fades out the texture from its edges to its center and
// allows it to lerp between two colors depending on the brightness of individual pixels along the sampled texture.
internal static Effect DoGRealityCrackShader;
internal static Asset<Effect> DoGRealityCrackShader;
// The distorted circular effect seen emanating from the distortion rift during DoG's fight.
internal static Effect DoGRiftAuraShader;
internal static Asset<Effect> DoGRiftAuraShader;
#endregion
#region Big E's Shaders
internal static Asset<Effect> SeaPrismColorBlendingShader;
#endregion
internal static Asset<Effect> SunkenSeaMenuLogoWater;
@@ -251,15 +263,14 @@ namespace CalamityMod.Effects
// Shorthand to load shaders immediately.
// Strings provided to LoadShader are the .xnb file paths.
Effect LoadShader(string path) => LoadShaderAsset(path).Value;
Asset<Effect> LoadShaderAsset(string path) => calAss.Request<Effect>($"{ShaderPath}{path}", AssetRequestMode.ImmediateLoad);
Asset<Effect> LoadShader(string path) => calAss.Request<Effect>($"{ShaderPath}{path}", AssetRequestMode.ImmediateLoad);
//
// Loading and registering each individual compiled shader for use.
//
AstralFogShader = LoadShader("AstralFogShader");
var astralPassReg = new AstralScreenShaderData(new Ref<Effect>(AstralFogShader), "AstralPass").UseColor(0.18f, 0.08f, 0.24f);
var astralPassReg = new AstralScreenShaderData(AstralFogShader, "AstralPass").UseColor(0.18f, 0.08f, 0.24f);
RegisterSceneFilter(astralPassReg, "Astral", EffectPriority.VeryHigh);
#region Loading Lucille's Shaders
@@ -458,6 +469,9 @@ namespace CalamityMod.Effects
#region Loading Doze's Shaders
FlipScreenShader = LoadShader("ScreenShaders/FlipScreen");
RegisterScreenShader(FlipScreenShader, "FlipTheScreen", "FlipScreen",EffectPriority.VeryHigh);
OtherworldBarrierDistortionShader = LoadShader("OtherworldBarrierDistortion");
RegisterMiscShader(OtherworldBarrierDistortionShader, "DistortionPass", "OtherworldBarrierDistortion");
#endregion
#region Loading fryzahh's Shaders
@@ -483,16 +497,20 @@ namespace CalamityMod.Effects
RegisterMiscShader(DoGRiftAuraShader, "DoGRiftAuraPass", "DoGRiftAura");
#endregion
SunkenSeaMenuLogoWater = LoadShaderAsset("UI/SunkenSeaMenuLogoWater");
#region Loading Big E's Shaders
SeaPrismColorBlendingShader = LoadShader("SeaPrismColorBlending");
RegisterMiscShader(SeaPrismColorBlendingShader, "SeaPrismBlendingPass", "SeaPrismColorBlending");
#endregion
SunkenSeaMenuLogoWater = LoadShader("UI/SunkenSeaMenuLogoWater");
}
// Shorthand to register a loaded shader in Terraria's graphics engine
// All shaders registered this way are accessible under GameShaders.Misc
// They will use the prefix described above
private static void RegisterMiscShader(Effect shader, string passName, string registrationName)
private static void RegisterMiscShader(Asset<Effect> shader, string passName, string registrationName)
{
Ref<Effect> shaderPointer = new(shader);
MiscShaderData passParamRegistration = new(shaderPointer, passName);
MiscShaderData passParamRegistration = new(shader, passName);
GameShaders.Misc[$"{CalamityShaderPrefix}{registrationName}"] = passParamRegistration;
}
@@ -506,10 +524,9 @@ namespace CalamityMod.Effects
// Shorthand to register a loaded shader in Terraria's graphics engine
// All shaders registered this way are accessible under Filters.Scene
// They will use the prefix described above
private static void RegisterScreenShader(Effect shader, string passName, string registrationName, EffectPriority priority = EffectPriority.High)
private static void RegisterScreenShader(Asset<Effect> shader, string passName, string registrationName, EffectPriority priority = EffectPriority.High)
{
Ref<Effect> shaderPointer = new(shader);
ScreenShaderData passParamRegistration = new(shaderPointer, passName);
ScreenShaderData passParamRegistration = new(shader, passName);
RegisterSceneFilter(passParamRegistration, registrationName, priority);
}
}
+52
View File
@@ -0,0 +1,52 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity; //Opacity works as the intensity of the filter
float uSaturation; //Saturation works as the speed of the noise movement
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
float4 uShaderSpecificData;
float4 AdjustPixelPosition(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
// Drift to offset the noisemap. X multiplier is a prime number to ensure the "loop time" of this is very high, it takes 100 uTime to return to the original state
float2 drift = float2(0.23 * uTime * uSaturation, uTime * uSaturation);
//This is the uv distance from the center of the texture
float2 uvOffsetFromCenter = (coords - 0.5);
float angle = atan2(uvOffsetFromCenter.y, uvOffsetFromCenter.x) / (2 * 3.1415926);
float dist = length(uvOffsetFromCenter);
float2 polarUV = float2(angle, dist);
// Gets the offset from the red channel of whatever pixel this should get from the noisemap. This is fine because the noisemap is greyscale.
float offsetToHave = tex2D(uImage1, polarUV + drift).x;
//This mask is to prevent weird stretching effects at the edge of the texture
float2 modifiedCoords = coords + uvOffsetFromCenter * offsetToHave * uOpacity;
float mask = step(0, modifiedCoords.x) * step(modifiedCoords.y, 1) *
step(0, modifiedCoords.y) * step(modifiedCoords.x, 1);
// This makes a greyscale image designed for additve use transparent for non-additve use.
// I would like to be able to draw directly additive, but I have been unable to make that work and this has worked well.
float4 distortedColor = tex2D(uImage0, modifiedCoords);
distortedColor.a = distortedColor.x;
return distortedColor * sampleColor * mask;
}
technique Technique1
{
pass DistortionPass
{
PixelShader = compile ps_2_0 AdjustPixelPosition();
}
}
Binary file not shown.
+69
View File
@@ -0,0 +1,69 @@
sampler baseTexture : register(s0);
sampler greenTexture : register(s1);
sampler purpleTexture : register(s2);
sampler glintTexture : register(s3);
float time;
float2 screenOffset;
float2 offscreenOffset;
float diagonalScreenLength;
bool doGlint;
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0, float4 screenPos : VPOS) : COLOR
{
// Calculate world position
float2 worldPos = screenPos.xy + screenOffset - offscreenOffset;
// Sample all three textures
float4 blueColor = tex2D(baseTexture, coords);
float4 purpleColor = tex2D(purpleTexture, coords);
float4 greenColor = tex2D(greenTexture, coords);
float4 glintColor = tex2D(glintTexture, coords);
// Calculate fade values
float fade1 = (sin(time * 0.2) + 1.0) / 2.0;
float fade2 = (sin(time * 0.1 + worldPos.x * 0.005 - worldPos.y * 0.003) + 1.0) / 2.0;
// Blend the colors
float4 result = blueColor;
result.rgb = lerp(result.rgb, greenColor.rgb, greenColor.a * fade1);
result.rgb = lerp(result.rgb, purpleColor.rgb, purpleColor.a * fade2);
if(doGlint)
{
// Calculate glint effect
float2 projPos = screenPos.xy - offscreenOffset;
float projection = (screenPos.x / 2.0) - (screenPos.y / 2.0);
// Define glint beam centers
float beamCenter1 = diagonalScreenLength * 0.05;
float beamCenter2 = diagonalScreenLength * 0.5;
float beamCenter3 = diagonalScreenLength * 1.05;
// Calculate glint strength for each beam
float dist1 = abs(projection - beamCenter1);
float dist2 = abs(projection - beamCenter2);
float dist3 = abs(projection - beamCenter3);
float strength1 = saturate(1.0 - dist1 / 100.0);
float strength2 = saturate(1.0 - dist2 / 100.0);
float strength3 = saturate(1.0 - dist3 / 100.0);
float totalGlintStrength = max(strength1, max(strength2, strength3));
// Apply glint
result.rgb = lerp(result.rgb, glintColor.rgb, glintColor.a * totalGlintStrength);
//Additive Blend Version (VERY BRIGHT)
//result.rgb = lerp(result.rgb, result.rgb + glintColor.rgb, glintColor.a * totalGlintStrength);
}
return result * sampleColor;
}
technique Technique1
{
pass SeaPrismBlendingPass
{
PixelShader = compile ps_3_0 PixelShaderFunction();
}
}
Binary file not shown.
-10
View File
@@ -1,10 +0,0 @@
namespace CalamityMod
{
public enum ConvertType
{
Pure,
Corrupt,
Crimson,
Hallow
}
}
+11
View File
@@ -0,0 +1,11 @@
using Terraria.ModLoader.Config;
namespace CalamityMod.Enums
{
public enum CooldownDisplayOptions
{
Full,
Compact,
Hidden
}
}
-3
View File
@@ -4,11 +4,8 @@ namespace CalamityMod.Enums
{
public enum SetBonusDoubleTapOptions
{
[LabelKey("$Mods.CalamityMod.Configs.CalamityClientConfig.SetBonusDoubleTap.Options.On")]
On,
[LabelKey("$Mods.CalamityMod.Configs.CalamityClientConfig.SetBonusDoubleTap.Options.Auto")]
Auto,
[LabelKey("$Mods.CalamityMod.Configs.CalamityClientConfig.SetBonusDoubleTap.Options.Off")]
Off
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

+15 -15
View File
@@ -172,11 +172,11 @@ namespace CalamityMod.FluidSimulation
ApplyThingToTarget(field.NextState, () =>
{
Main.instance.GraphicsDevice.Textures[1] = field.PreviousState;
CalamityShaders.FluidShaders.Parameters["size"].SetValue(Size);
CalamityShaders.FluidShaders.Parameters["diffusionFactor"].SetValue(diffusionFactor);
CalamityShaders.FluidShaders.Parameters["handlingColors"].SetValue(colors);
CalamityShaders.FluidShaders.Parameters["dissipationFactor"].SetValue(DissipationFactor);
CalamityShaders.FluidShaders.CurrentTechnique.Passes["DiffusionPass"].Apply();
CalamityShaders.FluidShaders.Value.Parameters["size"].SetValue(Size);
CalamityShaders.FluidShaders.Value.Parameters["diffusionFactor"].SetValue(diffusionFactor);
CalamityShaders.FluidShaders.Value.Parameters["handlingColors"].SetValue(colors);
CalamityShaders.FluidShaders.Value.Parameters["dissipationFactor"].SetValue(DissipationFactor);
CalamityShaders.FluidShaders.Value.CurrentTechnique.Passes["DiffusionPass"].Apply();
});
}
@@ -186,10 +186,10 @@ namespace CalamityMod.FluidSimulation
{
Main.instance.GraphicsDevice.Textures[1] = currentField;
Main.instance.GraphicsDevice.Textures[2] = velocities;
CalamityShaders.FluidShaders.Parameters["size"].SetValue(Size);
CalamityShaders.FluidShaders.Parameters["deltaTime"].SetValue(DeltaTime);
CalamityShaders.FluidShaders.Parameters["handlingColors"].SetValue(colors);
CalamityShaders.FluidShaders.CurrentTechnique.Passes["AdvectionPass"].Apply();
CalamityShaders.FluidShaders.Value.Parameters["size"].SetValue(Size);
CalamityShaders.FluidShaders.Value.Parameters["deltaTime"].SetValue(DeltaTime);
CalamityShaders.FluidShaders.Value.Parameters["handlingColors"].SetValue(colors);
CalamityShaders.FluidShaders.Value.CurrentTechnique.Passes["AdvectionPass"].Apply();
});
}
@@ -199,8 +199,8 @@ namespace CalamityMod.FluidSimulation
ApplyThingToTarget(DivergenceField, () =>
{
Main.instance.GraphicsDevice.Textures[2] = velocities;
CalamityShaders.FluidShaders.Parameters["size"].SetValue(Size);
CalamityShaders.FluidShaders.CurrentTechnique.Passes["InitializeDivergencePass"].Apply();
CalamityShaders.FluidShaders.Value.Parameters["size"].SetValue(Size);
CalamityShaders.FluidShaders.Value.CurrentTechnique.Passes["InitializeDivergencePass"].Apply();
});
// Clear the Poisson values and then calculate them, for use in the divergence clearance pass.
@@ -214,8 +214,8 @@ namespace CalamityMod.FluidSimulation
Main.instance.GraphicsDevice.Textures[1] = DivergencePoissonField;
Main.instance.GraphicsDevice.Textures[2] = velocities;
Main.instance.GraphicsDevice.Textures[4] = DivergenceField;
CalamityShaders.FluidShaders.Parameters["size"].SetValue(Size);
CalamityShaders.FluidShaders.CurrentTechnique.Passes["PerformPoissonIterationPass"].Apply();
CalamityShaders.FluidShaders.Value.Parameters["size"].SetValue(Size);
CalamityShaders.FluidShaders.Value.CurrentTechnique.Passes["PerformPoissonIterationPass"].Apply();
});
}
@@ -223,7 +223,7 @@ namespace CalamityMod.FluidSimulation
{
Main.instance.GraphicsDevice.Textures[1] = velocities;
Main.instance.GraphicsDevice.Textures[3] = DivergencePoissonField;
CalamityShaders.FluidShaders.CurrentTechnique.Passes["ClearDivergencePass"].Apply();
CalamityShaders.FluidShaders.Value.CurrentTechnique.Passes["ClearDivergencePass"].Apply();
});
}
@@ -282,7 +282,7 @@ namespace CalamityMod.FluidSimulation
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity);
Main.instance.GraphicsDevice.Textures[5] = ColorField.NextState;
CalamityShaders.FluidShaders.CurrentTechnique.Passes["DrawFluidPass"].Apply();
CalamityShaders.FluidShaders.Value.CurrentTechnique.Passes["DrawFluidPass"].Apply();
Main.spriteBatch.Draw(DensityField.NextState, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 1f, 0, 0f);
Main.spriteBatch.End();
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 546 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 888 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

+4 -4
View File
@@ -72,12 +72,12 @@ namespace CalamityMod.Graphics.Metaballs
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
// Supply shader parameter values.
metaballShader.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
metaballShader.Value.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Value.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Value.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
// Apply the metaball shader.
metaballShader.CurrentTechnique.Passes[0].Apply();
metaballShader.Value.CurrentTechnique.Passes[0].Apply();
}
public static void SpawnParticle(Vector2 position, float size) => Particles.Add(new(position, size));
+4 -4
View File
@@ -72,12 +72,12 @@ namespace CalamityMod.Graphics.Metaballs
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
// Supply shader parameter values.
metaballShader.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
metaballShader.Value.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Value.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Value.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
// Apply the metaball shader.
metaballShader.CurrentTechnique.Passes[0].Apply();
metaballShader.Value.CurrentTechnique.Passes[0].Apply();
}
public static void SpawnParticle(Vector2 position, float size) => Particles.Add(new(position, size));
+6 -6
View File
@@ -67,16 +67,16 @@ namespace CalamityMod.Graphics.Metaballs
if (FixedToScreen)
layerScrollOffset = Vector2.Zero;
metaballShader.Parameters["layerSize"]?.SetValue(DoGVisualsManager.DistortionForegroundContentsTarget.Target.Size());
metaballShader.Parameters["screenSize"]?.SetValue(screenSize);
metaballShader.Parameters["layerOffset"]?.SetValue(layerScrollOffset);
metaballShader.Parameters["edgeColor"]?.SetValue(EdgeColor.ToVector4());
metaballShader.Parameters["singleFrameScreenOffset"]?.SetValue((Main.screenLastPosition - Main.screenPosition) / screenSize);
metaballShader.Value.Parameters["layerSize"]?.SetValue(DoGVisualsManager.DistortionForegroundContentsTarget.Target.Size());
metaballShader.Value.Parameters["screenSize"]?.SetValue(screenSize);
metaballShader.Value.Parameters["layerOffset"]?.SetValue(layerScrollOffset);
metaballShader.Value.Parameters["edgeColor"]?.SetValue(EdgeColor.ToVector4());
metaballShader.Value.Parameters["singleFrameScreenOffset"]?.SetValue((Main.screenLastPosition - Main.screenPosition) / screenSize);
gd.Textures[1] = DoGVisualsManager.DistortionForegroundContentsTarget;
gd.SamplerStates[1] = SamplerState.LinearWrap;
metaballShader.CurrentTechnique.Passes[0].Apply();
metaballShader.Value.CurrentTechnique.Passes[0].Apply();
}
public override void DrawInstances()
+4 -4
View File
@@ -90,12 +90,12 @@ namespace CalamityMod.Graphics.Metaballs
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
// Supply shader parameter values.
metaballShader.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
metaballShader.Value.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Value.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Value.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
// Apply the metaball shader.
metaballShader.CurrentTechnique.Passes[0].Apply();
metaballShader.Value.CurrentTechnique.Passes[0].Apply();
}
public void SpawnParticle(Vector2 position, float size) => Particles.Add(new(position, size));
+4 -4
View File
@@ -90,12 +90,12 @@ namespace CalamityMod.Graphics.Metaballs
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
// Supply shader parameter values.
metaballShader.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
metaballShader.Value.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Value.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Value.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
// Apply the metaball shader.
metaballShader.CurrentTechnique.Passes[0].Apply();
metaballShader.Value.CurrentTechnique.Passes[0].Apply();
}
public void SpawnParticle(Vector2 position, float size) => Particles.Add(new(position, size));
+7 -7
View File
@@ -106,19 +106,19 @@ namespace CalamityMod.Graphics.Metaballs
layerScrollOffset = Vector2.Zero;
// Supply shader parameter values.
metaballShader.Parameters["layerSize"]?.SetValue(layerTexture.Size());
metaballShader.Parameters["screenSize"]?.SetValue(screenSize);
metaballShader.Parameters["layerOffset"]?.SetValue(layerScrollOffset);
metaballShader.Parameters["edgeColor"]?.SetValue(EdgeColor.ToVector4());
metaballShader.Parameters["singleFrameScreenOffset"]?.SetValue((Main.screenLastPosition - Main.screenPosition) / screenSize);
metaballShader.Parameters["layerColor"]?.SetValue(LayerColors.Count() > layerIndex ? LayerColors[layerIndex] : Color.White.ToVector4());
metaballShader.Value.Parameters["layerSize"]?.SetValue(layerTexture.Size());
metaballShader.Value.Parameters["screenSize"]?.SetValue(screenSize);
metaballShader.Value.Parameters["layerOffset"]?.SetValue(layerScrollOffset);
metaballShader.Value.Parameters["edgeColor"]?.SetValue(EdgeColor.ToVector4());
metaballShader.Value.Parameters["singleFrameScreenOffset"]?.SetValue((Main.screenLastPosition - Main.screenPosition) / screenSize);
metaballShader.Value.Parameters["layerColor"]?.SetValue(LayerColors.Count() > layerIndex ? LayerColors[layerIndex] : Color.White.ToVector4());
// Supply the metaball's layer texture to the graphics device so that the shader can read it.
gd.Textures[1] = layerTexture;
gd.SamplerStates[1] = SamplerState.LinearWrap;
// Apply the metaball shader.
metaballShader.CurrentTechnique.Passes[0].Apply();
metaballShader.Value.CurrentTechnique.Passes[0].Apply();
}
/// <summary>
+4 -4
View File
@@ -86,12 +86,12 @@ namespace CalamityMod.Graphics.Metaballs
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
// Supply shader parameter values.
metaballShader.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
metaballShader.Value.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Value.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Value.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
// Apply the metaball shader.
metaballShader.CurrentTechnique.Passes[0].Apply();
metaballShader.Value.CurrentTechnique.Passes[0].Apply();
}
public void SpawnParticle(Vector2 position, float size) =>
+4 -4
View File
@@ -91,12 +91,12 @@ namespace CalamityMod.Graphics.Metaballs
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
// Supply shader parameter values.
metaballShader.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
metaballShader.Value.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Value.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Value.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
// Apply the metaball shader.
metaballShader.CurrentTechnique.Passes[0].Apply();
metaballShader.Value.CurrentTechnique.Passes[0].Apply();
}
public static void SpawnParticle(Vector2 position, float size) => Particles.Add(new(position, size));
+4 -4
View File
@@ -92,12 +92,12 @@ namespace CalamityMod.Graphics.Metaballs
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
// Supply shader parameter values.
metaballShader.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
metaballShader.Value.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Value.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Value.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
// Apply the metaball shader.
metaballShader.CurrentTechnique.Passes[0].Apply();
metaballShader.Value.CurrentTechnique.Passes[0].Apply();
}
public static void SpawnParticle(Vector2 position, float size) => Particles.Add(new(position, size));
+4 -4
View File
@@ -87,12 +87,12 @@ namespace CalamityMod.Graphics.Metaballs
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
// Supply shader parameter values.
metaballShader.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
metaballShader.Value.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Value.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Value.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
// Apply the metaball shader.
metaballShader.CurrentTechnique.Passes[0].Apply();
metaballShader.Value.CurrentTechnique.Passes[0].Apply();
}
public static void SpawnParticle(Vector2 position, float size) => Particles.Add(new(position, size));
+4 -4
View File
@@ -86,12 +86,12 @@ namespace CalamityMod.Graphics.Metaballs
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
// Supply shader parameter values.
metaballShader.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
metaballShader.Value.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Value.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Value.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
// Apply the metaball shader.
metaballShader.CurrentTechnique.Passes[0].Apply();
metaballShader.Value.CurrentTechnique.Passes[0].Apply();
}
public static void SpawnParticle(Vector2 position, float size) => Particles.Add(new(position, size));
+4 -4
View File
@@ -68,12 +68,12 @@ namespace CalamityMod.Graphics.Metaballs
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
// Supply shader parameter values.
metaballShader.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
metaballShader.Value.Parameters["screenArea"]?.SetValue(screenSize);
metaballShader.Value.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Value.Parameters["singleFrameScreenOffset"]?.SetValue(Vector2.Zero);
// Apply the metaball shader.
metaballShader.CurrentTechnique.Passes[0].Apply();
metaballShader.Value.CurrentTechnique.Passes[0].Apply();
}
public static void SpawnParticle(Vector2 position, float size) =>
+1 -1
View File
@@ -84,7 +84,7 @@ namespace CalamityMod.Graphics.Metaballs
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeNPCs;
public override Color EdgeColor => CalamityGlobalNPC.SCal >= 0 && Main.npc[CalamityGlobalNPC.SCal].ModNPC<SupremeCalamitas>().ArenaBox is not null ? Main.npc[CalamityGlobalNPC.SCal].ModNPC<SupremeCalamitas>().ArenaBox.borderColor : SupremeCalamitas.AcceptanceColor;
public override Color EdgeColor => SupremeCalamitas.CurrentColor;
public override void Update()
{
+9 -16
View File
@@ -1,6 +1,5 @@
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
@@ -11,7 +10,7 @@ namespace CalamityMod.Graphics
/// </summary>
public class RenderTargetManager : ModSystem
{
internal static List<ManagedRenderTarget> ManagedTargets = new();
internal static List<ManagedRenderTarget> ManagedTargets { get; } = [];
public delegate void RenderTargetUpdateDelegate();
@@ -42,9 +41,6 @@ namespace CalamityMod.Graphics
internal static void DisposeOfTargets()
{
if (ManagedTargets is null)
return;
Main.QueueMainThreadAction(() =>
{
foreach (ManagedRenderTarget target in ManagedTargets)
@@ -55,7 +51,6 @@ namespace CalamityMod.Graphics
public override void OnModLoad()
{
ManagedTargets = new();
Main.OnPreDraw += HandleTargetUpdateLoop;
Main.OnResolutionChanged += ResetTargetSizes;
}
@@ -76,19 +71,17 @@ namespace CalamityMod.Graphics
private void HandleTargetUpdateLoop(GameTime obj)
{
// Auto-disposal of targets that havent been used in a while, to stop them hogging GPU memory.
if (ManagedTargets != null)
foreach (ManagedRenderTarget target in ManagedTargets)
{
foreach (ManagedRenderTarget target in ManagedTargets)
{
if (target == null || target.IsDisposed || !target.ShouldAutoDispose)
continue;
if (target == null || target.IsDisposed || !target.ShouldAutoDispose)
continue;
if (target.TimeSinceLastAccessed >= TimeBeforeAutoDispose)
target.Dispose();
else
target.TimeSinceLastAccessed++;
}
if (target.TimeSinceLastAccessed >= TimeBeforeAutoDispose)
target.Dispose();
else
target.TimeSinceLastAccessed++;
}
RenderTargetUpdateLoopEvent?.Invoke();
}
}
+2 -1
View File
@@ -13,6 +13,7 @@ using Terraria.GameContent.Liquid;
using Terraria.GameContent.UI.Elements;
using Terraria.GameContent.UI.States;
using Terraria.GameInput;
using Terraria.Graphics.CameraModifiers;
using Terraria.Graphics.Light;
using Terraria.Map;
using Terraria.ModLoader;
@@ -82,7 +83,6 @@ namespace CalamityMod.ILEditing
On_Projectile.NewProjectile_IEntitySource_float_float_float_float_int_int_float_int_float_float_float += IncorporateExtraProjectileVariables;
On_Player.ApplyDamageToNPC += ApplyOldFashionedDamageToMiscHits;
IL_Wiring.HitWireSingle += AddTwinklersToStatue;
On_Player.UpdateItemDye += FindCalamityItemDyeShader;
On_AWorldListItem.GetDifficulty += GetDifficultyOverride;
On_Item.GetShimmered += ShimmerEffectEdits;
On_Player.Teleport += TPOverride;
@@ -188,6 +188,7 @@ namespace CalamityMod.ILEditing
IL_Player.StatusFromNPC += RemoveExpertBrainRandomDebuffs;
IL_NPC.VanillaHitEffect += PreventLavaSlimeLavaDrop;
IL_NPC.StrikeNPC_HitInfo_bool_bool += LetDetonatingBubblesTakeDamage;
IL_PunchCameraModifier.Update += PunchCameraUsesScreenshakeConfig;
IL_Player.ItemCheck_EmitUseVisuals += MakeMagmaStoneFireGauntletDustToggleable;
IL_Projectile.EmitEnchantmentVisualsAt += MakeMagmaStoneFireGauntletProjectileDustToggleable;
IL_Sandstorm.HasSufficientWind += DecreaseSandstormWindSpeedRequirement;
+44 -165
View File
@@ -2,7 +2,6 @@
using System.Linq;
using System.Reflection;
using CalamityMod.Balancing;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.CalPlayer;
using CalamityMod.Cooldowns;
using CalamityMod.DataStructures;
@@ -19,11 +18,7 @@ using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.NPCs;
using CalamityMod.NPCs.Abyss;
using CalamityMod.NPCs.Astral;
using CalamityMod.NPCs.AstrumAureus;
using CalamityMod.NPCs.Crabulon;
using CalamityMod.NPCs.DraedonLabThings;
using CalamityMod.NPCs.NormalNPCs;
using CalamityMod.NPCs.Ravager;
using CalamityMod.NPCs.SunkenSea;
using CalamityMod.Packets;
using CalamityMod.Particles;
@@ -36,7 +31,6 @@ using CalamityMod.Tiles;
using CalamityMod.Walls;
using CalamityMod.Walls.UnsafeWalls;
using CalamityMod.Waterfalls;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Mono.Cecil.Cil;
@@ -44,10 +38,8 @@ using MonoMod.Cil;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.Chat;
using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.GameContent.Achievements;
using Terraria.GameContent.Biomes;
using Terraria.GameContent.Drawing;
using Terraria.GameContent.Events;
@@ -306,7 +298,7 @@ namespace CalamityMod.ILEditing
return;
}
if (CalamityKeybinds.DashHotkey.GetAssignedKeys().Count == 0)
if (CalamityKeybinds.DashHotkey.GetAssignedKeysOrEmpty().Count == 0)
orig(self, out dir, out dashing, dashStartAction);
else
{
@@ -324,7 +316,7 @@ namespace CalamityMod.ILEditing
return;
}
if ((CalamityKeybinds.ArmorSetBonusHotKey.GetAssignedKeys().Count != 0 && CalamityClientConfig.Instance.SetBonusDoubleTap == SetBonusDoubleTapOptions.Auto) || CalamityClientConfig.Instance.SetBonusDoubleTap == SetBonusDoubleTapOptions.Off)
if ((CalamityKeybinds.ArmorSetBonusHotKey.GetAssignedKeysOrEmpty().Count != 0 && CalamityClientConfig.Instance.SetBonusDoubleTap == SetBonusDoubleTapOptions.Auto) || CalamityClientConfig.Instance.SetBonusDoubleTap == SetBonusDoubleTapOptions.Off)
return;
orig(self, keyDir);
@@ -677,7 +669,8 @@ namespace CalamityMod.ILEditing
#endregion
#region Chaos Stone Mana Burn changes
private static bool AllowNegativeCheckMana(On_Player.orig_CheckMana_int_bool_bool orig, Player self, int amount, bool pay, bool blockQuickMana) {
private static bool AllowNegativeCheckMana(On_Player.orig_CheckMana_int_bool_bool orig, Player self, int amount, bool pay, bool blockQuickMana)
{
if (self.Calamity().ChaosStone)
{
if (pay)
@@ -689,7 +682,8 @@ namespace CalamityMod.ILEditing
return orig(self, amount, pay, blockQuickMana);
}
private static bool AllowNegativeCheckMana(On_Player.orig_CheckMana_Item_int_bool_bool orig, Player self, Item item, int amount, bool pay, bool blockQuickMana) {
private static bool AllowNegativeCheckMana(On_Player.orig_CheckMana_Item_int_bool_bool orig, Player self, Item item, int amount, bool pay, bool blockQuickMana)
{
if (self.Calamity().ChaosStone)
{
if (pay)
@@ -960,7 +954,8 @@ namespace CalamityMod.ILEditing
LogFailure("DoDraw Lava", "Could not locate the drawing of Background Waters");
return;
}
cursor.EmitDelegate(() => {
cursor.EmitDelegate(() =>
{
LavaRenderingSystem.Instance.DrawLavas(isBackground: true);
});
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdsfld<Main>("drawToScreen"), i => i.MatchBrfalse(out _), i => i.MatchLdarg0(), i => i.MatchLdcI4(0), i => i.MatchCall<Main>("DrawWaters")))
@@ -968,7 +963,8 @@ namespace CalamityMod.ILEditing
LogFailure("DoDraw Lava", "Could not locate the drawing of Waters");
return;
}
cursor.EmitDelegate(() => {
cursor.EmitDelegate(() =>
{
LavaRenderingSystem.Instance.DrawLavas();
});
}
@@ -981,7 +977,8 @@ namespace CalamityMod.ILEditing
LogFailure("Render Lava", "Could not locate the drawing of Waters");
return;
}
cursor.EmitDelegate(() => {
cursor.EmitDelegate(() =>
{
LavaRenderingSystem.Instance.DrawLavas();
});
}
@@ -994,7 +991,8 @@ namespace CalamityMod.ILEditing
LogFailure("Render Lava Backgroumds", "Could not locate the drawing of Background Waters");
return;
}
cursor.EmitDelegate(() => {
cursor.EmitDelegate(() =>
{
LavaRenderingSystem.Instance.DrawLavas(isBackground: true);
});
}
@@ -1007,7 +1005,8 @@ namespace CalamityMod.ILEditing
LogFailure("Draw lavas to captures", "Could not locate the saving of water alphas");
return;
}
cursor.EmitDelegate(() => {
cursor.EmitDelegate(() =>
{
LavaRenderingSystem.LavaAlpha.CopyTo(LavaRenderingSystem.AlphaSave, 0);
});
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcI4(0), i => i.MatchStloc(34), i => i.MatchBr(out _), i => i.MatchLdloc(34), i => i.MatchLdcI4(1), i => i.MatchBeq(out _)))
@@ -1016,7 +1015,8 @@ namespace CalamityMod.ILEditing
return;
}
cursor.EmitLdloc(8);
cursor.EmitDelegate((CaptureBiome biome) => {
cursor.EmitDelegate((CaptureBiome biome) =>
{
for (int i = 0; i < 1; i++)
{
LavaRenderingSystem.LavaAlpha[i] = ((i == LavaRenderingSystem.LavaStyle) ? 1f : 0f);
@@ -1027,7 +1027,8 @@ namespace CalamityMod.ILEditing
LogFailure("Draw lavas to captures", "Could not locate the background of liquid capture drawing");
return;
}
cursor.EmitDelegate(() => {
cursor.EmitDelegate(() =>
{
LavaRenderingSystem.Instance.DrawLiquid(bg: true, LavaRenderingSystem.LavaStyle);
});
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdarg0(), i => i.MatchLdcI4(1), i => i.MatchLdsfld<Main>("bloodMoon"), i => i.MatchBrtrue(out _), i => i.MatchLdloc(8), i => i.MatchLdfld<CaptureBiome>("WaterStyle"), i => i.MatchBr(out _), i => i.MatchLdcI4(9), i => i.MatchLdcR4(1), i => i.MatchLdcI4(1), i => i.MatchCall<Main>("DrawLiquid")))
@@ -1035,7 +1036,8 @@ namespace CalamityMod.ILEditing
LogFailure("Draw lavas to captures", "Could not locate the second background of liquid capture drawing");
return;
}
cursor.EmitDelegate(() => {
cursor.EmitDelegate(() =>
{
LavaRenderingSystem.Instance.DrawLiquid(bg: true, LavaRenderingSystem.LavaStyle);
});
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdarg0(), i => i.MatchLdcI4(0), i => i.MatchLdsfld<Main>("waterStyle"), i => i.MatchLdcR4(1), i => i.MatchLdcI4(1), i => i.MatchCall<Main>("DrawLiquid")))
@@ -1043,7 +1045,8 @@ namespace CalamityMod.ILEditing
LogFailure("Draw lavas to captures", "Could not locate the liquid capture drawing");
return;
}
cursor.EmitDelegate(() => {
cursor.EmitDelegate(() =>
{
LavaRenderingSystem.Instance.DrawLiquid(bg: false, LavaRenderingSystem.LavaStyle);
});
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdarg0(), i => i.MatchLdcI4(0), i => i.MatchLdloc(8), i => i.MatchLdfld<CaptureBiome>("WaterStyle"), i => i.MatchLdcR4(1), i => i.MatchLdcI4(1), i => i.MatchCall<Main>("DrawLiquid")))
@@ -1051,7 +1054,8 @@ namespace CalamityMod.ILEditing
LogFailure("Draw lavas to captures", "Could not locate the second liquid capture drawing");
return;
}
cursor.EmitDelegate(() => {
cursor.EmitDelegate(() =>
{
LavaRenderingSystem.Instance.DrawLiquid(bg: false, LavaRenderingSystem.LavaStyle);
});
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdloc2(), i => i.MatchStsfld<Main>("liquidAlpha")))
@@ -1059,7 +1063,8 @@ namespace CalamityMod.ILEditing
LogFailure("Draw lavas to captures", "Could not locate water style value returner");
return;
}
cursor.EmitDelegate(() => {
cursor.EmitDelegate(() =>
{
LavaRenderingSystem.AlphaSave.CopyTo(LavaRenderingSystem.LavaAlpha, 0);
});
}
@@ -1067,17 +1072,18 @@ namespace CalamityMod.ILEditing
private void AddTileLiquidDrawing(ILContext il)
{
ILCursor cursor = new ILCursor(il);
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdarg0(), i => i.MatchLdarg1(), i => i.MatchLdcI4(0), i => i.MatchLdarg(out _), i => i.MatchLdloc1(), i => i.MatchLdloc2(), i => i.MatchLdloc(12), i => i.MatchLdloc(13), i => i.MatchLdloc(14), i => i.MatchCall<TileDrawing>("DrawTile_LiquidBehindTile")))
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdarg0(), i => i.MatchLdarg1(), i => i.MatchLdcI4(0), i => i.MatchLdarg(out _), i => i.MatchLdloc1(), i => i.MatchLdloc2(), i => i.MatchLdloc(13), i => i.MatchLdloc(14), i => i.MatchLdloc(15), i => i.MatchCall<TileDrawing>("DrawTile_LiquidBehindTile")))
{
LogFailure("Tile Lava Drawing", "Could not locate the drawing of Liquid Behind Tile drawing");
return;
}
cursor.EmitLdloc1();
cursor.EmitLdloc2();
cursor.EmitLdloc(12);
cursor.EmitLdloc(13);
cursor.EmitLdloc(14);
cursor.EmitDelegate((Vector2 unscaledPosition, Vector2 vector, int j, int i, Tile tile) => {
cursor.EmitLdloc(15);
cursor.EmitDelegate((Vector2 unscaledPosition, Vector2 vector, int j, int i, Tile tile) =>
{
LavaRenderingSystem.Instance.DrawTile_LiquidBehindTile(solidLayer: false, inFrontOfPlayers: false, -1, unscaledPosition, vector, j, i, tile);
});
}
@@ -1085,18 +1091,6 @@ namespace CalamityMod.ILEditing
#region Lava Blocking
private void BlockLavaDrawing(ILContext il)
{
if (ModLoader.HasMod("LiquidSlopesPatch"))
{
BlockLavaDrawing_LiquidSlopesPatch(il);
}
else
{
BlockLavaDrawing_Vanilla(il);
}
}
private void BlockLavaDrawing_Vanilla(ILContext il)
{
//This edit to DrawNormalLiquids makes lavas in normal and white lighting draw with an alpha and with new textures
//If the parameter for the waterstyle is more than the max waterstyles then its subtracted by the max water style count and thats the lava style ID
@@ -1105,18 +1099,18 @@ namespace CalamityMod.ILEditing
//Continue if statement, basically
//if the liquid being drawn is lava and the water style is greater than the max water styles or if the liquid is water and less than the max water styles then the draw code is ran
//otherwise the loop/s are continued for the next liquid
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchStloc(4), i => i.MatchBr(out _), i => i.MatchLdloc(2), i => i.MatchLdfld(typeof(LiquidRenderer).GetNestedType("LiquidDrawCache", BindingFlags.NonPublic), "IsVisible")))
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchStloc(4), i => i.MatchBr(out _), i => i.MatchLdloc(2), i => i.MatchLdfld(typeof(LiquidRenderer).GetNestedType("LiquidDrawCache", BindingFlags.Public), "IsVisible")))
{
LogFailure("Liquid Renderer Drawing", "Could not locate the IsVisible boolean check");
return;
}
cursor.EmitLdarg3();
cursor.EmitLdloc2(); //Initiated Liquid Draw Cache (needed for the Type parameter)
cursor.EmitLdfld(typeof(LiquidRenderer).GetNestedType("LiquidDrawCache", BindingFlags.NonPublic).GetRuntimeField("Type"));
cursor.EmitLdfld(typeof(LiquidRenderer).GetNestedType("LiquidDrawCache", BindingFlags.Public).GetRuntimeField("Type"));
cursor.EmitDelegate<Func<bool, int, int, bool>>((IsVisible, style, type) => IsVisible && ((type == 1 && style >= LavaRenderingSystem.Instance.WaterStyleMaxCount + 1) || (type != 1 && style <= LavaRenderingSystem.Instance.WaterStyleMaxCount)));
//Lava alpha color, if the liquid drawn is lava, multiply num by the water alpha
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdloc(2), i => i.MatchLdfld(typeof(LiquidRenderer).GetNestedType("LiquidDrawCache", BindingFlags.NonPublic).GetRuntimeField("Type")), i => i.MatchStloc(8)))
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdloc(2), i => i.MatchLdfld(typeof(LiquidRenderer).GetNestedType("LiquidDrawCache", BindingFlags.Public).GetRuntimeField("Type")), i => i.MatchStloc(8)))
{
LogFailure("Liquid Renderer Drawing", "Could not locate creation of the local variable num2 (the liquid type holder variable)");
return;
@@ -1140,69 +1134,13 @@ namespace CalamityMod.ILEditing
}
cursor.EmitLdarg3();
cursor.EmitLdloc2(); //Initiated Liquid Draw Cache (needed for the Type parameter)
cursor.EmitLdfld(typeof(LiquidRenderer).GetNestedType("LiquidDrawCache", BindingFlags.NonPublic).GetRuntimeField("Type"));
cursor.EmitLdfld(typeof(LiquidRenderer).GetNestedType("LiquidDrawCache", BindingFlags.Public).GetRuntimeField("Type"));
cursor.EmitDelegate<Func<Texture2D, int, int, Texture2D>>((initialTexture, style, type) =>
(style >= LavaRenderingSystem.Instance.WaterStyleMaxCount + 1 && type == LiquidID.Lava)
? LavaRenderingSystem.Textures.liquid[style - LavaRenderingSystem.Instance.WaterStyleMaxCount - 1].Value
: initialTexture
);
}
private void BlockLavaDrawing_LiquidSlopesPatch(ILContext il)
{
Assembly lspAsm = ModLoader.GetMod("LiquidSlopesPatch").Code;
Type liquidDrawCache = lspAsm.GetType("LiquidSlopesPatch.Common.RewrittenLiquidRenderer").GetNestedType("LiquidDrawCache");
//This edit to DrawNormalLiquids makes lavas in normal and white lighting draw with an alpha and with new textures
//If the parameter for the waterstyle is more than the max waterstyles then its subtracted by the max water style count and thats the lava style ID
ILCursor cursor = new ILCursor(il);
//Continue if statement, basically
//if the liquid being drawn is lava and the water style is greater than the max water styles or if the liquid is water and less than the max water styles then the draw code is ran
//otherwise the loop/s are continued for the next liquid
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdfld(liquidDrawCache, "IsVisible")))
{
LogFailure("Liquid Renderer Drawing", "Could not locate the IsVisible boolean check");
return;
}
cursor.EmitLdarg3();
cursor.EmitLdloc2(); //Initiated Liquid Draw Cache (needed for the Type parameter)
cursor.EmitLdfld(liquidDrawCache.GetField("Type"));
cursor.EmitDelegate<Func<bool, int, int, bool>>((IsVisible, style, type) => IsVisible && ((type == 1 && style >= LavaRenderingSystem.Instance.WaterStyleMaxCount + 1) || (type != 1 && style <= LavaRenderingSystem.Instance.WaterStyleMaxCount)));
//Lava alpha color, if the liquid drawn is lava, multiply num by the water alpha
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdloc(2), i => i.MatchLdfld(liquidDrawCache.GetField("Type")), i => i.MatchStloc(8)))
{
LogFailure("Liquid Renderer Drawing", "Could not locate creation of the local variable num2 (the liquid type holder variable)");
return;
}
cursor.EmitLdloc(8);
cursor.EmitLdloca(7);
cursor.EmitLdarg(4);
cursor.EmitDelegate((int num2, ref float num, float globalAlpha) =>
{
if (num2 == LiquidID.Lava)
{
num *= globalAlpha;
}
});
//Conditionally replace the liquid texture whether the liquid is lava or water
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchCallvirt(typeof(Asset<Texture2D>).GetMethod("get_Value", BindingFlags.Public | BindingFlags.Instance))))
{
LogFailure("Liquid Renderer Drawing", "Could not locate the Texture2D array of liquids");
return;
}
cursor.EmitLdarg3();
cursor.EmitLdloc2(); //Initiated Liquid Draw Cache (needed for the Type parameter)
cursor.EmitLdfld(liquidDrawCache.GetField("Type"));
cursor.EmitDelegate<Func<Texture2D, int, int, Texture2D>>((initialTexture, style, type) =>
(style >= LavaRenderingSystem.Instance.WaterStyleMaxCount + 1 && type == LiquidID.Lava)
? LavaRenderingSystem.Textures.liquid[style - LavaRenderingSystem.Instance.WaterStyleMaxCount - 1].Value
: initialTexture
);
}
private void BlockLavaDrawingForSlopes(On_TileDrawing.orig_DrawTile_LiquidBehindTile orig, TileDrawing self, bool solidLayer, bool inFrontOfPlayers, int waterStyleOverride, Vector2 screenPosition, Vector2 screenOffset, int tileX, int tileY, Tile tileCache)
{
if (tileCache.LiquidType == LiquidID.Lava)
@@ -1266,7 +1204,8 @@ namespace CalamityMod.ILEditing
}
cursor.EmitLdloc(12);
cursor.EmitLdloc(11);
cursor.EmitDelegate((int i, int j) => {
cursor.EmitDelegate((int i, int j) =>
{
return Main.tile[i, j].LiquidType == LiquidID.Lava;
});
cursor.EmitBrtrue(target);
@@ -1442,75 +1381,25 @@ namespace CalamityMod.ILEditing
float g = 0.33f;
float b = 0.11f;
LavaStylesLoader.ModifyLightSetup(x, y, LavaRenderingSystem.LavaStyle, ref r, ref g, ref b);
if (!(r == 0 && g == 0 && b == 0))
{
float r8;
float num3 = (r8 = (r + (float)(270 - Main.mouseTextColor) / 900f) * 0.4f);
float g8 = num3 * g;
float b8 = num3 * b;
Lighting.AddLight(x, y, r8, g8, b8);
}
Lighting.AddLight(x, y, r, g, b);
return;
}
orig.Invoke(waterfallType, x, y);
}
private static void LiquidDrawColors(ILContext il)
{
if (ModLoader.HasMod("LiquidSlopesPatch"))
{
LiquidDrawColors_LiquidSlopesPatch(il);
}
else
{
LiquidDrawColors_Vanilla(il);
}
}
private static void LiquidDrawColors_Vanilla(ILContext il)
{
ILCursor cursor = new ILCursor(il);
if (!cursor.TryGotoNext(MoveType.Before, c => c.MatchLdarg2(), c => c.MatchLdloc3(), c => c.MatchLdloc(4), c => c.MatchCall<Main>("DrawTileInWater")))
if (!cursor.TryGotoNext(MoveType.Before, c => c.MatchLdarg2(), c => c.MatchLdloc(9), c => c.MatchLdloc(10), c => c.MatchCall<Main>("DrawTileInWater")))
{
LogFailure("Liquid Draw Colors", "Could not locate the liquid vertex colors for drawing");
return;
}
cursor.Emit(OpCodes.Ldloc_3);
cursor.Emit(OpCodes.Ldloc, 4);
cursor.Emit(OpCodes.Ldloc_2);
cursor.Emit(OpCodes.Ldfld, typeof(LiquidRenderer).GetNestedType("LiquidDrawCache", BindingFlags.NonPublic).GetRuntimeField("Type"));
cursor.Emit(OpCodes.Ldloca, 9);
cursor.EmitDelegate((int x, int y, int liquidType, ref VertexColors initialColor) =>
{
if (liquidType == LiquidID.Water)
{
CalamityWaterLoader.DrawColorSetup(x, y, Main.waterStyle, ref initialColor);
}
else if (liquidType == LiquidID.Lava && ExternalMods.biomeLava == null)
{
LavaStylesLoader.DrawColorSetup(x, y, LavaRenderingSystem.LavaStyle, ref initialColor);
}
});
}
private static void LiquidDrawColors_LiquidSlopesPatch(ILContext il)
{
Assembly lspAsm = ModLoader.GetMod("LiquidSlopesPatch").Code;
Type liquidDrawCache = lspAsm.GetType("LiquidSlopesPatch.Common.RewrittenLiquidRenderer").GetNestedType("LiquidDrawCache");
ILCursor cursor = new ILCursor(il);
if (!cursor.TryGotoNext(MoveType.Before, c => c.MatchLdarg2(), c => c.MatchLdloc(out _), c => c.MatchLdloc(out _), c => c.MatchCall<Main>("DrawTileInWater")))
{
LogFailure("Liquid Draw Colors (LSP)", "Could not locate the liquid vertex colors for drawing");
return;
}
cursor.Emit(OpCodes.Ldloc, 9);
cursor.Emit(OpCodes.Ldloc, 10);
cursor.Emit(OpCodes.Ldloc_2);
cursor.Emit(OpCodes.Ldfld, liquidDrawCache.GetField("Type"));
cursor.Emit(OpCodes.Ldfld, typeof(LiquidRenderer).GetNestedType("LiquidDrawCache", BindingFlags.Public).GetRuntimeField("Type"));
cursor.Emit(OpCodes.Ldloca, 11);
cursor.EmitDelegate((int x, int y, int liquidType, ref VertexColors initialColor) =>
@@ -1746,16 +1635,6 @@ namespace CalamityMod.ILEditing
}
#endregion
#region Find Calamity Item Dye Shader
internal static void FindCalamityItemDyeShader(On_Player.orig_UpdateItemDye orig, Player self, bool isNotInVanitySlot, bool isSetToHidden, Item armorItem, Item dyeItem)
{
orig(self, isNotInVanitySlot, isSetToHidden, armorItem, dyeItem);
if (armorItem.type == ModContent.ItemType<Calamity>())
self.Calamity().CalamityFireDyeShader = GameShaders.Armor.GetShaderFromItemId(dyeItem.type);
}
#endregion
#region Scopes Require Visibility to Zoom
private static void ScopesRequireVisibilityToZoom(ILContext il)
{
@@ -2674,7 +2553,7 @@ namespace CalamityMod.ILEditing
}
NetMessage.SendData(MessageID.PlayerControls, -1, -1, null, self.owner);
}
SoundEngine.PlaySound(SoundID.DD2_EtherianPortalSpawnEnemy with {Volume = 0.75f }, self.Center);
SoundEngine.PlaySound(SoundID.DD2_EtherianPortalSpawnEnemy with { Volume = 0.75f }, self.Center);
self.ai[0] = 2;
self.velocity = Vector2.Zero;
self.Calamity().arenaBoxPosition = new Vector2(Utils.Remap(self.Center.X, box.TopLeft.X, box.BottomRight.X, 0, 1, false), Utils.Remap(self.Center.Y, box.TopLeft.Y, box.BottomRight.Y, 0, 1, false));
@@ -2736,8 +2615,8 @@ namespace CalamityMod.ILEditing
foreach (var item in ArenaWallSystem.ActiveBoxes)
{
var oldVel = Velocity;
if (item.InnerEffect(Position,new Vector2(Width,Height)))
Velocity = ArenaCollisionLogic(item, Position, Width, Height, Velocity);
if (item.InnerEffect(Position, new Vector2(Width, Height)))
Velocity = ArenaCollisionLogic(item, Position, Width, Height, Velocity);
var dif = (oldVel - Velocity).Length();
}
}
+64 -31
View File
@@ -4,10 +4,8 @@ using System.Reflection;
using CalamityMod.Events;
using CalamityMod.Items.Fishing;
using CalamityMod.Items.Materials;
using CalamityMod.Items.TreasureBags.MiscGrabBags;
using CalamityMod.NPCs.AcidRain;
using CalamityMod.NPCs.NormalNPCs;
using CalamityMod.NPCs.TownNPCs;
using CalamityMod.Projectiles.Typeless;
using CalamityMod.Walls;
using CalamityMod.World;
@@ -17,13 +15,14 @@ using MonoMod.Cil;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.GameContent.Drawing;
using Terraria.GameContent.ItemDropRules;
using Terraria.GameInput;
using Terraria.Graphics.Effects;
using Terraria.Graphics.CameraModifiers;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Graphics.Effects;
using Terraria.GameInput;
using ReLogic.Utilities;
namespace CalamityMod.ILEditing
{
@@ -157,8 +156,10 @@ namespace CalamityMod.ILEditing
#region Prevention of Slime Rain Spawns When Near Bosses
private static void PreventBossSlimeRainSpawns(On_NPC.orig_SlimeRainSpawns orig, int plr)
{
if (!Main.player[plr].Calamity().isNearbyBoss && CalamityServerConfig.Instance.BossZen)
orig(plr);
if (CalamityServerConfig.Instance.BossZen && Main.player[plr].Calamity().isNearbyBoss)
return;
orig(plr);
}
#endregion Prevention of Slime Rain Spawns When Near Bosses
@@ -175,9 +176,10 @@ namespace CalamityMod.ILEditing
return;
}
// Remove the Expert Mode check, and in its place put a check for the Zenith seed (Get fixed boi).
cursor.Emit(OpCodes.Pop);
cursor.Emit(OpCodes.Ldsfld, typeof(Main).GetField("zenithWorld"));
// AND with 0, so that Expert Mode is never considered active.
// Calamity implements something more sinister in GFB :)
cursor.Emit(OpCodes.Ldc_I4_0);
cursor.Emit(OpCodes.And);
}
#endregion
@@ -236,6 +238,28 @@ namespace CalamityMod.ILEditing
}
#endregion
#region Make PunchCameraModifier Affected by Screenshake Config
private static void PunchCameraUsesScreenshakeConfig(ILContext il)
{
// Allow the screenshake from PunchCameraModifier to scale based on our screenshake power config.
var cursor = new ILCursor(il);
// There are 3 local variables that control the strength of the screenshake in separate ways, but they all get multiplied together at the end.
// Thus it doesn't matter at all which one is multiplied to. Here I chose num2.
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchStloc2()))
{
LogFailure("Make PunchCameraModifier Affected by Screenshake Config", "Could not move to the location to inject code.");
return;
}
// Emit a delegate which grabs the value of the screenshake config. Then multiply the local variable by it.
cursor.Emit(OpCodes.Ldloc_1);
cursor.EmitDelegate<Func<float>>(() => CalamityClientConfig.Instance.ScreenshakePower);
cursor.Emit(OpCodes.Mul);
cursor.Emit(OpCodes.Stloc_1);
}
#endregion
#region Make Meteorite Explodable
private static void MakeMeteoriteExplodable(ILContext il)
{
@@ -577,7 +601,7 @@ namespace CalamityMod.ILEditing
LogFailure("Use VisibleThroughWater Map Tile", "Could not locate call to Terraria.Map.TileMap::get_Item.");
return;
}
int tileIndex = -1;
if (!c.TryGotoNext(x => x.MatchStloc(out tileIndex)) || tileIndex == -1)
{
@@ -777,12 +801,13 @@ namespace CalamityMod.ILEditing
private static void DelayGravity(On_Player.orig_UpdateControlHolds orig, Player Player)
{
var cplay = Player.Calamity();
if (CalamityKeybinds.SwitchGravityHotkey.GetAssignedKeys().Count != 0 && (Player.gravControl || Player.gravControl2) && !Player.mount.Active)
if (CalamityKeybinds.SwitchGravityHotkey.GetAssignedKeysOrEmpty().Count != 0 && (Player.gravControl || Player.gravControl2) && !Player.mount.Active)
{
if (Player.controlUp && Player.releaseUp) {
if (Player.controlUp && Player.releaseUp)
{
Player.gravDir *= -1;
}
if (CalamityKeybinds.SwitchGravityHotkey.JustPressed)
if (CalamityKeybinds.SwitchGravityHotkey.JustPressed)
{
Player.gravDir *= -1;
Player.fallStart = (int)(Player.position.Y / 16f);
@@ -790,33 +815,40 @@ namespace CalamityMod.ILEditing
SoundEngine.PlaySound(SoundID.Item8, Player.position);
}
if (Player.forcedGravity > 0) {
Player.gravDir = -1f;
}
if (Player.forcedGravity > 0)
{
Player.gravDir = -1f;
}
}
if (cplay.justChangedGravity) {
if (cplay.justChangedGravity)
{
Player.gravDir = cplay.oldGravDir;
}
cplay.justChangedGravity = cplay.oldGravDir != Player.gravDir;
cplay.oldGravDir = Player.gravDir;
if (Main.netMode != NetmodeID.Server && !Main.gameMenu && CalamityClientConfig.Instance.DisableGravityScreenSwap)
{
if (Player.gravDir == -1) {
if (!Filters.Scene["CalamityMod:FlipScreen"].IsActive()) {
Filters.Scene.Activate("CalamityMod:FlipScreen");
Filters.Scene["CalamityMod:FlipScreen"].Opacity = 1f;
if (Player.gravDir == -1)
{
if (!Filters.Scene["CalamityMod:FlipScreen"].IsActive())
{
Filters.Scene.Activate("CalamityMod:FlipScreen");
Filters.Scene["CalamityMod:FlipScreen"].Opacity = 1f;
}
}
} else {
if (Filters.Scene["CalamityMod:FlipScreen"].IsActive()) {
Filters.Scene["CalamityMod:FlipScreen"].Opacity = 0f;
Filters.Scene.Deactivate("CalamityMod:FlipScreen");
else
{
if (Filters.Scene["CalamityMod:FlipScreen"].IsActive())
{
Filters.Scene["CalamityMod:FlipScreen"].Opacity = 0f;
Filters.Scene.Deactivate("CalamityMod:FlipScreen");
}
}
}
}
if (cplay.justChangedGravity)
{
Player.gravDir *= -1;
@@ -824,7 +856,8 @@ namespace CalamityMod.ILEditing
orig(Player);
}
private static void GravityMouse(On_PlayerInput.orig_SetZoom_MouseInWorld orig) {
private static void GravityMouse(On_PlayerInput.orig_SetZoom_MouseInWorld orig)
{
orig();
if (!Main.gameMenu && Filters.Scene["CalamityMod:FlipScreen"].IsActive())//((Main.LocalPlayer.gravDir == -1 && !Main.LocalPlayer.Calamity().justChangedGravity) || (Main.LocalPlayer.Calamity().oldGravDir == -1 && Main.LocalPlayer.Calamity().justChangedGravity))
{
@@ -841,7 +874,7 @@ namespace CalamityMod.ILEditing
}
orig(self);
}
private static void UI_Unflip_End(On_Main.orig_DrawInterface orig, Main self, GameTime gameTime)
{
orig(self, gameTime);
-3
View File
@@ -11,9 +11,6 @@ namespace CalamityMod.Items.Accessories
{
public new string LocalizationCategory => "Items.Accessories";
public static double PlatesAllDamageReduction = 0.15D;
public static double PlatesHitDecay = 0.03D;
public override string AssetPath => "CalamityMod/Items/Accessories/";
public override (EquipType, string, string)[] EquipSlots =>
[
+1 -1
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories
public new string LocalizationCategory => "Items.Accessories";
public static float WaterSpeedBoost = 0.15f;
public static double IceShieldAllDamageReduction = 0.2D;
public static float IceShieldDamageReductionBoost = 0.2f;
public override string AssetPath => "CalamityMod/Items/Accessories/";
public override (EquipType, string, string)[] EquipSlots =>
+3
View File
@@ -4,6 +4,7 @@ using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
@@ -46,6 +47,8 @@ namespace CalamityMod.Items.Accessories
player.Calamity().blazingCursorVisuals = true;
}
public override void UpdateItemDye(Player player, int dye, bool hideVisual) => player.Calamity().CalamityFireDyeShader = GameShaders.Armor.GetSecondaryShader(dye, player);
public override void UpdateEquip(Player player) => player.Calamity().blazingCursorVisuals = true;
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
+1 -1
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories
internal static readonly int EncasedIFrames = 90;
public static int EncasedDefenseBoost = 30;
public static double EncasedAllDamageReduction = 0.3D;
public static float EncasedDamageReductionBoost = 0.3f;
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
+1 -2
View File
@@ -19,7 +19,6 @@ namespace CalamityMod.Items.Accessories
Item.height = 26;
Item.value = CalamityGlobalItem.RarityOrangeBuyPrice;
Item.rare = ItemRarityID.Orange;
Item.accessory = true;
}
public override void UpdateInventory(Player player)
@@ -199,7 +198,7 @@ namespace CalamityMod.Items.Accessories
}
list.FindAndReplace("[ITEMS]", stats2);
float moveSpeedBoost = CalamityServerConfig.Instance.FasterBaseSpeed ? (player.moveSpeed / BalancingConstants.DefaultMoveSpeedBoost) - 1f : player.moveSpeed - 1f;
float moveSpeedBoost = CalamityServerConfig.Instance.FasterBaseSpeed ? (player.moveSpeed / BalancingConstants.DefaultMoveSpeedBoost) - 1f : player.moveSpeed - 1f;
float wingFlightTime = player.wingTimeMax;
// Does not use NormalizedLuck. Presents the player's luck exactly as it is used by the game engine.
// NormalizedLuck is only used in one place: the Wizard's luck report. Which is entirely obsoleted by this Meter.
@@ -36,6 +36,8 @@ namespace CalamityMod.Items.Accessories.Wings
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.DisableWingFlapSound();
if (player.controlJump && player.wingTime > 0f && player.jump == 0 && player.velocity.Y != 0f && !hideVisual)
{
player.rocketDelay2--;
+6 -6
View File
@@ -70,12 +70,12 @@ namespace CalamityMod.Items.Accessories.Wings
{
if (Item.wingSlot == -1) return;
WingStats stats = new();
if (Item.type == ModContent.ItemType<TracersCelestial>())
stats = ArmorIDs.Wing.Sets.Stats[TracersCelestial.wingSlot];
else if (Item.type == ModContent.ItemType<TracersElysian>())
stats = ArmorIDs.Wing.Sets.Stats[TracersElysian.wingSlot];
else if (Item.type == ModContent.ItemType<TracersSeraph>())
stats = ArmorIDs.Wing.Sets.Stats[TracersSeraph.wingSlot];
if (Item.type == ModContent.ItemType<MoonWalkers>())
stats = ArmorIDs.Wing.Sets.Stats[MoonWalkers.wingSlot];
else if (Item.type == ModContent.ItemType<VoidStriders>())
stats = ArmorIDs.Wing.Sets.Stats[VoidStriders.wingSlot];
else if (Item.type == ModContent.ItemType<SeraphTracers>())
stats = ArmorIDs.Wing.Sets.Stats[SeraphTracers.wingSlot];
else stats = ArmorIDs.Wing.Sets.Stats[Item.wingSlot];
int time = stats.FlyTime;
float run = stats.AccRunSpeedOverride;
+2
View File
@@ -87,6 +87,8 @@ namespace CalamityMod.Items.Accessories.Wings
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.DisableWingFlapSound();
if (toggleEnabled && player.controlJump && player.wingTime > 0f && player.jump == 0 && player.velocity.Y != 0f && !hideVisual)
{
player.rocketDelay2--;
@@ -15,8 +15,8 @@ using Terraria.ModLoader.IO;
namespace CalamityMod.Items.Accessories.Wings
{
[AutoloadEquip(EquipType.Wings, EquipType.Shoes)]
[LegacyName("InfinityBoots", "SeraphTracers")]
public class TracersCelestial : BaseWings
[LegacyName("InfinityBoots", "TracersCelestial")]
public class MoonWalkers : BaseWings
{
public override float BonusAscentWhileFalling => 0.75f;
public override float BonusAscentWhileRising => 0.15f;
@@ -82,8 +82,12 @@ namespace CalamityMod.Items.Accessories.Wings
}
public override void PostDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
Item.SetNameOverride(CalamityUtils.GetTextValue($"Items.Accessories.Wings.MoonWalkers.{(toggleEnabled ? "DisplayName" : "TreadsName")}"));
CalamityUtils.DrawInventoryDot(spriteBatch, position, new Vector2(16, 16) * Main.inventoryScale, toggleEnabled);
}
public override void UpdateInventory(Player player)
{
}
#endregion
public override void UpdateAccessory(Player player, bool hideVisual)
{
@@ -118,7 +122,7 @@ namespace CalamityMod.Items.Accessories.Wings
modPlayer.angelTreads = true;
}
modPlayer.tracersDust = !hideVisual && toggleEnabled;
modPlayer.tracersCelestial = true;
modPlayer.moonWalkers = true;
}
public override void AddRecipes()
File renamed without changes.

Before

Width:  |  Height:  |  Size: 807 B

After

Width:  |  Height:  |  Size: 807 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

@@ -13,14 +13,15 @@ using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;
namespace CalamityMod.Items.Accessories.Wings
{
[AutoloadEquip(EquipType.Wings)]
[LegacyName("CelestialTracers")]
public class TracersSeraph : BaseWings
[LegacyName("CelestialTracers", "TracersSeraph")]
public class SeraphTracers : BaseWings
{
public override float BonusAscentWhileFalling => 0.95f;
public override float BonusAscentWhileRising => 0.16f;
@@ -86,6 +87,7 @@ namespace CalamityMod.Items.Accessories.Wings
}
public override void PostDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
Item.SetNameOverride(CalamityUtils.GetTextValue($"Items.Accessories.Wings.SeraphTracers.{(toggleEnabled ? "DisplayName" : "TreadsName")}"));
CalamityUtils.DrawInventoryDot(spriteBatch, position, new Vector2(16, 16) * Main.inventoryScale, toggleEnabled);
}
#endregion
@@ -123,13 +125,13 @@ namespace CalamityMod.Items.Accessories.Wings
modPlayer.angelTreads = true;
}
modPlayer.tracersDust = !hideVisual && toggleEnabled;
modPlayer.tracersSeraph = true; // Grants immunity to Auric Rejection and other walk-on-block effects
modPlayer.seraphTracers = true; // Grants immunity to Auric Rejection and other walk-on-block effects
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<TracersElysian>().
AddIngredient<VoidStriders>().
AddIngredient<AuricBar>(5).
AddIngredient<AscendantSpiritEssence>(3).
AddTile<CosmicAnvil>().
File renamed without changes.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

@@ -18,8 +18,8 @@ using Terraria.ModLoader.IO;
namespace CalamityMod.Items.Accessories.Wings
{
[AutoloadEquip(EquipType.Wings)]
[LegacyName("ElysianTracers")]
public class TracersElysian : BaseWings
[LegacyName("ElysianTracers", "TracersElysian")]
public class VoidStriders : BaseWings
{
public override float BonusAscentWhileFalling => 0.85f;
public override float BonusAscentWhileRising => 0.15f;
@@ -85,8 +85,12 @@ namespace CalamityMod.Items.Accessories.Wings
}
public override void PostDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
Item.SetNameOverride(CalamityUtils.GetTextValue($"Items.Accessories.Wings.VoidStriders.{(toggleEnabled ? "DisplayName" : "TreadsName")}"));
CalamityUtils.DrawInventoryDot(spriteBatch, position, new Vector2(16, 16) * Main.inventoryScale, toggleEnabled);
}
public override void UpdateInventory(Player player)
{
}
#endregion
public override void UpdateAccessory(Player player, bool hideVisual)
{
@@ -122,13 +126,13 @@ namespace CalamityMod.Items.Accessories.Wings
modPlayer.angelTreads = true;
}
modPlayer.tracersDust = !hideVisual && toggleEnabled;
modPlayer.tracersElysian = true;
modPlayer.voidStriders = true;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<TracersCelestial>().
AddIngredient<MoonWalkers>().
AddIngredient<ArmoredShell>(3).
AddIngredient<TwistingNether>(3).
AddIngredient<DarkPlasma>(3).
File renamed without changes.

Before

Width:  |  Height:  |  Size: 985 B

After

Width:  |  Height:  |  Size: 985 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

-5
View File
@@ -20,10 +20,5 @@ namespace CalamityMod.Items.Ammo
{
itemGroup = ContentSamples.CreativeHelper.ItemGroup.Solutions;
}
public override bool CanConsumeAmmo(Item ammo, Player player)
{
return !(player.itemAnimation < player.ActiveItem().useAnimation - 3);
}
}
}
@@ -24,7 +24,7 @@ namespace CalamityMod.Items.Armor.Bloodflare
public static int HitsToActivateFrenzy = 15;
public static float FrenzyMeleeDamageBoost = 0.25f;
public static int FrenzyMeleeCritBoost = 25; // NOTE: Tooltip shares this number with damage % as they're equal
public static double FrenzyContactDamageReduction = 0.5D;
public static float FrenzyContactDamageReduction = 0.5f;
public static int FrenzyDuration = CalamityUtils.SecondsToFrames(5);
public static int FrenzyCooldown = CalamityUtils.SecondsToFrames(30);
+1 -1
View File
@@ -23,7 +23,7 @@ namespace CalamityMod.Items.Armor.Tarragon
public static int SetBonusAggroBoost = 800;
public static int TarraLifeDuration = CalamityUtils.SecondsToFrames(5);
public static int TarraLifeRegenBoost = 3;
public static double CloakContactDamageReduction = 0.5D;
public static float CloakContactDamageReduction = 0.5f;
public static int CloakDuration = CalamityUtils.SecondsToFrames(10);
public static int CloakCooldown = CalamityUtils.SecondsToFrames(30);
+31 -15
View File
@@ -89,6 +89,7 @@ namespace CalamityMod.Items.BaseItems
}
internal TransformationAccessory currentTransformation = null;
internal TransformationAccessory previousTransformation = null;
int previousHighest = -1;
int currentHighest = -1;
@@ -113,7 +114,14 @@ namespace CalamityMod.Items.BaseItems
{
orig(self);
Reset(self);
if (!self.dead)
Reset(self);
else
{
TransformationAccessory trans = self.Transformation().currentTransformation = self.Transformation().previousTransformation;
if (trans is not null)
EquipTransformation(trans, self, Mod);
}
}
private void Reset(Player p)
@@ -122,13 +130,16 @@ namespace CalamityMod.Items.BaseItems
currentHighest = -1;
if (p.Transformation().currentTransformation != null && !p.Transformation().currentTransformation.IsForced)
p.Transformation().currentTransformation = null;
{
p.Transformation().previousTransformation = p.Transformation().currentTransformation;
p.Transformation().currentTransformation = null;
}
}
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))
@@ -141,18 +152,7 @@ namespace CalamityMod.Items.BaseItems
if (self.Transformation().currentTransformation != null && itemSlot == previousHighest) // last item slot, can set equip slots to our transformation if one is equipped
{
TransformationAccessory trans = self.Transformation().currentTransformation;
bool[] list = new bool[15];
foreach (var (Type, AssetName, EquipName) in trans.EquipSlots)
{
string name = AssetName == null ? null : EquipName ?? trans.Name;
if (!trans.CustomSetEquipType(self, Type, Mod, name) && !list[(int)Type])
{
SetEquipSlot(self, Type, Mod, name);
list[(int)Type] = true;
}
}
if (trans.ShouldHideAccessories)
self.HideAccessories();
EquipTransformation(trans, self, Mod);
}
}
@@ -284,6 +284,22 @@ namespace CalamityMod.Items.BaseItems
_ => -1,
};
public static void EquipTransformation(TransformationAccessory trans, Player self, Mod mod)
{
bool[] list = new bool[15];
foreach (var (Type, AssetName, EquipName) in trans.EquipSlots)
{
string name = AssetName == null ? null : EquipName ?? trans.Name;
if (!trans.CustomSetEquipType(self, Type, mod, name) && !list[(int)Type])
{
SetEquipSlot(self, Type, mod, name);
list[(int)Type] = true;
}
}
if (trans.ShouldHideAccessories)
self.HideAccessories();
}
public static EquipTexture GetEquipTexture(Player p, EquipType type) => EquipLoader.GetEquipTexture(type, GetEquipSlot(p, type));
}
}
-10
View File
@@ -874,10 +874,6 @@ namespace CalamityMod.Items
// Handle general use-item effects for the Gem Tech Armor.
player.Calamity().GemTechState.OnItemUseEffects(item);
if (item.type == ItemID.MonkStaffT1 || CalamityItemSets.AutoreusableSpear[item.type])
{
return player.ownedProjectileCounts[item.shoot] <= 0;
}
if (item.type == ItemID.RodofDiscord)
{
if (player.chaosState)
@@ -1284,12 +1280,6 @@ namespace CalamityMod.Items
player.Calamity().critDamage += 0.2f;
}
if (item.type == ItemID.MagicQuiver)
player.arrowDamage -= 0.05f;
if (item.type == ItemID.MoltenQuiver)
player.arrowDamage -= 0.03f;
if (item.type == ItemID.FireGauntlet)
{
player.GetDamage<MeleeDamageClass>() += 0.02f;
+2 -10
View File
@@ -679,7 +679,7 @@ namespace CalamityMod.Items
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.GetAssignedKeys().Count != 0)
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
@@ -929,17 +929,9 @@ namespace CalamityMod.Items
if (item.type == ItemID.ReconScope)
EditTooltipByNum(0, (line) => line.Text += AddedTooltip("RifleScope"));
// Magic Quiver
if (item.type == ItemID.MagicQuiver)
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MagicQuiver"));
// Molten Quiver
if (item.type == ItemID.MoltenQuiver)
{
EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MoltenQuiver1"));
EditTooltipByNum(2, (line) => line.Text = EditedTooltip("MoltenQuiver2"));
}
EditTooltipByNum(2, (line) => line.Text = EditedTooltip("MoltenQuiver"));
// Magic Power Potion nerf
if (item.type == ItemID.MagicPowerPotion)
+96 -180
View File
@@ -31,9 +31,8 @@ namespace CalamityMod.Items
// Various shorthands for items which receive very simple changes, or are repeated multiple times.
IItemTweak[] trueMelee = Do(TrueMelee);
IItemTweak[] trueMeleeNoSpeed = Do(TrueMeleeNoSpeed);
IItemTweak[] autoReuse = Do(AutoReuse);
IItemTweak[] nonConsumableBossSummon = Do(MaxStack(1), NotConsumable, UseTimeExact(10));
IItemTweak[] phaseblade = Do(AutoReuse, UseTurn, DamageExact(36));
IItemTweak[] nonConsumableBossSummon = Do(MaxStack(1), NotConsumable);
IItemTweak[] phaseblade = Do(UseTurn, DamageExact(36));
IItemTweak[] phasesaber = Do(DamageExact(132));
// SORTING NOTES:
@@ -43,7 +42,7 @@ namespace CalamityMod.Items
currentTweaks = new SortedDictionary<int, IItemTweak[]>
{
#region CATEGORY 1: Weapon Balancing
{ ItemID.AdamantiteGlaive, Do(AutoReuse, TrueMelee, DamageExact(69), UseExact(7), ShootSpeedExact(18f)) },
{ ItemID.AdamantiteGlaive, Do(TrueMelee, DamageExact(69), UseExact(7), ShootSpeedExact(18f)) },
{ ItemID.AdamantiteRepeater, Do(UseExact(14)) },
{ ItemID.AdamantiteSword, Do(UseTurn, DamageExact(75), UseExact(7)) },
{ ItemID.AmberStaff, Do(UseTimeExact(15), UseAnimationExact(45), ReuseDelayExact(15)) },
@@ -60,33 +59,33 @@ namespace CalamityMod.Items
{ ItemID.BeesKnees, Do(DamageExact(21), UseExact(38)) },
{ ItemID.Bladetongue, Do(UseTurn, UseRatio(0.8f), DamageExact(120)) },
{ ItemID.BlizzardStaff, Do(DamageExact(41), ManaExact(7)) },
{ ItemID.BloodyMachete, Do(AutoReuse, DamageExact(24)) },
{ ItemID.BloodyMachete, Do(DamageExact(24)) },
{ ItemID.Blowgun, Do(DamageExact(40), ShootSpeedExact(15f)) },
{ ItemID.BluePhaseblade, phaseblade },
{ ItemID.BluePhasesaber, phasesaber },
{ ItemID.BoneSword, Do(AutoReuse, UseTurn, DamageExact(25)) },
{ ItemID.BoneSword, Do(UseTurn, DamageExact(25)) },
{ ItemID.BookofSkulls, Do(DamageExact(27), ManaExact(13), ShootSpeedExact(5.5f)) },
{ ItemID.BookStaff, Do(ManaExact(14)) }, // Tome of Infinite Wisdom
{ ItemID.Boomstick, Do(DamageExact(11)) },
{ ItemID.BreakerBlade, Do(AutoReuse, UseTurn, DamageExact(140)) },
{ ItemID.BreakerBlade, Do(UseTurn, DamageExact(140)) },
{ ItemID.CandyCornRifle, Do(DamageExact(66)) },
{ ItemID.Cascade, Do(AutoReuse, DamageExact(31)) },
{ ItemID.Cascade, Do(DamageExact(31)) },
{ ItemID.ChainGuillotines, Do(DamageExact(100)) },
{ ItemID.ChainGun, Do(DamageExact(35)) },
{ ItemID.ChainKnife, Do(AutoReuse, DamageRatio(1.34f)) }, // Uses ratios due to remix seed
{ ItemID.ChainKnife, Do(DamageRatio(1.34f)) }, // Uses ratios due to remix seed
{ ItemID.ChlorophyteClaymore, Do(UseMeleeSpeed, DamageExact(180), UseExact(45), ShootSpeedExact(22f)) },
{ ItemID.ChlorophytePartisan, Do(AutoReuse, UseMeleeSpeed, DamageExact(98)) },
{ ItemID.ChlorophytePartisan, Do(UseMeleeSpeed, DamageExact(98)) },
{ ItemID.ChlorophyteSaber, Do(UseMeleeSpeed, DamageExact(92), UseExact(10)) },
{ ItemID.ChristmasTreeSword, Do(UseTurn, UseMeleeSpeed, DamageExact(80), UseExact(30)) },
{ ItemID.ClingerStaff, Do(DamageExact(63)) },
{ ItemID.ClockworkAssaultRifle, Do(DamageExact(21)) },
{ ItemID.CobaltNaginata, Do(AutoReuse, TrueMelee, DamageExact(55), UseExact(9), ShootSpeedExact(12f)) },
{ ItemID.CobaltNaginata, Do(TrueMelee, DamageExact(55), UseExact(9), ShootSpeedExact(12f)) },
{ ItemID.CobaltRepeater, Do(UseExact(18)) },
{ ItemID.CobaltSword, Do(DamageExact(60), UseExact(9)) },
{ ItemID.Code2, Do(AutoReuse, DamageExact(43)) },
{ ItemID.Code2, Do(DamageExact(43)) },
{ ItemID.CoinGun, Do(UseExact(12)) },
{ ItemID.CorruptYoyo, Do(AutoReuse, DamageExact(20)) }, // Malaise
{ ItemID.CrimsonYoyo, Do(AutoReuse, DamageExact(20)) }, // Artery
{ ItemID.CorruptYoyo, Do(DamageExact(20)) }, // Malaise
{ ItemID.CrimsonYoyo, Do(DamageExact(20)) }, // Artery
{ ItemID.CrystalBullet, Do(DamageExact(6)) },
{ ItemID.CrystalDart, Do(DamageExact(20)) },
{ ItemID.CrystalStorm, Do(DamageExact(40)) },
@@ -96,64 +95,63 @@ namespace CalamityMod.Items
{ ItemID.Cutlass, Do(UseRatio(0.9f), DamageExact(90)) },
{ ItemID.DaedalusStormbow, Do(DamageExact(30)) },
{ ItemID.DaoofPow, Do(DamageExact(85)) }, // Displays as 170 damage
{ ItemID.DarkLance, Do(AutoReuse, TrueMelee, DamageExact(40)) },
{ ItemID.DarkLance, Do(TrueMelee, DamageExact(40)) },
{ ItemID.DartRifle, Do(DamageExact(58)) },
{ ItemID.DayBreak, Do(DamageExact(125), UseExact(22)) },
{ ItemID.DD2BetsyBow, Do(DamageExact(42)) }, // Aerial Bane's ridiculous multiplier is removed, so this compensates for that
{ ItemID.DD2SquireBetsySword, Do(UseMeleeSpeed, DamageExact(150)) }, // Flying Dragon
{ ItemID.DD2SquireDemonSword, Do(DamageExact(110), UseExact(25)) }, // Brand of the Inferno
{ ItemID.DeadlySphereStaff, Do(UseExact(20), DamageExact(50)) },
{ ItemID.DeadlySphereStaff, Do(DamageExact(50)) },
{ ItemID.DeathSickle, Do(UseMeleeSpeed, DamageExact(70), ShootSpeedExact(15f)) },
{ ItemID.DemonBow, Do(DamageExact(12), AutoReuse) },
{ ItemID.DemonScythe, Do(AutoReuse, DamageExact(28)) },
{ ItemID.DyeTradersScimitar, Do(AutoReuse, UseTurn, DamageExact(24)) }, // Exotic Scimitar
{ ItemID.DemonBow, Do(DamageExact(12)) },
{ ItemID.DemonScythe, Do(DamageExact(28)) },
{ ItemID.DyeTradersScimitar, Do(UseTurn, DamageExact(24)) }, // Exotic Scimitar
{ ItemID.ElfMelter, Do(ShootSpeedDelta(+5f)) },
{ ItemID.EmeraldStaff, Do(DamageExact(27)) },
{ ItemID.EmpressBlade, Do(DamageExact(50), UseExact(20)) }, // Terraprisma
{ ItemID.EmpressBlade, Do(DamageExact(50)) }, // Terraprisma
{ ItemID.EnchantedBoomerang, Do(DamageExact(24)) },
{ ItemID.EnchantedSword, Do(UseMeleeSpeed, DamageExact(30), ShootSpeedExact(15f)) },
{ ItemID.EndlessMusketPouch, Do(DamageExact(8)) },
{ ItemID.Excalibur, Do(TrueMelee, DamageExact(205), UseExact(24)) },
{ ItemID.Excalibur, Do(TrueMelee, DamageExact(170)) },
{ ItemID.FairyQueenMagicItem, Do(DamageExact(54)) }, // Nightglow
{ ItemID.FalconBlade, Do(UseTurn, UseExact(13)) },
{ ItemID.FireworksLauncher, Do(DamageExact(50), UseExact(25)) }, // Celebration
{ ItemID.Flamarang, Do(DamageExact(37)) },
{ ItemID.Flamelash, Do(DamageExact(36), ManaExact(18)) },
{ ItemID.Flamethrower, Do(DamageExact(21), ShootSpeedDelta(+3f)) },
{ ItemID.FlowerofFire, Do(AutoReuse, ManaExact(7), UseRatio(0.88f), DamageRatio(0.7f)) }, // Uses ratios due to remix seed
{ ItemID.FlowerofFrost, Do(AutoReuse, ManaExact(7), UseExact(22), DamageExact(70), ShootSpeedExact(14)) },
{ ItemID.FlowerofFire, Do(ManaExact(7), DamageRatio(0.78f)) }, // Uses ratios due to remix seed
{ ItemID.FlowerofFrost, Do(ManaExact(7), UseExact(22), DamageExact(70), ShootSpeedExact(14)) },
{ ItemID.FlyingKnife, Do(DamageExact(53)) },
{ ItemID.Frostbrand, Do(UseMeleeSpeed, DamageExact(88)) },
{ ItemID.Gatligator, Do(UseExact(6)) },
{ ItemID.GoldShortsword, Do(AutoReuse, TrueMelee, DamageExact(17)) },
{ ItemID.GoldShortsword, Do(TrueMelee, DamageExact(17)) },
{ ItemID.GolemFist, Do(DamageExact(150)) },
{ ItemID.Gradient, Do(AutoReuse, DamageExact(39)) },
{ ItemID.Gradient, Do(DamageExact(39)) },
{ ItemID.GreenPhaseblade, phaseblade },
{ ItemID.GreenPhasesaber, phasesaber },
{ ItemID.GrenadeLauncher, Do(DamageExact(105)) },
{ ItemID.Gungnir, Do(AutoReuse, TrueMelee, DamageExact(132), ShootSpeedExact(7f)) },
{ ItemID.Gungnir, Do(TrueMelee, DamageExact(132), ShootSpeedExact(7f)) },
{ ItemID.HallowedRepeater, Do(UseExact(12)) },
{ ItemID.Handgun, Do(UseExact(20)) },
{ ItemID.HighVelocityBullet, Do(DamageExact(13)) },
{ ItemID.HiveFive, Do(AutoReuse, DamageExact(27)) },
{ ItemID.HornetStaff, Do(DamageExact(18), UseExact(30)) },
{ ItemID.HiveFive, Do(DamageExact(27)) },
{ ItemID.HornetStaff, Do(DamageExact(18)) },
{ ItemID.IceBlade, Do(UseMeleeSpeed) },
{ ItemID.IceBoomerang, Do(UseExact(25), ShootSpeedExact(9)) },
{ ItemID.IceRod, Do(UseExact(6), ShootSpeedExact(20)) },
{ ItemID.IceSickle, Do(AutoReuse, UseMeleeSpeed, DamageExact(75), ShootSpeedExact(20f)) },
{ ItemID.IceSickle, Do(UseMeleeSpeed, DamageExact(75), ShootSpeedExact(20f)) },
{ ItemID.IchorArrow, Do(DamageExact(13)) },
{ ItemID.IchorBullet, Do(DamageExact(11)) },
{ ItemID.ImpStaff, Do(UseExact(30), DamageExact(25)) },
{ ItemID.ImpStaff, Do(DamageExact(25)) },
{ ItemID.InfernoFork, Do(DamageExact(83), ShootSpeedExact(11)) },
{ ItemID.InfluxWaver, Do(UseMeleeSpeed, DamageExact(80), UseExact(25)) },
{ ItemID.IronShortsword, Do(AutoReuse, TrueMelee, DamageExact(10)) },
{ ItemID.IronShortsword, Do(TrueMelee, DamageExact(10)) },
{ ItemID.Keybrand, Do(UseTurn) },
{ ItemID.KOCannon, Do(DamageRatio(2.65f)) }, // Uses ratios due to remix seed
{ ItemID.Kraken, Do(AutoReuse, DamageExact(65)) },
{ ItemID.Kraken, Do(DamageExact(65)) },
{ ItemID.LaserMachinegun, Do(DamageExact(49)) },
{ ItemID.LaserRifle, Do(DamageExact(46), UseExact(10), ManaExact(4)) },
{ ItemID.LastPrism, Do(DamageExact(57), ManaExact(10)) },
{ ItemID.LeadShortsword, Do(AutoReuse, TrueMelee, DamageExact(11)) },
{ ItemID.LeadShortsword, Do(TrueMelee, DamageExact(11)) },
{ ItemID.LeafBlower, Do(DamageExact(61)) },
{ ItemID.LightDisc, Do(DamageExact(80), ShootSpeedExact(18)) },
{ ItemID.LunarFlareBook, Do(DamageExact(110)) },
@@ -166,36 +164,36 @@ namespace CalamityMod.Items
{ ItemID.MiniNukeI, Do(DamageExact(90)) },
{ ItemID.MiniNukeII, Do(DamageExact(90)) },
{ ItemID.Minishark, Do(DamageExact(4)) },
{ ItemID.MoltenFury, Do(UseExact(28), AutoReuse) },
{ ItemID.MoltenFury, Do(UseExact(28)) },
{ ItemID.MonkStaffT1, Do(TrueMeleeNoSpeed, DamageExact(83)) }, // Sleepy Octopod
{ ItemID.MonkStaffT2, Do(AutoReuse, TrueMelee, DamageExact(90)) }, // Ghastly Glaive
{ ItemID.MonkStaffT2, Do(TrueMelee, DamageExact(90)) }, // Ghastly Glaive
{ ItemID.MonkStaffT3, Do(DamageExact(225)) }, // Sky Dragon's Fury
{ ItemID.MoonlordBullet, Do(DamageExact(17)) }, // Luminite Bullet
{ ItemID.MoonlordTurretStaff, Do(DamageExact(50), UseExact(15)) }, // Lunar Portal Staff
{ ItemID.MoonlordTurretStaff, Do(DamageExact(50)) }, // Lunar Portal Staff
{ ItemID.Muramasa, Do(CritDelta(+10)) },
{ ItemID.MushroomSpear, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(100)) },
{ ItemID.MushroomSpear, Do(TrueMelee, UseRatio(0.8f), DamageExact(100)) },
{ ItemID.Musket, Do(DamageExact(22)) },
{ ItemID.MythrilHalberd, Do(AutoReuse, TrueMelee, DamageExact(65), UseExact(8), ShootSpeedExact(15f)) },
{ ItemID.MythrilHalberd, Do(TrueMelee, DamageExact(65), UseExact(8), ShootSpeedExact(15f)) },
{ ItemID.MythrilRepeater, Do(UseExact(16)) },
{ ItemID.MythrilSword, Do(UseTurn, DamageExact(70), UseExact(8)) },
{ ItemID.NailGun, Do(DamageExact(77)) },
{ ItemID.NettleBurst, Do(ManaExact(10), DamageExact(65)) },
{ ItemID.NightsEdge, Do(TrueMelee, DamageExact(45)) },
{ ItemID.NorthPole, Do(AutoReuse, UseMeleeSpeed) },
{ ItemID.NorthPole, Do(UseMeleeSpeed) },
{ ItemID.OrangePhaseblade, phaseblade },
{ ItemID.OrangePhasesaber, phasesaber },
{ ItemID.OrichalcumHalberd, Do(AutoReuse, TrueMelee, DamageExact(128), ShootSpeedExact(6f)) },
{ ItemID.OrichalcumHalberd, Do(TrueMelee, DamageExact(128), ShootSpeedExact(6f)) },
{ ItemID.OrichalcumRepeater, Do(DamageExact(48)) },
{ ItemID.OrichalcumSword, Do(UseTurn, DamageExact(175)) },
{ ItemID.PaladinsHammer, Do(DamageExact(95), ShootSpeedExact(28)) },
{ ItemID.PalladiumPike, Do(AutoReuse, TrueMelee, DamageExact(120), ShootSpeedExact(5.4f)) },
{ ItemID.PalladiumPike, Do(TrueMelee, DamageExact(120), ShootSpeedExact(5.4f)) },
{ ItemID.PalladiumRepeater, Do(DamageExact(45)) },
{ ItemID.PalladiumSword, Do(DamageExact(150)) },
{ ItemID.PearlwoodBow, Do(AutoReuse, DamageExact(32)) },
{ ItemID.PearlwoodBow, Do(DamageExact(32)) },
{ ItemID.PearlwoodSword, Do(UseTurn, DamageExact(45)) },
{ ItemID.PewMaticHorn, Do(DamageExact(25), ShootSpeedExact(15)) },
{ ItemID.PhoenixBlaster, Do(AutoReuse, UseExact(20)) },
{ ItemID.PlatinumShortsword, Do(AutoReuse, TrueMelee, DamageExact(18)) },
{ ItemID.PhoenixBlaster, Do(UseExact(20)) },
{ ItemID.PlatinumShortsword, Do(TrueMelee, DamageExact(18)) },
{ ItemID.PoisonStaff, Do(DamageExact(57)) },
{ ItemID.PossessedHatchet, Do(DamageExact(135)) },
{ ItemID.PrincessWeapon, Do(DamageExact(80)) }, // Resonance Scepter
@@ -203,17 +201,17 @@ namespace CalamityMod.Items
{ ItemID.PurpleClubberfish, Do(UseTurn, KnockbackExact(10f)) },
{ ItemID.PurplePhaseblade, phaseblade },
{ ItemID.PurplePhasesaber, phasesaber },
{ ItemID.PygmyStaff, Do(UseExact(20), DamageExact(63)) },
{ ItemID.PygmyStaff, Do(DamageExact(63)) },
{ ItemID.RainbowGun, Do(DamageExact(60), ManaExact(40)) },
{ ItemID.RainbowRod, Do(DamageExact(40), ManaExact(13), KnockbackExact(8f)) },
{ ItemID.Rally, Do(AutoReuse, DamageExact(18)) },
{ ItemID.RavenStaff, Do(UseExact(20), DamageExact(36)) },
{ ItemID.Rally, Do(DamageExact(18)) },
{ ItemID.RavenStaff, Do(DamageExact(36)) },
{ ItemID.RazorbladeTyphoon, Do(DamageExact(103)) },
{ ItemID.Razorpine, Do(DamageExact(40)) },
{ ItemID.RedPhaseblade, phaseblade },
{ ItemID.RedPhasesaber, phasesaber },
{ ItemID.RedRyder, Do(DamageExact(24)) },
{ ItemID.RedsYoyo, Do(AutoReuse, DamageExact(48)) }, // Red's Throw and Valkyrie Yoyo have the same stats
{ ItemID.RedsYoyo, Do(DamageExact(48)) }, // Red's Throw and Valkyrie Yoyo have the same stats
{ ItemID.RocketLauncher, Do(DamageExact(60), ShootSpeedExact(9)) },
{ ItemID.Sandgun, Do(DamageExact(22), UseExact(20)) },
{ ItemID.SapphireStaff, Do(DamageExact(25)) },
@@ -224,71 +222,71 @@ namespace CalamityMod.Items
{ ItemID.ShadowFlameHexDoll, Do(DamageExact(40), ShootSpeedExact(30)) },
{ ItemID.ShadowFlameKnife, Do(DamageExact(50)) },
{ ItemID.SharpTears, Do(DamageExact(49)) }, // Blood Thorn
{ ItemID.Shotgun, Do(DamageExact(36), AutoReuse) },
{ ItemID.Shotgun, Do(DamageExact(36)) },
{ ItemID.Shroomerang, Do(ShootSpeedExact(11)) },
{ ItemID.SilverBullet, Do(DamageExact(8)) },
{ ItemID.SilverShortsword, Do(AutoReuse, TrueMelee, DamageExact(14)) },
{ ItemID.SilverShortsword, Do(TrueMelee, DamageExact(14)) },
{ ItemID.SkyFracture, Do(DamageExact(46)) },
{ ItemID.SlapHand, Do(UseTurn, DamageExact(120)) },
{ ItemID.Smolstar, Do(DamageExact(9), UseExact(25)) }, // Blade Staff
{ ItemID.Smolstar, Do(DamageExact(9)) }, // Blade Staff
{ ItemID.SniperRifle, Do(DamageExact(200), UseExact(40)) },
{ ItemID.SolarEruption, Do(DamageExact(122)) },
{ ItemID.SoulDrain, Do(DamageExact(38)) }, // Life Drain
{ ItemID.SpaceGun, Do(DamageExact(23)) },
{ ItemID.Spear, Do(AutoReuse, TrueMelee, DamageExact(14)) },
{ ItemID.Spear, Do(TrueMelee, DamageExact(14)) },
{ ItemID.SpectreStaff, Do(DamageExact(72)) },
{ ItemID.SpiritFlame, Do(UseExact(20), ManaExact(11), ShootSpeedExact(2f)) },
{ ItemID.StaffofEarth, Do(DamageExact(150)) },
{ ItemID.StarCannon, Do(DamageExact(25), UseExact(15)) },
{ ItemID.StardustDragonStaff, Do(DamageExact(20), UseExact(19)) },
{ ItemID.StormTigerStaff, Do(DamageExact(49), UseExact(20)) }, // Desert Tiger Staff
{ ItemID.StylistKilLaKillScissorsIWish, Do(AutoReuse, UseTurn, DamageExact(21)) }, // Stylish Scissors
{ ItemID.StarCannon, Do(UseExact(18)) },
{ ItemID.StardustDragonStaff, Do(DamageExact(20)) },
{ ItemID.StormTigerStaff, Do(DamageExact(49)) }, // Desert Tiger Staff
{ ItemID.StylistKilLaKillScissorsIWish, Do(UseTurn, DamageExact(21)) }, // Stylish Scissors
{ ItemID.Stynger, Do(DamageExact(75)) },
{ ItemID.SuperStarCannon, Do(DamageExact(55)) },
{ ItemID.Swordfish, Do(AutoReuse, TrueMelee, DamageExact(24)) },
{ ItemID.Swordfish, Do(TrueMelee, DamageExact(24)) },
{ ItemID.TacticalShotgun, Do(DamageExact(34)) },
{ ItemID.TaxCollectorsStickOfDoom, Do(AutoReuse, UseTurn, UseRatio(0.8f), DamageExact(70)) }, // Classy Cane
{ ItemID.TendonBow, Do(DamageExact(17), AutoReuse) },
{ ItemID.TaxCollectorsStickOfDoom, Do(UseTurn, UseRatio(0.8f), DamageExact(70)) }, // Classy Cane
{ ItemID.TendonBow, Do(DamageExact(17)) },
{ ItemID.TerraBlade, Do(DamageExact(95)) },
{ ItemID.Terragrim, Do(TrueMeleeNoSpeed, DamageExact(13)) },
// Vanilla damage 190. After fixing iframes so yoyo and shots can hit simultaneously,
// Terrarian is extremely overpowered and requires a heavy nerf.
{ ItemID.Terrarian, Do(AutoReuse, DamageExact(90)) },
{ ItemID.TheEyeOfCthulhu, Do(AutoReuse, DamageExact(80)) },
{ ItemID.Terrarian, Do(DamageExact(90)) },
{ ItemID.TheEyeOfCthulhu, Do(DamageExact(80)) },
{ ItemID.TheMeatball, Do(DamageExact(24)) },
{ ItemID.TheRottedFork, Do(AutoReuse, TrueMelee, DamageExact(20)) },
{ ItemID.TheUndertaker, Do(AutoReuse, DamageExact(15)) },
{ ItemID.ThunderSpear, Do(AutoReuse, UseMeleeSpeed) }, // Storm Spear
{ ItemID.TheRottedFork, Do(TrueMelee, DamageExact(20)) },
{ ItemID.TheUndertaker, Do(DamageExact(15)) },
{ ItemID.ThunderSpear, Do(UseMeleeSpeed) }, // Storm Spear
{ ItemID.ThunderStaff, Do(DamageExact(18)) }, //Thunder Zapper
{ ItemID.TitaniumRepeater, Do(DamageExact(52)) },
{ ItemID.TitaniumSword, Do(UseTurn, DamageExact(192)) },
{ ItemID.TitaniumTrident, Do(AutoReuse, TrueMelee, DamageExact(144), ShootSpeedExact(6.5f)) },
{ ItemID.TitaniumTrident, Do(TrueMelee, DamageExact(144), ShootSpeedExact(6.5f)) },
{ ItemID.TopazStaff, Do(ManaExact(2)) },
{ ItemID.ToxicFlask, Do(DamageExact(62), UseExact(33), ManaExact(20)) },
{ ItemID.Toxikarp, Do(UseExact(9)) },
{ ItemID.Trident, Do(AutoReuse, TrueMelee, DamageExact(20)) },
{ ItemID.Trident, Do(TrueMelee, DamageExact(20)) },
{ ItemID.Trimarang, Do(DamageExact(24)) },
{ ItemID.TrueExcalibur, Do(TrueMelee, DamageExact(112)) },
{ ItemID.TrueNightsEdge, Do(DamageExact(105)) },
{ ItemID.Tsunami, Do(DamageExact(45)) },
{ ItemID.TungstenBullet, Do(DamageExact(8)) },
{ ItemID.TungstenShortsword, Do(AutoReuse, TrueMelee, DamageExact(15)) },
{ ItemID.TungstenShortsword, Do(TrueMelee, DamageExact(15)) },
{ ItemID.UnholyArrow, Do(DamageExact(11)) },
{ ItemID.UnholyTrident, Do(ManaRatio(0.78f), DamageRatio(0.91f)) }, // Uses ratios due to remix seed
{ ItemID.Uzi, Do(UseExact(8)) },
{ ItemID.VampireKnives, Do(DamageExact(38)) },
{ ItemID.ValkyrieYoyo, Do(AutoReuse, DamageExact(48)) }, // Red's Throw and Valkyrie Yoyo have the same stats
{ ItemID.ValkyrieYoyo, Do(DamageExact(48)) }, // Red's Throw and Valkyrie Yoyo have the same stats
{ ItemID.VenomStaff, Do(UseExact(27)) },
{ ItemID.WaspGun, Do(DamageExact(44)) },
{ ItemID.WaterBolt, Do(DamageExact(23)) },
{ ItemID.WhitePhaseblade, phaseblade },
{ ItemID.WhitePhasesaber, phasesaber },
{ ItemID.WoodenBoomerang, Do(DamageExact(16), Value(Item.sellPrice(copper: 20))) },
{ ItemID.Yelets, Do(AutoReuse, DamageExact(53)) },
{ ItemID.Yelets, Do(DamageExact(53)) },
{ ItemID.YellowPhaseblade, phaseblade },
{ ItemID.YellowPhasesaber, phasesaber },
{ ItemID.Zenith, Do(DamageExact(210)) },
{ ItemID.ZombieArm, Do(AutoReuse, UseTurn, KnockbackExact(12f)) },
{ ItemID.ZombieArm, Do(UseTurn, KnockbackExact(12f)) },
#endregion
#region CATEGORY 2: Defense Balancing
@@ -405,130 +403,61 @@ namespace CalamityMod.Items
#region CATEGORY 4: True Melee support
{ ItemID.Arkhalis, trueMeleeNoSpeed },
{ ItemID.CopperShortsword, Do(AutoReuse, TrueMelee) },
{ ItemID.Gladius, Do(AutoReuse, TrueMelee) },
{ ItemID.CopperShortsword, trueMelee },
{ ItemID.Gladius, trueMelee },
{ ItemID.HallowJoustingLance, trueMelee },
{ ItemID.JoustingLance, trueMelee },
{ ItemID.NebulaChainsaw, trueMeleeNoSpeed },
{ ItemID.ObsidianSwordfish, Do(AutoReuse, TrueMelee) },
{ ItemID.ObsidianSwordfish, trueMelee },
{ ItemID.PiercingStarlight, trueMelee }, // Starlight
{ ItemID.Ruler, trueMelee },
{ ItemID.ShadowJoustingLance, trueMelee },
{ ItemID.SolarFlareChainsaw, trueMeleeNoSpeed },
{ ItemID.StardustChainsaw, trueMeleeNoSpeed },
{ ItemID.TheHorsemansBlade, trueMelee },
{ ItemID.TinShortsword, Do(AutoReuse, TrueMelee) },
{ ItemID.TinShortsword, trueMelee },
{ ItemID.VortexChainsaw, trueMeleeNoSpeed },
#endregion
#region CATEGORY 5: Summoner Quality of Life
{ ItemID.BabyBirdStaff, Do(UseExact(35)) }, // Finch Staff
{ ItemID.BlandWhip, autoReuse }, // Leather Whip
{ ItemID.BoneWhip, autoReuse }, // Spinal Tap
{ ItemID.CoolWhip, autoReuse },
{ ItemID.DD2BallistraTowerT1Popper, autoReuse }, // Ballista Tier 1
{ ItemID.DD2BallistraTowerT2Popper, Do(AutoReuse, UseExact(25)) }, // Ballista Tier 2
{ ItemID.DD2BallistraTowerT3Popper, Do(AutoReuse, UseExact(20)) }, // Ballista Tier 3
{ ItemID.DD2ExplosiveTrapT1Popper, autoReuse }, // Explosive Trap Tier 1
{ ItemID.DD2ExplosiveTrapT2Popper, Do(AutoReuse, UseExact(25)) }, // Explosive Trap Tier 2
{ ItemID.DD2ExplosiveTrapT3Popper, Do(AutoReuse, UseExact(20)) }, // Explosive Trap Tier 3
{ ItemID.DD2FlameburstTowerT1Popper, autoReuse }, // Flameburst Tier 1
{ ItemID.DD2FlameburstTowerT2Popper, Do(AutoReuse, UseExact(25)) }, // Flameburst Tier 2
{ ItemID.DD2FlameburstTowerT3Popper, Do(AutoReuse, UseExact(20)) }, // Flameburst Tier 3
{ ItemID.DD2LightningAuraT1Popper, autoReuse }, // Lightning Aura Tier 1
{ ItemID.DD2LightningAuraT2Popper, Do(AutoReuse, UseExact(25)) }, // Lightning Aura Tier 2
{ ItemID.DD2LightningAuraT3Popper, Do(AutoReuse, UseExact(20)) }, // Lightning Aura Tier 3
{ ItemID.FireWhip, autoReuse }, // Firecracker
{ ItemID.FlinxStaff, Do(UseExact(35)) },
{ ItemID.MaceWhip, autoReuse }, // Morning Star
{ ItemID.OpticStaff, Do(UseExact(25)) },
{ ItemID.PirateStaff, Do(UseExact(25)) },
{ ItemID.QueenSpiderStaff, Do(UseExact(25)) },
{ ItemID.RainbowCrystalStaff, Do(UseExact(15)) },
{ ItemID.RainbowWhip, autoReuse }, // Kaleidoscope
{ ItemID.SanguineStaff, Do(UseExact(25)) },
{ ItemID.ScytheWhip, autoReuse }, // Dark Harvest
{ ItemID.SlimeStaff, Do(UseExact(30)) },
{ ItemID.SpiderStaff, Do(UseExact(25)) },
{ ItemID.StaffoftheFrostHydra, Do(UseExact(20)) },
{ ItemID.StardustCellStaff, Do(UseExact(20)) },
{ ItemID.SwordWhip, autoReuse }, // Durendal
{ ItemID.TempestStaff, Do(UseExact(20)) },
{ ItemID.ThornWhip, autoReuse }, // Snapthorn
{ ItemID.VampireFrogStaff, Do(UseExact(30)) },
{ ItemID.XenoStaff, Do(UseExact(20)) },
#region CATEGORY 5: UseTurn
{ ItemID.BladeofGrass, Do(UseTurn) },
{ ItemID.BloodButcherer, Do(UseTurn) },
{ ItemID.BorealWoodSword, Do(UseTurn) },
{ ItemID.CactusSword, Do(UseTurn) },
{ ItemID.CandyCaneSword, Do(UseTurn) },
{ ItemID.CopperBroadsword, Do(UseTurn) },
{ ItemID.EbonwoodSword, Do(UseTurn) },
{ ItemID.FieryGreatsword, Do(UseTurn) }, // Volcano
{ ItemID.GoldBroadsword, Do(UseTurn) },
{ ItemID.IronBroadsword, Do(UseTurn) },
{ ItemID.LeadBroadsword, Do(UseTurn) },
{ ItemID.LightsBane, Do(UseTurn) },
{ ItemID.PalmWoodSword, Do(UseTurn) },
{ ItemID.PlatinumBroadsword, Do(UseTurn) },
{ ItemID.RichMahoganySword, Do(UseTurn) },
{ ItemID.ShadewoodSword, Do(UseTurn) },
{ ItemID.SilverBroadsword, Do(UseTurn) },
{ ItemID.TinBroadsword, Do(UseTurn) },
{ ItemID.TungstenBroadsword, Do(UseTurn) },
{ ItemID.WoodenSword, Do(UseTurn) },
#endregion
#region CATEGORY 6: Other Quality of Life (AutoReuse / UseTurn)
{ ItemID.Amarok, autoReuse },
{ ItemID.BatBat, autoReuse },
{ ItemID.BladeofGrass, Do(AutoReuse, UseTurn) },
{ ItemID.BloodButcherer, Do(AutoReuse, UseTurn) },
{ ItemID.BorealWoodSword, Do(AutoReuse, UseTurn) },
{ ItemID.CactusSword, Do(AutoReuse, UseTurn) },
{ ItemID.CandyCaneSword, Do(AutoReuse, UseTurn) },
{ ItemID.Chik, autoReuse },
{ ItemID.Code1, autoReuse },
{ ItemID.CopperBroadsword, Do(AutoReuse, UseTurn) },
{ ItemID.EbonwoodSword, Do(AutoReuse, UseTurn) },
{ ItemID.FieryGreatsword, Do(AutoReuse, UseTurn) }, // Volcano
{ ItemID.FormatC, autoReuse },
{ ItemID.GoldBroadsword, Do(AutoReuse, UseTurn) },
{ ItemID.HelFire, autoReuse },
{ ItemID.IronBroadsword, Do(AutoReuse, UseTurn) },
{ ItemID.JungleYoyo, autoReuse }, // Amazon
{ ItemID.LifeCrystal, autoReuse },
{ ItemID.LeadBroadsword, Do(AutoReuse, UseTurn) },
{ ItemID.LifeFruit, autoReuse },
{ ItemID.LightsBane, Do(AutoReuse, UseTurn) },
{ ItemID.ManaCrystal, autoReuse },
{ ItemID.PalmWoodSword, Do(AutoReuse, UseTurn) },
{ ItemID.PaperAirplaneA, autoReuse },
{ ItemID.PaperAirplaneB, autoReuse }, // White Paper Airplane
{ ItemID.PlatinumBroadsword, Do(AutoReuse, UseTurn) },
{ ItemID.Revolver, autoReuse },
{ ItemID.RichMahoganySword, Do(AutoReuse, UseTurn) },
{ ItemID.ShadewoodSword, Do(AutoReuse, UseTurn) },
{ ItemID.SilverBroadsword, Do(AutoReuse, UseTurn) },
{ ItemID.Starfury, autoReuse },
{ ItemID.TentacleSpike, autoReuse },
{ ItemID.TinBroadsword, Do(AutoReuse, UseTurn) },
{ ItemID.TragicUmbrella, autoReuse },
{ ItemID.TungstenBroadsword, Do(AutoReuse, UseTurn) },
{ ItemID.Umbrella, autoReuse },
{ ItemID.Valor, autoReuse },
{ ItemID.WandofFrosting, autoReuse },
{ ItemID.WandofSparking, autoReuse },
{ ItemID.WeatherPain, autoReuse },
{ ItemID.WoodenSword, Do(AutoReuse, UseTurn) },
{ ItemID.WoodYoyo, autoReuse },
{ ItemID.ZapinatorGray, autoReuse },
{ ItemID.ZapinatorOrange, autoReuse },
#endregion
#region CATEGORY 7: Summoning Item Quality of Life
#region CATEGORY 6: Summoning Item Quality of Life
{ ItemID.Abeemination, nonConsumableBossSummon },
{ ItemID.BloodMoonStarter, Do(UseTimeExact(10))}, // Bloody Tear
{ ItemID.BloodySpine, nonConsumableBossSummon },
{ ItemID.CelestialSigil, nonConsumableBossSummon },
{ ItemID.DeerThing, nonConsumableBossSummon },
{ ItemID.GoblinBattleStandard, Do(UseTimeExact(10)) },
{ ItemID.MechanicalEye, nonConsumableBossSummon },
{ ItemID.MechanicalSkull, nonConsumableBossSummon },
{ ItemID.MechanicalWorm, nonConsumableBossSummon },
{ ItemID.MechdusaSummon, nonConsumableBossSummon }, // Ocram's Razor
{ ItemID.NaughtyPresent, Do(UseTimeExact(10)) },
{ ItemID.PirateMap, Do(UseTimeExact(10)) },
{ ItemID.PumpkinMoonMedallion, Do(UseTimeExact(10)) },
{ ItemID.QueenSlimeCrystal, nonConsumableBossSummon }, // Gelatin Crystal
{ ItemID.SlimeCrown, nonConsumableBossSummon },
{ ItemID.SnowGlobe, Do(UseTimeExact(10)) },
{ ItemID.SolarTablet, Do(UseTimeExact(10)) },
{ ItemID.SuspiciousLookingEye, nonConsumableBossSummon },
{ ItemID.WormFood, nonConsumableBossSummon },
#endregion
#region CATEGORY 8: Sell Prices
#region CATEGORY 7: Sell Prices
{ ItemID.EncumberingStone, Do(Worthless) },
{ ItemID.FlareGun, Do(Value(Item.sellPrice(silver: 10))) },
{ ItemID.GlowingMushroom, Do(Worthless) },
@@ -622,19 +551,6 @@ namespace CalamityMod.Items
internal static IItemTweak AttackSpeedRatio(float f) => new AttackSpeedRatioRule(f);
#endregion
#region Auto Reuse
internal class AutoReuseRule : IItemTweak
{
internal readonly bool flag = true;
public AutoReuseRule(bool ar) => flag = ar;
public bool AppliesTo(Item it) => IsUsable(it);
public void ApplyTweak(Item it) => it.autoReuse = flag;
}
internal static IItemTweak AutoReuse => new AutoReuseRule(true);
internal static IItemTweak NoAutoReuse => new AutoReuseRule(false);
#endregion
#region Axe Power
// Uses the values shown by Terraria, which are multiplied by 5, not the internal values
internal class AxePowerRule : IItemTweak
+23
View File
@@ -0,0 +1,23 @@
using CalamityMod.NPCs.SunkenSea;
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
namespace CalamityMod.Items.Critters
{
public class ShoreskipperItem : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Misc";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 5;
}
public override void SetDefaults()
{
Item.DefaultToCapturedCritter(ModContent.NPCType<Shoreskipper>());
Item.value = Item.sellPrice(silver: 5);
Item.rare = ItemRarityID.Green;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 888 B

-39
View File
@@ -1,39 +0,0 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.DifficultyItems
{
public class BallAndChain : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Misc";
public override void SetDefaults()
{
Item.width = 32;
Item.height = 50;
Item.rare = ItemRarityID.Blue;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
{
itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.ToolsOther;
}
public override bool CanUseItem(Player player) => false;
public override void UpdateInventory(Player player)
{
if (Item.favorited)
player.Calamity().blockAllDashes = true;
}
public override void AddRecipes()
{
CreateRecipe().
AddRecipeGroup("IronBar", 10).
AddIngredient(ItemID.Chain).
AddTile(TileID.Anvils).
Register();
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 813 B

@@ -0,0 +1,30 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Fishing.SunkenSeaCatches
{
public class CoralskinFoolfish : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Fishing";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 3;
ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true;
}
public override void SetDefaults()
{
Item.width = 32;
Item.height = 36;
Item.maxStack = Item.CommonMaxStack;
Item.value = Item.sellPrice(silver: 5);
Item.rare = ItemRarityID.Blue;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
{
itemGroup = ContentSamples.CreativeHelper.ItemGroup.Fish;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

@@ -0,0 +1,30 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Fishing.SunkenSeaCatches
{
public class GleamingCucumber : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Fishing";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 3;
ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true;
}
public override void SetDefaults()
{
Item.width = 32;
Item.height = 36;
Item.maxStack = Item.CommonMaxStack;
Item.value = Item.sellPrice(silver: 5);
Item.rare = ItemRarityID.Blue;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
{
itemGroup = ContentSamples.CreativeHelper.ItemGroup.Fish;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

@@ -0,0 +1,30 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Fishing.SunkenSeaCatches
{
public class MoltenFishron : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Fishing";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 3;
ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true;
}
public override void SetDefaults()
{
Item.width = 32;
Item.height = 36;
Item.maxStack = Item.CommonMaxStack;
Item.value = Item.sellPrice(silver: 7, copper: 50);
Item.rare = ItemRarityID.Blue;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
{
itemGroup = ContentSamples.CreativeHelper.ItemGroup.Fish;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 805 B

@@ -0,0 +1,30 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Fishing.SunkenSeaCatches
{
public class SpecularSturgeon : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Fishing";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 3;
ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true;
}
public override void SetDefaults()
{
Item.width = 32;
Item.height = 36;
Item.maxStack = Item.CommonMaxStack;
Item.value = Item.sellPrice(silver: 5);
Item.rare = ItemRarityID.Blue;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
{
itemGroup = ContentSamples.CreativeHelper.ItemGroup.Fish;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 868 B

@@ -0,0 +1,30 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Fishing.SunkenSeaCatches
{
public class Squidoom : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Fishing";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 3;
ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true;
}
public override void SetDefaults()
{
Item.width = 32;
Item.height = 36;
Item.maxStack = Item.CommonMaxStack;
Item.value = Item.sellPrice(silver: 5);
Item.rare = ItemRarityID.Blue;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
{
itemGroup = ContentSamples.CreativeHelper.ItemGroup.Fish;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1017 B

+5 -4
View File
@@ -28,10 +28,11 @@ namespace CalamityMod.Items.Mounts.Minecarts
MountData.idleFrameDelay = 10;
MountData.idleFrameStart = 0;
// These are more powerful than the Cart Upgrade Kit (20f and 0.1f respectively) and using it will reduce the cart speed to that
// We can IL edit this now but we can also wait for TML to add support for the kit (copefully soon)
MountData.runSpeed = 22f;
MountData.acceleration = 0.16f;
// Stat balancing
MountData.runSpeed = 20.0f;
MountData.acceleration = 0.1f;
MountData.MinecartUpgradeRunSpeed = 22.0f;
MountData.MinecartUpgradeAcceleration = 0.16f;
if (!Main.dedServ)
{
@@ -0,0 +1,7 @@
namespace CalamityMod.Items.Placeables.Banners
{
public class ShoreskipperBanner : BaseBanner
{
public override int BannerTileStyle => 148;
}
}
@@ -72,7 +72,6 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings
"Fluffy",
"fryzahh",
"HaguriHat",
"Heart Plus Up!",
"LordMetarex",
"Memes",
"Mercutio 'Merkalto' Takle",
@@ -136,6 +135,7 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings
"GramOfSalt",
"Graydee",
"Grox the Great",
"Heart Plus Up!",
"Hectique",
"Hugekraken",
"Huggles",
-8
View File
@@ -10,8 +10,6 @@ namespace CalamityMod.Items.Potions.Alcohol
{
public new string LocalizationCategory => "Items.Potions";
public static float DamageBoost = 0.5f;
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 20;
@@ -29,11 +27,5 @@ namespace CalamityMod.Items.Potions.Alcohol
Item.value = Item.buyPrice(gold: 5); // Sold by Truffle
Item.rare = ItemRarityID.LightRed;
}
public override void OnConsumeItem(Player player)
{
if (player.Calamity().trippyLevel < 3)
player.Calamity().trippyLevel++;
}
}
}
+2 -10
View File
@@ -45,17 +45,9 @@ namespace CalamityMod.Items.Potions
list.FindAndReplace("[S]", duration);
}
public override bool CanUseItem(Player player)
{
return player.potionDelay <= 0 && player.Calamity().potionTimer <= 0;
}
public override void ModifyPotionDelay(Player player, ref int baseDelay) => baseDelay -= CalamityUtils.SecondsToFrames(60) - SicknessDuration;
public override void OnConsumeItem(Player player)
{
player.AddBuff(BuffType, BuffDuration);
// fixes hardcoded potion sickness duration from quick heal (see CalamityPlayerMiscEffects.cs)
player.Calamity().potionTimer = 2;
}
public override void OnConsumeItem(Player player) => player.AddBuff(BuffType, BuffDuration);
public override void AddRecipes()
{
+90
View File
@@ -0,0 +1,90 @@
using System.Collections.Generic;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;
namespace CalamityMod.Items.Tools
{
public class BallAndChain : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Tools";
public static Asset<Texture2D> DisabledSprite;
public override void Load() => DisabledSprite = ModContent.Request<Texture2D>("CalamityMod/Items/Tools/BallAndChainDisabled");
public override void SetDefaults()
{
Item.width = 48;
Item.height = 48;
Item.rare = ItemRarityID.Blue;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
{
itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.ToolsOther;
}
#region Toggling
public bool Enabled = true;
public override ModItem Clone(Item item)
{
var clone = (BallAndChain)base.Clone(item);
clone.Enabled = Enabled;
return clone;
}
public override void SaveData(TagCompound tag) => tag.Add("blockerEnabled", Enabled);
public override void LoadData(TagCompound tag) => Enabled = tag.GetBool("blockerEnabled");
public override void NetSend(BinaryWriter writer) => writer.Write(Enabled);
public override void NetReceive(BinaryReader reader) => Enabled = reader.ReadBoolean();
public override bool CanRightClick() => true;
public override bool ConsumeItem(Player player) => false;
public override void RightClick(Player player)
{
Enabled = !Enabled;
Item.NetStateChanged();
}
#endregion
public override bool CanUseItem(Player player) => false;
public override void UpdateInventory(Player player) => player.Calamity().blockAllDashes |= Enabled;
public override void ModifyTooltips(List<TooltipLine> tooltips)
{
string text = this.GetLocalizedValue(Enabled ? "TooltipEnabled" : "TooltipDisabled");
tooltips.FindAndReplace("[STATE]", text);
}
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
Texture2D tex = Enabled ? TextureAssets.Item[Type].Value : DisabledSprite.Value;
CalamityUtils.DrawInventoryCustomScale(spriteBatch, tex, position, frame, drawColor, itemColor, origin, scale, 0.8f);
return false;
}
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
{
Texture2D tex = Enabled ? TextureAssets.Item[Type].Value : DisabledSprite.Value;
Vector2 origin = tex.Size() / 2f;
spriteBatch.Draw(tex, Item.Bottom - Main.screenPosition - Vector2.UnitY * origin.Y, null, lightColor, rotation, origin, scale, SpriteEffects.None, 0f);
return false;
}
public override void AddRecipes()
{
CreateRecipe().
AddRecipeGroup("IronBar", 10).
AddIngredient(ItemID.Chain).
AddTile(TileID.Anvils).
Register();
}
}
}
Loaded 100 of 306 files, more files were not shown because too many files have changed in this diff. Show more