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 21 //Filename : OMONSRES.H 22 //Description : Header file of object RaceRes 23 24 #ifndef __OMONSRES_H 25 #define __OMONSRES_H 26 27 #ifndef __ORESDB_H 28 #include <ORESDB.h> 29 #endif 30 31 //----------- Define constant ------------// 32 33 enum { MAX_MONSTER_LEVEL = 9 }; 34 enum { MAX_ACTIVE_MONSTER = 3 }; // No. of monster type in each game 35 36 //----------- Define constant ------------// 37 38 #define REPUTATION_INCREASE_PER_ATTACK_MONSTER ((float)0.001) 39 40 //------------ Define struct RaceRec ---------------// 41 42 struct MonsterRec 43 { 44 enum { UNIT_CODE_LEN=8, RANK_LEN=8, NAME_LEN=20, FIRM_BUILD_CODE_LEN=8, UNIT_ID_LEN=3 }; 45 46 char unit_code[UNIT_CODE_LEN]; 47 char name[NAME_LEN]; 48 char level; // the level of the 1-9 monster, the higher the level is, the more powerful the monster is. 49 char firm_build_code[FIRM_BUILD_CODE_LEN]; 50 char unit_id[UNIT_ID_LEN]; 51 }; 52 53 //------------- Define struct MonsterInfo --------------// 54 55 struct MonsterInfo 56 { 57 public: 58 //------- constant vars --------// 59 60 enum { NAME_LEN=20, FIRM_BUILD_CODE_LEN=8 }; 61 62 short monster_id; 63 64 char name[NAME_LEN+1]; 65 short unit_id; 66 char level; 67 char firm_build_code[FIRM_BUILD_CODE_LEN+1]; 68 69 public: 70 int create_firm_monster(); 71 int build_firm_monster(int xLoc, int yLoc, int fullHitPoints=1); 72 }; 73 74 //----------- Define class MonsterRes ---------------// 75 76 class MonsterRes 77 { 78 public: 79 char init_flag; 80 81 short monster_count; 82 MonsterInfo* monster_info_array; 83 84 short active_monster_array[MAX_ACTIVE_MONSTER]; 85 86 ResourceDb res_bitmap; 87 88 public: 89 MonsterRes(); 90 91 void init(); 92 void deinit(); 93 94 void init_active_monster(); 95 void generate(int generateCount); 96 void stop_attack_nation(short nationRecno); 97 98 int write_file(File* filePtr); 99 int read_file(File* filePtr); 100 101 MonsterInfo* operator[](int monsterId); // pass monsterId as recno 102 103 private: 104 void load_monster_info(); 105 }; 106 107 extern MonsterRes monster_res; 108 109 //----------------------------------------------------// 110 111 #endif 112