gold hand return
This commit is contained in:
1 parent
300538ea03
commit
51eebb5be2
2 files changed
+19
-1
No files matched your search
@@ -19,15 +19,32 @@ namespace CalamityMod.Items.VanillaArmorChanges
|
||||
|
||||
public const float GoldDropChanceFromEnemies = 0.02f;
|
||||
public const int GoldFromBosses = 3;
|
||||
public const float SetBonusCritPerGoldCoin = 0.2f; // 5 gold coins = +1% crit chance
|
||||
public const float MaximumCritBonus = 5f;
|
||||
|
||||
public override void UpdateSetBonusText(ref string setBonusText)
|
||||
{
|
||||
setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(GoldDropChanceFromEnemies.ToPercent(), GoldFromBosses)}";
|
||||
setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(GoldDropChanceFromEnemies.ToPercent(), GoldFromBosses, SetBonusCritPerGoldCoin, MaximumCritBonus)}";
|
||||
}
|
||||
|
||||
public override void ApplyArmorSetBonus(Player player)
|
||||
{
|
||||
player.Calamity().goldArmorGoldDrops = true;
|
||||
float critFromGold;
|
||||
|
||||
// Give the crit chance from gold in inventory.
|
||||
// If you have any platinum, this guarantees the max boost.
|
||||
if (player.InventoryHas(ItemID.PlatinumCoin))
|
||||
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, 90);
|
||||
critFromGold = Math.Min(goldCoins * SetBonusCritPerGoldCoin, MaximumCritBonus);
|
||||
}
|
||||
|
||||
player.GetCritChance<GenericDamageClass>() += critFromGold;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,6 +67,7 @@ SetBonus: {
|
||||
'''
|
||||
All enemies have a {0}% chance to drop 1 extra gold
|
||||
All bosses drop {1} extra gold
|
||||
You gain {2}% critical strike chance for every gold in your inventory, capped at {3}%
|
||||
'''
|
||||
Iron: Multiplies all player-inflicted knockback by {0}x
|
||||
Jungle: 10% reduced mana costs
|
||||
|
||||
Reference in new issue
Block a user