mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-04-03 17:01:19 +00:00
Some drift code, some control code
This commit is contained in:
parent
3a3180ce05
commit
da7a513c9a
10 changed files with 283 additions and 36 deletions
|
@ -826,6 +826,8 @@ static void IdentifyVersion(void)
|
|||
D_AddFile(va(pandf,srb2waddir,"AllKartGraphics.wad"));
|
||||
D_AddFile(va(pandf,srb2waddir,"AllKartChars.wad"));
|
||||
D_AddFile(va(pandf,srb2waddir,"AllKartSounds.wad"));
|
||||
D_AddFile(va(pandf,srb2waddir,"KartTextures.wad"));
|
||||
D_AddFile(va(pandf,srb2waddir,"KMFixes3.wad"));
|
||||
|
||||
#if !defined (HAVE_SDL) || defined (HAVE_MIXER)
|
||||
{
|
||||
|
|
|
@ -234,7 +234,6 @@ typedef enum
|
|||
typedef enum
|
||||
{
|
||||
// Basic gameplay things
|
||||
k_introcam, // Something to do with the map intro
|
||||
k_position, // Used for Kart positions, mostly for deterministic stuff
|
||||
k_playerahead, // Is someone ahead of me or not?
|
||||
k_oldposition, // Used for taunting when you pass someone
|
||||
|
|
|
@ -394,6 +394,11 @@ extern UINT16 underwatertics;
|
|||
extern UINT16 spacetimetics;
|
||||
extern UINT16 extralifetics;
|
||||
|
||||
// SRB2kart
|
||||
extern INT32 bootime;
|
||||
extern INT32 mushroomtime;
|
||||
extern INT32 bonustime;
|
||||
|
||||
extern UINT8 introtoplay;
|
||||
extern UINT8 creditscutscene;
|
||||
|
||||
|
|
68
src/g_game.c
68
src/g_game.c
|
@ -195,6 +195,11 @@ UINT16 underwatertics = 30*TICRATE;
|
|||
UINT16 spacetimetics = 11*TICRATE + (TICRATE/2);
|
||||
UINT16 extralifetics = 4*TICRATE;
|
||||
|
||||
// SRB2kart
|
||||
INT32 bootime = 7*TICRATE;
|
||||
INT32 mushroomtime = 120;
|
||||
INT32 bonustime = 700;
|
||||
|
||||
INT32 gameovertics = 15*TICRATE;
|
||||
|
||||
UINT8 use1upSound = 0;
|
||||
|
@ -1042,6 +1047,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
axis = JoyAxis(AXISSTRAFE);
|
||||
if (gamepadjoystickmove && axis != 0)
|
||||
{
|
||||
|
@ -1055,16 +1061,36 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics)
|
|||
// JOYAXISRANGE is supposed to be 1023 (divide by 1024)
|
||||
side += ((axis * sidemove[1]) >> 10);
|
||||
}
|
||||
*/
|
||||
|
||||
// forward with key or button
|
||||
// forward with key or button // SRB2kart - we use an accel/brake instead of forward/backward.
|
||||
if (PLAYER1INPUTDOWN(gc_accelerate))
|
||||
{
|
||||
cmd->buttons |= BT_ACCELERATE;
|
||||
forward = forwardmove[speed];
|
||||
}
|
||||
if (PLAYER1INPUTDOWN(gc_brake))
|
||||
{
|
||||
cmd->buttons |= BT_BRAKE;
|
||||
forward -= forwardmove[speed];
|
||||
}
|
||||
// But forward/backward IS used for aiming.
|
||||
axis = JoyAxis(AXISMOVE);
|
||||
if (PLAYER1INPUTDOWN(gc_aimforward) || (gamepadjoystickmove && axis < 0))
|
||||
cmd->buttons |= BT_FORWARD;
|
||||
if (PLAYER1INPUTDOWN(gc_aimbackward) || (gamepadjoystickmove && axis > 0))
|
||||
cmd->buttons |= BT_BACKWARD;
|
||||
/*
|
||||
if (PLAYER1INPUTDOWN(gc_forward) || (gamepadjoystickmove && axis < 0))
|
||||
forward = forwardmove[speed];
|
||||
if (PLAYER1INPUTDOWN(gc_backward) || (gamepadjoystickmove && axis > 0))
|
||||
forward -= forwardmove[speed];
|
||||
*/
|
||||
|
||||
/*
|
||||
if (analogjoystickmove && axis != 0)
|
||||
forward -= ((axis * forwardmove[1]) >> 10); // ANALOG!
|
||||
*/
|
||||
|
||||
// some people strafe left & right with mouse buttons
|
||||
// those people are weird
|
||||
|
@ -1098,9 +1124,11 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics)
|
|||
cmd->buttons |= BT_ATTACK;
|
||||
|
||||
// fire normal with any button/key
|
||||
/*
|
||||
axis = JoyAxis(AXISFIRENORMAL);
|
||||
if (PLAYER1INPUTDOWN(gc_accelerate) || (cv_usejoystick.value && axis > 0))
|
||||
cmd->buttons |= BT_ACCELERATE;
|
||||
*/
|
||||
|
||||
if (PLAYER1INPUTDOWN(gc_spectate))
|
||||
cmd->buttons |= BT_SPECTATE;
|
||||
|
@ -1114,10 +1142,13 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics)
|
|||
cmd->buttons |= BT_CUSTOM3;
|
||||
|
||||
// use with any button/key
|
||||
/*
|
||||
if (PLAYER1INPUTDOWN(gc_brake))
|
||||
cmd->buttons |= BT_BRAKE;
|
||||
*/
|
||||
|
||||
// Camera Controls
|
||||
/*
|
||||
if (cv_debug || cv_analog.value || demoplayback || objectplacing || player->pflags & PF_NIGHTSMODE)
|
||||
{
|
||||
if (PLAYER1INPUTDOWN(gc_aimforward))
|
||||
|
@ -1125,6 +1156,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics)
|
|||
if (PLAYER1INPUTDOWN(gc_aimbackward))
|
||||
cmd->buttons |= BT_BACKWARD;
|
||||
}
|
||||
*/
|
||||
|
||||
if (PLAYER1INPUTDOWN(gc_lookback))
|
||||
{
|
||||
|
@ -1248,11 +1280,16 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics)
|
|||
// SRB2kart
|
||||
INT32 turnspeed;
|
||||
|
||||
if (players[consoleplayer].mo && (players[consoleplayer].kartstuff[k_introcam] > 1 || players[consoleplayer].speed == 0))
|
||||
if (players[consoleplayer].mo && (players[consoleplayer].speed == 0))
|
||||
turnspeed = 0;
|
||||
else
|
||||
turnspeed = 16;
|
||||
|
||||
cmd->angleturn = FixedMul(cmd->angleturn, FixedDiv(80 - (players[consoleplayer].speed >> 16), 80));
|
||||
|
||||
if (players[consoleplayer].kartstuff[k_startimer] || players[consoleplayer].kartstuff[k_mushroomtimer] || players[consoleplayer].kartstuff[k_growshrinktimer] > 0)
|
||||
cmd->angleturn = FixedMul(cmd->angleturn, FixedDiv(5*FRACUNIT, 4*FRACUNIT));
|
||||
|
||||
localangle += (cmd->angleturn<<turnspeed); // << 16
|
||||
cmd->angleturn = (INT16)(localangle >> 16);
|
||||
}
|
||||
|
@ -1357,6 +1394,7 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
axis = Joy2Axis(AXISSTRAFE);
|
||||
if (gamepadjoystickmove && axis != 0)
|
||||
{
|
||||
|
@ -1370,16 +1408,30 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics)
|
|||
// JOYAXISRANGE is supposed to be 1023 (divide by 1024)
|
||||
side += ((axis * sidemove[1]) >> 10);
|
||||
}
|
||||
*/
|
||||
|
||||
// forward with key or button
|
||||
axis = Joy2Axis(AXISMOVE);
|
||||
if (PLAYER2INPUTDOWN(gc_forward) || (gamepadjoystickmove && axis < 0))
|
||||
if (PLAYER1INPUTDOWN(gc_accelerate))
|
||||
{
|
||||
cmd->buttons |= BT_ACCELERATE;
|
||||
forward = forwardmove[speed];
|
||||
if (PLAYER2INPUTDOWN(gc_backward) || (gamepadjoystickmove && axis > 0))
|
||||
}
|
||||
if (PLAYER1INPUTDOWN(gc_brake))
|
||||
{
|
||||
cmd->buttons |= BT_BRAKE;
|
||||
forward -= forwardmove[speed];
|
||||
}
|
||||
// forward/backward is used for aiming.
|
||||
axis = Joy2Axis(AXISMOVE);
|
||||
if (PLAYER2INPUTDOWN(gc_aimforward) || (gamepadjoystickmove && axis < 0))
|
||||
cmd->buttons |= BT_FORWARD;
|
||||
if (PLAYER2INPUTDOWN(gc_aimbackward) || (gamepadjoystickmove && axis > 0))
|
||||
cmd->buttons |= BT_BACKWARD;
|
||||
|
||||
/*
|
||||
if (analogjoystickmove && axis != 0)
|
||||
forward -= ((axis * forwardmove[1]) >> 10); // ANALOG!
|
||||
*/
|
||||
|
||||
// some people strafe left & right with mouse buttons
|
||||
// those people are (still) weird
|
||||
|
@ -1389,9 +1441,9 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics)
|
|||
side -= sidemove[speed];
|
||||
|
||||
/* // SRB2kart - these aren't used in kart
|
||||
if (PLAYER2INPUTDOWN(gc_driftleft))
|
||||
if (PLAYER2INPUTDOWN(gc_weaponnext))
|
||||
cmd->buttons |= BT_WEAPONNEXT; // Next Weapon
|
||||
if (PLAYER2INPUTDOWN(gc_driftright))
|
||||
if (PLAYER2INPUTDOWN(gc_weaponprev))
|
||||
cmd->buttons |= BT_WEAPONPREV; // Previous Weapon
|
||||
*/
|
||||
|
||||
|
@ -1410,9 +1462,11 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics)
|
|||
cmd->buttons |= BT_ATTACK;
|
||||
|
||||
// fire normal with any button/key
|
||||
/*
|
||||
axis = Joy2Axis(AXISFIRENORMAL);
|
||||
if (PLAYER2INPUTDOWN(gc_accelerate) || (cv_usejoystick2.value && axis > 0))
|
||||
cmd->buttons |= BT_ACCELERATE;
|
||||
*/
|
||||
|
||||
if (PLAYER2INPUTDOWN(gc_spectate))
|
||||
cmd->buttons |= BT_SPECTATE;
|
||||
|
|
|
@ -97,9 +97,9 @@ state_t states[NUMSTATES] =
|
|||
{SPR_PLAY, 0, 2, {NULL}, 0, 0, S_KART_RUN2}, // S_KART_RUN1 A
|
||||
{SPR_PLAY, 3, 2, {NULL}, 0, 0, S_KART_RUN1}, // S_KART_RUN2 D
|
||||
{SPR_PLAY, 1, 2, {NULL}, 0, 0, S_KART_RUN_L2}, // S_KART_RUN_L1 B
|
||||
{SPR_PLAY, 4, 2, {NULL}, 0, 0, S_KART_RUN_L1}, // S_KART_RUN_L2 F
|
||||
{SPR_PLAY, 5, 2, {NULL}, 0, 0, S_KART_RUN_L1}, // S_KART_RUN_L2 F
|
||||
{SPR_PLAY, 2, 2, {NULL}, 0, 0, S_KART_RUN_R2}, // S_KART_RUN_R1 C
|
||||
{SPR_PLAY, 5, 2, {NULL}, 0, 0, S_KART_RUN_R1}, // S_KART_RUN_R2 H
|
||||
{SPR_PLAY, 7, 2, {NULL}, 0, 0, S_KART_RUN_R1}, // S_KART_RUN_R2 H
|
||||
{SPR_PLAY, 9, 2, {NULL}, 0, 0, S_KART_DRIFT_L2}, // S_KART_DRIFT_L1 J
|
||||
{SPR_PLAY, 10, 2, {NULL}, 0, 0, S_KART_DRIFT_L1}, // S_KART_DRIFT_L2 K
|
||||
{SPR_PLAY, 11, 2, {NULL}, 0, 0, S_KART_DRIFT_R2}, // S_KART_DRIFT_R1 L
|
||||
|
|
22
src/k_kart.c
22
src/k_kart.c
|
@ -883,10 +883,6 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
|
|||
|
||||
//{ SRB2kart p_user.c Stuff
|
||||
|
||||
INT32 bootime = 7*TICRATE;
|
||||
INT32 mushroomtime = 120;
|
||||
INT32 bonustime = 700;
|
||||
|
||||
/** \brief Decreases various kart timers and powers per frame. Called in P_PlayerThink in p_user.c
|
||||
|
||||
\param player player object passed from P_PlayerThink
|
||||
|
@ -1544,7 +1540,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
|
||||
if (!(cmd->buttons & BT_ATTACK))
|
||||
player->pflags |= PF_ATTACKDOWN;
|
||||
if (player && player->health > 0 && !player->spectator && !player->exiting && player->kartstuff[k_introcam] < 2 && player->kartstuff[k_spinouttimer] == 0)
|
||||
if (player && player->health > 0 && !player->spectator && !player->exiting && player->kartstuff[k_spinouttimer] == 0)
|
||||
{
|
||||
// GoldenMushroom power
|
||||
if (ATTACK_IS_DOWN && !HOLDING_ITEM && onground && player->kartstuff[k_goldshroom] == 1 && player->kartstuff[k_goldshroomtimer] == 0 && NO_BOO)
|
||||
|
@ -1988,7 +1984,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
&& (player->kartstuff[k_driftcharge] >= 30 && player->kartstuff[k_driftcharge] < 60)
|
||||
&& onground)
|
||||
{
|
||||
player->powers[pw_sneakers] += 16 + (player->acceleration-34);
|
||||
player->powers[pw_sneakers] += 17;
|
||||
S_StartSound(player->mo, sfx_mush);
|
||||
player->kartstuff[k_drift] = 0;
|
||||
player->kartstuff[k_driftcharge] = 0;
|
||||
|
@ -1997,7 +1993,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
&& player->kartstuff[k_driftcharge] >= 60
|
||||
&& onground)
|
||||
{
|
||||
player->powers[pw_sneakers] += 36 + (player->acceleration-34);
|
||||
player->powers[pw_sneakers] += 35;
|
||||
S_StartSound(player->mo, sfx_mush);
|
||||
player->kartstuff[k_drift] = 0;
|
||||
player->kartstuff[k_driftcharge] = 0;
|
||||
|
@ -2014,16 +2010,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
else if (player->kartstuff[k_jmp] == 0 || player->kartstuff[k_turndir] == 0)
|
||||
player->kartstuff[k_drift] = 0;
|
||||
|
||||
/*
|
||||
if (cmd->forwardmove == 0)
|
||||
player->powers[pw_exspeed]--;
|
||||
|
||||
if (cmd->forwardmove > 0)
|
||||
player->powers[pw_exspeed]++;
|
||||
*/
|
||||
|
||||
// If you press any strafe key while turning right, then drift right.
|
||||
if (player->kartstuff[k_introcam] < 2 && player->kartstuff[k_spinouttimer] == 0
|
||||
if (player->kartstuff[k_spinouttimer] == 0
|
||||
&& player->kartstuff[k_jmp] == 1 && (player->kartstuff[k_drift] == 1 || player->kartstuff[k_drift] == -1)
|
||||
&& onground) //Right
|
||||
{
|
||||
|
@ -2040,7 +2028,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
// Quick Turning
|
||||
// You can't turn your kart when you're not moving.
|
||||
// So now it's time to burn some rubber!
|
||||
if (player->kartstuff[k_introcam] < 2 && player->speed < 2 && leveltime > 140 && cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE)
|
||||
if (player->speed < 2 && leveltime > 140 && cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE)
|
||||
{
|
||||
if (player->kartstuff[k_turndir])
|
||||
player->kartstuff[k_drift] = 1;
|
||||
|
|
|
@ -3010,6 +3010,12 @@ retry:
|
|||
{
|
||||
mmomx = mo->player->rmomx;
|
||||
mmomy = mo->player->rmomy;
|
||||
|
||||
if (mo->player->kartstuff[k_drift] != 0) // SRB2kart
|
||||
{
|
||||
mo->player->kartstuff[k_drift] = 0;
|
||||
mo->player->kartstuff[k_driftcharge] = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
165
src/p_mobj.c
165
src/p_mobj.c
|
@ -3203,19 +3203,23 @@ void P_MobjCheckWater(mobj_t *mobj)
|
|||
}
|
||||
|
||||
// Drown timer setting
|
||||
/* // SRB2kart - Can't drown.
|
||||
if ((p->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL // Has elemental
|
||||
|| (p->exiting) // Or exiting
|
||||
|| (maptol & TOL_NIGHTS) // Or in NiGHTS mode
|
||||
|| (mariomode)) // Or in Mario mode...
|
||||
*/
|
||||
{
|
||||
// Can't drown.
|
||||
p->powers[pw_underwater] = 0;
|
||||
}
|
||||
/*
|
||||
else if (p->powers[pw_underwater] <= 0) // No underwater timer set
|
||||
{
|
||||
// Then we'll set it!
|
||||
p->powers[pw_underwater] = underwatertics + 1;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
// The rest of this code only executes on a water state change.
|
||||
|
@ -6329,6 +6333,167 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
if (!P_AddShield(mobj))
|
||||
return;
|
||||
break;
|
||||
//{ SRB2kart mobs
|
||||
case MT_DRIFT:
|
||||
if ((mobj->target && mobj->target->player && mobj->target->player->mo && mobj->target->player->health > 0 && !mobj->target->player->spectator)
|
||||
&& (mobj->type == MT_DRIFT && mobj->target->player->kartstuff[k_driftcharge] >= 30))
|
||||
{
|
||||
INT32 HEIGHT;
|
||||
fixed_t radius;
|
||||
|
||||
if (mobj->target->player->kartstuff[k_bootaketimer] > 0)
|
||||
{
|
||||
if ((mobj->target->player == &players[displayplayer] || (splitscreen && mobj->target->player == &players[secondarydisplayplayer]))
|
||||
|| (!(mobj->target->player == &players[displayplayer] || (splitscreen && mobj->target->player == &players[secondarydisplayplayer]))
|
||||
&& (mobj->target->player->kartstuff[k_bootaketimer] < 1*TICRATE/2 || mobj->target->player->kartstuff[k_bootaketimer] > bootime-(1*TICRATE/2))))
|
||||
{
|
||||
if (leveltime & 1)
|
||||
mobj->flags2 |= MF2_DONTDRAW;
|
||||
else
|
||||
mobj->flags2 &= ~MF2_DONTDRAW;
|
||||
}
|
||||
else
|
||||
mobj->flags2 |= MF2_DONTDRAW;
|
||||
}
|
||||
else if (mobj->target->player->kartstuff[k_bootaketimer] == 0)
|
||||
{
|
||||
mobj->flags2 &= ~MF2_DONTDRAW;
|
||||
}
|
||||
|
||||
// Actor's distance from its Target, or Radius.
|
||||
radius = FixedDiv(7, mobj->target->scale)*FRACUNIT;
|
||||
|
||||
// Switch blue flames to red flames
|
||||
if (mobj->target->player && mobj->type == MT_DRIFT
|
||||
&& mobj->target->player->kartstuff[k_driftcharge] > 60
|
||||
&& !(mobj->state >= &states[S_DRIFTSPARK4] && mobj->state <= &states[S_DRIFTSPARK6]))
|
||||
P_SetMobjStateNF(mobj, S_DRIFTSPARK4);
|
||||
|
||||
// Get the angle
|
||||
mobj->angle = ANGLE_180 + mobj->target->angle;
|
||||
|
||||
// If the player is on the ceiling, then flip
|
||||
if (mobj->target->player && mobj->target->eflags & MFE_VERTICALFLIP)
|
||||
{
|
||||
mobj->eflags |= MFE_VERTICALFLIP;
|
||||
HEIGHT = mobj->target->height;
|
||||
}
|
||||
else
|
||||
{
|
||||
mobj->eflags &= ~MFE_VERTICALFLIP;
|
||||
HEIGHT = mobj->target->height-mobj->target->height;
|
||||
}
|
||||
|
||||
// Shrink if the player shrunk too.
|
||||
if (mobj->target->player)
|
||||
mobj->scale = mobj->target->scale;
|
||||
|
||||
P_UnsetThingPosition(mobj);
|
||||
{
|
||||
const angle_t fa = mobj->angle>>ANGLETOFINESHIFT;
|
||||
mobj->x = mobj->target->x + FixedMul(finecosine[fa],radius);
|
||||
mobj->y = mobj->target->y + FixedMul(finesine[fa],radius);
|
||||
mobj->z = mobj->target->z + HEIGHT;
|
||||
P_SetThingPosition(mobj);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
P_RemoveMobj(mobj);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case MT_GREENSHIELD:
|
||||
case MT_REDSHIELD:
|
||||
case MT_BANANASHIELD:
|
||||
case MT_FAKESHIELD:
|
||||
case MT_BOMBSHIELD:
|
||||
case MT_TRIPLEGREENSHIELD1:
|
||||
case MT_TRIPLEGREENSHIELD2:
|
||||
case MT_TRIPLEGREENSHIELD3:
|
||||
case MT_TRIPLEREDSHIELD1:
|
||||
case MT_TRIPLEREDSHIELD2:
|
||||
case MT_TRIPLEREDSHIELD3:
|
||||
case MT_TRIPLEBANANASHIELD1:
|
||||
case MT_TRIPLEBANANASHIELD2:
|
||||
case MT_TRIPLEBANANASHIELD3:
|
||||
if (mobj->health > 0 && mobj->target && mobj->target->player && mobj->target->player->mo && mobj->target->player->health > 0 && !mobj->target->player->spectator)
|
||||
{
|
||||
INT32 zfixds = 56;
|
||||
if (mobj->type == MT_BANANASHIELD || mobj->type == MT_TRIPLEBANANASHIELD1 || mobj->type == MT_TRIPLEBANANASHIELD2 || mobj->type == MT_TRIPLEBANANASHIELD3)
|
||||
zfixds = 64;
|
||||
else
|
||||
zfixds = 56;
|
||||
|
||||
INT32 DIST = FixedDiv(zfixds, mobj->target->scale);
|
||||
INT32 HEIGHT;
|
||||
const fixed_t radius = DIST*FRACUNIT; // mobj's distance from its Target, or Radius.
|
||||
|
||||
//mobj->angle += FixedAngle(12*FRACUNIT); // mobj's actual speed.
|
||||
if (mobj->type == MT_TRIPLEGREENSHIELD1 || mobj->type == MT_TRIPLEGREENSHIELD2 || mobj->type == MT_TRIPLEGREENSHIELD3
|
||||
|| mobj->type == MT_TRIPLEREDSHIELD1 || mobj->type == MT_TRIPLEREDSHIELD2 || mobj->type == MT_TRIPLEREDSHIELD3)
|
||||
mobj->angle += FixedAngle(mobj->info->speed);
|
||||
else if (mobj->type == MT_TRIPLEBANANASHIELD2)
|
||||
mobj->angle = (mobj->target->angle + ANGLE_135);
|
||||
else if (mobj->type == MT_TRIPLEBANANASHIELD3)
|
||||
mobj->angle = (mobj->target->angle + ANGLE_225);
|
||||
else
|
||||
mobj->angle = (mobj->target->angle + ANGLE_180);
|
||||
|
||||
// If the player is on the ceiling, then flip your items as well.
|
||||
if (mobj->target->player && mobj->target->eflags & MFE_VERTICALFLIP)
|
||||
{
|
||||
mobj->eflags |= MFE_VERTICALFLIP;
|
||||
HEIGHT = mobj->target->height / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
mobj->eflags &= ~MFE_VERTICALFLIP;
|
||||
HEIGHT = mobj->target->height / 5;
|
||||
}
|
||||
|
||||
// Shrink your items if the player shrunk too.
|
||||
if (mobj->target->player)
|
||||
mobj->scale = mobj->target->scale;
|
||||
|
||||
P_UnsetThingPosition(mobj);
|
||||
{
|
||||
const angle_t fa = mobj->angle>>ANGLETOFINESHIFT;
|
||||
mobj->x = mobj->target->x + FixedMul(FINECOSINE(fa),radius);
|
||||
mobj->y = mobj->target->y + FixedMul(FINESINE(fa), radius);
|
||||
mobj->z = mobj->target->z + HEIGHT;
|
||||
P_SetThingPosition(mobj);
|
||||
}
|
||||
|
||||
// Was this so hard?
|
||||
if ((mobj->type == MT_GREENSHIELD && !(mobj->target->player->kartstuff[k_greenshell] & 1))
|
||||
|| (mobj->type == MT_REDSHIELD && !(mobj->target->player->kartstuff[k_redshell] & 1))
|
||||
|| (mobj->type == MT_BANANASHIELD && !(mobj->target->player->kartstuff[k_banana] & 1))
|
||||
|| (mobj->type == MT_TRIPLEGREENSHIELD1 && !(mobj->target->player->kartstuff[k_triplegreenshell] & 1))
|
||||
|| (mobj->type == MT_TRIPLEGREENSHIELD2 && !(mobj->target->player->kartstuff[k_triplegreenshell] & 2))
|
||||
|| (mobj->type == MT_TRIPLEGREENSHIELD3 && !(mobj->target->player->kartstuff[k_triplegreenshell] & 4))
|
||||
|| (mobj->type == MT_TRIPLEREDSHIELD1 && !(mobj->target->player->kartstuff[k_tripleredshell] & 1))
|
||||
|| (mobj->type == MT_TRIPLEREDSHIELD2 && !(mobj->target->player->kartstuff[k_tripleredshell] & 2))
|
||||
|| (mobj->type == MT_TRIPLEREDSHIELD3 && !(mobj->target->player->kartstuff[k_tripleredshell] & 4))
|
||||
|| (mobj->type == MT_TRIPLEBANANASHIELD1 && !(mobj->target->player->kartstuff[k_triplebanana] & 1))
|
||||
|| (mobj->type == MT_TRIPLEBANANASHIELD2 && !(mobj->target->player->kartstuff[k_triplebanana] & 2))
|
||||
|| (mobj->type == MT_TRIPLEBANANASHIELD3 && !(mobj->target->player->kartstuff[k_triplebanana] & 4))
|
||||
|| (mobj->type == MT_BOMBSHIELD && !(mobj->target->player->kartstuff[k_bobomb] & 1))
|
||||
|| (mobj->type == MT_FAKESHIELD && !(mobj->target->player->kartstuff[k_fakeitem] & 1)))
|
||||
{
|
||||
P_RemoveMobj(mobj);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if ((mobj->health > 0
|
||||
&& (!mobj->target || !mobj->target->player || !mobj->target->player->mo || mobj->target->player->health <= 0 || mobj->target->player->spectator))
|
||||
|| (mobj->health <= 0 && mobj->z <= mobj->floorz)) // When in death state
|
||||
{
|
||||
P_RemoveMobj(mobj);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
//}
|
||||
case MT_WATERDROP:
|
||||
P_SceneryCheckWater(mobj);
|
||||
if ((mobj->z <= mobj->floorz || mobj->z <= mobj->watertop)
|
||||
|
|
44
src/p_user.c
44
src/p_user.c
|
@ -3579,6 +3579,7 @@ void P_DoJump(player_t *player, boolean soundandstate)
|
|||
if (player->kartstuff[k_spinouttimer]) // SRB2kart
|
||||
return;
|
||||
|
||||
/* // SRB2kart - climbing in a kart?
|
||||
if (player->climbing)
|
||||
{
|
||||
// Jump this high.
|
||||
|
@ -3613,7 +3614,7 @@ void P_DoJump(player_t *player, boolean soundandstate)
|
|||
else if (player->mo->momz < 0) // still descending?
|
||||
player->mo->momz = (39*(FRACUNIT/4))>>1; // just default to the jump height.
|
||||
}
|
||||
else if (!(player->pflags & PF_JUMPED)) // Spin Attack
|
||||
else*/ if (!(player->pflags & PF_JUMPED)) // Spin Attack
|
||||
{
|
||||
if (player->mo->ceilingz-player->mo->floorz <= player->mo->height-1)
|
||||
return;
|
||||
|
@ -3650,6 +3651,9 @@ void P_DoJump(player_t *player, boolean soundandstate)
|
|||
}
|
||||
else if (maptol & TOL_NIGHTS)
|
||||
player->mo->momz = 24*FRACUNIT;
|
||||
else
|
||||
player->mo->momz = 3*FRACUNIT; // Kart jump momentum.
|
||||
/* // SRB2kart - Okay enough of that.
|
||||
else if (player->powers[pw_super])
|
||||
{
|
||||
if (player->charability == CA_FLOAT)
|
||||
|
@ -3691,6 +3695,7 @@ void P_DoJump(player_t *player, boolean soundandstate)
|
|||
player->mo->momz += FixedMul(FRACUNIT/8, dist6);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// Reduce player momz by 58.5% when underwater.
|
||||
if (player->mo->eflags & MFE_UNDERWATER)
|
||||
|
@ -4566,7 +4571,12 @@ static void P_3dMovement(player_t *player)
|
|||
}
|
||||
else
|
||||
{
|
||||
movepushangle = player->mo->angle;
|
||||
if (player->kartstuff[k_drift] == 1)
|
||||
movepushangle = player->mo->angle+ANGLE_45;
|
||||
else if (player->kartstuff[k_drift] == -1)
|
||||
movepushangle = player->mo->angle-ANGLE_45;
|
||||
else
|
||||
movepushangle = player->mo->angle;
|
||||
}
|
||||
movepushsideangle = movepushangle-ANGLE_90;
|
||||
|
||||
|
@ -4640,33 +4650,45 @@ static void P_3dMovement(player_t *player)
|
|||
else
|
||||
topspeed = normalspd;
|
||||
}
|
||||
else if (player->powers[pw_super] || player->powers[pw_sneakers])
|
||||
else if (player->powers[pw_super] || player->powers[pw_sneakers] || player->kartstuff[k_startimer] || player->kartstuff[k_mushroomtimer])
|
||||
{
|
||||
thrustfactor = player->thrustfactor*2;
|
||||
if (player->powers[pw_sneakers] && (player->kartstuff[k_growshrinktimer] > 0 || player->kartstuff[k_mushroomtimer] > 0 || player->kartstuff[k_startimer] > 0))
|
||||
thrustfactor = player->thrustfactor*3;
|
||||
else
|
||||
thrustfactor = player->thrustfactor*2;
|
||||
acceleration = player->accelstart/2 + (FixedDiv(player->speed, player->mo->scale)>>FRACBITS) * player->acceleration/2;
|
||||
|
||||
/*
|
||||
if (player->powers[pw_tailsfly])
|
||||
topspeed = normalspd;
|
||||
else if (player->mo->eflags & (MFE_UNDERWATER|MFE_GOOWATER))
|
||||
{
|
||||
topspeed = normalspd;
|
||||
acceleration = 2*acceleration/3;
|
||||
}
|
||||
}*/
|
||||
|
||||
if (cmd->forwardmove < 0)
|
||||
topspeed = 5<<16;
|
||||
else
|
||||
topspeed = normalspd * 2;
|
||||
topspeed = normalspd * 2 > 60<<16 ? 60<<16 : normalspd * 2;
|
||||
|
||||
CONS_Printf("topspeed = %d\n", topspeed>>16);
|
||||
}
|
||||
else
|
||||
{
|
||||
thrustfactor = player->thrustfactor;
|
||||
acceleration = player->accelstart + (FixedDiv(player->speed, player->mo->scale)>>FRACBITS) * player->acceleration;
|
||||
|
||||
/*
|
||||
if (player->powers[pw_tailsfly])
|
||||
topspeed = normalspd/2;
|
||||
else if (player->mo->eflags & (MFE_UNDERWATER|MFE_GOOWATER))
|
||||
{
|
||||
topspeed = normalspd/2;
|
||||
acceleration = 2*acceleration/3;
|
||||
}
|
||||
}*/
|
||||
if (cmd->forwardmove < 0)
|
||||
topspeed = 5<<16;
|
||||
else
|
||||
topspeed = normalspd;
|
||||
}
|
||||
|
@ -4710,6 +4732,9 @@ static void P_3dMovement(player_t *player)
|
|||
}
|
||||
|
||||
movepushforward = FixedMul(movepushforward, player->mo->scale);
|
||||
|
||||
if (mforward && cmd->forwardmove < 0) // SRB2kart - braking isn't instant
|
||||
movepushforward /= 32;
|
||||
|
||||
#ifdef ESLOPE
|
||||
totalthrust.x += P_ReturnThrustX(player->mo, movepushangle, movepushforward);
|
||||
|
@ -4761,6 +4786,9 @@ static void P_3dMovement(player_t *player)
|
|||
|
||||
movepushforward = FixedMul(movepushforward, player->mo->scale);
|
||||
|
||||
if (mforward && cmd->forwardmove < 0) // SRB2kart - braking isn't instant
|
||||
movepushforward /= 32;
|
||||
|
||||
#ifdef ESLOPE
|
||||
totalthrust.x += P_ReturnThrustX(player->mo, controldirection, movepushforward);
|
||||
totalthrust.y += P_ReturnThrustY(player->mo, controldirection, movepushforward);
|
||||
|
@ -6628,7 +6656,7 @@ static void P_MovePlayer(player_t *player)
|
|||
// Drifting sound
|
||||
{
|
||||
// Leveltime being 50 might take a while at times. We'll start it up once, isntantly.
|
||||
if ((player->kartstuff[k_drift] == 1 || player->kartstuff[k_drift] == -1) && onground && !S_SoundPlaying(NULL, sfx_mkdrft))
|
||||
if ((player->kartstuff[k_drift] == 1 || player->kartstuff[k_drift] == -1) && onground && player->kartstuff[k_driftcharge] < 5) //!S_SoundPlaying(NULL, sfx_mkdrft))
|
||||
S_StartSound(player->mo, sfx_mkdrft);
|
||||
// Start looping the sound now.
|
||||
else if (leveltime % 50 == 0 && ((player->kartstuff[k_drift] == 1 || player->kartstuff[k_drift] == -1) && onground))
|
||||
|
|
|
@ -587,7 +587,7 @@ void S_StartSound(const void *origin, sfxenum_t sfx_id)
|
|||
if (sound_disabled)
|
||||
return;
|
||||
|
||||
if (mariomode) // Sounds change in Mario mode!
|
||||
if (true) // Sounds change in Mario mode! // SRB2kart - every sound is mario.
|
||||
{
|
||||
switch (sfx_id)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue