mirror of
https://github.com/UberGames/EF2GameSource.git
synced 2025-02-21 11:01:40 +00:00
reformat
This commit is contained in:
parent
5477f6b6b8
commit
aeb607dfb8
1 changed files with 140 additions and 145 deletions
|
@ -1,145 +1,140 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Logfile:: /Code/DLLs/game/work.hpp $
|
// $Logfile:: /Code/DLLs/game/work.hpp $
|
||||||
// $Revision:: 169 $
|
// $Revision:: 169 $
|
||||||
// $Author:: sketcher $
|
// $Author:: sketcher $
|
||||||
// $Date:: 4/26/02 2:22p $
|
// $Date:: 4/26/02 2:22p $
|
||||||
//
|
//
|
||||||
// Copyright (C) 2002 by Ritual Entertainment, Inc.
|
// Copyright (C) 2002 by Ritual Entertainment, Inc.
|
||||||
// All rights reserved.
|
// All rights reserved.
|
||||||
//
|
//
|
||||||
// This source may not be distributed and/or modified without
|
// This source may not be distributed and/or modified without
|
||||||
// expressly written permission by Ritual Entertainment, Inc.
|
// expressly written permission by Ritual Entertainment, Inc.
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// DESCRIPTION:
|
// DESCRIPTION:
|
||||||
// CooridorCombatWithRangedWeapon Behavior Definition
|
// CooridorCombatWithRangedWeapon Behavior Definition
|
||||||
//
|
//
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
|
|
||||||
//==============================
|
//==============================
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
//==============================
|
//==============================
|
||||||
class UseAlarm;
|
class UseAlarm;
|
||||||
|
|
||||||
#ifndef __USE_ALARM_HPP__
|
#ifndef __USE_ALARM_HPP__
|
||||||
#define __USE_ALARM_HPP__
|
#define __USE_ALARM_HPP__
|
||||||
|
|
||||||
#include "behavior.h"
|
#include "behavior.h"
|
||||||
#include "behaviors_general.h"
|
#include "behaviors_general.h"
|
||||||
#include "gotoHelperNode.hpp"
|
#include "gotoHelperNode.hpp"
|
||||||
|
|
||||||
//------------------------- CLASS ------------------------------
|
//------------------------- CLASS ------------------------------
|
||||||
//
|
//
|
||||||
// Name: UseAlarm
|
// Name: UseAlarm
|
||||||
// Base Class: Behavior
|
// Base Class: Behavior
|
||||||
//
|
//
|
||||||
// Description: Makes the Actor use Work Helper Nodes
|
// Description: Makes the Actor use Work Helper Nodes
|
||||||
//
|
//
|
||||||
// Method of Use: Statemachine or another behavior
|
// Method of Use: Statemachine or another behavior
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
class UseAlarm : public Behavior
|
class UseAlarm : public Behavior {
|
||||||
{
|
public:
|
||||||
//------------------------------------
|
//------------------------------------
|
||||||
// States
|
// States
|
||||||
//------------------------------------
|
//------------------------------------
|
||||||
public:
|
typedef enum {
|
||||||
typedef enum
|
USE_ALARM_FIND_NODE,
|
||||||
{
|
USE_ALARM_MOVE_TO_NODE,
|
||||||
USE_ALARM_FIND_NODE,
|
USE_ALARM_AT_NODE,
|
||||||
USE_ALARM_MOVE_TO_NODE,
|
USE_ALARM_WAIT_ON_ANIM,
|
||||||
USE_ALARM_AT_NODE,
|
USE_ALARM_ROTATE_TO_ENEMY,
|
||||||
USE_ALARM_WAIT_ON_ANIM,
|
USE_ALARM_SUCCESSFUL,
|
||||||
USE_ALARM_ROTATE_TO_ENEMY,
|
USE_ALARM_FAILED
|
||||||
USE_ALARM_SUCCESSFUL,
|
} useAlarmStates_t;
|
||||||
USE_ALARM_FAILED
|
|
||||||
} useAlarmStates_t;
|
//-------------------------------------
|
||||||
|
// Public Interface
|
||||||
//------------------------------------
|
//-------------------------------------
|
||||||
// Parameters
|
CLASS_PROTOTYPE(UseAlarm);
|
||||||
//------------------------------------
|
UseAlarm();
|
||||||
private: // Parameters
|
~UseAlarm();
|
||||||
str _movementAnimName ; // anim to play to move to work node, default is "walk"
|
|
||||||
float _maxDistance; // maximum distance to look for node
|
void SetArgs(Event* ev);
|
||||||
|
void AnimDone(Event* ev);
|
||||||
//-------------------------------------
|
void HandleNodeCommand(Event* ev);
|
||||||
// Internal Functionality
|
|
||||||
//-------------------------------------
|
void Begin(Actor& self);
|
||||||
protected:
|
BehaviorReturnCode_t Evaluate(Actor& self);
|
||||||
void transitionToState ( useAlarmStates_t state );
|
void End(Actor& self);
|
||||||
void setInternalState ( useAlarmStates_t state , const str &stateName );
|
|
||||||
void init ( Actor &self );
|
virtual void Archive(Archiver& arc);
|
||||||
void think ();
|
|
||||||
|
protected:
|
||||||
void setupStateFindNode ();
|
//-------------------------------------
|
||||||
BehaviorReturnCode_t evaluateStateFindNode ();
|
// Internal Functionality
|
||||||
void failureStateFindNode ( const str& failureReason );
|
//-------------------------------------
|
||||||
|
void transitionToState(useAlarmStates_t state);
|
||||||
void setupStateMoveToNode ();
|
void setInternalState(useAlarmStates_t state, const str& stateName);
|
||||||
BehaviorReturnCode_t evaluateStateMoveToNode ();
|
void init(Actor &self);
|
||||||
void failureStateMoveToNode ( const str& failureReason );
|
void think();
|
||||||
|
|
||||||
void setupStateAtNode ();
|
void setupStateFindNode();
|
||||||
BehaviorReturnCode_t evaluateStateAtNode ();
|
BehaviorReturnCode_t evaluateStateFindNode();
|
||||||
void failureStateAtNode ( const str& failureReason );
|
void failureStateFindNode(const str& failureReason);
|
||||||
|
|
||||||
void setupStateWaitOnAnim ();
|
void setupStateMoveToNode();
|
||||||
BehaviorReturnCode_t evaluateStateWaitOnAnim ();
|
BehaviorReturnCode_t evaluateStateMoveToNode();
|
||||||
void failureStateWaitOnAnim ( const str& failureReason );
|
void failureStateMoveToNode(const str& failureReason);
|
||||||
|
|
||||||
void setupStateRotateToEnemy ();
|
void setupStateAtNode();
|
||||||
BehaviorReturnCode_t evaluateStateRotateToEnemy ();
|
BehaviorReturnCode_t evaluateStateAtNode();
|
||||||
void failureStateRotateToEnemy ( const str& failureReason );
|
void failureStateAtNode(const str& failureReason);
|
||||||
|
|
||||||
|
void setupStateWaitOnAnim();
|
||||||
//-------------------------------------
|
BehaviorReturnCode_t evaluateStateWaitOnAnim();
|
||||||
// Public Interface
|
void failureStateWaitOnAnim(const str& failureReason);
|
||||||
//-------------------------------------
|
|
||||||
public:
|
void setupStateRotateToEnemy();
|
||||||
CLASS_PROTOTYPE( UseAlarm );
|
BehaviorReturnCode_t evaluateStateRotateToEnemy();
|
||||||
UseAlarm();
|
void failureStateRotateToEnemy(const str& failureReason);
|
||||||
~UseAlarm();
|
|
||||||
|
|
||||||
void SetArgs ( Event *ev );
|
private:
|
||||||
void AnimDone ( Event *ev );
|
//------------------------------------
|
||||||
void HandleNodeCommand ( Event *ev );
|
// Parameters
|
||||||
|
//------------------------------------
|
||||||
void Begin ( Actor &self );
|
str _movementAnimName; // anim to play to move to work node, default is "walk"
|
||||||
BehaviorReturnCode_t Evaluate ( Actor &self );
|
float _maxDistance; // maximum distance to look for node
|
||||||
void End ( Actor &self );
|
|
||||||
|
// Component Behaviors
|
||||||
virtual void Archive ( Archiver &arc );
|
GotoHelperNode _gotoHelperNode;
|
||||||
|
RotateToEntity _rotateToEntity;
|
||||||
private: // Component Behaviors
|
|
||||||
GotoHelperNode _gotoHelperNode;
|
// Member Variables
|
||||||
RotateToEntity _rotateToEntity;
|
HelperNodePtr _node;
|
||||||
|
unsigned int _state;
|
||||||
private: // Member Variables
|
bool _animDone;
|
||||||
HelperNodePtr _node;
|
Actor* _self;
|
||||||
unsigned int _state;
|
};
|
||||||
bool _animDone;
|
|
||||||
Actor* _self;
|
inline void UseAlarm::Archive(Archiver& arc) {
|
||||||
|
Behavior::Archive(arc);
|
||||||
};
|
|
||||||
|
// Archive Parameters
|
||||||
inline void UseAlarm::Archive( Archiver &arc )
|
arc.ArchiveString(&_movementAnimName);
|
||||||
{
|
arc.ArchiveFloat(&_maxDistance);
|
||||||
Behavior::Archive ( arc );
|
|
||||||
|
// Archive Components
|
||||||
// Archive Parameters
|
arc.ArchiveObject(&_gotoHelperNode);
|
||||||
arc.ArchiveString ( &_movementAnimName);
|
arc.ArchiveObject(&_rotateToEntity);
|
||||||
arc.ArchiveFloat ( &_maxDistance );
|
|
||||||
|
|
||||||
// Archive Components
|
// Archive Member Vars
|
||||||
arc.ArchiveObject ( &_gotoHelperNode );
|
arc.ArchiveSafePointer(&_node);
|
||||||
arc.ArchiveObject ( &_rotateToEntity );
|
arc.ArchiveUnsigned(&_state);
|
||||||
|
arc.ArchiveBool(&_animDone);
|
||||||
|
arc.ArchiveObjectPointer((Class **)&_self);
|
||||||
// Archive Member Vars
|
}
|
||||||
arc.ArchiveSafePointer ( &_node );
|
|
||||||
arc.ArchiveUnsigned ( &_state );
|
#endif /* __USE_ALARM__ */
|
||||||
arc.ArchiveBool ( &_animDone );
|
|
||||||
arc.ArchiveObjectPointer ( ( Class ** )&_self );
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* __USE_ALARM__ */
|
|
||||||
|
|
Loading…
Reference in a new issue