Can get items during spin-outs now

Collision now correctly ignores boo and squish
Collision now ignores star
This commit is contained in:
ZTsukei 2017-05-11 20:49:17 -04:00
parent d29586716a
commit e72b2921fb
5 changed files with 73 additions and 37 deletions

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 #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 #ifdef DEVELOP
#define VERSION 103 // Game version #define VERSION 103 // Game version
#define SUBVERSION 13 // more precise version number #define SUBVERSION 14 // more precise version number
#define VERSIONSTRING "Development EXE" #define VERSIONSTRING "Development EXE"
#define VERSIONSTRINGW "v1.3.13" #define VERSIONSTRINGW "v1.3.14"
// most interface strings are ignored in development mode. // most interface strings are ignored in development mode.
// we use comprevision and compbranch instead. // we use comprevision and compbranch instead.
#else #else
#define VERSION 103 // Game version #define VERSION 103 // Game version
#define SUBVERSION 13 // more precise version number #define SUBVERSION 14 // more precise version number
#define VERSIONSTRING "DevEXE v1.3.13" #define VERSIONSTRING "DevEXE v1.3.14"
#define VERSIONSTRINGW L"v1.3.13" #define VERSIONSTRINGW L"v1.3.14"
// Hey! If you change this, add 1 to the MODVERSION below! // Hey! If you change this, add 1 to the MODVERSION below!
// Otherwise we can't force updates! // Otherwise we can't force updates!
#endif #endif

View file

@ -308,6 +308,7 @@ void K_RegisterKartStuff(void)
#define NUMKARTODDS 40 #define NUMKARTODDS 40
// Ugly ol' 3D arrays // Ugly ol' 3D arrays
/*
static INT32 K_KartItemOddsPosition_Retro[MAXPLAYERS][NUMKARTITEMS][MAXPLAYERS] = static INT32 K_KartItemOddsPosition_Retro[MAXPLAYERS][NUMKARTITEMS][MAXPLAYERS] =
{ {
// 1 Active Player // 1 Active Player
@ -662,14 +663,15 @@ static INT32 K_KartItemOddsPosition_Retro[MAXPLAYERS][NUMKARTITEMS][MAXPLAYERS]
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 8, 11, 0, 0 } // Lightning { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 8, 11, 0, 0 } // Lightning
} //1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10t 11t 12t 13t 14t 15t 16t // } //1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10t 11t 12t 13t 14t 15t 16t //
}; };
*/
// Less ugly 2D arrays // Less ugly 2D arrays
static INT32 K_KartItemOddsDistance_Retro[NUMKARTITEMS][9] = static INT32 K_KartItemOddsDistance_Retro[NUMKARTITEMS][9] =
{ {
/*P-Odds 0 1 2 3 4 5 6 7 8 //P-Odds 0 1 2 3 4 5 6 7 8
/*Magnet*/ { 0, 1, 2, 0, 0, 0, 0, 0, 0 }, // Magnet /*Magnet*/ { 0, 1, 2, 0, 0, 0, 0, 0, 0 }, // Magnet
/*Boo*/ { 0, 0, 2, 2, 1, 0, 0, 0, 0 }, // Boo /*Boo*/ { 0, 0, 2, 2, 1, 0, 0, 0, 0 }, // Boo
/*Mushroom*/ {20, 0, 0, 3, 5, 5, 0, 0, 0 }, // Mushroom /*Mushroom*/ { 1, 0, 0, 3, 5, 5, 0, 0, 0 }, // Mushroom
/*Triple Mushroom*/ { 0, 0, 0, 1, 3, 7, 6, 4, 0 }, // Triple Mushroom /*Triple Mushroom*/ { 0, 0, 0, 1, 3, 7, 6, 4, 0 }, // Triple Mushroom
/*Mega Mushroom*/ { 0, 0, 0, 0, 1, 2, 1, 0, 0 }, // Mega Mushroom /*Mega Mushroom*/ { 0, 0, 0, 0, 1, 2, 1, 0, 0 }, // Mega Mushroom
/*Gold Mushroom*/ { 0, 0, 0, 0, 0, 1, 6, 8,12 }, // Gold Mushroom /*Gold Mushroom*/ { 0, 0, 0, 0, 0, 1, 6, 8,12 }, // Gold Mushroom
@ -678,7 +680,7 @@ static INT32 K_KartItemOddsDistance_Retro[NUMKARTITEMS][9] =
/*Triple Banana*/ { 0, 0, 1, 1, 0, 0, 0, 0, 0 }, // Triple Banana /*Triple Banana*/ { 0, 0, 1, 1, 0, 0, 0, 0, 0 }, // Triple Banana
/*Fake Item*/ { 0, 4, 3, 2, 0, 0, 0, 0, 0 }, // Fake Item /*Fake Item*/ { 0, 4, 3, 2, 0, 0, 0, 0, 0 }, // Fake Item
/*Banana*/ { 0, 9, 6, 2, 1, 0, 0, 0, 0 }, // Banana /*Banana*/ { 0, 9, 6, 2, 1, 0, 0, 0, 0 }, // Banana
/*Green Shell*/ { 0, 6, 5, 3, 2, 0, 0, 0, 0 }, // Green Shell /*Green Shell*/ { 1, 6, 5, 3, 2, 0, 0, 0, 0 }, // Green Shell
/*Red Shell*/ { 0, 0, 1, 4, 3, 1, 0, 0, 0 }, // Red Shell /*Red Shell*/ { 0, 0, 1, 4, 3, 1, 0, 0, 0 }, // Red Shell
/*Triple Green Shell*/ { 0, 0, 0, 1, 1, 1, 0, 0, 0 }, // Triple Green Shell /*Triple Green Shell*/ { 0, 0, 0, 1, 1, 1, 0, 0, 0 }, // Triple Green Shell
/*Bob-omb*/ { 0, 0, 0, 1, 1, 0, 0, 0, 0 }, // Bob-omb /*Bob-omb*/ { 0, 0, 0, 1, 1, 0, 0, 0, 0 }, // Bob-omb
@ -779,7 +781,7 @@ static void K_KartGetItemResult(player_t *player, fixed_t getitem, boolean retro
\param player player object passed from P_KartPlayerThink \param player player object passed from P_KartPlayerThink
\return void \return void
*/ /
static void K_KartItemRouletteByPosition(player_t *player, ticcmd_t *cmd) static void K_KartItemRouletteByPosition(player_t *player, ticcmd_t *cmd)
{ {
INT32 i; INT32 i;
@ -864,7 +866,7 @@ static void K_KartItemRouletteByPosition(player_t *player, ticcmd_t *cmd)
else else
CONS_Printf("ERROR: P_KartItemRoulette - There were no choices given by the roulette (ppos = %d).\n", ppos); CONS_Printf("ERROR: P_KartItemRoulette - There were no choices given by the roulette (ppos = %d).\n", ppos);
//} //}
/*else if (gametype == GT_NEO) //else if (gametype == GT_NEO)
{ {
if (cv_magnet.value) SETITEMRESULT(ppos, pingame, 1) // Electro-Shield if (cv_magnet.value) SETITEMRESULT(ppos, pingame, 1) // Electro-Shield
if (cv_boo.value) SETITEMRESULT(ppos, pingame, 2) // S3K Ghost if (cv_boo.value) SETITEMRESULT(ppos, pingame, 2) // S3K Ghost
@ -895,7 +897,7 @@ static void K_KartItemRouletteByPosition(player_t *player, ticcmd_t *cmd)
} }
else else
CONS_Printf("ERROR: P_KartItemRoulette - There's no applicable game type!\n"); CONS_Printf("ERROR: P_KartItemRoulette - There's no applicable game type!\n");
*/ //
#undef SETITEMRESULT #undef SETITEMRESULT
@ -903,7 +905,7 @@ static void K_KartItemRouletteByPosition(player_t *player, ticcmd_t *cmd)
if (P_IsLocalPlayer(player)) if (P_IsLocalPlayer(player))
S_StartSound(NULL, sfx_mkitmF); S_StartSound(NULL, sfx_mkitmF);
} }*/
//} //}
@ -976,9 +978,6 @@ static void K_KartItemRouletteByDistance(player_t *player, ticcmd_t *cmd)
else if (pdis <= 11000) useodds = 7; else if (pdis <= 11000) useodds = 7;
else useodds = 8; else useodds = 8;
CONS_Printf("pdis = %d\n", pdis);
CONS_Printf("useodds = %d\n", useodds);
#define SETITEMRESULT(pos, itemnum) \ #define SETITEMRESULT(pos, itemnum) \
for (chance = 0; chance < K_KartItemOddsDistance_Retro[itemnum-1][pos]; chance++) spawnchance[numchoices++] = itemnum for (chance = 0; chance < K_KartItemOddsDistance_Retro[itemnum-1][pos]; chance++) spawnchance[numchoices++] = itemnum
@ -1082,6 +1081,7 @@ void K_SwapMomentum(mobj_t *mobj1, mobj_t *mobj2, boolean bounce)
mobj2->momx = meanX + FixedMul(deltax2, a); mobj2->momx = meanX + FixedMul(deltax2, a);
mobj2->momy = meanY + FixedMul(deltay2, a); mobj2->momy = meanY + FixedMul(deltay2, a);
} }
/*
if (mobj1->player && mobj2->player) // Weight is applicable if both are players if (mobj1->player && mobj2->player) // Weight is applicable if both are players
{ {
fixed_t m1w = 15 + mobj1->player->kartweight; fixed_t m1w = 15 + mobj1->player->kartweight;
@ -1093,12 +1093,12 @@ void K_SwapMomentum(mobj_t *mobj1, mobj_t *mobj2, boolean bounce)
mobj1->momy = FixedMul(mobj2->momy, FixedDiv(m2w*FRACUNIT, m1w*FRACUNIT)); mobj1->momy = FixedMul(mobj2->momy, FixedDiv(m2w*FRACUNIT, m1w*FRACUNIT));
} }
else else
{ {*/
newx = mobj1->momx; newx = mobj1->momx;
newy = mobj1->momy; newy = mobj1->momy;
mobj1->momx = mobj2->momx; mobj1->momx = mobj2->momx;
mobj1->momy = mobj2->momy; mobj1->momy = mobj2->momy;
} //}
mobj2->momx = newx; mobj2->momx = newx;
mobj2->momy = newy; mobj2->momy = newy;
if (bounce == true) // Perform a Goomba Bounce. if (bounce == true) // Perform a Goomba Bounce.
@ -1122,13 +1122,15 @@ void K_KartBouncer(void)
if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo) if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo)
&& !players[i].kartstuff[k_growshrinktimer] && !players[i].kartstuff[k_growshrinktimer]
&& !players[i].kartstuff[k_squishedtimer] && !players[i].kartstuff[k_squishedtimer]
&& !players[i].kartstuff[k_bootaketimer]) && !players[i].kartstuff[k_bootaketimer]
&& !players[i].kartstuff[k_startimer])
{ {
for (j = i+1; j < MAXPLAYERS; j++) for (j = i+1; j < MAXPLAYERS; j++)
if (playeringame[j] && players[j].mo && !P_MobjWasRemoved(players[j].mo) if (playeringame[j] && players[j].mo && !P_MobjWasRemoved(players[j].mo)
&& !players[i].kartstuff[k_squishedtimer] && !players[j].kartstuff[k_squishedtimer]
&& !players[j].kartstuff[k_growshrinktimer] && !players[j].kartstuff[k_growshrinktimer]
&& !players[i].kartstuff[k_bootaketimer]) && !players[j].kartstuff[k_bootaketimer]
&& !players[j].kartstuff[k_startimer])
{ {
if (players[j].mo == players[i].mo) if (players[j].mo == players[i].mo)
break; break;
@ -1421,7 +1423,20 @@ static fixed_t K_GetKartBoostPower(player_t *player, boolean speed)
if (player->kartstuff[k_mushroomtimer]) if (player->kartstuff[k_mushroomtimer])
{ // Mushroom { // Mushroom
if (speed) if (speed)
boostvalue = max(boostvalue, FRACUNIT/2); // + 50% {
switch (cv_kartcc.value)
{
case 50:
boostvalue = max(boostvalue, 53740+768);
break;
case 150:
boostvalue = max(boostvalue, 17294+768);
break;
default:
boostvalue = max(boostvalue, 32768);
break;
}
}
else else
boostvalue = max(boostvalue, 8*FRACUNIT); // + 800% boostvalue = max(boostvalue, 8*FRACUNIT); // + 800%
} }
@ -3453,23 +3468,27 @@ static void K_DrawKartTripleItem(void)
else*/ else*/
//{ //{
thisitem = stplyr->kartstuff[k_triplebanana]; thisitem = stplyr->kartstuff[k_triplebanana];
if (thisitem & 1) localpatch = kp_singlebananaicon; if (thisitem & 4) localpatch = kp_triplebananaicon;
else if (thisitem & 2) localpatch = kp_doublebananaicon; else if (thisitem & 2) localpatch = kp_doublebananaicon;
else if (thisitem & 4) localpatch = kp_triplebananaicon; else if (thisitem & 1) localpatch = kp_singlebananaicon;
thisitem = stplyr->kartstuff[k_triplegreenshell]; thisitem = stplyr->kartstuff[k_triplegreenshell];
if (thisitem & 1) localpatch = kp_singlegreenshellicon; if (thisitem & 4) localpatch = kp_triplegreenshellicon;
else if (thisitem & 2) localpatch = kp_doublegreenshellicon; else if (thisitem & 2) localpatch = kp_doublegreenshellicon;
else if (thisitem & 4) localpatch = kp_triplegreenshellicon; else if (thisitem & 1) localpatch = kp_singlegreenshellicon;
thisitem = stplyr->kartstuff[k_tripleredshell]; thisitem = stplyr->kartstuff[k_tripleredshell];
if (thisitem & 1) localpatch = kp_singleredshellicon; if (thisitem & 4) localpatch = kp_tripleredshellicon;
else if (thisitem & 2) localpatch = kp_doubleredshellicon; else if (thisitem & 2) localpatch = kp_doubleredshellicon;
else if (thisitem & 4) localpatch = kp_tripleredshellicon; else if (thisitem & 1) localpatch = kp_singleredshellicon;
if (stplyr->kartstuff[k_banana] & 1) localpatch = kp_singlebananaicon;
if (stplyr->kartstuff[k_greenshell] & 1) localpatch = kp_singlegreenshellicon;
if (stplyr->kartstuff[k_redshell] & 1) localpatch = kp_singleredshellicon;
//} //}
if (localpatch != kp_nodraw) if (localpatch != kp_nodraw)
V_DrawScaledPatch(TRIP_X, STRINGY(TRIP_Y), V_SNAPTORIGHT|V_TRANSLUCENT, localpatch); V_DrawScaledPatch(TRIP_X, STRINGY(TRIP_Y), V_SNAPTOBOTTOM, localpatch);
} }
static void K_drawKartTimestamp(void) static void K_drawKartTimestamp(void)

View file

@ -8121,12 +8121,12 @@ void A_ItemPop(mobj_t *actor)
return; return;
} }
if (actor->target && actor->target->player if (actor->target && actor->target->player // These used to be &2's and &8's for box only, but are now universal.
&& !(actor->target->player->kartstuff[k_greenshell] & 2 || actor->target->player->kartstuff[k_triplegreenshell] & 8 && !(actor->target->player->kartstuff[k_greenshell] || actor->target->player->kartstuff[k_triplegreenshell]
|| actor->target->player->kartstuff[k_redshell] & 2 || actor->target->player->kartstuff[k_tripleredshell] & 8 || actor->target->player->kartstuff[k_redshell] || actor->target->player->kartstuff[k_tripleredshell]
|| actor->target->player->kartstuff[k_banana] & 2 || actor->target->player->kartstuff[k_triplebanana] & 8 || actor->target->player->kartstuff[k_banana] || actor->target->player->kartstuff[k_triplebanana]
|| actor->target->player->kartstuff[k_fakeitem] & 2 || actor->target->player->kartstuff[k_magnet] || actor->target->player->kartstuff[k_fakeitem] || actor->target->player->kartstuff[k_magnet]
|| actor->target->player->kartstuff[k_bobomb] & 2 || actor->target->player->kartstuff[k_blueshell] || actor->target->player->kartstuff[k_bobomb] || actor->target->player->kartstuff[k_blueshell]
|| actor->target->player->kartstuff[k_mushroom] || actor->target->player->kartstuff[k_fireflower] || actor->target->player->kartstuff[k_mushroom] || actor->target->player->kartstuff[k_fireflower]
|| actor->target->player->kartstuff[k_star] || actor->target->player->kartstuff[k_goldshroom] || actor->target->player->kartstuff[k_star] || actor->target->player->kartstuff[k_goldshroom]
|| actor->target->player->kartstuff[k_lightning] || actor->target->player->kartstuff[k_megashroom] || actor->target->player->kartstuff[k_lightning] || actor->target->player->kartstuff[k_megashroom]
@ -8136,7 +8136,7 @@ void A_ItemPop(mobj_t *actor)
|| actor->target->player->kartstuff[k_growshrinktimer] > 1 || actor->target->player->kartstuff[k_growshrinktimer] > 1
|| actor->target->player->kartstuff[k_goldshroomtimer])) || actor->target->player->kartstuff[k_goldshroomtimer]))
actor->target->player->kartstuff[k_itemroulette] = 1; actor->target->player->kartstuff[k_itemroulette] = 1;
else if(cv_debug && !(actor->target && actor->target->player)) else if (cv_debug && !(actor->target && actor->target->player))
CONS_Printf("ERROR: Powerup has no target!\n"); CONS_Printf("ERROR: Powerup has no target!\n");
remains->flags &= ~MF_AMBUSH; remains->flags &= ~MF_AMBUSH;

View file

@ -147,8 +147,8 @@ boolean P_CanPickupItem(player_t *player, boolean weapon)
if (player->bot && weapon) if (player->bot && weapon)
return false; return false;
if (player->powers[pw_flashing] > (flashingtics/4)*3 && player->powers[pw_flashing] <= flashingtics) //if (player->powers[pw_flashing] > (flashingtics/4)*3 && player->powers[pw_flashing] <= flashingtics)
return false; // return false;
return true; return true;
} }

View file

@ -2305,7 +2305,24 @@ static boolean P_ZMovement(mobj_t *mo)
case MT_FLINGCOIN: case MT_FLINGCOIN:
case MT_FLINGRANDOMITEM: case MT_FLINGRANDOMITEM:
case MT_FLINGEMERALD: case MT_FLINGEMERALD:
// SRB2kart stuff that should die in pits
case MT_RANDOMITEM: case MT_RANDOMITEM:
case MT_BANANASHIELD:
case MT_TRIPLEBANANASHIELD1:
case MT_TRIPLEBANANASHIELD2:
case MT_TRIPLEBANANASHIELD3:
case MT_BANANAITEM:
case MT_GREENSHIELD:
case MT_TRIPLEGREENSHIELD1:
case MT_TRIPLEGREENSHIELD2:
case MT_TRIPLEGREENSHIELD3:
case MT_GREENITEM:
case MT_REDSHIELD:
case MT_TRIPLEREDSHIELD1:
case MT_TRIPLEREDSHIELD2:
case MT_TRIPLEREDSHIELD3:
case MT_REDITEM:
case MT_REDITEMDUD:
// Remove flinged stuff from death pits. // Remove flinged stuff from death pits.
if (P_CheckDeathPitCollide(mo)) if (P_CheckDeathPitCollide(mo))
{ {