Ammo Saving Changes

Adds ammo saving to blossom flux, Astreal defeat, and all post ML ranger/all class armor
This commit is contained in:
Raesh authored and Cameron Ewell committed 2025-09-19 19:04:54 -04:00
1 parent 03a67f7b7a
commit 0477a0c982
16 files changed
+59 -9

No files matched your search

+1
View File
@@ -314,6 +314,7 @@ namespace CalamityMod.DataStructures
if (IsGreenGemActive)
{
Owner.Calamity().ammoCost *= GemTechHeadgear.RangedAmmoReduction;
Owner.GetCritChance<RangedDamageClass>() += (int)(GemTechHeadgear.RangedCritBoost * 100f);
Owner.GetDamage<RangedDamageClass>() += GemTechHeadgear.RangedDamageBoost;
}
+4 -1
View File
@@ -12,8 +12,9 @@ namespace CalamityMod.Items.Armor.Astral
public new string LocalizationCategory => "Items.Armor.Hardmode";
public static int MaxManaBoost = 80;
public static float AmmoReduction = 0.75f;
public static float DamageBoost = 0.07f;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, DamageBoost.ToPercent());
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, DamageBoost.ToPercent(), (1f - AmmoReduction).ToPercent());
public override void SetDefaults()
{
@@ -26,6 +27,8 @@ namespace CalamityMod.Items.Armor.Astral
public override void UpdateEquip(Player player)
{
var modPlayer = player.Calamity();
modPlayer.ammoCost *= AmmoReduction;
player.statManaMax2 += MaxManaBoost;
player.GetDamage<GenericDamageClass>() += DamageBoost;
}
+5 -1
View File
@@ -25,6 +25,9 @@ namespace CalamityMod.Items.Armor.Auric
public static int RangedCritBoost = 20;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost);
// Set Bonus
public static float SetBonusAmmoReduction = 0.7f;
public override void SetDefaults()
{
Item.width = 18;
@@ -40,7 +43,7 @@ namespace CalamityMod.Items.Armor.Auric
public override void UpdateArmorSet(Player player)
{
player.setBonus = this.GetLocalizedValue("SetBonus");
player.setBonus = this.GetLocalization("SetBonus").Format((1f - SetBonusAmmoReduction).ToPercent());
var modPlayer = player.Calamity();
modPlayer.tarraSet = true;
modPlayer.tarraRanged = true;
@@ -50,6 +53,7 @@ namespace CalamityMod.Items.Armor.Auric
modPlayer.godSlayerRanged = true;
modPlayer.auricSet = true;
player.crimsonRegen = true; // Inherited from Bloodflare
modPlayer.ammoCost *= SetBonusAmmoReduction;
if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID))
modPlayer.DeferredDashID = GodslayerArmorDash.ID;
@@ -21,6 +21,7 @@ namespace CalamityMod.Items.Armor.Bloodflare
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent());
// Set Bonus
public static float SetBonusAmmoReduction = 0.75f;
public static int SoulCooldown = CalamityUtils.SecondsToFrames(30);
public static int SoulDamage = 300;
public static int SoulAmount = 16;
@@ -44,9 +45,10 @@ namespace CalamityMod.Items.Armor.Bloodflare
public override void UpdateArmorSet(Player player)
{
var modPlayer = player.Calamity();
modPlayer.ammoCost *= SetBonusAmmoReduction;
modPlayer.bloodflareSet = true;
modPlayer.bloodflareRanged = true;
player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey(), SoulCooldown.FramesToSeconds(), BloodBombCooldown.FramesToSeconds());
player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey(), SoulCooldown.FramesToSeconds(), BloodBombCooldown.FramesToSeconds(), (1f - SetBonusAmmoReduction).ToPercent());
player.crimsonRegen = true;
}
@@ -16,10 +16,11 @@ namespace CalamityMod.Items.Armor.Demonshade
public string FrontArmTexture => "CalamityMod/Items/Armor/Demonshade/DemonshadeBreastplate_Arms";
public static int MaxManaBoost = 200;
public static float AmmoReduction = 0.7f;
public static float DamageBoost = 0.15f;
public static int CritBoost = 15; // NOTE: Tooltip shares this number with damage % as they're equal
public static float MeleeSpeedBoost = 0.25f;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, DamageBoost.ToPercent(), MeleeSpeedBoost.ToPercent());
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, DamageBoost.ToPercent(), MeleeSpeedBoost.ToPercent(), (1f - AmmoReduction).ToPercent());
public override void SetDefaults()
{
@@ -35,6 +36,7 @@ namespace CalamityMod.Items.Armor.Demonshade
{
var modPlayer = player.Calamity();
modPlayer.shadeRegen = true;
modPlayer.ammoCost *= AmmoReduction;
player.statManaMax2 += MaxManaBoost;
player.GetDamage<GenericDamageClass>() += DamageBoost;
player.GetCritChance<GenericDamageClass>() += CritBoost;
+1
View File
@@ -28,6 +28,7 @@ namespace CalamityMod.Items.Armor.GemTech
public const float MeleeSpeedBoost = 0.26f;
public const int MaxFlechettes = 8;
public static float RangedAmmoReduction = 0.7f;
public const float RangedDamageBoost = 0.5f;
public const float RangedCritBoost = 0.16f;
+3 -1
View File
@@ -21,6 +21,7 @@ namespace CalamityMod.Items.Armor.GodSlayer
// Set Bonus
public static int ShrapnelRoundCooldown = CalamityUtils.SecondsToFrames(2.5f);
public static float SetBonusAmmoReduction = 0.7f;
public static double ShrapnelRoundDamageRatio = 1D;
public static int ShrapnelRoundDamageSoftcap = 800;
@@ -40,10 +41,11 @@ namespace CalamityMod.Items.Armor.GodSlayer
public override void UpdateArmorSet(Player player)
{
var modPlayer = player.Calamity();
modPlayer.ammoCost *= SetBonusAmmoReduction;
modPlayer.godSlayer = true;
modPlayer.godSlayerRanged = true;
var hotkey = CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString();
player.setBonus = this.GetLocalization("SetBonus").Format(ShrapnelRoundCooldown.FramesToSeconds(), hotkey, GodSlayerChestplate.DashCooldown.FramesToSeconds());
player.setBonus = this.GetLocalization("SetBonus").Format(ShrapnelRoundCooldown.FramesToSeconds(), hotkey, GodSlayerChestplate.DashCooldown.FramesToSeconds(), (1f - SetBonusAmmoReduction).ToPercent());
if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID))
{
+3 -1
View File
@@ -14,9 +14,10 @@ namespace CalamityMod.Items.Armor.OmegaBlue
{
public new string LocalizationCategory => "Items.Armor.PostMoonLord";
public static float AmmoReduction = 0.75f;
public static float DamageBoost = 0.18f;
public static int CritBoost = 12;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost);
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost, (1f - AmmoReduction).ToPercent());
public override void SetStaticDefaults()
{
@@ -43,6 +44,7 @@ namespace CalamityMod.Items.Armor.OmegaBlue
var modPlayer = player.Calamity();
player.GetDamage<GenericDamageClass>() += DamageBoost;
player.GetCritChance<GenericDamageClass>() += CritBoost;
modPlayer.ammoCost *= AmmoReduction;
modPlayer.omegaBlueChestplate = true;
modPlayer.noLifeRegen = true;
}
+3 -1
View File
@@ -20,6 +20,7 @@ namespace CalamityMod.Items.Armor.Tarragon
// Set Bonus
public static int OnHitEffectCooldown = CalamityUtils.SecondsToFrames(1);
public static float SetBonusAmmoReduction = 0.75f;
public static float LeafDamageRatio = 0.25f;
public static int LeafDamageSoftcap = 150;
public static float EnergyDamageRatio = 0.33f;
@@ -45,9 +46,10 @@ namespace CalamityMod.Items.Armor.Tarragon
public override void UpdateArmorSet(Player player)
{
var modPlayer = player.Calamity();
modPlayer.ammoCost *= SetBonusAmmoReduction;
modPlayer.tarraSet = true;
modPlayer.tarraRanged = true;
player.setBonus = this.GetLocalizedValue("SetBonus");
player.setBonus = this.GetLocalization("SetBonus").Format((1f - SetBonusAmmoReduction).ToPercent());
}
public override void UpdateEquip(Player player)
+7
View File
@@ -47,6 +47,13 @@ namespace CalamityMod.Items.Weapons.Ranged
return false;
}
public override bool CanConsumeAmmo(Item ammo, Player player)
{
if (Main.rand.Next(0, 100) < 67)
return true;
return false;
}
public override void AddRecipes()
{
CreateRecipe().
+7
View File
@@ -71,5 +71,12 @@ namespace CalamityMod.Items.Weapons.Ranged
}
return false;
}
public override bool CanConsumeAmmo(Item ammo, Player player)
{
if (Main.rand.Next(0, 100) < 50)
return true;
return false;
}
}
}
+3 -1
View File
@@ -67,12 +67,14 @@ namespace CalamityMod.Items.Weapons.Ranged
}
return false;
}
public override bool CanConsumeAmmo(Item ammo, Player player)
{
if (Main.rand.Next(0, 100) > 80 && SineCounter % 4 == 0)
if (Main.rand.Next(0, 100) < 20 && SineCounter % 4 == 0)
return true;
return false;
}
public override void AddRecipes()
{
CreateRecipe().
@@ -12,6 +12,7 @@ DoubleTapDown: Double tap {0}
// Miscellaneous stats/info
AggroBoost: Enemies are more likely to target you
AggroReduction: Enemies are less likely to target you
AmmoUseReduction: "{0}% chance to save ammo"
KnockbackImmunity: Grants immunity to knockback
AbyssLightLevel1: Provides a small amount of light in the abyss
AbyssLightLevel2: Provides a moderate amount of light in the abyss
@@ -4,6 +4,7 @@ AstralBreastplate: {
'''
{$CommonItemTooltip.IncreasesMaxManaBy}
{$CommonItemTooltip.PercentIncreasedDamage@1}
{$Common.AmmoUseReduction@2}
'''
}
@@ -18,6 +18,7 @@ AuricTeslaHeadRanged: {
Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedDamage} and {$CommonItemTooltip.PercentIncreasedRangedCritChance@1}"
SetBonus:
'''
{$Common.AmmoUseReduction@0}
Ranged Tarragon, Bloodflare and God Slayer armor effects
Hold Shift to view these set bonus details and press Shift repeatedly to cycle through them
'''
@@ -221,6 +222,7 @@ BloodflareHeadRanged: {
SetBonus: "{$BloodflareHeadRanged.SetBonusEffect}"
SetBonusEffect:
'''
{$Common.AmmoUseReduction@3}
{0} to unleash the lost souls of polterghast to destroy your enemies
This effect has a {1} second cooldown
Ranged weapons fire bloodsplosion orbs every {2} seconds
@@ -277,6 +279,7 @@ DemonshadeBreastplate: {
{$CommonItemTooltip.IncreasesMaxManaBy}
{$CommonItemTooltip.PercentIncreasedDamageCritChance@1}
{$CommonItemTooltip.PercentIncreasedMeleeSpeed@2}
{$Common.AmmoUseReduction@3}
Standing still absorbs shadows to grant exponentially accelerating life regen
'''
}
@@ -447,6 +450,7 @@ GodSlayerHeadRanged: {
SetBonus: "{$GodSlayerHeadRanged.SetBonusEffect}"
SetBonusEffect:
'''
{$Common.AmmoUseReduction@3}
Ranged weapons fire a god killer shrapnel round every {0} seconds
{$GodSlayerChestplate.CommonSetBonus@1}
'''
@@ -486,6 +490,7 @@ OmegaBlueChestplate: {
Tooltip:
'''
{$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1}
{$Common.AmmoUseReduction@2}
Your attacks inflict Hadopelagic Pressure
No positive life regen
'''
@@ -668,6 +673,7 @@ TarragonHeadRanged: {
SetBonus: "{$TarragonHeadRanged.SetBonusEffect}"
SetBonusEffect:
'''
{$Common.AmmoUseReduction@0}
Ranged projectiles spawn homing life energy and leaves on enemy hits
{$TarragonBreastplate.CommonSetBonus}
'''
@@ -126,7 +126,11 @@ AstralBlaster: {
AstrealDefeat: {
DisplayName: Astreal Defeat
Tooltip: All arrows are converted to Astreal Arrows that emit flames as they travel
Tooltip:
'''
All arrows are converted to Astreal Arrows that emit flames as they travel
33% chance to save ammo
'''
}
Auralis: {
@@ -210,6 +214,7 @@ BlossomFlux: {
'''
Fires a stream of leaves
Press <right> to fire a spore orb that explodes into a cloud of spore gas
50% chance to save ammo
'''
LegendaryText:
'''
@@ -635,6 +640,7 @@ Infinity: {
'''
Fires a twin stream of energy bolts that split
Press <right> to fire a barrage of normal bullets
80% chance to save ammo
'They say infinity is neverending, yet you hold it in your hands'
'''
}
@@ -1127,6 +1133,7 @@ Shredder: {
'''
Fires a barrage of energy bolts that split and bounce
Press <right> to fire a barrage of normal bullets instead
60% chance to save ammo
'The myth, the legend, the weapon that drops more frames than any other'
'''
}