mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-28 04:51:42 +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_BADGE,
|
||||||
POWERUP_SUPERFLICKY,
|
POWERUP_SUPERFLICKY,
|
||||||
ENDOFPOWERUPS,
|
ENDOFPOWERUPS,
|
||||||
|
LASTPOWERUP = ENDOFPOWERUPS - 1,
|
||||||
NUMPOWERUPS = ENDOFPOWERUPS - FIRSTPOWERUP,
|
NUMPOWERUPS = ENDOFPOWERUPS - FIRSTPOWERUP,
|
||||||
} kartitems_t;
|
} kartitems_t;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6896,6 +6896,7 @@ struct int_const_s const INT_CONST[] = {
|
||||||
{"POWERUP_BADGE",POWERUP_BADGE},
|
{"POWERUP_BADGE",POWERUP_BADGE},
|
||||||
{"POWERUP_SUPERFLICKY",POWERUP_SUPERFLICKY},
|
{"POWERUP_SUPERFLICKY",POWERUP_SUPERFLICKY},
|
||||||
{"ENDOFPOWERUPS",ENDOFPOWERUPS},
|
{"ENDOFPOWERUPS",ENDOFPOWERUPS},
|
||||||
|
{"LASTPOWERUP",LASTPOWERUP},
|
||||||
{"NUMPOWERUPS",NUMPOWERUPS},
|
{"NUMPOWERUPS",NUMPOWERUPS},
|
||||||
|
|
||||||
// kartshields_t
|
// kartshields_t
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
#include "../p_local.h"
|
#include "../p_local.h"
|
||||||
#include "../k_battle.h"
|
#include "../k_battle.h"
|
||||||
#include "../k_objects.h"
|
#include "../k_objects.h"
|
||||||
|
#include "../k_kart.h"
|
||||||
|
|
||||||
#define BATTLEUFO_LEG_ZOFFS (3*FRACUNIT) // Spawn height offset from the body
|
#define BATTLEUFO_LEG_ZOFFS (3*FRACUNIT) // Spawn height offset from the body
|
||||||
#define BATTLEUFO_LEGS (3) // Number of UFO legs to spawn
|
#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)
|
void Obj_BattleUFODeath(mobj_t *mobj)
|
||||||
{
|
{
|
||||||
UFO* ufo = static_cast<UFO*>(mobj);
|
UFO* ufo = static_cast<UFO*>(mobj);
|
||||||
|
const SINT8 flip = P_MobjFlip(ufo);
|
||||||
|
|
||||||
ufo->momz = -(8*mapobjectscale)/2;
|
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())
|
if (ufo->spawner())
|
||||||
{
|
{
|
||||||
g_battleufo.previousId = ufo->spawner()->id();
|
g_battleufo.previousId = ufo->spawner()->id();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue