The following are the files:
https://pastebin.com/4EyFEGxi - game.py # Define player and his set of actions
https://pastebin.com/BSpBB7De - main.py # A RPG Battle script where players and enemies fight each other
https://pastebin.com/uUpd5rnm - inventory.py # Items which can be used only by the players and not the enemies
https://pastebin.com/NP31VP1X - magic.py # Spells which can be used by both the players and the enemies
When I run the main.py, I get the following error after attacking for a few times:
I'm a novice and want to understand programming better.
Thanks for the help in advance
https://pastebin.com/4EyFEGxi - game.py # Define player and his set of actions
https://pastebin.com/BSpBB7De - main.py # A RPG Battle script where players and enemies fight each other
https://pastebin.com/uUpd5rnm - inventory.py # Items which can be used only by the players and not the enemies
https://pastebin.com/NP31VP1X - magic.py # Spells which can be used by both the players and the enemies
When I run the main.py, I get the following error after attacking for a few times:
Error:Traceback (most recent call last):
File "E:/Battle/main.py", line 190, in <module>
Players[target].take_dm(magic_dm)
File "E:\Battle\Classes\Game.py", line 34, in take_dm
self.hp -= dm
TypeError: unsupported operand type(s) for -=: 'int' and 'NoneType'
And I also want to know if all the functions in the main program are working as they are supposed to be.I'm a novice and want to understand programming better.
Thanks for the help in advance
