Example #1
0
 def copy(self):
     if (len(self.master.frames)):
         prev = self.master.frames[-1].creature
         if (type(prev) is monster):
             util.replaceEntry(self.name, prev.name)
             util.replaceEntry(self.ac, prev.AC)
             util.replaceEntry(self.hp, prev.HD)
             #replaceEntry(self.xp,prev.XP)
             for i in range(6):
                 util.replaceEntry(self.entries[i], prev.abilities[i])
Example #2
0
 def changeHP(self, totemp=False):
     amount = r.call(self.amount.get())
     h = int(self.current.get())
     t = int(self.temp.get())
     m = int(self.max.get())
     if (totemp):
         t += amount
     else:
         if (amount < 0):
             if (abs(amount) > t):
                 amount += t
                 t = 0
                 h += amount
             else:
                 t += amount
         else:
             h += amount
             h = m if h > m else h
     util.replaceEntry(self.temp, str(t))
     util.replaceEntry(self.current, str(h))
Example #3
0
 def populateFromConfig(self, data):
     util.replaceEntry(self.max, data['max HP'])
     util.replaceEntry(self.current, data['HP'])
     util.replaceEntry(self.temp, data['temp HP'])
Example #4
0
 def populateFromConfig(self, data):
     names = ['str', 'dex', 'con', 'int', 'wis', 'cha']
     for (i, name) in enumerate(names):
         util.replaceEntry(self.entries[i], data[name])
Example #5
0
 def populateFromConfig(self, data):
     util.replaceEntry(self.level, data['level'])
     util.replaceEntry(self.casterLevel, data['caster level'])
     util.replaceEntry(self.Class, data['class'])
Example #6
0
 def populateFromConfig(self, data):
     util.replaceEntry(self.name, data['Character']['name'])
     util.replaceEntry(self.level, data['Character']['level'])
     util.replaceEntry(self.casterlevel, data['Character']['caster level'])
     util.replaceEntry(self.Class, data['Character']['class'])
     util.replaceEntry(self.maxhp, data['HP']['max hp'])