Merge 1.4.4 into staging for 2.1.1 release

This commit is contained in:
Ozzatron committed 2026-02-10 20:57:00 -05:00
commit ad5fbbf1ca
293 files changed
+2325 -1123

No files matched your search

+2 -2
View File
@@ -296,8 +296,8 @@ namespace CalamityMod.Balancing
// 35% resist to Sulphuric Acid Cannon's explosions.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<SulphuricAcidCannonExplosion>()))));
// 25% resist to Corinth Prime's grenades.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<CorinthPrimeAirburst>()))));
// 60% resist to Corinth Prime's grenades.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.4f, ProjectileType<CorinthPrimeAirburst>()))));
// 20% resist to Valediction's typhoons; will catch Nuclear Fury as well but that doesn't matter.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<NuclearFuryProjectile>()))));
+12 -12
View File
@@ -62,18 +62,18 @@
internal const int SolarFlareIFrames = 12;
internal const float SolarFlareBaseDamage = 400f;
// Dodge cooldowns (in frames)
// TODO -- Some of these could be moved to the respective item files
internal static readonly int BeltDodgeCooldownMin = 1200;
internal static readonly int BeltDodgeCooldownMax = 5400;
internal static readonly int BrainDodgeCooldownMin = 1200;
internal static readonly int BrainDodgeCooldownMax = 5400;
internal static readonly int AmalgamDodgeCooldownMin = 1200;
internal static readonly int AmalgamDodgeCooldownMax = 5400;
internal static readonly int MirrorDodgeCooldownMin = 1200;
internal static readonly int MirrorDodgeCooldownMax = 5400;
internal static readonly int EvolutionReflectCooldownMin = 1200;
internal static readonly int EvolutionReflectCooldownMax = 5400;
/// <summary>
/// How long the dodge cooldown is at maximum damage
/// </summary>
internal static readonly int DodgeCooldownMax = 5400; // 90 seconds
/// <summary>
/// How much the dodge cooldown is reduced when at minimum damage
/// </summary>
internal static float DodgeCooldownDamageMult => 0.33f; // 30 seconds
/// <summary>
/// How much the dodge cooldown is reduced per stacked dodge. Each stack applies multiplicatively.
/// </summary>
internal static float DodgeCooldownMultPerStack => 0.85f; // -15% per stack, multiplicatively
#endregion
#region Damage
+68 -18
View File
@@ -68,6 +68,7 @@ using CalamityMod.Projectiles.Typeless;
using CalamityMod.Systems;
using CalamityMod.Systems.Collections;
using CalamityMod.Systems.Mechanic;
using CalamityMod.Utilities;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -193,7 +194,7 @@ namespace CalamityMod.CalPlayer
DevourerofCods //Not a fishing minigame but uses the same code as the rest
}
public FishingMinigames SelectedFishingMinigame = FishingMinigames.None;
public bool countsAsAnyWet => (Player.armor[0].type == ItemID.FishBowl || Player.wetCount > 0 || Player.wet || Player.honeyWet || Player.lavaWet);
public bool countsAsAnyWet => (Player.armor[0].type == ItemID.FishBowl || (Main.raining && Player.Center.Y < Main.worldSurface * 16.0) || Player.dripping || Player.wetCount > 0 || Player.wet || Player.honeyWet || Player.lavaWet);
/// <summary>
/// How many Starbursts the player has
@@ -948,6 +949,7 @@ namespace CalamityMod.CalPlayer
public bool seraphTracers = false;
public bool frostFlare = false;
public bool evolution = false;
public bool procDodgeEffects = true;
public bool nanotech = false;
public bool deadshotBrooch = false;
public bool shadowMinions = false;
@@ -1141,6 +1143,22 @@ namespace CalamityMod.CalPlayer
/// <summary> Used for spawning Quiver of Nihility's void fields. </summary>
public bool voidField = false;
public bool copyrightInfringementShield = false;
/// <summary>
/// This is the maximum cooldown of general Dodge effects, in frames. Can be modified by equipment.
/// Defaults to 90 seconds, or 5400 frames.
/// </summary>
public int ConsumableDodgeCooldown = 0;
/// <summary>
/// A list of on dodge effects for every dodge the player has equipped.
/// Also used to determine the amount of dodges for cooldowns.
/// Returns the string for the dodge cooldown icon to use.
/// </summary>
public List<Func<Player, Player.HurtInfo,string?>> DodgeEffects = [];
/// <summary>
/// Used internally to disable Player.shadowDodge so we can use custom dodge ordering.
/// </summary>
bool storedShadowDodge = false;
#endregion
#region Armor Set
@@ -2206,15 +2224,18 @@ namespace CalamityMod.CalPlayer
Player.AddCooldown(Starburst.ID, MaxStratusStarburst);
}
}
// Shields. Has to intentionally be above resetting accessories and armor or the shields would clear instantly
if (!roverDrive)
RoverDriveShieldDurability = 0;
if (!lunicCorpsSet)
LunicCorpsShieldDurability = 0;
if (!sponge)
SpongeShieldDurability = 0;
if (!pSoulArtifact)
pSoulShieldDurability = 0;
if (Player.whoAmI == Main.myPlayer)
{
if (!roverDrive)
RoverDriveShieldDurability = 0;
if (!lunicCorpsSet)
LunicCorpsShieldDurability = 0;
if (!sponge)
SpongeShieldDurability = 0;
if (!pSoulArtifact)
pSoulShieldDurability = 0;
}
pSoulShieldVisible = false;
roverDrive = false;
roverDriveShieldVisible = false;
@@ -2476,7 +2497,10 @@ namespace CalamityMod.CalPlayer
voidField = false;
copyrightInfringementShield = false;
daedalusReflect = false;
ConsumableDodgeCooldown = BalancingConstants.DodgeCooldownMax;
DodgeEffects = [];
daedalusReflect = false;
daedalusSplit = false;
daedalusAbsorb = false;
daedalusShard = false;
@@ -2732,6 +2756,11 @@ namespace CalamityMod.CalPlayer
pinkCandle = false;
yellowCandle = false;
//Disable Lockon when not on gamepad to prevent it being left on forever by The Pointer
if (!Main.gamePad)
LockOnHelper.ForceUsability = false;
SelectedFishingMinigame = FishingMinigames.None;
#region Minion Reset Effects
@@ -2881,6 +2910,7 @@ namespace CalamityMod.CalPlayer
abyssalDivingSuitPrevious = abyssalDivingSuit;
abyssalDivingSuit = false;
aquaticHeartPrevious = aquaticHeart;
aquaticHeart = false;
profanedCrystalStatePrevious = pscState;
@@ -3895,13 +3925,13 @@ namespace CalamityMod.CalPlayer
d.velocity = Main.rand.NextVector2Unit() * spreadSpeed;
Vector2 segmentTwoPos = Player.Center + segmentTwoStart + segmentTwoIncrement * interpolant;
d = Dust.CloneDust(d);
d = Dust.BetterCloneDust(d);
d.position = segmentTwoPos;
d.scale = Main.rand.NextFloat(1.2f, 1.8f);
d.velocity = Main.rand.NextVector2Unit() * spreadSpeed;
Vector2 segmentThreePos = Player.Center + segmentThreeStart + segmentThreeIncrement * interpolant;
d = Dust.CloneDust(d);
d = Dust.BetterCloneDust(d);
d.position = segmentThreePos;
d.scale = Main.rand.NextFloat(1.2f, 1.8f);
d.velocity = Main.rand.NextVector2Unit() * spreadSpeed;
@@ -4263,6 +4293,17 @@ namespace CalamityMod.CalPlayer
if (Player.accRunSpeed < accRunSpeedMin)
Player.accRunSpeed = accRunSpeedMin;
if (Player.blackBelt)
DodgeEffects.Add((Player, hit) => {
Player.NinjaDodge();
return null;
});
if (Player.brainOfConfusionItem != null && !Player.brainOfConfusionItem.IsAir)
DodgeEffects.Add((Player, hit) => {
Player.BrainOfConfusionDodge();
return null;
});
if (Player.Transformation().Type == ItemType<Popo>())
{
if (Player.whoAmI == Main.myPlayer && !snowmanNoseless)
@@ -4439,7 +4480,7 @@ namespace CalamityMod.CalPlayer
{
Player.ClearBuff(BuffID.WindPushed);
}
if (Player.statMana < 0)
if (Player.statMana < 0 && Player.Calamity().ChaosStone)
{
Player.AddBuff(BuffType<ManaBurn>(), 10);
}
@@ -4710,13 +4751,22 @@ namespace CalamityMod.CalPlayer
{
float baseRecoveryRate = Main.expertMode ? BalancingConstants.LifeStealRecoveryRate_Expert : BalancingConstants.LifeStealRecoveryRate_Classic;
float lifeStealRecoveryRateReduction = Main.expertMode ? BalancingConstants.LifeStealRecoveryRateReduction_Expert : BalancingConstants.LifeStealRecoveryRateReduction_Classic;
float lifeStealCap = Main.expertMode ? BalancingConstants.LifeStealCap_Expert: BalancingConstants.LifeStealCap_Classic;
float lifeStealRecoveryRate = baseRecoveryRate - lifeStealRecoveryRateReduction;
if (Player.lifeSteal < -lifeStealRecoveryRate)
if (Player.lifeSteal < lifeStealCap)
{
int duration = (int)Math.Ceiling(Math.Abs(Player.lifeSteal) / lifeStealRecoveryRate);
if (!Player.HasCooldown(LifeSteal.ID) || (cooldowns[LifeSteal.ID].duration < duration))
Player.AddCooldown(LifeSteal.ID, duration);
if (Player.Calamity().cooldowns.TryGetValue(LifeSteal.ID, out var cooldown))
{
cooldown.timeLeft = (int)Math.Max(0,(lifeStealCap-Math.Abs(Player.lifeSteal)));
}
else
{
Player.AddCooldown(LifeSteal.ID, (int)lifeStealCap)
.timeLeft = (int)Math.Max(0, (lifeStealCap - Math.Abs(Player.lifeSteal)));
}
}
}
if (moonshine)
+33 -34
View File
@@ -4,19 +4,14 @@ using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatBuffs;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.CalPlayer.DrawLayers;
using CalamityMod.DataStructures;
using CalamityMod.Dusts;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.NPCs.DevourerofGods;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Magic;
using CalamityMod.Projectiles.Ranged;
using CalamityMod.Projectiles.Summon;
using CalamityMod.Projectiles.Typeless;
using CalamityMod.Systems.Collections;
using CalamityMod.Systems.Graphic.PixelationSystem;
using CalamityMod.Systems.Mechanic;
using CalamityMod.Utilities.Daybreak;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -106,7 +101,8 @@ namespace CalamityMod.CalPlayer
DevourerofGodsHead DoG = null;
foreach (var item in Main.ActiveNPCs)
{
if (item.type == ModContent.NPCType<DevourerofGodsHead>()) {
if (item.type == ModContent.NPCType<DevourerofGodsHead>())
{
DoG = item.ModNPC<DevourerofGodsHead>();
break;
}
@@ -155,37 +151,40 @@ namespace CalamityMod.CalPlayer
var dis = Player.Distance(virtualTargetPos);
if ((DoG.NPC.ai[3] < 3 || !DoG.Phase2Started) && DoG.NPC.Opacity > 0.5f && !DoG.Dying && !drawInfo.drawPlayer.isDisplayDollOrInanimate)
{
string phase1IconPath = "CalamityMod/NPCs/DevourerofGods/DevourerofGodsHead_Head_Boss";
string phase2IconPath = "CalamityMod/NPCs/DevourerofGods/DevourerofGodsHead_P2_Head_Boss";
var tex = ModContent.Request<Texture2D>((DoG.Phase2Started && DoG.NPC.localAI[2] < 300) ? phase2IconPath : phase1IconPath).Value;
float baseRotation = DoG.NPC.rotation;
if (calamityPlayer.trippy)
int headIconIndex = -1;
DoG.BossHeadSlot(ref headIconIndex);
if (headIconIndex > -1)
{
Vector2 rotVec = baseRotation.ToRotationVector2();
switch (i)
var tex = TextureAssets.NpcHeadBoss[headIconIndex].Value;
float baseRotation = DoG.NPC.rotation;
if (calamityPlayer.trippy)
{
case 0:
rotVec.X *= -1;
rotVec.Y *= -1;
break;
case 1:
rotVec.Y *= -1;
break;
case 2:
break;
case 3:
rotVec.X *= -1;
break;
Vector2 rotVec = baseRotation.ToRotationVector2();
switch (i)
{
case 0:
rotVec.X *= -1;
rotVec.Y *= -1;
break;
case 1:
rotVec.Y *= -1;
break;
case 2:
break;
case 3:
rotVec.X *= -1;
break;
}
baseRotation = rotVec.ToRotation();
}
baseRotation = rotVec.ToRotation();
float opacity = 0.9f * Math.Clamp(MathHelper.Lerp(0, 1, (dis - 600) / 300), 0, 1);
Color drawColor = calamityPlayer.trippy ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, (int)(255 * 0.9f)) : Color.White * 0.9f;
Main.spriteBatch.Draw(tex, Player.Center + directionToTarget * 196 * Math.Min(dis / 2400f, 2) - Main.screenPosition, null, drawColor * opacity, baseRotation, tex.Size() / 2f, 1, SpriteEffects.None, 0);
}
float opacity = 0.9f * Math.Clamp(MathHelper.Lerp(0, 1, (dis - 600) / 300), 0, 1);
Color drawColor = calamityPlayer.trippy ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, (int)(255 * 0.9f)) : Color.White * 0.9f;
Main.spriteBatch.Draw(tex, Player.Center + directionToTarget * 196 * Math.Min(dis / 2400f, 2) - Main.screenPosition, null, drawColor * opacity, baseRotation, tex.Size() / 2f, 1, SpriteEffects.None, 0);
}
}
}
@@ -381,7 +380,7 @@ namespace CalamityMod.CalPlayer
else
{
// Mana Burn VFX disabled when hih
if (Player.statMana < 0)
if (Player.statMana < 0 && Player.Calamity().ChaosStone)
{
float compactness = Player.width * 0.6f;
if (compactness < 10f)
+63 -133
View File
@@ -46,6 +46,7 @@ using CalamityMod.Projectiles.Rogue;
using CalamityMod.Projectiles.Typeless;
using CalamityMod.Systems.Collections;
using CalamityMod.UI;
using CalamityMod.Utilities;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Terraria;
@@ -145,86 +146,7 @@ namespace CalamityMod.CalPlayer
NetMessage.SendData(MessageID.Dodge, -1, -1, null, Player.whoAmI, 1f, 0f, 0f, 0, 0, 0);
}
public void AbyssMirrorDodge(double dodgeDamageGateValuePercent, int dodgeDamageGateValue, int hitDamage, Player.HurtInfo info)
{
double maxCooldownDurationDamagePercent = 0.5;
int maxCooldownDurationDamageValue = (int)Math.Round(Player.statLifeMax2 * (maxCooldownDurationDamagePercent - dodgeDamageGateValuePercent));
// Just in case...
if (maxCooldownDurationDamageValue <= 0)
maxCooldownDurationDamageValue = 1;
float cooldownDurationScalar = MathHelper.Clamp((hitDamage - dodgeDamageGateValue) / (float)maxCooldownDurationDamageValue, 0f, 1f);
if (Player.whoAmI == Main.myPlayer && abyssalMirror && !eclipseMirror)
{
int cooldownDuration = (int)MathHelper.Lerp(BalancingConstants.MirrorDodgeCooldownMin, BalancingConstants.MirrorDodgeCooldownMax, cooldownDurationScalar);
Player.AddCooldown(GlobalDodge.ID, cooldownDuration, true, "abyssmirror");
// 17APR2024: Ozzatron: Abyssal Mirror is a dodge. It uses vanilla dodge iframes and benefits from Cross Necklace.
int abyssalMirrorDodgeIFrames = Player.ComputeDodgeIFrames();
Player.GiveUniversalIFrames(abyssalMirrorDodgeIFrames, true);
rogueStealth += 0.5f;
SoundEngine.PlaySound(SilvaArmor.ActivationSound, Player.Center);
var source = Player.GetSource_Accessory_OnHurt(FindAccessory<AbyssalMirror>(), info.DamageSource);
for (int i = 0; i < 10; i++)
{
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(55);
int lumenyl = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, Main.rand.NextFloat(-2f, 2f), Main.rand.NextFloat(-2f, 2f), ModContent.ProjectileType<AbyssalMirrorProjectile>(), damage, 0, Player.whoAmI);
Main.projectile[lumenyl].rotation = Main.rand.NextFloat(0, 360);
Main.projectile[lumenyl].frame = Main.rand.Next(0, 4);
if (lumenyl.WithinBounds(Main.maxProjectiles))
Main.projectile[lumenyl].DamageType = DamageClass.Generic;
}
// TODO -- Calamity dodges should probably not send a vanilla dodge packet considering that causes Tabi dust
if (Player.whoAmI == Main.myPlayer)
{
NetMessage.SendData(MessageID.Dodge, -1, -1, null, Player.whoAmI, 1f, 0f, 0f, 0, 0, 0);
}
}
}
public void EclipseMirrorDodge(double dodgeDamageGateValuePercent, int dodgeDamageGateValue, int hitDamage, Player.HurtInfo info)
{
double maxCooldownDurationDamagePercent = 0.5;
int maxCooldownDurationDamageValue = (int)Math.Round(Player.statLifeMax2 * (maxCooldownDurationDamagePercent - dodgeDamageGateValuePercent));
// Just in case...
if (maxCooldownDurationDamageValue <= 0)
maxCooldownDurationDamageValue = 1;
float cooldownDurationScalar = MathHelper.Clamp((hitDamage - dodgeDamageGateValue) / (float)maxCooldownDurationDamageValue, 0f, 1f);
if (Player.whoAmI == Main.myPlayer && eclipseMirror)
{
int cooldownDuration = (int)MathHelper.Lerp(BalancingConstants.MirrorDodgeCooldownMin, BalancingConstants.MirrorDodgeCooldownMax, cooldownDurationScalar);
Player.AddCooldown(GlobalDodge.ID, cooldownDuration, true, "eclipsemirror");
// 17APR2024: Ozzatron: Eclipse Mirror is a dodge. It uses vanilla dodge iframes and benefits from Cross Necklace.
int eclipseMirrorDodgeIFrames = Player.ComputeDodgeIFrames();
Player.GiveUniversalIFrames(eclipseMirrorDodgeIFrames, true);
rogueStealth += 0.5f;
SoundEngine.PlaySound(SoundID.Item68, Player.Center);
var source = Player.GetSource_Accessory_OnHurt(FindAccessory<EclipseMirror>(), info.DamageSource);
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(2000);
int eclipse = Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType<EclipseMirrorBurst>(), damage, 0, Player.whoAmI);
if (eclipse.WithinBounds(Main.maxProjectiles))
Main.projectile[eclipse].DamageType = DamageClass.Generic;
// TODO -- Calamity dodges should probably not send a vanilla dodge packet considering that causes Tabi dust
if (Player.whoAmI == Main.myPlayer)
{
NetMessage.SendData(MessageID.Dodge, -1, -1, null, Player.whoAmI, 1f, 0f, 0f, 0, 0, 0);
}
}
}
#endregion
#region Pre Kill
@@ -938,16 +860,8 @@ namespace CalamityMod.CalPlayer
Projectile.NewProjectile(source, Player.Center + Vector2.UnitX.RotatedBy(MathHelper.TwoPi * (i / 10f)), Vector2.Zero, ModContent.ProjectileType<MirrorBlast>(), mirrorDamage, 5, Main.myPlayer, 1);
}
}
//Doze - This gives the same iframes as vanilla dodges, including accounting for cross necklace.
int evolutionIFrames = Player.ComputeDodgeIFrames();
Player.GiveUniversalIFrames(evolutionIFrames, true);
modifiers.Cancel();
projTypeJustHitBy = proj.type;
int cooldownDuration = (int)MathHelper.Lerp(BalancingConstants.EvolutionReflectCooldownMin, BalancingConstants.EvolutionReflectCooldownMax, cooldownDurationScalar);
Player.AddCooldown(GlobalDodge.ID, cooldownDuration);
procDodgeEffects = true; //This tells the game to dodge in the Consumable Dodge step, which procs all generic dodge effects at once.
return;
}
@@ -1513,6 +1427,10 @@ namespace CalamityMod.CalPlayer
}
}
//Here we store the Holy Protection bool so that we can have Holy Protection run in the right order among our dodges
storedShadowDodge = Player.shadowDodge;
Player.shadowDodge = false;
// If no other effects occurred, run vanilla code
return base.FreeDodge(info);
}
@@ -1528,8 +1446,8 @@ namespace CalamityMod.CalPlayer
int actualDamageTaken = chaliceOfTheBloodGod ? chaliceHitOriginalDamage : info.Damage;
bool sufficientDamageForDodging = actualDamageTaken >= dodgeDamageGateValue;
if (!Player.HasCooldown(GlobalDodge.ID) && sufficientDamageForDodging)
{
//This is in a method here so the logic below can call it in multiple places
void GenericDodgeEffects() {
double maxCooldownDurationDamagePercent = 0.5;
int maxCooldownDurationDamageValue = (int)Math.Round(Player.statLifeMax2 * (maxCooldownDurationDamagePercent - dodgeDamageGateValuePercent));
@@ -1538,26 +1456,61 @@ namespace CalamityMod.CalPlayer
maxCooldownDurationDamageValue = 1;
float cooldownDurationScalar = MathHelper.Clamp((actualDamageTaken - dodgeDamageGateValue) / (float)maxCooldownDurationDamageValue, 0f, 1f);
//Every dodge after the first reduces the dodge cooldown by 15%, stacking multiplicatively
float cooldownMultiplier = 1;
if (DodgeEffects.Count > 1)
cooldownMultiplier = MathF.Pow(BalancingConstants.DodgeCooldownMultPerStack, DodgeEffects.Count - 1);
// Re-implementation of vanilla item Black Belt as a consumable dodge
if (Player.whoAmI == Main.myPlayer && Player.blackBelt)
string? IconToUse = null;
foreach (var dodge in DodgeEffects)
{
Player.NinjaDodge();
int cooldownDuration = (int)MathHelper.Lerp(BalancingConstants.BeltDodgeCooldownMin, BalancingConstants.BeltDodgeCooldownMax, cooldownDurationScalar);
string? str = dodge(Player, info);
if (str is not null)
IconToUse = str;
}
//This is set after DodgeEffects in case some dodge wants to modify ConsumableDodgeCooldown, and so custom dodge icons for mirror line work
int cooldownDuration = (int)MathHelper.Lerp(ConsumableDodgeCooldown * cooldownMultiplier * BalancingConstants.DodgeCooldownDamageMult, ConsumableDodgeCooldown * cooldownMultiplier, cooldownDurationScalar);
if (IconToUse is null)
Player.AddCooldown(GlobalDodge.ID, cooldownDuration);
return true;
}
else
Player.AddCooldown(GlobalDodge.ID, cooldownDuration, true, IconToUse);
}
// Re-implementation of vanilla item Brain of Confusion as a consumable dodge
if (Player.whoAmI == Main.myPlayer && Player.brainOfConfusionItem != null && !Player.brainOfConfusionItem.IsAir)
{
Player.BrainOfConfusionDodge();
int cooldownTime = amalgam ?
(int)MathHelper.Lerp(BalancingConstants.AmalgamDodgeCooldownMin, BalancingConstants.AmalgamDodgeCooldownMax, cooldownDurationScalar) :
(int)MathHelper.Lerp(BalancingConstants.BrainDodgeCooldownMin, BalancingConstants.BrainDodgeCooldownMax, cooldownDurationScalar);
Player.AddCooldown(GlobalDodge.ID, cooldownTime);
return true;
}
//Dodge activation order is as follows:
// 1. Evolution dodge (which also procs Generals)
// 2. Spectral Veil
// 3. Evasion/Counter Scarf
// 4. Hallowed Armor
// 5. General Dodge
if (procDodgeEffects)
{
DodgeEffects.Add((_, _) => null); //This is to account for whatever procced the dodge when counting dodge cooldown stacking
GenericDodgeEffects();
procDodgeEffects = false;
return true;
}
if (spectralVeil && spectralVeilImmunity > 0)
{
SpectralVeilDodge();
return true;
}
if (HandleDashDodges())
return true;
// Hallowed Armor dodge
if (storedShadowDodge)
{
Player.ShadowDodge();
storedShadowDodge = false;
return true;
}
if (!Player.HasCooldown(GlobalDodge.ID) && sufficientDamageForDodging && DodgeEffects.Count > 0)
{
GenericDodgeEffects();
return true;
}
//
@@ -1567,30 +1520,7 @@ namespace CalamityMod.CalPlayer
if (Player.whoAmI != Main.myPlayer || disableAllDodges)
return false;
if (spectralVeil && spectralVeilImmunity > 0)
{
SpectralVeilDodge();
return true;
}
// TODO -- drag all dodge code into a CalamityPlayer sub-file dedicated to dodging and nothing else
if (HandleDashDodges())
return true;
// Mirror evades do not work if the global dodge cooldown is active. This cooldown can be triggered by either mirror.
if (!Player.HasCooldown(GlobalDodge.ID) && actualDamageTaken >= dodgeDamageGateValue)
{
if (eclipseMirror)
{
EclipseMirrorDodge(dodgeDamageGateValuePercent, dodgeDamageGateValue, actualDamageTaken, info);
return true;
}
else if (abyssalMirror)
{
AbyssMirrorDodge(dodgeDamageGateValuePercent, dodgeDamageGateValue, actualDamageTaken, info);
return true;
}
}
return base.ConsumableDodge(info);
}
@@ -2083,9 +2013,9 @@ namespace CalamityMod.CalPlayer
d.velocity = dustVel;
d.noGravity = true;
d.scale *= Main.rand.NextFloat(1.1f, 1.4f);
Dust.CloneDust(d).velocity = dustVel.RotatedBy(MathHelper.PiOver2);
Dust.CloneDust(d).velocity = dustVel.RotatedBy(MathHelper.Pi);
Dust.CloneDust(d).velocity = dustVel.RotatedBy(MathHelper.Pi * 1.5f);
Dust.BetterCloneDust(d).velocity = dustVel.RotatedBy(MathHelper.PiOver2);
Dust.BetterCloneDust(d).velocity = dustVel.RotatedBy(MathHelper.Pi);
Dust.BetterCloneDust(d).velocity = dustVel.RotatedBy(MathHelper.Pi * 1.5f);
}
}
+1 -1
View File
@@ -256,7 +256,7 @@ namespace CalamityMod.CalPlayer
else
witheredWeaponHoldTime = 0;
if (Player.statMana < 0)
if (Player.statMana < 0 && Player.Calamity().ChaosStone)
{
totalNegativeLifeRegen -= Player.statMana/100f * Items.Accessories.ChaosStone.LostRegenPer100Mana;
}
+10 -17
View File
@@ -68,6 +68,7 @@ using CalamityMod.Tiles.Abyss.AbyssAmbient;
using CalamityMod.Tiles.FurnitureAuric;
using CalamityMod.Tiles.Ores;
using CalamityMod.UI;
using CalamityMod.Utilities;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -1672,7 +1673,7 @@ namespace CalamityMod.CalPlayer
holyDust.noGravity = true;
holyDust.scale = 1f;
holyDust.fadeIn = Main.rand.NextFloat() * 2f;
Dust dustClone = Dust.CloneDust(holyDust);
Dust dustClone = Dust.BetterCloneDust(holyDust);
Dust extraDust = dustClone;
extraDust.scale /= 2f;
extraDust = dustClone;
@@ -3554,19 +3555,8 @@ namespace CalamityMod.CalPlayer
if (starBeamRye)
{
Player.manaFlower = false;
Player.ClearBuff(ModContent.BuffType<AstralInjectionBuff>());
if (!Player.manaSick)
{
Player.manaRegenCount -= Player.manaRegen;
Player.manaRegenDelay = 0;
Player.manaRegenCount += 20; // 20 mana per second, even while using an item
if (Player.HeldItem.mana > 0)
{
Player.GetDamage<MagicDamageClass>() += 0.5f + MathHelper.Max(0.1f,Player.HeldItem.mana / (float)Player.HeldItem.useTime);
}
Player.GetDamage<GenericDamageClass>() -= 0.5f;
}
Player.manaRegenCount += StarBeamRye.ManaRegenBoost;
Player.GetDamage<MagicDamageClass>() *= StarBeamRye.MagicDmgMult;
}
if (whiteWine)
@@ -3729,11 +3719,11 @@ namespace CalamityMod.CalPlayer
Player.velocity *= 0.98f;
if (molluskHelmet)
Player.velocity.X *= 0.995f;
Player.velocity.X *= 0.996f;
if (molluskChest)
Player.velocity.X *= 0.995f;
Player.velocity.X *= 0.996f;
if (molluskLegs)
Player.velocity.X *= 0.995f;
Player.velocity.X *= 0.996f;
if ((warped) && !Player.slowFall && !Player.mount.Active)
{
@@ -4505,6 +4495,9 @@ namespace CalamityMod.CalPlayer
#region Energy Shields
private void EnergyShields()
{
if (Player.whoAmI != Main.myPlayer)
return;
// Because later tier shields are brighter, shields are handled from highest tier to lowest tier here.
bool shieldAddedLight = false;
+2
View File
@@ -21,6 +21,7 @@ namespace CalamityMod
public static ModKeybind TransformerHotKey { get; private set; }
public static ModKeybind SwitchGravityHotkey {get; private set;}
public static ModKeybind ExpandDebuffInfo { get; private set; }
public static ModKeybind ThePointerLock {get; private set;}
public override void Load()
{
@@ -42,6 +43,7 @@ namespace CalamityMod
TransformerHotKey = KeybindLoader.RegisterKeybind(Mod, "TransformerHotKey", "K");
SwitchGravityHotkey = KeybindLoader.RegisterKeybind(Mod, "GravitySwapOverride", "T");
ExpandDebuffInfo = KeybindLoader.RegisterKeybind(Mod, "ExpandDebuffInfo", "LeftControl");
ThePointerLock = KeybindLoader.RegisterKeybind(Mod, "ThePointerLock", "N");
}
public override void Unload()
+43 -5
View File
@@ -1,4 +1,9 @@
using Microsoft.Xna.Framework;
using System;
using CalamityMod.Balancing;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.GameContent;
using Terraria.Localization;
namespace CalamityMod.Cooldowns
@@ -6,11 +11,44 @@ namespace CalamityMod.Cooldowns
public class LifeSteal : CooldownHandler
{
public static new string ID => "LifeSteal";
public override bool ShouldDisplay => instance.player.lifeSteal < 0f;
private float lifeStealCap => Main.expertMode ? BalancingConstants.LifeStealCap_Expert : BalancingConstants.LifeStealCap_Classic;
public override bool ShouldDisplay => instance.player.lifeSteal < lifeStealCap;
public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}");
public override string Texture => "CalamityMod/Cooldowns/LifeSteal";
public override Color OutlineColor => new Color(255, 142, 165);
public override Color CooldownStartColor => Color.Lerp(new Color(255, 216, 216), new Color(255, 117, 117), instance.Completion);
public override Color CooldownEndColor => Color.Lerp(new Color(255, 216, 216), new Color(255, 117, 117), instance.Completion);
public override bool CanTickDown => false;
public override Color OutlineColor => instance.player!.lifeSteal < 0
? new Color(255, 142, 165)
: new Color(255, 142, 165);
public override Color CooldownStartColor => instance.player!.lifeSteal < 0
? new Color(145, 59, 59)
: new Color(255, 181, 181);
public override Color CooldownEndColor => CooldownStartColor;
private Color TextColor => Color.White;
private Color TextBorderColor => new Color(40, 0, 0);
public override void DrawExpanded(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale)
{
base.DrawExpanded(spriteBatch, position, opacity, scale);
var value = instance.player.lifeSteal;
bool negate = value < 0;
var valueToMeasure = Math.Abs(value);
float Xoffset = valueToMeasure > 9 ? valueToMeasure > 99 ? -12.5f : -10f : -5;
if (negate)
Xoffset -= 8;
CalamityUtils.DrawBorderStringEightWay(spriteBatch, FontAssets.MouseText.Value, (value).ToString("#"), position + new Vector2(Xoffset, 8) * scale, TextColor, TextBorderColor, scale);
}
public override void DrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale)
{
base.DrawCompact(spriteBatch, position, opacity, scale);
var value = instance.player.lifeSteal;
bool negate = value < 0;
var valueToMeasure = Math.Abs(value);
float Xoffset = valueToMeasure > 9 ? valueToMeasure > 99 ? -12.5f : -10f : -5;
if (negate)
Xoffset -= 8;
CalamityUtils.DrawBorderStringEightWay(spriteBatch, FontAssets.MouseText.Value, (value).ToString("#"), position + new Vector2(Xoffset, 8) * scale, TextColor, TextBorderColor, scale);
}
}
}
+10 -2
View File
@@ -92,11 +92,19 @@ namespace CalamityMod.Cooldowns
public override SoundStyle? EndSound => LunicCorpsHelmet.ActivationSound;
public override bool ShouldPlayEndSound => instance.player.Calamity().lunicCorpsSet;
public override void Tick() => instance.player.Calamity().playedLunicCorpsShieldSound = false;
// When the recharge period completes, grant 1 point of shielding immediately so the rest my refill normally.
public override void Tick()
{
if (instance.player.whoAmI == Main.myPlayer)
instance.player.Calamity().playedLunicCorpsShieldSound = false;
}
// When the recharge period completes, grant 1 point of shielding immediately so the rest may refill normally.
// The shield durability cooldown is added elsewhere, in Misc Effects.
public override void OnCompleted()
{
if (instance.player.whoAmI != Main.myPlayer)
return;
CalamityPlayer modPlayer = instance.player.Calamity();
if (modPlayer.LunicCorpsShieldDurability <= 0)
modPlayer.LunicCorpsShieldDurability = 1;
+9 -2
View File
@@ -109,16 +109,23 @@ namespace CalamityMod.Cooldowns
public override Color CooldownStartColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion);
public override Color CooldownEndColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion);
public override void Tick() => instance.player.Calamity().playedProfanedSoulShieldSound = false;
public override void Tick()
{
if (instance.player.whoAmI == Main.myPlayer)
instance.player.Calamity().playedProfanedSoulShieldSound = false;
}
public override SoundStyle? EndSound => Providence.BurnStartSound;
public override bool ShouldPlayEndSound => instance.player.Calamity().pSoulArtifact;
// When the recharge period completes, grant 1 point of shielding immediately so the rest my refill normally.
// When the recharge period completes, grant 1 point of shielding immediately so the rest may refill normally.
// The shield durability cooldown is added elsewhere, in Misc Effects.
public override void OnCompleted()
{
if (instance.player.whoAmI != Main.myPlayer)
return;
CalamityPlayer modPlayer = instance.player.Calamity();
if (modPlayer.pSoulShieldDurability <= 0)
modPlayer.pSoulShieldDurability = 1;
+10 -2
View File
@@ -92,11 +92,19 @@ namespace CalamityMod.Cooldowns
public override SoundStyle? EndSound => TheSponge.ActivationSound;
public override bool ShouldPlayEndSound => instance.player.Calamity().sponge;
public override void Tick() => instance.player.Calamity().playedSpongeShieldSound = false;
// When the recharge period completes, grant 1 point of shielding immediately so the rest my refill normally.
public override void Tick()
{
if (instance.player.whoAmI == Main.myPlayer)
instance.player.Calamity().playedSpongeShieldSound = false;
}
// When the recharge period completes, grant 1 point of shielding immediately so the rest may refill normally.
// The shield durability cooldown is added elsewhere, in Misc Effects.
public override void OnCompleted()
{
if (instance.player.whoAmI != Main.myPlayer)
return;
CalamityPlayer modPlayer = instance.player.Calamity();
if (modPlayer.SpongeShieldDurability <= 0)
modPlayer.SpongeShieldDurability = 1;
+8 -1
View File
@@ -91,11 +91,18 @@ namespace CalamityMod.Cooldowns
public override Color CooldownStartColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion);
public override Color CooldownEndColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion);
public override void Tick() => instance.player.Calamity().playedRoverDriveShieldSound = false;
public override void Tick()
{
if (instance.player.whoAmI == Main.myPlayer)
instance.player.Calamity().playedRoverDriveShieldSound = false;
}
// Rover Drive shields are recharged as a side effect of the cooldown completing client side
public override void OnCompleted()
{
if (instance.player.whoAmI != Main.myPlayer)
return;
CalamityPlayer modPlayer = instance.player.Calamity();
if (modPlayer.RoverDriveShieldDurability <= 0)
modPlayer.RoverDriveShieldDurability = 1;
+1 -1
View File
@@ -146,7 +146,7 @@ namespace CalamityMod.Graphics.Metaballs
// Load render targets.
int layerCount = Layers.Count();
for (int i = 0; i < layerCount; i++)
LayerTargets.Add(ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice));
LayerTargets.Add(ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice, (width, height) => (width + 4, height + 4)));
});
}
+12 -1
View File
@@ -75,7 +75,12 @@ namespace CalamityMod.Graphics.Metaballs
{
using (target.Scope(clearColor: Color.Transparent))
{
// -2,-2 is to account for the border appplying at screen edge. We need this to draw off-screen.
// We directly adjust screen position so that drawing in the metaball functions works as expected
var offset = new Vector2(-2, -2);
Main.screenPosition += offset;
metaball.DrawInstances();
Main.screenPosition -= offset;
// Flush metaball contents to its render target and reset the sprite batch for the next iteration.
Main.spriteBatch.End();
@@ -106,11 +111,17 @@ namespace CalamityMod.Graphics.Metaballs
{
for (int i = 0; i < metaball.LayerTargets.Count; i++)
{
// -2,-2 is to account for the border appplying at screen edge. We need this to draw off-screen.
// We directly adjust screen position so that drawing in the metaball functions works as expected
var offset = new Vector2(-2, -2);
Main.screenPosition += offset;
// Prepare shaders for the given layer target.
metaball.PrepareShaderForTarget(i);
Main.screenPosition -= offset;
// Draw the metaball's raw contents with the shader.
Main.spriteBatch.Draw(metaball.LayerTargets[i].Target, Vector2.Zero, Color.White);
Main.spriteBatch.Draw(metaball.LayerTargets[i].Target, offset, Color.White);
}
}
@@ -62,6 +62,21 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers
{
public override bool InstancePerEntity => false;
public override string IsArmorSet(Item head, Item body, Item legs)
{
if (head.ModItem is IDyeableShaderRenderer && head.ModItem.IsArmorSet(head, body, legs))
return "DyeableShaderSet";
if (body.ModItem is IDyeableShaderRenderer && body.ModItem.IsArmorSet(head, body, legs))
return "DyeableShaderSet";
if (legs.ModItem is IDyeableShaderRenderer && legs.ModItem.IsArmorSet(head, body, legs))
return "DyeableShaderSet";
return "";
}
public override void UpdateItemDye(Item item, Player player, int dye, bool hideVisual)
{
if (item.ModItem is not IDyeableShaderRenderer drawer)
+33
View File
@@ -1,6 +1,9 @@
using CalamityMod.CalPlayer;
using CalamityMod.Items.Armor.Silva;
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Rogue;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
@@ -33,6 +36,36 @@ namespace CalamityMod.Items.Accessories
modPlayer.stealthGenMoving += MovingStealthRegenBoost;
modPlayer.abyssalMirror = true;
player.aggro -= AggroReduction;
modPlayer.DodgeEffects.Add(AbyssMirrorDodge);
}
public string AbyssMirrorDodge(Player Player, Player.HurtInfo info)
{
// 17APR2024: Ozzatron: Abyssal Mirror is a dodge. It uses vanilla dodge iframes and benefits from Cross Necklace.
int abyssalMirrorDodgeIFrames = Player.ComputeDodgeIFrames();
Player.GiveUniversalIFrames(abyssalMirrorDodgeIFrames, true);
Player.Calamity().rogueStealth += 0.5f;
SoundEngine.PlaySound(SilvaArmor.ActivationSound, Player.Center);
var source = Player.GetSource_Accessory(Player.Calamity().FindAccessory(ModContent.ItemType<AbyssalMirror>()));
for (int i = 0; i < 10; i++)
{
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(55);
int lumenyl = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, Main.rand.NextFloat(-2f, 2f), Main.rand.NextFloat(-2f, 2f), ModContent.ProjectileType<AbyssalMirrorProjectile>(), damage, 0, Player.whoAmI);
Main.projectile[lumenyl].rotation = Main.rand.NextFloat(0, 360);
Main.projectile[lumenyl].frame = Main.rand.Next(0, 4);
if (lumenyl.WithinBounds(Main.maxProjectiles))
Main.projectile[lumenyl].DamageType = DamageClass.Generic;
}
// TODO -- Calamity dodges should probably not send a vanilla dodge packet considering that causes Tabi dust
if (Player.whoAmI == Main.myPlayer)
{
NetMessage.SendData(MessageID.Dodge, -1, -1, null, Player.whoAmI, 1f, 0f, 0f, 0, 0, 0);
}
return "abyssmirror";
}
public override void AddRecipes()
+1
View File
@@ -7,6 +7,7 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
[LegacyName("AlchemicalFlask")]
public class AlchemicalDecanter : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
+31 -1
View File
@@ -1,8 +1,14 @@
using CalamityMod.CalPlayer;
using CalamityMod.Balancing;
using CalamityMod.CalPlayer;
using CalamityMod.Cooldowns;
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Rogue;
using CalamityMod.Rarities;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
@@ -31,8 +37,32 @@ namespace CalamityMod.Items.Accessories
player.GetCritChance<ThrowingDamageClass>() += 6;
player.GetDamage<ThrowingDamageClass>() += 0.06f;
player.aggro -= 700;
modPlayer.DodgeEffects.Add(EclipseMirrorDodge);
}
public string EclipseMirrorDodge(Player Player, Player.HurtInfo info)
{
// 17APR2024: Ozzatron: Eclipse Mirror is a dodge. It uses vanilla dodge iframes and benefits from Cross Necklace.
int eclipseMirrorDodgeIFrames = Player.ComputeDodgeIFrames();
Player.GiveUniversalIFrames(eclipseMirrorDodgeIFrames, true);
Player.Calamity().rogueStealth += 0.5f;
SoundEngine.PlaySound(SoundID.Item68, Player.Center);
var source = Player.GetSource_Accessory(Player.Calamity().FindAccessory(ModContent.ItemType<EclipseMirror>()));
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(2000);
int eclipse = Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType<EclipseMirrorBurst>(), damage, 0, Player.whoAmI);
if (eclipse.WithinBounds(Main.maxProjectiles))
Main.projectile[eclipse].DamageType = DamageClass.Generic;
// TODO -- Calamity dodges should probably not send a vanilla dodge packet considering that causes Tabi dust
NetMessage.SendData(MessageID.Dodge, -1, -1, null, Player.whoAmI, 1f, 0f, 0f, 0, 0, 0);
return "eclipsemirror";
}
public override void AddRecipes()
{
CreateRecipe().
+2
View File
@@ -8,6 +8,8 @@ using static Terraria.ModLoader.ModContent;
namespace CalamityMod.Items.Accessories
{
[LegacyName("RustyMedallion")]
public class ScionsCurio : ModItem, ILocalizedModType
{
public static int postHitDamage = 45;
+79
View File
@@ -0,0 +1,79 @@
using System.Collections.Generic;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameInput;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
public class ThePointer : ModItem, ILocalizedModType
{
public static Asset<Texture2D> ActiveTexture;
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
{
Item.width = 26;
Item.height = 26;
Item.value = CalamityGlobalItem.RarityBlueBuyPrice;
Item.rare = ItemRarityID.Blue;
Item.accessory = true;
}
public override void ModifyTooltips(List<TooltipLine> list) => list.IntegrateHotkey(CalamityKeybinds.ThePointerLock);
public override void UpdateAccessory(Player player, bool hideVisual)
{
LockOnHelper.ForceUsability = true;
if (CalamityKeybinds.ThePointerLock.JustPressed)
{
LockOnHelper.Toggle();
if (LockOnHelper.AimedTarget != null)
{
Vector2 dir = player.DirectionTo(LockOnHelper.AimedTarget.Center);
int loops = (int)((player.Center.Distance(LockOnHelper.AimedTarget.Center)) / 30f) + 1;
for (var i = 1; i < loops; i++)
{
var pos = player.Center + dir * i * 30f;
if (i >= loops - 1)
pos = LockOnHelper.AimedTarget.Center - dir * 30f;
var x = new LineParticle(pos, dir, false, 10, 1, new Color(238, 2, 52));
GeneralParticleHandler.SpawnParticle(x);
}
}
}
}
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
if (LockOnHelper.AimedTarget == null)
return true;
var tex = ActiveTexture ??= ModContent.Request<Texture2D>("CalamityMod/Items/Accessories/ThePointer_Active");
CalamityUtils.DrawInventoryCustomScale(
spriteBatch,
tex.Value,
position,
tex.Frame(),
drawColor,
itemColor,
tex.Size() * 0.5f,
0.1f,
wantedScale: 0.75f);
return false;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient(ItemID.Glass).
AddRecipeGroup("AnyCopperBar", 2).
AddRecipeGroup("IronBar", 3).
AddIngredient(ItemID.ManaCrystal).
AddTile(TileID.WorkBenches).
Register();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 649 B

+1
View File
@@ -5,6 +5,7 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
[LegacyName("CorruptFlask")]
public class UnholyTonic : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 976 B

@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CalamityMod.Items.BaseItems;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories.Vanity
{
internal class GlimmeringRibbon : TransformationAccessory, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public override (EquipType, string, string)[] EquipSlots =>
[
(EquipType.Head, "Charlotte", null),
(EquipType.Body, "Charlotte", null),
(EquipType.Legs, "Charlotte", null),
];
public override void SetDefaults()
{
Item.width = 52;
Item.height = 46;
Item.accessory = true;
Item.vanity = true;
Item.rare = ItemRarityID.Blue;
Item.value = CalamityGlobalItem.RarityBlueBuyPrice;
Item.Calamity().devItem = true;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient(ItemID.Silk, 10).
AddIngredient(ItemID.FallenStar, 3).
AddTile(TileID.Loom).
Register();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 816 B

-28
View File
@@ -1,28 +0,0 @@
using CalamityMod.Items.BaseItems;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories.Vanity
{
public class GoldenBomb : TransformationAccessory, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public override (EquipType, string, string)[] EquipSlots =>
[
(EquipType.Head, "Mihaii", null),
(EquipType.Body, "Mihaii", null),
(EquipType.Legs, "Mihaii", null),
];
public override void SetDefaults()
{
Item.width = 42;
Item.height = 38;
Item.accessory = true;
Item.rare = ItemRarityID.Blue;
Item.value = CalamityGlobalItem.RarityBlueBuyPrice;
Item.vanity = true;
Item.Calamity().devItem = true;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 860 B

+68
View File
@@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CalamityMod.Items.BaseItems;
using Humanizer;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Terraria;
using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories.Vanity
{
public class LittleE : TransformationAccessory, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public override (EquipType, string, string)[] EquipSlots =>
[
(EquipType.Head, "BigE", null),
(EquipType.Body, "BigE", null),
(EquipType.Legs, "BigE", null),
];
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 14));
ItemID.Sets.AnimatesAsSoul[Type] = true;
ItemID.Sets.ShimmerTransformToItem[ItemID.AlphabetStatueE] = Type;
base.SetStaticDefaults();
}
public override void SetDefaults()
{
Item.width = 30;
Item.height = 32;
Item.accessory = true;
Item.vanity = true;
Item.rare = ItemRarityID.Red;
Item.value = CalamityGlobalItem.RarityBlueBuyPrice;
Item.Calamity().devItem = true;
}
public override void ModifyTooltips(List<TooltipLine> tooltips)
{
string text = Language.GetTextValue("Mods.CalamityMod.Items.Accessories.LittleE.Tooltip").FormatWith(Main.LocalPlayer.name);
if (Item.social)
tooltips.Insert(1, new(CalamityMod.Instance, "Tooltip", text));
else
tooltips[3].Text = text;
}
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
{
var frame = Item.GetFrame(whoAmI);
var position = Item.Center - Main.screenPosition + Vector2.UnitY * 4;
var origin = frame.Size() / 2f;
spriteBatch.Draw(TextureAssets.Item[Type].Value, position, frame, lightColor, rotation, origin, scale, SpriteEffects.None, 0);
return false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

+1
View File
@@ -5,6 +5,7 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
[LegacyName("CrimsonFlask")]
public class ViciousTonic : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
+2 -2
View File
@@ -77,8 +77,8 @@ namespace CalamityMod.Items.Accessories
if (Utils.Distance(nPC.Center, player.Center) < MaxDistance + generousHitboxWidth && (nPC.IsAnEnemy(true, true, false) || nPC.type == ModContent.NPCType<SuperDummyNPC>()) && !nPC.dontTakeDamage)
{
float minDamageMult = 0.35f;
int maxTargets = 25;
float minDamageMult = 0.10f;
int maxTargets = 7;
float damageMult = Utils.Remap(targetCount, maxTargets, 1, minDamageMult, 1);
// Handles giving the Warbanner Burn effect
+1 -1
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Items.Armor.Astral
public static int MaxManaBoost = 80;
public static float AmmoReduction = 0.75f;
public static float DamageBoost = 0.07f;
public static float DamageBoost = 0.1f;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, DamageBoost.ToPercent(), (1f - AmmoReduction).ToPercent());
public override void SetDefaults()
+1 -1
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Items.Armor.Astral
public new string LocalizationCategory => "Items.Armor.Hardmode";
public static float DamageBoost = 0.05f;
public static int CritBoost = 10;
public static int CritBoost = 15;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost);
// Set Bonus
+1 -1
View File
@@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Astral
{
public new string LocalizationCategory => "Items.Armor.Hardmode";
public static float DamageBoost = 0.05f;
public static float DamageBoost = 0.1f;
public static float MoveSpeedBoost = 0.15f;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), MoveSpeedBoost.ToPercent());
+11 -1
View File
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using CalamityMod.Enums;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Accessories.Vanity;
using CalamityMod.Items.Fishing;
using CalamityMod.Items.Materials;
using CalamityMod.Items.PermanentBoosters;
@@ -307,13 +308,22 @@ namespace CalamityMod.Items
loot.Add(ModContent.ItemType<EssenceofSunlight>(), 2, 2, 5);
break;
case ItemID.OasisCrate:
loot.Add(ModContent.ItemType<TheComb>(), 8);
break;
case ItemID.OasisCrateHard:
RemoveHardmodeOresFromBiomeCrates(loot);
loot.AddHardmodeOresToCrates(HardmodeCrateType.Biome);
loot.Add(ModContent.ItemType<TheComb>(), 8);
break;
case ItemID.CorruptFishingCrateHard:
case ItemID.CrimsonFishingCrateHard:
case ItemID.HallowedFishingCrateHard:
case ItemID.DungeonFishingCrateHard:
case ItemID.JungleFishingCrateHard:
case ItemID.LavaCrateHard:
case ItemID.OasisCrateHard:
case ItemID.OceanCrateHard:
RemoveHardmodeOresFromBiomeCrates(loot);
loot.AddHardmodeOresToCrates(HardmodeCrateType.Biome);
+15 -9
View File
@@ -679,6 +679,19 @@ namespace CalamityMod.Items
|| item.type == ItemID.QueenSlimeCrystal || item.type == ItemID.MechanicalEye || item.type == ItemID.MechanicalWorm || item.type == ItemID.MechanicalSkull || item.type == ItemID.CelestialSigil)
EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.NotConsumable"));
#endregion
// Brain of Confusion, Black Belt and Master Ninja Gear have guaranteed dodges with a fixed cooldown.
#region Guaranteed Dodge Tooltips
if (item.type == ItemID.BlackBelt)
EditTooltipByNum(0, (line) => line.Text = CalamityUtils.GetTextValue("Common.DodgeProvided") + "\n" + CalamityUtils.GetTextValue("Common.DodgeInformation"));
if (item.type == ItemID.MasterNinjaGear)
EditTooltipByNum(1, (line) => line.Text = CalamityUtils.GetTextValue("Common.DodgeProvided") + "\n" + CalamityUtils.GetTextValue("Common.DodgeInformation"));
if (item.type == ItemID.BrainOfConfusion)
{
EditTooltipByNum(0, (line) => line.Text = CalamityUtils.GetTextValue("Common.DodgeProvided"));
EditTooltipByNum(2, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.DodgeInformation"));
}
#endregion
// Whip tag is dynamically generated for all whips based on the SummonTagDebuffDict, so we'll remove the vanilla tag tootlips.
#region Whip Tag removal
@@ -706,13 +719,6 @@ namespace CalamityMod.Items
#endregion
#region Accessories
// Brain of Confusion, Black Belt and Master Ninja Gear have guaranteed dodges with a fixed cooldown.
if (item.type == ItemID.BlackBelt)
EditTooltipByNum(0, (line) => line.Text = CalamityUtils.GetText("Vanilla.DodgeInfo").Format(BalancingConstants.BeltDodgeCooldownMin / 60, BalancingConstants.BeltDodgeCooldownMax / 60));
if (item.type == ItemID.MasterNinjaGear)
EditTooltipByNum(1, (line) => line.Text = CalamityUtils.GetText("Vanilla.DodgeInfo").Format(BalancingConstants.BeltDodgeCooldownMin / 60, BalancingConstants.BeltDodgeCooldownMax / 60));
if (item.type == ItemID.BrainOfConfusion)
EditTooltipByNum(0, (line) => line.Text = CalamityUtils.GetText("Vanilla.DodgeInfo").Format(BalancingConstants.BrainDodgeCooldownMin / 60, BalancingConstants.BrainDodgeCooldownMax / 60));
// Nerfed Ancient Chisel and its upgrade.
if (item.type == ItemID.AncientChisel)
@@ -1488,7 +1494,7 @@ namespace CalamityMod.Items
#region Enchanted Rarity Text Drawing
public override bool PreDrawTooltipLine(Item item, DrawableTooltipLine line, ref int yOffset)
{
if (line.Name == "ItemName" && line.Mod == "Terraria" && item.type == ModContent.ItemType<XyksBlessingBlue>())
if (line.Name == "ItemName" && line.Mod == "Terraria" && item.type == ModContent.ItemType<XyksBlessingBlue>() && CalamityClientConfig.Instance.TextEffects)
{
Color rarityColor = Color.White;
Vector2 basePosition = new Vector2(line.X, line.Y);
@@ -1549,7 +1555,7 @@ namespace CalamityMod.Items
return false;
}
if (line.Name == "ItemName" && line.Mod == "Terraria" && item.type == ModContent.ItemType<XyksBlessingOrange>())
if (line.Name == "ItemName" && line.Mod == "Terraria" && item.type == ModContent.ItemType<XyksBlessingOrange>() && CalamityClientConfig.Instance.TextEffects)
{
Color rarityColor = Color.White;
Vector2 basePosition = new Vector2(line.X, line.Y);
+1 -1
View File
@@ -312,7 +312,7 @@ namespace CalamityMod.Items
{ ItemID.BonePickaxe, Do(UseTimeExact(6)) },
{ ItemID.BorealWoodHammer, Do(HammerPower(25), UseTimeExact(11)) },
{ ItemID.ButchersChainsaw, Do(TrueMeleeNoSpeed, UseTimeExact(3), TileBoostExact(+0)) },
{ ItemID.CactusPickaxe, Do(PickPower(34), UseTimeExact(9)) },
{ ItemID.CactusPickaxe, Do(UseTimeExact(9)) },
{ ItemID.CnadyCanePickaxe, Do(UseTimeExact(9), TileBoostExact(+1)) }, // Candy Cane Pickaxe
{ ItemID.ChlorophyteChainsaw, Do(TrueMeleeNoSpeed, AxePower(120), UseTimeExact(3), DamageExact(112)) },
{ ItemID.ChlorophyteDrill, Do(TrueMeleeNoSpeed, TileBoostExact(+2), DamageExact(43)) },
+7 -2
View File
@@ -1,4 +1,5 @@
using Terraria;
using CalamityMod.Items.Placeables.FurnitureWulfrum;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -20,7 +21,6 @@ namespace CalamityMod.Items.Materials
Item.maxStack = Item.CommonMaxStack;
Item.value = Item.sellPrice(copper: 10);
Item.rare = ItemRarityID.Blue;
Item.ammo = Item.type;
}
public override void AddRecipes()
{
@@ -29,6 +29,11 @@ namespace CalamityMod.Items.Materials
AddIngredient<WulfrumMetalScrap>().
AddTile(TileID.WorkBenches).
Register();
CreateRecipe().
AddIngredient<AnodizedWulfrumPlatform>(2).
DisableDecraft().
Register();
}
//Added to avoid making the recipes really repetitive and nonsensical. It also makes the new metal color make sense. Adds a bit of flavor to the Wulfrum Recipes
//Uses Stormlion Manible because in order to anodize a metal you must use a current, the other option was a Power Cell but I feel Stormlion Mandible needed more uses
+9
View File
@@ -1,4 +1,5 @@
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Placeables.FurnitureWulfrum;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
@@ -95,6 +96,14 @@ namespace CalamityMod.Items.Materials
}
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<WulfrumPlatform>(2).
DisableDecraft().
Register();
}
public override void Load()
{
Terraria.On_Item.CanFillEmptyAmmoSlot += AvoidDefaultingToAmmoSlot;
@@ -1,18 +1,20 @@
using CalamityMod.ForegroundDrawing.LoopingTextures;
using CalamityMod.Rarities;
using CalamityMod.Tiles.Furniture.Monoliths;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables.Furniture.Monoliths
{
public class OldDukeMonolith : ModItem, ILocalizedModType
[LegacyName("OldDukeMonolith")]
public class EldenDiorama : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetDefaults()
{
Item.DefaultToPlaceableTile(ModContent.TileType<OldDukeMonolithTile>());
Item.value = Item.buyPrice(gold: 25); // Sold by Archmage
Item.rare = ItemRarityID.Pink;
Item.value = Item.sellPrice(gold: 20);
Item.rare = ModContent.RarityType<PureGreen>();
Item.accessory = true;
Item.vanity = true;
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 976 B

After

Width:  |  Height:  |  Size: 976 B

@@ -51,12 +51,11 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
{
"Altixal",
"apotofkoolaid",
"AquaSG",
"Atalya",
"Ben-TK",
"Big E",
"carnymassacre",
"CDMusic",
"Cei",
"CongratsIsTrash",
"Cooper",
"CosmaticMango",
@@ -65,7 +64,6 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
"Dia",
"Done",
"dozezoze",
"Eddie Spaghetti",
"ENNWAY",
"Flowaria",
"Fluffy",
@@ -73,24 +71,19 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
"HaguriHat",
"jasper",
"LordMetarex",
"Mercutio 'Merkalto' Takle",
"Mishiro Usui",
"math2",
"Moonburn",
"Nycro",
"Ozzatron",
"Piky",
"PokerFace",
"Poroboros",
"Raesh",
"Sagittariod",
"Spider Prov",
"StipulateVenus",
"Sunny",
"_tofu",
"Tomat",
"Triangle",
"TYESKI (Universe)",
"Uncle Danny",
"Xyk",
"YuH",
// Former devs
@@ -101,12 +94,14 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
"Alphi",
"Altalyra",
"Amadis",
"AquaSG",
"AstroKnight",
"Blast",
"Blastitle",
"Blockaroz",
"Boffin",
"Bravioli",
"Cei",
"Chetto",
"Chill Dude",
"Cobalion",
@@ -120,6 +115,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
"DylanDoe21",
"Earth",
"EchoDuck",
"Eddie Spaghetti",
"Ein",
"enamoured",
"Enreden",
@@ -150,14 +146,17 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
"Lompl Allimath",
"Lucille Karma",
"MarieArk",
"Mercutio 'Merkalto' Takle",
"Mihaii",
"Minecat",
"Mishiro Usui",
"Mrrp",
"Nao",
"Neverglide",
"Nincity",
"Niorin",
"Nitro",
"Nycro",
"NyctoDarkMatter",
"PaleoStar",
"Pbtopacio",
@@ -166,6 +165,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
"Pinkie Poss",
"Poly",
"Popo",
"Poroboros",
"President Waluigi",
"Puff",
"Purple Necromancer",
@@ -180,6 +180,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
"SixteenInMono",
"Skeletony",
"Sok",
"Spider Prov",
"spooktacular",
"Spoopyro",
"Svante",
@@ -192,6 +193,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
"Trivaxy",
"Tobias",
"Uberransy",
"Uncle Danny",
"Vaikyia",
"Vladimier",
"Yatagarasu",
@@ -12,6 +12,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAuric
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 5;
// Did you know Land Mines can be placed on Weapon Racks? Yeah, me neither.
ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true;
}
@@ -21,7 +21,7 @@ namespace CalamityMod.Items.Placeables.FurnitureDriftwood
public override void AddRecipes()
{
CreateRecipe(4).
CreateRecipe().
AddIngredient<Walls.DriftwoodWall>(4).
AddTile(TileID.WorkBenches).
DisableDecraft().
@@ -9,7 +9,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel
public override void SetDefaults()
{
Item.DefaultToPlaceableTile(ModContent.TileType<Tiles.FurnitureStatigel.StaticRefiner>());
Item.value = Item.sellPrice(gold: 2);
Item.value = Item.sellPrice(silver: 5);
}
public override void AddRecipes()
@@ -21,11 +21,6 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum
AddIngredient<AnodizedWulfrumMetal>().
AddTile(TileID.HeavyWorkBench).
Register();
//CreateRecipe().
// AddIngredient<WulfrumPlatingWall>(4).
// AddTile(TileID.WorkBenches).
// DisableDecraft().
// Register();
}
}
}
@@ -21,11 +21,6 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum
AddIngredient<AnodizedWulfrumMetal>().
AddTile(TileID.HeavyWorkBench).
Register();
//CreateRecipe().
// AddIngredient<WulfrumPlatingWall>(4).
// AddTile(TileID.WorkBenches).
// DisableDecraft().
// Register();
}
}
}
@@ -1,4 +1,5 @@
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Walls;
using Terraria.ID;
using Terraria.ModLoader;
@@ -21,11 +22,11 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum
AddIngredient<EnergyCore>().
AddTile(TileID.HeavyWorkBench).
Register();
//CreateRecipe().
// AddIngredient<WulfrumPlatingWall>(4).
// AddTile(TileID.WorkBenches).
// DisableDecraft().
// Register();
CreateRecipe().
AddIngredient<ChargedWulfrumEnergyBarrierWall>(4).
AddTile(TileID.WorkBenches).
DisableDecraft().
Register();
}
}
}
@@ -1,4 +1,5 @@
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Walls;
using Terraria.ID;
using Terraria.ModLoader;
@@ -22,11 +23,11 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum
AddIngredient<WulfrumMetalScrap>().
AddTile(TileID.HeavyWorkBench).
Register();
//CreateRecipe().
// AddIngredient<WulfrumPlatingWall>(4).
// AddTile(TileID.WorkBenches).
// DisableDecraft().
// Register();
CreateRecipe().
AddIngredient<RoundedAnodizedWulfrumPanelWall>(4).
AddTile(TileID.WorkBenches).
DisableDecraft().
Register();
}
}
}
@@ -1,4 +1,5 @@
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Walls;
using Terraria.ID;
using Terraria.ModLoader;
@@ -21,11 +22,11 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum
AddIngredient<EnergyCore>().
AddTile(TileID.HeavyWorkBench).
Register();
//CreateRecipe().
// AddIngredient<WulfrumPlatingWall>(4).
// AddTile(TileID.WorkBenches).
// DisableDecraft().
// Register();
CreateRecipe().
AddIngredient<WulfrumEnergyBarrierWall>(4).
AddTile(TileID.WorkBenches).
DisableDecraft().
Register();
}
}
}
@@ -1,4 +1,5 @@
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Walls;
using Terraria.ID;
using Terraria.ModLoader;
@@ -21,11 +22,11 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum
AddIngredient<WulfrumMetalScrap>().
AddTile(TileID.Furnaces).
Register();
//CreateRecipe().
// AddIngredient<WulfrumPlatingWall>(4).
// AddTile(TileID.WorkBenches).
// DisableDecraft().
// Register();
CreateRecipe().
AddIngredient<WulfrumPanelWall>(4).
AddTile(TileID.WorkBenches).
DisableDecraft().
Register();
}
}
}
@@ -1,4 +1,5 @@
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Walls;
using Terraria.ID;
using Terraria.ModLoader;
@@ -21,11 +22,11 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum
AddIngredient<AnodizedWulfrumMetal>().
AddTile(TileID.Furnaces).
Register();
//CreateRecipe().
// AddIngredient<WulfrumPlatingWall>(4).
// AddTile(TileID.WorkBenches).
// DisableDecraft().
// Register();
CreateRecipe().
AddIngredient<WulfrumSheetWall>(4).
AddTile(TileID.WorkBenches).
DisableDecraft().
Register();
}
}
}
@@ -1,4 +1,5 @@
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Walls;
using Terraria.ID;
using Terraria.ModLoader;
@@ -22,11 +23,11 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum
AddIngredient<WulfrumMetalScrap>().
AddTile(TileID.Furnaces).
Register();
//CreateRecipe().
// AddIngredient<WulfrumPlatingWall>(4).
// AddTile(TileID.WorkBenches).
// DisableDecraft().
// Register();
CreateRecipe().
AddIngredient<WulfrumSidingWall>(4).
AddTile(TileID.WorkBenches).
DisableDecraft().
Register();
}
}
}
@@ -9,6 +9,7 @@ namespace CalamityMod.Items.Placeables.SunkenSea
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 100;
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<YellowCoral>();
}
public override void SetDefaults()
+1 -1
View File
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.Walls
public override void AddRecipes()
{
CreateRecipe().
CreateRecipe(4).
AddIngredient<Driftwood>().
AddTile(TileID.WorkBenches).
Register();
+3 -3
View File
@@ -12,9 +12,9 @@ namespace CalamityMod.Items.Potions.Alcohol
{
public new string LocalizationCategory => "Items.Potions";
public static float MaxManaBoost = 0.5f;
public static float ManaRegenBoost = 2f;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ManaRegenBoost.ToPercent(),(1-MaxManaBoost).ToPercent());
public static float MagicDmgMult = 0.9f;
public static int ManaRegenBoost = 30;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MagicDmgMult);
public override void SetStaticDefaults()
{
+1 -1
View File
@@ -26,7 +26,7 @@ namespace CalamityMod.Items.Potions.Food
{
Item.DefaultToFood(26, 32, BuffID.WellFed2, CalamityUtils.MinutesToFrames(5));
Item.value = Item.sellPrice(silver: 20);
Item.rare = ItemRarityID.Blue;
Item.rare = ItemRarityID.Green;
}
}
}
+1 -1
View File
@@ -26,7 +26,7 @@ namespace CalamityMod.Items.Potions.Food
{
Item.DefaultToFood(32, 32, BuffID.WellFed2, CalamityUtils.MinutesToFrames(5));
Item.value = Item.sellPrice(silver: 20);
Item.rare = ItemRarityID.Blue;
Item.rare = ItemRarityID.Green;
}
}
}
+1 -1
View File
@@ -26,7 +26,7 @@ namespace CalamityMod.Items.Potions.Food
{
Item.DefaultToFood(26, 32, BuffID.WellFed2, CalamityUtils.MinutesToFrames(5));
Item.value = Item.sellPrice(silver: 20);
Item.rare = ItemRarityID.Blue;
Item.rare = ItemRarityID.Green;
}
}
}
+1 -1
View File
@@ -26,7 +26,7 @@ namespace CalamityMod.Items.Potions.Food
{
Item.DefaultToFood(30, 32, BuffID.WellFed2, CalamityUtils.MinutesToFrames(5));
Item.value = Item.sellPrice(silver: 20);
Item.rare = ItemRarityID.Blue;
Item.rare = ItemRarityID.Green;
}
}
}
+2 -6
View File
@@ -35,18 +35,14 @@ namespace CalamityMod.Items.Tools
// The tool is mechanically faster when wet.
public override float UseTimeMultiplier(Player player)
{
bool surface = player.Center.Y < Main.worldSurface * 16.0;
bool GetEffects = ((Main.raining && surface) || player.dripping || (player.wet && !player.lavaWet && !player.honeyWet));
if (GetEffects)
if (player.Calamity().countsAsAnyWet)
return (float)FasterUseTime / NormalUseTime;
return base.UseTimeMultiplier(player);
}
public override void MeleeEffects(Player player, Rectangle hitbox)
{
bool surface = player.Center.Y < Main.worldSurface * 16.0;
bool GetEffects = ((Main.raining && surface) || player.dripping || (player.wet && !player.lavaWet && !player.honeyWet));
if (GetEffects)
if (player.Calamity().countsAsAnyWet)
Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, DustID.MagnetSphere);
}
+1 -1
View File
@@ -82,7 +82,7 @@ namespace CalamityMod.Items.TreasureBags
// Vanity
itemLoot.Add(ModContent.ItemType<AnahitaMask>(), 7);
itemLoot.Add(ModContent.ItemType<LeviathanMask>(), 7);
itemLoot.Add(ModContent.ItemType<DeepSeaAnchor>(), 15);
itemLoot.Add(ModContent.ItemType<DeepSeaAnchor>(), 10);
itemLoot.Add(ModContent.ItemType<ThankYouPainting>(), ThankYouPainting.DropInt);
}
}
+20 -9
View File
@@ -76,15 +76,6 @@ namespace CalamityMod.Items.TreasureBags.MiscGrabBags
};
itemLoot.AddIf(getsLadPet, ModContent.ItemType<JoyfulHeart>());
// Mihaii dev item
// Name specific: "Mihaii"
static bool getsGoldenBomb(DropAttemptInfo info)
{
string playerName = info.player.name;
return playerName == "Mihaii";
};
itemLoot.AddIf(getsGoldenBomb, ModContent.ItemType<GoldenBomb>());
// HPU dev item
// Name specific: "Heart Plus Up"
static bool getsHapuFruit(DropAttemptInfo info)
@@ -132,6 +123,26 @@ namespace CalamityMod.Items.TreasureBags.MiscGrabBags
}
itemLoot.AddIf(getsOracleHeadphones, ModContent.ItemType<OracleHeadphones>());
// Big E dev vanity
// Name specific: "Big E" in any form
static bool getsLittleE(DropAttemptInfo info)
{
string playerName = info.player.name.ToLower();
return playerName is "big e" or "bige";
}
itemLoot.AddIf(getsLittleE, ModContent.ItemType<LittleE>());
// Sagittariod dev vanity
// Name specific: "Sagi" or "Sagittariod" (case insensitive
static bool getsShimmeringRibbon(DropAttemptInfo info)
{
string playerName = info.player.name.ToLower();
return playerName is "sagi" or "sagittariod";
}
itemLoot.AddIf(getsShimmeringRibbon, ModContent.ItemType<GlimmeringRibbon>());
}
}
}
+2
View File
@@ -1,6 +1,7 @@
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Armor.Vanity;
using CalamityMod.Items.Placeables.Furniture.Paintings;
using CalamityMod.Items.Placeables.Furniture.Monoliths;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Ranged;
@@ -79,6 +80,7 @@ namespace CalamityMod.Items.TreasureBags
// Vanity
itemLoot.Add(ModContent.ItemType<OldDukeMask>(), 7);
itemLoot.Add(ModContent.ItemType<EldenDiorama>(), 10);
itemLoot.Add(ModContent.ItemType<ThankYouPainting>(), ThankYouPainting.DropInt);
}
}
+1 -1
View File
@@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
Item.height = 34;
Item.DamageType = DamageClass.Magic;
Item.mana = 9;
Item.damage = 40;
Item.damage = 31;
Item.knockBack = 11f;
Item.useAnimation = Item.useTime = 11;
Item.autoReuse = true;
+6 -2
View File
@@ -1,9 +1,10 @@
using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.Audio;
using Microsoft.Xna.Framework;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Magic
@@ -12,6 +13,9 @@ namespace CalamityMod.Items.Weapons.Magic
public class DeathValleyDuster : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Magic";
public static int BuffDefenseBoost = PrimordialEarth.BuffDefenseBoost;
public static float BuffDamageBoost = PrimordialEarth.BuffDamageBoost;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(BuffDefenseBoost, BuffDamageBoost.ToPercent());
public override void SetDefaults()
{
Item.width = 36;
+1 -1
View File
@@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic
{
Item.width = 38;
Item.height = 42;
Item.damage = 79;
Item.damage = 95;
Item.DamageType = DamageClass.Magic;
Item.mana = 13;
Item.useTime = 20;
+1 -1
View File
@@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Magic
Item.width = 112;
Item.height = 112;
Item.DamageType = DamageClass.Magic;
Item.damage = 5000;
Item.damage = 5100;
Item.knockBack = 9.5f;
Item.mana = 80;
Item.useAnimation = Item.useTime = AftershotCooldownFrames;
+4 -4
View File
@@ -19,9 +19,9 @@ namespace CalamityMod.Items.Weapons.Magic
{
public new string LocalizationCategory => "Items.Weapons.Magic";
public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/AnomalysNanogunMPFBShot");
public static readonly SoundStyle VacuumStart = new SoundStyle("CalamityMod/Sounds/Item/SHPCVacuumStart") with { Volume = 0.75f };
public static readonly SoundStyle VacuumLoop = new SoundStyle("CalamityMod/Sounds/Item/SHPCVacuumLoop") with { Volume = 0.75f };
public static readonly SoundStyle VacuumEnd = new SoundStyle("CalamityMod/Sounds/Item/SHPCVacuumEnd") with { Volume = 0.75f };
public static readonly SoundStyle VacuumStart = new SoundStyle("CalamityMod/Sounds/Item/SHPCVacuumStart") with { Volume = 0.5f };
public static readonly SoundStyle VacuumLoop = new SoundStyle("CalamityMod/Sounds/Item/SHPCVacuumLoop") with { Volume = 0.5f };
public static readonly SoundStyle VacuumEnd = new SoundStyle("CalamityMod/Sounds/Item/SHPCVacuumEnd") with { Volume = 0.5f };
public const int ShotsPerSoul = 50;
public int storedSoulpower = 0;
@@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Magic
{
Item.width = 124;
Item.height = 52;
Item.damage = 97;
Item.damage = 117;
Item.DamageType = DamageClass.Magic;
Item.mana = 15;
Item.useAnimation = Item.useTime = 60;
@@ -36,7 +36,6 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
public override bool CanRightClick() => true;
public override bool AltFunctionUse(Player player) => true;
public override void HoldItem(Player player)
+1 -1
View File
@@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Magic
{
Item.width = 60;
Item.height = 62;
Item.damage = 2893;
Item.damage = 2626; //Some kind of... brainstorm
Item.DamageType = DamageClass.Magic;
Item.mana = 45;
Item.useAnimation = Item.useTime = 16;
+1 -1
View File
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic
{
Item.width = 220;
Item.height = 60;
Item.damage = 840;
Item.damage = 890;
Item.DamageType = DamageClass.Magic;
Item.mana = 50;
Item.useAnimation = Item.useTime = 80; // 42 frames of firing animation
+1 -1
View File
@@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 70;
Item.height = 70;
Item.damage = 1200;
Item.damage = 900;
Item.knockBack = 9f;
Item.useAnimation = Item.useTime = 24;
Item.DamageType = DamageClass.Melee;
+2
View File
@@ -46,6 +46,8 @@ namespace CalamityMod.Items.Weapons.Melee
public override void HoldItem(Player player)
{
player.Calamity().mouseWorldListener = true;
if (player.whoAmI != Main.myPlayer)
return;
if (player.Calamity().mouseRight && !player.mouseInterface && player.Calamity().killModeCooldown == 0 && !Main.mapFullscreen && !Main.blockMouse)
{
SoundStyle buff = new("CalamityMod/Sounds/Item/DemonSwordKillMode");
+3 -9
View File
@@ -28,13 +28,13 @@ namespace CalamityMod.Items.Weapons.Melee
public override void MeleeEffects(Player player, Rectangle hitbox)
{
if (IsPlayerInContactWithWater(player))
if (player.Calamity().countsAsAnyWet)
Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, DustID.MagnetSphere);
}
public override float UseSpeedMultiplier(Player player) => IsPlayerInContactWithWater(player) ? 1.66f : 1f;
public override float UseSpeedMultiplier(Player player) => player.Calamity().countsAsAnyWet ? 1.66f : 1f;
public override void ModifyWeaponKnockback(Player player, ref StatModifier knockback) => knockback.Base += IsPlayerInContactWithWater(player) ? 1.5f : 0f;
public override void ModifyWeaponKnockback(Player player, ref StatModifier knockback) => knockback.Base += player.Calamity().countsAsAnyWet ? 1.5f : 0f;
public override void AddRecipes()
{
@@ -43,11 +43,5 @@ namespace CalamityMod.Items.Weapons.Melee
AddTile(TileID.WorkBenches).
Register();
}
private static bool IsPlayerInContactWithWater(Player player)
{
bool surface = player.Center.Y < Main.worldSurface * 16.0;
return (Main.raining && surface) || player.dripping || (player.wet && !player.lavaWet && !player.honeyWet);
}
}
}
+4 -2
View File
@@ -1,8 +1,9 @@
using CalamityMod.Items.Materials;
using System;
using CalamityMod.Enums;
using CalamityMod.Items.Materials;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Melee;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
@@ -90,6 +91,7 @@ namespace CalamityMod.Items.Weapons.Melee
GeneralParticleHandler.SpawnParticle(spark3);
Particle spark2 = new SparkParticle(partPos, partVel, false, 24, partScale * 0.6f, Color.LightGreen);
GeneralParticleHandler.SpawnParticle(spark2);
spark2.DrawLayer = GeneralDrawLayer.AfterEverything;
}
Vector2 dustVel2 = new Vector2(5 * swordDirection, -5).RotatedBy(swingRotation - 1.7f * swordDirection);
+2
View File
@@ -44,6 +44,8 @@ namespace CalamityMod.Items.Weapons.Melee
public override void HoldItem(Player player)
{
player.Calamity().mouseWorldListener = true;
if (player.whoAmI != Main.myPlayer)
return;
if (player.Calamity().mouseRight && !player.mouseInterface && player.Calamity().killModeCooldown == 0 && !Main.mapFullscreen && !Main.blockMouse)
{
SoundStyle buff = new("CalamityMod/Sounds/Item/DemonSwordKillMode");
@@ -43,6 +43,8 @@ namespace CalamityMod.Items.Weapons.Melee
public override void HoldItem(Player player)
{
player.Calamity().mouseWorldListener = true;
if (player.whoAmI != Main.myPlayer)
return;
if (player.Calamity().mouseRight && !player.mouseInterface && player.Calamity().killModeCooldown == 0 && !Main.mapFullscreen && !Main.blockMouse)
{
SoundStyle buff = new("CalamityMod/Sounds/Item/DemonSwordKillMode");
+9
View File
@@ -4,6 +4,8 @@ using CalamityMod.Projectiles.Melee.Spears;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using System.Collections.Generic;
using System.Linq;
namespace CalamityMod.Items.Weapons.Melee
{
@@ -18,6 +20,13 @@ namespace CalamityMod.Items.Weapons.Melee
base.SetStaticDefaults();
}
public override bool SizeModifiers => false;
public override void ModifyTooltips(List<TooltipLine> tooltips)
{
float cdmg = 2f + Main.LocalPlayer.Calamity().critDamage + Main.LocalPlayer.GetTotalCritChance(TrueMeleeNoSpeedDamageClass.Instance) * 0.02f;
tooltips.FirstOrDefault(x => x.Name == "CritChance")!.Text = CalamityUtils.GetText("Common.CritDamageTootip").Format(cdmg.ToPercent());
}
public override void SetDefaults()
{
Item.width = 66;
+1 -1
View File
@@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 78;
Item.height = 78;
Item.damage = 240;
Item.damage = 310;
Item.DamageType = DamageClass.Melee;
Item.useStyle = ItemUseStyleID.Swing;
Item.useAnimation = Item.useTime = 20;
+1 -1
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.width = 114;
Item.height = 146;
Item.damage = 3140;
Item.DamageType = DamageClass.Melee;
Item.DamageType = TrueMeleeDamageClass.Instance;
Item.useAnimation = 45;
Item.useStyle = ItemUseStyleID.Swing;
Item.useTime = 45;
+1 -1
View File
@@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 66;
Item.height = 70;
Item.damage = 300;
Item.damage = 250;
Item.DamageType = DamageClass.MeleeNoSpeed;
Item.noMelee = true;
Item.useTurn = true;
+1 -1
View File
@@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.width = 74;
Item.height = 94;
Item.useStyle = ItemUseStyleID.Shoot;
Item.damage = 234;
Item.damage = 220;
Item.DamageType = TrueMeleeDamageClass.Instance;
Item.useAnimation = Item.useTime = 20;
Item.shootSpeed = 10f;
+1 -1
View File
@@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 114;
Item.height = 128;
Item.damage = 550;
Item.damage = 600;
Item.DamageType = TrueMeleeDamageClass.Instance;
Item.useAnimation = 40;
Item.useTime = 40;
+6 -1
View File
@@ -4,6 +4,7 @@ using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Melee
@@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Melee
public class MonolithSword : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public static int ArmorPenetration = 15;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ArmorPenetration);
public override void SetDefaults()
{
Item.damage = 30;
@@ -25,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.useTurn = true;
Item.value = CalamityGlobalItem.RarityOrangeBuyPrice;
Item.rare = ItemRarityID.Orange;
Item.ArmorPenetration = 15;
Item.ArmorPenetration = ArmorPenetration;
}
public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox)
{
+1 -1
View File
@@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 90;
Item.height = 134;
Item.damage = 2001;
Item.damage = 2200;
Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance;
Item.noMelee = true;
Item.noUseGraphic = true;
+1 -1
View File
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 44;
Item.height = 42;
Item.damage = 36;
Item.damage = 32;
Item.DamageType = TrueMeleeDamageClass.Instance;
Item.noMelee = true;
Item.useTurn = true;
+1 -1
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 86;
Item.height = 64;
Item.damage = 1100;
Item.damage = 1170;
Item.DamageType = DamageClass.MeleeNoSpeed;
Item.useAnimation = Item.useTime = 55;
Item.knockBack = 8.5f;
+1 -1
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 100;
Item.height = 118;
Item.damage = 143;
Item.damage = 123;
Item.DamageType = TrueMeleeDamageClass.Instance;
Item.useAnimation = Item.useTime = 28;
+1 -1
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 44;
Item.height = 36;
Item.damage = 63;
Item.damage = 78;
Item.DamageType = DamageClass.MeleeNoSpeed;
Item.useTime = 20;
Item.useAnimation = 20;
Loaded 100 of 293 files, more files were not shown because too many files have changed in this diff. Show more