//----------------------------------------------------------------------------------------------------------- public void GeneratePokemon(int indexPokemon, int lvlMin, int lvlMax) { PokemonDatabase.PokemonItem pokemonDb = PokemonDatabase.GetPokemonByIndex(indexPokemon); if (pokemonDb != null) { // TODO Generate m_uniqueRandId m_index = pokemonDb.m_index; m_name = pokemonDb.m_name; m_type1 = pokemonDb.m_type1; m_type2 = pokemonDb.m_type2; m_size = pokemonDb.m_size; m_weight = pokemonDb.m_weight; m_tauxCapture = pokemonDb.m_tauxCapture; m_ratioMale = pokemonDb.m_ratioMale; // Sprites m_sprite_fight_face = pokemonDb.m_sprite_fight_face; m_sprite_fight_back = pokemonDb.m_sprite_fight_back; // Experience m_courbeEvolution = pokemonDb.m_courbeExp; m_baseXp = pokemonDb.m_baseXp; m_evolution = pokemonDb.m_evolution; m_lvlEvolution = pokemonDb.m_lvlEvolution; m_level = Random.Range(lvlMin, lvlMax + 1); //min inclusive, max exclusive. Hence the max+1 m_nature = (EPokemonNatures)Random.Range(1, (int)EPokemonNatures.MAX); //Init base stats m_pv [0] = pokemonDb.m_pv; m_atk [0] = pokemonDb.m_atk; m_def [0] = pokemonDb.m_def; m_vitesse [0] = pokemonDb.m_vitesse; m_atkspe [0] = pokemonDb.m_atkspe; m_defspe [0] = pokemonDb.m_defspe; //Init EV given stats m_pv [4] = pokemonDb.m_pv_given; m_atk [4] = pokemonDb.m_atk_given; m_def [4] = pokemonDb.m_def_given; m_vitesse [4] = pokemonDb.m_vitesse_given; m_atkspe [4] = pokemonDb.m_atkspe_given; m_defspe [4] = pokemonDb.m_defspe_given; InitExperience(); GenerateStats(); // full life on generation m_currentPV = m_pv [1]; InitAttacks(pokemonDb); } }
public void Reset() { overrideType1 = EPokemonType.Default; criticalStage = 0; atk = 0; def = 0; atkspe = 0; defspe = 0; vitesse = 0; precision = 0; esquive = 0; mentalStatus = EPokemonMentalStatus.Default; turnsSleep = 0; turnsConfusion = 0; turnsJail = 0; isStatChangesFromOppBlocked = false; canSwitch = true; fleeAttempts = 0; turnEffects.Reset(); m_lastAttackInfo.Reset(); }