Cleanup time for some of our base classes. Go over Show/Hide methods, and document
the EFFECTS fields we have available. Since we do our own networking mostly we can reuse some that are only available via CSQC (or NQSSQC)
This commit is contained in:
parent
3c673dcf6d
commit
7c40100e46
18 changed files with 324 additions and 272 deletions
|
@ -34,10 +34,10 @@ NSClient:NSNavAI
|
|||
virtual void(void) PreFrame;
|
||||
virtual void(void) PostFrame;
|
||||
|
||||
virtual bool(void) IsFakeSpectator;
|
||||
virtual bool(void) IsRealSpectator;
|
||||
virtual bool(void) IsDead;
|
||||
virtual bool(void) IsPlayer;
|
||||
const bool(void) IsFakeSpectator;
|
||||
const bool(void) IsRealSpectator;
|
||||
const bool(void) IsDead;
|
||||
const bool(void) IsPlayer;
|
||||
|
||||
virtual void(void) OnRemoveEntity;
|
||||
|
||||
|
|
|
@ -59,25 +59,25 @@ NSClient::PostFrame(void)
|
|||
{
|
||||
}
|
||||
|
||||
bool
|
||||
const bool
|
||||
NSClient::IsFakeSpectator(void)
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
|
||||
bool
|
||||
const bool
|
||||
NSClient::IsRealSpectator(void)
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
|
||||
bool
|
||||
const bool
|
||||
NSClient::IsDead(void)
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
|
||||
bool
|
||||
const bool
|
||||
NSClient::IsPlayer(void)
|
||||
{
|
||||
return (false);
|
||||
|
|
|
@ -80,10 +80,10 @@ NSClientPlayer:NSClientSpectator
|
|||
virtual void(void) Physics_InputPostMove;
|
||||
virtual void(void) Physics_Run;
|
||||
|
||||
virtual bool(void) IsFakeSpectator;
|
||||
virtual bool(void) IsRealSpectator;
|
||||
virtual bool(void) IsDead;
|
||||
virtual bool(void) IsPlayer;
|
||||
const bool(void) IsFakeSpectator;
|
||||
const bool(void) IsRealSpectator;
|
||||
const bool(void) IsDead;
|
||||
const bool(void) IsPlayer;
|
||||
|
||||
#ifdef CLIENT
|
||||
int sequence;
|
||||
|
|
|
@ -21,13 +21,13 @@ NSClientPlayer::NSClientPlayer(void)
|
|||
vehicle = __NULL__;
|
||||
}
|
||||
|
||||
bool
|
||||
const bool
|
||||
NSClientPlayer::IsRealSpectator(void)
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
|
||||
bool
|
||||
const bool
|
||||
NSClientPlayer::IsDead(void)
|
||||
{
|
||||
if (health > 0)
|
||||
|
@ -36,13 +36,13 @@ NSClientPlayer::IsDead(void)
|
|||
return (true);
|
||||
}
|
||||
|
||||
bool
|
||||
const bool
|
||||
NSClientPlayer::IsPlayer(void)
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
|
||||
bool
|
||||
const bool
|
||||
NSClientPlayer::IsFakeSpectator(void)
|
||||
{
|
||||
if (GetFlags() & FL_FAKESPEC)
|
||||
|
|
|
@ -60,10 +60,10 @@ class NSClientSpectator:NSClient
|
|||
virtual void(void) PostFrame;
|
||||
virtual void(void) SpectatorTrackPlayer;
|
||||
|
||||
virtual bool(void) IsFakeSpectator;
|
||||
virtual bool(void) IsRealSpectator;
|
||||
virtual bool(void) IsDead;
|
||||
virtual bool(void) IsPlayer;
|
||||
const bool(void) IsFakeSpectator;
|
||||
const bool(void) IsRealSpectator;
|
||||
const bool(void) IsDead;
|
||||
const bool(void) IsPlayer;
|
||||
|
||||
#ifdef SERVER
|
||||
virtual void(float) Save;
|
||||
|
|
|
@ -37,25 +37,25 @@ NSClientSpectator::Restore(string strKey, string strValue)
|
|||
}
|
||||
#endif
|
||||
|
||||
bool
|
||||
const bool
|
||||
NSClientSpectator::IsRealSpectator(void)
|
||||
{
|
||||
return (true);
|
||||
}
|
||||
|
||||
bool
|
||||
const bool
|
||||
NSClientSpectator::IsDead(void)
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
|
||||
bool
|
||||
const bool
|
||||
NSClientSpectator::IsPlayer(void)
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
|
||||
bool
|
||||
const bool
|
||||
NSClientSpectator::IsFakeSpectator(void)
|
||||
{
|
||||
return (false);
|
||||
|
|
|
@ -44,6 +44,8 @@ enumflags
|
|||
*/
|
||||
class NSEntity:NSTrigger
|
||||
{
|
||||
bool m_bHidden;
|
||||
|
||||
void(void) NSEntity;
|
||||
|
||||
/* these are the real bounds, whereas .mins .maxs are affected by .scale */
|
||||
|
@ -100,23 +102,24 @@ class NSEntity:NSTrigger
|
|||
PREDICTED_FLOAT_N(skin);
|
||||
PREDICTED_FLOAT_N(effects);
|
||||
|
||||
virtual void(void) Show;
|
||||
virtual void(void) Hide;
|
||||
virtual void(void) EvaluateEntity;
|
||||
virtual float(entity, float) SendEntity;
|
||||
|
||||
nonvirtual entity(void) GetParent;
|
||||
nonvirtual void(string) SetParent;
|
||||
nonvirtual void(string) SetParentAttachment;
|
||||
nonvirtual void(void) ClearParent;
|
||||
const entity(void) GetParent;
|
||||
virtual void(string) SetParent;
|
||||
virtual void(string) SetParentAttachment;
|
||||
virtual void(void) ClearParent;
|
||||
virtual void(void) ParentUpdate;
|
||||
|
||||
/* some ents need this */
|
||||
nonvirtual void(void) RestoreAngles;
|
||||
nonvirtual void(void) ClearAngles;
|
||||
virtual void(void) RestoreAngles;
|
||||
virtual void(void) ClearAngles;
|
||||
#endif
|
||||
|
||||
/* sets */
|
||||
virtual void(float) SetEffects;
|
||||
virtual void(float) SetFrame;
|
||||
virtual void(float) SetSkin;
|
||||
virtual void(float) SetScale;
|
||||
virtual void(entity) SetOwner;
|
||||
virtual void(vector) SetVelocity;
|
||||
|
@ -133,55 +136,65 @@ class NSEntity:NSTrigger
|
|||
virtual void(vector, vector) SetSize;
|
||||
virtual void(float) AddFlags;
|
||||
virtual void(float) RemoveFlags;
|
||||
/* gets */
|
||||
nonvirtual vector(void) GetSpawnOrigin;
|
||||
nonvirtual vector(void) GetSpawnAngles;
|
||||
nonvirtual string(void) GetSpawnModel;
|
||||
|
||||
virtual float(void) GetScale;
|
||||
virtual entity(void) GetOwner;
|
||||
virtual vector(void) GetVelocity;
|
||||
virtual float(void) GetSolid;
|
||||
virtual string(void) GetModel;
|
||||
virtual float(void) GetModelindex;
|
||||
virtual float(void) GetMovetype;
|
||||
virtual float(void) GetGravity;
|
||||
virtual vector(void) GetAngles;
|
||||
virtual vector(void) GetAngularVelocity;
|
||||
virtual vector(void) GetOrigin;
|
||||
virtual vector(void) GetMins;
|
||||
virtual vector(void) GetMaxs;
|
||||
virtual vector(void) GetRealMins;
|
||||
virtual vector(void) GetRealMaxs;
|
||||
virtual vector(void) GetAbsoluteMins;
|
||||
virtual vector(void) GetAbsoluteMaxs;
|
||||
virtual float(void) GetFlags;
|
||||
/* gets */
|
||||
const vector(void) GetSpawnOrigin;
|
||||
const vector(void) GetSpawnAngles;
|
||||
const string(void) GetSpawnModel;
|
||||
|
||||
const float(void) GetEffects;
|
||||
const float(void) GetFrame;
|
||||
const float(void) GetSkin;
|
||||
const float(void) GetScale;
|
||||
const entity(void) GetOwner;
|
||||
const vector(void) GetVelocity;
|
||||
const float(void) GetSolid;
|
||||
const string(void) GetModel;
|
||||
const float(void) GetModelindex;
|
||||
const float(void) GetMovetype;
|
||||
const float(void) GetGravity;
|
||||
const vector(void) GetAngles;
|
||||
const vector(void) GetAngularVelocity;
|
||||
const vector(void) GetOrigin;
|
||||
const vector(void) GetMins;
|
||||
const vector(void) GetMaxs;
|
||||
const vector(void) GetRealMins;
|
||||
const vector(void) GetRealMaxs;
|
||||
const vector(void) GetAbsoluteMins;
|
||||
const vector(void) GetAbsoluteMaxs;
|
||||
const float(void) GetFlags;
|
||||
|
||||
virtual void(void) Show;
|
||||
virtual void(void) Hide;
|
||||
const bool(void) IsHidden;
|
||||
|
||||
virtual void(string, string) SpawnKey;
|
||||
virtual void(void) Destroy;
|
||||
virtual void(void) UpdateBounds;
|
||||
|
||||
/* useful methods, based on GMod's API */
|
||||
nonvirtual float(void) EntIndex;
|
||||
nonvirtual void(void) DropToFloor;
|
||||
nonvirtual vector(void) GetForward;
|
||||
nonvirtual vector(void) GetRight;
|
||||
nonvirtual vector(void) GetUp;
|
||||
nonvirtual vector(void) WorldSpaceCenter;
|
||||
nonvirtual float(void) WaterLevel;
|
||||
nonvirtual bool(entity) Visible;
|
||||
nonvirtual bool(vector) VisibleVec;
|
||||
nonvirtual bool(float) HasSpawnFlags;
|
||||
nonvirtual bool(void) IsOnGround;
|
||||
nonvirtual entity(void) GetGroundEntity;
|
||||
virtual void(entity) Blocked;
|
||||
nonvirtual void(void) BlockedHandler;
|
||||
nonvirtual bool(void) CreatedByMap;
|
||||
const float(void) EntIndex;
|
||||
virtual void(void) DropToFloor;
|
||||
const vector(void) GetForward;
|
||||
const vector(void) GetRight;
|
||||
const vector(void) GetUp;
|
||||
const vector(void) WorldSpaceCenter;
|
||||
const float(void) WaterLevel;
|
||||
const bool(entity) Visible;
|
||||
const bool(vector) VisibleVec;
|
||||
const bool(float) HasSpawnFlags;
|
||||
const bool(void) IsOnGround;
|
||||
const entity(void) GetGroundEntity;
|
||||
const bool(void) CreatedByMap;
|
||||
|
||||
virtual void(entity) Blocked;
|
||||
virtual void(entity) StartTouch;
|
||||
virtual void(entity) Touch;
|
||||
virtual void(entity) EndTouch;
|
||||
nonvirtual void(void) TouchHandler;
|
||||
virtual void(void) _TouchHandler;
|
||||
virtual void(void) _BlockedHandler;
|
||||
|
||||
virtual void(void) OnRemoveEntity;
|
||||
|
||||
virtual void(void) MakeStatic;
|
||||
};
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
============
|
||||
NSEntity::NSEntity
|
||||
|
@ -25,8 +24,8 @@ client doesn't have to do a whole lot here
|
|||
void
|
||||
NSEntity::NSEntity(void)
|
||||
{
|
||||
blocked = BlockedHandler;
|
||||
touch = TouchHandler;
|
||||
blocked = _BlockedHandler;
|
||||
touch = _TouchHandler;
|
||||
|
||||
#ifdef SERVER
|
||||
identity = 1;
|
||||
|
@ -56,7 +55,7 @@ NSEntity::Spawned(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
float
|
||||
const float
|
||||
NSEntity::EntIndex(void)
|
||||
{
|
||||
return num_for_edict(this);
|
||||
|
@ -77,21 +76,21 @@ NSEntity::DropToFloor(void)
|
|||
droptofloorwrapper(this);
|
||||
}
|
||||
|
||||
vector
|
||||
const vector
|
||||
NSEntity::GetForward(void)
|
||||
{
|
||||
makevectors(angles);
|
||||
return v_forward;
|
||||
}
|
||||
|
||||
vector
|
||||
const vector
|
||||
NSEntity::GetRight(void)
|
||||
{
|
||||
makevectors(angles);
|
||||
return v_right;
|
||||
}
|
||||
|
||||
vector
|
||||
const vector
|
||||
NSEntity::GetUp(void)
|
||||
{
|
||||
makevectors(angles);
|
||||
|
@ -106,7 +105,7 @@ Returns the center of an entity's bounding boxes.
|
|||
Useful on brush entities that have no real 'origin' defined.
|
||||
============
|
||||
*/
|
||||
vector
|
||||
const vector
|
||||
NSEntity::WorldSpaceCenter(void)
|
||||
{
|
||||
return absmin + (0.5 * (absmax - absmin));
|
||||
|
@ -119,7 +118,7 @@ NSEntity::VisibleVec
|
|||
Returns whether or not the entity is able to see a given position
|
||||
============
|
||||
*/
|
||||
float
|
||||
const float
|
||||
NSEntity::WaterLevel(void)
|
||||
{
|
||||
return waterlevel;
|
||||
|
@ -132,7 +131,7 @@ NSEntity::VisibleVec
|
|||
Returns whether or not the entity is able to see a given position
|
||||
============
|
||||
*/
|
||||
bool
|
||||
const bool
|
||||
NSEntity::VisibleVec(vector org)
|
||||
{
|
||||
vector flDelta;
|
||||
|
@ -145,10 +144,10 @@ NSEntity::VisibleVec(vector org)
|
|||
if (flFoV > 0.3f) {
|
||||
traceline(origin, org, TRUE, this);
|
||||
if (trace_fraction == 1.0f) {
|
||||
return (TRUE);
|
||||
return (true);
|
||||
}
|
||||
}
|
||||
return (FALSE);
|
||||
return (false);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -158,7 +157,7 @@ NSEntity::Visible
|
|||
Returns whether or not the entity is able to see a given entity
|
||||
============
|
||||
*/
|
||||
bool
|
||||
const bool
|
||||
NSEntity::Visible(entity ent)
|
||||
{
|
||||
vector flDelta;
|
||||
|
@ -180,31 +179,31 @@ NSEntity::Visible(entity ent)
|
|||
return (false);
|
||||
}
|
||||
|
||||
bool
|
||||
const bool
|
||||
NSEntity::HasSpawnFlags(float sf)
|
||||
{
|
||||
return (spawnflags & sf) ? true : false;
|
||||
}
|
||||
|
||||
bool
|
||||
const bool
|
||||
NSEntity::IsOnGround(void)
|
||||
{
|
||||
return (flags & FL_ONGROUND) ? true : false;
|
||||
}
|
||||
|
||||
bool
|
||||
const bool
|
||||
NSEntity::IsSolid(void)
|
||||
{
|
||||
return (solid != SOLID_NOT) ? true : false;
|
||||
}
|
||||
|
||||
entity
|
||||
const entity
|
||||
NSEntity::GetGroundEntity(void)
|
||||
{
|
||||
return groundentity;
|
||||
}
|
||||
|
||||
bool
|
||||
const bool
|
||||
NSEntity::CreatedByMap(void)
|
||||
{
|
||||
return _mapspawned;
|
||||
|
@ -217,7 +216,7 @@ NSEntity::Blocked(entity eBlocker)
|
|||
}
|
||||
|
||||
void
|
||||
NSEntity::BlockedHandler(void)
|
||||
NSEntity::_BlockedHandler(void)
|
||||
{
|
||||
Blocked(other);
|
||||
}
|
||||
|
@ -241,8 +240,11 @@ NSEntity::EndTouch(entity eToucher)
|
|||
}
|
||||
|
||||
void
|
||||
NSEntity::TouchHandler(void)
|
||||
NSEntity::_TouchHandler(void)
|
||||
{
|
||||
if (IsHidden() == true)
|
||||
return;
|
||||
|
||||
#ifdef SERVER
|
||||
if (g_grMode.IsTeamplay())
|
||||
if (m_iTeam > 0i)
|
||||
|
@ -339,18 +341,6 @@ NSEntity::postdraw(void)
|
|||
|
||||
|
||||
#else
|
||||
void
|
||||
NSEntity::Show(void)
|
||||
{
|
||||
alpha = 1.0f;
|
||||
}
|
||||
|
||||
void
|
||||
NSEntity::Hide(void)
|
||||
{
|
||||
alpha = 0.0f;
|
||||
}
|
||||
|
||||
/* Make sure StartFrame calls this */
|
||||
float
|
||||
NSEntity::SendEntity(entity ePEnt, float flChanged)
|
||||
|
@ -461,7 +451,7 @@ NSEntity::ParentUpdate(void)
|
|||
}
|
||||
}
|
||||
|
||||
entity
|
||||
const entity
|
||||
NSEntity::GetParent(void)
|
||||
{
|
||||
return find(world, ::targetname, m_parent);
|
||||
|
@ -499,6 +489,28 @@ NSEntity::ClearAngles(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
NSEntity::SetEffects(float newEffects)
|
||||
{
|
||||
effects = newEffects;
|
||||
}
|
||||
|
||||
void
|
||||
NSEntity::SetFrame(float newFrame)
|
||||
{
|
||||
if (newFrame == frame)
|
||||
return;
|
||||
|
||||
frame = newFrame;
|
||||
frame1time = 0.0f;
|
||||
}
|
||||
|
||||
void
|
||||
NSEntity::SetSkin(float newSkin)
|
||||
{
|
||||
skin = newSkin;
|
||||
}
|
||||
|
||||
void
|
||||
NSEntity::SetOwner(entity newOwner)
|
||||
{
|
||||
|
@ -549,7 +561,11 @@ NSEntity::SetSolid(float newSolid)
|
|||
void
|
||||
NSEntity::SetScale(float newScale)
|
||||
{
|
||||
if (newScale == scale)
|
||||
return;
|
||||
|
||||
scale = newScale;
|
||||
setsize(this, m_vecMins * scale, m_vecMaxs * scale);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -661,130 +677,150 @@ NSEntity::RemoveFlags(float fl)
|
|||
flags &= ~fl;
|
||||
}
|
||||
|
||||
float
|
||||
const vector
|
||||
NSEntity::GetSpawnOrigin(void)
|
||||
{
|
||||
return m_oldOrigin;
|
||||
}
|
||||
|
||||
const vector
|
||||
NSEntity::GetSpawnAngles(void)
|
||||
{
|
||||
return m_oldAngle;
|
||||
}
|
||||
|
||||
const string
|
||||
NSEntity::GetSpawnModel(void)
|
||||
{
|
||||
return m_oldModel;
|
||||
}
|
||||
|
||||
const float
|
||||
NSEntity::GetEffects(void)
|
||||
{
|
||||
return effects;
|
||||
}
|
||||
|
||||
const float
|
||||
NSEntity::GetFrame(void)
|
||||
{
|
||||
return frame;
|
||||
}
|
||||
|
||||
const float
|
||||
NSEntity::GetSkin(void)
|
||||
{
|
||||
return skin;
|
||||
}
|
||||
|
||||
const float
|
||||
NSEntity::GetScale(void)
|
||||
{
|
||||
return scale;
|
||||
}
|
||||
|
||||
entity
|
||||
const entity
|
||||
NSEntity::GetOwner(void)
|
||||
{
|
||||
return owner;
|
||||
}
|
||||
|
||||
vector
|
||||
const vector
|
||||
NSEntity::GetVelocity(void)
|
||||
{
|
||||
return velocity;
|
||||
}
|
||||
|
||||
float
|
||||
const float
|
||||
NSEntity::GetSolid(void)
|
||||
{
|
||||
return solid;
|
||||
}
|
||||
|
||||
string
|
||||
const string
|
||||
NSEntity::GetModel(void)
|
||||
{
|
||||
return model;
|
||||
}
|
||||
|
||||
float
|
||||
const float
|
||||
NSEntity::GetModelindex(void)
|
||||
{
|
||||
return modelindex;
|
||||
}
|
||||
|
||||
float
|
||||
const float
|
||||
NSEntity::GetMovetype(void)
|
||||
{
|
||||
return movetype;
|
||||
}
|
||||
|
||||
float
|
||||
const float
|
||||
NSEntity::GetGravity(void)
|
||||
{
|
||||
return gravity;
|
||||
}
|
||||
|
||||
vector
|
||||
const vector
|
||||
NSEntity::GetAngles(void)
|
||||
{
|
||||
return angles;
|
||||
}
|
||||
|
||||
vector
|
||||
const vector
|
||||
NSEntity::GetAngularVelocity(void)
|
||||
{
|
||||
return avelocity;
|
||||
}
|
||||
|
||||
vector
|
||||
const vector
|
||||
NSEntity::GetOrigin(void)
|
||||
{
|
||||
return origin;
|
||||
}
|
||||
|
||||
vector
|
||||
const vector
|
||||
NSEntity::GetMins(void)
|
||||
{
|
||||
return mins;
|
||||
}
|
||||
|
||||
vector
|
||||
const vector
|
||||
NSEntity::GetMaxs(void)
|
||||
{
|
||||
return maxs;
|
||||
}
|
||||
|
||||
vector
|
||||
const vector
|
||||
NSEntity::GetRealMins(void)
|
||||
{
|
||||
return m_vecMins;
|
||||
}
|
||||
|
||||
vector
|
||||
const vector
|
||||
NSEntity::GetRealMaxs(void)
|
||||
{
|
||||
return m_vecMaxs;
|
||||
}
|
||||
|
||||
vector
|
||||
const vector
|
||||
NSEntity::GetAbsoluteMins(void)
|
||||
{
|
||||
return absmin;
|
||||
}
|
||||
|
||||
vector
|
||||
const vector
|
||||
NSEntity::GetAbsoluteMaxs(void)
|
||||
{
|
||||
return absmax;
|
||||
}
|
||||
|
||||
float
|
||||
const float
|
||||
NSEntity::GetFlags(void)
|
||||
{
|
||||
return flags;
|
||||
}
|
||||
|
||||
vector
|
||||
NSEntity::GetSpawnOrigin(void)
|
||||
{
|
||||
return m_oldOrigin;
|
||||
}
|
||||
vector
|
||||
NSEntity::GetSpawnAngles(void)
|
||||
{
|
||||
return m_oldAngle;
|
||||
}
|
||||
string
|
||||
NSEntity::GetSpawnModel(void)
|
||||
{
|
||||
return m_oldModel;
|
||||
}
|
||||
|
||||
#ifdef SERVER
|
||||
void
|
||||
NSEntity::Respawn(void)
|
||||
|
@ -998,3 +1034,27 @@ NSEntity::Destroy(void)
|
|||
else
|
||||
nextthink = time;
|
||||
}
|
||||
|
||||
void
|
||||
NSEntity::Show(void)
|
||||
{
|
||||
effects &= ~EF_NODRAW;
|
||||
}
|
||||
|
||||
void
|
||||
NSEntity::Hide(void)
|
||||
{
|
||||
effects |= EF_NODRAW;
|
||||
}
|
||||
|
||||
const bool
|
||||
NSEntity::IsHidden(void)
|
||||
{
|
||||
return (effects & EF_NODRAW) ? true : false;
|
||||
}
|
||||
|
||||
void
|
||||
NSEntity::MakeStatic(void)
|
||||
{
|
||||
makestatic(this);
|
||||
}
|
||||
|
|
|
@ -43,28 +43,28 @@ class NSIO
|
|||
string m_strOnUser4;
|
||||
|
||||
/* helper functions to allocate outputs */
|
||||
nonvirtual void(entity, string) UseOutput;
|
||||
nonvirtual string(string, string) PrepareOutput;
|
||||
nonvirtual string(string) CreateOutput;
|
||||
virtual void(entity, string) UseOutput;
|
||||
virtual string(string, string) PrepareOutput;
|
||||
virtual string(string) CreateOutput;
|
||||
|
||||
virtual void(float) Save;
|
||||
virtual void(string,string) Restore;
|
||||
|
||||
/* save game */
|
||||
nonvirtual void(float, string, float) SaveFloat;
|
||||
nonvirtual void(float, string, int) SaveInt;
|
||||
nonvirtual void(float, string, string) SaveString;
|
||||
nonvirtual void(float, string, vector) SaveVector;
|
||||
nonvirtual void(float, string, bool) SaveBool;
|
||||
nonvirtual void(float, string, entity) SaveEntity;
|
||||
virtual void(float, string, float) SaveFloat;
|
||||
virtual void(float, string, int) SaveInt;
|
||||
virtual void(float, string, string) SaveString;
|
||||
virtual void(float, string, vector) SaveVector;
|
||||
virtual void(float, string, bool) SaveBool;
|
||||
virtual void(float, string, entity) SaveEntity;
|
||||
|
||||
/* load game */
|
||||
nonvirtual float(string) ReadFloat;
|
||||
nonvirtual int(string) ReadInt;
|
||||
nonvirtual string(string) ReadString;
|
||||
nonvirtual vector(string) ReadVector;
|
||||
nonvirtual bool(string) ReadBool;
|
||||
nonvirtual entity(string) ReadEntity;
|
||||
virtual float(string) ReadFloat;
|
||||
virtual int(string) ReadInt;
|
||||
virtual string(string) ReadString;
|
||||
virtual vector(string) ReadVector;
|
||||
virtual bool(string) ReadBool;
|
||||
virtual entity(string) ReadEntity;
|
||||
|
||||
/* Handle incoming entities input messaging */
|
||||
virtual void(entity, string, string) Input;
|
||||
|
|
|
@ -253,7 +253,7 @@ class NSMonster:NSNavAI
|
|||
virtual void(string) Sound;
|
||||
virtual void(string, string) SpawnKey;
|
||||
|
||||
virtual bool(void) IsAlive;
|
||||
const bool(void) IsAlive;
|
||||
virtual bool(int) IsFriend;
|
||||
|
||||
/* see/hear subsystem */
|
||||
|
@ -279,15 +279,15 @@ class NSMonster:NSNavAI
|
|||
virtual float(void) MeleeMaxDistance;
|
||||
virtual bool(void) MeleeCondition;
|
||||
|
||||
virtual bool(entity enemy) IsValidEnemy;
|
||||
const bool(entity enemy) IsValidEnemy;
|
||||
|
||||
/* sequences */
|
||||
virtual void(void) FreeState;
|
||||
virtual void(void) FreeStateMoved;
|
||||
virtual void(void) RouteEnded;
|
||||
virtual void(void) WalkRoute;
|
||||
virtual int(void) GetSequenceState;
|
||||
virtual bool(void) InSequence;
|
||||
const int(void) GetSequenceState;
|
||||
const bool(void) InSequence;
|
||||
|
||||
/* animation cycles */
|
||||
float m_flAnimTime;
|
||||
|
@ -296,15 +296,15 @@ class NSMonster:NSNavAI
|
|||
virtual int(void) AnimRun;
|
||||
virtual void(float) AnimPlay;
|
||||
virtual void(void) AnimationUpdate;
|
||||
virtual bool(void) InAnimation;
|
||||
const bool(void) InAnimation;
|
||||
|
||||
/* states */
|
||||
virtual void(monsterState_t, monsterState_t) StateChanged;
|
||||
virtual void(monsterState_t) SetState;
|
||||
virtual monsterState_t(void) GetState;
|
||||
const monsterState_t(void) GetState;
|
||||
|
||||
/* TriggerTarget/Condition */
|
||||
virtual int(void) GetTriggerCondition;
|
||||
const int(void) GetTriggerCondition;
|
||||
virtual void(void) TriggerTargets;
|
||||
|
||||
virtual float(entity, float) SendEntity;
|
||||
|
|
|
@ -27,7 +27,7 @@ NSMonster::NSMonster(void)
|
|||
}
|
||||
|
||||
#ifdef SERVER
|
||||
int
|
||||
const int
|
||||
NSMonster::GetTriggerCondition(void)
|
||||
{
|
||||
return m_iTriggerCondition;
|
||||
|
@ -185,7 +185,7 @@ NSMonster::AnimPlay(float seq)
|
|||
m_flAnimTime = time + frameduration(modelindex, frame);
|
||||
}
|
||||
|
||||
bool
|
||||
const bool
|
||||
NSMonster::InAnimation(void)
|
||||
{
|
||||
return (m_flAnimTime > time) ? true : false;
|
||||
|
@ -272,7 +272,7 @@ NSMonster::AlertNearby(void)
|
|||
}
|
||||
|
||||
/* returns TRUE if 'enemy' should be considered a valid target for killing */
|
||||
bool
|
||||
const bool
|
||||
NSMonster::IsValidEnemy(entity enemy)
|
||||
{
|
||||
if (enemy == __NULL__)
|
||||
|
@ -618,7 +618,7 @@ NSMonster::AnimationUpdate(void)
|
|||
}
|
||||
|
||||
/* for an NSMonster, health doesn't matter that much, as we could be a corpse */
|
||||
bool
|
||||
const bool
|
||||
NSMonster::IsAlive(void)
|
||||
{
|
||||
if (GetState() == MONSTER_DEAD)
|
||||
|
@ -645,19 +645,19 @@ NSMonster::SetState(monsterState_t newState)
|
|||
StateChanged(m_iOldMState, m_iMState);
|
||||
}
|
||||
|
||||
monsterState_t
|
||||
const monsterState_t
|
||||
NSMonster::GetState(void)
|
||||
{
|
||||
return m_iMState;
|
||||
}
|
||||
|
||||
int
|
||||
const int
|
||||
NSMonster::GetSequenceState(void)
|
||||
{
|
||||
return m_iSequenceState;
|
||||
}
|
||||
|
||||
bool
|
||||
const bool
|
||||
NSMonster::InSequence(void)
|
||||
{
|
||||
return (GetSequenceState() == SEQUENCESTATE_NONE) ? false : true;
|
||||
|
|
|
@ -39,8 +39,8 @@ NSNavAI:NSSurfacePropEntity
|
|||
/* methods we'd like others to override */
|
||||
virtual bool(void) CanCrouch;
|
||||
|
||||
virtual vector(void) GetRouteMovevalues;
|
||||
virtual vector(void) GetRouteDirection;
|
||||
const vector(void) GetRouteMovevalues;
|
||||
const vector(void) GetRouteDirection;
|
||||
|
||||
virtual void(void) RouteEnded;
|
||||
virtual void(void) RouteClear;
|
||||
|
|
|
@ -186,7 +186,7 @@ NSNavAI::CheckRoute(void)
|
|||
}*/
|
||||
}
|
||||
|
||||
vector
|
||||
const vector
|
||||
NSNavAI::GetRouteMovevalues(void)
|
||||
{
|
||||
vector vecDirection;
|
||||
|
@ -203,7 +203,7 @@ NSNavAI::GetRouteMovevalues(void)
|
|||
return [v_forward * vecDirection, v_right * vecDirection, v_up * vecDirection];
|
||||
}
|
||||
|
||||
vector
|
||||
const vector
|
||||
NSNavAI::GetRouteDirection(void)
|
||||
{
|
||||
if (!m_iNodes)
|
||||
|
|
|
@ -117,15 +117,6 @@ class NSRenderableEntity:NSEntity
|
|||
/* model events */
|
||||
float m_flBaseTime;
|
||||
|
||||
#ifdef SERVER
|
||||
virtual void(void) Show;
|
||||
virtual void(void) Hide;
|
||||
#endif
|
||||
nonvirtual void(float) SetEffects;
|
||||
nonvirtual void(float) SetFrame;
|
||||
nonvirtual void(float) SetSkin;
|
||||
nonvirtual void(int) SetBody;
|
||||
nonvirtual void(float) SetScale;
|
||||
virtual void(void) MakeStatic;
|
||||
|
||||
PREDICTED_FLOAT(m_iRenderFX);
|
||||
|
@ -134,28 +125,30 @@ class NSRenderableEntity:NSEntity
|
|||
PREDICTED_VECTOR(m_vecRenderColor);
|
||||
|
||||
/* set */
|
||||
nonvirtual void(float) SetRenderFX;
|
||||
nonvirtual void(float) SetRenderMode;
|
||||
nonvirtual void(float) SetRenderAmt;
|
||||
nonvirtual void(vector) SetRenderColor;
|
||||
nonvirtual void(float) SetBoneControl1;
|
||||
nonvirtual void(float) SetBoneControl2;
|
||||
nonvirtual void(float) SetBoneControl3;
|
||||
nonvirtual void(float) SetBoneControl4;
|
||||
nonvirtual void(float) SetBoneControl5;
|
||||
virtual void(int) SetBody;
|
||||
virtual void(float) SetRenderFX;
|
||||
virtual void(float) SetRenderMode;
|
||||
virtual void(float) SetRenderAmt;
|
||||
virtual void(vector) SetRenderColor;
|
||||
virtual void(float) SetBoneControl1;
|
||||
virtual void(float) SetBoneControl2;
|
||||
virtual void(float) SetBoneControl3;
|
||||
virtual void(float) SetBoneControl4;
|
||||
virtual void(float) SetBoneControl5;
|
||||
|
||||
nonvirtual float(void) GetRenderMode;
|
||||
nonvirtual float(void) GetRenderFX;
|
||||
nonvirtual float(void) GetRenderAmt;
|
||||
nonvirtual vector(void) GetRenderColor;
|
||||
nonvirtual float(void) GetBoneControl1;
|
||||
nonvirtual float(void) GetBoneControl2;
|
||||
nonvirtual float(void) GetBoneControl3;
|
||||
nonvirtual float(void) GetBoneControl4;
|
||||
nonvirtual float(void) GetBoneControl5;
|
||||
const int(void) GetBody;
|
||||
const float(void) GetRenderMode;
|
||||
const float(void) GetRenderFX;
|
||||
const float(void) GetRenderAmt;
|
||||
const vector(void) GetRenderColor;
|
||||
const float(void) GetBoneControl1;
|
||||
const float(void) GetBoneControl2;
|
||||
const float(void) GetBoneControl3;
|
||||
const float(void) GetBoneControl4;
|
||||
const float(void) GetBoneControl5;
|
||||
|
||||
#ifdef CLIENT
|
||||
nonvirtual void(void) RenderFXPass;
|
||||
virtual void(void) RenderFXPass;
|
||||
#else
|
||||
/* respawn */
|
||||
float m_oldiRenderFX;
|
||||
|
|
|
@ -493,7 +493,7 @@ only to relevant child-classes
|
|||
float
|
||||
NSRenderableEntity::predraw(void)
|
||||
{
|
||||
if (!modelindex) {
|
||||
if (GetModelindex() == 0 || IsHidden()) {
|
||||
return (PREDRAW_NEXT);
|
||||
}
|
||||
|
||||
|
@ -538,61 +538,14 @@ NSRenderableEntity::Respawn(void)
|
|||
SetRenderAmt(m_oldflRenderAmt);
|
||||
SetRenderColor(m_oldvecRenderColor);
|
||||
}
|
||||
|
||||
void
|
||||
NSRenderableEntity::Show(void)
|
||||
{
|
||||
/* this needs to be more useful */
|
||||
}
|
||||
|
||||
void
|
||||
NSRenderableEntity::Hide(void)
|
||||
{
|
||||
SetModelindex(0);
|
||||
SetSolid(SOLID_NOT);
|
||||
SetMovetype(MOVETYPE_NONE);
|
||||
takedamage = DAMAGE_NO;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
NSRenderableEntity::SetEffects(float newEffects)
|
||||
{
|
||||
effects = newEffects;
|
||||
}
|
||||
|
||||
void
|
||||
NSRenderableEntity::SetFrame(float newFrame)
|
||||
{
|
||||
if (newFrame == frame)
|
||||
return;
|
||||
|
||||
frame = newFrame;
|
||||
frame1time = 0.0f;
|
||||
}
|
||||
|
||||
void
|
||||
NSRenderableEntity::SetSkin(float newSkin)
|
||||
{
|
||||
skin = newSkin;
|
||||
}
|
||||
|
||||
void
|
||||
NSRenderableEntity::SetBody(int newBody)
|
||||
{
|
||||
m_iBody = newBody;
|
||||
}
|
||||
|
||||
void
|
||||
NSRenderableEntity::SetScale(float newScale)
|
||||
{
|
||||
if (newScale == scale)
|
||||
return;
|
||||
|
||||
scale = newScale;
|
||||
setsize(this, m_vecMins * scale, m_vecMaxs * scale);
|
||||
}
|
||||
|
||||
void
|
||||
NSRenderableEntity::SetRenderFX(float newFX)
|
||||
{
|
||||
|
@ -647,55 +600,61 @@ NSRenderableEntity::SetBoneControl5(float val)
|
|||
m_flBoneControl5 = val;
|
||||
}
|
||||
|
||||
float
|
||||
const int
|
||||
NSRenderableEntity::GetBody(void)
|
||||
{
|
||||
return m_iBody;
|
||||
}
|
||||
|
||||
const float
|
||||
NSRenderableEntity::GetRenderMode(void)
|
||||
{
|
||||
return m_iRenderMode;
|
||||
}
|
||||
|
||||
float
|
||||
const float
|
||||
NSRenderableEntity::GetRenderFX(void)
|
||||
{
|
||||
return m_iRenderFX;
|
||||
}
|
||||
|
||||
float
|
||||
const float
|
||||
NSRenderableEntity::GetRenderAmt(void)
|
||||
{
|
||||
return m_flRenderAmt;
|
||||
}
|
||||
|
||||
vector
|
||||
const vector
|
||||
NSRenderableEntity::GetRenderColor(void)
|
||||
{
|
||||
return m_vecRenderColor;
|
||||
}
|
||||
|
||||
float
|
||||
const float
|
||||
NSRenderableEntity::GetBoneControl1(void)
|
||||
{
|
||||
return m_flBoneControl1;
|
||||
}
|
||||
|
||||
float
|
||||
const float
|
||||
NSRenderableEntity::GetBoneControl2(void)
|
||||
{
|
||||
return m_flBoneControl2;
|
||||
}
|
||||
|
||||
float
|
||||
const float
|
||||
NSRenderableEntity::GetBoneControl3(void)
|
||||
{
|
||||
return m_flBoneControl3;
|
||||
}
|
||||
|
||||
float
|
||||
const float
|
||||
NSRenderableEntity::GetBoneControl4(void)
|
||||
{
|
||||
return m_flBoneControl4;
|
||||
}
|
||||
|
||||
float
|
||||
const float
|
||||
NSRenderableEntity::GetBoneControl5(void)
|
||||
{
|
||||
return m_flBoneControl5;
|
||||
|
|
|
@ -75,9 +75,9 @@ class NSSurfacePropEntity:NSRenderableEntity
|
|||
/* I/O */
|
||||
string m_strOnBreak;
|
||||
|
||||
nonvirtual void(entity, float, int) Ignite;
|
||||
nonvirtual void(void) Extinguish;
|
||||
nonvirtual bool(void) IsOnFire;
|
||||
virtual void(entity, float, int) Ignite;
|
||||
virtual void(void) Extinguish;
|
||||
virtual bool(void) IsOnFire;
|
||||
|
||||
/* life, death */
|
||||
float m_oldHealth;
|
||||
|
@ -86,27 +86,27 @@ class NSSurfacePropEntity:NSRenderableEntity
|
|||
virtual bool(void) IsAlive;
|
||||
|
||||
/* Generic Damage */
|
||||
nonvirtual void(float) SetTakedamage;
|
||||
nonvirtual void(float) SetHealth;
|
||||
nonvirtual void(float) SetMaxHealth;
|
||||
nonvirtual float(void) GetHealth;
|
||||
nonvirtual float(void) GetMaxHealth;
|
||||
virtual void(float) SetTakedamage;
|
||||
virtual void(float) SetHealth;
|
||||
virtual void(float) SetMaxHealth;
|
||||
virtual float(void) GetHealth;
|
||||
virtual float(void) GetMaxHealth;
|
||||
|
||||
/* Surface/PropKit */
|
||||
int m_iMaterial;
|
||||
int m_iPropData;
|
||||
nonvirtual float(void) GetSpawnHealth;
|
||||
nonvirtual bool(void) HasPropData;
|
||||
nonvirtual __variant(int) GetPropData;
|
||||
nonvirtual bool(void) HasSurfaceData;
|
||||
nonvirtual __variant(int) GetSurfaceData;
|
||||
virtual float(void) GetSpawnHealth;
|
||||
virtual bool(void) HasPropData;
|
||||
virtual __variant(int) GetPropData;
|
||||
virtual bool(void) HasSurfaceData;
|
||||
virtual __variant(int) GetSurfaceData;
|
||||
|
||||
string m_strSurfData;
|
||||
string m_strPropData;
|
||||
nonvirtual void(string) SetSurfaceData;
|
||||
nonvirtual void(string) SetPropData;
|
||||
nonvirtual void(void) SurfaceDataFinish;
|
||||
nonvirtual void(void) PropDataFinish;
|
||||
virtual void(string) SetSurfaceData;
|
||||
virtual void(string) SetPropData;
|
||||
virtual void(void) SurfaceDataFinish;
|
||||
virtual void(void) PropDataFinish;
|
||||
#endif
|
||||
|
||||
/* misc 'being' methods */
|
||||
|
|
|
@ -70,6 +70,7 @@ string __fullspawndata;
|
|||
#include "NSMaterial.h"
|
||||
#include "damage.h"
|
||||
#include "flags.h"
|
||||
#include "effects.h"
|
||||
#include "entities.h"
|
||||
#include "events.h"
|
||||
#include "flags.h"
|
||||
|
|
26
src/shared/effects.h
Normal file
26
src/shared/effects.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
|
||||
/* engine reserved */
|
||||
#define EF_BRIGHTFIELD (1<<0)
|
||||
#define EF_MUZZLEFLASH (1<<1)
|
||||
#define EF_BRIGHTLIGHT (1<<2)
|
||||
#define EF_DIMLIGHT (1<<3)
|
||||
#define EF_NODRAW (1<<4)
|
||||
#define EF_ADDITIVE (1<<5)
|
||||
#define EF_BLUE (1<<6)
|
||||
#define EF_RED (1<<7)
|
||||
#define EF_UNUSED1 (1<<8)
|
||||
#define EF_FULLBRIGHT (1<<9)
|
||||
#define EF_UNUSED2 (1<<10)
|
||||
#define EF_UNUSED3 (1<<11)
|
||||
#define EF_NOSHADOW (1<<12)
|
||||
#define EF_NODEPTHTEST (1<<13)
|
||||
#define EF_UNUSED4 (1<<14)
|
||||
#define EF_UNUSED5 (1<<15)
|
||||
#define EF_UNUSED6 (1<<16)
|
||||
#define EF_UNUSED7 (1<<17)
|
||||
#define EF_UNUSED8 (1<<18)
|
||||
#define EF_UNUSED9 (1<<19)
|
||||
#define EF_UNUSED10 (1<<20)
|
||||
#define EF_UNUSED11 (1<<21)
|
||||
#define EF_UNUSED12 (1<<22)
|
||||
#define EF_UNUSED13 (1<<23)
|
Loading…
Reference in a new issue