Add invulnhitlag, timeshit and timeshitprev fields to player_t

This commit is contained in:
James R 2022-12-19 15:25:15 -08:00
parent 33167078c8
commit b73bbd3712
3 changed files with 27 additions and 1 deletions

View file

@ -466,6 +466,7 @@ struct player_t
UINT16 spinouttimer; // Spin-out from a banana peel or oil slick (was "pw_bananacam") UINT16 spinouttimer; // Spin-out from a banana peel or oil slick (was "pw_bananacam")
UINT8 spinouttype; // Determines the mode of spinout/wipeout, see kartspinoutflags_t UINT8 spinouttype; // Determines the mode of spinout/wipeout, see kartspinoutflags_t
UINT8 instashield; // Instashield no-damage animation timer UINT8 instashield; // Instashield no-damage animation timer
INT32 invulnhitlag; // Numbers of tics of hitlag added this tic for "potential" damage -- not real damage
UINT8 wipeoutslow; // Timer before you slowdown when getting wiped out UINT8 wipeoutslow; // Timer before you slowdown when getting wiped out
UINT8 justbumped; // Prevent players from endlessly bumping into each other UINT8 justbumped; // Prevent players from endlessly bumping into each other
UINT8 tumbleBounces; UINT8 tumbleBounces;
@ -615,7 +616,12 @@ struct player_t
INT16 lastsidehit, lastlinehit; INT16 lastsidehit, lastlinehit;
//UINT8 timeshit; // That's TIMES HIT, not TIME SHIT, you doofus! -- in memoriam // These track how many things tried to damage you, not
// whether you actually took damage.
UINT8 timeshit; // times hit this tic
UINT8 timeshitprev; // times hit before
// That's TIMES HIT, not TIME SHIT, you doofus! -- in memoriam
// No longer in memoriam =P -jart
INT32 onconveyor; // You are on a conveyor belt if nonzero INT32 onconveyor; // You are on a conveyor belt if nonzero

View file

@ -232,6 +232,8 @@ static int player_get(lua_State *L)
lua_pushinteger(L, plr->spinouttimer); lua_pushinteger(L, plr->spinouttimer);
else if (fastcmp(field,"instashield")) else if (fastcmp(field,"instashield"))
lua_pushinteger(L, plr->instashield); lua_pushinteger(L, plr->instashield);
else if (fastcmp(field,"invulnhitlag"))
lua_pushinteger(L, plr->invulnhitlag);
else if (fastcmp(field,"wipeoutslow")) else if (fastcmp(field,"wipeoutslow"))
lua_pushinteger(L, plr->wipeoutslow); lua_pushinteger(L, plr->wipeoutslow);
else if (fastcmp(field,"justbumped")) else if (fastcmp(field,"justbumped"))
@ -472,6 +474,10 @@ static int player_get(lua_State *L)
lua_pushinteger(L, plr->lastsidehit); lua_pushinteger(L, plr->lastsidehit);
else if (fastcmp(field,"lastlinehit")) else if (fastcmp(field,"lastlinehit"))
lua_pushinteger(L, plr->lastlinehit); lua_pushinteger(L, plr->lastlinehit);
else if (fastcmp(field,"timeshit"))
lua_pushinteger(L, plr->timeshit);
else if (fastcmp(field,"timeshitprev"))
lua_pushinteger(L, plr->timeshitprev);
else if (fastcmp(field,"onconveyor")) else if (fastcmp(field,"onconveyor"))
lua_pushinteger(L, plr->onconveyor); lua_pushinteger(L, plr->onconveyor);
else if (fastcmp(field,"awayviewmobj")) else if (fastcmp(field,"awayviewmobj"))
@ -604,6 +610,8 @@ static int player_set(lua_State *L)
plr->spinouttimer = luaL_checkinteger(L, 3); plr->spinouttimer = luaL_checkinteger(L, 3);
else if (fastcmp(field,"instashield")) else if (fastcmp(field,"instashield"))
plr->instashield = luaL_checkinteger(L, 3); plr->instashield = luaL_checkinteger(L, 3);
else if (fastcmp(field,"invulnhitlag"))
plr->invulnhitlag = luaL_checkinteger(L, 3);
else if (fastcmp(field,"wipeoutslow")) else if (fastcmp(field,"wipeoutslow"))
plr->wipeoutslow = luaL_checkinteger(L, 3); plr->wipeoutslow = luaL_checkinteger(L, 3);
else if (fastcmp(field,"justbumped")) else if (fastcmp(field,"justbumped"))
@ -830,6 +838,10 @@ static int player_set(lua_State *L)
plr->lastsidehit = (INT16)luaL_checkinteger(L, 3); plr->lastsidehit = (INT16)luaL_checkinteger(L, 3);
else if (fastcmp(field,"lastlinehit")) else if (fastcmp(field,"lastlinehit"))
plr->lastlinehit = (INT16)luaL_checkinteger(L, 3); plr->lastlinehit = (INT16)luaL_checkinteger(L, 3);
else if (fastcmp(field,"timeshit"))
plr->timeshit = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"timeshitprev"))
plr->timeshitprev = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"onconveyor")) else if (fastcmp(field,"onconveyor"))
plr->onconveyor = (INT32)luaL_checkinteger(L, 3); plr->onconveyor = (INT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"awayviewmobj")) else if (fastcmp(field,"awayviewmobj"))

View file

@ -190,6 +190,9 @@ static void P_NetArchivePlayers(void)
WRITEINT32(save_p, players[i].onconveyor); WRITEINT32(save_p, players[i].onconveyor);
WRITEUINT8(save_p, players[i].timeshit);
WRITEUINT8(save_p, players[i].timeshitprev);
WRITEUINT32(save_p, players[i].jointime); WRITEUINT32(save_p, players[i].jointime);
WRITEUINT8(save_p, players[i].splitscreenindex); WRITEUINT8(save_p, players[i].splitscreenindex);
@ -266,6 +269,7 @@ static void P_NetArchivePlayers(void)
WRITEUINT16(save_p, players[i].spinouttimer); WRITEUINT16(save_p, players[i].spinouttimer);
WRITEUINT8(save_p, players[i].spinouttype); WRITEUINT8(save_p, players[i].spinouttype);
WRITEUINT8(save_p, players[i].instashield); WRITEUINT8(save_p, players[i].instashield);
WRITEINT32(save_p, players[i].invulnhitlag);
WRITEUINT8(save_p, players[i].wipeoutslow); WRITEUINT8(save_p, players[i].wipeoutslow);
WRITEUINT8(save_p, players[i].justbumped); WRITEUINT8(save_p, players[i].justbumped);
WRITEUINT8(save_p, players[i].tumbleBounces); WRITEUINT8(save_p, players[i].tumbleBounces);
@ -557,6 +561,9 @@ static void P_NetUnArchivePlayers(void)
players[i].lastsidehit = READINT16(save_p); players[i].lastsidehit = READINT16(save_p);
players[i].lastlinehit = READINT16(save_p); players[i].lastlinehit = READINT16(save_p);
players[i].timeshit = READUINT8(save_p);
players[i].timeshitprev = READUINT8(save_p);
players[i].onconveyor = READINT32(save_p); players[i].onconveyor = READINT32(save_p);
players[i].jointime = READUINT32(save_p); players[i].jointime = READUINT32(save_p);
@ -615,6 +622,7 @@ static void P_NetUnArchivePlayers(void)
players[i].spinouttimer = READUINT16(save_p); players[i].spinouttimer = READUINT16(save_p);
players[i].spinouttype = READUINT8(save_p); players[i].spinouttype = READUINT8(save_p);
players[i].instashield = READUINT8(save_p); players[i].instashield = READUINT8(save_p);
players[i].invulnhitlag = READINT32(save_p);
players[i].wipeoutslow = READUINT8(save_p); players[i].wipeoutslow = READUINT8(save_p);
players[i].justbumped = READUINT8(save_p); players[i].justbumped = READUINT8(save_p);
players[i].tumbleBounces = READUINT8(save_p); players[i].tumbleBounces = READUINT8(save_p);