- scriptified the remaining RR destructibles.

This commit is contained in:
Christoph Oelckers 2022-12-02 21:09:09 +01:00
parent 15bee4ca6a
commit e5ac32e329
5 changed files with 90 additions and 46 deletions

View file

@ -687,13 +687,15 @@ y(RRTILE2123, 2123)
y(RRTILE2124, 2124) y(RRTILE2124, 2124)
y(RRTILE2125, 2125) y(RRTILE2125, 2125)
y(RRTILE2126, 2126) y(RRTILE2126, 2126)
y(RRTILE2137, 2137) y(FLAMINGO, 2137)
y(FLAMINGOB, 2138)
y(RRTILE2132, 2132) y(RRTILE2132, 2132)
y(RRTILE2136, 2136) y(RRTILE2136, 2136)
y(RRTILE2139, 2139) y(RRTILE2139, 2139)
y(RRTILE2150, 2150) y(RRTILE2150, 2150)
y(RRTILE2151, 2151) y(MARBLESTATUE1, 2151)
y(RRTILE2152, 2152) y(MARBLESTATUE2, 2152)
y(MARBLESTATUE3, 2153)
y(RRTILE2156, 2156) y(RRTILE2156, 2156)
y(RRTILE2157, 2157) y(RRTILE2157, 2157)
y(RRTILE2158, 2158) y(RRTILE2158, 2158)
@ -1390,8 +1392,8 @@ y(RRTILE8651, 8651)
y(RRTILE8660, 8660) y(RRTILE8660, 8660)
x(ENDGAME, 8677) x(ENDGAME, 8677)
x(ENDGAME2, 8678) x(ENDGAME2, 8678)
y(RRTILE8679, 8679) y(SNAKERIVERSIGN, 8679)
y(RRTILE8680, 8680) y(SNAKERIVERSIGNB, 8680)
y(RRTILE8681, 8681) y(RRTILE8681, 8681)
y(RRTILE8682, 8682) y(RRTILE8682, 8682)
y(RRTILE8683, 8683) y(RRTILE8683, 8683)

View file

@ -1395,51 +1395,10 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
{ {
case IRONWHEELSWITCH: case IRONWHEELSWITCH:
break; break;
case RRTILE8679:
targ->spr.picnum = RRTILE8680;
S_PlayActorSound(DUKE_SHUCKS, targ);
fi.hitradius(targ, 10, 0, 0, 1, 1);
if (targ->spr.lotag != 0)
{
DukeSpriteIterator it;
while (auto act = it.Next())
{
if (act->spr.picnum == RRTILE8679 && act->spr.pal == 4)
{
if (act->spr.lotag == targ->spr.lotag)
act->spr.picnum = RRTILE8680;
}
}
}
break;
} }
switch (targ->spr.picnum) switch (targ->spr.picnum)
{ {
case RRTILE2137:
case RRTILE2151:
case RRTILE2152:
S_PlayActorSound(GLASS_BREAKING, targ);
lotsofglass(targ, nullptr, 10);
targ->spr.picnum++;
for (int k = 0; k < 6; k++)
{
auto a = randomAngle();
auto vel = krandf(4) + 4;
auto zvel = -krandf(16) - targ->vel.Z * 0.25;
auto spawned = CreateActor(targ->sector(), targ->spr.pos.plusZ(-8), PClass::FindActor("DukeScrap"), -8, DVector2(0.75, 0.75), a, vel, zvel, targ, 5);
if (spawned) spawned->spriteextra = Scrap6 + (krand() & 15);
}
break;
case RRTILE2654:
case RRTILE2656:
case RRTILE3172:
if (!isRRRA()) break;
S_PlayActorSound(GLASS_BREAKING, targ);
lotsofglass(targ, nullptr, 10);
targ->Destroy();
break;
case TOILET: case TOILET:
targ->spr.picnum = TOILETBROKE; targ->spr.picnum = TOILETBROKE;
if(krand() & 1) targ->spr.cstat |= CSTAT_SPRITE_XFLIP; if(krand() & 1) targ->spr.cstat |= CSTAT_SPRITE_XFLIP;

View file

@ -48,6 +48,7 @@ spawnclasses
8450 = RedneckAirplane 8450 = RedneckAirplane
8099 = RedneckPiano 8099 = RedneckPiano
8094 = RedneckPianoKeys 8094 = RedneckPianoKeys
8679 = RedneckSnakeRiverSign
7636 = DukeGenericDestructible, "OLDPHOTO0", "OLDPHOTO0BROKE", "VENT_BUST" 7636 = DukeGenericDestructible, "OLDPHOTO0", "OLDPHOTO0BROKE", "VENT_BUST"
7638 = DukeGenericDestructible, "OLDPHOTO1", "OLDPHOTO1BROKE", "VENT_BUST" 7638 = DukeGenericDestructible, "OLDPHOTO1", "OLDPHOTO1BROKE", "VENT_BUST"

View file

@ -154,6 +154,9 @@ spawnclasses
4897 = RedneckHenstand 4897 = RedneckHenstand
296 = RedneckTeleport 296 = RedneckTeleport
297 = RedneckTeleportDest 297 = RedneckTeleportDest
2137 = RedneckFlamingo
2151 = RedneckMarbleStatue
2152 = RedneckMarbleStatue2
3114 = DukeGenericDestructible, "RRTILE3114", "RRTILE3117", "GLASS_BREAKING", spawnglass 3114 = DukeGenericDestructible, "RRTILE3114", "RRTILE3117", "GLASS_BREAKING", spawnglass
2876 = DukeGenericDestructible, "RRTILE2876", "RRTILE2990", "GLASS_BREAKING", spawnglass 2876 = DukeGenericDestructible, "RRTILE2876", "RRTILE2990", "GLASS_BREAKING", spawnglass
@ -207,6 +210,10 @@ spawnclasses
1176 = DukeGenericDestructible, "SUSHIPLATE3", "", "GLASS_HEAVYBREAK", 8, blocking, spawnglass2 1176 = DukeGenericDestructible, "SUSHIPLATE3", "", "GLASS_HEAVYBREAK", 8, blocking, spawnglass2
1178 = DukeGenericDestructible, "SUSHIPLATE4", "", "GLASS_HEAVYBREAK", 8, blocking, spawnglass2 1178 = DukeGenericDestructible, "SUSHIPLATE4", "", "GLASS_HEAVYBREAK", 8, blocking, spawnglass2
1180 = DukeGenericDestructible, "SUSHIPLATE5", "", "GLASS_HEAVYBREAK", 8, blocking, spawnglass2 1180 = DukeGenericDestructible, "SUSHIPLATE5", "", "GLASS_HEAVYBREAK", 8, blocking, spawnglass2
2654 = DukeGenericDestructible, "RRTILE2654", "", "GLASS_BREAKING", spawnglass
2656 = DukeGenericDestructible, "RRTILE2656", "", "GLASS_BREAKING", spawnglass
3172 = DukeGenericDestructible, "RRTILE3172", "", "GLASS_BREAKING", spawnglass
} }

View file

@ -466,3 +466,78 @@ class DukeChair3 : DukeActor
self.Destroy(); self.Destroy();
} }
} }
class RedneckFlamingo : DukeActor
{
default
{
spriteset "FLAMINGO", "FLAMINGOB";
}
override void OnHit(DukeActor proj)
{
if (self.spritesetindex < self.getSpriteSetSize() - 1)
{
self.setSpriteSetImage(self.spritesetindex + 1);
self.PlayActorSound("GLASS_BREAKING");
self.lotsofglass(10);
for (int k = 0; k < 6; k++)
{
let a = frandom(0, 360);
let vel = frandom(4, 8);
let zvel = -frandom(0, 16) - self.vel.Z * 0.25;
let spawned = dlevel.SpawnActor(self.sector, self.pos.plusZ(-8), "DukeScrap", -8, (0.75, 0.75), a, vel, zvel, self, STAT_MISC);
if (spawned) spawned.spriteextra = DukeScrap.Scrap6 + random(0, 15);
}
}
}
}
class RedneckMarbleStatue : RedneckFlamingo
{
default
{
spriteset "MARBLESTATUE1", "MARBLESTATUE2", "MARBLESTATUE3";
}
}
class RedneckMarbleStatue2 : RedneckMarbleStatue
{
default
{
spritesetindex 1;
}
}
class RedneckSnakeRiverSign : DukeActor
{
default
{
spriteset "FLAMINGO", "FLAMINGOB";
}
override void OnHit(DukeActor proj)
{
if (self.spritesetindex == 0)
{
self.setSpriteSetImage(1);
self.PlayActorSound("WOODBREK");
self.hitradius(10, 0, 0, 1, 1);
if (self.lotag != 0)
{
DukeSpriteIterator it;
for (let act = it.First(); act; act = it.Next())
{
if (act is 'RedneckSnakeRiverSign' && act.pal == 4)
{
if (act.lotag == self.lotag)
act.setSpriteSetImage(1);
}
}
}
}
}
}