mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Spawn powerup orb on death
Spawns random powerup
This commit is contained in:
parent
dae2142fbe
commit
06acc1c07f
3 changed files with 14 additions and 0 deletions
|
|
@ -190,6 +190,7 @@ typedef enum
|
|||
POWERUP_BADGE,
|
||||
POWERUP_SUPERFLICKY,
|
||||
ENDOFPOWERUPS,
|
||||
LASTPOWERUP = ENDOFPOWERUPS - 1,
|
||||
NUMPOWERUPS = ENDOFPOWERUPS - FIRSTPOWERUP,
|
||||
} kartitems_t;
|
||||
|
||||
|
|
|
|||
|
|
@ -6896,6 +6896,7 @@ struct int_const_s const INT_CONST[] = {
|
|||
{"POWERUP_BADGE",POWERUP_BADGE},
|
||||
{"POWERUP_SUPERFLICKY",POWERUP_SUPERFLICKY},
|
||||
{"ENDOFPOWERUPS",ENDOFPOWERUPS},
|
||||
{"LASTPOWERUP",LASTPOWERUP},
|
||||
{"NUMPOWERUPS",NUMPOWERUPS},
|
||||
|
||||
// kartshields_t
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#include "../p_local.h"
|
||||
#include "../k_battle.h"
|
||||
#include "../k_objects.h"
|
||||
#include "../k_kart.h"
|
||||
|
||||
#define BATTLEUFO_LEG_ZOFFS (3*FRACUNIT) // Spawn height offset from the body
|
||||
#define BATTLEUFO_LEGS (3) // Number of UFO legs to spawn
|
||||
|
|
@ -136,9 +137,20 @@ void Obj_BattleUFOThink(mobj_t *mobj)
|
|||
void Obj_BattleUFODeath(mobj_t *mobj)
|
||||
{
|
||||
UFO* ufo = static_cast<UFO*>(mobj);
|
||||
const SINT8 flip = P_MobjFlip(ufo);
|
||||
|
||||
ufo->momz = -(8*mapobjectscale)/2;
|
||||
|
||||
K_CreatePaperItem(
|
||||
ufo->x,
|
||||
ufo->y,
|
||||
ufo->z + (flip),
|
||||
0,
|
||||
flip,
|
||||
P_RandomRange(PR_BATTLEUFO, FIRSTPOWERUP, LASTPOWERUP),
|
||||
BATTLE_POWERUP_TIME
|
||||
);
|
||||
|
||||
if (ufo->spawner())
|
||||
{
|
||||
g_battleufo.previousId = ufo->spawner()->id();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue