mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- deleted PLAYER::Actor()
Also made actor a regular pointer. Unlike the other ones this may not be prematurely nulled ever.
This commit is contained in:
parent
d340a7e80c
commit
bf3f580d52
15 changed files with 212 additions and 217 deletions
|
@ -293,7 +293,7 @@ int DoActorPickClosePlayer(DSWActor* actor)
|
||||||
goto TARGETACTOR;
|
goto TARGETACTOR;
|
||||||
|
|
||||||
// Set initial target to Player 0
|
// Set initial target to Player 0
|
||||||
actor->user.targetActor = Player->Actor();
|
actor->user.targetActor = Player->actor;
|
||||||
|
|
||||||
if (TEST(actor->user.Flags2, SPR2_DONT_TARGET_OWNER))
|
if (TEST(actor->user.Flags2, SPR2_DONT_TARGET_OWNER))
|
||||||
{
|
{
|
||||||
|
|
|
@ -216,7 +216,7 @@ static void WeaponCheat(int player)
|
||||||
p->WpnRocketHeat = 5;
|
p->WpnRocketHeat = 5;
|
||||||
p->WpnRocketNuke = 1;
|
p->WpnRocketNuke = 1;
|
||||||
|
|
||||||
PlayerUpdateWeapon(p, p->Actor()->user.WeaponNum);
|
PlayerUpdateWeapon(p, p->actor->user.WeaponNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ItemCheat(int player)
|
static void ItemCheat(int player)
|
||||||
|
@ -265,9 +265,9 @@ static void cmd_Give(int player, uint8_t** stream, bool skip)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIVE_HEALTH:
|
case GIVE_HEALTH:
|
||||||
if (Player[player].Actor()->user.Health < Player[player].MaxHealth)
|
if (Player[player].actor->user.Health < Player[player].MaxHealth)
|
||||||
{
|
{
|
||||||
Player[player].Actor()->user.Health += 25;
|
Player[player].actor->user.Health += 25;
|
||||||
PutStringInfo(&Player[player], GStrings("TXTS_ADDEDHEALTH"));
|
PutStringInfo(&Player[player], GStrings("TXTS_ADDEDHEALTH"));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -294,7 +294,7 @@ static void cmd_Give(int player, uint8_t** stream, bool skip)
|
||||||
}
|
}
|
||||||
|
|
||||||
case GIVE_ARMOR:
|
case GIVE_ARMOR:
|
||||||
if (Player[player].Actor()->user.Health < Player[player].MaxHealth)
|
if (Player[player].actor->user.Health < Player[player].MaxHealth)
|
||||||
{
|
{
|
||||||
Player[player].Armor = 100;
|
Player[player].Armor = 100;
|
||||||
PutStringInfo(&Player[player], GStrings("TXTB_FULLARM"));
|
PutStringInfo(&Player[player], GStrings("TXTB_FULLARM"));
|
||||||
|
|
|
@ -765,7 +765,7 @@ void analyzesprites(tspritetype* tsprite, int& spritesortcnt, int viewx, int vie
|
||||||
ShadeSprite(tsp);
|
ShadeSprite(tsp);
|
||||||
|
|
||||||
// sw if its your playersprite
|
// sw if its your playersprite
|
||||||
if (Player[screenpeek].Actor() == tActor)
|
if (Player[screenpeek].actor == tActor)
|
||||||
{
|
{
|
||||||
pp = Player + screenpeek;
|
pp = Player + screenpeek;
|
||||||
if (display_mirror || TEST(pp->Flags, PF_VIEW_FROM_OUTSIDE|PF_VIEW_FROM_CAMERA))
|
if (display_mirror || TEST(pp->Flags, PF_VIEW_FROM_OUTSIDE|PF_VIEW_FROM_CAMERA))
|
||||||
|
@ -868,7 +868,7 @@ void analyzesprites(tspritetype* tsprite, int& spritesortcnt, int viewx, int vie
|
||||||
{
|
{
|
||||||
if (TEST(tActor->user.Flags2, SPR2_VIS_SHADING))
|
if (TEST(tActor->user.Flags2, SPR2_VIS_SHADING))
|
||||||
{
|
{
|
||||||
if (Player[screenpeek].Actor() != tActor)
|
if (Player[screenpeek].actor != tActor)
|
||||||
{
|
{
|
||||||
if (!TEST(tActor->user.PlayerP->Flags, PF_VIEW_FROM_OUTSIDE))
|
if (!TEST(tActor->user.PlayerP->Flags, PF_VIEW_FROM_OUTSIDE))
|
||||||
{
|
{
|
||||||
|
@ -1059,7 +1059,7 @@ void PrintSpriteInfo(PLAYERp pp)
|
||||||
|
|
||||||
//if (SpriteInfo && !LocationInfo)
|
//if (SpriteInfo && !LocationInfo)
|
||||||
{
|
{
|
||||||
auto actor = DoPickTarget(pp->Actor(), 32, 2);
|
auto actor = DoPickTarget(pp->actor, 32, 2);
|
||||||
|
|
||||||
actor->spr.hitag = 9997; // Special tag to make the actor glow red for one frame
|
actor->spr.hitag = 9997; // Special tag to make the actor glow red for one frame
|
||||||
|
|
||||||
|
@ -1477,10 +1477,10 @@ void drawscreen(PLAYERp pp, double smoothratio)
|
||||||
{
|
{
|
||||||
tz -= 8448;
|
tz -= 8448;
|
||||||
|
|
||||||
if (!calcChaseCamPos(&tx, &ty, &tz, pp->Actor(), &tsect, tang, thoriz, smoothratio))
|
if (!calcChaseCamPos(&tx, &ty, &tz, pp->actor, &tsect, tang, thoriz, smoothratio))
|
||||||
{
|
{
|
||||||
tz += 8448;
|
tz += 8448;
|
||||||
calcChaseCamPos(&tx, &ty, &tz, pp->Actor(), &tsect, tang, thoriz, smoothratio);
|
calcChaseCamPos(&tx, &ty, &tz, pp->actor, &tsect, tang, thoriz, smoothratio);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1520,7 +1520,7 @@ void drawscreen(PLAYERp pp, double smoothratio)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UpdateWallPortalState();
|
UpdateWallPortalState();
|
||||||
render_drawrooms(pp->Actor(), { tx, ty, tz }, sectnum(tsect), tang, thoriz, trotscrnang, smoothratio);
|
render_drawrooms(pp->actor, { tx, ty, tz }, sectnum(tsect), tang, thoriz, trotscrnang, smoothratio);
|
||||||
RestorePortalState();
|
RestorePortalState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1633,7 +1633,7 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int cposx, int cposy, int
|
||||||
|
|
||||||
|
|
||||||
// Draw sprites
|
// Draw sprites
|
||||||
auto peekActor = Player[screenpeek].Actor();
|
auto peekActor = Player[screenpeek].actor;
|
||||||
for (unsigned i = 0; i < sector.Size(); i++)
|
for (unsigned i = 0; i < sector.Size(); i++)
|
||||||
{
|
{
|
||||||
SWSectIterator it(i);
|
SWSectIterator it(i);
|
||||||
|
@ -1641,7 +1641,7 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int cposx, int cposy, int
|
||||||
{
|
{
|
||||||
for (p = connecthead; p >= 0; p = connectpoint2[p])
|
for (p = connecthead; p >= 0; p = connectpoint2[p])
|
||||||
{
|
{
|
||||||
if (Player[p].Actor() == actor)
|
if (Player[p].actor == actor)
|
||||||
{
|
{
|
||||||
if (actor->spr.xvel > 16)
|
if (actor->spr.xvel > 16)
|
||||||
pspr_ndx[myconnectindex] = ((PlayClock >> 4) & 3);
|
pspr_ndx[myconnectindex] = ((PlayClock >> 4) & 3);
|
||||||
|
@ -1673,7 +1673,7 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int cposx, int cposy, int
|
||||||
switch (actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK)
|
switch (actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK)
|
||||||
{
|
{
|
||||||
case 0: // Regular sprite
|
case 0: // Regular sprite
|
||||||
if (Player[p].Actor() == actor)
|
if (Player[p].actor == actor)
|
||||||
{
|
{
|
||||||
ox = mx - cposx;
|
ox = mx - cposx;
|
||||||
oy = my - cposy;
|
oy = my - cposy;
|
||||||
|
@ -1692,7 +1692,7 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int cposx, int cposy, int
|
||||||
int spnum = -1;
|
int spnum = -1;
|
||||||
if (sprisplayer)
|
if (sprisplayer)
|
||||||
{
|
{
|
||||||
if (gNet.MultiGameType != MULTI_GAME_COMMBAT || actor == Player[screenpeek].Actor())
|
if (gNet.MultiGameType != MULTI_GAME_COMMBAT || actor == Player[screenpeek].actor)
|
||||||
spnum = 1196 + pspr_ndx[myconnectindex];
|
spnum = 1196 + pspr_ndx[myconnectindex];
|
||||||
}
|
}
|
||||||
else spnum = actor->spr.picnum;
|
else spnum = actor->spr.picnum;
|
||||||
|
|
|
@ -614,7 +614,7 @@ struct PLAYERstruct
|
||||||
// variable that fit in the sprite or user structure
|
// variable that fit in the sprite or user structure
|
||||||
vec3_t pos, opos;
|
vec3_t pos, opos;
|
||||||
|
|
||||||
TObjPtr<DSWActor*> actor;
|
DSWActor* actor; // this may not be a TObjPtr!
|
||||||
TObjPtr<DSWActor*> lowActor, highActor;
|
TObjPtr<DSWActor*> lowActor, highActor;
|
||||||
TObjPtr<DSWActor*> remoteActor;
|
TObjPtr<DSWActor*> remoteActor;
|
||||||
TObjPtr<DSWActor*> PlayerUnderActor;
|
TObjPtr<DSWActor*> PlayerUnderActor;
|
||||||
|
@ -622,11 +622,6 @@ struct PLAYERstruct
|
||||||
TObjPtr<DSWActor*> HitBy; // Sprite num of whatever player was last hit by
|
TObjPtr<DSWActor*> HitBy; // Sprite num of whatever player was last hit by
|
||||||
TObjPtr<DSWActor*> last_camera_act;
|
TObjPtr<DSWActor*> last_camera_act;
|
||||||
|
|
||||||
DSWActor* Actor()
|
|
||||||
{
|
|
||||||
return actor;
|
|
||||||
}
|
|
||||||
|
|
||||||
// holds last valid move position
|
// holds last valid move position
|
||||||
int lv_x,lv_y,lv_z;
|
int lv_x,lv_y,lv_z;
|
||||||
|
|
||||||
|
|
|
@ -160,7 +160,7 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju
|
||||||
{
|
{
|
||||||
PLAYERp pp = &Player[myconnectindex];
|
PLAYERp pp = &Player[myconnectindex];
|
||||||
|
|
||||||
if (paused || M_Active() || pp->Actor() == nullptr)
|
if (paused || M_Active() || pp->actor == nullptr)
|
||||||
{
|
{
|
||||||
loc = {};
|
loc = {};
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1264,7 +1264,7 @@ int PlayerInitChemBomb(PLAYERp pp)
|
||||||
// actorNew->user.RotNum = 5;
|
// actorNew->user.RotNum = 5;
|
||||||
SET(actorNew->user.Flags, SPR_XFLIP_TOGGLE);
|
SET(actorNew->user.Flags, SPR_XFLIP_TOGGLE);
|
||||||
|
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->spr.yrepeat = 32;
|
actorNew->spr.yrepeat = 32;
|
||||||
actorNew->spr.xrepeat = 32;
|
actorNew->spr.xrepeat = 32;
|
||||||
actorNew->spr.shade = -15;
|
actorNew->spr.shade = -15;
|
||||||
|
@ -1426,7 +1426,7 @@ int PlayerInitFlashBomb(PLAYERp pp)
|
||||||
SWStatIterator it(StatDamageList[stat]);
|
SWStatIterator it(StatDamageList[stat]);
|
||||||
while (auto itActor = it.Next())
|
while (auto itActor = it.Next())
|
||||||
{
|
{
|
||||||
if (itActor == pp->Actor())
|
if (itActor == pp->actor)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
DISTANCE(itActor->spr.pos.X, itActor->spr.pos.Y, actor->spr.pos.X, actor->spr.pos.Y, dist, tx, ty, tmin);
|
DISTANCE(itActor->spr.pos.X, itActor->spr.pos.Y, actor->spr.pos.X, actor->spr.pos.Y, dist, tx, ty, tmin);
|
||||||
|
@ -1439,7 +1439,7 @@ int PlayerInitFlashBomb(PLAYERp pp)
|
||||||
if (!FAFcansee(itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z - ActorSizeZ(actor), actor->spr.sector()))
|
if (!FAFcansee(itActor->spr.pos.X, itActor->spr.pos.Y, itActor->spr.pos.Z, itActor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z - ActorSizeZ(actor), actor->spr.sector()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
damage = GetDamage(itActor, pp->Actor(), DMG_FLASHBOMB);
|
damage = GetDamage(itActor, pp->actor, DMG_FLASHBOMB);
|
||||||
|
|
||||||
if (itActor->user.sop_parent)
|
if (itActor->user.sop_parent)
|
||||||
{
|
{
|
||||||
|
@ -1634,7 +1634,7 @@ int PlayerInitCaltrops(PLAYERp pp)
|
||||||
|
|
||||||
SET(actorNew->user.Flags, SPR_XFLIP_TOGGLE);
|
SET(actorNew->user.Flags, SPR_XFLIP_TOGGLE);
|
||||||
|
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->spr.yrepeat = 64;
|
actorNew->spr.yrepeat = 64;
|
||||||
actorNew->spr.xrepeat = 64;
|
actorNew->spr.xrepeat = 64;
|
||||||
actorNew->spr.shade = -15;
|
actorNew->spr.shade = -15;
|
||||||
|
|
|
@ -72,7 +72,7 @@ void InitNetPlayerOptions(void)
|
||||||
if (actor)
|
if (actor)
|
||||||
{
|
{
|
||||||
actor->spr.pal = PALETTE_PLAYER0 + pp->TeamColor;
|
actor->spr.pal = PALETTE_PLAYER0 + pp->TeamColor;
|
||||||
pp->Actor()->user.spal = actor->spr.pal;
|
pp->actor->user.spal = actor->spr.pal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2358,7 +2358,7 @@ void InitPlayerSprite(PLAYERp pp)
|
||||||
actor->spr.pal = PALETTE_PLAYER0 + pp->pnum;
|
actor->spr.pal = PALETTE_PLAYER0 + pp->pnum;
|
||||||
actor->user.spal = actor->spr.pal;
|
actor->user.spal = actor->spr.pal;
|
||||||
|
|
||||||
NewStateGroup(pp->Actor(), actor->user.ActorActionSet->Run);
|
NewStateGroup(pp->actor, actor->user.ActorActionSet->Run);
|
||||||
|
|
||||||
pp->PlayerUnderActor = nullptr;
|
pp->PlayerUnderActor = nullptr;
|
||||||
|
|
||||||
|
|
|
@ -394,7 +394,7 @@ void PlayerUpdateKills(PLAYERp pp, short value)
|
||||||
opp = Player + pnum;
|
opp = Player + pnum;
|
||||||
|
|
||||||
// for everyone on the same team
|
// for everyone on the same team
|
||||||
if (opp != pp && opp->Actor()->user.spal == pp->Actor()->user.spal)
|
if (opp != pp && opp->actor->user.spal == pp->actor->user.spal)
|
||||||
{
|
{
|
||||||
opp->Kills += value;
|
opp->Kills += value;
|
||||||
if (opp->Kills > 999)
|
if (opp->Kills > 999)
|
||||||
|
@ -2294,7 +2294,7 @@ void pUziFire(PANEL_SPRITEp psp)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SpawnVis(psp->PlayerP->Actor(), nullptr, -1, -1, -1, 32);
|
SpawnVis(psp->PlayerP->actor, nullptr, -1, -1, -1, 32);
|
||||||
|
|
||||||
if (!WeaponOK(psp->PlayerP))
|
if (!WeaponOK(psp->PlayerP))
|
||||||
return;
|
return;
|
||||||
|
@ -2399,14 +2399,14 @@ void SpawnUziShell(PANEL_SPRITEp psp)
|
||||||
// LEFT side
|
// LEFT side
|
||||||
pp->UziShellLeftAlt = !pp->UziShellLeftAlt;
|
pp->UziShellLeftAlt = !pp->UziShellLeftAlt;
|
||||||
if (pp->UziShellLeftAlt)
|
if (pp->UziShellLeftAlt)
|
||||||
SpawnShell(pp->Actor(),-3);
|
SpawnShell(pp->actor,-3);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// RIGHT side
|
// RIGHT side
|
||||||
pp->UziShellRightAlt = !pp->UziShellRightAlt;
|
pp->UziShellRightAlt = !pp->UziShellRightAlt;
|
||||||
if (pp->UziShellRightAlt)
|
if (pp->UziShellRightAlt)
|
||||||
SpawnShell(pp->Actor(),-2);
|
SpawnShell(pp->actor,-2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2462,7 +2462,7 @@ PANEL_STATE ps_ShotgunShell[] =
|
||||||
void SpawnShotgunShell(PANEL_SPRITEp psp)
|
void SpawnShotgunShell(PANEL_SPRITEp psp)
|
||||||
{
|
{
|
||||||
PLAYERp pp = psp->PlayerP;
|
PLAYERp pp = psp->PlayerP;
|
||||||
SpawnShell(pp->Actor(),-4);
|
SpawnShell(pp->actor,-4);
|
||||||
}
|
}
|
||||||
|
|
||||||
void pShotgunShell(PANEL_SPRITEp psp)
|
void pShotgunShell(PANEL_SPRITEp psp)
|
||||||
|
@ -2934,7 +2934,7 @@ void pShotgunAction(PANEL_SPRITEp psp)
|
||||||
|
|
||||||
void pShotgunFire(PANEL_SPRITEp psp)
|
void pShotgunFire(PANEL_SPRITEp psp)
|
||||||
{
|
{
|
||||||
SpawnVis(psp->PlayerP->Actor(), nullptr, -1, -1, -1, 32);
|
SpawnVis(psp->PlayerP->actor, nullptr, -1, -1, -1, 32);
|
||||||
InitShotgun(psp->PlayerP);
|
InitShotgun(psp->PlayerP);
|
||||||
//SpawnShotgunShell(psp);
|
//SpawnShotgunShell(psp);
|
||||||
}
|
}
|
||||||
|
@ -3292,7 +3292,7 @@ void pRailAction(PANEL_SPRITEp psp)
|
||||||
|
|
||||||
void pRailFire(PANEL_SPRITEp psp)
|
void pRailFire(PANEL_SPRITEp psp)
|
||||||
{
|
{
|
||||||
SpawnVis(psp->PlayerP->Actor(), nullptr, -1, -1, -1, 16);
|
SpawnVis(psp->PlayerP->actor, nullptr, -1, -1, -1, 16);
|
||||||
InitRail(psp->PlayerP);
|
InitRail(psp->PlayerP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3307,7 +3307,7 @@ void pRailRetract(PANEL_SPRITEp psp)
|
||||||
{
|
{
|
||||||
RESET(psp->PlayerP->Flags, PF_WEAPON_RETRACT);
|
RESET(psp->PlayerP->Flags, PF_WEAPON_RETRACT);
|
||||||
psp->PlayerP->Wpn[psp->WeaponType] = nullptr;
|
psp->PlayerP->Wpn[psp->WeaponType] = nullptr;
|
||||||
DeleteNoSoundOwner(psp->PlayerP->Actor());
|
DeleteNoSoundOwner(psp->PlayerP->actor);
|
||||||
pKillSprite(psp);
|
pKillSprite(psp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3686,15 +3686,15 @@ void pHotheadAttack(PANEL_SPRITEp psp)
|
||||||
switch (psp->PlayerP->WpnFlameType)
|
switch (psp->PlayerP->WpnFlameType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
SpawnVis(psp->PlayerP->Actor(), nullptr, -1, -1, -1, 32);
|
SpawnVis(psp->PlayerP->actor, nullptr, -1, -1, -1, 32);
|
||||||
InitFireball(psp->PlayerP);
|
InitFireball(psp->PlayerP);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
SpawnVis(psp->PlayerP->Actor(), nullptr, -1, -1, -1, 20);
|
SpawnVis(psp->PlayerP->actor, nullptr, -1, -1, -1, 20);
|
||||||
InitSpellRing(psp->PlayerP);
|
InitSpellRing(psp->PlayerP);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
SpawnVis(psp->PlayerP->Actor(), nullptr, -1, -1, -1, 16);
|
SpawnVis(psp->PlayerP->actor, nullptr, -1, -1, -1, 16);
|
||||||
InitSpellNapalm(psp->PlayerP);
|
InitSpellNapalm(psp->PlayerP);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -4223,7 +4223,7 @@ void pMicroAction(PANEL_SPRITEp psp)
|
||||||
|
|
||||||
void pMicroFire(PANEL_SPRITEp psp)
|
void pMicroFire(PANEL_SPRITEp psp)
|
||||||
{
|
{
|
||||||
SpawnVis(psp->PlayerP->Actor(), nullptr, -1, -1, -1, 20);
|
SpawnVis(psp->PlayerP->actor, nullptr, -1, -1, -1, 20);
|
||||||
switch (psp->PlayerP->WpnRocketType)
|
switch (psp->PlayerP->WpnRocketType)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -5011,7 +5011,7 @@ void pGrenadeAction(PANEL_SPRITEp psp)
|
||||||
|
|
||||||
void pGrenadeFire(PANEL_SPRITEp psp)
|
void pGrenadeFire(PANEL_SPRITEp psp)
|
||||||
{
|
{
|
||||||
SpawnVis(psp->PlayerP->Actor(), nullptr, -1, -1, -1, 32);
|
SpawnVis(psp->PlayerP->actor, nullptr, -1, -1, -1, 32);
|
||||||
InitGrenade(psp->PlayerP);
|
InitGrenade(psp->PlayerP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1059,13 +1059,13 @@ void DoPlayerSpriteThrow(PLAYERp pp)
|
||||||
{
|
{
|
||||||
if (!TEST(pp->Flags, PF_DIVING|PF_FLYING|PF_CRAWLING))
|
if (!TEST(pp->Flags, PF_DIVING|PF_FLYING|PF_CRAWLING))
|
||||||
{
|
{
|
||||||
if (pp->CurWpn == pp->Wpn[WPN_SWORD] && pp->Actor()->user.Rot != sg_PlayerNinjaSword)
|
if (pp->CurWpn == pp->Wpn[WPN_SWORD] && pp->actor->user.Rot != sg_PlayerNinjaSword)
|
||||||
NewStateGroup(pp->Actor(), sg_PlayerNinjaSword);
|
NewStateGroup(pp->actor, sg_PlayerNinjaSword);
|
||||||
else
|
else
|
||||||
//if (pp->CurWpn == pp->Wpn[WPN_FIST] && pp->Actor()->user.Rot != sg_PlayerNinjaPunch)
|
//if (pp->CurWpn == pp->Wpn[WPN_FIST] && pp->actor->user.Rot != sg_PlayerNinjaPunch)
|
||||||
NewStateGroup(pp->Actor(), sg_PlayerNinjaPunch);
|
NewStateGroup(pp->actor, sg_PlayerNinjaPunch);
|
||||||
//else
|
//else
|
||||||
// NewStateGroup(pp->Actor(), sg_PlayerNinjaThrow);
|
// NewStateGroup(pp->actor, sg_PlayerNinjaThrow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1080,13 +1080,13 @@ int DoPlayerSpriteReset(DSWActor* actor)
|
||||||
|
|
||||||
// need to figure out what frames to put sprite into
|
// need to figure out what frames to put sprite into
|
||||||
if (pp->DoPlayerAction == DoPlayerCrawl)
|
if (pp->DoPlayerAction == DoPlayerCrawl)
|
||||||
NewStateGroup(pp->Actor(), actor->user.ActorActionSet->Crawl);
|
NewStateGroup(pp->actor, actor->user.ActorActionSet->Crawl);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (TEST(pp->Flags, PF_PLAYER_MOVED))
|
if (TEST(pp->Flags, PF_PLAYER_MOVED))
|
||||||
NewStateGroup(pp->Actor(), actor->user.ActorActionSet->Run);
|
NewStateGroup(pp->actor, actor->user.ActorActionSet->Run);
|
||||||
else
|
else
|
||||||
NewStateGroup(pp->Actor(), actor->user.ActorActionSet->Stand);
|
NewStateGroup(pp->actor, actor->user.ActorActionSet->Stand);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1338,7 +1338,7 @@ void DoSpawnTeleporterEffectPlace(DSWActor* actor)
|
||||||
|
|
||||||
void DoPlayerWarpTeleporter(PLAYERp pp)
|
void DoPlayerWarpTeleporter(PLAYERp pp)
|
||||||
{
|
{
|
||||||
auto ppActor = pp->Actor();
|
auto ppActor = pp->actor;
|
||||||
short pnum;
|
short pnum;
|
||||||
DSWActor* act_warp;
|
DSWActor* act_warp;
|
||||||
|
|
||||||
|
@ -1387,9 +1387,9 @@ void DoPlayerWarpTeleporter(PLAYERp pp)
|
||||||
// if someone already standing there
|
// if someone already standing there
|
||||||
if (npp->cursector == pp->cursector)
|
if (npp->cursector == pp->cursector)
|
||||||
{
|
{
|
||||||
PlayerUpdateHealth(npp, -npp->Actor()->user.Health); // Make sure he dies!
|
PlayerUpdateHealth(npp, -npp->actor->user.Health); // Make sure he dies!
|
||||||
// telefraged by teleporting player
|
// telefraged by teleporting player
|
||||||
PlayerCheckDeath(npp, pp->Actor());
|
PlayerCheckDeath(npp, pp->actor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1492,7 +1492,7 @@ void DoPlayerTurnVehicle(PLAYERp pp, float avel, int z, int floor_dist)
|
||||||
if (MultiClipTurn(pp, NORM_ANGLE(sum.asbuild()), z, floor_dist))
|
if (MultiClipTurn(pp, NORM_ANGLE(sum.asbuild()), z, floor_dist))
|
||||||
{
|
{
|
||||||
pp->angle.ang = sum;
|
pp->angle.ang = sum;
|
||||||
pp->Actor()->spr.ang = pp->angle.ang.asbuild();
|
pp->actor->spr.ang = pp->angle.ang.asbuild();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1520,7 +1520,7 @@ void DoPlayerTurnVehicleRect(PLAYERp pp, int *x, int *y, int *ox, int *oy)
|
||||||
if (RectClipTurn(pp, NORM_ANGLE(sum.asbuild()), x, y, ox, oy))
|
if (RectClipTurn(pp, NORM_ANGLE(sum.asbuild()), x, y, ox, oy))
|
||||||
{
|
{
|
||||||
pp->angle.ang = sum;
|
pp->angle.ang = sum;
|
||||||
pp->Actor()->spr.ang = pp->angle.ang.asbuild();
|
pp->actor->spr.ang = pp->angle.ang.asbuild();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1560,7 +1560,7 @@ void DoPlayerTurnTurret(PLAYERp pp, float avel)
|
||||||
}
|
}
|
||||||
|
|
||||||
pp->angle.ang = new_ang;
|
pp->angle.ang = new_ang;
|
||||||
pp->Actor()->spr.ang = pp->angle.ang.asbuild();
|
pp->actor->spr.ang = pp->angle.ang.asbuild();
|
||||||
}
|
}
|
||||||
|
|
||||||
OperateSectorObject(pp->sop, pp->angle.ang.asbuild(), pp->sop->xmid, pp->sop->ymid);
|
OperateSectorObject(pp->sop, pp->angle.ang.asbuild(), pp->sop->xmid, pp->sop->ymid);
|
||||||
|
@ -1746,7 +1746,7 @@ void UpdatePlayerSprite(PLAYERp pp)
|
||||||
// there are multiple death functions
|
// there are multiple death functions
|
||||||
if (TEST(pp->Flags, PF_DEAD))
|
if (TEST(pp->Flags, PF_DEAD))
|
||||||
{
|
{
|
||||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
ChangeActorSect(pp->actor, pp->cursector);
|
||||||
actor->spr.ang = pp->angle.ang.asbuild();
|
actor->spr.ang = pp->angle.ang.asbuild();
|
||||||
UpdatePlayerUnderSprite(pp);
|
UpdatePlayerUnderSprite(pp);
|
||||||
return;
|
return;
|
||||||
|
@ -1755,24 +1755,24 @@ void UpdatePlayerSprite(PLAYERp pp)
|
||||||
if (pp->sop_control)
|
if (pp->sop_control)
|
||||||
{
|
{
|
||||||
actor->spr.pos.Z = pp->cursector->floorz;
|
actor->spr.pos.Z = pp->cursector->floorz;
|
||||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
ChangeActorSect(pp->actor, pp->cursector);
|
||||||
}
|
}
|
||||||
else if (pp->DoPlayerAction == DoPlayerCrawl)
|
else if (pp->DoPlayerAction == DoPlayerCrawl)
|
||||||
{
|
{
|
||||||
actor->spr.pos.Z = pp->pos.Z + PLAYER_CRAWL_HEIGHT;
|
actor->spr.pos.Z = pp->pos.Z + PLAYER_CRAWL_HEIGHT;
|
||||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
ChangeActorSect(pp->actor, pp->cursector);
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
else if (pp->DoPlayerAction == DoPlayerSwim)
|
else if (pp->DoPlayerAction == DoPlayerSwim)
|
||||||
{
|
{
|
||||||
actor->spr.z = pp->loz - Z(pp->WadeDepth) + Z(1);
|
actor->spr.z = pp->loz - Z(pp->WadeDepth) + Z(1);
|
||||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
ChangeActorSect(pp->actor, pp->cursector);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (pp->DoPlayerAction == DoPlayerWade)
|
else if (pp->DoPlayerAction == DoPlayerWade)
|
||||||
{
|
{
|
||||||
actor->spr.pos.Z = pp->pos.Z + PLAYER_HEIGHT;
|
actor->spr.pos.Z = pp->pos.Z + PLAYER_HEIGHT;
|
||||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
ChangeActorSect(pp->actor, pp->cursector);
|
||||||
|
|
||||||
if (pp->WadeDepth > Z(29))
|
if (pp->WadeDepth > Z(29))
|
||||||
{
|
{
|
||||||
|
@ -1783,7 +1783,7 @@ void UpdatePlayerSprite(PLAYERp pp)
|
||||||
{
|
{
|
||||||
// bobbing and sprite position taken care of in DoPlayerDive
|
// bobbing and sprite position taken care of in DoPlayerDive
|
||||||
actor->spr.pos.Z = pp->pos.Z + Z(10);
|
actor->spr.pos.Z = pp->pos.Z + Z(10);
|
||||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
ChangeActorSect(pp->actor, pp->cursector);
|
||||||
}
|
}
|
||||||
else if (pp->DoPlayerAction == DoPlayerClimb)
|
else if (pp->DoPlayerAction == DoPlayerClimb)
|
||||||
{
|
{
|
||||||
|
@ -1793,7 +1793,7 @@ void UpdatePlayerSprite(PLAYERp pp)
|
||||||
//actor->spr.x += MOVEx(256+64, actor->spr.ang);
|
//actor->spr.x += MOVEx(256+64, actor->spr.ang);
|
||||||
//actor->spr.y += MOVEy(256+64, actor->spr.ang);
|
//actor->spr.y += MOVEy(256+64, actor->spr.ang);
|
||||||
|
|
||||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
ChangeActorSect(pp->actor, pp->cursector);
|
||||||
}
|
}
|
||||||
else if (pp->DoPlayerAction == DoPlayerFly)
|
else if (pp->DoPlayerAction == DoPlayerFly)
|
||||||
{
|
{
|
||||||
|
@ -1802,22 +1802,22 @@ void UpdatePlayerSprite(PLAYERp pp)
|
||||||
//actor->spr.z = pp->posz + PLAYER_HEIGHT;
|
//actor->spr.z = pp->posz + PLAYER_HEIGHT;
|
||||||
//DoPlayerSpriteBob(pp, PLAYER_HEIGHT, PLAYER_FLY_BOB_AMT, 3);
|
//DoPlayerSpriteBob(pp, PLAYER_HEIGHT, PLAYER_FLY_BOB_AMT, 3);
|
||||||
DoPlayerSpriteBob(pp, PLAYER_HEIGHT, Z(6), 3);
|
DoPlayerSpriteBob(pp, PLAYER_HEIGHT, Z(6), 3);
|
||||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
ChangeActorSect(pp->actor, pp->cursector);
|
||||||
}
|
}
|
||||||
else if (pp->DoPlayerAction == DoPlayerJump || pp->DoPlayerAction == DoPlayerFall || pp->DoPlayerAction == DoPlayerForceJump)
|
else if (pp->DoPlayerAction == DoPlayerJump || pp->DoPlayerAction == DoPlayerFall || pp->DoPlayerAction == DoPlayerForceJump)
|
||||||
{
|
{
|
||||||
actor->spr.pos.Z = pp->pos.Z + PLAYER_HEIGHT;
|
actor->spr.pos.Z = pp->pos.Z + PLAYER_HEIGHT;
|
||||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
ChangeActorSect(pp->actor, pp->cursector);
|
||||||
}
|
}
|
||||||
else if (pp->DoPlayerAction == DoPlayerTeleportPause)
|
else if (pp->DoPlayerAction == DoPlayerTeleportPause)
|
||||||
{
|
{
|
||||||
actor->spr.pos.Z = pp->pos.Z + PLAYER_HEIGHT;
|
actor->spr.pos.Z = pp->pos.Z + PLAYER_HEIGHT;
|
||||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
ChangeActorSect(pp->actor, pp->cursector);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
actor->spr.pos.Z = pp->loz;
|
actor->spr.pos.Z = pp->loz;
|
||||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
ChangeActorSect(pp->actor, pp->cursector);
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdatePlayerUnderSprite(pp);
|
UpdatePlayerUnderSprite(pp);
|
||||||
|
@ -2470,7 +2470,7 @@ void DriveCrush(PLAYERp pp, int *x, int *y)
|
||||||
damage = -(actor->user.Health + 100);
|
damage = -(actor->user.Health + 100);
|
||||||
PlayerDamageSlide(actor->user.PlayerP, damage, pp->angle.ang.asbuild());
|
PlayerDamageSlide(actor->user.PlayerP, damage, pp->angle.ang.asbuild());
|
||||||
PlayerUpdateHealth(actor->user.PlayerP, damage);
|
PlayerUpdateHealth(actor->user.PlayerP, damage);
|
||||||
PlayerCheckDeath(actor->user.PlayerP, pp->Actor());
|
PlayerCheckDeath(actor->user.PlayerP, pp->actor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2773,7 +2773,7 @@ void DoPlayerBeginJump(PLAYERp pp)
|
||||||
|
|
||||||
///DamageData[plActor->user.WeaponNum].Init(pp);
|
///DamageData[plActor->user.WeaponNum].Init(pp);
|
||||||
|
|
||||||
NewStateGroup(pp->Actor(), plActor->user.ActorActionSet->Jump);
|
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Jump);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoPlayerBeginForceJump(PLAYERp pp)
|
void DoPlayerBeginForceJump(PLAYERp pp)
|
||||||
|
@ -2794,7 +2794,7 @@ void DoPlayerBeginForceJump(PLAYERp pp)
|
||||||
|
|
||||||
///DamageData[plActor->user.WeaponNum].Init(pp);
|
///DamageData[plActor->user.WeaponNum].Init(pp);
|
||||||
|
|
||||||
NewStateGroup(pp->Actor(), plActor->user.ActorActionSet->Jump);
|
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Jump);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoPlayerJump(PLAYERp pp)
|
void DoPlayerJump(PLAYERp pp)
|
||||||
|
@ -2938,7 +2938,7 @@ void DoPlayerBeginFall(PLAYERp pp)
|
||||||
// Only change to falling frame if you were in the jump frame
|
// Only change to falling frame if you were in the jump frame
|
||||||
// Otherwise an animation may be messed up such as Running Jump Kick
|
// Otherwise an animation may be messed up such as Running Jump Kick
|
||||||
if (plActor->user.Rot == plActor->user.ActorActionSet->Jump)
|
if (plActor->user.Rot == plActor->user.ActorActionSet->Jump)
|
||||||
NewStateGroup(pp->Actor(), plActor->user.ActorActionSet->Fall);
|
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Fall);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StackedWaterSplash(PLAYERp pp)
|
void StackedWaterSplash(PLAYERp pp)
|
||||||
|
@ -3125,8 +3125,8 @@ void DoPlayerBeginClimb(PLAYERp pp)
|
||||||
|
|
||||||
//DamageData[plActor->user.WeaponNum].Init(pp);
|
//DamageData[plActor->user.WeaponNum].Init(pp);
|
||||||
|
|
||||||
//NewStateGroup(pp->Actor(), pp->Actor()->user.ActorActionSet->Climb);
|
//NewStateGroup(pp->actor, pp->actor->user.ActorActionSet->Climb);
|
||||||
NewStateGroup(pp->Actor(), sg_PlayerNinjaClimb);
|
NewStateGroup(pp->actor, sg_PlayerNinjaClimb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3242,7 +3242,7 @@ void DoPlayerClimb(PLAYERp pp)
|
||||||
{
|
{
|
||||||
// put player at the hiz
|
// put player at the hiz
|
||||||
pp->pos.Z = pp->hiz;
|
pp->pos.Z = pp->hiz;
|
||||||
NewStateGroup(pp->Actor(), sg_PlayerNinjaClimb);
|
NewStateGroup(pp->actor, sg_PlayerNinjaClimb);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if player gets to close the ceiling while climbing
|
// if player gets to close the ceiling while climbing
|
||||||
|
@ -3250,7 +3250,7 @@ void DoPlayerClimb(PLAYERp pp)
|
||||||
{
|
{
|
||||||
// put player at the ceiling
|
// put player at the ceiling
|
||||||
pp->pos.Z = pp->LadderSector->ceilingz + Z(4);
|
pp->pos.Z = pp->LadderSector->ceilingz + Z(4);
|
||||||
NewStateGroup(pp->Actor(), sg_PlayerNinjaClimb);
|
NewStateGroup(pp->actor, sg_PlayerNinjaClimb);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if floor is ABOVE you && your head goes above it, do a jump up to
|
// if floor is ABOVE you && your head goes above it, do a jump up to
|
||||||
|
@ -3295,12 +3295,12 @@ void DoPlayerClimb(PLAYERp pp)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NewStateGroup(pp->Actor(), sg_PlayerNinjaClimb);
|
NewStateGroup(pp->actor, sg_PlayerNinjaClimb);
|
||||||
}
|
}
|
||||||
|
|
||||||
// setsprite to players location
|
// setsprite to players location
|
||||||
plActor->spr.pos.Z = pp->pos.Z + PLAYER_HEIGHT;
|
plActor->spr.pos.Z = pp->pos.Z + PLAYER_HEIGHT;
|
||||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
ChangeActorSect(pp->actor, pp->cursector);
|
||||||
|
|
||||||
if (!SyncInput())
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
|
@ -3333,7 +3333,7 @@ void DoPlayerClimb(PLAYERp pp)
|
||||||
|
|
||||||
if (near.hitWall)
|
if (near.hitWall)
|
||||||
{
|
{
|
||||||
auto lActor = FindNearSprite(pp->Actor(), STAT_CLIMB_MARKER);
|
auto lActor = FindNearSprite(pp->actor, STAT_CLIMB_MARKER);
|
||||||
if (!lActor) return;
|
if (!lActor) return;
|
||||||
|
|
||||||
// determine where the player is supposed to be in relation to the ladder
|
// determine where the player is supposed to be in relation to the ladder
|
||||||
|
@ -3379,7 +3379,7 @@ int DoPlayerWadeSuperJump(PLAYERp pp)
|
||||||
|
|
||||||
if (hit.hitSector != nullptr && labs(hit.hitSector->floorz - pp->pos.Z) < Z(50))
|
if (hit.hitSector != nullptr && labs(hit.hitSector->floorz - pp->pos.Z) < Z(50))
|
||||||
{
|
{
|
||||||
if (Distance(pp->pos.X, pp->pos.Y, hit.hitpos.X, hit.hitpos.Y) < ((((int)pp->Actor()->spr.clipdist)<<2) + 256))
|
if (Distance(pp->pos.X, pp->pos.Y, hit.hitpos.X, hit.hitpos.Y) < ((((int)pp->actor->spr.clipdist)<<2) + 256))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3415,7 +3415,7 @@ void DoPlayerBeginCrawl(PLAYERp pp)
|
||||||
|
|
||||||
//pp->posz = pp->loz - PLAYER_CRAWL_HEIGHT;
|
//pp->posz = pp->loz - PLAYER_CRAWL_HEIGHT;
|
||||||
|
|
||||||
NewStateGroup(pp->Actor(), plActor->user.ActorActionSet->Crawl);
|
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Crawl);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PlayerFallTest(PLAYERp pp, int player_height)
|
bool PlayerFallTest(PLAYERp pp, int player_height)
|
||||||
|
@ -3490,7 +3490,7 @@ void DoPlayerCrawl(PLAYERp pp)
|
||||||
|
|
||||||
if (!TEST(pp->Flags, PF_PLAYER_MOVED))
|
if (!TEST(pp->Flags, PF_PLAYER_MOVED))
|
||||||
{
|
{
|
||||||
NewStateGroup(pp->Actor(), plActor->user.ActorActionSet->Crawl);
|
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Crawl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the floor is far below you, fall hard instead of adjusting height
|
// If the floor is far below you, fall hard instead of adjusting height
|
||||||
|
@ -3528,7 +3528,7 @@ void DoPlayerBeginFly(PLAYERp pp)
|
||||||
pp->bob_amt = 0;
|
pp->bob_amt = 0;
|
||||||
pp->bob_ndx = 1024;
|
pp->bob_ndx = 1024;
|
||||||
|
|
||||||
NewStateGroup(pp->Actor(), sg_PlayerNinjaFly);
|
NewStateGroup(pp->actor, sg_PlayerNinjaFly);
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetSinNdx(int range, int bob_amt)
|
int GetSinNdx(int range, int bob_amt)
|
||||||
|
@ -3714,7 +3714,7 @@ bool PlayerOnLadder(PLAYERp pp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
auto lActor = FindNearSprite(pp->Actor(), STAT_CLIMB_MARKER);
|
auto lActor = FindNearSprite(pp->actor, STAT_CLIMB_MARKER);
|
||||||
|
|
||||||
if (!lActor)
|
if (!lActor)
|
||||||
return false;
|
return false;
|
||||||
|
@ -4172,7 +4172,7 @@ void DoPlayerBeginDive(PLAYERp pp)
|
||||||
pp->Reverb = 140;
|
pp->Reverb = 140;
|
||||||
}
|
}
|
||||||
|
|
||||||
SpawnSplash(pp->Actor());
|
SpawnSplash(pp->actor);
|
||||||
|
|
||||||
DoPlayerWarpToUnderwater(pp);
|
DoPlayerWarpToUnderwater(pp);
|
||||||
OperateTripTrigger(pp);
|
OperateTripTrigger(pp);
|
||||||
|
@ -4195,7 +4195,7 @@ void DoPlayerBeginDive(PLAYERp pp)
|
||||||
DoPlayerMove(pp); // needs to be called to reset the pp->loz/hiz variable
|
DoPlayerMove(pp); // needs to be called to reset the pp->loz/hiz variable
|
||||||
///DamageData[plActor->user.WeaponNum].Init(pp);
|
///DamageData[plActor->user.WeaponNum].Init(pp);
|
||||||
|
|
||||||
NewStateGroup(pp->Actor(), plActor->user.ActorActionSet->Dive);
|
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Dive);
|
||||||
|
|
||||||
DoPlayerDive(pp);
|
DoPlayerDive(pp);
|
||||||
}
|
}
|
||||||
|
@ -4242,7 +4242,7 @@ void DoPlayerBeginDiveNoWarp(PLAYERp pp)
|
||||||
pp->DiveDamageTics = 0;
|
pp->DiveDamageTics = 0;
|
||||||
DoPlayerMove(pp); // needs to be called to reset the pp->loz/hiz variable
|
DoPlayerMove(pp); // needs to be called to reset the pp->loz/hiz variable
|
||||||
///DamageData[plActor->user.WeaponNum].Init(pp);
|
///DamageData[plActor->user.WeaponNum].Init(pp);
|
||||||
NewStateGroup(pp->Actor(), plActor->user.ActorActionSet->Dive);
|
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Dive);
|
||||||
DoPlayerDive(pp);
|
DoPlayerDive(pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4261,7 +4261,7 @@ void DoPlayerStopDiveNoWarp(PLAYERp pp)
|
||||||
RESET(pp->Flags, PF_DIVING|PF_DIVING_IN_LAVA);
|
RESET(pp->Flags, PF_DIVING|PF_DIVING_IN_LAVA);
|
||||||
DoPlayerDivePalette(pp);
|
DoPlayerDivePalette(pp);
|
||||||
DoPlayerNightVisionPalette(pp);
|
DoPlayerNightVisionPalette(pp);
|
||||||
RESET(pp->Actor()->spr.cstat, CSTAT_SPRITE_YCENTER);
|
RESET(pp->actor->spr.cstat, CSTAT_SPRITE_YCENTER);
|
||||||
if (pp == Player + screenpeek)
|
if (pp == Player + screenpeek)
|
||||||
{
|
{
|
||||||
COVER_SetReverb(0);
|
COVER_SetReverb(0);
|
||||||
|
@ -4509,7 +4509,7 @@ void DoPlayerDive(PLAYERp pp)
|
||||||
int nx,ny;
|
int nx,ny;
|
||||||
|
|
||||||
PlaySound(DIGI_BUBBLES, pp, v3df_none);
|
PlaySound(DIGI_BUBBLES, pp, v3df_none);
|
||||||
auto bubble = SpawnBubble(pp->Actor());
|
auto bubble = SpawnBubble(pp->actor);
|
||||||
if (bubble != nullptr)
|
if (bubble != nullptr)
|
||||||
{
|
{
|
||||||
// back it up a bit to get it out of your face
|
// back it up a bit to get it out of your face
|
||||||
|
@ -4548,7 +4548,7 @@ void DoPlayerCurrent(PLAYERp pp)
|
||||||
xvect = sectu->speed * synctics * bcos(sectu->ang) >> 4;
|
xvect = sectu->speed * synctics * bcos(sectu->ang) >> 4;
|
||||||
yvect = sectu->speed * synctics * bsin(sectu->ang) >> 4;
|
yvect = sectu->speed * synctics * bsin(sectu->ang) >> 4;
|
||||||
|
|
||||||
push_ret = pushmove(&pp->pos, &pp->cursector, ((int)pp->Actor()->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER);
|
push_ret = pushmove(&pp->pos, &pp->cursector, ((int)pp->actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER);
|
||||||
if (push_ret < 0)
|
if (push_ret < 0)
|
||||||
{
|
{
|
||||||
if (!TEST(pp->Flags, PF_DEAD))
|
if (!TEST(pp->Flags, PF_DEAD))
|
||||||
|
@ -4564,10 +4564,10 @@ void DoPlayerCurrent(PLAYERp pp)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Collision coll;
|
Collision coll;
|
||||||
clipmove(pp->pos, &pp->cursector, xvect, yvect, ((int)pp->Actor()->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll);
|
clipmove(pp->pos, &pp->cursector, xvect, yvect, ((int)pp->actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll);
|
||||||
|
|
||||||
PlayerCheckValidMove(pp);
|
PlayerCheckValidMove(pp);
|
||||||
pushmove(&pp->pos, &pp->cursector, ((int)pp->Actor()->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER);
|
pushmove(&pp->pos, &pp->cursector, ((int)pp->actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER);
|
||||||
if (push_ret < 0)
|
if (push_ret < 0)
|
||||||
{
|
{
|
||||||
if (!TEST(pp->Flags, PF_DEAD))
|
if (!TEST(pp->Flags, PF_DEAD))
|
||||||
|
@ -4633,7 +4633,7 @@ void DoPlayerBeginWade(PLAYERp pp)
|
||||||
DoPlayerFireOutWater(pp);
|
DoPlayerFireOutWater(pp);
|
||||||
|
|
||||||
if (pp->jump_speed > 100)
|
if (pp->jump_speed > 100)
|
||||||
SpawnSplash(pp->Actor());
|
SpawnSplash(pp->actor);
|
||||||
|
|
||||||
// fix it so that you won't go under water unless you hit the water at a
|
// fix it so that you won't go under water unless you hit the water at a
|
||||||
// certain speed
|
// certain speed
|
||||||
|
@ -4642,7 +4642,7 @@ void DoPlayerBeginWade(PLAYERp pp)
|
||||||
|
|
||||||
ASSERT(plActor->user.ActorActionSet->Run);
|
ASSERT(plActor->user.ActorActionSet->Run);
|
||||||
|
|
||||||
NewStateGroup(pp->Actor(), plActor->user.ActorActionSet->Run);
|
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Run);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4734,12 +4734,12 @@ void DoPlayerWade(PLAYERp pp)
|
||||||
if (TEST(pp->Flags, PF_PLAYER_MOVED))
|
if (TEST(pp->Flags, PF_PLAYER_MOVED))
|
||||||
{
|
{
|
||||||
if (plActor->user.Rot != plActor->user.ActorActionSet->Run)
|
if (plActor->user.Rot != plActor->user.ActorActionSet->Run)
|
||||||
NewStateGroup(pp->Actor(), plActor->user.ActorActionSet->Run);
|
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Run);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (plActor->user.Rot != plActor->user.ActorActionSet->Stand)
|
if (plActor->user.Rot != plActor->user.ActorActionSet->Stand)
|
||||||
NewStateGroup(pp->Actor(), plActor->user.ActorActionSet->Stand);
|
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Stand);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the floor is far below you, fall hard instead of adjusting height
|
// If the floor is far below you, fall hard instead of adjusting height
|
||||||
|
@ -4801,7 +4801,7 @@ void DoPlayerBeginOperateVehicle(PLAYERp pp)
|
||||||
|
|
||||||
ASSERT(plActor->user.ActorActionSet->Stand);
|
ASSERT(plActor->user.ActorActionSet->Stand);
|
||||||
|
|
||||||
NewStateGroup(pp->Actor(), plActor->user.ActorActionSet->Stand);
|
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Stand);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoPlayerBeginOperateTurret(PLAYERp pp)
|
void DoPlayerBeginOperateTurret(PLAYERp pp)
|
||||||
|
@ -4820,7 +4820,7 @@ void DoPlayerBeginOperateTurret(PLAYERp pp)
|
||||||
|
|
||||||
ASSERT(plActor->user.ActorActionSet->Stand);
|
ASSERT(plActor->user.ActorActionSet->Stand);
|
||||||
|
|
||||||
NewStateGroup(pp->Actor(), plActor->user.ActorActionSet->Stand);
|
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Stand);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FindMainSector(SECTOR_OBJECTp sop)
|
void FindMainSector(SECTOR_OBJECTp sop)
|
||||||
|
@ -4906,7 +4906,7 @@ void DoPlayerBeginOperate(PLAYERp pp)
|
||||||
}
|
}
|
||||||
|
|
||||||
pp->sop = pp->sop_control = sop;
|
pp->sop = pp->sop_control = sop;
|
||||||
sop->controller = pp->Actor();
|
sop->controller = pp->actor;
|
||||||
|
|
||||||
pp->angle.oang = pp->angle.ang = buildang(sop->ang);
|
pp->angle.oang = pp->angle.ang = buildang(sop->ang);
|
||||||
pp->pos.X = sop->xmid;
|
pp->pos.X = sop->xmid;
|
||||||
|
@ -4972,7 +4972,7 @@ void DoPlayerBeginRemoteOperate(PLAYERp pp, SECTOR_OBJECTp sop)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
pp->sop_remote = pp->sop = pp->sop_control = sop;
|
pp->sop_remote = pp->sop = pp->sop_control = sop;
|
||||||
sop->controller = pp->Actor();
|
sop->controller = pp->actor;
|
||||||
|
|
||||||
// won't operate - broken
|
// won't operate - broken
|
||||||
if (sop->max_damage != -9999 && sop->max_damage <= 0)
|
if (sop->max_damage != -9999 && sop->max_damage <= 0)
|
||||||
|
@ -5271,7 +5271,7 @@ void DoPlayerDeathFall(PLAYERp pp)
|
||||||
//if (pp->posz > loz - PLAYER_DEATH_HEIGHT)
|
//if (pp->posz > loz - PLAYER_DEATH_HEIGHT)
|
||||||
{
|
{
|
||||||
if (loz != pp->loz)
|
if (loz != pp->loz)
|
||||||
SpawnSplash(pp->Actor());
|
SpawnSplash(pp->actor);
|
||||||
|
|
||||||
if (RandomRange(1000) > 500)
|
if (RandomRange(1000) > 500)
|
||||||
PlaySound(DIGI_BODYFALL1, pp, v3df_dontpan);
|
PlaySound(DIGI_BODYFALL1, pp, v3df_dontpan);
|
||||||
|
@ -5307,7 +5307,7 @@ char *KilledPlayerMessage(PLAYERp pp, PLAYERp killer)
|
||||||
const char *p1 = pp->PlayerName;
|
const char *p1 = pp->PlayerName;
|
||||||
const char *p2 = killer->PlayerName;
|
const char *p2 = killer->PlayerName;
|
||||||
|
|
||||||
if (pp->HitBy == killer->Actor())
|
if (pp->HitBy == killer->actor)
|
||||||
{
|
{
|
||||||
sprintf(ds,"%s was killed by %s.",p1,p2);
|
sprintf(ds,"%s was killed by %s.",p1,p2);
|
||||||
return ds;
|
return ds;
|
||||||
|
@ -5451,7 +5451,7 @@ void DoPlayerBeginDie(PLAYERp pp)
|
||||||
|
|
||||||
pp->tilt_dest = 0;
|
pp->tilt_dest = 0;
|
||||||
|
|
||||||
ActorCoughItem(pp->Actor());
|
ActorCoughItem(pp->actor);
|
||||||
|
|
||||||
if (numplayers > 1)
|
if (numplayers > 1)
|
||||||
{
|
{
|
||||||
|
@ -5475,7 +5475,7 @@ void DoPlayerBeginDie(PLAYERp pp)
|
||||||
if (gNet.TeamPlay)
|
if (gNet.TeamPlay)
|
||||||
{
|
{
|
||||||
// playing team play
|
// playing team play
|
||||||
if (pp->Actor()->user.spal == killer->user.spal)
|
if (pp->actor->user.spal == killer->user.spal)
|
||||||
{
|
{
|
||||||
// Killed your team member
|
// Killed your team member
|
||||||
PlayerUpdateKills(pp, -1);
|
PlayerUpdateKills(pp, -1);
|
||||||
|
@ -5523,7 +5523,7 @@ void DoPlayerBeginDie(PLAYERp pp)
|
||||||
pp->sop = nullptr;
|
pp->sop = nullptr;
|
||||||
RESET(pp->Flags, PF_TWO_UZI);
|
RESET(pp->Flags, PF_TWO_UZI);
|
||||||
|
|
||||||
NewStateGroup(pp->Actor(), plActor->user.ActorActionSet->Run);
|
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Run);
|
||||||
pWeaponForceRest(pp);
|
pWeaponForceRest(pp);
|
||||||
|
|
||||||
switch (pp->DeathType)
|
switch (pp->DeathType)
|
||||||
|
@ -5533,9 +5533,9 @@ void DoPlayerBeginDie(PLAYERp pp)
|
||||||
SET(pp->Flags, PF_JUMPING);
|
SET(pp->Flags, PF_JUMPING);
|
||||||
plActor->user.ID = NINJA_DEAD;
|
plActor->user.ID = NINJA_DEAD;
|
||||||
pp->jump_speed = -200;
|
pp->jump_speed = -200;
|
||||||
NewStateGroup(pp->Actor(), sg_PlayerDeath);
|
NewStateGroup(pp->actor, sg_PlayerDeath);
|
||||||
DoFindGround(pp->Actor());
|
DoFindGround(pp->actor);
|
||||||
DoBeginJump(pp->Actor());
|
DoBeginJump(pp->actor);
|
||||||
plActor->user.jump_speed = -300;
|
plActor->user.jump_speed = -300;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -5547,15 +5547,15 @@ void DoPlayerBeginDie(PLAYERp pp)
|
||||||
SET(pp->Flags, PF_JUMPING);
|
SET(pp->Flags, PF_JUMPING);
|
||||||
plActor->user.ID = NINJA_DEAD;
|
plActor->user.ID = NINJA_DEAD;
|
||||||
pp->jump_speed = -300;
|
pp->jump_speed = -300;
|
||||||
NewStateGroup(pp->Actor(), sg_PlayerDeath);
|
NewStateGroup(pp->actor, sg_PlayerDeath);
|
||||||
//pp->ceiling_dist = Z(0);
|
//pp->ceiling_dist = Z(0);
|
||||||
//pp->floor_dist = Z(0);
|
//pp->floor_dist = Z(0);
|
||||||
|
|
||||||
RESET(plActor->spr.cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
|
RESET(plActor->spr.cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
|
||||||
plActor->user.ceiling_dist = Z(10);
|
plActor->user.ceiling_dist = Z(10);
|
||||||
plActor->user.floor_dist = Z(0);
|
plActor->user.floor_dist = Z(0);
|
||||||
DoFindGround(pp->Actor());
|
DoFindGround(pp->actor);
|
||||||
DoBeginJump(pp->Actor());
|
DoBeginJump(pp->actor);
|
||||||
plActor->user.jump_speed = -400;
|
plActor->user.jump_speed = -400;
|
||||||
break;
|
break;
|
||||||
case PLAYER_DEATH_CRUMBLE:
|
case PLAYER_DEATH_CRUMBLE:
|
||||||
|
@ -5565,14 +5565,14 @@ void DoPlayerBeginDie(PLAYERp pp)
|
||||||
SET(pp->Flags, PF_DEAD_HEAD | PF_JUMPING);
|
SET(pp->Flags, PF_DEAD_HEAD | PF_JUMPING);
|
||||||
pp->jump_speed = -300;
|
pp->jump_speed = -300;
|
||||||
plActor->user.slide_vel = 0;
|
plActor->user.slide_vel = 0;
|
||||||
SpawnShrap(pp->Actor(), nullptr);
|
SpawnShrap(pp->actor, nullptr);
|
||||||
SET(plActor->spr.cstat, CSTAT_SPRITE_YCENTER);
|
SET(plActor->spr.cstat, CSTAT_SPRITE_YCENTER);
|
||||||
NewStateGroup(pp->Actor(), sg_PlayerHeadFly);
|
NewStateGroup(pp->actor, sg_PlayerHeadFly);
|
||||||
plActor->user.ID = NINJA_Head_R0;
|
plActor->user.ID = NINJA_Head_R0;
|
||||||
plActor->spr.xrepeat = 48;
|
plActor->spr.xrepeat = 48;
|
||||||
plActor->spr.yrepeat = 48;
|
plActor->spr.yrepeat = 48;
|
||||||
// Blood fountains
|
// Blood fountains
|
||||||
InitBloodSpray(pp->Actor(),true,105);
|
InitBloodSpray(pp->actor,true,105);
|
||||||
break;
|
break;
|
||||||
case PLAYER_DEATH_EXPLODE:
|
case PLAYER_DEATH_EXPLODE:
|
||||||
|
|
||||||
|
@ -5580,16 +5580,16 @@ void DoPlayerBeginDie(PLAYERp pp)
|
||||||
|
|
||||||
SET(pp->Flags, PF_DEAD_HEAD | PF_JUMPING);
|
SET(pp->Flags, PF_DEAD_HEAD | PF_JUMPING);
|
||||||
pp->jump_speed = -650;
|
pp->jump_speed = -650;
|
||||||
SpawnShrap(pp->Actor(), nullptr);
|
SpawnShrap(pp->actor, nullptr);
|
||||||
SET(plActor->spr.cstat, CSTAT_SPRITE_YCENTER);
|
SET(plActor->spr.cstat, CSTAT_SPRITE_YCENTER);
|
||||||
NewStateGroup(pp->Actor(), sg_PlayerHeadFly);
|
NewStateGroup(pp->actor, sg_PlayerHeadFly);
|
||||||
plActor->user.ID = NINJA_Head_R0;
|
plActor->user.ID = NINJA_Head_R0;
|
||||||
plActor->spr.xrepeat = 48;
|
plActor->spr.xrepeat = 48;
|
||||||
plActor->spr.yrepeat = 48;
|
plActor->spr.yrepeat = 48;
|
||||||
// Blood fountains
|
// Blood fountains
|
||||||
InitBloodSpray(pp->Actor(),true,-1);
|
InitBloodSpray(pp->actor,true,-1);
|
||||||
InitBloodSpray(pp->Actor(),true,-1);
|
InitBloodSpray(pp->actor,true,-1);
|
||||||
InitBloodSpray(pp->Actor(),true,-1);
|
InitBloodSpray(pp->actor,true,-1);
|
||||||
break;
|
break;
|
||||||
case PLAYER_DEATH_SQUISH:
|
case PLAYER_DEATH_SQUISH:
|
||||||
|
|
||||||
|
@ -5598,14 +5598,14 @@ void DoPlayerBeginDie(PLAYERp pp)
|
||||||
SET(pp->Flags, PF_DEAD_HEAD | PF_JUMPING);
|
SET(pp->Flags, PF_DEAD_HEAD | PF_JUMPING);
|
||||||
pp->jump_speed = 200;
|
pp->jump_speed = 200;
|
||||||
plActor->user.slide_vel = 800;
|
plActor->user.slide_vel = 800;
|
||||||
SpawnShrap(pp->Actor(), nullptr);
|
SpawnShrap(pp->actor, nullptr);
|
||||||
SET(plActor->spr.cstat, CSTAT_SPRITE_YCENTER);
|
SET(plActor->spr.cstat, CSTAT_SPRITE_YCENTER);
|
||||||
NewStateGroup(pp->Actor(), sg_PlayerHeadFly);
|
NewStateGroup(pp->actor, sg_PlayerHeadFly);
|
||||||
plActor->user.ID = NINJA_Head_R0;
|
plActor->user.ID = NINJA_Head_R0;
|
||||||
plActor->spr.xrepeat = 48;
|
plActor->spr.xrepeat = 48;
|
||||||
plActor->spr.yrepeat = 48;
|
plActor->spr.yrepeat = 48;
|
||||||
// Blood fountains
|
// Blood fountains
|
||||||
InitBloodSpray(pp->Actor(),true,105);
|
InitBloodSpray(pp->actor,true,105);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5653,7 +5653,7 @@ void DoPlayerDeathZrange(PLAYERp pp)
|
||||||
DSWActor* plActor = pp->actor;
|
DSWActor* plActor = pp->actor;
|
||||||
|
|
||||||
// make sure we don't land on a regular sprite
|
// make sure we don't land on a regular sprite
|
||||||
DoFindGround(pp->Actor());
|
DoFindGround(pp->actor);
|
||||||
|
|
||||||
// update player values with results from DoFindGround
|
// update player values with results from DoFindGround
|
||||||
pp->loz = plActor->user.loz;
|
pp->loz = plActor->user.loz;
|
||||||
|
@ -5672,10 +5672,10 @@ void DoPlayerDeathHurl(PLAYERp pp)
|
||||||
|
|
||||||
|
|
||||||
SET(pp->Flags, PF_HEAD_CONTROL);
|
SET(pp->Flags, PF_HEAD_CONTROL);
|
||||||
NewStateGroup(pp->Actor(), sg_PlayerHeadHurl);
|
NewStateGroup(pp->actor, sg_PlayerHeadHurl);
|
||||||
if (MoveSkip4 == 0)
|
if (MoveSkip4 == 0)
|
||||||
{
|
{
|
||||||
SpawnShrap(pp->Actor(), nullptr);
|
SpawnShrap(pp->actor, nullptr);
|
||||||
if (RandomRange(1000) > 400)
|
if (RandomRange(1000) > 400)
|
||||||
PlayerSound(DIGI_DHVOMIT, v3df_dontpan|v3df_follow,pp);
|
PlayerSound(DIGI_DHVOMIT, v3df_dontpan|v3df_follow,pp);
|
||||||
}
|
}
|
||||||
|
@ -5685,7 +5685,7 @@ void DoPlayerDeathHurl(PLAYERp pp)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!TEST(pp->Flags, PF_JUMPING|PF_FALLING))
|
if (!TEST(pp->Flags, PF_JUMPING|PF_FALLING))
|
||||||
NewStateGroup(pp->Actor(), sg_PlayerHead);
|
NewStateGroup(pp->actor, sg_PlayerHead);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5722,7 +5722,7 @@ void DoPlayerDeathFollowKiller(PLAYERp pp)
|
||||||
|
|
||||||
void DoPlayerDeathCheckKeys(PLAYERp pp)
|
void DoPlayerDeathCheckKeys(PLAYERp pp)
|
||||||
{
|
{
|
||||||
auto plActor = pp->Actor();
|
DSWActor* plActor = pp->actor;
|
||||||
|
|
||||||
if (pp->input.actions & SB_OPEN)
|
if (pp->input.actions & SB_OPEN)
|
||||||
{
|
{
|
||||||
|
@ -5731,7 +5731,7 @@ void DoPlayerDeathCheckKeys(PLAYERp pp)
|
||||||
if (PlayerFloorHit(pp, pp->loz - PLAYER_HEIGHT))
|
if (PlayerFloorHit(pp, pp->loz - PLAYER_HEIGHT))
|
||||||
{
|
{
|
||||||
if (pp->DeathType == PLAYER_DEATH_FLIP || pp->DeathType == PLAYER_DEATH_RIPPER)
|
if (pp->DeathType == PLAYER_DEATH_FLIP || pp->DeathType == PLAYER_DEATH_RIPPER)
|
||||||
QueueLoWangs(pp->Actor());
|
QueueLoWangs(pp->actor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -5827,7 +5827,7 @@ void DoPlayerDeathCheckKick(PLAYERp pp)
|
||||||
SWStatIterator it(StatDamageList[stat]);
|
SWStatIterator it(StatDamageList[stat]);
|
||||||
while (auto itActor = it.Next())
|
while (auto itActor = it.Next())
|
||||||
{
|
{
|
||||||
if (itActor == pp->Actor())
|
if (itActor == pp->actor)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// don't set off mine
|
// don't set off mine
|
||||||
|
@ -5846,9 +5846,9 @@ void DoPlayerDeathCheckKick(PLAYERp pp)
|
||||||
plActor->user.slide_vel = itActor->spr.xvel<<1;
|
plActor->user.slide_vel = itActor->spr.xvel<<1;
|
||||||
RESET(plActor->user.Flags,SPR_BOUNCE);
|
RESET(plActor->user.Flags,SPR_BOUNCE);
|
||||||
pp->jump_speed = -500;
|
pp->jump_speed = -500;
|
||||||
NewStateGroup(pp->Actor(), sg_PlayerHeadFly);
|
NewStateGroup(pp->actor, sg_PlayerHeadFly);
|
||||||
SET(pp->Flags, PF_JUMPING);
|
SET(pp->Flags, PF_JUMPING);
|
||||||
SpawnShrap(pp->Actor(), nullptr);
|
SpawnShrap(pp->actor, nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5862,9 +5862,9 @@ void DoPlayerDeathCheckKick(PLAYERp pp)
|
||||||
plActor->user.slide_vel = 1000;
|
plActor->user.slide_vel = 1000;
|
||||||
RESET(plActor->user.Flags,SPR_BOUNCE);
|
RESET(plActor->user.Flags,SPR_BOUNCE);
|
||||||
pp->jump_speed = -100;
|
pp->jump_speed = -100;
|
||||||
NewStateGroup(pp->Actor(), sg_PlayerHeadFly);
|
NewStateGroup(pp->actor, sg_PlayerHeadFly);
|
||||||
SET(pp->Flags, PF_JUMPING);
|
SET(pp->Flags, PF_JUMPING);
|
||||||
SpawnShrap(pp->Actor(), nullptr);
|
SpawnShrap(pp->actor, nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5877,7 +5877,7 @@ void DoPlayerDeathMoveHead(PLAYERp pp)
|
||||||
dax = MOVEx(plActor->user.slide_vel, plActor->user.slide_ang);
|
dax = MOVEx(plActor->user.slide_vel, plActor->user.slide_ang);
|
||||||
day = MOVEy(plActor->user.slide_vel, plActor->user.slide_ang);
|
day = MOVEy(plActor->user.slide_vel, plActor->user.slide_ang);
|
||||||
|
|
||||||
plActor->user.coll = move_sprite(pp->Actor(), dax, day, 0, Z(16), Z(16), 1, synctics);
|
plActor->user.coll = move_sprite(pp->actor, dax, day, 0, Z(16), Z(16), 1, synctics);
|
||||||
{
|
{
|
||||||
switch (plActor->user.coll.type)
|
switch (plActor->user.coll.type)
|
||||||
{
|
{
|
||||||
|
@ -5895,7 +5895,7 @@ void DoPlayerDeathMoveHead(PLAYERp pp)
|
||||||
dang = getincangle(wall_ang, plActor->user.slide_ang);
|
dang = getincangle(wall_ang, plActor->user.slide_ang);
|
||||||
plActor->user.slide_ang = NORM_ANGLE(wall_ang + 1024 - dang);
|
plActor->user.slide_ang = NORM_ANGLE(wall_ang + 1024 - dang);
|
||||||
|
|
||||||
SpawnShrap(pp->Actor(), nullptr);
|
SpawnShrap(pp->actor, nullptr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case kHitWall:
|
case kHitWall:
|
||||||
|
@ -5905,7 +5905,7 @@ void DoPlayerDeathMoveHead(PLAYERp pp)
|
||||||
int dang = getincangle(wall_ang, plActor->user.slide_ang);
|
int dang = getincangle(wall_ang, plActor->user.slide_ang);
|
||||||
plActor->user.slide_ang = NORM_ANGLE(wall_ang + 1024 - dang);
|
plActor->user.slide_ang = NORM_ANGLE(wall_ang + 1024 - dang);
|
||||||
|
|
||||||
SpawnShrap(pp->Actor(), nullptr);
|
SpawnShrap(pp->actor, nullptr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5921,7 +5921,7 @@ void DoPlayerDeathMoveHead(PLAYERp pp)
|
||||||
if (sect == nullptr)
|
if (sect == nullptr)
|
||||||
{
|
{
|
||||||
pp->cursector = pp->lv_sector;
|
pp->cursector = pp->lv_sector;
|
||||||
ChangeActorSect(pp->Actor(), pp->lv_sector);
|
ChangeActorSect(pp->actor, pp->lv_sector);
|
||||||
pp->pos.X = plActor->spr.pos.X = pp->lv_x;
|
pp->pos.X = plActor->spr.pos.X = pp->lv_x;
|
||||||
pp->pos.Y = plActor->spr.pos.Y = pp->lv_y;
|
pp->pos.Y = plActor->spr.pos.Y = pp->lv_y;
|
||||||
}
|
}
|
||||||
|
@ -5947,7 +5947,7 @@ void DoPlayerDeathFlip(PLAYERp pp)
|
||||||
DoPlayerDeathJump(pp);
|
DoPlayerDeathJump(pp);
|
||||||
DoPlayerDeathHoriz(pp, PLAYER_DEATH_HORIZ_UP_VALUE, 2);
|
DoPlayerDeathHoriz(pp, PLAYER_DEATH_HORIZ_UP_VALUE, 2);
|
||||||
if (MoveSkip2 == 0)
|
if (MoveSkip2 == 0)
|
||||||
DoJump(pp->Actor());
|
DoJump(pp->actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TEST(pp->Flags,PF_FALLING))
|
if (TEST(pp->Flags,PF_FALLING))
|
||||||
|
@ -5955,7 +5955,7 @@ void DoPlayerDeathFlip(PLAYERp pp)
|
||||||
DoPlayerDeathFall(pp);
|
DoPlayerDeathFall(pp);
|
||||||
DoPlayerDeathHoriz(pp, PLAYER_DEATH_HORIZ_UP_VALUE, 4);
|
DoPlayerDeathHoriz(pp, PLAYER_DEATH_HORIZ_UP_VALUE, 4);
|
||||||
if (MoveSkip2 == 0)
|
if (MoveSkip2 == 0)
|
||||||
DoFall(pp->Actor());
|
DoFall(pp->actor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -5984,7 +5984,7 @@ void DoPlayerDeathDrown(PLAYERp pp)
|
||||||
DoPlayerDeathJump(pp);
|
DoPlayerDeathJump(pp);
|
||||||
DoPlayerDeathHoriz(pp, PLAYER_DEATH_HORIZ_UP_VALUE, 2);
|
DoPlayerDeathHoriz(pp, PLAYER_DEATH_HORIZ_UP_VALUE, 2);
|
||||||
if (MoveSkip2 == 0)
|
if (MoveSkip2 == 0)
|
||||||
DoJump(pp->Actor());
|
DoJump(pp->actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TEST(pp->Flags,PF_FALLING))
|
if (TEST(pp->Flags,PF_FALLING))
|
||||||
|
@ -6017,7 +6017,7 @@ void DoPlayerDeathBounce(PLAYERp pp)
|
||||||
if (pp->lo_sectp && TEST(pp->lo_sectp->extra, SECTFX_SINK))
|
if (pp->lo_sectp && TEST(pp->lo_sectp->extra, SECTFX_SINK))
|
||||||
{
|
{
|
||||||
RESET(plActor->spr.cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
|
RESET(plActor->spr.cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
|
||||||
NewStateGroup(pp->Actor(), sg_PlayerHead);
|
NewStateGroup(pp->actor, sg_PlayerHead);
|
||||||
plActor->user.slide_vel = 0;
|
plActor->user.slide_vel = 0;
|
||||||
SET(plActor->user.Flags, SPR_BOUNCE);
|
SET(plActor->user.Flags, SPR_BOUNCE);
|
||||||
|
|
||||||
|
@ -6030,7 +6030,7 @@ void DoPlayerDeathBounce(PLAYERp pp)
|
||||||
plActor->user.slide_vel >>= 2;
|
plActor->user.slide_vel >>= 2;
|
||||||
plActor->user.slide_ang = NORM_ANGLE((RANDOM_P2(64<<8)>>8) - 32);
|
plActor->user.slide_ang = NORM_ANGLE((RANDOM_P2(64<<8)>>8) - 32);
|
||||||
SET(pp->Flags, PF_JUMPING);
|
SET(pp->Flags, PF_JUMPING);
|
||||||
SpawnShrap(pp->Actor(), nullptr);
|
SpawnShrap(pp->actor, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6068,7 +6068,7 @@ void DoPlayerDeathCrumble(PLAYERp pp)
|
||||||
}
|
}
|
||||||
|
|
||||||
RESET(plActor->spr.cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
|
RESET(plActor->spr.cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
|
||||||
NewStateGroup(pp->Actor(), sg_PlayerHead);
|
NewStateGroup(pp->actor, sg_PlayerHead);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -6120,7 +6120,7 @@ void DoPlayerDeathExplode(PLAYERp pp)
|
||||||
}
|
}
|
||||||
|
|
||||||
RESET(plActor->spr.cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
|
RESET(plActor->spr.cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
|
||||||
NewStateGroup(pp->Actor(), sg_PlayerHead);
|
NewStateGroup(pp->actor, sg_PlayerHead);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -6170,9 +6170,9 @@ void DoPlayerBeginRun(PLAYERp pp)
|
||||||
ASSERT(plActor->user.ActorActionSet->Run);
|
ASSERT(plActor->user.ActorActionSet->Run);
|
||||||
|
|
||||||
if (TEST(pp->Flags, PF_PLAYER_MOVED))
|
if (TEST(pp->Flags, PF_PLAYER_MOVED))
|
||||||
NewStateGroup(pp->Actor(), plActor->user.ActorActionSet->Run);
|
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Run);
|
||||||
else
|
else
|
||||||
NewStateGroup(pp->Actor(), plActor->user.ActorActionSet->Stand);
|
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Stand);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoPlayerRun(PLAYERp pp)
|
void DoPlayerRun(PLAYERp pp)
|
||||||
|
@ -6243,7 +6243,7 @@ void DoPlayerRun(PLAYERp pp)
|
||||||
}
|
}
|
||||||
else if (TEST(pp->cursector->extra, SECTFX_TRIGGER))
|
else if (TEST(pp->cursector->extra, SECTFX_TRIGGER))
|
||||||
{
|
{
|
||||||
auto sActor = FindNearSprite(pp->Actor(), STAT_TRIGGER);
|
auto sActor = FindNearSprite(pp->actor, STAT_TRIGGER);
|
||||||
if (sActor && SP_TAG5(sActor) == TRIGGER_TYPE_REMOTE_SO)
|
if (sActor && SP_TAG5(sActor) == TRIGGER_TYPE_REMOTE_SO)
|
||||||
{
|
{
|
||||||
pp->remoteActor = sActor;
|
pp->remoteActor = sActor;
|
||||||
|
@ -6285,12 +6285,12 @@ void DoPlayerRun(PLAYERp pp)
|
||||||
if (TEST(pp->Flags, PF_PLAYER_MOVED))
|
if (TEST(pp->Flags, PF_PLAYER_MOVED))
|
||||||
{
|
{
|
||||||
if (plActor->user.Rot != plActor->user.ActorActionSet->Run)
|
if (plActor->user.Rot != plActor->user.ActorActionSet->Run)
|
||||||
NewStateGroup(pp->Actor(), plActor->user.ActorActionSet->Run);
|
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Run);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (plActor->user.Rot != plActor->user.ActorActionSet->Stand)
|
if (plActor->user.Rot != plActor->user.ActorActionSet->Stand)
|
||||||
NewStateGroup(pp->Actor(), plActor->user.ActorActionSet->Stand);
|
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Stand);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6506,7 +6506,7 @@ void PlayerGlobal(PLAYERp pp)
|
||||||
{
|
{
|
||||||
////DSPRINTF(ds,"Squish diff %d, min %d, cz %d, fz %d, lo %d, hi %d",labs(pp->loz - pp->hiz)>>8,min_height>>8, pp->ceiling_dist>>8, pp->floor_dist>>8,pp->lo_sectp-sector,pp->hi_sectp-sector);
|
////DSPRINTF(ds,"Squish diff %d, min %d, cz %d, fz %d, lo %d, hi %d",labs(pp->loz - pp->hiz)>>8,min_height>>8, pp->ceiling_dist>>8, pp->floor_dist>>8,pp->lo_sectp-sector,pp->hi_sectp-sector);
|
||||||
//MONO_PRINT(ds);
|
//MONO_PRINT(ds);
|
||||||
PlayerUpdateHealth(pp, -pp->Actor()->user.Health); // Make sure he dies!
|
PlayerUpdateHealth(pp, -pp->actor->user.Health); // Make sure he dies!
|
||||||
PlayerCheckDeath(pp, nullptr);
|
PlayerCheckDeath(pp, nullptr);
|
||||||
|
|
||||||
if (TEST(pp->Flags, PF_DEAD))
|
if (TEST(pp->Flags, PF_DEAD))
|
||||||
|
@ -6670,7 +6670,7 @@ void domovethings(void)
|
||||||
|
|
||||||
pSpriteControl(pp);
|
pSpriteControl(pp);
|
||||||
|
|
||||||
PlayerStateControl(pp->Actor());
|
PlayerStateControl(pp->actor);
|
||||||
|
|
||||||
DoPlayerSectorUpdatePostMove(pp);
|
DoPlayerSectorUpdatePostMove(pp);
|
||||||
PlayerGlobal(pp);
|
PlayerGlobal(pp);
|
||||||
|
|
|
@ -64,7 +64,7 @@ void InitPrediction(PLAYERp pp)
|
||||||
|
|
||||||
// make a copy of player struct and sprite
|
// make a copy of player struct and sprite
|
||||||
//*ppp = *pp;
|
//*ppp = *pp;
|
||||||
//PredictUser = *pp->Actor()->user;
|
//PredictUser = *pp->actor->user;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoPrediction(PLAYERp ppp)
|
void DoPrediction(PLAYERp ppp)
|
||||||
|
|
|
@ -1840,7 +1840,7 @@ void OperateTripTrigger(PLAYERp pp)
|
||||||
{
|
{
|
||||||
if (Distance(actor->spr.pos.X, actor->spr.pos.Y, pp->pos.X, pp->pos.Y) < dist)
|
if (Distance(actor->spr.pos.X, actor->spr.pos.Y, pp->pos.X, pp->pos.Y) < dist)
|
||||||
{
|
{
|
||||||
actor->user.targetActor = pp->Actor();
|
actor->user.targetActor = pp->actor;
|
||||||
RESET(actor->user.Flags, SPR_WAIT_FOR_TRIGGER);
|
RESET(actor->user.Flags, SPR_WAIT_FOR_TRIGGER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2159,7 +2159,7 @@ void PlayerOperateEnv(PLAYERp pp)
|
||||||
{
|
{
|
||||||
bool found;
|
bool found;
|
||||||
|
|
||||||
if (Prediction || !pp->Actor())
|
if (Prediction || !pp->actor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -2287,7 +2287,7 @@ void PlayerOperateEnv(PLAYERp pp)
|
||||||
{
|
{
|
||||||
PlayerTakeSectorDamage(pp);
|
PlayerTakeSectorDamage(pp);
|
||||||
}
|
}
|
||||||
else if ((ActorZOfBottom(pp->Actor()) >= sectp->floorz) && !TEST(pp->Flags, PF_DIVING))
|
else if ((ActorZOfBottom(pp->actor) >= sectp->floorz) && !TEST(pp->Flags, PF_DIVING))
|
||||||
{
|
{
|
||||||
PlayerTakeSectorDamage(pp);
|
PlayerTakeSectorDamage(pp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -839,7 +839,7 @@ void SpawnUser(DSWActor* actor, short id, STATEp state)
|
||||||
actor->user.WpnGoalActor = nullptr;
|
actor->user.WpnGoalActor = nullptr;
|
||||||
actor->user.attachActor = nullptr;
|
actor->user.attachActor = nullptr;
|
||||||
actor->user.track = -1;
|
actor->user.track = -1;
|
||||||
actor->user.targetActor = Player[0].Actor();
|
actor->user.targetActor = Player[0].actor;
|
||||||
actor->user.Radius = 220;
|
actor->user.Radius = 220;
|
||||||
actor->user.Sibling = -1;
|
actor->user.Sibling = -1;
|
||||||
actor->user.WaitTics = 0;
|
actor->user.WaitTics = 0;
|
||||||
|
@ -5046,7 +5046,7 @@ int DoGet(DSWActor* actor)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!SpriteOverlap(actor, pp->Actor()))
|
if (!SpriteOverlap(actor, pp->actor))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -5836,7 +5836,7 @@ KeyMain:
|
||||||
|
|
||||||
case ICON_FLAG:
|
case ICON_FLAG:
|
||||||
{
|
{
|
||||||
if (actor->spr.pal == pp->Actor()->spr.pal) break; // Can't pick up your own flag!
|
if (actor->spr.pal == pp->actor->spr.pal) break; // Can't pick up your own flag!
|
||||||
|
|
||||||
PlaySound(DIGI_ITEM, actor, v3df_dontpan);
|
PlaySound(DIGI_ITEM, actor, v3df_dontpan);
|
||||||
|
|
||||||
|
@ -5854,11 +5854,11 @@ KeyMain:
|
||||||
actorNew->user.Counter = 0;
|
actorNew->user.Counter = 0;
|
||||||
RESET(actorNew->spr.cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
|
RESET(actorNew->spr.cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
|
||||||
SET(actorNew->spr.cstat, CSTAT_SPRITE_ALIGNMENT_WALL);
|
SET(actorNew->spr.cstat, CSTAT_SPRITE_ALIGNMENT_WALL);
|
||||||
SetAttach(pp->Actor(), actorNew);
|
SetAttach(pp->actor, actorNew);
|
||||||
actorNew->user.sz = ActorZOfMiddle(pp->Actor()); // Set mid way up who it hit
|
actorNew->user.sz = 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
|
||||||
actorNew->user.flagOwnerActor = actor; // Tell carried flag who owns it
|
actorNew->user.flagOwnerActor = actor; // Tell carried flag who owns it
|
||||||
KillGet(actor); // Set up for flag respawning
|
KillGet(actor); // Set up for flag respawning
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1798,7 +1798,7 @@ PlayerPart:
|
||||||
//pp->posz -= PLAYER_HEIGHT + Z(12);
|
//pp->posz -= PLAYER_HEIGHT + Z(12);
|
||||||
DoPlayerZrange(pp);
|
DoPlayerZrange(pp);
|
||||||
pp->pos.Z = pp->loz - PLAYER_CRAWL_HEIGHT;
|
pp->pos.Z = pp->loz - PLAYER_CRAWL_HEIGHT;
|
||||||
pp->Actor()->spr.pos.Z = pp->loz;
|
pp->actor->spr.pos.Z = pp->loz;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1809,7 +1809,7 @@ PlayerPart:
|
||||||
if (!TEST(pp->Flags, PF_JUMPING | PF_FALLING | PF_FLYING))
|
if (!TEST(pp->Flags, PF_JUMPING | PF_FALLING | PF_FLYING))
|
||||||
{
|
{
|
||||||
pp->pos.Z = pp->loz - PLAYER_HEIGHT;
|
pp->pos.Z = pp->loz - PLAYER_HEIGHT;
|
||||||
pp->Actor()->spr.pos.Z = pp->loz;
|
pp->actor->spr.pos.Z = pp->loz;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3445,7 +3445,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics)
|
||||||
|
|
||||||
if (Distance(actor->spr.pos.X, actor->spr.pos.Y, pp->pos.X, pp->pos.Y) < actor->user.Dist)
|
if (Distance(actor->spr.pos.X, actor->spr.pos.Y, pp->pos.X, pp->pos.Y) < actor->user.Dist)
|
||||||
{
|
{
|
||||||
actor->user.targetActor = pp->Actor();
|
actor->user.targetActor = pp->actor;
|
||||||
RESET(actor->user.Flags, SPR_WAIT_FOR_PLAYER);
|
RESET(actor->user.Flags, SPR_WAIT_FOR_PLAYER);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5385,7 +5385,7 @@ bool PlayerTakeDamage(PLAYERp pp, DSWActor* weapActor)
|
||||||
if (weapActor->user.ID == ZOMBIE_RUN_R0)
|
if (weapActor->user.ID == ZOMBIE_RUN_R0)
|
||||||
{
|
{
|
||||||
// if weapons Owner the player
|
// if weapons Owner the player
|
||||||
if (weapOwner == pp->Actor())
|
if (weapOwner == pp->actor)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11264,7 +11264,7 @@ void InitSpellRing(PLAYERp pp)
|
||||||
|
|
||||||
actorNew->spr.hitag = LUMINOUS; //Always full brightness
|
actorNew->spr.hitag = LUMINOUS; //Always full brightness
|
||||||
actorNew->spr.xvel = 500;
|
actorNew->spr.xvel = 500;
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->spr.shade = -40;
|
actorNew->spr.shade = -40;
|
||||||
actorNew->spr.xrepeat = 32;
|
actorNew->spr.xrepeat = 32;
|
||||||
actorNew->spr.yrepeat = 32;
|
actorNew->spr.yrepeat = 32;
|
||||||
|
@ -11624,7 +11624,7 @@ void InitSpellNapalm(PLAYERp pp)
|
||||||
PlaySound(DIGI_NAPWIZ, actor, v3df_follow);
|
PlaySound(DIGI_NAPWIZ, actor, v3df_follow);
|
||||||
}
|
}
|
||||||
|
|
||||||
SetOwner(pp->Actor(), actor);
|
SetOwner(pp->actor, actor);
|
||||||
actor->spr.shade = -40;
|
actor->spr.shade = -40;
|
||||||
actor->spr.xrepeat = 32;
|
actor->spr.xrepeat = 32;
|
||||||
actor->spr.yrepeat = 32;
|
actor->spr.yrepeat = 32;
|
||||||
|
@ -11759,7 +11759,7 @@ int InitSpellMirv(PLAYERp pp)
|
||||||
|
|
||||||
PlaySound(DIGI_MIRVWIZ, actorNew, v3df_follow);
|
PlaySound(DIGI_MIRVWIZ, actorNew, v3df_follow);
|
||||||
|
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->spr.shade = -40;
|
actorNew->spr.shade = -40;
|
||||||
actorNew->spr.xrepeat = 72;
|
actorNew->spr.xrepeat = 72;
|
||||||
actorNew->spr.yrepeat = 72;
|
actorNew->spr.yrepeat = 72;
|
||||||
|
@ -11849,7 +11849,7 @@ int InitSwordAttack(PLAYERp pp)
|
||||||
for (size_t i = 0; i < countof(dangs); i++)
|
for (size_t i = 0; i < countof(dangs); i++)
|
||||||
{
|
{
|
||||||
if (RandomRange(1000) < 500) continue; // Don't spawn bubbles every time
|
if (RandomRange(1000) < 500) continue; // Don't spawn bubbles every time
|
||||||
bubble = SpawnBubble(pp->Actor());
|
bubble = SpawnBubble(pp->actor);
|
||||||
if (bubble != nullptr)
|
if (bubble != nullptr)
|
||||||
{
|
{
|
||||||
bubble->spr.ang = pp->angle.ang.asbuild();
|
bubble->spr.ang = pp->angle.ang.asbuild();
|
||||||
|
@ -11886,10 +11886,10 @@ int InitSwordAttack(PLAYERp pp)
|
||||||
|
|
||||||
if (dist < CloseRangeDist(itActor, plActor, reach) && PlayerFacingRange(pp, itActor, face))
|
if (dist < CloseRangeDist(itActor, plActor, reach) && PlayerFacingRange(pp, itActor, face))
|
||||||
{
|
{
|
||||||
if (SpriteOverlapZ(pp->Actor(), itActor, Z(20)))
|
if (SpriteOverlapZ(pp->actor, itActor, Z(20)))
|
||||||
{
|
{
|
||||||
if (FAFcansee(itActor->spr.pos.X, itActor->spr.pos.Y, ActorZOfMiddle(itActor), itActor->spr.sector(), plActor->spr.pos.X, plActor->spr.pos.Y, ActorZOfMiddle(plActor), plActor->spr.sector()))
|
if (FAFcansee(itActor->spr.pos.X, itActor->spr.pos.Y, ActorZOfMiddle(itActor), itActor->spr.sector(), plActor->spr.pos.X, plActor->spr.pos.Y, ActorZOfMiddle(plActor), plActor->spr.sector()))
|
||||||
DoDamage(itActor, pp->Actor());
|
DoDamage(itActor, pp->actor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12020,7 +12020,7 @@ int InitFistAttack(PLAYERp pp)
|
||||||
|
|
||||||
for (size_t i = 0; i < countof(dangs); i++)
|
for (size_t i = 0; i < countof(dangs); i++)
|
||||||
{
|
{
|
||||||
bubble = SpawnBubble(pp->Actor());
|
bubble = SpawnBubble(pp->actor);
|
||||||
if (bubble != nullptr)
|
if (bubble != nullptr)
|
||||||
{
|
{
|
||||||
bubble->spr.ang = pp->angle.ang.asbuild();
|
bubble->spr.ang = pp->angle.ang.asbuild();
|
||||||
|
@ -12062,7 +12062,7 @@ int InitFistAttack(PLAYERp pp)
|
||||||
|
|
||||||
if (dist < CloseRangeDist(itActor, plActor, reach) && PlayerFacingRange(pp, itActor, face))
|
if (dist < CloseRangeDist(itActor, plActor, reach) && PlayerFacingRange(pp, itActor, face))
|
||||||
{
|
{
|
||||||
if (SpriteOverlapZ(pp->Actor(), itActor, Z(20)) || face == 190)
|
if (SpriteOverlapZ(pp->actor, itActor, Z(20)) || face == 190)
|
||||||
{
|
{
|
||||||
if (FAFcansee(itActor->spr.pos.X, itActor->spr.pos.Y, ActorZOfMiddle(itActor), itActor->spr.sector(), plActor->spr.pos.X, plActor->spr.pos.Y, ActorZOfMiddle(plActor), plActor->spr.sector()))
|
if (FAFcansee(itActor->spr.pos.X, itActor->spr.pos.Y, ActorZOfMiddle(itActor), itActor->spr.sector(), plActor->spr.pos.X, plActor->spr.pos.Y, ActorZOfMiddle(plActor), plActor->spr.sector()))
|
||||||
DoDamage(itActor, plActor);
|
DoDamage(itActor, plActor);
|
||||||
|
@ -12651,7 +12651,7 @@ int InitStar(PLAYERp pp)
|
||||||
|
|
||||||
auto actorNew = SpawnActor(STAT_MISSILE, STAR1, s_Star, pp->cursector, nx, ny, nz, pp->angle.ang.asbuild(), STAR_VELOCITY);
|
auto actorNew = SpawnActor(STAT_MISSILE, STAR1, s_Star, pp->cursector, nx, ny, nz, pp->angle.ang.asbuild(), STAR_VELOCITY);
|
||||||
|
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->spr.yrepeat = actorNew->spr.xrepeat = STAR_REPEAT;
|
actorNew->spr.yrepeat = actorNew->spr.xrepeat = STAR_REPEAT;
|
||||||
actorNew->spr.shade = -25;
|
actorNew->spr.shade = -25;
|
||||||
actorNew->spr.clipdist = 32 >> 2;
|
actorNew->spr.clipdist = 32 >> 2;
|
||||||
|
@ -12676,7 +12676,7 @@ int InitStar(PLAYERp pp)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WeaponAutoAim(pp->Actor(), actorNew, 32, false) != -1)
|
if (WeaponAutoAim(pp->actor, actorNew, 32, false) != -1)
|
||||||
{
|
{
|
||||||
zvel = actorNew->spr.zvel;
|
zvel = actorNew->spr.zvel;
|
||||||
}
|
}
|
||||||
|
@ -12757,7 +12757,7 @@ void InitHeartAttack(PLAYERp pp)
|
||||||
|
|
||||||
actorNew->spr.hitag = LUMINOUS; //Always full brightness
|
actorNew->spr.hitag = LUMINOUS; //Always full brightness
|
||||||
|
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->spr.shade = -10;
|
actorNew->spr.shade = -10;
|
||||||
actorNew->spr.xrepeat = 52;
|
actorNew->spr.xrepeat = 52;
|
||||||
actorNew->spr.yrepeat = 52;
|
actorNew->spr.yrepeat = 52;
|
||||||
|
@ -12851,7 +12851,7 @@ int ContinueHitscan(PLAYERp pp, sectortype* sect, int x, int y, int z, short ang
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BulletHitSprite(pp->Actor(), hit.actor(), hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, 0))
|
if (BulletHitSprite(pp->actor, hit.actor(), hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, 0))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// hit a switch?
|
// hit a switch?
|
||||||
|
@ -12898,7 +12898,7 @@ int InitShotgun(PLAYERp pp)
|
||||||
daz = nz = pp->pos.Z + pp->bob_z;
|
daz = nz = pp->pos.Z + pp->bob_z;
|
||||||
|
|
||||||
daang = 64;
|
daang = 64;
|
||||||
if (WeaponAutoAimHitscan(pp->Actor(), &daz, &daang, false) != nullptr)
|
if (WeaponAutoAimHitscan(pp->actor, &daz, &daang, false) != nullptr)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -13017,7 +13017,7 @@ int InitShotgun(PLAYERp pp)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BulletHitSprite(pp->Actor(), hitActor, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, SHOTGUN_SMOKE))
|
if (BulletHitSprite(pp->actor, hitActor, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, SHOTGUN_SMOKE))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// hit a switch?
|
// hit a switch?
|
||||||
|
@ -13059,7 +13059,7 @@ int InitLaser(PLAYERp pp)
|
||||||
nx, ny, nz, pp->angle.ang.asbuild(), 300);
|
nx, ny, nz, pp->angle.ang.asbuild(), 300);
|
||||||
|
|
||||||
actorNew->spr.hitag = LUMINOUS; //Always full brightness
|
actorNew->spr.hitag = LUMINOUS; //Always full brightness
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->spr.yrepeat = 52;
|
actorNew->spr.yrepeat = 52;
|
||||||
actorNew->spr.xrepeat = 52;
|
actorNew->spr.xrepeat = 52;
|
||||||
actorNew->spr.shade = -15;
|
actorNew->spr.shade = -15;
|
||||||
|
@ -13116,7 +13116,7 @@ int InitLaser(PLAYERp pp)
|
||||||
|
|
||||||
actor->spr.clipdist = oclipdist;
|
actor->spr.clipdist = oclipdist;
|
||||||
|
|
||||||
if (WeaponAutoAim(pp->Actor(), actorNew, 32, false) == -1)
|
if (WeaponAutoAim(pp->actor, actorNew, 32, false) == -1)
|
||||||
{
|
{
|
||||||
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang - 5);
|
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang - 5);
|
||||||
}
|
}
|
||||||
|
@ -13162,7 +13162,7 @@ int InitRail(PLAYERp pp)
|
||||||
nx, ny, nz, pp->angle.ang.asbuild(), 1200);
|
nx, ny, nz, pp->angle.ang.asbuild(), 1200);
|
||||||
|
|
||||||
|
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->spr.yrepeat = 52;
|
actorNew->spr.yrepeat = 52;
|
||||||
actorNew->spr.xrepeat = 52;
|
actorNew->spr.xrepeat = 52;
|
||||||
actorNew->spr.shade = -15;
|
actorNew->spr.shade = -15;
|
||||||
|
@ -13201,7 +13201,7 @@ int InitRail(PLAYERp pp)
|
||||||
actor->spr.clipdist = oclipdist;
|
actor->spr.clipdist = oclipdist;
|
||||||
|
|
||||||
actorNew->spr.zvel = zvel >> 1;
|
actorNew->spr.zvel = zvel >> 1;
|
||||||
if (WeaponAutoAim(pp->Actor(), actorNew, 32, false) == -1)
|
if (WeaponAutoAim(pp->actor, actorNew, 32, false) == -1)
|
||||||
{
|
{
|
||||||
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang - 4);
|
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang - 4);
|
||||||
}
|
}
|
||||||
|
@ -13329,7 +13329,7 @@ int InitRocket(PLAYERp pp)
|
||||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], pp->cursector,
|
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], pp->cursector,
|
||||||
nx, ny, nz, pp->angle.ang.asbuild(), ROCKET_VELOCITY);
|
nx, ny, nz, pp->angle.ang.asbuild(), ROCKET_VELOCITY);
|
||||||
|
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->spr.yrepeat = 90;
|
actorNew->spr.yrepeat = 90;
|
||||||
actorNew->spr.xrepeat = 90;
|
actorNew->spr.xrepeat = 90;
|
||||||
actorNew->spr.shade = -15;
|
actorNew->spr.shade = -15;
|
||||||
|
@ -13387,7 +13387,7 @@ int InitRocket(PLAYERp pp)
|
||||||
actor->spr.clipdist = oclipdist;
|
actor->spr.clipdist = oclipdist;
|
||||||
|
|
||||||
actorNew->spr.zvel = zvel >> 1;
|
actorNew->spr.zvel = zvel >> 1;
|
||||||
if (WeaponAutoAim(pp->Actor(), actorNew, 32, false) == -1)
|
if (WeaponAutoAim(pp->actor, actorNew, 32, false) == -1)
|
||||||
{
|
{
|
||||||
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang - 5);
|
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang - 5);
|
||||||
}
|
}
|
||||||
|
@ -13437,7 +13437,7 @@ int InitBunnyRocket(PLAYERp pp)
|
||||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R4, &s_BunnyRocket[0][0], pp->cursector,
|
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R4, &s_BunnyRocket[0][0], pp->cursector,
|
||||||
nx, ny, nz, pp->angle.ang.asbuild(), ROCKET_VELOCITY);
|
nx, ny, nz, pp->angle.ang.asbuild(), ROCKET_VELOCITY);
|
||||||
|
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->spr.yrepeat = 64;
|
actorNew->spr.yrepeat = 64;
|
||||||
actorNew->spr.xrepeat = 64;
|
actorNew->spr.xrepeat = 64;
|
||||||
actorNew->spr.shade = -15;
|
actorNew->spr.shade = -15;
|
||||||
|
@ -13492,7 +13492,7 @@ int InitBunnyRocket(PLAYERp pp)
|
||||||
actor->spr.clipdist = oclipdist;
|
actor->spr.clipdist = oclipdist;
|
||||||
|
|
||||||
actorNew->spr.zvel = zvel >> 1;
|
actorNew->spr.zvel = zvel >> 1;
|
||||||
if (WeaponAutoAim(pp->Actor(), actorNew, 32, false) == -1)
|
if (WeaponAutoAim(pp->actor, actorNew, 32, false) == -1)
|
||||||
{
|
{
|
||||||
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang - 5);
|
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang - 5);
|
||||||
}
|
}
|
||||||
|
@ -13539,7 +13539,7 @@ int InitNuke(PLAYERp pp)
|
||||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], pp->cursector,
|
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], pp->cursector,
|
||||||
nx, ny, nz, pp->angle.ang.asbuild(), 700);
|
nx, ny, nz, pp->angle.ang.asbuild(), 700);
|
||||||
|
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->spr.yrepeat = 128;
|
actorNew->spr.yrepeat = 128;
|
||||||
actorNew->spr.xrepeat = 128;
|
actorNew->spr.xrepeat = 128;
|
||||||
actorNew->spr.shade = -15;
|
actorNew->spr.shade = -15;
|
||||||
|
@ -13585,7 +13585,7 @@ int InitNuke(PLAYERp pp)
|
||||||
actor->spr.clipdist = oclipdist;
|
actor->spr.clipdist = oclipdist;
|
||||||
|
|
||||||
actorNew->spr.zvel = zvel >> 1;
|
actorNew->spr.zvel = zvel >> 1;
|
||||||
if (WeaponAutoAim(pp->Actor(), actorNew, 32, false) == -1)
|
if (WeaponAutoAim(pp->actor, actorNew, 32, false) == -1)
|
||||||
{
|
{
|
||||||
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang - 5);
|
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang - 5);
|
||||||
}
|
}
|
||||||
|
@ -13689,7 +13689,7 @@ int InitMicro(PLAYERp pp)
|
||||||
|
|
||||||
const int MAX_MICRO = 1;
|
const int MAX_MICRO = 1;
|
||||||
|
|
||||||
DoPickTarget(pp->Actor(), 256, false);
|
DoPickTarget(pp->actor, 256, false);
|
||||||
|
|
||||||
if (TargetSortCount > MAX_MICRO)
|
if (TargetSortCount > MAX_MICRO)
|
||||||
TargetSortCount = MAX_MICRO;
|
TargetSortCount = MAX_MICRO;
|
||||||
|
@ -13722,7 +13722,7 @@ int InitMicro(PLAYERp pp)
|
||||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Micro[0][0], pp->cursector,
|
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Micro[0][0], pp->cursector,
|
||||||
nx, ny, nz, ang, 1200);
|
nx, ny, nz, ang, 1200);
|
||||||
|
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->spr.yrepeat = 24;
|
actorNew->spr.yrepeat = 24;
|
||||||
actorNew->spr.xrepeat = 24;
|
actorNew->spr.xrepeat = 24;
|
||||||
actorNew->spr.shade = -15;
|
actorNew->spr.shade = -15;
|
||||||
|
@ -14347,7 +14347,7 @@ int InitEnemyRail(DSWActor* actor)
|
||||||
TRAVERSE_CONNECT(pnum)
|
TRAVERSE_CONNECT(pnum)
|
||||||
{
|
{
|
||||||
pp = &Player[pnum];
|
pp = &Player[pnum];
|
||||||
if (actor->user.targetActor == pp->Actor())
|
if (actor->user.targetActor == pp->actor)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14922,7 +14922,7 @@ int InitTracerUzi(PLAYERp pp)
|
||||||
nx, ny, nz, pp->angle.ang.asbuild(), TRACER_VELOCITY);
|
nx, ny, nz, pp->angle.ang.asbuild(), TRACER_VELOCITY);
|
||||||
|
|
||||||
actorNew->spr.hitag = LUMINOUS; //Always full brightness
|
actorNew->spr.hitag = LUMINOUS; //Always full brightness
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->spr.yrepeat = 10;
|
actorNew->spr.yrepeat = 10;
|
||||||
actorNew->spr.xrepeat = 10;
|
actorNew->spr.xrepeat = 10;
|
||||||
actorNew->spr.shade = -40;
|
actorNew->spr.shade = -40;
|
||||||
|
@ -14959,7 +14959,7 @@ int InitTracerUzi(PLAYERp pp)
|
||||||
|
|
||||||
plActor->spr.clipdist = oclipdist;
|
plActor->spr.clipdist = oclipdist;
|
||||||
|
|
||||||
WeaponAutoAim(pp->Actor(), actorNew, 32, false);
|
WeaponAutoAim(pp->actor, actorNew, 32, false);
|
||||||
|
|
||||||
// a bit of randomness
|
// a bit of randomness
|
||||||
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang + RandomRange(30) - 15);
|
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang + RandomRange(30) - 15);
|
||||||
|
@ -15241,7 +15241,7 @@ int InitUzi(PLAYERp pp)
|
||||||
nz = pp->pos.Z + pp->bob_z;
|
nz = pp->pos.Z + pp->bob_z;
|
||||||
daz = pp->pos.Z + pp->bob_z;
|
daz = pp->pos.Z + pp->bob_z;
|
||||||
daang = 32;
|
daang = 32;
|
||||||
if (WeaponAutoAimHitscan(pp->Actor(), &daz, &daang, false) != nullptr)
|
if (WeaponAutoAimHitscan(pp->actor, &daz, &daang, false) != nullptr)
|
||||||
{
|
{
|
||||||
daang += RandomRange(24) - 12;
|
daang += RandomRange(24) - 12;
|
||||||
daang = NORM_ANGLE(daang);
|
daang = NORM_ANGLE(daang);
|
||||||
|
@ -15357,7 +15357,7 @@ int InitUzi(PLAYERp pp)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BulletHitSprite(pp->Actor(), hitActor, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, 0))
|
if (BulletHitSprite(pp->actor, hitActor, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, 0))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// hit a switch?
|
// hit a switch?
|
||||||
|
@ -15372,7 +15372,7 @@ int InitUzi(PLAYERp pp)
|
||||||
actorNew->spr.shade = -40;
|
actorNew->spr.shade = -40;
|
||||||
actorNew->spr.xrepeat = UZI_SMOKE_REPEAT;
|
actorNew->spr.xrepeat = UZI_SMOKE_REPEAT;
|
||||||
actorNew->spr.yrepeat = UZI_SMOKE_REPEAT;
|
actorNew->spr.yrepeat = UZI_SMOKE_REPEAT;
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
SET(actorNew->spr.cstat, cstat | CSTAT_SPRITE_YCENTER);
|
SET(actorNew->spr.cstat, cstat | CSTAT_SPRITE_YCENTER);
|
||||||
actorNew->spr.clipdist = 8 >> 2;
|
actorNew->spr.clipdist = 8 >> 2;
|
||||||
|
|
||||||
|
@ -15384,7 +15384,7 @@ int InitUzi(PLAYERp pp)
|
||||||
actorNew->spr.shade = -40;
|
actorNew->spr.shade = -40;
|
||||||
actorNew->spr.xrepeat = UZI_SPARK_REPEAT;
|
actorNew->spr.xrepeat = UZI_SPARK_REPEAT;
|
||||||
actorNew->spr.yrepeat = UZI_SPARK_REPEAT;
|
actorNew->spr.yrepeat = UZI_SPARK_REPEAT;
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->user.spal = actorNew->spr.pal = pal;
|
actorNew->user.spal = actorNew->spr.pal = pal;
|
||||||
SET(actorNew->spr.cstat, cstat | CSTAT_SPRITE_YCENTER);
|
SET(actorNew->spr.cstat, cstat | CSTAT_SPRITE_YCENTER);
|
||||||
actorNew->spr.clipdist = 8 >> 2;
|
actorNew->spr.clipdist = 8 >> 2;
|
||||||
|
@ -15410,7 +15410,7 @@ int InitTankShell(DSWActor* actor, PLAYERp pp)
|
||||||
auto actorNew = SpawnActor(STAT_MISSILE, 0, s_TankShell, actor->spr.sector(),
|
auto actorNew = SpawnActor(STAT_MISSILE, 0, s_TankShell, actor->spr.sector(),
|
||||||
actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.ang, TANK_SHELL_VELOCITY);
|
actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.ang, TANK_SHELL_VELOCITY);
|
||||||
|
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->spr.yrepeat = 8;
|
actorNew->spr.yrepeat = 8;
|
||||||
actorNew->spr.xrepeat = 8;
|
actorNew->spr.xrepeat = 8;
|
||||||
actorNew->spr.shade = -40;
|
actorNew->spr.shade = -40;
|
||||||
|
@ -15549,7 +15549,7 @@ int InitTurretRocket(DSWActor* actor, PLAYERp pp)
|
||||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], actor->spr.sector(),
|
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], actor->spr.sector(),
|
||||||
actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.ang, ROCKET_VELOCITY);
|
actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.ang, ROCKET_VELOCITY);
|
||||||
|
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->spr.yrepeat = 40;
|
actorNew->spr.yrepeat = 40;
|
||||||
actorNew->spr.xrepeat = 40;
|
actorNew->spr.xrepeat = 40;
|
||||||
actorNew->spr.shade = -40;
|
actorNew->spr.shade = -40;
|
||||||
|
@ -15586,7 +15586,7 @@ int InitTurretFireball(DSWActor* actor, PLAYERp pp)
|
||||||
auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL, s_Fireball, actor->spr.sector(),
|
auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL, s_Fireball, actor->spr.sector(),
|
||||||
actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.ang, FIREBALL_VELOCITY);
|
actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.ang, FIREBALL_VELOCITY);
|
||||||
|
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->spr.yrepeat = 40;
|
actorNew->spr.yrepeat = 40;
|
||||||
actorNew->spr.xrepeat = 40;
|
actorNew->spr.xrepeat = 40;
|
||||||
actorNew->spr.shade = -40;
|
actorNew->spr.shade = -40;
|
||||||
|
@ -15636,7 +15636,7 @@ int InitTurretRail(DSWActor* actor, PLAYERp pp)
|
||||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R1, &s_Rail[0][0], pp->cursector,
|
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R1, &s_Rail[0][0], pp->cursector,
|
||||||
nx, ny, nz, actor->spr.ang, 1200);
|
nx, ny, nz, actor->spr.ang, 1200);
|
||||||
|
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->spr.yrepeat = 52;
|
actorNew->spr.yrepeat = 52;
|
||||||
actorNew->spr.xrepeat = 52;
|
actorNew->spr.xrepeat = 52;
|
||||||
actorNew->spr.shade = -15;
|
actorNew->spr.shade = -15;
|
||||||
|
@ -15654,7 +15654,7 @@ int InitTurretRail(DSWActor* actor, PLAYERp pp)
|
||||||
|
|
||||||
actorNew->spr.clipdist = 64L>>2;
|
actorNew->spr.clipdist = 64L>>2;
|
||||||
|
|
||||||
if (WeaponAutoAim(pp->Actor(), actorNew, 32, false) == -1)
|
if (WeaponAutoAim(pp->actor, actorNew, 32, false) == -1)
|
||||||
{
|
{
|
||||||
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang);
|
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang);
|
||||||
}
|
}
|
||||||
|
@ -15685,7 +15685,7 @@ int InitTurretLaser(DSWActor* actor, PLAYERp pp)
|
||||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, s_Laser, pp->cursector,
|
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, s_Laser, pp->cursector,
|
||||||
nx, ny, nz, actor->spr.ang, 300);
|
nx, ny, nz, actor->spr.ang, 300);
|
||||||
|
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->spr.yrepeat = 52;
|
actorNew->spr.yrepeat = 52;
|
||||||
actorNew->spr.xrepeat = 52;
|
actorNew->spr.xrepeat = 52;
|
||||||
actorNew->spr.shade = -15;
|
actorNew->spr.shade = -15;
|
||||||
|
@ -15729,7 +15729,7 @@ int InitSobjMachineGun(DSWActor* actor, PLAYERp pp)
|
||||||
daz = nz = actor->spr.pos.Z;
|
daz = nz = actor->spr.pos.Z;
|
||||||
|
|
||||||
if (RANDOM_P2(1024) < 200)
|
if (RANDOM_P2(1024) < 200)
|
||||||
InitTracerTurret(actor, pp->Actor(), pp->horizon.horiz.asq16());
|
InitTracerTurret(actor, pp->actor, pp->horizon.horiz.asq16());
|
||||||
|
|
||||||
daang = 64;
|
daang = 64;
|
||||||
if (WeaponAutoAimHitscan(actor, &daz, &daang, false) != nullptr)
|
if (WeaponAutoAimHitscan(actor, &daz, &daang, false) != nullptr)
|
||||||
|
@ -15800,7 +15800,7 @@ int InitSobjMachineGun(DSWActor* actor, PLAYERp pp)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BulletHitSprite(pp->Actor(), hit.actor(), hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, 0))
|
if (BulletHitSprite(pp->actor, hit.actor(), hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, 0))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// hit a switch?
|
// hit a switch?
|
||||||
|
@ -15853,7 +15853,7 @@ int InitSobjGun(PLAYERp pp)
|
||||||
case 32:
|
case 32:
|
||||||
case 0:
|
case 0:
|
||||||
SpawnVis(actor, nullptr, -1, -1, -1, 8);
|
SpawnVis(actor, nullptr, -1, -1, -1, 8);
|
||||||
SpawnBigGunFlames(actor, pp->Actor(), pp->sop, false);
|
SpawnBigGunFlames(actor, pp->actor, pp->sop, false);
|
||||||
SetGunQuake(actor);
|
SetGunQuake(actor);
|
||||||
InitTankShell(actor, pp);
|
InitTankShell(actor, pp);
|
||||||
if (!SP_TAG5(actor))
|
if (!SP_TAG5(actor))
|
||||||
|
@ -15863,7 +15863,7 @@ int InitSobjGun(PLAYERp pp)
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
SpawnVis(actor, nullptr, -1, -1, -1, 32);
|
SpawnVis(actor, nullptr, -1, -1, -1, 32);
|
||||||
SpawnBigGunFlames(actor, pp->Actor(), pp->sop, true);
|
SpawnBigGunFlames(actor, pp->actor, pp->sop, true);
|
||||||
InitSobjMachineGun(actor, pp);
|
InitSobjMachineGun(actor, pp);
|
||||||
if (!SP_TAG5(actor))
|
if (!SP_TAG5(actor))
|
||||||
pp->FirePause = 10;
|
pp->FirePause = 10;
|
||||||
|
@ -15928,7 +15928,7 @@ DSWActor* SpawnBoatSparks(PLAYERp pp, sectortype* hit_sect, walltype* hit_wall,
|
||||||
actorNew->spr.shade = -40;
|
actorNew->spr.shade = -40;
|
||||||
actorNew->spr.xrepeat = UZI_SMOKE_REPEAT + 12;
|
actorNew->spr.xrepeat = UZI_SMOKE_REPEAT + 12;
|
||||||
actorNew->spr.yrepeat = UZI_SMOKE_REPEAT + 12;
|
actorNew->spr.yrepeat = UZI_SMOKE_REPEAT + 12;
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
SET(actorNew->spr.cstat, CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_YCENTER);
|
SET(actorNew->spr.cstat, CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_YCENTER);
|
||||||
|
|
||||||
actorNew->spr.hitag = LUMINOUS; //Always full brightness
|
actorNew->spr.hitag = LUMINOUS; //Always full brightness
|
||||||
|
@ -15944,7 +15944,7 @@ DSWActor* SpawnBoatSparks(PLAYERp pp, sectortype* hit_sect, walltype* hit_wall,
|
||||||
actorNew->spr.shade = -40;
|
actorNew->spr.shade = -40;
|
||||||
actorNew->spr.xrepeat = UZI_SPARK_REPEAT + 10;
|
actorNew->spr.xrepeat = UZI_SPARK_REPEAT + 10;
|
||||||
actorNew->spr.yrepeat = UZI_SPARK_REPEAT + 10;
|
actorNew->spr.yrepeat = UZI_SPARK_REPEAT + 10;
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->user.spal = actorNew->spr.pal = PALETTE_DEFAULT;
|
actorNew->user.spal = actorNew->spr.pal = PALETTE_DEFAULT;
|
||||||
SET(actorNew->spr.cstat, CSTAT_SPRITE_YCENTER);
|
SET(actorNew->spr.cstat, CSTAT_SPRITE_YCENTER);
|
||||||
|
|
||||||
|
@ -15965,7 +15965,7 @@ int SpawnSwordSparks(PLAYERp pp, sectortype* hit_sect, walltype* hit_wall, int h
|
||||||
auto actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE, s_UziSmoke, hit_sect, hit_x, hit_y, hit_z, hit_ang, 0);
|
auto actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE, s_UziSmoke, hit_sect, hit_x, hit_y, hit_z, hit_ang, 0);
|
||||||
actorNew->spr.shade = -40;
|
actorNew->spr.shade = -40;
|
||||||
actorNew->spr.xrepeat = actorNew->spr.yrepeat = 20;
|
actorNew->spr.xrepeat = actorNew->spr.yrepeat = 20;
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
SET(actorNew->spr.cstat, CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_YCENTER);
|
SET(actorNew->spr.cstat, CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_YCENTER);
|
||||||
actorNew->spr.hitag = LUMINOUS; //Always full brightness
|
actorNew->spr.hitag = LUMINOUS; //Always full brightness
|
||||||
|
|
||||||
|
@ -15980,7 +15980,7 @@ int SpawnSwordSparks(PLAYERp pp, sectortype* hit_sect, walltype* hit_wall, int h
|
||||||
actorNew = SpawnActor(STAT_MISSILE, UZI_SPARK, s_UziSpark, hit_sect, hit_x, hit_y, hit_z, hit_ang, 0);
|
actorNew = SpawnActor(STAT_MISSILE, UZI_SPARK, s_UziSpark, hit_sect, hit_x, hit_y, hit_z, hit_ang, 0);
|
||||||
actorNew->spr.shade = -40;
|
actorNew->spr.shade = -40;
|
||||||
actorNew->spr.xrepeat = actorNew->spr.yrepeat = 20;
|
actorNew->spr.xrepeat = actorNew->spr.yrepeat = 20;
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->user.spal = actorNew->spr.pal = PALETTE_DEFAULT;
|
actorNew->user.spal = actorNew->spr.pal = PALETTE_DEFAULT;
|
||||||
SET(actorNew->spr.cstat, CSTAT_SPRITE_YCENTER);
|
SET(actorNew->spr.cstat, CSTAT_SPRITE_YCENTER);
|
||||||
if (actor->user.WeaponNum == WPN_FIST)
|
if (actor->user.WeaponNum == WPN_FIST)
|
||||||
|
@ -16033,7 +16033,7 @@ DSWActor* SpawnShotgunSparks(PLAYERp pp, sectortype* hit_sect, walltype* hit_wal
|
||||||
actorNew->spr.shade = -40;
|
actorNew->spr.shade = -40;
|
||||||
actorNew->spr.xrepeat = UZI_SPARK_REPEAT;
|
actorNew->spr.xrepeat = UZI_SPARK_REPEAT;
|
||||||
actorNew->spr.yrepeat = UZI_SPARK_REPEAT;
|
actorNew->spr.yrepeat = UZI_SPARK_REPEAT;
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->user.spal = actorNew->spr.pal = PALETTE_DEFAULT;
|
actorNew->user.spal = actorNew->spr.pal = PALETTE_DEFAULT;
|
||||||
SET(actorNew->spr.cstat, CSTAT_SPRITE_YCENTER);
|
SET(actorNew->spr.cstat, CSTAT_SPRITE_YCENTER);
|
||||||
|
|
||||||
|
@ -16044,7 +16044,7 @@ DSWActor* SpawnShotgunSparks(PLAYERp pp, sectortype* hit_sect, walltype* hit_wal
|
||||||
actorNew = SpawnActor(STAT_MISSILE, SHOTGUN_SMOKE, s_ShotgunSmoke, hit_sect, hit_x, hit_y, hit_z, hit_ang, 0);
|
actorNew = SpawnActor(STAT_MISSILE, SHOTGUN_SMOKE, s_ShotgunSmoke, hit_sect, hit_x, hit_y, hit_z, hit_ang, 0);
|
||||||
actorNew->spr.xrepeat = SHOTGUN_SMOKE_REPEAT;
|
actorNew->spr.xrepeat = SHOTGUN_SMOKE_REPEAT;
|
||||||
actorNew->spr.yrepeat = SHOTGUN_SMOKE_REPEAT;
|
actorNew->spr.yrepeat = SHOTGUN_SMOKE_REPEAT;
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
SET(actorNew->spr.cstat, CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_YCENTER);
|
SET(actorNew->spr.cstat, CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_YCENTER);
|
||||||
|
|
||||||
actorNew->spr.hitag = LUMINOUS; //Always full brightness
|
actorNew->spr.hitag = LUMINOUS; //Always full brightness
|
||||||
|
@ -16411,7 +16411,7 @@ int InitGrenade(PLAYERp pp)
|
||||||
NewStateGroup(actorNew, &sg_Grenade[0]);
|
NewStateGroup(actorNew, &sg_Grenade[0]);
|
||||||
SET(actorNew->user.Flags, SPR_XFLIP_TOGGLE);
|
SET(actorNew->user.Flags, SPR_XFLIP_TOGGLE);
|
||||||
|
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->spr.yrepeat = 32;
|
actorNew->spr.yrepeat = 32;
|
||||||
actorNew->spr.xrepeat = 32;
|
actorNew->spr.xrepeat = 32;
|
||||||
actorNew->spr.shade = -15;
|
actorNew->spr.shade = -15;
|
||||||
|
@ -16445,7 +16445,7 @@ int InitGrenade(PLAYERp pp)
|
||||||
actor->spr.clipdist = oclipdist;
|
actor->spr.clipdist = oclipdist;
|
||||||
|
|
||||||
zvel = actorNew->spr.zvel;
|
zvel = actorNew->spr.zvel;
|
||||||
if (WeaponAutoAim(pp->Actor(), actorNew, 32, false) >= 0)
|
if (WeaponAutoAim(pp->actor, actorNew, 32, false) >= 0)
|
||||||
{
|
{
|
||||||
auto_aim = true;
|
auto_aim = true;
|
||||||
}
|
}
|
||||||
|
@ -16546,7 +16546,7 @@ int InitMine(PLAYERp pp)
|
||||||
auto actorNew = SpawnActor(STAT_MISSILE, MINE, s_Mine, pp->cursector,
|
auto actorNew = SpawnActor(STAT_MISSILE, MINE, s_Mine, pp->cursector,
|
||||||
nx, ny, nz, pp->angle.ang.asbuild(), MINE_VELOCITY);
|
nx, ny, nz, pp->angle.ang.asbuild(), MINE_VELOCITY);
|
||||||
|
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
actorNew->spr.yrepeat = 32;
|
actorNew->spr.yrepeat = 32;
|
||||||
actorNew->spr.xrepeat = 32;
|
actorNew->spr.xrepeat = 32;
|
||||||
actorNew->spr.shade = -15;
|
actorNew->spr.shade = -15;
|
||||||
|
@ -16679,7 +16679,7 @@ int InitFireball(PLAYERp pp)
|
||||||
actorNew->spr.yrepeat = 40;
|
actorNew->spr.yrepeat = 40;
|
||||||
actorNew->spr.shade = -40;
|
actorNew->spr.shade = -40;
|
||||||
actorNew->spr.clipdist = 32>>2;
|
actorNew->spr.clipdist = 32>>2;
|
||||||
SetOwner(pp->Actor(), actorNew);
|
SetOwner(pp->actor, actorNew);
|
||||||
SET(actorNew->spr.cstat, CSTAT_SPRITE_YCENTER);
|
SET(actorNew->spr.cstat, CSTAT_SPRITE_YCENTER);
|
||||||
actorNew->user.Radius = 100;
|
actorNew->user.Radius = 100;
|
||||||
|
|
||||||
|
@ -16709,7 +16709,7 @@ int InitFireball(PLAYERp pp)
|
||||||
actor->spr.clipdist = oclipdist;
|
actor->spr.clipdist = oclipdist;
|
||||||
|
|
||||||
actorNew->spr.zvel = zvel >> 1;
|
actorNew->spr.zvel = zvel >> 1;
|
||||||
if (WeaponAutoAimZvel(pp->Actor(), actorNew, &zvel, 32, false) == -1)
|
if (WeaponAutoAimZvel(pp->actor, actorNew, &zvel, 32, false) == -1)
|
||||||
{
|
{
|
||||||
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang - 9);
|
actorNew->spr.ang = NORM_ANGLE(actorNew->spr.ang - 9);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue