コード例 #1
0
/**
 * @brief Checks whether a jump is exit-only.
 *
 * @usage if jump.exitonly("Eneguoz", "Zied") then -- The jump point in Eneguoz cannot be entered.
 *    @luaparam j Jump to get the exit-only status of.
 *    @luareturn Whether the jump is exit-only.
 * @luafunc exitonly( j )
 */
static int jumpL_exitonly( lua_State *L )
{
   JumpPoint *jp;
   jp = luaL_validjump(L,1);
   lua_pushboolean(L, jp_isFlag(jp, JP_EXITONLY) );
   return 1;
}
コード例 #2
0
/**
 * @brief Checks whether a jump is hidden.
 *
 * @usage if not j:hidden() then -- Exclude hidden jumps.
 *    @luaparam j Jump to get the hidden status of.
 *    @luareturn Whether the jump is hidden.
 * @luafunc hidden( j )
 */
static int jumpL_hidden( lua_State *L )
{
   JumpPoint *jp;
   jp = luaL_validjump(L,1);
   lua_pushboolean(L, jp_isFlag(jp, JP_HIDDEN) );
   return 1;
}
コード例 #3
0
/**
 * @brief Gets the position of the jump in the system.
 *
 * @usage v = j:pos()
 *    @luaparam j Jump to get the position of.
 *    @luareturn The position of the jump in the system as a vec2.
 * @luafunc pos( j )
 */
static int jumpL_position( lua_State *L )
{
   JumpPoint *jp;
   jp = luaL_validjump(L,1);
   lua_pushvector(L, jp->pos);
   return 1;
}
コード例 #4
0
/**
 * @brief Checks to see if a jump is known by the player.
 *
 * @usage b = j:known()
 *
 *    @luaparam s Jump to check if the player knows.
 *    @luareturn true if the player knows the jump.
 * @luafunc known( j )
 */
static int jumpL_isKnown( lua_State *L )
{
   JumpPoint *jp;

   jp = luaL_validjump(L,1);
   lua_pushboolean(L, jp_isKnown(jp));
   return 1;
}
コード例 #5
0
/**
 * @brief Gets the system that a jump point exits into.
 *
 * @usage v = j:dest()
 *    @luaparam j Jump to get the destination of.
 *    @luareturn The jump's destination system.
 * @luafunc dest( j )
 */
static int jumpL_dest( lua_State *L )
{
   JumpPoint *jp;

   jp = luaL_validjump(L,1);
   lua_pushsystem(L,jp->targetid);
   return 1;
}
コード例 #6
0
/**
 * @brief Gets the angle of a jump in degrees.
 *
 * @usage v = j:angle()
 *    @luaparam j Jump to get the angle of.
 *    @luareturn The angle.
 * @luafunc angle( j )
 */
static int jumpL_angle( lua_State *L )
{
   JumpPoint *jp;

   jp = luaL_validjump(L,1);
   lua_pushnumber(L, jp->angle * 180. / M_PI);
   return 1;
}
コード例 #7
0
ファイル: nlua_jump.c プロジェクト: BariumBlue/naev
/**
 * @brief Gets the position of the jump in the system.
 *
 * @usage v = j:pos()
 *    @luaparam j Jump to get the position of.
 *    @luareturn The position of the jump in the system as a vec2.
 * @luafunc pos( j )
 */
static int jumpL_position( lua_State *L )
{
   JumpPoint *jp;
   LuaVector v;
   jp = luaL_validjump(L,1);
   vectcpy(&v.vec, &jp->pos);
   lua_pushvector(L, v);
   return 1;
}
コード例 #8
0
ファイル: nlua_jump.c プロジェクト: BariumBlue/naev
/**
 * @brief Gets the system that a jump point exits into.
 *
 * @usage v = j:dest()
 *    @luaparam j Jump to get the destination of.
 *    @luareturn The jump's destination system.
 * @luafunc dest( j )
 */
static int jumpL_dest( lua_State *L )
{
   JumpPoint *jp;
   LuaSystem ls;

   jp = luaL_validjump(L,1);
   ls.id = jp->targetid;
   lua_pushsystem(L,ls);
   return 1;
}