mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-13 12:32:13 +00:00
- some function separators in player.cpp, panel.cpp and ninja.cpp
This commit is contained in:
parent
22bd451872
commit
2840303e35
3 changed files with 1373 additions and 8 deletions
|
@ -1815,6 +1815,12 @@ ACTOR_ACTION_SET PlayerNinjaActionSet =
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
int SetupNinja(DSWActor* actor)
|
int SetupNinja(DSWActor* actor)
|
||||||
{
|
{
|
||||||
ANIMATOR DoActorDecide;
|
ANIMATOR DoActorDecide;
|
||||||
|
@ -1929,6 +1935,12 @@ int SetupNinja(DSWActor* actor)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
int DoNinjaHariKari(DSWActor* actor)
|
int DoNinjaHariKari(DSWActor* actor)
|
||||||
{
|
{
|
||||||
UpdateSinglePlayKills(actor);
|
UpdateSinglePlayKills(actor);
|
||||||
|
@ -1954,6 +1966,12 @@ int DoNinjaHariKari(DSWActor* actor)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
int DoNinjaGrabThroat(DSWActor* actor)
|
int DoNinjaGrabThroat(DSWActor* actor)
|
||||||
{
|
{
|
||||||
if ((actor->user.WaitTics -= ACTORMOVETICS) <= 0)
|
if ((actor->user.WaitTics -= ACTORMOVETICS) <= 0)
|
||||||
|
@ -1987,6 +2005,12 @@ int DoNinjaGrabThroat(DSWActor* actor)
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
int DoNinjaMove(DSWActor* actor)
|
int DoNinjaMove(DSWActor* actor)
|
||||||
{
|
{
|
||||||
if (actor->user.Flags2 & (SPR2_DYING))
|
if (actor->user.Flags2 & (SPR2_DYING))
|
||||||
|
@ -2031,6 +2055,12 @@ int DoNinjaMove(DSWActor* actor)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
int NinjaJumpActionFunc(DSWActor* actor)
|
int NinjaJumpActionFunc(DSWActor* actor)
|
||||||
{
|
{
|
||||||
// if cannot move the sprite
|
// if cannot move the sprite
|
||||||
|
@ -2069,6 +2099,11 @@ int NullNinja(DSWActor* actor)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
int DoNinjaPain(DSWActor* actor)
|
int DoNinjaPain(DSWActor* actor)
|
||||||
{
|
{
|
||||||
|
@ -2089,6 +2124,12 @@ int DoNinjaPain(DSWActor* actor)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
int DoNinjaSpecial(DSWActor* actor)
|
int DoNinjaSpecial(DSWActor* actor)
|
||||||
{
|
{
|
||||||
if (actor->user.spal == PALETTE_PLAYER5)
|
if (actor->user.spal == PALETTE_PLAYER5)
|
||||||
|
@ -2101,6 +2142,12 @@ int DoNinjaSpecial(DSWActor* actor)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
int CheckFire(DSWActor* actor)
|
int CheckFire(DSWActor* actor)
|
||||||
{
|
{
|
||||||
if (!CanSeePlayer(actor))
|
if (!CanSeePlayer(actor))
|
||||||
|
@ -2131,6 +2178,12 @@ void InitAllPlayerSprites(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void PlayerLevelReset(PLAYER* pp)
|
void PlayerLevelReset(PLAYER* pp)
|
||||||
{
|
{
|
||||||
DSWActor* actor = pp->actor;
|
DSWActor* actor = pp->actor;
|
||||||
|
@ -2170,6 +2223,12 @@ void PlayerLevelReset(PLAYER* pp)
|
||||||
DamageData[actor->user.WeaponNum].Init(pp);
|
DamageData[actor->user.WeaponNum].Init(pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void PlayerDeathReset(PLAYER* pp)
|
void PlayerDeathReset(PLAYER* pp)
|
||||||
{
|
{
|
||||||
DSWActor* actor = pp->actor;
|
DSWActor* actor = pp->actor;
|
||||||
|
@ -2234,6 +2293,12 @@ void PlayerDeathReset(PLAYER* pp)
|
||||||
DamageData[actor->user.WeaponNum].Init(pp);
|
DamageData[actor->user.WeaponNum].Init(pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void PlayerPanelSetup(void)
|
void PlayerPanelSetup(void)
|
||||||
{
|
{
|
||||||
short pnum;
|
short pnum;
|
||||||
|
@ -2250,6 +2315,12 @@ void PlayerPanelSetup(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void PlayerGameReset(PLAYER* pp)
|
void PlayerGameReset(PLAYER* pp)
|
||||||
{
|
{
|
||||||
DSWActor* actor = pp->actor;
|
DSWActor* actor = pp->actor;
|
||||||
|
@ -2309,6 +2380,12 @@ void PlayerGameReset(PLAYER* pp)
|
||||||
|
|
||||||
extern ACTOR_ACTION_SET PlayerNinjaActionSet;
|
extern ACTOR_ACTION_SET PlayerNinjaActionSet;
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void InitPlayerSprite(PLAYER* pp)
|
void InitPlayerSprite(PLAYER* pp)
|
||||||
{
|
{
|
||||||
int pnum = int(pp - Player);
|
int pnum = int(pp - Player);
|
||||||
|
@ -2377,6 +2454,12 @@ void InitPlayerSprite(PLAYER* pp)
|
||||||
pp->DeathType = 0;
|
pp->DeathType = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void SpawnPlayerUnderSprite(PLAYER* pp)
|
void SpawnPlayerUnderSprite(PLAYER* pp)
|
||||||
{
|
{
|
||||||
DSWActor* plActor = pp->actor;
|
DSWActor* plActor = pp->actor;
|
||||||
|
@ -2408,6 +2491,13 @@ void SpawnPlayerUnderSprite(PLAYER* pp)
|
||||||
actor->spr.yrepeat = plActor->spr.yrepeat;
|
actor->spr.yrepeat = plActor->spr.yrepeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
#include "saveable.h"
|
#include "saveable.h"
|
||||||
|
|
||||||
static saveable_code saveable_ninja_code[] =
|
static saveable_code saveable_ninja_code[] =
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1048,7 +1048,11 @@ STATE* sg_PlayerNinjaFly[] =
|
||||||
s_PlayerNinjaFly[4]
|
s_PlayerNinjaFly[4]
|
||||||
};
|
};
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DoPlayerSpriteThrow(PLAYER* pp)
|
void DoPlayerSpriteThrow(PLAYER* pp)
|
||||||
{
|
{
|
||||||
|
@ -1064,6 +1068,12 @@ void DoPlayerSpriteThrow(PLAYER* pp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
int DoPlayerSpriteReset(DSWActor* actor)
|
int DoPlayerSpriteReset(DSWActor* actor)
|
||||||
{
|
{
|
||||||
PLAYER* pp;
|
PLAYER* pp;
|
||||||
|
@ -1087,6 +1097,12 @@ int DoPlayerSpriteReset(DSWActor* actor)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
int SetVisHigh(void)
|
int SetVisHigh(void)
|
||||||
{
|
{
|
||||||
// g_visibility = NormalVisibility>>1;
|
// g_visibility = NormalVisibility>>1;
|
||||||
|
@ -1104,6 +1120,12 @@ void pSetVisNorm(PANEL_SPRITE* psp)
|
||||||
// SetVisNorm();
|
// SetVisNorm();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
TARGET_SORT TargetSort[MAX_TARGET_SORT];
|
TARGET_SORT TargetSort[MAX_TARGET_SORT];
|
||||||
unsigned TargetSortCount;
|
unsigned TargetSortCount;
|
||||||
|
|
||||||
|
@ -1120,6 +1142,12 @@ bool
|
||||||
FAFcansee(int32_t xs, int32_t ys, int32_t zs, int16_t sects,
|
FAFcansee(int32_t xs, int32_t ys, int32_t zs, int16_t sects,
|
||||||
int32_t xe, int32_t ye, int32_t ze, int16_t secte);
|
int32_t xe, int32_t ye, int32_t ze, int16_t secte);
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
DSWActor* DoPickTarget(DSWActor* actor, DAngle max_delta_ang, int skip_targets)
|
DSWActor* DoPickTarget(DSWActor* actor, DAngle max_delta_ang, int skip_targets)
|
||||||
{
|
{
|
||||||
const int PICK_DIST = 2500;
|
const int PICK_DIST = 2500;
|
||||||
|
@ -1238,6 +1266,12 @@ DSWActor* DoPickTarget(DSWActor* actor, DAngle max_delta_ang, int skip_targets)
|
||||||
return TargetSort[0].actor;
|
return TargetSort[0].actor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DoPlayerResetMovement(PLAYER* pp)
|
void DoPlayerResetMovement(PLAYER* pp)
|
||||||
{
|
{
|
||||||
pp->vect.Zero();
|
pp->vect.Zero();
|
||||||
|
@ -1247,6 +1281,12 @@ void DoPlayerResetMovement(PLAYER* pp)
|
||||||
pp->Flags &= ~(PF_PLAYER_MOVED);
|
pp->Flags &= ~(PF_PLAYER_MOVED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DoPlayerTeleportPause(PLAYER* pp)
|
void DoPlayerTeleportPause(PLAYER* pp)
|
||||||
{
|
{
|
||||||
DSWActor* actor = pp->actor;
|
DSWActor* actor = pp->actor;
|
||||||
|
@ -1264,6 +1304,12 @@ void DoPlayerTeleportPause(PLAYER* pp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DoPlayerTeleportToSprite(PLAYER* pp, DVector3& pos, DAngle ang)
|
void DoPlayerTeleportToSprite(PLAYER* pp, DVector3& pos, DAngle ang)
|
||||||
{
|
{
|
||||||
pp->angle.ang = pp->angle.oang = ang;
|
pp->angle.ang = pp->angle.oang = ang;
|
||||||
|
@ -1274,6 +1320,12 @@ void DoPlayerTeleportToSprite(PLAYER* pp, DVector3& pos, DAngle ang)
|
||||||
pp->Flags2 |= (PF2_TELEPORTED);
|
pp->Flags2 |= (PF2_TELEPORTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DoPlayerTeleportToOffset(PLAYER* pp)
|
void DoPlayerTeleportToOffset(PLAYER* pp)
|
||||||
{
|
{
|
||||||
pp->oldpos.XY() = pp->opos.XY() = pp->pos.XY();
|
pp->oldpos.XY() = pp->opos.XY() = pp->pos.XY();
|
||||||
|
@ -1282,6 +1334,12 @@ void DoPlayerTeleportToOffset(PLAYER* pp)
|
||||||
pp->Flags2 |= (PF2_TELEPORTED);
|
pp->Flags2 |= (PF2_TELEPORTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DoSpawnTeleporterEffect(DSWActor* actor)
|
void DoSpawnTeleporterEffect(DSWActor* actor)
|
||||||
{
|
{
|
||||||
extern STATE s_TeleportEffect[];
|
extern STATE s_TeleportEffect[];
|
||||||
|
@ -1300,6 +1358,12 @@ void DoSpawnTeleporterEffect(DSWActor* actor)
|
||||||
effectActor->spr.cstat |= (CSTAT_SPRITE_ALIGNMENT_WALL);
|
effectActor->spr.cstat |= (CSTAT_SPRITE_ALIGNMENT_WALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DoSpawnTeleporterEffectPlace(DSWActor* actor)
|
void DoSpawnTeleporterEffectPlace(DSWActor* actor)
|
||||||
{
|
{
|
||||||
extern STATE s_TeleportEffect[];
|
extern STATE s_TeleportEffect[];
|
||||||
|
@ -1316,6 +1380,12 @@ void DoSpawnTeleporterEffectPlace(DSWActor* actor)
|
||||||
effectActor->spr.cstat |= (CSTAT_SPRITE_ALIGNMENT_WALL);
|
effectActor->spr.cstat |= (CSTAT_SPRITE_ALIGNMENT_WALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DoPlayerWarpTeleporter(PLAYER* pp)
|
void DoPlayerWarpTeleporter(PLAYER* pp)
|
||||||
{
|
{
|
||||||
auto ppActor = pp->actor;
|
auto ppActor = pp->actor;
|
||||||
|
@ -1382,6 +1452,12 @@ void DoPlayerWarpTeleporter(PLAYER* pp)
|
||||||
ppActor->backuppos();
|
ppActor->backuppos();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DoPlayerSetWadeDepth(PLAYER* pp)
|
void DoPlayerSetWadeDepth(PLAYER* pp)
|
||||||
{
|
{
|
||||||
sectortype* sectp;
|
sectortype* sectp;
|
||||||
|
@ -1402,6 +1478,12 @@ void DoPlayerSetWadeDepth(PLAYER* pp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DoPlayerHeight(PLAYER* pp)
|
void DoPlayerHeight(PLAYER* pp)
|
||||||
{
|
{
|
||||||
double diff = pp->pos.Z - (pp->loz - PLAYER_HEIGHTF);
|
double diff = pp->pos.Z - (pp->loz - PLAYER_HEIGHTF);
|
||||||
|
@ -1426,6 +1508,12 @@ void DoPlayerCrawlHeight(PLAYER* pp)
|
||||||
pp->pos.Z -= diff * 0.375;
|
pp->pos.Z -= diff * 0.375;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void UpdatePlayerSpriteAngle(PLAYER* pp)
|
void UpdatePlayerSpriteAngle(PLAYER* pp)
|
||||||
{
|
{
|
||||||
DSWActor* plActor = pp->actor;
|
DSWActor* plActor = pp->actor;
|
||||||
|
@ -1441,12 +1529,24 @@ void UpdatePlayerSpriteAngle(PLAYER* pp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DoPlayerTurn(PLAYER* pp, float const avel, double const scaleAdjust)
|
void DoPlayerTurn(PLAYER* pp, float const avel, double const scaleAdjust)
|
||||||
{
|
{
|
||||||
pp->angle.applyinput(avel, &pp->input.actions, scaleAdjust);
|
pp->angle.applyinput(avel, &pp->input.actions, scaleAdjust);
|
||||||
UpdatePlayerSpriteAngle(pp);
|
UpdatePlayerSpriteAngle(pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DoPlayerTurnVehicle(PLAYER* pp, float avel, double zz, double floordist)
|
void DoPlayerTurnVehicle(PLAYER* pp, float avel, double zz, double floordist)
|
||||||
{
|
{
|
||||||
SECTOR_OBJECT* sop = pp->sop;
|
SECTOR_OBJECT* sop = pp->sop;
|
||||||
|
@ -1474,6 +1574,12 @@ void DoPlayerTurnVehicle(PLAYER* pp, float avel, double zz, double floordist)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DoPlayerTurnVehicleRect(PLAYER* pp, DVector2* pos, DVector2* opos)
|
void DoPlayerTurnVehicleRect(PLAYER* pp, DVector2* pos, DVector2* opos)
|
||||||
{
|
{
|
||||||
float avel;
|
float avel;
|
||||||
|
@ -1502,6 +1608,12 @@ void DoPlayerTurnVehicleRect(PLAYER* pp, DVector2* pos, DVector2* opos)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DoPlayerTurnTurret(PLAYER* pp, float avel)
|
void DoPlayerTurnTurret(PLAYER* pp, float avel)
|
||||||
{
|
{
|
||||||
DAngle new_ang, diff;
|
DAngle new_ang, diff;
|
||||||
|
@ -1543,6 +1655,12 @@ void DoPlayerTurnTurret(PLAYER* pp, float avel)
|
||||||
OperateSectorObject(pp->sop, pp->angle.ang, pp->sop->pmid);
|
OperateSectorObject(pp->sop, pp->angle.ang, pp->sop->pmid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void SlipSlope(PLAYER* pp)
|
void SlipSlope(PLAYER* pp)
|
||||||
{
|
{
|
||||||
if (!pp->insector() || !pp->cursector->hasU())
|
if (!pp->insector() || !pp->cursector->hasU())
|
||||||
|
@ -1558,6 +1676,12 @@ void SlipSlope(PLAYER* pp)
|
||||||
pp->vect += ang.ToVector() * pp->cursector->floorheinum / (1 << (sectu->speed + 4)); // todo confirm scale
|
pp->vect += ang.ToVector() * pp->cursector->floorheinum / (1 << (sectu->speed + 4)); // todo confirm scale
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DoPlayerHorizon(PLAYER* pp, float const horz, double const scaleAdjust)
|
void DoPlayerHorizon(PLAYER* pp, float const horz, double const scaleAdjust)
|
||||||
{
|
{
|
||||||
bool const canslopetilt = !(pp->Flags & (PF_FLYING|PF_SWIMMING|PF_DIVING|PF_CLIMBING|PF_JUMPING|PF_FALLING)) && pp->cursector && (pp->cursector->floorstat & CSTAT_SECTOR_SLOPE);
|
bool const canslopetilt = !(pp->Flags & (PF_FLYING|PF_SWIMMING|PF_DIVING|PF_CLIMBING|PF_JUMPING|PF_FALLING)) && pp->cursector && (pp->cursector->floorstat & CSTAT_SECTOR_SLOPE);
|
||||||
|
@ -1565,6 +1689,12 @@ void DoPlayerHorizon(PLAYER* pp, float const horz, double const scaleAdjust)
|
||||||
pp->horizon.applyinput(horz, &pp->input.actions, scaleAdjust);
|
pp->horizon.applyinput(horz, &pp->input.actions, scaleAdjust);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DoPlayerBob(PLAYER* pp)
|
void DoPlayerBob(PLAYER* pp)
|
||||||
{
|
{
|
||||||
int dist;
|
int dist;
|
||||||
|
@ -1602,6 +1732,12 @@ void DoPlayerBob(PLAYER* pp)
|
||||||
pp->bob_z = amt * BobVal(pp->bcnt);
|
pp->bob_z = amt * BobVal(pp->bcnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DoPlayerBeginRecoil(PLAYER* pp, short pix_amt)
|
void DoPlayerBeginRecoil(PLAYER* pp, short pix_amt)
|
||||||
{
|
{
|
||||||
pp->Flags |= (PF_RECOIL);
|
pp->Flags |= (PF_RECOIL);
|
||||||
|
@ -1629,9 +1765,12 @@ void DoPlayerRecoil(PLAYER* pp)
|
||||||
pp->recoil_horizoff = pp->recoil_amt * bsin(pp->recoil_ndx, 2);
|
pp->recoil_horizoff = pp->recoil_amt * bsin(pp->recoil_ndx, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
// for wading
|
// for wading
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DoPlayerSpriteBob(PLAYER* pp, double player_height, double bobamt, short bob_speed)
|
void DoPlayerSpriteBob(PLAYER* pp, double player_height, double bobamt, short bob_speed)
|
||||||
{
|
{
|
||||||
pp->bob_ndx = (pp->bob_ndx + (synctics << bob_speed)) & 2047;
|
pp->bob_ndx = (pp->bob_ndx + (synctics << bob_speed)) & 2047;
|
||||||
|
@ -1639,6 +1778,12 @@ void DoPlayerSpriteBob(PLAYER* pp, double player_height, double bobamt, short bo
|
||||||
pp->actor->spr.pos.Z = pp->pos.Z + player_height + pp->pbob_amt;
|
pp->actor->spr.pos.Z = pp->pos.Z + player_height + pp->pbob_amt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void UpdatePlayerUnderSprite(PLAYER* pp)
|
void UpdatePlayerUnderSprite(PLAYER* pp)
|
||||||
{
|
{
|
||||||
DSWActor* act_over = pp->actor;
|
DSWActor* act_over = pp->actor;
|
||||||
|
@ -1699,6 +1844,11 @@ void UpdatePlayerUnderSprite(PLAYER* pp)
|
||||||
act_under->spr.picnum = act_over->spr.picnum;
|
act_under->spr.picnum = act_over->spr.picnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void UpdatePlayerSprite(PLAYER* pp)
|
void UpdatePlayerSprite(PLAYER* pp)
|
||||||
{
|
{
|
||||||
|
@ -1777,6 +1927,12 @@ void UpdatePlayerSprite(PLAYER* pp)
|
||||||
actor->set_int_ang(pp->angle.ang.Buildang());
|
actor->set_int_ang(pp->angle.ang.Buildang());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DoPlayerZrange(PLAYER* pp)
|
void DoPlayerZrange(PLAYER* pp)
|
||||||
{
|
{
|
||||||
Collision ceilhit, florhit;
|
Collision ceilhit, florhit;
|
||||||
|
@ -1832,6 +1988,12 @@ void DoPlayerZrange(PLAYER* pp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DoPlayerSlide(PLAYER* pp)
|
void DoPlayerSlide(PLAYER* pp)
|
||||||
{
|
{
|
||||||
DSWActor* actor = pp->actor;
|
DSWActor* actor = pp->actor;
|
||||||
|
@ -1881,6 +2043,12 @@ void DoPlayerSlide(PLAYER* pp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void PlayerCheckValidMove(PLAYER* pp)
|
void PlayerCheckValidMove(PLAYER* pp)
|
||||||
{
|
{
|
||||||
if (!pp->insector())
|
if (!pp->insector())
|
||||||
|
@ -1890,6 +2058,12 @@ void PlayerCheckValidMove(PLAYER* pp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void PlayerSectorBound(PLAYER* pp, double amt)
|
void PlayerSectorBound(PLAYER* pp, double amt)
|
||||||
{
|
{
|
||||||
if (!pp->insector())
|
if (!pp->insector())
|
||||||
|
@ -1916,6 +2090,12 @@ void PlayerSectorBound(PLAYER* pp, double amt)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DoPlayerMove(PLAYER* pp)
|
void DoPlayerMove(PLAYER* pp)
|
||||||
{
|
{
|
||||||
DSWActor* actor = pp->actor;
|
DSWActor* actor = pp->actor;
|
||||||
|
@ -2085,6 +2265,12 @@ void DoPlayerMove(PLAYER* pp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DoPlayerSectorUpdatePreMove(PLAYER* pp)
|
void DoPlayerSectorUpdatePreMove(PLAYER* pp)
|
||||||
{
|
{
|
||||||
auto sect = pp->cursector;
|
auto sect = pp->cursector;
|
||||||
|
|
Loading…
Reference in a new issue