Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
action.h
1/* Renegade Scripts.dll
2 Copyright 2013 Tiberian Technologies
3
4 This file is part of the Renegade scripts.dll
5 The Renegade scripts.dll is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 2, or (at your option) any later
8 version. See the file COPYING for more details.
9 In addition, an exemption is given to allow Run Time Dynamic Linking of this code with any closed source module that does not contain code covered by this licence.
10 Only the source code to the module(s) containing the licenced code has to be released.
11*/
12#ifndef TT_INCLUDE_ACTION_H
13#define TT_INCLUDE_ACTION_H
14#include "scripts.h"
15#include "engine_io.h"
16#include "ReferencerClass.h"
17class ActionCodeClass;
18class SmartGameObj;
19class SafeActionParamsStruct : public ActionParamsStruct {
20public:
21 SafeActionParamsStruct & operator = (const ActionParamsStruct & src);
22 bool Save( ChunkSaveClass & csave );
23 bool Load( ChunkLoadClass & cload );
24 ReferencerClass MoveObjectRef;
25 ReferencerClass AttackObjectRef;
26 ReferencerClass LookObjectRef;
27 StringClass SafeAnimationName;
28 StringClass SafeConversationName;
29};
30class ActionClass {
31public:
32 ActionClass( SmartGameObj *obj );
33 virtual ~ActionClass( void );
34 bool Save( ChunkSaveClass & csave );
35 bool Load( ChunkLoadClass & cload );
36 SmartGameObj * Get_Action_Obj( void ) { return ActionObj; }
37 SafeActionParamsStruct & Get_Parameters( void ) { return Parameters; }
38 SCRIPTS_API bool Is_Acting( void );
39 bool Is_Animating( void );
40 void Begin_Hibernation( void );
41 void End_Hibernation( void );
42 bool Reset( float priority );
43 bool Follow_Input( const ActionParamsStruct & parameters );
44 bool Stand( const ActionParamsStruct & parameters );
45 bool Play_Animation( const ActionParamsStruct & parameters );
46 bool Goto( const ActionParamsStruct & parameters );
47 bool Enter_Exit( const ActionParamsStruct & parameters );
48 bool Dive( const ActionParamsStruct & parameters );
49 bool Attack( const ActionParamsStruct & parameters );
50 bool Face_Location( const ActionParamsStruct & parameters );
51 bool Have_Conversation( const ActionParamsStruct & parameters );
52 bool Dock_Vehicle( const ActionParamsStruct & parameters );
53 bool Modify( const ActionParamsStruct & parameters, bool modify_move, bool modify_attack );
54 void Act( void );
55 unsigned int Get_Act_Count( void ) { return ActCount; }
56 bool Is_Active( void );
57 bool Is_Busy( void );
58 bool Is_Paused( void ) const { return IsPaused; }
59 void Pause( bool onoff) { IsPaused = onoff; }
60 void Done( int reason );
61protected:
62 void Notify_Completed( int observer_id, int action_id, int reason );
63 bool Request_Action( ActionCodeClass * action, const ActionParamsStruct & parameters );
64 SmartGameObj * ActionObj;
65 ActionCodeClass * ActionCode;
66 SafeActionParamsStruct Parameters;
67 bool IsPaused;
68 unsigned int ActCount;
69 void Set_Action_Code( ActionCodeClass * code );
70};
71#endif