mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-10 15:22:20 +00:00
Add P_Telekinesis and P_IsFlagAtBase to Lua.
This commit is contained in:
parent
9987d132fb
commit
a8f5406233
5 changed files with 28 additions and 2 deletions
|
@ -769,6 +769,18 @@ static int lib_pSpawnSpinMobj(lua_State *L)
|
||||||
return 0;
|
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
|
// P_MAP
|
||||||
///////////
|
///////////
|
||||||
|
@ -1195,6 +1207,16 @@ static int lib_pThingOnSpecial3DFloor(lua_State *L)
|
||||||
return 1;
|
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)
|
static int lib_pSetupLevelSky(lua_State *L)
|
||||||
{
|
{
|
||||||
INT32 skynum = (INT32)luaL_checkinteger(L, 1);
|
INT32 skynum = (INT32)luaL_checkinteger(L, 1);
|
||||||
|
@ -1680,6 +1702,7 @@ static luaL_Reg lib[] = {
|
||||||
{"P_DoJump",lib_pDoJump},
|
{"P_DoJump",lib_pDoJump},
|
||||||
{"P_SpawnThokMobj",lib_pSpawnThokMobj},
|
{"P_SpawnThokMobj",lib_pSpawnThokMobj},
|
||||||
{"P_SpawnSpinMobj",lib_pSpawnSpinMobj},
|
{"P_SpawnSpinMobj",lib_pSpawnSpinMobj},
|
||||||
|
{"P_Telekinesis",lib_pTelekinesis},
|
||||||
|
|
||||||
// p_map
|
// p_map
|
||||||
{"P_CheckPosition",lib_pCheckPosition},
|
{"P_CheckPosition",lib_pCheckPosition},
|
||||||
|
@ -1722,6 +1745,7 @@ static luaL_Reg lib[] = {
|
||||||
{"P_SpawnLightningFlash",lib_pSpawnLightningFlash},
|
{"P_SpawnLightningFlash",lib_pSpawnLightningFlash},
|
||||||
{"P_FadeLight",lib_pFadeLight},
|
{"P_FadeLight",lib_pFadeLight},
|
||||||
{"P_ThingOnSpecial3DFloor",lib_pThingOnSpecial3DFloor},
|
{"P_ThingOnSpecial3DFloor",lib_pThingOnSpecial3DFloor},
|
||||||
|
{"P_IsFlagAtBase",lib_pIsFlagAtBase},
|
||||||
{"P_SetupLevelSky",lib_pSetupLevelSky},
|
{"P_SetupLevelSky",lib_pSetupLevelSky},
|
||||||
{"P_SetSkyboxMobj",lib_pSetSkyboxMobj},
|
{"P_SetSkyboxMobj",lib_pSetSkyboxMobj},
|
||||||
{"P_StartQuake",lib_pStartQuake},
|
{"P_StartQuake",lib_pStartQuake},
|
||||||
|
|
|
@ -166,6 +166,7 @@ void P_TransferToAxis(player_t *player, INT32 axisnum);
|
||||||
boolean P_PlayerMoving(INT32 pnum);
|
boolean P_PlayerMoving(INT32 pnum);
|
||||||
void P_SpawnThokMobj(player_t *player);
|
void P_SpawnThokMobj(player_t *player);
|
||||||
void P_SpawnSpinMobj(player_t *player, mobjtype_t type);
|
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);
|
void P_PlayLivesJingle(player_t *player);
|
||||||
#define P_PlayRinglossSound(s) S_StartSound(s, (mariomode) ? sfx_mario8 : sfx_altow1 + P_RandomKey(4));
|
#define P_PlayRinglossSound(s) S_StartSound(s, (mariomode) ? sfx_mario8 : sfx_altow1 + P_RandomKey(4));
|
||||||
|
|
|
@ -3109,7 +3109,7 @@ void P_SetupSignExit(player_t *player)
|
||||||
//
|
//
|
||||||
// Checks to see if a flag is at its base.
|
// 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;
|
thinker_t *think;
|
||||||
mobj_t *mo;
|
mobj_t *mo;
|
||||||
|
|
|
@ -56,6 +56,7 @@ INT32 P_FindSpecialLineFromTag(INT16 special, INT16 tag, INT32 start);
|
||||||
INT32 P_FindMinSurroundingLight(sector_t *sector, INT32 max);
|
INT32 P_FindMinSurroundingLight(sector_t *sector, INT32 max);
|
||||||
|
|
||||||
void P_SetupSignExit(player_t *player);
|
void P_SetupSignExit(player_t *player);
|
||||||
|
boolean P_IsFlagAtBase(mobjtype_t flag);
|
||||||
|
|
||||||
void P_SwitchWeather(INT32 weathernum);
|
void P_SwitchWeather(INT32 weathernum);
|
||||||
|
|
||||||
|
|
|
@ -3592,7 +3592,7 @@ static void P_DoJumpShield(player_t *player)
|
||||||
// Morph's fancy stuff-moving character ability
|
// Morph's fancy stuff-moving character ability
|
||||||
// +ve thrust pushes away, -ve thrust pulls in
|
// +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;
|
thinker_t *th;
|
||||||
mobj_t *mo2;
|
mobj_t *mo2;
|
||||||
|
|
Loading…
Reference in a new issue