//************************************************************************** //** //** ## ## ## ## ## #### #### ### ### //** ## ## ## ## ## ## ## ## ## ## #### #### //** ## ## ## ## ## ## ## ## ## ## ## ## ## ## //** ## ## ######## ## ## ## ## ## ## ## ### ## //** ### ## ## ### ## ## ## ## ## ## //** # ## ## # #### #### ## ## //** //** $Id: BasePlayer.vc 2707 2007-09-07 17:47:04Z dj_jl $ //** //** Copyright (C) 1999-2006 Jānis Legzdiņš //** //** 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 2 //** of the License, or (at your option) any later version. //** //** 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. //** //************************************************************************** // // Extended player object info // //************************************************************************** class BasePlayer : Object; struct VViewState { state State; // a 0 state means not active float StateTime; float SX; float SY; }; readonly LevelInfo Level; readonly bool bActive; readonly bool bSpawned; readonly bool bIsBot; bool bFixAngle; bool bAttackDown; // True if button down last tic. bool bUseDown; bool bDidSecret; // True if secret level has been done. readonly private bool bCentreing; readonly bool bIsClient; // Player on client side bool bAutomapRevealed; bool bAutomapShowThings; native readonly private void* Net; string UserInfo; string PlayerName; byte BaseClass; byte PClass; // player class type int Colour; // Copied from cmd, needed for PROGS, which supports only 4 byte ints float ClientForwardMove; // *2048 for move float ClientSideMove; // *2048 for move float ForwardMove; // *2048 for move float SideMove; // *2048 for move float FlyMove; // fly up/down/centreing byte Buttons; // fire, use byte Impulse; // weapon changes, inventory, etc Entity MO; int PlayerState; // Determine POV, // including viewpoint bobbing during movement. // Focal origin above r.z TVec ViewOrg; TAVec ViewAngles; // This is only used between levels, // mo->health is used during levels. int Health; // Frags, kills of other players. int Frags; int Deaths; // For intermission stats. int KillCount; int ItemCount; int SecretCount; // So gun flashes light up areas. byte ExtraLight; // For lite-amp and invulnarability powers byte FixedColourmap; // Colour shifts for damage, powerups and content types int CShifts[NUM_CSHIFTS]; // Overlay view sprites (gun, etc). VViewState ViewStates[NUMPSPRITES]; Entity ViewEnt; float PSpriteSY; float WorldTimer; // total time the player's been playing native readonly byte ClientNum; native readonly float ViewEntAlpha; native readonly ClientGameBase ClGame; // Valid only on client side PlayerReplicationInfo PlayerReplicationInfo; replication { reliable if (!bIsClient) Health, Frags, Deaths, ExtraLight, FixedColourmap, CShifts, PSpriteSY, KillCount, ItemCount, SecretCount, ViewStates, ViewEnt, ViewEntAlpha, ClientNum, WorldTimer, MO, bAutomapRevealed, bAutomapShowThings; unreliable if (!bIsClient) ClientStartSound, ClientStopSound, ClientForceLightning, ClientSetViewOrg; reliable if (!bIsClient) ClientStartSequence, ClientAddSequenceChoice, ClientStopSequence, ClientPrint, ClientCentrePrint, ClientSetAngles, ClientIntermission, ClientPause, ClientSkipIntermission, ClientFinale, ClientChangeMusic, ClientSetServerInfo; // Movement variables reliable if (bIsClient) ViewAngles, ClientForwardMove, ClientSideMove, FlyMove, Buttons; // Methods client can execute on server reliable if (bIsClient) ServerImpulse, ServerSetUserInfo; } // Print to client native final void cprint(string format, ...); // Client's centre message native final void centreprint(string format, ...); native final int GetPlayerNum(); native final void ClearPlayer(); native final void SetViewState(int position, state stnum); native final void AdvanceViewStates(float deltaTime); native final void DisconnectBot(); // For networking native void ClientStartSound(int SoundId, TVec Org, int OriginId, int Channel, float Volume, float Attenuation); native void ClientStopSound(int OriginId, int Channel); native void ClientStartSequence(TVec Origin, int OriginId, name Name, int ModeNum); native void ClientAddSequenceChoice(int OriginId, name Choice); native void ClientStopSequence(int OriginId); native void ClientForceLightning(); native void ClientPrint(string Str); native void ClientCentrePrint(string Str); native void ClientSetAngles(TAVec Angles); native void ClientIntermission(name NextMap); native void ClientPause(bool Paused); native void ClientSkipIntermission(); native void ClientFinale(string Type); native void ClientChangeMusic(name Song, int CDTrack); native void ClientSetServerInfo(string Key, string Value); native void ServerSetUserInfo(string Info); void PutClientIntoServer() { } void SpawnClient() { } void NetGameReborn() { } void DisconnectClient() { } void UserinfoChanged() { } void PlayerExitMap(bool clusterChange) { } void PlayerTick(float deltaTime) { } void SetViewPos() { } void Cheat_God() { } void Cheat_NoClip() { } void Cheat_Gimme() { } void Cheat_KillAll() { } void Cheat_Morph() { } void Cheat_NoWeapons() { } void Cheat_Class() { } void ServerImpulse(int AImpulse) { Impulse = AImpulse; } void ClientSetViewOrg(float x, float y, float z) { ViewOrg = vector(x, y, z); } defaultproperties { }