Skip to content

Commit

Permalink
Heretic: Player sounds as a chicken
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Mar 2, 2019
1 parent 5591aea commit 6b3c9b5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
4 changes: 4 additions & 0 deletions doomsday/apps/plugins/heretic/include/p_inter.h
Expand Up @@ -120,6 +120,10 @@ void P_TouchSpecialMobj(mobj_t *special, mobj_t *toucher);
*/
dd_bool P_MorphPlayer(player_t *player);

dd_bool P_IsPlayerMorphed(const player_t *player);

int P_GetPlayerLaughSound(const player_t *player);

/**
* Damages both enemies and players.
*
Expand Down
12 changes: 11 additions & 1 deletion doomsday/apps/plugins/heretic/src/p_inter.c
Expand Up @@ -45,6 +45,11 @@ int backpackAmmo[NUM_AMMO_TYPES] = { 10, 5, 10, 20, 1, 0 };
// Number of rounds to give for each weapon type.
int getWeaponAmmo[NUM_WEAPON_TYPES] = { 0, 25, 10, 30, 50, 2, 50, 0 };

int P_GetPlayerLaughSound(const player_t *plr)
{
return P_IsPlayerMorphed(plr) ? SFX_CHICDTH : SFX_WPNUP;
}

static dd_bool giveOneAmmo(player_t *plr, ammotype_t ammoType, int numRounds)
{
DENG_ASSERT(plr != 0);
Expand Down Expand Up @@ -569,7 +574,7 @@ static dd_bool pickupWeapon(player_t *plr, weapontype_t weaponType,

if(!mapSetup) // Pickup sounds are not played during map setup.
{
S_ConsoleSound(SFX_WPNUP, NULL, plr - players);
S_ConsoleSound(P_GetPlayerLaughSound(plr), NULL, plr - players);
}
}

Expand Down Expand Up @@ -1063,6 +1068,11 @@ static void killMobj(mobj_t *source, mobj_t *target)
target->tics -= P_Random() & 3;
}

dd_bool P_IsPlayerMorphed(const player_t *player)
{
return player && player->morphTics > 0;
}

dd_bool P_MorphPlayer(player_t *player)
{
mobj_t *pmo, *fog, *chicken;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/plugins/heretic/src/p_pspr.c
Expand Up @@ -1459,7 +1459,7 @@ void C_DECL A_TombOfPower(mobj_t* mo)
else
{ // Succeeded.
player->morphTics = 0;
S_StartSound(SFX_WPNUP, player->plr->mo);
S_StartSound(P_GetPlayerLaughSound(player), player->plr->mo);
}
}
else
Expand Down
10 changes: 4 additions & 6 deletions doomsday/apps/plugins/heretic/src/p_telept.c
Expand Up @@ -229,15 +229,13 @@ void P_ArtiTele(player_t *player)
P_Teleport(player->plr->mo, spot->origin[VX], spot->origin[VY], spot->angle, true);

#if __JHEXEN__
if(player->morphTics)
{ // Teleporting away will undo any morph effects (pig)
if (player->morphTics)
{
// Teleporting away will undo any morph effects (pig)
P_UndoPlayerMorph(player);
}
//S_StartSound(SFX_WPNUP, NULL); // Full volume laugh
#else
/*S_StartSound(SFX_WPNUP, NULL); // Full volume laugh
NetSv_Sound(NULL, SFX_WPNUP, player-players); */
S_StartSound(SFX_WPNUP, NULL);
S_StartSound(P_GetPlayerLaughSound(player), NULL);
#endif
}
}
Expand Down

0 comments on commit 6b3c9b5

Please sign in to comment.