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

As soon as default init for CON gets in this won't work right anymore - these must come last, not first.
This commit contains all the trivial cases with no inheritance concerns.
This commit is contained in:
Christoph Oelckers 2022-12-19 10:21:20 +01:00
parent 278cfe9216
commit 3a00480efd
42 changed files with 114 additions and 127 deletions

View file

@ -2,16 +2,15 @@ class RedneckAirplane : DukeActor
{
default
{
statnum STAT_ACTOR;
pic "AIRPLANE";
ScaleX 1;
ScaleY 1;
}
override void Initialize()
{
self.extra = self.lotag;
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.Scale = (1, 1);
self.ChangeStat(STAT_ACTOR);
}
override void Tick()

View file

@ -3,17 +3,16 @@ class RedneckBalloons1 : DukeActor
{
Default
{
ScaleX 0.5;
ScaleY 0.5;
Extra 0;
Hitag 0;
Statnum STAT_ACTOR;
Spriteset "BALLOONS1", "BALLOONS1BROKE";
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.Scale = (0.5, 0.5);
self.extra = 0;
self.hitag = 0;
self.ChangeStat(STAT_ACTOR);
}
override void Tick()

View file

@ -3,7 +3,6 @@ class DukeBloodPool : DukeActor
default
{
pic "BLOODPOOL";
statnum STAT_MISC;
}
virtual void SetPalette()
@ -32,6 +31,7 @@ class DukeBloodPool : DukeActor
self.cstat |= CSTAT_SPRITE_ALIGNMENT_FLOOR;
if (!self.mapSpawned)
self.scale = (REPEAT_SCALE, REPEAT_SCALE);
self.ChangeStat(STAT_MISC);
}
override void Tick()

View file

@ -2,7 +2,6 @@ class DukeBloodSplat1 : DukeActor
{
default
{
statnum STAT_MISC;
Pic "BLOODSPLAT1";
}
@ -15,6 +14,7 @@ class DukeBloodSplat1 : DukeActor
if (!self.mapSpawned && self.ownerActor && self.ownerActor.pal == 6)
self.pal = 6;
self.insertspriteq();
self.ChangeStat(STAT_MISC);
}
override void Tick()

View file

@ -2,14 +2,14 @@ class DukeBolt1 : DukeActor
{
default
{
yint 0;
statnum STAT_STANDABLE;
SpriteSet "BOLT1", "BOLT2", "BOLT3", "BOLT4";
spritesetindex 0;
}
override void Initialize()
{
self.temp_pos.XY = self.scale;
self.yint = 0;
self.ChangeStat(STAT_STANDABLE);
}
override void Tick()

View file

@ -3,9 +3,6 @@ class DukeCanWithSomething : DukeActor
{
Default
{
extra 0;
clipdist 18;
statnum STAT_ZOMBIEACTOR;
pic "CANWITHSOMETHING";
}
@ -15,6 +12,9 @@ class DukeCanWithSomething : DukeActor
self.scale = (0.5, 0.5);
self.makeitfall();
self.cstat = CSTAT_SPRITE_BLOCK_ALL | randomXFlip();
self.extra = 0;
self.clipdist = 18;
self.ChangeStat(STAT_ZOMBIEACTOR);
}

View file

@ -3,7 +3,6 @@ class DukeCrack : DukeActor
{
default
{
statnum STAT_STANDABLE;
pic "CRACK1";
}
@ -23,6 +22,7 @@ class DukeCrack : DukeActor
self.ownerActor = self;
self.vel.X = 0.5;
self.DoMove(CLIPMASK0);
self.ChangeStat(STAT_STANDABLE);
}
override void Tick()

View file

@ -2,13 +2,14 @@ class DukeDoorShock : DukeActor
{
default
{
shade -12;
statnum STAT_STANDABLE;
pic "DOORSHOCK";
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.shade = -12;
self.ChangeStat(STAT_STANDABLE);
}

View file

@ -3,13 +3,13 @@ class DukeLetter : DukeActor
default
{
pic "LETTER";
statnum STAT_ACTOR;
extra 1;
}
override void Initialize()
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.ChangeStat(STAT_ACTOR);
self.extra = 1;
}
}

View file

@ -4,10 +4,6 @@ class RedneckEmptyBike : DukeActor
default
{
pic "EMPTYBIKE";
scaleX 0.28125;
scaleY 0.28125;
lotag 1;
statnum STAT_ACTOR;
}
override void Initialize()
@ -18,10 +14,13 @@ class RedneckEmptyBike : DukeActor
self.ChangeStat(STAT_MISC);
return;
}
self.lotag = 1;
self.Scale = (0.28125, 0.28125);
self.pal = 0;
self.setClipDistFromTile();
self.saved_ammo = 100;
self.cstat = CSTAT_SPRITE_BLOCK_ALL;
self.ChangeStat(STAT_ACTOR);
}
override void Tick()
@ -53,10 +52,6 @@ class RedneckEmptyBoat : DukeActor
default
{
pic "EMPTYBOAT";
scaleX 0.5;
scaleY 0.5;
lotag 1;
statnum STAT_ACTOR;
}
override void Initialize()
@ -67,10 +62,13 @@ class RedneckEmptyBoat : DukeActor
self.ChangeStat(STAT_MISC);
return;
}
self.lotag = 1;
self.Scale = (0.5, 0.5);
self.pal = 0;
self.setClipDistFromTile();
self.saved_ammo = 20;
self.cstat = CSTAT_SPRITE_BLOCK_ALL;
self.ChangeStat(STAT_ACTOR);
}

View file

@ -3,7 +3,6 @@ class DukeFireext : DukeActor
{
default
{
statnum STAT_STANDABLE;
pic "FIREEXT";
}
@ -23,6 +22,7 @@ class DukeFireext : DukeActor
self.ownerActor = self;
self.vel.X = 0.5;
self.DoMove(CLIPMASK0);
self.ChangeStat(STAT_STANDABLE);
}
override void Tick()

View file

@ -2,7 +2,6 @@ class DukeFrameEffect : DukeActor
{
default
{
statnum STAT_MISC;
Pic "SMALLSMOKE";
}
@ -17,6 +16,7 @@ class DukeFrameEffect : DukeActor
{
self.Scale = (0, 0);
}
self.ChangeStat(STAT_MISC);
}
override void Tick()

View file

@ -3,10 +3,6 @@ class RedneckGamblingMachine : DukeActor
{
default
{
statnum STAT_ACTOR;
lotag 1;
clipdist 0;
extra 0;
spriteset "GAMBLINGMACHINE2", "GAMBLINGMACHINE3", "GAMBLINGMACHINE4", "GAMBLINGMACHINE5", "GAMBLINGMACHINE6", "GAMBLINGMACHINE7", "GAMBLINGMACHINE8", "GAMBLINGMACHINEBROKE";
spritesetindex 3;
RedneckGamblingMachine.winsound "COW3";
@ -16,6 +12,14 @@ class RedneckGamblingMachine : DukeActor
meta Sound winsound;
property winsound: winsound;
override void Initialize()
{
self.lotag = 1;
self.clipdist = 0;
self.extra = 0;
self.ChangeStat(STAT_ACTOR);
}
override void Tick()
{
int spriteindex;

View file

@ -2,17 +2,17 @@ class DukeCar : DukeActor
{
default
{
extra 1;
clipdist 32;
pic "DUKECAR";
statnum STAT_ACTOR;
}
override void Initialize()
{
self.extra = 1;
self.clipdist = 32;
self.vel.X = 292 / 16.;
self.vel.Z = 360 / 256.;
self.cstat = CSTAT_SPRITE_BLOCK_ALL;
self.ChangeStat(STAT_ACTOR);
}
override void Tick()

View file

@ -3,11 +3,15 @@ class RedneckLumberBlade : DukeActor
{
default
{
statnum STAT_LUMBERMILL;
extra 0;
spriteset "LUMBERBLADE1", "LUMBERBLADE";
}
override void Initialize()
{
self.ChangeStat(STAT_LUMBERMILL);
self.extra = 0;
}
override void Tick()
{
if (self.hitag == 100)
@ -60,13 +64,13 @@ Class RedneckKegHolder : DukeActor
{
default
{
statnum STAT_LUMBERMILL;
pic "KEGHOLDER";
}
override void Initialize()
{
self.cstat = CSTAT_SPRITE_INVISIBLE;
self.ChangeStat(STAT_LUMBERMILL);
}
override bool OnUse(DukePlayer user)

View file

@ -1,14 +1,10 @@
class DukeMasterSwitch : DukeActor
{
default
{
statnum STAT_STANDABLE;
}
override void Initialize()
{
self.cstat = CSTAT_SPRITE_INVISIBLE;
self.yint = 0;
self.ChangeStat(STAT_STANDABLE);
}
override void Tick()

View file

@ -4,7 +4,11 @@ class DukeNukeButton : DukeActor
default
{
spriteset "NUKEBUTTON", "NUKEBUTTON1", "NUKEBUTTON2", "NUKEBUTTON3";
statnum STAT_MISC;
}
override void Initialize()
{
self.ChangeStat(STAT_MISC);
}
override void Tick()

View file

@ -2,8 +2,6 @@ class DukeOoz : DukeActor
{
default
{
shade -12;
statnum STAT_ACTOR;
pic "OOZ";
}
@ -24,6 +22,7 @@ class DukeOoz : DukeActor
self.scale = (max(0., 0.390625 - z * 0.5), z);
self.cstat |= randomXFlip();
self.ChangeStat(STAT_ACTOR);
}
override void Tick()

View file

@ -3,7 +3,6 @@ class DukeOozFilter : DukeActor
{
default
{
statnum STAT_STANDABLE;
spriteset "OOZFILTER";
}
@ -18,6 +17,7 @@ class DukeOozFilter : DukeActor
else self.cstat = CSTAT_SPRITE_BLOCK_ALL;
self.extra = gs.impact_damage << 2;
self.ownerActor = self;
self.ChangeStat(STAT_STANDABLE);
}
override void Tick()

View file

@ -3,17 +3,16 @@ class DukeMoney : DukeActor
{
default
{
statnum STAT_MISC;
spriteset "MONEY", "MONEY1";
ScaleX 0.125;
ScaleY 0.125;
}
override void Initialize()
{
self.scale = (0.125, 0.125);
self.temp_data[0] = random(0, 2047);
self.cstat = self.randomFlip();
self.angle = frandom(0, 360);
self.ChangeStat(STAT_MISC);
}
override void Tick()

View file

@ -2,12 +2,16 @@ class RedneckPiano : DukeActor
{
default
{
lotag 5;
clipdist 0;
statnum STAT_ACTOR;
spriteset "PIANO", "PIANOBUST";
}
override void Initialize()
{
self.lotag = 5;
self.clipdist = 0;
self.ChangeStat(STAT_ACTOR);
}
override void Tick()
{
if (self.lotag == 5)

View file

@ -4,16 +4,15 @@ class RedneckPigDisplay : DukeActor
default
{
spriteset "PIGBACK", "PIGBACK1", "PIGBACK2", "PIGBACK3", "PIGBACK4";
ScaleX 0.25;
ScaleY 0.25;
clipdist 0;
extra 0;
statnum STAT_ACTOR;
}
override void Initialize()
{
cstat = 0;
self.scale = (0.25, 0.25);
self.clipdist = 0;
self.extra = 0;
self.ChangeStat(STAT_ACTOR);
}
override void Tick()

View file

@ -7,14 +7,14 @@ class DukeQueball : DukeActor
{
default
{
clipdist 2;
pic "QUEBALL";
statnum STAT_ZOMBIEACTOR;
}
override void Initialize()
{
self.clipdist = 2;
self.cstat = CSTAT_SPRITE_BLOCK_HITSCAN;
self.ChangeStat(STAT_ZOMBIEACTOR);
}
override void Tick()

View file

@ -1,14 +1,10 @@
class RedneckRabbitSpawner : DukeActor
{
default
{
statnum STAT_FX;
extra 0;
}
override void Initialize()
{
self.cstat = CSTAT_SPRITE_INVISIBLE;
self.extra = 0;
self.ChangeStat(STAT_FX);
}
override void Tick()

View file

@ -5,9 +5,6 @@ class DukeRat : DukeActor
default
{
pic "RAT";
clipdist 10;
scaleX 0.75;
scaleY 0.75;
}
override void Initialize()
@ -32,8 +29,9 @@ class DukeRat : DukeActor
if (Raze.isRR()) self.shade = self.ownerActor.shade;
}
else self.ChangeStat(STAT_ZOMBIEACTOR);
}
self. clipdist = 10;
self. scale = (0.75, 0.75);
}
override void Tick()

View file

@ -3,9 +3,6 @@ class DukeReactor : DukeActor
default
{
spriteset "REACTOR", "REACTORBURNT";
statnum STAT_ZOMBIEACTOR;
shade -17;
pal 0;
}
@ -13,11 +10,14 @@ class DukeReactor : DukeActor
{
self.extra = gs.impact_damage;
self.cstat |= CSTAT_SPRITE_BLOCK_ALL; // Make it hitable
self.shade = -17;
self.pal = 0;
if (ud.multimode < 2 && self.pal != 0)
{
self.scale = (0, 0);
self.ChangeStat(STAT_MISC);
}
else self.ChangeStat(STAT_ZOMBIEACTOR);
}

View file

@ -1,11 +1,5 @@
class DukeRespawnController : DukeActor
{
default
{
statnum STAT_FX;
extra 66 - 13;
}
override void Initialize()
{
if (ud.multimode < 2 && self.pal == 1)
@ -14,7 +8,11 @@ class DukeRespawnController : DukeActor
self.ChangeStat(STAT_MISC);
}
else
{
self.cstat = CSTAT_SPRITE_INVISIBLE;
self.extra = 66 - 13;
self.ChangeStat(STAT_FX);
}
}
override void Tick()

View file

@ -5,13 +5,12 @@ class DukeRespawnMarker : DukeActor
default
{
spriteset "RESPAWNMARKERRED", "RESPAWNMARKERYELLOW", "RESPAWNMARKERGREEN";
scalex 0.375;
scaley 0.375;
}
override void Initialize()
{
if (!self.mapSpawned && ownerActor != null) self.pos.Z = ownerActor.floorZ;
self.scale = (0.375, 0.375);
}
override void Tick()

View file

@ -3,7 +3,6 @@ class RedneckCactusLargeYellow : DukeActor
{
default
{
statnum STAT_ACTOR;
SpriteSet "CACTUSLARGEYELLOW";
}
@ -16,6 +15,7 @@ class RedneckCactusLargeYellow : DukeActor
p.pals = Color(32, 32, 0, 0);
p.actor.PlayActorSound("PLAYER_LONGTERM_PAIN");
}
self.ChangeStat(STAT_ACTOR);
}
}

View file

@ -4,10 +4,13 @@ class RedneckTeleportDest : DukeActor
default
{
pic "RRTELEPORTDEST";
statnum STAT_TELEPORT;
ScaleX 1;
ScaleY 1;
clipdist 16;
}
override void Initialize()
{
self. Scale = (1, 1);
self.clipdist = 16;
self.ChangeStat(STAT_TELEPORT);
}
}

View file

@ -1,11 +1,6 @@
class DukeScrap : DukeActor
{
default
{
statnum STAT_MISC;
}
enum EScrap
{
Scrap6 = 0,

View file

@ -3,8 +3,6 @@ class DukeShell : DukeActor
{
default
{
shade -8;
statnum STAT_MISC;
spriteset "SHELL", "SHELL1";
}
@ -49,6 +47,8 @@ class DukeShell : DukeActor
double scale = Raze.isRR() && isshell ? 0.03125 : 0.0625;
self.scale = (scale, scale);
}
self.shade = -8;
self.ChangeStat(STAT_MISC);
}
override void Initialize()

View file

@ -2,11 +2,6 @@
class DukeSoundController : DukeActor
{
default
{
statnum STAT_FX;
}
override void Initialize()
{
if (ud.multimode < 2 && self.pal == 1)
@ -16,6 +11,7 @@ class DukeSoundController : DukeActor
return;
}
self.cstat = CSTAT_SPRITE_INVISIBLE;
self.ChangeStat(STAT_FX);
}
override void Tick()

View file

@ -3,7 +3,6 @@ class DukeTongue : DukeActor
{
default
{
statnum STAT_PROJECTILE;
pic "TONGUE";
}
@ -14,6 +13,7 @@ class DukeTongue : DukeActor
self.pos.Z -= gs.playerheight;
self.vel.Z = 1 - frandom(0, 2);
self.vel.X = 4 - frandom(0, 8);
self.ChangeStat(STAT_PROJECTILE);
}
override void Tick()
@ -65,7 +65,6 @@ class DukeInnerJaw : DukeActor
{
default
{
statnum STAT_MISC;
pic "InnerJaw";
}
@ -86,6 +85,7 @@ class DukeInnerJaw : DukeActor
{
self.Destroy();
}
self.ChangeStat(STAT_MISC);
}
}

View file

@ -1,11 +1,6 @@
class DukeTouchPlate : DukeActor
{
default
{
statnum STAT_STANDABLE;
}
private bool checkspawn()
{
if (!Raze.isWorldTour())
@ -36,6 +31,7 @@ class DukeTouchPlate : DukeActor
return;
}
self.cstat = CSTAT_SPRITE_INVISIBLE;
self.ChangeStat(STAT_STANDABLE);
}

View file

@ -2,15 +2,14 @@ class DukeTrash : DukeActor
{
default
{
ScaleX 0.375;
ScaleY 0.375;
statnum STAT_STANDABLE;
pic "TRASH";
}
override void Initialize()
{
self.Scale = (0.375, 0.375);
self.angle = frandom(0, 360);
self.ChangeStat(STAT_STANDABLE);
}
override void Tick()

View file

@ -224,7 +224,6 @@ class DukeLaserLine : DukeActor
{
default
{
statnum STAT_MISC;
pic "LASERLINE";
}

View file

@ -2,9 +2,6 @@ class DukeViewscreen : DukeActor
{
default
{
lotag 1;
extra 1;
statnum STAT_STANDABLE;
spriteset "VIEWSCREEN", "STATIC", "VIEWSCR";
}
@ -13,6 +10,9 @@ class DukeViewscreen : DukeActor
override void Initialize()
{
self.ownerActor = self;
self.lotag = 1;
self.extra = 1;
self.ChangeStat(STAT_STANDABLE);
}
override void Tick()
@ -93,8 +93,6 @@ class DukeCamera : DukeActor
default
{
pic "CAMERA1";
statnum STAT_ACTOR;
extra 1;
}
override void Initialize()
@ -109,6 +107,8 @@ class DukeCamera : DukeActor
return;
}
else self.pal = 0;
self.extra = 1;
self.ChangeStat(STAT_ACTOR);
}
override void Tick()

View file

@ -2,9 +2,6 @@ class DukeWaterDrip : DukeActor
{
default
{
ScaleX 0.375;
ScaleY 0.375;
statnum STAT_STANDABLE;
pic "WATERDRIP";
}
@ -30,6 +27,8 @@ class DukeWaterDrip : DukeActor
self.temp_pos.Z = self.pos.Z;
self.temp_data[1] = random(0, 127);
}
self.Scale = (0.375, 0.375);
self.ChangeStat(STAT_STANDABLE);
}
override void Tick()

View file

@ -6,7 +6,6 @@ class DukeWaterFountain : DukeActor
default
{
spriteset "WATERFOUNTAIN", "WATERFOUNTAIN1", "WATERFOUNTAIN2", "WATERFOUNTAIN3", "WATERFOUNTAINBROKE";
statnum STAT_STANDABLE;
}
//---------------------------------------------------------------------------
@ -21,6 +20,7 @@ class DukeWaterFountain : DukeActor
self.lotag = 1;
self.cstat = CSTAT_SPRITE_BLOCK_ALL; // Make it hitable
self.extra = 1;
self.ChangeStat(STAT_STANDABLE);
}
override void Tick()
@ -99,7 +99,11 @@ class DukeWaterFountainBroke : DukeActor
default
{
pic "WATERFOUNTAINBROKE";
statnum STAT_STANDABLE;
}
override void Initialize()
{
self.ChangeStat(STAT_STANDABLE);
}
override void onHit(DukeActor hitter)

View file

@ -2,8 +2,6 @@ class DukeWatersplash : DukeActor
{
default
{
shade -16;
statnum STAT_MISC;
spriteset "WATERSPLASH2", "WATERSPLASH2A", "WATERSPLASH2B", "WATERSPLASH2C", "WATERSPLASH2D";
}
@ -23,6 +21,7 @@ class DukeWatersplash : DukeActor
self.scale = (s, s);
}
self.shade = -16;
self.cstat |= CSTAT_SPRITE_YCENTER;
if (Owner)
{