- scriptified two of RRRA's special effects.

This commit is contained in:
Christoph Oelckers 2022-12-03 17:54:17 +01:00
parent 3ee28eb600
commit 9641d3f712
4 changed files with 54 additions and 39 deletions

View file

@ -1595,34 +1595,6 @@ void checksectors_r(int snum)
else
switch (neartagsprite->spr.picnum)
{
case MUSICNOTES:
if (!isRRRA()) return;
if (!S_CheckActorSoundPlaying(neartagsprite, 340))
S_PlayActorSound(340, neartagsprite);
return;
case JOE9000:
if (!isRRRA()) return;
if (numplayers == 1)
{
// This is from RedneckGDX - the version in RR Reconstruction looked like broken nonsense.
if (S_CheckActorSoundPlaying(neartagsprite, 445) || ud.joe9000 != 0)
{
if (!S_CheckActorSoundPlaying(neartagsprite, 445) && !S_CheckActorSoundPlaying(neartagsprite, 446) &&
!S_CheckActorSoundPlaying(neartagsprite, 447) && ud.joe9000 != 0)
{
if ((krand() % 2) == 1)
S_PlayActorSound(446, neartagsprite);
else
S_PlayActorSound(447, neartagsprite);
}
}
else
{
S_PlayActorSound(445, neartagsprite);
ud.joe9000 = 1;
}
}
return;
case EMPTYBIKE:
if (!isRRRA()) return;
OnMotorcycle(p, neartagsprite);

View file

@ -66,16 +66,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->spr.scale = DVector2(0, 0);
ps[screenpeek].sea_sick_stat = 1;
break;
case MUSICNOTES:
if (!isRRRA()) goto default_case;
act->spr.lotag = 1;
act->clipdist = 0;
break;
case JOE9000:
if (!isRRRA()) goto default_case;
act->spr.lotag = 1;
act->clipdist = 0;
break;
case RRTILE8193:
if (!isRRRA()) goto default_case;
act->spr.scale = DVector2(0, 0);

View file

@ -49,6 +49,8 @@ spawnclasses
8099 = RedneckPiano
8094 = RedneckPianoKeys
8679 = RedneckSnakeRiverSign
8448 = RedneckMusicNotes
8704 = RedneckJoe9000
7636 = DukeGenericDestructible, "OLDPHOTO0", "OLDPHOTO0BROKE", "VENT_BUST"
7638 = DukeGenericDestructible, "OLDPHOTO1", "OLDPHOTO1BROKE", "VENT_BUST"

View file

@ -10,4 +10,55 @@ class RedneckBell : DukeActor
{
self.PlayActorSound("BELL");
}
}
}
class RedneckMusicNotes : DukeActor
{
default
{
pic "MUSICNOTES";
lotag -1;
clipdist 0;
}
override bool OnUse(DukePlayer user)
{
if (!self.CheckSoundPlaying("PIANO_P3"))
self.PlayActorSound("PIANO_P3");
return true;
}
}
class RedneckJoe9000 : DukeActor
{
default
{
pic "JOE9000";
lotag 1;
clipdist 0;
}
override bool OnUse(DukePlayer user)
{
if (ud.multimode < 2)
{
if (ud.joe9000 != 0)
{
if (!self.CheckSoundPlaying("JOE9000A") && !self.CheckSoundPlaying("JOE9000B") && !self.CheckSoundPlaying("JOE9000C"))
{
if (random(0, 1))
self.PlayActorSound("JOE9000B");
else
self.PlayActorSound("JOE9000C");
}
}
else
{
self.PlayActorSound("JOE9000A");
ud.joe9000 = 1;
}
}
return true;
}
}