mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-01-11 09:12:22 +00:00
Battle UFO: power-up drops take player momz, pick up immediately
This commit is contained in:
parent
e07fbd9a6e
commit
2bdb7d4349
5 changed files with 22 additions and 9 deletions
|
|
@ -7044,7 +7044,11 @@ mobj_t *K_CreatePaperItem(fixed_t x, fixed_t y, fixed_t z, angle_t angle, SINT8
|
|||
drop->movecount = amount;
|
||||
}
|
||||
|
||||
drop->flags |= MF_NOCLIPTHING;
|
||||
if (type < FIRSTPOWERUP)
|
||||
{
|
||||
// Pick up power-ups immediately
|
||||
drop->flags |= MF_NOCLIPTHING;
|
||||
}
|
||||
|
||||
if (gametyperules & GTR_CLOSERPLAYERS)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ boolean Obj_IsSuperFlickyTargettingYou(const mobj_t *flicky, mobj_t *player);
|
|||
void Obj_BattleUFOLegThink(mobj_t *leg);
|
||||
void Obj_BattleUFOThink(mobj_t *ufo);
|
||||
void Obj_SpawnBattleUFOLegs(mobj_t *ufo);
|
||||
void Obj_BattleUFODeath(mobj_t *ufo);
|
||||
void Obj_BattleUFODeath(mobj_t *ufo, mobj_t *inflictor);
|
||||
void Obj_LinkBattleUFOSpawner(mobj_t *spawner);
|
||||
void Obj_UnlinkBattleUFOSpawner(mobj_t *spawner);
|
||||
void Obj_SpawnBattleUFOFromSpawner(void);
|
||||
|
|
|
|||
|
|
@ -137,14 +137,14 @@ void Obj_BattleUFOThink(mobj_t *mobj)
|
|||
K_BattleOvertimeKiller(mobj);
|
||||
}
|
||||
|
||||
void Obj_BattleUFODeath(mobj_t *mobj)
|
||||
void Obj_BattleUFODeath(mobj_t *mobj, mobj_t *inflictor)
|
||||
{
|
||||
UFO* ufo = static_cast<UFO*>(mobj);
|
||||
const SINT8 flip = P_MobjFlip(ufo);
|
||||
|
||||
ufo->momz = -(8*mapobjectscale)/2;
|
||||
|
||||
K_CreatePaperItem(
|
||||
mobj_t* drop = K_CreatePaperItem(
|
||||
ufo->x,
|
||||
ufo->y,
|
||||
ufo->z + (flip),
|
||||
|
|
@ -154,6 +154,14 @@ void Obj_BattleUFODeath(mobj_t *mobj)
|
|||
BATTLE_POWERUP_TIME
|
||||
);
|
||||
|
||||
if (!P_MobjWasRemoved(inflictor) && inflictor->type == MT_INSTAWHIP)
|
||||
{
|
||||
// Take momentum of player who whips
|
||||
inflictor = inflictor->target;
|
||||
}
|
||||
|
||||
drop->momz = !P_MobjWasRemoved(inflictor) ? inflictor->momz : 0;
|
||||
|
||||
if (ufo->spawner())
|
||||
{
|
||||
g_battleufo.previousId = ufo->spawner()->id();
|
||||
|
|
|
|||
|
|
@ -396,9 +396,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
P_InstaThrust(player->mo, player->mo->angle, 20<<FRACBITS);
|
||||
return;
|
||||
case MT_FLOATINGITEM: // SRB2Kart
|
||||
// Avoid being picked up immediately
|
||||
if (special->scale < special->destscale/2)
|
||||
return;
|
||||
if (special->threshold >= FIRSTPOWERUP)
|
||||
{
|
||||
if (P_PlayerInPain(player))
|
||||
|
|
@ -408,6 +405,10 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
}
|
||||
else
|
||||
{
|
||||
// Avoid being picked up immediately
|
||||
if (special->scale < special->destscale/2)
|
||||
return;
|
||||
|
||||
if (!P_CanPickupItem(player, 3) || (player->itemamount && player->itemtype != special->threshold))
|
||||
return;
|
||||
|
||||
|
|
@ -2347,7 +2348,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
|||
Obj_MonitorOnDeath(target);
|
||||
break;
|
||||
case MT_BATTLEUFO:
|
||||
Obj_BattleUFODeath(target);
|
||||
Obj_BattleUFODeath(target, inflictor);
|
||||
break;
|
||||
case MT_BLENDEYE_MAIN:
|
||||
VS_BlendEye_Death(target);
|
||||
|
|
|
|||
|
|
@ -7451,7 +7451,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
case MT_FLOATINGITEM:
|
||||
{
|
||||
P_ResetPitchRoll(mobj);
|
||||
if (mobj->flags & MF_NOCLIPTHING)
|
||||
if (!(mobj->flags & MF_NOGRAVITY))
|
||||
{
|
||||
if (P_CheckDeathPitCollide(mobj))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue