2019-11-20 16:21:32 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 2010-2019 EDuke32 developers and contributors
|
|
|
|
Copyright (C) 2019 sirlemonhead, Nuke.YKT
|
|
|
|
This file is part of PCExhumed.
|
|
|
|
PCExhumed is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License version 2
|
|
|
|
as published by the Free Software Foundation.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2020-10-11 10:41:38 +00:00
|
|
|
#pragma once
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 09:08:38 +00:00
|
|
|
#include "compat.h"
|
2020-10-07 06:40:59 +00:00
|
|
|
#include "gamecontrol.h"
|
2020-10-11 14:33:43 +00:00
|
|
|
#include "gameinput.h"
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-11-22 23:11:37 +00:00
|
|
|
BEGIN_PS_NS
|
|
|
|
|
2019-08-26 03:59:14 +00:00
|
|
|
void RestoreSavePoint(int nPlayer, int *x, int *y, int *z, short *nSector, short *nAngle);
|
|
|
|
void SetSavePoint(int nPlayer, int x, int y, int z, short nSector, short nAngle);
|
|
|
|
void InitPlayer();
|
|
|
|
void InitPlayerKeys(short nPlayer);
|
|
|
|
int GrabPlayer();
|
|
|
|
void InitPlayerInventory(short nPlayer);
|
|
|
|
void RestartPlayer(short nPlayer);
|
|
|
|
|
2021-10-15 16:49:35 +00:00
|
|
|
void FuncPlayer(int, int nSector, int nSprite, int nRun);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2020-10-11 11:14:32 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
kMaxPlayers = 8,
|
|
|
|
kDefaultLives = 3,
|
|
|
|
kMaxPlayerLives = 5,
|
|
|
|
kMaxHealth = 800
|
2020-10-11 11:21:54 +00:00
|
|
|
};
|
2019-08-26 03:59:14 +00:00
|
|
|
|
|
|
|
extern int nLocalPlayer;
|
|
|
|
|
|
|
|
extern int lPlayerXVel;
|
|
|
|
extern int lPlayerYVel;
|
|
|
|
|
2021-10-21 10:51:16 +00:00
|
|
|
struct PlayerSave
|
|
|
|
{
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
int z;
|
|
|
|
short nSector;
|
|
|
|
short nAngle;
|
|
|
|
};
|
|
|
|
|
2019-08-26 03:59:14 +00:00
|
|
|
struct Player
|
|
|
|
{
|
2021-10-21 20:39:17 +00:00
|
|
|
DExhumedActor* Actor() { return pActor; }
|
|
|
|
DExhumedActor* pActor;
|
2019-08-31 07:47:15 +00:00
|
|
|
short nHealth;
|
2021-05-13 17:06:38 +00:00
|
|
|
short nLives;
|
2021-05-13 17:15:53 +00:00
|
|
|
short nDouble;
|
|
|
|
short nInvisible;
|
|
|
|
short nTorch;
|
2019-08-31 07:47:15 +00:00
|
|
|
short field_2;
|
|
|
|
short nAction;
|
|
|
|
short bIsMummified;
|
|
|
|
short invincibility;
|
|
|
|
short nAir;
|
|
|
|
short nSeq;
|
|
|
|
short nMaskAmount;
|
2019-08-31 09:08:38 +00:00
|
|
|
uint16_t keys;
|
2019-08-31 07:47:15 +00:00
|
|
|
short nMagic;
|
2021-05-13 11:44:58 +00:00
|
|
|
short nItem;
|
2021-05-13 20:28:02 +00:00
|
|
|
uint8_t items[8];
|
2019-08-31 07:47:15 +00:00
|
|
|
short nAmmo[7]; // TODO - kMaxWeapons?
|
|
|
|
|
|
|
|
short nCurrentWeapon;
|
2019-10-29 22:10:50 +00:00
|
|
|
short field_3FOUR;
|
2019-08-31 07:47:15 +00:00
|
|
|
short bIsFiring;
|
|
|
|
short field_38;
|
|
|
|
short field_3A;
|
|
|
|
short field_3C;
|
|
|
|
short nRun;
|
2021-04-13 11:56:01 +00:00
|
|
|
bool bPlayerPan, bLockPan;
|
|
|
|
fixedhoriz nDestVertPan;
|
2019-10-29 17:35:22 +00:00
|
|
|
|
2020-10-07 06:40:59 +00:00
|
|
|
PlayerHorizon horizon;
|
2020-10-07 21:08:40 +00:00
|
|
|
PlayerAngle angle;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-10-21 10:51:16 +00:00
|
|
|
short nBreathTimer;
|
|
|
|
short nPlayerSwear;
|
|
|
|
short nPlayerPushSect;
|
|
|
|
short nDeathType;
|
|
|
|
short nPlayerScore;
|
|
|
|
short nPlayerColor;
|
|
|
|
int nPlayerDY;
|
|
|
|
int nPlayerDX;
|
|
|
|
short nPistolClip;
|
|
|
|
int nXDamage;
|
|
|
|
int nYDamage;
|
|
|
|
short nPlayerOldWeapon;
|
|
|
|
short nPlayerClip;
|
|
|
|
short nPlayerPushSound;
|
|
|
|
short nTauntTimer;
|
|
|
|
uint16_t nPlayerWeapons; // each set bit represents a weapon the player has
|
|
|
|
short nPlayerViewSect;
|
|
|
|
PlayerSave sPlayerSave;
|
|
|
|
int ototalvel;
|
|
|
|
int totalvel;
|
|
|
|
int16_t eyelevel, oeyelevel;
|
2021-10-21 17:44:53 +00:00
|
|
|
DExhumedActor* pPlayerGrenade;
|
|
|
|
DExhumedActor* pPlayerFloorSprite;
|
2021-10-21 17:54:39 +00:00
|
|
|
DExhumedActor* pDoppleSprite;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-10-21 10:51:16 +00:00
|
|
|
};
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-10-21 10:51:16 +00:00
|
|
|
extern short PlayerCount;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-10-21 10:51:16 +00:00
|
|
|
extern Player PlayerList[kMaxPlayers];
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-11-08 16:55:26 +00:00
|
|
|
extern short obobangle, bobangle;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-10-21 08:41:41 +00:00
|
|
|
extern DExhumedActor* nNetStartSprite[kMaxPlayers];
|
2019-08-26 03:59:14 +00:00
|
|
|
extern short nNetStartSprites;
|
|
|
|
extern short nCurStartSprite;
|
|
|
|
|
|
|
|
short GetPlayerFromSprite(short nSprite);
|
2021-10-17 13:15:33 +00:00
|
|
|
short GetPlayerFromActor(DExhumedActor* actor)
|
|
|
|
{
|
|
|
|
return GetPlayerFromSprite(actor->GetSpriteIndex());
|
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
void SetPlayerMummified(int nPlayer, int bIsMummified);
|
|
|
|
int AddAmmo(int nPlayer, int nWeapon, int nAmmoAmount);
|
|
|
|
void ShootStaff(int nPlayer);
|
2020-09-21 10:37:09 +00:00
|
|
|
void UpdatePlayerSpriteAngle(Player* pPlayer);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-11-22 23:11:37 +00:00
|
|
|
END_PS_NS
|
|
|
|
|