- ported all simple EGS calls to CreateActor

This commit is contained in:
Christoph Oelckers 2022-09-13 01:05:13 +02:00
parent dafc1ff2d2
commit 021f7062d1
6 changed files with 18 additions and 16 deletions

View file

@ -1004,7 +1004,7 @@ static void movefireext(DDukeActor* actor)
for (int k = 0; k < 16; k++)
{
auto spawned = EGS(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (krand() % (48 << 8)), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (actor->int_zvel() >> 2), actor, 5);
auto spawned = CreateActor(actor->sector(), actor->spr.pos.plusZ(krandf(-48)), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (actor->int_zvel() >> 2), actor, 5);
if(spawned) spawned->spr.pal = 2;
}
@ -2153,7 +2153,7 @@ static void greenslime(DDukeActor *actor)
{
for (x = 0; x < 8; x++)
{
auto spawned = EGS(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (8 << 8), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (actor->int_zvel() >> 2), actor, 5);
auto spawned = CreateActor(actor->sector(), actor->spr.pos.plusZ(-8), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (actor->int_zvel() >> 2), actor, 5);
spawned->spr.pal = 6;
}
@ -2261,7 +2261,7 @@ static void greenslime(DDukeActor *actor)
for (x = 0; x < 8; x++)
{
auto spawned = EGS(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (8 << 8), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (actor->int_zvel() >> 2), actor, 5);
auto spawned = CreateActor(actor->sector(), actor->spr.pos.plusZ(-8), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (actor->int_zvel() >> 2), actor, 5);
if (spawned) spawned->spr.pal = 6;
}
actor->temp_data[0] = -3;

View file

@ -2163,9 +2163,12 @@ int ParseState::parse(void)
if(weap)
s = 0;
else s = (krand()%3);
DVector3 offs;
offs.X = krandf(16) - 8;
offs.Y = krandf(16) - 8;
offs.Z = -krandf(16) - 8;
auto spawned = EGS(g_ac->sector(),
g_ac->int_pos().X + (krand() & 255) - 128, g_ac->int_pos().Y + (krand() & 255) - 128, g_ac->int_pos().Z - (8 << 8) - (krand() & 8191),
auto spawned = CreateActor(g_ac->sector(), g_ac->spr.pos + offs,
dnum + s, g_ac->spr.shade, 32 + (krand() & 15), 32 + (krand() & 15),
krand() & 2047, (krand() & 127) + 32, -(krand() & 2047), g_ac, 5);
if (spawned)

View file

@ -539,7 +539,7 @@ void resetpspritevars(int g)
int aimmode[MAXPLAYERS];
STATUSBARTYPE tsbar[MAXPLAYERS];
EGS(ps[0].cursector, ps[0].player_int_pos().X, ps[0].player_int_pos().Y, ps[0].player_int_pos().Z,
CreateActor(ps[0].cursector, ps[0].pos,
TILE_APLAYER, 0, 0, 0, ps[0].angle.ang.Buildang(), 0, 0, nullptr, 10);
if (ud.recstat != 2) for (i = 0; i < MAXPLAYERS; i++)

View file

@ -1080,7 +1080,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
{
for (k = 0; k < 64; k++)
{
auto spawned = EGS(targ->sector(), targ->int_pos().X, targ->int_pos().Y, targ->int_pos().Z - (krand() % (48 << 8)), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (targ->int_zvel() >> 2), targ, 5);
auto spawned = CreateActor(targ->sector(), targ->spr.pos.plusZ(-krandf(48)), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (targ->int_zvel() >> 2), targ, 5);
spawned->spr.pal = 8;
}
@ -1093,7 +1093,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
case HANGLIGHT:
case GENERICPOLE2:
for (k = 0; k < 6; k++)
EGS(targ->sector(), targ->int_pos().X, targ->int_pos().Y, targ->int_pos().Z - (8 << 8), SCRAP1 + (krand() & 15), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (targ->int_zvel() >> 2), targ, 5);
CreateActor(targ->sector(), targ->spr.pos.plusZ(-8), SCRAP1 + (krand() & 15), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (targ->int_zvel() >> 2), targ, 5);
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
deletesprite(targ);
break;
@ -1123,7 +1123,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
if (gs.actorinfo[SHOTSPARK1].scriptaddress && proj->spr.extra != ScriptCode[gs.actorinfo[SHOTSPARK1].scriptaddress])
{
for (j = 0; j < 15; j++)
EGS(targ->sector(), targ->int_pos().X, targ->int_pos().Y, targ->sector()->int_floorz() - (12 << 8) - (j << 9), SCRAP1 + (krand() & 15), -8, 64, 64,
CreateActor(targ->sector(), DVector3(targ->spr.pos.XY(), targ->sector()->floorz - 12 - j * 2), SCRAP1 + (krand() & 15), -8, 64, 64,
krand() & 2047, (krand() & 127) + 64, -(krand() & 511) - 256, targ, 5);
spawn(targ, EXPLOSION2);
deletesprite(targ);

View file

@ -2060,7 +2060,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
lotsofglass(targ, nullptr, 10);
targ->spr.picnum++;
for (k = 0; k < 6; k++)
EGS(targ->sector(), targ->int_pos().X, targ->int_pos().Y, targ->int_pos().Z - (8 << 8), SCRAP6 + (krand() & 15), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (targ->int_zvel() >> 2), targ, 5);
CreateActor(targ->sector(), targ->spr.pos.plusZ(-8), SCRAP6 + (krand() & 15), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (targ->int_zvel() >> 2), targ, 5);
break;
case BOWLINGBALL:
proj->set_int_xvel((targ->int_xvel() >> 1) + (targ->int_xvel() >> 2));
@ -2127,7 +2127,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
{
for (k = 0; k < 64; k++)
{
auto spawned = EGS(targ->sector(), targ->int_pos().X, targ->int_pos().Y, targ->int_pos().Z - (krand() % (48 << 8)), SCRAP6 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (targ->int_zvel() >> 2), targ, 5);
auto spawned = CreateActor(targ->sector(), targ->spr.pos.plusZ(-krandf(48)), SCRAP6 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (targ->int_zvel() >> 2), targ, 5);
if (spawned) spawned->spr.pal = 8;
}
@ -2159,7 +2159,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
if (gs.actorinfo[SHOTSPARK1].scriptaddress && proj->spr.extra != ScriptCode[gs.actorinfo[SHOTSPARK1].scriptaddress])
{
for (j = 0; j < 15; j++)
EGS(targ->sector(), targ->int_pos().X, targ->int_pos().Y, targ->sector()->int_floorz() - (12 << 8) - (j << 9), SCRAP1 + (krand() & 15), -8, 64, 64,
CreateActor(targ->sector(), DVector3(targ->spr.pos.XY(), targ->sector()->floorz - 12 - j * 2), SCRAP1 + (krand() & 15), -8, 64, 64,
krand() & 2047, (krand() & 127) + 64, -(krand() & 511) - 256, targ, 5);
spawn(targ, EXPLOSION2);
deletesprite(targ);

View file

@ -219,7 +219,7 @@ DDukeActor* spawn(DDukeActor* actj, int pn)
{
if (actj)
{
auto spawned = EGS(actj->sector(), actj->int_pos().X, actj->int_pos().Y, actj->int_pos().Z, pn, 0, 0, 0, 0, 0, 0, actj, 0);
auto spawned = CreateActor(actj->sector(), actj->spr.pos, pn, 0, 0, 0, 0, 0, 0, actj, 0);
if (spawned)
{
spawned->attackertype = actj->spr.picnum;
@ -1118,8 +1118,7 @@ void spriteglass(DDukeActor* actor, int n)
for (int j = n; j > 0; j--)
{
int a = krand() & 2047;
int z = actor->int_pos().Z - ((krand() & 16) << 8);
auto k = EGS(actor->sector(), actor->int_pos().X, actor->int_pos().Y, z, TILE_GLASSPIECES + (j % 3), krand() & 15, 36, 36, a, 32 + (krand() & 63), -512 - (krand() & 2047), actor, 5);
auto k = CreateActor(actor->sector(), actor->spr.pos.plusZ(-(krand() & 16)), TILE_GLASSPIECES + (j % 3), krand() & 15, 36, 36, a, 32 + (krand() & 63), -512 - (krand() & 2047), actor, 5);
if (k) k->spr.pal = actor->spr.pal;
}
}
@ -1170,7 +1169,7 @@ void lotsofcolourglass(DDukeActor* actor, walltype* wal, int n)
for (j = n - 1; j >= 0; j--)
{
a = krand() & 2047;
auto k = EGS(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (krand() & (63 << 8)), TILE_GLASSPIECES + (j % 3), -32, 36, 36, a, 32 + (krand() & 63), 1024 - (krand() & 2047), actor, 5);
auto k = CreateActor(actor->sector(), actor->spr.pos.plusZ(-(krand() & 63)), TILE_GLASSPIECES + (j % 3), -32, 36, 36, a, 32 + (krand() & 63), 1024 - (krand() & 2047), actor, 5);
if (k) k->spr.pal = krand() & 15;
}
return;