mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-06-05 02:12:10 +03:00
Shadow Walker: Added Hammer configurable sound scripts
This commit is contained in:
parent
ca02f50e58
commit
6b0c4554c0
@ -96,6 +96,16 @@ public:
|
|||||||
virtual int SelectCombatSchedule();
|
virtual int SelectCombatSchedule();
|
||||||
virtual bool CanPickkUpWeapons() { return true; }
|
virtual bool CanPickkUpWeapons() { return true; }
|
||||||
|
|
||||||
|
// Sounds
|
||||||
|
virtual void PlaySound(string_t soundname);
|
||||||
|
virtual void DeathSound(const CTakeDamageInfo &info) { PlaySound(m_iszDeathSound); }
|
||||||
|
virtual void AlertSound(void) { PlaySound(m_iszAlertSound); };
|
||||||
|
virtual void IdleSound(void) { PlaySound(m_iszIdleSound); };
|
||||||
|
virtual void PainSound(const CTakeDamageInfo &info) { PlaySound(m_iszPainSound); };
|
||||||
|
virtual void FearSound(void) { PlaySound(m_iszFearSound); };
|
||||||
|
virtual void LostEnemySound(void) { PlaySound(m_iszLostEnemySound); };
|
||||||
|
virtual void FoundEnemySound(void) { PlaySound(m_iszFoundEnemySound); };
|
||||||
|
|
||||||
// Citizen methods
|
// Citizen methods
|
||||||
Activity NPC_TranslateActivity(Activity eNewActivity);
|
Activity NPC_TranslateActivity(Activity eNewActivity);
|
||||||
|
|
||||||
@ -111,7 +121,13 @@ public:
|
|||||||
// for the code to operate on. Delete this field when
|
// for the code to operate on. Delete this field when
|
||||||
// you are ready to do your own save/restore for this
|
// you are ready to do your own save/restore for this
|
||||||
// character.
|
// character.
|
||||||
bool m_bHasWeapon;
|
string_t m_iszFearSound; // Path/filename of WAV file to play.
|
||||||
|
string_t m_iszDeathSound; // Path/filename of WAV file to play.
|
||||||
|
string_t m_iszIdleSound; // Path/filename of WAV file to play.
|
||||||
|
string_t m_iszPainSound; // Path/filename of WAV file to play.
|
||||||
|
string_t m_iszAlertSound; // Path/filename of WAV file to play.
|
||||||
|
string_t m_iszLostEnemySound; // Path/filename of WAV file to play.
|
||||||
|
string_t m_iszFoundEnemySound; // Path/filename of WAV file to play.
|
||||||
|
|
||||||
DEFINE_CUSTOM_AI;
|
DEFINE_CUSTOM_AI;
|
||||||
|
|
||||||
@ -128,9 +144,13 @@ IMPLEMENT_CUSTOM_AI( npc_citizen,CNPC_ShadowWalker );
|
|||||||
// Save/Restore
|
// Save/Restore
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
BEGIN_DATADESC( CNPC_ShadowWalker )
|
BEGIN_DATADESC( CNPC_ShadowWalker )
|
||||||
|
DEFINE_KEYFIELD(m_iszFearSound, FIELD_SOUNDNAME, "FearSound"),
|
||||||
DEFINE_FIELD(m_bHasWeapon, FIELD_BOOLEAN),
|
DEFINE_KEYFIELD(m_iszDeathSound, FIELD_SOUNDNAME, "DeathSound"),
|
||||||
|
DEFINE_KEYFIELD(m_iszIdleSound, FIELD_SOUNDNAME, "IdleSound"),
|
||||||
|
DEFINE_KEYFIELD(m_iszPainSound, FIELD_SOUNDNAME, "PainSound"),
|
||||||
|
DEFINE_KEYFIELD(m_iszAlertSound, FIELD_SOUNDNAME, "AlertSound"),
|
||||||
|
DEFINE_KEYFIELD(m_iszLostEnemySound, FIELD_SOUNDNAME, "LostEnemySound"),
|
||||||
|
DEFINE_KEYFIELD(m_iszFoundEnemySound, FIELD_SOUNDNAME, "FoundEnemySound"),
|
||||||
END_DATADESC()
|
END_DATADESC()
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -163,7 +183,17 @@ void CNPC_ShadowWalker::Precache( void )
|
|||||||
SetModelName(MAKE_STRING("models/monster/subject.mdl"));
|
SetModelName(MAKE_STRING("models/monster/subject.mdl"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!m_iszFearSound) {
|
||||||
|
m_iszFearSound = MAKE_STRING("NPC_Shadow_Walker.Fear");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_iszDeathSound) {
|
||||||
|
m_iszDeathSound = MAKE_STRING("NPC_Shadow_Walker.Die");
|
||||||
|
}
|
||||||
|
|
||||||
PrecacheModel(STRING(GetModelName()));
|
PrecacheModel(STRING(GetModelName()));
|
||||||
|
PrecacheScriptSound(STRING(m_iszFearSound));
|
||||||
|
PrecacheScriptSound(STRING(m_iszDeathSound));
|
||||||
BaseClass::Precache();
|
BaseClass::Precache();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,8 +236,6 @@ void CNPC_ShadowWalker::Spawn( void )
|
|||||||
CapabilitiesAdd(bits_CAP_MOVE_GROUND);
|
CapabilitiesAdd(bits_CAP_MOVE_GROUND);
|
||||||
SetMoveType(MOVETYPE_STEP);
|
SetMoveType(MOVETYPE_STEP);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NPCInit();
|
NPCInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -663,6 +691,15 @@ Activity CNPC_ShadowWalker::NPC_TranslateActivity(Activity activity)
|
|||||||
// return pHurt;
|
// return pHurt;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Purpose: Play NPC soundscript
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
void CNPC_ShadowWalker::PlaySound(string_t soundname)
|
||||||
|
{
|
||||||
|
CPASAttenuationFilter filter2(this, STRING(soundname));
|
||||||
|
EmitSound(filter2, entindex(), STRING(soundname));
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose:
|
// Purpose:
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user