Added feather

This commit is contained in:
TehRealSalt 2017-11-07 00:57:42 -05:00
parent 7eb9f56741
commit 7fcca8f2d1
10 changed files with 64 additions and 12 deletions

View file

@ -313,6 +313,7 @@ consvar_t cv_jaws = {"jaws", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0,
consvar_t cv_fireflower = {"fireflowers", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_tripleredshell = {"tripleredshells", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_lightning = {"lightning", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_feather = {"feathers", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_karthud = {"karthud", "Default", CV_SAVE|CV_CALL, karthud_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_kartcheck = {"kartcheck", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};

View file

@ -103,6 +103,7 @@ extern consvar_t cv_magnet, cv_boo, cv_mushroom, cv_triplemushroom, cv_megashroo
extern consvar_t cv_goldshroom, cv_star, cv_triplebanana, cv_fakeitem, cv_banana;
extern consvar_t cv_greenshell, cv_redshell, cv_laserwisp, cv_triplegreenshell, cv_bobomb;
extern consvar_t cv_blueshell, cv_jaws, cv_fireflower, cv_tripleredshell, cv_lightning;
extern consvar_t cv_feather;
extern consvar_t cv_karthud;
extern consvar_t cv_kartcheck;

View file

@ -305,6 +305,7 @@ typedef enum
k_tripleredshell, // 0x1 = 1 Red Shell orbiting, 0x2 = 2 Red Shells orbiting
// 0x4 = 3 Red Shells orbiting, 0x8 = Triple Red Shell in inventory
k_lightning, // 0x1 = Lightning in inventory
k_feather, // 0x1 = Feather in inventory, 0x2 = Player is feather jumping
k_kitchensink, // 0x1 = Sink in inventory
k_balloon, // Battle mode, number of balloons left
k_comebackhits, // Battle mode, number of times hit in comeback mode

View file

@ -300,6 +300,7 @@ void K_RegisterKartStuff(void)
CV_RegisterVar(&cv_fireflower);
CV_RegisterVar(&cv_tripleredshell);
CV_RegisterVar(&cv_lightning);
CV_RegisterVar(&cv_feather);
CV_RegisterVar(&cv_kartcheck);
CV_RegisterVar(&cv_kartcc);
@ -325,7 +326,7 @@ UINT8 K_GetKartCC(void)
//{ SRB2kart Roulette Code - Position Based
#define NUMKARTITEMS 18
#define NUMKARTITEMS 19
#define NUMKARTODDS 40
// Ugly ol' 3D arrays
@ -708,7 +709,9 @@ static INT32 K_KartItemOddsDistance_Retro[NUMKARTITEMS][10] =
/*Blue Shell*/ { 0, 0, 0, 0, 0, 0, 1, 2, 0, 0 }, // Blue Shell
/*Fire Flower*/ { 2, 0, 0, 1, 2, 1, 0, 0, 0, 0 }, // Fire Flower
/*Triple Red Shell*/ { 1, 0, 0, 0, 1, 1, 0, 0, 0, 0 }, // Triple Red Shell
/*Lightning*/ { 0, 0, 0, 0, 0, 0, 0, 1, 2, 0 } // Lightning
/*Lightning*/ { 0, 0, 0, 0, 0, 0, 0, 1, 2, 0 }, // Lightning
/*Feather*/ { 4, 0, 0, 0, 0, 0, 0, 0, 0, 0 } // Feather
};
/** \brief Item Roulette for Kart
@ -789,6 +792,9 @@ static void K_KartGetItemResult(player_t *player, fixed_t getitem, boolean retro
case 18: // Lightning
player->kartstuff[k_lightning] = 1;
break;
case 19: // Feather
player->kartstuff[k_feather] |= 1;
break;
default: // Mushroom - Doing it here as a fail-safe
if (getitem != 3)
CONS_Printf("ERROR: P_KartGetItemResult - Item roulette gave bad item (%d), giving Mushroom instead.\n", getitem);
@ -1032,6 +1038,7 @@ static void K_KartItemRouletteByDistance(player_t *player, ticcmd_t *cmd)
if (cv_fireflower.value) SETITEMRESULT(useodds, 16); // Fire Flower
if (cv_tripleredshell.value) SETITEMRESULT(useodds, 17); // Triple Red Shell
if (cv_lightning.value && pingame > pexiting) SETITEMRESULT(useodds, 18); // Lightning
if (cv_feather.value) SETITEMRESULT(useodds, 19); // Triple Red Shell
prandom = P_RandomKey(numchoices);
@ -1441,7 +1448,11 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
player->mo->momz *= player->kartstuff[k_jmp];
player->kartstuff[k_jmp] = 0;
}
*/
*/
if (P_IsObjectOnGround(player->mo) && !(player->mo->momz)
&& player->kartstuff[k_feather] & 2)
player->kartstuff[k_feather] &= ~2;
if (cmd->buttons & BT_JUMP)
player->kartstuff[k_jmp] = 1;
@ -2722,6 +2733,7 @@ static boolean K_CheckForHoldItem(player_t *player)
static void K_StripItems(player_t *player)
{
if ( player->kartstuff[k_kitchensink]
|| player->kartstuff[k_feather] & 1
|| player->kartstuff[k_lightning]
|| player->kartstuff[k_tripleredshell]
|| player->kartstuff[k_fireflower]
@ -2747,6 +2759,7 @@ static void K_StripItems(player_t *player)
|| player->kartstuff[k_itemroulette]
) player->kartstuff[k_itemclose] = 10;
player->kartstuff[k_kitchensink] = 0;
player->kartstuff[k_feather] = 0;
player->kartstuff[k_lightning] = 0;
player->kartstuff[k_tripleredshell] = 0;
player->kartstuff[k_fireflower] = 0;
@ -3216,6 +3229,20 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
player->pflags |= PF_ATTACKDOWN;
player->kartstuff[k_magnet] = 0;
}
// Feather
else if (ATTACK_IS_DOWN && !HOLDING_ITEM && player->kartstuff[k_feather] & 1 && NO_BOO)
{
S_StartSound(player->mo, sfx_boing); // Boing!
K_PlayTauntSound(player->mo);
player->mo->momz = FixedMul(15<<FRACBITS, player->mo->scale);
player->pflags |= PF_ATTACKDOWN;
player->kartstuff[k_feather] |= 2;
player->kartstuff[k_feather] &= ~1;
player->kartstuff[k_itemclose] = 10;
}
// Mushroom Boost
if (((player->kartstuff[k_mushroomtimer] > 0 && player->kartstuff[k_boosting] == 0)
@ -3465,6 +3492,7 @@ static patch_t *kp_blueshell;
static patch_t *kp_fireflower;
static patch_t *kp_tripleredshell;
static patch_t *kp_lightning;
static patch_t *kp_feather;
static patch_t *kp_kitchensink;
static patch_t *kp_itemused1;
static patch_t *kp_itemused2;
@ -3602,6 +3630,7 @@ void K_LoadKartHUDGraphics(void)
kp_fireflower = W_CachePatchName("K_ITFIRE", PU_HUDGFX);
kp_tripleredshell = W_CachePatchName("K_ITTRED", PU_HUDGFX);
kp_lightning = W_CachePatchName("K_ITLIGH", PU_HUDGFX);
kp_feather = W_CachePatchName("K_ITFETH", PU_HUDGFX);
kp_kitchensink = W_CachePatchName("K_ITSINK", PU_HUDGFX);
// Item-used - Closing the item window after an item is used
@ -3917,6 +3946,7 @@ static void K_drawKartRetroItem(void)
&& (leveltime & 2)) localpatch = kp_boosteal;
else if (stplyr->kartstuff[k_boostolentimer] > 0 && !(leveltime & 2)) localpatch = kp_noitem;
else if (stplyr->kartstuff[k_kitchensink] == 1) localpatch = kp_kitchensink;
else if (stplyr->kartstuff[k_feather] & 1) localpatch = kp_feather;
else if (stplyr->kartstuff[k_lightning] == 1) localpatch = kp_lightning;
else if (stplyr->kartstuff[k_tripleredshell]) localpatch = kp_tripleredshell; // &8
else if (stplyr->kartstuff[k_fireflower] == 1) localpatch = kp_fireflower;

View file

@ -150,9 +150,13 @@ boolean P_CanPickupItem(player_t *player, boolean weapon)
//if (player->powers[pw_flashing] > (flashingtics/4)*3 && player->powers[pw_flashing] <= flashingtics)
// return false;
if (gametype != GT_RACE && player->kartstuff[k_balloon] <= 0)
if (gametype != GT_RACE && player->kartstuff[k_balloon] <= 0) // No balloons in Match
return false;
if (player->kartstuff[k_bootaketimer] || player->kartstuff[k_boostolentimer]
|| player->kartstuff[k_growshrinktimer] > 1 || player->kartstuff[k_goldshroomtimer]) // Item-specific timer going off
return false;
if (player->kartstuff[k_itemroulette]
|| player->kartstuff[k_greenshell] || player->kartstuff[k_triplegreenshell]
|| player->kartstuff[k_redshell] || player->kartstuff[k_tripleredshell]
@ -162,10 +166,7 @@ boolean P_CanPickupItem(player_t *player, boolean weapon)
|| player->kartstuff[k_mushroom] || player->kartstuff[k_fireflower]
|| player->kartstuff[k_star] || player->kartstuff[k_goldshroom]
|| player->kartstuff[k_lightning] || player->kartstuff[k_megashroom]
|| player->kartstuff[k_boo] || player->kartstuff[k_bootaketimer]
|| player->kartstuff[k_boostolentimer]
|| player->kartstuff[k_growshrinktimer] > 1
|| player->kartstuff[k_goldshroomtimer])
|| player->kartstuff[k_boo] || player->kartstuff[k_feather] & 1) // Item slot already taken up
return false;
return true;

View file

@ -1661,9 +1661,23 @@ static boolean PIT_CheckThing(mobj_t *thing)
}
if (P_IsObjectOnGround(thing) && tmthing->momz < 0)
{
K_KartBouncing(tmthing, thing, true);
if (tmthing->player->kartstuff[k_feather] & 2)
{
K_StealBalloon(tmthing->player, thing->player);
K_SpinPlayer(thing->player, tmthing);
}
}
else if (P_IsObjectOnGround(tmthing) && thing->momz < 0)
{
K_KartBouncing(thing, tmthing, true);
if (thing->player->kartstuff[k_feather] & 2)
{
K_StealBalloon(thing->player, tmthing->player);
K_SpinPlayer(tmthing->player, thing);
}
}
else
K_KartBouncing(tmthing, thing, false);

View file

@ -6778,7 +6778,7 @@ void P_MobjThinker(mobj_t *mobj)
else if (mobj->target->player->kartstuff[k_fireflower]) P_SetMobjState(mobj, S_PLAYERARROW_FIREFLOWER);
else if (mobj->target->player->kartstuff[k_bobomb]) P_SetMobjState(mobj, S_PLAYERARROW_BOBOMB);
else if (mobj->target->player->kartstuff[k_redshell]) P_SetMobjState(mobj, S_PLAYERARROW_REDSHELL);
//else if (mobj->target->player->kartstuff[k_feather]) P_SetMobjState(mobj, S_PLAYERARROW_FEATHER);
else if (mobj->target->player->kartstuff[k_feather] & 1) P_SetMobjState(mobj, S_PLAYERARROW_FEATHER);
else if (mobj->target->player->kartstuff[k_boo] == 1) P_SetMobjState(mobj, S_PLAYERARROW_BOO);
else if (mobj->target->player->kartstuff[k_fakeitem] & 2) P_SetMobjState(mobj, S_PLAYERARROW_FAKEITEM);
else if (mobj->target->player->kartstuff[k_banana]) P_SetMobjState(mobj, S_PLAYERARROW_BANANA);

View file

@ -6700,10 +6700,12 @@ static void P_MovePlayer(player_t *player)
{
K_KartMoveAnimation(player);
player->frameangle = player->mo->angle;
if (player->kartstuff[k_feather] & 2)
player->frameangle += ANGLE_22h;
else
player->frameangle = player->mo->angle;
}
player->mo->movefactor = FRACUNIT; // We're not going to do any more with this, so let's change it back for the next frame.
// If you are stopped and are still walking, stand still!

View file

@ -502,6 +502,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"tossed", false,150, 8, -1, NULL, 0, -1, -1, LUMPERROR},
{"shelit", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR},
{"vroom", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"boing", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
// SRB2kart - Skin sounds
{"kwin", false, 64, 0, -1, NULL, 0, SKSWIN, -1, LUMPERROR},

View file

@ -574,6 +574,7 @@ typedef enum
sfx_tossed,
sfx_shelit,
sfx_vroom,
sfx_boing,
sfx_kwin,
sfx_klose,