1 // Copyright (C) 2001, 2002, 2003 Michael Bartl 2 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Ulf Lorenz 3 // Copyright (C) 2003, 2004, 2005, 2006 Andrea Paternesi 4 // Copyright (C) 2004 David Sterba 5 // Copyright (C) 2005 Bryan Duff 6 // Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2014, 2015, 2016, 7 // 2020 Ben Asselstine 8 // 9 // This program is free software; you can redistribute it and/or modify 10 // it under the terms of the GNU General Public License as published by 11 // the Free Software Foundation; either version 3 of the License, or 12 // (at your option) any later version. 13 // 14 // This program is distributed in the hope that it will be useful, 15 // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 // GNU Library General Public License for more details. 18 // 19 // You should have received a copy of the GNU General Public License 20 // along with this program; if not, write to the Free Software 21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 // 02110-1301, USA. 23 24 //This file contains the various macros used within lordsawar. 25 26 #pragma once 27 #ifndef DEFINITIONS_H 28 #define DEFINITIONS_H 29 30 #include <gtkmm.h> 31 #include <glibmm.h> 32 #include <libintl.h> 33 34 #define LORDSAWAR_SAVEGAME_VERSION "0.3.2" 35 #define LORDSAWAR_TILESET_VERSION "0.2.1" 36 #define LORDSAWAR_ARMYSET_VERSION "0.3.0" 37 #define LORDSAWAR_CITYSET_VERSION "0.2.1" 38 #define LORDSAWAR_SHIELDSET_VERSION "0.2.1" 39 #define LORDSAWAR_CONFIG_VERSION "0.2.2" 40 #define LORDSAWAR_ITEMS_VERSION "0.2.1" 41 #define LORDSAWAR_RECENTLY_PLAYED_VERSION "0.2.1" 42 #define LORDSAWAR_RECENTLY_EDITED_VERSION "0.2.1" 43 #define LORDSAWAR_PROFILES_VERSION "0.3.0" 44 #define LORDSAWAR_RECENTLY_HOSTED_VERSION "0.3.0" 45 #define LORDSAWAR_PBM_TURN_VERSION "0.3.0" 46 #define _(string) Glib::locale_to_utf8(Glib::ustring(gettext(string))) // Macro for the gettext 47 #define N_(string) string 48 49 50 //----------------------------------------------------------------------------- 51 //some standard timers. They can easier be changed here than somewhere deep 52 //within the code, and sometimes you have to tweak them a little bit. 53 const unsigned int TIMER_BIGMAP_SELECTOR = 150; //milliseconds 54 const unsigned int TIMER_SMALLMAP_REFRESH = 8000; //microseconds 55 const unsigned int TIMER_BIGMAP_EXPLOSION_DELAY = 1500000; //microseconds 56 const unsigned int CITY_LEVELS = 4; 57 const unsigned int MAX_PLAYERS = 8; 58 const unsigned int TEMPLE_TYPES = 1; 59 const unsigned int RUIN_TYPES = 3; 60 const unsigned int DIPLOMACY_TYPES = 3; 61 const unsigned int ROAD_TYPES = 15; 62 const unsigned int STONE_TYPES = 89; 63 const unsigned int FOG_TYPES = 15; 64 const unsigned int BRIDGE_TYPES = 4; 65 const unsigned int CURSOR_TYPES = 13; 66 const unsigned int DEFAULT_TILESTYLE_TYPES = 18; 67 const unsigned int MAX_CITIES_VECTORED_TO_ONE_CITY = 4; 68 const unsigned int MAX_TURNS_FOR_VECTORING = 2; 69 const unsigned int MAX_BOAT_MOVES = 18; 70 const unsigned int CUSP_OF_WAR_ROUND = 9; 71 const unsigned int DIPLOMACY_STARTING_SCORE = 8; 72 const unsigned int DIPLOMACY_MAX_SCORE = 15; 73 const unsigned int DIPLOMACY_MIN_SCORE = 0; 74 const unsigned int MAX_STACK_SIZE = 8; 75 const unsigned int FLAG_TYPES = MAX_STACK_SIZE; 76 const unsigned int MAX_ARMIES_ON_A_SINGLE_TILE = 8; 77 const unsigned int MAX_PRODUCTION_SLOTS_IN_A_CITY = 4; 78 const unsigned int MAX_ARMIES_PRODUCED_IN_NEUTRAL_CITY = 5; 79 80 const unsigned int MAP_SIZE_TINY_WIDTH = 50; 81 const unsigned int MAP_SIZE_TINY_HEIGHT = 75; 82 const unsigned int MAP_SIZE_SMALL_WIDTH = 70; 83 const unsigned int MAP_SIZE_SMALL_HEIGHT = 105; 84 const unsigned int MAP_SIZE_NORMAL_WIDTH = 112; 85 const unsigned int MAP_SIZE_NORMAL_HEIGHT = 156; 86 87 const unsigned int PRODUCTION_SHIELD_TYPES = 8; 88 const unsigned int MOVE_BONUS_TYPES = 6; 89 const unsigned int MEDAL_TYPES = 3; 90 const unsigned int NUM_WAYPOINTS = 2; 91 const unsigned int NUM_GAME_BUTTON_IMAGES = 12; 92 const unsigned int NUM_ARROW_IMAGES = 8; 93 94 const int MAX_GOLD_TO_CARRY_OVER_TO_NEXT_SCENARIO = 5000; 95 const unsigned int MAX_ARMY_STRENGTH = 9; 96 const unsigned int MAX_BOAT_STRENGTH = 4; 97 const unsigned int BATTLE_DICE_SIDES_INTENSE = 24; 98 const unsigned int BATTLE_DICE_SIDES_NORMAL = 20; 99 100 const unsigned short LORDSAWAR_PORT = 14998; 101 const unsigned short LORDSAWAR_GAMELIST_PORT = 18998; 102 const unsigned short LORDSAWAR_GAMEHOST_PORT = 22998; 103 const unsigned int MINIMUM_CACHE_SIZE = (1 << 21); 104 #define HUMAN_PLAYER_TYPE _("Human") 105 #define EASY_PLAYER_TYPE _("Easy") 106 #define HARD_PLAYER_TYPE _("Hard") 107 #define NO_PLAYER_TYPE _("Off") 108 #define NETWORKED_PLAYER_TYPE _("Network") 109 110 const Glib::ustring ARMYSETDIR = "army"; 111 const Glib::ustring TILESETDIR = "tilesets"; 112 const Glib::ustring CITYSETDIR = "citysets"; 113 const Glib::ustring SHIELDSETDIR = "shield"; 114 const Glib::ustring MAPDIR = "map"; 115 const Glib::ustring ARMYSET_EXT = ".lwa"; 116 const Glib::ustring TILESET_EXT = ".lwt"; 117 const Glib::ustring CITYSET_EXT = ".lwc"; 118 const Glib::ustring SHIELDSET_EXT = ".lws"; 119 const Glib::ustring MAP_EXT = ".map"; 120 const Glib::ustring SAVE_EXT = ".sav"; 121 const Glib::ustring PBM_EXT = ".trn"; 122 const Glib::ustring RECENTLY_PLAYED_LIST = "recently-played.xml"; 123 const Glib::ustring RECENTLY_EDITED_LIST = "recently-edited.xml"; 124 const Glib::ustring PROFILE_LIST = "profiles.xml"; 125 const Glib::ustring RECENTLY_ADVERTISED_LIST = "recently-advertised.xml"; 126 const Glib::ustring RECENTLY_HOSTED_LIST = "recently-hosted.xml"; 127 128 const unsigned int MIN_PRODUCTION_TURNS_FOR_ARMY_UNITS = 1; 129 const unsigned int MAX_PRODUCTION_TURNS_FOR_ARMY_UNITS = 5; 130 const unsigned int MIN_UPKEEP_FOR_ARMY_UNITS = 0; 131 const unsigned int MAX_UPKEEP_FOR_ARMY_UNITS = 20; 132 const unsigned int MIN_MOVES_FOR_ARMY_UNITS = 6; 133 const unsigned int MAX_MOVES_FOR_ARMY_UNITS = 75; 134 const unsigned int MIN_STRENGTH_FOR_ARMY_UNITS = 1; 135 const unsigned int MAX_STRENGTH_FOR_ARMY_UNITS = 9; 136 const unsigned int MIN_COST_FOR_ARMY_UNITS = 0; 137 const unsigned int MAX_COST_FOR_ARMY_UNITS = 50; 138 const unsigned int MIN_NEW_COST_FOR_ARMY_UNITS = 0; 139 const unsigned int MAX_NEW_COST_FOR_ARMY_UNITS = 20000; 140 const unsigned int MIN_EXP_FOR_ARMY_UNITS = 0; 141 const unsigned int MAX_EXP_FOR_ARMY_UNITS = 50000; 142 const unsigned int MIN_SIGHT_FOR_ARMY_UNITS = 0; 143 const unsigned int MAX_SIGHT_FOR_ARMY_UNITS = 25; 144 145 const float SIGNPOST_FREQUENCY = 0.0030; 146 147 const Glib::ustring YELLOW_COLOUR = "#FCFCECEC2020"; 148 const Glib::ustring ORANGE_COLOUR = "#FCFCA0A00000"; 149 const Glib::ustring WHITE_COLOUR = "#FFFFFFFFFFFF"; 150 const Glib::ustring BLACK_COLOUR = "#000000000000"; 151 //const Glib::ustring DARK_GREY_COLOUR = "#515151515151"; 152 //const Glib::ustring LIGHT_GREY_COLOUR = "#929292929292"; 153 const Glib::ustring DARK_GREY_COLOUR = "#292929292929"; 154 const Glib::ustring LIGHT_GREY_COLOUR = "#393f3f393f3f"; 155 const Gdk::RGBA SEND_VECTORED_UNIT_LINE_COLOUR(YELLOW_COLOUR); 156 const Gdk::RGBA RECEIVE_VECTORED_UNIT_LINE_COLOUR(ORANGE_COLOUR); 157 const Gdk::RGBA SELECTOR_BOX_COLOUR(WHITE_COLOUR); 158 const Gdk::RGBA QUEST_LINE_COLOUR(ORANGE_COLOUR); 159 const Gdk::RGBA QUESTMAP_TARGET_BOX_COLOUR(ORANGE_COLOUR); 160 const Gdk::RGBA ROAD_PLANNER_TARGET_BOX_COLOUR(ORANGE_COLOUR); 161 const Gdk::RGBA GRID_BOX_COLOUR(BLACK_COLOUR); 162 const Gdk::RGBA FOG_COLOUR(BLACK_COLOUR); 163 const Gdk::RGBA VECTORMAP_ACTIVE_BOX_COLOUR(WHITE_COLOUR); 164 const Gdk::RGBA SELECTED_CITY_BOX_COLOUR(WHITE_COLOUR); 165 const Gdk::RGBA BEVELED_CIRCLE_DARK(DARK_GREY_COLOUR); 166 const Gdk::RGBA BEVELED_CIRCLE_LIGHT(LIGHT_GREY_COLOUR); 167 const Gdk::RGBA ACTIVE_RUIN_BOX(YELLOW_COLOUR); 168 169 #ifdef GDK_WINDOWING_WIN32 170 const int SPEED_DELAY = 0; 171 const double ZOOM_STEP = 0.1; 172 #else 173 const int SPEED_DELAY = 300000; 174 const double ZOOM_STEP = 0.1; 175 #endif 176 177 const Glib::ustring DEFAULT_CONFIG_FILENAME = "lordsawarrc"; 178 179 //1 in x chance of standing stone being on a road tile for random map. 180 const unsigned int ROAD_STONE_CHANCE = 150; 181 182 //how tall an army icon appears on a dialog relative to default font height 183 const double DIALOG_ARMY_PIC_FONTSIZE_MULTIPLE = 4.936363634; 184 //scale for the small shield pictures that appear on dialogs 185 const double DIALOG_SMALL_SHIELD_PIC_FONTSIZE_MULTIPLE = 0.727272727; 186 //scale for the medium shield pictures that appear on dialogs 187 const double DIALOG_MEDIUM_SHIELD_PIC_FONTSIZE_MULTIPLE = 1.872727273; //was 1.2 188 //scale for the large shield pictures 189 const double DIALOG_LARGE_SHIELD_PIC_FONTSIZE_MULTIPLE = 3.272727273; 190 //scale for the smaller diplomacy pictures 191 const double DIALOG_DIPLOMACY_TYPE_0_PIC_FONTSIZE_MULTIPLE = 3.0; 192 //scale for the larger diplomacy pictures 193 const double DIALOG_DIPLOMACY_TYPE_1_PIC_FONTSIZE_MULTIPLE = 5.0; 194 //scale for the mouse cursor graphics 195 const double DIALOG_CURSOR_PIC_FONTSIZE_MULTIPLE = 2.25; 196 //scale for the new hero level picture 197 const double DIALOG_NEW_LEVEL_PIC_FONTSIZE_MULTIPLE = 23; 198 //scale for the tartan progress images 199 const double DIALOG_TARTAN_PIC_FONTSIZE_MULTIPLE = 3.73; 200 //scale for the movement bonus pictures 201 const double DIALOG_MOVE_BONUS_PIC_FONTSIZE_MULTIPLE = 2; 202 //scale for the large medal awarded picture 203 const double DIALOG_MEDAL_PIC_FONTSIZE_MULTIPLE = 19; 204 //scale for the cities/treasury/income/upkeep pictures on the main game screen 205 const double DIALOG_STATUS_PIC_FONTSIZE_MULTIPLE = 2.333; 206 //scale for the tiny defense icon that appears on a city info tip 207 const double DIALOG_DEFENSE_PIC_FONTSIZE_MULTIPLE = 1.333; 208 //scale for the images in the buttons on the main game screen 209 const double DIALOG_GAME_BUTTON_PIC_FONTSIZE_MULTIPLE = 3; 210 //scale for the new turn (ship) picture 211 const double DIALOG_NEXT_TURN_PIC_FONT_SIZE_MULTIPLE = 23; 212 //scale for the male/female hero picture 213 const double DIALOG_NEW_HERO_PIC_FONT_SIZE_MULTIPLE = 23; 214 //scale for city defeated picture 215 const double DIALOG_CONQUERED_CITY_PIC_FONT_SIZE_MULTIPLE = 23; 216 //scale for the game winning cheese picture 217 const double DIALOG_WINNING_PIC_FONT_SIZE_MULTIPLE = 41; 218 //scale for the ruin success/defeated picture 219 const double DIALOG_RUIN_PIC_FONT_SIZE_MULTIPLE = 23; 220 //scale for the parley accepted/refuse picture 221 const double DIALOG_PARLEY_PIC_FONT_SIZE_MULTIPLE = 41; 222 //scale for the underline beneath the shields in the turn indicator 223 const double TURN_INDICATOR_FONT_SIZE_MULTIPLE = 0.3; 224 //scale for tile graphics appearing on dialogs in the scenario builder 225 const double EDITOR_DIALOG_TILE_PIC_FONTSIZE_MULTIPLE = 5.3; 226 //scale for the warlord commentator picture 227 const double DIALOG_COMMENTATOR_PIC_FONT_SIZE_MULTIPLE = 41; 228 229 //do dialog pics too 230 231 //for mingw: 232 #ifndef M_PI 233 # define M_PI 3.14159265358979323846 /* pi */ 234 #endif 235 #endif // DEFINITIONS_H 236 237