- check_fta_sounds.

This commit is contained in:
Christoph Oelckers 2020-10-22 19:08:10 +02:00
parent b9aa5de217
commit 4c9655b110
8 changed files with 30 additions and 33 deletions

View file

@ -73,13 +73,13 @@ void SerializeActorGlobals(FSerializer& arc)
{
fire.Clear();
if (!res) return;
auto length = arc.ArraySize() / 2;
int length = arc.ArraySize() / 2;
int key;
FireProj value;
for (int i = 0; i < length; i++)
{
Serialize(arc, nullptr, key, nullptr);
arc(nullptr, key);
Serialize(arc, nullptr, value, nullptr);
fire.Insert(key, value);
}
@ -144,10 +144,9 @@ bool floorspace_d(int sectnum)
//
//---------------------------------------------------------------------------
void check_fta_sounds_d(int i)
void check_fta_sounds_d(DDukeActor* actor)
{
auto spri = &sprite[i];
if (spri->extra > 0) switch (spri->picnum)
if (actor->s.extra > 0) switch (actor->s.picnum)
{
case LIZTROOPONTOILET:
case LIZTROOPJUSTSIT:
@ -156,56 +155,56 @@ void check_fta_sounds_d(int i)
case LIZTROOPDUCKING:
case LIZTROOPRUNNING:
case LIZTROOP:
S_PlayActorSound(PRED_RECOG, i);
S_PlayActorSound(PRED_RECOG, actor);
break;
case LIZMAN:
case LIZMANSPITTING:
case LIZMANFEEDING:
case LIZMANJUMP:
S_PlayActorSound(CAPT_RECOG, i);
S_PlayActorSound(CAPT_RECOG, actor);
break;
case PIGCOP:
case PIGCOPDIVE:
S_PlayActorSound(PIG_RECOG, i);
S_PlayActorSound(PIG_RECOG, actor);
break;
case RECON:
S_PlayActorSound(RECO_RECOG, i);
S_PlayActorSound(RECO_RECOG, actor);
break;
case DRONE:
S_PlayActorSound(DRON_RECOG, i);
S_PlayActorSound(DRON_RECOG, actor);
break;
case COMMANDER:
case COMMANDERSTAYPUT:
S_PlayActorSound(COMM_RECOG, i);
S_PlayActorSound(COMM_RECOG, actor);
break;
case ORGANTIC:
S_PlayActorSound(TURR_RECOG, i);
S_PlayActorSound(TURR_RECOG, actor);
break;
case OCTABRAIN:
case OCTABRAINSTAYPUT:
S_PlayActorSound(OCTA_RECOG, i);
S_PlayActorSound(OCTA_RECOG, actor);
break;
case BOSS1:
S_PlaySound(BOS1_RECOG);
break;
case BOSS2:
if (spri->pal == 1)
if (actor->s.pal == 1)
S_PlaySound(BOS2_RECOG);
else S_PlaySound(WHIPYOURASS);
break;
case BOSS3:
if (spri->pal == 1)
if (actor->s.pal == 1)
S_PlaySound(BOS3_RECOG);
else S_PlaySound(RIPHEADNECK);
break;
case BOSS4:
case BOSS4STAYPUT:
if (spri->pal == 1)
if (actor->s.pal == 1)
S_PlaySound(BOS4_RECOG);
S_PlaySound(BOSS4_FIRSTSEE);
break;
case GREENSLIME:
S_PlayActorSound(SLIM_RECOG, i);
S_PlayActorSound(SLIM_RECOG, actor);
break;
}
}
@ -781,7 +780,7 @@ void movefta_d(void)
default:
ht->timetosleep = 0;
fi.check_fta_sounds(i);
check_fta_sounds_d(&hittype[i]);
changespritestat(i, STAT_ACTOR);
break;
}

View file

@ -92,18 +92,18 @@ bool floorspace_r(int sectnum)
//
//---------------------------------------------------------------------------
void check_fta_sounds_r(int i)
void check_fta_sounds_r(DDukeActor* actor)
{
if (sprite[i].extra > 0) switch (sprite[i].picnum)
if (actor->s.extra > 0) switch (actor->s.picnum)
{
case COOT: // LIZTROOP
if (!isRRRA() && (krand() & 3) == 2)
S_PlayActorSound(PRED_RECOG, i);
S_PlayActorSound(PRED_RECOG, actor);
break;
case BILLYCOCK:
case BILLYRAY:
case BRAYSNIPER: // PIGCOP
S_PlayActorSound(PIG_RECOG, i);
S_PlayActorSound(PIG_RECOG, actor);
break;
}
}
@ -606,7 +606,7 @@ void movefta_r(void)
if (actorflag(spriteNum, SFLAG_USEACTIVATOR) && sector[sprite[spriteNum].sectnum].lotag & 16384) break;
#endif
hittype[i].timetosleep = 0;
fi.check_fta_sounds(i);
check_fta_sounds_r(&hittype[i]);
changespritestat(i, STAT_ACTOR);
break;
}
@ -624,7 +624,7 @@ void movefta_r(void)
if (wakeup(i, p))
{
hittype[i].timetosleep = 0;
fi.check_fta_sounds(i);
check_fta_sounds_r(&hittype[i]);
changespritestat(i, STAT_ACTOR);
}
}

View file

@ -88,8 +88,6 @@ void move_d(int g_i, int g_p, int g_x);
void move_r(int g_i, int g_p, int g_x);
int spawn_d(int j, int pn);
int spawn_r(int j, int pn);
void check_fta_sounds_d(int i);
void check_fta_sounds_r(int i);
void incur_damage_d(struct player_struct* p);
void incur_damage_r(struct player_struct* p);
void shoot_d(int i, int atwith);
@ -161,7 +159,6 @@ void SetDispatcher()
checktimetosleep_d,
move_d,
spawn_d,
check_fta_sounds_d,
incur_damage_d,
shoot_d,
@ -212,7 +209,6 @@ void SetDispatcher()
checktimetosleep_r,
move_r,
spawn_r,
check_fta_sounds_r,
incur_damage_r,
shoot_r,

View file

@ -101,7 +101,6 @@ struct Dispatcher
void (*checktimetosleep)(int g_i);
void (*move)(int g_i, int g_p, int g_x);
int (*spawn)(int j, int pn);
void (*check_fta_sounds)(int i);
// player
void (*incur_damage)(struct player_struct* p);

View file

@ -95,6 +95,9 @@ void handle_se128(DDukeActor* i);
void handle_se130(DDukeActor* i, int countmax, int EXPLOSION2);
void respawn_rrra(DDukeActor* oldact, DDukeActor* newact);
// This is only called from game specific code so it does not need an indirection.
void check_fta_sounds_d(DDukeActor* i);
void check_fta_sounds_r(DDukeActor* i);
int dodge(DDukeActor*);
void alterang(int ang, DDukeActor* actor, int g_p);

View file

@ -3991,7 +3991,7 @@ HORIZONLY:
if (sprite[var60].picnum == BILLYRAY)
S_PlayActorSound(404, var60);
else
fi.check_fta_sounds(var60);
check_fta_sounds_r(&hittype[var60]);
changespritestat(var60, 1);
}
}

View file

@ -106,7 +106,7 @@ int spawn_d(int j, int pn)
if (j >= 0) {
hittype[i].timetosleep = 0;
fi.check_fta_sounds(i);
check_fta_sounds_d(&hittype[i]);
changespritestat(i, 1);
} else
changespritestat(i, 2);
@ -879,7 +879,7 @@ int spawn_d(int j, int pn)
if(j >= 0)
{
hittype[i].timetosleep = 0;
fi.check_fta_sounds(i);
check_fta_sounds_d(&hittype[i]);
changespritestat(i,1);
}
else changespritestat(i,2);

View file

@ -1049,7 +1049,7 @@ int spawn_r(int j, int pn)
if(j >= 0)
{
hittype[i].timetosleep = 0;
fi.check_fta_sounds(i);
check_fta_sounds_r(&hittype[i]);
changespritestat(i,1);
}
else changespritestat(i,2);