Output:
our attribute is: fire
You have encountered: Small Fireball (Tier: 0)
Greetings, young mage.
skip tutorial? (y/n)
y
small fireball
You cast: Small Fireball (Tier: 0)
You have mastered Small Fireball (Tier: 0)
Enemy's health remained the same
Opponent cast: Healing Drop (Tier: 0)
Healing Drop backfired!
Health dropped from 110 to 102
Traceback (most recent call last):
File "main.py", line 122, in
castSpell(castedSpell, THE_ENEMY, THE_PLAYER)
File "main.py", line 82, in castSpell
THE_PLAYER.processAttack(spellName, caster)
File "/Users/jonathantan/Desktop/pythonCode/textspellgame/player.py", line 131, in processAttack
attack = self.SPELL_DATA[spellName]["damage"]
KeyError: 'damage'
The error should be about dict with name "spellName" in SPELL_DATA not having key "damage", but the .json file clearly states the "damage".
Output: our attribute is: fire You have encountered: Small Fireball (Tier: 0) Greetings, young mage. skip tutorial? (y/n) y small fireball You cast: Small Fireball (Tier: 0) You have mastered Small Fireball (Tier: 0) Enemy's health remained the same Opponent cast: Healing Drop (Tier: 0) Healing Drop backfired! Health dropped from 110 to 102 Traceback (most recent call last): File "main.py", line 122, in
castSpell(castedSpell, THE_ENEMY, THE_PLAYER)
File "main.py", line 82, in castSpell
THE_PLAYER.processAttack(spellName, caster)
File "/Users/jonathantan/Desktop/pythonCode/textspellgame/player.py", line 131, in processAttack
attack = self.SPELL_DATA[spellName]["damage"]
KeyError: 'damage'
The error should be about dict with name "spellName" in SPELL_DATA not having key "damage", but the .json file clearly states the "damage".