mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Add K_DropPaperItem, split from K_DropItems but with custom item type and amount
This commit is contained in:
parent
58cccedd64
commit
a0b0891009
2 changed files with 19 additions and 8 deletions
26
src/k_kart.c
26
src/k_kart.c
|
|
@ -6599,20 +6599,30 @@ mobj_t *K_CreatePaperItem(fixed_t x, fixed_t y, fixed_t z, angle_t angle, SINT8
|
||||||
return drop;
|
return drop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void K_DropPaperItem(player_t *player, UINT8 itemtype, UINT16 itemamount)
|
||||||
|
{
|
||||||
|
if (!player->mo || P_MobjWasRemoved(player->mo))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mobj_t *drop = K_CreatePaperItem(
|
||||||
|
player->mo->x, player->mo->y, player->mo->z + player->mo->height/2,
|
||||||
|
player->mo->angle + ANGLE_90, P_MobjFlip(player->mo),
|
||||||
|
itemtype, itemamount
|
||||||
|
);
|
||||||
|
|
||||||
|
K_FlipFromObject(drop, player->mo);
|
||||||
|
}
|
||||||
|
|
||||||
// For getting EXTRA hit!
|
// For getting EXTRA hit!
|
||||||
void K_DropItems(player_t *player)
|
void K_DropItems(player_t *player)
|
||||||
{
|
{
|
||||||
K_DropHnextList(player);
|
K_DropHnextList(player);
|
||||||
|
|
||||||
if (player->mo && !P_MobjWasRemoved(player->mo) && player->itemamount > 0)
|
if (player->itemamount > 0)
|
||||||
{
|
{
|
||||||
mobj_t *drop = K_CreatePaperItem(
|
K_DropPaperItem(player, player->itemtype, player->itemamount);
|
||||||
player->mo->x, player->mo->y, player->mo->z + player->mo->height/2,
|
|
||||||
player->mo->angle + ANGLE_90, P_MobjFlip(player->mo),
|
|
||||||
player->itemtype, player->itemamount
|
|
||||||
);
|
|
||||||
|
|
||||||
K_FlipFromObject(drop, player->mo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
K_StripItems(player);
|
K_StripItems(player);
|
||||||
|
|
|
||||||
|
|
@ -151,6 +151,7 @@ void K_KartUpdatePosition(player_t *player);
|
||||||
void K_UpdateAllPlayerPositions(void);
|
void K_UpdateAllPlayerPositions(void);
|
||||||
SINT8 K_GetTotallyRandomResult(UINT8 useodds);
|
SINT8 K_GetTotallyRandomResult(UINT8 useodds);
|
||||||
mobj_t *K_CreatePaperItem(fixed_t x, fixed_t y, fixed_t z, angle_t angle, SINT8 flip, UINT8 type, UINT8 amount);
|
mobj_t *K_CreatePaperItem(fixed_t x, fixed_t y, fixed_t z, angle_t angle, SINT8 flip, UINT8 type, UINT8 amount);
|
||||||
|
void K_DropPaperItem(player_t *player, UINT8 itemtype, UINT16 itemamount);
|
||||||
void K_PopPlayerShield(player_t *player);
|
void K_PopPlayerShield(player_t *player);
|
||||||
void K_DropItems(player_t *player);
|
void K_DropItems(player_t *player);
|
||||||
void K_DropRocketSneaker(player_t *player);
|
void K_DropRocketSneaker(player_t *player);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue