Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SamVanheer committed Aug 6, 2022
2 parents c72ea5b + c2239e6 commit 0c81c8f
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 25 deletions.
6 changes: 4 additions & 2 deletions dlls/aflock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,10 @@ void CFlockingFlyer::SpawnCommonCode()
pev->classname = MAKE_STRING("monster_flyer");
pev->solid = SOLID_SLIDEBOX;
pev->movetype = MOVETYPE_FLY;
pev->takedamage = DAMAGE_NO;
pev->health = 1;
pev->takedamage = DAMAGE_YES;
pev->health = 10;

m_bloodColor = BLOOD_COLOR_GREEN;

m_fPathBlocked = false; // obstacles will be detected
m_flFieldOfView = 0.2;
Expand Down
11 changes: 9 additions & 2 deletions dlls/houndeye.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
#define HOUNDEYE_MAX_ATTACK_RADIUS 384
#define HOUNDEYE_SQUAD_BONUS (float)1.1

#define HOUNDEYE_EYE_FRAMES 4 // how many different switchable maps for the eye
// Marphy Fact Files Fix - Fix various instances of Houndeye not correctly blinking/closing eyes
#define HOUNDEYE_EYE_FRAMES 3 // how many different switchable maps for the eye

#define HOUNDEYE_SOUND_STARTLE_VOLUME 128 // how loud a sound has to be to badly scare a sleeping houndeye

Expand Down Expand Up @@ -894,10 +895,11 @@ void CHoundeye::PrescheduleThink()
//=========================================================
// AI Schedules Specific to this monster
//=========================================================
// Marphy Fact Files Fix - Fix freeze stutter after leaderlook sequence
Task_t tlHoundGuardPack[] =
{
{TASK_STOP_MOVING, (float)0},
{TASK_GUARD, (float)0},
{TASK_PLAY_SEQUENCE, (float)ACT_GUARD},
};

Schedule_t slHoundGuardPack[] =
Expand Down Expand Up @@ -1175,6 +1177,11 @@ Schedule_t* CHoundeye::GetScheduleOfType(int Type)
{
return &slHoundSleep[0];
}
// Marphy Fact Files Fix - Restore squad leader leaderlook animation
if (InSquad() && IsLeader() && !m_fAsleep && RANDOM_LONG(0, 14) < 1)
{
return &slHoundGuardPack[0];
}
else
{
return CSquadMonster::GetScheduleOfType(Type);
Expand Down
2 changes: 1 addition & 1 deletion dlls/monsters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2194,7 +2194,7 @@ int CBaseMonster::IRelationship(CBaseEntity* pTarget)
/*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},
/*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},
/*PLAYER*/ {R_NO, R_DL, R_NO, R_NO, R_DL, R_DL, R_DL, R_DL, R_DL, R_DL, R_NO, R_NO, R_DL, R_DL},
/*HUMANPASSIVE*/ {R_NO, R_NO, R_AL, R_AL, R_HT, R_FR, R_NO, R_HT, R_DL, R_FR, R_NO, R_AL, R_NO, R_NO},
/*HUMANPASSIVE*/ {R_NO, R_NO, R_AL, R_AL, R_HT, R_HT, R_NO, R_HT, R_DL, R_DL, R_NO, R_AL, R_NO, R_NO},
/*HUMANMILITAR*/ {R_NO, R_NO, R_HT, R_DL, R_NO, R_HT, R_DL, R_DL, R_DL, R_DL, R_NO, R_HT, R_NO, R_NO},
/*ALIENMILITAR*/ {R_NO, R_DL, R_HT, R_DL, R_HT, R_NO, R_NO, R_NO, R_NO, R_NO, R_NO, R_DL, R_NO, R_NO},
/*ALIENPASSIVE*/ {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},
Expand Down
2 changes: 2 additions & 0 deletions dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3088,7 +3088,9 @@ void CBasePlayer::SelectItem(const char* pstr)

if (m_pActiveItem)
{
m_pActiveItem->m_ForceSendAnimations = true;
m_pActiveItem->Deploy();
m_pActiveItem->m_ForceSendAnimations = false;
m_pActiveItem->UpdateItemInfo();
}
}
Expand Down
79 changes: 59 additions & 20 deletions dlls/scientist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,13 @@ Schedule_t slScientistStartle[] =
};



// Marphy Fact Files Fix - Restore fear display animation
Task_t tlFear[] =
{
{TASK_STOP_MOVING, (float)0},
{TASK_FACE_ENEMY, (float)0},
{TASK_SAY_FEAR, (float)0},
// { TASK_PLAY_SEQUENCE, (float)ACT_FEAR_DISPLAY },
{TASK_PLAY_SEQUENCE_FACE_ENEMY, (float)ACT_FEAR_DISPLAY},
};

Schedule_t slFear[] =
Expand Down Expand Up @@ -416,12 +416,13 @@ void CScientist::DeclineFollowing()

void CScientist::Scream()
{
if (FOkToSpeak())
{
Talk(10);
m_hTalkTarget = m_hEnemy;
PlaySentence("SC_SCREAM", RANDOM_FLOAT(3, 6), VOL_NORM, ATTN_NORM);
}
// Marphy Fact Files Fix - This speech check always fails during combat, so removing
//if ( FOkToSpeak() )
//{
Talk(10);
m_hTalkTarget = m_hEnemy;
PlaySentence("SC_SCREAM", RANDOM_FLOAT(3, 6), VOL_NORM, ATTN_NORM);
//}
}


Expand Down Expand Up @@ -458,15 +459,16 @@ void CScientist::StartTask(Task_t* pTask)
break;

case TASK_SAY_FEAR:
if (FOkToSpeak())
{
Talk(2);
m_hTalkTarget = m_hEnemy;
if (m_hEnemy->IsPlayer())
PlaySentence("SC_PLFEAR", 5, VOL_NORM, ATTN_NORM);
else
PlaySentence("SC_FEAR", 5, VOL_NORM, ATTN_NORM);
}
// Marphy Fact FIles Fix - This speech check always fails during combat, so removing
//if ( FOkToSpeak() )
//{
Talk(2);
m_hTalkTarget = m_hEnemy;
if (m_hEnemy->IsPlayer())
PlaySentence("SC_PLFEAR", 5, VOL_NORM, ATTN_NORM);
else
PlaySentence("SC_FEAR", 5, VOL_NORM, ATTN_NORM);
//}
TaskComplete();
break;

Expand Down Expand Up @@ -504,14 +506,18 @@ void CScientist::RunTask(Task_t* pTask)
case TASK_RUN_PATH_SCARED:
if (MovementIsComplete())
TaskComplete();
if (RANDOM_LONG(0, 31) < 8)

// Marphy Fact Files Fix - Reducing scream (which didn't work before) chance significantly
//if ( RANDOM_LONG(0,31) < 8 )
if (RANDOM_LONG(0, 63) < 1)
Scream();
break;

case TASK_MOVE_TO_TARGET_RANGE_SCARED:
{
if (RANDOM_LONG(0, 63) < 8)
Scream();
// Marphy Fact Files Fix - Removing redundant scream
//if ( RANDOM_LONG(0,63)< 8 )
//Scream();

if (m_hEnemy == NULL)
{
Expand Down Expand Up @@ -764,6 +770,7 @@ bool CScientist::TakeDamage(entvars_t* pevInflictor, entvars_t* pevAttacker, flo
// of sounds this monster regards. In the base class implementation,
// monsters care about all sounds, but no scents.
//=========================================================
// Marphy Fact Files Fix - Restore scientist's sense of smell
int CScientist::ISoundMask()
{
return bits_SOUND_WORLD |
Expand Down Expand Up @@ -916,6 +923,9 @@ Schedule_t* CScientist::GetSchedule()
{
m_hEnemy = NULL;
pEnemy = NULL;

// Marphy Fact Files Fix - Fix scientists not disregarding enemy after hiding
m_fearTime = gpGlobals->time;
}
}

Expand Down Expand Up @@ -991,12 +1001,38 @@ Schedule_t* CScientist::GetSchedule()
case MONSTERSTATE_COMBAT:
if (HasConditions(bits_COND_NEW_ENEMY))
return slFear; // Point and scream!

if (HasConditions(bits_COND_SEE_ENEMY))
{
// Marphy Fact Files Fix - Fix scientists not disregarding enemy after hiding
m_fearTime = gpGlobals->time;
return slScientistCover; // Take Cover
}

if (HasConditions(bits_COND_HEAR_SOUND))
return slTakeCoverFromBestSound; // Cower and panic from the scary sound!

// Marphy Fact Files Fix - Fix scientists not disregarding enemy after hiding
if (pEnemy)
{
if (HasConditions(bits_COND_SEE_ENEMY))
m_fearTime = gpGlobals->time;
else if (DisregardEnemy(pEnemy)) // After 15 seconds of being hidden, return to alert
{
m_hEnemy = NULL;
pEnemy = NULL;

m_fearTime = gpGlobals->time;

if (IsFollowing())
{
return slScientistStartle;
}

return slScientistHide; // Hide after disregard
}
}

return slScientistCover; // Run & Cower
break;
}
Expand Down Expand Up @@ -1042,6 +1078,9 @@ MONSTERSTATE CScientist::GetIdealState()
// Strip enemy when going to alert
m_IdealMonsterState = MONSTERSTATE_ALERT;
m_hEnemy = NULL;

// Marphy Fact Files Fix - Fix scientists not disregarding enemy after hiding
m_fearTime = gpGlobals->time;
return m_IdealMonsterState;
}
// Follow if only scared a little
Expand Down

0 comments on commit 0c81c8f

Please sign in to comment.