private void SetupSettings()
 {
     _settings = new TestSettings();
     _settings.SetDefaultSettings();
     _formationBanners = new TestFormations();
     _formationBanners.SetDefaultFormationSettings();
 }
示例#2
0
        public BattleBannerAssignBehaviour(IBMBSettings settings, IBMBFormationBanners formationBannerSettings, MissionType missionType)
        {
            _controller              = new BattleBannerController(settings, formationBannerSettings, missionType);
            _dropBannerController    = new DropBannerController(settings);
            _settings                = settings;
            _formationBannerSettings = formationBannerSettings;

            // For battles, we don't want ranged units dropping banners because they had a bow
            _forbiddenWeapons = new HashSet <WeaponClass>()
            {
                WeaponClass.Arrow,
                WeaponClass.Bolt,
                WeaponClass.Bow,
                WeaponClass.Crossbow
            };

            _formationBanners = new Dictionary <FormationGroup, Banner>()
            {
                { FormationGroup.Infantry, new Banner(_formationBannerSettings.Infantry) },
                { FormationGroup.Ranged, new Banner(_formationBannerSettings.Ranged) },
                { FormationGroup.Cavalry, new Banner(_formationBannerSettings.Cavalry) },
                { FormationGroup.HorseArcher, new Banner(_formationBannerSettings.HorseArcher) },
                { FormationGroup.Skirmisher, new Banner(_formationBannerSettings.Skirmisher) },
                { FormationGroup.HeavyInfantry, new Banner(_formationBannerSettings.HeavyInfantry) },
                { FormationGroup.LightCavalry, new Banner(_formationBannerSettings.LightCavalry) },
                { FormationGroup.HeavyCavalry, new Banner(_formationBannerSettings.HeavyCavalry) }
            };
        }
示例#3
0
 private static IBMBSettings GetInstance()
 {
     if (_settings == null)
     {
         _settings = SettingsLoader.LoadBMBSettings();
     }
     return(_settings);
 }
 public TournamentBannerAssignBehaviour(IBMBSettings settings)
 {
     _controller           = new TournamentBannerController(settings);
     _dropBannerController = new DropBannerController(settings);
     _settings             = settings;
     _forbiddenWeapons     = new HashSet <ItemObject.ItemTypeEnum>()
     {
         ItemObject.ItemTypeEnum.Shield
     };
 }
示例#5
0
        public BattleBannerController(IBMBSettings settings, IBMBFormationBanners formationBanners, MissionType missionType)
        {
            _settings         = settings;
            _formationBanners = formationBanners;
            _missionType      = missionType;

            _processedBySpec        = new Dictionary <string, Dictionary <TroopSpecialization, List <IBMBAgent> > >();
            _processedByFormation   = new Dictionary <string, Dictionary <FormationGroup, List <IBMBAgent> > >();
            _processedByTroop       = new Dictionary <string, Dictionary <IBMBCharacter, List <IBMBAgent> > >();
            _equippedBannersByParty = new Dictionary <string, int>();
            PopulateAllowedFormations();
        }
        public BattleBannerController(IBMBSettings settings, IPolybianConfig polybianConfig, MissionType missionType)
        {
            _settings       = settings;
            _polybianConfig = polybianConfig;
            _missionType    = missionType;

            _processedBySpec        = new Dictionary <string, Dictionary <TroopSpecialization, List <IBMBAgent> > >();
            _processedByFormation   = new Dictionary <string, Dictionary <FormationGroup, List <IBMBAgent> > >();
            _processedByTroop       = new Dictionary <string, Dictionary <IBMBCharacter, List <IBMBAgent> > >();
            _equippedBannersByParty = new Dictionary <string, int>();
            _polybianDict           = _polybianConfig.PolybianDict;
            _polybianIdCount        = new Dictionary <string, int>();
        }
示例#7
0
        public CustomBattleBannerBehaviour(IBMBSettings settings)
        {
            _controller           = new BattleBannerController(settings, null, MissionType.CustomBattle);
            _dropBannerController = new DropBannerController(settings);
            _settings             = settings;

            _forbiddenWeapons = new HashSet <WeaponClass>()
            {
                WeaponClass.Arrow,
                WeaponClass.Bolt,
                WeaponClass.Bow,
                WeaponClass.Crossbow
            };
        }
示例#8
0
 public DropBannerComponent(Agent agent, IBMBSettings settings, DropBannerController controller) : base(agent)
 {
     try
     {
         _settings         = settings;
         _controller       = controller;
         _dropsOnLowHealth = _controller.DropsOnLowHealth();
         _dropsOnRetreat   = _controller.DropsOnRetreat(agent.Character.GetPower());
     }
     catch (Exception ex)
     {
         Main.LogError(ex);
     }
 }
示例#9
0
        public CustomBattleBannerBehaviour(IBMBSettings settings)
        {
            _controller           = new BattleBannerController(settings, null, MissionType.CustomBattle);
            _dropBannerController = new DropBannerController(settings);
            _settings             = settings;

            _forbiddenWeapons = new HashSet <ItemObject.ItemTypeEnum>()
            {
                ItemObject.ItemTypeEnum.Arrows,
                ItemObject.ItemTypeEnum.Bolts,
                ItemObject.ItemTypeEnum.Bow,
                ItemObject.ItemTypeEnum.Crossbow
            };
        }
示例#10
0
        public BattleBannerAssignBehaviour(IBMBSettings settings, IPolybianConfig polybianConfig, MissionType missionType)
        {
            _controller           = new BattleBannerController(settings, polybianConfig, missionType);
            _dropBannerController = new DropBannerController(settings);
            _settings             = settings;
            _polybianConfig       = polybianConfig;

            // For battles, we don't want ranged units dropping banners because they had a bow
            _forbiddenWeapons = new HashSet <ItemObject.ItemTypeEnum>()
            {
                ItemObject.ItemTypeEnum.Arrows,
                ItemObject.ItemTypeEnum.Bolts,
                ItemObject.ItemTypeEnum.Bow,
                ItemObject.ItemTypeEnum.Crossbow
            };
        }
示例#11
0
        protected override void OnSubModuleLoad()
        {
            base.OnSubModuleLoad();
            try
            {
                FileDatabase.Initialise(ModuleFolderName);
                BMBSettings settings = FileDatabase.Get <BMBSettings>(BMBSettings.InstanceID) ??
                                       (BMBSettings) new BMBSettings().SetDefaults();

                _settings = settings;
                SettingsDatabase.RegisterSettings(settings);
            }
            catch (Exception ex)
            {
                LogInMessageLog("BMB Error: " + ex.Message);
            }
        }
示例#12
0
        public static IBMBSettings SetDefaultSettings(this IBMBSettings settings)
        {
            settings.AllowSoldiers      = true;
            settings.AllowCaravanGuards = CaravanAssignMode.OnlyMasters;
            settings.AllowMercenaries   = true;
            settings.AllowBandits       = BanditAssignMode.RecruitedOnly;

            settings.AllowTypeInfantry      = true;
            settings.AllowTypeRanged        = true;
            settings.AllowTypeMounted       = true;
            settings.AllowTypeMountedRanged = true;

            settings.FilterTiers  = false;
            settings.AllowedTiers = "4,5,6";

            settings.AllowPlayer     = false;
            settings.AllowCompanions = false;
            settings.AllowNobles     = false;

            settings.BearerToTroopRatio = 100;
            settings.UnitCountMode      = UnitCountMode.Spec;

            settings.AllowSieges = true;
            settings.SiegeAttackersUseBanners = true;
            settings.SiegeDefendersUseBanners = false;

            settings.AllowHideouts = false;
            settings.HideoutAttackersUseBanners = false;
            settings.HideoutBanditsUseBanners   = false;

            settings.DropOnLowHealth     = true;
            settings.DropHealthThreshold = 20;
            settings.DropRetreatMode     = DropRetreatMode.Weighted;
            settings.DropRetreatChance   = 0.6f;

            settings.ShowMessages  = true;
            settings.WhiteMessages = false;
            settings.ReloadFiles   = false;

            return(settings);
        }
        public static IBMBSettings SetDefaults(this IBMBSettings settings)
        {
            settings.AllowSoldiers      = true;
            settings.AllowCaravanGuards = false;
            settings.AllowMercenaries   = false;
            settings.AllowBandits       = false;
            settings.AllowInfantry      = true;
            settings.AllowMounted       = true;
            settings.AllowRanged        = false;
            settings.AllowMountedRanged = false;

            settings.FilterTiers    = true;
            settings.AllowTier1     = false;
            settings.AllowTier2     = false;
            settings.AllowTier3     = false;
            settings.AllowTier4     = true;
            settings.AllowTier5     = true;
            settings.AllowTier6     = true;
            settings.AllowTier7Plus = false;

            settings.AllowPlayer     = false;
            settings.AllowCompanions = false;
            settings.AllowNobles     = false;

            settings.BearerToTroopRatio = 7;
            settings.UseTroopSpecs      = false;

            settings.AllowSieges = true;
            settings.SiegeAttackersUseBanners = true;
            settings.SiegeDefendersUseBanners = false;

            settings.AllowHideouts = false;
            settings.HideoutAttackersUseBanners = false;
            settings.HideoutBanditsUseBanners   = false;

            settings.ShowMessages = true;

            return(settings);
        }
        public static IBMBSettings SetDefaultSettings(this IBMBSettings settings)
        {
            settings.AllowSoldiers      = true;
            settings.AllowMercenaries   = true;
            settings.AllowCaravanGuards = CaravanAssignMode.OnlyMasters;
            settings.AllowBandits       = BanditAssignMode.RecruitedOnly;

            settings.AllowTypeInfantry      = true;
            settings.AllowTypeRanged        = true;
            settings.AllowTypeMounted       = true;
            settings.AllowTypeMountedRanged = true;

            settings.FilterTiers  = true;
            settings.AllowedTiers = "3,4,5,6";

            settings.AllowFormationInfantry      = true;
            settings.AllowFormationRanged        = true;
            settings.AllowFormationCavalry       = true;
            settings.AllowFormationHorseArcher   = true;
            settings.AllowFormationSkirmisher    = true;
            settings.AllowFormationHeavyInfantry = true;
            settings.AllowFormationLightCavalry  = true;
            settings.AllowFormationHeavyCavalry  = true;

            settings.AllowPlayer     = false;
            settings.AllowCompanions = false;
            settings.AllowNobles     = false;

            settings.BearerToTroopRatio = 10;
            settings.UnitCountMode      = UnitCountMode.Spec;

            settings.AllowSieges = true;
            settings.SiegeAttackersUseBanners = true;
            settings.SiegeDefendersUseBanners = false;

            settings.AllowHideouts = false;
            settings.HideoutAttackersUseBanners = false;
            settings.HideoutBanditsUseBanners   = false;

            settings.TournamentBanners          = true;
            settings.TournamentThemes           = true;
            settings.TournamentBannersInShields = false;

            settings.TownCastleVisitBanner = false;
            settings.VillageVisitBanner    = true;

            settings.DropOnLowHealth     = true;
            settings.DropHealthThreshold = 35;
            settings.DropRetreatMode     = DropRetreatMode.Weighted;
            settings.DropRetreatChance   = 0.6f;

            settings.EnableFormationBanners        = false;
            settings.CompanionsUseFormationBanners = false;
            settings.FormationBannersUseInShields  = true;

            settings.ShowMessages  = true;
            settings.DebugMessages = false;
            settings.WhiteMessages = false;
            settings.ReloadFiles   = false;
            settings.KonamiCode    = false;

            return(settings);
        }
示例#15
0
 public BannerAssignmentController(IBMBSettings settings)
 {
     _settings = settings;
 }
示例#16
0
 public static IBMBSettings Reload()
 {
     _settings = null;
     return(Instance);
 }
 public TournamentBannerController(IBMBSettings settings)
 {
     _settings = settings;
 }
 public DropBannerController(IBMBSettings settings)
 {
     _settings = settings;
 }
 public BattleBannerAssignBehaviour(IBMBSettings settings)
 {
     _bannerAssignmentController = new BannerAssignmentController(settings);
 }
示例#20
0
 private void SetupSettings()
 {
     _settings = new TestSettings();
     _settings.SetDefaults();
 }