mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-05-31 16:07:41 +03:00
Shadow Walker: Animation fixes. Deprecated weapon pickup in FGD; not working currently.
This commit is contained in:
parent
289a9b4f6e
commit
9f999c4c87
@ -50,16 +50,17 @@
|
|||||||
0 : "Can Open Doors"
|
0 : "Can Open Doors"
|
||||||
1 : "Cannot Open Doors"
|
1 : "Cannot Open Doors"
|
||||||
]
|
]
|
||||||
CanPickupWeapons(choices) : "Can Pick Up Guns?" : 0 : "Is this NPC able to pick up guns? You can change this after spawning with EnablePickupWeapons and DisablePickupWeapons." =
|
// // Weapon pickup feature not working yet
|
||||||
[
|
// CanPickupWeapons(choices) : "Can Pick Up Guns?" : 0 : "Is this NPC able to pick up guns? You can change this after spawning with EnablePickupWeapons and DisablePickupWeapons." =
|
||||||
0 : "Cannot Pick Up Guns"
|
// [
|
||||||
1 : "Can Pick Up Guns"
|
// 0 : "Cannot Pick Up Guns"
|
||||||
]
|
// 1 : "Can Pick Up Guns"
|
||||||
|
// ]
|
||||||
input SetSpeedModifier(float) : "Set a float value to multiple distance traveled by."
|
input SetSpeedModifier(float) : "Set a float value to multiple distance traveled by."
|
||||||
input EnableOpenDoors(void) : "Allow this NPC to open doors. (Warning: Doesn't always seem to update pathfinding / AI)"
|
input EnableOpenDoors(void) : "Allow this NPC to open doors. (Warning: Doesn't always seem to update pathfinding / AI)"
|
||||||
input DisableOpenDoors(void) : "Prevent this NPC from opening doors."
|
input DisableOpenDoors(void) : "Prevent this NPC from opening doors."
|
||||||
input EnablePickupWeapons(void) : "Allow this NPC to pick up any weapon off of the ground."
|
// input EnablePickupWeapons(void) : "Allow this NPC to pick up any weapon off of the ground."
|
||||||
input DisablePickupWeapons(void) : "Prevent this NPC from picking up weapons."
|
// input DisablePickupWeapons(void) : "Prevent this NPC from picking up weapons."
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
#include "entitylist.h"
|
#include "entitylist.h"
|
||||||
#include "activitylist.h"
|
#include "activitylist.h"
|
||||||
#include "ai_basenpc.h"
|
#include "ai_basenpc.h"
|
||||||
|
#include "ai_blended_movement.h"
|
||||||
|
#include "ai_behavior_actbusy.h"
|
||||||
#include "engine/IEngineSound.h"
|
#include "engine/IEngineSound.h"
|
||||||
#include "basehlcombatweapon_shared.h"
|
#include "basehlcombatweapon_shared.h"
|
||||||
#include "ai_squadslot.h"
|
#include "ai_squadslot.h"
|
||||||
@ -42,9 +44,11 @@ enum
|
|||||||
|
|
||||||
//=========================================================
|
//=========================================================
|
||||||
//=========================================================
|
//=========================================================
|
||||||
class CNPC_ShadowWalker : public CAI_BaseNPC
|
typedef CAI_BlendingHost< CAI_BehaviorHost<CAI_BaseNPC> > CAI_CustomNPCBase;
|
||||||
|
|
||||||
|
class CNPC_ShadowWalker : public CAI_CustomNPCBase
|
||||||
{
|
{
|
||||||
DECLARE_CLASS( CNPC_ShadowWalker, CAI_BaseNPC );
|
DECLARE_CLASS( CNPC_ShadowWalker, CAI_CustomNPCBase);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Precache( void );
|
void Precache( void );
|
||||||
@ -57,9 +61,8 @@ public:
|
|||||||
virtual int SelectIdleSchedule();
|
virtual int SelectIdleSchedule();
|
||||||
virtual int SelectAlertSchedule();
|
virtual int SelectAlertSchedule();
|
||||||
virtual int SelectCombatSchedule();
|
virtual int SelectCombatSchedule();
|
||||||
virtual bool CanPickkUpWeapons() { return m_bCanPickupWeapons; }
|
|
||||||
virtual float GetSequenceGroundSpeed(CStudioHdr *pStudioHdr, int iSequence);
|
virtual float GetSequenceGroundSpeed(CStudioHdr *pStudioHdr, int iSequence);
|
||||||
Activity NPC_TranslateActivity(Activity eNewActivity);
|
virtual Activity NPC_TranslateActivity(Activity eNewActivity);
|
||||||
virtual int TranslateSchedule(int scheduleType);
|
virtual int TranslateSchedule(int scheduleType);
|
||||||
|
|
||||||
// Sounds
|
// Sounds
|
||||||
@ -360,7 +363,7 @@ int CNPC_ShadowWalker::SelectFailSchedule(int failedSchedule, int failedTask, AI
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
int CNPC_ShadowWalker::SelectScheduleRetrieveItem()
|
int CNPC_ShadowWalker::SelectScheduleRetrieveItem()
|
||||||
{
|
{
|
||||||
if (HasCondition(COND_BETTER_WEAPON_AVAILABLE))
|
if (m_bCanPickupWeapons && HasCondition(COND_BETTER_WEAPON_AVAILABLE))
|
||||||
{
|
{
|
||||||
CBaseHLCombatWeapon *pWeapon = dynamic_cast<CBaseHLCombatWeapon *>(Weapon_FindUsable(WEAPON_SEARCH_DELTA));
|
CBaseHLCombatWeapon *pWeapon = dynamic_cast<CBaseHLCombatWeapon *>(Weapon_FindUsable(WEAPON_SEARCH_DELTA));
|
||||||
if (pWeapon)
|
if (pWeapon)
|
||||||
@ -433,11 +436,9 @@ int CNPC_ShadowWalker::SelectIdleSchedule()
|
|||||||
return SCHED_INVESTIGATE_SOUND;
|
return SCHED_INVESTIGATE_SOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CanPickkUpWeapons()) {
|
nSched = SelectScheduleRetrieveItem();
|
||||||
nSched = SelectScheduleRetrieveItem();
|
if (nSched != SCHED_NONE)
|
||||||
if (nSched != SCHED_NONE)
|
return nSched;
|
||||||
return nSched;
|
|
||||||
}
|
|
||||||
|
|
||||||
// no valid route! Wander instead
|
// no valid route! Wander instead
|
||||||
if (GetNavigator()->GetGoalType() == GOALTYPE_NONE) {
|
if (GetNavigator()->GetGoalType() == GOALTYPE_NONE) {
|
||||||
@ -476,17 +477,16 @@ int CNPC_ShadowWalker::SelectAlertSchedule()
|
|||||||
return SCHED_INVESTIGATE_SOUND;
|
return SCHED_INVESTIGATE_SOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CanPickkUpWeapons()) {
|
nSched = SelectScheduleRetrieveItem();
|
||||||
nSched = SelectScheduleRetrieveItem();
|
if (nSched != SCHED_NONE)
|
||||||
if (nSched != SCHED_NONE)
|
return nSched;
|
||||||
return nSched;
|
|
||||||
}
|
|
||||||
|
|
||||||
// no valid route! Wander instead
|
// no valid route! Wander instead
|
||||||
if (GetNavigator()->GetGoalType() == GOALTYPE_NONE) {
|
if (GetNavigator()->GetGoalType() == GOALTYPE_NONE) {
|
||||||
nSched = SelectScheduleWander();
|
nSched = SelectScheduleWander();
|
||||||
if (nSched == SCHED_NONE)
|
if (nSched != SCHED_NONE)
|
||||||
return SCHED_IDLE_STAND;
|
return nSched;
|
||||||
|
return SCHED_IDLE_STAND;
|
||||||
}
|
}
|
||||||
|
|
||||||
// valid route. Get moving
|
// valid route. Get moving
|
||||||
@ -640,8 +640,6 @@ int CNPC_ShadowWalker::TranslateSchedule(int scheduleType)
|
|||||||
Activity CNPC_ShadowWalker::NPC_TranslateActivity(Activity activity)
|
Activity CNPC_ShadowWalker::NPC_TranslateActivity(Activity activity)
|
||||||
{
|
{
|
||||||
switch (activity) {
|
switch (activity) {
|
||||||
case ACT_IDLE_MELEE:
|
|
||||||
return ACT_IDLE; // If the walker has a melee weapon but is in an idle state, don't raise the weapon
|
|
||||||
case ACT_RUN_AIM_SHOTGUN:
|
case ACT_RUN_AIM_SHOTGUN:
|
||||||
return ACT_RUN_AIM_RIFLE;
|
return ACT_RUN_AIM_RIFLE;
|
||||||
case ACT_WALK_AIM_SHOTGUN:
|
case ACT_WALK_AIM_SHOTGUN:
|
||||||
@ -650,6 +648,10 @@ Activity CNPC_ShadowWalker::NPC_TranslateActivity(Activity activity)
|
|||||||
return ACT_IDLE_ANGRY_SMG1;
|
return ACT_IDLE_ANGRY_SMG1;
|
||||||
case ACT_RANGE_ATTACK_SHOTGUN_LOW:
|
case ACT_RANGE_ATTACK_SHOTGUN_LOW:
|
||||||
return ACT_RANGE_ATTACK_SMG1_LOW;
|
return ACT_RANGE_ATTACK_SMG1_LOW;
|
||||||
|
case ACT_IDLE_MELEE:
|
||||||
|
case ACT_IDLE_ANGRY_MELEE: // If the walker has a melee weapon but is in an idle state, don't raise the weapon
|
||||||
|
if (m_NPCState == NPC_STATE_IDLE)
|
||||||
|
return ACT_IDLE_SUITCASE;
|
||||||
default:
|
default:
|
||||||
return BaseClass::NPC_TranslateActivity(activity);
|
return BaseClass::NPC_TranslateActivity(activity);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user