Shadow Walker: Animation fixes. Deprecated weapon pickup in FGD; not working currently.

This commit is contained in:
1upD 2018-10-22 20:59:32 -04:00
parent 289a9b4f6e
commit 9f999c4c87
2 changed files with 29 additions and 26 deletions

View File

@ -50,16 +50,17 @@
0 : "Can 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." =
[
0 : "Cannot Pick Up Guns"
1 : "Can Pick Up Guns"
]
// // 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"
// ]
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 DisableOpenDoors(void) : "Prevent this NPC from opening doors."
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 EnablePickupWeapons(void) : "Allow this NPC to pick up any weapon off of the ground."
// input DisablePickupWeapons(void) : "Prevent this NPC from picking up weapons."
]

View File

@ -21,6 +21,8 @@
#include "entitylist.h"
#include "activitylist.h"
#include "ai_basenpc.h"
#include "ai_blended_movement.h"
#include "ai_behavior_actbusy.h"
#include "engine/IEngineSound.h"
#include "basehlcombatweapon_shared.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:
void Precache( void );
@ -57,9 +61,8 @@ public:
virtual int SelectIdleSchedule();
virtual int SelectAlertSchedule();
virtual int SelectCombatSchedule();
virtual bool CanPickkUpWeapons() { return m_bCanPickupWeapons; }
virtual float GetSequenceGroundSpeed(CStudioHdr *pStudioHdr, int iSequence);
Activity NPC_TranslateActivity(Activity eNewActivity);
virtual Activity NPC_TranslateActivity(Activity eNewActivity);
virtual int TranslateSchedule(int scheduleType);
// Sounds
@ -360,7 +363,7 @@ int CNPC_ShadowWalker::SelectFailSchedule(int failedSchedule, int failedTask, AI
//-----------------------------------------------------------------------------
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));
if (pWeapon)
@ -433,11 +436,9 @@ int CNPC_ShadowWalker::SelectIdleSchedule()
return SCHED_INVESTIGATE_SOUND;
}
if (CanPickkUpWeapons()) {
nSched = SelectScheduleRetrieveItem();
if (nSched != SCHED_NONE)
return nSched;
}
nSched = SelectScheduleRetrieveItem();
if (nSched != SCHED_NONE)
return nSched;
// no valid route! Wander instead
if (GetNavigator()->GetGoalType() == GOALTYPE_NONE) {
@ -476,17 +477,16 @@ int CNPC_ShadowWalker::SelectAlertSchedule()
return SCHED_INVESTIGATE_SOUND;
}
if (CanPickkUpWeapons()) {
nSched = SelectScheduleRetrieveItem();
if (nSched != SCHED_NONE)
return nSched;
}
nSched = SelectScheduleRetrieveItem();
if (nSched != SCHED_NONE)
return nSched;
// no valid route! Wander instead
if (GetNavigator()->GetGoalType() == GOALTYPE_NONE) {
nSched = SelectScheduleWander();
if (nSched == SCHED_NONE)
return SCHED_IDLE_STAND;
if (nSched != SCHED_NONE)
return nSched;
return SCHED_IDLE_STAND;
}
// valid route. Get moving
@ -640,8 +640,6 @@ int CNPC_ShadowWalker::TranslateSchedule(int scheduleType)
Activity CNPC_ShadowWalker::NPC_TranslateActivity(Activity 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:
return ACT_RUN_AIM_RIFLE;
case ACT_WALK_AIM_SHOTGUN:
@ -650,6 +648,10 @@ Activity CNPC_ShadowWalker::NPC_TranslateActivity(Activity activity)
return ACT_IDLE_ANGRY_SMG1;
case ACT_RANGE_ATTACK_SHOTGUN_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:
return BaseClass::NPC_TranslateActivity(activity);
}