public void UpdateValues(PokemonInstance pokemon) { imageIcon.sprite = pokemon.LoadSprite(PokemonSpecies.SpriteType.Icon); textName.text = pokemon.GetDisplayName(); healthBar.UpdateBar(pokemon.HealthProportion); if (pokemon.nonVolatileStatusCondition == PokemonInstance.NonVolatileStatusCondition.None) { imageStatusCondition.gameObject.SetActive(false); } else { imageStatusCondition.gameObject.SetActive(true); imageStatusCondition.sprite = SpriteStorage.GetNonVolatileStatusConditionSprite(pokemon.nonVolatileStatusCondition); } if (pokemon.heldItem == null) { imageHeldItem.enabled = false; } else { imageHeldItem.enabled = true; } }
public void SetValues(string name, Sprite icon, float healthBarValue, PokemonInstance.NonVolatileStatusCondition statusCondition, bool hasHeldItem) { if (healthBarValue < 0 || healthBarValue > 1) { Debug.LogError("Health bar value provided out of range"); } textName.text = name; imageIcon.sprite = icon; healthBar.UpdateBar(healthBarValue); if (statusCondition == PokemonInstance.NonVolatileStatusCondition.None) { imageStatusCondition.gameObject.SetActive(false); } else { imageStatusCondition.gameObject.SetActive(true); imageStatusCondition.sprite = SpriteStorage.GetNonVolatileStatusConditionSprite(statusCondition); } imageHeldItem.enabled = hasHeldItem; }
public void UpdateNonVolatileStatsCondition(PokemonInstance.NonVolatileStatusCondition nvsc) { if (nvsc == PokemonInstance.NonVolatileStatusCondition.None) { imageNonVolatileStatusCondition.gameObject.SetActive(false); } else { imageNonVolatileStatusCondition.gameObject.SetActive(true); imageNonVolatileStatusCondition.sprite = SpriteStorage.GetNonVolatileStatusConditionSprite(nvsc); } }
public void SetPokemon(PokemonInstance pokemon) { if (pokemon == null) { SetInteractable(false); return; } else { SetInteractable(true); } textName.text = pokemon.GetDisplayName(); textLevel.text = levelTextPrefix + pokemon.GetLevel().ToString(); imageIcon.sprite = pokemon.LoadSprite(PokemonSpecies.SpriteType.Icon); if (pokemon.nonVolatileStatusCondition == PokemonInstance.NonVolatileStatusCondition.None) { nvscImage.enabled = false; } else { nvscImage.enabled = true; nvscImage.sprite = SpriteStorage.GetNonVolatileStatusConditionSprite(pokemon.nonVolatileStatusCondition); } if (pokemon.heldItem == null) { imageHeldItem.enabled = false; } else { imageHeldItem.enabled = true; } healthBar.UpdateBar(pokemon.HealthProportion); }
public void SetPokemonDetails(PokemonInstance pokemon) { #region Images imageIcon.sprite = pokemon.LoadSprite(PokemonSpecies.SpriteType.Icon); imageFront.sprite = pokemon.LoadSprite(PokemonSpecies.SpriteType.Front1); imageBack.sprite = pokemon.LoadSprite(PokemonSpecies.SpriteType.Back); #endregion #region General Details imageType1.sprite = SpriteStorage.GetTypeSymbolSprite(pokemon.species.type1); Pokemon.Type?pokemonType2 = pokemon.species.type2; if (pokemonType2 == null) { imageType2.gameObject.SetActive(false); } else { imageType2.gameObject.SetActive(true); imageType2.sprite = SpriteStorage.GetTypeSymbolSprite((Pokemon.Type)pokemon.species.type2); } textName.text = pokemon.GetDisplayName(); imageGender.sprite = pokemon.LoadGenderSprite(); textLevelValue.text = pokemon.GetLevel().ToString(); if (pokemon.heldItem != null) { textItemName.text = pokemon.heldItem.itemName; imageItemIcon.enabled = true; imageItemIcon.sprite = pokemon.heldItem.LoadSprite(); } else { textItemName.text = "No held item"; imageItemIcon.enabled = false; } //TODO - set values for ability when and if implemented textAbilityName.text = ""; textAbilityDescription.text = ""; if (pokemon.nonVolatileStatusCondition != PokemonInstance.NonVolatileStatusCondition.None) { imageStatusCondition.gameObject.SetActive(true); Sprite statusConditionSprite = SpriteStorage.GetNonVolatileStatusConditionSprite(pokemon.nonVolatileStatusCondition); if (statusConditionSprite != null) { imageStatusCondition.gameObject.SetActive(true); imageStatusCondition.sprite = statusConditionSprite; } else { imageStatusCondition.gameObject.SetActive(false); } } else { imageStatusCondition.gameObject.SetActive(false); } imageCheatPokemon.gameObject.SetActive(pokemon.cheatPokemon); imageShinyPokemon.gameObject.SetActive(pokemon.IsShiny); #endregion #region Stats Pokemon.Stats <int> stats = pokemon.GetStats(); textAttackValue.text = stats.attack.ToString(); textDefenseValue.text = stats.defense.ToString(); textSpecialAttackValue.text = stats.specialAttack.ToString(); textSpecialDefenseValue.text = stats.specialDefense.ToString(); textSpeedValue.text = stats.speed.ToString(); healthBar.UpdateBar(pokemon.HealthProportion); #endregion }