Fix Alien Slave beams not clearing upon gib/removal.
Fix env_smoker showing as func_wall. Fix pev->message field not working on many entities. Fix monstermaker "soundlist" keyvalue not working. Add prisoner spawnflag (16) for monstermaker. Add poison damage to spore grenades. Increase max entities from 512 to 768. Increase max spawnpoints from 256 to 384.
This commit is contained in:
@@ -632,6 +632,7 @@ public:
|
|||||||
void IdleSound( void );
|
void IdleSound( void );
|
||||||
|
|
||||||
void Killed( entvars_t *pevAttacker, int iGib );
|
void Killed( entvars_t *pevAttacker, int iGib );
|
||||||
|
void UpdateOnRemove();
|
||||||
|
|
||||||
void StartTask ( Task_t *pTask );
|
void StartTask ( Task_t *pTask );
|
||||||
Schedule_t *GetSchedule( void );
|
Schedule_t *GetSchedule( void );
|
||||||
|
|||||||
@@ -715,6 +715,7 @@ edict_t* spawn_monster(int monster_type, Vector origin, Vector angles, int spawn
|
|||||||
case 33: monsters[monster_index].pMonster = CreateClassPtr((CMAmbientMusic *)NULL); break;
|
case 33: monsters[monster_index].pMonster = CreateClassPtr((CMAmbientMusic *)NULL); break;
|
||||||
case 34: monsters[monster_index].pMonster = CreateClassPtr((CMXenMaker *)NULL); break;
|
case 34: monsters[monster_index].pMonster = CreateClassPtr((CMXenMaker *)NULL); break;
|
||||||
case 35: monsters[monster_index].pMonster = CreateClassPtr((CMSetCVar *)NULL); break;
|
case 35: monsters[monster_index].pMonster = CreateClassPtr((CMSetCVar *)NULL); break;
|
||||||
|
default: LOG_MESSAGE(PLID, "ERROR: Invalid monster type! (%i)", monster_type); return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (monsters[monster_index].pMonster == NULL)
|
if (monsters[monster_index].pMonster == NULL)
|
||||||
@@ -1243,6 +1244,28 @@ void SpawnViewerCommand(void)
|
|||||||
LOG_MESSAGE(PLID, "spawns a node viewer at the player's location");
|
LOG_MESSAGE(PLID, "spawns a node viewer at the player's location");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DebugGetEntities(void)
|
||||||
|
{
|
||||||
|
LOG_MESSAGE(PLID, "count: %i ents of max %i\n", monster_ents_used, MAX_MONSTER_ENTS);
|
||||||
|
for (int index = 0; index < MAX_MONSTER_ENTS; index++)
|
||||||
|
{
|
||||||
|
if (monsters[index].monster_index)
|
||||||
|
{
|
||||||
|
LOG_MESSAGE(PLID, "SLOT #%i:", index);
|
||||||
|
edict_t *pent = (*g_engfuncs.pfnPEntityOfEntIndex)(monsters[index].monster_index);
|
||||||
|
|
||||||
|
if (pent)
|
||||||
|
{
|
||||||
|
LOG_MESSAGE(PLID, "Class is \"%s\"\n", STRING(pent->v.classname));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOG_MESSAGE(PLID, "NULL entity\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void mmGameDLLInit( void )
|
void mmGameDLLInit( void )
|
||||||
{
|
{
|
||||||
// one time initialization stuff here...
|
// one time initialization stuff here...
|
||||||
@@ -1446,6 +1469,7 @@ void mmServerActivate( edict_t *pEdictList, int edictCount, int clientMax )
|
|||||||
|
|
||||||
(g_engfuncs.pfnAddServerCommand)("monster", MonsterCommand);
|
(g_engfuncs.pfnAddServerCommand)("monster", MonsterCommand);
|
||||||
(g_engfuncs.pfnAddServerCommand)("node_viewer", SpawnViewerCommand);
|
(g_engfuncs.pfnAddServerCommand)("node_viewer", SpawnViewerCommand);
|
||||||
|
(g_engfuncs.pfnAddServerCommand)("get_edicts", DebugGetEntities);
|
||||||
(g_engfuncs.pfnAddServerCommand)("_use", mmDispatchUse);
|
(g_engfuncs.pfnAddServerCommand)("_use", mmDispatchUse);
|
||||||
|
|
||||||
for (index = 0; monster_types[index].name[0]; index++)
|
for (index = 0; monster_types[index].name[0]; index++)
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ void CSmoker::Spawn( void )
|
|||||||
UTIL_SetSize(pev, g_vecZero, g_vecZero );
|
UTIL_SetSize(pev, g_vecZero, g_vecZero );
|
||||||
pev->effects |= EF_NODRAW;
|
pev->effects |= EF_NODRAW;
|
||||||
pev->angles = g_vecZero;
|
pev->angles = g_vecZero;
|
||||||
|
pev->classname = MAKE_STRING("env_smoker");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSmoker::Think( void )
|
void CSmoker::Think( void )
|
||||||
|
|||||||
@@ -168,6 +168,12 @@ void CMISlave::Killed( entvars_t *pevAttacker, int iGib )
|
|||||||
CMBaseMonster::Killed( pevAttacker, iGib );
|
CMBaseMonster::Killed( pevAttacker, iGib );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CMISlave::UpdateOnRemove()
|
||||||
|
{
|
||||||
|
CMBaseMonster::UpdateOnRemove();
|
||||||
|
ClearBeams();
|
||||||
|
}
|
||||||
|
|
||||||
//=========================================================
|
//=========================================================
|
||||||
// SetYawSpeed - allows each sequence to have a different
|
// SetYawSpeed - allows each sequence to have a different
|
||||||
// turn rate associated with it.
|
// turn rate associated with it.
|
||||||
|
|||||||
@@ -133,7 +133,6 @@ void process_monster_sound(edict_t *pMonster, char *fileName)
|
|||||||
|
|
||||||
// SC soundlist path starts from sound/MAPNAME
|
// SC soundlist path starts from sound/MAPNAME
|
||||||
sprintf(srPath, "%s/sound/%s/%s", game_dir, STRING(gpGlobals->mapname), fileName);
|
sprintf(srPath, "%s/sound/%s/%s", game_dir, STRING(gpGlobals->mapname), fileName);
|
||||||
|
|
||||||
if (access(srPath, 0) == 0)
|
if (access(srPath, 0) == 0)
|
||||||
{
|
{
|
||||||
if ((fp = fopen(srPath, "r")) != NULL)
|
if ((fp = fopen(srPath, "r")) != NULL)
|
||||||
@@ -450,11 +449,11 @@ void scan_monster_cfg(FILE *fp)
|
|||||||
{
|
{
|
||||||
// precache the sound here
|
// precache the sound here
|
||||||
PRECACHE_GENERIC(data[i].value);
|
PRECACHE_GENERIC(data[i].value);
|
||||||
|
|
||||||
// the entity will need the keyvalue
|
|
||||||
strcpy(monster_spawnpoint[monster_spawn_count].keyvalue[i].key, data[i].key);
|
|
||||||
strcpy(monster_spawnpoint[monster_spawn_count].keyvalue[i].value, data[i].value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// common pev-field, an entity might need it
|
||||||
|
strcpy(monster_spawnpoint[monster_spawn_count].keyvalue[i].key, data[i].key);
|
||||||
|
strcpy(monster_spawnpoint[monster_spawn_count].keyvalue[i].value, data[i].value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -828,11 +827,11 @@ void scan_monster_bsp(void)
|
|||||||
{
|
{
|
||||||
// precache the sound here
|
// precache the sound here
|
||||||
PRECACHE_GENERIC(data[i].value);
|
PRECACHE_GENERIC(data[i].value);
|
||||||
|
|
||||||
// the entity will need the keyvalue
|
|
||||||
strcpy(monster_spawnpoint[monster_spawn_count].keyvalue[i].key, data[i].key);
|
|
||||||
strcpy(monster_spawnpoint[monster_spawn_count].keyvalue[i].value, data[i].value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// common pev-field, an entity might need it
|
||||||
|
strcpy(monster_spawnpoint[monster_spawn_count].keyvalue[i].key, data[i].key);
|
||||||
|
strcpy(monster_spawnpoint[monster_spawn_count].keyvalue[i].value, data[i].value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ typedef struct
|
|||||||
CMBaseMonster *pMonster;
|
CMBaseMonster *pMonster;
|
||||||
} monster_t;
|
} monster_t;
|
||||||
|
|
||||||
#define MAX_MONSTER_ENTS 512
|
#define MAX_MONSTER_ENTS 768
|
||||||
|
|
||||||
extern monster_t monsters[MAX_MONSTER_ENTS];
|
extern monster_t monsters[MAX_MONSTER_ENTS];
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ typedef struct {
|
|||||||
bool need_to_respawn;
|
bool need_to_respawn;
|
||||||
} monster_spawnpoint_t;
|
} monster_spawnpoint_t;
|
||||||
|
|
||||||
#define MAX_MONSTERS 256
|
#define MAX_MONSTERS 384
|
||||||
extern monster_spawnpoint_t monster_spawnpoint[MAX_MONSTERS];
|
extern monster_spawnpoint_t monster_spawnpoint[MAX_MONSTERS];
|
||||||
|
|
||||||
// this is here to store if a node we want to spawn is an ordinary one, or a flying one
|
// this is here to store if a node we want to spawn is an ordinary one, or a flying one
|
||||||
|
|||||||
@@ -25,9 +25,10 @@
|
|||||||
#include "monsters.h"
|
#include "monsters.h"
|
||||||
|
|
||||||
// Monstermaker spawnflags
|
// Monstermaker spawnflags
|
||||||
#define SF_MONSTERMAKER_START_ON 1 // start active ( if has targetname )
|
#define SF_MONSTERMAKER_START_ON 1 // start active ( if has targetname )
|
||||||
#define SF_MONSTERMAKER_CYCLIC 4 // drop one monster every time fired.
|
#define SF_MONSTERMAKER_CYCLIC 4 // drop one monster every time fired.
|
||||||
#define SF_MONSTERMAKER_MONSTERCLIP 8 // Children are blocked by monsterclip
|
#define SF_MONSTERMAKER_MONSTERCLIP 8 // Children are blocked by monsterclip
|
||||||
|
#define SF_MONSTERMAKER_PRISONER 16 // children won't attack or be attacked
|
||||||
|
|
||||||
extern monster_type_t monster_types[];
|
extern monster_type_t monster_types[];
|
||||||
extern edict_t* spawn_monster(int monster_type, Vector origin, Vector angles, int spawnflags, pKVD *keyvalue);
|
extern edict_t* spawn_monster(int monster_type, Vector origin, Vector angles, int spawnflags, pKVD *keyvalue);
|
||||||
@@ -171,7 +172,7 @@ void CMMonsterMaker::MakeMonster( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
edict_t *pent;
|
edict_t *pent;
|
||||||
pKVD keyvalue[MAX_KEYVALUES]; // sometimes, i don't know what am i doing. -Giegue
|
pKVD keyvalue[MAX_KEYVALUES];
|
||||||
int createSF = SF_MONSTER_FALL_TO_GROUND;
|
int createSF = SF_MONSTER_FALL_TO_GROUND;
|
||||||
|
|
||||||
if ( m_iMaxLiveChildren > 0 && m_cLiveChildren >= m_iMaxLiveChildren )
|
if ( m_iMaxLiveChildren > 0 && m_cLiveChildren >= m_iMaxLiveChildren )
|
||||||
@@ -205,6 +206,10 @@ void CMMonsterMaker::MakeMonster( void )
|
|||||||
if ( pev->spawnflags & SF_MONSTERMAKER_MONSTERCLIP )
|
if ( pev->spawnflags & SF_MONSTERMAKER_MONSTERCLIP )
|
||||||
createSF |= SF_MONSTER_HITMONSTERCLIP;
|
createSF |= SF_MONSTER_HITMONSTERCLIP;
|
||||||
|
|
||||||
|
// Should children be prisoner entities?
|
||||||
|
if (pev->spawnflags & SF_MONSTERMAKER_PRISONER)
|
||||||
|
createSF |= SF_MONSTER_PRISONER;
|
||||||
|
|
||||||
/* KEYVALUES */
|
/* KEYVALUES */
|
||||||
// Monster is to have a custom model?
|
// Monster is to have a custom model?
|
||||||
if ( !FStringNull( m_iszCustomModel ) )
|
if ( !FStringNull( m_iszCustomModel ) )
|
||||||
@@ -284,13 +289,13 @@ void CMMonsterMaker::MakeMonster( void )
|
|||||||
pent->v.rendercolor = pev->rendercolor;
|
pent->v.rendercolor = pev->rendercolor;
|
||||||
|
|
||||||
// Soundlist isn't "exactly" a keyvalue so pass it here
|
// Soundlist isn't "exactly" a keyvalue so pass it here
|
||||||
if ( m_srSoundList != NULL )
|
if (m_srSoundList != NULL)
|
||||||
{
|
{
|
||||||
// it needs to be allocated first
|
// it needs to be allocated first
|
||||||
CMBaseMonster *pChild = GetClassPtr((CMBaseMonster *)VARS(pent));
|
CMBaseMonster *pChild = GetClassPtr((CMBaseMonster *)VARS(pent));
|
||||||
pChild->m_srSoundList = (REPLACER::REPLACER*)calloc(MAX_REPLACEMENTS, sizeof(*pChild->m_srSoundList));
|
pChild->m_srSoundList = (REPLACER::REPLACER*)calloc(MAX_REPLACEMENTS, sizeof(*pChild->m_srSoundList));
|
||||||
|
|
||||||
memcpy(pChild->m_srSoundList, m_srSoundList, sizeof(REPLACER::REPLACER));
|
memcpy(pChild->m_srSoundList, m_srSoundList, m_isrSounds * sizeof(*pChild->m_srSoundList));
|
||||||
pChild->m_isrSounds = m_isrSounds;
|
pChild->m_isrSounds = m_isrSounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ void CMSporeGrenade::Explode(TraceResult *pTrace)
|
|||||||
|
|
||||||
pev->owner = NULL; // can't traceline attack owner if this is set
|
pev->owner = NULL; // can't traceline attack owner if this is set
|
||||||
|
|
||||||
RadiusDamage(pev, pevOwner, pev->dmg, CLASS_NONE, DMG_BLAST);
|
RadiusDamage(pev, pevOwner, pev->dmg, CLASS_NONE, DMG_BLAST | DMG_POISON);
|
||||||
|
|
||||||
// Place a decal on the surface that was hit.
|
// Place a decal on the surface that was hit.
|
||||||
UTIL_DecalTrace(pTrace, DECAL_SPIT1 + RANDOM_LONG(0, 1));
|
UTIL_DecalTrace(pTrace, DECAL_SPIT1 + RANDOM_LONG(0, 1));
|
||||||
|
|||||||
Reference in New Issue
Block a user