public override string HandoutReward(EventRanking eventRanking, int position) { base.HandoutReward(eventRanking, position); if (!Data.Scores.TryGetValue(eventRanking.Client.Player.CharID, out var userScore)) { return(""); } var availableSpecies = userScore.FoundSpecies.ToList(); var selectedIndex = Server.Math.Rand(0, availableSpecies.Count); var selectedSpecies = Pokedex.GetPokemon(availableSpecies[selectedIndex]); var recruit = new Recruit(eventRanking.Client); //recruit.SpriteOverride = -1; recruit.Level = 1; recruit.Species = selectedSpecies.ID; recruit.Sex = Pokedex.GetPokemonForm(selectedSpecies.ID).GenerateLegalSex(); recruit.Name = Pokedex.GetPokemon(selectedSpecies.ID).Name; recruit.Shiny = Enums.Coloration.Shiny; recruit.NpcBase = 0; recruit.GenerateMoveset(); using (var dbConnection = new DatabaseConnection(DatabaseID.Players)) { eventRanking.Client.Player.AddToRecruitmentBank(dbConnection, recruit); } return($"a shiny {selectedSpecies.Name}"); }
private void Button_clicked(object sender, EventArgs e) { var text = txtNumber.Text; int number = int.Parse(text); pokemon = _pokedex.GetPokemon(number); lblName.Text = pokemon.Name; imgImage.Source = ImageSource.FromUri(new Uri(pokemon.ImageUrl)); }
private void ButtonFind_Clicked(object sender, EventArgs e) { var text = txtNumber.Text; if (int.TryParse(text, out int number)) { _pokemon = _pokedex.GetPokemon(number); txtName.Text = _pokemon.Name; imgImage.Source = ImageSource.FromUri(new Uri(_pokemon.ImageUrl)); } }
void ButtonFind_Clicked(object sender, System.EventArgs e) { var textNumber = txtNumberPokemon.Text; if (textNumber != null && textNumber.Length > 0) { int number = int.Parse(textNumber); pokemon = _pokedex.GetPokemon(number); imgPokemon.Source = pokemon.ImageUrl; lblName.Text = pokemon.Name; } }
public override void OnActivateMap(IMap map) { var minionXs = new int[] { 11, 13 }; var mapType = this.typeMappings.Where(x => x.Value == ((InstancedMap)map).MapBase).First().Key; var availableMinions = minionNpcs.Where(x => Pokedex.GetPokemon(NpcManager.Npcs[x].Species).Forms[0].Type1 == mapType || Pokedex.GetPokemon(NpcManager.Npcs[x].Species).Forms[0].Type2 == mapType).ToList(); if (availableMinions.Count == 0) { availableMinions = minionNpcs; } var availableBosses = bossNpcs.Where(x => Pokedex.GetPokemon(NpcManager.Npcs[x].Species).Forms[0].Type1 == mapType || Pokedex.GetPokemon(NpcManager.Npcs[x].Species).Forms[0].Type2 == mapType).ToList(); if (availableBosses.Count == 0) { availableBosses = bossNpcs; } for (var i = 0; i < MinionCount; i++) { var minionSlot = Server.Math.Rand(0, availableMinions.Count); var minion = availableMinions[minionSlot]; var npc = new MapNpcPreset(); npc.SpawnX = minionXs[i]; npc.SpawnY = 6; npc.NpcNum = minion; npc.MaxLevel = 30; npc.MinLevel = 30; map.SpawnNpc(npc); } var bossSlot = Server.Math.Rand(0, availableBosses.Count); var boss = availableMinions[bossSlot]; var bossNpc = new MapNpcPreset(); bossNpc.SpawnX = 12; bossNpc.SpawnY = 6; bossNpc.NpcNum = boss; bossNpc.MinLevel = 35; bossNpc.MaxLevel = 35; map.SpawnNpc(bossNpc); }
public void GetByName() { maybeMon = dex.GetPokemon("Arcanine"); Assert.AreEqual(magsy, maybeMon); }
private void PokemonList_SelectionChanged(object sender, SelectionChangedEventArgs e) { DisplayPokemon.Source = new BitmapImage(new Uri(pokedex.GetPokemon(PokemonList.SelectedIndex).ImageSource)); }