mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-17 02:01:15 +00:00
Fixes
This commit is contained in:
parent
889d790ea0
commit
4e2b30fcae
7 changed files with 80 additions and 57 deletions
|
@ -220,7 +220,7 @@ static CV_PossibleValue_t competitionboxes_cons_t[] = {{0, "Normal"}, {1, "Rando
|
||||||
static CV_PossibleValue_t matchboxes_cons_t[] = {{0, "Normal"}, {1, "Random"}, {2, "Non-Random"},
|
static CV_PossibleValue_t matchboxes_cons_t[] = {{0, "Normal"}, {1, "Random"}, {2, "Non-Random"},
|
||||||
{3, "None"}, {0, NULL}};
|
{3, "None"}, {0, NULL}};
|
||||||
|
|
||||||
static CV_PossibleValue_t chances_cons_t[] = {{0, "MIN"}, {9, "MAX"}, {0, NULL}};
|
//static CV_PossibleValue_t chances_cons_t[] = {{0, "MIN"}, {9, "MAX"}, {0, NULL}};
|
||||||
static CV_PossibleValue_t match_scoring_cons_t[] = {{0, "Normal"}, {1, "Classic"}, {0, NULL}};
|
static CV_PossibleValue_t match_scoring_cons_t[] = {{0, "Normal"}, {1, "Classic"}, {0, NULL}};
|
||||||
static CV_PossibleValue_t pause_cons_t[] = {{0, "Server"}, {1, "All"}, {0, NULL}};
|
static CV_PossibleValue_t pause_cons_t[] = {{0, "Server"}, {1, "All"}, {0, NULL}};
|
||||||
|
|
||||||
|
|
|
@ -5392,7 +5392,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
if (thing->skin && thing->sprite == SPR_PLAY) // This thing is a player!
|
if (thing->skin && thing->sprite == SPR_PLAY) // This thing is a player!
|
||||||
{
|
{
|
||||||
if (thing->colorized)
|
if (thing->colorized)
|
||||||
vis->colormap = R_GetTranslationColormap(TC_STARMAN, thing->color, GTC_CACHE);
|
vis->colormap = R_GetTranslationColormap(TC_RAINBOW, thing->color, GTC_CACHE);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
size_t skinnum = (skin_t*)thing->skin-skins;
|
size_t skinnum = (skin_t*)thing->skin-skins;
|
||||||
|
@ -5402,7 +5402,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (vis->mobj && vis->mobj->colorized)
|
if (vis->mobj && vis->mobj->colorized)
|
||||||
vis->colormap = R_GetTranslationColormap(TC_STARMAN, vis->mobj->color ? vis->mobj->color : SKINCOLOR_CYAN, GTC_CACHE);
|
vis->colormap = R_GetTranslationColormap(TC_RAINBOW, vis->mobj->color ? vis->mobj->color : SKINCOLOR_CYAN, GTC_CACHE);
|
||||||
else
|
else
|
||||||
vis->colormap = R_GetTranslationColormap(TC_DEFAULT, vis->mobj->color ? vis->mobj->color : SKINCOLOR_CYAN, GTC_CACHE);
|
vis->colormap = R_GetTranslationColormap(TC_DEFAULT, vis->mobj->color ? vis->mobj->color : SKINCOLOR_CYAN, GTC_CACHE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1207,8 +1207,8 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// starman support, could theoretically support boss ones too
|
// rainbow support, could theoretically support boss ones too
|
||||||
if (skinnum == TC_STARMAN)
|
if (skinnum == TC_RAINBOW)
|
||||||
{
|
{
|
||||||
while (size--)
|
while (size--)
|
||||||
{
|
{
|
||||||
|
@ -1490,7 +1490,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||||
if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
|
if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
|
||||||
{
|
{
|
||||||
if (spr->mobj->colorized)
|
if (spr->mobj->colorized)
|
||||||
skinnum = TC_STARMAN;
|
skinnum = TC_RAINBOW;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
skinnum = (INT32)((skin_t*)spr->mobj->skin-skins);
|
skinnum = (INT32)((skin_t*)spr->mobj->skin-skins);
|
||||||
|
|
|
@ -2722,7 +2722,7 @@ state_t states[NUMSTATES] =
|
||||||
{SPR_BLIG, 1, 2, {NULL}, 0, 0, S_BLUELIGHTNING3}, // S_BLUELIGHTNING2
|
{SPR_BLIG, 1, 2, {NULL}, 0, 0, S_BLUELIGHTNING3}, // S_BLUELIGHTNING2
|
||||||
{SPR_BLIG, 2, 2, {NULL}, 0, 0, S_BLUELIGHTNING4}, // S_BLUELIGHTNING3
|
{SPR_BLIG, 2, 2, {NULL}, 0, 0, S_BLUELIGHTNING4}, // S_BLUELIGHTNING3
|
||||||
{SPR_BLIG, 3, 2, {NULL}, 0, 0, S_NULL}, // S_BLUELIGHTNING4
|
{SPR_BLIG, 3, 2, {NULL}, 0, 0, S_NULL}, // S_BLUELIGHTNING4
|
||||||
{SPR_BOMB, 0, 1, {A_MineExplode}, MT_BLUEEXPLOSION, 0, S_NULL}, // S_BLUEEXPLODE
|
{SPR_SSMN, 0, 1, {A_MineExplode}, MT_BLUEEXPLOSION, 0, S_NULL}, // S_BLUEEXPLODE
|
||||||
|
|
||||||
{SPR_LIGH, 0, 2, {NULL}, 0, 0, S_LIGHTNING2}, // S_LIGHTNING1
|
{SPR_LIGH, 0, 2, {NULL}, 0, 0, S_LIGHTNING2}, // S_LIGHTNING1
|
||||||
{SPR_LIGH, 1, 2, {NULL}, 0, 0, S_LIGHTNING3}, // S_LIGHTNING2
|
{SPR_LIGH, 1, 2, {NULL}, 0, 0, S_LIGHTNING3}, // S_LIGHTNING2
|
||||||
|
|
109
src/k_kart.c
109
src/k_kart.c
|
@ -425,17 +425,6 @@ static void K_KartGetItemResult(player_t *player, SINT8 getitem)
|
||||||
switch (getitem)
|
switch (getitem)
|
||||||
{
|
{
|
||||||
// Special roulettes first, then the generic ones are handled by default
|
// Special roulettes first, then the generic ones are handled by default
|
||||||
case KITEM_TRIPLESNEAKER:
|
|
||||||
if (getitem <= 0 || getitem >= NUMKARTRESULTS) // Sad (Fallback)
|
|
||||||
{
|
|
||||||
if (getitem != 0)
|
|
||||||
CONS_Printf("ERROR: P_KartGetItemResult - Item roulette gave bad item (%d) :(\n", getitem);
|
|
||||||
player->kartstuff[k_itemtype] = KITEM_SAD;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
player->kartstuff[k_itemtype] = getitem;
|
|
||||||
player->kartstuff[k_itemamount] = 1;
|
|
||||||
break;
|
|
||||||
case KRITEM_TRIPLESNEAKER: // Sneaker x3
|
case KRITEM_TRIPLESNEAKER: // Sneaker x3
|
||||||
player->kartstuff[k_itemtype] = KITEM_SNEAKER;
|
player->kartstuff[k_itemtype] = KITEM_SNEAKER;
|
||||||
player->kartstuff[k_itemamount] = 3;
|
player->kartstuff[k_itemamount] = 3;
|
||||||
|
@ -478,6 +467,9 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, player_t *player, boolean
|
||||||
INT32 newodds;
|
INT32 newodds;
|
||||||
INT32 i;
|
INT32 i;
|
||||||
UINT8 pingame = 0, pexiting = 0;
|
UINT8 pingame = 0, pexiting = 0;
|
||||||
|
SINT8 first = -1;
|
||||||
|
SINT8 second = -1;
|
||||||
|
INT32 secondist = 0;
|
||||||
|
|
||||||
if (G_BattleGametype())
|
if (G_BattleGametype())
|
||||||
newodds = K_KartItemOddsBattle[item-1][pos];
|
newodds = K_KartItemOddsBattle[item-1][pos];
|
||||||
|
@ -487,11 +479,31 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, player_t *player, boolean
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
if (playeringame[i] && !players[i].spectator)
|
if (playeringame[i] && !players[i].spectator)
|
||||||
|
{
|
||||||
pingame++;
|
pingame++;
|
||||||
|
if (players[i].mo)
|
||||||
|
{
|
||||||
|
if (players[i].kartstuff[k_position] == 1 && first == -1)
|
||||||
|
first = i;
|
||||||
|
if (players[i].kartstuff[k_position] == 2 && second == -1)
|
||||||
|
second = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (players[i].exiting)
|
if (players[i].exiting)
|
||||||
pexiting++;
|
pexiting++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (first != -1 && second != -1) // calculate 2nd's distance from 1st, for SPB
|
||||||
|
{
|
||||||
|
secondist = P_AproxDistance(P_AproxDistance(players[first].mo->x - players[second].mo->x,
|
||||||
|
players[first].mo->y - players[second].mo->y),
|
||||||
|
players[first].mo->z - players[second].mo->z) / mapheaderinfo[gamemap-1]->mobj_scale
|
||||||
|
* (pingame - 1)
|
||||||
|
/ ((pingame - 1) * (pingame + 1) / 3);
|
||||||
|
if (franticitems)
|
||||||
|
secondist = (15*secondist/14);
|
||||||
|
}
|
||||||
|
|
||||||
switch (item)
|
switch (item)
|
||||||
{
|
{
|
||||||
case KITEM_SNEAKER:
|
case KITEM_SNEAKER:
|
||||||
|
@ -592,7 +604,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, player_t *player, boolean
|
||||||
|
|
||||||
//{ SRB2kart Roulette Code - Distance Based, no waypoints
|
//{ SRB2kart Roulette Code - Distance Based, no waypoints
|
||||||
|
|
||||||
static void K_KartItemRouletteByDistance(player_t *player, ticcmd_t *cmd)
|
static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
|
||||||
{
|
{
|
||||||
const INT32 distvar = (64*14);
|
const INT32 distvar = (64*14);
|
||||||
INT32 i;
|
INT32 i;
|
||||||
|
@ -605,9 +617,6 @@ static void K_KartItemRouletteByDistance(player_t *player, ticcmd_t *cmd)
|
||||||
UINT8 oddsvalid[9];
|
UINT8 oddsvalid[9];
|
||||||
UINT8 disttable[14];
|
UINT8 disttable[14];
|
||||||
UINT8 distlen = 0;
|
UINT8 distlen = 0;
|
||||||
INT32 secondist = 0;
|
|
||||||
SINT8 first = -1;
|
|
||||||
SINT8 second = -1;
|
|
||||||
boolean mashed = false;
|
boolean mashed = false;
|
||||||
|
|
||||||
// This makes the roulette cycle through items - if this is 0, you shouldn't be here.
|
// This makes the roulette cycle through items - if this is 0, you shouldn't be here.
|
||||||
|
@ -683,47 +692,32 @@ static void K_KartItemRouletteByDistance(player_t *player, ticcmd_t *cmd)
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
if (playeringame[i] && !players[i].spectator && players[i].mo)
|
if (playeringame[i] && !players[i].spectator && players[i].mo
|
||||||
{
|
&& players[i].kartstuff[k_position] < player->kartstuff[k_position])
|
||||||
if (players[i].kartstuff[k_position] < player->kartstuff[k_position])
|
|
||||||
pdis += P_AproxDistance(P_AproxDistance(players[i].mo->x - player->mo->x,
|
pdis += P_AproxDistance(P_AproxDistance(players[i].mo->x - player->mo->x,
|
||||||
players[i].mo->y - player->mo->y),
|
players[i].mo->y - player->mo->y),
|
||||||
players[i].mo->z - player->mo->z) / mapheaderinfo[gamemap-1]->mobj_scale
|
players[i].mo->z - player->mo->z) / mapheaderinfo[gamemap-1]->mobj_scale
|
||||||
* (pingame - players[i].kartstuff[k_position])
|
* (pingame - players[i].kartstuff[k_position])
|
||||||
/ ((pingame - 1) * (pingame + 1) / 3);
|
/ ((pingame - 1) * (pingame + 1) / 3);
|
||||||
if (players[i].kartstuff[k_position] == 1 && first == -1)
|
|
||||||
first = i;
|
|
||||||
if (players[i].kartstuff[k_position] == 2 && second == -1)
|
|
||||||
second = i;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (first != -1 && second != -1 && !secondist) // calculate 2nd's distance from 1st, for blue shell
|
|
||||||
secondist = P_AproxDistance(P_AproxDistance(players[first].mo->x - players[second].mo->x,
|
|
||||||
players[first].mo->y - players[second].mo->y),
|
|
||||||
players[first].mo->z - players[second].mo->z) / mapheaderinfo[gamemap-1]->mobj_scale
|
|
||||||
* (pingame - 1)
|
|
||||||
/ ((pingame - 1) * (pingame + 1) / 3);
|
|
||||||
|
|
||||||
#define SETUPDISTTABLE(odds, num) \
|
#define SETUPDISTTABLE(odds, num) \
|
||||||
for (i = num; i; --i) disttable[distlen++] = odds
|
for (i = num; i; --i) disttable[distlen++] = odds
|
||||||
|
|
||||||
if (G_BattleGametype()) // Battle Mode
|
if (G_BattleGametype()) // Battle Mode
|
||||||
{
|
{
|
||||||
UINT8 wantedpos;
|
|
||||||
|
|
||||||
if (oddsvalid[0]) SETUPDISTTABLE(0,1);
|
if (oddsvalid[0]) SETUPDISTTABLE(0,1);
|
||||||
if (oddsvalid[1]) SETUPDISTTABLE(1,1);
|
if (oddsvalid[1]) SETUPDISTTABLE(1,1);
|
||||||
if (oddsvalid[2]) SETUPDISTTABLE(2,1);
|
if (oddsvalid[2]) SETUPDISTTABLE(2,1);
|
||||||
if (oddsvalid[3]) SETUPDISTTABLE(3,1);
|
if (oddsvalid[3]) SETUPDISTTABLE(3,1);
|
||||||
if (oddsvalid[4]) SETUPDISTTABLE(4,1);
|
if (oddsvalid[4]) SETUPDISTTABLE(4,1);
|
||||||
// Nothing we can do about setting disttable[5], because of how that is set.
|
// Nothing we can do about getting new odds for disttable[5], because of how that is set.
|
||||||
|
|
||||||
if (player->kartstuff[k_roulettetype] == 1)
|
if (player->kartstuff[k_roulettetype] == 1)
|
||||||
useodds = 5;
|
useodds = 5;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wantedpos = (player->kartstuff[k_balloon]-avgballoon)+2; // 0 is two balloons below average, 2 is average, 4 is two balloons above average
|
UINT8 wantedpos = (player->kartstuff[k_balloon]-avgballoon)+2; // 0 is two balloons below average, 2 is average, 4 is two balloons above average
|
||||||
if (wantedpos > 4)
|
if (wantedpos > 4)
|
||||||
wantedpos = 4;
|
wantedpos = 4;
|
||||||
if (wantedpos < 0)
|
if (wantedpos < 0)
|
||||||
|
@ -743,10 +737,7 @@ static void K_KartItemRouletteByDistance(player_t *player, ticcmd_t *cmd)
|
||||||
if (oddsvalid[8]) SETUPDISTTABLE(8,1);
|
if (oddsvalid[8]) SETUPDISTTABLE(8,1);
|
||||||
|
|
||||||
if (franticitems) // Frantic items make the distances between everyone artifically higher, for crazier items
|
if (franticitems) // Frantic items make the distances between everyone artifically higher, for crazier items
|
||||||
{
|
|
||||||
pdis = (15*pdis/14);
|
pdis = (15*pdis/14);
|
||||||
secondist = (15*pdis/14);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pingame == 1 && oddsvalid[0]) // Record Attack, or just alone
|
if (pingame == 1 && oddsvalid[0]) // Record Attack, or just alone
|
||||||
useodds = 0;
|
useodds = 0;
|
||||||
|
@ -2162,7 +2153,7 @@ static void K_DoShrink(player_t *player)
|
||||||
|
|
||||||
static void K_DoSPB(player_t *victim, player_t *source)
|
static void K_DoSPB(player_t *victim, player_t *source)
|
||||||
{
|
{
|
||||||
INT32 i;
|
//INT32 i;
|
||||||
S_StartSound(victim->mo, sfx_bkpoof); // Sound the BANG!
|
S_StartSound(victim->mo, sfx_bkpoof); // Sound the BANG!
|
||||||
|
|
||||||
/*for (i = 0; i < MAXPLAYERS; i++)
|
/*for (i = 0; i < MAXPLAYERS; i++)
|
||||||
|
@ -2319,7 +2310,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
||||||
if (player->kartstuff[k_deathsentence])
|
if (player->kartstuff[k_deathsentence])
|
||||||
{
|
{
|
||||||
if (player->kartstuff[k_deathsentence] == 1)
|
if (player->kartstuff[k_deathsentence] == 1)
|
||||||
K_DoBlueShell(player, &players[spbplayer]);
|
K_DoSPB(player, &players[spbplayer]);
|
||||||
player->kartstuff[k_deathsentence]--;
|
player->kartstuff[k_deathsentence]--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2382,8 +2373,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
||||||
K_LakituChecker(player);
|
K_LakituChecker(player);
|
||||||
|
|
||||||
// Roulette Code
|
// Roulette Code
|
||||||
//K_KartItemRouletteByPosition(player, cmd); // Old, position-based
|
K_KartItemRoulette(player, cmd);
|
||||||
K_KartItemRouletteByDistance(player, cmd); // New, distance-based
|
|
||||||
|
|
||||||
// Stopping of the horrible invincibility SFX
|
// Stopping of the horrible invincibility SFX
|
||||||
if (player->mo->health <= 0 || player->mo->player->kartstuff[k_invincibilitytimer] <= 0
|
if (player->mo->health <= 0 || player->mo->player->kartstuff[k_invincibilitytimer] <= 0
|
||||||
|
@ -3129,8 +3119,41 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
||||||
case KITEM_SPB:
|
case KITEM_SPB:
|
||||||
if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO)
|
if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO)
|
||||||
{
|
{
|
||||||
K_DoShrink(player, true);
|
UINT8 ploop;
|
||||||
|
UINT8 bestrank = 0;
|
||||||
|
fixed_t dist = 0;
|
||||||
|
|
||||||
|
for (ploop = 0; ploop < MAXPLAYERS; ploop++)
|
||||||
|
{
|
||||||
|
fixed_t thisdist;
|
||||||
|
if (!playeringame[ploop] || players[ploop].spectator)
|
||||||
|
continue;
|
||||||
|
if (&players[ploop] == player)
|
||||||
|
continue;
|
||||||
|
if (!players[ploop].mo)
|
||||||
|
continue;
|
||||||
|
if (players[ploop].exiting)
|
||||||
|
continue;
|
||||||
|
thisdist = R_PointToDist2(player->mo->x, player->mo->y, players[ploop].mo->x, players[ploop].mo->y);
|
||||||
|
if (bestrank == 0 || players[ploop].kartstuff[k_position] < bestrank)
|
||||||
|
{
|
||||||
|
bestrank = players[ploop].kartstuff[k_position];
|
||||||
|
dist = thisdist;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dist == 0)
|
||||||
|
spbincoming = 6*TICRATE; // If you couldn't find anyone, just set an abritary timer
|
||||||
|
else
|
||||||
|
spbincoming = (tic_t)max(1, FixedDiv(dist, 64*FRACUNIT)/FRACUNIT);
|
||||||
|
|
||||||
|
spbplayer = player-players;
|
||||||
|
|
||||||
|
player->pflags |= PF_ATTACKDOWN;
|
||||||
player->kartstuff[k_itemamount]--;
|
player->kartstuff[k_itemamount]--;
|
||||||
|
|
||||||
|
K_PlayTauntSound(player->mo);
|
||||||
|
player->kartstuff[k_sounds] = 50;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case KITEM_GROW:
|
case KITEM_GROW:
|
||||||
|
@ -3154,7 +3177,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
||||||
case KITEM_SHRINK:
|
case KITEM_SHRINK:
|
||||||
if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO)
|
if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO)
|
||||||
{
|
{
|
||||||
K_DoShrink(player, false);
|
K_DoShrink(player);
|
||||||
player->kartstuff[k_itemamount]--;
|
player->kartstuff[k_itemamount]--;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -2549,7 +2549,7 @@ void A_MonitorPop(mobj_t *actor)
|
||||||
mobj_t *remains;
|
mobj_t *remains;
|
||||||
mobjtype_t explode;
|
mobjtype_t explode;
|
||||||
mobjtype_t item = 0;
|
mobjtype_t item = 0;
|
||||||
mobjtype_t newbox;
|
//mobjtype_t newbox;
|
||||||
|
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
if (LUA_CallAction("A_MonitorPop", actor))
|
if (LUA_CallAction("A_MonitorPop", actor))
|
||||||
|
|
|
@ -142,7 +142,7 @@ void S_StopSoundByNum(sfxenum_t sfxnum);
|
||||||
#ifdef MUSICSLOT_COMPATIBILITY
|
#ifdef MUSICSLOT_COMPATIBILITY
|
||||||
// For compatibility with code/scripts relying on older versions
|
// For compatibility with code/scripts relying on older versions
|
||||||
// This is a list of all the "special" slot names and their associated numbers
|
// This is a list of all the "special" slot names and their associated numbers
|
||||||
const char *compat_special_music_slots[21];
|
const char *compat_special_music_slots[16];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue