diff --git a/src/k_kart.c b/src/k_kart.c index 39ef34c0..29506a2c 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -6783,7 +6783,7 @@ static void K_drawKartBumpersOrKarma(void) } } -fixed_t K_FindCheckX(fixed_t px, fixed_t py, angle_t ang, fixed_t mx, fixed_t my) +static fixed_t K_FindCheckX(fixed_t px, fixed_t py, angle_t ang, fixed_t mx, fixed_t my) { fixed_t dist, x; fixed_t range = RING_DIST/3; diff --git a/src/k_kart.h b/src/k_kart.h index 67229330..9eaa4186 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -64,7 +64,6 @@ void K_CheckSpectateStatus(void); const char *K_GetItemPatch(UINT8 item, boolean tiny); INT32 K_calcSplitFlags(INT32 snapflags); void K_LoadKartHUDGraphics(void); -fixed_t K_FindCheckX(fixed_t px, fixed_t py, angle_t ang, fixed_t mx, fixed_t my); void K_drawKartHUD(void); void K_drawKartFreePlay(UINT32 flashtime); void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, boolean playing); diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 2238e0d4..bbfc2ae6 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -2211,6 +2211,17 @@ static int lib_kSpawnKartExplosion(lua_State *L) return 0; } +static int lib_kSpawnMineExplosion(lua_State *L) +{ + mobj_t *source = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); + UINT8 color = (UINT8)luaL_checkinteger(L, 2); + NOHUD + if (!source) + return LUA_ErrInvalid(L, "mobj_t"); + K_SpawnMineExplosion(source, color); + return 0; +} + static int lib_kSpawnBoostTrail(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); @@ -2301,6 +2312,59 @@ static int lib_kRepairOrbitChain(lua_State *L) return 0; } +static int lib_kFindJawzTarget(lua_State *L) +{ + mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); + player_t *source = *((player_t **)luaL_checkudata(L, 2, META_PLAYER)); + NOHUD + if (!actor) + return LUA_ErrInvalid(L, "mobj_t"); + if (!source) + return LUA_ErrInvalid(L, "player_t"); + LUA_PushUserdata(L, K_FindJawzTarget(actor, source), META_PLAYER); + return 0; +} + +static int lib_kGetKartDriftSparkValue(lua_State *L) +{ + player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); + NOHUD + if (!player) + return LUA_ErrInvalid(L, "player_t"); + lua_pushfixed(L, K_GetKartDriftSparkValue(player)); + return 0; +} + +static int lib_kDropItems(lua_State *L) +{ + player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); + NOHUD + if (!player) + return LUA_ErrInvalid(L, "player_t"); + K_DropItems(player); + return 0; +} + +static int lib_kStripItems(lua_State *L) +{ + player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); + NOHUD + if (!player) + return LUA_ErrInvalid(L, "player_t"); + K_StripItems(player); + return 0; +} + +static int lib_kStripOther(lua_State *L) +{ + player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); + NOHUD + if (!player) + return LUA_ErrInvalid(L, "player_t"); + K_StripOther(player); + return 0; +} + static int lib_kMomentumToFacing(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); @@ -2342,6 +2406,15 @@ static int lib_kGetKartFlashing(lua_State *L) return 0; } +static int lib_kGetItemPatch(lua_State *L) +{ + UINT8 item = luaL_checkinteger(L, 1); + boolean tiny = luaL_checkboolean(L, 2); + //HUDSAFE + lua_pushstring(L, K_GetItemPatch(item, tiny)); + return 1; +} + static luaL_Reg lib[] = { {"print", lib_print}, {"chatprint", lib_chatprint}, @@ -2532,6 +2605,7 @@ static luaL_Reg lib[] = { {"K_ExplodePlayer",lib_kExplodePlayer}, {"K_StealBumper",lib_kStealBumper}, {"K_SpawnKartExplosion",lib_kSpawnKartExplosion}, + {"K_SpawnMineExplosion",lib_kSpawnMineExplosion}, {"K_SpawnBoostTrail",lib_kSpawnBoostTrail}, {"K_SpawnSparkleTrail",lib_kSpawnSparkleTrail}, {"K_SpawnWipeoutTrail",lib_kSpawnWipeoutTrail}, @@ -2540,10 +2614,16 @@ static luaL_Reg lib[] = { {"K_DoPogoSpring",lib_kDoPogoSpring}, {"K_KillBananaChain",lib_kKillBananaChain}, {"K_RepairOrbitChain",lib_kRepairOrbitChain}, + {"K_FindJawzTarget",lib_kFindJawzTarget}, + {"K_GetKartDriftSparkValue",lib_kGetKartDriftSparkValue}, + {"K_DropItems",lib_kDropItems}, + {"K_StripItems",lib_kStripItems}, + {"K_StripOther",lib_kStripOther}, {"K_MomentumToFacing",lib_kMomentumToFacing}, {"K_GetKartSpeed",lib_kGetKartSpeed}, {"K_GetKartAccel",lib_kGetKartAccel}, {"K_GetKartFlashing",lib_kGetKartFlashing}, + {"K_GetItemPatch",lib_kK_GetItemPatch}, {NULL, NULL} };