- do not use properties to set the sprite fields, part 2.

This covers the remaining simple cases.
This commit is contained in:
Christoph Oelckers 2022-12-19 10:29:01 +01:00
parent 3a00480efd
commit 8b664c840d
7 changed files with 62 additions and 59 deletions

View file

@ -3,14 +3,14 @@ class DukeCactusBroke : DukeActor
{ {
default default
{ {
clipdist 8;
statnum STAT_ACTOR;
pic "CACTUSBROKE"; pic "CACTUSBROKE";
} }
override void Initialize() override void Initialize()
{ {
self.cstat |= CSTAT_SPRITE_BLOCK_ALL; self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
self.ChangeStat(STAT_ACTOR);
} }
} }
@ -18,8 +18,6 @@ class DukeCactus : DukeCactusBroke
{ {
default default
{ {
clipdist 8;
statnum STAT_ACTOR;
spriteset "CACTUS", "CACTUSBROKE"; spriteset "CACTUS", "CACTUSBROKE";
} }
@ -60,4 +58,3 @@ class DukeCactus : DukeCactusBroke
} }
} }
} }

View file

@ -1,14 +1,10 @@
class DukeActivator : DukeActor class DukeActivator : DukeActor
{ {
default
{
statnum STAT_ACTIVATOR;
}
override void Initialize() override void Initialize()
{ {
self.cstat = CSTAT_SPRITE_INVISIBLE; self.cstat = CSTAT_SPRITE_INVISIBLE;
self.ChangeStat(STAT_ACTIVATOR);
} }
/* this first needs work on the sector effectors. /* this first needs work on the sector effectors.
@ -63,29 +59,21 @@ class DukeActivator : DukeActor
class DukeLocator : DukeActor class DukeLocator : DukeActor
{ {
default
{
statnum STAT_LOCATOR;
}
override void Initialize() override void Initialize()
{ {
self.cstat = CSTAT_SPRITE_INVISIBLE; self.cstat = CSTAT_SPRITE_INVISIBLE;
self.ChangeStat(STAT_LOCATOR);
} }
} }
class DukeActivatorLocked : DukeActor class DukeActivatorLocked : DukeActor
{ {
default
{
statnum STAT_ACTIVATOR;
}
override void Initialize() override void Initialize()
{ {
self.cstat = CSTAT_SPRITE_INVISIBLE; self.cstat = CSTAT_SPRITE_INVISIBLE;
if (!Raze.IsRR()) self.sector.lotag |= 16384; if (!Raze.IsRR()) self.sector.lotag |= 16384;
else self.sector.lotag ^= 16384; else self.sector.lotag ^= 16384;
self.ChangeStat(STAT_ACTIVATOR);
} }
/* must wait until Activator.onActivate can be done. /* must wait until Activator.onActivate can be done.

View file

@ -25,14 +25,14 @@ class DukeHangLight : DukeGenericPole2
{ {
default default
{ {
statnum STAT_ACTOR;
clipdist 8;
pic "HANGLIGHT"; pic "HANGLIGHT";
} }
override void Initialize() override void Initialize()
{ {
self.clipdist = 8;
self.cstat |= CSTAT_SPRITE_BLOCK_ALL; self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.ChangeStat(STAT_ACTOR);
} }
} }
@ -68,12 +68,12 @@ class DukeBottle10 : DukeActor
Default Default
{ {
pic "BOTTLE10"; pic "BOTTLE10";
clipdist 8;
} }
override void Initialize() override void Initialize()
{ {
self.cstat |= CSTAT_SPRITE_BLOCK_ALL; self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
} }
override void OnHit(DukeActor proj) override void OnHit(DukeActor proj)
{ {
@ -91,12 +91,12 @@ class DukeVase : DukeActor
Default Default
{ {
pic "VASE"; pic "VASE";
clipdist 8;
} }
override void Initialize() override void Initialize()
{ {
self.cstat |= CSTAT_SPRITE_BLOCK_ALL; self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
} }
override void OnHit(DukeActor proj) override void OnHit(DukeActor proj)
{ {
@ -114,13 +114,13 @@ class DukeFanSprite : DukeActor
Default Default
{ {
spriteset "FANSPRITE", "FANSPRITEBROKE"; spriteset "FANSPRITE", "FANSPRITEBROKE";
clipdist 8;
statnum STAT_DEFAULT;
} }
override void Initialize() override void Initialize()
{ {
self.cstat |= CSTAT_SPRITE_BLOCK_ALL; self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
self.ChangeStat(STAT_DEFAULT);
} }
override void OnHit(DukeActor proj) override void OnHit(DukeActor proj)
{ {
@ -142,13 +142,13 @@ class DukeSatellite : DukeActor
Default Default
{ {
pic "SATELITE"; pic "SATELITE";
clipdist 8;
statnum STAT_DEFAULT;
} }
override void Initialize() override void Initialize()
{ {
self.cstat |= CSTAT_SPRITE_BLOCK_ALL; self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
self.ChangeStat(STAT_DEFAULT);
} }
override void OnHit(DukeActor proj) override void OnHit(DukeActor proj)
{ {
@ -199,13 +199,13 @@ class DukeFetus : DukeActor
Default Default
{ {
spriteset "FETUS", "FETUSBROKE"; spriteset "FETUS", "FETUSBROKE";
clipdist 8;
statnum STAT_DEFAULT;
} }
override void Initialize() override void Initialize()
{ {
self.cstat |= CSTAT_SPRITE_BLOCK_ALL; self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
self.ChangeStat(STAT_DEFAULT);
} }
override void OnHit(DukeActor proj) override void OnHit(DukeActor proj)
{ {
@ -278,13 +278,13 @@ class DukeHydrant : DukeActor
Default Default
{ {
spriteset "HYDRENT", "BROKEFIREHYDRENT"; spriteset "HYDRENT", "BROKEFIREHYDRENT";
clipdist 8;
statnum STAT_DEFAULT;
} }
override void Initialize() override void Initialize()
{ {
self.cstat |= CSTAT_SPRITE_BLOCK_ALL; self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
self.ChangeStat(STAT_DEFAULT);
} }
override void OnHit(DukeActor proj) override void OnHit(DukeActor proj)
{ {
@ -302,13 +302,13 @@ class DukePipe1 : DukeActor
Default Default
{ {
spriteset "PIPE1", "PIPE1B"; spriteset "PIPE1", "PIPE1B";
clipdist 8;
statnum STAT_DEFAULT;
} }
override void Initialize() override void Initialize()
{ {
self.cstat |= CSTAT_SPRITE_BLOCK_ALL; self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
self.ChangeStat(STAT_DEFAULT);
} }
override void OnHit(DukeActor proj) override void OnHit(DukeActor proj)
{ {
@ -411,12 +411,12 @@ class DukeMonk : DukeSpaceMarine
default default
{ {
pic "MONK"; pic "MONK";
clipdist 8;
} }
override void Initialize() override void Initialize()
{ {
self.cstat |= CSTAT_SPRITE_BLOCK_ALL; self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
ChangeStat(STAT_DEFAULT); ChangeStat(STAT_DEFAULT);
} }

View file

@ -4,8 +4,12 @@ class DukePlug : DukeActor
default default
{ {
pic "PLUG"; pic "PLUG";
statnum STAT_STANDABLE; }
lotag 9999;
override void Initialize()
{
self.lotag = 9999;
self.ChangeStat(STAT_STANDABLE);
} }
override bool OnUse(DukePlayer p) override bool OnUse(DukePlayer p)
@ -22,12 +26,12 @@ class DukeFemMag : DukeActor
default default
{ {
pic "FEMMAG1"; pic "FEMMAG1";
statnum STAT_DEFAULT;
} }
override void Initialize() override void Initialize()
{ {
self.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; self.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
self.ChangeStat(STAT_DEFAULT);
} }
} }
@ -54,13 +58,13 @@ class DukeMaskWall : DukeActor
default default
{ {
pic "MASKWALL1"; pic "MASKWALL1";
statnum STAT_DEFAULT;
} }
override void Initialize() override void Initialize()
{ {
let j = self.cstat & (CSTAT_SPRITE_ALIGNMENT_MASK | CSTAT_SPRITE_XFLIP | CSTAT_SPRITE_YFLIP); let j = self.cstat & (CSTAT_SPRITE_ALIGNMENT_MASK | CSTAT_SPRITE_XFLIP | CSTAT_SPRITE_YFLIP);
self.cstat = j | CSTAT_SPRITE_BLOCK; self.cstat = j | CSTAT_SPRITE_BLOCK;
self.ChangeStat(STAT_DEFAULT);
} }
} }
@ -68,7 +72,6 @@ class DukeFootprints : DukeActor
{ {
default default
{ {
statnum STAT_MISC;
spriteset "FOOTPRINTS", "FOOTPRINTS2", "FOOTPRINTS3", "FOOTPRINTS4"; spriteset "FOOTPRINTS", "FOOTPRINTS2", "FOOTPRINTS3", "FOOTPRINTS4";
} }
@ -90,6 +93,7 @@ class DukeFootprints : DukeActor
if (sect.lotag != ST_1_ABOVE_WATER && sect.lotag != ST_2_UNDERWATER) if (sect.lotag != ST_1_ABOVE_WATER && sect.lotag != ST_2_UNDERWATER)
self.scale = (0.5, 0.5); self.scale = (0.5, 0.5);
self.setSpriteSetImage(random(0, 3)); self.setSpriteSetImage(random(0, 3));
self.ChangeStat(STAT_MISC);
} }
override bool animate(tspritetype t) override bool animate(tspritetype t)
@ -104,16 +108,15 @@ class DukeBulletHole : DukeActor
{ {
default default
{ {
statnum STAT_MISC;
pic "BULLETHOLE"; pic "BULLETHOLE";
scaleX 0.046875;
scaleY 0.046875;
} }
override void Initialize() override void Initialize()
{ {
self.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | randomFlip(); self.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | randomFlip();
self.insertspriteq(); self.insertspriteq();
self.Scale = (0.046875, 0.046875);
self.ChangeStat(STAT_MISC);
} }
override bool animate(tspritetype t) override bool animate(tspritetype t)
@ -146,13 +149,13 @@ class DukeCameraPole : DukeGenericPole
default default
{ {
pic "CAMERAPOLE"; pic "CAMERAPOLE";
extra 1;
} }
override void Initialize() override void Initialize()
{ {
if (gs.camerashitable) self.cstat = CSTAT_SPRITE_BLOCK_ALL; if (gs.camerashitable) self.cstat = CSTAT_SPRITE_BLOCK_ALL;
else self.cstat = 0; else self.cstat = 0;
self.extra = 1;
super.Initialize(); super.Initialize();
} }
} }
@ -161,13 +164,13 @@ class DukeNeon : DukeActor
{ {
default default
{ {
statnum STAT_MISC;
pic "NEON1"; pic "NEON1";
} }
override void Initialize() override void Initialize()
{ {
self.cstat |= CSTAT_SPRITE_BLOCK_ALL; self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.ChangeStat(STAT_MISC);
} }
override void Tick() override void Tick()

View file

@ -554,8 +554,11 @@ class RedneckRabbitJibA : DukeJibs1
default default
{ {
pic "RABBITJIBA"; pic "RABBITJIBA";
ScaleX 0.28125; }
ScaleY 0.28125;
override void Initialize()
{
self.Scale = (0.28125, 0.28125);
} }
} }
@ -564,8 +567,11 @@ class RedneckRabbitJibB : DukeJibs1
default default
{ {
pic "RABBITJIBB"; pic "RABBITJIBB";
ScaleX 0.5625; }
ScaleY 0.5625;
override void Initialize()
{
self.Scale = (0.5625, 0.5625);
} }
} }
@ -574,8 +580,11 @@ class RedneckRabbitJibC : DukeJibs1
default default
{ {
pic "RABBITJIBC"; pic "RABBITJIBC";
ScaleX 0.84375; }
ScaleY 0.84375;
override void Initialize()
{
self.Scale = (0.84375, 0.84375);
} }
} }

View file

@ -18,8 +18,12 @@ class RedneckMusicNotes : DukeActor
default default
{ {
pic "MUSICNOTES"; pic "MUSICNOTES";
lotag -1; }
clipdist 0;
override void Initialize()
{
self.lotag = -1;
self.clipdist = 0;
} }
override bool OnUse(DukePlayer user) override bool OnUse(DukePlayer user)
@ -35,8 +39,12 @@ class RedneckJoe9000 : DukeActor
default default
{ {
pic "JOE9000"; pic "JOE9000";
lotag 1; }
clipdist 0;
override void Initialize()
{
self.lotag = 1;
self.clipdist = 0;
} }
override bool OnUse(DukePlayer user) override bool OnUse(DukePlayer user)

View file

@ -4,14 +4,14 @@ class DukeStall : DukeActor
default default
{ {
spriteset "STALL", "STALLBROKE"; spriteset "STALL", "STALLBROKE";
lotag 1;
clipdist 2;
} }
override void Initialize() override void Initialize()
{ {
self.cstat |= CSTAT_SPRITE_BLOCK_ALL; self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.OwnerActor = self; self.OwnerActor = self;
self.lotag = 1;
self.clipdist = 2;
} }
override bool OnUse(DukePlayer p) override bool OnUse(DukePlayer p)
@ -63,8 +63,6 @@ class DukeToilet : DukeStall
default default
{ {
spriteset "TOILET", "TOILETBROKE"; spriteset "TOILET", "TOILETBROKE";
lotag 1;
clipdist 2;
} }
override void StandingOn(DukePlayer p) override void StandingOn(DukePlayer p)