Beispiel #1
0
/**
 * @brief Have a pilot order it's escorts to dock.
 *
 *    @param parent Pilot giving the order.
 */
int escorts_return( Pilot *parent )
{
   int ret;
   ret = escort_command( parent, ESCORT_RETURN, -1 );
   if ((ret == 0) && (parent == player))
      player_message("Escorts: Returning to ship.");
   return ret;
}
Beispiel #2
0
/**
 * @brief Have a pilot order it's escorts to clear orders.
 *
 *    @param parent Pilot giving the order.
 */
int escorts_clear( Pilot *parent )
{
   int ret;
   ret = escort_command( parent, ESCORT_CLEAR, -1);
   if ((ret == 0) && (parent == player))
      player_message("Escorts: Clearing orders.");
   return ret;
}
Beispiel #3
0
/**
 * @brief Have a pilot order its escorts to clear orders.
 *
 *    @param parent Pilot giving the order.
 */
int escorts_clear( Pilot *parent )
{
   int ret;
   ret = escort_command( parent, "e_clear", 0 );
   if ((ret == 0) && (parent == player.p))
      player_message(_("\agEscorts: \a0Clearing orders."));
   return ret;
}
Beispiel #4
0
/**
 * @brief Have a pilot order it's escorts to hold position.
 *
 *    @param parent Pilot giving the order.
 */
int escorts_hold( Pilot *parent )
{
   int ret;
   ret = escort_command( parent, ESCORT_HOLD, -1 );
   if ((ret == 0) && (parent == player))
         player_message("Escorts: Holding position.");
   return ret;
}
Beispiel #5
0
/**
 * @brief Have a pilot order its escorts to dock.
 *
 *    @param parent Pilot giving the order.
 */
int escorts_return( Pilot *parent )
{
   int ret;
   ret = escort_command( parent, "e_return", 0 );
   if ((ret == 0) && (parent == player.p))
      player_message(_("\agEscorts: \a0Returning to ship."));
   return ret;
}
Beispiel #6
0
/**
 * @brief Have a pilot order its escorts to hold position.
 *
 *    @param parent Pilot giving the order.
 */
int escorts_hold( Pilot *parent )
{
   int ret;
   ret = escort_command( parent, "e_hold", 0 );
   if ((ret == 0) && (parent == player.p))
         player_message(_("\agEscorts: \a0Holding position."));
   return ret;
}
Beispiel #7
0
/**
 * @brief Have a pilot order it's escorts to attack it's target.
 *
 *    @param parent Pilot giving the order.
 */
int escorts_attack( Pilot *parent )
{
   int ret;
   Pilot *t;

   ret = 1;
   if (parent->target != parent->id)
      ret = escort_command( parent, ESCORT_ATTACK, parent->target );
   if ((ret == 0) && (parent == player)) {
      t = pilot_get(parent->target);
      if (t != NULL)
         player_message("Escorts: Attacking %s.", t->name);
   }
   return ret;
}
Beispiel #8
0
/**
 * @brief Have a pilot order its escorts to jump.
 *
 *    @param parent Pilot giving the order.
 */
int escorts_jump( Pilot *parent, JumpPoint *jp )
{
   int ret;
   LuaJump lj;

   lj.destid = jp->targetid;
   lj.srcid = cur_system->id;

   lua_pushjump( naevL, lj );
   ret = escort_command( parent, "hyperspace", -1 );
   lua_pop(naevL, 1);

   if ((ret == 0) && (parent == player.p))
      player_message(_("\agEscorts: \a0Jumping."));
   return ret;
}
Beispiel #9
0
/**
 * @brief Have a pilot order its escorts to attack its target.
 *
 *    @param parent Pilot giving the order.
 */
int escorts_attack( Pilot *parent )
{
   int ret;
   Pilot *t;

   /* Avoid killing self. */
   t = pilot_get(parent->target);
   if (t == NULL)
      return 1;
   if (t->faction == parent->faction)
      return 1;

   /* Send command. */
   ret = 1;
   if (parent->target != parent->id) {
      lua_pushpilot(naevL, parent->target);
      ret = escort_command( parent, "e_attack", -1 );
      lua_pop(naevL, 1);
   }
   if ((ret == 0) && (parent == player.p))
      player_message(_("\agEscorts: \a0Attacking %s."), t->name);
   return ret;
}