- moved Duke's native classes to a subfolder.

This commit is contained in:
Christoph Oelckers 2022-12-31 09:50:30 +01:00
parent 64d096c2c7
commit 665370c86d
37 changed files with 857 additions and 837 deletions

View file

@ -58,48 +58,15 @@ version "4.10"
#include "zscript/games/duke/actors/respawncontroller.zs"
#include "zscript/games/duke/actors/respawnmarker.zs"
#include "zscript/games/duke/actors/genericdestructible.zs"
#include "zscript/games/duke/actors/frameeffect.zs"
#include "zscript/games/duke/actors/naturallightning.zs"
#include "zscript/games/duke/actors/_placeholders.zs"
#include "zscript/games/duke/actors/dukemisc.zs"
#include "zscript/games/duke/actors/projectiles.zs"
#include "zscript/games/duke/actors/mortar.zs"
#include "zscript/games/duke/actors/rat.zs"
#include "zscript/games/duke/actors/jibs.zs"
#include "zscript/games/duke/actors/crane.zs"
#include "zscript/games/duke/actors/waterfountain.zs"
#include "zscript/games/duke/actors/flammables.zs"
#include "zscript/games/duke/actors/scrap.zs"
#include "zscript/games/duke/actors/cactus.zs"
#include "zscript/games/duke/actors/crack.zs"
#include "zscript/games/duke/actors/fireext.zs"
#include "zscript/games/duke/actors/oozfilter.zs"
#include "zscript/games/duke/actors/trash.zs"
#include "zscript/games/duke/actors/bolt.zs"
#include "zscript/games/duke/actors/waterdrip.zs"
#include "zscript/games/duke/actors/doorshock.zs"
#include "zscript/games/duke/actors/viewscreen.zs"
#include "zscript/games/duke/actors/canwithsomething.zs"
#include "zscript/games/duke/actors/tongue.zs"
#include "zscript/games/duke/actors/queball.zs"
#include "zscript/games/duke/actors/forcesphere.zs"
#include "zscript/games/duke/actors/recon.zs"
#include "zscript/games/duke/actors/ooz.zs"
#include "zscript/games/duke/actors/bloodsplats.zs"
#include "zscript/games/duke/actors/reactor.zs"
#include "zscript/games/duke/actors/destructibles.zs"
#include "zscript/games/duke/actors/ducktarget.zs"
#include "zscript/games/duke/actors/helicopt.zs"
#include "zscript/games/duke/actors/greenslime.zs"
#include "zscript/games/duke/actors/heavyhbomb.zs"
#include "zscript/games/duke/actors/nukebutton.zs"
#include "zscript/games/duke/actors/paper.zs"
#include "zscript/games/duke/actors/watersplash.zs"
#include "zscript/games/duke/actors/glasspieces.zs"
#include "zscript/games/duke/actors/shell.zs"
#include "zscript/games/duke/actors/bloodpool.zs"
#include "zscript/games/duke/actors/toilet.zs"
#include "zscript/games/duke/actors/transporter.zs"
#include "zscript/games/duke/actors/toiletwater.zs"
@ -149,6 +116,41 @@ version "4.10"
#include "zscript/games/duke/actors/nwinter.zs"
#include "zscript/games/duke/actors/dukecstuff/bloodpool.zs"
#include "zscript/games/duke/actors/dukecstuff/bloodsplats.zs"
#include "zscript/games/duke/actors/dukecstuff/bolt.zs"
#include "zscript/games/duke/actors/dukecstuff/cactus.zs"
#include "zscript/games/duke/actors/dukecstuff/canwithsomething.zs"
#include "zscript/games/duke/actors/dukecstuff/crack.zs"
#include "zscript/games/duke/actors/dukecstuff/crane.zs"
#include "zscript/games/duke/actors/dukecstuff/destructibles.zs"
#include "zscript/games/duke/actors/dukecstuff/doorshock.zs"
#include "zscript/games/duke/actors/dukecstuff/ducktarget.zs"
#include "zscript/games/duke/actors/dukecstuff/dukemisc.zs"
#include "zscript/games/duke/actors/dukecstuff/fireext.zs"
#include "zscript/games/duke/actors/dukecstuff/flammables.zs"
#include "zscript/games/duke/actors/dukecstuff/forcesphere.zs"
#include "zscript/games/duke/actors/dukecstuff/frameeffect.zs"
#include "zscript/games/duke/actors/dukecstuff/glasspieces.zs"
#include "zscript/games/duke/actors/dukecstuff/helicopt.zs"
#include "zscript/games/duke/actors/dukecstuff/jibs.zs"
#include "zscript/games/duke/actors/dukecstuff/nukebutton.zs"
#include "zscript/games/duke/actors/dukecstuff/ooz.zs"
#include "zscript/games/duke/actors/dukecstuff/oozfilter.zs"
#include "zscript/games/duke/actors/dukecstuff/paper.zs"
#include "zscript/games/duke/actors/dukecstuff/queball.zs"
#include "zscript/games/duke/actors/dukecstuff/rat.zs"
#include "zscript/games/duke/actors/dukecstuff/reactor.zs"
#include "zscript/games/duke/actors/dukecstuff/scrap.zs"
#include "zscript/games/duke/actors/dukecstuff/shell.zs"
#include "zscript/games/duke/actors/dukecstuff/toilet.zs"
#include "zscript/games/duke/actors/dukecstuff/tongue.zs"
#include "zscript/games/duke/actors/dukecstuff/trash.zs"
#include "zscript/games/duke/actors/dukecstuff/viewscreen.zs"
#include "zscript/games/duke/actors/dukecstuff/waterdrip.zs"
#include "zscript/games/duke/actors/dukecstuff/waterfountain.zs"
#include "zscript/games/duke/actors/dukecstuff/watersplash.zs"
#include "zscript/games/duke/actors/dukeenemies/enemy_common.zs"
#include "zscript/games/duke/actors/dukeenemies/boss1.zs"
#include "zscript/games/duke/actors/dukeenemies/boss2.zs"

View file

@ -1,42 +1,4 @@
class DukeGenericPole2 : DukeActor
{
default
{
pic "GENERICPOLE2";
}
override void OnHit(DukeActor proj)
{
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.Scrap1 + random(0, 15);
}
self.PlayActorSound("GLASS_HEAVYBREAK");
self.Destroy();
}
}
class DukeHangLight : DukeGenericPole2
{
default
{
pic "HANGLIGHT";
}
override void Initialize()
{
self.clipdist = 8;
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.ChangeStat(STAT_ACTOR);
}
}
class DukeStatueFlash : DukeActor
{
default
@ -70,488 +32,3 @@ class DukeStatue : DukeStatueFlash
}
}
class DukeBottle10 : DukeActor
{
Default
{
pic "BOTTLE10";
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
}
override void OnHit(DukeActor proj)
{
self.lotsofstuff("DukeMoney", random(4, 7));
self.PlayActorSound("GLASS_HEAVYBREAK");
self.angle = frandom(0, 360);
self.lotsofglass(8);
self.Destroy();
}
}
class DukeVase : DukeActor
{
Default
{
pic "VASE";
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
}
override void OnHit(DukeActor proj)
{
self.lotsofglass(49);
self.PlayActorSound("GLASS_HEAVYBREAK");
self.angle = frandom(0, 360);
self.lotsofglass(8);
self.Destroy();
}
}
class DukeFanSprite : DukeActor
{
Default
{
spriteset "FANSPRITE", "FANSPRITEBROKE";
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
self.ChangeStat(STAT_DEFAULT);
}
override void OnHit(DukeActor proj)
{
if (self.spritesetindex == 0)
{
self.setSpriteSetImage(1);
self.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
if (self.sector.CheckTexture(sectortype.floor, "FANSHADOW"))
self.sector.SetTextureName(sectortype.floor, "FANSHADOWBROKE");
self.PlayActorSound("GLASS_HEAVYBREAK");
for (int j = 0; j < 16; j++) self.RANDOMSCRAP();
}
}
}
class DukeSatellite : DukeActor
{
Default
{
pic "SATELITE";
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
self.ChangeStat(STAT_DEFAULT);
}
override void OnHit(DukeActor proj)
{
if (!proj.bLIGHTDAMAGE)
{
for (int j = 0; j < 15; j++)
{
let a = frandom(0, 360);
let vel = frandom(4, 12);
let zvel = -frandom(-1, 1);
let spawned = dlevel.SpawnActor(self.sector, (self.pos.XY, self.sector.floorz - 12 - j * 2), 'DukeScrap', -8, (1, 1), a, vel, zvel, self, STAT_MISC);
if (spawned) spawned.spriteextra = DukeScrap.Scrap1 + random(0, 15);
}
self.spawn("DukeExplosion2");
self.Destroy();
}
}
}
class DukeFuelPod : DukeSatellite
{
Default
{
pic "FUELPOD";
}
}
class DukeSolarPanel : DukeSatellite
{
Default
{
pic "SOLARPANNEL";
}
}
class DukeAntenna : DukeSatellite
{
Default
{
pic "ANTENNA";
}
}
class DukeFetus : DukeActor
{
Default
{
spriteset "FETUS", "FETUSBROKE";
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
self.ChangeStat(STAT_DEFAULT);
}
override void OnHit(DukeActor proj)
{
if (self.spritesetindex == 0)
{
self.setSpriteSetImage(1);
self.PlayActorSound("GLASS_BREAKING");
self.lotsofglass(10);
}
else
{
for (int j = 0; j < 48; j++)
{
self.shoot("DukeBloodSplat1");
self.angle += 58.5; // Was 333, which really makes no sense.
}
self.PlayActorSound("GLASS_HEAVYBREAK");
self.PlayActorSound("SQUISHED");
self.PlayActorSound("GLASS_BREAKING");
self.lotsofglass(10);
self.Destroy();
}
}
}
class DukeFetusBroke : DukeFetus
{
Default
{
spritesetindex 1;
}
}
// This one had no init code.
class DukeHydroplant : DukeActor
{
Default
{
spriteset "HYDROPLANT", "BROKEHYDROPLANT";
}
override void OnHit(DukeActor proj)
{
if (self.spritesetindex == 0)
{
self.setSpriteSetImage(1);
self.PlayActorSound("GLASS_BREAKING");
self.lotsofglass(10);
}
else if (self.cstat & CSTAT_SPRITE_BLOCK)
{
self.PlayActorSound("GLASS_BREAKING");
self.pos.Z += 16;
self.cstat = 0;
self.lotsofglass(5);
}
}
}
class DukeHydroplantBroke : DukeHydroplant
{
Default
{
spritesetindex 1;
}
}
class DukeHydrant : DukeActor
{
Default
{
spriteset "HYDRENT", "BROKEFIREHYDRENT";
+INFLAME;
+DOUBLEDMGTHRUST;
+BREAKMIRRORS;
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
self.ChangeStat(STAT_DEFAULT);
}
override void OnHit(DukeActor proj)
{
if (self.spritesetindex == 0)
{
self.setSpriteSetImage(1);
self.spawn("DukeToiletWater");
self.PlayActorSound("GLASS_HEAVYBREAK");
}
}
}
class DukePipe1 : DukeActor
{
Default
{
spriteset "PIPE1", "PIPE1B";
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
self.ChangeStat(STAT_DEFAULT);
}
override void OnHit(DukeActor proj)
{
if (self.spritesetindex == 0)
{
self.setSpriteSetImage(1);
let spawned = self.spawn("DukeSteam");
if (spawned) spawned.pos.Z = self.sector.floorz - 32;
}
}
}
class DukePipe2 : DukePipe1
{
Default
{
spriteset "PIPE2", "PIPE2B";
}
}
class DukePipe3 : DukePipe1
{
Default
{
spriteset "PIPE3", "PIPE3B";
}
}
class DukePipe4 : DukePipe1
{
Default
{
spriteset "PIPE4", "PIPE4B";
}
}
class DukePipe5 : DukePipe1
{
Default
{
spriteset "PIPE5", "PIPE5B";
}
}
class DukePipe6 : DukePipe1
{
Default
{
spriteset "PIPE6", "PIPE6B";
}
}
class DukeSpaceMarine : DukeActor
{
Default
{
pic "SPACEMARINE";
+HITRADIUSCHECK;
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.extra = 20;
ChangeStat(STAT_ZOMBIEACTOR);
}
override void OnHit(DukeActor proj)
{
self.extra -= proj.extra;
if (self.extra > 0) return;
self.angle = frandom(0, 360);
self.shoot("DukeBloodSplat1");
self.angle = frandom(0, 360);
self.shoot("DukeBloodSplat2");
self.angle = frandom(0, 360);
self.shoot("DukeBloodSplat3");
self.angle = frandom(0, 360);
self.shoot("DukeBloodSplat4");
self.angle = frandom(0, 360);
self.shoot("DukeBloodSplat1");
self.angle = frandom(0, 360);
self.shoot("DukeBloodSplat2");
self.angle = frandom(0, 360);
self.shoot("DukeBloodSplat3");
self.angle = frandom(0, 360);
self.shoot("DukeBloodSplat4");
self.spawnguts("DukeJibs1", 1);
self.spawnguts("DukeJibs2", 2);
self.spawnguts("DukeJibs3", 3);
self.spawnguts("DukeJibs4", 4);
self.spawnguts("DukeJibs5", 1);
self.spawnguts("DukeJibs3", 6);
Duke.PlaySound("SQUISHED");
self.Destroy();
}
}
class DukeMonk : DukeSpaceMarine
{
default
{
pic "MONK";
-HITRADIUSCHECK;
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
ChangeStat(STAT_DEFAULT);
}
override void OnHit(DukeActor proj)
{
self.PlayActorSound(Raze.FindSoundByResID(self.lotag));
self.spawnsprite(self.hitag);
super.OnHit(proj);
}
}
class DukeLuke : DukeMonk
{
default
{
pic "LUKE";
}
}
class DukeIndy : DukeMonk
{
default
{
pic "INDY";
}
}
class DukeJuryGuy : DukeMonk
{
default
{
pic "JURYGUY";
}
}
class DukeChair3 : DukeActor
{
default
{
pic "CHAIR3";
+ALWAYSROTATE1;
}
override void OnHit(DukeActor proj)
{
self.PlayActorSound("GLASS_HEAVYBREAK");
for (int j = 0; j < 16; j++) self.RANDOMSCRAP();
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);
}
}
}
}
}
}

View file

@ -0,0 +1,524 @@
class DukeGenericPole2 : DukeActor
{
default
{
pic "GENERICPOLE2";
}
override void OnHit(DukeActor proj)
{
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.Scrap1 + random(0, 15);
}
self.PlayActorSound("GLASS_HEAVYBREAK");
self.Destroy();
}
}
class DukeHangLight : DukeGenericPole2
{
default
{
pic "HANGLIGHT";
}
override void Initialize()
{
self.clipdist = 8;
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.ChangeStat(STAT_ACTOR);
}
}
class DukeBottle10 : DukeActor
{
Default
{
pic "BOTTLE10";
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
}
override void OnHit(DukeActor proj)
{
self.lotsofstuff("DukeMoney", random(4, 7));
self.PlayActorSound("GLASS_HEAVYBREAK");
self.angle = frandom(0, 360);
self.lotsofglass(8);
self.Destroy();
}
}
class DukeVase : DukeActor
{
Default
{
pic "VASE";
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
}
override void OnHit(DukeActor proj)
{
self.lotsofglass(49);
self.PlayActorSound("GLASS_HEAVYBREAK");
self.angle = frandom(0, 360);
self.lotsofglass(8);
self.Destroy();
}
}
class DukeFanSprite : DukeActor
{
Default
{
spriteset "FANSPRITE", "FANSPRITEBROKE";
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
self.ChangeStat(STAT_DEFAULT);
}
override void OnHit(DukeActor proj)
{
if (self.spritesetindex == 0)
{
self.setSpriteSetImage(1);
self.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
if (self.sector.CheckTexture(sectortype.floor, "FANSHADOW"))
self.sector.SetTextureName(sectortype.floor, "FANSHADOWBROKE");
self.PlayActorSound("GLASS_HEAVYBREAK");
for (int j = 0; j < 16; j++) self.RANDOMSCRAP();
}
}
}
class DukeSatellite : DukeActor
{
Default
{
pic "SATELITE";
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
self.ChangeStat(STAT_DEFAULT);
}
override void OnHit(DukeActor proj)
{
if (!proj.bLIGHTDAMAGE)
{
for (int j = 0; j < 15; j++)
{
let a = frandom(0, 360);
let vel = frandom(4, 12);
let zvel = -frandom(-1, 1);
let spawned = dlevel.SpawnActor(self.sector, (self.pos.XY, self.sector.floorz - 12 - j * 2), 'DukeScrap', -8, (1, 1), a, vel, zvel, self, STAT_MISC);
if (spawned) spawned.spriteextra = DukeScrap.Scrap1 + random(0, 15);
}
self.spawn("DukeExplosion2");
self.Destroy();
}
}
}
class DukeFuelPod : DukeSatellite
{
Default
{
pic "FUELPOD";
}
}
class DukeSolarPanel : DukeSatellite
{
Default
{
pic "SOLARPANNEL";
}
}
class DukeAntenna : DukeSatellite
{
Default
{
pic "ANTENNA";
}
}
class DukeFetus : DukeActor
{
Default
{
spriteset "FETUS", "FETUSBROKE";
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
self.ChangeStat(STAT_DEFAULT);
}
override void OnHit(DukeActor proj)
{
if (self.spritesetindex == 0)
{
self.setSpriteSetImage(1);
self.PlayActorSound("GLASS_BREAKING");
self.lotsofglass(10);
}
else
{
for (int j = 0; j < 48; j++)
{
self.shoot("DukeBloodSplat1");
self.angle += 58.5; // Was 333, which really makes no sense.
}
self.PlayActorSound("GLASS_HEAVYBREAK");
self.PlayActorSound("SQUISHED");
self.PlayActorSound("GLASS_BREAKING");
self.lotsofglass(10);
self.Destroy();
}
}
}
class DukeFetusBroke : DukeFetus
{
Default
{
spritesetindex 1;
}
}
// This one had no init code.
class DukeHydroplant : DukeActor
{
Default
{
spriteset "HYDROPLANT", "BROKEHYDROPLANT";
}
override void OnHit(DukeActor proj)
{
if (self.spritesetindex == 0)
{
self.setSpriteSetImage(1);
self.PlayActorSound("GLASS_BREAKING");
self.lotsofglass(10);
}
else if (self.cstat & CSTAT_SPRITE_BLOCK)
{
self.PlayActorSound("GLASS_BREAKING");
self.pos.Z += 16;
self.cstat = 0;
self.lotsofglass(5);
}
}
}
class DukeHydroplantBroke : DukeHydroplant
{
Default
{
spritesetindex 1;
}
}
class DukeHydrant : DukeActor
{
Default
{
spriteset "HYDRENT", "BROKEFIREHYDRENT";
+INFLAME;
+DOUBLEDMGTHRUST;
+BREAKMIRRORS;
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
self.ChangeStat(STAT_DEFAULT);
}
override void OnHit(DukeActor proj)
{
if (self.spritesetindex == 0)
{
self.setSpriteSetImage(1);
self.spawn("DukeToiletWater");
self.PlayActorSound("GLASS_HEAVYBREAK");
}
}
}
class DukePipe1 : DukeActor
{
Default
{
spriteset "PIPE1", "PIPE1B";
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
self.ChangeStat(STAT_DEFAULT);
}
override void OnHit(DukeActor proj)
{
if (self.spritesetindex == 0)
{
self.setSpriteSetImage(1);
let spawned = self.spawn("DukeSteam");
if (spawned) spawned.pos.Z = self.sector.floorz - 32;
}
}
}
class DukePipe2 : DukePipe1
{
Default
{
spriteset "PIPE2", "PIPE2B";
}
}
class DukePipe3 : DukePipe1
{
Default
{
spriteset "PIPE3", "PIPE3B";
}
}
class DukePipe4 : DukePipe1
{
Default
{
spriteset "PIPE4", "PIPE4B";
}
}
class DukePipe5 : DukePipe1
{
Default
{
spriteset "PIPE5", "PIPE5B";
}
}
class DukePipe6 : DukePipe1
{
Default
{
spriteset "PIPE6", "PIPE6B";
}
}
class DukeSpaceMarine : DukeActor
{
Default
{
pic "SPACEMARINE";
+HITRADIUSCHECK;
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.extra = 20;
ChangeStat(STAT_ZOMBIEACTOR);
}
override void OnHit(DukeActor proj)
{
self.extra -= proj.extra;
if (self.extra > 0) return;
self.angle = frandom(0, 360);
self.shoot("DukeBloodSplat1");
self.angle = frandom(0, 360);
self.shoot("DukeBloodSplat2");
self.angle = frandom(0, 360);
self.shoot("DukeBloodSplat3");
self.angle = frandom(0, 360);
self.shoot("DukeBloodSplat4");
self.angle = frandom(0, 360);
self.shoot("DukeBloodSplat1");
self.angle = frandom(0, 360);
self.shoot("DukeBloodSplat2");
self.angle = frandom(0, 360);
self.shoot("DukeBloodSplat3");
self.angle = frandom(0, 360);
self.shoot("DukeBloodSplat4");
self.spawnguts("DukeJibs1", 1);
self.spawnguts("DukeJibs2", 2);
self.spawnguts("DukeJibs3", 3);
self.spawnguts("DukeJibs4", 4);
self.spawnguts("DukeJibs5", 1);
self.spawnguts("DukeJibs3", 6);
Duke.PlaySound("SQUISHED");
self.Destroy();
}
}
class DukeMonk : DukeSpaceMarine
{
default
{
pic "MONK";
-HITRADIUSCHECK;
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
ChangeStat(STAT_DEFAULT);
}
override void OnHit(DukeActor proj)
{
self.PlayActorSound(Raze.FindSoundByResID(self.lotag));
self.spawnsprite(self.hitag);
super.OnHit(proj);
}
}
class DukeLuke : DukeMonk
{
default
{
pic "LUKE";
}
}
class DukeIndy : DukeMonk
{
default
{
pic "INDY";
}
}
class DukeJuryGuy : DukeMonk
{
default
{
pic "JURYGUY";
}
}
class DukeChair3 : DukeActor
{
default
{
pic "CHAIR3";
+ALWAYSROTATE1;
}
override void OnHit(DukeActor proj)
{
self.PlayActorSound("GLASS_HEAVYBREAK");
for (int j = 0; j < 16; j++) self.RANDOMSCRAP();
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);
}
}
}
}
}
}

View file

@ -0,0 +1,298 @@
class DukePlug : DukeActor
{
default
{
pic "PLUG";
}
override void Initialize()
{
self.lotag = 9999;
self.ChangeStat(STAT_STANDABLE);
}
override bool OnUse(DukePlayer p)
{
p.actor.PlayActorSound("SHORT_CIRCUIT");
p.actor.extra -= random(2, 5);
p.pals = Color(32, 48, 48, 64);
return true;
}
}
class DukeFemMag : DukeActor
{
default
{
pic "FEMMAG1";
}
override void Initialize()
{
self.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
self.ChangeStat(STAT_DEFAULT);
}
}
class DukeTag : DukeActor
{
default
{
pic "DUKETAG";
}
override void Initialize()
{
if (ud.multimode < 2 && self.pal)
{
self.scale = (0, 0);
self.ChangeStat(STAT_MISC);
}
else self.pal = 0;
}
}
class DukeMaskWall : DukeActor
{
default
{
pic "MASKWALL1";
}
override void Initialize()
{
let j = self.cstat & (CSTAT_SPRITE_ALIGNMENT_MASK | CSTAT_SPRITE_XFLIP | CSTAT_SPRITE_YFLIP);
self.cstat = j | CSTAT_SPRITE_BLOCK;
self.ChangeStat(STAT_DEFAULT);
}
}
class DukeFootprints : DukeActor
{
default
{
spriteset "FOOTPRINTS", "FOOTPRINTS2", "FOOTPRINTS3", "FOOTPRINTS4";
+SE24_REMOVE;
}
override void Initialize()
{
if (!self.mapSpawned)
{
bool away = self.isAwayFromWall(5.25);
if (!away)
{
self.scale = (0, 0);
return;
}
self.cstat = CSTAT_SPRITE_ALIGNMENT_FLOOR;
self.insertspriteq();
}
let sect = self.sector;
self.pos.Z = sect.floorz;
if (sect.lotag != ST_1_ABOVE_WATER && sect.lotag != ST_2_UNDERWATER)
self.scale = (0.5, 0.5);
self.setSpriteSetImage(random(0, 3));
self.ChangeStat(STAT_MISC);
}
override bool animate(tspritetype t)
{
if (self.shade == 127) t.shade = 127;
if (t.pal == 6) t.shade = -127;
return true;
}
}
class DukeBulletHole : DukeActor
{
default
{
pic "BULLETHOLE";
+SE24_REMOVE;
+NOTELEPORT;
}
override void Initialize()
{
self.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | randomFlip();
self.insertspriteq();
self.Scale = (0.046875, 0.046875);
self.ChangeStat(STAT_MISC);
}
override bool animate(tspritetype t)
{
t.shade = 16;
return true;
}
}
class DukeGenericPole : DukeActor
{
default
{
pic "GENERICPOLE";
}
override void Initialize()
{
if (ud.multimode < 2 && self.pal != 0)
{
self.scale = (0, 0);
self.ChangeStat(STAT_MISC);
}
else self.pal = 0;
}
}
class DukeCameraPole : DukeGenericPole
{
default
{
pic "CAMERAPOLE";
}
override void Initialize()
{
if (gs.camerashitable) self.cstat = CSTAT_SPRITE_BLOCK_ALL;
else self.cstat = 0;
self.extra = 1;
super.Initialize();
}
}
class DukeNeon : DukeActor
{
default
{
pic "NEON1";
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.ChangeStat(STAT_MISC);
}
override void Tick()
{
if ((Duke.global_random() / (self.lotag + 1) & 31) > 4) self.shade = -127;
else self.shade = 127;
}
override bool Animate(tspritetype t)
{
t.shade = self.shade;
return true;
}
}
class DeveloperCommentary : DukeActor
{
default
{
spriteset "DEVELOPERCOMMENTARY", "DEVELOPERCOMMENTARYON";
}
override bool TriggerSwitch(DukePlayer p)
{
if (!wt_commentary) return true;
if (self.spriteSetIndex == 0)
{
if (Duke.StartCommentary(self.lotag, self))
self.setSpriteSetImage(1);
}
else
{
Duke.StopCommentary();
self.setSpriteSetImage(0);
}
return true;
}
override bool animate(tspritetype t)
{
if (!wt_commentary) t.scale = (0, 0);
else t.shade = self.shade;
return true;
}
}
// These ones are either inert or use CON but also have flags attached
class DukeBarBroke : DukeActor
{
default
{
pic "BARBROKE";
+SE24_NOCARRY;
}
}
class DukeBearingPlate : DukeActor
{
default
{
pic "BEARINGPLATE";
}
}
class DukeLaserSite : DukeActor
{
default
{
pic "LASERSITE";
+FORCERUNCON;
}
}
class RedneckUfoLight : DukeActor
{
default
{
pic "UFOLIGHT";
}
}
class DukeSpaceShuttle : DukeActor // (487)
{
default
{
pic "SPACESHUTTLE";
}
}
class DukeSatellite2 : DukeActor // (489)
{
default
{
pic "SATELLITE";
}
}
class DukeDevastatorBlast : DukeActor // (1642) looks dead.
{
default
{
pic "DEVISTATORBLAST";
//Strength FREEZETHROWER_WEAPON_STRENGTH;
}
}
class DukeNaturalLightning : DukeActor
{
default
{
pic "NATURALLIGHTNING";
+FULLBRIGHT;
}
override void Initialize()
{
self.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
self.cstat |= CSTAT_SPRITE_INVISIBLE;
}
}

View file

@ -1,244 +1,4 @@
class DukePlug : DukeActor
{
default
{
pic "PLUG";
}
override void Initialize()
{
self.lotag = 9999;
self.ChangeStat(STAT_STANDABLE);
}
override bool OnUse(DukePlayer p)
{
p.actor.PlayActorSound("SHORT_CIRCUIT");
p.actor.extra -= random(2, 5);
p.pals = Color(32, 48, 48, 64);
return true;
}
}
class DukeFemMag : DukeActor
{
default
{
pic "FEMMAG1";
}
override void Initialize()
{
self.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
self.ChangeStat(STAT_DEFAULT);
}
}
class DukeTag : DukeActor
{
default
{
pic "DUKETAG";
}
override void Initialize()
{
if (ud.multimode < 2 && self.pal)
{
self.scale = (0, 0);
self.ChangeStat(STAT_MISC);
}
else self.pal = 0;
}
}
class DukeMaskWall : DukeActor
{
default
{
pic "MASKWALL1";
}
override void Initialize()
{
let j = self.cstat & (CSTAT_SPRITE_ALIGNMENT_MASK | CSTAT_SPRITE_XFLIP | CSTAT_SPRITE_YFLIP);
self.cstat = j | CSTAT_SPRITE_BLOCK;
self.ChangeStat(STAT_DEFAULT);
}
}
class DukeFootprints : DukeActor
{
default
{
spriteset "FOOTPRINTS", "FOOTPRINTS2", "FOOTPRINTS3", "FOOTPRINTS4";
+SE24_REMOVE;
}
override void Initialize()
{
if (!self.mapSpawned)
{
bool away = self.isAwayFromWall(5.25);
if (!away)
{
self.scale = (0, 0);
return;
}
self.cstat = CSTAT_SPRITE_ALIGNMENT_FLOOR;
self.insertspriteq();
}
let sect = self.sector;
self.pos.Z = sect.floorz;
if (sect.lotag != ST_1_ABOVE_WATER && sect.lotag != ST_2_UNDERWATER)
self.scale = (0.5, 0.5);
self.setSpriteSetImage(random(0, 3));
self.ChangeStat(STAT_MISC);
}
override bool animate(tspritetype t)
{
if (self.shade == 127) t.shade = 127;
if (t.pal == 6) t.shade = -127;
return true;
}
}
class DukeBulletHole : DukeActor
{
default
{
pic "BULLETHOLE";
+SE24_REMOVE;
+NOTELEPORT;
}
override void Initialize()
{
self.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | randomFlip();
self.insertspriteq();
self.Scale = (0.046875, 0.046875);
self.ChangeStat(STAT_MISC);
}
override bool animate(tspritetype t)
{
t.shade = 16;
return true;
}
}
class DukeGenericPole : DukeActor
{
default
{
pic "GENERICPOLE";
}
override void Initialize()
{
if (ud.multimode < 2 && self.pal != 0)
{
self.scale = (0, 0);
self.ChangeStat(STAT_MISC);
}
else self.pal = 0;
}
}
class DukeCameraPole : DukeGenericPole
{
default
{
pic "CAMERAPOLE";
}
override void Initialize()
{
if (gs.camerashitable) self.cstat = CSTAT_SPRITE_BLOCK_ALL;
else self.cstat = 0;
self.extra = 1;
super.Initialize();
}
}
class DukeNeon : DukeActor
{
default
{
pic "NEON1";
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.ChangeStat(STAT_MISC);
}
override void Tick()
{
if ((Duke.global_random() / (self.lotag + 1) & 31) > 4) self.shade = -127;
else self.shade = 127;
}
override bool Animate(tspritetype t)
{
t.shade = self.shade;
return true;
}
}
class DeveloperCommentary : DukeActor
{
default
{
spriteset "DEVELOPERCOMMENTARY", "DEVELOPERCOMMENTARYON";
}
override bool TriggerSwitch(DukePlayer p)
{
if (!wt_commentary) return true;
if (self.spriteSetIndex == 0)
{
if (Duke.StartCommentary(self.lotag, self))
self.setSpriteSetImage(1);
}
else
{
Duke.StopCommentary();
self.setSpriteSetImage(0);
}
return true;
}
override bool animate(tspritetype t)
{
if (!wt_commentary) t.scale = (0, 0);
else t.shade = self.shade;
return true;
}
}
// These ones are either inert or use CON but also have flags attached
class DukeBarBroke : DukeActor
{
default
{
pic "BARBROKE";
+SE24_NOCARRY;
}
}
class DukeBearingPlate : DukeActor
{
default
{
pic "BEARINGPLATE";
}
}
class DukeBurnedCorpse : DukeActor
{
default
@ -248,15 +8,6 @@ class DukeBurnedCorpse : DukeActor
}
}
class DukeLaserSite : DukeActor
{
default
{
pic "LASERSITE";
+FORCERUNCON;
}
}
class DukeSpeaker : DukeActor
{
default
@ -266,14 +17,6 @@ class DukeSpeaker : DukeActor
}
}
class RedneckUfoLight : DukeActor
{
default
{
pic "UFOLIGHT";
}
}
class DukeFoodObject6: DukeActor
{
@ -596,22 +339,6 @@ class DukeFem6Pad: DukeActor
}
}
class DukeSpaceShuttle : DukeActor // (487)
{
default
{
pic "SPACESHUTTLE";
}
}
class DukeSatellite2 : DukeActor // (489)
{
default
{
pic "SATELLITE";
}
}
class DukeMop : DukeActor // (4497)
{
default
@ -852,14 +579,6 @@ class DukeCoffeeMug : DukeActor // (4438)
}
}
class DukeDevastatorBlast : DukeActor // (1642)
{
default
{
pic "DEVISTATORBLAST";
}
}
class DukeHotMeat : DukeActor // (4427)
{
default