- player.i, part 3

This commit is contained in:
Christoph Oelckers 2020-11-02 20:23:48 +01:00
parent cc0a668da3
commit d773601d81
3 changed files with 37 additions and 36 deletions

View file

@ -64,6 +64,7 @@ void hud_input(int plnum)
unk = 0;
p = &ps[plnum];
auto pact = p->GetActor();
i = p->aim_mode;
p->aim_mode = !PlayerInput(plnum, SB_AIMMODE);
@ -80,7 +81,7 @@ void hud_input(int plnum)
if (!isRRRA() || p->GetActor()->s.extra > 0)
{
p->last_pissed_time = 4000;
S_PlayActorSound(437, p->i);
S_PlayActorSound(437, pact);
if (p->GetActor()->s.extra <= max_player_health - max_player_health / 10)
{
p->GetActor()->s.extra += 2;
@ -137,7 +138,7 @@ void hud_input(int plnum)
p->heat_on = !p->heat_on;
setpal(p);
p->inven_icon = 5;
S_PlayActorSound(NITEVISION_ONOFF, p->i);
S_PlayActorSound(NITEVISION_ONOFF, pact);
FTA(106 + (!p->heat_on), p);
}
}
@ -151,7 +152,7 @@ void hud_input(int plnum)
if (p->steroids_amount == 400)
{
p->steroids_amount--;
S_PlayActorSound(DUKE_TAKEPILLS, p->i);
S_PlayActorSound(DUKE_TAKEPILLS, pact);
p->inven_icon = ICON_STEROIDS;
FTA(12, p);
}
@ -319,8 +320,8 @@ void hud_input(int plnum)
if (p->holoduke_amount == 0)
checkavailinven(p);
if (p->drink_amt < 99 && !S_CheckActorSoundPlaying(p->i, 425))
S_PlayActorSound(425, p->i);
if (p->drink_amt < 99 && !S_CheckActorSoundPlaying(pact, 425))
S_PlayActorSound(425, pact);
}
}
}
@ -335,7 +336,7 @@ void hud_input(int plnum)
if (p->yehaa_timer == 0)
{
p->yehaa_timer = 126;
S_PlayActorSound(390, p->i);
S_PlayActorSound(390, pact);
p->noise_radius = 16384;
madenoise(plnum);
if (sector[p->cursectnum].lotag == 857)
@ -382,7 +383,7 @@ void hud_input(int plnum)
p->firstaid_amount = 0;
checkavailinven(p);
}
S_PlayActorSound(DUKE_USEMEDKIT, p->i);
S_PlayActorSound(DUKE_USEMEDKIT, pact);
}
else
{
@ -404,8 +405,8 @@ void hud_input(int plnum)
if (p->GetActor()->s.extra > max_player_health)
p->GetActor()->s.extra = max_player_health;
p->drink_amt += 10;
if (p->drink_amt <= 100 && !S_CheckActorSoundPlaying(p->i, DUKE_USEMEDKIT))
S_PlayActorSound(DUKE_USEMEDKIT, p->i);
if (p->drink_amt <= 100 && !S_CheckActorSoundPlaying(pact, DUKE_USEMEDKIT))
S_PlayActorSound(DUKE_USEMEDKIT, pact);
}
}
}
@ -426,17 +427,17 @@ void hud_input(int plnum)
{
p->inven_icon = 4;
S_StopSound(-1, p->i, CHAN_VOICE); // this will stop the falling scream
S_PlayActorSound(DUKE_JETPACK_ON, p->i);
S_StopSound(-1, pact, CHAN_VOICE); // this will stop the falling scream
S_PlayActorSound(DUKE_JETPACK_ON, pact);
FTA(QUOTE_JETPACK_ON, p);
}
else
{
p->hard_landing = 0;
p->poszv = 0;
S_PlayActorSound(DUKE_JETPACK_OFF, p->i);
S_StopSound(DUKE_JETPACK_IDLE, p->i);
S_StopSound(DUKE_JETPACK_ON, p->i);
S_PlayActorSound(DUKE_JETPACK_OFF, pact);
S_StopSound(DUKE_JETPACK_IDLE, pact);
S_StopSound(DUKE_JETPACK_ON, pact);
FTA(QUOTE_JETPACK_OFF, p);
}
}
@ -447,8 +448,8 @@ void hud_input(int plnum)
// eat cow pie
if (p->jetpack_amount > 0 && p->GetActor()->s.extra < max_player_health)
{
if (!S_CheckActorSoundPlaying(p->i, 429))
S_PlayActorSound(429, p->i);
if (!S_CheckActorSoundPlaying(pact, 429))
S_PlayActorSound(429, pact);
p->jetpack_amount -= 100;
if (p->drink_amt > 0)

View file

@ -200,9 +200,9 @@ void tracers(int x1, int y1, int z1, int x2, int y2, int z2, int n)
if (sect >= 0)
{
if (sector[sect].lotag == 2)
EGS(sect, x1, y1, z1, TILE_WATERBUBBLE, -32, 4 + (krand() & 3), 4 + (krand() & 3), krand() & 2047, 0, 0, ps[0].i, 5);
EGS(sect, x1, y1, z1, TILE_WATERBUBBLE, -32, 4 + (krand() & 3), 4 + (krand() & 3), krand() & 2047, 0, 0, ps[0].GetActor(), 5);
else
EGS(sect, x1, y1, z1, TILE_SMALLSMOKE, -32, 14, 14, 0, 0, 0, ps[0].i, 5);
EGS(sect, x1, y1, z1, TILE_SMALLSMOKE, -32, 14, 14, 0, 0, 0, ps[0].GetActor(), 5);
}
}
}

View file

@ -60,7 +60,7 @@ void DoFire(struct player_struct* p, short snum)
if (aplWeaponFireSound[p->curr_weapon][snum])
{
S_PlayActorSound(aplWeaponFireSound[p->curr_weapon][snum], p->i);
S_PlayActorSound(aplWeaponFireSound[p->curr_weapon][snum], p->GetActor());
}
SetGameVarID(g_iWeaponVarID, p->curr_weapon, p->GetActor(), snum);
@ -142,7 +142,7 @@ void DoSpawn(struct player_struct *p, short snum)
void fireweapon_ww(int snum)
{
auto p = &ps[snum];
int pi = p->i;
auto pact = p->GetActor();
p->crack_time = CRACK_TIME;
@ -172,7 +172,7 @@ void fireweapon_ww(int snum)
p->kickback_pic = 1;
if (aplWeaponInitialSound[p->curr_weapon][snum])
{
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi);
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pact);
}
}
break;
@ -181,7 +181,7 @@ void fireweapon_ww(int snum)
p->kickback_pic = 1;
if (aplWeaponInitialSound[p->curr_weapon][snum])
{
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi);
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pact);
}
break;
@ -192,7 +192,7 @@ void fireweapon_ww(int snum)
p->kickback_pic = 1;
if (aplWeaponInitialSound[p->curr_weapon][snum])
{
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi);
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pact);
}
}
break;
@ -204,7 +204,7 @@ void fireweapon_ww(int snum)
p->kickback_pic = 1;
if (aplWeaponInitialSound[p->curr_weapon][snum])
{
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi);
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pact);
}
}
break;
@ -215,7 +215,7 @@ void fireweapon_ww(int snum)
p->kickback_pic = 1;
if (aplWeaponInitialSound[p->curr_weapon][snum])
{
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi);
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pact);
}
}
break;
@ -225,7 +225,7 @@ void fireweapon_ww(int snum)
p->kickback_pic = 1;
if (aplWeaponInitialSound[p->curr_weapon][snum])
{
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi);
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pact);
}
}
break;
@ -236,7 +236,7 @@ void fireweapon_ww(int snum)
p->kickback_pic = 1;
if (aplWeaponInitialSound[p->curr_weapon][snum])
{
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi);
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pact);
}
}
break;
@ -247,7 +247,7 @@ void fireweapon_ww(int snum)
p->kickback_pic = 1;
if (aplWeaponInitialSound[p->curr_weapon][snum])
{
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi);
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pact);
}
}
break;
@ -258,7 +258,7 @@ void fireweapon_ww(int snum)
p->kickback_pic = 1;
if (aplWeaponInitialSound[p->curr_weapon][snum])
{
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi);
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pact);
}
}
break;
@ -269,7 +269,7 @@ void fireweapon_ww(int snum)
p->hbomb_hold_delay = !p->hbomb_hold_delay;
if (aplWeaponInitialSound[p->curr_weapon][snum])
{
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi);
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pact);
}
}
break;
@ -280,7 +280,7 @@ void fireweapon_ww(int snum)
p->kickback_pic = 1;
if (aplWeaponInitialSound[p->curr_weapon][snum])
{
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi);
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pact);
}
}
break;
@ -291,7 +291,7 @@ void fireweapon_ww(int snum)
p->kickback_pic = 1;
if (aplWeaponInitialSound[p->curr_weapon][snum])
{
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pi);
S_PlayActorSound(aplWeaponInitialSound[p->curr_weapon][snum], pact);
}
}
break;
@ -309,7 +309,7 @@ void fireweapon_ww(int snum)
void operateweapon_ww(int snum, ESyncBits actions, int psect)
{
auto p = &ps[snum];
int pi = p->i;
auto pact = p->GetActor();
int i, k;
int psectlotag = sector[psect].lotag;
@ -443,7 +443,7 @@ void operateweapon_ww(int snum, ESyncBits actions, int psect)
{
if (aplWeaponSound2Sound[p->curr_weapon][snum])
{
S_PlayActorSound(aplWeaponSound2Sound[p->curr_weapon][snum], pi);
S_PlayActorSound(aplWeaponSound2Sound[p->curr_weapon][snum], pact);
}
}
if (p->kickback_pic == aplWeaponSpawnTime[p->curr_weapon][snum])
@ -500,12 +500,12 @@ void operateweapon_ww(int snum, ESyncBits actions, int psect)
if (p->kickback_pic == (aplWeaponTotalTime[p->curr_weapon][snum] + 1))
{ // eject shortly after 'total time'
S_PlayActorSound(EJECT_CLIP, pi);
S_PlayActorSound(EJECT_CLIP, pact);
}
else if (p->kickback_pic == (aplWeaponReload[p->curr_weapon][snum] - (i / 3)))
{
// insert occurs 2/3 of way through reload delay
S_PlayActorSound(INSERT_CLIP, pi);
S_PlayActorSound(INSERT_CLIP, pact);
}
if (p->kickback_pic >= (aplWeaponReload[p->curr_weapon][snum]))