mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Battle UFO: polish drops
- Whip
- Player gets power-up instantly, no paper item spawned
- Items
- Put a small delay on the drop appearing
- Adjusted drop spawn position so it spawns right under
the UFO
This commit is contained in:
parent
3724dd542b
commit
ecf70c6eea
3 changed files with 21 additions and 15 deletions
|
|
@ -50,6 +50,8 @@ void K_GivePowerUp(player_t* player, kartitems_t powerup, tic_t time)
|
||||||
Obj_SpawnPowerUpAura(player);
|
Obj_SpawnPowerUpAura(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
player->flashing = 2*TICRATE;
|
||||||
|
|
||||||
switch (powerup)
|
switch (powerup)
|
||||||
{
|
{
|
||||||
case POWERUP_SMONITOR:
|
case POWERUP_SMONITOR:
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,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_powerup.h"
|
||||||
#include "../k_kart.h"
|
#include "../k_kart.h"
|
||||||
#include "../k_hud.h" // K_AddMessage
|
#include "../k_hud.h" // K_AddMessage
|
||||||
|
|
||||||
|
|
@ -151,26 +152,30 @@ void Obj_BattleUFODeath(mobj_t *mobj, mobj_t *inflictor)
|
||||||
{
|
{
|
||||||
UFO* ufo = static_cast<UFO*>(mobj);
|
UFO* ufo = static_cast<UFO*>(mobj);
|
||||||
const SINT8 flip = P_MobjFlip(ufo);
|
const SINT8 flip = P_MobjFlip(ufo);
|
||||||
|
const kartitems_t pwrup = static_cast<kartitems_t>(P_RandomRange(PR_BATTLEUFO, FIRSTPOWERUP, LASTPOWERUP));
|
||||||
|
|
||||||
ufo->momz = -(8*mapobjectscale)/2;
|
ufo->momz = -(8*mapobjectscale)/2;
|
||||||
|
|
||||||
mobj_t* drop = K_CreatePaperItem(
|
if (!P_MobjWasRemoved(inflictor) && inflictor->type == MT_INSTAWHIP &&
|
||||||
ufo->x,
|
!P_MobjWasRemoved(inflictor->target) && inflictor->target->player)
|
||||||
ufo->y,
|
|
||||||
ufo->z + (flip),
|
|
||||||
0,
|
|
||||||
flip,
|
|
||||||
P_RandomRange(PR_BATTLEUFO, FIRSTPOWERUP, LASTPOWERUP),
|
|
||||||
BATTLE_POWERUP_TIME
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!P_MobjWasRemoved(inflictor) && inflictor->type == MT_INSTAWHIP)
|
|
||||||
{
|
{
|
||||||
// Take momentum of player who whips
|
// Just give it to the player, they earned it.
|
||||||
inflictor = inflictor->target;
|
K_GivePowerUp(inflictor->target->player, pwrup, BATTLE_POWERUP_TIME);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mobj_t *drop = K_CreatePaperItem(
|
||||||
|
ufo->x,
|
||||||
|
ufo->y,
|
||||||
|
ufo->z + ufo->sprzoff() + (flip),
|
||||||
|
0,
|
||||||
|
flip,
|
||||||
|
pwrup,
|
||||||
|
BATTLE_POWERUP_TIME
|
||||||
|
);
|
||||||
|
|
||||||
drop->momz = !P_MobjWasRemoved(inflictor) ? inflictor->momz : 0;
|
drop->hitlag = ufo->hitlag();
|
||||||
|
}
|
||||||
|
|
||||||
if (ufo->spawner())
|
if (ufo->spawner())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -402,7 +402,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
K_GivePowerUp(player, special->threshold, special->movecount);
|
K_GivePowerUp(player, special->threshold, special->movecount);
|
||||||
player->flashing = 2*TICRATE;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue