BattleAction.h 770 B

123456789101112131415
  1. #ifndef __BATTLEACTION_H__
  2. #define __BATTLEACTION_H__
  3. struct BattleAction
  4. {
  5. ui8 side; //who made this action: false - left, true - right player
  6. ui32 stackNumber;//stack ID, -1 left hero, -2 right hero,
  7. ui8 actionType; // 0 = No action; 1 = Hero cast a spell 2 = Walk 3 = Defend 4 = Retreat from the battle 5 = Surrender 6 = Walk and Attack 7 = Shoot 8 = Wait 9 = Catapult 10 = Monster casts a spell (i.e. Faerie Dragons) 11 - Bad morale freeze
  8. ui16 destinationTile;
  9. si32 additionalInfo; // e.g. spell number if type is 1 || 10; tile to attack if type is 6
  10. template <typename Handler> void serialize(Handler &h, const int version)
  11. {
  12. h & side & stackNumber & actionType & destinationTile & additionalInfo;
  13. }
  14. };
  15. #endif // __BATTLEACTION_H__