You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
205 lines
5.8 KiB
205 lines
5.8 KiB
/*** |
|
* |
|
* Copyright (c) 1996-2001, Valve LLC. All rights reserved. |
|
* |
|
* This product contains software technology licensed from Id |
|
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. |
|
* All Rights Reserved. |
|
* |
|
* This source code contains proprietary and confidential information of |
|
* Valve LLC and its suppliers. Access to this code is restricted to |
|
* persons who have executed a written SDK license with Valve. Any access, |
|
* use or distribution of this code by or to any unlicensed person is illegal. |
|
* |
|
****/ |
|
|
|
#include "extdll.h" |
|
#include "util.h" |
|
#include "cbase.h" |
|
#include "monsters.h" |
|
#include "talkmonster.h" |
|
#include "schedule.h" |
|
#include "defaultai.h" |
|
#include "scripted.h" |
|
#include "animation.h" |
|
#include "soundent.h" |
|
#include "scientist.h" |
|
|
|
//========================================================= |
|
// Cleansuit scientist |
|
//========================================================= |
|
class CCleansuitScientist : public CScientist |
|
{ |
|
public: |
|
void Spawn( void ); |
|
void Precache( void ); |
|
virtual BOOL CanHeal(void); |
|
}; |
|
|
|
LINK_ENTITY_TO_CLASS(monster_cleansuit_scientist, CCleansuitScientist); |
|
|
|
//========================================================= |
|
// Spawn |
|
//========================================================= |
|
void CCleansuitScientist::Spawn(void) |
|
{ |
|
Precache(); |
|
|
|
SET_MODEL(ENT(pev), "models/cleansuit_scientist.mdl"); |
|
UTIL_SetSize(pev, VEC_HUMAN_HULL_MIN, VEC_HUMAN_HULL_MAX); |
|
|
|
pev->solid = SOLID_SLIDEBOX; |
|
pev->movetype = MOVETYPE_STEP; |
|
m_bloodColor = BLOOD_COLOR_RED; |
|
pev->health = gSkillData.scientistHealth; |
|
pev->view_ofs = Vector(0, 0, 50);// position of the eyes relative to monster's origin. |
|
m_flFieldOfView = VIEW_FIELD_WIDE; // NOTE: we need a wide field of view so scientists will notice player and say hello |
|
m_MonsterState = MONSTERSTATE_NONE; |
|
|
|
// m_flDistTooFar = 256.0; |
|
|
|
m_afCapability = bits_CAP_HEAR | bits_CAP_TURN_HEAD | bits_CAP_OPEN_DOORS | bits_CAP_AUTO_DOORS | bits_CAP_USE; |
|
|
|
// White hands |
|
pev->skin = 0; |
|
|
|
if (pev->body == -1) |
|
{// -1 chooses a random head |
|
pev->body = RANDOM_LONG(0, NUM_SCIENTIST_HEADS - 1);// pick a head, any head |
|
} |
|
|
|
// Luther is black, make his hands black |
|
if (pev->body == HEAD_LUTHER) |
|
pev->skin = 1; |
|
|
|
MonsterInit(); |
|
if (!m_fStartSuspicious) |
|
SetUse(&CScientist::FollowerUse); |
|
} |
|
|
|
//========================================================= |
|
// Precache - precaches all resources this monster needs |
|
//========================================================= |
|
void CCleansuitScientist::Precache(void) |
|
{ |
|
PRECACHE_MODEL("models/cleansuit_scientist.mdl"); |
|
PRECACHE_SOUND("scientist/sci_pain1.wav"); |
|
PRECACHE_SOUND("scientist/sci_pain2.wav"); |
|
PRECACHE_SOUND("scientist/sci_pain3.wav"); |
|
PRECACHE_SOUND("scientist/sci_pain4.wav"); |
|
PRECACHE_SOUND("scientist/sci_pain5.wav"); |
|
|
|
// every new scientist must call this, otherwise |
|
// when a level is loaded, nobody will talk (time is reset to 0) |
|
TalkInit(); |
|
|
|
CTalkMonster::Precache(); |
|
} |
|
|
|
BOOL CCleansuitScientist::CanHeal() |
|
{ |
|
return FALSE; |
|
} |
|
|
|
//========================================================= |
|
// Dead Cleansuit Scientist PROP |
|
//========================================================= |
|
class CDeadCleansuitScientist : public CDeadScientist |
|
{ |
|
public: |
|
virtual void Spawn(void); |
|
|
|
static const char *m_szPoses[9]; |
|
}; |
|
|
|
LINK_ENTITY_TO_CLASS(monster_cleansuit_scientist_dead, CDeadCleansuitScientist); |
|
|
|
const char *CDeadCleansuitScientist::m_szPoses[] = { "lying_on_back", "lying_on_stomach", "dead_sitting", "dead_hang", "dead_table1", "dead_table2", "dead_table3", "scientist_deadpose1", "dead_against_wall" }; |
|
|
|
void CDeadCleansuitScientist::Spawn(void) |
|
{ |
|
PRECACHE_MODEL("models/cleansuit_scientist.mdl"); |
|
SET_MODEL(ENT(pev), "models/cleansuit_scientist.mdl"); |
|
|
|
pev->effects = 0; |
|
pev->sequence = 0; |
|
// Corpses have less health |
|
pev->health = 8;//gSkillData.scientistHealth; |
|
|
|
m_bloodColor = BLOOD_COLOR_RED; |
|
|
|
if (pev->body == -1) |
|
{// -1 chooses a random head |
|
pev->body = RANDOM_LONG(0, NUM_SCIENTIST_HEADS - 1);// pick a head, any head |
|
} |
|
// Luther is black, make his hands black |
|
if (pev->body == HEAD_LUTHER) |
|
pev->skin = 1; |
|
else |
|
pev->skin = 0; |
|
|
|
pev->sequence = LookupSequence(m_szPoses[m_iPose]); |
|
if (pev->sequence == -1) |
|
{ |
|
ALERT(at_console, "Dead cleansuit scientist with bad pose\n"); |
|
} |
|
|
|
// pev->skin += 2; // use bloody skin -- UNDONE: Turn this back on when we have a bloody skin again! |
|
MonsterInitDead(); |
|
} |
|
|
|
//========================================================= |
|
// Sitting Cleansuit Scientist PROP |
|
//========================================================= |
|
|
|
class CSittingCleansuitScientist : public CSittingScientist |
|
{ |
|
public: |
|
|
|
void Spawn( void ); |
|
}; |
|
|
|
LINK_ENTITY_TO_CLASS(monster_sitting_cleansuit_scientist, CSittingCleansuitScientist); |
|
|
|
|
|
// |
|
// ********** Cleansuit Scientist SPAWN ********** |
|
// |
|
void CSittingCleansuitScientist::Spawn(void) |
|
{ |
|
PRECACHE_MODEL("models/cleansuit_scientist.mdl"); |
|
SET_MODEL(ENT(pev), "models/cleansuit_scientist.mdl"); |
|
Precache(); |
|
InitBoneControllers(); |
|
|
|
UTIL_SetSize(pev, Vector(-14, -14, 0), Vector(14, 14, 36)); |
|
|
|
pev->solid = SOLID_SLIDEBOX; |
|
pev->movetype = MOVETYPE_STEP; |
|
pev->effects = 0; |
|
pev->health = 50; |
|
|
|
m_bloodColor = BLOOD_COLOR_RED; |
|
m_flFieldOfView = VIEW_FIELD_WIDE; // indicates the width of this monster's forward view cone ( as a dotproduct result ) |
|
|
|
m_afCapability = bits_CAP_HEAR | bits_CAP_TURN_HEAD; |
|
|
|
SetBits(pev->spawnflags, SF_MONSTER_PREDISASTER); // predisaster only! |
|
|
|
if (pev->body == -1) |
|
{// -1 chooses a random head |
|
pev->body = RANDOM_LONG(0, NUM_SCIENTIST_HEADS - 1);// pick a head, any head |
|
} |
|
// Luther is black, make his hands black |
|
if (pev->body == HEAD_LUTHER) |
|
pev->skin = 1; |
|
|
|
m_baseSequence = LookupSequence("sitlookleft"); |
|
pev->sequence = m_baseSequence + RANDOM_LONG(0, 4); |
|
ResetSequenceInfo(); |
|
|
|
SetThink(&CSittingScientist::SittingThink); |
|
pev->nextthink = gpGlobals->time + 0.1; |
|
|
|
DROP_TO_FLOOR(ENT(pev)); |
|
}
|
|
|