Grimmys / rpg_tactical_fantasy_game

A tactical turn-based game project in pygame, open to support
GNU General Public License v3.0
394 stars 85 forks source link

AttributeError during enemy turn #11

Closed talljosh closed 3 years ago

talljosh commented 3 years ago

During level 2, when the enemy was attacking and possibly killing one of my characters, I got this traceback:

Traceback (most recent call last):
  File "main.py", line 57, in <module>
    start_screen.update_state()
  File "/home/josh/Downloads/games/rpg_tactical_fantasy_game/src/StartScreen.py", line 112, in update_state
    status = self.level.update_state()
  File "/home/josh/Downloads/games/rpg_tactical_fantasy_game/src/Level.py", line 286, in update_state
    self.entity_action(ent, (self.side_turn is EntityTurn.ALLIES))
  File "/home/josh/Downloads/games/rpg_tactical_fantasy_game/src/Level.py", line 707, in entity_action
    self.duel(ent, ent_attacked, allies, targets, ent.attack_kind)
  File "/home/josh/Downloads/games/rpg_tactical_fantasy_game/src/Level.py", line 642, in duel
    xp += target.xp_gain
AttributeError: 'Player' object has no attribute 'xp_gain'
Grimmys commented 3 years ago

Hi, this was a mistake ; xp should not be increased when the attacker is an ennemy. Thank you for the issue, I think it's fixed now.