OF_BASE.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * Seven Kingdoms: Ancient Adversaries
  3. *
  4. * Copyright 1997,1998 Enlight Software Ltd.
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. *
  19. */
  20. //Filename : OF_BASE.H
  21. //Description : Header of FirmBase
  22. #ifndef __OF_BASE_H
  23. #define __OF_BASE_H
  24. #ifndef __OUNIT_H
  25. #include <OUNIT.h>
  26. #endif
  27. #ifndef __OSKILL_H
  28. #include <OSKILL.h>
  29. #endif
  30. #ifndef __OFIRM_H
  31. #include <OFIRM.h>
  32. #endif
  33. //------- Define constant -----------//
  34. #define MAX_BASE_PRAYER 30
  35. #define MAX_PRAY_POINTS 400
  36. //------- Define class FirmBase --------//
  37. #pragma pack(1)
  38. class FirmBase : public Firm
  39. {
  40. public:
  41. short god_id;
  42. short god_unit_recno; // unit recno of the summoned god
  43. float pray_points;
  44. public:
  45. FirmBase();
  46. ~FirmBase();
  47. void init_derived();
  48. void assign_unit(int unitRecno);
  49. void assign_overseer(int overseerRecno);
  50. void change_nation(int newNationRecno);
  51. void put_info(int refreshFlag);
  52. void detect_info();
  53. void next_day();
  54. void process_ai();
  55. int can_invoke();
  56. void invoke_god();
  57. virtual FirmBase* cast_to_FirmBase() { return this; };
  58. //-------------- multiplayer checking codes ---------------//
  59. virtual UCHAR crc8();
  60. virtual void clear_ptr();
  61. private:
  62. void disp_base_info(int dispY1, int refreshFlag);
  63. void disp_god_info(int dispY1, int refreshFlag);
  64. void train_unit();
  65. void recover_hit_point();
  66. //------------- AI actions --------------//
  67. void think_assign_unit();
  68. void think_invoke_god();
  69. };
  70. #pragma pack()
  71. //--------------------------------------//
  72. #endif