mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Expose K_KartGetItemResult to Lua
This commit is contained in:
parent
ae11db8b78
commit
a4a6c349b4
3 changed files with 36 additions and 11 deletions
|
|
@ -1845,19 +1845,11 @@ fixed_t K_GetSlotOffset(itemroulette_t *const roulette, fixed_t renderDelta, UIN
|
|||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
static void K_KartGetItemResult(player_t *const player, kartitems_t getitem)
|
||||
void K_KartGetItemResult(player_t *const player, kartitems_t getitem)
|
||||
|
||||
Initializes a player's item to what was
|
||||
received from the roulette.
|
||||
|
||||
Input Arguments:-
|
||||
player - The player receiving the item.
|
||||
getitem - The item to give to the player.
|
||||
|
||||
Return:-
|
||||
N/A
|
||||
See header file for description.
|
||||
--------------------------------------------------*/
|
||||
static void K_KartGetItemResult(player_t *const player, kartitems_t getitem)
|
||||
void K_KartGetItemResult(player_t *const player, kartitems_t getitem)
|
||||
{
|
||||
if (K_ItemSingularity(getitem) == true)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -260,6 +260,24 @@ fixed_t K_GetSlotOffset(itemroulette_t *const roulette, fixed_t renderDelta, UIN
|
|||
|
||||
void K_KartItemRoulette(player_t *const player, ticcmd_t *cmd);
|
||||
|
||||
/*--------------------------------------------------
|
||||
void K_CreateAndShuffleItemReel(player_t *const player, itemroulette_t *const roulette, const boolean freeplay);
|
||||
|
||||
Adds items to the item reel based on the RNG seed,
|
||||
item odds or whether it's free play or not.
|
||||
|
||||
Input Arguments:-
|
||||
player - The player to add items to their reel to.
|
||||
roulette - The player's roulette.
|
||||
freeplay - Whether we should create the free play
|
||||
roulette instead or not.
|
||||
|
||||
Return:-
|
||||
N/A
|
||||
--------------------------------------------------*/
|
||||
|
||||
void K_KartGetItemResult(player_t *const player, kartitems_t getitem);
|
||||
|
||||
UINT32 K_GetItemRouletteDistance(const player_t *player, UINT8 numPlayers);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
|
|
@ -4305,6 +4305,20 @@ static int lib_kStopRoulette(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int lib_kKartGetItemResult(lua_State *L)
|
||||
{
|
||||
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||
kartitems_t item = luaL_checkinteger(L, 2);
|
||||
|
||||
NOHUD
|
||||
INLEVEL
|
||||
if (!player)
|
||||
return LUA_ErrInvalid(L, "player_t");
|
||||
|
||||
K_KartGetItemResult(player, item);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_getTimeMicros(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, I_GetPreciseTime() / (I_GetPrecisePrecision() / 1000000));
|
||||
|
|
@ -4606,6 +4620,7 @@ static luaL_Reg lib[] = {
|
|||
{"K_StartItemRoulette", lib_kStartItemRoulette},
|
||||
{"K_StartEggmanRoulette", lib_kStartEggmanRoulette},
|
||||
{"K_StopRoulette", lib_kStopRoulette},
|
||||
{"K_KartGetItemResult", lib_kKartGetItemResult},
|
||||
|
||||
// hu_stuff technically?
|
||||
{"HU_DoTitlecardCEcho", lib_startTitlecardCecho},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue