mirror of
https://github.com/UberGames/EF2GameSource.git
synced 2025-02-22 03:11:05 +00:00
Reformatting
This commit is contained in:
parent
f98ce24dec
commit
28213f6679
1 changed files with 122 additions and 129 deletions
|
@ -41,11 +41,10 @@ class RotateToEntity;
|
||||||
//
|
//
|
||||||
// Method of Use: State machine or called from another behavior
|
// Method of Use: State machine or called from another behavior
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
class DoAttack : public Behavior
|
class DoAttack : public Behavior {
|
||||||
{
|
public:
|
||||||
public: // States
|
// States
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
ATTACK_STATE_SETUP,
|
ATTACK_STATE_SETUP,
|
||||||
ATTACK_STATE_ROTATE,
|
ATTACK_STATE_ROTATE,
|
||||||
ATTACK_STATE_START_ANIM,
|
ATTACK_STATE_START_ANIM,
|
||||||
|
@ -54,21 +53,6 @@ class DoAttack : public Behavior
|
||||||
ATTACK_STATE_FAILED
|
ATTACK_STATE_FAILED
|
||||||
} attackStates_t;
|
} attackStates_t;
|
||||||
|
|
||||||
private: // Parameters
|
|
||||||
str _anim;
|
|
||||||
float _turnspeed;
|
|
||||||
bool _forceAttack;
|
|
||||||
str _rotateAnim;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void _setupRotate ( Actor &self );
|
|
||||||
void _rotate ( Actor &self );
|
|
||||||
void _playAttackAnim ( Actor &self );
|
|
||||||
|
|
||||||
bool _canAttack ( Actor &self );
|
|
||||||
void init ( Actor &self );
|
|
||||||
|
|
||||||
public:
|
|
||||||
CLASS_PROTOTYPE(DoAttack);
|
CLASS_PROTOTYPE(DoAttack);
|
||||||
|
|
||||||
void SetArgs(Event* ev);
|
void SetArgs(Event* ev);
|
||||||
|
@ -83,34 +67,43 @@ class DoAttack : public Behavior
|
||||||
void SetForceAttack(bool force);
|
void SetForceAttack(bool force);
|
||||||
void SetRotateAnim(const str& animName);
|
void SetRotateAnim(const str& animName);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void _setupRotate(Actor& self);
|
||||||
|
void _rotate(Actor& self);
|
||||||
|
void _playAttackAnim(Actor& self);
|
||||||
|
|
||||||
|
bool _canAttack(Actor& self);
|
||||||
|
void init(Actor& self);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
// Parameters
|
||||||
|
str _anim;
|
||||||
|
float _turnspeed;
|
||||||
|
bool _forceAttack;
|
||||||
|
str _rotateAnim;
|
||||||
|
|
||||||
unsigned int _state;
|
unsigned int _state;
|
||||||
RotateToEntity _rotateBehavior;
|
RotateToEntity _rotateBehavior;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
inline void DoAttack::SetAnim( const str &animName )
|
inline void DoAttack::SetAnim(const str& animName) {
|
||||||
{
|
|
||||||
_anim = animName;
|
_anim = animName;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void DoAttack::SetTurnSpeed( float turnSpeed )
|
inline void DoAttack::SetTurnSpeed(float turnSpeed) {
|
||||||
{
|
|
||||||
_turnspeed = turnSpeed;
|
_turnspeed = turnSpeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void DoAttack::SetForceAttack( bool force )
|
inline void DoAttack::SetForceAttack(bool force) {
|
||||||
{
|
|
||||||
_forceAttack = force;
|
_forceAttack = force;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void DoAttack::SetRotateAnim( const str &animName )
|
inline void DoAttack::SetRotateAnim(const str& animName) {
|
||||||
{
|
|
||||||
_rotateAnim = animName;
|
_rotateAnim = animName;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void DoAttack::Archive( Archiver &arc )
|
inline void DoAttack::Archive(Archiver& arc) {
|
||||||
{
|
|
||||||
Behavior::Archive(arc);
|
Behavior::Archive(arc);
|
||||||
|
|
||||||
// Archive Parameters
|
// Archive Parameters
|
||||||
|
|
Loading…
Reference in a new issue