Merge pull request 'Continue to attempt to make legacy odds bearable' (#138) from ledamagecontrol into blankart-dev
Reviewed-on: https://codeberg.org/NepDisk/blankart/pulls/138
This commit is contained in:
commit
62fab4b7b2
5 changed files with 37 additions and 7 deletions
|
|
@ -564,6 +564,17 @@ consvar_t cv_kartdrafting_basedistance = CVAR_INIT ("kartdrafting_basedistance",
|
|||
|
||||
consvar_t cv_kartairdrop = CVAR_INIT ("kartairdrop", "No", CV_NETVAR|CV_CALL|CV_NOINIT, CV_YesNo, KartAirDrop_OnChange);
|
||||
|
||||
// Odds distancing
|
||||
#define MAXODDSDIST ((INT32_MAX / FRACUNIT) / 2)
|
||||
static CV_PossibleValue_t distvar_cons_t[] = {{1, "MIN"}, {MAXODDSDIST, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_kartoddsdist = CVAR_INIT ("kartoddsdist", "2048", CV_NETVAR|CV_CHEAT, distvar_cons_t, NULL);
|
||||
consvar_t cv_kartlegacyoddsdist = CVAR_INIT ("kartlegacyoddsdist", "2048", CV_NETVAR|CV_CHEAT, distvar_cons_t, NULL);
|
||||
|
||||
// SPB distance; no legacy modifiers currently (lazy)
|
||||
static CV_PossibleValue_t spbdist_cons_t[] = {{1, "MIN"}, {32000, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_kartspbdist = CVAR_INIT ("kartspbdist", "8192", CV_NETVAR|CV_CHEAT, spbdist_cons_t, NULL);
|
||||
#undef MAXODDSDIST
|
||||
|
||||
// Invincibility modifiers
|
||||
static CV_PossibleValue_t invintype_cons_t[] = {{0, "Legacy"}, {1, "Alternative"}, {0, NULL}};
|
||||
consvar_t cv_kartinvintype = CVAR_INIT ("kartinvintype", "Legacy", CV_NETVAR|CV_CALL, invintype_cons_t, KartInvinType_OnChange);
|
||||
|
|
|
|||
|
|
@ -204,6 +204,10 @@ extern consvar_t cv_kartinvin_midtime;
|
|||
|
||||
extern consvar_t cv_kartairdrop;
|
||||
|
||||
extern consvar_t cv_kartoddsdist;
|
||||
extern consvar_t cv_kartlegacyoddsdist;
|
||||
extern consvar_t cv_kartspbdist;
|
||||
|
||||
extern consvar_t cv_encorevotes;
|
||||
|
||||
extern consvar_t cv_votetime;
|
||||
|
|
|
|||
|
|
@ -391,6 +391,10 @@ void K_RegisterKartStuff(void)
|
|||
CV_RegisterVar(&cv_kartinvin_maxtime);
|
||||
CV_RegisterVar(&cv_kartinvin_midtime);
|
||||
|
||||
CV_RegisterVar(&cv_kartoddsdist);
|
||||
CV_RegisterVar(&cv_kartlegacyoddsdist);
|
||||
CV_RegisterVar(&cv_kartspbdist);
|
||||
|
||||
CV_RegisterVar(&cv_kartdriftsounds);
|
||||
CV_RegisterVar(&cv_kartdriftefx);
|
||||
CV_RegisterVar(&cv_driftsparkpulse);
|
||||
|
|
|
|||
19
src/k_odds.c
19
src/k_odds.c
|
|
@ -152,10 +152,13 @@ static UINT8 K_KartItemOddsBattle[NUMKARTRESULTS][2] =
|
|||
{ 5, 1 } // Jawz x2
|
||||
};
|
||||
|
||||
#define DISTVAR (K_UsingLegacyCheckpoints() ? 1480 : 2048) // Magic number distance for use with item roulette tiers
|
||||
#define SPBSTARTDIST (4*DISTVAR) // Distance when SPB can start appearing
|
||||
#define SPBFORCEDIST (14*DISTVAR) // Distance when SPB is forced onto 2nd place
|
||||
#define ENDDIST (12*DISTVAR) // Distance when the game stops giving you bananas
|
||||
// Magic number distance for use with item roulette tiers
|
||||
#define ACTIVEDISTVAR (K_UsingLegacyCheckpoints() ? DISTVAR_LEGACY : DISTVAR)
|
||||
|
||||
#define SPBSTARTDIST (SPBDISTVAR) // Distance when SPB can start appearing
|
||||
#define SPBFORCEDIST (7 * SPBDISTVAR / 2) // Distance when SPB is forced onto 2nd place (3.5x SPBDISTVAR)
|
||||
|
||||
#define ENDDIST (12*ACTIVEDISTVAR) // Distance when the game stops giving you bananas
|
||||
|
||||
SINT8 K_ItemResultToType(SINT8 getitem)
|
||||
{
|
||||
|
|
@ -762,11 +765,11 @@ UINT8 K_FindUseodds(const player_t *player, fixed_t mashed, UINT32 pdis, UINT8 b
|
|||
SETUPDISTTABLE(6,3);
|
||||
SETUPDISTTABLE(7,1);*/
|
||||
|
||||
const INT32 usedistvar = FixedDiv(DISTVAR, oddsfac);
|
||||
const INT32 usedistvar = FixedDiv(ACTIVEDISTVAR, oddsfac);
|
||||
|
||||
if (pdis == 0)
|
||||
useodds = disttable[0];
|
||||
else if (pdis > (UINT32)DISTVAR * ((12 * distlen) / oddsdiv))
|
||||
else if (pdis > (UINT32)ACTIVEDISTVAR * ((12 * distlen) / oddsdiv))
|
||||
useodds = disttable[distlen-1];
|
||||
else
|
||||
{
|
||||
|
|
@ -980,9 +983,11 @@ UINT32 K_CalculateInitalPDIS(const player_t *player, UINT8 pingame)
|
|||
// Again, but this time base it on playercount, same form as
|
||||
// the following vanilla adjustment, but much weaker since it
|
||||
// stacks with it
|
||||
|
||||
// MAXODDS should always match the number of players the game is designed
|
||||
// around, so there shouldn't be any issues with basing this calc around that.
|
||||
pdis = ((100 + MAXODDS - min(pingame, 16)) * pdis) / 100;
|
||||
// Hacky solution to the overflow problem: use 64-bit integers!
|
||||
pdis = (UINT32)(((UINT64)(100 + MAXODDS - min(pingame, 16)) * pdis) / 100);
|
||||
|
||||
// Advance to next index.
|
||||
firstIndex = secondIndex;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
#include "d_player.h" // Need for player_t
|
||||
#include "d_ticcmd.h"
|
||||
#include "m_fixed.h"
|
||||
#include "k_kart.h" // K_RAGuard
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
@ -28,6 +29,11 @@ extern "C" {
|
|||
// Max odds count
|
||||
#define MAXODDS 16
|
||||
|
||||
// Distance variables
|
||||
#define DISTVAR K_RAGuard(cv_kartoddsdist)
|
||||
#define DISTVAR_LEGACY K_RAGuard(cv_kartlegacyoddsdist)
|
||||
#define SPBDISTVAR K_RAGuard(cv_kartspbdist)
|
||||
|
||||
extern consvar_t *KartItemCVars[NUMKARTRESULTS-1];
|
||||
|
||||
UINT32 K_CalculateInitalPDIS(const player_t *player, UINT8 pingame);
|
||||
|
|
|
|||
Loading…
Reference in a new issue