Merge branch '1.4.4' into three-little-pigs

This commit is contained in:
fryzahh committed 2026-06-04 18:01:15 -04:00
commit f5ee37f500
251 files changed
+3674 -1358

No files matched your search

+3
View File
@@ -76,6 +76,9 @@ namespace CalamityMod.Balancing
// 25% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.EaterOfWorlds, Do(ResistTrueMelee(0.75f))));
// 40% resist to Lemon 'nade
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.EaterOfWorlds, Do(new ProjectileResistBalancingRule(0.60f, ProjectileType<LemonNadeProjectile>()))));
#endregion
#region Brain of Cthulhu: Creepers
+2 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.DataStructures;
using CalamityMod.Systems.Collections;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -18,7 +19,7 @@ namespace CalamityMod.Buffs.Alcohol
Main.buffNoSave[Type] = false;
Main.persistentBuff[Type] = true;
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+4 -2
View File
@@ -140,14 +140,16 @@ namespace CalamityMod.Buffs
{
// Globally remove summon tag debuff stacking, unless allowed in the SummonTag
// Other mods need to add to this list because otherwise we can't tell which IsATag buff is actually for whips
if (CalamityBuffSets.SummonTagDebuff.TryGetValue(type, out var tag1) && !tag1.AllowsWhipStacking && buffIndex > 0)
var tag1 = CalamityBuffSets.SummonTagDebuff[type];
if (tag1 is not null && !tag1.AllowsWhipStacking && buffIndex > 0)
{
for (int i = buffIndex; i >= 0; i--)
{
if (npc.buffTime[i] > 0)
{
int buffID = npc.buffType[i];
if (CalamityBuffSets.SummonTagDebuff.TryGetValue(buffID, out var tag2) && !tag2.AllowsWhipStacking && buffID != type)
var tag2 = CalamityBuffSets.SummonTagDebuff[buffID];
if (tag2 is not null && !tag2.AllowsWhipStacking && buffID != type)
{
npc.DelBuff(i);
break;
@@ -5,6 +5,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -5,6 +5,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -7,6 +7,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -25,7 +26,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public static void BaneNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage)
{
+2 -1
View File
@@ -2,6 +2,7 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -24,7 +25,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -4,6 +4,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -20,7 +21,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -5,6 +5,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -5,6 +5,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -5,6 +5,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -4,6 +4,7 @@ using Terraria.DataStructures;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -17,7 +18,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = DebuffData.Daybroken;
CalamityBuffSets.DebuffDataset[Type] = DebuffData.Daybroken;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -7,6 +7,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -29,7 +30,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -5,6 +5,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -5,6 +5,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -20,7 +21,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -5,6 +5,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -5,6 +5,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -6,6 +6,7 @@ using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -5,6 +5,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -2,6 +2,7 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -19,7 +20,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -6,6 +6,7 @@ using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -13,6 +13,7 @@ using Terraria.DataStructures;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -55,7 +56,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -5,6 +5,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -5,6 +5,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -4,6 +4,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -20,7 +21,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Summon;
using CalamityMod.Systems.Collections;
using Terraria;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -58,7 +59,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(NPC npc, ref int buffIndex)
{
+2 -1
View File
@@ -2,6 +2,7 @@
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -33,7 +34,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -5,6 +5,7 @@ using Terraria.DataStructures;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -18,7 +19,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = DebuffData.Shadowflame;
CalamityBuffSets.DebuffDataset[Type] = DebuffData.Shadowflame;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -5,6 +5,7 @@ using CalamityMod.Projectiles.Summon;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -51,7 +52,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
BuffID.Sets.IsATagBuff[Type] = true;
}
+2 -1
View File
@@ -2,6 +2,7 @@
using CalamityMod.Projectiles.Rogue;
using Terraria;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -34,7 +35,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(NPC npc, ref int buffIndex)
+2 -1
View File
@@ -4,6 +4,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -20,7 +21,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -5,6 +5,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
// Acid Venom immunity is granted automatically if you are immune to Sulphuric Poisoning.
BuffID.Sets.GrantImmunityWith[BuffID.Venom].Add(Type);
+2 -1
View File
@@ -8,6 +8,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -28,7 +29,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.buffNoSave[Type] = true;
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex) => player.Calamity().trueVHex = true;
+2 -1
View File
@@ -6,6 +6,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -23,7 +24,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -5,6 +5,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -5,6 +5,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -8,6 +8,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -31,7 +32,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.buffNoSave[Type] = true;
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex) => player.Calamity().vHex = true;
+2 -1
View File
@@ -1,6 +1,7 @@
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.DamageOverTime
{
@@ -17,7 +18,7 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
Main.buffNoTimeDisplay[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex) => player.Calamity().weakBrimstoneFlames = true;
+4 -9
View File
@@ -1,14 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CalamityMod.DataStructures;
using CalamityMod.Dusts;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Magic;
using CalamityMod.Projectiles.Typeless;
using CalamityMod.Systems.Collections;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
@@ -31,12 +26,12 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public static void WindChilledNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage)
{
var cnpc = npc.Calamity();
int baseDoTValue = (int)(cnpc.windChilledMult * npc.Calamity().ActiveColdDebuffMultiplier.ApplyTo(debuffData.EnemyLostRegen));
cnpc.ApplyDPSDebuff(baseDoTValue, Math.Max((int)(baseDoTValue * debuffData.MultiplierDamageTickSize), debuffData.MinimumDamageTickSize) / 2, ref npc.lifeRegen, ref damage);
}
@@ -94,7 +89,7 @@ namespace CalamityMod.Buffs.DamageOverTime
bool start = !Main.rand.NextBool(4);
Vector2 particleVel = Vector2.UnitY * Main.rand.NextFloat(-1.25f, 1.25f) * Math.Max(hightMult, widthMult) * (Main.rand.NextBool(5) ? 1.5f : 1) + npc.velocity * 0.85f;
Vector2 particlePos = npc.Center + Main.rand.NextVector2Circular(3 * widthMult + 8, 3 * widthMult + 8) * Math.Max(hightMult, widthMult);
Particle mist = new CustomPulsingSpark(particlePos, particleVel, "CalamityMod/Particles/ThinSparkle", "CalamityMod/Particles/BloomCircle", false, 65, Main.rand.NextFloat(0.95f, 1.35f) * MathF.Pow(widthMult, 0.45f), start ? color : color2, start ? color2 : color,
Particle mist = new CustomPulsingSpark(particlePos, particleVel, "CalamityMod/Particles/ThinSparkle", "CalamityMod/Particles/BloomCircle", false, 65, Main.rand.NextFloat(0.95f, 1.35f) * MathF.Pow(widthMult, 0.45f), start ? color : color2, start ? color2 : color,
new Vector2(0.6f, 1.2f), true, true, Main.rand.Next(4, 7 + 1), colorFadeSpeed: 0.85f, noShrink: true, extraRotation: -particleVel.ToRotation(), shrinkSpeed: 0.1f, sineRate: Main.rand.NextFloat(0.25f, 0.55f), sineIntensity: (int)(Main.rand.Next(12, 19 + 1) * Math.Max(hightMult, widthMult)));
GeneralParticleHandler.SpawnParticle(mist, true, Main.rand.NextBool() ? Enums.GeneralDrawLayer.AfterNPCs : Enums.GeneralDrawLayer.BeforeNPCs);
}
+27
View File
@@ -0,0 +1,27 @@
using CalamityMod.Projectiles.Pets;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Pets
{
public class BeldumBuff : ModBuff
{
public override void SetStaticDefaults()
{
Main.buffNoTimeDisplay[Type] = true;
Main.vanityPet[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
player.buffTime[buffIndex] = 18000;
player.Calamity().beldum = true;
bool PetProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType<Beldum>()] <= 0;
if (PetProjectileNotSpawned && player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectile(player.GetSource_Buff(buffIndex), player.Center, Vector2.Zero, ModContent.ProjectileType<Beldum>(), 0, 0f, player.whoAmI, 0f, 0f);
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

+2 -1
View File
@@ -4,6 +4,7 @@ using CalamityMod.Items.Accessories;
using Terraria;
using Terraria.Localization;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.StatBuffs
{
@@ -47,7 +48,7 @@ namespace CalamityMod.Buffs.StatBuffs
Main.debuff[Type] = false;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -4,6 +4,7 @@ using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.StatDebuffs
{
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.StatDebuffs
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(NPC npc, ref int buffIndex)
+2 -1
View File
@@ -4,6 +4,7 @@ using CalamityMod.Systems.Collections;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.StatDebuffs
{
@@ -15,7 +16,7 @@ namespace CalamityMod.Buffs.StatDebuffs
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
// Purely to make it get electric color in tooltips
public static DebuffData debuffData = new DebuffData()
+2 -1
View File
@@ -4,6 +4,7 @@ using CalamityMod.Projectiles.Magic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.StatDebuffs
{
@@ -53,7 +54,7 @@ namespace CalamityMod.Buffs.StatDebuffs
Main.buffNoSave[Type] = true;
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
+2 -1
View File
@@ -2,6 +2,7 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Buffs.StatDebuffs
{
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.StatDebuffs
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
CalamityBuffSets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

+8 -1
View File
@@ -36,6 +36,7 @@ using CalamityMod.Items.Armor.TitanHeart;
using CalamityMod.Items.Armor.Victide;
using CalamityMod.Items.Armor.Wulfrum;
using CalamityMod.Items.Dyes;
using CalamityMod.Items.Fishing;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Mounts;
using CalamityMod.Items.Mounts.Minecarts;
@@ -433,6 +434,7 @@ namespace CalamityMod.CalPlayer
public int murasamaHitCooldown = 0;
public int giantShellPostHit = 0;
public int tortShellPostHit = 0;
public int sharkGunDamageScaling = 0;
public int MiniSwarmerCooldown = 0;
public float SulphWaterPoisoningLevel;
public float holyInfernoFadeIntensity;
@@ -599,6 +601,7 @@ namespace CalamityMod.CalPlayer
public bool lordePet = false;
public bool frostyBat = false;
public bool toastyBat = false;
public bool beldum = false;
public bool starSwallowerPetFroge = false;
#endregion
@@ -2313,6 +2316,7 @@ namespace CalamityMod.CalPlayer
lordePet = false;
frostyBat = false;
toastyBat = false;
beldum = false;
starSwallowerPetFroge = false;
onyxExcavator = false;
@@ -5104,7 +5108,7 @@ namespace CalamityMod.CalPlayer
for (int l = 0; l < Player.MaxBuffs; ++l)
{
int buffID = Player.buffType[l];
if ((BuffDatasets.DebuffDataset[buffID] != null && BuffDatasets.DebuffDataset[buffID].AlcoholLevel > 0) || buffID == BuffID.Tipsy)
if ((CalamityBuffSets.DebuffDataset[buffID] != null && CalamityBuffSets.DebuffDataset[buffID].AlcoholLevel > 0) || buffID == BuffID.Tipsy)
{
Player.buffTime[l]++;
}
@@ -6400,6 +6404,9 @@ namespace CalamityMod.CalPlayer
if (it.type == ItemType<ElephantKiller>())
playerUsingWeapon = false;
if (it.type == ItemType<Spadefish>())
playerUsingWeapon = false;
// Animation check depends on whether the item is "clockwork", like Clockwork Assault Rifle.
// "Clockwork" weapons can chain-fire multiple stealth strikes (really only 2 max) until you run out of stealth.
bool animationCheck = it.useAnimation == it.useTime
+1 -1
View File
@@ -330,7 +330,7 @@ namespace CalamityMod.CalPlayer
// Lower chance of Spadefish in Hardmode
if (underground) // Underground
{
int chance = Main.hardMode ? 10 : 2;
int chance = Main.hardMode ? 10 : 4;
if (attempt.veryrare && Main.rand.NextBool(chance))
{
itemDrop = ModContent.ItemType<Spadefish>();
+1 -1
View File
@@ -502,7 +502,7 @@ namespace CalamityMod.CalPlayer
for (int index = 0; index < target.buffType.Length; index++)
{
int type = target.buffType[index];
var debuffData = BuffDatasets.DebuffDataset[type];
var debuffData = CalamityBuffSets.DebuffDataset[type];
if (debuffData != null)
numOfDebuffs++;
}
+5 -5
View File
@@ -198,18 +198,18 @@ namespace CalamityMod.CalPlayer
int buff = Player.buffType[l];
if (buff <= 0) continue;
var data = BuffDatasets.DebuffDataset[buff];
var data = CalamityBuffSets.DebuffDataset[buff];
if (data?.AlcoholLevel > 0)
alcoholPoisonLevel += data.AlcoholLevel;
}
if (dripPlayer.ivDripEquipped && dripPlayer.currentAlcohol != AlcoholType.None)
{
int ivBuffID = BuffDatasets.GetBuffIDFromAlcoholType(dripPlayer.currentAlcohol);
int ivBuffID = CalamityBuffSets.GetBuffIDFromAlcoholType(dripPlayer.currentAlcohol);
if (ivBuffID != -1)
{
var ivData = BuffDatasets.DebuffDataset[ivBuffID];
var ivData = CalamityBuffSets.DebuffDataset[ivBuffID];
if (ivData?.AlcoholLevel > 0)
alcoholPoisonLevel += ivData.AlcoholLevel;
}
@@ -338,7 +338,7 @@ namespace CalamityMod.CalPlayer
}
// Permafrost's Concoction increases life regen while afflicted with a fire debuff
if (permafrostsConcoction && Player.buffType.Any(l => BuffDatasets.DebuffDataset[l] is not null && BuffDatasets.DebuffDataset[l].HeatDebuffScaling > 0))
if (permafrostsConcoction && Player.buffType.Any(l => CalamityBuffSets.DebuffDataset[l] is not null && CalamityBuffSets.DebuffDataset[l].HeatDebuffScaling > 0))
Player.lifeRegen += 6;
if (grandDadHealTimer == 0 && grandDadHealPool >= 7)
@@ -588,7 +588,7 @@ namespace CalamityMod.CalPlayer
if (community)
{
int regenBoost = 1 + (int)(TheCommunity.CalculatePower() * TheCommunity.RegenMultiplier);
bool lesserEffect = Player.buffType.Any(i => BuffDatasets.DebuffDataset[i] is not null && BuffDatasets.DebuffDataset[i].AlcoholLevel > 0);
bool lesserEffect = Player.buffType.Any(i => CalamityBuffSets.DebuffDataset[i] is not null && CalamityBuffSets.DebuffDataset[i].AlcoholLevel > 0);
if (Player.lifeRegen < 0)
Player.lifeRegen += lesserEffect ? 1 : regenBoost;
}
+9 -6
View File
@@ -978,12 +978,15 @@ namespace CalamityMod.CalPlayer
if (Player.sitting.TryGetSittingBlock(Player, out Tile AuricToiletTile) && !rejectionImmunity)
{
Player.Hurt(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AuricRejection").ToNetworkText(Player.name)), auricRejectionDamage, 0);
Player.AddBuff(ModContent.BuffType<AuricRebuke>(), 120);
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/ExoMechs/TeslaShoot1"), Player.Center);
Player.sitting.SitUp(Player, false);
Vector2 yeetVec = new Vector2(Player.direction, -1.5f);
Player.velocity += yeetVec * auricRejectionKB;
if (AuricToiletTile.TileType == ModContent.TileType<AuricToiletTile>())
{
Player.Hurt(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AuricRejection").ToNetworkText(Player.name)), auricRejectionDamage, 0);
Player.AddBuff(ModContent.BuffType<AuricRebuke>(), 120);
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/ExoMechs/TeslaShoot1"), Player.Center);
Player.sitting.SitUp(Player, false);
Vector2 yeetVec = new Vector2(Player.direction, -1.5f);
Player.velocity += yeetVec * auricRejectionKB;
}
}
}
private void HandleBlazingMouseEffects()
+9
View File
@@ -461,6 +461,15 @@ namespace CalamityMod.CalPlayer
GungeonMusicSystem.GUN();
}
// Used by Megalodon, Seadragon & Voidragon, allows bullets to track their damage scaling
if (cgp.sharkBullets)
{
if (proj.numHits == 0)
{
sharkGunDamageScaling++;
}
}
if (cgp.fireBullet)
{
target.AddBuff(BuffID.OnFire3, 60);
-82
View File
@@ -9,88 +9,6 @@ using Terraria.ModLoader;
namespace CalamityMod.DataStructures
{
[ReinitializeDuringResizeArrays]
public static class BuffDatasets
{
private static DebuffData Alch(int level) => new DebuffData() { AlcoholLevel = level };
public static DebuffData[] DebuffDataset = BuffID.Sets.Factory.CreateNamedSet("DebuffData")
.Description("Stores DebuffData for a particular debuff")
.RegisterCustomSet<DebuffData>(null,
BuffID.OnFire, DebuffData.OnFire,
BuffID.OnFire3, DebuffData.Hellfire,
BuffID.CursedInferno, DebuffData.CursedInferno,
BuffID.ShadowFlame, DebuffData.Shadowflame,
BuffID.Daybreak, DebuffData.Daybroken,
BuffID.Burning, DebuffData.Burning,
BuffID.Frostburn, DebuffData.Frostburn,
BuffID.Frostburn2, DebuffData.Frostbite,
BuffID.Poisoned, DebuffData.Poisoned,
BuffID.Venom, DebuffData.AcidVenom,
BuffID.Electrified, DebuffData.Electrified,
BuffID.Oiled, DebuffData.Oiled,
BuffID.Tipsy, Alch(1),
ModContent.BuffType<BloodyMaryBuff>(), Alch(1),
ModContent.BuffType<CaribbeanRumBuff>(), Alch(1),
ModContent.BuffType<CinnamonRollBuff>(), Alch(1),
ModContent.BuffType<EvergreenGinBuff>(), Alch(1),
ModContent.BuffType<FireballBuff>(), Alch(1),
ModContent.BuffType<GrapeBeerBuff>(), Alch(1),
ModContent.BuffType<ManhattanBuff>(), Alch(1),
ModContent.BuffType<MargaritaBuff>(), Alch(1),
ModContent.BuffType<MoonshineBuff>(), Alch(1),
ModContent.BuffType<MoscowMuleBuff>(), Alch(1),
ModContent.BuffType<OldFashionedBuff>(), Alch(1),
ModContent.BuffType<PurpleHazeBuff>(), Alch(1),
ModContent.BuffType<RedWineBuff>(), Alch(1),
ModContent.BuffType<RumBuff>(), Alch(1),
ModContent.BuffType<ScrewdriverBuff>(), Alch(1),
ModContent.BuffType<StarBeamRyeBuff>(), Alch(1),
ModContent.BuffType<TequilaBuff>(), Alch(1),
ModContent.BuffType<TequilaSunriseBuff>(), Alch(1),
ModContent.BuffType<VodkaBuff>(), Alch(1),
ModContent.BuffType<WhiskeyBuff>(), Alch(1),
ModContent.BuffType<WhiteWineBuff>(), Alch(1),
ModContent.BuffType<EverclearBuff>(), Alch(2),
ModContent.BuffType<BaconOilBuff>(), Alch(3)
);
public static int GetBuffIDFromAlcoholType(AlcoholType type)
{
return type switch
{
AlcoholType.BaconOil => ModContent.BuffType<BaconOilBuff>(),
AlcoholType.BloodyMary => ModContent.BuffType<BloodyMaryBuff>(),
AlcoholType.CaribbeanRum => ModContent.BuffType<CaribbeanRumBuff>(),
AlcoholType.CinnamonRoll => ModContent.BuffType<CinnamonRollBuff>(),
AlcoholType.Everclear => ModContent.BuffType<EverclearBuff>(),
AlcoholType.EvergreenGin => ModContent.BuffType<EvergreenGinBuff>(),
AlcoholType.Fireball => ModContent.BuffType<FireballBuff>(),
AlcoholType.GrapeBeer => ModContent.BuffType<GrapeBeerBuff>(),
AlcoholType.Manhattan => ModContent.BuffType<ManhattanBuff>(),
AlcoholType.Margarita => ModContent.BuffType<MargaritaBuff>(),
AlcoholType.Moonshine => ModContent.BuffType<MoonshineBuff>(),
AlcoholType.MoscowMule => ModContent.BuffType<MoscowMuleBuff>(),
AlcoholType.OldFashioned => ModContent.BuffType<OldFashionedBuff>(),
AlcoholType.PurpleHaze => ModContent.BuffType<PurpleHazeBuff>(),
AlcoholType.RedWine => ModContent.BuffType<RedWineBuff>(),
AlcoholType.Rum => ModContent.BuffType<RumBuff>(),
AlcoholType.Screwdriver => ModContent.BuffType<ScrewdriverBuff>(),
AlcoholType.StarBeamRye => ModContent.BuffType<StarBeamRyeBuff>(),
AlcoholType.Tequila => ModContent.BuffType<TequilaBuff>(),
AlcoholType.TequilaSunrise => ModContent.BuffType<TequilaSunriseBuff>(),
AlcoholType.Vodka => ModContent.BuffType<VodkaBuff>(),
AlcoholType.Whiskey => ModContent.BuffType<WhiskeyBuff>(),
AlcoholType.WhiteWine => ModContent.BuffType<WhiteWineBuff>(),
// Vanilla treats both Ale and Sake as the "Tipsy" buff
AlcoholType.Ale => BuffID.Tipsy,
AlcoholType.Sake => BuffID.Tipsy,
_ => -1
};
}
}
public class DebuffData
{
/// <summary>
+79
View File
@@ -0,0 +1,79 @@
sampler noiseTexture : register(s1);
sampler noiseTexture2 : register(s2);
float time;
float glowPower;
float overallColorStrength;
float2 noiseScale;
float2 edgeFadeoutThreshold;
float3 innerColor;
float3 outerColor;
float3 overallColor;
float3 tipColor;
matrix uWorldViewProjection;
struct VertexShaderInput
{
float4 Position : POSITION0;
float4 Color : COLOR0;
float3 TextureCoordinates : TEXCOORD0;
};
struct VertexShaderOutput
{
float4 Position : SV_POSITION;
float4 Color : COLOR0;
float3 TextureCoordinates : TEXCOORD0;
};
VertexShaderOutput VertexShaderFunction(in VertexShaderInput input)
{
VertexShaderOutput output = (VertexShaderOutput) 0;
float4 pos = mul(input.Position, uWorldViewProjection);
output.Position = pos;
output.Color = input.Color;
output.TextureCoordinates = input.TextureCoordinates;
return output;
}
float InverseLerp(float from, float to, float x)
{
return saturate((x - from) / (to - from));
}
float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
{
float4 color = input.Color;
float2 coords = input.TextureCoordinates;
// Account for texture distortion artifacts.
coords.y = (coords.y - 0.5) / input.TextureCoordinates.z + 0.5;
// Fade out at the horizontal and vertical ends of the streak.
float horizonatalDistanceFromCenter = distance(0.5, coords.y);
float opacity = smoothstep(0.5, 0.5 - edgeFadeoutThreshold, horizonatalDistanceFromCenter);
// Calculate the main nosie color and distortion.
float4 noiseDistortion = tex2D(noiseTexture, coords * float2(4, 2) + float2(time * -0.72, time * 0.51));
float4 noiseColor = tex2D(noiseTexture, coords * noiseScale + float2(time * -2.42 - noiseDistortion.r * 0.8, time * -1.33 + noiseDistortion.r * 0.8));
// Calculate how much a pixel should glow from the center outwards.
float glow = pow(0.1 / horizonatalDistanceFromCenter, glowPower);
// Render as white near the tip of the flame jet, then ease into the inner and outer colors of the jet.
float3 flameBodyColor = lerp(tipColor, lerp(outerColor, innerColor, opacity), InverseLerp(0, 0.092, coords.x));
float3 finalFlameColor = lerp(flameBodyColor, overallColor, overallColorStrength);
float4 returnColor = (color * float4(finalFlameColor, 1) + noiseColor * glow) * opacity;
return returnColor;
}
technique Technique1
{
pass LaserPass
{
VertexShader = compile vs_3_0 VertexShaderFunction();
PixelShader = compile ps_3_0 PixelShaderFunction();
}
}
Binary file not shown.
+6
View File
@@ -255,6 +255,9 @@ namespace CalamityMod.Effects
// The distorted circular effect seen emanating from the distortion rift during DoG's fight.
internal static Asset<Effect> DoGRiftAuraShader;
// The shader effect used for Voidragon's Abyssal Fire laser projectile.
internal static Asset<Effect> AbyssalFireShader;
// A simple chromatic abberation effect shader with support for custom abberation colors.
internal static Asset<Effect> ChromaticAbberationShader;
@@ -523,6 +526,9 @@ namespace CalamityMod.Effects
DoGRiftAuraShader = LoadShader("DoGRiftAuraShader");
RegisterMiscShader(DoGRiftAuraShader, "DoGRiftAuraPass", "DoGRiftAura");
AbyssalFireShader = LoadShader("AbyssalFireShader");
RegisterMiscShader(AbyssalFireShader, "LaserPass", "AbyssalFire");
ChromaticAbberationShader = LoadShader("ChromaticAbberationShader");
RegisterMiscShader(ChromaticAbberationShader, "ChormaAbberationPass", "ChromaticAbberation");
+9 -2
View File
@@ -186,7 +186,13 @@ namespace CalamityMod.Events
new Boss(NPCID.QueenBee, permittedNPCs: new int[] { NPCID.Bee, NPCID.BeeSmall, NPCID.LittleHornetHoney, NPCID.HornetHoney, NPCID.BigHornetHoney }),
new Boss(NPCID.Deerclops),
new Boss(NPCID.Deerclops, spawnContext: type =>
{
Player plr = Main.player[ClosestPlayerToWorldCenter];
int deer = NPC.NewNPC(Source, (int)plr.Center.X, (int)(plr.Center.Y - 400f), type, 1);
Main.npc[deer].timeLeft *= 20;
CalamityUtils.BossAwakenMessage(deer);
} ),
new Boss(NPCID.SkeletronHead, TimeChangeContext.Night, type =>
{
@@ -700,7 +706,8 @@ namespace CalamityMod.Events
// Killing any split Deus head ends the fight instantly. You don't need to kill both.
else if (npc.type == ModContent.NPCType<AstrumDeusHead>() && npc.Calamity().newAI[0] != 0f)
{
BossRushStage++;
if (BossRushStage <= Bosses.FindIndex(boss => boss.EntityID == ModContent.NPCType<AstrumDeusHead>()))
BossRushStage++;
CalamityUtils.KillAllHostileProjectiles();
HostileProjectileKillCounter = 3;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

+34
View File
@@ -850,5 +850,39 @@ namespace CalamityMod.ILEditing
});
}
#endregion
#region Remove Vanilla Whip Tag Crits
// Code written by Habble
/// <summary>
/// IL edits both vanilla whip crit tags' crit bool set calls to ensure they're never assigned a new value
/// </summary>
/// <param name="context"></param>
private static void PreventVanillaWhipTagCrits(ILContext context)
{
ILCursor cursor = new(context);
#region Morning Star
// Go to the unique instructions nearest to the Morning Star tag's crit roll and then stand before the crit bool set call
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdloc(59)) || !cursor.TryGotoNext(MoveType.Before, i => i.MatchStloc(30)))
{
LogFailure("Removing vanilla whip tag crits", "Could not locate the crit bool set call under Morning Star tag");
return;
}
// Put the previous value of the crit bool on the stack to then return that instead of the supplied value by "consuming" them as parameters, so as to not overwrite it
// This is more ideal than modifying label conditions because it is likelier for the latter to change over time
cursor.Emit(OpCodes.Ldloc, 30);
cursor.EmitDelegate((int input, bool originalValue) => originalValue.ToInt());
#endregion Morning Star
#region Kaleidoscope
// Similar deal for Kaleidoscope as well
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchStloc(30)) || !cursor.TryGotoNext(MoveType.Before, i => i.MatchStloc(30)))
{
LogFailure("Removing vanilla whip tag crits", "Could not locate the crit bool set call under Kaleidoscope tag");
return;
}
cursor.Emit(OpCodes.Ldloc, 30);
cursor.EmitDelegate((int input, bool originalValue) => originalValue.ToInt());
#endregion Kaleidoscope
}
#endregion
}
}
+1
View File
@@ -104,6 +104,7 @@ namespace CalamityMod.ILEditing
// Damage and health balance
On_Main.DamageVar_float_int_float += AdjustDamageVariance;
IL_NPC.ScaleStats_ApplyExpertTweaks += RemoveExpertHardmodeScaling;
IL_Projectile.Damage += PreventVanillaWhipTagCrits;
IL_Projectile.Damage += VanillaBossResistChanges;
IL_Projectile.AI_026 += PygmyAggroOnClosestPointInHitbox;
IL_Projectile.AI_099_2 += LimitTerrarianProjectiles;
+6 -2
View File
@@ -36,7 +36,11 @@ namespace CalamityMod.Items.Accessories
public const int maxMinionRequirement = 10;
public const int maxPscAnimTime = 120;
public static SummonTag SummonTag = new() { MultiplicativeTagDamage = 0.2f, TagModifyHitEffects = ApplyTagModifyHit, AutoDrawTooltip = false };
public static SummonTag SummonTag = new() {
MultiplicativeTagDamage = 0.2f,
TagModifyHitEffects = ApplyTagModifyHit,
AutoDrawTooltip = false
};
public static void ApplyTagModifyHit(Projectile proj, NPC npc, ref NPC.HitModifiers modifiers, ref float tagDamageMult, ref float critChance)
{
@@ -221,7 +225,7 @@ namespace CalamityMod.Items.Accessories
public override void SetDefaults()
{
SummonTag.TagItem = Item.type;
SummonTag.TagItem = Type;
SummonTag.TagTexture = TextureAssets.Item[Type];
Item.width = 50;
Item.height = 50;
+1 -1
View File
@@ -9,7 +9,7 @@ namespace CalamityMod.Items.Accessories
{
public new string LocalizationCategory => "Items.Accessories";
public static int cooldown = 420;
public static int damage = 60;
public static int damage = 30;
public override void SetDefaults()
{
Item.width = 34;
+1 -1
View File
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.Accessories
public class ScionsCurio : ModItem, ILocalizedModType
{
public static int postHitDamage = 45;
public static int postHitDamage = 20;
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
{
+2 -3
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Armor
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(SummonDamageBoost.ToPercent(), RogueVelocityBoost.ToPercent());
// Set Bonus
public static float SetBonusRogueStealth = 0.4f;
public static float SetBonusRogueStealth = 1.05f;
public static int TagDuration = CalamityUtils.SecondsToFrames(10);
public static int StormManaCost = 60;
public static int StormCooldown = 45;
@@ -34,7 +34,7 @@ namespace CalamityMod.Items.Armor
{
//These tag damage fields determine the damage of the spawned eater. The resulting number from each is added together
//So, 0.5 multiplicative and 10 flat would make the damage be 50% of the spawning hit's damage, plus 10 more.
//If you want entirely flt, set multiplicative to 0. If you want entirely multiplicative, set flat to 0.
//If you want entirely flat, set multiplicative to 0. If you want entirely multiplicative, set flat to 0.
MultiplicativeTagDamage = 0.25f,
FlatTagDamage = 5,
AllowsWhipStacking = true,
@@ -57,7 +57,6 @@ namespace CalamityMod.Items.Armor
if (!Main.dedServ)
ArmorIDs.Head.Sets.DrawFullHair[Item.headSlot] = true;
summonTag.TagItem = Type;
CalamityBuffSets.SummonTagDebuff.Add(ModContent.BuffType<ForbiddenStealthSummonTagBuff>(),summonTag);
}
public override void SetDefaults()
+1 -1
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Items.Armor.Victide
public new string LocalizationCategory => "Items.Armor.PreHardmode";
public string BulkTexture => "CalamityMod/Items/Armor/Victide/VictideBreastplate_Bulk";
public static int RegenBoost = 2;
public static int RegenBoost = 1;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond());
+4 -4
View File
@@ -16,15 +16,15 @@ namespace CalamityMod.Items.Armor.Victide
{
public new string LocalizationCategory => "Items.Armor.PreHardmode";
public static int RegenBoost = 2;
public static float RunAccelerationMult = 1.75f;
public static int RegenBoost = 1;
public static float RunAccelerationMult = 1.25f;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), RunAccelerationMult.Round());
// Set Bonus
public static int BarrierCooldown = CalamityUtils.SecondsToFrames(8);
public static int BarrierDefenseBoost = 6;
public static int BarrierDefenseBoost = 4;
public static float BarrierDamageAbsorptionPercent = 0.1f;
public static int BarrierFramesPerHeal = 15;
public static int BarrierFramesPerHeal = 30;
public static int BarrierDamage = 50;
public static float BarrierExplosionKB = 8f;
+3 -3
View File
@@ -18,10 +18,10 @@ namespace CalamityMod.Items.Armor.Victide
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedAccelerationBoost.ToPercent());
// Set Bonus
public static float BaseBurrowSpeed = 9f; // 46 mph
public static float SubmergedBurrowSpeed = 12f; // 61 mph
public static float BaseBurrowSpeed = 8f; // 41 mph
public static float SubmergedBurrowSpeed = 10f; // 51 mph
public static float BaseAcceleration = 0.4f; // For reference, base player running acceleration is 0.08
public static int BurrowDuration = CalamityUtils.SecondsToFrames(7);
public static int BurrowDuration = CalamityUtils.SecondsToFrames(5);
public static int BurrowCooldown = CalamityUtils.SecondsToFrames(30);
public override void SetDefaults()
+1 -2
View File
@@ -1435,8 +1435,7 @@ namespace CalamityMod.Items
#region PostUpdate
public override void PostUpdate(Item item)
{
if (CalamityItemSets.ItemForcedInsideWorld[item.type])
CalamityUtils.ForceItemIntoWorld(item);
CalamityUtils.ForceItemIntoWorld(item);
}
#endregion
+5 -9
View File
@@ -114,7 +114,7 @@ namespace CalamityMod.Items
int standardTooltipCount = 0;
for (int i = 0; i < tooltips.Count; i++)
{
if (tooltips[i].Name.StartsWith("Tooltip"))
if (tooltips[i]?.Name?.StartsWith("Tooltip") == true)
{
if (firstTooltipIndex == -1)
firstTooltipIndex = i;
@@ -526,12 +526,8 @@ namespace CalamityMod.Items
string MultTagTooltip(float mult) => (CalamityUtils.GetText($"Common.SummonTagDamageMult").Format((mult + 1).ToString("0.##")));
string CritTagTooltip(float crit) => (CalamityUtils.GetText($"Common.SummonTagCrit").Format((crit * 100).ToString("0.#")));
Dictionary<int, SummonTag> TagByItem = new();
foreach (SummonTag tag1 in CalamityBuffSets.SummonTagDebuff.Values)
{
if (tag1.TagItem > -1) TagByItem.Add(tag1.TagItem, tag1);
}
if (TagByItem.TryGetValue(item.type, out SummonTag tag))
var tag = CalamityBuffSets.SummonTagDebuff.FirstOrDefault(x => x is not null && x.TagItem == item.type && x.AutoDrawTooltip, null);
if (tag is not null)
{
if (!tag.AutoDrawTooltip) return;
var modPlayer = Main.LocalPlayer.Calamity();
@@ -735,7 +731,7 @@ namespace CalamityMod.Items
}
#endregion
// Whip tag is dynamically generated for all whips based on the SummonTagDebuffDict, so we'll remove the vanilla tag tootlips.
// Whip tag is dynamically generated for all whips based on the SummonTagDebuff dictionary, so we'll remove the vanilla tag tootlips.
#region Whip Tag removal
// Additive tag changes
if (item.type == ItemID.BlandWhip)
@@ -1078,7 +1074,7 @@ namespace CalamityMod.Items
if (item.type == ItemID.HiveFive)
AddYoyoStats(24f, 320f, 20f);
if (item.type == ItemID.JungleYoyo)
AddYoyoStats(20f, 288f, 17f);
AddYoyoStats(24f, 320f, 20f);
if (item.type == ItemID.Kraken)
AddYoyoStats(-1f, 480f, 54f);
if (item.type == ItemID.Rally)
+27 -31
View File
@@ -41,19 +41,18 @@ namespace CalamityMod.Items
currentTweaks = new SortedDictionary<int, IItemTweak[]>
{
#region CATEGORY 1: Weapon Balancing
{ ItemID.AdamantiteGlaive, Do(TrueMelee, DamageExact(69), UseExact(7), ShootSpeedExact(18f)) }, // VANILLA: 49 DMG, 25 UT, 5 VEL
{ ItemID.AdamantiteGlaive, Do(TrueMelee, DamageExact(66), UseExact(7), ShootSpeedExact(18f)) }, // VANILLA: 49 DMG, 25 UT, 5 VEL
{ ItemID.AdamantiteRepeater, Do(UseExact(14)) }, // VANILLA: 18 UT
{ ItemID.AdamantiteSword, Do(UseTurn, DamageExact(75), UseExact(7)) }, // VANILLA: 61 DMG, 21 UT
{ ItemID.AmberStaff, Do(UseTimeExact(15), UseAnimationExact(45), ReuseDelayExact(15)) }, // VANILLA: 28 UT/UA, 0 RUD
{ ItemID.AdamantiteSword, Do(UseTurn, DamageExact(72), UseExact(7)) }, // VANILLA: 61 DMG, 21 UT
{ ItemID.AmberStaff, Do(UseTimeExact(18), UseAnimationExact(36), ReuseDelayExact(15)) }, // VANILLA: 28 UT/UA, 0 RUD
{ ItemID.AmethystStaff, Do(ManaExact(2)) }, // VANILLA: 5 MANA
{ ItemID.Anchor, Do(DamageExact(107), UseExact(30)) }, // VANILLA: 70 DMG, 20 UT
{ ItemID.Anchor, Do(DamageExact(107)) }, // VANILLA: 70 DMG
{ ItemID.AntlionClaw, Do(UseExact(10)) }, // Mandible Blade. VANILLA: 18 UT
{ ItemID.AquaScepter, Do(DamageRatio(0.9f)) }, // VANILLA: 27 DMG. Uses ratios due to remix seed
{ ItemID.Bananarang, Do(DamageExact(60)) }, // VANILLA: 45 DMG
{ ItemID.BatScepter, Do(DamageExact(50)) }, // VANILLA: 45 DMG
{ ItemID.BeamSword, Do(UseMeleeSpeed, DamageExact(131), UseAnimationExact(40), KnockbackExact(8)) }, // VANILLA: 52 DMG, 20 UT, 6.5 KB
{ ItemID.BeeGun, Do(DamageExact(11)) }, // VANILLA: 9 DMG
{ ItemID.BeeKeeper, Do(UseTurn, DamageExact(32)) }, // VANILLA: 30 DMG
{ ItemID.Beenade, Do(UseTimeExact(22), ShootSpeedExact(10f)) }, // VANILLA: 15 UT, 6 VEL
{ ItemID.BeesKnees, Do(DamageExact(21), UseExact(35)) }, // VANILLA: 23 DMG, 23 UT
{ ItemID.Bladetongue, Do(UseTurn, DamageExact(120), UseExact(22)) }, // VANILLA: 55 DMG, 28 UT
@@ -65,20 +64,20 @@ namespace CalamityMod.Items
{ ItemID.BoneSword, Do(UseTurn, DamageExact(25)) }, // VANILLA: 19 DMG
{ ItemID.BookofSkulls, Do(ShootSpeedExact(5.5f)) }, // VANILLA: 3.5 VEL
{ ItemID.Boomstick, Do(DamageExact(11)) }, // VANILLA: 14 DMG
{ ItemID.BreakerBlade, Do(UseTurn, DamageExact(140)) }, // VANILLA: 70 DMG
{ ItemID.CandyCornRifle, Do(DamageExact(66)) }, // VANILLA: 44 DMG
{ ItemID.BreakerBlade, Do(UseTurn, DamageExact(160)) }, // VANILLA: 70 DMG
{ ItemID.CandyCornRifle, Do(DamageExact(80)) }, // VANILLA: 44 DMG
{ ItemID.Cascade, Do(DamageExact(31)) }, // VANILLA: 27 DMG
{ ItemID.ChainGuillotines, Do(DamageExact(100)) }, // VANILLA: 59 DMG
{ ItemID.ChainGuillotines, Do(DamageExact(75)) }, // VANILLA: 59 DMG
{ ItemID.ChainGun, Do(DamageExact(35)) }, // VANILLA: 31 DMG
{ ItemID.ChainKnife, Do(DamageRatio(1.34f)) }, // VANILLA: 12 DMG. Uses ratios due to remix seed
{ ItemID.ChlorophyteClaymore, Do(UseMeleeSpeed, DamageExact(180), UseExact(45), ShootSpeedExact(22f)) }, // VANILLA: 95 DMG, 26 UT, 8 VEL
{ ItemID.ChlorophytePartisan, Do(UseMeleeSpeed, DamageExact(95)) }, // VANILLA: 49 DMG
{ ItemID.ChlorophytePartisan, Do(UseMeleeSpeed, DamageExact(80)) }, // VANILLA: 49 DMG
{ ItemID.ChlorophyteSaber, Do(UseMeleeSpeed, DamageExact(92), UseExact(10)) }, // VANILLA: 57 DMG, 16 UT
{ ItemID.ChristmasTreeSword, Do(UseTurn, UseMeleeSpeed, DamageExact(80), UseExact(30)) }, // VANILLA: 86 DMG, 23 UT
{ ItemID.ClockworkAssaultRifle, Do(DamageExact(21)) }, // VANILLA: 17 DMG
{ ItemID.CobaltNaginata, Do(TrueMelee, DamageExact(55), UseExact(9), ShootSpeedExact(12f)) }, // VANILLA: 44 DMG, 28 UT, 4.3 VEL
{ ItemID.CobaltRepeater, Do(UseExact(18)) }, // VANILLA: 23 UT
{ ItemID.CobaltSword, Do(DamageExact(60), UseExact(9)) }, // VANILLA: 40 DMG, 19 UT
{ ItemID.ClockworkAssaultRifle, Do(DamageExact(24)) }, // VANILLA: 17 DMG
{ ItemID.CobaltNaginata, Do(TrueMelee, DamageExact(60), UseExact(9), ShootSpeedExact(12f)) }, // VANILLA: 44 DMG, 28 UT, 4.3 VEL
{ ItemID.CobaltRepeater, Do(UseExact(17)) }, // VANILLA: 23 UT
{ ItemID.CobaltSword, Do(DamageExact(69), UseExact(9)) }, // VANILLA: 40 DMG, 19 UT
{ ItemID.Code2, Do(DamageExact(43)) }, // VANILLA: 54 DMG
{ ItemID.CoinGun, Do(UseExact(12)) }, // VANILLA: 8 UT
{ ItemID.CorruptYoyo, Do(DamageExact(20)) }, // Malaise. VANILLA: 16 DMG
@@ -89,11 +88,9 @@ namespace CalamityMod.Items
{ ItemID.CrystalVileShard, Do(DamageExact(35)) }, // VANILLA: 25 DMG
{ ItemID.CursedArrow, Do(DamageExact(14)) }, // VANILLA: 17 DMG
{ ItemID.CursedDart, Do(DamageExact(25)) }, // VANILLA: 9 DMG
{ ItemID.Cutlass, Do(DamageExact(90), UseExact(14)) }, // VANILLA: 53 DMG, 16 UT
{ ItemID.Cutlass, Do(DamageExact(90), UseExact(11)) }, // VANILLA: 53 DMG, 16 UT
{ ItemID.DaedalusStormbow, Do(DamageExact(30)) }, // VANILLA: 38 DMG
{ ItemID.DaoofPow, Do(DamageExact(85)) }, // Displays as 170 damage. VANILLA: 50 DMG (displays as 100)
{ ItemID.DarkLance, Do(TrueMelee, DamageExact(40)) }, // VANILLA: 34 DMG
{ ItemID.DartRifle, Do(DamageExact(58)) }, // VANILLA: 52 DMG
{ ItemID.DayBreak, Do(DamageExact(125), UseExact(22)) }, // VANILLA: 150 DMG, 16 UT
{ ItemID.DD2BetsyBow, Do(DamageExact(42)) }, // Aerial Bane. VANILLA: 39 DMG. Compensation for removing aerial multiplier
{ ItemID.DD2SquireBetsySword, Do(UseMeleeSpeed, DamageExact(150)) }, // Flying Dragon. VANILLA: 180 DMG
@@ -105,8 +102,8 @@ namespace CalamityMod.Items
{ ItemID.ElfMelter, Do(ShootSpeedDelta(+5f)) }, // VANILLA: 8.5 VEL
{ ItemID.EmeraldStaff, Do(DamageExact(27)) }, // VANILLA: 19 DMG
{ ItemID.EmpressBlade, Do(DamageExact(68)) }, // Terraprisma. VANILLA: 90 DMG
{ ItemID.EnchantedBoomerang, Do(DamageExact(24)) }, // VANILLA: 17 DMG
{ ItemID.EnchantedSword, Do(UseMeleeSpeed, DamageExact(30), ShootSpeedExact(15f)) }, // VANILLA: 23 DMG, 9.5 VEL
{ ItemID.EnchantedBoomerang, Do(DamageExact(21)) }, // VANILLA: 17 DMG
{ ItemID.EnchantedSword, Do(UseMeleeSpeed) },
{ ItemID.EndlessMusketPouch, Do(DamageExact(8)) }, // VANILLA: 7 DMG. Gives it the same damage as Tungsten Bullet
{ ItemID.Excalibur, Do(TrueMelee, DamageExact(170)) }, // VANILLA: 72 DMG
{ ItemID.FairyQueenMagicItem, Do(DamageExact(54)) }, // Nightglow. VANILLA: 50 DMG
@@ -118,7 +115,7 @@ namespace CalamityMod.Items
{ ItemID.FlowerofFire, Do(DamageRatio(0.78f)) }, // VANILLA: 48 DMG. Uses ratios due to remix seed
{ ItemID.FlowerPow, Do(DamageExact(80)) }, // Displays as 160 damage. VANILLA: 65 DMG (displays as 130)
{ ItemID.FlyingKnife, Do(DamageExact(53)) }, // VANILLA: 40 DMG
{ ItemID.Frostbrand, Do(UseMeleeSpeed, DamageExact(88)) }, // VANILLA: 49 DMG
{ ItemID.Frostbrand, Do(UseMeleeSpeed, DamageExact(110)) }, // VANILLA: 49 DMG
{ ItemID.Gatligator, Do(UseExact(6)) }, // VANILLA: 7 UT
{ ItemID.GoldShortsword, Do(TrueMelee, DamageExact(17)) }, // VANILLA: 12 DMG
{ ItemID.GolemFist, Do(DamageExact(150)) }, // VANILLA: 90 DMG
@@ -143,7 +140,7 @@ namespace CalamityMod.Items
{ ItemID.InfluxWaver, Do(UseMeleeSpeed, DamageExact(80), UseExact(25)) }, // VANILLA: 100 DMG, 20 UT
{ ItemID.IronShortsword, Do(TrueMelee, DamageExact(10)) }, // VANILLA: 8 DMG
{ ItemID.Keybrand, Do(UseTurn) },
{ ItemID.KOCannon, Do(DamageRatio(2.65f)) }, // VANILLA: 40 DMG. Uses ratios due to remix seed
{ ItemID.KOCannon, Do(DamageRatio(3f)) }, // VANILLA: 40 DMG. Uses ratios due to remix seed
{ ItemID.Kraken, Do(DamageExact(65)) }, // VANILLA: 95 DMG
{ ItemID.LaserMachinegun, Do(DamageExact(49)) }, // VANILLA: 60 DMG
{ ItemID.LaserRifle, Do(DamageExact(46)) }, // VANILLA: 29 DMG
@@ -156,7 +153,7 @@ namespace CalamityMod.Items
{ ItemID.MagicMissile, Do(DamageExact(23), UseAnimationExact(20), UseTimeExact(10)) }, // VANILLA: 35 DMG, 22 UT/UA
{ ItemID.Marrow, Do(DamageExact(60)) }, // VANILLA: 53 DMG
{ ItemID.MedusaHead, Do(DamageExact(75)) }, // VANILLA: 40 DMG
{ ItemID.Meowmere, Do(UseMeleeSpeed, DamageExact(240)) }, // VANILLA: 200 DMG
{ ItemID.Meowmere, Do(UseMeleeSpeed) },
{ ItemID.MiniNukeI, Do(DamageExact(90)) }, // VANILLA: 75 DMG
{ ItemID.MiniNukeII, Do(DamageExact(90)) },
{ ItemID.Minishark, Do(DamageExact(4)) }, // VANILLA: 6 DMG
@@ -166,7 +163,6 @@ namespace CalamityMod.Items
{ ItemID.MonkStaffT3, Do(DamageExact(225)) }, // Sky Dragon's Fury. VANILLA: 140 DMG
{ ItemID.MoonlordBullet, Do(DamageExact(17)) }, // Luminite Bullet. VANILLA: 20 DMG
{ ItemID.MoonlordTurretStaff, Do(DamageExact(50)) }, // Lunar Portal Staff. VANILLA: 100 DMG
{ ItemID.Muramasa, Do(CritDelta(+10)) }, // VANILLA: 4% CRIT
{ ItemID.MushroomSpear, Do(TrueMelee, DamageExact(100), UseExact(32)) }, // VANILLA: 60 DMG, 40 UT
{ ItemID.Musket, Do(DamageExact(22)) }, // VANILLA: 31 DMG
{ ItemID.MythrilHalberd, Do(TrueMelee, DamageExact(65), UseExact(8), ShootSpeedExact(15f)) }, // VANILLA: 45 DMG, 26 UT, 4.5 VEL
@@ -179,11 +175,11 @@ namespace CalamityMod.Items
{ ItemID.OrangePhaseblade, phaseblade },
{ ItemID.OrangePhasesaber, phasesaber },
{ ItemID.OrichalcumHalberd, Do(TrueMelee, DamageExact(128), ShootSpeedExact(6f)) }, // VANILLA: 46 DMG, 4.5 VEL
{ ItemID.OrichalcumRepeater, Do(DamageExact(48)) }, // VANILLA: 40 DMG
{ ItemID.OrichalcumRepeater, Do(DamageExact(50)) }, // VANILLA: 40 DMG
{ ItemID.OrichalcumSword, Do(UseTurn, DamageExact(175)) }, // VANILLA: 59 DMG
{ ItemID.PaladinsHammer, Do(DamageExact(95), ShootSpeedExact(28)) }, // VANILLA: 90 DMG, 14 VEL
{ ItemID.PalladiumPike, Do(TrueMelee, DamageExact(120), ShootSpeedExact(5.4f)) }, // VANILLA: 44 DMG, 4.4 VEL
{ ItemID.PalladiumRepeater, Do(DamageExact(45)) }, // VANILLA: 37 DMG
{ ItemID.PalladiumRepeater, Do(DamageExact(48)) }, // VANILLA: 37 DMG
{ ItemID.PalladiumSword, Do(DamageExact(150)) }, // VANILLA: 49 DMG
{ ItemID.PearlwoodBow, Do(DamageExact(32)) }, // VANILLA: 12 DMG
{ ItemID.PearlwoodSword, Do(UseTurn, DamageExact(45)) }, // VANILLA: 30 DMG
@@ -232,14 +228,13 @@ namespace CalamityMod.Items
{ ItemID.SpiritFlame, Do(UseExact(20), ShootSpeedExact(2f)) }, // VANILLA: 22 UT, 3 VEL
{ ItemID.StaffofEarth, Do(DamageExact(150)) }, // VANILLA: 125 DMG
{ ItemID.StarCannon, Do(UseExact(18)) }, // VANILLA: 12 UT
{ ItemID.StardustDragonStaff, Do(DamageExact(20)) }, // VANILLA: 40 DMG
{ ItemID.StardustDragonStaff, Do(DamageExact(24)) }, // VANILLA: 40 DMG
{ ItemID.StormTigerStaff, Do(DamageExact(49)) }, // Desert Tiger Staff. VANILLA: 41 DMG
{ ItemID.StylistKilLaKillScissorsIWish, Do(UseTurn, DamageExact(21)) }, // Stylish Scissors. VANILLA: 14 DMG
{ ItemID.Stynger, Do(DamageExact(75)) }, // VANILLA: 45 DMG
{ ItemID.SuperStarCannon, Do(DamageExact(55)) }, // VANILLA: 60 DMG
{ ItemID.Swordfish, Do(TrueMelee, DamageExact(24)) }, // VANILLA: 19 DMG
{ ItemID.Swordfish, Do(TrueMelee, DamageExact(21)) }, // VANILLA: 19 DMG
{ ItemID.TacticalShotgun, Do(DamageExact(34)) }, // VANILLA: 29 DMG
{ ItemID.TaxCollectorsStickOfDoom, Do(UseTurn, DamageExact(70), UseExact(12)) }, // Classy Cane. VANILLA: 16 DMG, 15 UT
{ ItemID.TaxCollectorsStickOfDoom, Do(UseTurn, DamageExact(80), UseExact(10)) }, // Classy Cane. VANILLA: 16 DMG, 15 UT
{ ItemID.TendonBow, Do(DamageExact(17)) }, // VANILLA: 19 DMG
{ ItemID.TerraBlade, Do(DamageExact(95)) }, // VANILLA: 85 DMG
{ ItemID.Terragrim, Do(TrueMeleeNoSpeed, DamageExact(13)) }, // VANILLA: 17 DMG
@@ -249,15 +244,14 @@ namespace CalamityMod.Items
{ ItemID.TheRottedFork, Do(TrueMelee, DamageExact(20)) }, // VANILLA: 17 DMG
{ ItemID.TheUndertaker, Do(DamageExact(15)) }, // VANILLA: 19 DMG
{ ItemID.ThunderSpear, Do(UseMeleeSpeed) }, // Storm Spear
{ ItemID.ThunderStaff, Do(DamageExact(18)) }, // Thunder Zapper. VANILLA: 20 DMG
{ ItemID.ThunderStaff, Do(DamageExact(15)) }, // Thunder Zapper. VANILLA: 20 DMG
{ ItemID.TitaniumRepeater, Do(DamageExact(52)) }, // VANILLA: 43 DMG
{ ItemID.TitaniumSword, Do(UseTurn, DamageExact(192)) }, // VANILLA: 61 DMG
{ ItemID.TitaniumSword, Do(UseTurn, DamageExact(185)) }, // VANILLA: 61 DMG
{ ItemID.TitaniumTrident, Do(TrueMelee, DamageExact(144), ShootSpeedExact(6.5f)) }, // VANILLA: 48 DMG, 5 VEL
{ ItemID.TopazStaff, Do(ManaExact(2)) }, // VANILLA: 5 MANA
{ ItemID.ToxicFlask, Do(DamageExact(62), UseExact(33)) }, // VANILLA: 52 DMG, 45 UT
{ ItemID.Toxikarp, Do(UseExact(9)) }, // VANILLA: 10 UT
{ ItemID.Trident, Do(TrueMelee, DamageExact(20)) }, // VANILLA: 14 DMG
{ ItemID.Trimarang, Do(DamageExact(24)) }, // VANILLA: 21 DMG
{ ItemID.TrueExcalibur, Do(TrueMelee, DamageExact(112)) }, // VANILLA: 72 DMG
{ ItemID.TrueNightsEdge, Do(DamageExact(105)) }, // VANILLA: 70 DMG
{ ItemID.Tsunami, Do(DamageExact(45)) }, // VANILLA: 53 DMG
@@ -388,6 +382,7 @@ namespace CalamityMod.Items
#region CATEGORY 4: True Melee support
{ ItemID.Arkhalis, trueMeleeNoSpeed },
{ ItemID.CopperShortsword, trueMelee },
{ ItemID.DarkLance, trueMelee },
{ ItemID.Gladius, trueMelee },
{ ItemID.HallowJoustingLance, trueMelee },
{ ItemID.JoustingLance, trueMelee },
@@ -404,6 +399,7 @@ namespace CalamityMod.Items
#endregion
#region CATEGORY 5: UseTurn
{ ItemID.BeeKeeper, Do(UseTurn) },
{ ItemID.BladeofGrass, Do(UseTurn) },
{ ItemID.BloodButcherer, Do(UseTurn) },
{ ItemID.BorealWoodSword, Do(UseTurn) },
+390 -9
View File
@@ -1,28 +1,409 @@
using Terraria.ID;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using CalamityMod.Items.Weapons.Rogue;
using CalamityMod.Utilities.Daybreak;
using CalamityMod.Utilities.Daybreak.Buffers;
using Microsoft.CodeAnalysis;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.GameContent.Achievements;
using Terraria.Graphics.Renderers;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;
namespace CalamityMod.Items.Fishing
{
public class Spadefish : ModItem, ILocalizedModType
public class Spadefish : RogueWeapon, ILocalizedModType
{
public static float SpinsToThrow => 3;
public static float SpinDamageMult => 0.33f;
public static float SpinAccel => 1.0175f;
public static float SpinThrowVelocityMult => 1.5f;
public override float StealthDamageMultiplier => 2f;
public static int PickPower => 50;
public new string LocalizationCategory => "Items.Fishing";
public override void SetDefaults()
{
Item.width = 46;
Item.height = 44;
Item.damage = 15;
Item.damage = 30;
Item.knockBack = 2f;
Item.useTime = 7;
Item.useAnimation = 20;
Item.pick = 34;
Item.DamageType = DamageClass.Melee;
Item.useTurn = true;
Item.useTime = 40;
Item.useAnimation = 40;
Item.shootSpeed = 12;
Item.DamageType = RogueDamageClass.Instance;
Item.useStyle = ItemUseStyleID.Swing;
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
Item.rare = ItemRarityID.Green;
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<SpadefishThrown>();
Item.noMelee = true;
Item.noUseGraphic = true;
Item.pick = PickPower;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (player.Calamity().StealthStrikeAvailable())
{
type = ModContent.ProjectileType<SpadefishHoldout>();
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); //This proj sets StealthStrike on its own setdefaults
player.Calamity().ConsumeStealthByAttacking(); //Due to the holdout, we manually consume stealth here and on spam.
return false;
}
player.Calamity().rogueStealth = 0;
return true;
}
#region Toggleable Mining
public bool CanMine = false;
public override void ModifyTooltips(List<TooltipLine> tooltips)
{
tooltips.FindAndReplace("[TOGGLE]", CanMine ? this.GetLocalizedValue("TextWhileEnabled") : this.GetLocalizedValue("TextWhileDisabled"));
}
public override bool CanRightClick() => Main.keyState.PressingShift();
public override void RightClick(Player player)
{
CanMine = !CanMine;
Item.NetStateChanged();
}
public override bool ConsumeItem(Player player) => false;
public override void SaveData(TagCompound tag)
{
tag.Add("CanMine", CanMine);
}
public override void LoadData(TagCompound tag)
{
CanMine = tag.GetBool("CanMine");
}
public override void NetSend(BinaryWriter writer)
{
writer.Write(CanMine);
}
public override void NetReceive(BinaryReader reader)
{
CanMine = reader.ReadBoolean();
}
Asset<Texture2D> texture;
public override void PostDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
if (CanMine)
{
var tex = CalamityUtils.GetTextureEfficient(ref texture, "Terraria/Images/Extra_48").Value;
var dotFrame = tex.Frame(8, 39, 4, 23);
spriteBatch.Draw(tex, position + new Vector2(16, 16) * Main.inventoryScale, dotFrame, Color.White, 0, dotFrame.Size() * 0.5f, Main.inventoryScale, SpriteEffects.None, 0);
}
}
#endregion
}
public class SpadefishThrown : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Rogue";
public override string Texture => "CalamityMod/Items/Fishing/Spadefish";
public override void SetDefaults()
{
Projectile.DamageType = RogueDamageClass.Instance;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = -1;
Projectile.penetrate = 3;
Projectile.width = 16;
Projectile.height = 16;
Projectile.friendly = true;
Projectile.stopsDealingDamageAfterPenetrateHits = true;
Projectile.timeLeft = 480;
Projectile.MaxUpdates = 2;
Projectile.ignoreWater = true;
}
bool frameOne = true;
public override void AI()
{
if (frameOne)
{
Projectile.velocity /= Projectile.MaxUpdates;
frameOne = false;
}
if (Projectile.ai[0] <= 1 && Projectile.timeLeft < 450)
Projectile.velocity.Y += 0.08f;
if (Projectile.ai[0] == 0)
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4;
else if (Projectile.ai[0] == 1)
Projectile.rotation += Projectile.velocity.X * 0.15f;
if (Projectile.timeLeft < 60)
{
Projectile.Opacity = Projectile.timeLeft / 60f;
}
}
public override bool OnTileCollide(Vector2 oldVelocity)
{
if (Projectile.ai[0] == 1)
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4;
Projectile.velocity = Vector2.Zero;
Projectile.Center += oldVelocity;
Projectile.ai[0] = 2;
SoundEngine.PlaySound(SoundID.Dig, Projectile.Center);
Collision.HitTiles(Projectile.position, Projectile.velocity, Projectile.width, Projectile.height);
if (Main.myPlayer == Projectile.owner && Main.LocalPlayer.HeldItem.ModItem is Spadefish s && s.CanMine)
for (var j = -1; j < 2; j++)
for (var k = -1; k < 2; k++)
Dig(Spadefish.PickPower, Projectile.Center.ToTileCoordinates() + new Point(j, k));
return false;
}
public static void Dig(int pickPower, Point point)
{
var tile = Main.tile[point];
var x = tile.X();
var y = tile.Y();
if (!tile.HasTile || Main.tileAxe[tile.TileType] || Main.tileHammer[tile.TileType])
return;
int hitIndex = Main.LocalPlayer.hitTile.HitObject(x, y, 1);
if (tile.TileType == TileID.MysticSnakeRope)
return;
int pickDmg = Main.LocalPlayer.GetPickaxeDamage(x, y, pickPower, hitIndex, tile);
if (!WorldGen.CanKillTile(x, y))
pickDmg = 0;
if (Main.getGoodWorld)
pickDmg *= 2;
if (Main.LocalPlayer.DoesPickTargetTransformOnKill(Main.LocalPlayer.hitTile, pickDmg, x, y, pickPower, hitIndex, tile))
pickDmg = 0;
if (Main.LocalPlayer.hitTile.AddDamage(hitIndex, pickDmg) >= 100)
{
AchievementsHelper.CurrentlyMining = true;
Main.LocalPlayer.ClearMiningCacheAt(x, y, 1);
if (Main.netMode == NetmodeID.MultiplayerClient && Main.tileContainer[tile.TileType])
{
if (tile.TileType == TileID.DisplayDoll || tile.TileType == TileID.HatRack)
NetMessage.SendData(MessageID.TileManipulation, -1, -1, null, 20, x, y);
else
{
WorldGen.KillTile(x, y, fail: true);
NetMessage.SendData(MessageID.TileManipulation, -1, -1, null, 0, x, y, 1f);
}
if (tile.TileType == TileID.Containers)
{
NetMessage.SendData(MessageID.ChestUpdates, -1, -1, null, 1, x, y);
}
if (tile.TileType == TileID.Containers2)
{
NetMessage.SendData(MessageID.ChestUpdates, -1, -1, null, 5, x, y);
}
if (tile.TileType == TileID.Dressers)
{
NetMessage.SendData(MessageID.ChestUpdates, -1, -1, null, 3, x, y);
}
}
else
{
bool flag = tile.HasTile;
WorldGen.KillTile(x, y);
if (!Main.dedServ && flag && !tile.HasTile)
{
AchievementsHelper.HandleMining();
}
if (Main.netMode == NetmodeID.MultiplayerClient)
{
NetMessage.SendData(MessageID.TileManipulation, -1, -1, null, 0, x, y);
}
}
AchievementsHelper.CurrentlyMining = false;
}
else
{
WorldGen.KillTile(x, y, fail: true);
if (Main.netMode == NetmodeID.MultiplayerClient)
{
NetMessage.SendData(MessageID.TileManipulation, -1, -1, null, 0, x, y, 1f);
NetMessage.SendData(MessageID.SyncTilePicking, -1, -1, null, Main.myPlayer, x, y, pickDmg);
}
}
if (pickDmg != 0)
{
Main.LocalPlayer.hitTile.Prune();
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
SoundEngine.PlaySound(SoundID.Item178 with { Pitch = -0.5f + 0.25f * Projectile.numHits + (Projectile.Calamity().stealthStrike ? 1f : 0f) }, Projectile.Center);
Projectile.velocity.X = -Projectile.velocity.X.DirectionalSign();
Projectile.velocity.Y = -2f;
Projectile.ai[0] = 1;
Projectile.damage /= 2;
Projectile.netUpdate = true;
}
public override bool PreDraw(ref Color lightColor)
{
var tex = TextureAssets.Projectile[Type];
Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, null, lightColor * Projectile.Opacity, Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, 0);
return false;
}
}
public class SpadefishHoldout : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Rogue";
public override string Texture => "CalamityMod/Items/Fishing/Spadefish";
ref float spin => ref Projectile.ai[0];
ref float startingDir => ref Projectile.ai[1];
float throwSpeed = 12; //changing this does nothing, as this is set in the code. This is just a fallback value if something breaks.
bool reset = false;
float oldSpin = 0;
int digDir = 0;
float spinSin => MathF.Sin(spin);
public override void SetDefaults()
{
Projectile.DamageType = RogueDamageClass.Instance;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = -1;
Projectile.width = 64;
Projectile.height = 64;
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.Calamity().stealthStrike = true;
Projectile.tileCollide = false;
}
public override void Load()
{
On_LegacyPlayerRenderer.DrawPlayer += spinThePlayer;
}
private void spinThePlayer(On_LegacyPlayerRenderer.orig_DrawPlayer orig, LegacyPlayerRenderer self, Terraria.Graphics.Camera camera, Player drawPlayer, Vector2 position, float rotation, Vector2 rotationOrigin, float shadow, float scale)
{
var t = ModContent.ProjectileType<SpadefishHoldout>();
if (drawPlayer.ownedProjectileCounts[t] <= 0)
{
orig(self, camera, drawPlayer, position, rotation, rotationOrigin, shadow, scale);
return;
}
var Spade = Main.projectile.FirstOrDefault(p => p.active && p.owner == drawPlayer.whoAmI && p.type == t)?.ModProjectile<SpadefishHoldout>();
if (Spade is null || Spade.startingDir == 0)
{
orig(self, camera, drawPlayer, position, rotation, rotationOrigin, shadow, scale);
return;
}
using var lease = ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice);
using (lease.Scope(clearColor: Color.Transparent))
{
orig(self, camera, drawPlayer, position, rotation, rotationOrigin, shadow, scale);
bool flip = (Spade.spinSin * Spade.startingDir) < 0;
var tex = TextureAssets.Projectile[Type];
Main.EntitySpriteDraw(tex.Value, drawPlayer.Center + new Vector2(40, 0) - Main.screenPosition, null, Lighting.GetColor(Spade.Projectile.Center.ToTileCoordinates()), Spade.Projectile.rotation - (flip ? MathHelper.PiOver2 : 0), tex.Size() * 0.5f, new Vector2(Spade.Projectile.scale, Spade.Projectile.scale), flip ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
}
float width = Spade.spinSin * Spade.startingDir * drawPlayer.direction;
using (Main.spriteBatch.Scope())
{
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullNone, null, Matrix.identity);
Main.spriteBatch.Draw(lease.Target, position - Main.screenPosition, null, Color.White, 0, position - Main.screenPosition, new Vector2(MathF.Abs(width), 1), width < 0 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f);
Main.spriteBatch.End();
}
}
public override void AI()
{
var player = Main.player[Projectile.owner];
if (startingDir == 0)
{
startingDir = Projectile.velocity.X.DirectionalSign();
throwSpeed = Projectile.velocity.Length();
Projectile.velocity = Vector2.Zero;
}
player.direction = 1;
player.SetDummyItemTime((int)(player.HeldItem.useTime * player.GetWeaponAttackSpeed(player.HeldItem)));
Projectile.Center = player.Center + new Vector2(48 * spinSin, 0 * MathF.Cos(spin)) * startingDir;
Projectile.rotation = Projectile.DirectionFrom(player.Center).ToRotation() + MathHelper.PiOver4;
if (spin == 0)
{
spin = MathHelper.TwoPi;
}
spin *= Spadefish.SpinAccel;
int res = reset ? -1 : 1;
if (res != spinSin.DirectionalSign())
{
Projectile.ResetLocalNPCHitImmunity();
reset = !reset;
}
if (Projectile.timeLeft % 5 == 0 && Main.myPlayer == Projectile.owner && Main.LocalPlayer.HeldItem.ModItem is Spadefish s && s.CanMine)
for (var j = -1; j < 2; j++)
for (var k = -1; k < 2; k++)
SpadefishThrown.Dig(Spadefish.PickPower, Projectile.Center.ToTileCoordinates() + new Point(j, k));
if (spin > MathHelper.TwoPi * (1 + Spadefish.SpinsToThrow))
{
player.direction = (int)startingDir;
if (Main.myPlayer == Projectile.owner)
{
var p = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), player.Center, player.Calamity().mouseRotationFromPlayer.ToRotationVector2() * throwSpeed * Spadefish.SpinThrowVelocityMult, ModContent.ProjectileType<SpadefishThrown>(), Projectile.damage, Projectile.knockBack, player.whoAmI);
p.Calamity().stealthStrike = true;
}
Projectile.Kill();
}
}
public override bool PreDraw(ref Color lightColor)
{
return false;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
SoundEngine.PlaySound(SoundID.Item178 with { pitch = (spin-MathHelper.TwoPi) / (MathHelper.TwoPi * Spadefish.SpinsToThrow) - 0.5f }, Projectile.Center);
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
modifiers.SourceDamage *= Spadefish.SpinDamageMult;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 998 B

After

Width:  |  Height:  |  Size: 624 B

+30
View File
@@ -0,0 +1,30 @@
using CalamityMod.Buffs.Pets;
using CalamityMod.Projectiles.Pets;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Pets
{
public class IronBall : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Pets";
public override void SetDefaults()
{
Item.DefaultToVanitypet(ModContent.ProjectileType<Beldum>(), ModContent.BuffType<BeldumBuff>());
Item.UseSound = SoundID.NPCHit4;
Item.value = Item.sellPrice(gold: 2);
Item.rare = ItemRarityID.Orange;
Item.Calamity().donorItem = true;
}
public override void UseStyle(Player player, Rectangle heldItemFrame)
{
if (player.whoAmI == Main.myPlayer && player.itemTime == 0)
{
player.AddBuff(Item.buffType, 15, true);
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B

@@ -10,6 +10,8 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
{
public new string LocalizationCategory => "Items.Placeables";
public const int DropInt = 100;
public static bool holdShift = true;
public static bool showingFormerDevs = true;
public override void SetDefaults()
{
@@ -22,34 +24,42 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
public override void ModifyTooltips(List<TooltipLine> tooltips)
{
if (!Main.keyState.PressingShift())
return;
string tooltip = "";
int namesPerLine = 5;
for (int i = 0; i < devList.Count; i++)
if (Main.keyState.PressingShift())
{
tooltip += devList[i];
if (!holdShift)
{
holdShift = true;
showingFormerDevs = !showingFormerDevs;
}
if (i == devList.Count - 1)
break;
string tooltip = "--------\n";
int namesPerLine = 7;
IList<string> listToPullFrom = showingFormerDevs ? formerDevList : currentDevList;
if (i % namesPerLine == 0)
tooltip += "\n";
for (int i = 1; i <= listToPullFrom.Count; i++)
{
tooltip += listToPullFrom[i - 1];
else
tooltip += ", ";
if (i == listToPullFrom.Count)
break;
if (i % namesPerLine == 0)
tooltip += "\n";
else
tooltip += ", ";
}
TooltipLine line = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip2");
if (line != null)
line.Text = tooltip;
}
TooltipLine line = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip2");
if (line != null)
line.Text = tooltip;
else
holdShift = false;
}
public static IList<string> devList = new List<string>()
public static IList<string> currentDevList = new List<string>()
{
"Altixal",
"Altixal",
"apotofkoolaid",
"ArchonSystem",
"Atalya",
@@ -69,6 +79,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
"Fluffy",
"fryzahh",
"Gpscorpion",
"Hugekraken",
"jasper",
"LordMetarex",
"Moonburn",
@@ -85,8 +96,11 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
"TYESKI",
"Xyk",
"YuH",
// Former devs
"Afzofa",
};
public static IList<string> formerDevList = new List<string>()
{
"Afzofa",
"AdipemDragon",
"Akeeli",
"Aleksh",
@@ -130,7 +144,6 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
"Grox the Great",
"Heart Plus Up!",
"Hectique",
"Hugekraken",
"Huggles",
"Ian-1KV",
"IbanPlay",
+12 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Tiles.Pylons;
using CalamityMod.Items.Placeables.Crags;
using CalamityMod.Tiles.Pylons;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -15,5 +16,15 @@ namespace CalamityMod.Items.Placeables.Pylons
Item.value = Item.sellPrice(gold: 2);
Item.rare = ItemRarityID.Blue;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<ScorchedRemains>(15).
AddIngredient<ScorchedBone>(10).
AddIngredient(ItemID.Hellstone, 15).
AddTile(TileID.Anvils).
Register();
}
}
}
+11 -1
View File
@@ -1,4 +1,5 @@
using Terraria.ModLoader;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables
{
@@ -11,5 +12,14 @@ namespace CalamityMod.Items.Placeables
}
public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType<Tiles.VernalSoil>());
public override void AddRecipes()
{
CreateRecipe(25).
AddIngredient(ItemID.MudBlock, 25).
AddIngredient(ItemID.JungleSpores).
AddTile(TileID.Anvils).
Register();
}
}
}
+2 -1
View File
@@ -6,6 +6,7 @@ using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Systems.Collections;
namespace CalamityMod.Items.Potions
{
@@ -46,7 +47,7 @@ namespace CalamityMod.Items.Potions
for (int i = Player.MaxBuffs - 1; i >= 0; i--)
{
int buffType = player.buffType[i];
if (BuffDatasets.DebuffDataset[buffType] is not null && (BuffDatasets.DebuffDataset[buffType].SicknessDebuffScaling > 0 || BuffDatasets.DebuffDataset[buffType].ElectricDebuffScaling > 0))
if (CalamityBuffSets.DebuffDataset[buffType] is not null && (CalamityBuffSets.DebuffDataset[buffType].SicknessDebuffScaling > 0 || CalamityBuffSets.DebuffDataset[buffType].ElectricDebuffScaling > 0))
player.DelBuff(i);
}
+1 -1
View File
@@ -38,7 +38,7 @@ namespace CalamityMod.Items.SummonItems
{
var Prov = CalamityGlobalNPC.holyBoss;
bool canPissOffProvi = Prov != -1 && Main.npc[Prov].life >= (Main.npc[Prov].lifeMax * 0.95f) && Main.npc[Prov].Calamity().newAI[3] >= 180f && !Main.npc[Prov].Calamity().CurrentlyEnraged;
return (!NPC.AnyNPCs(ModContent.NPCType<Providence>()) || canPissOffProvi) && (player.ZoneHallow || player.ZoneUnderworldHeight) && !BossRushEvent.BossRushActive;
return ((!NPC.AnyNPCs(ModContent.NPCType<Providence>()) && (player.ZoneHallow || player.ZoneUnderworldHeight)) || canPissOffProvi) && !BossRushEvent.BossRushActive;
}
public override bool? UseItem(Player player)
+1 -1
View File
@@ -16,7 +16,7 @@ namespace CalamityMod.Items.Tools
public static float DamageBoost = 0.15f;
public static int DefenseBoost = 15;
public static int GraxBoostDuration = CalamityUtils.SecondsToFrames(10);
public static int GraxBoostDuration = CalamityUtils.SecondsToFrames(15);
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), DefenseBoost, GraxBoostDuration.FramesToSeconds());
public override void SetStaticDefaults()
{
+11 -6
View File
@@ -1,7 +1,9 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
@@ -14,14 +16,14 @@ namespace CalamityMod.Items.Tools
{
Item.width = 80;
Item.height = 66;
Item.damage = 110;
Item.damage = 55;
Item.crit = 10;
Item.knockBack = 7f;
Item.useTime = 8;
Item.useAnimation = 12;
Item.axe = 135 / 5;
Item.tileBoost += 1;
Item.shoot = ProjectileID.Spark; // Dummy argument to ensure it doesn't get set to true melee
Item.DamageType = DamageClass.Melee;
Item.useTurn = true;
Item.useStyle = ItemUseStyleID.Swing;
@@ -31,6 +33,8 @@ namespace CalamityMod.Items.Tools
Item.autoReuse = true;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) => false;
public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox)
{
hitbox = CalamityUtils.FixSwingHitbox(54, 54);
@@ -112,7 +116,7 @@ namespace CalamityMod.Items.Tools
sparkXSpawn *= (float)player.direction;
sparkYSpawn *= player.gravDir;
var source = player.GetSource_ItemUse(Item);
int damage = (int)player.GetTotalDamage<MeleeDamageClass>().ApplyTo(Item.damage * 0.2f);
int damage = (int)player.GetTotalDamage<MeleeDamageClass>().ApplyTo(Item.damage * 0.5f);
int spark = Projectile.NewProjectile(source, (float)(hitbox.X + hitbox.Width / 2) + sparkXSpawn, (float)(hitbox.Y + hitbox.Height / 2) + sparkYSpawn, (float)player.direction * sparkXVel, sparkYVel * player.gravDir, ProjectileID.Spark, damage, 0f, player.whoAmI);
if (spark.WithinBounds(Main.maxProjectiles))
Main.projectile[spark].DamageType = DamageClass.Melee;
@@ -129,9 +133,10 @@ namespace CalamityMod.Items.Tools
if (hit.Crit)
{
var source = player.GetSource_ItemUse(Item);
int boom = Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType<FuckYou>(), Item.damage, Item.knockBack, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f);
if (boom.WithinBounds(Main.maxProjectiles))
Main.projectile[boom].DamageType = DamageClass.Melee;
Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType<FuckYou>(), 0, Item.knockBack, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f);
int onHitDamage = player.CalcIntDamage<MeleeDamageClass>(Item.damage * 0.5f);
Projectile blast = Projectile.NewProjectileDirect(Item.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), onHitDamage, 0f, player.whoAmI, target.whoAmI);
blast.DamageType = Item.DamageType;
}
target.AddBuff(BuffID.OnFire3, 300);
}
+2 -2
View File
@@ -345,8 +345,8 @@ namespace CalamityMod.Items.Tools
{
PrefixID.Brisk,
PrefixID.Fleeting,
PrefixID.Hasty,
PrefixID.Quick
PrefixID.Hasty2,
PrefixID.Quick2
};
public override void SetDefaults()
+3 -3
View File
@@ -16,10 +16,10 @@ namespace CalamityMod.Items.Weapons.Magic
{
Item.width = 42;
Item.height = 28;
Item.damage = 28;
Item.damage = 18;
Item.DamageType = DamageClass.Magic;
Item.mana = 9;
Item.useAnimation = Item.useTime = 45;
Item.mana = 12;
Item.useAnimation = Item.useTime = 20;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 1.5f;
+3 -3
View File
@@ -16,13 +16,13 @@ namespace CalamityMod.Items.Weapons.Magic
{
Item.width = 40;
Item.height = 46;
Item.damage = 77;
Item.damage = 120;
Item.knockBack = 3.5f;
Item.noMelee = true;
Item.DamageType = DamageClass.Magic;
Item.mana = 32;
Item.mana = 45;
Item.useAnimation = Item.useTime = 32;
Item.useAnimation = Item.useTime = 45;
Item.useStyle = ItemUseStyleID.Shoot;
Item.autoReuse = true;
+4 -30
View File
@@ -20,8 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic
Item.damage = 130;
Item.DamageType = DamageClass.Magic;
Item.mana = 14;
Item.useTime = 5;
Item.useAnimation = 10;
Item.useAnimation = Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 5f;
@@ -40,21 +39,6 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool AltFunctionUse(Player player) => true;
public override bool CanUseItem(Player player)
{
if (player.altFunctionUse == 2)
{
Item.useTime = 20;
Item.useAnimation = 20;
}
else
{
Item.useTime = 5;
Item.useAnimation = 10;
}
return base.CanUseItem(player);
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (player.altFunctionUse == 2)
@@ -64,19 +48,9 @@ namespace CalamityMod.Items.Weapons.Magic
}
else
{
int note = Main.rand.Next(2);
if (note == 0)
{
damage = (int)(damage * 1.5f);
type = ModContent.ProjectileType<MelterNote1>();
}
else
{
velocity.X *= 1.5f;
velocity.Y *= 1.5f;
type = ModContent.ProjectileType<MelterNote2>();
}
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
Vector2 offset = velocity.SafeNormalize(Vector2.UnitX) * 8f;
Projectile.NewProjectile(source, position + offset.RotatedBy(MathHelper.PiOver2), velocity, type, (int)(damage * 1.5f), knockback, player.whoAmI);
Projectile.NewProjectile(source, position + offset.RotatedBy(-MathHelper.PiOver2), velocity * 1.5f, ModContent.ProjectileType<MelterNote2>(), damage, knockback, player.whoAmI);
return false;
}
}
+1 -1
View File
@@ -65,7 +65,7 @@ namespace CalamityMod.Items.Weapons.Magic
}
realPlayerPos += new Vector2(mouseXDist, mouseYDist);
int numProjectiles = 5;
int numProjectiles = 6;
for (int i = 0; i < numProjectiles; i++)
{
realPlayerPos.X += (float)Main.rand.Next(-100, 101);
-6
View File
@@ -24,12 +24,6 @@ namespace CalamityMod.Items.Weapons.Magic
public static int AftershotCooldownFrames = 17;
public static int FullChargeFrames = 88;
public override void SetStaticDefaults()
{
base.SetStaticDefaults();
CalamityItemSets.ShowScalingCritDamageTooltip[Type] = true;
}
public override void SetDefaults()
{
Item.width = 112;
+1 -1
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic
{
Item.width = 28;
Item.height = 32;
Item.damage = 19;
Item.damage = 16;
Item.DamageType = DamageClass.Magic;
Item.mana = 14;
Item.useAnimation = Item.useTime = 36;
-1
View File
@@ -16,7 +16,6 @@ namespace CalamityMod.Items.Weapons.Magic
public override void SetStaticDefaults()
{
Item.staff[Type] = true;
CalamityItemSets.ShowScalingCritDamageTooltip[Type] = true;
}
public override void SetDefaults()
+2 -3
View File
@@ -16,10 +16,9 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 30;
Item.height = 10;
Item.damage = 28;
Item.damage = 25;
Item.DamageType = DamageClass.MeleeNoSpeed;
Item.useTime = 20;
Item.useAnimation = 20;
Item.useAnimation = Item.useTime = 20;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.noUseGraphic = true;
+1 -1
View File
@@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.height = 54;
Item.damage = 32;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = Item.useTime = 21;
Item.useAnimation = Item.useTime = 24;
Item.useTurn = true;
Item.useStyle = ItemUseStyleID.Swing;
Item.knockBack = 5.5f;
+1 -1
View File
@@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 90;
Item.height = 90;
Item.damage = 200;
Item.damage = 350;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = 34;
Item.useStyle = ItemUseStyleID.Swing;
+7 -7
View File
@@ -14,19 +14,19 @@ namespace CalamityMod.Items.Weapons.Melee
{
public new string LocalizationCategory => "Items.Weapons.Melee";
// Weapon attribute constants
public static readonly int BaseDamage = 690;
public static readonly float GiantSkullDamageMultiplier = 1.7f;
public static int BaseDamage => 850;
public static float GiantSkullDamageMultiplier => 2.0f;
// Weapon projectile attribute constants
public static readonly int SearchDistance = 1450;
public static readonly int ImmunityFrames = 10;
public static int SearchDistance => 1450;
public static int ImmunityFrames => 10;
// Skull ring attribute constants
public static readonly float SkullsplosionDamageMultiplier = 1.5f;
public static float SkullsplosionDamageMultiplier => 1.5f;
internal static string SkullsplosionEntitySourceContext => "GaelsGreatswordRageSkullsplosion";
// Rage gain attribute constant
public static readonly float RagePerSecond = 0.025f; // 2.5% rage per second
public static float RagePerSecond => 0.025f; // 2.5% rage per second
//NOTE: GetWeaponDamage is in the CalamityPlayer file
public override void SetDefaults()
+1 -1
View File
@@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.width = 86;
Item.height = 72;
Item.DamageType = DamageClass.MeleeNoSpeed;
Item.damage = 1180;
Item.damage = 1100;
Item.knockBack = 14f;
Item.useTime = Item.useAnimation = 48;
Item.autoReuse = true;
Loaded 100 of 251 files, more files were not shown because too many files have changed in this diff. Show more