BattleAction.h 1.0 KB

12345678910111213141516171819202122232425262728
  1. #ifndef __BATTLEACTION_H__
  2. #define __BATTLEACTION_H__
  3. /*
  4. * BattleAction.h, part of VCMI engine
  5. *
  6. * Authors: listed in file AUTHORS in main folder
  7. *
  8. * License: GNU General Public License v2.0 or later
  9. * Full text of license available in license.txt file, in main folder
  10. *
  11. */
  12. struct BattleAction
  13. {
  14. ui8 side; //who made this action: false - left, true - right player
  15. ui32 stackNumber;//stack ID, -1 left hero, -2 right hero,
  16. ui8 actionType; // 0 = No action; 1 = Hero cast a spell 2 = Walk 3 = Defend 4 = Retreat from the battle
  17. //5 = Surrender 6 = Walk and Attack 7 = Shoot 8 = Wait 9 = Catapult
  18. //10 = Monster casts a spell (i.e. Faerie Dragons) 11 - Bad morale freeze 12 - stacks heals another stack
  19. ui16 destinationTile;
  20. si32 additionalInfo; // e.g. spell number if type is 1 || 10; tile to attack if type is 6
  21. template <typename Handler> void serialize(Handler &h, const int version)
  22. {
  23. h & side & stackNumber & actionType & destinationTile & additionalInfo;
  24. }
  25. };
  26. #endif // __BATTLEACTION_H__