Pol  Revision:f37d500
action.h
Go to the documentation of this file.
1 
8 #ifndef ACTION_H
9 #define ACTION_H
10 
11 #include <cstddef>
12 #include <vector>
13 
14 #include "../clib/rawtypes.h"
15 
16 namespace Pol
17 {
18 namespace Mobile
19 {
20 class Character;
21 }
22 namespace Core
23 {
24 enum UACTION
25 {
29  ACTION_RUN1 = 0x02,
30  ACTION_RUN2 = 0x03,
33  ACTION_WARMODE1 = 0x07, /* hand down */
34  ACTION_WARMODE2 = 0x08, /* hand up */
35 
36  ACTION_HUMAN_ATTACK = 0x9, /* hand to hand or sword, not bow */
38  ACTION_HUMAN_ATTACK_BIGSWING = 0x0B, /* big overhead swing */
39  ACTION_ATTACK4 = 0x0C, /* hmm, sort of up/down */
42  ACTION_READY2 = 0x0F,
53  ACTION_RIDINGHORSE4 = 0x1A, /* a type of swing */
54  ACTION_RIDINGHORSE5 = 0x1B, /* shoot bow */
55  ACTION_RIDINGHORSE6 = 0x1C, /* shoot crossbow */
57  ACTION_DODGE1 = 0x1E, /* shield block? */
59 
60 
61  ACTION_BOW = 0x20,
62  ACTION_SALUTE = 0x21,
63  ACTION_EAT = 0x22,
65 };
66 
67 inline bool UACTION_IS_VALID( unsigned short action )
68 {
69  // don't need to check >= ACTION__LOWEST since it's 0. avoids a warning.
70  return ( action <= ACTION__HIGHEST );
71 }
72 
74 {
75  BACKWARD = 1,
76  FORWARD = 0
77 };
79 {
80  REPEAT = 1,
82 };
83 void send_action_to_inrange( const Mobile::Character* obj, UACTION action,
84  unsigned short framecount = 0x05, unsigned short repeatcount = 0x01,
85  DIRECTION_FLAG_OLD backward = FORWARD,
86  REPEAT_FLAG_OLD repeatflag = NOREPEAT, unsigned char delay = 0x01 );
87 
89 {
90  struct OldAnimDef
91  {
92  bool valid;
99  OldAnimDef();
100  };
101  struct NewAnimDef
102  {
103  bool valid;
107  NewAnimDef();
108  };
109  std::vector<u16> graphics;
113  MobileTranslate();
114  bool has_graphic( u16 graphic ) const;
115  size_t estimateSize() const;
116 };
117 }
118 }
119 #endif
unsigned char u8
Definition: rawtypes.h:25
std::vector< u16 > graphics
Definition: action.h:109
unsigned short u16
Definition: rawtypes.h:26
REPEAT_FLAG_OLD
Definition: action.h:78
DIRECTION_FLAG_OLD
Definition: action.h:73
bool UACTION_IS_VALID(unsigned short action)
Definition: action.h:67
Definition: berror.cpp:12
void send_action_to_inrange(const Mobile::Character *obj, UACTION action, unsigned short framecount=0x05, unsigned short repeatcount=0x01, DIRECTION_FLAG_OLD backward=FORWARD, REPEAT_FLAG_OLD repeatflag=NOREPEAT, unsigned char delay=0x01)
Definition: bowsalut.cpp:180