mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 04:21:47 +00:00
Add K_FlingPaperItem, split off random thrust functionality
Battle UFO drops do not fling.
This commit is contained in:
parent
06acc1c07f
commit
d8afc7597d
4 changed files with 20 additions and 11 deletions
|
|
@ -417,7 +417,7 @@ void K_RunPaperItemSpawners(void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
K_CreatePaperItem(
|
K_FlingPaperItem(
|
||||||
battleovertime.x, battleovertime.y, battleovertime.z + (128 * mapobjectscale * flip),
|
battleovertime.x, battleovertime.y, battleovertime.z + (128 * mapobjectscale * flip),
|
||||||
FixedAngle(P_RandomRange(PR_ITEM_ROULETTE, 0, 359) * FRACUNIT), flip,
|
FixedAngle(P_RandomRange(PR_ITEM_ROULETTE, 0, 359) * FRACUNIT), flip,
|
||||||
0, 0
|
0, 0
|
||||||
|
|
|
||||||
24
src/k_kart.c
24
src/k_kart.c
|
|
@ -6613,13 +6613,6 @@ mobj_t *K_CreatePaperItem(fixed_t x, fixed_t y, fixed_t z, angle_t angle, SINT8
|
||||||
drop->destscale = (3*drop->destscale)/2;
|
drop->destscale = (3*drop->destscale)/2;
|
||||||
|
|
||||||
drop->angle = angle;
|
drop->angle = angle;
|
||||||
P_Thrust(drop,
|
|
||||||
FixedAngle(P_RandomFixed(PR_ITEM_ROULETTE) * 180) + angle,
|
|
||||||
16*mapobjectscale);
|
|
||||||
|
|
||||||
drop->momz = flip * 3 * mapobjectscale;
|
|
||||||
if (drop->eflags & MFE_UNDERWATER)
|
|
||||||
drop->momz = (117 * drop->momz) / 200;
|
|
||||||
|
|
||||||
if (type == 0)
|
if (type == 0)
|
||||||
{
|
{
|
||||||
|
|
@ -6665,6 +6658,21 @@ mobj_t *K_CreatePaperItem(fixed_t x, fixed_t y, fixed_t z, angle_t angle, SINT8
|
||||||
return drop;
|
return drop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mobj_t *K_FlingPaperItem(fixed_t x, fixed_t y, fixed_t z, angle_t angle, SINT8 flip, UINT8 type, UINT16 amount)
|
||||||
|
{
|
||||||
|
mobj_t *drop = K_CreatePaperItem(x, y, z, angle, flip, type, amount);
|
||||||
|
|
||||||
|
P_Thrust(drop,
|
||||||
|
FixedAngle(P_RandomFixed(PR_ITEM_ROULETTE) * 180) + angle,
|
||||||
|
16*mapobjectscale);
|
||||||
|
|
||||||
|
drop->momz = flip * 3 * mapobjectscale;
|
||||||
|
if (drop->eflags & MFE_UNDERWATER)
|
||||||
|
drop->momz = (117 * drop->momz) / 200;
|
||||||
|
|
||||||
|
return drop;
|
||||||
|
}
|
||||||
|
|
||||||
void K_DropPaperItem(player_t *player, UINT8 itemtype, UINT16 itemamount)
|
void K_DropPaperItem(player_t *player, UINT8 itemtype, UINT16 itemamount)
|
||||||
{
|
{
|
||||||
if (!player->mo || P_MobjWasRemoved(player->mo))
|
if (!player->mo || P_MobjWasRemoved(player->mo))
|
||||||
|
|
@ -6672,7 +6680,7 @@ void K_DropPaperItem(player_t *player, UINT8 itemtype, UINT16 itemamount)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mobj_t *drop = K_CreatePaperItem(
|
mobj_t *drop = K_FlingPaperItem(
|
||||||
player->mo->x, player->mo->y, player->mo->z + player->mo->height/2,
|
player->mo->x, player->mo->y, player->mo->z + player->mo->height/2,
|
||||||
player->mo->angle + ANGLE_90, P_MobjFlip(player->mo),
|
player->mo->angle + ANGLE_90, P_MobjFlip(player->mo),
|
||||||
itemtype, itemamount
|
itemtype, itemamount
|
||||||
|
|
|
||||||
|
|
@ -152,6 +152,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, UINT16 amount);
|
mobj_t *K_CreatePaperItem(fixed_t x, fixed_t y, fixed_t z, angle_t angle, SINT8 flip, UINT8 type, UINT16 amount);
|
||||||
|
mobj_t *K_FlingPaperItem(fixed_t x, fixed_t y, fixed_t z, angle_t angle, SINT8 flip, UINT8 type, UINT16 amount);
|
||||||
void K_DropPaperItem(player_t *player, UINT8 itemtype, UINT16 itemamount);
|
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);
|
||||||
|
|
|
||||||
|
|
@ -668,13 +668,13 @@ Obj_MonitorOnDeath (mobj_t *monitor)
|
||||||
const UINT32 localseed = restore_item_rng(sharedseed);
|
const UINT32 localseed = restore_item_rng(sharedseed);
|
||||||
|
|
||||||
adjust_monitor_drop(monitor,
|
adjust_monitor_drop(monitor,
|
||||||
K_CreatePaperItem(
|
K_FlingPaperItem(
|
||||||
monitor->x, monitor->y, monitor->z + (128 * mapobjectscale * flip),
|
monitor->x, monitor->y, monitor->z + (128 * mapobjectscale * flip),
|
||||||
i * ang, flip,
|
i * ang, flip,
|
||||||
K_ItemResultToType(result),
|
K_ItemResultToType(result),
|
||||||
K_ItemResultToAmount(result)));
|
K_ItemResultToAmount(result)));
|
||||||
|
|
||||||
// K_CreatePaperItem may advance RNG, so update our
|
// K_FlingPaperItem may advance RNG, so update our
|
||||||
// copy of the seed afterward
|
// copy of the seed afterward
|
||||||
sharedseed = restore_item_rng(localseed);
|
sharedseed = restore_item_rng(localseed);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue