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

Fix - Out of ammo hint to use Ammo name #279

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

niefia
Copy link
Collaborator

@niefia niefia commented Sep 19, 2024

Noticed that there was a hint message saying "Flashlight is out of ammo", came up with this as a way to avoid that. This fix makes it now say "Flashlight is out of Battery"

Downside is that it may be too verbose to use full ammo name sometimes, If we want to avoid that could introduce shortened name property to use in places like this.

Alternatively could attempt to shorten name automatically, maybe something like this:

if equipped_wieldable_item.charge_current == 0:
		# If the wieldable is a type of ammo or bullet, shorten to just ammo, to avoid saying things like "Laser Ammo"
		if equipped_wieldable_item.ammo_item_name.to_lower().find("ammo") != -1 or equipped_wieldable_item.ammo_item_name.to_lower().find("bullet") != -1:
			send_hint(null, equipped_wieldable_item.name + " is out of ammo")
		else:
			send_hint(null, equipped_wieldable_item.name + " is out of " + equipped_wieldable_item.ammo_item_name)

Noticed that there was a hint message saying "Flashlight is out of ammo", came up with this as a way to avoid that.
This fix makes it now say "Flashlight is out of Battery"
Copy link
Owner

@Phazorknight Phazorknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

I'll merge this in, but wanted to give a heads up that I want to change how wieldables are checking for ammo a bit in general as it currently triggers too often. Also would love for wieldables to offer bespoke behavior when out of ammo (like a hollow click when trying to fire a gun that's empty)

@Phazorknight Phazorknight merged commit de4c235 into Phazorknight:main Sep 19, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants