Galactic ballhog fuckup WIP

This commit is contained in:
Antonio Martinez 2025-07-29 05:28:13 -04:00 committed by AJ Martinez
parent b4d4e3a140
commit 6aed8f5f1c
9 changed files with 79 additions and 4 deletions

View file

@ -838,6 +838,7 @@ struct player_t
UINT16 counterdash; // Flame Shield boost without the flame, largely. Used in places where awarding thrust would affect player control.
UINT16 ballhogcharge; // Ballhog charge up -- the higher this value, the more projectiles
UINT8 ballhogburst;
boolean ballhogtap; // Ballhog released during charge: used to allow semirapid tapfire
mobj_t *ballhogreticule; // First ballhog reticule estimation object

View file

@ -1875,7 +1875,7 @@ static void K_drawKartItem(void)
V_ClearClipRect();
// A little goofy, but helps with ballhog charge conveyance—you're "loading" them.
UINT8 fakeitemamount = stplyr->itemamount - (stplyr->ballhogcharge / BALLHOGINCREMENT);
UINT8 fakeitemamount = stplyr->itemamount - std::min(stplyr->itemamount - 1, (stplyr->ballhogcharge / BALLHOGINCREMENT));
boolean transflag = V_HUDTRANS;

View file

@ -10984,6 +10984,17 @@ void K_KartResetPlayerColor(player_t *player)
}
}
if (player->ballhogcharge && player->ballhogburst >= (BALLHOG_BURST_FUSE/2))
{
if (player->ballhogburst % 2 == 0)
{
player->mo->colorized = true;
player->mo->color = SKINCOLOR_KETCHUP;
fullbright = true;
goto finalise;
}
}
if (player->invincibilitytimer) // You're gonna kiiiiill
{
const tic_t defaultTime = itemtime+(2*TICRATE);
@ -14696,6 +14707,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
{
if (player->ballhogcharge < ballhogmax)
{
player->ballhogburst = 0;
player->ballhogcharge++;
if (player->ballhogcharge % BALLHOGINCREMENT == 0)
@ -14713,6 +14725,47 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
S_StartSound(player->mo, hogsound[chargesound-1]);
}
}
else
{
player->ballhogburst++;
if (player->ballhogburst == BALLHOG_BURST_FUSE/2)
S_StartSound(player->mo, sfx_gshb8);
else if (player->ballhogburst == BALLHOG_BURST_FUSE)
{
K_PlayBoostTaunt(player->mo);
for (UINT8 j = 0; j < player->itemamount; j++)
{
K_DoSneaker(player, 0);
}
mobj_t *boom = P_SpawnMobjFromMobj(player->mo, 0, 0, 0, MT_THOK);
P_SetMobjState(boom, S_BALLHOGBOOM);
boom->scale = player->mo->scale + (player->mo->scale / 4 * player->itemamount);
// boom->momx = player->mo->momx/2;
// boom->momy = player->mo->momy/2;
// boom->momz = player->mo->momz/2;
boom->color = player->skincolor;
boom->colorized = true;
S_StartSound(player->mo, mobjinfo[MT_BALLHOG].deathsound);
K_StumblePlayer(player);
K_AddHitLag(player->mo, TICRATE/4, false);
player->tumbleBounces = 10;
P_Thrust(player->mo, player->mo->angle, 240 * player->mo->scale);
if (onground)
player->mo->momz += 10*player->mo->scale;
else
player->mo->momz -= 50*player->mo->scale;
player->itemamount = 0;
player->botvars.itemconfirm = 0;
player->ballhogcharge = 0;
player->ballhogburst = 0;
}
}
}
else
{
@ -16532,7 +16585,6 @@ static boolean K_PickUp(player_t *player, mobj_t *picked)
type = KITEM_JAWZ;
break;
case MT_BALLHOG:
case MT_BALLHOGBOOM:
type = KITEM_BALLHOG;
break;
case MT_LANDMINE:

View file

@ -68,6 +68,8 @@ Make sure this matches the actual number of states
#define FLAMESHIELD_MAX (120)
#define BALLHOG_BURST_FUSE (TICRATE)
#define RR_PROJECTILE_FUSE (8*TICRATE)
#define SCAMDIST (2000)

View file

@ -498,6 +498,8 @@ static int player_get(lua_State *L)
lua_pushinteger(L, plr->lightningcharge);
else if (fastcmp(field,"ballhogcharge"))
lua_pushinteger(L, plr->ballhogcharge);
else if (fastcmp(field,"ballhogburst"))
lua_pushinteger(L, plr->ballhogburst);
else if (fastcmp(field,"ballhogtap"))
lua_pushinteger(L, plr->ballhogtap);
else if (fastcmp(field,"hyudorotimer"))
@ -1139,6 +1141,8 @@ static int player_set(lua_State *L)
plr->lightningcharge = luaL_checkinteger(L, 3);
else if (fastcmp(field,"ballhogcharge"))
plr->ballhogcharge = luaL_checkinteger(L, 3);
else if (fastcmp(field,"ballhogburst"))
plr->ballhogburst = luaL_checkinteger(L, 3);
else if (fastcmp(field,"ballhogtap"))
plr->ballhogtap = luaL_checkinteger(L, 3);
else if (fastcmp(field,"hyudorotimer"))

View file

@ -12207,6 +12207,12 @@ void A_BallhogExplode(mobj_t *actor)
P_SetTarget(&mo2->target, actor->target);
S_StartSound(mo2, actor->info->deathsound);
if (actor->target && !P_MobjWasRemoved(actor->target) && actor->target->player)
{
mo2->color = actor->target->color;
mo2->colorized = true;
}
P_StartQuakeFromMobj(7, 50 * actor->scale, 1024 * actor->scale, actor);
actor->fuse = 1;

View file

@ -2775,11 +2775,17 @@ fixed_t P_BaseStepUp(void)
fixed_t P_GetThingStepUp(mobj_t *thing, fixed_t destX, fixed_t destY)
{
// I have no idea why this check caused Ballhog to step up on EVERYTHING,
// but it sure did step up on everything.
/*
if (thing->type == MT_BALLHOG || thing->type == MT_BALLHOG_RETICULE_TEST)
{
// these should explode, not go up stairs
return 0;
}
*/
const fixed_t maxstepmove = P_BaseStepUp();
fixed_t maxstep = maxstepmove;

View file

@ -1719,11 +1719,13 @@ boolean P_XYMovement(mobj_t *mo)
P_PushSpecialLine(result.line, mo);
/*
if (mo->type == MT_BALLHOG || mo->type == MT_BALLHOG_RETICULE_TEST)
{
P_ExplodeMissile(mo);
return false;
}
*/
if (mo->flags & MF_MISSILE)
{
@ -2011,7 +2013,7 @@ boolean P_XYMovement(mobj_t *mo)
return moved;
//{ SRB2kart stuff
if (mo->type == MT_FLINGRING || mo->type == MT_BALLHOG || mo->type == MT_BALLHOG_RETICULE_TEST || mo->type == MT_BUBBLESHIELDTRAP)
if (mo->type == MT_FLINGRING || mo->type == MT_BUBBLESHIELDTRAP)
return moved;
if (player && (player->spinouttimer && !player->wipeoutslow)
@ -2390,7 +2392,7 @@ boolean P_ZMovement(mobj_t *mo)
break;
case MT_BALLHOG:
case MT_BALLHOG_RETICULE_TEST:
if (mo->z <= mo->floorz || mo->z + mo->height >= mo->ceilingz)
if (mo->z <= mo->floorz)
{
P_ExplodeMissile(mo);
return false;

View file

@ -563,6 +563,7 @@ static void P_NetArchivePlayers(savebuffer_t *save)
WRITEUINT8(save->p, players[i].lightningcharge);
WRITEUINT16(save->p, players[i].ballhogcharge);
WRITEUINT8(save->p, players[i].ballhogburst);
WRITEUINT8(save->p, players[i].ballhogtap);
WRITEUINT16(save->p, players[i].hyudorotimer);
@ -1229,6 +1230,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
players[i].lightningcharge = READUINT8(save->p);
players[i].ballhogcharge = READUINT16(save->p);
players[i].ballhogburst = READUINT8(save->p);
players[i].ballhogtap = READUINT8(save->p);
players[i].hyudorotimer = READUINT16(save->p);