mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-03-12 05:22:55 +00:00
Do not break Save/Restore(Think/Touch-functions must not virtual).
This commit is contained in:
parent
f3abe0adcf
commit
1ea69570cb
@ -2189,6 +2189,16 @@ Schedule_t *CHGrunt::GetScheduleOfType( int Type )
|
||||
// CHGruntRepel - when triggered, spawns a monster_human_grunt
|
||||
// repelling down a line.
|
||||
//=========================================================
|
||||
|
||||
class CHGruntRepel : public CBaseMonster
|
||||
{
|
||||
public:
|
||||
void Spawn(void);
|
||||
void Precache(void);
|
||||
void EXPORT RepelUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
|
||||
int m_iSpriteTexture; // Don't save, precache
|
||||
};
|
||||
|
||||
LINK_ENTITY_TO_CLASS( monster_grunt_repel, CHGruntRepel )
|
||||
|
||||
void CHGruntRepel::Spawn( void )
|
||||
|
@ -171,18 +171,4 @@ typedef enum
|
||||
HGRUNT_SENT_TAUNT
|
||||
} HGRUNT_SENTENCE_TYPES;
|
||||
|
||||
//=========================================================
|
||||
// CHGruntRepel - when triggered, spawns a monster_human_grunt
|
||||
// repelling down a line.
|
||||
//=========================================================
|
||||
|
||||
class CHGruntRepel : public CBaseMonster
|
||||
{
|
||||
public:
|
||||
virtual void Spawn(void);
|
||||
virtual void Precache(void);
|
||||
virtual void EXPORT RepelUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
|
||||
int m_iSpriteTexture; // Don't save, precache
|
||||
};
|
||||
|
||||
#endif // HGRUNT_H
|
||||
|
@ -135,9 +135,13 @@ void COsprey::CommandUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP
|
||||
void COsprey::FindAllThink( void )
|
||||
{
|
||||
CBaseEntity *pEntity = NULL;
|
||||
const char *pszName = "monster_human_grunt";
|
||||
|
||||
if( FClassnameIs( pev, "monster_blkop_osprey" ) )
|
||||
pszName = "monster_male_assassin";
|
||||
|
||||
m_iUnits = 0;
|
||||
while( m_iUnits < OSPREY_MAX_CARRY && ( pEntity = UTIL_FindEntityByClassname( pEntity, "monster_human_grunt" ) ) != NULL )
|
||||
while( m_iUnits < OSPREY_MAX_CARRY && ( pEntity = UTIL_FindEntityByClassname( pEntity, pszName ) ) != NULL )
|
||||
{
|
||||
if( pEntity->IsAlive() )
|
||||
{
|
||||
@ -208,6 +212,10 @@ CBaseMonster *COsprey::MakeGrunt( Vector vecSrc )
|
||||
{
|
||||
CBaseEntity *pEntity;
|
||||
CBaseMonster *pGrunt;
|
||||
const char *pszName = "monster_human_grunt";
|
||||
|
||||
if( FClassnameIs( pev, "monster_blkop_osprey" ) )
|
||||
pszName = "monster_male_assassin";
|
||||
|
||||
TraceResult tr;
|
||||
UTIL_TraceLine( vecSrc, vecSrc + Vector( 0, 0, -4096.0 ), dont_ignore_monsters, ENT( pev ), &tr );
|
||||
@ -222,7 +230,7 @@ CBaseMonster *COsprey::MakeGrunt( Vector vecSrc )
|
||||
{
|
||||
m_hGrunt[i]->SUB_StartFadeOut();
|
||||
}
|
||||
pEntity = Create( "monster_human_grunt", vecSrc, pev->angles );
|
||||
pEntity = Create( pszName, vecSrc, pev->angles );
|
||||
pGrunt = pEntity->MyMonsterPointer();
|
||||
pGrunt->pev->movetype = MOVETYPE_FLY;
|
||||
pGrunt->pev->velocity = Vector( 0, 0, RANDOM_FLOAT( -196, -128 ) );
|
||||
|
@ -37,9 +37,9 @@ public:
|
||||
void EXPORT DeployThink(void);
|
||||
void Flight(void);
|
||||
void EXPORT HitTouch(CBaseEntity *pOther);
|
||||
virtual void EXPORT FindAllThink(void);
|
||||
void EXPORT FindAllThink(void);
|
||||
void EXPORT HoverThink(void);
|
||||
virtual CBaseMonster *MakeGrunt(Vector vecSrc);
|
||||
CBaseMonster *MakeGrunt(Vector vecSrc);
|
||||
void EXPORT CrashTouch(CBaseEntity *pOther);
|
||||
void EXPORT DyingThink(void);
|
||||
void EXPORT CommandUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
|
||||
|
@ -31,13 +31,8 @@
|
||||
class CBlkopOsprey : public COsprey
|
||||
{
|
||||
public:
|
||||
|
||||
void Spawn( void );
|
||||
void Precache( void );
|
||||
|
||||
void EXPORT FindAllThink(void);
|
||||
|
||||
CBaseMonster *MakeGrunt(Vector vecSrc);
|
||||
};
|
||||
|
||||
LINK_ENTITY_TO_CLASS(monster_blkop_osprey, CBlkopOsprey);
|
||||
@ -99,71 +94,3 @@ void CBlkopOsprey::Precache(void)
|
||||
m_iEngineGibs = PRECACHE_MODEL("models/blkop_enginegibs.mdl");
|
||||
}
|
||||
|
||||
|
||||
void CBlkopOsprey::FindAllThink(void)
|
||||
{
|
||||
CBaseEntity *pEntity = NULL;
|
||||
|
||||
m_iUnits = 0;
|
||||
while (m_iUnits < MAX_CARRY && (pEntity = UTIL_FindEntityByClassname(pEntity, "monster_male_assassin")) != NULL)
|
||||
{
|
||||
if (pEntity->IsAlive())
|
||||
{
|
||||
m_hGrunt[m_iUnits] = pEntity;
|
||||
m_vecOrigin[m_iUnits] = pEntity->pev->origin;
|
||||
m_iUnits++;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_iUnits == 0)
|
||||
{
|
||||
ALERT(at_console, "osprey error: no assassins to resupply\n");
|
||||
UTIL_Remove(this);
|
||||
return;
|
||||
}
|
||||
SetThink(&COsprey::FlyThink);
|
||||
pev->nextthink = gpGlobals->time + 0.1;
|
||||
m_startTime = gpGlobals->time;
|
||||
}
|
||||
|
||||
|
||||
CBaseMonster *CBlkopOsprey::MakeGrunt(Vector vecSrc)
|
||||
{
|
||||
CBaseEntity *pEntity;
|
||||
CBaseMonster *pGrunt;
|
||||
|
||||
TraceResult tr;
|
||||
UTIL_TraceLine(vecSrc, vecSrc + Vector(0, 0, -4096.0), dont_ignore_monsters, ENT(pev), &tr);
|
||||
if (tr.pHit && Instance(tr.pHit)->pev->solid != SOLID_BSP)
|
||||
return NULL;
|
||||
|
||||
for (int i = 0; i < m_iUnits; i++)
|
||||
{
|
||||
if (m_hGrunt[i] == 0 || !m_hGrunt[i]->IsAlive())
|
||||
{
|
||||
if (m_hGrunt[i] != 0 && m_hGrunt[i]->pev->rendermode == kRenderNormal)
|
||||
{
|
||||
m_hGrunt[i]->SUB_StartFadeOut();
|
||||
}
|
||||
pEntity = Create("monster_male_assassin", vecSrc, pev->angles);
|
||||
pGrunt = pEntity->MyMonsterPointer();
|
||||
pGrunt->pev->movetype = MOVETYPE_FLY;
|
||||
pGrunt->pev->velocity = Vector(0, 0, RANDOM_FLOAT(-196, -128));
|
||||
pGrunt->SetActivity(ACT_GLIDE);
|
||||
|
||||
CBeam *pBeam = CBeam::BeamCreate("sprites/rope.spr", 10);
|
||||
pBeam->PointEntInit(vecSrc + Vector(0, 0, 112), pGrunt->entindex());
|
||||
pBeam->SetFlags(BEAM_FSOLID);
|
||||
pBeam->SetColor(255, 255, 255);
|
||||
pBeam->SetThink(&CBeam::SUB_Remove);
|
||||
pBeam->pev->nextthink = gpGlobals->time + -4096.0 * tr.flFraction / pGrunt->pev->velocity.z + 0.5;
|
||||
|
||||
// ALERT( at_console, "%d at %.0f %.0f %.0f\n", i, m_vecOrigin[i].x, m_vecOrigin[i].y, m_vecOrigin[i].z );
|
||||
pGrunt->m_vecLastPosition = m_vecOrigin[i];
|
||||
m_hGrunt[i] = pGrunt;
|
||||
return pGrunt;
|
||||
}
|
||||
}
|
||||
// ALERT( at_console, "none dead\n");
|
||||
return NULL;
|
||||
}
|
||||
|
@ -915,12 +915,13 @@ Schedule_t *CFGrunt::GetScheduleOfType( int Type )
|
||||
// CNGruntRepel - when triggered, spawns a monster_nari_grunt
|
||||
// repelling down a line.
|
||||
//=========================================================
|
||||
class CFGruntRepel : public CHGruntRepel
|
||||
class CFGruntRepel : public CBaseMonster
|
||||
{
|
||||
public:
|
||||
void Spawn(void);
|
||||
void Precache(void);
|
||||
void EXPORT RepelUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
|
||||
int m_iSpriteTexture; // Don't save, precache
|
||||
};
|
||||
|
||||
LINK_ENTITY_TO_CLASS( monster_grunt_repel_ally, CFGruntRepel )
|
||||
|
@ -349,11 +349,13 @@ void CMassn::DeathSound(void)
|
||||
// repelling down a line.
|
||||
//=========================================================
|
||||
|
||||
class CAssassinRepel : public CHGruntRepel
|
||||
class CAssassinRepel : public CBaseMonster
|
||||
{
|
||||
public:
|
||||
void Precache(void);
|
||||
void Spawn();
|
||||
void EXPORT RepelUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
|
||||
int m_iSpriteTexture; // Don't save, precache
|
||||
};
|
||||
|
||||
LINK_ENTITY_TO_CLASS(monster_assassin_repel, CAssassinRepel);
|
||||
@ -364,6 +366,14 @@ void CAssassinRepel::Precache(void)
|
||||
m_iSpriteTexture = PRECACHE_MODEL("sprites/rope.spr");
|
||||
}
|
||||
|
||||
void CAssassinRepel::Spawn( void )
|
||||
{
|
||||
Precache();
|
||||
pev->solid = SOLID_NOT;
|
||||
|
||||
SetUse( &CAssassinRepel::RepelUse );
|
||||
}
|
||||
|
||||
void CAssassinRepel::RepelUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
|
||||
{
|
||||
TraceResult tr;
|
||||
|
@ -882,12 +882,13 @@ Schedule_t *CNGrunt::GetScheduleOfType( int Type )
|
||||
// CNGruntRepel - when triggered, spawns a monster_nari_grunt
|
||||
// repelling down a line.
|
||||
//=========================================================
|
||||
class CNGruntRepel : public CHGruntRepel
|
||||
class CNGruntRepel : public CBaseMonster
|
||||
{
|
||||
public:
|
||||
void Spawn(void);
|
||||
void Precache(void);
|
||||
void EXPORT RepelUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
|
||||
int m_iSpriteTexture; // Don't save, precache
|
||||
};
|
||||
|
||||
LINK_ENTITY_TO_CLASS( monster_ngrunt_repel, CNGruntRepel )
|
||||
|
@ -933,12 +933,13 @@ Schedule_t *CZGrunt::GetScheduleOfType( int Type )
|
||||
// CZGruntRepel - when triggered, spawns a monster_nari_grunt
|
||||
// repelling down a line.
|
||||
//=========================================================
|
||||
class CZGruntRepel : public CHGruntRepel
|
||||
class CZGruntRepel : public CBaseMonster
|
||||
{
|
||||
public:
|
||||
void Spawn(void);
|
||||
void Precache(void);
|
||||
void EXPORT RepelUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
|
||||
int m_iSpriteTexture; // Don't save, precache
|
||||
};
|
||||
|
||||
LINK_ENTITY_TO_CLASS( monster_zgrunt_repel, CZGruntRepel )
|
||||
|
Loading…
x
Reference in New Issue
Block a user