mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-23 17:31:14 +00:00
- Duke: look up all internally used actor classes at game startup.
This allows early validation of the names but is also more efficient.
This commit is contained in:
parent
36d5ab74bb
commit
65e66a573d
20 changed files with 248 additions and 214 deletions
|
@ -11,85 +11,6 @@ xx(RazeStatusBar)
|
|||
xx(zoomsize)
|
||||
xx(AltHud)
|
||||
|
||||
// internal Duke actor classes that need direct checking
|
||||
xx(DukeMasterSwitch)
|
||||
xx(DukeTouchplate)
|
||||
xx(DukeSoundController)
|
||||
xx(DukeRespawnController)
|
||||
xx(DukeActivator)
|
||||
xx(DukeActivatorLocked)
|
||||
xx(DukeLocator)
|
||||
xx(DukeGenericDestructible)
|
||||
xx(DukeGlassPieces)
|
||||
xx(DukeGlassPieces1)
|
||||
xx(DukeGlassPieces2)
|
||||
xx(DukeNaturalLightning)
|
||||
xx(RedneckBowlingPin)
|
||||
xx(DukeReactor)
|
||||
xx(DukeFootprints)
|
||||
xx(RedneckMinecartDef)
|
||||
xx(RedneckMinecartSound)
|
||||
xx(RedneckMinecartInner)
|
||||
xx(RedneckJaildoorDef)
|
||||
xx(RedneckJaildoorSound)
|
||||
xx(RedneckGeometryEffect)
|
||||
xx(RedneckKeyinfoSetter)
|
||||
xx(DukeSectorEffector)
|
||||
xx(RedneckGoogooCluster)
|
||||
xx(DukeAtomicHealth)
|
||||
xx(RedneckHen)
|
||||
xx(DukeSmallSmoke)
|
||||
xx(DukeExplosion2)
|
||||
xx(DukeWaterBubble)
|
||||
xx(DukeMoney)
|
||||
xx(DukeMail)
|
||||
xx(DukePaper)
|
||||
xx(RedneckFeather)
|
||||
xx(DukeSteamBase)
|
||||
xx(RedneckFire)
|
||||
xx(DukePlayerOnWater)
|
||||
xx(RedneckBillyRay)
|
||||
xx(RedneckBiker)
|
||||
xx(RedneckCheerleader)
|
||||
xx(DukeShotSpark)
|
||||
xx(DukeJibs6)
|
||||
xx(RedneckMotoHit)
|
||||
xx(DukeFlamethrowerFlame)
|
||||
xx(DukeShrinkSpark)
|
||||
xx(DukeFirefly)
|
||||
xx(DukeFireball)
|
||||
xx(DukeBloodSplat3)
|
||||
xx(DukeBloodSplat1)
|
||||
xx(DukeBloodSplat2)
|
||||
xx(DukeBloodSplat4)
|
||||
xx(DukeBloodPool)
|
||||
xx(DukeFirelaser)
|
||||
xx(RedneckFirelaser)
|
||||
xx(DukeMeleeAttack)
|
||||
xx(DukeFirstgunSprite)
|
||||
xx(DukeShotgunSprite)
|
||||
xx(DukeChaingunSprite)
|
||||
xx(DukeRPGSprite)
|
||||
xx(DukePipeBomb)
|
||||
xx(DukeShrinkerSprite)
|
||||
xx(DukeDevastatorSprite)
|
||||
xx(DukeTripBombSprite)
|
||||
xx(DukeFreezeSprite)
|
||||
xx(DukeTransporterBeam)
|
||||
xx(DukeWaterSplash)
|
||||
xx(DukeShell)
|
||||
xx(DukeShotgunShell)
|
||||
xx(DukeRPG)
|
||||
xx(RedneckDynamiteArrow)
|
||||
xx(RedneckHulk)
|
||||
xx(RedneckPig)
|
||||
xx(RedneckMinion)
|
||||
xx(RedneckVixen)
|
||||
xx(RedneckRabbit)
|
||||
xx(RedneckDoorkey)
|
||||
xx(RedneckEmptyBike)
|
||||
xx(RedneckEmptyBoat)
|
||||
|
||||
xx(spawnstate)
|
||||
xx(brokenstate)
|
||||
xx(breaksound)
|
||||
|
@ -100,4 +21,4 @@ xx(falladjustz)
|
|||
xx(aimoffset)
|
||||
xx(strength)
|
||||
xx(autoaimangle)
|
||||
xx(shootzoffset)
|
||||
xx(shootzoffset)
|
||||
|
|
|
@ -153,7 +153,7 @@ void RANDOMSCRAP(DDukeActor* origin)
|
|||
auto vel = krandf(4) + 4;
|
||||
auto zvel = -krandf(8) - 2;
|
||||
|
||||
auto spawned = CreateActor(origin->sector(), origin->spr.pos + offset, PClass::FindActor("DukeScrap"), -8, DVector2(v, v), a, vel, zvel, origin, STAT_MISC);
|
||||
auto spawned = CreateActor(origin->sector(), origin->spr.pos + offset, DukeScrapClass, -8, DVector2(v, v), a, vel, zvel, origin, STAT_MISC);
|
||||
if (spawned)
|
||||
{
|
||||
spawned->spriteextra = (r4 & 15);
|
||||
|
@ -624,7 +624,7 @@ void movefallers(void)
|
|||
{
|
||||
a2->counter = 1;
|
||||
a2->spr.cstat &= ~CSTAT_SPRITE_ONE_SIDE;
|
||||
if (a2->IsKindOf(NAME_DukeSteamBase))
|
||||
if (a2->IsKindOf(DukeSteamBaseClass))
|
||||
a2->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
}
|
||||
}
|
||||
|
@ -1173,7 +1173,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, PClassActor* RPG)
|
|||
updatesector(a2->spr.pos, &k);
|
||||
if (a2->spr.extra >= 0 && k == actor->sector())
|
||||
{
|
||||
gutsdir(a2, PClass::FindActor(NAME_DukeJibs6), 72, myconnectindex);
|
||||
gutsdir(a2, DukeJibs6Class, 72, myconnectindex);
|
||||
S_PlayActorSound(SQUISHED, actor);
|
||||
a2->Destroy();
|
||||
}
|
||||
|
@ -1333,7 +1333,7 @@ void handle_se30(DDukeActor *actor)
|
|||
updatesector(a2->spr.pos, &k);
|
||||
if (a2->spr.extra >= 0 && k == actor->sector())
|
||||
{
|
||||
gutsdir(a2, PClass::FindActor(NAME_DukeJibs6), 24, myconnectindex);
|
||||
gutsdir(a2, DukeJibs6Class, 24, myconnectindex);
|
||||
S_PlayActorSound(SQUISHED, a2);
|
||||
a2->Destroy();
|
||||
}
|
||||
|
@ -1541,7 +1541,7 @@ void handle_se05(DDukeActor* actor)
|
|||
{
|
||||
auto ang = actor->spr.Angles.Yaw;
|
||||
actor->spr.Angles.Yaw = (actor->spr.pos.XY() - ps[p].GetActor()->spr.pos.XY()).Angle();
|
||||
shoot(actor, -1, PClass::FindActor(isRR()? NAME_RedneckFirelaser : NAME_DukeFirelaser));
|
||||
shoot(actor, -1, isRR()? RedneckFirelaserClass : DukeFirelaserClass);
|
||||
actor->spr.Angles.Yaw = ang;
|
||||
}
|
||||
|
||||
|
@ -2014,7 +2014,7 @@ void handle_se16(DDukeActor* actor)
|
|||
DDukeActor* a2;
|
||||
while ((a2 = it.Next()))
|
||||
{
|
||||
if (a2->IsKindOf(NAME_DukeReactor) && a2->spritesetindex == 0)
|
||||
if (a2->IsKindOf(DukeReactorClass) && a2->spritesetindex == 0)
|
||||
return;
|
||||
}
|
||||
if (a2 == nullptr)
|
||||
|
@ -2765,14 +2765,14 @@ void handle_se35(DDukeActor *actor)
|
|||
for (int j = 0; j < 8; j++)
|
||||
{
|
||||
actor->spr.Angles.Yaw = randomAngle(90);
|
||||
auto spawned = spawn(actor, PClass::FindActor(NAME_DukeSmallSmoke));
|
||||
auto spawned = spawn(actor, DukeSmallSmokeClass);
|
||||
if (spawned)
|
||||
{
|
||||
spawned->vel.X = 6 + krandf(8);
|
||||
ssp(spawned, CLIPMASK0);
|
||||
SetActor(spawned, spawned->spr.pos);
|
||||
if (rnd(16))
|
||||
spawn(actor, PClass::FindActor(NAME_DukeExplosion2));
|
||||
spawn(actor, DukeExplosion2Class);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2859,7 +2859,7 @@ void handle_se130(DDukeActor *actor, int countmax)
|
|||
|
||||
if (rnd(64))
|
||||
{
|
||||
auto k = spawn(actor, PClass::FindActor(NAME_DukeExplosion2));
|
||||
auto k = spawn(actor, DukeExplosion2Class);
|
||||
if (k)
|
||||
{
|
||||
double s = 0.03125 + (krand() & 7) * REPEAT_SCALE;
|
||||
|
@ -3373,20 +3373,20 @@ void fall_common(DDukeActor *actor, int playernum, int DRONE, int(*fallspecial)(
|
|||
goto SKIPJIBS;
|
||||
if (sphit)
|
||||
{
|
||||
spawnguts(actor, PClass::FindActor(NAME_DukeJibs6), 5);
|
||||
spawnguts(actor, DukeJibs6Class, 5);
|
||||
S_PlayActorSound(SQUISHED, actor);
|
||||
}
|
||||
else
|
||||
{
|
||||
spawnguts(actor, PClass::FindActor(NAME_DukeJibs6), 15);
|
||||
spawnguts(actor, DukeJibs6Class, 15);
|
||||
S_PlayActorSound(SQUISHED, actor);
|
||||
spawn(actor, PClass::FindActor(NAME_DukeBloodPool));
|
||||
spawn(actor, DukeBloodPoolClass);
|
||||
}
|
||||
}
|
||||
|
||||
SKIPJIBS:
|
||||
|
||||
actor->attackertype = PClass::FindActor(NAME_DukeShotSpark);
|
||||
actor->attackertype = DukeShotSparkClass;
|
||||
actor->hitextra = 1;
|
||||
actor->vel.Z = 0;
|
||||
}
|
||||
|
@ -3586,7 +3586,7 @@ void spawndebris(DDukeActor* g_ac, int dnum, int count)
|
|||
auto zvel = -krandf(8);
|
||||
DVector2 scale(0.5 + (krand() & 15) * REPEAT_SCALE, 0.5 + (krand() & 15) * REPEAT_SCALE);
|
||||
|
||||
auto spawned = CreateActor(g_ac->sector(), g_ac->spr.pos + offs, PClass::FindActor("DukeScrap"), g_ac->spr.shade, scale, a, vel, zvel, g_ac, STAT_MISC);
|
||||
auto spawned = CreateActor(g_ac->sector(), g_ac->spr.pos + offs, DukeScrapClass, g_ac->spr.shade, scale, a, vel, zvel, g_ac, STAT_MISC);
|
||||
if (spawned)
|
||||
{
|
||||
spawned->spriteextra = dnum + s;
|
||||
|
|
|
@ -131,7 +131,7 @@ int ifsquished(DDukeActor* actor, int p)
|
|||
|
||||
if (actor->spr.pal == 1)
|
||||
{
|
||||
actor->attackertype = PClass::FindActor(NAME_DukeShotSpark);
|
||||
actor->attackertype = DukeShotSparkClass;
|
||||
actor->hitextra = 1;
|
||||
return false;
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ void hitradius_d(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
|
|||
{
|
||||
int p = act2->spr.yint;
|
||||
|
||||
if (act2->attackertype->TypeName == NAME_DukeFlamethrowerFlame && Owner->isPlayer())
|
||||
if (act2->attackertype == DukeFlamethrowerFlameClass && Owner->isPlayer())
|
||||
{
|
||||
ps[p].numloogs = -1 - actor->spr.yint;
|
||||
}
|
||||
|
@ -386,17 +386,17 @@ int movesprite_ex_d(DDukeActor* actor, const DVector3& change, unsigned int clip
|
|||
|
||||
void lotsofmoney_d(DDukeActor *actor, int n)
|
||||
{
|
||||
lotsofstuff(actor, n, PClass::FindActor(NAME_DukeMoney));
|
||||
lotsofstuff(actor, n, DukeMoneyClass);
|
||||
}
|
||||
|
||||
void lotsofmail_d(DDukeActor *actor, int n)
|
||||
{
|
||||
lotsofstuff(actor, n, PClass::FindActor(NAME_DukeMail));
|
||||
lotsofstuff(actor, n, DukeMailClass);
|
||||
}
|
||||
|
||||
void lotsofpaper_d(DDukeActor *actor, int n)
|
||||
{
|
||||
lotsofstuff(actor, n, PClass::FindActor(NAME_DukePaper));
|
||||
lotsofstuff(actor, n, DukePaperClass);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -457,10 +457,10 @@ int ifhitbyweapon_d(DDukeActor *actor)
|
|||
else
|
||||
{
|
||||
if (actor->hitextra == 0)
|
||||
if (actor->attackertype->TypeName == NAME_DukeShrinkSpark && actor->spr.scale.X < 0.375)
|
||||
if (actor->attackertype == DukeShrinkSparkClass && actor->spr.scale.X < 0.375)
|
||||
return -1;
|
||||
|
||||
if (actor->attackertype->TypeName == NAME_DukeFirefly && actor->spr.scale.X < 0.75)
|
||||
if (actor->attackertype == DukeFireflyClass && actor->spr.scale.X < 0.75)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
@ -483,7 +483,7 @@ int ifhitbyweapon_d(DDukeActor *actor)
|
|||
|
||||
if (ud.multimode < 2
|
||||
|| actor->attackertype == nullptr
|
||||
|| actor->attackertype->TypeName != NAME_DukeFlamethrowerFlame
|
||||
|| actor->attackertype != DukeFlamethrowerFlameClass
|
||||
|| actor->hitextra >= 0
|
||||
|| actor->spr.extra > 0
|
||||
|| !actor->isPlayer()
|
||||
|
@ -557,7 +557,7 @@ void movetransports_d(void)
|
|||
{
|
||||
if (act->spr.pal == 0)
|
||||
{
|
||||
spawn(act, PClass::FindActor(NAME_DukeTransporterBeam));
|
||||
spawn(act, DukeTransporterBeamClass);
|
||||
S_PlayActorSound(TELEPORTER, act);
|
||||
}
|
||||
|
||||
|
@ -586,7 +586,7 @@ void movetransports_d(void)
|
|||
|
||||
if (act->spr.pal == 0)
|
||||
{
|
||||
auto k = spawn(Owner, PClass::FindActor(NAME_DukeTransporterBeam));
|
||||
auto k = spawn(Owner, DukeTransporterBeamClass);
|
||||
if (k) S_PlayActorSound(TELEPORTER, k);
|
||||
}
|
||||
|
||||
|
@ -667,12 +667,12 @@ void movetransports_d(void)
|
|||
SetActor(act2, act2->spr.pos);
|
||||
|
||||
if ((krand() & 255) < 32)
|
||||
spawn(act2, PClass::FindActor(NAME_DukeWaterSplash));
|
||||
spawn(act2, DukeWaterSplashClass);
|
||||
|
||||
if (sectlotag == 1)
|
||||
for (int l = 0; l < 9; l++)
|
||||
{
|
||||
auto q = spawn(ps[p].GetActor(), PClass::FindActor(NAME_DukeWaterBubble));
|
||||
auto q = spawn(ps[p].GetActor(), DukeWaterBubbleClass);
|
||||
if (q) q->spr.pos.Z += krandf(64);
|
||||
}
|
||||
}
|
||||
|
@ -729,7 +729,7 @@ void movetransports_d(void)
|
|||
|
||||
if (sectlotag > 0)
|
||||
{
|
||||
auto k = spawn(act2, PClass::FindActor(NAME_DukeWaterSplash));
|
||||
auto k = spawn(act2, DukeWaterSplashClass);
|
||||
if (k && sectlotag == 1 && act2->spr.statnum == 4)
|
||||
{
|
||||
k->vel.X = act2->vel.X * 0.5;
|
||||
|
@ -752,10 +752,10 @@ void movetransports_d(void)
|
|||
|
||||
if (act->spr.pal == 0)
|
||||
{
|
||||
auto k = spawn(act, PClass::FindActor(NAME_DukeTransporterBeam));
|
||||
auto k = spawn(act, DukeTransporterBeamClass);
|
||||
if (k) S_PlayActorSound(TELEPORTER, k);
|
||||
|
||||
k = spawn(Owner, PClass::FindActor(NAME_DukeTransporterBeam));
|
||||
k = spawn(Owner, DukeTransporterBeamClass);
|
||||
if (k) S_PlayActorSound(TELEPORTER, k);
|
||||
}
|
||||
|
||||
|
@ -850,7 +850,7 @@ void handle_se06_d(DDukeActor* actor)
|
|||
act2->temp_data[4] = actor->temp_data[4];
|
||||
}
|
||||
}
|
||||
handle_se14(actor, true, PClass::FindActor(NAME_DukeRPG));
|
||||
handle_se14(actor, true, DukeRPGClass);
|
||||
}
|
||||
|
||||
|
||||
|
@ -896,7 +896,7 @@ static void handle_se28(DDukeActor* actor)
|
|||
DukeStatIterator it(STAT_DEFAULT);
|
||||
while (auto act2 = it.Next())
|
||||
{
|
||||
if (act2->GetClass()->TypeName == NAME_DukeNaturalLightning && act2->spr.hitag == actor->spr.hitag)
|
||||
if (act2->GetClass() == DukeNaturalLightningClass && act2->spr.hitag == actor->spr.hitag)
|
||||
act2->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
}
|
||||
}
|
||||
|
@ -913,12 +913,12 @@ static void handle_se28(DDukeActor* actor)
|
|||
DukeStatIterator it(STAT_DEFAULT);
|
||||
while (auto act2 = it.Next())
|
||||
{
|
||||
if (act2->GetClass()->TypeName == NAME_DukeNaturalLightning && act2->spr.hitag == actor->spr.hitag)
|
||||
if (act2->GetClass() == DukeNaturalLightningClass && act2->spr.hitag == actor->spr.hitag)
|
||||
{
|
||||
if (rnd(32) && (actor->temp_data[2] & 1))
|
||||
{
|
||||
act2->spr.cstat &= ~CSTAT_SPRITE_INVISIBLE;
|
||||
spawn(act2, PClass::FindActor(NAME_DukeSmallSmoke));
|
||||
spawn(act2, DukeSmallSmokeClass);
|
||||
|
||||
double x;
|
||||
int p = findplayer(actor, &x);
|
||||
|
@ -970,7 +970,7 @@ void moveeffectors_d(void) //STATNUM 3
|
|||
break;
|
||||
|
||||
case SE_14_SUBWAY_CAR:
|
||||
handle_se14(act, true, PClass::FindActor(NAME_DukeRPG));
|
||||
handle_se14(act, true, DukeRPGClass);
|
||||
break;
|
||||
|
||||
case SE_30_TWO_WAY_TRAIN:
|
||||
|
|
|
@ -351,7 +351,7 @@ int movesprite_ex_r(DDukeActor* actor, const DVector3& change, unsigned int clip
|
|||
|
||||
void lotsoffeathers_r(DDukeActor *actor, int n)
|
||||
{
|
||||
lotsofstuff(actor, n, PClass::FindActor(NAME_RedneckFeather));
|
||||
lotsofstuff(actor, n, RedneckFeatherClass);
|
||||
}
|
||||
|
||||
|
||||
|
@ -484,7 +484,7 @@ void movetransports_r(void)
|
|||
{
|
||||
if (ps[p].on_ground && sectlotag == 0 && onfloorz && ps[p].jetpack_on == 0)
|
||||
{
|
||||
spawn(act, PClass::FindActor(NAME_DukeTransporterBeam));
|
||||
spawn(act, DukeTransporterBeamClass);
|
||||
S_PlayActorSound(TELEPORTER, act);
|
||||
|
||||
for (k = connecthead; k >= 0; k = connectpoint2[k])
|
||||
|
@ -510,7 +510,7 @@ void movetransports_r(void)
|
|||
ChangeActorSect(act2, Owner->sector());
|
||||
ps[p].setCursector(act2->sector());
|
||||
|
||||
auto beam = spawn(Owner, PClass::FindActor(NAME_DukeTransporterBeam));
|
||||
auto beam = spawn(Owner, DukeTransporterBeamClass);
|
||||
if (beam) S_PlayActorSound(TELEPORTER, beam);
|
||||
|
||||
break;
|
||||
|
@ -598,7 +598,7 @@ void movetransports_r(void)
|
|||
ChangeActorSect(act2, Owner->sector());
|
||||
|
||||
if ((krand() & 255) < 32)
|
||||
spawn(ps[p].GetActor(), PClass::FindActor(NAME_DukeWaterSplash));
|
||||
spawn(ps[p].GetActor(), DukeWaterSplashClass);
|
||||
}
|
||||
else if (isRRRA() && k == 2)
|
||||
{
|
||||
|
@ -694,7 +694,7 @@ void movetransports_r(void)
|
|||
|
||||
if (sectlotag > 0)
|
||||
{
|
||||
auto spawned = spawn(act2, PClass::FindActor(NAME_DukeWaterSplash));
|
||||
auto spawned = spawn(act2, DukeWaterSplashClass);
|
||||
if (spawned && sectlotag == 1 && act2->spr.statnum == 4)
|
||||
{
|
||||
spawned->vel.X = act2->vel.X * 0.5;
|
||||
|
@ -715,10 +715,10 @@ void movetransports_r(void)
|
|||
|
||||
act2->backupang();
|
||||
|
||||
auto beam = spawn(act, PClass::FindActor(NAME_DukeTransporterBeam));
|
||||
auto beam = spawn(act, DukeTransporterBeamClass);
|
||||
if (beam) S_PlayActorSound(TELEPORTER, beam);
|
||||
|
||||
beam = spawn(Owner, PClass::FindActor(NAME_DukeTransporterBeam));
|
||||
beam = spawn(Owner, DukeTransporterBeamClass);
|
||||
if (beam) S_PlayActorSound(TELEPORTER, beam);
|
||||
|
||||
if (Owner->GetOwner() != Owner)
|
||||
|
@ -907,7 +907,7 @@ void handle_se06_r(DDukeActor *actor)
|
|||
if ((!isRRRA() || lastlevel) && hulkspawn)
|
||||
{
|
||||
hulkspawn--;
|
||||
auto ns = spawn(actor, PClass::FindActor(NAME_RedneckHulk));
|
||||
auto ns = spawn(actor, RedneckHulkClass);
|
||||
if (ns)
|
||||
{
|
||||
ns->spr.pos.Z = ns->sector()->ceilingz;
|
||||
|
@ -945,28 +945,28 @@ void handle_se06_r(DDukeActor *actor)
|
|||
{
|
||||
ufocnt = 0;
|
||||
ufospawn--;
|
||||
const char* pn;
|
||||
PClassActor* pn;
|
||||
if (!isRRRA())
|
||||
{
|
||||
switch (krand() & 3)
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
pn = "RedneckUfo1";
|
||||
pn = RedneckUfo1Class;
|
||||
break;
|
||||
case 1:
|
||||
pn = "RedneckUfo2";
|
||||
pn = RedneckUfo2Class;
|
||||
break;
|
||||
case 2:
|
||||
pn = "RedneckUfo3";
|
||||
pn = RedneckUfo3Class;
|
||||
break;
|
||||
case 3:
|
||||
pn = "RedneckUfo4";
|
||||
pn = RedneckUfo4Class;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else pn = "RedneckUfoRRRA";
|
||||
auto ns = spawn(actor, PClass::FindActor(pn));
|
||||
else pn = RedneckUfoRRRAClass;
|
||||
auto ns = spawn(actor, pn);
|
||||
if (ns) ns->spr.pos.Z = ns->sector()->ceilingz;
|
||||
}
|
||||
}
|
||||
|
@ -989,7 +989,7 @@ void handle_se06_r(DDukeActor *actor)
|
|||
act2->temp_data[4] = actor->temp_data[4];
|
||||
}
|
||||
}
|
||||
handle_se14(actor, false, PClass::FindActor(NAME_RedneckDynamiteArrow));
|
||||
handle_se14(actor, false, RedneckDynamiteArrowClass);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -1023,7 +1023,7 @@ void moveeffectors_r(void) //STATNUM 3
|
|||
break;
|
||||
|
||||
case SE_14_SUBWAY_CAR:
|
||||
handle_se14(act, false, PClass::FindActor(NAME_RedneckDynamiteArrow));
|
||||
handle_se14(act, false, RedneckDynamiteArrowClass);
|
||||
break;
|
||||
|
||||
case SE_30_TWO_WAY_TRAIN:
|
||||
|
@ -1493,16 +1493,16 @@ void fakebubbaspawn(DDukeActor *actor, player_struct* p)
|
|||
default:
|
||||
break;
|
||||
case 1:
|
||||
spawn(actor, PClass::FindActor(NAME_RedneckPig));
|
||||
spawn(actor, RedneckPigClass);
|
||||
break;
|
||||
case 2:
|
||||
spawn(actor, PClass::FindActor(NAME_RedneckMinion));
|
||||
spawn(actor, RedneckMinionClass);
|
||||
break;
|
||||
case 3:
|
||||
spawn(actor, PClass::FindActor(NAME_RedneckCheerleader));
|
||||
spawn(actor, RedneckCheerleaderClass);
|
||||
break;
|
||||
case 4:
|
||||
spawn(actor, PClass::FindActor(NAME_RedneckVixen));
|
||||
spawn(actor, RedneckVixenClass);
|
||||
operateactivators(666, p);
|
||||
break;
|
||||
}
|
||||
|
@ -1533,7 +1533,7 @@ static int fallspecial(DDukeActor *actor, int playernum)
|
|||
{
|
||||
if (!actor->isPlayer() && badguy(actor) && actor->spr.pos.Z == actor->floorz - FOURSLEIGHT_F)
|
||||
{
|
||||
spawnguts(actor, PClass::FindActor(NAME_DukeJibs6), 5);
|
||||
spawnguts(actor, DukeJibs6Class, 5);
|
||||
S_PlayActorSound(SQUISHED, actor);
|
||||
addspritetodelete();
|
||||
}
|
||||
|
@ -1567,7 +1567,7 @@ static int fallspecial(DDukeActor *actor, int playernum)
|
|||
addspritetodelete();
|
||||
return 0;
|
||||
}
|
||||
actor->attackertype = PClass::FindActor(NAME_DukeShotSpark);
|
||||
actor->attackertype = DukeShotSparkClass;
|
||||
actor->hitextra = 1;
|
||||
}
|
||||
else if (tilesurface(actor->sector()->floortexture) == TSURF_MAGMA)
|
||||
|
@ -1576,7 +1576,7 @@ static int fallspecial(DDukeActor *actor, int playernum)
|
|||
{
|
||||
if ((krand() & 3) == 1)
|
||||
{
|
||||
actor->attackertype = PClass::FindActor(NAME_DukeShotSpark);
|
||||
actor->attackertype = DukeShotSparkClass;
|
||||
actor->hitextra = 5;
|
||||
}
|
||||
}
|
||||
|
@ -1628,7 +1628,7 @@ void destroyit(DDukeActor *actor)
|
|||
{
|
||||
if (a3->spr.picnum == RTILE_DESTRUCTO)
|
||||
{
|
||||
a3->attackertype = PClass::FindActor(NAME_DukeShotSpark);
|
||||
a3->attackertype = DukeShotSparkClass;
|
||||
a3->hitextra = 1;
|
||||
}
|
||||
}
|
||||
|
@ -1711,7 +1711,7 @@ void mamaspawn(DDukeActor *actor)
|
|||
if (mamaspawn_count)
|
||||
{
|
||||
mamaspawn_count--;
|
||||
spawn(actor, PClass::FindActor(NAME_RedneckRabbit));
|
||||
spawn(actor, RedneckRabbitClass);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -92,15 +92,15 @@ void drawshadows(tspriteArray& tsprites, tspritetype* t, DDukeActor* h)
|
|||
|
||||
bool RRRAFullbrightHack(tspritetype* t, int k)
|
||||
{
|
||||
if (t->ownerActor->IsKindOf(NAME_RedneckBillyRay))
|
||||
if (t->ownerActor->IsKindOf(RedneckBillyRayClass))
|
||||
{
|
||||
return k >= 102 && k <= 151;
|
||||
}
|
||||
else if (t->ownerActor->IsKindOf(NAME_RedneckBiker))
|
||||
else if (t->ownerActor->IsKindOf(RedneckBikerClass))
|
||||
{
|
||||
return (k >= 54 && k <= 58) || (k >= 84 && k <= 88);
|
||||
}
|
||||
else if (t->ownerActor->IsKindOf(NAME_RedneckCheerleader))
|
||||
else if (t->ownerActor->IsKindOf(RedneckCheerleaderClass))
|
||||
{
|
||||
return k >= 102 && k <= 151;
|
||||
}
|
||||
|
|
|
@ -119,7 +119,7 @@ static const char *cheatKfc(int player)
|
|||
{
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
auto spr = spawn(ps[player].GetActor(), PClass::FindActor(NAME_RedneckHen));
|
||||
auto spr = spawn(ps[player].GetActor(), RedneckHenClass);
|
||||
if (spr)
|
||||
{
|
||||
spr->spr.pal = 1;
|
||||
|
|
83
source/games/duke/src/classnames.h
Normal file
83
source/games/duke/src/classnames.h
Normal file
|
@ -0,0 +1,83 @@
|
|||
xx(DukeMasterSwitch)
|
||||
xx(DukeTouchplate)
|
||||
xx(DukeSoundController)
|
||||
xx(DukeRespawnController)
|
||||
xx(DukeActivator)
|
||||
xx(DukeActivatorLocked)
|
||||
xx(DukeLocator)
|
||||
xx(DukeGenericDestructible)
|
||||
xx(DukeGlassPieces)
|
||||
xx(DukeGlassPieces1)
|
||||
xx(DukeGlassPieces2)
|
||||
xx(DukeNaturalLightning)
|
||||
xx(RedneckBowlingPin)
|
||||
xx(DukeReactor)
|
||||
xx(DukeFootprints)
|
||||
xx(RedneckMinecartDef)
|
||||
xx(RedneckMinecartSound)
|
||||
xx(RedneckMinecartInner)
|
||||
xx(RedneckJaildoorDef)
|
||||
xx(RedneckJaildoorSound)
|
||||
xx(RedneckGeometryEffect)
|
||||
xx(RedneckKeyinfoSetter)
|
||||
xx(DukeSectorEffector)
|
||||
xx(RedneckGoogooCluster)
|
||||
xx(DukeAtomicHealth)
|
||||
xx(RedneckHen)
|
||||
xx(DukeSmallSmoke)
|
||||
xx(DukeExplosion2)
|
||||
xx(DukeWaterBubble)
|
||||
xx(DukeMoney)
|
||||
xx(DukeMail)
|
||||
xx(DukePaper)
|
||||
xx(RedneckFeather)
|
||||
xx(DukeSteamBase)
|
||||
xx(RedneckFire)
|
||||
xx(DukePlayerOnWater)
|
||||
xx(RedneckBillyRay)
|
||||
xx(RedneckBiker)
|
||||
xx(RedneckCheerleader)
|
||||
xx(DukeShotSpark)
|
||||
xx(DukeJibs6)
|
||||
xx(RedneckMotoHit)
|
||||
xx(DukeFlamethrowerFlame)
|
||||
xx(DukeShrinkSpark)
|
||||
xx(DukeFirefly)
|
||||
xx(DukeFireball)
|
||||
xx(DukeBloodSplat3)
|
||||
xx(DukeBloodSplat1)
|
||||
xx(DukeBloodSplat2)
|
||||
xx(DukeBloodSplat4)
|
||||
xx(DukeBloodPool)
|
||||
xx(DukeFirelaser)
|
||||
xx(RedneckFirelaser)
|
||||
xx(DukeMeleeAttack)
|
||||
xx(DukeFirstgunSprite)
|
||||
xx(DukeShotgunSprite)
|
||||
xx(DukeChaingunSprite)
|
||||
xx(DukeRPGSprite)
|
||||
xx(DukePipeBomb)
|
||||
xx(DukeShrinkerSprite)
|
||||
xx(DukeDevastatorSprite)
|
||||
xx(DukeTripBombSprite)
|
||||
xx(DukeFreezeSprite)
|
||||
xx(DukeTransporterBeam)
|
||||
xx(DukeWaterSplash)
|
||||
xx(DukeShell)
|
||||
xx(DukeShotgunShell)
|
||||
xx(DukeRPG)
|
||||
xx(RedneckDynamiteArrow)
|
||||
xx(RedneckHulk)
|
||||
xx(RedneckPig)
|
||||
xx(RedneckMinion)
|
||||
xx(RedneckVixen)
|
||||
xx(RedneckRabbit)
|
||||
xx(RedneckDoorkey)
|
||||
xx(RedneckEmptyBike)
|
||||
xx(RedneckEmptyBoat)
|
||||
xx(DukeScrap)
|
||||
xx(RedneckUfo1)
|
||||
xx(RedneckUfo2)
|
||||
xx(RedneckUfo3)
|
||||
xx(RedneckUfo4)
|
||||
xx(RedneckUfoRRRA)
|
|
@ -20,7 +20,7 @@ inline int player_struct::GetPlayerNum()
|
|||
}
|
||||
|
||||
DDukeActor* spawn(DDukeActor* spawner, int type);
|
||||
DDukeActor* spawn(DDukeActor* actj, PClassActor* pname);
|
||||
DDukeActor* spawn(DDukeActor* spawner, PClassActor* pname);
|
||||
|
||||
// return type is int for scripting - the value must still be true or false!
|
||||
inline int badguy(const DDukeActor* pSprite)
|
||||
|
|
|
@ -359,6 +359,7 @@ void setTextureIDs()
|
|||
|
||||
void GameInterface::app_init()
|
||||
{
|
||||
RegisterClasses();
|
||||
GC::AddMarkerFunc(markgcroots);
|
||||
|
||||
if (isRR()) C_SetNotifyFontScale(0.5);
|
||||
|
|
|
@ -1507,7 +1507,7 @@ int ParseState::parse(void)
|
|||
insptr++;
|
||||
// HACK ALERT! The fire animation uses a broken ifrnd setup to delay its start because original CON has no variables
|
||||
// But the chosen random value of 16/255 is too low and can cause delays of a second or more. (identical in Duke and RR.)
|
||||
if (g_ac->IsKindOf(NAME_RedneckFire) && g_ac->curAction->name == NAME_None && *insptr == 16)
|
||||
if (g_ac->IsKindOf(RedneckFireClass) && g_ac->curAction->name == NAME_None && *insptr == 16)
|
||||
{
|
||||
parseifelse(rnd(64));
|
||||
break;
|
||||
|
@ -1698,10 +1698,10 @@ int ParseState::parse(void)
|
|||
// Separating it here is easiest as long as the ZScript reimplementation explicitly takes care of these differences.
|
||||
if (isRRRA())
|
||||
{
|
||||
//if (g_ac->GetClass.TypeName == NAME_RedneckCheerleader && type == 3400) typecls = PClass::FindActor(NAME_RedneckCheerBaton);
|
||||
//if (g_ac->GetClass.TypeName == NAME_RedneckMama && type == 3390) typecls = PClass::FindActor(NAME_RedneckRabbitBall);
|
||||
//if (g_ac->GetClass.TypeName == NAME_RedneckMinion && type == 3390 && g_ac->spr.pal == 8) typecls = PClass::FindActor(NAME_RedneckFrogBall);
|
||||
//if (g_ac->GetClass.TypeName == NAME_RedneckMinion && type == 3390 && g_ac->spr.pal == 19)) typecls = PClass::FindActor(NAME_RedneckShitBurn);
|
||||
//if (g_ac->GetClass.TypeName == NAME_RedneckCheerleader && type == 3400) typecls = RedneckCheerBatonClass);
|
||||
//if (g_ac->GetClass.TypeName == NAME_RedneckMama && type == 3390) typecls = RedneckRabbitBallClass);
|
||||
//if (g_ac->GetClass.TypeName == NAME_RedneckMinion && type == 3390 && g_ac->spr.pal == 8) typecls = RedneckFrogBallClass);
|
||||
//if (g_ac->GetClass.TypeName == NAME_RedneckMinion && type == 3390 && g_ac->spr.pal == 19)) typecls = RedneckShitBurnClass);
|
||||
}
|
||||
shoot(g_ac, *insptr, nullptr);
|
||||
insptr++;
|
||||
|
|
|
@ -115,4 +115,32 @@ double geoy2[MAXGEOSECTORS];
|
|||
int geocnt;
|
||||
|
||||
|
||||
|
||||
// Register all internally used classes at game startup so that we can find naming errors right away without having them cause bugs later.
|
||||
void RegisterClasses()
|
||||
{
|
||||
#define xx(n) { #n, &n##Class},
|
||||
static std::pair<const char*, PClassActor**> classreg[] = {
|
||||
#include "classnames.h"
|
||||
};
|
||||
#undef xx
|
||||
|
||||
int error = 0;
|
||||
for (auto& classdef : classreg)
|
||||
{
|
||||
auto cls = PClass::FindActor(classdef.first);
|
||||
if (cls == nullptr || !cls->IsDescendantOf(RUNTIME_CLASS(DDukeActor)))
|
||||
{
|
||||
Printf(TEXTCOLOR_RED, "%s: Attempt to register unknown actor class '%s'\n", classdef.first);
|
||||
error++;
|
||||
}
|
||||
|
||||
*classdef.second = cls;
|
||||
}
|
||||
if (error > 0)
|
||||
{
|
||||
I_FatalError("Unable to register %d actor classes", error);
|
||||
}
|
||||
}
|
||||
|
||||
END_DUKE_NS
|
||||
|
|
|
@ -138,6 +138,15 @@ extern uint8_t enemysizecheat /*raat607*/, chickenphase /* raat605*/, RRRA_Exite
|
|||
extern player_orig po[MAXPLAYERS];
|
||||
extern int32_t g_cdTrack;
|
||||
|
||||
|
||||
|
||||
#define xx(n) inline PClassActor* n##Class;
|
||||
#include "classnames.h"
|
||||
#undef xx
|
||||
|
||||
void RegisterClasses();
|
||||
|
||||
|
||||
END_DUKE_NS
|
||||
|
||||
#include "inlines.h"
|
||||
|
|
|
@ -18,37 +18,37 @@ inline int rnd(int X)
|
|||
inline int ismasterswitch(DDukeActor* actor)
|
||||
{
|
||||
// The STAT_REMOVED check here is important!
|
||||
return actor->GetClass()->TypeName == NAME_DukeMasterSwitch && actor->spr.statnum != STAT_REMOVED;
|
||||
return actor->GetClass() == DukeMasterSwitchClass && actor->spr.statnum != STAT_REMOVED;
|
||||
}
|
||||
|
||||
inline int issoundcontroller(DDukeActor* actor)
|
||||
{
|
||||
return actor->GetClass()->TypeName == NAME_DukeSoundController;
|
||||
return actor->GetClass() == DukeSoundControllerClass;
|
||||
}
|
||||
|
||||
inline int isrespawncontroller(DDukeActor* actor)
|
||||
{
|
||||
return actor->GetClass()->TypeName == NAME_DukeRespawnController;
|
||||
return actor->GetClass() == DukeRespawnControllerClass;
|
||||
}
|
||||
|
||||
inline int isactivator(DDukeActor* actor)
|
||||
{
|
||||
return actor->GetClass()->TypeName == NAME_DukeActivator;
|
||||
return actor->GetClass() == DukeActivatorClass;
|
||||
}
|
||||
|
||||
inline int islockedactivator(DDukeActor* actor)
|
||||
{
|
||||
return actor->GetClass()->TypeName == NAME_DukeActivatorLocked;
|
||||
return actor->GetClass() == DukeActivatorLockedClass;
|
||||
}
|
||||
|
||||
inline int islocator(DDukeActor* actor)
|
||||
{
|
||||
return actor->GetClass()->TypeName == NAME_DukeLocator;
|
||||
return actor->GetClass() == DukeLocatorClass;
|
||||
}
|
||||
|
||||
inline int iseffector(DDukeActor* actor)
|
||||
{
|
||||
return actor->GetClass()->TypeName == NAME_DukeSectorEffector;
|
||||
return actor->GetClass() == DukeSectorEffectorClass;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ void quickkill(player_struct* p)
|
|||
auto pa = p->GetActor();
|
||||
pa->spr.extra = 0;
|
||||
pa->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
if (ud.god == 0) spawnguts(pa, PClass::FindActor("DukeJibs6"), 8);
|
||||
if (ud.god == 0) spawnguts(pa, DukeJibs6Class, 8);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -363,8 +363,8 @@ void dokneeattack(int snum)
|
|||
p->weapon_pos = -p->weapon_pos;
|
||||
if (p->actorsqu != nullptr && (pact->spr.pos - p->actorsqu->spr.pos).Length() < 1400/16.)
|
||||
{
|
||||
spawnguts(p->actorsqu, PClass::FindActor("DukeJibs6"), 7);
|
||||
spawn(p->actorsqu, PClass::FindActor("DukeBloodPool"));
|
||||
spawnguts(p->actorsqu, DukeJibs6Class, 7);
|
||||
spawn(p->actorsqu, DukeBloodPoolClass);
|
||||
S_PlayActorSound(SQUISHED, p->actorsqu);
|
||||
if (p->actorsqu->flags2 & SFLAG2_TRIGGERRESPAWN)
|
||||
{
|
||||
|
@ -480,7 +480,7 @@ void footprints(int snum)
|
|||
DukeSectIterator it(actor->sector());
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->IsKindOf(NAME_DukeFootprints))
|
||||
if (act->IsKindOf(DukeFootprintsClass))
|
||||
if (abs(act->spr.pos.X - p->GetActor()->spr.pos.X) < 24)
|
||||
if (abs(act->spr.pos.Y - p->GetActor()->spr.pos.Y) < 24)
|
||||
{
|
||||
|
@ -493,7 +493,7 @@ void footprints(int snum)
|
|||
p->footprintcount--;
|
||||
if (p->cursector->lotag == 0 && p->cursector->hitag == 0)
|
||||
{
|
||||
DDukeActor* fprint = spawn(actor, PClass::FindActor(NAME_DukeFootprints));
|
||||
DDukeActor* fprint = spawn(actor, DukeFootprintsClass);
|
||||
if (fprint)
|
||||
{
|
||||
fprint->spr.Angles.Yaw = p->actor->spr.Angles.Yaw;
|
||||
|
|
|
@ -531,7 +531,7 @@ int doincrements_d(player_struct* p)
|
|||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------NAM
|
||||
//
|
||||
//
|
||||
//
|
||||
|
@ -539,9 +539,9 @@ int doincrements_d(player_struct* p)
|
|||
|
||||
void checkweapons_d(player_struct* p)
|
||||
{
|
||||
static const FName weapon_sprites[MAX_WEAPONS] = { NAME_DukeMeleeAttack, NAME_DukeFirstgunSprite, NAME_DukeShotgunSprite,
|
||||
NAME_DukeChaingunSprite, NAME_DukeRPGSprite, NAME_DukePipeBomb, NAME_DukeShrinkerSprite, NAME_DukeDevastatorSprite,
|
||||
NAME_DukeTripBombSprite, NAME_DukeFreezeSprite, NAME_DukePipeBomb, NAME_DukeShrinkerSprite };
|
||||
static PClassActor* const * const weapon_sprites[MAX_WEAPONS] = { &DukeMeleeAttackClass, &DukeFirstgunSpriteClass, &DukeShotgunSpriteClass,
|
||||
&DukeChaingunSpriteClass, &DukeRPGSpriteClass, &DukePipeBombClass, &DukeShrinkerSpriteClass, &DukeDevastatorSpriteClass,
|
||||
&DukeTripBombSpriteClass, &DukeFreezeSpriteClass, &DukePipeBombClass, &DukeShrinkerSpriteClass };
|
||||
|
||||
int cw;
|
||||
|
||||
|
@ -559,12 +559,12 @@ void checkweapons_d(player_struct* p)
|
|||
if (cw)
|
||||
{
|
||||
if (krand() & 1)
|
||||
spawn(p->GetActor(), PClass::FindActor(weapon_sprites[cw]));
|
||||
spawn(p->GetActor(), *weapon_sprites[cw]);
|
||||
else switch (cw)
|
||||
{
|
||||
case RPG_WEAPON:
|
||||
case HANDBOMB_WEAPON:
|
||||
spawn(p->GetActor(), PClass::FindActor(NAME_DukeExplosion2));
|
||||
spawn(p->GetActor(), DukeExplosion2Class);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -674,7 +674,7 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, double floo
|
|||
if (p->on_ground == 1)
|
||||
{
|
||||
if (p->dummyplayersprite == nullptr)
|
||||
p->dummyplayersprite = spawn(pact, PClass::FindActor(NAME_DukePlayerOnWater));
|
||||
p->dummyplayersprite = spawn(pact, DukePlayerOnWaterClass);
|
||||
|
||||
p->footprintcount = 6;
|
||||
if (tilesurface(p->cursector->floortexture) == TSURF_SLIME)
|
||||
|
@ -892,7 +892,7 @@ static void underwater(int snum, ESyncBits actions, double floorz, double ceilin
|
|||
|
||||
if (p->scuba_on && (krand() & 255) < 8)
|
||||
{
|
||||
auto j = spawn(pact, PClass::FindActor(NAME_DukeWaterBubble));
|
||||
auto j = spawn(pact, DukeWaterBubbleClass);
|
||||
if (j)
|
||||
{
|
||||
j->spr.pos += (p->GetActor()->spr.Angles.Yaw.ToVector() + DVector2(4 - (global_random & 8), 4 - (global_random & 8))) * 16;
|
||||
|
@ -1185,7 +1185,7 @@ static void operateweapon(int snum, ESyncBits actions)
|
|||
}
|
||||
|
||||
else if (p->kickback_pic == 2)
|
||||
spawn(pact, PClass::FindActor(NAME_DukeShell));
|
||||
spawn(pact, DukeShellClass);
|
||||
|
||||
p->kickback_pic++;
|
||||
|
||||
|
@ -1253,7 +1253,7 @@ static void operateweapon(int snum, ESyncBits actions)
|
|||
break;
|
||||
case 24:
|
||||
{
|
||||
auto j = spawn(pact, PClass::FindActor(NAME_DukeShotgunShell));
|
||||
auto j = spawn(pact, DukeShotgunShellClass);
|
||||
if (j)
|
||||
{
|
||||
j->spr.Angles.Yaw += DAngle180;
|
||||
|
@ -1287,7 +1287,7 @@ static void operateweapon(int snum, ESyncBits actions)
|
|||
|
||||
if ((p->kickback_pic % 3) == 0)
|
||||
{
|
||||
auto j = spawn(pact, PClass::FindActor(NAME_DukeShell));
|
||||
auto j = spawn(pact, DukeShellClass);
|
||||
if (j)
|
||||
{
|
||||
j->spr.Angles.Yaw += DAngle180;
|
||||
|
|
|
@ -657,7 +657,7 @@ void checkweapons_r(player_struct* p)
|
|||
[[fallthrough]];
|
||||
case DYNAMITE_WEAPON:
|
||||
case CROSSBOW_WEAPON:
|
||||
spawn(p->GetActor(), PClass::FindActor(NAME_DukeExplosion2));
|
||||
spawn(p->GetActor(), DukeExplosion2Class);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -666,7 +666,7 @@ void checkweapons_r(player_struct* p)
|
|||
{
|
||||
if (p->keys[i] == 1)
|
||||
{
|
||||
auto j = spawn(p->GetActor(), PClass::FindActor(NAME_RedneckDoorkey));
|
||||
auto j = spawn(p->GetActor(), RedneckDoorkeyClass);
|
||||
if (j) switch (i)
|
||||
{
|
||||
case 1:
|
||||
|
@ -1128,7 +1128,7 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, double floo
|
|||
if (p->on_ground == 1)
|
||||
{
|
||||
if (p->dummyplayersprite == nullptr)
|
||||
p->dummyplayersprite = spawn(pact, PClass::FindActor(NAME_DukePlayerOnWater));
|
||||
p->dummyplayersprite = spawn(pact, DukePlayerOnWaterClass);
|
||||
|
||||
p->footprintcount = 6;
|
||||
if (tilesurface(p->cursector->floortexture) == TSURF_SLIME)
|
||||
|
@ -1385,7 +1385,7 @@ static void underwater(int snum, ESyncBits actions, double floorz, double ceilin
|
|||
|
||||
if (p->scuba_on && (krand() & 255) < 8)
|
||||
{
|
||||
auto j = spawn(pact, PClass::FindActor(NAME_DukeWaterBubble));
|
||||
auto j = spawn(pact, DukeWaterBubbleClass);
|
||||
if (j)
|
||||
{
|
||||
j->spr.pos += (p->GetActor()->spr.Angles.Yaw.ToVector() + DVector2(12 - (global_random & 8), 12 - (global_random & 8))) * 16;
|
||||
|
@ -1516,7 +1516,7 @@ void onMotorcycleHit(int snum, DDukeActor* victim)
|
|||
}
|
||||
else
|
||||
victim->SetHitOwner(p->GetActor());
|
||||
victim->attackertype = PClass::FindActor(NAME_RedneckMotoHit);
|
||||
victim->attackertype = RedneckMotoHitClass;
|
||||
victim->hitextra = int(p->MotoSpeed * 0.5);
|
||||
p->MotoSpeed -= p->MotoSpeed / 4.;
|
||||
p->TurbCount = 6;
|
||||
|
@ -1550,7 +1550,7 @@ void onBoatHit(int snum, DDukeActor* victim)
|
|||
}
|
||||
else
|
||||
victim->SetHitOwner(p->GetActor());
|
||||
victim->attackertype = PClass::FindActor(NAME_RedneckMotoHit);
|
||||
victim->attackertype = RedneckMotoHitClass;
|
||||
victim->hitextra = int(p->MotoSpeed * 0.25);
|
||||
p->MotoSpeed -= p->MotoSpeed / 4.;
|
||||
p->TurbCount = 6;
|
||||
|
@ -2440,7 +2440,7 @@ void processinput_r(int snum)
|
|||
{
|
||||
if (badguy(clz.actor()))
|
||||
{
|
||||
clz.actor()->attackertype = PClass::FindActor(NAME_RedneckMotoHit);
|
||||
clz.actor()->attackertype = RedneckMotoHitClass;
|
||||
clz.actor()->hitextra = int(2 + (p->MotoSpeed * 0.5));
|
||||
p->MotoSpeed -= p->MotoSpeed * (1. / 16.);
|
||||
}
|
||||
|
@ -3060,7 +3060,7 @@ void OffMotorcycle(player_struct *p)
|
|||
p->TurbCount = 0;
|
||||
p->vel.XY() = p->GetActor()->spr.Angles.Yaw.ToVector() / 2048.;
|
||||
p->moto_underwater = 0;
|
||||
auto spawned = spawn(p->GetActor(), PClass::FindActor(NAME_RedneckEmptyBike));
|
||||
auto spawned = spawn(p->GetActor(), RedneckEmptyBikeClass);
|
||||
if (spawned)
|
||||
{
|
||||
spawned->spr.Angles.Yaw = p->GetActor()->spr.Angles.Yaw;
|
||||
|
@ -3114,7 +3114,7 @@ void OffBoat(player_struct *p)
|
|||
p->TurbCount = 0;
|
||||
p->vel.XY() = p->GetActor()->spr.Angles.Yaw.ToVector() / 2048.;
|
||||
p->moto_underwater = 0;
|
||||
auto spawned = spawn(p->GetActor(), PClass::FindActor(NAME_RedneckEmptyBoat));
|
||||
auto spawned = spawn(p->GetActor(), RedneckEmptyBoatClass);
|
||||
if (spawned)
|
||||
{
|
||||
spawned->spr.Angles.Yaw = p->GetActor()->spr.Angles.Yaw;
|
||||
|
|
|
@ -418,13 +418,13 @@ void prelevel_r(int g, TArray<DDukeActor*>& actors)
|
|||
dist = 0;
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->GetClass()->TypeName == NAME_RedneckJaildoorDef)
|
||||
if (act->GetClass() == RedneckJaildoorDefClass)
|
||||
{
|
||||
dist = act->spr.lotag;
|
||||
speed = act->spr.hitag;
|
||||
act->Destroy();
|
||||
}
|
||||
if (act->GetClass()->TypeName == NAME_RedneckJaildoorSound)
|
||||
if (act->GetClass() == RedneckJaildoorSoundClass)
|
||||
{
|
||||
sound = act->spr.lotag;
|
||||
act->Destroy();
|
||||
|
@ -458,14 +458,14 @@ void prelevel_r(int g, TArray<DDukeActor*>& actors)
|
|||
DukeSectIterator it(sectp);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->GetClass()->TypeName == NAME_RedneckMinecartDef)
|
||||
if (act->GetClass() == RedneckMinecartDefClass)
|
||||
{
|
||||
dist = act->spr.lotag;
|
||||
speed = act->spr.hitag;
|
||||
DukeSpriteIterator itt;
|
||||
while(auto act1 = itt.Next())
|
||||
{
|
||||
if (act1->GetClass()->TypeName == NAME_RedneckMinecartInner)
|
||||
if (act1->GetClass() == RedneckMinecartInnerClass)
|
||||
if (act1->spr.lotag == act->sectno()) // bad map format design... Should have used a tag instead...
|
||||
{
|
||||
childsectnum = act1->sector();
|
||||
|
@ -474,7 +474,7 @@ void prelevel_r(int g, TArray<DDukeActor*>& actors)
|
|||
}
|
||||
act->Destroy();
|
||||
}
|
||||
if (act->GetClass()->TypeName == NAME_RedneckMinecartSound)
|
||||
if (act->GetClass() == RedneckMinecartSoundClass)
|
||||
{
|
||||
sound = act->spr.lotag;
|
||||
act->Destroy();
|
||||
|
@ -504,7 +504,7 @@ void prelevel_r(int g, TArray<DDukeActor*>& actors)
|
|||
for (auto actor : actors)
|
||||
{
|
||||
if (!actor->exists()) continue;
|
||||
if (actor->GetClass()->TypeName == NAME_RedneckGeometryEffect)
|
||||
if (actor->GetClass() == RedneckGeometryEffectClass)
|
||||
{
|
||||
if (geocnt >= MAXGEOSECTORS)
|
||||
I_Error("Too many geometry effects");
|
||||
|
@ -552,9 +552,9 @@ void prelevel_r(int g, TArray<DDukeActor*>& actors)
|
|||
{
|
||||
if (iseffector(actor) && actor->spr.lotag == SE_14_SUBWAY_CAR)
|
||||
spriteinit(actor, actors);
|
||||
if (actor->GetClass()->TypeName == NAME_RedneckGeometryEffect)
|
||||
if (actor->GetClass() == RedneckGeometryEffectClass)
|
||||
actor->Destroy();
|
||||
if (actor->GetClass()->TypeName == NAME_RedneckKeyinfoSetter)
|
||||
if (actor->GetClass() == RedneckKeyinfoSetterClass)
|
||||
{
|
||||
actor->sector()->keyinfo = uint8_t(actor->spr.lotag);
|
||||
actor->Destroy();
|
||||
|
|
|
@ -177,7 +177,7 @@ void checkhitdefault_d(DDukeActor* targ, DDukeActor* proj)
|
|||
if (proj->spr.picnum != DTILE_FREEZEBLAST)
|
||||
//if (actortype[targ->spr.picnum] == 0) //TRANSITIONAL.
|
||||
{
|
||||
auto spawned = spawn(proj, PClass::FindActor(NAME_DukeJibs6));
|
||||
auto spawned = spawn(proj, DukeJibs6Class);
|
||||
if (spawned)
|
||||
{
|
||||
if (proj->spr.pal == 6)
|
||||
|
@ -194,10 +194,10 @@ void checkhitdefault_d(DDukeActor* targ, DDukeActor* proj)
|
|||
if (Owner && Owner->isPlayer() && targ->spr.picnum != DTILE_ROTATEGUN && targ->spr.picnum != DTILE_DRONE)
|
||||
if (ps[Owner->PlayerIndex()].curr_weapon == SHOTGUN_WEAPON)
|
||||
{
|
||||
shoot(targ, -1, PClass::FindActor(NAME_DukeBloodSplat3));
|
||||
shoot(targ, -1, PClass::FindActor(NAME_DukeBloodSplat1));
|
||||
shoot(targ, -1, PClass::FindActor(NAME_DukeBloodSplat2));
|
||||
shoot(targ, -1, PClass::FindActor(NAME_DukeBloodSplat4));
|
||||
shoot(targ, -1, DukeBloodSplat3Class);
|
||||
shoot(targ, -1, DukeBloodSplat1Class);
|
||||
shoot(targ, -1, DukeBloodSplat2Class);
|
||||
shoot(targ, -1, DukeBloodSplat4Class);
|
||||
}
|
||||
|
||||
if (!(targ->flags2 & SFLAG2_NODAMAGEPUSH)) // RR does not have this.
|
||||
|
@ -233,8 +233,8 @@ void checkhitdefault_d(DDukeActor* targ, DDukeActor* proj)
|
|||
return;
|
||||
|
||||
auto tOwner = targ->GetOwner();
|
||||
if (hitpic->TypeName == NAME_DukeFireball && tOwner && tOwner->GetClass()->TypeName != NAME_DukeFireball)
|
||||
hitpic = PClass::FindActor(NAME_DukeFlamethrowerFlame);
|
||||
if (hitpic == DukeFireballClass && tOwner && tOwner->GetClass() != DukeFireballClass)
|
||||
hitpic = DukeFlamethrowerFlameClass;
|
||||
}
|
||||
|
||||
targ->attackertype = hitpic;
|
||||
|
|
|
@ -175,7 +175,7 @@ void checkhitdefault_r(DDukeActor* targ, DDukeActor* proj)
|
|||
if (proj->spr.picnum != RTILE_FREEZEBLAST)
|
||||
//if (actortype[targ->spr.picnum] == 0)
|
||||
{
|
||||
auto spawned = spawn(proj, PClass::FindActor(NAME_DukeJibs6));
|
||||
auto spawned = spawn(proj, DukeJibs6Class);
|
||||
if (spawned)
|
||||
{
|
||||
if (proj->spr.pal == 6)
|
||||
|
@ -192,10 +192,10 @@ void checkhitdefault_r(DDukeActor* targ, DDukeActor* proj)
|
|||
if (Owner && Owner->isPlayer() && targ->spr.picnum != RTILE_DRONE)
|
||||
if (ps[Owner->PlayerIndex()].curr_weapon == SHOTGUN_WEAPON)
|
||||
{
|
||||
shoot(targ, -1, PClass::FindActor(NAME_DukeBloodSplat3));
|
||||
shoot(targ, -1, PClass::FindActor(NAME_DukeBloodSplat1));
|
||||
shoot(targ, -1, PClass::FindActor(NAME_DukeBloodSplat2));
|
||||
shoot(targ, -1, PClass::FindActor(NAME_DukeBloodSplat4));
|
||||
shoot(targ, -1, DukeBloodSplat3Class);
|
||||
shoot(targ, -1, DukeBloodSplat1Class);
|
||||
shoot(targ, -1, DukeBloodSplat2Class);
|
||||
shoot(targ, -1, DukeBloodSplat4Class);
|
||||
}
|
||||
|
||||
if (targ->spr.statnum == STAT_ZOMBIEACTOR)
|
||||
|
@ -624,7 +624,7 @@ void tearitup(sectortype* sect)
|
|||
{
|
||||
if (act->spr.picnum == RTILE_DESTRUCTO)
|
||||
{
|
||||
act->attackertype = PClass::FindActor(NAME_DukeShotSpark);
|
||||
act->attackertype = DukeShotSparkClass;
|
||||
act->hitextra = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ void setFromSpawnRec(DDukeActor* act, SpawnRec* info)
|
|||
act->curAction = &actions[0];
|
||||
if (info)
|
||||
{
|
||||
if (info->basetex > 0 && act->IsKindOf(NAME_DukeGenericDestructible))
|
||||
if (info->basetex > 0 && act->IsKindOf(DukeGenericDestructibleClass))
|
||||
{
|
||||
// allow defining simple destructibles without actual actor definitions.
|
||||
act->IntVar(NAME_spawnstate) = info->basetex;
|
||||
|
@ -887,16 +887,8 @@ void spriteinit(DDukeActor* actor, TArray<DDukeActor*>& actors)
|
|||
|
||||
inline PClassActor* GlassClass(int j)
|
||||
{
|
||||
static PClassActor* glasses[3];
|
||||
if (glasses[0] == nullptr)
|
||||
{
|
||||
static const FName glassnames[] = { NAME_DukeGlassPieces, NAME_DukeGlassPieces1, NAME_DukeGlassPieces2 };
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
glasses[i] = PClass::FindActor(glassnames[i]);
|
||||
}
|
||||
}
|
||||
return glasses[j % 3];
|
||||
static PClassActor* const* glasses[] = { &DukeGlassPiecesClass, &DukeGlassPieces1Class, &DukeGlassPieces2Class };
|
||||
return *glasses[j % 3];
|
||||
}
|
||||
|
||||
void lotsofglass(DDukeActor *actor, walltype* wal, int n)
|
||||
|
|
Loading…
Reference in a new issue