Repository navigation
Conversation
…gic out of the way and then do a second pass
… just the key name
…it's DRY but at least I'm having fun and being myself
… done, bouncing around all three
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.
@sttbtt
room.pybased on what you see inadv.py.player.py.item.pyand add anItemclass in there.nameanddescriptionattributes.Roomclass should be extended with alistthat holds theItems that are currently in that room.Items to the player's inventory. The inventory can also be alistof items "in" the player, similar to howItems can be in aRoom.verbsuch as "n" or "q". But now we want to add the form:verbobjectsuch as "take coins" or "drop sword".getfollowed by anItemname. This will be used to pick upItems.getortakefollowed by anItemname, look at the contents of the currentRoomto see if the item is there.Roomcontents, and add it to thePlayercontents.on_takemethod toItem.Itemis picked up by the player.Itemcan use this to run additional code when it is picked up.on_dropmethod toItem. Implement it similar toon_take.dropfollowed by anItemname. This is the opposite ofget/take.iandinventorycommands that both show a list of items currently carried by the player.