Merge branch 'master' into more-fixes

This commit is contained in:
TehRealSalt 2018-11-01 18:10:53 -04:00
commit 0c2a5cf9d3
11 changed files with 413 additions and 44 deletions

View file

@ -280,6 +280,7 @@ typedef enum
k_throwdir, // Held dir of controls; 1 = forward, 0 = none, -1 = backward (was "player->heldDir")
k_lapanimation, // Used to show the lap start wing logo animation
k_laphand, // Lap hand gfx to use; 0 = none, 1 = :ok_hand:, 2 = :thumbs_up:, 3 = :thumps_down:
k_cardanimation, // Used to determine the position of some full-screen Battle Mode graphics
k_voices, // Used to stop the player saying more voices than it should
k_tauntvoices, // Used to specifically stop taunt voice spam
@ -308,6 +309,7 @@ typedef enum
k_destboostcam, // Ditto
k_timeovercam, // Camera timer for leaving behind or not
k_aizdriftstrat, // Let go of your drift while boosting? Helper for the SICK STRATZ you have just unlocked
k_brakedrift, // Helper for brake-drift spark spawning
k_itemroulette, // Used for the roulette when deciding what item to give you (was "pw_kartitem")
k_roulettetype, // Used for the roulette, for deciding type (currently only used for Battle, to give you better items from Karma items)
@ -344,6 +346,7 @@ typedef enum
k_comebackpoints, // Number of times you've bombed or gave an item to someone; once it's 3 it gets set back to 0 and you're given a bumper
k_comebackmode, // 0 = bomb, 1 = item
k_wanted, // Timer for determining WANTED status, lowers when hitting people, prevents the game turning into Camp Lazlo
k_yougotem, // "You Got Em" gfx when hitting someone as a karma player via a method that gets you back in the game instantly
NUMKARTSTUFF
} kartstufftype_t;

View file

@ -6247,6 +6247,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_DRIFTSPARK_C1",
"S_DRIFTSPARK_C2",
// Brake drift sparks
"S_BRAKEDRIFT",
// Drift Smoke
"S_DRIFTDUST1",
"S_DRIFTDUST2",
@ -6758,6 +6761,36 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_KARMAWHEEL", // Karma player wheels
"S_BATTLEPOINT1A", // Battle point indicators
"S_BATTLEPOINT1B",
"S_BATTLEPOINT1C",
"S_BATTLEPOINT1D",
"S_BATTLEPOINT1E",
"S_BATTLEPOINT1F",
"S_BATTLEPOINT1G",
"S_BATTLEPOINT1H",
"S_BATTLEPOINT1I",
"S_BATTLEPOINT2A",
"S_BATTLEPOINT2B",
"S_BATTLEPOINT2C",
"S_BATTLEPOINT2D",
"S_BATTLEPOINT2E",
"S_BATTLEPOINT2F",
"S_BATTLEPOINT2G",
"S_BATTLEPOINT2H",
"S_BATTLEPOINT2I",
"S_BATTLEPOINT3A",
"S_BATTLEPOINT3B",
"S_BATTLEPOINT3C",
"S_BATTLEPOINT3D",
"S_BATTLEPOINT3E",
"S_BATTLEPOINT3F",
"S_BATTLEPOINT3G",
"S_BATTLEPOINT3H",
"S_BATTLEPOINT3I",
// Thunder shield use stuff;
"S_KSPARK1", // Sparkling Radius
"S_KSPARK2",
@ -7393,6 +7426,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
"MT_INVULNFLASH",
"MT_WIPEOUTTRAIL",
"MT_DRIFTSPARK",
"MT_BRAKEDRIFT",
"MT_DRIFTDUST",
"MT_ROCKETSNEAKER", // Rocket sneakers
@ -7515,6 +7549,8 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
"MT_KARMAHITBOX",
"MT_KARMAWHEEL",
"MT_BATTLEPOINT",
"MT_FZEROBOOM",
// Midnight Channel stuff:
@ -7867,6 +7903,7 @@ static const char *const KARTSTUFF_LIST[] = {
"THROWDIR",
"LAPANIMATION",
"LAPHAND",
"CARDANIMATION",
"VOICES",
"TAUNTVOICES",
@ -7895,6 +7932,7 @@ static const char *const KARTSTUFF_LIST[] = {
"DESTBOOSTCAM",
"TIMEOVERCAM",
"AIZDRIFTSTRAT",
"BRAKEDRIFT",
"ITEMROULETTE",
"ROULETTETYPE",
@ -7927,6 +7965,7 @@ static const char *const KARTSTUFF_LIST[] = {
"COMEBACKPOINTS",
"COMEBACKMODE",
"WANTED",
"YOUGOTEM",
};
static const char *const HUDITEMS_LIST[] = {

View file

@ -56,13 +56,13 @@ char sprnames[NUMSPRITES + 1][5] =
"SRBJ","SRBK","SRBL","SRBM","SRBN","SRBO",
//SRB2kart Sprites
"SPRG","BSPR","RNDM","RPOP","SGNS","FAST","DSHR","BOST","BOSM","KFRE",
"KINV","KINF","WIPD","DRIF","DUST","RSHE","FITM","BANA","ORBN","JAWZ",
"SSMN","KRBM","BHOG","BHBM","SPBM","THNS","SINK","SITR","KBLN","DEZL",
"POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB","CHOM","SACO",
"CRAB","SHAD","BRNG","BUMP","FLEN","CLAS","PSHW","ISTA","ISTB","ARRO",
"ITEM","ITMO","ITMI","ITMN","WANT","PBOM","RETI","AIDU","KSPK","LZI1",
"LZI2","KLIT","FZSM","FZBM","FPRT","SPTL","ENM1","GARU","MARR","REAP",
"JITB","CDMO","CDBU","VIEW"
"KINV","KINF","WIPD","DRIF","BDRF","DUST","RSHE","FITM","BANA","ORBN",
"JAWZ","SSMN","KRBM","BHOG","BHBM","SPBM","THNS","SINK","SITR","KBLN",
"DEZL","POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB","CHOM",
"SACO","CRAB","SHAD","BRNG","BUMP","FLEN","CLAS","PSHW","ISTA","ISTB",
"ARRO","ITEM","ITMO","ITMI","ITMN","WANT","PBOM","HIT1","HIT2","HIT3",
"RETI","AIDU","KSPK","LZI1","LZI2","KLIT","FZSM","FZBM","FPRT","SPTL",
"ENM1","GARU","MARR","REAP","JITB","CDMO","CDBU","VIEW"
};
// Doesn't work with g++, needs actionf_p1 (don't modify this comment)
@ -2561,6 +2561,8 @@ state_t states[NUMSTATES] =
{SPR_DRIF, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_DRIFTSPARK_C2}, // S_DRIFTSPARK_C1
{SPR_DRIF, FF_FULLBRIGHT|FF_TRANS20, 1, {NULL}, 0, 0, S_DRIFTSPARK_A3}, // S_DRIFTSPARK_C2 (Loop back to A3)
{SPR_BDRF, FF_FULLBRIGHT|FF_PAPERSPRITE|FF_ANIMATE, -1, {NULL}, 5, 2, S_BRAKEDRIFT}, // S_BRAKEDRIFT
{SPR_DUST, 0, 3, {NULL}, 0, 0, S_DRIFTDUST2}, // S_DRIFTDUST1
{SPR_DUST, 1, 3, {NULL}, 0, 0, S_DRIFTDUST3}, // S_DRIFTDUST2
{SPR_DUST, FF_TRANS20|2, 3, {NULL}, 0, 0, S_DRIFTDUST4}, // S_DRIFTDUST3
@ -3046,6 +3048,36 @@ state_t states[NUMSTATES] =
{SPR_PBOM, 0, -1, {NULL}, 0, 0, S_NULL}, // S_KARMAWHEEL
{SPR_HIT1, 0, 7, {NULL}, 0, 0, S_BATTLEPOINT1B}, // S_BATTLEPOINT1A
{SPR_HIT1, 2, 1, {NULL}, 0, 0, S_BATTLEPOINT1C}, // S_BATTLEPOINT1B
{SPR_HIT1, 4, 1, {NULL}, 0, 0, S_BATTLEPOINT1D}, // S_BATTLEPOINT1C
{SPR_HIT1, 3, 1, {NULL}, 0, 0, S_BATTLEPOINT1E}, // S_BATTLEPOINT1D
{SPR_HIT1, 2, 1, {NULL}, 0, 0, S_BATTLEPOINT1F}, // S_BATTLEPOINT1E
{SPR_HIT1, 1, 1, {NULL}, 0, 0, S_BATTLEPOINT1G}, // S_BATTLEPOINT1F
{SPR_HIT1, 2, TICRATE, {NULL}, 0, 0, S_BATTLEPOINT1H}, // S_BATTLEPOINT1G
{SPR_HIT1, 5, 1, {NULL}, 0, 0, S_BATTLEPOINT1I}, // S_BATTLEPOINT1H
{SPR_HIT1, 6, 1, {NULL}, 0, 0, S_NULL}, // S_BATTLEPOINT1I
{SPR_HIT2, 0, 7, {NULL}, 0, 0, S_BATTLEPOINT2B}, // S_BATTLEPOINT2A
{SPR_HIT2, 2, 1, {NULL}, 0, 0, S_BATTLEPOINT2C}, // S_BATTLEPOINT2B
{SPR_HIT2, 4, 1, {NULL}, 0, 0, S_BATTLEPOINT2D}, // S_BATTLEPOINT2C
{SPR_HIT2, 3, 1, {NULL}, 0, 0, S_BATTLEPOINT2E}, // S_BATTLEPOINT2D
{SPR_HIT2, 2, 1, {NULL}, 0, 0, S_BATTLEPOINT2F}, // S_BATTLEPOINT2E
{SPR_HIT2, 1, 1, {NULL}, 0, 0, S_BATTLEPOINT2G}, // S_BATTLEPOINT2F
{SPR_HIT2, 2, TICRATE, {NULL}, 0, 0, S_BATTLEPOINT2H}, // S_BATTLEPOINT2G
{SPR_HIT2, 5, 1, {NULL}, 0, 0, S_BATTLEPOINT2I}, // S_BATTLEPOINT2H
{SPR_HIT2, 6, 1, {NULL}, 0, 0, S_NULL}, // S_BATTLEPOINT2I
{SPR_HIT3, 0, 7, {NULL}, 0, 0, S_BATTLEPOINT3B}, // S_BATTLEPOINT3A
{SPR_HIT3, 2, 1, {NULL}, 0, 0, S_BATTLEPOINT3C}, // S_BATTLEPOINT3B
{SPR_HIT3, 4, 1, {NULL}, 0, 0, S_BATTLEPOINT3D}, // S_BATTLEPOINT3C
{SPR_HIT3, 3, 1, {NULL}, 0, 0, S_BATTLEPOINT3E}, // S_BATTLEPOINT3D
{SPR_HIT3, 2, 1, {NULL}, 0, 0, S_BATTLEPOINT3F}, // S_BATTLEPOINT3E
{SPR_HIT3, 1, 1, {NULL}, 0, 0, S_BATTLEPOINT3G}, // S_BATTLEPOINT3F
{SPR_HIT3, 2, TICRATE, {NULL}, 0, 0, S_BATTLEPOINT3H}, // S_BATTLEPOINT3G
{SPR_HIT3, 5, 1, {NULL}, 0, 0, S_BATTLEPOINT3I}, // S_BATTLEPOINT3H
{SPR_HIT3, 6, 1, {NULL}, 0, 0, S_NULL}, // S_BATTLEPOINT3I
// Oh no it's annoying lightning states.......
// Lightning Sparks (it's the ones we'll use for the radius)
{SPR_KSPK, FF_FULLBRIGHT, 2, {A_LightningFollowPlayer}, 0, 0, S_KSPARK2}, // S_KSPARK1
@ -14873,6 +14905,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate
},
{ // MT_BRAKEDRIFT
-1, // doomednum
S_BRAKEDRIFT, // spawnstate
1000, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
8, // speed
8*FRACUNIT, // radius
8*FRACUNIT, // height
1, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},
{ // MT_DRIFTDUST
-1, // doomednum
S_DRIFTDUST1, // spawnstate
@ -17276,6 +17335,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate
},
{ // MT_BATTLEPOINT
-1, // doomednum
S_INVISIBLE, // spawnstate
1000, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
8, // speed
8*FRACUNIT, // radius
8*FRACUNIT, // height
-1, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},
{ // MT_FZEROBOOM
-1, // doomednum
S_INVISIBLE, // spawnstate

View file

@ -601,6 +601,7 @@ typedef enum sprite
SPR_KINF, // Invincibility flash
SPR_WIPD, // Wipeout dust trail
SPR_DRIF, // Drift Sparks
SPR_BDRF, // Brake drift sparks
SPR_DUST, // Drift Dust
// Kart Items
@ -651,6 +652,11 @@ typedef enum sprite
SPR_WANT,
SPR_PBOM, // player bomb
SPR_HIT1, // battle points
SPR_HIT2, // battle points
SPR_HIT3, // battle points
SPR_RETI, // player reticule
SPR_AIDU,
@ -3109,6 +3115,9 @@ typedef enum state
S_DRIFTSPARK_C1,
S_DRIFTSPARK_C2,
// Brake drift sparks
S_BRAKEDRIFT,
// Drift Smoke
S_DRIFTDUST1,
S_DRIFTDUST2,
@ -3619,7 +3628,37 @@ typedef enum state
S_PLAYERFAKE,
S_KARMAWHEEL,
S_BATTLEPOINT1A, // Battle point indicators
S_BATTLEPOINT1B,
S_BATTLEPOINT1C,
S_BATTLEPOINT1D,
S_BATTLEPOINT1E,
S_BATTLEPOINT1F,
S_BATTLEPOINT1G,
S_BATTLEPOINT1H,
S_BATTLEPOINT1I,
S_BATTLEPOINT2A,
S_BATTLEPOINT2B,
S_BATTLEPOINT2C,
S_BATTLEPOINT2D,
S_BATTLEPOINT2E,
S_BATTLEPOINT2F,
S_BATTLEPOINT2G,
S_BATTLEPOINT2H,
S_BATTLEPOINT2I,
S_BATTLEPOINT3A,
S_BATTLEPOINT3B,
S_BATTLEPOINT3C,
S_BATTLEPOINT3D,
S_BATTLEPOINT3E,
S_BATTLEPOINT3F,
S_BATTLEPOINT3G,
S_BATTLEPOINT3H,
S_BATTLEPOINT3I,
// Thunder shield use stuff;
S_KSPARK1, // Sparkling Radius
S_KSPARK2,
@ -4272,6 +4311,7 @@ typedef enum mobj_type
MT_INVULNFLASH,
MT_WIPEOUTTRAIL,
MT_DRIFTSPARK,
MT_BRAKEDRIFT,
MT_DRIFTDUST,
MT_ROCKETSNEAKER,
@ -4394,6 +4434,8 @@ typedef enum mobj_type
MT_KARMAHITBOX,
MT_KARMAWHEEL,
MT_BATTLEPOINT,
MT_FZEROBOOM,
// Midnight Channel stuff:

View file

@ -1330,6 +1330,23 @@ static void K_SpawnDashDustRelease(player_t *player)
}
}
static void K_SpawnBrakeDriftSparks(player_t *player) // Be sure to update the mobj thinker case too!
{
mobj_t *sparks;
I_Assert(player != NULL);
I_Assert(player->mo != NULL);
I_Assert(!P_MobjWasRemoved(player->mo));
// Position & etc are handled in its thinker, and its spawned invisible.
// This avoids needing to dupe code if we don't need it.
sparks = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BRAKEDRIFT);
P_SetTarget(&sparks->target, player->mo);
P_SetScale(sparks, (sparks->destscale = player->mo->scale));
K_MatchGenericExtraFlags(sparks, player->mo);
sparks->flags2 |= MF2_DONTDRAW;
}
/** \brief Calculates the respawn timer and drop-boosting
\param player player object passed from K_KartPlayerThink
@ -1784,6 +1801,32 @@ void K_DoInstashield(player_t *player)
P_SetTarget(&layerb->target, player->mo);
}
void K_SpawnBattlePoints(player_t *source, player_t *victim, UINT8 amount)
{
statenum_t st;
mobj_t *pt;
if (!source || !source->mo)
return;
if (amount == 1)
st = S_BATTLEPOINT1A;
else if (amount == 2)
st = S_BATTLEPOINT2A;
else if (amount == 3)
st = S_BATTLEPOINT3A;
else
return; // NO STATE!
pt = P_SpawnMobj(source->mo->x, source->mo->y, source->mo->z, MT_BATTLEPOINT);
P_SetTarget(&pt->target, source->mo);
P_SetMobjState(pt, st);
if (victim && victim->skincolor)
pt->color = victim->skincolor;
else
pt->color = source->skincolor;
}
void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, boolean trapitem)
{
UINT8 scoremultiply = 1;
@ -1817,6 +1860,7 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, boolean trapitem
if (source && source->player && player != source->player)
{
P_AddPlayerScore(source->player, scoremultiply);
K_SpawnBattlePoints(source->player, player, scoremultiply);
if (!trapitem)
{
source->player->kartstuff[k_wanted] -= wantedreduce;
@ -1907,6 +1951,7 @@ void K_SquishPlayer(player_t *player, mobj_t *source)
if (source && source->player && player != source->player)
{
P_AddPlayerScore(source->player, scoremultiply);
K_SpawnBattlePoints(source->player, player, scoremultiply);
source->player->kartstuff[k_wanted] -= wantedreduce;
player->kartstuff[k_wanted] -= (wantedreduce/2);
}
@ -1996,6 +2041,7 @@ void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor) // A b
if (source && source->player && player != source->player)
{
P_AddPlayerScore(source->player, scoremultiply);
K_SpawnBattlePoints(source->player, player, scoremultiply);
source->player->kartstuff[k_wanted] -= wantedreduce;
player->kartstuff[k_wanted] -= (wantedreduce/2);
}
@ -3879,6 +3925,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
fast->momx = 3*player->mo->momx/4;
fast->momy = 3*player->mo->momy/4;
fast->momz = 3*player->mo->momz/4;
K_MatchGenericExtraFlags(fast, player->mo);
}
if (player->playerstate == PST_DEAD || player->kartstuff[k_respawn] > 1) // Ensure these are set correctly here
@ -4067,6 +4114,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
if (player->kartstuff[k_lapanimation])
player->kartstuff[k_lapanimation]--;
if (player->kartstuff[k_yougotem])
player->kartstuff[k_yougotem]--;
if (G_BattleGametype() && (player->exiting || player->kartstuff[k_comebacktimer]))
{
if (player->exiting)
@ -4454,7 +4504,8 @@ static void K_KartDrift(player_t *player, boolean onground)
if (player->kartstuff[k_spinouttimer] > 0 // banana peel
|| player->speed < FixedMul(10<<16, player->mo->scale)) // you're too slow!
{
player->kartstuff[k_drift] = player->kartstuff[k_driftcharge] = player->kartstuff[k_aizdriftstrat] = 0;
player->kartstuff[k_drift] = player->kartstuff[k_driftcharge] = 0;
player->kartstuff[k_aizdriftstrat] = player->kartstuff[k_brakedrift] = 0;
}
if ((!player->kartstuff[k_sneakertimer])
@ -4468,6 +4519,18 @@ static void K_KartDrift(player_t *player, boolean onground)
}
else if (player->kartstuff[k_aizdriftstrat] && !player->kartstuff[k_drift])
K_SpawnAIZDust(player);
if (player->kartstuff[k_drift]
&& ((player->cmd.buttons & BT_BRAKE)
|| !(player->cmd.buttons & BT_ACCELERATE))
&& P_IsObjectOnGround(player->mo))
{
if (!player->kartstuff[k_brakedrift])
K_SpawnBrakeDriftSparks(player);
player->kartstuff[k_brakedrift] = 1;
}
else
player->kartstuff[k_brakedrift] = 0;
}
//
// K_KartUpdatePosition
@ -5578,6 +5641,9 @@ static patch_t *kp_lapanim_lap[7];
static patch_t *kp_lapanim_final[11];
static patch_t *kp_lapanim_number[10][3];
static patch_t *kp_lapanim_emblem;
static patch_t *kp_lapanim_hand[3];
static patch_t *kp_yougotem;
void K_LoadKartHUDGraphics(void)
{
@ -5797,6 +5863,15 @@ void K_LoadKartHUDGraphics(void)
}
kp_lapanim_emblem = (patch_t *) W_CachePatchName("K_LAPE00", PU_HUDGFX);
sprintf(buffer, "K_LAPH0x");
for (i = 0; i < 3; i++)
{
buffer[7] = '0'+(i+1);
kp_lapanim_hand[i] = (patch_t *) W_CachePatchName(buffer, PU_HUDGFX);
}
kp_yougotem = (patch_t *) W_CachePatchName("YOUGOTEM", PU_HUDGFX);
}
// For the item toggle menu
@ -7377,41 +7452,57 @@ static void K_drawLapStartAnim(void)
{
// This is an EVEN MORE insanely complicated animation.
const UINT8 progress = 80-stplyr->kartstuff[k_lapanimation];
UINT8 *colormap = R_GetTranslationColormap(TC_DEFAULT, stplyr->skincolor, 0);
V_DrawScaledPatch(BASEVIDWIDTH/2 + (32*max(0, stplyr->kartstuff[k_lapanimation]-76)),
56 - (32*max(0, progress-76)),
0, kp_lapanim_emblem);
V_DrawFixedPatch((BASEVIDWIDTH/2 + (32*max(0, stplyr->kartstuff[k_lapanimation]-76)))*FRACUNIT,
(48 - (32*max(0, progress-76)))*FRACUNIT,
FRACUNIT, V_HUDTRANS,
kp_lapanim_emblem, colormap);
if (stplyr->kartstuff[k_laphand] >= 1 && stplyr->kartstuff[k_laphand] <= 3)
{
V_DrawFixedPatch((BASEVIDWIDTH/2 + (32*max(0, stplyr->kartstuff[k_lapanimation]-76)))*FRACUNIT,
(48 - (32*max(0, progress-76))
+ 4 - abs((leveltime % 8) - 4))*FRACUNIT,
FRACUNIT, V_HUDTRANS,
kp_lapanim_hand[stplyr->kartstuff[k_laphand]-1], NULL);
}
if (stplyr->laps == (UINT8)(cv_numlaps.value - 1))
{
V_DrawScaledPatch(27 - (32*max(0, progress-76)),
32,
0, kp_lapanim_final[min(progress/2, 10)]);
V_DrawFixedPatch((62 - (32*max(0, progress-76)))*FRACUNIT, // 27
(-6)*FRACUNIT, // 24
FRACUNIT, V_HUDTRANS,
kp_lapanim_final[min(progress/2, 10)], NULL);
if (progress/2-12 >= 0)
{
V_DrawScaledPatch(194 + (32*max(0, progress-76)),
32,
0, kp_lapanim_lap[min(progress/2-12, 6)]);
V_DrawFixedPatch((188 + (32*max(0, progress-76)))*FRACUNIT, // 194
(-6)*FRACUNIT, // 24
FRACUNIT, V_HUDTRANS,
kp_lapanim_lap[min(progress/2-12, 6)], NULL);
}
}
else
{
V_DrawScaledPatch(61 - (32*max(0, progress-76)),
32,
0, kp_lapanim_lap[min(progress/2, 6)]);
V_DrawFixedPatch((82 - (32*max(0, progress-76)))*FRACUNIT, // 61
(-6)*FRACUNIT, // 24
FRACUNIT, V_HUDTRANS,
kp_lapanim_lap[min(progress/2, 6)], NULL);
if (progress/2-8 >= 0)
{
V_DrawScaledPatch(194 + (32*max(0, progress-76)),
32,
0, kp_lapanim_number[(((UINT32)stplyr->laps+1) / 10)][min(progress/2-8, 2)]);
V_DrawFixedPatch((188 + (32*max(0, progress-76)))*FRACUNIT, // 194
(-6)*FRACUNIT, // 24
FRACUNIT, V_HUDTRANS,
kp_lapanim_number[(((UINT32)stplyr->laps+1) / 10)][min(progress/2-8, 2)], NULL);
if (progress/2-10 >= 0)
{
V_DrawScaledPatch(221 + (32*max(0, progress-76)),
32,
0, kp_lapanim_number[(((UINT32)stplyr->laps+1) % 10)][min(progress/2-10, 2)]);
V_DrawFixedPatch((208 + (32*max(0, progress-76)))*FRACUNIT, // 221
(-6)*FRACUNIT, // 24
FRACUNIT, V_HUDTRANS,
kp_lapanim_number[(((UINT32)stplyr->laps+1) % 10)][min(progress/2-10, 2)], NULL);
}
}
}
@ -7653,6 +7744,9 @@ void K_drawKartHUD(void)
K_drawLapStartAnim();
}
if (G_BattleGametype() && !splitscreen && (stplyr->kartstuff[k_yougotem] % 2)) // * YOU GOT EM *
V_DrawScaledPatch(BASEVIDWIDTH/2 - (SHORT(kp_yougotem->width)/2), 32, V_HUDTRANS, kp_yougotem);
// Draw FREE PLAY.
if (isfreeplay && !stplyr->spectator && timeinmap > 113)
K_drawKartFreePlay(leveltime);

View file

@ -27,6 +27,7 @@ void K_KartMoveAnimation(player_t *player);
void K_KartPlayerThink(player_t *player, ticcmd_t *cmd);
void K_KartPlayerAfterThink(player_t *player);
void K_DoInstashield(player_t *player);
void K_SpawnBattlePoints(player_t *source, player_t *victim, UINT8 amount);
void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, boolean trapitem);
void K_SquishPlayer(player_t *player, mobj_t *source);
void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor);

View file

@ -2109,6 +2109,20 @@ static int lib_kDoInstashield(lua_State *L)
return 0;
}
static int lib_kSpawnBattlePoints(lua_State *L)
{
player_t *source = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
player_t *victim = *((player_t **)luaL_checkudata(L, 2, META_PLAYER));
UINT8 amount = (UINT8)luaL_checkinteger(L, 3);
NOHUD
if (!source)
return LUA_ErrInvalid(L, "player_t");
if (!victim)
return LUA_ErrInvalid(L, "player_t");
K_SpawnBattlePoints(source, victim, amount);
return 0;
}
static int lib_kSpinPlayer(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
@ -2500,6 +2514,7 @@ static luaL_Reg lib[] = {
{"K_KartBouncing",lib_kKartBouncing},
{"K_MatchGenericExtraFlags",lib_kMatchGenericExtraFlags},
{"K_DoInstashield",lib_kDoInstashield},
{"K_SpawnBattlePoints",lib_kSpawnBattlePoints},
{"K_SpinPlayer",lib_kSpinPlayer},
{"K_SquishPlayer",lib_kSquishPlayer},
{"K_ExplodePlayer",lib_kExplodePlayer},

View file

@ -8435,6 +8435,7 @@ void A_SPBChase(mobj_t *actor)
//fast->momz = 3*actor->momz/4;
fast->color = SKINCOLOR_RED;
fast->colorized = true;
K_MatchGenericExtraFlags(fast, actor);
}
return;

View file

@ -494,6 +494,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
else
{
mobj_t *boom = P_SpawnMobj(special->target->x, special->target->y, special->target->z, MT_BOOMEXPLODE);
UINT8 ptadd = (K_IsPlayerWanted(player) ? 2 : 1);
boom->scale = special->target->scale;
boom->destscale = special->target->scale;
boom->momz = 5*FRACUNIT;
@ -516,12 +518,17 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
}
if (numingame <= 2) // If so, then an extra karma point so they are 100% certain to switch places; it's annoying to end matches with a bomb kill
special->target->player->kartstuff[k_comebackpoints]++;
ptadd++;
}
special->target->player->kartstuff[k_comebackpoints] += (K_IsPlayerWanted(player) ? 2 : 1);
special->target->player->kartstuff[k_comebackpoints] += ptadd;
if (ptadd > 1)
special->target->player->kartstuff[k_yougotem] = 2*TICRATE;
if (special->target->player->kartstuff[k_comebackpoints] >= 2)
K_StealBumper(special->target->player, player, true);
special->target->player->kartstuff[k_comebacktimer] = comebacktime;
K_ExplodePlayer(player, special->target, special);
@ -545,6 +552,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
else if (special->target->player->kartstuff[k_comebackmode] == 2 && P_CanPickupItem(player, 2))
{
mobj_t *poof = P_SpawnMobj(special->x, special->y, special->z, MT_EXPLODE);
UINT8 ptadd = 1; // No WANTED bonus for tricking
S_StartSound(poof, special->info->seesound);
if (player->kartstuff[k_bumper] == 1) // If you have only one bumper left, and see if it's a 1v1
@ -560,14 +569,18 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
}
if (numingame <= 2) // If so, then an extra karma point so they are 100% certain to switch places; it's annoying to end matches with a fake kill
special->target->player->kartstuff[k_comebackpoints]++;
ptadd++;
}
special->target->player->kartstuff[k_comebackmode] = 0;
special->target->player->kartstuff[k_comebackpoints]++;
special->target->player->kartstuff[k_comebackpoints] += ptadd;
if (ptadd > 1)
special->target->player->kartstuff[k_yougotem] = 2*TICRATE;
if (special->target->player->kartstuff[k_comebackpoints] >= 2)
K_StealBumper(special->target->player, player, true);
special->target->player->kartstuff[k_comebacktimer] = comebacktime;
K_DropItems(player); //K_StripItems(player);

View file

@ -8302,6 +8302,43 @@ void P_MobjThinker(mobj_t *mobj)
}
P_TeleportMove(mobj, mobj->target->x, mobj->target->y, mobj->target->z);
break;
case MT_BRAKEDRIFT:
if ((!mobj->target || !mobj->target->health || !mobj->target->player || !P_IsObjectOnGround(mobj->target))
|| !mobj->target->player->kartstuff[k_drift] || !mobj->target->player->kartstuff[k_brakedrift]
|| !((mobj->target->player->cmd.buttons & BT_BRAKE)
|| !(mobj->target->player->cmd.buttons & BT_ACCELERATE))) // Letting go of accel functions about the same as brake-drifting
{
P_RemoveMobj(mobj);
return;
}
else
{
fixed_t newx, newy;
angle_t travelangle;
travelangle = mobj->target->angle - ((ANGLE_45/5)*mobj->target->player->kartstuff[k_drift]);
newx = mobj->target->x + P_ReturnThrustX(mobj->target, travelangle+ANGLE_180, 24*mobj->target->scale);
newy = mobj->target->y + P_ReturnThrustY(mobj->target, travelangle+ANGLE_180, 24*mobj->target->scale);
P_TeleportMove(mobj, newx, newy, mobj->target->z);
mobj->angle = travelangle - ((ANGLE_90/5)*mobj->target->player->kartstuff[k_drift]);
P_SetScale(mobj, (mobj->destscale = mobj->target->scale));
if (mobj->target->player->kartstuff[k_driftcharge] >= K_GetKartDriftSparkValue(mobj->target->player)*4)
mobj->color = (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1)));
else if (mobj->target->player->kartstuff[k_driftcharge] >= K_GetKartDriftSparkValue(mobj->target->player)*2)
mobj->color = SKINCOLOR_KETCHUP;
else if (mobj->target->player->kartstuff[k_driftcharge] >= K_GetKartDriftSparkValue(mobj->target->player))
mobj->color = SKINCOLOR_SAPPHIRE;
else
mobj->color = SKINCOLOR_WHITE;
K_MatchGenericExtraFlags(mobj, mobj->target);
if (leveltime & 1)
mobj->flags2 |= MF2_DONTDRAW;
}
break;
case MT_PLAYERRETICULE:
if (!mobj->target || !mobj->target->health)
{
@ -8311,10 +8348,7 @@ void P_MobjThinker(mobj_t *mobj)
P_TeleportMove(mobj, mobj->target->x, mobj->target->y, mobj->target->z);
break;
case MT_INSTASHIELDB:
if (leveltime & 1)
mobj->flags2 |= MF2_DONTDRAW;
else
mobj->flags2 &= ~MF2_DONTDRAW;
mobj->flags2 ^= MF2_DONTDRAW;
/* FALLTHRU */
case MT_INSTASHIELDA:
if (!mobj->target || !mobj->target->health || (mobj->target->player && !mobj->target->player->kartstuff[k_instashield]))
@ -8324,6 +8358,28 @@ void P_MobjThinker(mobj_t *mobj)
}
P_TeleportMove(mobj, mobj->target->x, mobj->target->y, mobj->target->z);
break;
case MT_BATTLEPOINT:
if (!mobj->target || P_MobjWasRemoved(mobj->target))
{
P_RemoveMobj(mobj);
return;
}
if (mobj->movefactor < 48*mobj->target->scale)
{
mobj->movefactor += (48*mobj->target->scale)/6;
if (mobj->movefactor > mobj->target->height)
mobj->movefactor = mobj->target->height;
}
else if (mobj->movefactor > 48*mobj->target->scale)
{
mobj->movefactor -= (48*mobj->target->scale)/6;
if (mobj->movefactor < mobj->target->height)
mobj->movefactor = mobj->target->height;
}
P_TeleportMove(mobj, mobj->target->x, mobj->target->y, mobj->target->z + (mobj->target->height/2) + mobj->movefactor);
break;
case MT_THUNDERSHIELD:
{
fixed_t destx, desty;

View file

@ -4196,7 +4196,34 @@ DoneSection2:
{
if (player->starpostcount >= numstarposts/2) // srb2kart: must have touched *enough* starposts (was originally "(player->starpostnum == numstarposts)")
{
UINT8 i;
UINT8 nump = 0;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator)
continue;
nump++;
}
player->laps++;
// Set up lap animation vars
if (nump > 1)
{
if (K_IsPlayerLosing(player))
player->kartstuff[k_laphand] = 3;
else
{
if (nump > 2 && player->kartstuff[k_position] == 1) // 1st place in 1v1 uses thumbs up
player->kartstuff[k_laphand] = 1;
else
player->kartstuff[k_laphand] = 2;
}
}
else
player->kartstuff[k_laphand] = 0; // No hands in FREE PLAY
player->kartstuff[k_lapanimation] = 80;
if (player->pflags & PF_NIGHTSMODE)
@ -4237,15 +4264,7 @@ DoneSection2:
// Figure out how many are playing on the last lap, to prevent spectate griefing
if (!nospectategrief && player->laps >= (UINT8)(cv_numlaps.value - 1))
{
UINT8 i;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator)
continue;
nospectategrief++;
}
}
nospectategrief = nump;
}
else if (player->starpostnum)
{