ScummVM API documentation
animation.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef WORLD_ACTORS_ANIMATION_H
23 #define WORLD_ACTORS_ANIMATION_H
24 
25 namespace Ultima {
26 namespace Ultima8 {
27 namespace Animation {
28 
29 enum Sequence {
30  walk = 0,
31  run = 1,
32  stand = 2,
33  jumpUp = 3,
34  standUp = 4,
35  readyWeapon = 5,
36  unreadyWeapon = 6,
37  attack = 7,
38  advance = 8,
39  retreat = 9,
40  runningJump = 10,
41  shakeHead = 11,
42  step = 12,
43  stumbleBackwards = 13,
44  die = 14,
45  combatStand = 15,
46  land = 16,
47  jump = 17,
48  airwalkJump = 18,
49  //19-26: climbing up on increasingly high objects
50  climb16 = 19,
51  climb24 = 20,
52  climb32 = 21,
53  climb40 = 22,
54  climb48 = 23,
55  climb56 = 24,
56  climb64 = 25,
57  climb72 = 26,
58  //27-31: casting magic
59  cast1 = 27,
60  cast2 = 28,
61  cast3 = 29,
62  cast4 = 30,
63  cast5 = 31,
64  lookLeft = 32,
65  lookRight = 33,
66  startKneeling = 34,
67  kneel = 35,
68  //36: Vividos only: magic?
69  //37: Mythran only: magic?
70  //38: Vividos only: ?
71  //39: unused in u8
72  //40: ? - could be a slow attack or quick block ???
73  //41: unused in u8
74  keepBalance = 42,
75  //43: unused in u8
76  fallBackwards = 44,
77  hang = 45,
78  climbUp = 46,
79  idle1 = 47,
80  idle2 = 48,
81  kneel2 = 49,
82  stopKneeling = 50,
83  sitDownInChair = 51,
84  standUpFromChair = 52,
85  talk = 53,
86  //54: Mythran and Vividos only: magic?
87  work = 55,
88  drown = 56,
89  burn = 57,
90  kick = 58,
91  startBlock = 59,
92  stopBlock = 60,
93  //61: unused in u8
94  //62: unused in u8
95  //63: unused in u8
96 
97  // All belowa are crusader-specific animations (some use the same IDs as above)
98  standCru = 0,
99  walkCru = 1,
100  retreatSmallWeapon = 2,
101  runCru = 3,
102  combatStandSmallWeapon = 4,
103  readySmallWeapon = 7,
104  fireSmallWeapon = 8,
105  reloadSmallWeapon = 10,
106  unreadySmallWeapon = 11,
107  readyLargeWeapon = 12,
108  fireLargeWeapon = 13,
109  reload = 14,
110  reloadLargeWeapon = 15,
111  unreadyLargeWeapon = 16,
112  fallBackwardsCru = 18,
113  fallForwardsCru = 20,
114  kneelCombatRollLeft = 23,
115  kneelCombatRollRight = 24,
116  stopRunningAndDrawLargeWeapon = 25,
117  kneelAndFire = 26,
118  slideLeft = 28,
119  slideRight = 29,
120  lookLeftCru = 30,
121  lookRightCru = 31,
122  teleportIn = 32,
123  teleportOut = 33,
124  startRunSmallWeapon = 34,
125  startRunLargeWeapon = 35,
126  advanceSmallWeapon = 36,
127  combatStandLargeWeapon = 37,
128  startRun = 38,
129  stopRunningAndDrawSmallWeapon = 39,
130  kneelStartCru = 40,
131  kneelEndCru = 41,
132  kneelAndFireSmallWeapon = 42,
133  kneelAndFireLargeWeapon = 43,
134  advanceLargeWeapon = 44,
135  retreatLargeWeapon = 45,
136  kneelingWithSmallWeapon = 46,
137  kneelingWithLargeWeapon = 47,
138  combatRunSmallWeapon = 48,
139  combatRunLargeWeapon = 49,
140  brightKneelAndFireLargeWeapon = 50,
141  kneelingRetreat = 51,
142  kneelingAdvance = 52,
143  kneelingSlowRetreat = 53,
144  brightFireLargeWpn = 54,
145  electrocuted = 55,
146  jumpForward = 56,
147  surrender = 57,
148  quickJumpCru = 58,
149  jumpLanding = 59,
150  surrenderStand = 60,
151  combatRollLeft = 61,
152  combatRollRight = 62,
153  finishFiring = 63,
154 
159  crusaderAbsoluteAnimFlag = 0x1000,
160 };
161 
162 static inline Animation::Sequence absAnim(Animation::Sequence seq) {
163  return static_cast<Animation::Sequence>(seq | crusaderAbsoluteAnimFlag);
164 }
165 
166 enum Result {
167  FAILURE = 0,
168  SUCCESS = 1,
169  END_OFF_LAND = 2
170 };
171 
172 bool isCombatAnim(const Sequence anim);
173 bool isCombatAnimU8(const Sequence anim);
174 bool isCombatAnimCru(const Sequence anim);
175 bool isCastAnimU8(const Sequence anim);
176 Sequence checkWeapon(const Sequence nextanim, const Sequence lastanim);
177 
178 } // End of namespace Animation
179 } // End of namespace Ultima8
180 } // End of namespace Ultima
181 
182 #endif
Definition: detection.h:27