2016-03-01 15:47:10 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//
|
2017-04-17 11:33:19 +00:00
|
|
|
// Copyright 1993-1996 id Software
|
|
|
|
// Copyright 1994-1996 Raven Software
|
|
|
|
// Copyright 1998-1998 Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
|
|
|
|
// Copyright 1999-2016 Randy Heit
|
|
|
|
// Copyright 2002-2016 Christoph Oelckers
|
2016-03-01 15:47:10 +00:00
|
|
|
//
|
2017-04-17 11:33:19 +00:00
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
2016-03-01 15:47:10 +00:00
|
|
|
//
|
2017-04-17 11:33:19 +00:00
|
|
|
// This program is distributed in the hope that it will be useful,
|
2016-03-01 15:47:10 +00:00
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2017-04-17 11:33:19 +00:00
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
2016-03-01 15:47:10 +00:00
|
|
|
//
|
2017-04-17 11:33:19 +00:00
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program. If not, see http://www.gnu.org/licenses/
|
2016-03-01 15:47:10 +00:00
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------
|
2017-04-17 11:33:19 +00:00
|
|
|
//
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifndef __D_PLAYER_H__
|
|
|
|
#define __D_PLAYER_H__
|
|
|
|
|
|
|
|
// Finally, for odd reasons, the player input
|
|
|
|
// is buffered within the player data struct,
|
|
|
|
// as commands per game tick.
|
2017-03-09 22:30:42 +00:00
|
|
|
#include "d_protocol.h"
|
2016-03-01 15:47:10 +00:00
|
|
|
#include "doomstat.h"
|
|
|
|
|
2016-11-30 11:24:50 +00:00
|
|
|
#include "a_weapons.h"
|
2016-03-01 15:47:10 +00:00
|
|
|
|
2018-10-30 20:41:04 +00:00
|
|
|
#include "d_netinf.h"
|
|
|
|
|
2016-03-01 15:47:10 +00:00
|
|
|
// The player data structure depends on a number
|
|
|
|
// of other structs: items (internal inventory),
|
|
|
|
// animation states (closely tied to the sprites
|
|
|
|
// used to represent them, unfortunately).
|
|
|
|
#include "p_pspr.h"
|
|
|
|
|
|
|
|
// In addition, the player is just a special
|
|
|
|
// case of the generic moving object/actor.
|
|
|
|
#include "actor.h"
|
|
|
|
|
|
|
|
//Added by MC:
|
|
|
|
#include "b_bot.h"
|
|
|
|
|
|
|
|
class player_t;
|
|
|
|
|
|
|
|
// Standard pre-defined skin colors
|
|
|
|
struct FPlayerColorSet
|
|
|
|
{
|
|
|
|
struct ExtraRange
|
|
|
|
{
|
2017-03-08 17:47:52 +00:00
|
|
|
uint8_t RangeStart, RangeEnd; // colors to remap
|
|
|
|
uint8_t FirstColor, LastColor; // colors to map to
|
2016-03-01 15:47:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
FName Name; // Name of this color
|
|
|
|
|
|
|
|
int Lump; // Lump to read the translation from, otherwise use next 2 fields
|
2017-03-08 17:47:52 +00:00
|
|
|
uint8_t FirstColor, LastColor; // Describes the range of colors to use for the translation
|
2016-03-01 15:47:10 +00:00
|
|
|
|
2017-03-08 17:47:52 +00:00
|
|
|
uint8_t RepresentativeColor; // A palette entry representative of this translation,
|
2016-03-01 15:47:10 +00:00
|
|
|
// for map arrows and status bar backgrounds and such
|
2017-03-08 17:47:52 +00:00
|
|
|
uint8_t NumExtraRanges;
|
2016-03-01 15:47:10 +00:00
|
|
|
ExtraRange Extra[6];
|
|
|
|
};
|
|
|
|
|
2017-02-08 18:10:11 +00:00
|
|
|
typedef TArray<std::tuple<PClass*, FName, PalEntry>> PainFlashList;
|
|
|
|
typedef TArray<std::tuple<PClass*, int, FPlayerColorSet>> ColorSetList;
|
|
|
|
|
|
|
|
extern PainFlashList PainFlashes;
|
|
|
|
extern ColorSetList ColorSets;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
2017-02-08 18:42:24 +00:00
|
|
|
FString GetPrintableDisplayName(PClassActor *cls);
|
2016-03-01 15:47:10 +00:00
|
|
|
|
2019-01-03 12:58:53 +00:00
|
|
|
void PlayIdle(AActor *player);
|
|
|
|
|
|
|
|
|
2016-03-01 15:47:10 +00:00
|
|
|
//
|
|
|
|
// PlayerPawn flags
|
|
|
|
//
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
PPF_NOTHRUSTWHENINVUL = 1, // Attacks do not thrust the player if they are invulnerable.
|
|
|
|
};
|
|
|
|
|
|
|
|
//
|
|
|
|
// Player states.
|
|
|
|
//
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
PST_LIVE, // Playing or camping.
|
|
|
|
PST_DEAD, // Dead on the ground, view follows killer.
|
|
|
|
PST_REBORN, // Ready to restart/respawn???
|
|
|
|
PST_ENTER, // [BC] Entered the game
|
|
|
|
PST_GONE // Player has left the game
|
|
|
|
} playerstate_t;
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Player internal flags, for cheats and debug.
|
|
|
|
//
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
CF_NOCLIP = 1 << 0, // No clipping, walk through barriers.
|
|
|
|
CF_GODMODE = 1 << 1, // No damage, no health loss.
|
|
|
|
CF_NOVELOCITY = 1 << 2, // Not really a cheat, just a debug aid.
|
|
|
|
CF_NOTARGET = 1 << 3, // [RH] Monsters don't target
|
|
|
|
CF_FLY = 1 << 4, // [RH] Flying player
|
|
|
|
CF_CHASECAM = 1 << 5, // [RH] Put camera behind player
|
|
|
|
CF_FROZEN = 1 << 6, // [RH] Don't let the player move
|
|
|
|
CF_REVERTPLEASE = 1 << 7, // [RH] Stick camera in player's head if (s)he moves
|
|
|
|
CF_STEPLEFT = 1 << 9, // [RH] Play left footstep sound next time
|
|
|
|
CF_FRIGHTENING = 1 << 10, // [RH] Scare monsters away
|
|
|
|
CF_INSTANTWEAPSWITCH= 1 << 11, // [RH] Switch weapons instantly
|
|
|
|
CF_TOTALLYFROZEN = 1 << 12, // [RH] All players can do is press +use
|
|
|
|
CF_PREDICTING = 1 << 13, // [RH] Player movement is being predicted
|
|
|
|
CF_INTERPVIEW = 1 << 14, // [RH] view was changed outside of input, so interpolate one frame
|
|
|
|
CF_EXTREMELYDEAD = 1 << 22, // [RH] Reliably let the status bar know about extreme deaths.
|
|
|
|
CF_BUDDHA2 = 1 << 24, // [MC] Absolute buddha. No voodoo can kill it either.
|
|
|
|
CF_GODMODE2 = 1 << 25, // [MC] Absolute godmode. No voodoo can kill it either.
|
|
|
|
CF_BUDDHA = 1 << 27, // [SP] Buddha mode - take damage, but don't die
|
|
|
|
CF_NOCLIP2 = 1 << 30, // [RH] More Quake-like noclip
|
|
|
|
} cheat_t;
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
WF_WEAPONREADY = 1 << 0, // [RH] Weapon is in the ready state and can fire its primary attack
|
|
|
|
WF_WEAPONBOBBING = 1 << 1, // [HW] Bob weapon while the player is moving
|
|
|
|
WF_WEAPONREADYALT = 1 << 2, // Weapon can fire its secondary attack
|
|
|
|
WF_WEAPONSWITCHOK = 1 << 3, // It is okay to switch away from this weapon
|
|
|
|
WF_DISABLESWITCH = 1 << 4, // Disable weapon switching completely
|
|
|
|
WF_WEAPONRELOADOK = 1 << 5, // [XA] Okay to reload this weapon.
|
|
|
|
WF_WEAPONZOOMOK = 1 << 6, // [XA] Okay to use weapon zoom function.
|
|
|
|
WF_REFIRESWITCHOK = 1 << 7, // Mirror WF_WEAPONSWITCHOK for A_ReFire
|
|
|
|
WF_USER1OK = 1 << 8, // [MC] Allow pushing of custom state buttons 1-4
|
|
|
|
WF_USER2OK = 1 << 9,
|
|
|
|
WF_USER3OK = 1 << 10,
|
|
|
|
WF_USER4OK = 1 << 11,
|
|
|
|
};
|
|
|
|
|
2016-11-19 00:23:56 +00:00
|
|
|
// The VM cannot deal with this as an invalid pointer because it performs a read barrier on every object pointer read.
|
|
|
|
// This doesn't have to point to a valid weapon, though, because WP_NOCHANGE is never dereferenced, but it must point to a valid object
|
|
|
|
// and the class descriptor just works fine for that.
|
2018-12-04 16:11:36 +00:00
|
|
|
extern AActor *WP_NOCHANGE;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
#define MAXPLAYERNAME 15
|
|
|
|
|
|
|
|
// [GRB] Custom player classes
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
PCF_NOMENU = 1, // Hide in new game menu
|
|
|
|
};
|
|
|
|
|
|
|
|
class FPlayerClass
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FPlayerClass ();
|
|
|
|
FPlayerClass (const FPlayerClass &other);
|
|
|
|
~FPlayerClass ();
|
|
|
|
|
|
|
|
bool CheckSkin (int skin);
|
|
|
|
|
2017-02-08 18:42:24 +00:00
|
|
|
PClassActor *Type;
|
2017-03-08 17:50:37 +00:00
|
|
|
uint32_t Flags;
|
2016-03-01 15:47:10 +00:00
|
|
|
TArray<int> Skins;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern TArray<FPlayerClass> PlayerClasses;
|
|
|
|
|
|
|
|
// User info (per-player copies of each CVAR_USERINFO cvar)
|
|
|
|
struct userinfo_t : TMap<FName,FBaseCVar *>
|
|
|
|
{
|
|
|
|
~userinfo_t();
|
|
|
|
|
2016-03-17 10:38:56 +00:00
|
|
|
double GetAimDist() const
|
2016-03-01 15:47:10 +00:00
|
|
|
{
|
|
|
|
if (dmflags2 & DF2_NOAUTOAIM)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
float aim = *static_cast<FFloatCVar *>(*CheckKey(NAME_Autoaim));
|
|
|
|
if (aim > 35 || aim < 0)
|
|
|
|
{
|
2016-03-17 10:38:56 +00:00
|
|
|
return 35.;
|
2016-03-01 15:47:10 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-03-17 10:38:56 +00:00
|
|
|
return aim;
|
2016-03-01 15:47:10 +00:00
|
|
|
}
|
|
|
|
}
|
2017-02-18 00:20:07 +00:00
|
|
|
// Same but unfiltered.
|
|
|
|
double GetAutoaim() const
|
|
|
|
{
|
|
|
|
return *static_cast<FFloatCVar *>(*CheckKey(NAME_Autoaim));
|
|
|
|
}
|
2016-03-01 15:47:10 +00:00
|
|
|
const char *GetName() const
|
|
|
|
{
|
|
|
|
return *static_cast<FStringCVar *>(*CheckKey(NAME_Name));
|
|
|
|
}
|
|
|
|
int GetTeam() const
|
|
|
|
{
|
|
|
|
return *static_cast<FIntCVar *>(*CheckKey(NAME_Team));
|
|
|
|
}
|
|
|
|
int GetColorSet() const
|
|
|
|
{
|
|
|
|
return *static_cast<FIntCVar *>(*CheckKey(NAME_ColorSet));
|
|
|
|
}
|
2017-03-09 18:31:45 +00:00
|
|
|
uint32_t GetColor() const
|
2016-03-01 15:47:10 +00:00
|
|
|
{
|
|
|
|
return *static_cast<FColorCVar *>(*CheckKey(NAME_Color));
|
|
|
|
}
|
|
|
|
bool GetNeverSwitch() const
|
|
|
|
{
|
|
|
|
return *static_cast<FBoolCVar *>(*CheckKey(NAME_NeverSwitchOnPickup));
|
|
|
|
}
|
2016-03-19 23:54:18 +00:00
|
|
|
double GetMoveBob() const
|
2016-03-01 15:47:10 +00:00
|
|
|
{
|
2016-03-19 23:54:18 +00:00
|
|
|
return *static_cast<FFloatCVar *>(*CheckKey(NAME_MoveBob));
|
2016-03-01 15:47:10 +00:00
|
|
|
}
|
2016-03-19 23:54:18 +00:00
|
|
|
double GetStillBob() const
|
2016-03-01 15:47:10 +00:00
|
|
|
{
|
2016-03-19 23:54:18 +00:00
|
|
|
return *static_cast<FFloatCVar *>(*CheckKey(NAME_StillBob));
|
2016-03-01 15:47:10 +00:00
|
|
|
}
|
2016-09-16 07:48:09 +00:00
|
|
|
float GetWBobSpeed() const
|
2016-09-16 07:01:52 +00:00
|
|
|
{
|
|
|
|
return *static_cast<FFloatCVar *>(*CheckKey(NAME_WBobSpeed));
|
|
|
|
}
|
2016-03-01 15:47:10 +00:00
|
|
|
int GetPlayerClassNum() const
|
|
|
|
{
|
|
|
|
return *static_cast<FIntCVar *>(*CheckKey(NAME_PlayerClass));
|
|
|
|
}
|
2017-10-23 16:16:02 +00:00
|
|
|
bool GetClassicFlight() const
|
|
|
|
{
|
|
|
|
return *static_cast<FBoolCVar *>(*CheckKey(NAME_ClassicFlight));
|
|
|
|
}
|
2017-02-08 18:42:24 +00:00
|
|
|
PClassActor *GetPlayerClassType() const
|
2016-03-01 15:47:10 +00:00
|
|
|
{
|
|
|
|
return PlayerClasses[GetPlayerClassNum()].Type;
|
|
|
|
}
|
|
|
|
int GetSkin() const
|
|
|
|
{
|
|
|
|
return *static_cast<FIntCVar *>(*CheckKey(NAME_Skin));
|
|
|
|
}
|
|
|
|
int GetGender() const
|
|
|
|
{
|
|
|
|
return *static_cast<FIntCVar *>(*CheckKey(NAME_Gender));
|
|
|
|
}
|
|
|
|
bool GetNoAutostartMap() const
|
|
|
|
{
|
|
|
|
return *static_cast<FBoolCVar *>(*CheckKey(NAME_Wi_NoAutostartMap));
|
|
|
|
}
|
|
|
|
|
|
|
|
void Reset();
|
|
|
|
int TeamChanged(int team);
|
|
|
|
int SkinChanged(const char *skinname, int playerclass);
|
|
|
|
int SkinNumChanged(int skinnum);
|
|
|
|
int GenderChanged(const char *gendername);
|
|
|
|
int PlayerClassChanged(const char *classname);
|
|
|
|
int PlayerClassNumChanged(int classnum);
|
2017-03-09 18:31:45 +00:00
|
|
|
uint32_t ColorChanged(const char *colorname);
|
|
|
|
uint32_t ColorChanged(uint32_t colorval);
|
2016-03-01 15:47:10 +00:00
|
|
|
int ColorSetChanged(int setnum);
|
|
|
|
};
|
|
|
|
|
2016-09-20 23:18:29 +00:00
|
|
|
void ReadUserInfo(FSerializer &arc, userinfo_t &info, FString &skin);
|
|
|
|
void WriteUserInfo(FSerializer &arc, userinfo_t &info);
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Extended player object info: player_t
|
|
|
|
//
|
|
|
|
class player_t
|
|
|
|
{
|
|
|
|
public:
|
2018-08-18 23:14:15 +00:00
|
|
|
player_t() = default;
|
2016-05-09 18:03:47 +00:00
|
|
|
~player_t();
|
2016-03-01 15:47:10 +00:00
|
|
|
player_t &operator= (const player_t &p);
|
|
|
|
|
2016-09-20 23:18:29 +00:00
|
|
|
void Serialize(FSerializer &arc);
|
2016-03-01 15:47:10 +00:00
|
|
|
size_t PropagateMark();
|
|
|
|
|
|
|
|
void SetLogNumber (int num);
|
|
|
|
void SetLogText (const char *text);
|
|
|
|
void SendPitchLimits() const;
|
|
|
|
|
2019-01-03 21:05:49 +00:00
|
|
|
AActor *mo = nullptr;
|
2018-08-18 23:14:15 +00:00
|
|
|
uint8_t playerstate = 0;
|
|
|
|
ticcmd_t cmd = {};
|
2016-03-01 15:47:10 +00:00
|
|
|
usercmd_t original_cmd;
|
2017-03-08 17:50:37 +00:00
|
|
|
uint32_t original_oldbuttons;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
userinfo_t userinfo; // [RH] who is this?
|
|
|
|
|
2018-08-18 23:14:15 +00:00
|
|
|
PClassActor *cls = nullptr; // class of associated PlayerPawn
|
2016-03-01 15:47:10 +00:00
|
|
|
|
2018-08-18 23:14:15 +00:00
|
|
|
float DesiredFOV = 0; // desired field of vision
|
|
|
|
float FOV = 0; // current field of vision
|
|
|
|
double viewz = 0; // focal origin above r.z
|
|
|
|
double viewheight = 0; // base height above floor for viewz
|
|
|
|
double deltaviewheight = 0; // squat speed.
|
|
|
|
double bob = 0; // bounded/scaled total velocity
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
// killough 10/98: used for realistic bobbing (i.e. not simply overall speed)
|
2016-03-19 23:54:18 +00:00
|
|
|
// mo->velx and mo->vely represent true velocity experienced by player.
|
2016-03-01 15:47:10 +00:00
|
|
|
// This only represents the thrust that the player applies himself.
|
|
|
|
// This avoids anomalies with such things as Boom ice and conveyors.
|
2018-08-18 23:14:15 +00:00
|
|
|
DVector2 Vel = { 0,0 };
|
2016-03-01 15:47:10 +00:00
|
|
|
|
2018-08-18 23:14:15 +00:00
|
|
|
bool centering = false;
|
|
|
|
uint8_t turnticks = 0;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
|
2018-08-18 23:14:15 +00:00
|
|
|
bool attackdown = false;
|
|
|
|
bool usedown = false;
|
|
|
|
uint32_t oldbuttons = false;
|
|
|
|
int health = 0; // only used between levels, mo->health
|
2016-03-01 15:47:10 +00:00
|
|
|
// is used during levels
|
|
|
|
|
2018-08-18 23:14:15 +00:00
|
|
|
int inventorytics = 0;
|
|
|
|
uint8_t CurrentPlayerClass = 0; // class # for this player instance
|
|
|
|
|
|
|
|
int frags[MAXPLAYERS] = {}; // kills of other players
|
|
|
|
int fragcount = 0; // [RH] Cumulative frags for this player
|
|
|
|
int lastkilltime = 0; // [RH] For multikills
|
|
|
|
uint8_t multicount = 0;
|
|
|
|
uint8_t spreecount = 0; // [RH] Keep track of killing sprees
|
|
|
|
uint16_t WeaponState = 0;
|
|
|
|
|
2018-12-04 16:11:36 +00:00
|
|
|
AActor *ReadyWeapon = nullptr;
|
|
|
|
AActor *PendingWeapon = nullptr; // WP_NOCHANGE if not changing
|
2018-08-18 23:14:15 +00:00
|
|
|
TObjPtr<DPSprite*> psprites = nullptr; // view sprites (gun, etc)
|
|
|
|
|
|
|
|
int cheats = 0; // bit flags
|
|
|
|
int timefreezer = 0; // Player has an active time freezer
|
|
|
|
short refire = 0; // refired shots are less accurate
|
|
|
|
short inconsistant = 0;
|
|
|
|
bool waiting = 0;
|
|
|
|
int killcount = 0, itemcount = 0, secretcount = 0; // for intermission
|
|
|
|
int damagecount = 0, bonuscount = 0;// for screen flashing
|
|
|
|
int hazardcount = 0; // for delayed Strife damage
|
|
|
|
int hazardinterval = 0; // Frequency of damage infliction
|
|
|
|
FName hazardtype = NAME_None; // Damage type of last hazardous damage encounter.
|
|
|
|
int poisoncount = 0; // screen flash for poison damage
|
|
|
|
FName poisontype = NAME_None; // type of poison damage to apply
|
|
|
|
FName poisonpaintype = NAME_None; // type of Pain state to enter for poison damage
|
|
|
|
TObjPtr<AActor*> poisoner = nullptr; // NULL for non-player actors
|
|
|
|
TObjPtr<AActor*> attacker = nullptr; // who did damage (NULL for floors)
|
|
|
|
int extralight = 0; // so gun flashes light up areas
|
|
|
|
short fixedcolormap = 0; // can be set to REDCOLORMAP, etc.
|
|
|
|
short fixedlightlevel = 0;
|
|
|
|
int morphTics = 0; // player is a chicken/pig if > 0
|
|
|
|
PClassActor *MorphedPlayerClass = nullptr; // [MH] (for SBARINFO) class # for this player instance when morphed
|
|
|
|
int MorphStyle = 0; // which effects to apply for this player instance when morphed
|
2018-11-24 07:39:35 +00:00
|
|
|
PClassActor *MorphExitFlash = nullptr; // flash to apply when demorphing (cache of value given to MorphPlayer)
|
2018-12-04 16:11:36 +00:00
|
|
|
TObjPtr<AActor*> PremorphWeapon = nullptr; // ready weapon before morphing
|
2018-08-18 23:14:15 +00:00
|
|
|
int chickenPeck = 0; // chicken peck countdown
|
|
|
|
int jumpTics = 0; // delay the next jump for a moment
|
|
|
|
bool onground = 0; // Identifies if this player is on the ground or other object
|
|
|
|
|
|
|
|
int respawn_time = 0; // [RH] delay respawning until this tic
|
|
|
|
TObjPtr<AActor*> camera = nullptr; // [RH] Whose eyes this player sees through
|
|
|
|
|
|
|
|
int air_finished = 0; // [RH] Time when you start drowning
|
|
|
|
|
|
|
|
FName LastDamageType = NAME_None; // [RH] For damage-specific pain and death sounds
|
|
|
|
|
|
|
|
TObjPtr<AActor*> MUSINFOactor = nullptr; // For MUSINFO purposes
|
|
|
|
int8_t MUSINFOtics = 0;
|
|
|
|
|
2018-12-10 08:36:40 +00:00
|
|
|
bool settings_controller = false; // Player can control game settings.
|
2018-08-18 23:14:15 +00:00
|
|
|
int8_t crouching = 0;
|
|
|
|
int8_t crouchdir = 0;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
//Added by MC:
|
2018-08-18 23:14:15 +00:00
|
|
|
TObjPtr<DBot*> Bot = nullptr;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
2018-08-18 23:14:15 +00:00
|
|
|
float BlendR = 0; // [RH] Final blending values
|
|
|
|
float BlendG = 0;
|
|
|
|
float BlendB = 0;
|
|
|
|
float BlendA = 0;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
FString LogText; // [RH] Log for Strife
|
|
|
|
|
2018-08-18 23:14:15 +00:00
|
|
|
DAngle MinPitch = 0.; // Viewpitch limits (negative is up, positive is down)
|
|
|
|
DAngle MaxPitch = 0.;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
2018-08-18 23:14:15 +00:00
|
|
|
double crouchfactor = 0;
|
|
|
|
double crouchoffset = 0;
|
|
|
|
double crouchviewdelta = 0;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
FWeaponSlots weapons;
|
|
|
|
|
|
|
|
// [CW] I moved these here for multiplayer conversation support.
|
2018-08-18 23:14:15 +00:00
|
|
|
TObjPtr<AActor*> ConversationNPC = nullptr, ConversationPC = nullptr;
|
|
|
|
DAngle ConversationNPCAngle = 0.;
|
|
|
|
bool ConversationFaceTalker = false;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
2016-03-22 11:42:27 +00:00
|
|
|
double GetDeltaViewHeight() const
|
2016-03-01 15:47:10 +00:00
|
|
|
{
|
2019-01-03 17:01:58 +00:00
|
|
|
return (mo->FloatVar(NAME_ViewHeight) + crouchviewdelta - viewheight) / 8;
|
2016-03-01 15:47:10 +00:00
|
|
|
}
|
|
|
|
|
2019-01-03 17:01:58 +00:00
|
|
|
double DefaultViewHeight() const
|
|
|
|
{
|
|
|
|
return mo->FloatVar(NAME_ViewHeight);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-03-01 15:47:10 +00:00
|
|
|
void Uncrouch()
|
|
|
|
{
|
2016-03-19 23:54:18 +00:00
|
|
|
if (crouchfactor != 1)
|
2016-03-01 15:47:10 +00:00
|
|
|
{
|
2016-03-19 23:54:18 +00:00
|
|
|
crouchfactor = 1;
|
2016-03-01 15:47:10 +00:00
|
|
|
crouchoffset = 0;
|
|
|
|
crouchdir = 0;
|
|
|
|
crouching = 0;
|
|
|
|
crouchviewdelta = 0;
|
2019-01-03 17:01:58 +00:00
|
|
|
viewheight = mo ? mo->FloatVar(NAME_ViewHeight) : 0;
|
2016-03-01 15:47:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int GetSpawnClass();
|
2016-05-09 18:03:47 +00:00
|
|
|
|
|
|
|
// PSprite layers
|
|
|
|
void TickPSprites();
|
|
|
|
void DestroyPSprites();
|
2016-05-18 12:20:36 +00:00
|
|
|
DPSprite *FindPSprite(int layer);
|
2016-07-08 09:55:04 +00:00
|
|
|
// Used ONLY for compatibility with the old hardcoded layers.
|
|
|
|
// Make sure that a state is properly set after calling this unless
|
|
|
|
// you are 100% sure the context already implies the layer exists.
|
|
|
|
DPSprite *GetPSprite(PSPLayers layer);
|
2017-02-08 18:10:11 +00:00
|
|
|
|
2017-02-28 10:23:40 +00:00
|
|
|
// [Nash] set player FOV
|
|
|
|
void SetFOV(float fov);
|
2017-03-26 20:04:58 +00:00
|
|
|
bool HasWeaponsInSlot(int slot) const;
|
2017-03-28 19:29:14 +00:00
|
|
|
bool Resurrect();
|
2016-03-01 15:47:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Bookkeeping on players - state.
|
|
|
|
extern player_t players[MAXPLAYERS];
|
|
|
|
|
2016-03-20 11:13:00 +00:00
|
|
|
void P_CheckPlayerSprite(AActor *mo, int &spritenum, DVector2 &scale);
|
2017-02-08 18:10:11 +00:00
|
|
|
void EnumColorSets(PClassActor *pc, TArray<int> *out);
|
|
|
|
FPlayerColorSet *GetColorSet(PClassActor *pc, int setnum);
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
inline void AActor::SetFriendPlayer(player_t *player)
|
|
|
|
{
|
|
|
|
if (player == NULL)
|
|
|
|
{
|
|
|
|
FriendPlayer = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FriendPlayer = int(player - players) + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool AActor::IsNoClip2() const
|
|
|
|
{
|
|
|
|
if (player != NULL && player->mo == this)
|
|
|
|
{
|
|
|
|
return (player->cheats & CF_NOCLIP2) != 0;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool P_IsPlayerTotallyFrozen(const player_t *player);
|
|
|
|
|
|
|
|
#endif // __D_PLAYER_H__
|