Pol
Revision:cb584c9
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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
{
26
ACTION__LOWEST
= 0x00,
27
ACTION_WALK_UNARMED
= 0x00,
28
ACTION_WALK_ARMED
= 0x01,
29
ACTION_RUN1
= 0x02,
30
ACTION_RUN2
= 0x03,
31
ACTION_LOOK_AROUND
= 0x05,
32
ACTION_LOOK_DOWN
= 0x06,
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 */
37
ACTION_HUMAN_ATACK_THRUST
= 0x0A,
38
ACTION_HUMAN_ATTACK_BIGSWING
= 0x0B,
/* big overhead swing */
39
ACTION_ATTACK4
= 0x0C,
/* hmm, sort of up/down */
40
ACTION_ATTACK5
= 0x0D,
41
ACTION_ATTACK6
= 0x0E,
42
ACTION_READY2
= 0x0F,
43
ACTION_CAST_SPELL1
= 0x10,
44
ACTION_CAST_SPELL2
= 0x11,
45
ACTION_HUMAN_SHOOT_BOW
= 0x12,
46
ACTION_SHOOT_CROSSBOW
= 0x13,
47
ACTION_GOT_HIT
= 0x14,
48
ACTION_STRUCK_DOWN_BACKWARD
= 0x15,
49
ACTION_STRUCK_DOWN_FORWARD
= 0x16,
50
ACTION_RIDINGHORSE1
= 0x17,
51
ACTION_RIDINGHORSE2
= 0x18,
52
ACTION_RIDINGHORSE3
= 0x19,
53
ACTION_RIDINGHORSE4
= 0x1A,
/* a type of swing */
54
ACTION_RIDINGHORSE5
= 0x1B,
/* shoot bow */
55
ACTION_RIDINGHORSE6
= 0x1C,
/* shoot crossbow */
56
ACTION_RIDINGHORSE7
= 0x1D,
57
ACTION_DODGE1
= 0x1E,
/* shield block? */
58
ACTION_UNKNOWN1
= 0x1F,
59
60
61
ACTION_BOW
= 0x20,
62
ACTION_SALUTE
= 0x21,
63
ACTION_EAT
= 0x22,
64
ACTION__HIGHEST
= 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
73
enum
DIRECTION_FLAG_OLD
74
{
75
BACKWARD
= 1,
76
FORWARD
= 0
77
};
78
enum
REPEAT_FLAG_OLD
79
{
80
REPEAT
= 1,
81
NOREPEAT
= 0
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
88
struct
MobileTranslate
89
{
90
struct
OldAnimDef
91
{
92
bool
valid
;
93
u16
action
;
94
u16
framecount
;
95
u16
repeatcount
;
96
u8
backward
;
97
u8
repeatflag
;
98
u8
delay
;
99
OldAnimDef
();
100
};
101
struct
NewAnimDef
102
{
103
bool
valid
;
104
u16
anim
;
105
u16
action
;
106
u8
subaction
;
107
NewAnimDef
();
108
};
109
std::vector<u16>
graphics
;
110
OldAnimDef
old_anim[
ACTION__HIGHEST
+ 1];
111
NewAnimDef
new_anim[
ACTION__HIGHEST
+ 1];
112
bool
supports_mount
;
113
MobileTranslate
();
114
bool
has_graphic(
u16
graphic )
const
;
115
size_t
estimateSize()
const
;
116
};
117
}
118
}
119
#endif
Pol::Core::MobileTranslate::OldAnimDef::framecount
u16 framecount
Definition:
action.h:94
u8
unsigned char u8
Definition:
rawtypes.h:25
Pol::Core::ACTION_ATTACK6
Definition:
action.h:41
Pol::Core::ACTION_WARMODE1
Definition:
action.h:33
Pol::Core::ACTION_UNKNOWN1
Definition:
action.h:58
Pol::Core::ACTION_SALUTE
Definition:
action.h:62
Pol::Core::ACTION__LOWEST
Definition:
action.h:26
Pol::Core::BACKWARD
Definition:
action.h:75
Pol::Core::MobileTranslate::NewAnimDef
Definition:
action.h:101
Pol::Core::MobileTranslate
Definition:
action.h:88
Pol::Core::MobileTranslate::OldAnimDef::repeatflag
u8 repeatflag
Definition:
action.h:97
Pol::Core::ACTION_ATTACK4
Definition:
action.h:39
Pol::Core::ACTION_WALK_ARMED
Definition:
action.h:28
Pol::Core::ACTION_HUMAN_ATTACK_BIGSWING
Definition:
action.h:38
Pol::Core::ACTION_STRUCK_DOWN_FORWARD
Definition:
action.h:49
Pol::Core::ACTION_CAST_SPELL1
Definition:
action.h:43
Pol::Core::ACTION_RIDINGHORSE2
Definition:
action.h:51
Pol::Core::MobileTranslate::OldAnimDef::action
u16 action
Definition:
action.h:93
Pol::Core::MobileTranslate::graphics
std::vector< u16 > graphics
Definition:
action.h:109
Pol::Core::MobileTranslate::NewAnimDef::anim
u16 anim
Definition:
action.h:104
Pol::Core::MobileTranslate::NewAnimDef::valid
bool valid
Definition:
action.h:103
Pol::Core::ACTION_READY2
Definition:
action.h:42
Pol::Core::ACTION_HUMAN_ATACK_THRUST
Definition:
action.h:37
Pol::Core::ACTION_HUMAN_ATTACK
Definition:
action.h:36
Pol::Core::ACTION_RUN1
Definition:
action.h:29
Pol::Core::ACTION_STRUCK_DOWN_BACKWARD
Definition:
action.h:48
u16
unsigned short u16
Definition:
rawtypes.h:26
Pol::Core::ACTION_RIDINGHORSE6
Definition:
action.h:55
Pol::Core::ACTION_BOW
Definition:
action.h:61
Pol::Core::MobileTranslate::NewAnimDef::action
u16 action
Definition:
action.h:105
Pol::Core::ACTION_WALK_UNARMED
Definition:
action.h:27
Pol::Core::ACTION_CAST_SPELL2
Definition:
action.h:44
Pol::Core::MobileTranslate::OldAnimDef::valid
bool valid
Definition:
action.h:92
Pol::Core::MobileTranslate::OldAnimDef
Definition:
action.h:90
Pol::Core::MobileTranslate::OldAnimDef::delay
u8 delay
Definition:
action.h:98
Pol::Core::REPEAT_FLAG_OLD
REPEAT_FLAG_OLD
Definition:
action.h:78
Pol::Core::ACTION_DODGE1
Definition:
action.h:57
Pol::Core::ACTION_HUMAN_SHOOT_BOW
Definition:
action.h:45
Pol::Mobile::Character
Definition:
charactr.h:334
Pol::Core::REPEAT
Definition:
action.h:80
Pol::Core::ACTION_SHOOT_CROSSBOW
Definition:
action.h:46
Pol::Core::ACTION_LOOK_AROUND
Definition:
action.h:31
Pol::Core::MobileTranslate::OldAnimDef::backward
u8 backward
Definition:
action.h:96
Pol::Core::ACTION_GOT_HIT
Definition:
action.h:47
Pol::Core::FilterType::Mobile
Pol::Core::FORWARD
Definition:
action.h:76
Pol::Core::ACTION_RIDINGHORSE3
Definition:
action.h:52
Pol::Core::NOREPEAT
Definition:
action.h:81
Pol::Core::ACTION__HIGHEST
Definition:
action.h:64
Pol::Core::MobileTranslate::supports_mount
bool supports_mount
Definition:
action.h:112
Pol::Core::ACTION_WARMODE2
Definition:
action.h:34
Pol::Core::ACTION_EAT
Definition:
action.h:63
Pol::Core::ACTION_RUN2
Definition:
action.h:30
Pol::Core::UACTION
UACTION
Definition:
action.h:24
Pol::Core::ACTION_ATTACK5
Definition:
action.h:40
Pol::Core::MobileTranslate::OldAnimDef::repeatcount
u16 repeatcount
Definition:
action.h:95
Pol::Core::DIRECTION_FLAG_OLD
DIRECTION_FLAG_OLD
Definition:
action.h:73
Pol::Core::UACTION_IS_VALID
bool UACTION_IS_VALID(unsigned short action)
Definition:
action.h:67
Pol
Definition:
berror.cpp:12
Pol::Core::ACTION_RIDINGHORSE4
Definition:
action.h:53
Pol::Core::ACTION_RIDINGHORSE1
Definition:
action.h:50
Pol::Core::ACTION_RIDINGHORSE5
Definition:
action.h:54
Pol::Core::ACTION_RIDINGHORSE7
Definition:
action.h:56
Pol::Core::send_action_to_inrange
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
Pol::Core::MobileTranslate::NewAnimDef::subaction
u8 subaction
Definition:
action.h:106
Pol::Core::ACTION_LOOK_DOWN
Definition:
action.h:32
pol
action.h
Generated on Wed Oct 10 2018 02:41:54 for Pol by
1.8.11