コード例 #1
0
    private void Start()
    {
        // Spawn options
        m_Coordinator = GetComponent <AICoordinator>();

        EncounterSettings settings = SelectSettings();

        if (settings != null)
        {
            m_Coordinator.SpawnPawns(settings.PawnSettings);
        }
    }
コード例 #2
0
    private EncounterSettings SelectSettings()
    {
        EncounterSettings currSettings = null;

        float currDifficulty = EncounterManager.Instance.CurrentDifficulty;

        foreach (var settings in m_DifficultySpawns)
        {
            if (currDifficulty >= settings.MinDifficulty && (currSettings == null || settings.MinDifficulty > currSettings.MinDifficulty))
            {
                currSettings = settings;
            }
        }

        return(currSettings);
    }
コード例 #3
0
        public Config()
        {
            Debug = new DebugSettings()
            {
                Debug         = false,
                ToFiles       = false,
                DebugMessages = false
            };

            Backend = new BackendSocketSettings()
            {
                Port = 9838
            };

            Http = new HttpSettings()
            {
                Enabled          = true,
                Port             = 8888,
                ShowAccountNames = false
            };

            RawData = new RawDataSettings()
            {
                Enabled    = false,
                WebhookUrl = "",
                DelayMs    = 5000
            };

            MySql = new MysqlSettings()
            {
                Enabled          = false,
                ConnectionString = "server=localhost; port=3306; database=mysqldotnet; user=mysqldotnetuser; password=Pa55w0rd!; Persist Security Info=false; Connect Timeout=300"
            };

            MadExport = new MadExportSettings()
            {
                Enabled          = false,
                ConnectionString = "server=localhost; port=3306; database=mysqldotnet; user=mysqldotnetuser; password=Pa55w0rd!; Persist Security Info=false; Connect Timeout=300"
            };

            Encounter = new EncounterSettings()
            {
                Enabled         = false,
                SaveToDatabase  = false,
                DiscordWebhooks = new List <EncounterSettings.WebhookSettings>()
                {
                    new EncounterSettings.WebhookSettings()
                    {
                        WebhookUrl       = "discord webhook url",
                        FilterByIV       = false,
                        OnlyEqual        = false,
                        MinAttackIV      = 0,
                        MinDefenseIV     = 0,
                        MinStaminaIV     = 0,
                        FilterByLocation = false,
                        Latitude         = 0.1,
                        Longitude        = 0.1,
                        DistanceInKm     = 20,
                        CustomLink       = new EncounterSettings.CustomLink()
                        {
                            Title = "Custom Link",
                            Link  = ""
                        }
                    }
                }
            };
        }
コード例 #4
0
        public async Task <MethodResult <Dictionary <PokemonId, PokemonSettings> > > GetItemTemplates()
        {
            if (PokeSettings != null && PokeSettings.Count != 0)
            {
                return(new MethodResult <Dictionary <PokemonId, PokemonSettings> >
                {
                    Data = PokeSettings,
                    Message = "Settings already grabbed",
                    Success = true
                });
            }

            if (!_client.LoggedIn)
            {
                MethodResult result = await AcLogin();

                if (!result.Success)
                {
                    return(new MethodResult <Dictionary <PokemonId, PokemonSettings> >
                    {
                        Message = result.Message
                    });
                }
            }

            if (_client.ClientSession.Templates.ItemTemplates == null)
            {
                return new MethodResult <Dictionary <PokemonId, PokemonSettings> >
                       {
                           Message = "Failed to get setting templates"
                       }
            }
            ;

            var pokemonSettings      = new Dictionary <PokemonId, PokemonSettings>();
            var moveSettings         = new Dictionary <PokemonMove, MoveSettings>();
            var badgeSettings        = new Dictionary <BadgeType, BadgeSettings>();
            var itemSettings         = new Dictionary <ItemId, ItemSettings>();
            var battleSettings       = new GymBattleSettings();
            var upgradeSettings      = new PokemonUpgradeSettings();
            var moveSequenceSettings = new MoveSequenceSettings();
            var encounterSettings    = new EncounterSettings();
            var iapItemDisplay       = new IapItemDisplay();
            var iapSettings          = new IapSettings();
            var equippedBadge        = new EquippedBadgeSettings();
            var questSettings        = new QuestSettings();
            var avatarCustomization  = new AvatarCustomizationSettings();
            var formSettings         = new FormSettings();
            var genderSettings       = new GenderSettings();
            var gymBadgeSettings     = new GymBadgeGmtSettings();
            var weatherAffinities    = new WeatherAffinity();
            var weatherBonusSettings = new WeatherBonus();
            var pokemonScaleSettings = new PokemonScaleSetting();
            var typeEffective        = new TypeEffectiveSettings();
            var camera   = new CameraSettings();
            var gymLevel = new GymLevelSettings();

            foreach (var template in _client.ClientSession.Templates.ItemTemplates)
            {
                if (template.PlayerLevel != null)
                {
                    LevelSettings = template.PlayerLevel;

                    continue;
                }

                if (template.PokemonSettings != null)
                {
                    if (pokemonSettings.ContainsKey(template.PokemonSettings.PokemonId))
                    {
                        pokemonSettings.Remove(template.PokemonSettings.PokemonId);
                    }
                    pokemonSettings.Add(template.PokemonSettings.PokemonId, template.PokemonSettings);
                }
                else if (template.MoveSettings != null)
                {
                    if (moveSettings.ContainsKey(template.MoveSettings.MovementId))
                    {
                        moveSettings.Remove(template.MoveSettings.MovementId);
                    }
                    moveSettings.Add(template.MoveSettings.MovementId, template.MoveSettings);
                }
                else if (template.BadgeSettings != null)
                {
                    if (badgeSettings.ContainsKey(template.BadgeSettings.BadgeType))
                    {
                        badgeSettings.Remove(template.BadgeSettings.BadgeType);
                    }
                    badgeSettings.Add(template.BadgeSettings.BadgeType, template.BadgeSettings);
                }
                else if (template.ItemSettings != null)
                {
                    if (itemSettings.ContainsKey(template.ItemSettings.ItemId))
                    {
                        itemSettings.Remove(template.ItemSettings.ItemId);
                    }
                    itemSettings.Add(template.ItemSettings.ItemId, template.ItemSettings);
                }
                else if (template.EncounterSettings != null)
                {
                    encounterSettings = template.EncounterSettings;
                }
                else if (template.MoveSequenceSettings != null)
                {
                    moveSequenceSettings = template.MoveSequenceSettings;
                }
                else if (template.BattleSettings != null)
                {
                    battleSettings = template.BattleSettings;
                }
                else if (template.IapItemDisplay != null)
                {
                    iapItemDisplay = template.IapItemDisplay;
                }
                else if (template.IapSettings != null)
                {
                    iapSettings = template.IapSettings;
                }
                else if (template.EquippedBadges != null)
                {
                    equippedBadge = template.EquippedBadges;
                }
                else if (template.QuestSettings != null)
                {
                    questSettings = template.QuestSettings;
                }
                else if (template.AvatarCustomization != null)
                {
                    avatarCustomization = template.AvatarCustomization;
                }
                else if (template.FormSettings != null)
                {
                    formSettings = template.FormSettings;
                }
                else if (template.GenderSettings != null)
                {
                    genderSettings = template.GenderSettings;
                }
                else if (template.GymBadgeSettings != null)
                {
                    gymBadgeSettings = template.GymBadgeSettings;
                }
                else if (template.WeatherAffinities != null)
                {
                    weatherAffinities = template.WeatherAffinities;
                }
                else if (template.WeatherBonusSettings != null)
                {
                    weatherBonusSettings = template.WeatherBonusSettings;
                }
                else if (template.PokemonScaleSettings != null)
                {
                    pokemonScaleSettings = template.PokemonScaleSettings;
                }
                else if (template.TypeEffective != null)
                {
                    typeEffective = template.TypeEffective;
                }
                else if (template.Camera != null)
                {
                    camera = template.Camera;
                }
                else if (template.GymLevel != null)
                {
                    gymLevel = template.GymLevel;
                }
                else if (template.PokemonUpgrades != null)
                {
                    upgradeSettings = template.PokemonUpgrades;
                }
            }

            PokeSettings                   = pokemonSettings;
            MoveSettings                   = moveSettings;
            BadgeSettings                  = badgeSettings;
            ItemSettings                   = itemSettings;
            BadgeSettings                  = badgeSettings;
            UpgradeSettings                = upgradeSettings;
            GetMoveSequenceSettings        = moveSequenceSettings;
            GetEncounterSettings           = encounterSettings;
            GetIapItemDisplay              = iapItemDisplay;
            GetIapSettings                 = iapSettings;
            GetEquippedBadgeSettings       = equippedBadge;
            GetQuestSettings               = questSettings;
            GetAvatarCustomizationSettings = avatarCustomization;
            GetFormSettings                = formSettings;
            GetGenderSettings              = genderSettings;
            GetGymBadgeGmtSettings         = gymBadgeSettings;
            GetWeatherAffinity             = weatherAffinities;
            GetWeatherBonus                = weatherBonusSettings;
            GetPokemonScaleSetting         = pokemonScaleSettings;
            GetTypeEffectiveSettings       = typeEffective;
            GetCameraSettings              = camera;
            GetGymLevelSettings            = gymLevel;

            return(new MethodResult <Dictionary <PokemonId, PokemonSettings> >
            {
                Data = pokemonSettings,
                Message = "Success",
                Success = true
            });
        }