mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-31 05:20:51 +00:00
Merge branch 'sonicitems' into encore
This commit is contained in:
commit
2d92aefc29
6 changed files with 86 additions and 32 deletions
|
@ -59,8 +59,8 @@ char sprnames[NUMSPRITES + 1][5] =
|
|||
"FITM","BANA","ORBN","JAWZ","SSMN","KRBM","BHOG","BHBM","BLIG","LIGH",
|
||||
"THNS","SINK","SITR","KBLN","DEZL","POKE","AUDI","DECO","DOOD","SNES",
|
||||
"GBAS","SPRS","BUZB","CHOM","SACO","CRAB","SHAD","BRNG","BUMP","FLEN",
|
||||
"CLAS","PSHW","ISTA","ISTB","ARRO","ITEM","ITMI","ITMN","WANT","PBOM",
|
||||
"VIEW"
|
||||
"CLAS","PSHW","ISTA","ISTB","ARRO","ITEM","ITMO","ITMI","ITMN","WANT",
|
||||
"PBOM","VIEW"
|
||||
};
|
||||
|
||||
// Doesn't work with g++, needs actionf_p1 (don't modify this comment)
|
||||
|
|
|
@ -631,6 +631,7 @@ typedef enum sprite
|
|||
|
||||
SPR_ARRO, // player arrows
|
||||
SPR_ITEM,
|
||||
SPR_ITMO,
|
||||
SPR_ITMI,
|
||||
SPR_ITMN,
|
||||
SPR_WANT,
|
||||
|
|
53
src/k_kart.c
53
src/k_kart.c
|
@ -790,7 +790,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
|
|||
player->kartstuff[k_itemroulette] = 0;
|
||||
player->kartstuff[k_roulettetype] = 0;
|
||||
if (P_IsLocalPlayer(player))
|
||||
S_StartSound(NULL, sfx_mkitmF);
|
||||
S_StartSound(NULL, sfx_mkitmE);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -801,7 +801,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
|
|||
player->kartstuff[k_itemroulette] = 0;
|
||||
player->kartstuff[k_roulettetype] = 0;
|
||||
if (P_IsLocalPlayer(player))
|
||||
S_StartSound(NULL, sfx_mkitmF);
|
||||
S_StartSound(NULL, sfx_dbgsal);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3019,7 +3019,26 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
ghost->fuse = 4;
|
||||
ghost->frame |= FF_FULLBRIGHT;
|
||||
}
|
||||
else if (player->kartstuff[k_growshrinktimer] != 0)
|
||||
else if (player->kartstuff[k_eggmanexplode])
|
||||
{
|
||||
INT32 flashtime = 4<<(player->kartstuff[k_eggmanexplode]/TICRATE);
|
||||
if (player->kartstuff[k_eggmanexplode] == 1 || (player->kartstuff[k_eggmanexplode] % (flashtime/2) != 0))
|
||||
{
|
||||
player->mo->colorized = false;
|
||||
player->mo->color = player->skincolor;
|
||||
}
|
||||
else if (player->kartstuff[k_eggmanexplode] % flashtime == 0)
|
||||
{
|
||||
player->mo->colorized = true;
|
||||
player->mo->color = SKINCOLOR_BLACK;
|
||||
}
|
||||
else
|
||||
{
|
||||
player->mo->colorized = true;
|
||||
player->mo->color = SKINCOLOR_CRIMSON;
|
||||
}
|
||||
}
|
||||
else if (player->kartstuff[k_growshrinktimer])
|
||||
{
|
||||
if (player->kartstuff[k_growshrinktimer] % 5 == 0)
|
||||
{
|
||||
|
@ -4913,6 +4932,7 @@ static void K_drawKartItem(void)
|
|||
patch_t *localbg = ((splitscreen > 1) ? kp_itembg[2] : kp_itembg[0]);
|
||||
patch_t *localinv = ((splitscreen > 1) ? kp_invincibility[((leveltime % (6*3)) / 3) + 7] : kp_invincibility[(leveltime % (7*3)) / 3]);
|
||||
INT32 splitflags = K_calcSplitFlags(V_SNAPTOTOP|V_SNAPTOLEFT);
|
||||
INT32 itembar = 0;
|
||||
|
||||
if (stplyr->kartstuff[k_itemroulette])
|
||||
{
|
||||
|
@ -4964,6 +4984,7 @@ static void K_drawKartItem(void)
|
|||
}
|
||||
else if (stplyr->kartstuff[k_rocketsneakertimer] > 1)
|
||||
{
|
||||
itembar = stplyr->kartstuff[k_rocketsneakertimer];
|
||||
if (leveltime & 1)
|
||||
localpatch = kp_rocketsneaker[offset];
|
||||
else if (!(leveltime & 1))
|
||||
|
@ -5033,29 +5054,25 @@ static void K_drawKartItem(void)
|
|||
else
|
||||
V_DrawScaledPatch(ITEM_X, ITEM_Y, V_HUDTRANS|splitflags, localpatch);
|
||||
|
||||
// Meter for rocket sneaker, could be extended to work for any other timer item...
|
||||
if (stplyr->kartstuff[k_rocketsneakertimer])
|
||||
// Extensible meter, currently only used for rocket sneaker...
|
||||
if (itembar)
|
||||
{
|
||||
const INT32 barlength = (splitscreen > 1 ? 12 : 2);
|
||||
const INT32 timer = stplyr->kartstuff[k_rocketsneakertimer]; // item's timer
|
||||
const INT32 barlength = (splitscreen > 1 ? 12 : 24);
|
||||
const INT32 max = itemtime; // timer's normal highest value
|
||||
INT32 length = min(barlength, (timer * barlength) / max);
|
||||
INT32 length = min(barlength, (itembar * barlength) / max);
|
||||
INT32 height = (splitscreen > 1 ? 1 : 2);
|
||||
INT32 x = (splitscreen > 1 ? 17 : 11), y = (splitscreen > 1 ? 27 : 35);
|
||||
|
||||
V_DrawScaledPatch(ITEM_X+x, ITEM_Y+y, V_HUDTRANS|splitflags, kp_itemtimer[offset]);
|
||||
// The dark "AA" edges on the sides
|
||||
V_DrawFill(ITEM_X+x+1, ITEM_Y+y+1, length, height, 12);
|
||||
// The left dark "AA" edge
|
||||
V_DrawFill(ITEM_X+x+1, ITEM_Y+y+1, (length == 2 ? 2 : 1), height, 12);
|
||||
// The bar itself
|
||||
if (length >= 3)
|
||||
if (length > 2)
|
||||
{
|
||||
if (height == 1)
|
||||
V_DrawFill(ITEM_X+x+2, ITEM_Y+y+1, length-1, height, 120);
|
||||
else
|
||||
{
|
||||
V_DrawFill(ITEM_X+x+2, ITEM_Y+y+1, length-1, height, 8);
|
||||
V_DrawFill(ITEM_X+x+2, ITEM_Y+y+1, length-1, height/2, 120);
|
||||
}
|
||||
V_DrawFill(ITEM_X+x+length, ITEM_Y+y+1, 1, height, 12); // the right one
|
||||
if (height == 2)
|
||||
V_DrawFill(ITEM_X+x+2, ITEM_Y+y+2, length-2, 1, 8); // the dulled underside
|
||||
V_DrawFill(ITEM_X+x+2, ITEM_Y+y+1, length-2, 1, 120); // the shine
|
||||
}
|
||||
}
|
||||
|
||||
|
|
54
src/p_mobj.c
54
src/p_mobj.c
|
@ -6964,6 +6964,45 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
P_SetMobjState(mobj, S_PLAYERARROW_BOX);
|
||||
mobj->tracer->sprite = SPR_ITEM;
|
||||
mobj->tracer->frame = FF_FULLBRIGHT|(((mobj->target->player->kartstuff[k_itemroulette] % (13*3)) / 3) + 1);
|
||||
mobj->tracer->flags2 &= ~MF2_DONTDRAW;
|
||||
}
|
||||
else if (mobj->target->player->kartstuff[k_stolentimer] > 0)
|
||||
{
|
||||
P_SetMobjState(mobj, S_PLAYERARROW_BOX);
|
||||
mobj->tracer->sprite = SPR_ITEM;
|
||||
mobj->tracer->frame = FF_FULLBRIGHT|KITEM_HYUDORO;
|
||||
if (!(leveltime & 2))
|
||||
mobj->tracer->flags2 |= MF2_DONTDRAW;
|
||||
else
|
||||
mobj->tracer->flags2 &= ~MF2_DONTDRAW;
|
||||
}
|
||||
else if ((mobj->target->player->kartstuff[k_stealingtimer] > 0) && (leveltime & 2))
|
||||
{
|
||||
P_SetMobjState(mobj, S_PLAYERARROW_BOX);
|
||||
mobj->tracer->sprite = SPR_ITEM;
|
||||
mobj->tracer->frame = FF_FULLBRIGHT|KITEM_HYUDORO;
|
||||
mobj->tracer->flags2 &= ~MF2_DONTDRAW;
|
||||
}
|
||||
else if (mobj->target->player->kartstuff[k_eggmanexplode] > 1)
|
||||
{
|
||||
P_SetMobjState(mobj, S_PLAYERARROW_BOX);
|
||||
mobj->tracer->sprite = SPR_ITEM;
|
||||
mobj->tracer->frame = FF_FULLBRIGHT|KITEM_EGGMAN;
|
||||
if (leveltime & 1)
|
||||
mobj->tracer->flags2 |= MF2_DONTDRAW;
|
||||
else
|
||||
mobj->tracer->flags2 &= ~MF2_DONTDRAW;
|
||||
}
|
||||
else if (mobj->target->player->kartstuff[k_growshrinktimer] > 0)
|
||||
{
|
||||
P_SetMobjState(mobj, S_PLAYERARROW_BOX);
|
||||
mobj->tracer->sprite = SPR_ITEM;
|
||||
mobj->tracer->frame = FF_FULLBRIGHT|KITEM_GROW;
|
||||
|
||||
if (leveltime & 1)
|
||||
mobj->tracer->flags2 |= MF2_DONTDRAW;
|
||||
else
|
||||
mobj->tracer->flags2 &= ~MF2_DONTDRAW;
|
||||
}
|
||||
else if (mobj->target->player->kartstuff[k_itemtype])
|
||||
{
|
||||
|
@ -6971,6 +7010,10 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
|
||||
switch (mobj->target->player->kartstuff[k_itemtype])
|
||||
{
|
||||
case KITEM_ORBINAUT:
|
||||
mobj->tracer->sprite = SPR_ITMO;
|
||||
mobj->tracer->frame = FF_FULLBRIGHT|(min(mobj->target->player->kartstuff[k_itemamount]-1, 3));
|
||||
break;
|
||||
case KITEM_INVINCIBILITY:
|
||||
mobj->tracer->sprite = SPR_ITMI;
|
||||
mobj->tracer->frame = FF_FULLBRIGHT|((leveltime % (7*3)) / 3);
|
||||
|
@ -6985,17 +7028,6 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
break;
|
||||
}
|
||||
|
||||
if (mobj->target->player->kartstuff[k_growshrinktimer] > 0)
|
||||
{
|
||||
mobj->tracer->sprite = SPR_ITEM;
|
||||
mobj->tracer->frame = FF_FULLBRIGHT|KITEM_GROW;
|
||||
|
||||
if (leveltime & 1)
|
||||
mobj->tracer->flags2 |= MF2_DONTDRAW;
|
||||
else
|
||||
mobj->tracer->flags2 &= ~MF2_DONTDRAW;
|
||||
}
|
||||
else
|
||||
mobj->tracer->flags2 &= ~MF2_DONTDRAW;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -799,6 +799,7 @@ sfxinfo_t S_sfx[NUMSFX] =
|
|||
{"mkitm7", true, 72, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
||||
{"mkitm8", true, 72, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
||||
{"mkitmF", true, 72, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
||||
{"mkitmE", true, 72, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
||||
{"clash", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR},
|
||||
{"tossed", false, 150, 8, -1, NULL, 0, -1, -1, LUMPERROR},
|
||||
{"shelit", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR},
|
||||
|
@ -812,6 +813,7 @@ sfxinfo_t S_sfx[NUMSFX] =
|
|||
{"ruby1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
||||
{"ruby2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
||||
{"hogbom", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR},
|
||||
{"dbgsal", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR},
|
||||
|
||||
// SRB2kart - Skin sounds
|
||||
{"kwin", false, 64, 0, -1, NULL, 0, SKSWIN, -1, LUMPERROR},
|
||||
|
|
|
@ -871,6 +871,7 @@ typedef enum
|
|||
sfx_mkitm7,
|
||||
sfx_mkitm8,
|
||||
sfx_mkitmF,
|
||||
sfx_mkitmE,
|
||||
sfx_clash,
|
||||
sfx_tossed,
|
||||
sfx_shelit,
|
||||
|
@ -884,6 +885,7 @@ typedef enum
|
|||
sfx_ruby1,
|
||||
sfx_ruby2,
|
||||
sfx_hogbom,
|
||||
sfx_dbgsal,
|
||||
|
||||
sfx_kwin,
|
||||
sfx_klose,
|
||||
|
|
Loading…
Reference in a new issue