Friction updated. Added KARTSTUFF to lua. Added ->kartstuff to network syncing stuff (surprised it even worked before now???), also maybe items correctly reset at the end of level now.

This commit is contained in:
ZTsukei 2017-02-27 17:55:24 -05:00
parent f50ecc0dcd
commit 5d0b9ef551
10 changed files with 19 additions and 10 deletions

View file

@ -517,6 +517,8 @@ static inline void resynch_write_player(resynch_pak *rsp, const size_t i)
for (j = 0; j < NUMPOWERS; ++j)
rsp->powers[j] = (UINT16)SHORT(players[i].powers[j]);
for (j = 0; j < NUMKARTSTUFF; ++j)
rsp->kartstuff[j] = (UINT16)SHORT(players[i].kartstuff[j]); // SRB2kart
// Score is resynched in the rspfirm resync packet
rsp->health = 0; // resynched with mo health
@ -647,6 +649,8 @@ static void resynch_read_player(resynch_pak *rsp)
for (j = 0; j < NUMPOWERS; ++j)
players[i].powers[j] = (UINT16)SHORT(rsp->powers[j]);
for (j = 0; j < NUMKARTSTUFF; ++j)
players[i].kartstuff[j] = (UINT16)SHORT(rsp->kartstuff[j]); // SRB2kart
// Score is resynched in the rspfirm resync packet
players[i].health = rsp->health;

View file

@ -376,7 +376,7 @@ consvar_t cv_maxping = {"maxping", "0", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NUL
#endif
// Intermission time Tails 04-19-2002
static CV_PossibleValue_t inttime_cons_t[] = {{0, "MIN"}, {3600, "MAX"}, {0, NULL}};
consvar_t cv_inttime = {"inttime", "20", CV_NETVAR, inttime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_inttime = {"inttime", "3000", CV_NETVAR, inttime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t advancemap_cons_t[] = {{0, "Off"}, {1, "Next"}, {2, "Random"}, {0, NULL}};
consvar_t cv_advancemap = {"advancemap", "Next", CV_NETVAR, advancemap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};

View file

@ -143,16 +143,16 @@ extern FILE *logstream;
#define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3
#ifdef DEVELOP
#define VERSION 102 // Game version
#define SUBVERSION 0 // more precise version number
#define SUBVERSION 1 // more precise version number
#define VERSIONSTRING "Development EXE"
#define VERSIONSTRINGW "v1.2.00"
#define VERSIONSTRINGW "v1.2.01"
// most interface strings are ignored in development mode.
// we use comprevision and compbranch instead.
#else
#define VERSION 102 // Game version
#define SUBVERSION 0 // more precise version number
#define VERSIONSTRING "DevEXE v1.2.00"
#define VERSIONSTRINGW L"v1.2.00"
#define SUBVERSION 1 // more precise version number
#define VERSIONSTRING "DevEXE v1.2.01"
#define VERSIONSTRINGW L"v1.2.01"
// Hey! If you change this, add 1 to the MODVERSION below!
// Otherwise we can't force updates!
#endif

View file

@ -199,7 +199,7 @@ UINT16 extralifetics = 4*TICRATE;
// SRB2kart
INT32 bootime = 7*TICRATE;
INT32 mushroomtime = TICRATE + (TICRATE/3);
INT32 bonustime = 10*TICRATE;
INT32 bonustime = 8*TICRATE;
INT32 gameovertics = 15*TICRATE;
@ -2119,6 +2119,7 @@ static inline void G_PlayerFinishLevel(INT32 player)
p = &players[player];
memset(p->powers, 0, sizeof (p->powers));
memset(p->kartstuff, 0, sizeof (p->kartstuff)); // SRB2kart
p->ringweapons = 0;
p->mo->flags2 &= ~MF2_SHADOW; // cancel invisibility

View file

@ -792,7 +792,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
// If the roulette finishes or the player presses BT_ATTACK, stop the roulette and calculate the item.
// I'm returning via the exact opposite, however, to forgo having another bracket embed. Same result either way, I think.
// Finally, if you get past this check, now you can actually start calculating what item you get.
if (!(player->kartstuff[k_itemroulette] > (TICRATE*3)-1 || ((cmd->buttons & BT_ATTACK) && player->kartstuff[k_itemroulette] > ((TICRATE*2)/3)-1)))
if (!(player->kartstuff[k_itemroulette] > (TICRATE*3)-1)) // || ((cmd->buttons & BT_ATTACK) && player->kartstuff[k_itemroulette] > ((TICRATE*2)/3)-1)))
return;
// Initializes existing values

View file

@ -30,6 +30,7 @@ extern lua_State *gL;
#define META_TICCMD "TICCMD_T*"
#define META_SKIN "SKIN_T*"
#define META_POWERS "PLAYER_T*POWERS"
#define META_KARTSTUFF "PLAYER_T*KARTSTUFF"
#define META_SOUNDSID "SKIN_T*SOUNDSID"
#define META_VERTEX "VERTEX_T*"

View file

@ -128,6 +128,8 @@ static int player_get(lua_State *L)
lua_pushinteger(L, plr->ringweapons);
else if (fastcmp(field,"powers"))
LUA_PushUserdata(L, plr->powers, META_POWERS);
else if (fastcmp(field,"kartstuff"))
LUA_PushUserdata(L, plr->kartstuff, META_KARTSTUFF);
else if (fastcmp(field,"pflags"))
lua_pushinteger(L, plr->pflags);
else if (fastcmp(field,"panim"))

View file

@ -434,6 +434,7 @@ void LUA_InvalidatePlayer(player_t *player)
return;
LUA_InvalidateUserdata(player);
LUA_InvalidateUserdata(player->powers);
LUA_InvalidateUserdata(player->kartstuff);
LUA_InvalidateUserdata(&player->cmd);
}

View file

@ -8514,7 +8514,7 @@ void P_RemoveSavegameMobj(mobj_t *mobj)
}
static CV_PossibleValue_t respawnitemtime_cons_t[] = {{1, "MIN"}, {300, "MAX"}, {0, NULL}};
consvar_t cv_itemrespawntime = {"respawnitemtime", "30", CV_NETVAR|CV_CHEAT, respawnitemtime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_itemrespawntime = {"respawnitemtime", "1", CV_NETVAR|CV_CHEAT, respawnitemtime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_itemrespawn = {"respawnitem", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t flagtime_cons_t[] = {{0, "MIN"}, {300, "MAX"}, {0, NULL}};
consvar_t cv_flagtime = {"flagtime", "30", CV_NETVAR|CV_CHEAT, flagtime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};

View file

@ -393,7 +393,7 @@ typedef struct
} friction_t;
// Friction defines.
#define ORIG_FRICTION (0xE8 << (FRACBITS-8)) ///< Original value.
#define ORIG_FRICTION 62914 //(0xE8 << (FRACBITS-8)) ///< Original value.
#define ORIG_FRICTION_FACTOR (8 << (FRACBITS-8)) ///< Original value.
void T_Friction(friction_t *f);