Example #1
0
        public RegionMgr(ushort regionId, List <Zone_Info> zones, string name, IApocCommunications apocCommunications)
        {
            ApocCommunications = apocCommunications;
            RegionId           = regionId;
            ZonesInfo          = zones;
            RegionName         = name;

            LoadSpawns();

            BountyManager = new BountyManager();

            try
            {
                switch (ZonesInfo[0].Pairing)
                {
                case (byte)Pairing.PAIRING_GREENSKIN_DWARVES:
                    _races = new[] { Races.RACES_DWARF, Races.RACES_GOBLIN };
                    break;

                case (byte)Pairing.PAIRING_EMPIRE_CHAOS:
                    _races = new[] { Races.RACES_EMPIRE, Races.RACES_CHAOS };
                    break;

                case (byte)Pairing.PAIRING_ELVES_DARKELVES:
                    _races = new[] { Races.RACES_HIGH_ELF, Races.RACES_DARK_ELF };
                    break;
                }
            }
            catch (Exception e)
            {
                _logger.Error($"Zone - Pairing {e.Message} {e.StackTrace}");
                throw;
            }

            _updater = new Thread(Update);
            _updater.Start();

            RegionCreatures = GetObjects <Creature>().ToList();
        }
Example #2
0
        public void Setup()
        {
            FakeComms  = A.Fake <IApocCommunications>();
            RegionMgrs = new List <RegionMgr>();

            PraagBOList           = new List <BattlefieldObjective>();
            ChaosWastesBOList     = new List <BattlefieldObjective>();
            ThunderMountainBOList = new List <BattlefieldObjective>();
            KadrinValleyBOList    = new List <BattlefieldObjective>();

            Region1BOList = new List <BattlefieldObjective>();
            Region3BOList = new List <BattlefieldObjective>();


            var R1ZoneList = new List <Zone_Info>();

            R1ZoneList.Add(new Zone_Info {
                ZoneId = 200, Name = "R1Zone200 PR", Pairing = 2, Tier = 4
            });
            R1ZoneList.Add(new Zone_Info {
                ZoneId = 201, Name = "R1Zone201 CW", Pairing = 2, Tier = 4
            });

            var R3ZoneList = new List <Zone_Info>();

            R3ZoneList.Add(new Zone_Info {
                ZoneId = 400, Name = "R3Zone400 TM", Pairing = 1, Tier = 4
            });
            R3ZoneList.Add(new Zone_Info {
                ZoneId = 401, Name = "R3Zone401 KV", Pairing = 1, Tier = 4
            });

            Region1 = new RegionMgr(1, R1ZoneList, "Region1", FakeComms);
            Region3 = new RegionMgr(3, R3ZoneList, "Region3", FakeComms);


            RegionMgrs.Add(Region1);
            RegionMgrs.Add(Region3);


            PraagBOList.Add(new BattlefieldObjective(1, "BO1", 200, 1, 4));
            PraagBOList.Add(new BattlefieldObjective(2, "BO2", 200, 1, 4));
            PraagBOList.Add(new BattlefieldObjective(3, "BO3", 200, 1, 4));
            PraagBOList.Add(new BattlefieldObjective(4, "BO4", 200, 1, 4));

            ChaosWastesBOList.Add(new BattlefieldObjective(11, "BO1", 201, 1, 4));
            ChaosWastesBOList.Add(new BattlefieldObjective(12, "BO2", 201, 1, 4));
            ChaosWastesBOList.Add(new BattlefieldObjective(13, "BO3", 201, 1, 4));
            ChaosWastesBOList.Add(new BattlefieldObjective(14, "BO4", 201, 1, 4));

            ThunderMountainBOList.Add(new BattlefieldObjective(21, "BO1", 400, 3, 4));
            ThunderMountainBOList.Add(new BattlefieldObjective(22, "BO2", 400, 3, 4));
            ThunderMountainBOList.Add(new BattlefieldObjective(23, "BO3", 400, 3, 4));
            ThunderMountainBOList.Add(new BattlefieldObjective(24, "BO4", 400, 3, 4));

            KadrinValleyBOList.Add(new BattlefieldObjective(31, "BO1", 401, 3, 4));
            KadrinValleyBOList.Add(new BattlefieldObjective(32, "BO2", 401, 3, 4));
            KadrinValleyBOList.Add(new BattlefieldObjective(33, "BO3", 401, 3, 4));
            KadrinValleyBOList.Add(new BattlefieldObjective(34, "BO4", 401, 3, 4));

            Region1BOList.AddRange(PraagBOList);
            Region1BOList.AddRange(ChaosWastesBOList);

            Region3BOList.AddRange(ThunderMountainBOList);
            Region3BOList.AddRange(KadrinValleyBOList);


            SampleProgressionList = new List <RVRProgression>();
            SampleProgressionList.Add(new RVRProgression
            {
                Tier                    = 4,
                ZoneId                  = 200,
                BattleFrontId           = 1,
                Description             = "Praag", // named for default pickup
                DestWinProgression      = 2,
                OrderWinProgression     = 3,
                PairingId               = 2,
                RegionId                = 1,
                ResetProgressionOnEntry = 1
            });
            SampleProgressionList.Add(new RVRProgression
            {
                Tier                    = 4,
                ZoneId                  = 201,
                BattleFrontId           = 2,
                Description             = "Chaos Wastes",
                DestWinProgression      = 6,
                OrderWinProgression     = 7,
                PairingId               = 2,
                RegionId                = 1,
                ResetProgressionOnEntry = 0
            });
            SampleProgressionList.Add(new RVRProgression
            {
                Tier                    = 4,
                ZoneId                  = 400,
                BattleFrontId           = 6,
                Description             = "Thunder Mountain",
                DestWinProgression      = 7,
                OrderWinProgression     = 2,
                PairingId               = 1,
                RegionId                = 3,
                ResetProgressionOnEntry = 0
            });
            SampleProgressionList.Add(new RVRProgression
            {
                Tier                    = 4,
                ZoneId                  = 401,
                BattleFrontId           = 7,
                Description             = "Kadrin Valley",
                DestWinProgression      = 1,
                OrderWinProgression     = 1,
                PairingId               = 1,
                RegionId                = 3,
                ResetProgressionOnEntry = 0
            });
            manager = new UpperTierCampaignManager(SampleProgressionList, RegionMgrs);
            // Must be run before attaching ApocBattleFronts to get an ActiveBF
            manager.GetActiveBattleFrontFromProgression();

            Region1.Campaign = new Campaign(Region1, Region1BOList, new HashSet <Player>(), manager, FakeComms);
            Region3.Campaign = new Campaign(Region3, Region3BOList, new HashSet <Player>(), manager, FakeComms);
        }