GS-EntBase: Added a ton more Save/Restore functions for many core entities.

Player entity is also getting save/restored now.
This commit is contained in:
Marco Cawthorne 2021-10-28 04:29:11 +02:00
parent 98c234da48
commit 5bf3545e69
Signed by: eukara
GPG Key ID: C196CD8BA993248A
42 changed files with 1526 additions and 60 deletions

View File

@ -67,14 +67,61 @@ class ambient_generic:NSPointTrigger
int m_iLoop;
void(void) ambient_generic;
virtual void(void) Respawn;
virtual void(entity, int) UseNormal;
virtual void(entity, int) UseLoop;
/* overrides */
virtual void(float) Save;
virtual void(string, string) Restore;
virtual float(entity, float) SendEntity;
virtual void(string, string) SpawnKey;
virtual void(void) Respawn;
virtual void(entity, int) UseNormal;
virtual void(entity, int) UseLoop;
};
void
ambient_generic::Save(float handle)
{
SaveInt(handle, "loop", m_iLoop);
SaveInt(handle, "toggleswitch", m_iToggleSwitch);
SaveFloat(handle, "pitch", m_flPitch);
SaveFloat(handle, "radius", m_flRadius);
SaveFloat(handle, "volume", m_flVolume);
SaveString(handle, "soundpath", m_strSoundPath);
SaveString(handle, "activepath", m_strActivePath);
super::Save(handle);
}
void
ambient_generic::Restore(string strKey, string strValue)
{
switch (strKey) {
case "loop":
m_iLoop = ReadInt(strValue);
break;
case "toggleswitch":
m_iToggleSwitch = ReadInt(strValue);
break;
case "pitch":
m_flPitch = ReadFloat(strValue);
break;
case "radius":
m_flRadius = ReadFloat(strValue);
break;
case "volume":
m_flVolume = ReadFloat(strValue);
break;
case "soundpath":
m_strSoundPath = ReadString(strValue);
break;
case "activepath":
m_strActivePath = ReadString(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
float
ambient_generic::SendEntity(entity ePEnt, float fChanged)
{

View File

@ -51,10 +51,37 @@ class env_explosion:NSPointTrigger
float m_flMaxDelay;
void(void) env_explosion;
/* overrides */
virtual void(float) Save;
virtual void(string,string) Restore;
virtual void(entity, int) Trigger;
virtual void(string, string) SpawnKey;
};
void
env_explosion::Save(float handle)
{
SaveInt(handle, "magnitude", m_iMagnitude);
SaveFloat(handle, "max_delay", m_flMaxDelay);
super::Save(handle);
}
void
env_explosion::Restore(string strKey, string strValue)
{
switch (strKey) {
case "magnitude":
m_iMagnitude = ReadInt(strValue);
break;
case "max_delay":
m_flMaxDelay = ReadFloat(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
env_explosion::Trigger(entity act, int state)
{

View File

@ -48,10 +48,37 @@ class env_fade:NSRenderableEntity
float m_flFadeHold;
void(void) env_fade;
/* overrides */
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(entity, int) Trigger;
virtual void(string, string) SpawnKey;
};
void
env_fade::Save(float handle)
{
SaveFloat(handle, "fade_duration", m_flFadeDuration);
SaveFloat(handle, "hold", m_flFadeHold);
super::Save(handle);
}
void
env_fade::Restore(string strKey, string strValue)
{
switch (strKey) {
case "fade_duration":
m_flFadeDuration = ReadFloat(strValue);
break;
case "hold":
m_flFadeHold = ReadFloat(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
env_fade::Trigger(entity act, int state)
{

View File

@ -127,16 +127,52 @@ class func_breakable:NSSurfacePropEntity
int m_pressDamage;*/
void(void) func_breakable;
/* overrides */
virtual void(void) Respawn;
virtual void(void) Explode;
virtual void(entity, int) Trigger;
virtual void(void) PlayerTouch;
/*virtual void(void) PressureDeath;*/
virtual void(void) Pain;
virtual void(void) Death;
virtual void(string, string) SpawnKey;
virtual void(entity, int) Trigger;
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(void) Explode;
virtual void(void) PlayerTouch;
/*virtual void(void) PressureDeath;*/
};
void
func_breakable::Save(float handle)
{
SaveFloat(handle, "delay", m_flDelay);
SaveFloat(handle, "explode_mag", m_flExplodeMag);
SaveFloat(handle, "explode_rad", m_flExplodeRad);
SaveString(handle, "breakspawn", m_strBreakSpawn);
super::Save(handle);
}
void
func_breakable::Restore(string strKey, string strValue)
{
switch (strKey) {
case "delay":
m_flDelay = ReadFloat(strValue);
break;
case "explode_mag":
m_flExplodeMag = ReadFloat(strValue);
break;
case "explode_rad":
m_flExplodeRad = ReadFloat(strValue);
break;
case "breakspawn":
m_strBreakSpawn = ReadString(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
func_breakable::Pain(void)
{

View File

@ -40,13 +40,57 @@ class func_healthcharger:NSRenderableEntity
string m_strSndDone;
void(void) func_healthcharger;
virtual void(void) customphysics;
virtual void(void) OnPlayerUse;
/* overrides */
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(string, string) SpawnKey;
virtual void(void) ResetHealth;
virtual void(void) customphysics;
virtual void(void) Respawn;
virtual void(void) OnPlayerUse;
virtual void(void) ResetHealth;
};
void
func_healthcharger::Save(float handle)
{
SaveFloat(handle, "user", num_for_edict(m_eUser));
SaveFloat(handle, "delay", m_flDelay);
SaveFloat(handle, "check", m_flCheck);
SaveString(handle, "snd_first", m_strSndFirst);
SaveString(handle, "snd_charging", m_strSndCharging);
SaveString(handle, "snd_done", m_strSndDone);
super::Save(handle);
}
void
func_healthcharger::Restore(string strKey, string strValue)
{
switch (strKey) {
case "user":
m_eUser = edict_num(ReadFloat(strValue));
break;
case "delay":
m_flDelay = ReadFloat(strValue);
break;
case "check":
m_flCheck = ReadFloat(strValue);
break;
case "snd_first":
m_strSndFirst = ReadString(strValue);
break;
case "snd_charging":
m_strSndCharging = ReadString(strValue);
break;
case "snd_done":
m_strSndDone = ReadString(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
func_healthcharger::ResetHealth(void)
{

View File

@ -40,13 +40,57 @@ class func_recharge:NSRenderableEntity
string m_strSndDone;
void(void) func_recharge;
virtual void(void) customphysics;
virtual void(void) OnPlayerUse;
/* overrides */
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(string, string) SpawnKey;
virtual void(void) ResetHealth;
virtual void(void) customphysics;
virtual void(void) Respawn;
virtual void(void) OnPlayerUse;
virtual void(void) ResetHealth;
};
void
func_recharge::Save(float handle)
{
SaveFloat(handle, "user", num_for_edict(m_eUser));
SaveFloat(handle, "delay", m_flDelay);
SaveFloat(handle, "check", m_flCheck);
SaveString(handle, "snd_first", m_strSndFirst);
SaveString(handle, "snd_charging", m_strSndCharging);
SaveString(handle, "snd_done", m_strSndDone);
super::Save(handle);
}
void
func_recharge::Restore(string strKey, string strValue)
{
switch (strKey) {
case "user":
m_eUser = edict_num(ReadFloat(strValue));
break;
case "delay":
m_flDelay = ReadFloat(strValue);
break;
case "check":
m_flCheck = ReadFloat(strValue);
break;
case "snd_first":
m_strSndFirst = ReadString(strValue);
break;
case "snd_charging":
m_strSndCharging = ReadString(strValue);
break;
case "snd_done":
m_strSndDone = ReadString(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
func_recharge::ResetHealth(void)
{

View File

@ -64,26 +64,69 @@ class func_rot_button:NSRenderableEntity
{
vector m_vecMoveAngle;
int m_iState;
int m_iHealth;
float m_flSpeed;
float m_flDistance;
float m_flReturnTime;
int m_iHealth;
void(void) func_rot_button;
/* overrides */
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(string, string) SpawnKey;
virtual void(void) touch;
virtual void(void) Respawn;
virtual void(void) Death;
virtual void(void) ArrivedClosed;
virtual void(void) ArrivedOpened;
virtual void(void) TriggerTargets;
virtual void(vector, void()) Rotate;
virtual void(void) TurnToggle;
virtual void(void) OnPlayerUse;
virtual void(void) Respawn;
virtual void(void) Death;
virtual void(void) touch;
virtual void(string, string) SpawnKey;
};
void
func_rot_button::Save(float handle)
{
SaveVector(handle, "moveangle", m_vecMoveAngle);
SaveInt(handle, "state", m_iState);
SaveInt(handle, "health", m_iHealth);
SaveFloat(handle, "speed", m_flSpeed);
SaveFloat(handle, "distance", m_flDistance);
SaveFloat(handle, "returntime", m_flReturnTime);
super::Save(handle);
}
void
func_rot_button::Restore(string strKey, string strValue)
{
switch (strKey) {
case "moveangle":
m_vecMoveAngle = ReadVector(strValue);
break;
case "state":
m_iState = ReadInt(strValue);
break;
case "health":
m_iHealth = ReadInt(strValue);
break;
case "speed":
m_flSpeed = ReadFloat(strValue);
break;
case "distance":
m_flDistance = ReadFloat(strValue);
break;
case "returntime":
m_flReturnTime = ReadFloat(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
func_rot_button::TriggerTargets(void)
{

View File

@ -71,14 +71,50 @@ class func_rotating:NSRenderableEntity
float m_flDir;
void(void) func_rotating;
/* overrides */
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(void) Respawn;
virtual void(entity, int) Trigger;
virtual void(string, string) SpawnKey;
virtual void(void) Rotate;
virtual void(void) Blocked;
virtual void(void) SetMovementDirection;
virtual void(string, string) SpawnKey;
};
void
func_rotating::Save(float handle)
{
SaveVector(handle, "movedir", m_vecMoveDir);
SaveFloat(handle, "speed", m_flSpeed);
SaveFloat(handle, "damage", m_flDamage);
SaveFloat(handle, "dir", m_flDir);
super::Save(handle);
}
void
func_rotating::Restore(string strKey, string strValue)
{
switch (strKey) {
case "movedir":
m_vecMoveDir = ReadVector(strValue);
break;
case "speed":
m_flSpeed = ReadFloat(strValue);
break;
case "damage":
m_flDamage = ReadFloat(strValue);
break;
case "dir":
m_flDir = ReadFloat(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
func_rotating::Rotate(void)
{

View File

@ -50,7 +50,7 @@ enumflags
TRAIN_NOTSOLID
};
class func_tracktrain:NSBrushTrigger
class func_tracktrain:NSRenderableEntity
{
float m_flWait;
float m_flSpeed;
@ -61,17 +61,64 @@ class func_tracktrain:NSBrushTrigger
string m_strStopSnd;
void(void) func_tracktrain;
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(entity, int) Trigger;
virtual void(void) Respawn;
virtual void(string, string) SpawnKey;
virtual void(void) SoundMove;
virtual void(void) SoundStop;
virtual void(void) AfterSpawn;
virtual void(void) PathNext;
virtual void(void) PathMove;
virtual void(entity, int) Trigger;
virtual void(void) Respawn;
virtual void(void) Blocked;
virtual void(string, string) SpawnKey;
};
void
func_tracktrain::Save(float handle)
{
SaveFloat(handle, "wait", m_flWait);
SaveFloat(handle, "speed", m_flSpeed);
SaveFloat(handle, "damage", m_flDamage);
SaveFloat(handle, "height", m_flHeight);
SaveFloat(handle, "startspeed", m_flStartSpeed);
SaveString(handle, "snd_move", m_strMoveSnd);
SaveString(handle, "snd_stop", m_strStopSnd);
super::Save(handle);
}
void
func_tracktrain::Restore(string strKey, string strValue)
{
switch (strKey) {
case "wait":
m_flWait = ReadFloat(strValue);
break;
case "speed":
m_flSpeed = ReadFloat(strValue);
break;
case "damage":
m_flDamage = ReadFloat(strValue);
break;
case "height":
m_flHeight = ReadFloat(strValue);
break;
case "startspeed":
m_flStartSpeed = ReadFloat(strValue);
break;
case "snd_move":
m_strMoveSnd = ReadString(strValue);
break;
case "snd_stop":
m_strStopSnd = ReadString(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
func_tracktrain::Blocked(void)
{
@ -284,7 +331,7 @@ func_tracktrain::func_tracktrain(void)
{
/* FIXME: This is all decided by the first path_corner pretty much */
m_flSpeed = 100;
super::NSBrushTrigger();
super::NSRenderableEntity();
if (m_strMoveSnd)
Sound_Precache(m_strMoveSnd);

View File

@ -63,17 +63,57 @@ class func_train:NSRenderableEntity
string m_strStopSnd;
void(void) func_train;
/* overrides */
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(entity, int) Trigger;
virtual void(void) Respawn;
virtual void(string, string) SpawnKey;
virtual void(void) SoundMove;
virtual void(void) SoundStop;
virtual void(void) AfterSpawn;
virtual void(void) PathNext;
virtual void(void) PathMove;
virtual void(entity, int) Trigger;
virtual void(void) Respawn;
virtual void(void) Blocked;
virtual void(string, string) SpawnKey;
};
void
func_train::Save(float handle)
{
SaveFloat(handle, "wait", m_flWait);
SaveFloat(handle, "speed", m_flSpeed);
SaveFloat(handle, "damage", m_flDamage);
SaveString(handle, "snd_move", m_strMoveSnd);
SaveString(handle, "snd_stop", m_strStopSnd);
super::Save(handle);
}
void
func_train::Restore(string strKey, string strValue)
{
switch (strKey) {
case "wait":
m_flWait = ReadFloat(strValue);
break;
case "speed":
m_flSpeed = ReadFloat(strValue);
break;
case "damage":
m_flDamage = ReadFloat(strValue);
break;
case "snd_move":
m_strMoveSnd = ReadString(strValue);
break;
case "snd_stop":
m_strStopSnd = ReadString(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
func_train::Blocked(void)
{

View File

@ -38,11 +38,37 @@ class func_wall_toggle:NSRenderableEntity
int m_iVisible;
void(void) func_wall_toggle;
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(void) Respawn;
virtual void(entity, int) Trigger;
virtual void(entity, string, string) Input;
};
void
func_wall_toggle::Save(float handle)
{
SaveInt(handle, "old_modelindex", m_oldmodelindex);
SaveInt(handle, "visible", m_iVisible);
super::Save(handle);
}
void
func_wall_toggle::Restore(string strKey, string strValue)
{
switch (strKey) {
case "old_modelindex":
m_oldmodelindex = ReadInt(strValue);
break;
case "visible":
m_iVisible = ReadInt(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
func_wall_toggle::Trigger(entity act, int state)
{

View File

@ -49,11 +49,33 @@ class game_player_equip:NSPointTrigger
void(void) game_player_equip;
virtual void(string, vector) SpawnUnit;
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(entity, int) Trigger;
virtual void(string, string) SpawnKey;
virtual void(string, vector) SpawnUnit;
};
void
game_player_equip::Save(float handle)
{
SaveString(handle, "buffer", m_strBuffer);
super::Save(handle);
}
void
game_player_equip::Restore(string strKey, string strValue)
{
switch (strKey) {
case "buffer":
m_strBuffer = ReadString(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
game_player_equip::SpawnUnit(string cname, vector org)
{

View File

@ -48,24 +48,82 @@ enumflags
class game_text:NSPointTrigger
{
float m_flPosX;
float m_flPosY;
int m_iEffect;
vector m_vecColor1;
vector m_vecColor2;
float m_flPosX;
float m_flPosY;
float m_flFadeIn;
float m_flFadeOut;
float m_flHoldTime;
float m_flFXTime;
int m_iChannel;
int m_iEffect;
void(void) game_text;
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(entity, int) Trigger;
virtual void(string, string) SpawnKey;
};
void game_text::Trigger(entity act, int state)
void
game_text::Save(float handle)
{
SaveVector(handle, "color1", m_vecColor1);
SaveVector(handle, "color2", m_vecColor2);
SaveFloat(handle, "pos_x", m_flPosX);
SaveFloat(handle, "pos_y", m_flPosY);
SaveFloat(handle, "fade_in", m_flFadeIn);
SaveFloat(handle, "fade_out", m_flFadeOut);
SaveFloat(handle, "hold_time", m_flHoldTime);
SaveFloat(handle, "fx_time", m_flFXTime);
SaveInt(handle, "channel", m_iChannel);
SaveInt(handle, "effect", m_iEffect);
super::Save(handle);
}
void
game_text::Restore(string strKey, string strValue)
{
switch (strKey) {
case "color1":
m_vecColor1 = ReadVector(strValue);
break;
case "color2":
m_vecColor2 = ReadVector(strValue);
break;
case "pos_x":
m_flPosX = ReadFloat(strValue);
break;
case "pos_y":
m_flPosY = ReadFloat(strValue);
break;
case "fade_in":
m_flFadeIn = ReadFloat(strValue);
break;
case "fade_out":
m_flFadeOut = ReadFloat(strValue);
break;
case "hold_time":
m_flHoldTime = ReadFloat(strValue);
break;
case "fx_time":
m_flFXTime = ReadFloat(strValue);
break;
case "channel":
m_iChannel = ReadInt(strValue);
break;
case "effect":
m_iEffect = ReadInt(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
game_text::Trigger(entity act, int state)
{
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EV_TEXT);
@ -133,7 +191,8 @@ game_text::SpawnKey(string strKey, string strValue)
}
}
void game_text::game_text(void)
void
game_text::game_text(void)
{
super::NSPointTrigger();
}

View File

@ -39,16 +39,40 @@ This entity was introduced in Half-Life (1998).
class infodecal:NSPointTrigger
{
decal m_decChild;
string m_strTexture;
void(void) infodecal;
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(entity, int) Trigger;
virtual void(void) Respawn;
virtual void(string, string) SpawnKey;
};
void
infodecal::Save(float handle)
{
SaveFloat(handle, "child", num_for_edict(m_decChild));
SaveString(handle, "texture", m_strTexture);
super::Save(handle);
}
void
infodecal::Restore(string strKey, string strValue)
{
switch (strKey) {
case "child":
m_decChild = edict_num(ReadFloat(strValue));
break;
case "texture":
m_strTexture = ReadString(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
infodecal::Trigger(entity act, int state)
{

View File

@ -100,17 +100,56 @@ This entity was introduced in Nuclide (2021).
class light:NSPointTrigger
{
int m_iEnabled;
int m_iStartActive;
float m_flStyle;
float m_flSwitchStyle;
string m_strPattern;
int m_iStartActive;
void(void) light;
/* overrides */
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(entity, int) Trigger;
virtual void(void) Respawn;
virtual void(string, string) SpawnKey;
};
void
light::Save(float handle)
{
SaveInt(handle, "enabled", m_iEnabled);
SaveInt(handle, "start_active", m_iStartActive);
SaveFloat(handle, "style", m_flStyle);
SaveFloat(handle, "switch_style", m_flSwitchStyle);
SaveString(handle, "pattern", m_strPattern);
super::Save(handle);
}
void
light::Restore(string strKey, string strValue)
{
switch (strKey) {
case "enabled":
m_iEnabled = ReadInt(strValue);
break;
case "start_active":
m_iStartActive = ReadInt(strValue);
break;
case "style":
m_flStyle = ReadFloat(strValue);
break;
case "switch_style":
m_flSwitchStyle = ReadFloat(strValue);
break;
case "pattern":
m_strPattern = ReadString(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
light::Trigger(entity act, int state)
{

View File

@ -17,7 +17,6 @@
class CBaseMomentary:NSRenderableEntity
{
entity m_eUser;
float m_flProgress;
vector m_vecMoveDir;
vector m_vecPos1;
vector m_vecPos2;
@ -29,9 +28,62 @@ class CBaseMomentary:NSRenderableEntity
float m_flReturnspeed;
void(void) CBaseMomentary;
/* overrides */
virtual void(float) Save;
virtual void(string, string) Restore;
};
void CBaseMomentary::CBaseMomentary(void)
void
CBaseMomentary::Save(float handle)
{
SaveFloat(handle, "user", num_for_edict(m_eUser));
SaveVector(handle, "move_dir", m_vecMoveDir);
SaveVector(handle, "pos1", m_vecPos1);
SaveVector(handle, "pos2", m_vecPos2);
SaveFloat(handle, "distance", m_flDistance);
SaveFloat(handle, "progress", m_flProgress);
SaveFloat(handle, "speed", m_flSpeed);
SaveFloat(handle, "returnspeed", m_flReturnspeed);
super::Save(handle);
}
void
CBaseMomentary::Restore(string strKey, string strValue)
{
switch (strKey) {
case "user":
m_eUser = edict_num(ReadFloat(strValue));
break;
case "move_dir":
m_vecMoveDir = ReadVector(strValue);
break;
case "pos1":
m_vecPos1 = ReadVector(strValue);
break;
case "pos2":
m_vecPos2 = ReadVector(strValue);
break;
case "distance":
m_flProgress = ReadFloat(strValue);
break;
case "progress":
m_flProgress = ReadFloat(strValue);
break;
case "speed":
m_flSpeed = ReadFloat(strValue);
break;
case "returnspeed":
m_flReturnspeed = ReadFloat(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
CBaseMomentary::CBaseMomentary(void)
{
super::NSRenderableEntity();
}

View File

@ -48,22 +48,65 @@ enumflags
class monstermaker:NSPointTrigger
{
string m_strMonster;
string m_strChildName;
int m_iMonsterSpawned;
int m_iTotalMonsters;
float m_flDelay;
int m_iMaxChildren;
string m_strChildName;
float m_flDelay;
void(void) monstermaker;
virtual void(void) Spawner;
/* overrides */
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(entity, int) Trigger;
virtual void(void) Respawn;
virtual void(string, string) SpawnKey;
virtual void(void) Spawner;
virtual void(void) TurnOn;
virtual void(void) TurnOff;
virtual void(string, string) SpawnKey;
};
void
monstermaker::Save(float handle)
{
SaveString(handle, "monster", m_strMonster);
SaveString(handle, "child_name", m_strChildName);
SaveInt(handle, "monster_spawned", m_iMonsterSpawned);
SaveInt(handle, "total_monsters", m_iTotalMonsters);
SaveInt(handle, "max_children", m_iMaxChildren);
SaveFloat(handle, "delay", m_flDelay);
super::Save(handle);
}
void
monstermaker::Restore(string strKey, string strValue)
{
switch (strKey) {
case "enabled":
m_strMonster = ReadString(strValue);
break;
case "child_name":
m_strChildName = ReadString(strValue);
break;
case "monster_spawned":
m_iMonsterSpawned = ReadInt(strValue);
break;
case "total_monsters":
m_iTotalMonsters = ReadInt(strValue);
break;
case "max_children":
m_iMaxChildren = ReadInt(strValue);
break;
case "delay":
m_flDelay = ReadFloat(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
monstermaker::TurnOff(void)
{

View File

@ -53,11 +53,45 @@ class path_corner:NSPointTrigger
float m_flWait;
void(void) path_corner;
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(entity, int) Trigger;
virtual void(void) Respawn;
virtual void(string, string) SpawnKey;
};
void
path_corner::Save(float handle)
{
SaveInt(handle, "fired", m_iFired);
SaveFloat(handle, "speed", m_flSpeed);
SaveFloat(handle, "yaw_speed", m_flYawSpeed);
SaveFloat(handle, "wait", m_flWait);
super::Save(handle);
}
void
path_corner::Restore(string strKey, string strValue)
{
switch (strKey) {
case "fired":
m_iFired = ReadInt(strValue);
break;
case "speed":
m_flSpeed = ReadFloat(strValue);
break;
case "yaw_speed":
m_flYawSpeed = ReadFloat(strValue);
break;
case "wait":
m_flWait = ReadFloat(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
path_corner::Trigger(entity act, int state)
{

View File

@ -41,11 +41,46 @@ class player_loadsaved:NSRenderableEntity // for the rendercolor values
void(void) player_loadsaved;
/* overrides */
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(entity, int) Trigger;
virtual void(void) ReloadSave;
virtual void(string, string) SpawnKey;
virtual void(void) ReloadSave;
};
void
player_loadsaved::Save(float handle)
{
SaveString(handle, "message", m_strMessage);
SaveFloat(handle, "load_time", m_flLoadTime);
SaveFloat(handle, "fade_duration", m_flFadeDuration);
SaveFloat(handle, "fade_hold", m_flFadeHold);
super::Save(handle);
}
void
player_loadsaved::Restore(string strKey, string strValue)
{
switch (strKey) {
case "message":
m_strMessage = ReadString(strValue);
break;
case "load_time":
m_flLoadTime = ReadFloat(strValue);
break;
case "fade_duration":
m_flFadeDuration = ReadFloat(strValue);
break;
case "fade_hold":
m_flFadeHold = ReadFloat(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
player_loadsaved::ReloadSave(void)
{

View File

@ -42,20 +42,62 @@ This entity was introduced in Half-Life 2 (2004).
class point_camera:NSPointTrigger
{
float m_flFOV;
int m_iUseSAR;
int m_iUseFog;
vector m_vecFogColor;
float m_flFogStart;
float m_flFogEnd;
float m_flFOV;
void(void) point_camera;
/* overrides */
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(entity,string,string) Input;
virtual void(string,string) SpawnKey;
virtual void(void) Respawn;
};
void
point_camera::Save(float handle)
{
SaveInt(handle, "use_sar", m_iUseSAR);
SaveInt(handle, "use_fog", m_iUseFog);
SaveVector(handle, "fog_color", m_vecFogColor);
SaveFloat(handle, "fog_start", m_flFogStart);
SaveFloat(handle, "fog_end", m_flFogEnd);
SaveFloat(handle, "fov", m_flFOV);
super::Save(handle);
}
void
point_camera::Restore(string strKey, string strValue)
{
switch (strKey) {
case "use_sar":
m_iUseSAR = ReadInt(strValue);
break;
case "use_fog":
m_iUseFog = ReadInt(strValue);
break;
case "fog_color":
m_vecFogColor = ReadVector(strValue);
break;
case "fog_start":
m_flFogStart = ReadFloat(strValue);
break;
case "fog_end":
m_flFogEnd = ReadFloat(strValue);
break;
case "fov":
m_flFOV = ReadFloat(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
point_camera::Input(entity eAct, string strInput, string strData)
{

View File

@ -30,14 +30,48 @@ class prop_door_rotating:NSPointTrigger
void(void) prop_door_rotating;
/* overrides */
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(void) Respawn;
virtual void(void) Interact;
virtual void(void) Interact;
virtual void(vector, void(void)) Turn;
virtual void(void) Opened;
virtual void(void) Closed;
};
void
prop_door_rotating::Save(float handle)
{
SaveVector(handle, "dest1", m_vecDest1);
SaveVector(handle, "dest2", m_vecDest2);
SaveFloat(handle, "distance", m_flDistance);
SaveFloat(handle, "speed", m_flSpeed);
super::Save(handle);
}
void
prop_door_rotating::Restore(string strKey, string strValue)
{
switch (strKey) {
case "dest1":
m_vecDest1 = ReadVector(strValue);
break;
case "dest2":
m_vecDest2 = ReadVector(strValue);
break;
case "distance":
m_flDistance = ReadFloat(strValue);
break;
case "speed":
m_flSpeed = ReadFloat(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
prop_door_rotating::Turn(vector vecDest, void(void) vFunc)
{

View File

@ -47,14 +47,49 @@ class random_speaker:NSPointTrigger
void(void) random_speaker;
/* overrides */
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(entity,int) Trigger;
virtual void(void) Respawn;
virtual void(string, string) SpawnKey;
virtual void(void) PlaySample;
virtual void(void) Enable;
virtual void(void) Disable;
virtual void(string, string) SpawnKey;
};
void
random_speaker::Save(float handle)
{
SaveString(handle, "sample", m_strSample);
SaveFloat(handle, "volume", m_flVolume);
SaveFloat(handle, "min_pos", m_flMinPos);
SaveFloat(handle, "rand_percent", m_flRandPercent);
super::Save(handle);
}
void
random_speaker::Restore(string strKey, string strValue)
{
switch (strKey) {
case "sample":
m_strSample = ReadString(strValue);
break;
case "volume":
m_flVolume = ReadFloat(strValue);
break;
case "min_pos":
m_flMinPos = ReadFloat(strValue);
break;
case "rand_percent":
m_flRandPercent = ReadFloat(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
random_speaker::PlaySample(void)
{

View File

@ -40,11 +40,44 @@ class random_trigger:NSPointTrigger
void(void) random_trigger;
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(entity,int) Trigger;
virtual void(void) Respawn;
virtual void(string, string) SpawnKey;
};
void
random_trigger::Save(float handle)
{
SaveFloat(handle, "min_time", m_flMinTime);
SaveFloat(handle, "rand_min", m_flRandMin);
SaveFloat(handle, "rand_max", m_flRandMax);
SaveInt(handle, "start_state", m_iStartState);
super::Save(handle);
}
void
random_trigger::Restore(string strKey, string strValue)
{
switch (strKey) {
case "min_time":
m_flMinTime = ReadFloat(strValue);
break;
case "rand_min":
m_flRandMin = ReadFloat(strValue);
break;
case "rand_max":
m_flRandMax = ReadFloat(strValue);
break;
case "start_state":
m_iStartState = ReadInt(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
random_trigger::Trigger(entity act, int state)
{

View File

@ -43,10 +43,52 @@ class scripted_sentence:NSPointTrigger
void(void) scripted_sentence;
/* overrides */
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(entity, int) Trigger;
virtual void(string, string) SpawnKey;
};
void
scripted_sentence::Save(float handle)
{
SaveString(handle, "speaker", m_strSpeaker);
SaveString(handle, "sentence", m_strSentence);
SaveFloat(handle, "delay", m_flDelay);
SaveFloat(handle, "wait", m_flWait);
SaveFloat(handle, "pitch", m_flPitch);
SaveFloat(handle, "duration", m_flDuration);
super::Save(handle);
}
void
scripted_sentence::Restore(string strKey, string strValue)
{
switch (strKey) {
case "speaker":
m_strSpeaker = ReadString(strValue);
break;
case "sentence":
m_strSentence = ReadString(strValue);
break;
case "delay":
m_flDelay = ReadFloat(strValue);
break;
case "wait":
m_flWait = ReadFloat(strValue);
break;
case "pitch":
m_flPitch = ReadFloat(strValue);
break;
case "duration":
m_flDuration = ReadFloat(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
scripted_sentence::Trigger(entity act, int unused)
{

View File

@ -103,14 +103,58 @@ class scripted_sequence:NSPointTrigger
int m_iMove;
void(void) scripted_sequence;
/* overrides */
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(entity, int) Trigger;
virtual void(void) Respawn;
virtual void(string, string) SpawnKey;
virtual void(entity) RunOnEntity;
virtual void(void) InitIdle;
virtual void(void) Respawn;
virtual void(void) touch;
virtual void(string, string) SpawnKey;
};
void
scripted_sequence::Save(float handle)
{
SaveInt(handle, "enabled", m_iEnabled);
SaveString(handle, "monster", m_strMonster);
SaveString(handle, "action_anim", m_strActionAnim);
SaveString(handle, "idle_anim", m_strIdleAnim);
SaveFloat(handle, "search_radius", m_flSearchRadius);
SaveInt(handle, "move", m_iMove);
super::Save(handle);
}
void
scripted_sequence::Restore(string strKey, string strValue)
{
switch (strKey) {
case "enabled":
m_iEnabled = ReadInt(strValue);
break;
case "monster":
m_strMonster = ReadString(strValue);
break;
case "action_anim":
m_strActionAnim = ReadString(strValue);
break;
case "idle_anim":
m_strIdleAnim = ReadString(strValue);
break;
case "search_radius":
m_flSearchRadius = ReadFloat(strValue);
break;
case "move":
m_iMove = ReadInt(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
scripted_sequence::RunOnEntity(entity targ)
{

View File

@ -71,12 +71,39 @@ class speaker:NSTalkMonster
void(void) speaker;
virtual void(void) Annouce;
/* overrides */
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(void) Respawn;
virtual void(entity, int) Trigger;
virtual void(string, string) SpawnKey;
virtual void(void) Annouce;
};
void
speaker::Save(float handle)
{
SaveString(handle, "sentence", m_strSentence);
SaveFloat(handle, "volume", m_flVolume);
super::Save(handle);
}
void
speaker::Restore(string strKey, string strValue)
{
switch (strKey) {
case "sentence":
m_strSentence = ReadString(strValue);
break;
case "volume":
m_flVolume = ReadFloat(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
speaker::Annouce(void)
{

View File

@ -39,11 +39,36 @@ class targ_speaker:NSPointTrigger
void(void) targ_speaker;
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(void) Respawn;
virtual void(entity,int) Trigger;
virtual void(string, string) SpawnKey;
};
void
targ_speaker::Save(float handle)
{
SaveString(handle, "sample", m_strSample);
SaveFloat(handle, "volume", m_flVolume);
super::Save(handle);
}
void
targ_speaker::Restore(string strKey, string strValue)
{
switch (strKey) {
case "sample":
m_strSample = ReadString(strValue);
break;
case "volume":
m_flVolume = ReadFloat(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
targ_speaker::Trigger(entity act, int state)
{

View File

@ -37,11 +37,35 @@ class target_cdaudio:NSPointTrigger
int m_iCDTrack;
void(void) target_cdaudio;
virtual void(void) touch;
virtual void(void) Respawn;
virtual void(string, string) SpawnKey;
};
void
target_cdaudio::Save(float handle)
{
SaveFloat(handle, "radius", m_flRadius);
SaveInt(handle, "cdtrack", m_iCDTrack);
super::Save(handle);
}
void
target_cdaudio::Restore(string strKey, string strValue)
{
switch (strKey) {
case "radius":
m_flRadius = ReadFloat(strValue);
break;
case "cdtrack":
m_iCDTrack = ReadInt(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
target_cdaudio::touch(void)
{

View File

@ -39,11 +39,39 @@ class trigger_auto:NSPointTrigger
float m_flDelay;
void(void) trigger_auto;
virtual void(void) Processing;
/* overrides */
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(void) Respawn;
virtual void(string, string) SpawnKey;
virtual void(void) Processing;
};
void
trigger_auto::Save(float handle)
{
SaveInt(handle, "triggerstate", m_iTriggerState);
SaveFloat(handle, "delay", m_flDelay);
super::Save(handle);
}
void
trigger_auto::Restore(string strKey, string strValue)
{
switch (strKey) {
case "triggerstate":
m_iTriggerState = ReadInt(strValue);
break;
case "delay":
m_flDelay = ReadFloat(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
trigger_auto::Processing(void)
{

View File

@ -35,6 +35,25 @@ class trigger_autosave:NSBrushTrigger
virtual void(void) Respawn;
};
void
trigger_autosave::Save(float handle)
{
SaveFloat(handle, "delay", m_flDelay);
super::Save(handle);
}
void
trigger_autosave::Restore(string strKey, string strValue)
{
switch (strKey) {
case "delay":
m_flDelay = ReadFloat(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
trigger_autosave::touch(void)
{

View File

@ -31,12 +31,33 @@ class trigger_cdaudio:NSBrushTrigger
void(void) trigger_cdaudio;
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(entity, int) Trigger;
virtual void(void) Respawn;
virtual void(void) touch;
virtual void(string, string) SpawnKey;
};
void
trigger_cdaudio::Save(float handle)
{
SaveInt(handle, "cdtrack", m_iCDTrack);
super::Save(handle);
}
void
trigger_cdaudio::Restore(string strKey, string strValue)
{
switch (strKey) {
case "cdtrack":
m_iCDTrack = ReadInt(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
trigger_cdaudio::Trigger(entity act, int unused)
{

View File

@ -48,23 +48,58 @@ enumflags
class trigger_changelevel:NSBrushTrigger
{
float m_flChangeDelay;
string m_strMap;
string m_strLandmark;
float m_flChangeDelay;
string m_strOnLevelChange;
entity m_activator;
string m_strOnLevelChange;
void(void) trigger_changelevel;
virtual void(void) Change;
/* overrides */
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(entity, int) Trigger;
virtual void(void) TouchTrigger;
virtual void(void) Respawn;
virtual int(entity, entity) IsInside;
virtual void(entity, string, string) Input;
virtual void(string, string) SpawnKey;
virtual void(void) Change;
virtual void(void) TouchTrigger;
virtual int(entity, entity) IsInside;
};
void
trigger_changelevel::Save(float handle)
{
SaveFloat(handle, "changedelay", m_flChangeDelay);
SaveString(handle, "map", m_strMap);
SaveString(handle, "landmark", m_strLandmark);
SaveString(handle, "OnLevelChange", m_strOnLevelChange);
super::Save(handle);
}
void
trigger_changelevel::Restore(string strKey, string strValue)
{
switch (strKey) {
case "changedelay":
m_flChangeDelay = ReadFloat(strValue);
break;
case "map":
m_strMap = ReadString(strValue);
break;
case "landmark":
m_strLandmark = ReadString(strValue);
break;
case "OnLevelChange":
m_strOnLevelChange = ReadString(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
int
trigger_changelevel::IsInside(entity ePlayer, entity eVolume)
{

View File

@ -33,10 +33,31 @@ class trigger_changetarget:NSPointTrigger
void(void) trigger_changetarget;
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(entity,int) Trigger;
virtual void(string, string) SpawnKey;
};
void
trigger_changetarget::Save(float handle)
{
SaveString(handle, "new_target", m_strNewTarget);
super::Save(handle);
}
void
trigger_changetarget::Restore(string strKey, string strValue)
{
switch (strKey) {
case "new_target":
m_strNewTarget = ReadString(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
trigger_changetarget::Trigger(entity act, int state)
{

View File

@ -43,12 +43,37 @@ class trigger_counter:NSBrushTrigger
void(void) trigger_counter;
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(void) touch;
virtual void(entity,int) Trigger;
virtual void(void) Respawn;
virtual void(string, string) SpawnKey;
};
void
trigger_counter::Save(float handle)
{
SaveInt(handle, "counted", m_iCounted);
SaveInt(handle, "maxcount", m_iMaxCount);
super::Save(handle);
}
void
trigger_counter::Restore(string strKey, string strValue)
{
switch (strKey) {
case "counted":
m_iCounted = ReadInt(strValue);
break;
case "maxcount":
m_iMaxCount = ReadInt(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
trigger_counter::touch(void)
{

View File

@ -45,9 +45,9 @@ This entity was introduced in Quake (1996).
class trigger_hurt:NSBrushTrigger
{
int m_iDamage;
float m_flNextTrigger;
float m_flNextDmg;
int m_iDamage;
float m_flDelay;
string m_strOnHurt;
@ -55,6 +55,8 @@ class trigger_hurt:NSBrushTrigger
void(void) trigger_hurt;
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(entity, int) Trigger;
virtual void(void) touch;
virtual void(void) Respawn;
@ -62,6 +64,45 @@ class trigger_hurt:NSBrushTrigger
virtual void(entity, string, string) Input;
};
void
trigger_hurt::Save(float handle)
{
SaveInt(handle, "damage", m_iDamage);
SaveFloat(handle, "nexttrigger", m_flNextTrigger);
SaveFloat(handle, "nextdmg", m_flNextDmg);
SaveFloat(handle, "delay", m_flDelay);
SaveString(handle, "OnHurt", m_strOnHurt);
SaveString(handle, "OnHurtPlayer", m_strOnHurtPlayer);
super::Save(handle);
}
void
trigger_hurt::Restore(string strKey, string strValue)
{
switch (strKey) {
case "damage":
m_iDamage = ReadInt(strValue);
break;
case "nexttrigger":
m_flNextTrigger = ReadFloat(strValue);
break;
case "nextdmg":
m_flNextDmg = ReadFloat(strValue);
break;
case "delay":
m_flDelay = ReadFloat(strValue);
break;
case "OnHurt":
m_strOnHurt = ReadString(strValue);
break;
case "OnHurtPlayer":
m_strOnHurtPlayer = ReadString(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
trigger_hurt::Trigger(entity act, int state)
{

View File

@ -39,20 +39,61 @@ class trigger_look:NSBrushTrigger
{
float m_flFOV;
float m_flLookTime;
string m_strLookTarget;
float m_flDelay;
float m_flLooked;
string m_strLookTarget;
/* Input/Output */
string m_strOnTrigger;
void(void) trigger_look;
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(void) Touch;
virtual void(void) Respawn;
virtual void(string, string) SpawnKey;
};
void
trigger_look::Save(float handle)
{
SaveFloat(handle, "fov", m_flFOV);
SaveFloat(handle, "looktime", m_flLookTime);
SaveFloat(handle, "delay", m_flDelay);
SaveFloat(handle, "looked", m_flLooked);
SaveString(handle, "looktarget", m_strLookTarget);
SaveString(handle, "OnTrigger", m_strOnTrigger);
super::Save(handle);
}
void
trigger_look::Restore(string strKey, string strValue)
{
switch (strKey) {
case "fov":
m_flFOV = ReadFloat(strValue);
break;
case "looktime":
m_flLookTime = ReadFloat(strValue);
break;
case "delay":
m_flDelay = ReadFloat(strValue);
break;
case "looked":
m_flLooked = ReadFloat(strValue);
break;
case "looktarget":
m_strLookTarget = ReadString(strValue);
break;
case "OnTrigger":
m_strOnTrigger = ReadString(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
trigger_look::Touch(void)
{

View File

@ -49,11 +49,41 @@ class trigger_multiple:NSBrushTrigger
string m_strOnTrigger;
void(void) trigger_multiple;
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(void) touch;
virtual void(void) Respawn;
virtual void(string, string) SpawnKey;
};
void
trigger_multiple::Save(float handle)
{
SaveFloat(handle, "wait", m_flWait);
SaveString(handle, "OnStartTouch", m_strOnStartTouch);
SaveString(handle, "OnTrigger", m_strOnTrigger);
super::Save(handle);
}
void
trigger_multiple::Restore(string strKey, string strValue)
{
switch (strKey) {
case "wait":
m_flWait = ReadFloat(strValue);
break;
case "OnStartTouch":
m_strOnStartTouch = ReadString(strValue);
break;
case "OnTrigger":
m_strOnTrigger = ReadString(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
trigger_multiple::touch(void)
{

View File

@ -47,11 +47,36 @@ class trigger_once:NSBrushTrigger
void(void) trigger_once;
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(void) touch;
virtual void(void) Respawn;
virtual void(string, string) SpawnKey;
};
void
trigger_once::Save(float handle)
{
SaveString(handle, "OnStartTouch", m_strOnStartTouch);
SaveString(handle, "OnTrigger", m_strOnTrigger);
super::Save(handle);
}
void
trigger_once::Restore(string strKey, string strValue)
{
switch (strKey) {
case "OnStartTouch":
m_strOnStartTouch = ReadString(strValue);
break;
case "OnTrigger":
m_strOnTrigger = ReadString(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
trigger_once::touch(void)
{

View File

@ -43,6 +43,8 @@ class trigger_push:NSBrushTrigger
void(void) trigger_push;
virtual void(float) Save;
virtual void(string, string) Restore;
virtual void(void) touch;
virtual void(void) Respawn;
virtual void(entity, int) Trigger;
@ -50,6 +52,29 @@ class trigger_push:NSBrushTrigger
virtual void(string, string) SpawnKey;
};
void
trigger_push::Save(float handle)
{
SaveVector(handle, "movedir", m_vecMoveDir);
SaveFloat(handle, "speed", m_flSpeed);
super::Save(handle);
}
void
trigger_push::Restore(string strKey, string strValue)
{
switch (strKey) {
case "movedir":
m_vecMoveDir = ReadVector(strValue);
break;
case "speed":
m_flSpeed = ReadFloat(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
trigger_push::SetMovementDirection(void)
{

View File

@ -49,6 +49,29 @@ class trigger_relay:NSPointTrigger
virtual void(string, string) SpawnKey;
};
void
trigger_relay::Save(float handle)
{
SaveInt(handle, "trigger_state", m_iTriggerState);
SaveInt(handle, "enabled", m_iEnabled);
super::Save(handle);
}
void
trigger_relay::Restore(string strKey, string strValue)
{
switch (strKey) {
case "trigger_state":
m_iTriggerState = ReadInt(strValue);
break;
case "enabled":
m_iEnabled = ReadInt(strValue);
break;
default:
super::Restore(strKey, strValue);
}
}
void
trigger_relay::Trigger(entity act, int state)
{

View File

@ -105,6 +105,8 @@ base_player
float underwater_dmg;
float pain_time;
virtual void(float) Save;
virtual void(string,string) Restore;
virtual void(void) Respawn;
virtual void(void) EvaluateEntity;
virtual float(entity, float) SendEntity;

View File

@ -177,6 +177,105 @@ base_player::PredictPostFrame(void)
ROLL_BACK(vehicle);
}
#else
void
base_player::Save(float handle)
{
SaveFloat(handle, "health", health);
SaveFloat(handle, "armor", armor);
SaveFloat(handle, "modelindex", modelindex);
SaveVector(handle, "origin", origin);
SaveVector(handle, "velocity", velocity);
SaveVector(handle, "angles", angles);
SaveFloat(handle, "colormap", colormap);
SaveFloat(handle, "flags", flags);
SaveFloat(handle, "gflags", gflags);
SaveFloat(handle, "viewzoom", viewzoom);
SaveVector(handle, "view_ofs", view_ofs);
SaveVector(handle, "v_angle", v_angle);
SaveVector(handle, "punchangle", punchangle);
SaveFloat(handle, "movetype", movetype);
SaveFloat(handle, "pmove_flags", pmove_flags);
SaveFloat(handle, "w_attack_next", w_attack_next);
SaveFloat(handle, "w_idle_next", w_idle_next);
SaveFloat(handle, "teleport_time", teleport_time);
SaveFloat(handle, "weapontime", weapontime);
SaveInt(handle, "g_items", g_items);
SaveFloat(handle, "activeweapon", activeweapon);
SaveFloat(handle, "vehicle", num_for_edict(vehicle));
}
void
base_player::Restore(string strKey, string strValue)
{
switch (strKey) {
case "health":
health = ReadFloat(strValue);
break;
case "armor":
armor = ReadFloat(strValue);
break;
case "modelindex":
modelindex = ReadFloat(strValue);
break;
case "origin":
origin = ReadVector(strValue);
break;
case "velocity":
velocity = ReadVector(strValue);
break;
case "angles":
angles = ReadVector(strValue);
break;
case "colormap":
colormap = ReadFloat(strValue);
break;
case "flags":
flags = ReadFloat(strValue);
break;
case "gflags":
gflags = ReadFloat(strValue);
break;
case "view_ofs":
view_ofs = ReadVector(strValue);
break;
case "v_angle":
v_angle = ReadVector(strValue);
break;
case "punchangle":
punchangle = ReadVector(strValue);
break;
case "movetype":
movetype = ReadFloat(strValue);
break;
case "pmove_flags":
pmove_flags = ReadFloat(strValue);
break;
case "w_attack_next":
w_attack_next = ReadFloat(strValue);
break;
case "w_idle_next":
w_idle_next = ReadFloat(strValue);
break;
case "teleport_time":
teleport_time = ReadFloat(strValue);
break;
case "weapontime":
weapontime = ReadFloat(strValue);
break;
case "g_items":
g_items = ReadInt(strValue);
break;
case "activeweapon":
activeweapon = ReadFloat(strValue);
break;
case "vehicle":
vehicle = edict_num(ReadFloat(strValue));
break;
default:
super::Restore(strKey, strValue);
}
}
/*
=================
base_player::Respawn