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

Implement initiative ranking command #7

Merged
merged 5 commits into from
Aug 7, 2023
Merged

Implement initiative ranking command #7

merged 5 commits into from
Aug 7, 2023

Conversation

Yochien
Copy link
Owner

@Yochien Yochien commented Aug 7, 2023

The following commits create an initial implementation of the initiative/ranking command.

Simplifying the program's main loop was done to make it easier to sort NPCs by rank in the future.

The rank field is meant as a generic stand-in for the table top concept of initiative. This includes two values so that the rank can be temporarily modified by status effects or death and be restored to its original value when these effects pass.
Implements a basic ranking system for NPCs in which a higher value places them higher in their listing.

This command might require displaying output once it finishes since it could be hard to visualize how it would affect the current list.
This change is made in preparation for sorting the encounter list after every command. This could be potentially wasteful, but would also ensure NPC ranking is always up to date.

This new change excludes empty inputs from processing allowing for some trimmed down code branching.

This code also provides a soft error message in the case the user provides some input that is visually empty, i.e. all whitespace or entirely empty, by changing the command prompt back to its longer form.
Should allow github's test runners to run properly again.
@Yochien Yochien merged commit e4b9f64 into dev Aug 7, 2023
6 checks passed
@Yochien Yochien deleted the initiative-command branch August 7, 2023 01:38
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.

None yet

1 participant