Simpler 120-tic flame shield behavior

This commit is contained in:
AJ Martinez 2023-07-29 05:10:14 -07:00
parent 9171992a9f
commit 6607722b64
7 changed files with 28 additions and 23 deletions

View file

@ -742,7 +742,6 @@ extern INT32 greasetics;
extern INT32 wipeoutslowtime; extern INT32 wipeoutslowtime;
extern INT32 wantedreduce; extern INT32 wantedreduce;
extern INT32 wantedfrequency; extern INT32 wantedfrequency;
extern INT32 flameseg;
extern UINT8 introtoplay; extern UINT8 introtoplay;
extern UINT8 creditscutscene; extern UINT8 creditscutscene;

View file

@ -254,7 +254,6 @@ INT32 greasetics = 3*TICRATE;
INT32 wipeoutslowtime = 20; INT32 wipeoutslowtime = 20;
INT32 wantedreduce = 5*TICRATE; INT32 wantedreduce = 5*TICRATE;
INT32 wantedfrequency = 10*TICRATE; INT32 wantedfrequency = 10*TICRATE;
INT32 flameseg = TICRATE/4;
UINT8 use1upSound = 0; UINT8 use1upSound = 0;
UINT8 maxXtraLife = 2; // Max extra lives from rings UINT8 maxXtraLife = 2; // Max extra lives from rings

View file

@ -1247,7 +1247,7 @@ static void K_BotItemFlame(player_t *player, ticcmd_t *cmd)
} }
else if (player->pflags & PF_HOLDREADY) else if (player->pflags & PF_HOLDREADY)
{ {
INT32 flamemax = player->flamelength * flameseg; INT32 flamemax = player->flamelength;
if (player->flamemeter < flamemax || flamemax == 0) if (player->flamemeter < flamemax || flamemax == 0)
{ {

View file

@ -163,8 +163,8 @@ static patch_t *kp_typdot;
static patch_t *kp_eggnum[6]; static patch_t *kp_eggnum[6];
static patch_t *kp_flameshieldmeter[104][2]; static patch_t *kp_flameshieldmeter[FLAMESHIELD_MAX][2];
static patch_t *kp_flameshieldmeter_bg[16][2]; static patch_t *kp_flameshieldmeter_bg[FLAMESHIELD_MAX][2];
static patch_t *kp_fpview[3]; static patch_t *kp_fpview[3];
static patch_t *kp_inputwheel[5]; static patch_t *kp_inputwheel[5];
@ -502,7 +502,7 @@ void K_LoadKartHUDGraphics(void)
HU_UpdatePatch(&kp_jackpot[0], "K_RBJACK"); HU_UpdatePatch(&kp_jackpot[0], "K_RBJACK");
sprintf(buffer, "FSMFGxxx"); sprintf(buffer, "FSMFGxxx");
for (i = 0; i < 104; i++) for (i = 0; i < FLAMESHIELD_MAX; i++)
{ {
buffer[5] = '0'+((i+1)/100); buffer[5] = '0'+((i+1)/100);
buffer[6] = '0'+(((i+1)/10)%10); buffer[6] = '0'+(((i+1)/10)%10);
@ -510,10 +510,11 @@ void K_LoadKartHUDGraphics(void)
HU_UpdatePatch(&kp_flameshieldmeter[i][0], "%s", buffer); HU_UpdatePatch(&kp_flameshieldmeter[i][0], "%s", buffer);
} }
sprintf(buffer, "FSMBG0xx"); sprintf(buffer, "FSMBGxxx");
for (i = 0; i < 16; i++) for (i = 0; i < FLAMESHIELD_MAX; i++)
{ {
buffer[6] = '0'+((i+1)/10); buffer[5] = '0'+((i+1)/100);
buffer[6] = '0'+(((i+1)/10)%10);
buffer[7] = '0'+((i+1)%10); buffer[7] = '0'+((i+1)%10);
HU_UpdatePatch(&kp_flameshieldmeter_bg[i][0], "%s", buffer); HU_UpdatePatch(&kp_flameshieldmeter_bg[i][0], "%s", buffer);
} }
@ -561,7 +562,7 @@ void K_LoadKartHUDGraphics(void)
HU_UpdatePatch(&kp_jackpot[1], "K_SBJACK"); HU_UpdatePatch(&kp_jackpot[1], "K_SBJACK");
sprintf(buffer, "FSMFSxxx"); sprintf(buffer, "FSMFSxxx");
for (i = 0; i < 104; i++) for (i = 0; i < 120; i++)
{ {
buffer[5] = '0'+((i+1)/100); buffer[5] = '0'+((i+1)/100);
buffer[6] = '0'+(((i+1)/10)%10); buffer[6] = '0'+(((i+1)/10)%10);
@ -570,9 +571,10 @@ void K_LoadKartHUDGraphics(void)
} }
sprintf(buffer, "FSMBS0xx"); sprintf(buffer, "FSMBS0xx");
for (i = 0; i < 16; i++) for (i = 0; i < 120; i++)
{ {
buffer[6] = '0'+((i+1)/10); buffer[5] = '0'+((i+1)/100);
buffer[6] = '0'+(((i+1)/10)%10);
buffer[7] = '0'+((i+1)%10); buffer[7] = '0'+((i+1)%10);
HU_UpdatePatch(&kp_flameshieldmeter_bg[i][1], "%s", buffer); HU_UpdatePatch(&kp_flameshieldmeter_bg[i][1], "%s", buffer);
} }
@ -1534,14 +1536,13 @@ static void K_drawKartItem(void)
if (stplyr->itemtype == KITEM_FLAMESHIELD && stplyr->flamelength > 0) if (stplyr->itemtype == KITEM_FLAMESHIELD && stplyr->flamelength > 0)
{ {
INT32 numframes = 104; INT32 numframes = FLAMESHIELD_MAX;
INT32 absolutemax = 16 * flameseg; INT32 absolutemax = numframes;
INT32 flamemax = stplyr->flamelength * flameseg; INT32 flamemax = stplyr->flamelength;
INT32 flamemeter = min(stplyr->flamemeter, flamemax); INT32 flamemeter = min(stplyr->flamemeter, flamemax);
INT32 bf = 16 - stplyr->flamelength; INT32 bf = numframes - stplyr->flamelength;
INT32 ff = numframes - ((flamemeter * numframes) / absolutemax); INT32 ff = numframes - ((flamemeter * numframes) / absolutemax);
INT32 fmin = (8 * (bf-1));
INT32 xo = 6, yo = 4; INT32 xo = 6, yo = 4;
INT32 flip = 0; INT32 flip = 0;
@ -1557,10 +1558,13 @@ static void K_drawKartItem(void)
} }
} }
/*
INT32 fmin = (8 * (bf-1));
if (ff < fmin) if (ff < fmin)
ff = fmin; ff = fmin;
*/
if (bf >= 0 && bf < 16) if (bf >= 0 && bf < numframes)
V_DrawScaledPatch(fx-xo, fy-yo, V_HUDTRANS|V_SLIDEIN|fflags|flip, kp_flameshieldmeter_bg[bf][offset]); V_DrawScaledPatch(fx-xo, fy-yo, V_HUDTRANS|V_SLIDEIN|fflags|flip, kp_flameshieldmeter_bg[bf][offset]);
if (ff >= 0 && ff < numframes && stplyr->flamemeter > 0) if (ff >= 0 && ff < numframes && stplyr->flamemeter > 0)

View file

@ -9958,6 +9958,7 @@ static INT32 K_FlameShieldMax(player_t *player)
{ {
UINT32 disttofinish = 0; UINT32 disttofinish = 0;
UINT32 distv = 2048; UINT32 distv = 2048;
distv = distv * 16 / FLAMESHIELD_MAX; // Old distv was based on a 16-segment bar
UINT8 numplayers = 0; UINT8 numplayers = 0;
UINT8 i; UINT8 i;
@ -9974,7 +9975,7 @@ static INT32 K_FlameShieldMax(player_t *player)
if (numplayers <= 1) if (numplayers <= 1)
{ {
return 16; // max when alone, for testing return FLAMESHIELD_MAX; // max when alone, for testing
// and when in battle, for chaos // and when in battle, for chaos
} }
else if (player->position == 1) else if (player->position == 1)
@ -9984,7 +9985,7 @@ static INT32 K_FlameShieldMax(player_t *player)
disttofinish = player->distancetofinish - disttofinish; disttofinish = player->distancetofinish - disttofinish;
distv = FixedMul(distv, mapobjectscale); distv = FixedMul(distv, mapobjectscale);
return min(16, 1 + (disttofinish / distv)); return min(FLAMESHIELD_MAX, (FLAMESHIELD_MAX / 16) + (disttofinish / distv)); // Ditto for this minimum, old value was 1/16
} }
boolean K_PlayerEBrake(player_t *player) boolean K_PlayerEBrake(player_t *player)
@ -11392,7 +11393,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
if (player->flamelength < destlen) if (player->flamelength < destlen)
player->flamelength++; // Can always go up! player->flamelength++; // Can always go up!
flamemax = player->flamelength * flameseg; flamemax = player->flamelength;
if (flamemax > 0) if (flamemax > 0)
flamemax += TICRATE; // leniency period flamemax += TICRATE; // leniency period
@ -11444,7 +11445,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
{ {
player->flamelength--; // Can ONLY go down if you're not using it player->flamelength--; // Can ONLY go down if you're not using it
flamemax = player->flamelength * flameseg; flamemax = player->flamelength;
if (flamemax > 0) if (flamemax > 0)
flamemax += TICRATE; // leniency period flamemax += TICRATE; // leniency period
} }

View file

@ -35,6 +35,8 @@ Make sure this matches the actual number of states
#define INSTAWHIP_DROPGUARD (12) #define INSTAWHIP_DROPGUARD (12)
#define GUARDBREAK_COOLDOWN (TICRATE*4) #define GUARDBREAK_COOLDOWN (TICRATE*4)
#define FLAMESHIELD_MAX (120)
#define RR_PROJECTILE_FUSE (8*TICRATE) #define RR_PROJECTILE_FUSE (8*TICRATE)
#define STUMBLE_STEEP_VAL ANG60 #define STUMBLE_STEEP_VAL ANG60

View file

@ -8322,7 +8322,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
return false; return false;
} }
flamemax = mobj->target->player->flamelength * flameseg; flamemax = mobj->target->player->flamelength;
P_SetScale(mobj, (mobj->destscale = (5*mobj->target->scale)>>2)); P_SetScale(mobj, (mobj->destscale = (5*mobj->target->scale)>>2));