diff --git a/src/lua_baselib.c b/src/lua_baselib.c index e61b0993e..a01afe80f 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -769,6 +769,18 @@ static int lib_pSpawnSpinMobj(lua_State *L) return 0; } +static int lib_pTelekinesis(lua_State *L) +{ + player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); + fixed_t thrust = (fixed_t)luaL_checkinteger(L, 2); + fixed_t range = (fixed_t)luaL_checkinteger(L, 3); + NOHUD + if (!player) + return LUA_ErrInvalid(L, "player_t"); + P_Telekinesis(player, thrust, range); + return 0; +} + // P_MAP /////////// @@ -1195,6 +1207,16 @@ static int lib_pThingOnSpecial3DFloor(lua_State *L) return 1; } +static int lib_pIsFlagAtBase(lua_State *L) +{ + mobjtype_t flag = luaL_checkinteger(L, 1); + NOHUD + if (flag > MT_LASTFREESLOT) + return luaL_error(L, "mobjtype_t out of bounds error!"); + lua_pushboolean(L, P_IsFlagAtBase(flag)); + return 1; +} + static int lib_pSetupLevelSky(lua_State *L) { INT32 skynum = (INT32)luaL_checkinteger(L, 1); @@ -1680,6 +1702,7 @@ static luaL_Reg lib[] = { {"P_DoJump",lib_pDoJump}, {"P_SpawnThokMobj",lib_pSpawnThokMobj}, {"P_SpawnSpinMobj",lib_pSpawnSpinMobj}, + {"P_Telekinesis",lib_pTelekinesis}, // p_map {"P_CheckPosition",lib_pCheckPosition}, @@ -1722,6 +1745,7 @@ static luaL_Reg lib[] = { {"P_SpawnLightningFlash",lib_pSpawnLightningFlash}, {"P_FadeLight",lib_pFadeLight}, {"P_ThingOnSpecial3DFloor",lib_pThingOnSpecial3DFloor}, + {"P_IsFlagAtBase",lib_pIsFlagAtBase}, {"P_SetupLevelSky",lib_pSetupLevelSky}, {"P_SetSkyboxMobj",lib_pSetSkyboxMobj}, {"P_StartQuake",lib_pStartQuake}, diff --git a/src/p_local.h b/src/p_local.h index d1da89cbe..2c8d9165d 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -166,6 +166,7 @@ void P_TransferToAxis(player_t *player, INT32 axisnum); boolean P_PlayerMoving(INT32 pnum); void P_SpawnThokMobj(player_t *player); void P_SpawnSpinMobj(player_t *player, mobjtype_t type); +void P_Telekinesis(player_t *player, fixed_t thrust, fixed_t range); void P_PlayLivesJingle(player_t *player); #define P_PlayRinglossSound(s) S_StartSound(s, (mariomode) ? sfx_mario8 : sfx_altow1 + P_RandomKey(4)); diff --git a/src/p_spec.c b/src/p_spec.c index fa6200cd5..11660d20b 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3109,7 +3109,7 @@ void P_SetupSignExit(player_t *player) // // Checks to see if a flag is at its base. // -static boolean P_IsFlagAtBase(mobjtype_t flag) +boolean P_IsFlagAtBase(mobjtype_t flag) { thinker_t *think; mobj_t *mo; diff --git a/src/p_spec.h b/src/p_spec.h index 191d8eae0..067c47f7a 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -56,6 +56,7 @@ INT32 P_FindSpecialLineFromTag(INT16 special, INT16 tag, INT32 start); INT32 P_FindMinSurroundingLight(sector_t *sector, INT32 max); void P_SetupSignExit(player_t *player); +boolean P_IsFlagAtBase(mobjtype_t flag); void P_SwitchWeather(INT32 weathernum); diff --git a/src/p_user.c b/src/p_user.c index e4b807437..57c8fac6a 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3592,7 +3592,7 @@ static void P_DoJumpShield(player_t *player) // Morph's fancy stuff-moving character ability // +ve thrust pushes away, -ve thrust pulls in // -static void P_Telekinesis(player_t *player, fixed_t thrust, fixed_t range) +void P_Telekinesis(player_t *player, fixed_t thrust, fixed_t range) { thinker_t *th; mobj_t *mo2;