def add_wound(self, location=None, damage=0, bleed=0, dmg_type=None): """ Adds wounds to a character, based on damage, bleed, and damage type. """ if damage == 0 and bleed > 0: wound = wounds.BloodlossWound(bleed, self) elif damage > 0: wound = wounds.Wound(location, damage, bleed, dmg_type, self) self.db.wounds.append(wound) new_health = self.db.health - damage self.set_health(new_health) if bleed > 0 and not self.ndb.combat_handler: tickerhandler.add(self, 30, hook_key="at_bleed_tick") if not self.ndb.combat_handler: tickerhandler.add(self, 3600, hook_key="at_heal_tick")
def start_bleed(self): """ Starts the bleed tick. """ tickerhandler.add(self, 30, hook_key="at_bleed_tick")
def start_heal(self): """ Starts the heal tick. """ tickerhandler.add(self, 60 * 60, hook_key="at_heal_tick")