Beispiel #1
0
        private void GenerateArmySideType(int side, int army_type, int qty)
        {
            var rnd = new Random();


            while (qty > 0)
            {
                var pos = new PosXY();
                if (side == (int)FriendFoeKind.friend)
                {
                    pos.PosX = rnd.Next(0, glb_settings.get_map_dim_parameter_x() / 2 - 5);
                    pos.PosY = rnd.Next(0, glb_settings.get_map_dim_parameter_y());
                }
                else
                {
                    pos.PosX = rnd.Next(glb_settings.get_map_dim_parameter_x() / 2 + 5, glb_settings.get_map_dim_parameter_x());
                    pos.PosY = rnd.Next(0, glb_settings.get_map_dim_parameter_y());
                }
                if (!IsArmy[pos.PosX, pos.PosY])                                                                                             //empty slot
                {
                    if (MapTerrain[pos.PosX, pos.PosY] == (int)TerrainKind.grass || MapTerrain[pos.PosX, pos.PosY] == (int)TerrainKind.city) //not on roads or water
                    {
                        var army = new Army(side, army_type);
                        //create unit
                        ArmyUnits.Add(pos, army);
                        //mark on the map
                        IsArmy[pos.PosX, pos.PosY] = true;
                        qty--;
                    }
                }
            }
        }
Beispiel #2
0
 /// <summary>
 /// Fill the ArmyUnits List with possible Units.
 /// </summary>
 private void AddArmyUnits()
 {
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.sword, 1, 0, Gods.none, true, true, 95, 0, 85, 0, 0, 1, 0));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.slinger, 1, 0, Gods.none, true, false, 55, 100, 40, 0, 0, 1, 0));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.archer, 1, 0, Gods.none, true, false, 120, 0, 75, 0, 0, 1, 0));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.hoplite, 1, 0, Gods.none, true, false, 0, 75, 150, 0, 0, 1, 0));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.rider, 3, 0, Gods.none, true, false, 240, 120, 360, 0, 0, 10, 0));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.chariot, 4, 0, Gods.none, true, false, 200, 440, 320, 0, 0, 15, 0));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.catapult, 15, 0, Gods.none, true, false, 1200, 1200, 1200, 0, 0, 1, 0));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.minotaur, 30, 0, Gods.zeus, true, true, 1400, 600, 3100, 202, 10, 1, 0));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.manticore, 45, 0, Gods.zeus, true, true, 4400, 3000, 3400, 405, 15, 1, 0));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.centaur, 12, 0, Gods.athena, true, true, 1740, 300, 700, 100, 4, 1, 0));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.pegasus, 20, 0, Gods.athena, true, true, 2800, 360, 80, 180, 12, 1, 0));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.harpy, 14, 0, Gods.hera, true, true, 1600, 400, 1360, 130, 5, 1, 0));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.medusa, 18, 0, Gods.hera, true, true, 1500, 3800, 2200, 210, 10, 1, 0));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.zyklop, 40, 0, Gods.poseidon, true, true, 2000, 4200, 3360, 360, 12, 1, 0));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.cerberus, 30, 0, Gods.hades, true, true, 1250, 1500, 3000, 320, 10, 1, 0));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.fury, 55, 0, Gods.hades, true, true, 2500, 5000, 5000, 480, 16, 1, 0));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.griffin, 38, 0, Gods.artemis, true, true, 3800, 1900, 4800, 250, 15, 1, 0));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.calydonian_boar, 20, 0, Gods.artemis, true, true, 2800, 1400, 1600, 110, 10, 1, 0));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.godsent, 3, 0, Gods.none, true, true, 0, 0, 0, 15, 1, 1, 0));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.big_transporter, 7, 26, Gods.none, false, true, 500, 500, 400, 0, 0, 0, 1));//19
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.bireme, 8, 0, Gods.none, false, false, 800, 700, 180, 0, 0, 0, 1));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.attack_ship, 10, 0, Gods.none, false, false, 1300, 300, 800, 0, 0, 0, 1));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.demolition_ship, 8, 0, Gods.none, false, false, 500, 750, 150, 0, 0, 0, 1));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.small_transporter, 5, 10, Gods.none, false, false, 800, 0, 400, 0, 0, 0, 1));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.trireme, 16, 0, Gods.none, false, false, 2000, 1300, 900, 0, 0, 0, 1));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.colonize_ship, 170, 0, Gods.none, false, false, 10000, 10000, 10000, 0, 0, 0, 20));
     ArmyUnits.Add(new ArmyUnit(Enums.ArmyUnits.sea_monster, 50, 0, Gods.poseidon, false, true, 5400, 2800, 3800, 400, 22, 0, 1));
 }