- handle special case for activation sounds when player bumps into other actors.

This commit is contained in:
Christoph Oelckers 2022-12-31 15:21:03 +01:00
parent 524df20d26
commit 125ea52e57
21 changed files with 33 additions and 35 deletions

View file

@ -112,7 +112,7 @@ void CallOnRespawn(DDukeActor* actor, int low);
bool CallAnimate(DDukeActor* actor, tspritetype* hitter);
bool CallShootThis(DDukeActor* clsdef, DDukeActor* actor, int pn, const DVector3& spos, DAngle sang);
void CallStaticSetup(DDukeActor* actor);
void CallPlayFTASound(DDukeActor* actor);
void CallPlayFTASound(DDukeActor* actor, int mode = 0);
void CallStandingOn(DDukeActor* actor, player_struct* p);
void CallRunState(DDukeActor* actor);
int CallTriggerSwitch(DDukeActor* actor, player_struct* p);

View file

@ -623,12 +623,12 @@ bool CallShootThis(DDukeActor* clsdef, DDukeActor* actor, int pn, const DVector3
return rv;
}
void CallPlayFTASound(DDukeActor* actor)
void CallPlayFTASound(DDukeActor* actor, int mode)
{
IFVIRTUALPTR(actor, DDukeActor, PlayFTASound)
{
VMValue val = actor;
VMCall(func, &val, 1, nullptr, 0);
VMValue val[] = { actor, mode };
VMCall(func, val, 2, nullptr, 0);
}
}

View file

@ -2762,11 +2762,8 @@ HORIZONLY:
if (clip.actor()->spr.statnum != STAT_ACTOR)
{
clip.actor()->timetosleep = 0;
if (clip.actor()->spr.picnum == RTILE_BILLYRAY)
S_PlayActorSound(404, clip.actor());
else
CallPlayFTASound(clip.actor());
ChangeActorStat(clip.actor(), 1);
CallPlayFTASound(clip.actor(), 1);
ChangeActorStat(clip.actor(), STAT_ACTOR);
}
}
CallOnTouch(clip.actor(), p);

View file

@ -20,7 +20,7 @@ class DukeGreenSlime : DukeActor
}
override void PlayFTASound()
override void PlayFTASound(int mode)
{
self.PlayActorSound("SLIM_RECOG");
}

View file

@ -222,7 +222,7 @@ class DukeRecon : DukeActor
return true;
}
override void PlayFTASound()
override void PlayFTASound(int mode)
{
self.PlayActorSound("RECO_RECOG");
}
@ -264,7 +264,7 @@ class RedneckUFO1 : DukeRecon
return true;
}
override void PlayFTASound()
override void PlayFTASound(int mode)
{
}
}

View file

@ -45,7 +45,7 @@ class DukeBoss1 : DukeBossBase
}
override void PlayFTASound()
override void PlayFTASound(int mode)
{
Duke.PlaySound("BOS1_RECOG");
}
@ -62,7 +62,7 @@ class DukeBoss1Stayput : DukeBoss1
+BADGUYSTAYPUT;
}
override void PlayFTASound()
override void PlayFTASound(int mode)
{
}

View file

@ -21,7 +21,7 @@ class DukeBoss2 : DukeBossBase
//
//---------------------------------------------------------------------------
override void PlayFTASound()
override void PlayFTASound(int mode)
{
if (self.pal == 1)
Duke.PlaySound("BOS2_RECOG");

View file

@ -11,7 +11,7 @@ class DukeBoss3 : DukeBossBase
}
override void PlayFTASound()
override void PlayFTASound(int mode)
{
if (self.pal == 1)
Duke.PlaySound("BOS3_RECOG");

View file

@ -13,7 +13,7 @@ class DukeBoss4 : DukeBossBase
}
override void PlayFTASound()
override void PlayFTASound(int mode)
{
if (self.pal == 1)
Duke.PlaySound("BOS4_RECOG");

View file

@ -21,7 +21,7 @@ class DukeCommander : DukeActor
}
override void PlayFTASound()
override void PlayFTASound(int mode)
{
self.PlayActorSound("COMM_RECOG");
}

View file

@ -19,7 +19,7 @@ class DukeDrone : DukeActor
}
override void PlayFTASound()
override void PlayFTASound(int mode)
{
self.PlayActorSound("DRON_RECOG");
}

View file

@ -14,7 +14,7 @@ class DukeLizMan : DukeActor
}
override void PlayFTASound()
override void PlayFTASound(int mode)
{
self.PlayActorSound("CAPT_RECOG");
}
@ -82,7 +82,7 @@ class DukeLizManStayput : DukeLizMan
+BADGUYSTAYPUT;
}
override void PlayFTASound()
override void PlayFTASound(int mode)
{
}

View file

@ -26,7 +26,7 @@ class DukeLizTrooper : DukeActor
//
//---------------------------------------------------------------------------
override void PlayFTASound()
override void PlayFTASound(int mode)
{
self.PlayActorSound("PRED_RECOG");
}
@ -139,7 +139,7 @@ class DukeLizTrooperStayput : DukeLizTrooper
+BADGUYSTAYPUT;
}
override void PlayFTASound()
override void PlayFTASound(int mode)
{
}

View file

@ -14,7 +14,7 @@ class DukeOctabrain : DukeActor
}
override void PlayFTASound()
override void PlayFTASound(int mode)
{
self.PlayActorSound("OCTA_RECOG");
}

View file

@ -12,7 +12,7 @@ class DukePigCop : DukeActor
}
override void PlayFTASound()
override void PlayFTASound(int mode)
{
self.PlayActorSound("PIG_RECOG");
}
@ -48,7 +48,7 @@ class DukePigCopDive : DukePigCopStayput
pic "PIGCOPDIVE";
}
override void PlayFTASound()
override void PlayFTASound(int mode)
{
}

View file

@ -13,7 +13,7 @@ class DukeTurret : DukeActor
aimoffset 32;
}
override void PlayFTASound()
override void PlayFTASound(int mode)
{
self.PlayActorSound("TURR_RECOG");
}

View file

@ -11,9 +11,10 @@ class RedneckBillyRay : DukeActor
}
override void PlayFTASound()
override void PlayFTASound(int mode)
{
self.PlayActorSound("BR_RECOG");
if (mode == 0) self.PlayActorSound("BR_RECOG");
else self.PlayActorSound("FART1");
}
override void Initialize()
@ -33,7 +34,7 @@ class RedneckBillyRayStayput: RedneckBillyRay
+BADGUYSTAYPUT
}
override void PlayFTASound()
override void PlayFTASound(int mode)
{
}

View file

@ -13,7 +13,7 @@ class RedneckCoot : DukeActor
+DESTRUCTOIMMUNE;
}
override void PlayFTASound()
override void PlayFTASound(int mode)
{
if (!Raze.isRRRA() && (random(0, 3)) == 2)
self.PlayActorSound("CT_GET");
@ -40,7 +40,7 @@ class RedneckCootStayput: RedneckCoot
+BADGUYSTAYPUT;
}
override void PlayFTASound()
override void PlayFTASound(int mode)
{
}

View file

@ -42,7 +42,7 @@ class RedneckMinionStayput: RedneckMinion
+BADGUYSTAYPUT;
}
override void PlayFTASound()
override void PlayFTASound(int mode)
{
}

View file

@ -9,7 +9,7 @@ class VacationBeachBabe : DukeLizmanJump
+INTERNAL_BADGUY;
}
override void PlayFTASound()
override void PlayFTASound(int mode)
{
self.PlayActorSound("CAPT_RECOG");
}

View file

@ -366,7 +366,7 @@ class DukeActor : CoreActor native
virtual void onRespawn(int tag) { }
virtual bool animate(tspritetype tspr) { return false; }
virtual void RunState(DukePlayer p, double pdist) {} // this is the CON function.
virtual void PlayFTASound() {}
virtual void PlayFTASound(int mode) {}
virtual void StandingOn(DukePlayer p) {}
virtual bool TriggerSwitch(DukePlayer activator) { return false; }
virtual bool shootthis(DukeActor actor, DukePlayer p, Vector3 pos, double ang) const // this gets called on the defaults.