Added Crit Dmg & Minion Slot Tooltips
- All items that need minion slots list their minion slot cost directly above "Uses X Mana" tooltip line - Adjusted logic for setting crit that scales dmg with crit chance to scale crit dmg stat, made into one extension that is used everywhere scaling force crit is used - Items that always use scaling force crit on all attacks now replace crit chance with crit dmg in tooltip - Omega Blue Tentacles now scaling force crit - Thread of Eradication now scaling force crits, rebalance to match
This commit is contained in:
1 parent
9056e8470a
commit
2ce9ca1594
20 files changed
+94
-66
No files matched your search
@@ -163,6 +163,20 @@ namespace CalamityMod.Items
|
||||
}
|
||||
}
|
||||
|
||||
//Replace Crit Chance with Crit Damage on applicable tooltips
|
||||
if (CalamityItemSets.ShowScalingCritDamageTooltip[item.type])
|
||||
{
|
||||
float cdmg = 2f + Main.LocalPlayer.Calamity().critDamage + Main.LocalPlayer.GetTotalCritChance(TrueMeleeNoSpeedDamageClass.Instance) * 0.02f;
|
||||
tooltips.FirstOrDefault(x => x.Name == "CritChance")!.Text = CalamityUtils.GetText("Common.CritDamageTootip").Format(cdmg.ToPercent());
|
||||
}
|
||||
|
||||
//Add "Uses X Minion Slots right above "Uses X Mana"
|
||||
if (ItemID.Sets.StaffMinionSlotsRequired[item.type] > 0)
|
||||
{
|
||||
tooltips.Insert(tooltips.FindIndex(0, (x) => x.Name == "Knockback") + 1, new(Mod, "Minions", CalamityUtils.GetText("Common.MinionSlotCost").Format(ItemID.Sets.StaffMinionSlotsRequired[item.type])));
|
||||
}
|
||||
|
||||
|
||||
// Everything below this line can only apply to modded items. If the item is vanilla, stop here for efficiency.
|
||||
if (item.type < ItemID.Count)
|
||||
return;
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
using CalamityMod.Projectiles.BaseProjectiles;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Projectiles.Melee.Spears;
|
||||
using CalamityMod.Systems.Collections;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
@@ -18,15 +16,9 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
base.SetStaticDefaults();
|
||||
CalamityItemSets.ShowScalingCritDamageTooltip[Type] = true;
|
||||
}
|
||||
public override bool SizeModifiers => false;
|
||||
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
float cdmg = 2f + Main.LocalPlayer.Calamity().critDamage + Main.LocalPlayer.GetTotalCritChance(TrueMeleeNoSpeedDamageClass.Instance) * 0.02f;
|
||||
tooltips.FirstOrDefault(x => x.Name == "CritChance")!.Text = CalamityUtils.GetText("Common.CritDamageTootip").Format(cdmg.ToPercent());
|
||||
|
||||
}
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 66;
|
||||
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Items.Weapons.Magic;
|
||||
using CalamityMod.NPCs.DevourerofGods;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.Rarities;
|
||||
using CalamityMod.Systems.Collections;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
@@ -16,6 +17,11 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public class ThreadOfEradication : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
CalamityItemSets.ShowScalingCritDamageTooltip[Type] = true;
|
||||
}
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
tooltips.FindAndReplaceAll("ff00ff", Utils.Hex3(DevourerofGodsHead.SpecialMoveColor));
|
||||
@@ -24,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
Item.width = 40;
|
||||
Item.height = 82;
|
||||
Item.damage = 2570;
|
||||
Item.damage = 1500;
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.useTime = Item.useAnimation = 45;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
|
||||
@@ -93,11 +93,6 @@ namespace CalamityMod.Items.Weapons.Summon
|
||||
return false;
|
||||
}
|
||||
public override bool AltFunctionUse(Player player) => true;
|
||||
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
tooltips.Insert(tooltips.FindIndex(0, (x) => x.Name == "Knockback")+1,new(Mod,"Minions",CalamityUtils.GetText("Common.MinionSlotCost").Format(4)));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Utilities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
@@ -84,13 +85,12 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
|
||||
target.MoveNPC(launchVel, launchPower, true, Owner);
|
||||
|
||||
if (Projectile.ai[2] == 5)
|
||||
modifiers.SetCrit();
|
||||
modifiers.ApplyScalingForcedCrit(Projectile);
|
||||
|
||||
float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f);
|
||||
float minMult = 0.3f;
|
||||
int hitsToMinMult = 7;
|
||||
float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true);
|
||||
modifiers.SourceDamage *= (Projectile.ai[2] == 5 ? (1f + critDamage) : 1) * damageMult;
|
||||
modifiers.SourceDamage *= damageMult;
|
||||
|
||||
if (Projectile.numHits == 0)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Utilities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
@@ -54,13 +55,13 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
|
||||
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
modifiers.SetCrit();
|
||||
modifiers.ApplyScalingForcedCrit(Projectile);
|
||||
|
||||
Player Owner = Main.player[Projectile.owner];
|
||||
float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f);
|
||||
float minMult = 0.25f;
|
||||
int hitsToMinMult = 7;
|
||||
float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true);
|
||||
modifiers.SourceDamage *= damageMult + critDamage;
|
||||
modifiers.SourceDamage *= damageMult;
|
||||
|
||||
Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX);
|
||||
float launchPower = 40;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using CalamityMod.Dusts;
|
||||
using System;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.Utilities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -78,13 +79,13 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
|
||||
if (onKill && Projectile.numHits > 0)
|
||||
Projectile.numHits--;
|
||||
|
||||
modifiers.SetCrit();
|
||||
modifiers.ApplyScalingForcedCrit(Projectile);
|
||||
|
||||
Player Owner = Main.player[Projectile.owner];
|
||||
float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f);
|
||||
float minMult = 0.25f;
|
||||
int hitsToMinMult = 7;
|
||||
float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true);
|
||||
modifiers.SourceDamage *= damageMult + critDamage;
|
||||
modifiers.SourceDamage *= damageMult;
|
||||
|
||||
Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX);
|
||||
float launchPower = 20;
|
||||
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles.BaseProjectiles;
|
||||
using CalamityMod.Utilities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
@@ -395,13 +396,12 @@ namespace CalamityMod.Projectiles.Melee
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
if (chargedSwing)
|
||||
modifiers.SetCrit();
|
||||
modifiers.ApplyScalingForcedCrit(Projectile);
|
||||
|
||||
float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f);
|
||||
float minMult = 0.25f;
|
||||
int hitsToMinMult = 10;
|
||||
float damageMult = Utils.Remap(pierceReduction, 0, hitsToMinMult, 1, minMult, true);
|
||||
modifiers.SourceDamage *= (chargedSwing ? (2.9f + critDamage) : 1) * damageMult;
|
||||
modifiers.SourceDamage *= (chargedSwing ? 2.9f : 1) * damageMult;
|
||||
}
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles.BaseProjectiles;
|
||||
using CalamityMod.Utilities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -265,10 +266,6 @@ namespace CalamityMod.Projectiles.Melee.Spears
|
||||
Projectile.damage = (int)(Projectile.damage * 0.925f);
|
||||
}
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
modifiers.SetCrit();
|
||||
float critDamage = Main.player[Projectile.owner].GetTotalCritChance(Projectile.DamageType) * 0.02f;
|
||||
modifiers.CritDamage += critDamage;
|
||||
}
|
||||
=> modifiers.ApplyScalingForcedCrit(Projectile);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Utilities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
@@ -107,12 +108,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
|
||||
}
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
modifiers.SetCrit();
|
||||
Player Owner = Main.player[Projectile.owner];
|
||||
float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f);
|
||||
modifiers.SourceDamage *= 1 + critDamage;
|
||||
}
|
||||
=> modifiers.ApplyScalingForcedCrit(Projectile);
|
||||
public override bool? CanDamage() => base.CanDamage();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using CalamityMod.Utilities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
@@ -29,13 +30,12 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
}
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
modifiers.SetCrit();
|
||||
modifiers.ApplyScalingForcedCrit(Projectile);
|
||||
Player Owner = Main.player[Projectile.owner];
|
||||
float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f);
|
||||
float minMult = 0.45f;
|
||||
int hitsToMinMult = 15;
|
||||
float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true);
|
||||
modifiers.SourceDamage *= (damageMult + critDamage);
|
||||
modifiers.SourceDamage *= (damageMult);
|
||||
|
||||
Vector2 launchVel = Projectile.Center.DirectionTo(target.Center);
|
||||
float launchPower = 20;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Utilities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
@@ -127,11 +128,8 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
}
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
modifiers.SetCrit();
|
||||
modifiers.ApplyScalingForcedCrit(Projectile);
|
||||
Player Owner = Main.player[Projectile.owner];
|
||||
float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f);
|
||||
modifiers.SourceDamage *= 1 + critDamage;
|
||||
|
||||
Vector2 launchVel = Projectile.velocity;
|
||||
float launchPower = 60;
|
||||
target.MoveNPC(launchVel, launchPower, true, Owner);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Utilities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
@@ -200,12 +201,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
return useColor;
|
||||
}
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
modifiers.SetCrit();
|
||||
Player Owner = Main.player[Projectile.owner];
|
||||
float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f);
|
||||
modifiers.SourceDamage *= 1 + critDamage;
|
||||
}
|
||||
=> modifiers.ApplyScalingForcedCrit(Projectile);
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
if (time < 2)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Utilities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
@@ -117,9 +118,7 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
}
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
modifiers.SetCrit();
|
||||
float critDamage = Math.Min(Owner.GetTotalCritChance(AverageDamageClass.Instance) * 0.01f, 1f);
|
||||
modifiers.SourceDamage *= 1 + critDamage;
|
||||
modifiers.ApplyScalingForcedCrit(Projectile);
|
||||
|
||||
Vector2 launchVel = Utils.DirectionTo(Owner.Center, target.Center) - Vector2.UnitY;
|
||||
float launchPower = 9;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Cooldowns;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Utilities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
@@ -61,11 +62,7 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
time++;
|
||||
}
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
modifiers.SetCrit();
|
||||
float critDamage = Math.Min(Owner.GetTotalCritChance(AverageDamageClass.Instance) * 0.01f, 1f);
|
||||
modifiers.SourceDamage *= (1 + critDamage);
|
||||
}
|
||||
=> modifiers.ApplyScalingForcedCrit(Projectile);
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
bool hasCD = Owner.Calamity().cooldowns.TryGetValue(GenericBandCooldown.ID, out CooldownInstance bandCD);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Utilities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
@@ -130,6 +131,12 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
return hitCheck;
|
||||
}
|
||||
}
|
||||
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
if (Projectile.CountsAsClass(DamageClass.Ranged)) //Thread of Eradication
|
||||
modifiers.ApplyScalingForcedCrit(Projectile);
|
||||
}
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
if (laserFX == 0)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.Utilities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
@@ -171,7 +172,7 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
if (Owner.Calamity().omegaBlueAbyssalMadness)
|
||||
modifiers.SetCrit();
|
||||
modifiers.ApplyScalingForcedCrit(Projectile);
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Owner.DoLifestealDirect(target, 10 * hit.Damage / Projectile.damage, 0.5f);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Utilities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using ReLogic.Utilities;
|
||||
using Terraria;
|
||||
@@ -101,13 +102,12 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
}
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
modifiers.SetCrit();
|
||||
float critDamage = Math.Min(Owner.GetTotalCritChance(AverageDamageClass.Instance) * 0.01f, 1f);
|
||||
modifiers.ApplyScalingForcedCrit(Projectile);
|
||||
|
||||
float minMult = 0.1f;
|
||||
int hitsToMinMult = 5;
|
||||
float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true);
|
||||
modifiers.SourceDamage *= damageMult + critDamage;
|
||||
modifiers.SourceDamage *= damageMult;
|
||||
|
||||
Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center) - Vector2.UnitY;
|
||||
float launchPower = 6;
|
||||
|
||||
@@ -135,5 +135,10 @@ namespace CalamityMod.Systems.Collections
|
||||
/// </summary>
|
||||
public static bool[] RogueSpikyBall = Factory.CreateBoolSet(ItemType<BurningStrife>(), ItemType<GodsParanoia>(), ItemType<MetalMonstrosity>(), ItemType<NastyCholla>(), ItemType<SystemBane>(),
|
||||
ItemType<WebBall>());
|
||||
|
||||
public static bool[] ShowScalingCritDamageTooltip = Factory
|
||||
.CreateNamedSet("ShowScalingCritDamageTooltip")
|
||||
.Description("Replaces Crit Chance tooltip line with Crit Damage, getting 2% crit dmg per 1% crit chance")
|
||||
.RegisterBoolSet();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Terraria;
|
||||
using Terraria.WorldBuilding;
|
||||
|
||||
namespace CalamityMod.Utilities
|
||||
{
|
||||
internal static class HitModiferUtils
|
||||
{
|
||||
extension(NPC.HitModifiers modifiers)
|
||||
{
|
||||
internal void ApplyScalingForcedCrit(Projectile Projectile)
|
||||
{
|
||||
modifiers.SetCrit();
|
||||
float critDamage = Main.player[Projectile.owner].GetTotalCritChance(Projectile.DamageType) * 0.02f;
|
||||
modifiers.CritDamage += critDamage;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user