mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-13 22:33:32 +00:00
Scale player to Drone's scale on Nightserize, and reset scale on De-Nightserize
* Also correct player's position to Z center of Drone hitbox on Nightserize
This commit is contained in:
parent
480c4f890d
commit
d1a8e0baa0
2 changed files with 12 additions and 2 deletions
|
@ -793,8 +793,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
P_SwitchSpheresBonusMode(false);
|
P_SwitchSpheresBonusMode(false);
|
||||||
if (!(netgame || multiplayer) && !(player->powers[pw_carry] == CR_NIGHTSMODE))
|
if (!(netgame || multiplayer) && !(player->powers[pw_carry] == CR_NIGHTSMODE))
|
||||||
P_SetTarget(&special->tracer, toucher);
|
P_SetTarget(&special->tracer, toucher);
|
||||||
P_NightserizePlayer(player, special->health); // Transform!
|
|
||||||
P_SetTarget(&player->drone, special); // Mark the player as 'center into the drone'
|
P_SetTarget(&player->drone, special); // Mark the player as 'center into the drone'
|
||||||
|
P_NightserizePlayer(player, special->health); // Transform!
|
||||||
if (!spec)
|
if (!spec)
|
||||||
{
|
{
|
||||||
if (toucher->tracer) // Move the ideya over to the drone!
|
if (toucher->tracer) // Move the ideya over to the drone!
|
||||||
|
|
12
src/p_user.c
12
src/p_user.c
|
@ -623,6 +623,10 @@ static void P_DeNightserizePlayer(player_t *player)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (player->mo->scale != player->oldscale)
|
||||||
|
player->mo->destscale = player->oldscale;
|
||||||
|
player->oldscale = 0;
|
||||||
|
|
||||||
// Restore from drowning music
|
// Restore from drowning music
|
||||||
P_RestoreMusic(player);
|
P_RestoreMusic(player);
|
||||||
}
|
}
|
||||||
|
@ -640,7 +644,10 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (player->powers[pw_carry] != CR_NIGHTSMODE)
|
if (player->powers[pw_carry] != CR_NIGHTSMODE)
|
||||||
|
{
|
||||||
player->mo->height = P_GetPlayerHeight(player); // Just to make sure jumping into the drone doesn't result in a squashed hitbox.
|
player->mo->height = P_GetPlayerHeight(player); // Just to make sure jumping into the drone doesn't result in a squashed hitbox.
|
||||||
|
player->oldscale = player->mo->scale;
|
||||||
|
}
|
||||||
|
|
||||||
player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_NOJUMPDAMAGE|PF_THOKKED|PF_SHIELDABILITY|PF_SPINNING|PF_DRILLING);
|
player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_NOJUMPDAMAGE|PF_THOKKED|PF_SHIELDABILITY|PF_SPINNING|PF_DRILLING);
|
||||||
player->homing = 0;
|
player->homing = 0;
|
||||||
|
@ -765,6 +772,9 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
|
||||||
player->texttimer = (UINT8)(110 - timeinmap);
|
player->texttimer = (UINT8)(110 - timeinmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (player->drone && player->drone->scale != player->mo->scale)
|
||||||
|
player->mo->destscale = player->drone->scale;
|
||||||
|
|
||||||
player->powers[pw_carry] = CR_NIGHTSMODE;
|
player->powers[pw_carry] = CR_NIGHTSMODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6105,7 +6115,7 @@ static void P_MoveNiGHTSToDrone(player_t *player)
|
||||||
if (!player->drone)
|
if (!player->drone)
|
||||||
return;
|
return;
|
||||||
player->mo->momx = player->mo->momy = player->mo->momz = 0;
|
player->mo->momx = player->mo->momy = player->mo->momz = 0;
|
||||||
P_TeleportMove(player->mo, player->drone->x, player->drone->y, player->drone->z);
|
P_TeleportMove(player->mo, player->drone->x, player->drone->y, player->drone->z + player->drone->height/2 - player->mo->height/2);
|
||||||
P_SetTarget(&player->drone, NULL);
|
P_SetTarget(&player->drone, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue