Example #1
0
        public void LockBattleFront1()
        {
            var fakeCommsEngine = A.Fake <IApocCommunications>();

            manager = new UpperTierCampaignManager(SampleProgressionList, RegionMgrs);
            // Must be run before attaching ApocBattleFronts to get an ActiveBF
            var bf = manager.GetActiveBattleFrontFromProgression();

            Region1.Campaign = new Campaign(Region1, Region1BOList, new HashSet <Player>(), manager, FakeComms);
            Region3.Campaign = new Campaign(Region3, Region3BOList, new HashSet <Player>(), manager, FakeComms);
            // Open Praag (BF==1)
            manager.OpenActiveBattlefront();
            // Locking Region1.Campaign
            Region1.Campaign.VictoryPointProgress.DestructionVictoryPoints = 5000f;
            Region1.Campaign.VictoryPointProgress.OrderVictoryPoints       = 1000f;
            manager.LockActiveBattleFront(Realms.REALMS_REALM_DESTRUCTION, -1);

            // Ensure battlefront 1 is locked and to Destro
            Assert.IsTrue(manager.GetBattleFrontStatus(manager.ActiveBattleFront.BattleFrontId).LockingRealm == Realms.REALMS_REALM_DESTRUCTION);
            Assert.IsTrue(manager.GetBattleFrontStatus(manager.ActiveBattleFront.BattleFrontId).Locked);
            Assert.IsTrue(manager.GetBattleFrontStatus(manager.ActiveBattleFront.BattleFrontId).FinalVictoryPoint.DestructionVictoryPoints == 5000f);
            Assert.IsTrue(manager.GetBattleFrontStatus(manager.ActiveBattleFront.BattleFrontId).FinalVictoryPoint.OrderVictoryPoints == 1000f);

            // Ensure that the BOs for this battlefront ONLY are locked.
            foreach (var apocBattlefieldObjective in Region1.Campaign.Objectives)
            {
                // Locking a battlefront should ZoneLock the BOs in that Zone, and Open those in the next battlefront.
                if ((apocBattlefieldObjective.ZoneId == 200) || (apocBattlefieldObjective.ZoneId == 201))
                {
                    // Should be all locked.
                    Assert.IsTrue(apocBattlefieldObjective.State == StateFlags.ZoneLocked);
                }
            }
        }
Example #2
0
        public void GetBattleFrontStatus()
        {
            var fakeCommsEngine = A.Fake <IApocCommunications>();

            manager = new UpperTierCampaignManager(SampleProgressionList, RegionMgrs);
            // Must be run before attaching ApocBattleFronts to get an ActiveBF
            var bf = manager.GetActiveBattleFrontFromProgression();

            Region1.Campaign = new Campaign(Region1, Region1BOList, new HashSet <Player>(), manager, FakeComms);
            Region3.Campaign = new Campaign(Region3, Region3BOList, new HashSet <Player>(), manager, FakeComms);
            // Open Praag (BF==1)
            manager.OpenActiveBattlefront();

            var status = manager.GetBattleFrontStatus(bf.BattleFrontId);

            Assert.IsTrue(status.Locked == false);
            Assert.IsTrue(status.FinalVictoryPoint.DestructionVictoryPoints == 0);
            Assert.IsTrue(status.FinalVictoryPoint.OrderVictoryPoints == 0);
            Assert.IsTrue(status.LockStatus == BattleFrontConstants.ZONE_STATUS_CONTESTED);
        }
Example #3
0
        public void RollAllRegionsBackToStart()
        {
            var fakeCommsEngine = A.Fake <IApocCommunications>();

            manager = new UpperTierCampaignManager(SampleProgressionList, RegionMgrs);
            // Must be run before attaching ApocBattleFronts to get an ActiveBF
            var bf = manager.GetActiveBattleFrontFromProgression();

            Region1.Campaign = new Campaign(Region1, Region1BOList, new HashSet <Player>(), manager, FakeComms);
            Region3.Campaign = new Campaign(Region3, Region3BOList, new HashSet <Player>(), manager, FakeComms);
            // Open Praag (BF==1)
            manager.OpenActiveBattlefront();
            // Locking Region1.Campaign
            Region1.Campaign.VictoryPointProgress.DestructionVictoryPoints = 5000f;
            Region1.Campaign.VictoryPointProgress.OrderVictoryPoints       = 1000f;

            manager.LockActiveBattleFront(Realms.REALMS_REALM_DESTRUCTION, -1);

            // Ensure battlefront 1 is locked and to Destro
            Assert.IsTrue(manager.GetBattleFrontStatus(manager.ActiveBattleFront.BattleFrontId).LockingRealm == Realms.REALMS_REALM_DESTRUCTION);
            Assert.IsTrue(manager.GetBattleFrontStatus(manager.ActiveBattleFront.BattleFrontId).Locked);
            Assert.IsTrue(manager.GetBattleFrontStatus(manager.ActiveBattleFront.BattleFrontId).FinalVictoryPoint.DestructionVictoryPoints == 5000f);
            Assert.IsTrue(manager.GetBattleFrontStatus(manager.ActiveBattleFront.BattleFrontId).FinalVictoryPoint.OrderVictoryPoints == 1000f);
            Assert.IsTrue(manager.GetBattleFrontStatus(manager.ActiveBattleFront.BattleFrontId).RegionId == 1);

            // Advance Destro

            var progression = manager.AdvanceBattleFront(Realms.REALMS_REALM_DESTRUCTION);

            Assert.IsTrue(progression.BattleFrontId == 2);
            Assert.IsTrue(progression.ZoneId == 201);
            manager.OpenActiveBattlefront();
            Region1.Campaign.VictoryPointProgress.DestructionVictoryPoints = 5000f;
            Region1.Campaign.VictoryPointProgress.OrderVictoryPoints       = 2200f;

            var activeCampaign = manager.GetActiveCampaign();

            Assert.IsTrue(activeCampaign.ActiveCampaignName == "Chaos Wastes");
            Assert.IsTrue(activeCampaign.Region.RegionId == 1);
            Assert.IsTrue(activeCampaign.VictoryPointProgress.DestructionVictoryPoints == 5000f);
            Assert.IsTrue(activeCampaign.VictoryPointProgress.OrderVictoryPoints == 2200f);

            // Lock Destro again
            manager.LockActiveBattleFront(Realms.REALMS_REALM_DESTRUCTION, -1);

            // Ensure battlefront is locked and to Destro
            Assert.IsTrue(manager.GetBattleFrontStatus(manager.ActiveBattleFront.BattleFrontId).LockingRealm == Realms.REALMS_REALM_DESTRUCTION);
            Assert.IsTrue(manager.GetBattleFrontStatus(manager.ActiveBattleFront.BattleFrontId).Locked);

            // Advance Destro
            var progression2 = manager.AdvanceBattleFront(Realms.REALMS_REALM_DESTRUCTION);

            Assert.IsTrue(progression2.BattleFrontId == 6);
            Assert.IsTrue(progression2.ZoneId == 400);

            // KV
            manager.LockActiveBattleFront(Realms.REALMS_REALM_DESTRUCTION, -1);
            var progression3 = manager.AdvanceBattleFront(Realms.REALMS_REALM_DESTRUCTION);

            manager.OpenActiveBattlefront();
            Assert.IsTrue(progression3.BattleFrontId == 7);
            Assert.IsTrue(progression3.ZoneId == 401);

            //Back to Emp
            manager.LockActiveBattleFront(Realms.REALMS_REALM_DESTRUCTION, -1);
            var progression4 = manager.AdvanceBattleFront(Realms.REALMS_REALM_DESTRUCTION);

            manager.OpenActiveBattlefront();
            Assert.IsTrue(progression4.BattleFrontId == 1);
            Assert.IsTrue(progression4.ZoneId == 200);

            // Should be all unlocked in Praag
            // Ensure that the BOs for this battlefront ONLY are locked.
            foreach (var apocBattlefieldObjective in Region1.Campaign.Objectives)
            {
                // Locking a battlefront should ZoneLock the BOs in that Zone, and Open those in the next battlefront.
                if (apocBattlefieldObjective.ZoneId == 200)
                {
                    // Should be all unsecure.
                    Assert.IsTrue(apocBattlefieldObjective.State == StateFlags.Unsecure);
                }
                else
                {
                    Assert.IsTrue(apocBattlefieldObjective.State == StateFlags.ZoneLocked);
                }
            }

            Assert.IsTrue(manager.GetBattleFrontStatus(manager.ActiveBattleFront.BattleFrontId).LockingRealm == Realms.REALMS_REALM_NEUTRAL);
            Assert.IsFalse(manager.GetBattleFrontStatus(manager.ActiveBattleFront.BattleFrontId).Locked);
        }