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

Forbid firing bow when out of stamina, consume stamina after firing #2005

Merged
merged 1 commit into from
Oct 19, 2022

Conversation

olanti-p
Copy link
Contributor

Summary

SUMMARY: Bugfixes "Forbid firing bow when out of stamina, consume stamina after firing"

Purpose of change

Fix couple bugs:

  1. Entering aiming menu with a bow and immediately closing it without doing anything consumes stamina
  2. Starting to aim with a bow when low on stamina would trigger "catching breath" activity, which is frequently not desired when in the heat of a battle
  3. It's possible to draw a bow when out of stamina, making it essentially free in that case
  4. If "catching breath" activity is interrupted, the bow is never unloaded and keeps its arrow

Describe the solution

Move stamina consumption to fire action (after aiming), forbid aiming if not enough stamina to fire.
Removing stamina consumption from do_turn() makes it so stamina stays the same during activity and ACT_WAIT_STAMINA isn't triggered.

Describe alternatives you've considered

Refactoring activity code.

Testing

  1. Repeatedly open and close firing menu when wielding a bow, see stamina does not drain.
  2. Exhaust the character in melee, then try aiming. It now either lets you aim (with penalty to reload time), or outright forbids it.
  3. Wear a few scarves, exhaust stamina, try repeatedly firing bow.
  4. No catching breath activity means there's nothing to interrupt :)

@Coolthulhu Coolthulhu self-assigned this Oct 15, 2022
@Coolthulhu Coolthulhu merged commit c7ffc8d into cataclysmbnteam:upload Oct 19, 2022
@Coolthulhu
Copy link
Member

Works, but the stamina time penalty is not adequately presented to the player. It has to be guessed from passing time.

I realized that aiming and then immediately cancelling consumes time. The hacks, hiding in every other line!

@olanti-p olanti-p deleted the fix-bow-stamina branch October 20, 2022 20:52
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