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

Command polish #8

Merged
merged 20 commits into from
Aug 7, 2023
Merged

Command polish #8

merged 20 commits into from
Aug 7, 2023

Conversation

Yochien
Copy link
Owner

@Yochien Yochien commented Aug 7, 2023

This merge improves the following commands:

  • Load: utilizes YAML format for input
  • Status: improved description
  • Nickname: added aliases
  • Rank: Allow removing rank and maintaining state modifications after death
  • Add: implement all selector
  • Heal: Display output only when relevant

Consistently use double quotes throughout code.
Removes some unnecessary and confusing nesting based around validating command arguments.
Reflects the commands ability to display status for multiple NPCs.
Removing continue makes following the flow of control of the main loop more obvious.
Use numbers 0 or below to reset NPC rank. Bounds all negative ranks to 0, so all negative values have the same ranking as 0.

The distinction between ranked or not could help establish which NPCs are active in the encounter or not.
This commit makes it more clear what the final output should look like and why.
Minor stylistic changes in preparation for changing rank command behavior.
Uses the YAML file format instead of a home grown CSV format. This allows for use of the robust PyYAML parser for loading objects from a file.

This commit also performs some basic error checking to keep the program from hard crashing when encountering some kind of syntactical error in the provided YAML file.
This commit implements the all selector for the add command. This commit also provides better error messages in the case the user provides a non integer for a selector index.
No longer needed after modifying load behavior.
Gives an indication of load status success automatically.
This method did not need to differ per instance and did not rely on any class attributes.
This behavior regressed after rewrite of NPC.__str__
The NPC.__str__ method used for displaying NPCs in menus is somewhat simplified by hiding NPC base type if the NPC has a nickname.

The status command now reveals the NPC base type and note details.
Sorts list after every operation meaning ordering can be maintained if other commands cause side effects that change the overall NPC ordering.
Effective rank is set to 0 on death. Rank can be edited after death. Effective rank will be restored on revive.
@Yochien Yochien merged commit 6c103b4 into dev Aug 7, 2023
6 checks 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.

None yet

1 participant