Example #1
0
//=========================================================
// StartMonster
//=========================================================
void CSquadMonster :: StartMonster( void )
{
    CBaseMonster :: StartMonster();

    if ( ( m_afCapability & bits_CAP_SQUAD ) && !InSquad() )
    {
        if ( !FStringNull( pev->netname ) )
        {
            // if I have a groupname, I can only recruit if I'm flagged as leader
            if ( !( pev->spawnflags & SF_SQUADMONSTER_LEADER ) )
            {
                return;
            }
        }

        // try to form squads now.
        int iSquadSize = SquadRecruit( 1024, 4 );

        if ( iSquadSize )
        {
            ALERT ( at_aiconsole, "Squad of %d %s formed\n", iSquadSize, STRING( pev->classname ) );
        }

        if ( IsLeader() && FClassnameIs ( pev, "monster_human_grunt" ) )
        {
            SetBodygroup( 1, 1 ); // UNDONE: truly ugly hack
            pev->skin = 0;
        }

    }
}
Example #2
0
//=========================================================
// StartMonster
//=========================================================
void CSquadMonster :: StartMonster( void )
{
	CBaseMonster :: StartMonster();

	if ( ( m_afCapability & bits_CAP_SQUAD ) && !InSquad() )
	{
		if ( HasNetName() )
		{
			// if I have a groupname, I can only recruit if I'm flagged as leader
			if ( !GetSpawnFlags().Any( SF_SQUADMONSTER_LEADER ) )
			{
				return;
			}
		}

		// try to form squads now.
		int iSquadSize = SquadRecruit( 1024, 4 );

		if ( iSquadSize )
		{
		  ALERT ( at_aiconsole, "Squad of %d %s formed\n", iSquadSize, GetClassname() );
		}

		if ( IsLeader() && ClassnameIs( "monster_human_grunt" ) )
		{
			SetBodygroup( 1, 1 ); // UNDONE: truly ugly hack
			SetSkin( 0 );
		}

	}
}