Add monster_pitdrone.

This commit is contained in:
Julian
2020-06-11 01:30:29 -03:00
parent ba25f7710c
commit 433bb24dcd
10 changed files with 1165 additions and 8 deletions

View File

@@ -30,3 +30,4 @@
//monster_gonome
//monster_male_assassin
//monster_otis
//monster_pitdrone

View File

@@ -103,6 +103,11 @@ sk_massassin_kick 25
// Otis
sk_otis_health 35
// Pit Drone
sk_pitdrone_health 40
sk_pitdrone_dmg_bite 25
sk_pitdrone_dmg_whip 35
sk_pitdrone_dmg_spit 10
// MONSTER WEAPON DAMAGE
sk_9mm_bullet 5

View File

@@ -37,6 +37,7 @@ OBJ = \
monsterstate.o \
nodes.o \
otis.o \
pitdrone.o \
scientist.o \
skill.o \
sound.o \

View File

@@ -213,7 +213,7 @@ public:
void AdvanceRoute ( float distance );
virtual BOOL FTriangulate ( const Vector &vecStart , const Vector &vecEnd, float flDist, edict_t *pTargetEnt, Vector *pApex );
void MakeIdealYaw( Vector vecTarget );
virtual void SetYawSpeed ( void ) { return; };// allows different yaw_speeds for each activity
virtual void SetYawSpeed ( void ) { return; }; // allows different yaw_speeds for each activity
BOOL BuildRoute ( const Vector &vecGoal, int iMoveFlag, edict_t *pTarget );
virtual BOOL BuildNearestRoute ( Vector vecThreat, Vector vecViewOffset, float flMinDist, float flMaxDist );
int RouteClassify( int iMoveFlag );
@@ -1257,7 +1257,7 @@ public:
};
//=========================================================
// CGonome
// Gonome
//=========================================================
class CMGonome : public CMBaseMonster
{
@@ -1358,4 +1358,62 @@ public:
int bodystate;
};
//=========================================================
// Pit Drone's spit projectile
//=========================================================
class CPitdroneSpike : public CMBaseEntity
{
public:
void Spawn(void);
void EXPORT SpikeTouch(edict_t *pOther);
void EXPORT StartTrail();
static edict_t *Shoot(entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, Vector vecAngles);
};
//=========================================================
// Pit Drone
//=========================================================
class CMPitdrone : public CMBaseMonster
{
public:
void Spawn(void);
void Precache(void);
void HandleAnimEvent(MonsterEvent_t *pEvent);
void SetYawSpeed(void);
int ISoundMask();
void KeyValue(KeyValueData *pkvd);
int Classify(void);
BOOL CheckMeleeAttack1(float flDot, float flDist);
BOOL CheckRangeAttack1(float flDot, float flDist);
void IdleSound(void);
void PainSound(void);
void AlertSound(void);
void DeathSound(void);
void BodyChange(float spikes);
int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
int IgnoreConditions(void);
Schedule_t* GetSchedule(void);
Schedule_t* GetScheduleOfType(int Type);
void StartTask(Task_t *pTask);
void RunTask(Task_t *pTask);
void RunAI(void);
void CheckAmmo();
void GibMonster();
CUSTOM_SCHEDULES;
float m_flLastHurtTime;
float m_flNextSpitTime;// last time the PitDrone used the spit attack.
float m_flNextFlinch;
int m_iInitialAmmo;
bool shouldAttackWithLeftClaw;
static const char *pIdleSounds[];
static const char *pAlertSounds[];
static const char *pPainSounds[];
static const char *pDieSounds[];
static const char *pAttackMissSounds[];
};
#endif // BASEMONSTER_H

View File

@@ -177,7 +177,15 @@ void CMGib :: SpawnHeadGib( entvars_t *pevVictim )
pGib->LimitVelocity();
}
// Overload
void CMGib :: SpawnRandomGibs( entvars_t *pevVictim, int cGibs, int human )
{
if ( human )
CMGib::SpawnRandomGibs( pevVictim, cGibs, "models/hgibs.mdl", human );
else
CMGib::SpawnRandomGibs( pevVictim, cGibs, "models/agibs.mdl", human );
}
void CMGib :: SpawnRandomGibs( entvars_t *pevVictim, int cGibs, const char *pGibModel, int human )
{
int cSplat;
@@ -191,13 +199,13 @@ void CMGib :: SpawnRandomGibs( entvars_t *pevVictim, int cGibs, int human )
if ( human )
{
// human pieces
pGib->Spawn( "models/hgibs.mdl" );
pGib->Spawn( pGibModel );
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->Spawn( pGibModel );
pGib->pev->body = RANDOM_LONG(0,ALIEN_GIB_COUNT-1);
}

View File

@@ -155,6 +155,7 @@ monster_type_t monster_types[]=
"monster_gonome", FALSE, // Opposing Force Monsters
"monster_male_assassin", FALSE,
"monster_otis", FALSE,
"monster_pitdrone", FALSE,
"info_node", FALSE, // Nodes
"info_node_air", FALSE,
"", FALSE
@@ -618,6 +619,7 @@ bool spawn_monster(int monster_type, Vector origin, Vector angles, int respawn_i
case 18: monsters[monster_index].pMonster = CreateClassPtr((CMGonome *)NULL); break;
case 19: monsters[monster_index].pMonster = CreateClassPtr((CMMassn *)NULL); break;
case 20: monsters[monster_index].pMonster = CreateClassPtr((CMOtis *)NULL); break;
case 21: monsters[monster_index].pMonster = CreateClassPtr((CMPitdrone *)NULL); break;
}
if (monsters[monster_index].pMonster == NULL)
@@ -1296,6 +1298,7 @@ void mmServerActivate( edict_t *pEdictList, int edictCount, int clientMax )
CMGonome gonome;
CMMassn massn;
CMOtis otis;
CMPitdrone pitdrone;
g_psv_gravity = CVAR_GET_POINTER( "sv_gravity" );
@@ -1314,7 +1317,7 @@ void mmServerActivate( edict_t *pEdictList, int edictCount, int clientMax )
switch (index)
{
case 0: agrunt.Precache(); break;
case 1: apache.Precache(); break;
case 1: apache.Precache(); break;
case 2: barney.Precache(); break;
case 3: bigmomma.Precache(); break;
case 4: bullsquid.Precache(); break;
@@ -1334,6 +1337,7 @@ void mmServerActivate( edict_t *pEdictList, int edictCount, int clientMax )
case 18: gonome.Precache(); break;
case 19: massn.Precache(); break;
case 20: otis.Precache(); break;
case 21: pitdrone.Precache(); break;
}
}
}

View File

@@ -150,9 +150,10 @@ public:
void LimitVelocity( void );
virtual int ObjectCaps( void ) { return (CMBaseEntity :: ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | FCAP_DONT_SAVE; }
static void SpawnHeadGib( entvars_t *pevVictim );
static void SpawnRandomGibs( entvars_t *pevVictim, int cGibs, int human );
static void SpawnStickyGibs( entvars_t *pevVictim, Vector vecOrigin, int cGibs );
static void SpawnHeadGib( entvars_t *pevVictim );
static void SpawnRandomGibs( entvars_t *pevVictim, int cGibs, int human );
static void SpawnRandomGibs( entvars_t *pevVictim, int cGibs, const char *pGibModel, int human );
static void SpawnStickyGibs( entvars_t *pevVictim, Vector vecOrigin, int cGibs );
int m_bloodColor;
int m_cBloodDecals;

1064
src/dlls/pitdrone.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -79,6 +79,10 @@ skill_cfg_t skill_cfg[] = {
{"sk_massassin_health", &gSkillData.massnHealth},
{"sk_massassin_kick", &gSkillData.massnDmgKick},
{"sk_otis_health", &gSkillData.otisHealth},
{"sk_pitdrone_health", &gSkillData.pitdroneHealth},
{"sk_pitdrone_dmg_spit", &gSkillData.pitdroneDmgSpit},
{"sk_pitdrone_dmg_whip", &gSkillData.pitdroneDmgWhip},
{"sk_pitdrone_dmg_bite", &gSkillData.pitdroneDmgBite},
{"sk_12mm_bullet", &gSkillData.monDmg9MM},
{"sk_9mmAR_bullet", &gSkillData.monDmgMP5},
{"sk_9mm_bullet", &gSkillData.monDmg12MM},
@@ -234,6 +238,12 @@ void monster_skill_init(void)
// Otis
gSkillData.otisHealth = 35.0f;
// Pit Drone
gSkillData.pitdroneHealth = 40.0f;
gSkillData.pitdroneDmgSpit = 10.0f;
gSkillData.pitdroneDmgWhip = 35.0f;
gSkillData.pitdroneDmgBite = 25.0f;
// MONSTER WEAPONS
gSkillData.monDmg9MM = 5.0f;
gSkillData.monDmgMP5 = 4.0f;

View File

@@ -97,6 +97,11 @@ struct skilldata_t
float otisHealth;
float pitdroneHealth;
float pitdroneDmgSpit;
float pitdroneDmgWhip;
float pitdroneDmgBite;
// weapons shared by monsters
float monDmg9MM;
float monDmgMP5;