2022-11-15 09:17:23 +00:00
|
|
|
|
|
|
|
class DukeCactusBroke : DukeActor
|
|
|
|
{
|
|
|
|
default
|
|
|
|
{
|
|
|
|
pic "CACTUSBROKE";
|
|
|
|
}
|
|
|
|
|
|
|
|
override void Initialize()
|
|
|
|
{
|
|
|
|
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
|
2022-12-19 09:29:01 +00:00
|
|
|
self.clipdist = 8;
|
2023-01-21 14:48:55 +00:00
|
|
|
self.ChangeStat(STAT_DEFAULT);
|
2022-11-15 09:17:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class DukeCactus : DukeCactusBroke
|
|
|
|
{
|
|
|
|
default
|
|
|
|
{
|
|
|
|
spriteset "CACTUS", "CACTUSBROKE";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
override void onHit(DukeActor hitter)
|
|
|
|
{
|
2022-12-16 16:53:47 +00:00
|
|
|
if (self.spritesetindex == 0 && hitter.bINFLAME)
|
2022-11-15 09:17:23 +00:00
|
|
|
{
|
2023-01-01 17:22:08 +00:00
|
|
|
let scrap = isRR()? DukeScrap.Scrap6 : DukeScrap.Scrap3;
|
2022-11-15 09:17:23 +00:00
|
|
|
|
|
|
|
for (int k = 0; k < 64; k++)
|
|
|
|
{
|
|
|
|
double ang = frandom(0, 360);
|
|
|
|
double vel = frandom(4, 8);
|
|
|
|
double zvel = -frandom(0, 16) - self.vel.Z * 0.25;
|
|
|
|
|
2023-01-21 14:48:55 +00:00
|
|
|
let spawned = dlevel.SpawnActor(self.sector, self.pos.plusZ(-48), "DukeScrap", -8, (0.75, 0.75), ang, vel, zvel, self, STAT_MISC);
|
2022-11-15 09:17:23 +00:00
|
|
|
if (spawned)
|
|
|
|
{
|
|
|
|
spawned.spriteextra = DukeScrap.Scrap3 + random(0, 3);
|
|
|
|
spawned.pal = 6;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-01 12:58:18 +00:00
|
|
|
self.setSpritesetImage(1);
|
2022-11-15 09:17:23 +00:00
|
|
|
self.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
override void onHurt(DukePlayer p)
|
|
|
|
{
|
|
|
|
if (self.spritesetindex == 0 && p.hurt_delay < 8)
|
|
|
|
{
|
|
|
|
p.actor.extra -= 5;
|
|
|
|
p.hurt_delay = 16;
|
|
|
|
p.pals = Color(32, 32, 0, 0);
|
2022-11-24 20:27:08 +00:00
|
|
|
p.actor.PlayActorSound("PLAYER_LONGTERM_PAIN");
|
2022-11-15 09:17:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|