Couple of fixes and subjective improvements#1
Open
z33ky wants to merge 17 commits into
Open
Conversation
It's quaint to override the sleeps for testing purposes...
print() emits spaces between arguments, which resulted in the first line being off.
Default arguments are passed by reference. The same empty list was thus assigned to both Player and AI inventory and modification to one was visible for the other. This is unintended.
This resulted in random.choice() raising an IndexError if the AI's inventory is empty.
The game does not state that the dealer dies upon losing.
The game mistakenly claimed the player died if the AI dropped to -1 health due to the saw. This fixes the issue.
Buckshot Roulette caps the health. Smoking does not increase health points beyond the maximum.
Like Buckshot Roulette, both players now get an equal amount of items.
Like Buckshot Roulette, add new items on round start to the players' inventories.
It's easier to read/keep track of the items.
The game has less first-mover advantage with fewer items. I don't know the probabilities that Buckshot Roulette uses, but to me it makes sense to make 2 the likeliest, 1 and 3 less likely and 4 the least likely.
Allow direct, more efficient selection of action.
useItem('🔍') will also automatically shoot the gun. On a blank round,
the AI is intended to point the gun towards itself, which works fine. If
a live round is found, the AI is intended to point the gun towards the
player, optionally doubling damage beforehand.
Since `effector` has not been set previously, the AI would shoot itself
with a live round though. This is fixed by passing the player as
`effector` when the AI uses 🔍.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey, I just wanted to notify you about some changes I have made.
Rather than looking at the complete diff it'll be easier to view each commit in isolation. Most commit messages also have justifications for the change, though some "improvements" are certainly just a matter of taste.
Feel free to merge, cherry-pick or outright ignore.
I'm happy to answer questions or address concerns as well.
P.S.: Nifty use of Unicode characters for the items :)