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 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (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, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 */ 22 23 #ifndef WORLD_ACTORS_ANIMATION_H 24 #define WORLD_ACTORS_ANIMATION_H 25 26 namespace Ultima { 27 namespace Ultima8 { 28 namespace Animation { 29 30 enum Sequence { 31 walk = 0, 32 run = 1, 33 stand = 2, 34 jumpUp = 3, 35 standUp = 4, 36 readyWeapon = 5, 37 unreadyWeapon = 6, 38 attack = 7, 39 advance = 8, 40 retreat = 9, 41 runningJump = 10, 42 shakeHead = 11, 43 step = 12, 44 stumbleBackwards = 13, 45 die = 14, 46 combatStand = 15, 47 land = 16, 48 jump = 17, 49 airwalkJump = 18, 50 //19-26: climbing up on increasingly high objects 51 climb16 = 19, 52 climb24 = 20, 53 climb32 = 21, 54 climb40 = 22, 55 climb48 = 23, 56 climb56 = 24, 57 climb64 = 25, 58 climb72 = 26, 59 //27-31: casting magic 60 cast1 = 27, 61 cast2 = 28, 62 cast3 = 29, 63 cast4 = 30, 64 cast5 = 31, 65 lookLeft = 32, 66 lookRight = 33, 67 startKneeling = 34, 68 kneel = 35, 69 //36: Vividos only: magic? 70 //37: Mythran only: magic? 71 //38: Vividos only: ? 72 //39: unused in u8 73 //40: ? - could be a slow attack or quick block ??? 74 //41: unused in u8 75 keepBalance = 42, 76 //43: unused in u8 77 fallBackwards = 44, 78 hang = 45, 79 climbUp = 46, 80 idle1 = 47, 81 idle2 = 48, 82 kneel2 = 49, 83 stopKneeling = 50, 84 sitDownInChair = 51, 85 standUpFromChair = 52, 86 talk = 53, 87 //54: Mythran and Vividos only: magic? 88 work = 55, 89 drown = 56, 90 burn = 57, 91 kick = 58, 92 startBlock = 59, 93 stopBlock = 60, 94 //61: unused in u8 95 //62: unused in u8 96 //63: unused in u8 97 98 // All belowa are crusader-specific animations (some use the same IDs as above) 99 standCru = 0, 100 walkCru = 1, 101 retreatSmallWeapon = 2, 102 runCru = 3, 103 combatStandSmallWeapon = 4, 104 readySmallWeapon = 7, 105 fireSmallWeapon = 8, 106 reloadSmallWeapon = 10, 107 unreadySmallWeapon = 11, 108 readyLargeWeapon = 12, 109 fireLargeWeapon = 13, 110 reload = 14, 111 reloadLargeWeapon = 15, 112 unreadyLargeWeapon = 16, 113 fallBackwardsCru = 18, 114 fallForwardsCru = 20, 115 kneelCombatRollLeft = 23, 116 kneelCombatRollRight = 24, 117 stopRunningAndDrawLargeWeapon = 25, 118 kneelAndFire = 26, 119 slideLeft = 28, 120 slideRight = 29, 121 unknownAnim30 = 30, 122 startRunLargeWeapon = 31, 123 teleportIn = 32, 124 teleportOut = 33, 125 startRunSmallWeapon = 34, 126 startRunLargeWeapon2 = 35, 127 advanceSmallWeapon = 36, 128 combatStandLargeWeapon = 37, 129 startRun = 38, 130 stopRunningAndDrawSmallWeapon = 39, 131 kneelStartCru = 40, 132 kneelEndCru = 41, 133 kneelAndFireSmallWeapon = 42, 134 kneelAndFireLargeWeapon = 43, 135 advanceLargeWeapon = 44, 136 retreatLargeWeapon = 45, 137 kneelingWithSmallWeapon = 46, 138 kneelingWithLargeWeapon = 47, 139 combatRunSmallWeapon = 48, 140 combatRunLargeWeapon = 49, 141 brightKneelAndFireLargeWeapon = 50, 142 kneelingRetreat = 51, 143 kneelingAdvance = 52, 144 kneelingSlowRetreat = 53, 145 brightFireLargeWpn = 54, 146 electrocuted = 55, 147 jumpForward = 56, 148 surrender = 57, 149 quickJumpCru = 58, 150 jumpLanding = 59, 151 surrenderStand = 60, 152 combatRollLeft = 61, 153 combatRollRight = 62, 154 finishFiring = 63, 155 156 crusaderAbsoluteAnimFlag = 0x1000, //!< Bit mask magic to say we want an exact number, don't do mapping from U8 animation numbers 157 teleportInReplacement = crusaderAbsoluteAnimFlag | teleportIn, //!< See notes in Actor::receiveHitCru 158 teleportOutReplacement = crusaderAbsoluteAnimFlag | teleportOut //!< See notes in Actor::receiveHitCru 159 }; 160 161 enum Result { 162 FAILURE = 0, 163 SUCCESS = 1, 164 END_OFF_LAND = 2 165 }; 166 167 bool isCombatAnim(const Sequence anim); 168 bool isCombatAnimU8(const Sequence anim); 169 bool isCombatAnimCru(const Sequence anim); 170 bool isCastAnimU8(const Sequence anim); 171 Sequence checkWeapon(const Sequence nextanim, const Sequence lastanim); 172 173 } // End of namespace Animation 174 } // End of namespace Ultima8 175 } // End of namespace Ultima 176 177 #endif 178