Merge branch 'master' into hit-stop-efx

# Conflicts:
#	src/objects/ufo.c
This commit is contained in:
VelocitOni 2023-07-03 06:24:27 -04:00
commit 30d21e960a
9 changed files with 242 additions and 11 deletions

View file

@ -2595,6 +2595,10 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
{
rings = 20;
}
else if (gametyperules & GTR_CATCHER)
{
rings = 20;
}
else
{
rings = 5;

View file

@ -10798,7 +10798,6 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
player->ringboxdelay--;
if (player->ringboxdelay == 0)
{
// TODO
UINT32 behind = K_GetItemRouletteDistance(player, player->itemRoulette.playing);
UINT32 behindMulti = behind / 1000;
behindMulti = min(behindMulti, 20);
@ -10808,6 +10807,10 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
award = 3 * award / 2;
award = award * (behindMulti + 10) / 10;
// SPB Attack is hard, but we're okay with that.
if (modeattacking & ATTACKING_SPB)
award = award / 2;
K_AwardPlayerRings(player, award, true);
player->ringboxaward = 0;
}

View file

@ -146,12 +146,15 @@ static UINT8 cheatf_devmode(void)
gamedata->unlocked[i] = true;
}
G_SetUsedCheats();
// This is a developer feature, you know how to delete ringdata
// G_SetUsedCheats();
S_StartSound(0, sfx_kc42);
devparm = true;
cht_debug |= 0x8000;
G_SaveGameData();
return 1;
}
#endif

View file

@ -287,10 +287,10 @@ void M_Challenges(INT32 choice)
M_SetupNextMenu(&MISC_ChallengesDef, false);
}
static boolean M_CanKeyHiliTile(void)
static boolean M_CanKeyHiliTile(boolean devskip)
{
// No keys to do it with?
if (gamedata->chaokeys == 0)
if (gamedata->chaokeys == 0 && !devskip)
return false;
// No tile data?
@ -306,14 +306,15 @@ static boolean M_CanKeyHiliTile(void)
return false;
// Marked as unskippable?
if (unlockables[challengesmenu.currentunlock].majorunlock == true)
if (unlockables[challengesmenu.currentunlock].majorunlock == true && !devskip)
return false;
UINT16 i = (challengesmenu.hilix * CHALLENGEGRIDHEIGHT) + challengesmenu.hiliy;
// Not a hinted tile OR a fresh board.
if (!(challengesmenu.extradata[i].flags & CHE_HINT)
&& (challengesmenu.unlockcount[CC_UNLOCKED] + challengesmenu.unlockcount[CC_TALLY] > 0))
&& (challengesmenu.unlockcount[CC_UNLOCKED] + challengesmenu.unlockcount[CC_TALLY] > 0)
&& !devskip)
return false;
// All good!
@ -366,7 +367,12 @@ void M_ChallengesTick(void)
if (challengesmenu.chaokeyhold)
{
if (M_MenuExtraHeld(pid) && M_CanKeyHiliTile())
boolean devskip = false;
#ifdef DEVELOP
devskip = M_MenuButtonHeld(pid, MBT_Z);
#endif
// A little messy, but don't freak out, this is just so devs don't crash the game on non-tiles
if ((devskip || M_MenuExtraHeld(pid)) && M_CanKeyHiliTile(devskip))
{
// Not pressed just this frame?
if (!M_MenuExtraPressed(pid))
@ -605,7 +611,7 @@ boolean M_ChallengesInputs(INT32 ch)
}
else if (M_MenuExtraPressed(pid))
{
if (M_CanKeyHiliTile())
if (M_CanKeyHiliTile(false))
{
challengesmenu.chaokeyhold = 1;
}
@ -628,6 +634,13 @@ boolean M_ChallengesInputs(INT32 ch)
}
return true;
}
#ifdef DEVELOP
else if (M_MenuButtonPressed(pid, MBT_Z))
{
challengesmenu.chaokeyhold = 1;
return true;
}
#endif
else
{
if (M_MenuBackPressed(pid) || start)

View file

@ -114,7 +114,8 @@ void Obj_RandomItemVisuals(mobj_t *mobj)
// the player's cleared out a good portion of the map.
//
// Then extraval1 starts ticking up and triggers the transformation from Ringbox to Random Item.
if (mobj->fuse == 0 && !(mobj->flags & MF_NOCLIPTHING) && !cv_thunderdome.value)
if (mobj->fuse == 0 && !(mobj->flags & MF_NOCLIPTHING)
&& !cv_thunderdome.value && !(modeattacking & ATTACKING_SPB))
{
mobj->extravalue1++;
if (mobj->extravalue1 == RINGBOX_TIME)

View file

@ -661,6 +661,7 @@ static void SPBChase(mobj_t *spb, mobj_t *bestMobj)
baseSpeed = SPB_DEFAULTSPEED;
range = (160 * chase->scale);
range = max(range, FixedMul(range, K_GetKartGameSpeedScalar(gamespeed)));
// Play the intimidating gurgle
if (S_SoundPlaying(spb, spb->info->activesound) == false)

View file

@ -36,6 +36,9 @@
#define UFO_DAMAGED_SPEED (UFO_BASE_SPEED >> 1) // Speed to add when UFO takes damage.
#define UFO_START_SPEED (UFO_BASE_SPEED << 1) // Speed when the map starts.
#define UFO_PITY_DIST (10000) // Let's aim for an exciting finish! Try to stick closer to the player once they're past this threshold.
#define UFO_PITY_BRAKES (600 * FRACUNIT) // Subtract this amount from UFO_SFACING, starting at UFO_PITY_DIST and ending at the finish line.
#define UFO_NUMARMS (3)
#define UFO_ARMDELTA (ANGLE_MAX / UFO_NUMARMS)
@ -53,6 +56,8 @@
#define ufo_piece_next(o) ((o)->hnext)
#define ufo_piece_prev(o) ((o)->hprev)
#define ufo_intangible(o) ((o)->cusval)
enum
{
UFO_PIECE_TYPE_POD,
@ -168,9 +173,12 @@ static void UFOUpdateDistanceToFinish(mobj_t *ufo)
static void UFOUpdateSpeed(mobj_t *ufo)
{
const fixed_t mapspeedscale = FixedMul(mapobjectscale, K_GetKartGameSpeedScalar(gamespeed));
const fixed_t baseSpeed = FixedMul(UFO_BASE_SPEED, K_GetKartGameSpeedScalar(gamespeed));
const UINT32 spacing = FixedMul(FixedMul(UFO_SPACING, mapobjectscale), K_GetKartGameSpeedScalar(gamespeed)) >> FRACBITS;
const UINT32 deadzone = FixedMul(FixedMul(UFO_DEADZONE, mapobjectscale), K_GetKartGameSpeedScalar(gamespeed)) >> FRACBITS;
const UINT32 deadzone = FixedMul(UFO_DEADZONE, mapspeedscale) >> FRACBITS;
UINT32 spacing = FixedMul(UFO_SPACING, mapspeedscale) >> FRACBITS;
UINT32 distanceNerf = FixedMul(UFO_PITY_BRAKES, mapspeedscale) >> FRACBITS;
// Best values of all of the players.
UINT32 bestDist = UINT32_MAX;
@ -224,6 +232,13 @@ static void UFOUpdateSpeed(mobj_t *ufo)
{
INT32 distDelta = 0;
if (bestDist < UFO_PITY_DIST && UFOEmeraldChase(ufo))
{
INT32 brakeDelta = UFO_PITY_DIST - bestDist;
INT32 distPerNerf = UFO_PITY_DIST / distanceNerf; // Doing this in the sensible way integer overflows. Sorry.
spacing = spacing - (brakeDelta / distPerNerf);
}
if (bestDist > spacing)
{
wantedDist = bestDist - spacing;
@ -496,6 +511,9 @@ void Obj_SpecialUFOThinker(mobj_t *ufo)
UFOUpdateSpeed(ufo);
UFOUpdateSound(ufo);
if (ufo_intangible(ufo))
ufo_intangible(ufo)--;
if (UFOEmeraldChase(ufo) == true)
{
// Spawn emerald sparkles
@ -767,6 +785,8 @@ boolean Obj_SpecialUFODamage(mobj_t *ufo, mobj_t *inflictor, mobj_t *source, UIN
SetRandomFakePlayerSkin(source->player, true);
}
ufo_intangible(ufo) = 30;
// Speed up on damage!
ufo_speed(ufo) += addSpeed;
@ -817,6 +837,11 @@ void Obj_PlayerUFOCollide(mobj_t *ufo, mobj_t *other)
return; // underneath
}
if (ufo_intangible(ufo))
{
return; // We were just hit!
}
if ((other->player->sneakertimer > 0)
&& !P_PlayerInPain(other->player)
&& (other->player->flashing == 0))

View file

@ -1325,6 +1325,97 @@ sfxinfo_t S_sfx[NUMSFX] =
{"krti11", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"krti12", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR, ""},
// Gunstar Heroes
// Gunstar Heroes
{"gsha0", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gsha1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gsha2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gsha3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gsha4", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gsha5", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gsha6", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gsha7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gsha8", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gsha9", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshaa", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshab", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshac", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshad", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshae", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshaf", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshb0", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshb1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshb2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshb3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshb4", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshb5", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshb6", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshb7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshb8", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshb9", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshba", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshbb", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshbc", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshbd", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshbe", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshbf", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshc0a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshc0b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshc0c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshc0d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshc0e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshc0f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshc0g", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshc1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshc2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshc3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshc4", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshc5", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshc6", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshc7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshc8", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshc9", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshca", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshcb", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshcc", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshcd", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshce", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshcf", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshd0", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshd1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshd2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshd3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshd4", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshd5", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshd6", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshd7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshd8", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshd9", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshda", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshdb", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshdc", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshdd", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshde", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshdf", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshe0", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshe1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshe2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshe3", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshe4", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshe5", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshe6", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshe7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshe8", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshe9", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshea", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gsheb", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshec", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshed", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshee", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshef", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshf0", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
{"gshf1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
// SRB2kart - Skin sounds
{"kwin", false, 64, 96, -1, NULL, 0, SKSKWIN, -1, LUMPERROR, ""},
{"klose", false, 64, 96, -1, NULL, 0, SKSKLOSE, -1, LUMPERROR, ""},

View file

@ -1393,6 +1393,96 @@ typedef enum
sfx_krti11,
sfx_krti12,
// Gunstar Heroes
sfx_gsha0,
sfx_gsha1,
sfx_gsha2,
sfx_gsha3,
sfx_gsha4,
sfx_gsha5,
sfx_gsha6,
sfx_gsha7,
sfx_gsha8,
sfx_gsha9,
sfx_gshaa,
sfx_gshab,
sfx_gshac,
sfx_gshad,
sfx_gshae,
sfx_gshaf,
sfx_gshb0,
sfx_gshb1,
sfx_gshb2,
sfx_gshb3,
sfx_gshb4,
sfx_gshb5,
sfx_gshb6,
sfx_gshb7,
sfx_gshb8,
sfx_gshb9,
sfx_gshba,
sfx_gshbb,
sfx_gshbc,
sfx_gshbd,
sfx_gshbe,
sfx_gshbf,
sfx_gshc0a,
sfx_gshc0b,
sfx_gshc0c,
sfx_gshc0d,
sfx_gshc0e,
sfx_gshc0f,
sfx_gshc0g,
sfx_gshc1,
sfx_gshc2,
sfx_gshc3,
sfx_gshc4,
sfx_gshc5,
sfx_gshc6,
sfx_gshc7,
sfx_gshc8,
sfx_gshc9,
sfx_gshca,
sfx_gshcb,
sfx_gshcc,
sfx_gshcd,
sfx_gshce,
sfx_gshcf,
sfx_gshd0,
sfx_gshd1,
sfx_gshd2,
sfx_gshd3,
sfx_gshd4,
sfx_gshd5,
sfx_gshd6,
sfx_gshd7,
sfx_gshd8,
sfx_gshd9,
sfx_gshda,
sfx_gshdb,
sfx_gshdc,
sfx_gshdd,
sfx_gshde,
sfx_gshdf,
sfx_gshe0,
sfx_gshe1,
sfx_gshe2,
sfx_gshe3,
sfx_gshe4,
sfx_gshe5,
sfx_gshe6,
sfx_gshe7,
sfx_gshe8,
sfx_gshe9,
sfx_gshea,
sfx_gsheb,
sfx_gshec,
sfx_gshed,
sfx_gshee,
sfx_gshef,
sfx_gshf0,
sfx_gshf1,
// And LASTLY, Kart's skin sounds.
sfx_kwin,
sfx_klose,