ReGameDLL_CS/regamedll/dlls/bmodels.h

266 lines
7.2 KiB
C
Raw Normal View History

2015-06-30 12:46:07 +03: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 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.
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#ifndef BMODELS_H
#define BMODELS_H
#ifdef _WIN32
#pragma once
#endif
2017-06-13 20:42:57 +03:00
// func_rotating
#define SF_BRUSH_ROTATE_Y_AXIS 0
#define SF_BRUSH_ROTATE_INSTANT 1
#define SF_BRUSH_ROTATE_BACKWARDS 2
#define SF_BRUSH_ROTATE_Z_AXIS 4
#define SF_BRUSH_ROTATE_X_AXIS 8
2015-09-16 23:19:21 +03:00
2017-06-13 20:42:57 +03:00
#define SF_BRUSH_ACCDCC 16 // brush should accelerate and decelerate when toggled
#define SF_BRUSH_HURT 32 // rotating brush that inflicts pain based on rotation speed
2015-06-30 12:46:07 +03:00
2017-06-13 20:42:57 +03:00
#define SF_ROTATING_NOT_SOLID 64 // some special rotating objects are not solid.
2015-06-30 12:46:07 +03:00
2017-06-13 20:42:57 +03:00
#define SF_BRUSH_ROTATE_SMALLRADIUS 128
#define SF_BRUSH_ROTATE_MEDIUMRADIUS 256
#define SF_BRUSH_ROTATE_LARGERADIUS 512
2015-06-30 12:46:07 +03:00
2017-06-13 20:42:57 +03:00
#define FANPITCHMIN 30
#define FANPITCHMAX 100
2015-12-06 22:57:51 +03:00
2017-06-13 20:42:57 +03:00
// func_pendulum
#define SF_PENDULUM_SWING 2 // spawnflag that makes a pendulum a rope swing.
#define SF_PENDULUM_AUTO_RETURN 16
#define SF_PENDULUM_PASSABLE 32
// func_wall_toggle
#define SF_WALL_START_OFF 0x0001
// func_conveyor
#define SF_CONVEYOR_VISUAL 0x0001
#define SF_CONVEYOR_NOTSOLID 0x0002
2015-06-30 12:46:07 +03:00
2015-09-16 23:19:21 +03:00
// covering cheesy noise1, noise2, & noise3 fields so they make more sense (for rotating fans)
2017-06-13 20:42:57 +03:00
#define noiseStart noise1
#define noiseStop noise2
#define noiseRunning noise3
2015-06-30 12:46:07 +03:00
2015-09-16 23:19:21 +03:00
// This is just a solid wall if not inhibited
2015-06-30 12:46:07 +03:00
class CFuncWall: public CBaseEntity
{
public:
virtual void Spawn();
2015-09-16 23:19:21 +03:00
// Bmodels don't go across transitions
virtual int ObjectCaps() { return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
2015-09-16 23:19:21 +03:00
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
2015-06-30 12:46:07 +03:00
#ifdef HOOK_GAMEDLL
void Spawn_();
2015-06-30 12:46:07 +03:00
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
2015-06-30 12:46:07 +03:00
};
2015-06-30 12:46:07 +03:00
class CFuncWallToggle: public CFuncWall
{
public:
virtual void Spawn();
2015-09-16 23:19:21 +03:00
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
2015-06-30 12:46:07 +03:00
#ifdef HOOK_GAMEDLL
void Spawn_();
2015-06-30 12:46:07 +03:00
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
2015-06-30 12:46:07 +03:00
public:
void TurnOff();
void TurnOn();
BOOL IsOn();
};
2015-06-30 12:46:07 +03:00
class CFuncConveyor: public CFuncWall
{
public:
virtual void Spawn();
2015-09-16 23:19:21 +03:00
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
2015-06-30 12:46:07 +03:00
#ifdef HOOK_GAMEDLL
void Spawn_();
2015-06-30 12:46:07 +03:00
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
2015-06-30 12:46:07 +03:00
public:
2015-09-16 23:19:21 +03:00
void UpdateSpeed(float speed);
};
2015-06-30 12:46:07 +03:00
2015-09-16 23:19:21 +03:00
// A simple entity that looks solid but lets you walk through it.
2015-06-30 12:46:07 +03:00
class CFuncIllusionary: public CBaseToggle
{
public:
virtual void Spawn();
2015-09-16 23:19:21 +03:00
virtual void KeyValue(KeyValueData *pkvd);
virtual int ObjectCaps() { return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
2015-06-30 12:46:07 +03:00
#ifdef HOOK_GAMEDLL
void Spawn_();
2015-06-30 12:46:07 +03:00
void KeyValue_(KeyValueData *pkvd);
#endif
2015-06-30 12:46:07 +03:00
public:
2015-09-16 23:19:21 +03:00
void EXPORT SloshTouch(CBaseEntity *pOther);
};
2015-06-30 12:46:07 +03:00
2015-12-06 22:57:51 +03:00
// Monster only clip brush
//
// This brush will be solid for any entity who has the FL_MONSTERCLIP flag set
// in pev->flags
//
// otherwise it will be invisible and not solid. This can be used to keep
2015-09-16 23:19:21 +03:00
// specific monsters out of certain areas
2015-06-30 12:46:07 +03:00
class CFuncMonsterClip: public CFuncWall
{
public:
virtual void Spawn();
2015-09-16 23:19:21 +03:00
// Clear out func_wall's use function
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) {}
2015-06-30 12:46:07 +03:00
#ifdef HOOK_GAMEDLL
void Spawn_();
2015-06-30 12:46:07 +03:00
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
2015-06-30 12:46:07 +03:00
};
2015-06-30 12:46:07 +03:00
class CFuncRotating: public CBaseEntity
{
public:
2015-09-16 23:19:21 +03:00
// basic functions
virtual void Spawn();
virtual void Precache();
2015-09-16 23:19:21 +03:00
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | FCAP_MUST_RESET; }
2015-09-16 23:19:21 +03:00
virtual void Blocked(CBaseEntity *pOther);
2015-06-30 12:46:07 +03:00
#ifdef REGAMEDLL_FIXES
virtual void Restart();
#endif
2015-06-30 12:46:07 +03:00
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
2015-06-30 12:46:07 +03:00
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Blocked_(CBaseEntity *pOther);
#endif
2015-06-30 12:46:07 +03:00
public:
void EXPORT SpinUp();
void EXPORT SpinDown();
2015-09-16 23:19:21 +03:00
void EXPORT HurtTouch(CBaseEntity *pOther);
void EXPORT RotatingUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void EXPORT Rotate();
2015-09-16 23:19:21 +03:00
void RampPitchVol(int fUp);
2015-06-30 12:46:07 +03:00
public:
2015-12-09 01:39:54 +03:00
static TYPEDESCRIPTION IMPL(m_SaveData)[5];
2015-06-30 12:46:07 +03:00
float m_flFanFriction;
float m_flAttenuation;
float m_flVolume;
float m_pitch;
int m_sounds;
#ifdef REGAMEDLL_FIXES
Vector m_angles;
#endif
};
2015-06-30 12:46:07 +03:00
class CPendulum: public CBaseEntity
{
public:
virtual void Spawn();
2015-09-16 23:19:21 +03:00
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps() { return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
2015-09-16 23:19:21 +03:00
virtual void Touch(CBaseEntity *pOther);
virtual void Blocked(CBaseEntity *pOther);
2015-06-30 12:46:07 +03:00
#ifdef HOOK_GAMEDLL
void Spawn_();
2015-06-30 12:46:07 +03:00
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Touch_(CBaseEntity *pOther);
void Blocked_(CBaseEntity *pOther);
#endif
2015-06-30 12:46:07 +03:00
public:
void EXPORT Swing();
2015-09-16 23:19:21 +03:00
void EXPORT PendulumUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void EXPORT Stop();
2015-09-16 23:19:21 +03:00
// this touch func makes the pendulum a rope
void EXPORT RopeTouch(CBaseEntity *pOther);
2015-06-30 12:46:07 +03:00
public:
2015-12-09 01:39:54 +03:00
static TYPEDESCRIPTION IMPL(m_SaveData)[8];
2015-06-30 12:46:07 +03:00
2015-09-16 23:19:21 +03:00
float m_accel; // Acceleration
2015-06-30 12:46:07 +03:00
float m_distance;
float m_time;
float m_damp;
float m_maxSpeed;
float m_dampSpeed;
2015-09-16 23:19:21 +03:00
2015-06-30 12:46:07 +03:00
Vector m_center;
Vector m_start;
};
2015-06-30 12:46:07 +03:00
Vector VecBModelOrigin(entvars_t *pevBModel);
2015-06-30 12:46:07 +03:00
#endif // BMODELS_H