mirror of
https://github.com/UberGames/EF2GameSource.git
synced 2025-02-21 11:01:40 +00:00
reformat
This commit is contained in:
parent
51e9513177
commit
d8bb50f96e
1 changed files with 179 additions and 191 deletions
|
@ -44,14 +44,12 @@ class GeneralCombatWithRangedWeapon;
|
|||
// Method of Use: State machine or another behavior
|
||||
//--------------------------------------------------------------
|
||||
|
||||
class RangedCombatWithWeapon : public Behavior
|
||||
{
|
||||
class RangedCombatWithWeapon : public Behavior {
|
||||
public:
|
||||
//------------------------------------
|
||||
// States
|
||||
//------------------------------------
|
||||
public:
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
RCWW_EVALUATE_OPTIONS,
|
||||
RCWW_CHANGE_WEAPON,
|
||||
RCWW_GENERAL_COMBAT,
|
||||
|
@ -61,26 +59,36 @@ class RangedCombatWithWeapon : public Behavior
|
|||
} RangedCombatWithWeapon_t;
|
||||
|
||||
|
||||
//------------------------------------
|
||||
// Parameters
|
||||
//------------------------------------
|
||||
private:
|
||||
str _aimAnim; // --Animation used to aim the weapon
|
||||
str _fireAnim; // --The animation used to fire the weapon
|
||||
float _approachDist;
|
||||
float _retreatDist;
|
||||
float _strafeChance;
|
||||
float _postureChangeChance;
|
||||
//-------------------------------------
|
||||
// Public Interface
|
||||
//-------------------------------------
|
||||
CLASS_PROTOTYPE(RangedCombatWithWeapon);
|
||||
|
||||
RangedCombatWithWeapon();
|
||||
~RangedCombatWithWeapon();
|
||||
|
||||
void SetArgs(Event* ev);
|
||||
void AnimDone(Event* ev);
|
||||
void PostureDone(Event* ev);
|
||||
|
||||
void Begin(Actor& self);
|
||||
BehaviorReturnCode_t Evaluate(Actor& self);
|
||||
void End(Actor& self);
|
||||
|
||||
virtual void Archive(Archiver& arc);
|
||||
|
||||
// Mutators
|
||||
void SetFireAnim(const str& anim);
|
||||
|
||||
protected:
|
||||
//-------------------------------------
|
||||
// Internal Functionality
|
||||
//-------------------------------------
|
||||
protected:
|
||||
void transitionToState ( RangedCombatWithWeapon_t state );
|
||||
void setInternalState ( RangedCombatWithWeapon_t state , const str &stateName );
|
||||
void init ( Actor &self );
|
||||
void think ();
|
||||
void updateEnemy ();
|
||||
void transitionToState(RangedCombatWithWeapon_t state);
|
||||
void setInternalState(RangedCombatWithWeapon_t state, const str& stateName);
|
||||
void init(Actor& self);
|
||||
void think();
|
||||
void updateEnemy();
|
||||
|
||||
bool checkShouldDoCorridorCombat();
|
||||
bool checkShouldDoGeneralCombat();
|
||||
|
@ -107,36 +115,20 @@ class RangedCombatWithWeapon : public Behavior
|
|||
BehaviorReturnCode_t evaluateStateCorridorCombat();
|
||||
void failureStateCorridorCombat();
|
||||
|
||||
|
||||
//-------------------------------------
|
||||
// Public Interface
|
||||
//-------------------------------------
|
||||
public:
|
||||
CLASS_PROTOTYPE( RangedCombatWithWeapon );
|
||||
|
||||
RangedCombatWithWeapon();
|
||||
~RangedCombatWithWeapon();
|
||||
|
||||
void SetArgs ( Event *ev );
|
||||
void AnimDone ( Event *ev );
|
||||
void PostureDone ( Event *ev );
|
||||
|
||||
void Begin ( Actor &self );
|
||||
BehaviorReturnCode_t Evaluate ( Actor &self );
|
||||
void End ( Actor &self );
|
||||
|
||||
virtual void Archive ( Archiver &arc );
|
||||
|
||||
// Mutators
|
||||
void SetFireAnim ( const str &anim );
|
||||
|
||||
|
||||
|
||||
private:
|
||||
//------------------------------------
|
||||
// Parameters
|
||||
//------------------------------------
|
||||
str _aimAnim; // --Animation used to aim the weapon
|
||||
str _fireAnim; // --The animation used to fire the weapon
|
||||
float _approachDist;
|
||||
float _retreatDist;
|
||||
float _strafeChance;
|
||||
float _postureChangeChance;
|
||||
|
||||
//-------------------------------------
|
||||
// Member Variables
|
||||
//-------------------------------------
|
||||
private:
|
||||
// Component Behaviors
|
||||
CloseInOnEnemy _gotoEnemy;
|
||||
GeneralCombatWithRangedWeapon _generalCombat;
|
||||
|
@ -144,7 +136,6 @@ class RangedCombatWithWeapon : public Behavior
|
|||
CoverCombatWithRangedWeapon _coverCombat;
|
||||
SelectBestWeapon _selectBestWeapon;
|
||||
|
||||
|
||||
// Member Vars
|
||||
int _state; //-- Maintains our Behavior's current State
|
||||
Actor* _self;
|
||||
|
@ -152,40 +143,37 @@ class RangedCombatWithWeapon : public Behavior
|
|||
float _nextSelectWeaponTime;
|
||||
float _recheckTime;
|
||||
// Constants
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
inline void RangedCombatWithWeapon::Archive( Archiver &arc )
|
||||
{
|
||||
Behavior::Archive( arc );
|
||||
inline void RangedCombatWithWeapon::Archive(Archiver& arc) {
|
||||
Behavior::Archive(arc);
|
||||
|
||||
// Archive Parameters
|
||||
arc.ArchiveString ( &_aimAnim );
|
||||
arc.ArchiveString ( &_fireAnim );
|
||||
arc.ArchiveFloat ( &_approachDist );
|
||||
arc.ArchiveFloat ( &_retreatDist );
|
||||
arc.ArchiveFloat ( &_strafeChance );
|
||||
arc.ArchiveFloat ( &_postureChangeChance );
|
||||
arc.ArchiveString(&_aimAnim);
|
||||
arc.ArchiveString(&_fireAnim);
|
||||
arc.ArchiveFloat(&_approachDist);
|
||||
arc.ArchiveFloat(&_retreatDist);
|
||||
arc.ArchiveFloat(&_strafeChance);
|
||||
arc.ArchiveFloat(&_postureChangeChance);
|
||||
|
||||
// Archive Components
|
||||
arc.ArchiveObject ( &_gotoEnemy );
|
||||
arc.ArchiveObject ( &_generalCombat );
|
||||
arc.ArchiveObject ( &_corridorCombat );
|
||||
arc.ArchiveObject ( &_coverCombat );
|
||||
arc.ArchiveObject ( &_selectBestWeapon );
|
||||
arc.ArchiveObject(&_gotoEnemy);
|
||||
arc.ArchiveObject(&_generalCombat);
|
||||
arc.ArchiveObject(&_corridorCombat);
|
||||
arc.ArchiveObject(&_coverCombat);
|
||||
arc.ArchiveObject(&_selectBestWeapon);
|
||||
|
||||
// Archive Member Variables
|
||||
arc.ArchiveInteger ( &_state );
|
||||
arc.ArchiveObjectPointer ( ( Class ** )&_self );
|
||||
arc.ArchiveSafePointer( &_currentEnemy );
|
||||
arc.ArchiveFloat ( &_nextSelectWeaponTime );
|
||||
arc.ArchiveFloat ( &_recheckTime );
|
||||
}
|
||||
arc.ArchiveInteger(&_state);
|
||||
arc.ArchiveObjectPointer((Class **)&_self);
|
||||
arc.ArchiveSafePointer(&_currentEnemy);
|
||||
arc.ArchiveFloat(&_nextSelectWeaponTime);
|
||||
arc.ArchiveFloat(&_recheckTime);
|
||||
}
|
||||
|
||||
inline void RangedCombatWithWeapon::SetFireAnim( const str &anim )
|
||||
{
|
||||
inline void RangedCombatWithWeapon::SetFireAnim(const str &anim) {
|
||||
_fireAnim = anim;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* __RANGEDCOMBAT_WITH_WEAPON_HPP__ */
|
||||
|
|
Loading…
Reference in a new issue