Merge branch '1.4.4' into AprilFoolsFishingContent

This commit is contained in:
Xyk committed 2026-03-11 01:09:05 -07:00
commit 463dd810bb
282 files changed
+2715 -1456

No files matched your search

+118
View File
@@ -0,0 +1,118 @@
using System;
using CalamityMod.DataStructures;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.DamageOverTime
{
public class Bane : ModBuff
{
public static Color baneColor1 = new Color(217, 115, 0);
public static Color baneColor2 = new Color(0, 232, 146);
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 40,
NPCLifeRegenMethod = BaneNPCLifeRegen
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public static void BaneNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage)
{
var cnpc = npc.Calamity();
bool effected = (cnpc.abaddonEffected || cnpc.apollyonEffected);
bool strong = cnpc.apollyonEffected;
int baseDoTValue = (int)debuffData.EnemyLostRegen;
if (effected)
{
foreach (var player in Main.ActivePlayers)
{
{
float improvedDamage = baseDoTValue * player.Calamity().playerBaneDebuffDamage;
if (improvedDamage > baseDoTValue && (player.Calamity().abaddon || player.Calamity().apollyon))
{
baseDoTValue = (int)improvedDamage;
}
}
}
}
cnpc.ApplyDPSDebuff(baseDoTValue, baseDoTValue / 20, ref npc.lifeRegen, ref damage);
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().bane = true;
}
public override void Update(NPC npc, ref int buffIndex)
{
npc.Calamity().bane = true;
}
internal static void DrawEffects(PlayerDrawSet drawInfo, bool hasDebuffResistance = false)
{
Player player = drawInfo.drawPlayer;
Vector3 light = baneColor1.ToVector3();
Lighting.AddLight(player.Center, light);
float sine = (float)Math.Sin((Main.GlobalTimeWrappedHourly * 9.0f) / MathHelper.Pi);
if (Main.rand.NextBool(20))
{
bool start = !Main.rand.NextBool(4);
Vector2 baneVel = Vector2.UnitY * Main.rand.NextFloat(-0.5f, -1.5f) * (Main.rand.NextBool(5) ? 2 : 1) + player.velocity * 0.35f;
Vector2 banePos = player.Center + Main.rand.NextVector2Circular(3, 8) + (Vector2.UnitY * 14) + Vector2.UnitY * ((1 - sine) * 2.3f);
Particle baneRunes = new BaneParticle(banePos, baneVel, false, 55, 1f, start ? baneColor1 : baneColor2, start ? baneColor2 : baneColor1, Vector2.One, true, Main.rand.NextBool(3) ? Main.rand.NextFloat(-0.2f, 0.2f) : 0, 0.95f, MathHelper.PiOver2 * Main.rand.Next(4 + 1), sineRate: Main.rand.NextFloat(0.2f, 1f), sineIntensity: Main.rand.Next(14, 19 + 1));
GeneralParticleHandler.SpawnParticle(baneRunes);
if (Main.rand.NextBool())
baneRunes.DrawLayer = Enums.GeneralDrawLayer.BeforeNPCs;
}
}
internal static void DrawEffects(NPC npc, ref Color drawColor)
{
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomRingAngled").Value;
Texture2D center = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
Vector2 drawPosition = npc.Center - Main.screenPosition;
Color color = baneColor1;
Color color2 = baneColor2;
float maxSizeMult = 10f;
float widthMult = MathF.Pow(Utils.Remap(npc.width, 10, 500, 1f, maxSizeMult, false), 0.8f);
float sine = (float)Math.Sin((Main.GlobalTimeWrappedHourly * 9.0f) / MathHelper.Pi);
float sine2 = (float)Math.Sin((Main.GlobalTimeWrappedHourly * 11.0f) / MathHelper.Pi);
float randSize = Main.rand.NextFloat(0.82f, 1.08f);
float clockSine = (float)Math.Sin((float)Math.Pow(Utils.GetLerpValue(0, 110, ((int)(Main.GlobalTimeWrappedHourly * 60) % 120)), 5));
for (int i = 0; i < 2; i++)
{
float sizeMult = (i == 0 ? 1 : 0.8f);
float colorMult = (i == 0 ? 1 : 0.7f);
Main.EntitySpriteDraw(bloom, drawPosition + (Vector2.UnitY * npc.height / 2f) + Vector2.UnitY * ((1 - sine) * 2.3f * MathF.Pow(widthMult, 0.55f)), null, Color.Lerp(color2, Color.White, i * 0.7f) with { A = 0 } * colorMult, 0, bloom.Size() / 2, new Vector2((sine * 0.09f + 1.2f) * widthMult, 0.9f) * 0.18f * MathF.Pow(randSize, 0.3f) * npc.Calamity().baneVisual, SpriteEffects.None);
Main.EntitySpriteDraw(center, drawPosition + (Vector2.UnitY * npc.height / 2f) + Vector2.UnitY * ((1 - sine2) * 3.3f * MathF.Pow(widthMult, 0.55f)), null, Color.Lerp(color, Color.White, i * 0.7f) with { A = 0 } * colorMult, 0, center.Size() / 2, new Vector2((sine2 * 0.09f + 1.2f) * widthMult, 0.6f) * 0.18f * randSize * npc.Calamity().baneVisual, SpriteEffects.None);
}
int chance = (int)(13 + 40 * (1 - npc.Calamity().baneVisual));
if (Main.rand.NextBool(chance))
{
bool start = !Main.rand.NextBool(4);
Vector2 baneVel = Vector2.UnitY * Main.rand.NextFloat(-0.5f, -1.5f) * widthMult * (Main.rand.NextBool(5) ? 2 : 1) + npc.velocity * 0.35f;
Vector2 banePos = npc.Center + Main.rand.NextVector2Circular(3 * widthMult, 8) + (Vector2.UnitY * npc.height / 3f) + Vector2.UnitY * ((1 - sine) * 2.3f);
Particle baneRunes = new BaneParticle(banePos, baneVel, false, 55, 1f * MathF.Pow(widthMult, 0.45f), start ? color : color2, start ? color2 : color, Vector2.One, true, Main.rand.NextBool(3) ? Main.rand.NextFloat(-0.2f, 0.2f) : 0, 0.95f, MathHelper.PiOver2 * Main.rand.Next(4 + 1), sineRate: Main.rand.NextFloat(0.2f, 1f), sineIntensity: Main.rand.Next(14, 19 + 1) * widthMult);
GeneralParticleHandler.SpawnParticle(baneRunes);
if (Main.rand.NextBool())
baneRunes.DrawLayer = Enums.GeneralDrawLayer.BeforeNPCs;
}
Lighting.AddLight(npc.Center, color.ToVector3() * 0.6f);
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

+3 -4
View File
@@ -16,11 +16,11 @@ namespace CalamityMod.Buffs.DamageOverTime
{
EnemyLostRegen = 60, //Unused in the method, this is the amount of DoT from Forbidden Oathblade demon flames
HeatDebuffScaling = 1, //Unused in the method, but kept so other things can know this is a heat debuff
NPCLifeRegenMethod = DemonFlamesNPCLifeRegen
NPCLifeRegenMethod = DemonicFlamesNPCLifeRegen
};
public static void DemonFlamesNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage)
public static void DemonicFlamesNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage)
{
int baseDemonicFlamesDoTValue = (int)Math.Max(npc.Calamity().ActiveHeatDebuffMultiplier.ApplyTo(npc.Calamity().demonicFlamesBonusDamage), npc.Calamity().demonicFlamesBonusDamage);
int baseDemonicFlamesDoTValue = (int)Math.Max(Math.Max(npc.Calamity().ActiveHeatDebuffMultiplier.ApplyTo(npc.Calamity().demonicFlamesBonusDamage), npc.Calamity().demonicFlamesBonusDamage), (int)debuffData.EnemyLostRegen);
npc.Calamity().ApplyDPSDebuff(baseDemonicFlamesDoTValue, baseDemonicFlamesDoTValue / 15, ref npc.lifeRegen, ref damage);
}
public override void SetStaticDefaults()
@@ -30,7 +30,6 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+1 -1
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 400,
EnemyLostRegen = 350, //175 dps
WaterDebuffScaling = 1
};
public override void SetStaticDefaults()
+5 -1
View File
@@ -1,4 +1,5 @@
using System;
using CalamityMod.DataStructures;
using CalamityMod.NPCs;
using CalamityMod.Particles;
using CalamityMod.Projectiles;
@@ -19,7 +20,10 @@ namespace CalamityMod.Buffs.DamageOverTime
// This deals 600 DPS per stack, is boosted by ranged stats and can supercrit.
internal static int BaseDamage = 120;
internal static int FramesPerDamageTick = 12;
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = BaseDamage
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+1 -1
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 240,
EnemyLostRegen = 350, //175 dps
SicknessDebuffScaling = 1
};
public override void SetStaticDefaults()
+1 -1
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public static DebuffData debuffData = new DebuffData(DebuffData.DebuffBehavior.Electric)
{
EnemyLostRegen = 100,
EnemyLostRegen = 75, //150 dps when moving, 37.5 dps when stationary
ElectricDebuffScaling = 1
};
public override void SetStaticDefaults()
+1 -1
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Buffs.DamageOverTime
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 400,
EnemyLostRegen = 500, //250 dps is extra strong for its tier due to being difficult to inflict
ColdDebuffScaling = 1
};
public override void SetStaticDefaults()
-1
View File
@@ -15,7 +15,6 @@ namespace CalamityMod.Buffs.StatBuffs
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
}
+64
View File
@@ -0,0 +1,64 @@
using System;
using CalamityMod.DataStructures;
using CalamityMod.Items.Accessories;
using Terraria;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.StatBuffs
{
public class SmashedEvil : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
EnemyLostRegen = 40,
SicknessDebuffScaling = 1,
HeatDebuffScaling = 1,
ColdDebuffScaling = 1,
ElectricDebuffScaling = 1,
WaterDebuffScaling = 1,
NPCLifeRegenMethod = SmashedEvilNPCRegen
};
public static void SmashedEvilNPCRegen(NPC npc, int buffType, ref int buffIndex, ref int damage)
{
var cnpc = npc.Calamity();
float totalDPS = debuffData.EnemyLostRegen;
var heat = cnpc.ActiveHeatDebuffMultiplier;
var cold = cnpc.ActiveColdDebuffMultiplier;
var sick = cnpc.ActiveSicknessDebuffMultiplier;
var elec = cnpc.ActiveElectricDebuffMultiplier;
var water = cnpc.ActiveWaterDebuffMultiplier;
StatModifier totalScaling =
DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveHeatDebuffMultiplier, debuffData.HeatDebuffScaling)
.CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveColdDebuffMultiplier, debuffData.ColdDebuffScaling)
.CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveSicknessDebuffMultiplier, debuffData.SicknessDebuffScaling)
.CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveWaterDebuffMultiplier, debuffData.WaterDebuffScaling)
.CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveElectricDebuffMultiplier, debuffData.ElectricDebuffScaling)
))));
totalDPS = totalScaling.ApplyTo(totalDPS);
var totalDPSAdjusted = totalDPS - debuffData.EnemyVanillaRegenToCancelOut;
npc.Calamity().ApplyDPSDebuff((int)(totalDPSAdjusted), (int)Math.Max(totalDPS * debuffData.MultiplierDamageTickSize, debuffData.MinimumDamageTickSize), ref npc.lifeRegen, ref damage);
}
public override void SetStaticDefaults()
{
Main.debuff[Type] = false;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
{
player.lifeRegenTime += 2;
player.GetDamage<GenericDamageClass>() += 0.1f;
player.moveSpeed += 0.2f;
}
public override void Update(NPC npc, ref int buffIndex)
{
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 665 B

+8 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.NPCs;
using CalamityMod.DataStructures;
using CalamityMod.NPCs;
using CalamityMod.Systems.Collections;
using Terraria;
using Terraria.ID;
@@ -14,7 +15,13 @@ namespace CalamityMod.Buffs.StatDebuffs
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
// Purely to make it get electric color in tooltips
public static DebuffData debuffData = new DebuffData()
{
ElectricDebuffScaling = 1
};
public override void Update(NPC npc, ref int buffIndex)
{
-12
View File
@@ -1,12 +0,0 @@
using CalamityMod.Projectiles.Typeless;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class DemonshadeSetDevilBuff : BaseSummonBuff
{
protected override int MinionProjectileType => ModContent.ProjectileType<DemonshadeRedDevil>();
protected override ref bool MinionBool => ref BuffModdedOwner.rDevil;
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 993 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 750 B

After

Width:  |  Height:  |  Size: 819 B

+31 -29
View File
@@ -326,15 +326,6 @@ namespace CalamityMod.CalPlayer
public int deadSunCounter = 6;
public int DragonsBreathAudioCooldown = 0;
public int DragonsBreathAudioCooldown2 = 0;
public int darklightEnergy = 0;
public int darklightEnergyTimer = 0;
public bool darklightEnergyPaused = false;
public bool darklightEnergyMaxFXPlayed = false;
private int lucreciaParticleTimer = 0;
public int elementalMastery = 0;
public int elementalMasteryTimer = 0;
public bool elementalMasteryPaused = false;
public bool elementalMasterySFXPlayed = false;
public float unstableCastersGauntletVis = 0;
public int unstableCastersGauntletVisTimer = 0;
public int PhotoAudioCooldown = 0;
@@ -343,11 +334,6 @@ namespace CalamityMod.CalPlayer
public int arpeggioCooldown = 0;
/// <summary> Cooldown variable which prevents using Burning Sea during its "burn-out" mechanic. </summary>
public int burningSeaBurnOut = 0;
/// <summary>
/// How many stacks of Evil Smasher's boost the player has. This increases the weapon's damage, use speed, and knockback.<br/>
/// Getting hit decreases this by 1. Switching to a different item resets this to 0.
/// </summary>
public int evilSmasherBoost = 0;
/// <summary> Cooldown variable for spawning Plague Tainted SMG's drones from left-click bullets. </summary>
public int plagueTaintedSMGDroneCooldown = 0;
/// <summary> Cooldown variable which prevents using Firestorm Cannon or Spectralstorm Cannon during their overheat periods. </summary>
@@ -454,6 +440,9 @@ namespace CalamityMod.CalPlayer
public int consecutiveCaughtFish = 0;
public float WeakTimeFreezeUseTimer = 0;
public bool WeakTimeFreezeInUse = false;
public int DemonAltarDialogueCounter = 0;
public int DemonAltarDialogueCooldown = 0;
#endregion
#region Sound
@@ -722,8 +711,8 @@ namespace CalamityMod.CalPlayer
public bool drawnAnyShieldThisFrame = false;
// TODO -- Some way to show the player their total shield points.
public int TotalEnergyShielding => RoverDriveShieldDurability + LunicCorpsShieldDurability + pSoulShieldDurability + SpongeShieldDurability;
public int TotalMaxShieldDurability => (roverDrive ? RoverDrive.ShieldDurabilityMax : 0) + (lunicCorpsSet ? LunicCorpsHelmet.ShieldDurabilityMax : 0) + (profanedCrystalBuffs ? ProfanedSoulCrystal.ShieldDurabilityMax : ((pSoulArtifact && !profanedCrystal) ? ProfanedSoulArtifact.ShieldDurabilityMax : 0)) + (sponge ? TheSponge.ShieldDurabilityMax : 0);
public int TotalEnergyShielding => RoverDriveShieldDurability + LunicCorpsShieldDurability + pSoulShieldDurability + SpongeShieldDurability + (Starshield > 0 ? StratusStarburst : 0);
public int TotalMaxShieldDurability => (roverDrive ? RoverDrive.ShieldDurabilityMax : 0) + (lunicCorpsSet ? LunicCorpsHelmet.ShieldDurabilityMax : 0) + (profanedCrystalBuffs ? ProfanedSoulCrystal.ShieldDurabilityMax : ((pSoulArtifact && !profanedCrystal) ? ProfanedSoulArtifact.ShieldDurabilityMax : 0)) + (sponge ? TheSponge.ShieldDurabilityMax : 0) + (Starshield > 0 ? 100 : 0);
public int RoverDriveShieldDurability = 0;
public int LunicCorpsShieldDurability = 0;
@@ -810,6 +799,7 @@ namespace CalamityMod.CalPlayer
#region Accessory
public bool shieldOfTheHighRulerDashVelocityBoosted = false;
public bool yharimsGift = false;
public bool luxorsGift = false;
public bool luxorHit = false;
public bool luxorsGiftVanity = false;
@@ -960,6 +950,9 @@ namespace CalamityMod.CalPlayer
public bool toxicHeart = false;
public bool toxicHeartVisuals = false;
public bool abaddon = false;
public int abaddonCooldown = 0;
public bool abaddonEffectVisual = false;
public float playerBaneDebuffDamage = 0;
public bool aeroStone = false;
public bool lifejelly = false;
@@ -1032,7 +1025,7 @@ namespace CalamityMod.CalPlayer
public bool IsFirstDashFrame = true;
public int fallingBootVelCheckTimer = 0;
public bool voidOfCalamity = false;
public bool voidOfExtinction = false;
public bool apollyon = false;
public bool eArtifact = false;
public bool dArtifact = false;
public bool auricSArtifact = false;
@@ -1269,7 +1262,6 @@ namespace CalamityMod.CalPlayer
public int tailFrame = 0;
public bool astralStarRain = false;
public int astralStarRainCooldown = 0;
public int AbaddonCooldown = 0;
public int VoidCooldown = 0;
public int ursaSergeantCooldown = 0;
public int AlchFlaskCooldown = 0;
@@ -1308,8 +1300,6 @@ namespace CalamityMod.CalPlayer
public bool daedalusCrystal = false;
/// <summary> Hydrothermic armor's summoner set bonus minion. </summary>
public bool chaosSpirit = false;
/// <summary> Demonshade armor's set bonus minion. </summary>
public bool redDevil = false;
public bool GemTechSet = false;
/// <summary> Calamity's Cobalt armor set bonus; increases damage and crit chance based on how fast the player is moving. </summary>
public bool CobaltSet = false;
@@ -1363,6 +1353,7 @@ namespace CalamityMod.CalPlayer
public bool armorCrunch = false;
public bool crumble = false;
public bool irradiated = false;
public bool bane = false;
public bool brimstoneFlames = false;
public bool weakBrimstoneFlames = false;
public bool demonicFlames = false;
@@ -1564,8 +1555,6 @@ namespace CalamityMod.CalPlayer
/// <summary> Pearl of Enthrallment. </summary>
public bool waterEleBuff = false;
public bool fClump = false;
/// <summary> Demonshade armor's Red Devil. </summary>
public bool rDevil = false;
/// <summary> Aerospec armor's Valkyrie. </summary>
public bool aValkyrie = false;
public bool apexShark = false;
@@ -2350,6 +2339,7 @@ namespace CalamityMod.CalPlayer
blazingCursorDamage = false;
blazingCursorVisuals = false;
yharimsGift = false;
luxorsGift = false;
luxorsGiftVanity = false;
fungalSymbiote = false;
@@ -2459,7 +2449,7 @@ namespace CalamityMod.CalPlayer
crawCarapace = false;
baroclaw = false;
voidOfCalamity = false;
voidOfExtinction = false;
apollyon = false;
eArtifact = false;
dArtifact = false;
auricSArtifact = false;
@@ -2548,6 +2538,8 @@ namespace CalamityMod.CalPlayer
spiritOrigin = false;
spiritOriginVanity = false;
critDamage = 0;
if (abaddonCooldown > 0)
abaddonCooldown--;
astralStarRain = false;
@@ -2640,6 +2632,9 @@ namespace CalamityMod.CalPlayer
blunderBoosterVisibility = true;
veneratedLocket = false;
if (DemonAltarDialogueCooldown > 0)
DemonAltarDialogueCooldown--;
alcoholPoisoning = false;
shadowflame = false;
daybroken = false;
@@ -2652,6 +2647,7 @@ namespace CalamityMod.CalPlayer
armorCrunch = false;
crumble = false;
irradiated = false;
bane = false;
brimstoneFlames = false;
witheredDebuff = false;
absorberAffliction = false;
@@ -2814,7 +2810,6 @@ namespace CalamityMod.CalPlayer
brimEleBuff = false;
waterEleBuff = false;
fClump = false;
rDevil = false;
aValkyrie = false;
sCrystal = false;
sGod = false;
@@ -2841,7 +2836,6 @@ namespace CalamityMod.CalPlayer
fungalClumpVanity = false;
howlsHeart = false;
howlsHeartVanity = false;
redDevil = false;
valkyrie = false;
slimeGod = false;
chaosSpirit = false;
@@ -3090,7 +3084,6 @@ namespace CalamityMod.CalPlayer
gSabatonTempJumpSpeed = 0;
rOfDelivarenceRam = false;
astralStarRainCooldown = 0;
AbaddonCooldown = 0;
VoidCooldown = 0;
AlchFlaskCooldown = 0;
ascendantInsigniaCooldown = 0;
@@ -3139,6 +3132,7 @@ namespace CalamityMod.CalPlayer
armorCrunch = false;
crumble = false;
irradiated = false;
bane = false;
brimstoneFlames = false;
witheredDebuff = false;
absorberAffliction = false;
@@ -3435,12 +3429,9 @@ namespace CalamityMod.CalPlayer
CurrentlyViewedHologramText = string.Empty;
#endregion
evilSmasherBoost = 0;
burningSeaBurnOut = 0;
flareGunOverheat = 0;
hellbornShots = 0;
darklightEnergy = 0;
elementalMastery = 0;
garandShots = 0;
persecutedEnchantSummonTimer = 0;
momentumCapacitorTime = 0;
@@ -4479,6 +4470,10 @@ namespace CalamityMod.CalPlayer
if (HasCustomDash && UsedDash.IsOmnidirectional)
Player.maxFallSpeed = 50f;
// If the player isn't moving yet is still dashing, disable the dash (prevents weird hook jank)
if (Player.velocity == Vector2.Zero && Player.dashDelay == -1)
Player.dashDelay = 0;
tailFrameUp++;
if (tailFrameUp == 8)
{
@@ -4998,6 +4993,13 @@ namespace CalamityMod.CalPlayer
else
scionsCurioDebuffDamage = 0;
if (Player.Calamity().abaddon || Player.Calamity().apollyon)
{
Player.Calamity().playerBaneDebuffDamage = (1 + Player.GetTotalCritChance(Player.GetBestClass()) * 0.01f * (Player.Calamity().apollyon ? Apollyon.critScaling : Abaddon.critScaling));
}
else
Player.Calamity().playerBaneDebuffDamage = 0;
// True melee damage from various vanilla equipment placed here.
// Titan Glove and ALL upgrades.
+1 -2
View File
@@ -497,8 +497,7 @@ namespace CalamityMod.CalPlayer
if (calamityPlayer.brimstoneFlames && drawInfo.shadow == 0f)
{
bool resistsBrimstoneFlames = abaddon; // Looks weaker if you have Abaddon equipped
BrimstoneFlames.DrawEffects(drawInfo, resistsBrimstoneFlames);
BrimstoneFlames.DrawEffects(drawInfo);
}
if (calamityPlayer.brainRot && drawInfo.shadow == 0f)
+58 -17
View File
@@ -8,6 +8,7 @@ using CalamityMod.Buffs.StatBuffs;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.CalPlayer.Dashes;
using CalamityMod.Cooldowns;
using CalamityMod.DataStructures;
using CalamityMod.Dusts;
using CalamityMod.Enums;
using CalamityMod.Events;
@@ -27,7 +28,7 @@ using CalamityMod.Items.Armor.Tarragon;
using CalamityMod.Items.Armor.Victide;
using CalamityMod.Items.Armor.Wulfrum;
using CalamityMod.Items.Potions;
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.Items.Tools;
using CalamityMod.Items.VanillaArmorChanges;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Rogue;
@@ -40,6 +41,7 @@ using CalamityMod.NPCs.Providence;
using CalamityMod.NPCs.SupremeCalamitas;
using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Projectiles.Ranged;
using CalamityMod.Projectiles.Rogue;
using CalamityMod.Projectiles.Typeless;
@@ -52,13 +54,11 @@ using Terraria;
using Terraria.Audio;
using Terraria.Chat;
using Terraria.DataStructures;
using Terraria.Graphics.Shaders;
using Terraria.GameContent.Creative;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Items.Tools;
namespace CalamityMod.CalPlayer
{
@@ -460,7 +460,53 @@ namespace CalamityMod.CalPlayer
}
#endregion
#region OnHitNPC
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (Player.Calamity().yharimsGift)
target.AddBuff(ModContent.BuffType<AuricRebuke>(),120);
int debuffSpreadProj = ModContent.ProjectileType<DebuffSpreadEffect>();
if ((Player.Calamity().abaddon || Player.Calamity().apollyon) && (target.Calamity().abaddonEffected || target.Calamity().apollyonEffected) && hit.Crit && abaddonCooldown == 0 && Player.ownedProjectileCounts[debuffSpreadProj] == 0)
{
int maxTargetNum = target.Calamity().apollyonEffected ? 10 : 6;
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, Vector2.Zero, debuffSpreadProj, 0, 0, Player.whoAmI, 0, target.whoAmI, maxTargetNum);
abaddonCooldown = -1; // Prevents multiple projectiles hitting on the same frame from spawning multiple of these
}
}
#endregion
#region Modify Hit NPC
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
if (target.HasBuff<SmashedEvil>())
{
//This is essentially 10 AP, but independent of armor amount
modifiers.FlatBonusDamage += 5;
}
if (Player.Calamity().apollyon)
{
target.Calamity().apollyonEffected = true;
// Check here for the amount of debuffs on enemy
int numOfDebuffs = 0;
for (int index = 0; index < target.buffType.Length; index++)
{
int type = target.buffType[index];
var debuffData = BuffDatasets.DebuffDataset[type];
if (debuffData != null)
numOfDebuffs++;
}
modifiers.CritDamage += Apollyon.critDamageBoostPerDebuff * numOfDebuffs;
}
else if (Player.Calamity().abaddon)
target.Calamity().abaddonEffected = true;
else
{
target.Calamity().abaddonEffected = false;
target.Calamity().apollyonEffected = false;
}
}
public override void ModifyHitNPCWithItem(Item item, NPC target, ref NPC.HitModifiers modifiers)
{
modifiers.CritDamage += critDamage;
@@ -848,7 +894,7 @@ namespace CalamityMod.CalPlayer
float cooldownDurationScalar = MathHelper.Clamp((actualProjDamage - dodgeDamageGateValue) / (float)maxCooldownDurationDamageValue, 0f, 1f);
// The Evolution
if (evolution)
if (evolution && !Player.HasBuff<SilvaRevival>())
{
if (Player.whoAmI == Main.myPlayer)
{
@@ -1887,10 +1933,6 @@ namespace CalamityMod.CalPlayer
Rectangle location = new Rectangle((int)Player.position.X, (int)Player.position.Y - 16, Player.width, Player.height);
CombatText.NewText(location, Color.LightBlue, Language.GetTextValue(shieldDamageText));
// Give the player iframes for taking a shield hit, regardless of whether or not the shields broke.
int shieldHitIFrames = Player.ComputeHitIFrames(info);
Player.GiveIFrames(info.CooldownCounter, shieldHitIFrames, true);
// Spawn particles when hit with the shields up, regardless of whether or not the shields broke.
// More particles spawn if a shield broke.
if (pSoulArtifact)
@@ -1961,6 +2003,10 @@ namespace CalamityMod.CalPlayer
// If the shields completely absorbed the hit, then delete the hit using reflection.
if (shieldsFullyAbsorbedHit)
{
// Give the player iframes for taking a shield hit
int shieldHitIFrames = Player.ComputeHitIFrames(info);
Player.GiveIFrames(info.CooldownCounter, shieldHitIFrames, true);
freeDodgeFromShieldAbsorption = true;
// Cancel defense damage, if it was going to occur this frame.
@@ -2174,9 +2220,6 @@ namespace CalamityMod.CalPlayer
LoseAdrenalineOnHurt(hurtInfo, false);
}
if (evilSmasherBoost > 0)
evilSmasherBoost -= 1;
if (trinketOfChi)
chiBuffTimer = 0;
@@ -2366,7 +2409,7 @@ namespace CalamityMod.CalPlayer
Player.AddBuff(BuffID.Honey, 300, false);
// Handle hit effects from the gem tech armor set.
Player.Calamity().GemTechState.PlayerOnHitEffects((int)hurtInfo.Damage);
Player.Calamity().GemTechState.PlayerOnHitEffects(hurtInfo);
if (Player.whoAmI == Main.myPlayer)
{
@@ -2408,10 +2451,10 @@ namespace CalamityMod.CalPlayer
if (dAmulet)
{
var source = Player.GetSource_Accessory_OnHurt(FindAccessory<DeificAmulet>(), hurtInfo.DamageSource);
int projAmount = (rampartOfDeities ? 12 : 6);
var projAmount = (rampartOfDeities ? 12 : 6) * (Player.strongBees ? 1.5f : 1f);
for (int n = 0; n < projAmount; n++)
{
int deificProjDamage = (int)(Player.GetBestClassDamage().ApplyTo(DeificAmulet.StarDamage) * (Player.strongBees ? 0.85f : 1f));
int deificProjDamage = (int)(Player.GetBestClassDamage().ApplyTo(DeificAmulet.StarDamage));
Projectile onHitProj = Main.projectile[Projectile.NewProjectile(source, Player.Center, new Vector2(0,-15 * (rampartOfDeities && n % 2 == 0 ? 0.75f: 1.25f)).RotatedBy(MathHelper.TwoPi/projAmount*n), ModContent.ProjectileType<AstralStar>(), deificProjDamage, 4f, Player.whoAmI)];
if (onHitProj.whoAmI.WithinBounds(Main.maxProjectiles))
@@ -2422,8 +2465,6 @@ namespace CalamityMod.CalPlayer
onHitProj.tileCollide = false;
onHitProj.extraUpdates = 1;
onHitProj.Calamity().conditionalHomingRange = 600f;
if (Player.strongBees)
onHitProj.penetrate += 1;
}
}
}
+3 -2
View File
@@ -115,13 +115,14 @@ namespace CalamityMod.CalPlayer
ApplyDoTDebuff(crushDepth, 18, purity);
ApplyDoTDebuff(astralInfection, 24, infectedJewel || hideOfDeus || purity);
ApplyDoTDebuff(shadowflame, 30, purity);
ApplyDoTDebuff(brimstoneFlames, (int)MathF.Round(30 * (abaddon ? (1f - Abaddon.BrimstoneFlamesReduction) : 1f)), purity);
ApplyDoTDebuff(plague, (int)MathF.Round(30 * (abaddon ? (1f - AlchemicalDecanter.PlagueReduction) : 1f)), purity);
ApplyDoTDebuff(brimstoneFlames, 30, purity);
ApplyDoTDebuff(plague, (int)MathF.Round(30 * (alchFlask ? (1f - AlchemicalDecanter.PlagueReduction) : 1f)), purity);
ApplyDoTDebuff(vHex, 30); // Has other effects
ApplyDoTDebuff(searingLava, 30);
ApplyDoTDebuff(demonicFlames, 33, purity); // Never inflicted on the player
ApplyDoTDebuff(laceration, 36, purity);
ApplyDoTDebuff(daybroken, 40, purity);
ApplyDoTDebuff(bane, 40, purity);
ApplyDoTDebuff(nightwither, 40, purity);
ApplyDoTDebuff(holyFlames, 40, purity);
ApplyDoTDebuff(voidfrost, 40, purity);
+33 -200
View File
@@ -69,6 +69,8 @@ using CalamityMod.Tiles.Abyss.AbyssAmbient;
using CalamityMod.Tiles.FurnitureAuric;
using CalamityMod.Tiles.Ores;
using CalamityMod.UI;
using CalamityMod.UI.DialogueDisplay;
using CalamityMod.UI.DialogueDisplay.DisplayEffects;
using CalamityMod.Utilities;
using CalamityMod.World;
using Microsoft.Xna.Framework;
@@ -152,9 +154,6 @@ namespace CalamityMod.CalPlayer
// Drawing parameters
UpdateDrawingParameters();
// Handle Lucrecia's passive energy effects
HandleLucreciaLineEffects();
// Update all particle sets for items.
// This must be done here instead of in the item logic because these sets are not properly instanced
// in the global classes. Attempting to update them there will cause multiple updates to one set for multiple items.
@@ -406,120 +405,6 @@ namespace CalamityMod.CalPlayer
Player.wingTime++;
}
if (Player.HeldItem.type == ModContent.ItemType<Lucrecia>() && darklightEnergy > 0)
{
if (darklightEnergy == Lucrecia.MaxEnergy && !darklightEnergyPaused)
{
darklightEnergyPaused = true;
darklightEnergyTimer = 0;
}
darklightEnergyTimer++;
// If the energy is at max, pause for 180 ticks
if (darklightEnergyPaused)
{
if (darklightEnergyTimer >= 1 && !darklightEnergyMaxFXPlayed)
{
SoundStyle maxEnergyReached = new("CalamityMod/Sounds/Custom/AbilitySounds/DarklightEnergyCharged");
SoundEngine.PlaySound(maxEnergyReached with { Volume = 0.9f }, Player.Center);
for (int i = 0; i < 10; i++) // Circular ring of particles burst from player
{
float angle = MathHelper.TwoPi * (i / 10f);
Vector2 spawnDirection = angle.ToRotationVector2();
Vector2 velocity = spawnDirection * 14f;
CritSpark spark = new CritSpark(Player.Center + spawnDirection * 3f, velocity, Color.Lerp(Color.CornflowerBlue, Color.MediumPurple, Main.rand.NextFloat(1f)), Color.White * 0.33f, 1.2f, 12, 0.3f, 1.2f);
GeneralParticleHandler.SpawnParticle(spark);
}
darklightEnergyMaxFXPlayed = true;
}
// If the pause is Done, resume decrementing.
if (darklightEnergyTimer >= 180)
{
darklightEnergyPaused = false;
darklightEnergyTimer = 0;
darklightEnergy--;
}
}
else // Decrementing
{
darklightEnergyMaxFXPlayed = false;
// Once every 20 ticks
if (darklightEnergyTimer >= 20)
{
darklightEnergy--;
darklightEnergyTimer = 0;
}
}
}
else
{
// Reset all energy variables when not holding the weapon
darklightEnergyTimer = 0;
darklightEnergyPaused = false;
darklightEnergy = 0;
}
if (Player.HeldItem.type == ModContent.ItemType<Lightspeed>() && elementalMastery > 0)
{
if (elementalMastery == Lightspeed.MaxEnergy && !elementalMasteryPaused)
{
elementalMasteryPaused = true;
elementalMasteryTimer = 0;
}
elementalMasteryTimer++;
// If the mastery is at max, pause for 180 ticks
if (elementalMasteryPaused)
{
if (elementalMasteryTimer >= 1 && !elementalMasterySFXPlayed)
{
SoundStyle maxEnergyReached = new("CalamityMod/Sounds/Custom/AbilitySounds/DarklightEnergyCharged");
SoundEngine.PlaySound(maxEnergyReached with { Volume = 0.9f }, Player.Center);
for (int i = 0; i < 10; i++) // Circular ring of particles burst from player
{
float angle = MathHelper.TwoPi * (i / 10f);
Vector2 spawnDirection = angle.ToRotationVector2();
Vector2 velocity = spawnDirection * 14f;
CritSpark spark = new CritSpark(Player.Center + spawnDirection * 3f, velocity, Color.Lerp(Color.CornflowerBlue, Color.MediumPurple, Main.rand.NextFloat(1f)), Color.White * 0.33f, 1.2f, 12, 0.3f, 1.2f);
GeneralParticleHandler.SpawnParticle(spark);
}
elementalMasterySFXPlayed = true;
}
// If the pause is Done, resume decrementing.
if (elementalMasteryTimer >= 180)
{
elementalMasteryPaused = false;
elementalMasteryTimer = 0;
elementalMastery--;
}
}
else // Decrementing
{
elementalMasterySFXPlayed = false;
// Once every 30 ticks
if (elementalMasteryTimer >= 30)
{
elementalMastery--;
elementalMasteryTimer = 0;
}
}
}
else
{
// Reset all EM variables when not holding the weapon
elementalMasteryTimer = 0;
elementalMasteryPaused = false;
elementalMastery = 0;
}
if (Player.HeldItem.type == ModContent.ItemType<UnstableCastersGauntlet>() && unstableCastersGauntletVis < 100)
{
@@ -1139,8 +1024,39 @@ namespace CalamityMod.CalPlayer
}
}
private void DemonAltarTalking()
{
for (var h = -15; h < 15; h++)
{
for (var j = -15; j < 15; j++)
{
var tilePos = Player.Center.ToTileCoordinates() + new Point(h, j);
if (Main.tile[tilePos.X, tilePos.Y].TileType == TileID.DemonAltar)
{
string type = WorldGen.crimson ? "Mods.CalamityMod.EvilSmasher.CrimsonAltar" : "Mods.CalamityMod.EvilSmasher.DemonAltar";
if (DialogueDisplaySystem.ContainsDialogueKey(type))
DialogueDisplaySystem.RemoveDialogue(DialogueDisplaySystem.GetSlot(type));
DialogueDisplaySystem.StartDialogueOnClient(type, new Vector2(tilePos.X * 16 + 16, tilePos.Y * 16), DemonAltarDialogueCounter, 180, false, new AltarText());
DemonAltarDialogueCounter++;
DemonAltarDialogueCooldown = 300;
if (DemonAltarDialogueCounter >= 4)
{
DemonAltarDialogueCooldown = 3600;
DemonAltarDialogueCounter = 0;
}
return;
}
}
}
}
private void MiscEffects()
{
if (Player.inventory.Any(x => x.type == ItemID.Pwnhammer) && !Player.inventory.Any(x => x.type == ModContent.ItemType<EvilSmasher>()) && Player.adjTile[TileID.DemonAltar] && DemonAltarDialogueCooldown <= 0 && Player.miscCounter % 30 == 0)
{
DemonAltarTalking();
}
//Mana Burn update
if (ManaBurnFireDrawer != null)
{
@@ -2250,8 +2166,6 @@ namespace CalamityMod.CalPlayer
raiderSoundCooldown--;
if (astralStarRainCooldown > 0)
astralStarRainCooldown--;
if (AbaddonCooldown > 0)
AbaddonCooldown--;
if (VoidCooldown > 0)
VoidCooldown--;
if (ursaSergeantCooldown > 0)
@@ -3629,11 +3543,6 @@ namespace CalamityMod.CalPlayer
if (Player.HeldItem.type != ModContent.ItemType<PridefulHuntersPlanarRipper>())
planarSpeedBoost = 0;
}
if (evilSmasherBoost > 0)
{
if (Player.HeldItem.type != ModContent.ItemType<EvilSmasher>())
evilSmasherBoost = 0;
}
// Flight time boosts
double flightTimeMult = 1D +
@@ -4435,82 +4344,6 @@ namespace CalamityMod.CalPlayer
}
#endregion
#region Lucrecia Line Effects
public void HandleLucreciaLineEffects()
{
int lucreciaItemID = ModContent.ItemType<Lucrecia>();
int lightspeedItemID = ModContent.ItemType<Lightspeed>();
if (Player.HeldItem.type == lucreciaItemID && darklightEnergy > 0)
{
lucreciaParticleTimer--;
// If the timer is at or below zero, spawn a particle.
if (lucreciaParticleTimer <= 0)
{
// Reset the timer (spawn rate depends on energy)
lucreciaParticleTimer = (int)(20 - 15 * (darklightEnergy / 60));
float radius = Main.rand.NextFloat(160f, 190f); // Distance from center
float spawnAngle = Main.rand.NextFloat(MathHelper.TwoPi); // Random angle along the whole radius
Vector2 spawnPosition = Player.Center + spawnAngle.ToRotationVector2() * radius;
// Scale opacity with energy
float opacity = darklightEnergy / (float)Lucrecia.MaxEnergy;
Color color = Main.rand.NextBool() ? Color.MediumPurple : Color.CornflowerBlue;
color *= opacity * 0.5f;
if (darklightEnergy >= 100)
{
color *= 2.4f; // Way brighter
}
Vector2 dummyVelocity = Vector2.Zero; // We dont want the argument where this is used to have influence on the actual path
float rotationSpeed = 0.04f;
var particle = new RoundedStarParticle(spawnPosition, dummyVelocity, color with { A = 0 }, Main.rand.NextFloat(0.05f, 0.065f), Main.rand.Next(30, 60), rotationSpeed, 1f, true, Player.Center, Player.whoAmI);
GeneralParticleHandler.SpawnParticle(particle);
}
}
if (Player.HeldItem.type == lightspeedItemID && elementalMastery > 0)
{
lucreciaParticleTimer--;
// If the timer is at or below zero, spawn a particle.
if (lucreciaParticleTimer <= 0)
{
// Reset the timer (spawn rate depends on energy)
lucreciaParticleTimer = (int)(20 - 15 * (elementalMastery / 60));
float radius = Main.rand.NextFloat(160f, 190f); // Distance from center
float spawnAngle = Main.rand.NextFloat(MathHelper.TwoPi); // Random angle along the whole radius
Vector2 spawnPosition = Player.Center + spawnAngle.ToRotationVector2() * radius;
// Scale opacity with energy
float opacity = elementalMastery / (float)Lightspeed.MaxEnergy;
Color color = Main.rand.NextBool() ? Color.Aqua : Color.OrangeRed;
color *= opacity * 0.5f;
if (elementalMastery >= 100)
{
color *= 2.4f; // Way brighter
}
Vector2 dummyVelocity = Vector2.Zero; // We dont want the argument where this is used to have influence on the actual path
float rotationSpeed = 0.04f;
var particle = new RoundedStarParticle(spawnPosition, dummyVelocity, color with { A = 0 }, Main.rand.NextFloat(0.05f, 0.065f), Main.rand.Next(30, 60), rotationSpeed, 1f, true, Player.Center, Player.whoAmI);
GeneralParticleHandler.SpawnParticle(particle);
}
}
}
#endregion
#region Energy Shields
private void EnergyShields()
{
+5 -19
View File
@@ -695,14 +695,14 @@ namespace CalamityMod.CalPlayer
if (alchFlask && AlchFlaskCooldown == 0 && proj.type != ProjectileType<BasicPlagueBee>())
{
int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(10);
int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(Player.strongBees ? 15 : 10);
Vector2 seekerVelocity = new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.2f);
Projectile bee = Projectile.NewProjectileDirect(source, position, seekerVelocity, ProjectileType<BasicPlagueBee>(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2);
bee.ArmorPenetration = 20;
bee.penetrate = 2;
bee.extraUpdates = 1;
AlchFlaskCooldown = Player.strongBees ? 6 : 7;
AlchFlaskCooldown = 7;
}
bool lifeAndShieldCondition = Player.statLife >= Player.statLifeMax2 && (!HasAnyEnergyShield || TotalEnergyShielding >= TotalMaxShieldDurability);
@@ -733,20 +733,6 @@ namespace CalamityMod.CalPlayer
}
}
if (abaddon && crit && AbaddonCooldown <= 0 && !voidOfExtinction)
{
AbaddonCooldown = 15;
int AbaddonExploDamage = (int)Player.GetBestClassDamage().ApplyTo(Abaddon.AbaddonExploDamage);
Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType<AbaddonCrit>(), AbaddonExploDamage, 0f, Player.whoAmI);
}
if (voidOfExtinction && crit && VoidCooldown <= 0)
{
VoidCooldown = 15;
int VoidExploDamage = (int)Player.GetBestClassDamage().ApplyTo(VoidofExtinction.VoidExploDamage);
Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType<VoidofExtinctionCrit>(), VoidExploDamage, 0f, Player.whoAmI);
}
if (ursaSergeant && ursaSergeantCooldown <= 0)
{
ursaSergeantCooldown = UrsaSergeant.MaxCooldown;
@@ -1266,10 +1252,10 @@ namespace CalamityMod.CalPlayer
}
if (amalgam)
{
target.AddBuff(BuffID.Daybreak, 120);
target.AddBuff(BuffType<Nightwither>(), 120);
target.AddBuff(BuffType<BrimstoneFlames>(), 120);
target.AddBuff(BuffID.Frostburn2, 120);
target.AddBuff(BuffType<Plague>(), 120);
target.AddBuff(BuffType<VermillionFlux>(), 120);
target.AddBuff(BuffID.Electrified, 120);
target.AddBuff(BuffType<CrushDepth>(), 120);
}
if (frostFlare)
@@ -11,7 +11,7 @@ using Terraria.UI.Chat;
namespace CalamityMod.ChatTags
{
public sealed class CalamityBuffTagHandler : AbstractTagHandler<CalamityBuffTagHandler>
public sealed class BuffTagEnemyEffectHandler : AbstractTagHandler<BuffTagEnemyEffectHandler>
{
public sealed class Snippet(int buffId) : TextSnippet
{
+79
View File
@@ -0,0 +1,79 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Graphics;
using Terraria;
using Terraria.GameContent;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.UI.Chat;
namespace CalamityMod.ChatTags
{
public sealed class BuffTagPlayerEffectHandler : AbstractTagHandler<BuffTagPlayerEffectHandler>
{
public sealed class Snippet(int buffId) : TextSnippet
{
private const float IconSize = 26f;
public int BuffId => buffId;
public bool DrawIcon => true;
public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = default, Color color = default, float scale = 1)
{
size = new Vector2(GetStringLength(FontAssets.MouseText.Value), IconSize);
if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0))
{
// Avoid re-drawing the icon when drawing borders.
if (DrawIcon)
{
// Tomat: I would love to support
// BuffLoader.[Pre/Post]Draw here, but it's not vaible
// because:
// 1. Main.DrawBuffIcon relies on LocalPlayer's buffs,
// 2. we can't control the source or destination
// rectangles.
if (Main.netMode != NetmodeID.Server && !Main.dedServ)
{
var texture = TextureAssets.Buff[BuffId];
spriteBatch.Draw(texture.Value, new Rectangle((int)position.X, (int)position.Y - 2, (int)IconSize, (int)IconSize), null, Color.White);
}
position.X += IconSize;
}
var buffColor = CalamityUtils.GetDebuffTooltipNameColor(buffId);
var name = $"{(DrawIcon ? " " : "")}{Lang.GetBuffName(buffId)}";
ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.MouseText.Value, name, position, buffColor, 0f, Vector2.Zero, new Vector2(scale));
}
return true;
}
public override float GetStringLength(DynamicSpriteFont font)
{
float iconSize = !DrawIcon ? 0f : IconSize + font.MeasureString(" ").X;
float size = iconSize + font.MeasureString(Lang.GetBuffName(buffId)).X;
return size * Scale;
}
}
protected override string[] TagNames { get; } = ["cbuffplr"];
public override TextSnippet Parse(string text, Color baseColor = new(), string options = null)
{
if (int.TryParse(text, out int buffId) && buffId >= 0 && buffId < BuffLoader.BuffCount)
{
return new Snippet(buffId);
}
if (BuffID.Search.TryGetId(text, out buffId))
{
return new Snippet(buffId);
}
return new TextSnippet(text);
}
}
}
-1
View File
@@ -6,7 +6,6 @@ using Terraria.ModLoader;
namespace CalamityMod.Cooldowns
{
// TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks.
public sealed class CooldownRegistry : ModSystem
{
// Indexed by ushort netID. Contains every registered cooldown.
+6 -4
View File
@@ -1,9 +1,9 @@
using System;
using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.WorldBuilding;
namespace CalamityMod.DataStructures
{
@@ -224,7 +224,8 @@ namespace CalamityMod.DataStructures
.CombineWith(ApplyScalingToStatModifer(cnpc.ActiveElectricDebuffMultiplier, ElectricDebuffScaling)
))))
:
cnpc.ActiveTypelessDebuffMultiplier;
// Bane doesn't scale with debuff multipliers. This should be implemented as a default feature you can apply to debuffs at some point.
buffType == ModContent.BuffType<Bane>() ? cnpc.ActiveTypelessDebuffMultiplier : StatModifier.Default;
//Ensure at least 25% effectiveness
if (totalScaling.Multiplicative <= 0.25f)
@@ -257,7 +258,8 @@ namespace CalamityMod.DataStructures
.CombineWith(ApplyScalingToStatModifer(cnpc.ActiveElectricDebuffMultiplier, ElectricDebuffScaling)
))))
:
cnpc.ActiveTypelessDebuffMultiplier;
// Bane doesn't scale with debuff multipliers. This should be implemented as a default feature you can apply to debuffs at some point.
buffType == ModContent.BuffType<Bane>() ? cnpc.ActiveTypelessDebuffMultiplier : StatModifier.Default;
//Ensure at least 25% effectiveness
if (totalScaling.Multiplicative <= 0.25f)
@@ -419,7 +421,7 @@ namespace CalamityMod.DataStructures
};
public static DebuffData Electrified = new DebuffData(DebuffBehavior.Electric)
{
EnemyLostRegen = 21,
EnemyLostRegen = 30, // 15 dps stationary, 60 dps moving
EnemyVanillaRegenToCancelOut = 8,
ElectricDebuffScaling = 1
};
+3 -2
View File
@@ -202,7 +202,7 @@ namespace CalamityMod.DataStructures
PreviouslyUsedGem = usedGemType;
}
public void PlayerOnHitEffects(int hitDamage)
public void PlayerOnHitEffects(Player.HurtInfo hurtInfo)
{
// Don't do anything if the player is not wearing the Gem Tech set.
var cgp = Owner.Calamity();
@@ -211,6 +211,7 @@ namespace CalamityMod.DataStructures
bool gemWasLost = false;
int gemDamage = 0;
int hitDamage = (int)hurtInfo.Damage;
bool largeEnoughRegularHit = hitDamage >= GemTechHeadgear.GemBreakDamageLowerBound;
// 09FEB2024: Ozzatron: chalice of the blood god no longer protects you when using gem tech armor.
// It is now slightly anti-synergetic, in that taking tiny hits when you're already bleeding will make you keep losing gems.
@@ -275,7 +276,7 @@ namespace CalamityMod.DataStructures
gemDamage = CalamityUtils.DamageSoftCap(gemDamage, GemTechHeadgear.GemDamageSoftcapThreshold);
if (Main.myPlayer == OwnerIndex)
Projectile.NewProjectile(Owner.GetSource_ItemUse(Owner.HeldItem), gemPosition, Vector2.Zero, ModContent.ProjectileType<GemTechArmorGem>(), gemDamage, 0f, OwnerIndex, 0f, (int)GemThatShouldBeLost);
Projectile.NewProjectile(Owner.GetSource_OnHurt(hurtInfo.DamageSource), gemPosition, Vector2.Zero, ModContent.ProjectileType<GemTechArmorGem>(), gemDamage, 0f, OwnerIndex, 0f, (int)GemThatShouldBeLost);
}
}
@@ -0,0 +1,47 @@
{
"Revision": 1,
"DefaultColor": "FF0000",
"DefaultSpeaker": "DemonAltar",
"AlignType": 1,
"TextDelay": 2,
"BasePunctuationDelay": {
"Delay": 10,
"ForceSet": false,
"Locks": false
},
"PunctuationDelayCap": 30,
"PunctuationDelays": {
"!": {
"Delay": 20,
"ForceSet": true,
"Locks": true
},
"?": {
"Delay": 20,
"ForceSet": true,
"Locks": true
}
},
"Pages": [
{
"Lines": [
"You, slayer of the flesh tower...[Pause(0.25)] we have an offer fitting of your deeds."
]
},
{
"Lines": [
"We can bestow you might untold...[Pause(0.25)] [Shaking:to grind your enemies to dust!]"
]
},
{
"Lines": [
"Simply yield the holy hammer unto the altar."
]
},
{
"Lines": [
"Kneel, and we shall render you the strength."
]
}
]
}
@@ -0,0 +1,47 @@
{
"Revision": 1,
"DefaultColor": "FF00FF",
"DefaultSpeaker": "DemonAltar",
"AlignType": 1,
"TextDelay": 2,
"BasePunctuationDelay": {
"Delay": 10,
"ForceSet": false,
"Locks": false
},
"PunctuationDelayCap": 30,
"PunctuationDelays": {
"!": {
"Delay": 20,
"ForceSet": true,
"Locks": true
},
"?": {
"Delay": 20,
"ForceSet": true,
"Locks": true
}
},
"Pages": [
{
"Lines": [
"Bearer of the Holy Hammer...[Pause(0.25)] [Wavy:desirest thou to taste true power?]"
]
},
{
"Lines": [
"Thine eyes shall be opened...[Pause(0.25)] [Shaking:thou shalt be even as the gods!]"
]
},
{
"Lines": [
"Yield the hammer unto us upon the altar."
]
},
{
"Lines": [
"Surrender, and thou shalt surely receive our might."
]
}
]
}
+10 -2
View File
@@ -56,7 +56,11 @@ namespace CalamityMod.Dusts
public override bool PreDraw(Dust dust)
{
Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f));
Vector2 baseSize = Vector2.One;
if (dust.customData != null)
baseSize = (Vector2)dust.customData;
Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1 * baseSize.X, 0.5f * baseSize.X), Utils.Remap(dust.velocity.Length(), 2, 7, 1 * baseSize.Y, 2.5f * baseSize.Y));
// Glow Orb
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
@@ -82,7 +86,11 @@ namespace CalamityMod.Dusts
private static void DrawPixelated(Dust dust)
{
Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f));
Vector2 baseSize = Vector2.One;
if (dust.customData != null)
baseSize = (Vector2)dust.customData;
Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1 * baseSize.X, 0.5f * baseSize.X), Utils.Remap(dust.velocity.Length(), 2, 7, 1 * baseSize.Y, 2.5f * baseSize.Y));
// Glow Orb
Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
Binary file not shown.

Before

Width:  |  Height:  |  Size: 445 B

After

Width:  |  Height:  |  Size: 786 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 401 B

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 B

After

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 834 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 647 B

After

Width:  |  Height:  |  Size: 407 B

+11 -6
View File
@@ -1,4 +1,6 @@
using Terraria;
using System.Collections.Generic;
using CalamityMod.Buffs.DamageOverTime;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
@@ -10,11 +12,8 @@ namespace CalamityMod.Items.Accessories
{
public new string LocalizationCategory => "Items.Accessories";
public static int CritBoost = 8;
public static float BrimstoneFlamesReduction = 0.5f;
public static int AbaddonExploDamage = 25;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost, BrimstoneFlamesReduction.ToPercent());
public static float critScaling = 3f; // How effective crit chance is at increasing debuff damage
public override void SetDefaults()
{
Item.width = 26;
@@ -27,7 +26,13 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.Calamity().abaddon = true;
player.GetCritChance<GenericDamageClass>() += CritBoost;
player.Calamity().abaddonEffectVisual = !hideVisual;
}
public override void ModifyTooltips(List<TooltipLine> list)
{
if (Main.LocalPlayer != null)
list.FindAndReplace("[DAMAGELINE]", Main.LocalPlayer.Calamity().abaddon ? this.GetLocalization("Equipped").Format(((int)(Bane.debuffData.EnemyLostRegen / 2 * Main.LocalPlayer.Calamity().playerBaneDebuffDamage)).ToString())
: this.GetLocalizedValue("Unequipped"));
}
}
}
@@ -1,20 +1,20 @@
using CalamityMod.CalPlayer;
using System.Collections.Generic;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.CalPlayer;
using CalamityMod.Items.Materials;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
public class VoidofExtinction : ModItem, ILocalizedModType
[LegacyName("VoidofExtinction")]
public class Apollyon : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public static int CritBoost = 13;
public static int VoidExploDamage = 40;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost, Abaddon.BrimstoneFlamesReduction.ToPercent());
public static float critScaling = 8f; // How effective crit chance is at increasing debuff damage
public static float critDamageBoostPerDebuff = 0.03f; // 3% increased crit damage per debuff
public override void SetDefaults()
{
Item.width = 26;
@@ -37,10 +37,14 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.voidOfExtinction = true;
modPlayer.abaddon = true;
player.GetCritChance<GenericDamageClass>() += CritBoost;
modPlayer.apollyon = true;
modPlayer.abaddonEffectVisual = !hideVisual;
}
public override void ModifyTooltips(List<TooltipLine> list)
{
if (Main.LocalPlayer != null)
list.FindAndReplace("[DAMAGELINE]", Main.LocalPlayer.Calamity().apollyon ? this.GetLocalization("Equipped").Format(((int)(Bane.debuffData.EnemyLostRegen / 2 * Main.LocalPlayer.Calamity().playerBaneDebuffDamage)).ToString())
: this.GetLocalizedValue("Unequipped"));
}
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 798 B

After

Width:  |  Height:  |  Size: 798 B

+1 -1
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories
public class ChaosStone : ModItem, ILocalizedModType
{
public static float LostRegenPer100Mana => 8;
public static float DamageMultPer100Mana => 0.04f;
public static float DamageMultPer100Mana => 0.05f;
public new string LocalizationCategory => "Items.Accessories";
public override void ModifyTooltips(List<TooltipLine> tooltips)
{
+2 -2
View File
@@ -14,8 +14,8 @@ namespace CalamityMod.Items.Accessories
public static int PauldronSlamDamage = 330;
public override void SetDefaults()
{
Item.width = 54;
Item.height = 56;
Item.width = 42;
Item.height = 34;
Item.value = CalamityGlobalItem.RarityLightRedBuyPrice;
Item.rare = ItemRarityID.LightRed;
Item.accessory = true;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

+5 -5
View File
@@ -39,11 +39,11 @@ namespace CalamityMod.Items.Accessories
modPlayer.rBrain = true; // Handles shaderain cloud spawning on hit
modPlayer.amalgam = true;
player.brainOfConfusionItem = Item;
modPlayer.HeatDebuffMultiplier += 2f;
modPlayer.ColdDebuffMultiplier += 2f;
modPlayer.SicknessDebuffMultiplier += 2f;
modPlayer.WaterDebuffMultiplier += 2f;
modPlayer.ElectricDebuffMultiplier += 2f;
modPlayer.HeatDebuffMultiplier += 3f;
modPlayer.ColdDebuffMultiplier += 3f;
modPlayer.SicknessDebuffMultiplier += 3f;
modPlayer.WaterDebuffMultiplier += 3f;
modPlayer.ElectricDebuffMultiplier += 3f;
}
public override void AddRecipes()
+9 -26
View File
@@ -9,13 +9,14 @@ namespace CalamityMod.Items.Accessories
public class YharimsGift : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public int dragonTimer = 60;
public static int MeteorDamage => CalamityUtils.ScaleWithDifficulty(250);
public override void SetDefaults()
{
Item.width = 20;
Item.height = 22;
Item.defense = 12;
Item.defense = 10;
Item.accessory = true;
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
Item.rare = ModContent.RarityType<BurnishedAuric>();
@@ -24,38 +25,20 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.Calamity().yharimsGift = true;
var source = player.GetSource_Accessory(Item);
player.moveSpeed += 0.15f;
player.GetDamage<GenericDamageClass>() += 0.15f;
player.moveSpeed += 0.2f;
player.GetDamage<GenericDamageClass>() += 0.1f;
player.noKnockback = true;
if (!player.StandingStill())
{
dragonTimer--;
if (dragonTimer <= 0)
{
if (player.whoAmI == Main.myPlayer)
{
int damage = (int)player.GetBestClassDamage().ApplyTo(175);
int projectile1 = Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType<DragonDust>(), damage, 5f, player.whoAmI, 0f, 0f);
Main.projectile[projectile1].timeLeft = 60;
}
dragonTimer = 60;
}
}
else
{
dragonTimer = 60;
}
if (player.immune)
if (player.HasIFrames())
{
if (player.miscCounter % 8 == 0)
{
if (player.whoAmI == Main.myPlayer)
{
int damage = (int)player.GetBestClassDamage().ApplyTo(375);
int damage = (int)player.GetBestClassDamage().ApplyTo(MeteorDamage);
CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType<SkyFlareFriendly>(), damage, 9f, player.whoAmI);
CalamityUtils.ProjectileRain(source, player.Center, 400f, 400f, 500f, 800f, 22f, ModContent.ProjectileType<SkyFlareFriendly>(), damage, 9f, player.whoAmI).Calamity().conditionalHomingRange = 160;
}
}
}
-17
View File
@@ -27,7 +27,6 @@ namespace CalamityMod.Items.Armor.Demonshade
// Set Bonus
public static int SetBonusMinionSlotBoost = 8;
public static float SetBonusSummonDamageBoost = 1f;
public static int DevilDamage = 1000;
public static int BeamDamage => CalamityUtils.ScaleWithDifficulty(300);
public static int ScytheDamage => CalamityUtils.ScaleWithDifficulty(500);
public static int EnrageDuration = CalamityUtils.SecondsToFrames(10);
@@ -59,22 +58,6 @@ namespace CalamityMod.Items.Armor.Demonshade
modPlayer.dsSetBonus = true;
modPlayer.wearingRogueArmor = true;
modPlayer.WearingPostMLSummonerSet = true;
if (player.whoAmI == Main.myPlayer && !modPlayer.chibii)
{
modPlayer.redDevil = true;
var source = player.GetSource_ItemUse(Item);
if (player.FindBuffIndex(ModContent.BuffType<DemonshadeSetDevilBuff>()) == -1)
{
player.AddBuff(ModContent.BuffType<DemonshadeSetDevilBuff>(), 3600, true);
}
if (player.ownedProjectileCounts[ModContent.ProjectileType<DemonshadeRedDevil>()] < 1)
{
int damage = (int)player.GetTotalDamage<SummonDamageClass>().ApplyTo(DevilDamage);
var devil = Projectile.NewProjectileDirect(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType<DemonshadeRedDevil>(), damage, 0f, Main.myPlayer, 2f, 0f);
devil.originalDamage = DevilDamage;
}
}
player.maxMinions += SetBonusMinionSlotBoost;
player.GetDamage<SummonDamageClass>() += SetBonusSummonDamageBoost;
}
+2 -2
View File
@@ -1,4 +1,4 @@
using CalamityMod.Buffs.StatBuffs;
using CalamityMod.Buffs.StatBuffs;
using CalamityMod.Items.Materials;
using Terraria;
using Terraria.ID;
@@ -76,7 +76,7 @@ namespace CalamityMod.Items.Armor.Empyrean
var modPlayer = player.Calamity();
modPlayer.xerocSet = true;
modPlayer.rogueStealthMax += SetBonusRogueStealth;
player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth());
player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), PermanentWrathHealthRatio.ToPercent());
if (player.statLife <= (int)(player.statLifeMax2 * PermanentWrathHealthRatio))
player.AddBuff(ModContent.BuffType<EmpyreanWrath>(), 2);
modPlayer.wearingRogueArmor = true;
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.Armor.Plaguebringer
public new string LocalizationCategory => "Items.Armor.Hardmode";
public static int MinionSlotBoost = 1;
public static float SummonDamageBoost = 0.15f;
public static float SummonDamageBoost = 0.20f;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent());
public override void SetStaticDefaults()
@@ -12,7 +12,7 @@ namespace CalamityMod.Items.Armor.Plaguebringer
public new string LocalizationCategory => "Items.Armor.Hardmode";
public static int MinionSlotBoost = 1;
public static float SummonDamageBoost = 0.15f;
public static float SummonDamageBoost = 0.20f;
public static float MoveSpeedBoost = 0.15f;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent(), MoveSpeedBoost.ToPercent());
@@ -15,7 +15,7 @@ namespace CalamityMod.Items.Armor.Plaguebringer
public new string LocalizationCategory => "Items.Armor.Hardmode";
public static int MinionSlotBoost = 1;
public static float SummonDamageBoost = 0.15f;
public static float SummonDamageBoost = 0.20f;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent());
// Set Bonus
-7
View File
@@ -562,13 +562,6 @@ namespace CalamityMod.Items
#region Use Item Changes
public override void HoldItem(Item item, Player player)
{
// Clear Evil Smasher buffs if not holding Evil Smasher
if (player.Calamity().evilSmasherBoost > 0)
{
if (item.type != ItemType<EvilSmasher>())
player.Calamity().evilSmasherBoost = 0;
}
if (player.Calamity().ChaosStone && item.mana == 0 && !player.ItemTimeIsZero)
{
player.manaRegenDelay = player.maxRegenDelay;
+40 -16
View File
@@ -278,8 +278,9 @@ namespace CalamityMod.Items
tooltips.Insert(++difficultyTooltipIndex, donorLine);
}
var buffIdsInTooltip = new HashSet<int>();
// The int is the buff ID
// The byte determines what information to show; 0 = enemy, 1 = player, 2 = both
var buffIdsInTooltip = new Dictionary<int, byte>();
foreach (var tooltip in tooltips)
{
// Parse the tags of each line of text to find our buff tags'
@@ -287,9 +288,18 @@ namespace CalamityMod.Items
var snippets = ChatManager.ParseMessage(tooltip.Text, Color.White);
foreach (var snippet in snippets)
{
if (snippet is CalamityBuffTagHandler.Snippet buffSnippet)
if (snippet is BuffTagEnemyEffectHandler.Snippet enemy)
{
buffIdsInTooltip.Add(buffSnippet.BuffId);
if (!buffIdsInTooltip.ContainsKey(enemy.BuffId))
buffIdsInTooltip.Add(enemy.BuffId, 0);
}
else if (snippet is BuffTagPlayerEffectHandler.Snippet player)
{
if (!buffIdsInTooltip.TryAdd(player.BuffId, 1))
{
buffIdsInTooltip.Remove(player.BuffId);
buffIdsInTooltip.Add(player.BuffId, 2);
}
}
}
}
@@ -298,26 +308,36 @@ namespace CalamityMod.Items
{
bool showTheTip = false;
bool foundDebuff = false;
foreach (int buffId in buffIdsInTooltip)
foreach (var buffInfo in buffIdsInTooltip)
{
string tooltipKey = "";
if (buffId < BuffID.Count)
string secondTooltipKey = "";
// Change the localization based on whether it should display player or enemy info, or both
string locKey = buffInfo.Value == 1 ? "ItemTooltipPlayer" : "ItemTooltipEnemy";
string secondLocKey = buffInfo.Value == 2 ? "ItemTooltipPlayer" : "";
if (buffInfo.Key < BuffID.Count)
{
tooltipKey = $"Mods.Terraria.Buffs.{BuffID.Search.GetName(buffId)}.ItemTooltip";
tooltipKey = $"Mods.Terraria.Buffs.{BuffID.Search.GetName(buffInfo.Key)}.{locKey}";
if (buffInfo.Value == 2)
secondTooltipKey = $"Mods.Terraria.Buffs.{BuffID.Search.GetName(buffInfo.Key)}.{secondLocKey}";
}
else
{
var modBuff = BuffLoader.GetBuff(buffId);
tooltipKey = $"Mods.{modBuff.Mod.Name}.Buffs.{modBuff.Name}.ItemTooltip";
var modBuff = BuffLoader.GetBuff(buffInfo.Key);
tooltipKey = $"Mods.{modBuff.Mod.Name}.Buffs.{modBuff.Name}.{locKey}";
if (buffInfo.Value == 2)
secondTooltipKey = $"Mods.{modBuff.Mod.Name}.Buffs.{modBuff.Name}.{secondLocKey}";
}
if (!Language.Exists(tooltipKey))
{
continue;
}
var text = "";
var secondText = "";
if (Language.Exists(tooltipKey))
text = Language.GetTextValue(tooltipKey);
if (Language.Exists(secondTooltipKey))
secondText = Language.GetTextValue(secondTooltipKey);
var text = Language.GetTextValue(tooltipKey);
if (string.IsNullOrWhiteSpace(text))
if (string.IsNullOrWhiteSpace(text) && string.IsNullOrWhiteSpace(secondText))
{
continue;
}
@@ -329,7 +349,11 @@ namespace CalamityMod.Items
break;
}
tooltips.Insert(++lastTooltipIndex, new TooltipLine(Mod, "CalamityMod:AltExpandTooltip" + buffId, $"[cbuff:{buffId}]\n{text}"));
string extraLoc = GetTextValue(buffInfo.Value == 1 ? "Buffs.OnPlayer" : "Buffs.OnEnemy");
if (!string.IsNullOrWhiteSpace(text))
tooltips.Insert(++lastTooltipIndex, new TooltipLine(Mod, "CalamityMod:AltExpandTooltip" + buffInfo.Key, $"[cbuff:{buffInfo.Key}] {extraLoc}\n{text}"));
if (buffInfo.Value == 2 && !string.IsNullOrWhiteSpace(secondText))
tooltips.Insert(++lastTooltipIndex, new TooltipLine(Mod, "CalamityMod:AltExpandTooltip" + buffInfo.Key, $"[cbuff:{buffInfo.Key}] {GetTextValue("Buffs.OnPlayer")}\n{secondText}"));
}
if (showTheTip)
+1 -1
View File
@@ -211,7 +211,7 @@ namespace CalamityMod.Items
{ ItemID.RedRyder, Do(DamageExact(24)) },
{ 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.Sandgun, Do(UseExact(20)) },
{ ItemID.SapphireStaff, Do(DamageExact(25)) },
{ ItemID.ScourgeoftheCorruptor, Do(DamageExact(63)) },
{ ItemID.Seedler, Do(UseMeleeSpeed, DamageExact(45), ShootSpeedExact(16)) },
Binary file not shown.

Before

Width:  |  Height:  |  Size: 863 B

After

Width:  |  Height:  |  Size: 591 B

+1 -1
View File
@@ -32,7 +32,7 @@ namespace CalamityMod.Items.LabFinders
{
CreateRecipe().
AddIngredient<LabSeekingMechanism>().
AddIngredient(ItemID.IceBlock, 50).
AddRecipeGroup("AnyIceBlock", 50).
AddTile(TileID.Anvils).
Register();
}
+1 -1
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Astral
Item.ResearchUnlockCount = 100;
ItemTrader.ChlorophyteExtractinator.AddOption_OneWay(Type, 1, ItemID.SandBlock, 1);
ItemID.Sets.SandgunAmmoProjectileData[Type] = new(ModContent.ProjectileType<AstralSandBallGun>(), 0);
ItemID.Sets.SandgunAmmoProjectileData[Type] = new(ModContent.ProjectileType<AstralSandBallGun>(), 5);
}
public override void SetDefaults()
+1 -1
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Items.Potions.Alcohol
{
public new string LocalizationCategory => "Items.Potions";
public static float CritLoss = 75;
public static float CritLoss = 50;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritLoss);
public override void SetStaticDefaults()
+1 -1
View File
@@ -49,7 +49,7 @@ namespace CalamityMod.Items.SummonItems
public override void AddRecipes()
{
CreateRecipe().
AddIngredient(ItemID.SandBlock, 40).
AddRecipeGroup("Sand", 40).
AddIngredient(ItemID.AntlionMandible, 4).
AddIngredient<StormlionMandible>(2).
AddTile(TileID.DemonAltar).
+1 -3
View File
@@ -16,6 +16,7 @@ namespace CalamityMod.Items.Tools
Item.width = 60;
Item.height = 70;
Item.damage = 80;
Item.crit = 25;
Item.knockBack = 5f;
Item.useTime = 5;
Item.useAnimation = 20;
@@ -32,9 +33,6 @@ namespace CalamityMod.Items.Tools
Item.autoReuse = true;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25;
public override void MeleeEffects(Player player, Rectangle hitbox)
{
Dust d = CalamityUtils.MeleeDustHelper(player, Main.rand.NextBool() ? ModContent.DustType<AstralOrange>() : ModContent.DustType<AstralBlue>(), 0.48f, 50, 78, -0.1f, 0.1f);
+1 -3
View File
@@ -16,6 +16,7 @@ namespace CalamityMod.Items.Tools
Item.width = 50;
Item.height = 60;
Item.damage = 65;
Item.crit = 25;
Item.knockBack = 5f;
Item.useTime = 6;
Item.useAnimation = 10;
@@ -31,9 +32,6 @@ namespace CalamityMod.Items.Tools
Item.autoReuse = true;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25;
public override void AddRecipes()
{
CreateRecipe().
+1 -1
View File
@@ -50,7 +50,7 @@ namespace CalamityMod.Items.Tools.ClimateChange
public override void AddRecipes()
{
CreateRecipe().
AddIngredient(ItemID.SandBlock, 50).
AddRecipeGroup("Sand", 50).
AddRecipeGroup("AnyAdamantiteBar", 10).
AddIngredient(ItemID.AncientCloth, 5).
AddTile(TileID.MythrilAnvil).
+1 -3
View File
@@ -31,6 +31,7 @@ namespace CalamityMod.Items.Tools
Item.width = 70;
Item.height = 70;
Item.damage = 400;
Item.crit = 25;
Item.knockBack = 9f;
Item.useTime = 1;
Item.useAnimation = 10;
@@ -56,9 +57,6 @@ namespace CalamityMod.Items.Tools
return new Vector2(10, 10);
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25;
public override bool AltFunctionUse(Player player) => true;
public override void HoldItem(Player player)
+1 -3
View File
@@ -15,6 +15,7 @@ namespace CalamityMod.Items.Tools
Item.width = 80;
Item.height = 66;
Item.damage = 110;
Item.crit = 10;
Item.knockBack = 7f;
Item.useTime = 8;
Item.useAnimation = 12;
@@ -30,9 +31,6 @@ namespace CalamityMod.Items.Tools
Item.autoReuse = true;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10;
public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox)
{
hitbox = CalamityUtils.FixSwingHitbox(54, 54);
+1 -3
View File
@@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic
Item.height = 30;
Item.damage = 63;
Item.DamageType = DamageClass.Magic;
Item.crit = 12;
Item.mana = 20;
Item.useTime = 8;
Item.useAnimation = 20;
@@ -37,9 +38,6 @@ namespace CalamityMod.Items.Weapons.Magic
public override void HoldItem(Player player) => player.Calamity().mouseRotationListener = true;
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 12;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Projectile.NewProjectileDirect(source, position, velocity.RotatedByRandom(0.7f), ModContent.ProjectileType<CosmicTentacle>(), damage, knockback, player.whoAmI);
+1 -3
View File
@@ -22,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic
Item.height = 72;
Item.damage = 245;
Item.DamageType = DamageClass.Magic;
Item.crit = 15;
Item.mana = 26;
Item.useTime = 18;
Item.useAnimation = 18;
@@ -36,9 +37,6 @@ namespace CalamityMod.Items.Weapons.Magic
Item.shootSpeed = 15f;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 15;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Vector2 spawnPos = new Vector2(player.MountedCenter.X + Main.rand.Next(-200, 201), player.MountedCenter.Y - 600f);
+1 -3
View File
@@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic
Item.height = 30;
Item.damage = 32;
Item.DamageType = DamageClass.Magic;
Item.crit = 5;
Item.mana = 7;
Item.useTime = 7;
Item.useAnimation = 21;
@@ -31,9 +32,6 @@ namespace CalamityMod.Items.Weapons.Magic
Item.shootSpeed = 12f;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 5;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Vector2 spreadVelocity = velocity.RotatedByRandom(MathHelper.ToRadians(18f)) * Main.rand.NextFloat(0.8f, 1.2f);
+1 -1
View File
@@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Magic
{
Item.width = 80;
Item.height = 84;
Item.damage = 4300;
Item.damage = 4100;
Item.DamageType = DamageClass.Magic;
Item.mana = 50;
Item.useTime = Item.useAnimation = 50;
+1 -4
View File
@@ -22,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic
Item.height = 16;
Item.damage = 50;
Item.DamageType = DamageClass.Magic;
Item.crit = 25;
Item.mana = 15;
Item.useTime = 2;
Item.useAnimation = 30;
@@ -38,10 +39,6 @@ namespace CalamityMod.Items.Weapons.Magic
Item.shootSpeed = 28f;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
+1 -3
View File
@@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic
Item.width = 38;
Item.height = 54;
Item.damage = 60;
Item.crit = 20;
Item.mana = 17;
Item.noMelee = true;
Item.useAnimation = 22;
@@ -32,9 +33,6 @@ namespace CalamityMod.Items.Weapons.Magic
Item.DamageType = DamageClass.Magic;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
for (int i = 0; i < 6; i++)
+21 -4
View File
@@ -1,10 +1,10 @@
using CalamityMod.Items.Materials;
using System;
using System.Collections.Generic;
using System.IO;
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.IO;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
@@ -92,6 +92,23 @@ namespace CalamityMod.Items.Weapons.Magic
return soul;
}
public override bool CanRightClick()
{
if (!Main.keyState.PressingShift())
return false;
return true;
}
public override void RightClick(Player player)
{
if (storedSoulpower > 0)
{
storedSoulpower = 0;
}
}
public override bool ConsumeItem(Player player) => false;
public Color FindColorForSoul()
{
Color returnColor = new(0, 0, 0);
+1 -3
View File
@@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic
Item.height = 40;
Item.damage = 60;
Item.DamageType = DamageClass.Magic;
Item.crit = 25;
Item.mana = 15;
Item.rare = ItemRarityID.Cyan;
Item.useTime = 14;
@@ -34,9 +35,6 @@ namespace CalamityMod.Items.Weapons.Magic
Item.shootSpeed = ShootSpeed;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Vector2 mouse = player.ClampedMouseWorld();
+2 -4
View File
@@ -33,9 +33,10 @@ namespace CalamityMod.Items.Weapons.Magic
Item.width = 40;
Item.height = 42;
Item.damage = 515;
Item.knockBack = 4f;
Item.DamageType = DamageClass.Magic;
Item.crit = 20;
Item.mana = 6;
Item.knockBack = 4f;
Item.useStyle = ItemUseStyleID.Shoot;
Item.useTime = 2;
@@ -54,9 +55,6 @@ namespace CalamityMod.Items.Weapons.Magic
Item.Calamity().devItem = true;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20;
public override Vector2? HoldoutOffset() => Vector2.Zero;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
+1 -3
View File
@@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic
{
Item.width = Item.height = 70;
Item.damage = 120;
Item.crit = 30;
Item.knockBack = 5f;
Item.useTime = 3;
Item.reuseDelay = Item.useAnimation = 15;
@@ -37,9 +38,6 @@ namespace CalamityMod.Items.Weapons.Magic
Item.rare = ItemRarityID.Purple;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 30;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo projSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Vector2 playerPos = player.RotatedRelativePoint(player.MountedCenter, true);
+5 -6
View File
@@ -10,11 +10,11 @@ namespace CalamityMod.Items.Weapons.Magic
public class ValkyrieRay : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Magic";
// The base use time of the weapon is 28: 18 charge frames + 10 cooldown frames.
// The base use time of the weapon is 36: 24 charge frames + 12 cooldown frames.
// The rate at which it progresses through its charge and discharge cycle is dynamically sped up by reforges.
// This math is handled in its holdout projectile, ValkyrieRayStaff.
public const int ChargeFrames = 18;
public const int CooldownFrames = 10;
public const int ChargeFrames = 24;
public const int CooldownFrames = 12;
public const float GemDistance = 18f;
public static readonly Color LightColor = new Color(235, 40, 121);
@@ -27,9 +27,10 @@ namespace CalamityMod.Items.Weapons.Magic
{
Item.width = 54;
Item.height = 52;
Item.damage = 115;
Item.damage = 90;
Item.knockBack = 8.5f;
Item.DamageType = DamageClass.Magic;
Item.crit = 11;
Item.mana = 17;
Item.useTime = ChargeFrames + CooldownFrames;
Item.useAnimation = ChargeFrames + CooldownFrames;
@@ -45,8 +46,6 @@ namespace CalamityMod.Items.Weapons.Magic
Item.autoReuse = true;
}
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 11;
public override void AddRecipes()
{
CreateRecipe().
+1 -1
View File
@@ -76,7 +76,7 @@ namespace CalamityMod.Items.Weapons.Magic
public override void AddRecipes()
{
CreateRecipe().
AddIngredient(ItemID.IceBlock, 30).
AddRecipeGroup("AnyIceBlock", 30).
AddIngredient(ItemID.Feather, 3).
AddIngredient(ItemID.FallenStar, 5).
AddIngredient(ItemID.Cloud, 10).
+1 -3
View File
@@ -78,6 +78,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.width = Item.height = 136;
Item.damage = 1800;
Item.DamageType = DamageClass.MeleeNoSpeed;
Item.crit = 15;
Item.noMelee = true;
Item.noUseGraphic = true;
Item.useAnimation = 15;
@@ -93,9 +94,6 @@ namespace CalamityMod.Items.Weapons.Melee
Item.rare = RarityType<BurnishedAuric>();
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 15;
public override bool AltFunctionUse(Player player) => true;
public override void HoldItem(Player player)
+1 -3
View File
@@ -56,6 +56,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.height = 172;
Item.damage = 507;
Item.DamageType = DamageClass.MeleeNoSpeed;
Item.crit = 10;
Item.noUseGraphic = true;
Item.noMelee = true;
Item.useAnimation = 20;
@@ -71,9 +72,6 @@ namespace CalamityMod.Items.Weapons.Melee
Item.shootSpeed = 16f;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10;
public override bool AltFunctionUse(Player player) => true;
public override void HoldItem(Player player)
+1 -3
View File
@@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.height = 50;
Item.damage = 90;
Item.DamageType = TrueMeleeDamageClass.Instance;
Item.crit = 25;
Item.noMelee = true;
Item.useTurn = true;
Item.noUseGraphic = true;
@@ -35,9 +36,6 @@ namespace CalamityMod.Items.Weapons.Melee
Item.shootSpeed = 13f;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25;
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
public override void AddRecipes()
+1 -1
View File
@@ -327,7 +327,7 @@ namespace CalamityMod.Items.Weapons.Melee
AddIngredient(ItemType<AerialiteBar>(), 10).
AddIngredient(ItemID.HellstoneBar, 10).
AddIngredient(ItemID.DirtBlock, 50).
AddIngredient(ItemID.StoneBlock, 50).
AddRecipeGroup("AnyStoneBlock", 50).
AddTile(TileID.Anvils).
Register();
}
+1 -2
View File
@@ -18,6 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.height = 66;
Item.damage = 420;
Item.DamageType = DamageClass.MeleeNoSpeed;
Item.crit = 10;
Item.useAnimation = 25;
Item.useTime = 5;
Item.noMelee = true;
@@ -35,8 +36,6 @@ namespace CalamityMod.Items.Weapons.Melee
Item.shootSpeed = 24f;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10;
// You can't use the sword if you've thrown it, silly
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[ModContent.ProjectileType<DevilsSunriseCyclone>()] <= 0;
public override void HoldItem(Player player)
+183 -18
View File
@@ -1,38 +1,203 @@
using Terraria;
using System;
using CalamityMod.Projectiles.BaseProjectiles;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Utilities.Daybreak;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Melee
{
public class EvilSmasher : ModItem, ILocalizedModType
public class EvilSmasher : BaseSwordHoldoutItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public override int ProjectileType => ModContent.ProjectileType<EvilSmasherProjectile>();
public bool IsAnimating = false;
public int AnimationTime = 0;
public override void SetDefaults()
{
base.SetDefaults();
Item.width = 64;
Item.height = 66;
Item.damage = 120;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = Item.useTime = 38;
Item.useStyle = ItemUseStyleID.Swing;
Item.useTurn = true;
Item.damage = 200;
Item.DamageType = AverageDamageClass.Instance;
Item.useAnimation = Item.useTime = 120;
Item.channel = true;
Item.knockBack = 6f;
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.value = CalamityGlobalItem.RarityLightRedBuyPrice;
Item.rare = ItemRarityID.LightRed;
}
public override float UseSpeedMultiplier(Player player) => 1f + (player.Calamity().evilSmasherBoost * 0.1f);
public override void ModifyWeaponDamage(Player player, ref StatModifier damage) => damage *= 1f + player.Calamity().evilSmasherBoost * 0.1f;
public override void ModifyWeaponKnockback(Player player, ref StatModifier knockback) => knockback *= 1f + (player.Calamity().evilSmasherBoost * 0.1f);
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
public override void UpdateInventory(Player player)
{
if (target.life <= 0 && player.Calamity().evilSmasherBoost < 10)
player.Calamity().evilSmasherBoost += 1;
AnimationTime = 300;
base.UpdateInventory(player);
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
if (!IsAnimating)
{
if (AnimationTime < 300)
AnimationTime++;
return;
}
float completion = AnimationTime / 240f;
Item.noGrabDelay = 120;
Item.velocity = new Vector2(0, -1f);
int dotAmount = 0;
for (var i = 0; i < dotAmount; i++)
{
var ringDir = getRingOffset(i / (float)dotAmount * -MathHelper.TwoPi + MathHelper.TwoPi * completion * 3, ySquish: 3f);
Dust.NewDustPerfect(Item.Center + (ringDir * (completion - MathF.Pow(completion, 2)) * 256), i % 2 == 0 ? DustID.Crimson : DustID.Corruption, ringDir);
}
if (Main.rand.NextFloat() < completion)
Dust.NewDustPerfect(Item.Center, Main.rand.NextBool() ? DustID.CursedTorch : DustID.IchorTorch,Vector2.UnitX.RotatedByRandom(MathHelper.TwoPi) * 5);
if (completion >= 1)
{
for (var i = 0; i < 50; i++)
{
Dust.NewDustPerfect(Item.Center, Main.rand.NextBool() ? DustID.CursedTorch : DustID.IchorTorch, Vector2.UnitX.RotatedByRandom(MathHelper.TwoPi) * 5);
Dust.NewDustPerfect(Item.Center, Main.rand.NextBool() ? DustID.Crimson : DustID.Corruption, Vector2.UnitX.RotatedByRandom(MathHelper.TwoPi) * 5);
}
IsAnimating = false;
Item.velocity = new Vector2(0, -5);
}
AnimationTime++;
}
#region Textures
private static Asset<Texture2D> GlowTex = null;
private static Texture2D GetGlowTex()
{
if (GlowTex == null)
{
GlowTex = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle");
}
return GlowTex.Value;
}
private static Asset<Texture2D> GlowBeamTex = null;
private static Texture2D GetGlowBeamTex()
{
if (GlowBeamTex == null)
{
GlowBeamTex = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomLineFade");
}
return GlowBeamTex.Value;
}
private static Asset<Texture2D> GlowBeamCapTex = null;
private static Texture2D GetGlowBeamCapTex()
{
if (GlowBeamCapTex == null)
{
GlowBeamCapTex = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomLineCap");
}
return GlowBeamCapTex.Value;
}
#endregion
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
{
if (IsAnimating)
{
var color = Color.Lerp(Color.Purple, Color.Red, MathF.Sin(Main.GlobalTimeWrappedHourly * 6) * 0.5f + 0.5f);
using (Main.spriteBatch.Scope())
{
Main.spriteBatch.Begin(SpriteSortMode.Immediate,
BlendState.Additive,
SamplerState.PointClamp,
DepthStencilState.None,
Main.Rasterizer,
null,
Main.GameViewMatrix.TransformationMatrix
);
Main.spriteBatch.Draw(GetGlowTex(), Item.Center - Main.screenPosition, null, color, 0, GetGlowTex().Size() * 0.5f, 0.1f + 0.7f * (AnimationTime / 240f), SpriteEffects.None, 0);
int rep = 0;
for (float i = 0; i <= MathHelper.TwoPi; i += MathHelper.TwoPi * 0.166f)
{
Main.spriteBatch.Draw(GetGlowBeamTex(), Item.Center - Main.screenPosition, null, color, MathHelper.WrapAngle(Main.GlobalTimeWrappedHourly) + i, new(GetGlowBeamTex().Size().X * 0.5f, 0), 0f + 0.06f * (AnimationTime / 240f) * (rep == 0 ? 1 : 0.75f), SpriteEffects.None, 0);
rep = (rep + 1) % 2;
}
Main.spriteBatch.End();
}
var tex = TextureAssets.Item[ItemID.Pwnhammer].Value;
Main.spriteBatch.Draw(tex, Item.Center - Main.screenPosition, null, Color.Lerp(lightColor, Color.Black, AnimationTime / 240f), 0, tex.Size() * 0.5f, MathHelper.Lerp(1, 1.75f, AnimationTime / 240f), SpriteEffects.None, 0);
return false;
}
else if (AnimationTime < 300)
{
float completion = 1 - (AnimationTime - 240) / 60f;
var color = Color.Lerp(Color.Purple, Color.Red, MathF.Sin(Main.GlobalTimeWrappedHourly * 6) * 0.5f + 0.5f);
using (Main.spriteBatch.Scope())
{
Main.spriteBatch.Begin(SpriteSortMode.Immediate,
BlendState.Additive,
SamplerState.PointClamp,
DepthStencilState.None,
Main.Rasterizer,
null,
Main.GameViewMatrix.TransformationMatrix
);
Main.spriteBatch.Draw(GetGlowTex(), Item.Center - Main.screenPosition, null, color, 0, GetGlowTex().Size() * 0.5f, 0.1f + 0.7f * completion, SpriteEffects.None, 0);
int rep = 0;
for (float i = 0; i <= MathHelper.TwoPi; i += MathHelper.TwoPi * 0.166f)
{
Main.spriteBatch.Draw(GetGlowBeamTex(), Item.Center - Main.screenPosition, null, color, MathHelper.WrapAngle(Main.GlobalTimeWrappedHourly) + i, new(GetGlowBeamTex().Size().X * 0.5f, 0), 0f + 0.06f * completion * (rep == 0 ? 1 : 0.75f), SpriteEffects.None, 0);
rep = (rep + 1) % 2;
}
Main.spriteBatch.End();
}
}
return base.PreDrawInWorld(spriteBatch, lightColor, alphaColor, ref rotation, ref scale, whoAmI);
}
private Vector2 getRingOffset(float rad, float xSquish = 1, float ySquish = 1)
{
return new Vector2((1 / xSquish) * MathF.Cos(rad), (1 / ySquish) * MathF.Sin(rad));
}
}
public class EvilSmasherSacrifice : GlobalItem
{
public override bool AppliesToEntity(Item entity, bool lateInstantiation)
{
return entity.type == ItemID.Pwnhammer;
}
public override void Update(Item item, ref float gravity, ref float maxFallSpeed)
{
if (item.noGrabDelay > 0) return; //Only run once the item is fully settled
for (var i = 0; i < 5; i++) //Loop a couple times to check different vertical positions for the altar, improving accuracy.
{
var tileCheckPos = item.Center.ToTileCoordinates() + new Point(0, i);
if (Main.tile[tileCheckPos.X, tileCheckPos.Y].TileType == TileID.DemonAltar)
{
if (!(Main.netMode == NetmodeID.MultiplayerClient))
{
var newItem = Main.item[Item.NewItem(item.GetSource_FromThis(), item.Hitbox, ModContent.ItemType<EvilSmasher>())];
newItem.noGrabDelay = 120;
newItem.prefix = item.prefix;
(newItem.ModItem as EvilSmasher).IsAnimating = true;
}
item.stack -= 1;
if (item.stack <= 0)
item.active = false;
return;
}
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 575 B

+1 -1
View File
@@ -22,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.width = 88;
Item.height = 88;
Item.damage = 90;
Item.crit = 31;
Item.useAnimation = Item.useTime = 45;
Item.useStyle = ItemUseStyleID.Shoot;
@@ -39,7 +40,6 @@ namespace CalamityMod.Items.Weapons.Melee
Item.rare = ItemRarityID.Yellow;
}
public override bool MeleePrefix() => true;
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 31;
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[ModContent.ProjectileType<ExaltedOathbladeHoldout>()] <= 0 && !player.Calamity().mouseRight;
public override void HoldItem(Player player)
{
+1 -1
View File
@@ -21,6 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.width = 74;
Item.height = 74;
Item.damage = 58;
Item.crit = 21;
Item.useAnimation = Item.useTime = 50;
Item.useStyle = ItemUseStyleID.Shoot;
@@ -38,7 +39,6 @@ namespace CalamityMod.Items.Weapons.Melee
Item.rare = ItemRarityID.Pink;
}
public override bool MeleePrefix() => true;
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 21;
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[ModContent.ProjectileType<ForbiddenOathbladeHoldout>()] <= 0 && !player.Calamity().mouseRight;
public override void HoldItem(Player player)
{
+127 -3
View File
@@ -1,7 +1,10 @@
using CalamityMod.Cooldowns;
using CalamityMod.Items.Materials;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Melee;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
@@ -19,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.width = 74;
Item.height = 94;
Item.useStyle = ItemUseStyleID.Shoot;
Item.damage = 220;
Item.damage = 200;
Item.DamageType = TrueMeleeDamageClass.Instance;
Item.useAnimation = Item.useTime = 20;
Item.shootSpeed = 10f;
@@ -37,13 +40,13 @@ namespace CalamityMod.Items.Weapons.Melee
}
// You can only use the right-click if you have sufficient Elemental Mastery
public override bool AltFunctionUse(Player player) => player.Calamity().elementalMastery >= 100;
public override bool AltFunctionUse(Player player) => player.GetModPlayer<LightspeedPlayer>().elementalMastery >= MaxEnergy;
public override void HoldItem(Player player)
{
if (player.Calamity().cooldowns.TryGetValue(ElementalMastery.ID, out var cooldown))
{
cooldown.timeLeft = player.Calamity().elementalMastery;
cooldown.timeLeft = player.GetModPlayer<LightspeedPlayer>().elementalMastery;
}
else
{
@@ -62,4 +65,125 @@ namespace CalamityMod.Items.Weapons.Melee
Register();
}
}
public class LightspeedPlayer : ModPlayer
{
public int elementalMastery = 0;
public int elementalMasteryPrevious = 0;
public int elementalMasteryTimer = 0;
public bool elementalMasteryPaused = false;
public bool elementalMasteryMaxFXPlayed = false;
private int lucreciaParticleTimer = 0;
public override void PostUpdateMiscEffects()
{
if (Player.HeldItem.type == ModContent.ItemType<Lightspeed>() && elementalMastery > 0)
{
lucreciaParticleTimer--;
// If the timer is at or below zero, spawn a particle.
if (lucreciaParticleTimer <= 0)
{
// Reset the timer (spawn rate depends on energy)
lucreciaParticleTimer = (int)(20 - 15 * (elementalMastery / 60));
float radius = Main.rand.NextFloat(160f, 190f); // Distance from center
float spawnAngle = Main.rand.NextFloat(MathHelper.TwoPi); // Random angle along the whole radius
Vector2 spawnPosition = Player.Center + spawnAngle.ToRotationVector2() * radius;
// Scale opacity with energy
float opacity = elementalMastery / (float)Lightspeed.MaxEnergy;
Color color = Main.rand.NextBool() ? Color.Aqua : Color.OrangeRed;
color *= opacity * 0.5f;
if (elementalMastery >= 100)
{
color *= 2.4f; // Way brighter
}
Vector2 dummyVelocity = Vector2.Zero; // We dont want the argument where this is used to have influence on the actual path
float rotationSpeed = 0.04f;
var particle = new RoundedStarParticle(spawnPosition, dummyVelocity, color with { A = 0 }, Main.rand.NextFloat(0.05f, 0.065f), Main.rand.Next(30, 60), rotationSpeed, 1f, true, Player.Center, Player.whoAmI);
GeneralParticleHandler.SpawnParticle(particle);
}
}
if (Player.HeldItem.type == ModContent.ItemType<Lightspeed>())
{
if (elementalMastery == 0)
elementalMasteryPrevious = 0;
if (elementalMastery > 0)
{
if (elementalMastery > elementalMasteryPrevious)
{
elementalMasteryPaused = true;
elementalMasteryTimer = 0;
}
elementalMasteryTimer++;
// Pause for 180 ticks
if (elementalMasteryPaused)
{
if (elementalMasteryTimer >= 1 && elementalMastery == Lightspeed.MaxEnergy && !elementalMasteryMaxFXPlayed)
{
SoundStyle maxEnergyReached = new("CalamityMod/Sounds/Custom/AbilitySounds/DarklightEnergyCharged");
SoundEngine.PlaySound(maxEnergyReached with { Volume = 0.9f }, Player.Center);
for (int i = 0; i < 10; i++) // Circular ring of particles burst from player
{
float angle = MathHelper.TwoPi * (i / 10f);
Vector2 spawnDirection = angle.ToRotationVector2();
Vector2 velocity = spawnDirection * 14f;
CritSpark spark = new CritSpark(Player.Center + spawnDirection * 3f, velocity, Color.Lerp(Color.CornflowerBlue, Color.MediumPurple, Main.rand.NextFloat(1f)), Color.White * 0.33f, 1.2f, 12, 0.3f, 1.2f);
GeneralParticleHandler.SpawnParticle(spark);
}
elementalMasteryMaxFXPlayed = true;
}
// If the pause is Done, resume decrementing.
if (elementalMasteryTimer >= 180)
{
elementalMasteryTimer = 0;
elementalMastery--;
}
}
else // Decrementing
{
// Once every 30 ticks
if (elementalMasteryTimer >= 30)
{
elementalMastery--;
elementalMasteryTimer = 0;
}
}
if (elementalMastery != Lightspeed.MaxEnergy)
elementalMasteryMaxFXPlayed = false;
}
// Update for next loop.
elementalMasteryPrevious = elementalMastery;
}
else
{
// Reset all EM variables when not holding the weapon
elementalMasteryTimer = 0;
elementalMasteryPaused = false;
elementalMastery = 0;
}
}
public override void UpdateDead()
{
elementalMastery = 0;
elementalMasteryPrevious = 0;
}
}
}
+131 -3
View File
@@ -1,8 +1,11 @@
using CalamityMod.Cooldowns;
using CalamityMod.Items.Materials;
using CalamityMod.Particles;
using CalamityMod.Projectiles.BaseProjectiles;
using CalamityMod.Projectiles.Melee;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
@@ -21,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.width = 54;
Item.height = 54;
Item.useStyle = ItemUseStyleID.Shoot;
Item.damage = 150;
Item.damage = 132;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = Item.useTime = 34;
Item.shootSpeed = 10f;
@@ -37,13 +40,13 @@ namespace CalamityMod.Items.Weapons.Melee
}
public override bool AltFunctionUse(Player player) => player.Calamity().darklightEnergy >= MaxEnergy;
public override bool AltFunctionUse(Player player) => player.GetModPlayer<LucreciaPlayer>().darklightEnergy >= MaxEnergy;
public override void HoldItem(Player player)
{
if (player.Calamity().cooldowns.TryGetValue(DarklightEnergy.ID, out var cooldown))
{
cooldown.timeLeft = player.Calamity().darklightEnergy;
cooldown.timeLeft = player.GetModPlayer<LucreciaPlayer>().darklightEnergy;
}
else
{
@@ -64,4 +67,129 @@ namespace CalamityMod.Items.Weapons.Melee
Register();
}
}
public class LucreciaPlayer : ModPlayer
{
private int lucreciaParticleTimer = 0;
public int darklightEnergy = 0;
public int darklightEnergyPrevious = 0;
public int darklightEnergyTimer = 0;
public bool darklightEnergyPaused = false;
public bool darklightEnergyMaxFXPlayed = false;
public override void PostUpdateMiscEffects()
{
if (Player.HeldItem.type == ModContent.ItemType<Lucrecia>())
{
if (darklightEnergy == 0)
darklightEnergyPrevious = 0;
if (darklightEnergy > 0)
{
// If the player's energy has increased since last tick
if (darklightEnergy > darklightEnergyPrevious)
{
darklightEnergyPaused = true;
darklightEnergyTimer = 0;
}
darklightEnergyTimer++;
// Pause for 180 ticks
if (darklightEnergyPaused)
{
if (darklightEnergyTimer >= 1 && darklightEnergy == Lucrecia.MaxEnergy && !darklightEnergyMaxFXPlayed)
{
SoundStyle maxEnergyReached = new("CalamityMod/Sounds/Custom/AbilitySounds/DarklightEnergyCharged");
SoundEngine.PlaySound(maxEnergyReached with { Volume = 0.9f }, Player.Center);
for (int i = 0; i < 10; i++) // Circular ring of particles burst from player
{
float angle = MathHelper.TwoPi * (i / 10f);
Vector2 spawnDirection = angle.ToRotationVector2();
Vector2 velocity = spawnDirection * 14f;
CritSpark spark = new CritSpark(Player.Center + spawnDirection * 3f, velocity, Color.Lerp(Color.CornflowerBlue, Color.MediumPurple, Main.rand.NextFloat(1f)), Color.White * 0.33f, 1.2f, 12, 0.3f, 1.2f);
GeneralParticleHandler.SpawnParticle(spark);
}
darklightEnergyMaxFXPlayed = true;
}
// If the pause is Done, resume decrementing.
if (darklightEnergyTimer >= 180)
{
darklightEnergyPaused = false;
darklightEnergyTimer = 0;
darklightEnergy--;
}
}
else // Decrementing
{
darklightEnergyMaxFXPlayed = false;
// Once every 20 ticks
if (darklightEnergyTimer >= 20)
{
darklightEnergy--;
darklightEnergyTimer = 0;
}
}
}
if (darklightEnergy != Lucrecia.MaxEnergy)
darklightEnergyMaxFXPlayed = false;
// Update for next loop.
darklightEnergyPrevious = darklightEnergy;
}
else
{
// Reset all energy variables when not holding the weapon
darklightEnergyTimer = 0;
darklightEnergyPaused = false;
darklightEnergy = 0;
}
if (Player.HeldItem.type == ModContent.ItemType<Lucrecia>() && darklightEnergy > 0)
{
lucreciaParticleTimer--;
// If the timer is at or below zero, spawn a particle.
if (lucreciaParticleTimer <= 0)
{
// Reset the timer (spawn rate depends on energy)
lucreciaParticleTimer = (int)(20 - 15 * (darklightEnergy / 60));
float radius = Main.rand.NextFloat(160f, 190f); // Distance from center
float spawnAngle = Main.rand.NextFloat(MathHelper.TwoPi); // Random angle along the whole radius
Vector2 spawnPosition = Player.Center + spawnAngle.ToRotationVector2() * radius;
// Scale opacity with energy
float opacity = darklightEnergy / (float)Lucrecia.MaxEnergy;
Color color = Main.rand.NextBool() ? Color.MediumPurple : Color.CornflowerBlue;
color *= opacity * 0.5f;
if (darklightEnergy >= 100)
{
color *= 2.4f; // Way brighter
}
Vector2 dummyVelocity = Vector2.Zero; // We dont want the argument where this is used to have influence on the actual path
float rotationSpeed = 0.04f;
var particle = new RoundedStarParticle(spawnPosition, dummyVelocity, color with { A = 0 }, Main.rand.NextFloat(0.05f, 0.065f), Main.rand.Next(30, 60), rotationSpeed, 1f, true, Player.Center, Player.whoAmI);
GeneralParticleHandler.SpawnParticle(particle);
}
}
}
public override void UpdateDead()
{
darklightEnergy = 0;
darklightEnergyPrevious = 0;
}
}
}
+1 -3
View File
@@ -33,6 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.height = 134;
Item.damage = 2200;
Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance;
Item.crit = 61;
Item.noMelee = true;
Item.noUseGraphic = true;
Item.channel = true;
@@ -47,9 +48,6 @@ namespace CalamityMod.Items.Weapons.Melee
Item.rare = ModContent.RarityType<CosmicPurple>();
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 61;
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
Texture2D texture;
+1 -1
View File
@@ -19,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.height = 76;
Item.damage = 144;
Item.DamageType = TrueMeleeDamageClass.Instance;
Item.crit = 11;
Item.useAnimation = Item.useTime = 90; // Yes it's actually supposed to be this slow
Item.useStyle = ItemUseStyleID.Shoot;
@@ -38,6 +39,5 @@ namespace CalamityMod.Items.Weapons.Melee
Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Melee/OldLordClaymoreGlow").Value);
}
public override bool MeleePrefix() => true;
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 11;
}
}
+1 -3
View File
@@ -15,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.height = 146;
Item.damage = 100;
Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance;
Item.crit = 45;
Item.useAnimation = 12;
Item.useStyle = ItemUseStyleID.Swing;
Item.useTime = 12;
@@ -31,9 +32,6 @@ namespace CalamityMod.Items.Weapons.Melee
Item.rare = ItemRarityID.Yellow;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 45;
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
public override void AddRecipes()
@@ -18,6 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.width = Item.height = 40;
Item.damage = 2705;
Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance;
Item.crit = 10;
Item.noMelee = true;
Item.noUseGraphic = true;
Item.channel = true;
@@ -33,9 +34,6 @@ namespace CalamityMod.Items.Weapons.Melee
Item.rare = ModContent.RarityType<PureGreen>();
}
// Terraria seems to really dislike high crit values in SetDefaults.
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10;
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
+1 -2
View File
@@ -21,6 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.width = 134;
Item.height = 54;
Item.damage = 3725;
Item.crit = 18;
Item.knockBack = 12f;
Item.useTime = 5;
Item.useAnimation = 25;
@@ -43,8 +44,6 @@ namespace CalamityMod.Items.Weapons.Melee
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
}
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 18;
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
public override bool AltFunctionUse(Player player) => true;
public override void HoldItem(Player player)
+2 -5
View File
@@ -21,6 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.width = 100;
Item.height = 100;
Item.damage = 180;
Item.crit = 8;
Item.knockBack = 13f;
Item.DamageType = DamageClass.Melee;
Item.useStyle = ItemUseStyleID.Shoot;
@@ -39,10 +40,6 @@ namespace CalamityMod.Items.Weapons.Melee
Item.channel = true;
}
public override void ModifyWeaponCrit(Player player, ref float crit)
{
crit += 8f;
}
public override bool CanUseItem(Player player) => Main.hardMode && player.ownedProjectileCounts[Item.shoot] < 1;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
@@ -61,7 +58,7 @@ namespace CalamityMod.Items.Weapons.Melee
.AddIngredient(ItemID.SoulofNight, 10)
.AddIngredient<EssenceofHavoc>(5)
.AddIngredient(ItemID.Obsidian, 10)
.AddIngredient(ItemID.StoneBlock, 100)
.AddRecipeGroup("AnyStoneBlock", 100)
.AddIngredient(ItemID.Amethyst, 2)
.AddTile(TileID.Anvils)
.Register();
+1 -3
View File
@@ -13,6 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.width = 46;
Item.height = 58;
Item.damage = 69;
Item.crit = 100;
Item.knockBack = 80f; //This number doesn't mean anything, but it's not 9001f because that caused bugs.
Item.useAnimation = Item.useTime = 12;
Item.DamageType = DamageClass.Melee;
@@ -24,9 +25,6 @@ namespace CalamityMod.Items.Weapons.Melee
Item.value = CalamityGlobalItem.RarityLimeBuyPrice;
}
// Boosting crit in SetDefaults along with knockback seemed to severely inflate the reforging price. Guaranteed crits for more knockback.
public override void ModifyWeaponCrit(Player player, ref float crit) => crit = 100;
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 300);
+1 -3
View File
@@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.height = 40;
Item.damage = 1818;
Item.DamageType = DamageClass.Ranged;
Item.crit = 20;
Item.useTime = Item.useAnimation = 60;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
@@ -37,9 +38,6 @@ namespace CalamityMod.Items.Weapons.Ranged
public override void HoldItem(Player player) => player.scope = true;
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20;
public override void AddRecipes()
{
CreateRecipe().
+1 -3
View File
@@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.height = 24;
Item.damage = 120;
Item.DamageType = DamageClass.Ranged;
Item.crit = 25;
Item.useTime = 15;
Item.useAnimation = 15;
Item.useStyle = ItemUseStyleID.Shoot;
@@ -31,9 +32,6 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.useAmmo = AmmoID.Bullet;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25;
public override Vector2? HoldoutOffset() => new Vector2(-5, 0);
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
+1 -3
View File
@@ -22,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.width = 76;
Item.height = 42;
Item.damage = 56;
Item.crit = 21;
Item.useTime = 30;
Item.useAnimation = 30;
Item.useStyle = ItemUseStyleID.Shoot;
@@ -37,9 +38,6 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.shootSpeed = 20f;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 21;
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
+1 -3
View File
@@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.height = 38;
Item.damage = 75;
Item.DamageType = DamageClass.Ranged;
Item.crit = 20;
Item.useTime = 45;
Item.useAnimation = 45;
Item.useStyle = ItemUseStyleID.Shoot;
@@ -31,9 +32,6 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.useAmmo = AmmoID.Arrow;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (CalamityUtils.CheckWoodenAmmo(type, player))
+1 -3
View File
@@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.height = 22;
Item.damage = 60;
Item.DamageType = DamageClass.Ranged;
Item.crit = 25;
Item.useTime = 60;
Item.useAnimation = 60;
Item.useStyle = ItemUseStyleID.Shoot;
@@ -31,9 +32,6 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.useAmmo = AmmoID.Bullet;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25;
public override Vector2? HoldoutOffset() => new Vector2(-7, 0);
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
+1 -2
View File
@@ -34,6 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.damage = 444;
Item.knockBack = 5.5f;
Item.DamageType = DamageClass.Ranged;
Item.crit = 20;
// Burst of 5, one every 5 frames for 25 total. Cooldown of 39 frames.
Item.useTime = 5;
@@ -58,8 +59,6 @@ namespace CalamityMod.Items.Weapons.Ranged
ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20;
public override void HoldItem(Player player)
{
if (player.mount.Type == MountID.Drill)
+1 -3
View File
@@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.height = 46;
Item.DamageType = DamageClass.Ranged;
Item.damage = 740;
Item.crit = 15;
Item.knockBack = 16f;
Item.useTime = Item.useAnimation = 74;
Item.autoReuse = true;
@@ -37,9 +38,6 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.useAmmo = AmmoID.Rocket;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 15;
public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback)
{
position += velocity.SafeNormalize(Vector2.UnitX) * 48f;
+1 -2
View File
@@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.height = 22;
Item.damage = 75;
Item.DamageType = DamageClass.Ranged;
Item.crit = 10;
Item.useTime = 40;
Item.useAnimation = 40;
Item.useStyle = ItemUseStyleID.Shoot;
@@ -35,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.rare = ItemRarityID.Orange;
}
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10;
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
public override void HoldItem(Player player)
{
+1 -3
View File
@@ -15,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.height = 110;
Item.damage = 39;
Item.DamageType = DamageClass.Ranged;
Item.crit = 10;
Item.useTime = 5;
Item.useAnimation = 15;
Item.useLimitPerAnimation = 3;
@@ -33,9 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.Calamity().donorItem = true;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10;
public override Vector2? HoldoutOffset() => new Vector2(-4, 0);
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
+1 -3
View File
@@ -19,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.height = 22;
Item.damage = 210;
Item.DamageType = DamageClass.Ranged;
Item.crit = 10;
Item.useTime = 70;
Item.useAnimation = 70;
Item.useStyle = ItemUseStyleID.Shoot;
@@ -35,9 +36,6 @@ namespace CalamityMod.Items.Weapons.Ranged
public override Vector2? HoldoutOffset() => new Vector2(-10, 8);
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10;
public override void AddRecipes()
{
CreateRecipe().
Loaded 100 of 282 files, more files were not shown because too many files have changed in this diff. Show more