Descriptive Ranged Tools & Reserved Ammo Display

If you liked this item, please rate it up on Steam Workshop page.

Author: Thiena

Last revision: 11 Apr, 2025 at 13:31 UTC

File size: 111 KB

On Steam Workshop

Description:
General Info
  • Displays the more important calculations/modifiers/sockets a Ranged Weapon (Bow/Crossbow/Gun/Cane) has in the Tooltip — because some level calculations aren’t as linear.
  • If the weapon is on your hotbar, displays the amount of Reserved Ammo in your inventory; so you don’t accidentally get caught with your pants down when you just found out when you ran out of ammo. Also is shown on your allies’ firearms and their own inventories.

This mod does not change any formulas or gameplay — and is purely informative.
This mod also assumes that there is no update or mod that affects the formulas (otherwise this would have inaccurate information).


Nerd Stuff

‘ight this one is spoilers because it’s the source-code or formulas so heads-up.
Descriptive Ranged Tools modifies Trait.cs and checks if the Thing/Item is of a TraitToolRanged before writing in its UINote.
Reserved Ammo modifies TraitToolRanged.cs and changes the string where the current and max ammo is displayed.

Once again, the mod changes to the tooltip assumes that there is no update or mod that affects the formulas.
I also tried to hide irrelevant information, such as resistances, flat DMG/ACC modifiers (it is already on the tooltip), etc.
A lot of it comes from referencing AttackProcess.cs and ActRanged.cs. If you know where to look, you can use it as a reference for yourself.

The below info is information I think that isn’t as easily self-explanatory.

Rapid Fire

There is a chance to fire an extra projectile; each 10 levels is a guaranteed amount with an extra projectile after that.
There is damage reduction after each shot, that formula is as follows:

num = num * 100 / (100 + (count – numFireWithoutDamageLoss + 1) * 30);

The total damage on the tooltip gives a rough estimate of all the projectiles landing (including the one having a chance of firing) with the damage reduction for each arrow. This assumes there is no damage reduction on the opposing target (They probably will have damage reduction).

This also takes into account of Assault Rifle’s innate multi-shot. I’m pretty sure it’s accurate.
This tooltip does not take into account if the user has Boost or Rapid Fire related feats.

Knockback

Formula per projectile(?) is:

num3 > 0 && num3 * 2 + 15 > EClass.rnd(100)

num3 being the level of your Knockback Modifier.

Ammo Recovery

The chance to not consume ammo is:

Mathf.Sqrt(num4) * 5f + 10f > (float)EClass.rnd(100)

num4 being the level of your Ammo Recovery Modifier. It’s Square-rooted so it’ll be difficult to get a 100% (not impossible).

Sharpshooter

I have no idea how to word this: it minimizes the penalty, aka a (negative) damage multiplier, if you’re not shooting at the optimal range your weapon has.

distMod = Mathf.Max(115 – 10 * Mathf.Abs(num – toolRange.BestDist) * 100 / (100 + weapon.Evalue(605) * 10), 80);

distMod is then used for Damage and Accuracy Modifiers.

In the tooltip mod, I used (referring to the later half of the above code):

100 * 100 / (100 + (value * 10)

Where value is the level of Sharpshooter. This final value from the formula then subtracts from 100.
I decided that the higher level you have of this -> going upwards to 100%, means you’re more effective and mitigate the penalty. Each 10 levels reduces the penalty to 1/2, 1/3, etc. of how much its supposed to penalize you by.
Felt intuitive for the value in tooltip to go up compared to the value going backwards, but correct me if I’m wrong.

Banes

Each level of bane increases the total damage by 3%. If it’s an All Bane, then that bonus is half: 1.5%
These banes are totaled and summed together.

Drill/Scatter

Literally just the default included level/value… I don’t think there was an intuitive way to describe this but it was included by default.


Config

You can arrange how the Reserved Ammo is displayed by going to:
ElinBepInExconfigThiena.Mods.ElinReservedAmmo.cfg and adjusting it with the instructions there. A friend of mine says to use "C/R" if you want to try that for yourself.
I gave up on making a dedicated Mod-Config page so maybe later.


Author’s Personal Note

It originally started off as just trying to show the Reserved Ammo (because I got caught running out of ammo once), but it eventually expanded to me wanted to show the stats on weapons. Figured it was better as a package deal.
I’m not personally sure how this works with "Melee with Ammo"-type weapons, such as Gunlance or Zephir’s Wrath — mostly because I don’t use them. Let me know if it works as expected though.
I’m aware there’s some UI Bugs (the code was not being very friendly when I originally tried transpiling the Thing.cs file) but it doesn’t affect gameplay, lol.
Feel free to comment about what changes might be needed (settings or if a certain modification on the ranged weapon isn’t shown and you would like it to be), or bugged UI/Misinfomation I missed.

Donations are appreciated at Ko-Fi[ko-fi.com], but take care of yourself first.