+ @defer_to_update
+ def _damage_player(self, world):
+ if not world.roaches:
+ # Skip out if we're already dead
+ return
+ roach = random.choice(world.roaches)
+ roach.health -= self._last_dmg
+ self._last_dmg = 0
+ if roach.health < 0:
+ index = [x.name for x in world.roaches].index(roach.name)
+ world.roaches.pop(index)
+ # We can't check for empty, because updates will be processed later
+ if len(world.roaches) > 1:
+ self._vehicle_changed()
+