def respawn(self): # Set properties before making it visible. self.state = GameObjectStates.GO_STATE_READY self.respawn_timer = 0 self.respawn_time = randint(self.gobject_instance.spawn_spawntimemin, self.gobject_instance.spawn_spawntimemin) MapManager.respawn_object(self)
def respawn(self): # Set properties before making it visible. self.set_state(GameObjectStates.GO_STATE_READY) self.respawn_timer = 0 self.respawn_time = randint(self.gobject_instance.spawn_spawntimemin, self.gobject_instance.spawn_spawntimemin) if self.gobject_template.type == GameObjectTypes.TYPE_TRAP: self.trap_manager.reset() MapManager.respawn_object(self)
def respawn(self): super().respawn() # Set all property values before making this creature visible. self.location = self.spawn_position.copy() self.set_health(self.max_health) self.set_mana(self.max_power_1) self.loot_manager.clear() self.set_lootable(False) if self.killed_by and self.killed_by.group_manager: self.killed_by.group_manager.clear_looters_for_victim(self) self.killed_by = None self.respawn_timer = 0 self.respawn_time = randint(self.creature_instance.spawntimesecsmin, self.creature_instance.spawntimesecsmax) # Update its cell position if needed (Died far away from spawn location cell) MapManager.update_object(self) # Make this creature visible to its surroundings. MapManager.respawn_object(self)