- disabled property-type definition of spritetype members.

As it turned out this is simply too dangerous - these should be left to be loaded from the map data or set manually.
All remaining setups using this feature have either been moved to Initialize or other meta properties that are not affected by map loading.
This commit is contained in:
Christoph Oelckers 2023-01-08 16:38:30 +01:00
parent b48dad46f3
commit deaec2d91d
10 changed files with 60 additions and 236 deletions

View file

@ -15,24 +15,6 @@ enum EDefaultFlags
{ {
DEFF_PICNUM = 1, DEFF_PICNUM = 1,
DEFF_STATNUM = 2, DEFF_STATNUM = 2,
DEFF_ANG = 4,
DEFF_XVEL = 8,
DEFF_YVEL = 16,
DEFF_ZVEL = 32,
DEFF_HITAG = 64,
DEFF_LOTAG = 128,
DEFF_EXTRA = 256,
DEFF_DETAIL = 512,
DEFF_SHADE = 1024,
DEFF_PAL = 2048,
DEFF_CLIPDIST = 8192,
DEFF_BLEND = 16384,
DEFF_XREPEAT = 32768,
DEFF_YREPEAT = 65536,
DEFF_XOFFSET = 0x20000,
DEFF_YOFFSET = 0x40000,
DEFF_OWNER = 0x80000,
DEFF_INTANG = 0x100000
}; };
struct FActorInfo struct FActorInfo

View file

@ -375,33 +375,33 @@ void DCoreActor::initFromSprite(spritetype* mspr)
spr.cstat = (mspr->cstat & ~ESpriteFlags::FromInt(actorinfo->DefaultCstat)) | (spr.cstat & ESpriteFlags::FromInt(actorinfo->DefaultCstat)); spr.cstat = (mspr->cstat & ~ESpriteFlags::FromInt(actorinfo->DefaultCstat)) | (spr.cstat & ESpriteFlags::FromInt(actorinfo->DefaultCstat));
spr.pos = mspr->pos; spr.pos = mspr->pos;
spr.sectp = mspr->sectp; spr.sectp = mspr->sectp;
spr.clipdist = mspr->clipdist; // this has no associated property because it is needed for initialization of the real clipdist. spr.clipdist = mspr->clipdist;
// only copy those values which have not been defaulted by the class definition. // picnum may only be used if the class allows it.
#define setter(flag, var) if (!(actorinfo->DefaultFlags & flag)) spr.var = mspr->var; if (!(actorinfo->DefaultFlags & DEFF_PICNUM)) spr.picnum = mspr->picnum;
setter(DEFF_PICNUM, picnum); #define setter(var) spr.var = mspr->var;
setter(DEFF_ANG, Angles.Yaw);
setter(DEFF_INTANG, intangle); setter(Angles.Yaw);
setter(DEFF_XVEL, xint); setter(intangle);
setter(DEFF_YVEL, yint); setter(xint);
setter(DEFF_ZVEL, inittype); setter(yint);
setter(DEFF_HITAG, hitag); setter(inittype);
setter(DEFF_LOTAG, lotag); setter(hitag);
setter(DEFF_EXTRA, extra); setter(lotag);
setter(DEFF_DETAIL, detail); setter(extra);
setter(DEFF_SHADE, shade); setter(detail);
setter(DEFF_PAL, pal); setter(shade);
setter(DEFF_BLEND, blend); setter(pal);
setter(DEFF_XREPEAT, scale.X); setter(blend);
setter(DEFF_YREPEAT, scale.Y); setter(scale);
setter(DEFF_XOFFSET, xoffset); setter(xoffset);
setter(DEFF_YOFFSET, yoffset); setter(yoffset);
setter(DEFF_OWNER, intowner); setter(intowner);
#undef setter #undef setter
if (!(actorinfo->DefaultFlags & DEFF_CLIPDIST)) clipdist = spr.clipdist * 0.25; clipdist = spr.clipdist * 0.25;
if (mspr->statnum != 0 && !(actorinfo->DefaultFlags & DEFF_STATNUM)) if (mspr->statnum != 0 && !(actorinfo->DefaultFlags & DEFF_STATNUM))
ChangeActorStat(this, mspr->statnum); ChangeActorStat(this, mspr->statnum);
} }

View file

@ -329,176 +329,6 @@ DEFINE_PROPERTY(statnum, I, CoreActor)
bag.Info->ActorInfo()->DefaultFlags |= DEFF_STATNUM; bag.Info->ActorInfo()->DefaultFlags |= DEFF_STATNUM;
} }
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(angle, F, CoreActor)
{
PROP_INT_PARM(i, 0);
defaults->spr.Angles.Yaw = DAngle::fromDeg(i);
bag.Info->ActorInfo()->DefaultFlags |= DEFF_ANG;
}
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(intangle, I, CoreActor)
{
PROP_INT_PARM(i, 0);
defaults->spr.intangle = i;
bag.Info->ActorInfo()->DefaultFlags |= DEFF_INTANG;
}
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(xint, I, CoreActor)
{
PROP_INT_PARM(i, 0);
defaults->spr.xint = i;
bag.Info->ActorInfo()->DefaultFlags |= DEFF_XVEL;
}
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(yint, I, CoreActor)
{
PROP_INT_PARM(i, 0);
defaults->spr.yint = i;
bag.Info->ActorInfo()->DefaultFlags |= DEFF_YVEL;
}
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(inittype, I, CoreActor)
{
PROP_INT_PARM(i, 0);
defaults->spr.inittype = i;
bag.Info->ActorInfo()->DefaultFlags |= DEFF_ZVEL;
}
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(lotag, I, CoreActor)
{
PROP_INT_PARM(i, 0);
defaults->spr.lotag = i;
bag.Info->ActorInfo()->DefaultFlags |= DEFF_LOTAG;
}
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(hitag, I, CoreActor)
{
PROP_INT_PARM(i, 0);
defaults->spr.lotag = i;
bag.Info->ActorInfo()->DefaultFlags |= DEFF_HITAG;
}
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(extra, I, CoreActor)
{
PROP_INT_PARM(i, 0);
defaults->spr.lotag = i;
bag.Info->ActorInfo()->DefaultFlags |= DEFF_EXTRA;
}
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(detail, I, CoreActor)
{
PROP_INT_PARM(i, 0);
defaults->spr.detail = i;
bag.Info->ActorInfo()->DefaultFlags |= DEFF_DETAIL;
}
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(shade, I, CoreActor)
{
PROP_INT_PARM(i, 0);
defaults->spr.shade = i;
bag.Info->ActorInfo()->DefaultFlags |= DEFF_SHADE;
}
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(pal, I, CoreActor)
{
PROP_INT_PARM(i, 0);
defaults->spr.pal = i;
bag.Info->ActorInfo()->DefaultFlags |= DEFF_PAL;
}
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(clipdist, F, CoreActor)
{
PROP_FLOAT_PARM(i, 0);
defaults->clipdist = i;
bag.Info->ActorInfo()->DefaultFlags |= DEFF_CLIPDIST;
}
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(scalex, F, CoreActor)
{
PROP_FLOAT_PARM(i, 0);
defaults->spr.scale.X = i;
bag.Info->ActorInfo()->DefaultFlags |= DEFF_XREPEAT;
}
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(scaley, F, CoreActor)
{
PROP_FLOAT_PARM(i, 0);
defaults->spr.scale.Y = i;
bag.Info->ActorInfo()->DefaultFlags |= DEFF_YREPEAT;
}
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(xoffset, I, CoreActor)
{
PROP_INT_PARM(i, 0);
defaults->spr.xoffset = i;
bag.Info->ActorInfo()->DefaultFlags |= DEFF_XOFFSET;
}
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(yoffset, I, CoreActor)
{
PROP_INT_PARM(i, 0);
defaults->spr.yoffset = i;
bag.Info->ActorInfo()->DefaultFlags |= DEFF_YOFFSET;
}
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(owner, I, CoreActor)
{
PROP_INT_PARM(i, 0);
defaults->spr.intowner = i;
bag.Info->ActorInfo()->DefaultFlags |= DEFF_OWNER;
}
//========================================================================== //==========================================================================
// //
//========================================================================== //==========================================================================

View file

@ -2,10 +2,13 @@ class RedneckBowlingPin : DukeActor
{ {
default default
{ {
detail 0; RedneckBowlingPin.Behavior 0;
spriteset "BOWLINGPIN", "BOWLINGPIN1"; spriteset "BOWLINGPIN", "BOWLINGPIN1";
} }
meta int behavior;
property behavior: behavior;
override void Initialize() override void Initialize()
{ {
self.cstat |= CSTAT_SPRITE_BLOCK_ALL; self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
@ -83,14 +86,14 @@ class RedneckBowlingPin : DukeActor
let targ = RedneckBowlingPin(targa); let targ = RedneckBowlingPin(targa);
if (!targ) return; if (!targ) return;
if (targ.detail == 0) if (targ.behavior == 0)
{ {
self.vel.X *= 0.75; self.vel.X *= 0.75;
self.angle -= targ.angle * 2 + frandom(0, 11.25); self.angle -= targ.angle * 2 + frandom(0, 11.25);
targ.angle += frandom(0, 22.5 / 8); targ.angle += frandom(0, 22.5 / 8);
targ.PlayActorSound("BOWLPIN"); targ.PlayActorSound("BOWLPIN");
} }
else if (targ.detail == 1) else if (targ.behavior == 1)
{ {
self.vel.X *= 0.75; self.vel.X *= 0.75;
self.angle -= targ.angle * 2 + frandom(0, 22.5 / 8); self.angle -= targ.angle * 2 + frandom(0, 22.5 / 8);
@ -115,7 +118,7 @@ class RedneckHenstand : RedneckBowlingPin
default default
{ {
spriteset "HENSTAND", "HENSTAND1"; spriteset "HENSTAND", "HENSTAND1";
detail 1; RedneckBowlingPin.Behavior 1;
} }
override void Initialize() override void Initialize()
@ -144,7 +147,7 @@ class RedneckBowlingBall : RedneckBowlingPin
default default
{ {
pic "BOWLINGBALL"; pic "BOWLINGBALL";
detail 2; RedneckBowlingPin.Behavior 2;
} }
override void Initialize() override void Initialize()

View file

@ -3,15 +3,15 @@ class DukeGreenSlime : DukeActor
default default
{ {
spriteset "GREENSLIME", "GREENSLIME1", "GREENSLIME2", "GREENSLIME3", "GREENSLIME4", "GREENSLIME5", "GREENSLIME6", "GREENSLIME7"; spriteset "GREENSLIME", "GREENSLIME1", "GREENSLIME2", "GREENSLIME3", "GREENSLIME4", "GREENSLIME5", "GREENSLIME6", "GREENSLIME7";
scaleX 0.625;
scaleY 0.625;
clipdist 20;
extra 1;
} }
override void Initialize() override void Initialize()
{ {
commonEnemySetup(); commonEnemySetup();
self.scale = (0.625, 0.625);
self.clipdist = 20;
self.extra = 1;
} }
override void PlayFTASound() override void PlayFTASound()

View file

@ -4,7 +4,6 @@ class DukePipeBomb : DukeActor
default default
{ {
pic "HEAVYHBOMB"; pic "HEAVYHBOMB";
detail 3; // ceiling distance
// do not add anything here! // do not add anything here!
} }
@ -226,7 +225,6 @@ class RedneckDynamite : DukePipeBomb
default default
{ {
pic "DYNAMITE"; pic "DYNAMITE";
detail 16;
} }
override void pickupCheck(DukePlayer p) override void pickupCheck(DukePlayer p)

View file

@ -49,10 +49,15 @@ class DukeJibs1 : DukeActor
{ {
default default
{ {
DukeJibs1.Behavior 0;
statnum STAT_MISC; statnum STAT_MISC;
spriteset "JIBS1", "JIBS6", "JIBS6A", "JIBS6B", "JIBS6C", "JIBS6D", "JIBS6E", "JIBS6F", "JIBS6G"; spriteset "JIBS1", "JIBS6", "JIBS6A", "JIBS6B", "JIBS6C", "JIBS6D", "JIBS6E", "JIBS6F", "JIBS6G";
} }
meta int behavior;
property behavior: behavior;
override void Tick() override void Tick()
{ {
if(self.vel.X > 0) self.vel.X -= 1/16.; if(self.vel.X > 0) self.vel.X -= 1/16.;
@ -94,7 +99,7 @@ class DukeJibs1 : DukeActor
else if (sectp.lotag != 2) else if (sectp.lotag != 2)
{ {
self.temp_data[1] = 0; self.temp_data[1] = 0;
if (detail == 1) if (self.behavior == 1)
{ {
if (self.temp_data[0] > 6) self.temp_data[0] = 0; if (self.temp_data[0] > 6) self.temp_data[0] = 0;
else self.temp_data[0]++; else self.temp_data[0]++;
@ -129,7 +134,7 @@ class DukeJibs1 : DukeActor
} }
else else
{ {
if (self.detail == 2) // cactus debris only if (self.behavior == 2) // cactus debris only
{ {
self.Destroy(); self.Destroy();
return; return;
@ -317,7 +322,7 @@ class DukePlayerTorso : DukeJibs1
default default
{ {
pic "DUKETORSO"; pic "DUKETORSO";
detail 1; DukeJibs1.Behavior 1;
} }
} }
@ -596,7 +601,7 @@ class RedneckCactusDebris1 : DukeJibs1
default default
{ {
pic "CACTUSDEBRIS1"; pic "CACTUSDEBRIS1";
detail 2; DukeJibs1.Behavior 2;
} }
} }

View file

@ -3,9 +3,12 @@ class DukeMortar : DukeActor
default default
{ {
pic "MORTAR"; pic "MORTAR";
detail 3; DukeMortar.ceilingdist 3;
} }
meta int ceilingdist;
property ceilingdist: ceilingdist;
override void Tick() override void Tick()
{ {
let spawned = self.spawn("DukeFrameEffect"); let spawned = self.spawn("DukeFrameEffect");
@ -61,9 +64,9 @@ class DukeMortar : DukeActor
self.vel.Z *= 0.25; self.vel.Z *= 0.25;
self.yint++; self.yint++;
} }
if (itemmode != 2 && self.pos.Z < self.ceilingz + self.detail && (!Raze.isRR() || sectp.lotag != ST_2_UNDERWATER)) // underwater check only for RR if (itemmode != 2 && self.pos.Z < self.ceilingz + self.ceilingdist && (!Raze.isRR() || sectp.lotag != ST_2_UNDERWATER)) // underwater check only for RR
{ {
self.pos.Z = self.ceilingz + self.detail; self.pos.Z = self.ceilingz + self.ceilingdist;
self.vel.Z = 0; self.vel.Z = 0;
} }
} }
@ -184,7 +187,7 @@ class RedneckMortar : DukeMortar
default default
{ {
pic "MORTAR"; pic "MORTAR";
detail 16; DukeMortar.ceilingdist 16;
} }
override void Tick() override void Tick()
@ -199,7 +202,7 @@ class RedneckCheerBomb : DukeMortar
default default
{ {
spriteset "CHEERBOMB", "CHEERBOMB1", "CHEERBOMB2", "CHEERBOMB3"; spriteset "CHEERBOMB", "CHEERBOMB1", "CHEERBOMB2", "CHEERBOMB3";
detail 16; DukeMortar.ceilingdist 16;
} }
override bool Animate(tspritetype t) override bool Animate(tspritetype t)

View file

@ -247,9 +247,6 @@ class RedneckUFO1 : DukeRecon
default default
{ {
Pic "UFO1_RR"; Pic "UFO1_RR";
ScaleX 0.5;
ScaleY 0.5;
Extra 50;
} }
override void Initialize() override void Initialize()
@ -259,6 +256,9 @@ class RedneckUFO1 : DukeRecon
RoamSnd = "UFOLET"; RoamSnd = "UFOLET";
shift = 1; shift = 1;
SpawnType = "RedneckHen"; SpawnType = "RedneckHen";
self.Scale = (0.5, 0.5);
self.Extra = 50;
self.setClipDistFromTile(); self.setClipDistFromTile();
} }

View file

@ -42,8 +42,11 @@ class RedneckRespawnMarker : DukeRespawnMarker
{ {
spriteset "RESPAWNMARKER1", "RESPAWNMARKER2", "RESPAWNMARKER3", "RESPAWNMARKER4", "RESPAWNMARKER5", "RESPAWNMARKERRED", "RESPAWNMARKER7", spriteset "RESPAWNMARKER1", "RESPAWNMARKER2", "RESPAWNMARKER3", "RESPAWNMARKER4", "RESPAWNMARKER5", "RESPAWNMARKERRED", "RESPAWNMARKER7",
"RESPAWNMARKER8", "RESPAWNMARKER9", "RESPAWNMARKER10", "RESPAWNMARKER11", "RESPAWNMARKER12", "RESPAWNMARKER13", "RESPAWNMARKER14"; "RESPAWNMARKER8", "RESPAWNMARKER9", "RESPAWNMARKER10", "RESPAWNMARKER11", "RESPAWNMARKER12", "RESPAWNMARKER13", "RESPAWNMARKER14";
scalex 0.125; }
scaley 0.125;
override void Initialize()
{
self.scale = (0.125, 0.125);
} }
override bool Animate(tspritetype t) override bool Animate(tspritetype t)