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])
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))
def populateFromConfig(self, data): util.replaceEntry(self.max, data['max HP']) util.replaceEntry(self.current, data['HP']) util.replaceEntry(self.temp, data['temp HP'])
def populateFromConfig(self, data): names = ['str', 'dex', 'con', 'int', 'wis', 'cha'] for (i, name) in enumerate(names): util.replaceEntry(self.entries[i], data[name])
def populateFromConfig(self, data): util.replaceEntry(self.level, data['level']) util.replaceEntry(self.casterLevel, data['caster level']) util.replaceEntry(self.Class, data['class'])
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'])