context: /*******************************************************************************
   *
   * Space Trader for Windows 1.00
   *
   * Copyright (C) 2016 Keith Banner, All Rights Reserved
   *
   * Port to Windows by David Pierron & Jay French
   * Original coding by Pieter Spronck, Sam Anderson, Samuel Goldstein, Matt Lee
   *
   * This program is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License as published by the Free
   * Software Foundation; either version 2 of the License, or (at your option) any
   * later version.
   *
   * This program is distributed in the hope that it will be useful, but WITHOUT
   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   *
   * If you'd like a copy of the GNU General Public License, go to
   * http://www.gnu.org/copyleft/gpl.html.
   *
   * You can contact the author at spacetrader@kb4000.com
   *
   ******************************************************************************/
  
  using System;
  using System.Collections;
  using System.Drawing;
  using System.IO;
  
  namespace SpaceTrader
  {
  	public class Consts
  	{
  		#region Individual Constants
  
  		// Directory structure and File constants.
  		public static string BaseDirectory = Environment.CurrentDirectory;
  		public static string CustomDirectory = Path.Combine(BaseDirectory, "custom");
  		public static string DataDirectory = Path.Combine(BaseDirectory, "data");
  		public static string SaveDirectory = Path.Combine(BaseDirectory, "save");
  
  		public static string CustomImagesDirectory = Path.Combine(CustomDirectory, "images");
  		public static string CustomTemplatesDirectory = Path.Combine(CustomDirectory, "templates");
  
  		public static string HighScoreFile = Path.Combine(DataDirectory, "HighScores.bin");
  		public static string DefaultSettingsFile = Path.Combine(DataDirectory, "DefaultSettings.bin");
  
  		public const string CurrentVersion = "2.00";
  
  		// Price paid by government for each negative PoliceScore point
  		public const int BountyModifier = 1000;
  
  		public const int GalaxyWidth = 154;
  		public const int GalaxyHeight = 110;
  		public const int MinDistance = 7;
  		public const int CloseDistance = 13;
  		public const int MaxRange = 20;
  		public const int WormDist = 25;
  
  		public const int DebtWarning = 75000;
  		public const int DebtTooLarge = 100000;
  		public const double InsRate = 0.0025;
  		public const double IntRate = 0.1;
  		public const int MaxNoClaim = 90;
  
  		public const int SkillBonus = 3;
  		public const int CloakBonus = 2;
  
  		public const int MaxSkill = 10;
  
  		public const int StartClicks = 20;
  		public const int MaxFuelTanks = 20;
  		public const int FuelCompactorTanks = 3;
  		public const int HullUpgrade = 50;
  		public const int MaxShip = 9;
  		public const int MaxSlots = 5;
  		public const int FleaConversionCost = 500;
  		public const int PodTransferCost = 200;
  
  		public const int ImagesPerShip = 4;
  		public const int ShipImgOffsetNormal = 0;
  		public const int ShipImgOffsetDamage = 1;
  		public const int ShipImgOffsetShield = 2;
  		public const int ShipImgOffsetSheildDamage = 3;
  		public const int ShipImgUseDefault = -1;
  		public const int EncounterImgAlien = 0;
  		public const int EncounterImgPirate = 1;
  		public const int EncounterImgPolice = 2;
  		public const int EncounterImgSpecial = 3;
  		public const int EncounterImgTrader = 4;
  
  		public const int StoryProbability = 50 / 8;
  		public const int FabricRipInitialProbability = 25;
  
  		public const int DirectionUp = 0;
  		public const int DirectionDown = 1;
  		public const int DirectionLeft = 2;
  		public const int DirectionRight = 3;
  
  		public const int DisruptorSystemsMultiplier = 3;
  
  		public const int MaxTribbles = 100000;
  
  		public const int PoliceRecordScorePsychopath = -100;
  		public const int PoliceRecordScoreVillain = -70;
  		public const int PoliceRecordScoreCriminal = -30;
  		public const int PoliceRecordScoreCrook = -10;
  		public const int PoliceRecordScoreDubious = -5;
  		public const int PoliceRecordScoreClean = 0;
  		public const int PoliceRecordScoreLawful = 5;
  		public const int PoliceRecordScoreTrusted = 10;
  		public const int PoliceRecordScoreLiked = 25;
  		public const int PoliceRecordScoreHero = 75;
  
  		public const int ReputationScoreHarmless = 0;
  		public const int ReputationScoreMostlyHarmless = 10;
  		public const int ReputationScorePoor = 20;
  		public const int ReputationScoreAverage = 40;
  		public const int ReputationScoreAboveAverage = 80;
  		public const int ReputationScoreCompetent = 150;
  		public const int ReputationScoreDangerous = 300;
  		public const int ReputationScoreDeadly = 600;
  		public const int ReputationScoreElite = 1500;
  
  		public const int ScoreAttackPirate = 0;
  		public const int ScoreAttackPolice = -3;
  		public const int ScoreAttackTrader = -2;
  		public const int ScoreCaughtWithWild = -4;
  		public const int ScoreFleePolice = -2;
  		public const int ScoreKillCaptain = 100;
  		public const int ScoreKillPirate = 1;
  		public const int ScoreKillPolice = -6;
  		public const int ScoreKillTrader = -4;
  		public const int ScorePlunderPirate = -1;
  		public const int ScorePlunderTrader = -2;
  		public const int ScoreTrafficking = -1;
  
  		public const string ShipTemplateSeparator = "----------------------------";
  
  		#endregion
  
  		#region Constant Arrays
  
  		#region Gadgets
  		public static Gadget[] Gadgets = new Gadget[]
  		{
  			new Gadget(GadgetType.ExtraCargoBays,   SkillType.Na,         2500, TechLevel.EarlyIndustrial, 35), // 5 extra holds
  			new Gadget(GadgetType.AutoRepairSystem, SkillType.Engineer,   7500, TechLevel.Industrial,      20), // Increases engineer's effectivity
  			new Gadget(GadgetType.NavigatingSystem, SkillType.Pilot,     15000, TechLevel.PostIndustrial,  20), // Increases pilot's effectivity
  			new Gadget(GadgetType.TargetingSystem,  SkillType.Fighter,   25000, TechLevel.PostIndustrial,  20), // Increases fighter's effectivity
  			new Gadget(GadgetType.CloakingDevice,   SkillType.Pilot,    100000, TechLevel.HiTech,           5), // If you have a good engineer, neither pirates nor police will notice you
  			// The gadgets below can't be bought
  			new Gadget(GadgetType.FuelCompactor,    SkillType.Na,        30000, TechLevel.Unavailable,      0),
  			new Gadget(GadgetType.HiddenCargoBays,  SkillType.Na,        60000, TechLevel.Unavailable,      0)
  		};
  		#endregion
  
  		#region PoliceRecords
  		public static PoliceRecord[] PoliceRecords = new PoliceRecord[]
  		{
  			new PoliceRecord(PoliceRecordType.Psychopath, PoliceRecordScorePsychopath),
  			new PoliceRecord(PoliceRecordType.Villain,    PoliceRecordScoreVillain),
  			new PoliceRecord(PoliceRecordType.Criminal,   PoliceRecordScoreCriminal),
  			new PoliceRecord(PoliceRecordType.Crook,      PoliceRecordScoreCrook),
  			new PoliceRecord(PoliceRecordType.Dubious,    PoliceRecordScoreDubious),
  			new PoliceRecord(PoliceRecordType.Clean,      PoliceRecordScoreClean),
  			new PoliceRecord(PoliceRecordType.Lawful,     PoliceRecordScoreLawful),
  			new PoliceRecord(PoliceRecordType.Trusted,    PoliceRecordScoreTrusted),
  			new PoliceRecord(PoliceRecordType.Liked,      PoliceRecordScoreLiked),
  			new PoliceRecord(PoliceRecordType.Hero,       PoliceRecordScoreHero)
  		};
  		#endregion
  
  		#region PoliticalSystems
  		public static PoliticalSystem[] PoliticalSystems = new PoliticalSystem[]
  		{
  			new PoliticalSystem(PoliticalSystemType.Anarchy,      0, Activity.Absent,   Activity.Swarms,   Activity.Minimal,  TechLevel.PreAgricultural, TechLevel.Industrial,      7, true,  true,  TradeItemType.Food),
  			new PoliticalSystem(PoliticalSystemType.Capitalist,   2, Activity.Some,     Activity.Few,      Activity.Swarms,   TechLevel.EarlyIndustrial, TechLevel.HiTech,          1, true,  true,  TradeItemType.Ore),
  			new PoliticalSystem(PoliticalSystemType.Communist,    6, Activity.Abundant, Activity.Moderate, Activity.Moderate, TechLevel.Agricultural,    TechLevel.Industrial,      5, true,  true,  TradeItemType.Na),
  			new PoliticalSystem(PoliticalSystemType.Confederacy,  5, Activity.Moderate, Activity.Some,     Activity.Many,     TechLevel.Agricultural,    TechLevel.PostIndustrial,  3, true,  true,  TradeItemType.Games),
  			new PoliticalSystem(PoliticalSystemType.Corporate,    2, Activity.Abundant, Activity.Few,      Activity.Swarms,   TechLevel.EarlyIndustrial, TechLevel.HiTech,          2, true,  true,  TradeItemType.Robots),
  			new PoliticalSystem(PoliticalSystemType.Cybernetic,   0, Activity.Swarms,   Activity.Swarms,   Activity.Many,     TechLevel.PostIndustrial,  TechLevel.HiTech,          0, false, false, TradeItemType.Ore),
  			new PoliticalSystem(PoliticalSystemType.Democracy,    4, Activity.Some,     Activity.Few,      Activity.Many,     TechLevel.Renaissance,     TechLevel.HiTech,          2, true,  true,  TradeItemType.Games),
  			new PoliticalSystem(PoliticalSystemType.Dictatorship, 3, Activity.Moderate, Activity.Many,     Activity.Some,     TechLevel.PreAgricultural, TechLevel.HiTech,          2, true,  true,  TradeItemType.Na),
  			new PoliticalSystem(PoliticalSystemType.Fascist,      7, Activity.Swarms,   Activity.Swarms,   Activity.Minimal,  TechLevel.EarlyIndustrial, TechLevel.HiTech,          0, false, true,  TradeItemType.Machines),
  			new PoliticalSystem(PoliticalSystemType.Feudal,       1, Activity.Minimal,  Activity.Abundant, Activity.Few,      TechLevel.PreAgricultural, TechLevel.Renaissance,     6, true,  true,  TradeItemType.Firearms),
  			new PoliticalSystem(PoliticalSystemType.Military,     7, Activity.Swarms,   Activity.Absent,   Activity.Abundant, TechLevel.Medieval,        TechLevel.HiTech,          0, false, true,  TradeItemType.Robots),
  			new PoliticalSystem(PoliticalSystemType.Monarchy,     3, Activity.Moderate, Activity.Some,     Activity.Moderate, TechLevel.PreAgricultural, TechLevel.Industrial,      4, true,  true,  TradeItemType.Medicine),
  			new PoliticalSystem(PoliticalSystemType.Pacifist,     7, Activity.Few,      Activity.Minimal,  Activity.Many,     TechLevel.PreAgricultural, TechLevel.Renaissance,     1, true,  false, TradeItemType.Na),
  			new PoliticalSystem(PoliticalSystemType.Socialist,    4, Activity.Few,      Activity.Many,     Activity.Some,     TechLevel.PreAgricultural, TechLevel.Industrial,      6, true,  true,  TradeItemType.Na),
  			new PoliticalSystem(PoliticalSystemType.Satori,       0, Activity.Minimal,  Activity.Minimal,  Activity.Minimal,  TechLevel.PreAgricultural, TechLevel.Agricultural,    0, false, false, TradeItemType.Na),
  			new PoliticalSystem(PoliticalSystemType.Technocracy,  1, Activity.Abundant, Activity.Some,     Activity.Abundant, TechLevel.EarlyIndustrial, TechLevel.HiTech,          2, true,  true,  TradeItemType.Water),
  			new PoliticalSystem(PoliticalSystemType.Theocracy,    5, Activity.Abundant, Activity.Minimal,  Activity.Moderate, TechLevel.PreAgricultural, TechLevel.EarlyIndustrial, 0, true,  true,  TradeItemType.Narcotics)
  		};
  		#endregion
  
  		#region Reputations
  		public static Reputation[] Reputations = new Reputation[]
  		{
  			new Reputation(ReputationType.Harmless,       ReputationScoreHarmless),
  			new Reputation(ReputationType.MostlyHarmless, ReputationScoreMostlyHarmless),
  			new Reputation(ReputationType.Poor,           ReputationScorePoor),
  			new Reputation(ReputationType.Average,        ReputationScoreAverage),
  			new Reputation(ReputationType.AboveAverage,   ReputationScoreAboveAverage),
  			new Reputation(ReputationType.Competent,      ReputationScoreCompetent),
  			new Reputation(ReputationType.Dangerous,      ReputationScoreDangerous),
  			new Reputation(ReputationType.Deadly,         ReputationScoreDeadly),
  			new Reputation(ReputationType.Elite,          ReputationScoreElite)
  		};
  		#endregion
  
  		#region Shields
  		public static Shield[] Shields = new Shield[]
  		{
  			new Shield(ShieldType.Energy,     100,  5000, TechLevel.Industrial,     70),
  			new Shield(ShieldType.Reflective, 200, 20000, TechLevel.PostIndustrial, 30),
  			// The weapons below cannot be bought
  			new Shield(ShieldType.Lightning,  350, 45000, TechLevel.Unavailable,     0)
  		};
  		#endregion
  
  		#region ShipImageOffsets
  		public static Rectangle[] ShipImageOffsets = new Rectangle[]
  		{
  			// We only care about X and Width, so set Y and Height to 0.
  			new Rectangle(22, 0, 19, 0),	// Flea
  			new Rectangle(18, 0, 27, 0),	// Gnat
  			new Rectangle(18, 0, 27, 0),	// Firefly
  			new Rectangle(18, 0, 27, 0),	// Mosquito
  			new Rectangle(12, 0, 40, 0),	// Bumblebee
  			new Rectangle(12, 0, 40, 0),	// Beetle
  			new Rectangle( 7, 0, 50, 0),	// Hornet
  			new Rectangle( 7, 0, 50, 0),	// Grasshopper
  
gt: 			new Rectangle( 2, 0, 60, 0),	// Termite