Browse Source

Fix pitdrone (#6)

opforfixed
Roman Chistokhodov 7 years ago committed by Andrey Akhmichin
parent
commit
692c38a26a
  1. 1
      dlls/cbase.h
  2. 25
      dlls/combat.cpp
  3. 588
      dlls/gearbox/pitdrone.cpp
  4. 33
      dlls/monsters.cpp
  5. 1
      dlls/monsters.h

1
dlls/cbase.h

@ -101,6 +101,7 @@ typedef void(CBaseEntity::*USEPTR)( CBaseEntity *pActivator, CBaseEntity *pCalle
#define CLASS_PLAYER_ALLY 11 #define CLASS_PLAYER_ALLY 11
#define CLASS_PLAYER_BIOWEAPON 12 // hornets and snarks.launched by players #define CLASS_PLAYER_BIOWEAPON 12 // hornets and snarks.launched by players
#define CLASS_ALIEN_BIOWEAPON 13 // hornets and snarks.launched by the alien menace #define CLASS_ALIEN_BIOWEAPON 13 // hornets and snarks.launched by the alien menace
#define CLASS_RACEX_PREDATOR 14
#define CLASS_BARNACLE 99 // special because no one pays attention to it, and it eats a wide cross-section of creatures. #define CLASS_BARNACLE 99 // special because no one pays attention to it, and it eats a wide cross-section of creatures.
class CBaseEntity; class CBaseEntity;

25
dlls/combat.cpp

@ -179,6 +179,15 @@ void CGib::SpawnHeadGib( entvars_t *pevVictim )
} }
void CGib::SpawnRandomGibs( entvars_t *pevVictim, int cGibs, int human ) void CGib::SpawnRandomGibs( entvars_t *pevVictim, int cGibs, int human )
{
if (human) {
SpawnRandomGibs( pevVictim, cGibs, "models/hgibs.mdl", HUMAN_GIB_COUNT, 1 ); // start at one to avoid throwing random amounts of skulls (0th gib)
} else {
SpawnRandomGibs( pevVictim, cGibs, "models/agibs.mdl", ALIEN_GIB_COUNT );
}
}
void CGib::SpawnRandomGibs(entvars_t *pevVictim, int cGibs, const char* gibModel, int gibBodiesNum , int startGibNum)
{ {
int cSplat; int cSplat;
@ -189,22 +198,12 @@ void CGib::SpawnRandomGibs( entvars_t *pevVictim, int cGibs, int human )
if( g_Language == LANGUAGE_GERMAN ) if( g_Language == LANGUAGE_GERMAN )
{ {
pGib->Spawn( "models/germangibs.mdl" ); pGib->Spawn( "models/germangibs.mdl" );
pGib->pev->body = RANDOM_LONG( 0, GERMAN_GIB_COUNT - 1 ); pGib->pev->body = RANDOM_LONG( startGibNum, GERMAN_GIB_COUNT - 1 );
} }
else else
{ {
if( human ) pGib->Spawn( gibModel );
{ pGib->pev->body = RANDOM_LONG( startGibNum, gibBodiesNum - 1 );
// human pieces
pGib->Spawn( "models/hgibs.mdl" );
pGib->pev->body = RANDOM_LONG( 1, HUMAN_GIB_COUNT - 1 );// start at one to avoid throwing random amounts of skulls (0th gib)
}
else
{
// aliens
pGib->Spawn( "models/agibs.mdl" );
pGib->pev->body = RANDOM_LONG( 0, ALIEN_GIB_COUNT - 1 );
}
} }
if( pevVictim ) if( pevVictim )

588
dlls/gearbox/pitdrone.cpp

File diff suppressed because it is too large Load Diff

33
dlls/monsters.cpp

@ -2177,22 +2177,23 @@ int CBaseMonster::TaskIsRunning( void )
//========================================================= //=========================================================
int CBaseMonster::IRelationship( CBaseEntity *pTarget ) int CBaseMonster::IRelationship( CBaseEntity *pTarget )
{ {
static int iEnemy[14][14] = static int iEnemy[15][15] =
{ // NONE MACH PLYR HPASS HMIL AMIL APASS AMONST APREY APRED INSECT PLRALY PBWPN ABWPN { // NONE MACH PLYR HPASS HMIL AMIL APASS AMONST APREY APRED INSECT PLRALY PBWPN ABWPN XPED
/*NONE*/ { R_NO ,R_NO ,R_NO ,R_NO ,R_NO ,R_NO ,R_NO ,R_NO ,R_NO ,R_NO ,R_NO ,R_NO, R_NO, R_NO }, /*NONE*/ { R_NO ,R_NO ,R_NO ,R_NO ,R_NO ,R_NO ,R_NO ,R_NO ,R_NO ,R_NO ,R_NO ,R_NO, R_NO, R_NO, R_NO},
/*MACHINE*/ { R_NO ,R_NO ,R_DL ,R_DL ,R_NO ,R_DL ,R_DL ,R_DL ,R_DL ,R_DL ,R_NO ,R_DL, R_DL, R_DL }, /*MACHINE*/ { R_NO ,R_NO ,R_DL ,R_DL ,R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O ,R_NO ,R_DL ,R_DL ,R_DL ,R_DL ,R_DL ,R_DL ,R_DL ,R_DL ,R_NO ,R_DL, R_NO, R_DL }, /*PBIOWEAPON*/ { R_NO ,R_NO ,R_DL ,R_DL ,R_DL ,R_DL ,R_DL ,R_DL ,R_DL ,R_DL ,R_NO ,R_DL, R_NO, R_DL, R_DL},
/*ABIOWEAPON*/ { R_NO ,R_NO ,R_DL ,R_DL ,R_DL ,R_AL ,R_NO ,R_DL ,R_DL ,R_NO ,R_NO ,R_DL, R_DL, R_NO } /*ABIOWEAPON*/ { R_NO ,R_NO ,R_DL ,R_DL ,R_DL ,R_AL ,R_NO ,R_DL ,R_DL ,R_NO ,R_NO ,R_DL, R_DL, R_NO, R_DL},
/*XPREDATOR*/ { R_NO ,R_DL ,R_DL ,R_DL ,R_DL ,R_NO ,R_NO ,R_NO ,R_DL ,R_DL ,R_NO ,R_NO, R_NO, R_AL, R_AL}
}; };
return iEnemy[Classify()][pTarget->Classify()]; return iEnemy[Classify()][pTarget->Classify()];

1
dlls/monsters.h

@ -148,6 +148,7 @@ public:
virtual int ObjectCaps( void ) { return ( CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION ) | FCAP_DONT_SAVE; } virtual int ObjectCaps( void ) { return ( CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION ) | FCAP_DONT_SAVE; }
static void SpawnHeadGib( entvars_t *pevVictim ); static void SpawnHeadGib( entvars_t *pevVictim );
static void SpawnRandomGibs( entvars_t *pevVictim, int cGibs, int human ); static void SpawnRandomGibs( entvars_t *pevVictim, int cGibs, int human );
static void SpawnRandomGibs( entvars_t *pevVictim, int cGibs, const char* gibModel, int gibBodiesNum, int startGibNum = 0 );
static void SpawnStickyGibs( entvars_t *pevVictim, Vector vecOrigin, int cGibs ); static void SpawnStickyGibs( entvars_t *pevVictim, Vector vecOrigin, int cGibs );
int m_bloodColor; int m_bloodColor;

Loading…
Cancel
Save