Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(UI): show ammo per shot for weapons that use it #6013

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

chaosvolt
Copy link
Member

Purpose of change (The Why)

Was suggested I make item UI tell the player when a gun uses more than one ammo per shot, just as it mentions UPS costs.

Describe the solution (The How)

In item.cpp, added a section to item::gun_info that checks if the gun's total ammo per shot is higher than one, and if so prints how many are used per shot.

Describe alternatives you've considered

Screaming.

Testing

  1. Compiled and load-tested.
  2. Spawned in a normal gun, saw it didn't show me ammo per shot info.
  3. Spawned in a flamethrower, it shows 100 ammo per shot.
  4. Installed a nozzle on it, it shows the value change.
  5. Checked affected file for astyle.

image

Additional context

I also wanted to fix reasons-why-you-can't-fire messages printing multiple times when the gun has more than one fire mode but couldn't figure out how.

Checklist

Mandatory

@github-actions github-actions bot added the src changes related to source code. label Jan 30, 2025
@chaosvolt chaosvolt merged commit 496df8f into cataclysmbnteam:main Jan 30, 2025
16 checks passed
@chaosvolt chaosvolt deleted the expand-fwoosh branch January 30, 2025 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants