def _refresh(self): if self.dead or not attributes.need_refresh(self): unregister(self._refresh_pulse) del self._refresh_pulse return for pool_id, base_pool_id in attributes.pool_keys: new_value = getattr(self, pool_id) + refresh_rates[pool_id] setattr(self, pool_id, min(new_value, getattr(self, base_pool_id))) self.status_change() self.check_fight()
def start_refresh(self): if not self._refresh_pulse and attributes.need_refresh(self): self._refresh_pulse = register_p(self._refresh, pulses=refresh_interval)