Merge branch 'skins-fix' into 'v1'

Remove skin shit

See merge request KartKrew/Kart!145
This commit is contained in:
Sal 2019-05-06 21:07:24 -04:00
commit 2dc91d1723
14 changed files with 51 additions and 980 deletions

View File

@ -271,13 +271,7 @@ void B_RespawnBot(INT32 playernum)
player->powers[pw_nocontrol] = sonic->player->powers[pw_nocontrol];
P_TeleportMove(tails, x, y, z);
if (player->charability == CA_FLY)
{
P_SetPlayerMobjState(tails, S_KART_STND1); // SRB2kart - was S_PLAY_ABL1
tails->player->powers[pw_tailsfly] = (UINT16)-1;
}
else
P_SetPlayerMobjState(tails, S_KART_STND1); // SRB2kart - was S_PLAY_FALL1
P_SetPlayerMobjState(tails, S_KART_STND1); // SRB2kart - was S_PLAY_FALL1
P_SetScale(tails, sonic->scale);
tails->destscale = sonic->destscale;
}

View File

@ -583,21 +583,7 @@ static inline void resynch_write_player(resynch_pak *rsp, const size_t i)
rsp->kartspeed = (UINT8)players[i].kartspeed;
rsp->kartweight = (UINT8)players[i].kartweight;
//
rsp->normalspeed = (fixed_t)LONG(players[i].normalspeed);
rsp->runspeed = (fixed_t)LONG(players[i].runspeed);
rsp->thrustfactor = players[i].thrustfactor;
rsp->accelstart = players[i].accelstart;
rsp->acceleration = players[i].acceleration;
rsp->charability = players[i].charability;
rsp->charability2 = players[i].charability2;
rsp->charflags = (UINT32)LONG(players[i].charflags);
rsp->thokitem = (UINT32)LONG(players[i].thokitem); //mobjtype_t
rsp->spinitem = (UINT32)LONG(players[i].spinitem); //mobjtype_t
rsp->revitem = (UINT32)LONG(players[i].revitem); //mobjtype_t
rsp->actionspd = (fixed_t)LONG(players[i].actionspd);
rsp->mindash = (fixed_t)LONG(players[i].mindash);
rsp->maxdash = (fixed_t)LONG(players[i].maxdash);
rsp->jumpfactor = (fixed_t)LONG(players[i].jumpfactor);
rsp->speed = (fixed_t)LONG(players[i].speed);
rsp->jumping = players[i].jumping;
@ -720,21 +706,7 @@ static void resynch_read_player(resynch_pak *rsp)
players[i].kartspeed = (UINT8)rsp->kartspeed;
players[i].kartweight = (UINT8)rsp->kartweight;
players[i].normalspeed = (fixed_t)LONG(rsp->normalspeed);
players[i].runspeed = (fixed_t)LONG(rsp->runspeed);
players[i].thrustfactor = rsp->thrustfactor;
players[i].accelstart = rsp->accelstart;
players[i].acceleration = rsp->acceleration;
players[i].charability = rsp->charability;
players[i].charability2 = rsp->charability2;
players[i].charflags = (UINT32)LONG(rsp->charflags);
players[i].thokitem = (UINT32)LONG(rsp->thokitem); //mobjtype_t
players[i].spinitem = (UINT32)LONG(rsp->spinitem); //mobjtype_t
players[i].revitem = (UINT32)LONG(rsp->revitem); //mobjtype_t
players[i].actionspd = (fixed_t)LONG(rsp->actionspd);
players[i].mindash = (fixed_t)LONG(rsp->mindash);
players[i].maxdash = (fixed_t)LONG(rsp->maxdash);
players[i].jumpfactor = (fixed_t)LONG(rsp->jumpfactor);
players[i].speed = (fixed_t)LONG(rsp->speed);
players[i].jumping = rsp->jumping;

View File

@ -222,21 +222,7 @@ typedef struct
UINT8 kartspeed;
UINT8 kartweight;
//
fixed_t normalspeed;
fixed_t runspeed;
UINT8 thrustfactor;
UINT8 accelstart;
UINT8 acceleration;
UINT8 charability;
UINT8 charability2;
UINT32 charflags;
UINT32 thokitem; // mobjtype_t
UINT32 spinitem; // mobjtype_t
UINT32 revitem; // mobjtype_t
fixed_t actionspd;
fixed_t mindash;
fixed_t maxdash;
fixed_t jumpfactor;
fixed_t speed;
UINT8 jumping;

View File

@ -35,33 +35,6 @@ typedef enum
SF_HIRES = 1, // Draw the sprite 2x as small?
} skinflags_t;
//Primary and secondary skin abilities
typedef enum
{
CA_NONE=0,
CA_THOK,
CA_FLY,
CA_GLIDEANDCLIMB,
CA_HOMINGTHOK,
CA_SWIM,
CA_DOUBLEJUMP,
CA_FLOAT,
CA_SLOWFALL,
CA_TELEKINESIS,
CA_FALLSWITCH,
CA_JUMPBOOST,
CA_AIRDRILL,
CA_JUMPTHOK
} charability_t;
//Secondary skin abilities
typedef enum
{
CA2_NONE=0,
CA2_SPINDASH,
CA2_MULTIABILITY
} charability2_t;
//
// Player states.
//
@ -442,29 +415,8 @@ typedef struct player_s
UINT8 kartweight; // Kart weight stat between 1 and 9
//
fixed_t normalspeed; // Normal ground
fixed_t runspeed; // Speed you break into the run animation
UINT8 thrustfactor; // Thrust = thrustfactor * acceleration
UINT8 accelstart; // Starting acceleration if speed = 0.
UINT8 acceleration; // Acceleration
// See charability_t and charability2_t for more information.
UINT8 charability; // Ability definition
UINT8 charability2; // Secondary ability definition
UINT32 charflags; // Extra abilities/settings for skins (combinable stuff)
// See SF_ flags
mobjtype_t thokitem; // Object # to spawn for the thok
mobjtype_t spinitem; // Object # to spawn for spindash/spinning
mobjtype_t revitem; // Object # to spawn for spindash/spinning
fixed_t actionspd; // Speed of thok/glide/fly
fixed_t mindash; // Minimum spindash speed
fixed_t maxdash; // Maximum spindash speed
fixed_t jumpfactor; // How high can the player jump?
SINT8 lives;
SINT8 continues; // continues that player has acquired

View File

@ -8649,27 +8649,6 @@ struct {
// Character flags (skinflags_t)
{"SF_HIRES",SF_HIRES},
// Character abilities!
// Primary
{"CA_NONE",CA_NONE}, // now slot 0!
{"CA_THOK",CA_THOK},
{"CA_FLY",CA_FLY},
{"CA_GLIDEANDCLIMB",CA_GLIDEANDCLIMB},
{"CA_HOMINGTHOK",CA_HOMINGTHOK},
{"CA_DOUBLEJUMP",CA_DOUBLEJUMP},
{"CA_FLOAT",CA_FLOAT},
{"CA_SLOWFALL",CA_SLOWFALL},
{"CA_SWIM",CA_SWIM},
{"CA_TELEKINESIS",CA_TELEKINESIS},
{"CA_FALLSWITCH",CA_FALLSWITCH},
{"CA_JUMPBOOST",CA_JUMPBOOST},
{"CA_AIRDRILL",CA_AIRDRILL},
{"CA_JUMPTHOK",CA_JUMPTHOK},
// Secondary
{"CA2_NONE",CA2_NONE}, // now slot 0!
{"CA2_SPINDASH",CA2_SPINDASH},
{"CA2_MULTIABILITY",CA2_MULTIABILITY},
// Sound flags
{"SF_TOTALLYSINGLE",SF_TOTALLYSINGLE},
{"SF_NOMULTIPLESOUND",SF_NOMULTIPLESOUND},

View File

@ -2331,25 +2331,12 @@ void G_PlayerReborn(INT32 player)
INT32 score, marescore;
INT32 lives;
INT32 continues;
UINT8 charability;
UINT8 charability2;
// SRB2kart
UINT8 kartspeed;
UINT8 kartweight;
//
fixed_t normalspeed;
fixed_t runspeed;
UINT8 thrustfactor;
UINT8 accelstart;
UINT8 acceleration;
INT32 charflags;
INT32 pflags;
UINT32 thokitem;
UINT32 spinitem;
UINT32 revitem;
fixed_t actionspd;
fixed_t mindash;
fixed_t maxdash;
INT32 ctfteam;
INT32 starposttime;
INT16 starpostx;
@ -2357,7 +2344,6 @@ void G_PlayerReborn(INT32 player)
INT16 starpostz;
INT32 starpostnum;
INT32 starpostangle;
fixed_t jumpfactor;
INT32 exiting;
INT16 numboxes;
INT16 totalring;
@ -2405,17 +2391,10 @@ void G_PlayerReborn(INT32 player)
skincolor = players[player].skincolor;
skin = players[player].skin;
charability = players[player].charability;
charability2 = players[player].charability2;
// SRB2kart
kartspeed = players[player].kartspeed;
kartweight = players[player].kartweight;
//
normalspeed = players[player].normalspeed;
runspeed = players[player].runspeed;
thrustfactor = players[player].thrustfactor;
accelstart = players[player].accelstart;
acceleration = players[player].acceleration;
charflags = players[player].charflags;
starposttime = players[player].starposttime;
@ -2425,13 +2404,6 @@ void G_PlayerReborn(INT32 player)
starpostnum = players[player].starpostnum;
respawnflip = players[player].kartstuff[k_starpostflip]; //SRB2KART
starpostangle = players[player].starpostangle;
jumpfactor = players[player].jumpfactor;
thokitem = players[player].thokitem;
spinitem = players[player].spinitem;
revitem = players[player].revitem;
actionspd = players[player].actionspd;
mindash = players[player].mindash;
maxdash = players[player].maxdash;
mare = players[player].mare;
bot = players[player].bot;
@ -2495,24 +2467,11 @@ void G_PlayerReborn(INT32 player)
// save player config truth reborn
p->skincolor = skincolor;
p->skin = skin;
p->charability = charability;
p->charability2 = charability2;
// SRB2kart
p->kartspeed = kartspeed;
p->kartweight = kartweight;
//
p->normalspeed = normalspeed;
p->runspeed = runspeed;
p->thrustfactor = thrustfactor;
p->accelstart = accelstart;
p->acceleration = acceleration;
p->charflags = charflags;
p->thokitem = thokitem;
p->spinitem = spinitem;
p->revitem = revitem;
p->actionspd = actionspd;
p->mindash = mindash;
p->maxdash = maxdash;
p->starposttime = starposttime;
p->starpostx = starpostx;
@ -2520,7 +2479,6 @@ void G_PlayerReborn(INT32 player)
p->starpostz = starpostz;
p->starpostnum = starpostnum;
p->starpostangle = starpostangle;
p->jumpfactor = jumpfactor;
p->exiting = exiting;
p->numboxes = numboxes;
@ -5537,24 +5495,21 @@ void G_BeginRecording(void)
demo_p += 16;
// Stats
WRITEUINT8(demo_p,player->charability);
WRITEUINT8(demo_p,player->charability2);
WRITEUINT8(demo_p,player->actionspd>>FRACBITS);
WRITEUINT8(demo_p,player->mindash>>FRACBITS);
WRITEUINT8(demo_p,player->maxdash>>FRACBITS);
// SRB2kart
demo_p++; // charability
demo_p++; // charability2
demo_p++; // actionspd
demo_p++; // mindash
demo_p++; // maxdash
// SRB2Kart
WRITEUINT8(demo_p,player->kartspeed);
WRITEUINT8(demo_p,player->kartweight);
//
WRITEUINT8(demo_p,player->normalspeed>>FRACBITS);
WRITEUINT8(demo_p,player->runspeed>>FRACBITS);
WRITEUINT8(demo_p,player->thrustfactor);
WRITEUINT8(demo_p,player->accelstart);
WRITEUINT8(demo_p,player->acceleration);
// Trying to convert it back to % causes demo desync due to precision loss.
// Don't do it.
WRITEFIXED(demo_p, player->jumpfactor);
demo_p++; // normalspeed
demo_p++; // runspeed
demo_p++; // thrustfactor
demo_p++; // accelstart
demo_p++; // acceleration
demo_p += 4; // jumpfactor
// Save netvar data (SONICCD, etc)
CV_SaveNetVars(&demo_p);
@ -5767,9 +5722,8 @@ void G_DoPlayDemo(char *defdemoname)
UINT8 i;
lumpnum_t l;
char skin[17],color[17],*n,*pdemoname;
UINT8 version,subversion,charability,charability2,kartspeed,kartweight,thrustfactor,accelstart,acceleration;
UINT8 version,subversion,kartspeed,kartweight;
UINT32 randseed;
fixed_t actionspd,mindash,maxdash,normalspeed,runspeed,jumpfactor;
char msg[1024];
#if defined(SKIPERRORS) && !defined(DEVELOP)
boolean skiperrors = false;
@ -5906,21 +5860,21 @@ void G_DoPlayDemo(char *defdemoname)
M_Memcpy(color,demo_p,16);
demo_p += 16;
charability = READUINT8(demo_p);
charability2 = READUINT8(demo_p);
actionspd = (fixed_t)READUINT8(demo_p)<<FRACBITS;
mindash = (fixed_t)READUINT8(demo_p)<<FRACBITS;
maxdash = (fixed_t)READUINT8(demo_p)<<FRACBITS;
demo_p++; // charability
demo_p++; // charability2
demo_p++; // actionspd
demo_p++; // mindash
demo_p++; // maxdash
// SRB2kart
kartspeed = READUINT8(demo_p);
kartweight = READUINT8(demo_p);
//
normalspeed = (fixed_t)READUINT8(demo_p)<<FRACBITS;
runspeed = (fixed_t)READUINT8(demo_p)<<FRACBITS;
thrustfactor = READUINT8(demo_p);
accelstart = READUINT8(demo_p);
acceleration = READUINT8(demo_p);
jumpfactor = READFIXED(demo_p);
demo_p++; // normalspeed
demo_p++; // runspeed
demo_p++; // thrustfactor
demo_p++; // accelstart
demo_p++; // acceleration
demo_p += 4; // jumpfactor
// net var data
CV_LoadNetVars(&demo_p);
@ -6014,21 +5968,10 @@ void G_DoPlayDemo(char *defdemoname)
// Set saved attribute values
// No cheat checking here, because even if they ARE wrong...
// it would only break the replay if we clipped them.
players[0].charability = charability;
players[0].charability2 = charability2;
players[0].actionspd = actionspd;
players[0].mindash = mindash;
players[0].maxdash = maxdash;
// SRB2kart
players[0].kartspeed = kartspeed;
players[0].kartweight = kartweight;
//
players[0].normalspeed = normalspeed;
players[0].runspeed = runspeed;
players[0].thrustfactor = thrustfactor;
players[0].accelstart = accelstart;
players[0].acceleration = acceleration;
players[0].jumpfactor = jumpfactor;
demo_start = true;
}

View File

@ -946,40 +946,6 @@ static int lib_pHomingAttack(lua_State *L)
return 1;
}*/
static int lib_pDoJump(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
boolean soundandstate = (boolean)lua_opttrueboolean(L, 2);
NOHUD
if (!player)
return LUA_ErrInvalid(L, "player_t");
P_DoJump(player, soundandstate);
return 0;
}
static int lib_pSpawnThokMobj(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
NOHUD
if (!player)
return LUA_ErrInvalid(L, "player_t");
P_SpawnThokMobj(player);
return 0;
}
static int lib_pSpawnSpinMobj(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
mobjtype_t type = luaL_checkinteger(L, 2);
NOHUD
if (!player)
return LUA_ErrInvalid(L, "player_t");
if (type >= NUMMOBJTYPES)
return luaL_error(L, "mobj type %d out of range (0 - %d)", type, NUMMOBJTYPES-1);
P_SpawnSpinMobj(player, type);
return 0;
}
static int lib_pTelekinesis(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
@ -2645,9 +2611,6 @@ static luaL_Reg lib[] = {
{"P_NukeEnemies",lib_pNukeEnemies},
{"P_HomingAttack",lib_pHomingAttack},
//{"P_SuperReady",lib_pSuperReady},
{"P_DoJump",lib_pDoJump},
{"P_SpawnThokMobj",lib_pSpawnThokMobj},
{"P_SpawnSpinMobj",lib_pSpawnSpinMobj},
{"P_Telekinesis",lib_pTelekinesis},
// p_map

View File

@ -155,36 +155,8 @@ static int player_get(lua_State *L)
else if (fastcmp(field,"kartweight"))
lua_pushinteger(L, plr->kartweight);
//
else if (fastcmp(field,"normalspeed"))
lua_pushfixed(L, plr->normalspeed);
else if (fastcmp(field,"runspeed"))
lua_pushfixed(L, plr->runspeed);
else if (fastcmp(field,"thrustfactor"))
lua_pushinteger(L, plr->thrustfactor);
else if (fastcmp(field,"accelstart"))
lua_pushinteger(L, plr->accelstart);
else if (fastcmp(field,"acceleration"))
lua_pushinteger(L, plr->acceleration);
else if (fastcmp(field,"charability"))
lua_pushinteger(L, plr->charability);
else if (fastcmp(field,"charability2"))
lua_pushinteger(L, plr->charability2);
else if (fastcmp(field,"charflags"))
lua_pushinteger(L, plr->charflags);
else if (fastcmp(field,"thokitem"))
lua_pushinteger(L, plr->thokitem);
else if (fastcmp(field,"spinitem"))
lua_pushinteger(L, plr->spinitem);
else if (fastcmp(field,"revitem"))
lua_pushinteger(L, plr->revitem);
else if (fastcmp(field,"actionspd"))
lua_pushfixed(L, plr->actionspd);
else if (fastcmp(field,"mindash"))
lua_pushfixed(L, plr->mindash);
else if (fastcmp(field,"maxdash"))
lua_pushfixed(L, plr->maxdash);
else if (fastcmp(field,"jumpfactor"))
lua_pushfixed(L, plr->jumpfactor);
else if (fastcmp(field,"lives"))
lua_pushinteger(L, plr->lives);
else if (fastcmp(field,"continues"))
@ -431,36 +403,8 @@ static int player_set(lua_State *L)
else if (fastcmp(field,"kartweight"))
plr->kartweight = (UINT8)luaL_checkinteger(L, 3);
//
else if (fastcmp(field,"normalspeed"))
plr->normalspeed = luaL_checkfixed(L, 3);
else if (fastcmp(field,"runspeed"))
plr->runspeed = luaL_checkfixed(L, 3);
else if (fastcmp(field,"thrustfactor"))
plr->thrustfactor = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"accelstart"))
plr->accelstart = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"acceleration"))
plr->acceleration = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"charability"))
plr->charability = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"charability2"))
plr->charability2 = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"charflags"))
plr->charflags = (UINT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"thokitem"))
plr->thokitem = luaL_checkinteger(L, 3);
else if (fastcmp(field,"spinitem"))
plr->spinitem = luaL_checkinteger(L, 3);
else if (fastcmp(field,"revitem"))
plr->revitem = luaL_checkinteger(L, 3);
else if (fastcmp(field,"actionspd"))
plr->actionspd = (INT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"mindash"))
plr->mindash = (INT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"maxdash"))
plr->maxdash = (INT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"jumpfactor"))
plr->jumpfactor = (INT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"lives"))
plr->lives = (SINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"continues"))

View File

@ -4781,8 +4781,8 @@ void A_DetonChase(mobj_t *actor)
actor->reactiontime = -42;
exact = actor->movedir>>ANGLETOFINESHIFT;
xyspeed = FixedMul(FixedMul(actor->tracer->player->normalspeed,3*FRACUNIT/4), FINECOSINE(exact));
actor->momz = FixedMul(FixedMul(actor->tracer->player->normalspeed,3*FRACUNIT/4), FINESINE(exact));
xyspeed = FixedMul(FixedMul(K_GetKartSpeed(actor->tracer->player, false),3*FRACUNIT/4), FINECOSINE(exact));
actor->momz = FixedMul(FixedMul(K_GetKartSpeed(actor->tracer->player, false),3*FRACUNIT/4), FINESINE(exact));
exact = actor->angle>>ANGLETOFINESHIFT;
actor->momx = FixedMul(xyspeed, FINECOSINE(exact));

View File

@ -178,7 +178,6 @@ boolean P_LookForEnemies(player_t *player);
void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius);
void P_HomingAttack(mobj_t *source, mobj_t *enemy); /// \todo doesn't belong in p_user
//boolean P_SuperReady(player_t *player);
void P_DoJump(player_t *player, boolean soundandstate);
boolean P_AnalogMove(player_t *player);
/*boolean P_TransferToNextMare(player_t *player);
UINT8 P_FindLowestMare(void);*/
@ -187,8 +186,6 @@ UINT8 P_FindHighestLap(void);
void P_FindEmerald(void);
//void P_TransferToAxis(player_t *player, INT32 axisnum);
boolean P_PlayerMoving(INT32 pnum);
void P_SpawnThokMobj(player_t *player);
void P_SpawnSpinMobj(player_t *player, mobjtype_t type);
void P_Telekinesis(player_t *player, fixed_t thrust, fixed_t range);
void P_PlayLivesJingle(player_t *player);

View File

@ -1932,7 +1932,7 @@ void P_XYMovement(mobj_t *mo)
if (mo->type == MT_ORBINAUT || mo->type == MT_JAWZ_DUD || mo->type == MT_JAWZ || mo->type == MT_BALLHOG) //(mo->type == MT_JAWZ && !mo->tracer))
return;
if (mo->player && (mo->player->kartstuff[k_spinouttimer] && !mo->player->kartstuff[k_wipeoutslow]) && mo->player->speed <= mo->player->normalspeed/2)
if (mo->player && (mo->player->kartstuff[k_spinouttimer] && !mo->player->kartstuff[k_wipeoutslow]) && mo->player->speed <= K_GetKartSpeed(mo->player, false)/2)
return;
//}

View File

@ -265,25 +265,11 @@ static void P_NetArchivePlayers(void)
if (flags & AWAYVIEW)
WRITEUINT32(save_p, players[i].awayviewmobj->mobjnum);
WRITEUINT8(save_p, players[i].charability);
WRITEUINT8(save_p, players[i].charability2);
WRITEUINT32(save_p, players[i].charflags);
WRITEUINT32(save_p, (UINT32)players[i].thokitem);
WRITEUINT32(save_p, (UINT32)players[i].spinitem);
WRITEUINT32(save_p, (UINT32)players[i].revitem);
WRITEFIXED(save_p, players[i].actionspd);
WRITEFIXED(save_p, players[i].mindash);
WRITEFIXED(save_p, players[i].maxdash);
// SRB2kart
WRITEUINT8(save_p, players[i].kartspeed);
WRITEUINT8(save_p, players[i].kartweight);
//
WRITEFIXED(save_p, players[i].normalspeed);
WRITEFIXED(save_p, players[i].runspeed);
WRITEUINT8(save_p, players[i].thrustfactor);
WRITEUINT8(save_p, players[i].accelstart);
WRITEUINT8(save_p, players[i].acceleration);
WRITEFIXED(save_p, players[i].jumpfactor);
for (j = 0; j < MAXPREDICTTICS; j++)
{
@ -447,25 +433,11 @@ static void P_NetUnArchivePlayers(void)
players[i].viewheight = 32<<FRACBITS;
//SetPlayerSkinByNum(i, players[i].skin);
players[i].charability = READUINT8(save_p);
players[i].charability2 = READUINT8(save_p);
players[i].charflags = READUINT32(save_p);
players[i].thokitem = (mobjtype_t)READUINT32(save_p);
players[i].spinitem = (mobjtype_t)READUINT32(save_p);
players[i].revitem = (mobjtype_t)READUINT32(save_p);
players[i].actionspd = READFIXED(save_p);
players[i].mindash = READFIXED(save_p);
players[i].maxdash = READFIXED(save_p);
// SRB2kart
players[i].kartspeed = READUINT8(save_p);
players[i].kartweight = READUINT8(save_p);
//
players[i].normalspeed = READFIXED(save_p);
players[i].runspeed = READFIXED(save_p);
players[i].thrustfactor = READUINT8(save_p);
players[i].accelstart = READUINT8(save_p);
players[i].acceleration = READUINT8(save_p);
players[i].jumpfactor = READFIXED(save_p);
for (j = 0; j < MAXPREDICTTICS; j++)
{

View File

@ -1653,113 +1653,6 @@ mobj_t *P_SpawnGhostMobj(mobj_t *mobj)
return ghost;
}
//
// P_SpawnThokMobj
//
// Spawns the appropriate thok object on the player
//
void P_SpawnThokMobj(player_t *player)
{
mobj_t *mobj;
mobjtype_t type = player->thokitem;
fixed_t zheight;
if (player->skincolor == 0)
return;
if (player->spectator)
return;
if (type == MT_GHOST)
mobj = P_SpawnGhostMobj(player->mo); // virtually does everything here for us
else
{
if (player->mo->eflags & MFE_VERTICALFLIP)
zheight = player->mo->z + player->mo->height + FixedDiv(P_GetPlayerHeight(player) - player->mo->height, 3*FRACUNIT) - FixedMul(mobjinfo[type].height, player->mo->scale);
else
zheight = player->mo->z - FixedDiv(P_GetPlayerHeight(player) - player->mo->height, 3*FRACUNIT);
if (!(player->mo->eflags & MFE_VERTICALFLIP) && zheight < player->mo->floorz && !(mobjinfo[type].flags & MF_NOCLIPHEIGHT))
zheight = player->mo->floorz;
else if (player->mo->eflags & MFE_VERTICALFLIP && zheight + FixedMul(mobjinfo[type].height, player->mo->scale) > player->mo->ceilingz && !(mobjinfo[type].flags & MF_NOCLIPHEIGHT))
zheight = player->mo->ceilingz - FixedMul(mobjinfo[type].height, player->mo->scale);
mobj = P_SpawnMobj(player->mo->x, player->mo->y, zheight, type);
// set to player's angle, just in case
mobj->angle = player->mo->angle;
// color and skin
mobj->color = player->mo->color;
mobj->skin = player->mo->skin;
// vertical flip
if (player->mo->eflags & MFE_VERTICALFLIP)
mobj->flags2 |= MF2_OBJECTFLIP;
mobj->eflags |= (player->mo->eflags & MFE_VERTICALFLIP);
// scale
P_SetScale(mobj, player->mo->scale);
mobj->destscale = player->mo->scale;
}
P_SetTarget(&mobj->target, player->mo); // the one thing P_SpawnGhostMobj doesn't do
if (demorecording)
G_GhostAddThok();
}
//
// P_SpawnSpinMobj
//
// Spawns the appropriate spin object on the player
//
void P_SpawnSpinMobj(player_t *player, mobjtype_t type)
{
mobj_t *mobj;
fixed_t zheight;
if (player->skincolor == 0)
return;
if (player->spectator)
return;
if (type == MT_GHOST)
mobj = P_SpawnGhostMobj(player->mo); // virtually does everything here for us
else
{
if (player->mo->eflags & MFE_VERTICALFLIP)
zheight = player->mo->z + player->mo->height + FixedDiv(P_GetPlayerHeight(player) - player->mo->height, 3*FRACUNIT) - FixedMul(mobjinfo[type].height, player->mo->scale);
else
zheight = player->mo->z - FixedDiv(P_GetPlayerHeight(player) - player->mo->height, 3*FRACUNIT);
if (!(player->mo->eflags & MFE_VERTICALFLIP) && zheight < player->mo->floorz && !(mobjinfo[type].flags & MF_NOCLIPHEIGHT))
zheight = player->mo->floorz;
else if (player->mo->eflags & MFE_VERTICALFLIP && zheight + FixedMul(mobjinfo[type].height, player->mo->scale) > player->mo->ceilingz && !(mobjinfo[type].flags & MF_NOCLIPHEIGHT))
zheight = player->mo->ceilingz - FixedMul(mobjinfo[type].height, player->mo->scale);
mobj = P_SpawnMobj(player->mo->x, player->mo->y, zheight, type);
// set to player's angle, just in case
mobj->angle = player->mo->angle;
// color and skin
mobj->color = player->mo->color;
mobj->skin = player->mo->skin;
// vertical flip
if (player->mo->eflags & MFE_VERTICALFLIP)
mobj->flags2 |= MF2_OBJECTFLIP;
mobj->eflags |= (player->mo->eflags & MFE_VERTICALFLIP);
// scale
P_SetScale(mobj, player->mo->scale);
mobj->destscale = player->mo->scale;
}
P_SetTarget(&mobj->target, player->mo); // the one thing P_SpawnGhostMobj doesn't do
}
//
// P_DoPlayerExit
//
@ -1960,13 +1853,13 @@ static void P_CheckBustableBlocks(player_t *player)
// ...or are drilling in NiGHTS (or Metal Sonic)
if (!(rover->flags & FF_SHATTER) && !(rover->flags & FF_SPINBUST)
&& !((player->pflags & PF_SPINNING) && !(player->pflags & PF_JUMPED))
&& (player->charability != CA_GLIDEANDCLIMB && !player->powers[pw_super])
&& (/*player->charability != CA_GLIDEANDCLIMB &&*/ !player->powers[pw_super])
&& !(player->pflags & PF_DRILLING) && !metalrecording)
continue;
// Only Knuckles can break this rock...
if (!(rover->flags & FF_SHATTER) && (rover->flags & FF_ONLYKNUX) && !(player->charability == CA_GLIDEANDCLIMB))
continue;
/*if (!(rover->flags & FF_SHATTER) && (rover->flags & FF_ONLYKNUX) && !(player->charability == CA_GLIDEANDCLIMB))
continue;*/
topheight = P_GetFOFTopZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL);
bottomheight = P_GetFOFBottomZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL);
@ -2468,7 +2361,7 @@ static void P_DoBubbleBreath(player_t *player)
return;
// Tails stirs up the water while flying in it
if (player->powers[pw_tailsfly] && (leveltime & 1) && player->charability != CA_SWIM)
/*if (player->powers[pw_tailsfly] && (leveltime & 1) && player->charability != CA_SWIM)
{
fixed_t radius = (3*player->mo->radius)>>1;
angle_t fa = ((leveltime%45)*FINEANGLES/8) & FINEMASK;
@ -2494,7 +2387,7 @@ static void P_DoBubbleBreath(player_t *player)
stirwaterz, MT_SMALLBUBBLE);
bubble->destscale = player->mo->scale;
P_SetScale(bubble,bubble->destscale);
}
}*/
}
//
@ -3634,195 +3527,6 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) // SRB2kart - unused.
}
*/
//
// P_DoJump
//
// Jump routine for the player
//
void P_DoJump(player_t *player, boolean soundandstate)
{
fixed_t factor;
const fixed_t dist6 = FixedMul(FixedDiv(player->speed, player->mo->scale), player->actionspd)/20;
return;
if (player->pflags & PF_JUMPSTASIS)
return;
if (!player->jumpfactor)
return;
if (player->kartstuff[k_spinouttimer]) // SRB2kart
return;
/* // SRB2kart - climbing in a kart?
if (player->climbing)
{
// Jump this high.
if (player->powers[pw_super])
player->mo->momz = 5*FRACUNIT;
else if (player->mo->eflags & MFE_UNDERWATER)
player->mo->momz = 2*FRACUNIT;
else
player->mo->momz = 15*(FRACUNIT/4);
player->mo->angle = player->mo->angle - ANGLE_180; // Turn around from the wall you were climbing.
if (player == &players[consoleplayer])
localangle = player->mo->angle; // Adjust the local control angle.
else if (player == &players[secondarydisplayplayer])
localangle2 = player->mo->angle;
else if (player == &players[thirddisplayplayer])
localangle3 = player->mo->angle;
else if (player == &players[fourthdisplayplayer])
localangle4 = player->mo->angle;
player->climbing = 0; // Stop climbing, duh!
P_InstaThrust(player->mo, player->mo->angle, FixedMul(6*FRACUNIT, player->mo->scale)); // Jump off the wall.
}
// Quicksand jumping.
else if (P_InQuicksand(player->mo))
{
if (player->mo->ceilingz-player->mo->floorz <= player->mo->height-1)
return;
player->mo->momz += (39*(FRACUNIT/4))>>1;
if (player->mo->momz >= 6*FRACUNIT)
player->mo->momz = 6*FRACUNIT; //max momz in quicksand
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
{
if (player->mo->ceilingz-player->mo->floorz <= player->mo->height-1)
return;
// Jump this high.
if (player->pflags & PF_CARRIED)
{
player->mo->momz = 9*FRACUNIT;
player->pflags &= ~PF_CARRIED;
/*if (player-players == consoleplayer && botingame)
CV_SetValue(&cv_analog2, true);*/
}
else if (player->pflags & PF_ITEMHANG)
{
player->mo->momz = 9*FRACUNIT;
player->pflags &= ~PF_ITEMHANG;
}
else if (player->pflags & PF_ROPEHANG)
{
player->mo->momz = 12*FRACUNIT;
player->pflags &= ~PF_ROPEHANG;
P_SetTarget(&player->mo->tracer, NULL);
}
else if (player->mo->eflags & MFE_GOOWATER)
{
player->mo->momz = 7*FRACUNIT;
if (player->charability == CA_JUMPBOOST && onground)
{
if (player->charability2 == CA2_MULTIABILITY)
player->mo->momz += FixedMul(FRACUNIT/4, dist6);
else
player->mo->momz += FixedMul(FRACUNIT/8, dist6);
}
}
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)
player->mo->momz = 28*FRACUNIT; //Obscene jump height anyone?
else if (player->charability == CA_SLOWFALL)
player->mo->momz = 37*(FRACUNIT/2); //Less obscene because during super, floating propells oneself upward.
else // Default super jump momentum.
player->mo->momz = 13*FRACUNIT;
// Add a boost for super characters with float/slowfall and multiability.
if (player->charability2 == CA2_MULTIABILITY &&
(player->charability == CA_FLOAT || player->charability == CA_SLOWFALL))
player->mo->momz += 2*FRACUNIT;
else if (player->charability == CA_JUMPBOOST)
{
if (player->charability2 == CA2_MULTIABILITY)
player->mo->momz += FixedMul(FRACUNIT/4, dist6);
else
player->mo->momz += FixedMul(FRACUNIT/8, dist6);
}
}
else if (player->charability2 == CA2_MULTIABILITY &&
(player->charability == CA_DOUBLEJUMP || player->charability == CA_FLOAT || player->charability == CA_SLOWFALL))
{
// Multiability exceptions, since some abilities cannot effectively use it and need a boost.
if (player->charability == CA_DOUBLEJUMP)
player->mo->momz = 23*(FRACUNIT/2); // Increased jump height instead of infinite jumps.
else if (player->charability == CA_FLOAT || player->charability == CA_SLOWFALL)
player->mo->momz = 12*FRACUNIT; // Increased jump height due to ineffective repeat.
}
else
{
player->mo->momz = 39*(FRACUNIT/4); // Default jump momentum.
if (player->charability == CA_JUMPBOOST && onground)
{
if (player->charability2 == CA2_MULTIABILITY)
player->mo->momz += FixedMul(FRACUNIT/4, dist6);
else
player->mo->momz += FixedMul(FRACUNIT/8, dist6);
}
}
*/
// Reduce player momz by 58.5% when underwater.
if (player->mo->eflags & MFE_UNDERWATER)
player->mo->momz = FixedMul(player->mo->momz, FixedDiv(117*FRACUNIT, 200*FRACUNIT));
player->jumping = 1;
}
factor = player->jumpfactor;
if (twodlevel || (player->mo->flags2 & MF2_TWOD))
factor += player->jumpfactor / 10;
P_SetObjectMomZ(player->mo, FixedMul(factor, player->mo->momz), false); // Custom height
// set just an eensy above the ground
if (player->mo->eflags & MFE_VERTICALFLIP)
{
player->mo->z--;
if (player->mo->pmomz < 0)
player->mo->momz += player->mo->pmomz; // Add the platform's momentum to your jump.
else
player->mo->pmomz = 0;
}
else
{
player->mo->z++;
if (player->mo->pmomz > 0)
player->mo->momz += player->mo->pmomz; // Add the platform's momentum to your jump.
else
player->mo->pmomz = 0;
}
player->mo->eflags &= ~MFE_APPLYPMOMZ;
player->pflags |= PF_JUMPED;
if (soundandstate)
{
if (!player->spectator)
S_StartSound(player->mo, sfx_jump); // Play jump sound!
/* // SRB2kart - don't need jump frames
if (!(player->charability2 == CA2_SPINDASH))
P_SetPlayerMobjState(player->mo, S_PLAY_SPRING);
else
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
*/
}
}
//
// P_DoSpinDash
//
@ -3946,7 +3650,7 @@ void P_DoJumpShield(player_t *player)
return;
player->pflags &= ~PF_JUMPED;
P_DoJump(player, false);
//P_DoJump(player, false);
player->pflags &= ~PF_JUMPED;
player->secondjump = 0;
player->jumping = 0;
@ -4004,338 +3708,10 @@ void P_Telekinesis(player_t *player, fixed_t thrust, fixed_t range)
}
}
P_SpawnThokMobj(player);
//P_SpawnThokMobj(player);
player->pflags |= PF_THOKKED;
}
//
// P_DoJumpStuff
//
// Handles player jumping
//
static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
{
if (player->pflags & PF_JUMPSTASIS)
return;
if (cmd->buttons & BT_BRAKE && !(player->pflags & PF_JUMPDOWN) && !player->exiting && !P_PlayerInPain(player))
{
if (onground || player->climbing || player->pflags & (PF_CARRIED|PF_ITEMHANG|PF_ROPEHANG))
{}
else if (player->pflags & PF_MACESPIN && player->mo->tracer)
{}
else if (!(player->pflags & PF_SLIDING) && ((gametype != GT_CTF) || (!player->gotflag)))
{
#ifdef HAVE_BLUA
if (!LUAh_JumpSpinSpecial(player))
#endif
switch (player->charability)
{
case CA_TELEKINESIS:
if (player->pflags & PF_JUMPED)
{
if (!(player->pflags & PF_THOKKED) || (player->charability2 == CA2_MULTIABILITY))
{
P_Telekinesis(player,
-FixedMul(player->actionspd, player->mo->scale), // -ve thrust (pulling towards player)
FixedMul(384*FRACUNIT, player->mo->scale));
}
}
break;
case CA_AIRDRILL:
if (player->pflags & PF_JUMPED)
{
if (player->pflags & PF_THOKKED) // speed up falling down
{
if (player->secondjump < 42)
player->secondjump ++;
}
}
break;
default:
break;
}
}
}
if (player->charability == CA_AIRDRILL)
{
if (player->pflags & PF_JUMPED)
{
if (player->flyangle > 0 && player->pflags & PF_THOKKED)
{
player->flyangle--;
P_SetObjectMomZ(player->mo, ((player->flyangle-24 - player->secondjump*3)*((player->actionspd>>FRACBITS)/12 + 1)<<FRACBITS)/7, false);
P_SpawnThokMobj(player);
if ((player->mo->eflags & MFE_UNDERWATER))
P_InstaThrust(player->mo, player->mo->angle, FixedMul(player->normalspeed, player->mo->scale)*(80-player->flyangle - (player->actionspd>>FRACBITS)/2)/80);
else
P_InstaThrust(player->mo, player->mo->angle, ((FixedMul(player->normalspeed - player->actionspd/4, player->mo->scale))*2)/3);
}
}
}
if (cmd->buttons & BT_DRIFT && !player->exiting && !P_PlayerInPain(player))
{
#ifdef HAVE_BLUA
if (LUAh_JumpSpecial(player))
;
else
#endif
if (player->pflags & PF_JUMPDOWN) // all situations below this require jump button not to be pressed already
;
else
// Jump S3&K style while in quicksand.
if (P_InQuicksand(player->mo))
{
P_DoJump(player, true);
player->secondjump = 0;
player->pflags &= ~PF_THOKKED;
}
else
// can't jump while in air, can't jump while jumping
if (onground || player->climbing || player->pflags & (PF_CARRIED|PF_ITEMHANG|PF_ROPEHANG))
{
P_DoJump(player, true);
player->secondjump = 0;
player->pflags &= ~PF_THOKKED;
}
/* // SRB2kart - no jumpy power things
else if (player->pflags & PF_MACESPIN && player->mo->tracer)
{
player->pflags &= ~PF_MACESPIN;
player->powers[pw_flashing] = TICRATE/4;
}
else if (player->pflags & PF_SLIDING || (gametype == GT_CTF && player->gotflag))
;
else if (P_SuperReady(player))
{
// If you can turn super and aren't already,
// and you don't have a shield, do it!
P_DoSuperTransformation(player, false);
}
else if (player->pflags & PF_JUMPED)
{
#ifdef HAVE_BLUA
if (!LUAh_AbilitySpecial(player))
#endif
switch (player->charability)
{
case CA_THOK:
case CA_HOMINGTHOK:
case CA_JUMPTHOK: // Credit goes to CZ64 and Sryder13 for the original
// Now it's Sonic's abilities turn!
// THOK!
if (!(player->pflags & PF_THOKKED) || (player->charability2 == CA2_MULTIABILITY))
{
// Catapult the player
fixed_t actionspd = player->actionspd;
if (player->mo->eflags & MFE_UNDERWATER)
actionspd >>= 1;
if ((player->charability == CA_JUMPTHOK) && !(player->pflags & PF_THOKKED))
{
player->pflags &= ~PF_JUMPED;
P_DoJump(player, false);
}
P_InstaThrust(player->mo, player->mo->angle, FixedMul(actionspd, player->mo->scale));
if (maptol & TOL_2D)
{
player->mo->momx /= 2;
player->mo->momy /= 2;
}
else if (player->charability == CA_HOMINGTHOK)
{
player->mo->momx /= 3;
player->mo->momy /= 3;
}
if (player->mo->info->attacksound && !player->spectator)
S_StartSound(player->mo, player->mo->info->attacksound); // Play the THOK sound
P_SpawnThokMobj(player);
if (player->charability == CA_HOMINGTHOK && !player->homing)
{
if (P_LookForEnemies(player))
{
if (player->mo->tracer)
player->homing = 3*TICRATE;
}
}
player->pflags &= ~(PF_SPINNING|PF_STARTDASH);
player->pflags |= PF_THOKKED;
}
break;
case CA_FLY:
case CA_SWIM: // Swim
// If currently in the air from a jump, and you pressed the
// button again and have the ability to fly, do so!
if (player->charability == CA_SWIM && !(player->mo->eflags & MFE_UNDERWATER))
; // Can't do anything if you're a fish out of water!
else if (!(player->pflags & PF_THOKKED) && !(player->powers[pw_tailsfly]))
{
//P_SetPlayerMobjState(player->mo, S_PLAY_ABL1); // Change to the flying animation
player->powers[pw_tailsfly] = tailsflytics + 1; // Set the fly timer
player->pflags &= ~(PF_JUMPED|PF_SPINNING|PF_STARTDASH);
player->pflags |= PF_THOKKED;
}
break;
case CA_GLIDEANDCLIMB:
// Now Knuckles-type abilities are checked.
// If you can turn super and aren't already,
// and you don't have a shield, do it!
if (!(player->pflags & PF_THOKKED) || player->charability2 == CA2_MULTIABILITY)
{
INT32 glidespeed = player->actionspd;
player->pflags |= PF_GLIDING|PF_THOKKED;
player->glidetime = 0;
if (player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]))
{
// Glide at double speed while super.
glidespeed *= 2;
player->pflags &= ~PF_THOKKED;
}
//P_SetPlayerMobjState(player->mo, S_PLAY_ABL1);
P_InstaThrust(player->mo, player->mo->angle, FixedMul(glidespeed, player->mo->scale));
player->pflags &= ~(PF_SPINNING|PF_STARTDASH);
}
break;
case CA_DOUBLEJUMP: // Double-Jump
if (!(player->pflags & PF_THOKKED))
{
player->pflags &= ~PF_JUMPED;
P_DoJump(player, true);
// Allow infinite double jumping if super.
if (!player->powers[pw_super])
player->pflags |= PF_THOKKED;
}
break;
case CA_FLOAT: // Float
case CA_SLOWFALL: // Slow descent hover
if (!player->secondjump)
player->secondjump = 1;
break;
case CA_TELEKINESIS:
if (!(player->pflags & PF_THOKKED) || player->charability2 == CA2_MULTIABILITY)
{
P_Telekinesis(player,
FixedMul(player->actionspd, player->mo->scale), // +ve thrust (pushing away from player)
FixedMul(384*FRACUNIT, player->mo->scale));
}
break;
case CA_FALLSWITCH:
if (!(player->pflags & PF_THOKKED) || player->charability2 == CA2_MULTIABILITY)
{
player->mo->momz = -player->mo->momz;
P_SpawnThokMobj(player);
player->pflags |= PF_THOKKED;
}
break;
case CA_AIRDRILL:
if (!(player->pflags & PF_THOKKED) || player->charability2 == CA2_MULTIABILITY)
{
player->flyangle = 56 + (60-(player->actionspd>>FRACBITS))/3;
player->pflags |= PF_THOKKED;
S_StartSound(player->mo, sfx_spndsh);
}
break;
default:
break;
}
}
else if (player->pflags & PF_THOKKED)
{
#ifdef HAVE_BLUA
if (!LUAh_AbilitySpecial(player))
#endif
switch (player->charability)
{
case CA_FLY:
case CA_SWIM: // Swim
if (player->charability == CA_SWIM && !(player->mo->eflags & MFE_UNDERWATER))
; // Can't do anything if you're a fish out of water!
else if (player->powers[pw_tailsfly]) // If currently flying, give an ascend boost.
{
if (!player->fly1)
player->fly1 = 20;
else
player->fly1 = 2;
if (player->charability == CA_SWIM)
player->fly1 /= 2;
// Slow down!
if (player->speed > FixedMul(8*FRACUNIT, player->mo->scale) && player->speed > FixedMul(player->normalspeed>>1, player->mo->scale))
P_Thrust(player->mo, R_PointToAngle2(0,0,player->mo->momx,player->mo->momy), FixedMul(-4*FRACUNIT, player->mo->scale));
}
break;
default:
break;
}
}
else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_JUMP && !player->powers[pw_super])
P_DoJumpShield(player);
*/
}
if (cmd->buttons & BT_DRIFT)
{
player->pflags |= PF_JUMPDOWN;
if ((gametype != GT_CTF || !player->gotflag) && !player->exiting)
{
if (player->secondjump == 1)
{
if (player->charability == CA_FLOAT)
player->mo->momz = 0;
else if (player->charability == CA_SLOWFALL)
{
if (player->powers[pw_super])
{
if (P_MobjFlip(player->mo)*player->mo->momz < gravity*16)
player->mo->momz = P_MobjFlip(player->mo)*gravity*16; //Float upward 4x as fast while super.
}
else if (P_MobjFlip(player->mo)*player->mo->momz < -gravity*4)
player->mo->momz = P_MobjFlip(player->mo)*-gravity*4;
}
player->pflags &= ~PF_SPINNING;
}
}
}
else // If not pressing the jump button
{
player->pflags &= ~PF_JUMPDOWN;
// Repeat abilities, but not double jump!
if ((player->charability2 == CA2_MULTIABILITY && player->charability != CA_DOUBLEJUMP)
|| (player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds])))
player->secondjump = 0;
else if (player->charability == CA_FLOAT && player->secondjump == 1)
player->secondjump = 2;
// If letting go of the jump button while still on ascent, cut the jump height.
if (player->pflags & PF_JUMPED && P_MobjFlip(player->mo)*player->mo->momz > 0 && player->jumping == 1)
{
player->mo->momz >>= 1;
player->jumping = 0;
}
}
}
boolean P_AnalogMove(player_t *player)
{
return player->pflags & PF_ANALOGMODE;
@ -6538,14 +5914,7 @@ static void P_MovePlayer(player_t *player)
P_SetPlayerMobjState(player->mo, S_KART_STND1); // SRB2kart - was S_PLAY_STND
}
// Cap the speed limit on a spindash
// Up the 60*FRACUNIT number to boost faster, you speed demon you!
if (player->dashspeed > FixedMul(player->maxdash, player->mo->scale))
player->dashspeed = FixedMul(player->maxdash, player->mo->scale);
else if (player->dashspeed > 0 && player->dashspeed < FixedMul(player->mindash, player->mo->scale))
player->dashspeed = FixedMul(player->mindash, player->mo->scale);
if (!(player->charability == CA_GLIDEANDCLIMB) || player->gotflag) // If you can't glide, then why the heck would you be gliding?
if (/*!(player->charability == CA_GLIDEANDCLIMB) ||*/ player->gotflag) // If you can't glide, then why the heck would you be gliding?
{
/* // SRB2kart - ???
if (player->pflags & PF_GLIDING || player->climbing)
@ -6798,7 +6167,7 @@ static void P_MovePlayer(player_t *player)
P_DoSpinDash(player, cmd);
*/
// jumping
P_DoJumpStuff(player, cmd);
//P_DoJumpStuff(player, cmd);
/*
// If you're not spinning, you'd better not be spindashing!
@ -6854,7 +6223,7 @@ static void P_MovePlayer(player_t *player)
}
// Otherwise, face the direction you're travelling.
else if (player->panim == PA_WALK || player->panim == PA_RUN || player->panim == PA_ROLL
|| (/*(player->mo->state >= &states[S_PLAY_ABL1] && player->mo->state <= &states[S_PLAY_SPC4]) && */player->charability == CA_FLY)) // SRB2kart - idk
/*|| ((player->mo->state >= &states[S_PLAY_ABL1] && player->mo->state <= &states[S_PLAY_SPC4]) && player->charability == CA_FLY)*/) // SRB2kart - idk
player->mo->angle = R_PointToAngle2(0, 0, player->rmomx, player->rmomy);
// Update the local angle control.
@ -7044,8 +6413,8 @@ static void P_MovePlayer(player_t *player)
speed = R_PointToDist2(player->rmomx, player->rmomy, 0, 0);
if (speed > player->normalspeed-5*FRACUNIT)
speed = player->normalspeed-5*FRACUNIT;
if (speed > K_GetKartSpeed(player, false)-(5<<FRACBITS))
speed = K_GetKartSpeed(player, false)-(5<<FRACBITS);
if (speed >= runnyspeed)
player->fovadd = speed-runnyspeed;
@ -7600,7 +6969,7 @@ void P_HomingAttack(mobj_t *source, mobj_t *enemy) // Home in on your target
dist = 1;
if (source->type == MT_DETON && enemy->player) // For Deton Chase (Unused)
ns = FixedDiv(FixedMul(enemy->player->normalspeed, enemy->scale), FixedDiv(20*FRACUNIT,17*FRACUNIT));
ns = FixedDiv(FixedMul(K_GetKartSpeed(enemy->player, false), enemy->scale), FixedDiv(20*FRACUNIT,17*FRACUNIT));
else if (source->type != MT_PLAYER)
{
if (source->threshold == 32000)
@ -7609,7 +6978,7 @@ void P_HomingAttack(mobj_t *source, mobj_t *enemy) // Home in on your target
ns = FixedMul(source->info->speed, source->scale);
}
else if (source->player)
ns = FixedDiv(FixedMul(source->player->actionspd, source->scale), 3*FRACUNIT/2);
ns = FixedDiv(FixedMul(K_GetKartSpeed(source->player, false), source->scale), 3*FRACUNIT/2);
source->momx = FixedMul(FixedDiv(enemy->x - source->x, dist), ns);
source->momy = FixedMul(FixedDiv(enemy->y - source->y, dist), ns);
@ -9090,7 +8459,7 @@ void P_PlayerThink(player_t *player)
|| (player->spectator || player->powers[pw_flashing] < K_GetKartFlashing(player))))
player->powers[pw_flashing]--;
if (player->powers[pw_tailsfly] && player->powers[pw_tailsfly] < UINT16_MAX && player->charability != CA_SWIM && !(player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]))) // tails fly counter
if (player->powers[pw_tailsfly] && player->powers[pw_tailsfly] < UINT16_MAX /*&& player->charability != CA_SWIM*/ && !(player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]))) // tails fly counter
player->powers[pw_tailsfly]--;
/* // SRB2kart - Can't drown.

View File

@ -573,17 +573,17 @@ static void ST_drawDebugInfo(void)
if (cv_debug & DBG_DETAILED)
{
V_DrawRightAlignedString(320, height - 104, V_MONOSPACE, va("SHIELD: %5x", stplyr->powers[pw_shield]));
//V_DrawRightAlignedString(320, height - 104, V_MONOSPACE, va("SHIELD: %5x", stplyr->powers[pw_shield]));
V_DrawRightAlignedString(320, height - 96, V_MONOSPACE, va("SCALE: %5d%%", (stplyr->mo->scale*100)/FRACUNIT));
V_DrawRightAlignedString(320, height - 88, V_MONOSPACE, va("DASH: %3d/%3d", stplyr->dashspeed>>FRACBITS, FixedMul(stplyr->maxdash,stplyr->mo->scale)>>FRACBITS));
V_DrawRightAlignedString(320, height - 80, V_MONOSPACE, va("AIR: %4d, %3d", stplyr->powers[pw_underwater], stplyr->powers[pw_spacetime]));
//V_DrawRightAlignedString(320, height - 88, V_MONOSPACE, va("DASH: %3d/%3d", stplyr->dashspeed>>FRACBITS, FixedMul(stplyr->maxdash,stplyr->mo->scale)>>FRACBITS));
//V_DrawRightAlignedString(320, height - 80, V_MONOSPACE, va("AIR: %4d, %3d", stplyr->powers[pw_underwater], stplyr->powers[pw_spacetime]));
// Flags
V_DrawRightAlignedString(304-64, height - 72, V_MONOSPACE, "Flags:");
V_DrawString(304-60, height - 72, (stplyr->jumping) ? V_GREENMAP : V_REDMAP, "JM");
V_DrawString(304-40, height - 72, (stplyr->pflags & PF_JUMPED) ? V_GREENMAP : V_REDMAP, "JD");
V_DrawString(304-20, height - 72, (stplyr->pflags & PF_SPINNING) ? V_GREENMAP : V_REDMAP, "SP");
V_DrawString(304, height - 72, (stplyr->pflags & PF_STARTDASH) ? V_GREENMAP : V_REDMAP, "ST");
//V_DrawRightAlignedString(304-64, height - 72, V_MONOSPACE, "Flags:");
//V_DrawString(304-60, height - 72, (stplyr->jumping) ? V_GREENMAP : V_REDMAP, "JM");
//V_DrawString(304-40, height - 72, (stplyr->pflags & PF_JUMPED) ? V_GREENMAP : V_REDMAP, "JD");
//V_DrawString(304-20, height - 72, (stplyr->pflags & PF_SPINNING) ? V_GREENMAP : V_REDMAP, "SP");
//V_DrawString(304, height - 72, (stplyr->pflags & PF_STARTDASH) ? V_GREENMAP : V_REDMAP, "ST");
V_DrawRightAlignedString(320, height - 64, V_MONOSPACE, va("CEILZ: %6d", stplyr->mo->ceilingz>>FRACBITS));
V_DrawRightAlignedString(320, height - 56, V_MONOSPACE, va("FLOORZ: %6d", stplyr->mo->floorz>>FRACBITS));