- renamed ActorZOfMiddle

This commit is contained in:
Christoph Oelckers 2022-10-05 17:57:38 +02:00
parent 360e01a778
commit cdff2b12cc
7 changed files with 42 additions and 42 deletions

View file

@ -615,7 +615,7 @@ int DoCoolgMatchPlayerZ(DSWActor* actor)
// actor does a sine wave about sz - this is the z mid point // actor does a sine wave about sz - this is the z mid point
zdiff = (ActorZOfMiddle(actor->user.targetActor)) - actor->user.pos.Z; zdiff = (int_ActorZOfMiddle(actor->user.targetActor)) - actor->user.pos.Z;
// check z diff of the player and the sprite // check z diff of the player and the sprite
zdist = Z(20 + RandomRange(100)); // put a random amount zdist = Z(20 + RandomRange(100)); // put a random amount

View file

@ -2021,7 +2021,7 @@ inline int ActorZOfBottom(DSWActor* actor)
return GetSpriteZOfBottom(&actor->spr); return GetSpriteZOfBottom(&actor->spr);
} }
inline int ActorZOfMiddle(DSWActor* actor) inline int int_ActorZOfMiddle(DSWActor* actor)
{ {
return (ActorZOfTop(actor) + ActorZOfBottom(actor)) >> 1; return (ActorZOfTop(actor) + ActorZOfBottom(actor)) >> 1;
} }

View file

@ -345,7 +345,7 @@ int DoHornetMatchPlayerZ(DSWActor* actor)
// actor does a sine wave about actor->user.sz - this is the z mid point // actor does a sine wave about actor->user.sz - this is the z mid point
zdiff = (ActorZOfMiddle(actor->user.targetActor)) - actor->user.pos.Z; zdiff = (int_ActorZOfMiddle(actor->user.targetActor)) - actor->user.pos.Z;
// check z diff of the player and the sprite // check z diff of the player and the sprite
zdist = Z(20 + RandomRange(200)); // put a random amount zdist = Z(20 + RandomRange(200)); // put a random amount

View file

@ -293,7 +293,7 @@ int DoWallBloodDrip(DSWActor* actor)
void SpawnMidSplash(DSWActor* actor) void SpawnMidSplash(DSWActor* actor)
{ {
auto actorNew = SpawnActor(STAT_MISSILE, GOREDrip, s_GoreSplash, actor->sector(), auto actorNew = SpawnActor(STAT_MISSILE, GOREDrip, s_GoreSplash, actor->sector(),
actor->int_pos().X, actor->int_pos().Y, ActorZOfMiddle(actor), actor->int_ang(), 0); actor->int_pos().X, actor->int_pos().Y, int_ActorZOfMiddle(actor), actor->int_ang(), 0);
actorNew->spr.shade = -12; actorNew->spr.shade = -12;
actorNew->spr.xrepeat = 70-RandomRange(20); actorNew->spr.xrepeat = 70-RandomRange(20);
@ -1918,7 +1918,7 @@ int DoCarryFlag(DSWActor* actor)
// if no Owner then die // if no Owner then die
if (attached != nullptr) if (attached != nullptr)
{ {
vec3_t pos = { attached->int_pos().X, attached->int_pos().Y, ActorZOfMiddle(attached) }; vec3_t pos = { attached->int_pos().X, attached->int_pos().Y, int_ActorZOfMiddle(attached) };
SetActorZ(actor, &pos); SetActorZ(actor, &pos);
actor->set_int_ang(NORM_ANGLE(attached->int_ang() + 1536)); actor->set_int_ang(NORM_ANGLE(attached->int_ang() + 1536));
} }
@ -2067,7 +2067,7 @@ int DoCarryFlagNoDet(DSWActor* actor)
// if no Owner then die // if no Owner then die
if (attached != nullptr) if (attached != nullptr)
{ {
vec3_t pos = { attached->int_pos().X, attached->int_pos().Y, ActorZOfMiddle(attached) }; vec3_t pos = { attached->int_pos().X, attached->int_pos().Y, int_ActorZOfMiddle(attached) };
SetActorZ(actor, &pos); SetActorZ(actor, &pos);
actor->set_int_ang(NORM_ANGLE(attached->int_ang() + 1536)); actor->set_int_ang(NORM_ANGLE(attached->int_ang() + 1536));
actor->set_int_z(attached->int_pos().Z - (ActorSizeZ(attached) >> 1)); actor->set_int_z(attached->int_pos().Z - (ActorSizeZ(attached) >> 1));
@ -2162,7 +2162,7 @@ int SpawnShell(DSWActor* actor, int ShellNum)
nx = actor->int_pos().X; nx = actor->int_pos().X;
ny = actor->int_pos().Y; ny = actor->int_pos().Y;
nz = ActorZOfMiddle(actor); nz = int_ActorZOfMiddle(actor);
switch (ShellNum) switch (ShellNum)
{ {

View file

@ -146,7 +146,7 @@ int DoToiletGirl(DSWActor* actor)
bool ICanSee = false; bool ICanSee = false;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector()); ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,int_ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,int_ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector());
if (actor->user.FlagOwner != 1) if (actor->user.FlagOwner != 1)
{ {
@ -199,7 +199,7 @@ int NullToiletGirl(DSWActor* actor)
bool ICanSee = false; bool ICanSee = false;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,actor->user.targetActor->int_pos().Z,actor->user.targetActor->sector()); ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,int_ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,actor->user.targetActor->int_pos().Z,actor->user.targetActor->sector());
if (!(actor->user.Flags & SPR_CLIMBING)) if (!(actor->user.Flags & SPR_CLIMBING))
KeepActorOnFloor(actor); KeepActorOnFloor(actor);
@ -366,7 +366,7 @@ int DoWashGirl(DSWActor* actor)
bool ICanSee = false; bool ICanSee = false;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector()); ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,int_ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,int_ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector());
if (RandomRange(1000) > 980 && actor->user.ShellNum <= 0) if (RandomRange(1000) > 980 && actor->user.ShellNum <= 0)
{ {
@ -428,7 +428,7 @@ int NullWashGirl(DSWActor* actor)
bool ICanSee = false; bool ICanSee = false;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,actor->user.targetActor->int_pos().Z,actor->user.targetActor->sector()); ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,int_ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,actor->user.targetActor->int_pos().Z,actor->user.targetActor->sector());
if (!(actor->user.Flags & SPR_CLIMBING)) if (!(actor->user.Flags & SPR_CLIMBING))
KeepActorOnFloor(actor); KeepActorOnFloor(actor);
@ -1154,7 +1154,7 @@ int DoCarGirl(DSWActor* actor)
bool ICanSee = false; bool ICanSee = false;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector()); ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,int_ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,int_ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector());
if (actor->user.FlagOwner == 1) if (actor->user.FlagOwner == 1)
{ {
@ -1198,7 +1198,7 @@ int NullCarGirl(DSWActor* actor)
bool ICanSee = false; bool ICanSee = false;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,actor->user.targetActor->int_pos().Z,actor->user.targetActor->sector()); ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,int_ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,actor->user.targetActor->int_pos().Z,actor->user.targetActor->sector());
if (!(actor->user.Flags & SPR_CLIMBING)) if (!(actor->user.Flags & SPR_CLIMBING))
KeepActorOnFloor(actor); KeepActorOnFloor(actor);
@ -1354,7 +1354,7 @@ int DoMechanicGirl(DSWActor* actor)
bool ICanSee = false; bool ICanSee = false;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector()); ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,int_ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,int_ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector());
if (actor->user.FlagOwner == 1) if (actor->user.FlagOwner == 1)
{ {
@ -1398,7 +1398,7 @@ int NullMechanicGirl(DSWActor* actor)
bool ICanSee = false; bool ICanSee = false;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,actor->user.targetActor->int_pos().Z,actor->user.targetActor->sector()); ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,int_ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,actor->user.targetActor->int_pos().Z,actor->user.targetActor->sector());
if (!(actor->user.Flags & SPR_CLIMBING)) if (!(actor->user.Flags & SPR_CLIMBING))
KeepActorOnFloor(actor); KeepActorOnFloor(actor);
@ -1555,7 +1555,7 @@ int DoSailorGirl(DSWActor* actor)
bool ICanSee = false; bool ICanSee = false;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector()); ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,int_ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,int_ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector());
if (actor->user.FlagOwner == 1) if (actor->user.FlagOwner == 1)
{ {
@ -1604,7 +1604,7 @@ int NullSailorGirl(DSWActor* actor)
static short alreadythrew = 0; static short alreadythrew = 0;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,actor->user.targetActor->int_pos().Z,actor->user.targetActor->sector()); ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,int_ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,actor->user.targetActor->int_pos().Z,actor->user.targetActor->sector());
if (!(actor->user.Flags & SPR_CLIMBING)) if (!(actor->user.Flags & SPR_CLIMBING))
KeepActorOnFloor(actor); KeepActorOnFloor(actor);
@ -1748,7 +1748,7 @@ int DoPruneGirl(DSWActor* actor)
bool ICanSee = false; bool ICanSee = false;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector()); ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,int_ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,int_ActorZOfMiddle(actor->user.targetActor),actor->user.targetActor->sector());
if (actor->user.FlagOwner == 1) if (actor->user.FlagOwner == 1)
{ {
@ -1808,7 +1808,7 @@ int NullPruneGirl(DSWActor* actor)
bool ICanSee = false; bool ICanSee = false;
DoActorPickClosePlayer(actor); DoActorPickClosePlayer(actor);
ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,actor->user.targetActor->int_pos().Z,actor->user.targetActor->sector()); ICanSee = FAFcansee(actor->int_pos().X,actor->int_pos().Y,int_ActorZOfMiddle(actor),actor->sector(),actor->user.targetActor->int_pos().X,actor->user.targetActor->int_pos().Y,actor->user.targetActor->int_pos().Z,actor->user.targetActor->sector());
if (!(actor->user.Flags & SPR_CLIMBING)) if (!(actor->user.Flags & SPR_CLIMBING))
KeepActorOnFloor(actor); KeepActorOnFloor(actor);

View file

@ -3518,7 +3518,7 @@ int ActorCoughItem(DSWActor* actor)
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS); actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
actorNew->spr.cstat = 0; actorNew->spr.cstat = 0;
actorNew->spr.extra = 0; actorNew->spr.extra = 0;
actorNew->set_int_pos({ actor->int_pos().X, actor->int_pos().Y, ActorZOfMiddle(actor) }); actorNew->set_int_pos({ actor->int_pos().X, actor->int_pos().Y, int_ActorZOfMiddle(actor) });
actorNew->set_int_ang(0); actorNew->set_int_ang(0);
actorNew->spr.extra = 0; actorNew->spr.extra = 0;
@ -3557,7 +3557,7 @@ int ActorCoughItem(DSWActor* actor)
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS); actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
actorNew->spr.cstat = 0; actorNew->spr.cstat = 0;
actorNew->spr.extra = 0; actorNew->spr.extra = 0;
actorNew->set_int_pos({ actor->int_pos().X, actor->int_pos().Y, ActorZOfMiddle(actor) }); actorNew->set_int_pos({ actor->int_pos().X, actor->int_pos().Y, int_ActorZOfMiddle(actor) });
actorNew->set_int_ang(0); actorNew->set_int_ang(0);
actorNew->spr.extra = 0; actorNew->spr.extra = 0;
@ -3583,7 +3583,7 @@ int ActorCoughItem(DSWActor* actor)
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS); actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
actorNew->spr.cstat = 0; actorNew->spr.cstat = 0;
actorNew->spr.extra = 0; actorNew->spr.extra = 0;
actorNew->set_int_pos({ actor->int_pos().X, actor->int_pos().Y, ActorZOfMiddle(actor) }); actorNew->set_int_pos({ actor->int_pos().X, actor->int_pos().Y, int_ActorZOfMiddle(actor) });
actorNew->set_int_ang(0); actorNew->set_int_ang(0);
actorNew->spr.extra = 0; actorNew->spr.extra = 0;
@ -3612,7 +3612,7 @@ int ActorCoughItem(DSWActor* actor)
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS); actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
actorNew->spr.cstat = 0; actorNew->spr.cstat = 0;
actorNew->spr.extra = 0; actorNew->spr.extra = 0;
actorNew->set_int_pos({ actor->int_pos().X, actor->int_pos().Y, ActorZOfMiddle(actor) }); actorNew->set_int_pos({ actor->int_pos().X, actor->int_pos().Y, int_ActorZOfMiddle(actor) });
actorNew->set_int_ang(0); actorNew->set_int_ang(0);
actorNew->spr.extra = 0; actorNew->spr.extra = 0;
@ -3672,7 +3672,7 @@ int ActorCoughItem(DSWActor* actor)
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS); actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
actorNew->spr.cstat = 0; actorNew->spr.cstat = 0;
actorNew->spr.extra = 0; actorNew->spr.extra = 0;
actorNew->set_int_pos({ actor->int_pos().X, actor->int_pos().Y, ActorZOfMiddle(actor) }); actorNew->set_int_pos({ actor->int_pos().X, actor->int_pos().Y, int_ActorZOfMiddle(actor) });
actorNew->set_int_ang(0); actorNew->set_int_ang(0);
actorNew->spr.extra = 0; actorNew->spr.extra = 0;
@ -5840,7 +5840,7 @@ KeyMain:
actorNew->spr.cstat &= ~(CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); actorNew->spr.cstat &= ~(CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
actorNew->spr.cstat |= (CSTAT_SPRITE_ALIGNMENT_WALL); actorNew->spr.cstat |= (CSTAT_SPRITE_ALIGNMENT_WALL);
SetAttach(pp->actor, actorNew); SetAttach(pp->actor, actorNew);
actorNew->user.pos.Z = ActorZOfMiddle(pp->actor); // Set mid way up who it hit actorNew->user.pos.Z = int_ActorZOfMiddle(pp->actor); // Set mid way up who it hit
actorNew->user.spal = actorNew->spr.pal = actor->spr.pal; // Set the palette of the flag actorNew->user.spal = actorNew->spr.pal = actor->spr.pal; // Set the palette of the flag
SetOwner(pp->actor, actorNew); // Player now owns the flag SetOwner(pp->actor, actorNew); // Player now owns the flag

View file

@ -4469,7 +4469,7 @@ int DoFireballFlames(DSWActor* actor)
DSWActor* attach = actor->user.attachActor; DSWActor* attach = actor->user.attachActor;
if (attach != nullptr) if (attach != nullptr)
{ {
actor->set_int_pos({ attach->int_pos().X, attach->int_pos().Y, ActorZOfMiddle(attach) }); actor->set_int_pos({ attach->int_pos().X, attach->int_pos().Y, int_ActorZOfMiddle(attach) });
if ((attach->spr.extra & SPRX_BURNABLE)) if ((attach->spr.extra & SPRX_BURNABLE))
{ {
@ -7092,7 +7092,7 @@ int DoFlamesDamageTest(DSWActor* actor)
if (actor->user.Radius > 200) // Note: No weaps have bigger radius than 200 cept explosion stuff if (actor->user.Radius > 200) // Note: No weaps have bigger radius than 200 cept explosion stuff
{ {
if (FAFcansee(itActor->int_pos().X,itActor->int_pos().Y,ActorZOfMiddle(actor),itActor->sector(),actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector())) if (FAFcansee(itActor->int_pos().X,itActor->int_pos().Y,int_ActorZOfMiddle(actor),itActor->sector(),actor->int_pos().X,actor->int_pos().Y,int_ActorZOfMiddle(actor),actor->sector()))
{ {
DoDamage(itActor, actor); DoDamage(itActor, actor);
} }
@ -7262,11 +7262,11 @@ int DoExpDamageTest(DSWActor* actor)
if ((unsigned)dist > actor->user.Radius) if ((unsigned)dist > actor->user.Radius)
continue; continue;
dist = FindDistance3D(itActor->int_pos().X - actor->int_pos().X, itActor->int_pos().Y - actor->int_pos().Y, ActorZOfMiddle(itActor) - actor->int_pos().Z); dist = FindDistance3D(itActor->int_pos().X - actor->int_pos().X, itActor->int_pos().Y - actor->int_pos().Y, int_ActorZOfMiddle(itActor) - actor->int_pos().Z);
if ((unsigned)dist > actor->user.Radius) if ((unsigned)dist > actor->user.Radius)
continue; continue;
if (!FAFcansee(itActor->int_pos().X, itActor->int_pos().Y, ActorZOfMiddle(itActor), itActor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector())) if (!FAFcansee(itActor->int_pos().X, itActor->int_pos().Y, int_ActorZOfMiddle(itActor), itActor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector()))
continue; continue;
if ((itActor->spr.extra & SPRX_BREAKABLE)) if ((itActor->spr.extra & SPRX_BREAKABLE))
@ -10335,7 +10335,7 @@ void SpawnGrenadeExp(DSWActor* actor)
{ {
dx += RandomRange(1000)-RandomRange(1000); dx += RandomRange(1000)-RandomRange(1000);
dy += RandomRange(1000)-RandomRange(1000); dy += RandomRange(1000)-RandomRange(1000);
dz = ActorZOfMiddle(actor) + RandomRange(1000)-RandomRange(1000); dz = int_ActorZOfMiddle(actor) + RandomRange(1000)-RandomRange(1000);
} }
auto expActor = SpawnActor(STAT_MISSILE, GRENADE_EXP, s_GrenadeExp, actor->sector(), auto expActor = SpawnActor(STAT_MISSILE, GRENADE_EXP, s_GrenadeExp, actor->sector(),
@ -11147,7 +11147,7 @@ int DoRing(DSWActor* actor)
if (pp) if (pp)
z = pp->pos.Z + Z(20); z = pp->pos.Z + Z(20);
else else
z = ActorZOfMiddle(own) + Z(30); z = int_ActorZOfMiddle(own) + Z(30);
actor->set_int_pos({ own->int_pos().X, own->int_pos().Y, z }); actor->set_int_pos({ own->int_pos().X, own->int_pos().Y, z });
@ -11845,7 +11845,7 @@ int InitSwordAttack(PLAYER* pp)
{ {
if (SpriteOverlapZ(pp->actor, itActor, Z(20))) if (SpriteOverlapZ(pp->actor, itActor, Z(20)))
{ {
if (FAFcansee(itActor->int_pos().X, itActor->int_pos().Y, ActorZOfMiddle(itActor), itActor->sector(), plActor->int_pos().X, plActor->int_pos().Y, ActorZOfMiddle(plActor), plActor->sector())) if (FAFcansee(itActor->int_pos().X, itActor->int_pos().Y, int_ActorZOfMiddle(itActor), itActor->sector(), plActor->int_pos().X, plActor->int_pos().Y, int_ActorZOfMiddle(plActor), plActor->sector()))
DoDamage(itActor, pp->actor); DoDamage(itActor, pp->actor);
} }
} }
@ -12021,7 +12021,7 @@ int InitFistAttack(PLAYER* pp)
{ {
if (SpriteOverlapZ(pp->actor, itActor, Z(20)) || face == 190) if (SpriteOverlapZ(pp->actor, itActor, Z(20)) || face == 190)
{ {
if (FAFcansee(itActor->int_pos().X, itActor->int_pos().Y, ActorZOfMiddle(itActor), itActor->sector(), plActor->int_pos().X, plActor->int_pos().Y, ActorZOfMiddle(plActor), plActor->sector())) if (FAFcansee(itActor->int_pos().X, itActor->int_pos().Y, int_ActorZOfMiddle(itActor), itActor->sector(), plActor->int_pos().X, plActor->int_pos().Y, int_ActorZOfMiddle(plActor), plActor->sector()))
DoDamage(itActor, plActor); DoDamage(itActor, plActor);
if (face == 190) if (face == 190)
{ {
@ -12236,7 +12236,7 @@ int InitSumoSkull(DSWActor* actor)
PlaySound(DIGI_SERPSUMMONHEADS, actor, v3df_none); PlaySound(DIGI_SERPSUMMONHEADS, actor, v3df_none);
auto actorNew = SpawnActor(STAT_ENEMY, SKULL_R0, &s_SkullWait[0][0], actor->sector(), actor->int_pos().X, actor->int_pos().Y, ActorZOfMiddle(actor), actor->int_ang(), 0); auto actorNew = SpawnActor(STAT_ENEMY, SKULL_R0, &s_SkullWait[0][0], actor->sector(), actor->int_pos().X, actor->int_pos().Y, int_ActorZOfMiddle(actor), actor->int_ang(), 0);
actorNew->spr.xvel = 500; actorNew->spr.xvel = 500;
SetOwner(actor, actorNew); SetOwner(actor, actorNew);
@ -12299,7 +12299,7 @@ int InitSumoStompAttack(DSWActor* actor)
if (dist < CloseRangeDist(itActor, actor, reach)) if (dist < CloseRangeDist(itActor, actor, reach))
{ {
if (FAFcansee(itActor->int_pos().X, itActor->int_pos().Y, ActorZOfMiddle(itActor), itActor->sector(), actor->int_pos().X, actor->int_pos().Y, ActorZOfMiddle(actor), actor->sector())) if (FAFcansee(itActor->int_pos().X, itActor->int_pos().Y, int_ActorZOfMiddle(itActor), itActor->sector(), actor->int_pos().X, actor->int_pos().Y, int_ActorZOfMiddle(actor), actor->sector()))
DoDamage(itActor, actor); DoDamage(itActor, actor);
} }
} }
@ -12325,7 +12325,7 @@ int InitMiniSumoClap(DSWActor* actor)
{ {
if (SpriteOverlapZ(actor, targetActor, Z(20))) if (SpriteOverlapZ(actor, targetActor, Z(20)))
{ {
if (FAFcansee(targetActor->int_pos().X, targetActor->int_pos().Y, ActorZOfMiddle(targetActor), targetActor->sector(), actor->int_pos().X, actor->int_pos().Y, ActorZOfMiddle(actor), actor->sector())) if (FAFcansee(targetActor->int_pos().X, targetActor->int_pos().Y, int_ActorZOfMiddle(targetActor), targetActor->sector(), actor->int_pos().X, actor->int_pos().Y, int_ActorZOfMiddle(actor), actor->sector()))
{ {
PlaySound(DIGI_CGTHIGHBONE, actor, v3df_follow | v3df_dontpan); PlaySound(DIGI_CGTHIGHBONE, actor, v3df_follow | v3df_dontpan);
DoDamage(targetActor, actor); DoDamage(targetActor, actor);
@ -12334,7 +12334,7 @@ int InitMiniSumoClap(DSWActor* actor)
} }
else if (dist < CloseRangeDist(targetActor, actor, reach)) else if (dist < CloseRangeDist(targetActor, actor, reach))
{ {
if (FAFcansee(targetActor->int_pos().X, targetActor->int_pos().Y, ActorZOfMiddle(targetActor), targetActor->sector(), actor->int_pos().X, actor->int_pos().Y, ActorZOfMiddle(actor), actor->sector())) if (FAFcansee(targetActor->int_pos().X, targetActor->int_pos().Y, int_ActorZOfMiddle(targetActor), targetActor->sector(), actor->int_pos().X, actor->int_pos().Y, int_ActorZOfMiddle(actor), actor->sector()))
{ {
PlaySound(DIGI_30MMEXPLODE, actor, v3df_none); PlaySound(DIGI_30MMEXPLODE, actor, v3df_none);
SpawnFireballFlames(actor, targetActor); SpawnFireballFlames(actor, targetActor);
@ -13936,7 +13936,7 @@ int DoStaticFlamesDamage(DSWActor* actor)
DoDamage(itActor, actor); DoDamage(itActor, actor);
else if (actor->user.Radius > 200) else if (actor->user.Radius > 200)
{ {
if (FAFcansee(actor->int_pos().X,actor->int_pos().Y,ActorZOfMiddle(actor),actor->sector(),itActor->int_pos().X,itActor->int_pos().Y,ActorZOfMiddle(itActor),itActor->sector())) if (FAFcansee(actor->int_pos().X,actor->int_pos().Y,int_ActorZOfMiddle(actor),actor->sector(),itActor->int_pos().X,itActor->int_pos().Y,int_ActorZOfMiddle(itActor),itActor->sector()))
DoDamage(itActor, actor); DoDamage(itActor, actor);
} }
} }
@ -14117,7 +14117,7 @@ int SpawnDemonFist(DSWActor* actor)
return -1; return -1;
auto expActor = SpawnActor(STAT_MISSILE, 0, s_TeleportEffect, actor->sector(), auto expActor = SpawnActor(STAT_MISSILE, 0, s_TeleportEffect, actor->sector(),
actor->int_pos().X, actor->int_pos().Y, ActorZOfMiddle(actor), actor->int_ang(), 0); actor->int_pos().X, actor->int_pos().Y, int_ActorZOfMiddle(actor), actor->int_ang(), 0);
expActor->spr.hitag = LUMINOUS; //Always full brightness expActor->spr.hitag = LUMINOUS; //Always full brightness
expActor->spr.shade = -40; expActor->spr.shade = -40;
@ -14442,7 +14442,7 @@ int InitEnemyStar(DSWActor* actor)
nx = actor->int_pos().X; nx = actor->int_pos().X;
ny = actor->int_pos().Y; ny = actor->int_pos().Y;
nz = ActorZOfMiddle(actor); nz = int_ActorZOfMiddle(actor);
// Spawn a shot // Spawn a shot
auto actorNew = SpawnActor(STAT_MISSILE, STAR1, s_Star, actor->sector(), auto actorNew = SpawnActor(STAT_MISSILE, STAR1, s_Star, actor->sector(),
@ -14481,7 +14481,7 @@ int InitEnemyCrossbow(DSWActor* actor)
nx = actor->int_pos().X; nx = actor->int_pos().X;
ny = actor->int_pos().Y; ny = actor->int_pos().Y;
nz = ActorZOfMiddle(actor)-Z(14); nz = int_ActorZOfMiddle(actor)-Z(14);
// Spawn a shot // Spawn a shot
auto actorNew = SpawnActor(STAT_MISSILE, CROSSBOLT, &s_CrossBolt[0][0], actor->sector(), auto actorNew = SpawnActor(STAT_MISSILE, CROSSBOLT, &s_CrossBolt[0][0], actor->sector(),
@ -14802,7 +14802,7 @@ void InitSpearTrap(DSWActor* actor)
nx = actor->int_pos().X; nx = actor->int_pos().X;
ny = actor->int_pos().Y; ny = actor->int_pos().Y;
nz = ActorZOfMiddle(actor); nz = int_ActorZOfMiddle(actor);
// Spawn a shot // Spawn a shot
auto actorNew = SpawnActor(STAT_MISSILE, CROSSBOLT, &s_CrossBolt[0][0], actor->sector(), nx, ny, nz, actor->int_ang(), 750); auto actorNew = SpawnActor(STAT_MISSILE, CROSSBOLT, &s_CrossBolt[0][0], actor->sector(), nx, ny, nz, actor->int_ang(), 750);