- 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 CallAnimate(DDukeActor* actor, tspritetype* hitter);
bool CallShootThis(DDukeActor* clsdef, DDukeActor* actor, int pn, const DVector3& spos, DAngle sang); bool CallShootThis(DDukeActor* clsdef, DDukeActor* actor, int pn, const DVector3& spos, DAngle sang);
void CallStaticSetup(DDukeActor* actor); void CallStaticSetup(DDukeActor* actor);
void CallPlayFTASound(DDukeActor* actor); void CallPlayFTASound(DDukeActor* actor, int mode = 0);
void CallStandingOn(DDukeActor* actor, player_struct* p); void CallStandingOn(DDukeActor* actor, player_struct* p);
void CallRunState(DDukeActor* actor); void CallRunState(DDukeActor* actor);
int CallTriggerSwitch(DDukeActor* actor, player_struct* p); 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; return rv;
} }
void CallPlayFTASound(DDukeActor* actor) void CallPlayFTASound(DDukeActor* actor, int mode)
{ {
IFVIRTUALPTR(actor, DDukeActor, PlayFTASound) IFVIRTUALPTR(actor, DDukeActor, PlayFTASound)
{ {
VMValue val = actor; VMValue val[] = { actor, mode };
VMCall(func, &val, 1, nullptr, 0); VMCall(func, val, 2, nullptr, 0);
} }
} }

View file

@ -2762,11 +2762,8 @@ HORIZONLY:
if (clip.actor()->spr.statnum != STAT_ACTOR) if (clip.actor()->spr.statnum != STAT_ACTOR)
{ {
clip.actor()->timetosleep = 0; clip.actor()->timetosleep = 0;
if (clip.actor()->spr.picnum == RTILE_BILLYRAY) CallPlayFTASound(clip.actor(), 1);
S_PlayActorSound(404, clip.actor()); ChangeActorStat(clip.actor(), STAT_ACTOR);
else
CallPlayFTASound(clip.actor());
ChangeActorStat(clip.actor(), 1);
} }
} }
CallOnTouch(clip.actor(), p); 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"); self.PlayActorSound("SLIM_RECOG");
} }

View file

@ -222,7 +222,7 @@ class DukeRecon : DukeActor
return true; return true;
} }
override void PlayFTASound() override void PlayFTASound(int mode)
{ {
self.PlayActorSound("RECO_RECOG"); self.PlayActorSound("RECO_RECOG");
} }
@ -264,7 +264,7 @@ class RedneckUFO1 : DukeRecon
return true; 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"); Duke.PlaySound("BOS1_RECOG");
} }
@ -62,7 +62,7 @@ class DukeBoss1Stayput : DukeBoss1
+BADGUYSTAYPUT; +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) if (self.pal == 1)
Duke.PlaySound("BOS2_RECOG"); 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) if (self.pal == 1)
Duke.PlaySound("BOS3_RECOG"); 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) if (self.pal == 1)
Duke.PlaySound("BOS4_RECOG"); 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"); 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"); 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"); self.PlayActorSound("CAPT_RECOG");
} }
@ -82,7 +82,7 @@ class DukeLizManStayput : DukeLizMan
+BADGUYSTAYPUT; +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"); self.PlayActorSound("PRED_RECOG");
} }
@ -139,7 +139,7 @@ class DukeLizTrooperStayput : DukeLizTrooper
+BADGUYSTAYPUT; +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"); 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"); self.PlayActorSound("PIG_RECOG");
} }
@ -48,7 +48,7 @@ class DukePigCopDive : DukePigCopStayput
pic "PIGCOPDIVE"; pic "PIGCOPDIVE";
} }
override void PlayFTASound() override void PlayFTASound(int mode)
{ {
} }

View file

@ -13,7 +13,7 @@ class DukeTurret : DukeActor
aimoffset 32; aimoffset 32;
} }
override void PlayFTASound() override void PlayFTASound(int mode)
{ {
self.PlayActorSound("TURR_RECOG"); 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() override void Initialize()
@ -33,7 +34,7 @@ class RedneckBillyRayStayput: RedneckBillyRay
+BADGUYSTAYPUT +BADGUYSTAYPUT
} }
override void PlayFTASound() override void PlayFTASound(int mode)
{ {
} }

View file

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

View file

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

View file

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

View file

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