Don't worry, we'll stop counting at 50! Actually counts to 100 like a boss.
This commit is contained in:
1 parent
01c092ec17
commit
edc00a227e
1 file changed
+7
-3
@@ -1,4 +1,5 @@
|
||||
using System.Text;
|
||||
using System;
|
||||
using System.Text;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -23,6 +24,7 @@ namespace CalamityMod.Items.VanillaArmorChanges
|
||||
public const float GoldDropChanceFromEnemies = 0.04f;
|
||||
public const int GoldFromBosses = 3;
|
||||
public const float SetBonusCritPerGoldCoin = 0.2f; // 5 gold coins = +1% crit chance
|
||||
public const float MaximumCritBonus = 10f;
|
||||
|
||||
public override void ApplyHeadPieceEffect(Player player) => player.GetDamage<GenericDamageClass>() += HeadDamage;
|
||||
|
||||
@@ -43,11 +45,13 @@ namespace CalamityMod.Items.VanillaArmorChanges
|
||||
// Give the crit chance from gold in inventory.
|
||||
// If you have any platinum, this guarantees the max boost.
|
||||
if (player.InventoryHas(ItemID.PlatinumCoin))
|
||||
critFromGold = 10f;
|
||||
critFromGold = MaximumCritBonus;
|
||||
else
|
||||
{
|
||||
// 13FEB2024: Ozzatron: this function doesn't cap at its second argument, it just stops counting if it exceeds that number
|
||||
// so this can give up to 100 gold coins
|
||||
int goldCoins = player.CountItem(ItemID.GoldCoin, 50);
|
||||
critFromGold = goldCoins * SetBonusCritPerGoldCoin;
|
||||
critFromGold = Math.Max(goldCoins * SetBonusCritPerGoldCoin, MaximumCritBonus);
|
||||
}
|
||||
|
||||
player.GetCritChance<GenericDamageClass>() += critFromGold;
|
||||
|
||||
Reference in new issue
Block a user