mirror of https://github.com/FWGS/hlsdk-xash3d
Merge changes for monster_generic and turrets from SoHL1.5.
This commit is contained in:
parent
0a41f6ec70
commit
519fd90274
|
@ -21,20 +21,21 @@
|
||||||
#include "monsters.h"
|
#include "monsters.h"
|
||||||
#include "schedule.h"
|
#include "schedule.h"
|
||||||
#include "animation.h"
|
#include "animation.h"
|
||||||
|
#include "talkmonster.h"
|
||||||
|
|
||||||
// For holograms, make them not solid so the player can walk through them
|
// For holograms, make them not solid so the player can walk through them
|
||||||
//LRC- this seems to interfere with SF_MONSTER_CLIP
|
//LRC- this seems to interfere with SF_MONSTER_CLIP
|
||||||
#define SF_GENERICMONSTER_NOTSOLID 4
|
#define SF_GENERICMONSTER_NOTSOLID 4
|
||||||
#define SF_GENERICMONSTER_PLAYERMODEL 8
|
#define SF_HEAD_CONTROLLER 8
|
||||||
#define SF_GENERICMONSTER_INVULNERABLE 32
|
#define SF_GENERICMONSTER_INVULNERABLE 32
|
||||||
//Not implemented:
|
//Not implemented:
|
||||||
#define SF_GENERICMONSTER_CORPSE 64
|
#define SF_GENERICMONSTER_PLAYERMODEL 64
|
||||||
|
|
||||||
//=========================================================
|
//=========================================================
|
||||||
// Monster's Anim Events Go Here
|
// Monster's Anim Events Go Here
|
||||||
//=========================================================
|
//=========================================================
|
||||||
|
|
||||||
class CGenericMonster : public CBaseMonster
|
class CGenericMonster : public CTalkMonster
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void Spawn( void );
|
void Spawn( void );
|
||||||
|
@ -179,6 +180,11 @@ void CGenericMonster::Spawn()
|
||||||
|
|
||||||
MonsterInit();
|
MonsterInit();
|
||||||
|
|
||||||
|
if( pev->spawnflags & SF_HEAD_CONTROLLER )
|
||||||
|
{
|
||||||
|
m_afCapability = bits_CAP_TURN_HEAD;
|
||||||
|
}
|
||||||
|
|
||||||
if( pev->spawnflags & SF_GENERICMONSTER_NOTSOLID )
|
if( pev->spawnflags & SF_GENERICMONSTER_NOTSOLID )
|
||||||
{
|
{
|
||||||
pev->solid = SOLID_NOT;
|
pev->solid = SOLID_NOT;
|
||||||
|
@ -195,6 +201,8 @@ void CGenericMonster::Spawn()
|
||||||
//=========================================================
|
//=========================================================
|
||||||
void CGenericMonster::Precache()
|
void CGenericMonster::Precache()
|
||||||
{
|
{
|
||||||
|
CTalkMonster::Precache();
|
||||||
|
TalkInit();
|
||||||
PRECACHE_MODEL( (char *)STRING(pev->model) );
|
PRECACHE_MODEL( (char *)STRING(pev->model) );
|
||||||
if (m_iszGibModel)
|
if (m_iszGibModel)
|
||||||
PRECACHE_MODEL( STRING(m_iszGibModel) ); //LRC
|
PRECACHE_MODEL( STRING(m_iszGibModel) ); //LRC
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "talkmonster.h"
|
#include "talkmonster.h"
|
||||||
#include "gamerules.h"
|
#include "gamerules.h"
|
||||||
|
#include "locus.h"
|
||||||
|
|
||||||
static char *memfgets( byte *pMemFile, int fileSize, int &filePos, char *pBuffer, int bufferSize );
|
static char *memfgets( byte *pMemFile, int fileSize, int &filePos, char *pBuffer, int bufferSize );
|
||||||
|
|
||||||
|
@ -719,6 +720,10 @@ void CAmbientGeneric::ToggleUse( CBaseEntity *pActivator, CBaseEntity *pCaller,
|
||||||
// init all ramp params for startup
|
// init all ramp params for startup
|
||||||
InitModulationParms();
|
InitModulationParms();
|
||||||
|
|
||||||
|
// AJH / MJB - [LR] volume field:
|
||||||
|
if( pev->noise )
|
||||||
|
m_dpv.vol = CalcLocus_Ratio( this, STRING( pev->noise ) );
|
||||||
|
|
||||||
if (m_pPlayFrom)
|
if (m_pPlayFrom)
|
||||||
{
|
{
|
||||||
EMIT_SOUND_DYN( m_pPlayFrom, m_iChannel, szSoundFile, //LRC
|
EMIT_SOUND_DYN( m_pPlayFrom, m_iChannel, szSoundFile, //LRC
|
||||||
|
|
|
@ -259,6 +259,12 @@ void CBaseTurret::Spawn()
|
||||||
m_iAutoStart = TRUE;
|
m_iAutoStart = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( m_iOrientation == 1 )
|
||||||
|
{
|
||||||
|
pev->idealpitch = 180;
|
||||||
|
pev->angles.x = 180;
|
||||||
|
}
|
||||||
|
|
||||||
ResetSequenceInfo();
|
ResetSequenceInfo();
|
||||||
SetBoneController( 0, 0 );
|
SetBoneController( 0, 0 );
|
||||||
SetBoneController( 1, 0 );
|
SetBoneController( 1, 0 );
|
||||||
|
@ -386,8 +392,8 @@ void CBaseTurret::Initialize( void )
|
||||||
m_flStartYaw = pev->angles.y;
|
m_flStartYaw = pev->angles.y;
|
||||||
if( m_iOrientation == 1 )
|
if( m_iOrientation == 1 )
|
||||||
{
|
{
|
||||||
pev->idealpitch = 180;
|
//pev->idealpitch = 180;
|
||||||
pev->angles.x = 180;
|
//pev->angles.x = 180; //This is moved to CBaseTurret::Spawn for fix old bug in original HL. G-Cont.
|
||||||
pev->view_ofs.z = -pev->view_ofs.z;
|
pev->view_ofs.z = -pev->view_ofs.z;
|
||||||
pev->effects |= EF_INVLIGHT;
|
pev->effects |= EF_INVLIGHT;
|
||||||
pev->angles.y = pev->angles.y + 180;
|
pev->angles.y = pev->angles.y + 180;
|
||||||
|
@ -1183,7 +1189,9 @@ void CSentry::Spawn()
|
||||||
pev->health = gSkillData.sentryHealth;
|
pev->health = gSkillData.sentryHealth;
|
||||||
m_HackedGunPos = Vector( 0, 0, 48 );
|
m_HackedGunPos = Vector( 0, 0, 48 );
|
||||||
pev->view_ofs.z = 48;
|
pev->view_ofs.z = 48;
|
||||||
m_flMaxWait = 1E6;
|
// m_flMaxWait = 1E6;
|
||||||
|
if( m_flMaxWait == 0 )
|
||||||
|
m_flMaxWait = TURRET_MAXWAIT;//G-Cont. now sentry can deployed
|
||||||
m_flMaxSpin = 1E6;
|
m_flMaxSpin = 1E6;
|
||||||
|
|
||||||
CBaseTurret::Spawn();
|
CBaseTurret::Spawn();
|
||||||
|
|
Loading…
Reference in New Issue