public Pokemon(PokemonBase pBAse, int pLevel) //Create an instance of the pokemon, moslty use with wild pokemon, to catch a copy of the wild pokemon, and not THE pokemon itself { _base = pBAse; level = pLevel; Init(); }
//When receiving a new message public override void onMessage(string message) { int dexNum; if (!int.TryParse(message, out dexNum)) { dexNum = 0; } Debug.Log("We received message and got a dexnum: " + dexNum); PokemonBase pokemon = receivedPokemon.GetComponent <PokemonBase> (); Debug.Log("PokemonBase is set"); pokemon = PokemonBase.RandomPokemon(dexNum); Debug.Log("Random Pokemon has been generated with dex number: " + dexNum + "\n It's name is " + pokemon.Name); TextMesh pokeText = receivedPokemon.GetComponentInChildren <TextMesh> (); pokeText.text = ("#" + pokemon.DexNum + " " + pokemon.Name); if (Resources.Load <Sprite> ("Sprites/Front/Normal/" + dexNum) != null) { receivedPokemon.GetComponent <SpriteRenderer> ().sprite = Resources.Load <Sprite> ("Sprites/Front/Normal/" + dexNum); Debug.Log("Sprite loaded from " + dexNum); } else { receivedPokemon.GetComponent <SpriteRenderer> ().sprite = Resources.Load <Sprite> ("Sprites/Front/Normal/NoEntry"); Debug.Log("Sprite loaded, unfortuantely NoEntry"); } addrCanvas.SetActive(false); pokemonTeam.AddPokemon(pokemon); //save game???? //Play Animation }
public Pokemon(PokemonBase pBase, int pLevel) { _base = pBase; level = pLevel; Init(); }
/// END public override void SwitchPokemon(PokemonBase poke) { if (!poke.fainted) { activePokemon = poke; } }
public Pokemon(PokemonBase pBase, int pLevel) { Base = pBase; Level = pLevel; exp2NextLevel = (int)Mathf.Pow(Level, 3); Moves = new List <Move>(); foreach (var move in Base.LearnableMoves) { if (move.Level <= Level) { Moves.Add(new Move(move.Base)); } if (Moves.Count == 4) { break; } } CalculateStats(); HP = MaxHp; StatBoost = new Dictionary <PokemonStat, int>() { { PokemonStat.Attack, 0 }, { PokemonStat.Defense, 0 }, { PokemonStat.SpcAttack, 0 }, { PokemonStat.SpcDefense, 0 }, { PokemonStat.Speed, 0 }, }; }
PokemonBase NewPokemon(int dexNum) { PokemonBase poke = new PokemonBase(); poke.Level = 5; poke.Exp = 0; return(poke); }
public static Pokemon ReadPokemonString(string strMon) { var pokeSave = JsonUtility.FromJson <SavePokemon>(strMon); //Load SavePokemon var baseMon = PokemonBase.ReadBaseMonString(pokeSave.pokemonBaseName); //Load PokemonBase SO var pokemon = new Pokemon(baseMon, pokeSave.lvl); //Build Pokemon pokemon.HP = pokeSave.hp; return(pokemon); }
public void SetData(PokemonBase pokemon) { if (pokemon != null) { idText.text = pokemon.PokedexId.ToString(); nameText.text = pokemon.Name; } else { SetDefaultData(); } }
public static Pokemon ReadPokemonLambda(string strMon) { var pokesave = JsonUtility.FromJson <LamdaPokemon>(strMon); var baseMon = PokemonBase.ReadBaseMonString(pokesave.Pokemon); int lvl = int.Parse(pokesave.Level); int hp = int.Parse(pokesave.Health); var pokemon = new Pokemon(baseMon, lvl); pokemon.HP = hp; return(pokemon); }
public override void AddPokemon(PokemonBase pokemon) { if (pokeTeam.Count < 6) { pokeTeam.Add(pokemon); } else { //give error message or send to PC //We can let this method return a string which gives the user info (via json) } }
void Start() { LoginFieldText = GetComponent <TMP_InputField>(); if (LoginFieldText != null) { //LoginFieldText.text = "Hello"; LoginFieldText.Select(); } PokemonBase _base = PokemonBase.ReadBaseMonString("Squirtle"); SaveSystem.startPokemon = new Pokemon(_base, 5); }
public void Setup(PokemonBase selection) { Pokemon = new Pokemon(selection, level); if (isPlayerUnit) { image.sprite = Pokemon.Base.BackSprite; } else { image.sprite = Pokemon.Base.FrontSprite; } EnterAnimation(); }
public override void Awake() { pokeTeam = this.gameObject.GetComponent <OpponentTeam> (); Debug.Log(pokeTeam.gameObject.name); if (pokeTeam.pokeTeam.Count == 0) { PokemonBase pokepon = PokemonBase.RandomPokemon(DebugNumber()); pokeTeam.pokeTeam.Add(pokepon); //DEBUG// } //PokemonBase sentretje = PokemonBase.RandomPokemon (163); //pokeTeam.pokeTeam.Add(sentretje); //DEBUG// activeSprite = gameObject.transform.GetChild(0).GetChild(0).GetComponent <SpriteRenderer> (); activePokemon = pokeTeam.pokeTeam [0]; activeSprite.sprite = Resources.Load <Sprite> ("Sprites/Front/Normal/" + activePokemon.DexNum); }
public void StartBattle() { //Set up player playerUnit.Setup(); playerHud.SetData(playerUnit.Pokemon); //Set up opponent var baseMon = PokemonBase.ReadBaseMonString(BattleData.pokemonName); enemyUnit.Pokemon = new Pokemon(baseMon, BattleData.Lvl); enemyUnit.Pokemon.HP = BattleData.hp; enemyUnit.Setup(); enemyHud.SetData(enemyUnit.Pokemon); StartCoroutine(SetupBattle()); }
public Pokemon(PokemonBase pBase) { Base = pBase; HP = MaxHP; Moves = new List <Move>(); foreach (var move in Base.UsableMoves) { Moves.Add(new Move(move.Base)); if (Moves.Count >= 4) { break; } } }
//PokemonBase (){ // return this; //} //Debugging public static PokemonBase RandomPokemon(int dexNum) { GameObject temp = new GameObject(); Debug.Log("GameObject is set" + temp.name); //Pokemon pokemonData = PokemonDataManager.GetPokemon (); PokemonDataManager data = temp.AddComponent <PokemonDataManager> (); Debug.Log("New data Manager created"); Pokemon pokemonData = data.GetPokemon(dexNum); Debug.Log("Got our new pokemon"); Debug.Log(pokemonData.Name); PokemonBase poke = temp.AddComponent <PokemonBase> (); Debug.Log("Pokemon Added to temp GameObject"); //this = temp.AddComponent<PokemonBase> (); //PokemonBase poke = new PokemonBase (); poke.DexNum = pokemonData.No; poke.DexNumJohto = pokemonData.JohtoNo; poke.Type1 = pokemonData.Type1; poke.Type2 = pokemonData.Type2; poke.Health = pokemonData.BaseStats.HP; poke.Attack = pokemonData.BaseStats.Attack; poke.Defense = pokemonData.BaseStats.Defense; poke.Speed = pokemonData.BaseStats.Speed; poke.Name = pokemonData.Name; if (Random.Range(0.0f, 1.0f) == 0.5f) { poke.Gender = true; } else { poke.Gender = false; } if (Random.Range(0, shinyRate) == 0) { poke.Shiny = true; } else { poke.Shiny = false; } return(poke); }
public PokemonInstance(PokemonBase _source, int _level, int _id, Attack[] _attacks) { id = _id; level = _level; source = _source; base_attack = source.getAttack(level); base_speed = source.getSpeed(level); base_defense = source.getDefense(level); base_hp = source.getHealth(level); base_mana = source.getMana(level); current_hp = base_hp; current_mana = base_mana; attacks = _attacks; }
public PokemonInstance(PokemonBase _source, int _level, Attack[] _attacks) { id = UnityEngine.Random.Range(0, 999); level = _level; source = _source; base_attack = source.getAttack(level); base_speed = source.getSpeed(level); base_defense = source.getDefense(level); base_hp = source.getHealth(level); base_mana = source.getMana(level); current_hp = base_hp; current_mana = base_mana; attacks = _attacks; }
public override void Awake() { if (TrainerTeam.pokeTeam.Count == 0) { PokemonBase pokepon = PokemonBase.RandomPokemon(163); TrainerTeam.pokeTeam.Add(pokepon); //DEBUG// } activeSprite = gameObject.transform.GetChild(0).GetChild(0).GetComponent <SpriteRenderer> (); activePokemon = TrainerTeam.pokeTeam [0]; if (activePokemon.Type1 == null) { activeSprite.sprite = Resources.Load <Sprite> ("Sprites/Back/Normal/NoEntry"); } else { activeSprite.sprite = Resources.Load <Sprite> ("Sprites/Back/Normal/" + activePokemon.DexNum); } }
public Pokemon(PokemonBase skeleton, int level) { Skeleton = skeleton; Level = level; Health = MaxHealth; Moves = new Move[4]; int moveIndex = 0; foreach (var move in skeleton.learnableMoves) { if (move.level <= level) { Moves[moveIndex] = new Move(move.skeleton); moveIndex = (moveIndex + 1) % 4; } } }
public Pokemon(PokemonBase pBase, int pLevel) { Base = pBase; Level = pLevel; HP = MaxHP; Moves = new List <Move>(); foreach (var move in Base.LearnableMoves) { if (move.Level <= Level) { Moves.Add(new Move(move.Base)); } if (Moves.Count >= 4) { break; } } }
public void SetData(PokemonBase pokemon) { frontSprite.sprite = pokemon.FrontSprite; nameText.text = pokemon.Name; type1Text.text = pokemon.Type1.ToString(); type2Text.text = pokemon.Type2.ToString(); statBars[0].SetStatBase(pokemon.Hp); statBars[1].SetStatBase(pokemon.Attack); statBars[2].SetStatBase(pokemon.Defense); statBars[3].SetStatBase(pokemon.SpAttack); statBars[4].SetStatBase(pokemon.SpDefense); statBars[5].SetStatBase(pokemon.Speed); statTextsBase[0].text = pokemon.Hp.ToString(); statTextsBase[1].text = pokemon.Attack.ToString(); statTextsBase[2].text = pokemon.Defense.ToString(); statTextsBase[3].text = pokemon.SpAttack.ToString(); statTextsBase[4].text = pokemon.SpDefense.ToString(); statTextsBase[5].text = pokemon.Speed.ToString(); }
public void EnablePokemonMenu() { MenuOptions [1].SetActive(!MenuOptions [1].activeInHierarchy); //get the players team and instantiate the correct pokemon ///Debug/// /// if (TrainerTeam.pokeTeam.Count == 0) { pokemonTeam.AddPokemon(PokemonBase.RandomPokemon(158)); } if (MenuOptions [1].GetComponentInChildren <UnityEngine.UI.ContentSizeFitter> ().GetComponentsInChildren <Transform>().Length < TrainerTeam.pokeTeam.Count + 1) { for (int i = 0; i < TrainerTeam.pokeTeam.Count; i++) { GameObject listPoke = Instantiate(pokemonObject, MenuOptions [1].GetComponentInChildren <UnityEngine.UI.ContentSizeFitter> ().gameObject.transform); Debug.Log(TrainerTeam.pokeTeam [0].Name); //printing name listPoke.GetComponentInChildren <UnityEngine.UI.Text> ().text = TrainerTeam.pokeTeam [i].Name; } } }
//Debugging public static PokemonBase RandomPokemon(int dexNum) { GameObject temp = new GameObject(); PokemonDataManager data = new PokemonDataManager(); Pokemon pokemonData = data.GetPokemon(dexNum); PokemonBase poke = temp.AddComponent <PokemonBase> (); poke.DexNum = pokemonData.No; poke.DexNumJohto = pokemonData.JohtoNo; poke.Type1 = pokemonData.Type1; poke.Type2 = pokemonData.Type2; poke.Health = pokemonData.BaseStats.HP; poke.Attack = pokemonData.BaseStats.Attack; poke.Defense = pokemonData.BaseStats.Defense; poke.Speed = pokemonData.BaseStats.Speed; poke.Name = pokemonData.Name; if (Random.Range(0.0f, 1.0f) == 0.5f) { poke.Gender = true; } else { poke.Gender = false; } if (Random.Range(0, shinyRate) == 0) { poke.Shiny = true; } else { poke.Shiny = false; } return(poke); }
public void PickStarter(string pokeName) { PokemonBase _base = PokemonBase.ReadBaseMonString(pokeName); SaveSystem.startPokemon = new Pokemon(_base, 5); }
public PokemonBase ChangeFastAttack( PokemonBase pokemon) { pokemon.FastAtack = new WindAttack(); return(pokemon); }
public static void Load() { DrawingsManager.Load(); Teste = new PokemonBase(Pokemons.Bulbasaur); }
private void Bind(PokemonParty4 pkmn) { litNickname.Text = pkmn.Nickname; bool shiny = pkmn.IsShiny; imgPokemon.ImageUrl = WebFormat.PokemonImageLarge(pkmn); imgPokemon.AlternateText = pkmn.Species.Name.ToString(); phShiny.Visible = shiny; litMarks.Text = WebFormat.Markings(pkmn.Markings); imgPokeball.ImageUrl = WebFormat.ItemImage(pkmn.Pokeball); imgPokeball.AlternateText = pkmn.Pokeball.Name.ToString(); imgPokeball.ToolTip = pkmn.Pokeball.Name.ToString(); litLevel.Text = pkmn.Level.ToString(); litGender.Text = WebFormat.Gender(pkmn.Gender); litTrainerMemo.Text = pkmn.TrainerMemo.ToString(); litCharacteristic.Text = pkmn.Characteristic.ToString(); litSpecies.Text = pkmn.Species.Name.ToString(); litPokedex.Text = pkmn.SpeciesID.ToString("000"); FormStats fs = pkmn.Form.BaseStats(Generations.Generation4); litType1.Text = fs.Type1 == null ? "" : WebFormat.RenderType(fs.Type1); litType2.Text = fs.Type2 == null ? "" : WebFormat.RenderType(fs.Type2); litOtName.Text = Common.HtmlEncode(pkmn.TrainerName); litTrainerId.Text = (pkmn.TrainerID & 0xffff).ToString("00000"); litExperience.Text = pkmn.Experience.ToString(); if (pkmn.Level < 100) { int expCurrLevel = PokemonBase.ExperienceAt(pkmn.Level, pkmn.Species.GrowthRate); int expNextLevel = PokemonBase.ExperienceAt(pkmn.Level + 1, pkmn.Species.GrowthRate); int progress = pkmn.Experience - expCurrLevel; int nextIn = expNextLevel - pkmn.Experience; litExperienceNext.Text = String.Format("next in {0}", nextIn); litExpProgress.Text = WebFormat.RenderProgress(progress, expNextLevel - expCurrLevel); } else { litExperienceNext.Text = ""; litExpProgress.Text = WebFormat.RenderProgress(0, 1); } if (pkmn.HeldItem != null) { imgHeldItem.Visible = true; imgHeldItem.ImageUrl = WebFormat.ItemImage(pkmn.HeldItem); litHeldItem.Text = pkmn.HeldItem.Name.ToString(); } else { imgHeldItem.Visible = false; litHeldItem.Text = ""; } litNature.Text = pkmn.Nature.ToString(); // todo: i18n litAbility.Text = pkmn.Ability == null ? "" : pkmn.Ability.Name.ToString(); litHpCurr.Text = pkmn.HP.ToString(); litHp.Text = pkmn.Stats[Stats.Hp].ToString(); litHpProgress.Text = WebFormat.RenderProgress(pkmn.HP, pkmn.Stats[Stats.Hp]); litAtk.Text = pkmn.Stats[Stats.Attack].ToString(); litDef.Text = pkmn.Stats[Stats.Defense].ToString(); litSAtk.Text = pkmn.Stats[Stats.SpecialAttack].ToString(); litSDef.Text = pkmn.Stats[Stats.SpecialDefense].ToString(); litSpeed.Text = pkmn.Stats[Stats.Speed].ToString(); phPkrs.Visible = pkmn.Pokerus == Pokerus.Infected; phPkrsCured.Visible = pkmn.Pokerus == Pokerus.Cured; rptMoves.DataSource = pkmn.Moves; rptMoves.DataBind(); rptRibbons.DataSource = pkmn.Ribbons; rptRibbons.DataBind(); rptUnknownRibbons.DataSource = pkmn.UnknownRibbons; rptUnknownRibbons.DataBind(); }
public abstract void AddPokemon(PokemonBase pokemon);
public abstract void SwitchPokemon(PokemonBase poke);