matteoferla/DnD-battler

NameError: name 'N' is not defined

RichardScottOZ opened this issue · 3 comments

image

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_38768/2654407226.py in <module>
      2 level3 = Creature.load('badger') # get from beastiary
      3 arena = Encounter(level2, level3)
----> 4 print(arena.battle())

j:\clone\dnd-battler\DnD_battler\encounter\_action.py in battle(self, reset, verbose)
    128             character.tally['hp'] += character.hp
    129             character.tally['healing_spells'] += character.healing_spells
--> 130         if verbose: self.masterlog.append(str(self))
    131         # return self or side?
    132         return self

j:\clone\dnd-battler\DnD_battler\encounter\_base.py in __str__(self)
     54 
     55     def __str__(self):
---> 56         string = "=" * 50 + ' ' + self.name + " " + "=" * 50 + N
     57         string += self.predict()
     58         string += "-" * 110 + '\n'

NameError: name 'N' is not defined

Given where this is, is the N supposed to be a newline?

I just put in N = "\n" at the start of things and it seemed to be fine.

standardised to "\n"