tModLoader Chance to not Consume Ammo?

How do i add a Chance to not Consume ammo to an Weapon and an Armor/Accessoir?
If you use one of the vanilla flags, such as player.ammoCost75 = true or player.ammoCost80 = true in the UpdateEquip, that would be the easiest. For a more specific percentage, you'll need to make your own bool in a ModPlayer, set the bool in UpdateEquip, and use the ConsumeAmmo hook in ModPlayer to reduce with a chance.
 
If you use one of the vanilla flags, such as player.ammoCost75 = true or player.ammoCost80 = true in the UpdateEquip, that would be the easiest. For a more specific percentage, you'll need to make your own bool in a ModPlayer, set the bool in UpdateEquip, and use the ConsumeAmmo hook in ModPlayer to reduce with a chance.
How much % is ammoCost75 and 80?
 
If you use one of the vanilla flags, such as player.ammoCost75 = true or player.ammoCost80 = true in the UpdateEquip, that would be the easiest. For a more specific percentage, you'll need to make your own bool in a ModPlayer, set the bool in UpdateEquip, and use the ConsumeAmmo hook in ModPlayer to reduce with a chance.
This is exactly what I was looking for. But instead, I'm quite new to coding. Could you able to show how you do that? (Creating a set bonus of 100% Chance not to consume ammo)
 
Back
Top Bottom