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

V2 - Crash: Buying Anything #22

Open
brando56894 opened this issue Oct 4, 2016 · 2 comments
Open

V2 - Crash: Buying Anything #22

brando56894 opened this issue Oct 4, 2016 · 2 comments
Labels

Comments

@brando56894
Copy link
Owner

I went to buy a rifle and typed 1 and it crashed.

Rifle
--------------
Defense: -5
Strength: 15
Speed: -5
Hands Needed: 2

Cost: 50

Pres Enter To Go Back

How many do you want to buy? 1
Traceback (most recent call last):
  File "main.py", line 132, in <module>
    menu(new_player)
  File "main.py", line 108, in menu
    choices[choice](player)
  File "/home/bran/dungeon-quest/actions.py", line 152, in visit_shop
    visit_shop_section(area, areas[area], player)
  File "/home/bran/dungeon-quest/actions.py", line 176, in visit_shop_section
    visit_shop(player)
  File "/home/bran/dungeon-quest/actions.py", line 152, in visit_shop
    visit_shop_section(area, areas[area], player)
  File "/home/bran/dungeon-quest/actions.py", line 176, in visit_shop_section
    visit_shop(player)
  File "/home/bran/dungeon-quest/actions.py", line 152, in visit_shop
    visit_shop_section(area, areas[area], player)
  File "/home/bran/dungeon-quest/actions.py", line 176, in visit_shop_section
    visit_shop(player)
  File "/home/bran/dungeon-quest/actions.py", line 152, in visit_shop
    visit_shop_section(area, areas[area], player)
  File "/home/bran/dungeon-quest/actions.py", line 181, in visit_shop_section
    area, player)
  File "/home/bran/dungeon-quest/actions.py", line 240, in checkout_item
    visit_shop_section(section, section_dict, player)
  File "/home/bran/dungeon-quest/actions.py", line 181, in visit_shop_section
    area, player)
  File "/home/bran/dungeon-quest/actions.py", line 210, in checkout_item
    section_dict, player, True)
  File "/home/bran/dungeon-quest/actions.py", line 224, in checkout_item
    if amount and player.gold_handle(cost*amount):
  File "/home/bran/dungeon-quest/player.py", line 360, in gold_handle
    self.stat_modifier({"gold", -cost})
  File "/home/bran/dungeon-quest/character.py", line 117, in stat_modifier
    mod = stat_mod[stat]
TypeError: 'set' object has no attribute '__getitem__'
@brando56894 brando56894 added the bug label Oct 4, 2016
@brando56894
Copy link
Owner Author

brando56894 commented Oct 4, 2016

Same thing happens when buying a pistol, and buying Armor.

This one is related but gives a different TypeError: #24

@brando56894 brando56894 changed the title Crash: Buying a rifle Crash: Buying Anything Oct 4, 2016
@ghost ghost self-assigned this Oct 4, 2016
@ghost
Copy link

ghost commented Oct 4, 2016

The problem is the comma between "gold" and -cost. This should be a colon. Adding this fix tto the commit I am currently working on

ghost pushed a commit that referenced this issue Oct 4, 2016
Issue #25, #24, #22, #20, and #19 have all been fixed. To make
1v1 battles less repetitive, the feature brought up in issue #23
has been implemented. Also for dev testing, gold has been preset.
@brando56894 brando56894 changed the title Crash: Buying Anything V2 - Crash: Buying Anything Dec 18, 2016
@brando56894 brando56894 unassigned ghost Dec 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant