public PokedexNestScreen(Screen preScreen, PokedexEntry entry) { _preScreen = preScreen; _entry = entry; // TODO: set location from current map location _location = "NEW BARK TOWN"; }
private void ConfirmSearch() { var type1 = (PokemonType)(_type1Index + 1); var type2 = (PokemonType)_type2Index; var resultEntries = PokedexEntry.GetTypeFiltered(type1, type2, _listMode); if (resultEntries.Length > 0) { var resultScreen = new PokedexResultScreen(this, type1, type2, _listMode); resultScreen.LoadContent(); GetComponent <ScreenManager>().SetScreen(resultScreen); // reset ui _type1Index = 0; _type2Index = 0; } else { // display no results message _noResultsDelay = NO_RESULTS_DELAY; _selectorVisible = false; } // push cursor to top _index = 0; }
public PokedexDetailsScreen(Screen preScreen, PokedexEntry entry, Func <PokedexEntry> GetNextEntry, Func <PokedexEntry> GetPreviousEntry) { _preScreen = preScreen; _entry = entry; _getNextEntry = GetNextEntry; _getPreviousEntry = GetPreviousEntry; }
public IEnumerator DisplayABio(int whatBio) { SoundManager.instance.SetMusicLow(); PokedexEntry entry = GameData.instance.pokedexlist[whatBio - 1]; Debug.Log("Display " + PokemonData.IndexToMon(whatBio) + "'s bio. \n This Pokemon " + (entry.seen && entry.caught ? "has been seen and caught." : entry.seen ? "has been seen." : "has not been seen or caught.")); bioscreen.enabled = true; currentBioNumber = 0; for (int i = 0; i < 3; i++) { if (i > 0 && !GameData.instance.pokedexlist[whatBio - 1].caught) { break; } displayingbio = true; bioscreen.sprite = bios [whatBio + (2 * (whatBio - 1)) + (i - 1)]; while (displayingbio) { yield return(new WaitForSeconds(0.01f)); if (Inputs.pressed("a")) { displayingbio = false; break; } } } bioscreen.enabled = false; SoundManager.instance.SetMusicNormal(); }
public PokedexEntry GetPreviousEntry() { var i = _index + _scrollIndex - 1; var scrolled = 1; PokedexEntry entry = null; while (i >= 0 && entry == null) { if (_entries[i].IsKnown) { entry = _entries[i]; _index -= scrolled; while (_index < 0) { _scrollIndex--; _index++; } // do not want the image to animation when returning: _entryStack.Clear(); _spriteAnimationStack.Clear(); } else { i--; scrolled++; } } return(entry); }
static Pokedex() { //Create some pokemon //Missingno PokemonStats missingnoBaseStats = new PokemonStats ( 56, 35, 25, 35, 72, 30 ); PokedexEntry missingno = new PokedexEntry ( new DexID("", 0), "Missingno.", missingnoBaseStats, PokemonType.bug ); AddEntry(missingno); }
public static string ThrowBall(Ball ball, Pokemon pokemon, int tries) { ball.count--; PokeData.WriteBalls(Balls); int number = rand.Next(1, 10 * pokemon.rarity); if (Ran(pokemon, tries)) { return("ran"); } else if (number % ball.power == 0) { PokedexEntry entry = GeneratePokedexEntry(pokemon); UpdatePokedex(entry); return("caught"); } else if (number % ball.power != 0) { return("broke"); } else { return(null); } }
// methods called from the details screen to go the next/previous entry // returns null when past list boundary public PokedexEntry GetNextEntry() { var i = _index + _scrollIndex + 1; var scrolled = 1; PokedexEntry entry = null; while (i < _entries.Length && entry == null) { if (_entries[i].IsKnown) { entry = _entries[i]; _index += scrolled; while (_index >= VisibleEntries) { _scrollIndex++; _index--; } // do not want the image to animation when returning: _entryStack.Clear(); _spriteAnimationStack.Clear(); } else { i++; scrolled++; } } return(entry); }
public PokedexEntryExportModel(PokedexEntry entry) { Id = (int)entry.PokemonId; Name = entry.PokemonId.ToString(); TimesEncountered = entry.TimesEncountered; TimesCaught = entry.TimesCaptured; }
public override int GetHashCode() { int hash = 1; if (pokemonData_ != null) { hash ^= PokemonData.GetHashCode(); } if (item_ != null) { hash ^= Item.GetHashCode(); } if (pokedexEntry_ != null) { hash ^= PokedexEntry.GetHashCode(); } if (playerStats_ != null) { hash ^= PlayerStats.GetHashCode(); } if (playerCurrency_ != null) { hash ^= PlayerCurrency.GetHashCode(); } if (playerCamera_ != null) { hash ^= PlayerCamera.GetHashCode(); } if (inventoryUpgrades_ != null) { hash ^= InventoryUpgrades.GetHashCode(); } if (appliedItems_ != null) { hash ^= AppliedItems.GetHashCode(); } if (eggIncubators_ != null) { hash ^= EggIncubators.GetHashCode(); } if (candy_ != null) { hash ^= Candy.GetHashCode(); } if (quest_ != null) { hash ^= Quest.GetHashCode(); } if (avatarItem_ != null) { hash ^= AvatarItem.GetHashCode(); } if (raidTickets_ != null) { hash ^= RaidTickets.GetHashCode(); } return(hash); }
//Mouse Double click event private void dgPokemonList1_MouseDoubleClick(object sender, MouseButtonEventArgs e) { pokemon1 = (Pokemon)dgPokemonList1.SelectedItem; statsTotal1 = pokedexEntry1.PokemonHP + pokedexEntry1.PokemonDefense + pokedexEntry1.PokemonDefense + pokedexEntry1.PokemonSpecialAttack + pokedexEntry1.PokemonSpeed; pokedexEntry1 = _pokemonManager.GetPokedexEntry(pokemon1.PokemonNumber); dgPokemonList1.IsEnabled = false; btnSelectionChange1.Visibility = Visibility.Visible; if (dgPokemonList2.IsEnabled == false) { btnCompare.IsEnabled = true; btnBattle.IsEnabled = true; } if (cboPokemonVersion1.SelectedItem.ToString() == "Pokemon") { pokedexEntry1 = _pokemonManager.GetPokedexEntry(pokemon1.PokemonNumber); } else { pokedexEntry1 = _pokemonManager.RetrieveAlternateVersionStats(pokemon1.PokemonName); } barHP_1.Maximum = 10; barAttack_1.Maximum = 10; barDefense_1.Maximum = 10; barSpecialAttack_1.Maximum = 10; barSpecialDefense_1.Maximum = 10; barSpeed_1.Maximum = 10; barTotal_1.Maximum = 50; lblPkmnName1.Content = pokedexEntry1.PokemonNames.ToString(); lblTypeHolder_1.Content = pokedexEntry1.PokemonTypes.ToString(); lblType2Holder_1.Content = pokedexEntry1.PokemonTypes2.ToString(); lblAbilityHolder_1.Content = pokedexEntry1.PokemonAbility.ToString(); if (pokedexEntry1.PokemonAbility != null) { lblAbility2Holder_1.Content = pokedexEntry1.PokemonAbility.ToString(); } barHP_1.Value = pokedexEntry1.PokemonHP; lblHPNum_1.Content = pokedexEntry1.PokemonHP; barAttack_1.Value = pokedexEntry1.PokemonAttack; lblAttackNum_1.Content = pokedexEntry1.PokemonAttack; barDefense_1.Value = pokedexEntry1.PokemonDefense; lblDefenseNum_1.Content = pokedexEntry1.PokemonDefense; barSpecialAttack_1.Value = pokedexEntry1.PokemonSpecialAttack; lblSpecialAttackNum_1.Content = pokedexEntry1.PokemonSpecialAttack; barSpecialDefense_1.Value = pokedexEntry1.PokemonSpecialDefense; lblSpecialDefenseNum_1.Content = pokedexEntry1.PokemonSpecialDefense; barSpeed_1.Value = pokedexEntry1.PokemonSpeed; lblSpeedNum_1.Content = pokedexEntry1.PokemonSpeed; barTotal_1.Value = pokedexEntry1.PokemonHP + pokedexEntry1.PokemonDefense + pokedexEntry1.PokemonDefense + pokedexEntry1.PokemonSpecialAttack + pokedexEntry1.PokemonSpeed; lblTotalNum_1.Content = pokedexEntry1.PokemonHP + pokedexEntry1.PokemonDefense + pokedexEntry1.PokemonDefense + pokedexEntry1.PokemonSpecialAttack + pokedexEntry1.PokemonSpeed; PokedexDataObjects.PokedexAppDetails.AppPath = AppContext.BaseDirectory; imgPokemon1.Source = new BitmapImage(new Uri(PokedexAppDetails.ImagePath + pokedexEntry1.PokemonImage.ToString())); }
internal override void LoadContent() { base.LoadContent(); _overlay = Controller.Content.LoadDirect <Texture2D>("Textures/UI/Pokedex/resultsOverlay.png"); _selector = Controller.Content.LoadDirect <Texture2D>("Textures/UI/Pokedex/selectorWide.png"); _entries = PokedexEntry.GetTypeFiltered(_type1, _type2, ListMode); PresetSelection(); }
internal override void LoadContent() { base.LoadContent(); _overlay = Controller.Content.LoadDirect <Texture2D>("Textures/UI/Pokedex/nationalOverlay.png"); _selector = Controller.Content.LoadDirect <Texture2D>("Textures/UI/Pokedex/selectorWide.png"); _entries = PokedexEntry.GetNational(); PresetSelection(); }
private void UpdatePokedexListView() { PokedexEntry p = Logic.GeneratePokedexEntry(currentPokemon); ListViewItem item = new ListViewItem(); item.ImageIndex = Convert.ToInt16(p.id); item.Text = p.id.ToString() + " " + p.name; item.SubItems.Add("Type: " + p.type); item.SubItems.Add("Moves: " + p.moves); lv_pokedex.Items.Add(item); }
public static PokedexEntry GeneratePokedexEntry(Pokemon pokemon) { PokedexEntry pokedex_entry = new PokedexEntry(); pokedex_entry.id = pokemon.id.ToString().PadLeft(3, '0'); pokedex_entry.name = pokemon.name; pokedex_entry.level = pokemon.level; pokedex_entry.rarity = pokemon.rarity; pokedex_entry.type = GetPokemonType(pokemon); pokedex_entry.moves = GetPokemonMoves(pokemon); return(pokedex_entry); }
public void BuildFromPokedexEntry(PokedexEntry pokedexEntry) { if (pokedexEntry == null) { return; } TimesCaptured = pokedexEntry.TimesCaptured; TimesEncountered = pokedexEntry.TimesEncountered; EvolutionStonePieces = pokedexEntry.EvolutionStonePieces; EvolutionStones = pokedexEntry.EvolutionStones; }
private PokemonModel FromId(PokemonId id) { PokemonModel temp = new PokemonModel(); PokemonSettings pokeman = GameClient.GetExtraDataForPokemon(id); temp.BuildFromSettings(pokeman); PokedexEntry pokedexEntry = GameClient.PokedexInventory.FirstOrDefault(x => x.PokemonId == id); temp.BuildFromPokedexEntry(pokedexEntry); return(temp); }
public void SetListMode(PokedexListMode listMode) { ListMode = listMode; if (ListMode == PokedexListMode.Regional) { _entries = PokedexEntry.GetRegional(); } else { _entries = PokedexEntry.GetRegionalAtoZ(); } PresetSelection(); }
private bool PokedexFilter(object item) { PokedexEntry pokemon = item as PokedexEntry; bool result = true; foreach (PokedexFilterElement filter in this.Filters) { if (!filter.EvaluateFilter(pokemon)) { result = false; } } return(result); }
private async Task ReadPokemonExcelData(SLDocument document) { document.SelectWorksheet("My Pokemon"); int row = 2, col = 2; this.MyPokemon.Clear(); while (!string.IsNullOrWhiteSpace(document.GetCellValueAsString(row, col))) { col = 2; string name = document.GetCellValueAsString(row, 2); string speciesName = document.GetCellValueAsString(row, 3); PokedexEntry species = this.Pokedex.SingleOrDefault(x => x.Species.Equals(speciesName)); if (species == null) { Debug.WriteLine($"Could not find species {speciesName}"); row++; continue; } Pokemon pokemon = new Pokemon(species, name); pokemon.GameCP = document.GetCellValueAsInt32(row, 8); pokemon.GameHP = document.GetCellValueAsInt32(row, 9); pokemon.DustToPower = document.GetCellValueAsInt32(row, 10); pokemon.HasBeenPowered = document.GetCellValueAsString(row, 11).Equals("Yes"); pokemon.StaminaIVExpression = document.GetCellValueAsString(row, 15); pokemon.AttackIVExpression = document.GetCellValueAsString(row, 16); pokemon.DefenseIVExpression = document.GetCellValueAsString(row, 17); pokemon.LevelExpression = document.GetCellValueAsString(row, 18); string fastMoveName = document.GetCellValueAsString(row, 13); PokedexFastMoveWrapper fastMove = await Task.Run(() => species.FastMoves.SingleOrDefault(x => x.FastMove.Name.Equals(fastMoveName))); if (fastMove != null) { pokemon.FastMove = fastMove; } string chargeMoveName = document.GetCellValueAsString(row, 14); PokedexChargeMoveWrapper chargeMove = await Task.Run(() => species.ChargeMoves.SingleOrDefault(x => x.ChargeMove.Name.Equals(chargeMoveName))); if (chargeMove != null) { pokemon.ChargeMove = chargeMove; } this.MyPokemon.Add(pokemon); row++; } }
private void DrawPokemonPortrait(PokedexEntry entry) { var unit = (int)(Border.SCALE * Border.UNIT); var width = Border.SCREEN_WIDTH * unit; var startX = (int)(Controller.ClientRectangle.Width / 2f - width / 2f); if (_entryStack.Count == 0) { _entryStack.Insert(0, entry); _spriteAnimationStack.Insert(0, 1); } else if (_entryStack[0] != entry) { _entryStack.Insert(0, entry); _spriteAnimationStack.Insert(0, 0); } for (var i = _entryStack.Count - 1; i >= 0; i--) { var stackEntry = _entryStack[i]; var animation = _spriteAnimationStack[i]; Color backgroundColor; Texture2D sprite; if (stackEntry.IsKnown) { backgroundColor = POKEMON_PORTRAIT_BACKGROUND; sprite = GetPokemonPortrait(stackEntry.Id); } else { backgroundColor = POKEMON_UNKNOWN_BACKGROUND; sprite = _unknown; } var spriteSlice = (int)(animation * sprite.Width); var targetRect = new Rectangle( (int)(startX + 3 * Border.SCALE), unit, (int)(spriteSlice * Border.SCALE), unit * 7); _batch.DrawRectangle(targetRect, backgroundColor); _batch.Draw(sprite, targetRect, new Rectangle(0, 0, spriteSlice, sprite.Height), Color.White); } }
private async Task ReadMovesetExcelData(SLDocument document) { document.SelectWorksheet("Movesets"); int row = 2, col = 2; while (!string.IsNullOrWhiteSpace(document.GetCellValueAsString(row, col))) { col = 2; string name = document.GetCellValueAsString(row, col); PokedexEntry species = this.Pokedex.SingleOrDefault(x => x.Species.Equals(name)); if (species == null) { Debug.WriteLine($"Could not find species {name}"); row++; continue; } species.FastMoves.Clear(); species.ChargeMoves.Clear(); for (int i = 0; i < 2; i++) { string moveName = document.GetCellValueAsString(row, 3 + i); if (!string.IsNullOrWhiteSpace(moveName)) { FastMove fastMove = await Task.Run(() => this.FastMoveList.SingleOrDefault(x => x.Name.Equals(moveName))); if (fastMove != null) { species.FastMoves.Add(new PokedexFastMoveWrapper(fastMove)); } } } int index = 0; while (!string.IsNullOrWhiteSpace(document.GetCellValueAsString(row, 5 + index))) { string moveName = document.GetCellValueAsString(row, 5 + index); ChargeMove chargeMove = await Task.Run(() => this.ChargeMoveList.SingleOrDefault(x => x.Name.Equals(moveName))); if (chargeMove != null) { species.ChargeMoves.Add(new PokedexChargeMoveWrapper(chargeMove)); } index++; } row++; } }
public async Task <PokedexEntry> LoadPokedexEntryAsync(int dexId, int speciesId, int displayLanguage, CancellationToken token) { try { var tableQuery = _connection.Table <DbPokemonDexNumber>().Where(w => w.PokedexId == dexId && w.PokemonSpeciesId == speciesId); List <DbPokemonDexNumber> entries = await tableQuery.ToListAsync(token); var result = new PokedexEntry { Id = dexId }; if (entries.Any()) { result.DexNumber = entries.First().PokedexNumber; } return(result); } catch (Exception) { return(null); } }
public PokemonModel(PokemonId id) { PokemonSettings pokeman = GameClient.GetExtraDataForPokemon(id); BuildFromSettings(pokeman); PokedexEntry pokedexEntry = GameClient.PokedexInventory.FirstOrDefault(x => x.PokemonId == id); BuildFromPokedexEntry(pokedexEntry); PokemonModel pokemonModel = new PokemonModel(pokeman, pokedexEntry); var CurrPokemon = pokemonModel; Evolutions.Add(pokemonModel); while (CurrPokemon.ParentPokemonId != PokemonId.Missingno) { var insertme = FromId(CurrPokemon.ParentPokemonId); Evolutions.Insert(0, insertme); CurrPokemon = FromId(CurrPokemon.ParentPokemonId); } CurrPokemon = pokemonModel; while (CurrPokemon.EvolutionIds.Count > 0) { foreach (PokemonId ev in CurrPokemon.EvolutionIds) { var addme = FromId(ev); Evolutions.Add(addme); } CurrPokemon = new PokemonModel(CurrPokemon.EvolutionIds.ElementAt(0)); } if (TimesCaptured == 0 && Id == PokemonId.Poliwag) { Debug.WriteLine(Name); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { List <PokedexEntry> pokedexEntries = new List <PokedexEntry>(); List <PlayerPokedex> playerPokedexList = DatabaseOperations.GetPlayerPokedexEntries(PlayerInformation.PlayerId); List <Pokedex> pokedexList = DatabaseOperations.GetPokedexEntries(); // nieuwe pokedexEntry objecten aanmaken voor het aantal pokemon in de pokedex, startwaardes geven en toevoegen aan lijst foreach (var item in pokedexList) { PokedexEntry p = new PokedexEntry { PokedexNumber = item.PokedexEntry, Name = "???", Caught = false, Encountered = false }; pokedexEntries.Add(p); } // Voor elk item in de pokedexEntries lijst controleren of de speler deze pokemon heeft in zijn pokedex. // name, caught en encountered gelijkstellen aan de juist waardens als speler deze pokemon in zijn pokedex heeft. for (int i = 0; i < pokedexEntries.Count; i++) { int index = pokedexEntries[i].PokedexNumber; foreach (var record in playerPokedexList) { if (record.PokedexId == index) { pokedexEntries[i].Name = pokedexList[i].Name; pokedexEntries[i].Caught = record.Caught; pokedexEntries[i].Encountered = record.Encountered; } } } datagridPokedex.ItemsSource = pokedexEntries; }
private void JumpTo(string name) { PokedexEntry jumpTarget = this.Session.Pokedex.FirstOrDefault(x => x.Species.Equals(name)); this.PokedexEntries.MoveCurrentTo(jumpTarget); }
private async void ShowMovesets(PokedexEntry species) { await this.navigationService.OpenPopup <EditMovesetsViewModel>(species); }
public void MergeFrom(InventoryItemData other) { if (other == null) { return; } if (other.pokemonData_ != null) { if (pokemonData_ == null) { pokemonData_ = new global::POGOProtos.Data.PokemonData(); } PokemonData.MergeFrom(other.PokemonData); } if (other.item_ != null) { if (item_ == null) { item_ = new global::POGOProtos.Inventory.Item.ItemData(); } Item.MergeFrom(other.Item); } if (other.pokedexEntry_ != null) { if (pokedexEntry_ == null) { pokedexEntry_ = new global::POGOProtos.Data.PokedexEntry(); } PokedexEntry.MergeFrom(other.PokedexEntry); } if (other.playerStats_ != null) { if (playerStats_ == null) { playerStats_ = new global::POGOProtos.Data.Player.PlayerStats(); } PlayerStats.MergeFrom(other.PlayerStats); } if (other.playerCurrency_ != null) { if (playerCurrency_ == null) { playerCurrency_ = new global::POGOProtos.Data.Player.PlayerCurrency(); } PlayerCurrency.MergeFrom(other.PlayerCurrency); } if (other.playerCamera_ != null) { if (playerCamera_ == null) { playerCamera_ = new global::POGOProtos.Data.Player.PlayerCamera(); } PlayerCamera.MergeFrom(other.PlayerCamera); } if (other.inventoryUpgrades_ != null) { if (inventoryUpgrades_ == null) { inventoryUpgrades_ = new global::POGOProtos.Inventory.InventoryUpgrades(); } InventoryUpgrades.MergeFrom(other.InventoryUpgrades); } if (other.appliedItems_ != null) { if (appliedItems_ == null) { appliedItems_ = new global::POGOProtos.Inventory.AppliedItems(); } AppliedItems.MergeFrom(other.AppliedItems); } if (other.eggIncubators_ != null) { if (eggIncubators_ == null) { eggIncubators_ = new global::POGOProtos.Inventory.EggIncubators(); } EggIncubators.MergeFrom(other.EggIncubators); } if (other.candy_ != null) { if (candy_ == null) { candy_ = new global::POGOProtos.Inventory.Candy(); } Candy.MergeFrom(other.Candy); } if (other.quest_ != null) { if (quest_ == null) { quest_ = new global::POGOProtos.Data.Quests.Quest(); } Quest.MergeFrom(other.Quest); } if (other.avatarItem_ != null) { if (avatarItem_ == null) { avatarItem_ = new global::POGOProtos.Data.Avatar.AvatarItem(); } AvatarItem.MergeFrom(other.AvatarItem); } if (other.raidTickets_ != null) { if (raidTickets_ == null) { raidTickets_ = new global::POGOProtos.Inventory.RaidTickets(); } RaidTickets.MergeFrom(other.RaidTickets); } }
internal override void Update(GameTime gameTime) { _selectorFlickerDelay--; if (_selectorFlickerDelay == 0) { _selectorFlickerDelay = SELECTOR_FLICKER_DELAY; _selectorVisible = !_selectorVisible; } if (GameboyInputs.RightPressed() && _cursorIndex + 1 < OPTIONS.Length) { _cursorIndex++; } else if (GameboyInputs.LeftPressed() && _cursorIndex > 0) { _cursorIndex--; } else if (GameboyInputs.UpPressed()) { var newEntry = _getPreviousEntry(); if (newEntry != null) { _entry = newEntry; _cursorIndex = 0; // set cursor to PAGE _pageIndex = 0; InitializeEntry(); } } else if (GameboyInputs.DownPressed()) { var newEntry = _getNextEntry(); if (newEntry != null) { _entry = newEntry; _cursorIndex = 0; // set cursor to PAGE _pageIndex = 0; InitializeEntry(); } } if (GameboyInputs.APressed()) { switch (_cursorIndex) { case 0: // PAGE _pageIndex++; if (_pageIndex == _pages.Length) { _pageIndex = 0; } break; case 1: // AREA var nestScreen = new PokedexNestScreen(this, _entry); nestScreen.LoadContent(); GetComponent <ScreenManager>().SetScreen(nestScreen); break; case 2: // CRY // TODO: play cry break; case 3: // BACK Close(); break; } } else if (GameboyInputs.BPressed()) { Close(); } }
public PokemonModel(PokemonSettings settings, PokedexEntry pokedexEntry) { BuildFromSettings(settings); BuildFromPokedexEntry(pokedexEntry); }