| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- /*
- ** Command & Conquer Renegade(tm)
- ** Copyright 2025 Electronic Arts Inc.
- **
- ** This program is free software: you can redistribute it and/or modify
- ** it under the terms of the GNU General Public License as published by
- ** the Free Software Foundation, either version 3 of the License, or
- ** (at your option) any later version.
- **
- ** This program is distributed in the hope that it will be useful,
- ** but WITHOUT ANY WARRANTY; without even the implied warranty of
- ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ** GNU General Public License for more details.
- **
- ** You should have received a copy of the GNU General Public License
- ** along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- /***********************************************************************************************
- *** Confidential - Westwood Studios ***
- ***********************************************************************************************
- * *
- * Project Name : Commando *
- * *
- * $Archive:: /Commando/Code/Combat/action.h $*
- * *
- * $Author:: Patrick $*
- * *
- * $Modtime:: 10/09/01 2:15p $*
- * *
- * $Revision:: 47 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
- #ifndef ACTION_H
- #define ACTION_H
- #ifndef ALWAYS_H
- #include "always.h"
- #endif
- #ifndef VECTOR3_H
- #include "vector3.h"
- #endif
- #ifndef GAMEOBJREF_H
- #include "gameobjref.h"
- #endif
- #ifndef WWSTRING_H
- #include "wwstring.h"
- #endif
- #ifndef ACTIONPARAMS_H
- #include "actionparams.h"
- #endif
- /*
- **
- */
- class ActionCodeClass;
- class SmartGameObj;
- /*
- **
- */
- class SafeActionParamsStruct : public ActionParamsStruct {
- public:
- SafeActionParamsStruct & operator = (const ActionParamsStruct & src); // Assignment operator.
- bool Save( ChunkSaveClass & csave );
- bool Load( ChunkLoadClass & cload );
- GameObjReference MoveObjectRef;
- GameObjReference AttackObjectRef;
- GameObjReference LookObjectRef;
- StringClass SafeAnimationName;
- StringClass SafeConversationName;
- };
- /*
- **
- */
- class ActionClass {
- public:
- ActionClass( SmartGameObj *obj );
- virtual ~ActionClass( void );
- bool Save( ChunkSaveClass & csave );
- bool Load( ChunkLoadClass & cload );
- SmartGameObj * Get_Action_Obj( void ) { return ActionObj; }
- SafeActionParamsStruct & Get_Parameters( void ) { return Parameters; }
- bool Is_Acting( void );
- bool Is_Animating( void );
- void Begin_Hibernation( void );
- void End_Hibernation( void );
- bool Reset( float priority );
- bool Follow_Input( const ActionParamsStruct & parameters );
- bool Stand( const ActionParamsStruct & parameters );
- bool Play_Animation( const ActionParamsStruct & parameters );
- bool Goto( const ActionParamsStruct & parameters );
- bool Enter_Exit( const ActionParamsStruct & parameters );
- bool Dive( const ActionParamsStruct & parameters );
- bool Attack( const ActionParamsStruct & parameters );
- bool Face_Location( const ActionParamsStruct & parameters );
- bool Have_Conversation( const ActionParamsStruct & parameters );
- bool Dock_Vehicle( const ActionParamsStruct & parameters );
- bool Modify( const ActionParamsStruct & parameters, bool modify_move, bool modify_attack );
- void Act( void );
- unsigned int Get_Act_Count( void ) { return ActCount; }
- bool Is_Active( void );
- bool Is_Busy( void );
- bool Is_Paused( void ) const { return IsPaused; }
- void Pause( bool onoff) { IsPaused = onoff; }
- void Done( int reason ); // Notify the obserever
- protected:
- void Notify_Completed( int observer_id, int action_id, int reason ); // Notify the obserever
- bool Request_Action( ActionCodeClass * action, const ActionParamsStruct & parameters );
- SmartGameObj * ActionObj;
- ActionCodeClass * ActionCode;
- SafeActionParamsStruct Parameters;
- bool IsPaused;
- unsigned int ActCount; // TSS - diagnostic
- void Set_Action_Code( ActionCodeClass * code );
- };
- // Debugging
- void Toggle_Display_Findpaths( void );
- #endif // ACTION_H
|