@Override
  public MapObject doNextAction(MapEngine engine, double s_elapsed) {
    if (is_cloaked && is_visible && visible_time_left < 0.0) {
      is_visible = false;
    }
    if (shields < 0) {
      return (has_death_spin ? doNextDeathSpinAction(engine, s_elapsed) : handleDeath(engine, s_elapsed));
    }
    previous_turn = (next_action != null ? next_action.turn : TurnDirection.NONE);
    MultipleObject created_objects = new MultipleObject();
    int less_half_shields = half_shields - shields;
    if (less_half_shields > 0 &&
            Math.random() * MIN_TIME_BETWEEN_DAMAGED_EXPLOSIONS < less_half_shields / (half_shields + 1.0) *
                    s_elapsed) {
      created_objects.addObject(createDamagedExplosion());
    }
    created_objects.addObject(super.doNextAction(engine, s_elapsed));
    return created_objects;
  }