From 752977aa94514e8eb42fd0777ee54d42a549bd47 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Fri, 26 Feb 2021 22:53:22 -0500 Subject: [PATCH] take and pick up now work the same --- Adventure Game/adventure_game/Handler.py | 9 +++++---- .../adventure_game/gamedata/world/hallway.yaml | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Adventure Game/adventure_game/Handler.py b/Adventure Game/adventure_game/Handler.py index 3958aed..a40af42 100644 --- a/Adventure Game/adventure_game/Handler.py +++ b/Adventure Game/adventure_game/Handler.py @@ -85,11 +85,12 @@ class Handler(npyscreen.ButtonPress): self.parent.parentApp.log.error('Could not handle {0}, {1}'.format(command, arguments)) self.parent.update_log("You must specify something to look at.") - elif command == 'PICK': + elif command in ['PICK', 'TAKE']: try: - if arguments[0] == 'UP': - if len( - arguments) <= 2: # If there are only 2 args ex:up, item then we dont need to merge that last arg + if arguments[0] == 'UP' or command in ['TAKE']: + if command in ['TAKE']: + arguments = ['UP'] + arguments # This is a messy way to fix take logic vs pick up logic but it works. + if len(arguments) <= 2: # If there are only 2 args ex:up, item then we dont need to merge that last arg try: # Argument[1] is the "thing" you want to pick up, yaml is lowercase so we lowercase it. self.parent.parentApp.log.info('Player tried to pick up {0}'.format(arguments[1])) diff --git a/Adventure Game/adventure_game/gamedata/world/hallway.yaml b/Adventure Game/adventure_game/gamedata/world/hallway.yaml index 21b797c..ea45ce6 100644 --- a/Adventure Game/adventure_game/gamedata/world/hallway.yaml +++ b/Adventure Game/adventure_game/gamedata/world/hallway.yaml @@ -14,7 +14,7 @@ room: look_at: "Its a door, it leads to your office. You should try to |OPEN| it." inspect: "Its ornate but basic, this side of the door has your name on a |plaque|." plaque: - item_name: "Plaque" + item_name: "Office Door Plaque" look_at: "Its a small brass plate, it has your name on it." inspect: "Its still a small brass plate, and it has your name on it. Beyond that its nothing special." pick_up: "You tear off the *PLAQUE*, and now you're stuck with it i guess."