mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-13 04:24:39 +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)
|
||||
{
|
||||
ANIMATOR DoActorDecide;
|
||||
|
@ -1929,6 +1935,12 @@ int SetupNinja(DSWActor* actor)
|
|||
return 0;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
int DoNinjaHariKari(DSWActor* actor)
|
||||
{
|
||||
UpdateSinglePlayKills(actor);
|
||||
|
@ -1954,6 +1966,12 @@ int DoNinjaHariKari(DSWActor* actor)
|
|||
return 0;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
int DoNinjaGrabThroat(DSWActor* actor)
|
||||
{
|
||||
if ((actor->user.WaitTics -= ACTORMOVETICS) <= 0)
|
||||
|
@ -1987,6 +2005,12 @@ int DoNinjaGrabThroat(DSWActor* actor)
|
|||
|
||||
*/
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
int DoNinjaMove(DSWActor* actor)
|
||||
{
|
||||
if (actor->user.Flags2 & (SPR2_DYING))
|
||||
|
@ -2031,6 +2055,12 @@ int DoNinjaMove(DSWActor* actor)
|
|||
return 0;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
int NinjaJumpActionFunc(DSWActor* actor)
|
||||
{
|
||||
// if cannot move the sprite
|
||||
|
@ -2069,6 +2099,11 @@ int NullNinja(DSWActor* actor)
|
|||
return 0;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
int DoNinjaPain(DSWActor* actor)
|
||||
{
|
||||
|
@ -2089,6 +2124,12 @@ int DoNinjaPain(DSWActor* actor)
|
|||
return 0;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
int DoNinjaSpecial(DSWActor* actor)
|
||||
{
|
||||
if (actor->user.spal == PALETTE_PLAYER5)
|
||||
|
@ -2101,6 +2142,12 @@ int DoNinjaSpecial(DSWActor* actor)
|
|||
return 0;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
int CheckFire(DSWActor* actor)
|
||||
{
|
||||
if (!CanSeePlayer(actor))
|
||||
|
@ -2131,6 +2178,12 @@ void InitAllPlayerSprites(void)
|
|||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void PlayerLevelReset(PLAYER* pp)
|
||||
{
|
||||
DSWActor* actor = pp->actor;
|
||||
|
@ -2170,6 +2223,12 @@ void PlayerLevelReset(PLAYER* pp)
|
|||
DamageData[actor->user.WeaponNum].Init(pp);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void PlayerDeathReset(PLAYER* pp)
|
||||
{
|
||||
DSWActor* actor = pp->actor;
|
||||
|
@ -2234,6 +2293,12 @@ void PlayerDeathReset(PLAYER* pp)
|
|||
DamageData[actor->user.WeaponNum].Init(pp);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void PlayerPanelSetup(void)
|
||||
{
|
||||
short pnum;
|
||||
|
@ -2250,6 +2315,12 @@ void PlayerPanelSetup(void)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void PlayerGameReset(PLAYER* pp)
|
||||
{
|
||||
DSWActor* actor = pp->actor;
|
||||
|
@ -2309,6 +2380,12 @@ void PlayerGameReset(PLAYER* pp)
|
|||
|
||||
extern ACTOR_ACTION_SET PlayerNinjaActionSet;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void InitPlayerSprite(PLAYER* pp)
|
||||
{
|
||||
int pnum = int(pp - Player);
|
||||
|
@ -2377,6 +2454,12 @@ void InitPlayerSprite(PLAYER* pp)
|
|||
pp->DeathType = 0;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void SpawnPlayerUnderSprite(PLAYER* pp)
|
||||
{
|
||||
DSWActor* plActor = pp->actor;
|
||||
|
@ -2408,6 +2491,13 @@ void SpawnPlayerUnderSprite(PLAYER* pp)
|
|||
actor->spr.yrepeat = plActor->spr.yrepeat;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
#include "saveable.h"
|
||||
|
||||
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]
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DoPlayerSpriteThrow(PLAYER* pp)
|
||||
{
|
||||
|
@ -1064,6 +1068,12 @@ void DoPlayerSpriteThrow(PLAYER* pp)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
int DoPlayerSpriteReset(DSWActor* actor)
|
||||
{
|
||||
PLAYER* pp;
|
||||
|
@ -1087,6 +1097,12 @@ int DoPlayerSpriteReset(DSWActor* actor)
|
|||
return 0;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
int SetVisHigh(void)
|
||||
{
|
||||
// g_visibility = NormalVisibility>>1;
|
||||
|
@ -1104,6 +1120,12 @@ void pSetVisNorm(PANEL_SPRITE* psp)
|
|||
// SetVisNorm();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
TARGET_SORT TargetSort[MAX_TARGET_SORT];
|
||||
unsigned TargetSortCount;
|
||||
|
||||
|
@ -1120,6 +1142,12 @@ bool
|
|||
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);
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
DSWActor* DoPickTarget(DSWActor* actor, DAngle max_delta_ang, int skip_targets)
|
||||
{
|
||||
const int PICK_DIST = 2500;
|
||||
|
@ -1238,6 +1266,12 @@ DSWActor* DoPickTarget(DSWActor* actor, DAngle max_delta_ang, int skip_targets)
|
|||
return TargetSort[0].actor;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DoPlayerResetMovement(PLAYER* pp)
|
||||
{
|
||||
pp->vect.Zero();
|
||||
|
@ -1247,6 +1281,12 @@ void DoPlayerResetMovement(PLAYER* pp)
|
|||
pp->Flags &= ~(PF_PLAYER_MOVED);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DoPlayerTeleportPause(PLAYER* pp)
|
||||
{
|
||||
DSWActor* actor = pp->actor;
|
||||
|
@ -1264,6 +1304,12 @@ void DoPlayerTeleportPause(PLAYER* pp)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DoPlayerTeleportToSprite(PLAYER* pp, DVector3& pos, DAngle ang)
|
||||
{
|
||||
pp->angle.ang = pp->angle.oang = ang;
|
||||
|
@ -1274,6 +1320,12 @@ void DoPlayerTeleportToSprite(PLAYER* pp, DVector3& pos, DAngle ang)
|
|||
pp->Flags2 |= (PF2_TELEPORTED);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DoPlayerTeleportToOffset(PLAYER* pp)
|
||||
{
|
||||
pp->oldpos.XY() = pp->opos.XY() = pp->pos.XY();
|
||||
|
@ -1282,6 +1334,12 @@ void DoPlayerTeleportToOffset(PLAYER* pp)
|
|||
pp->Flags2 |= (PF2_TELEPORTED);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DoSpawnTeleporterEffect(DSWActor* actor)
|
||||
{
|
||||
extern STATE s_TeleportEffect[];
|
||||
|
@ -1300,6 +1358,12 @@ void DoSpawnTeleporterEffect(DSWActor* actor)
|
|||
effectActor->spr.cstat |= (CSTAT_SPRITE_ALIGNMENT_WALL);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DoSpawnTeleporterEffectPlace(DSWActor* actor)
|
||||
{
|
||||
extern STATE s_TeleportEffect[];
|
||||
|
@ -1316,6 +1380,12 @@ void DoSpawnTeleporterEffectPlace(DSWActor* actor)
|
|||
effectActor->spr.cstat |= (CSTAT_SPRITE_ALIGNMENT_WALL);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DoPlayerWarpTeleporter(PLAYER* pp)
|
||||
{
|
||||
auto ppActor = pp->actor;
|
||||
|
@ -1382,6 +1452,12 @@ void DoPlayerWarpTeleporter(PLAYER* pp)
|
|||
ppActor->backuppos();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DoPlayerSetWadeDepth(PLAYER* pp)
|
||||
{
|
||||
sectortype* sectp;
|
||||
|
@ -1402,6 +1478,12 @@ void DoPlayerSetWadeDepth(PLAYER* pp)
|
|||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DoPlayerHeight(PLAYER* pp)
|
||||
{
|
||||
double diff = pp->pos.Z - (pp->loz - PLAYER_HEIGHTF);
|
||||
|
@ -1426,6 +1508,12 @@ void DoPlayerCrawlHeight(PLAYER* pp)
|
|||
pp->pos.Z -= diff * 0.375;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void UpdatePlayerSpriteAngle(PLAYER* pp)
|
||||
{
|
||||
DSWActor* plActor = pp->actor;
|
||||
|
@ -1441,12 +1529,24 @@ void UpdatePlayerSpriteAngle(PLAYER* pp)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DoPlayerTurn(PLAYER* pp, float const avel, double const scaleAdjust)
|
||||
{
|
||||
pp->angle.applyinput(avel, &pp->input.actions, scaleAdjust);
|
||||
UpdatePlayerSpriteAngle(pp);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DoPlayerTurnVehicle(PLAYER* pp, float avel, double zz, double floordist)
|
||||
{
|
||||
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)
|
||||
{
|
||||
float avel;
|
||||
|
@ -1502,6 +1608,12 @@ void DoPlayerTurnVehicleRect(PLAYER* pp, DVector2* pos, DVector2* opos)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DoPlayerTurnTurret(PLAYER* pp, float avel)
|
||||
{
|
||||
DAngle new_ang, diff;
|
||||
|
@ -1543,6 +1655,12 @@ void DoPlayerTurnTurret(PLAYER* pp, float avel)
|
|||
OperateSectorObject(pp->sop, pp->angle.ang, pp->sop->pmid);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void SlipSlope(PLAYER* pp)
|
||||
{
|
||||
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
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
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);
|
||||
|
@ -1565,6 +1689,12 @@ void DoPlayerHorizon(PLAYER* pp, float const horz, double const scaleAdjust)
|
|||
pp->horizon.applyinput(horz, &pp->input.actions, scaleAdjust);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DoPlayerBob(PLAYER* pp)
|
||||
{
|
||||
int dist;
|
||||
|
@ -1602,6 +1732,12 @@ void DoPlayerBob(PLAYER* pp)
|
|||
pp->bob_z = amt * BobVal(pp->bcnt);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DoPlayerBeginRecoil(PLAYER* pp, short pix_amt)
|
||||
{
|
||||
pp->Flags |= (PF_RECOIL);
|
||||
|
@ -1629,9 +1765,12 @@ void DoPlayerRecoil(PLAYER* pp)
|
|||
pp->recoil_horizoff = pp->recoil_amt * bsin(pp->recoil_ndx, 2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// for wading
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DoPlayerSpriteBob(PLAYER* pp, double player_height, double bobamt, short bob_speed)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void UpdatePlayerUnderSprite(PLAYER* pp)
|
||||
{
|
||||
DSWActor* act_over = pp->actor;
|
||||
|
@ -1699,6 +1844,11 @@ void UpdatePlayerUnderSprite(PLAYER* pp)
|
|||
act_under->spr.picnum = act_over->spr.picnum;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void UpdatePlayerSprite(PLAYER* pp)
|
||||
{
|
||||
|
@ -1777,6 +1927,12 @@ void UpdatePlayerSprite(PLAYER* pp)
|
|||
actor->set_int_ang(pp->angle.ang.Buildang());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DoPlayerZrange(PLAYER* pp)
|
||||
{
|
||||
Collision ceilhit, florhit;
|
||||
|
@ -1832,6 +1988,12 @@ void DoPlayerZrange(PLAYER* pp)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DoPlayerSlide(PLAYER* pp)
|
||||
{
|
||||
DSWActor* actor = pp->actor;
|
||||
|
@ -1881,6 +2043,12 @@ void DoPlayerSlide(PLAYER* pp)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void PlayerCheckValidMove(PLAYER* pp)
|
||||
{
|
||||
if (!pp->insector())
|
||||
|
@ -1890,6 +2058,12 @@ void PlayerCheckValidMove(PLAYER* pp)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void PlayerSectorBound(PLAYER* pp, double amt)
|
||||
{
|
||||
if (!pp->insector())
|
||||
|
@ -1916,6 +2090,12 @@ void PlayerSectorBound(PLAYER* pp, double amt)
|
|||
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DoPlayerMove(PLAYER* pp)
|
||||
{
|
||||
DSWActor* actor = pp->actor;
|
||||
|
@ -2085,6 +2265,12 @@ void DoPlayerMove(PLAYER* pp)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DoPlayerSectorUpdatePreMove(PLAYER* pp)
|
||||
{
|
||||
auto sect = pp->cursector;
|
||||
|
|
Loading…
Reference in a new issue