summaryrefslogtreecommitdiffstats
path: root/pokemod/MapTrainerPokemon.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2007-10-26 20:46:09 +0000
committerBen Boeckel <MathStuf@gmail.com>2007-10-26 20:46:09 +0000
commit4385af885daf460a18e236f08509358f764b2c8c (patch)
tree6c2838312dd7f42769280e24e8abc16b53c165cb /pokemod/MapTrainerPokemon.cpp
parent1f08afc80c73087bf9bde639754670548b89fc9f (diff)
Reverted repo back to rev24 because committing of rev25 messed up
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@26 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/MapTrainerPokemon.cpp')
-rw-r--r--pokemod/MapTrainerPokemon.cpp28
1 files changed, 4 insertions, 24 deletions
diff --git a/pokemod/MapTrainerPokemon.cpp b/pokemod/MapTrainerPokemon.cpp
index 6ba80bb8..1acb6dcd 100644
--- a/pokemod/MapTrainerPokemon.cpp
+++ b/pokemod/MapTrainerPokemon.cpp
@@ -25,8 +25,7 @@
PokeGen::PokeMod::MapTrainerPokemon::MapTrainerPokemon(const Pokemod* par, const unsigned _id) :
Object(_id, par),
species(UINT_MAX),
- level(UINT_MAX),
- nature(UINT_MAX)
+ level(1)
{
}
@@ -39,7 +38,7 @@ PokeGen::PokeMod::MapTrainerPokemon::MapTrainerPokemon(const Pokemod* par, Ini&
bool PokeGen::PokeMod::MapTrainerPokemon::Validate()
{
pokemod->ValidationMsg(QString("---------Pokémon with id %1---").arg(id), Pokemod::V_Msg);
- if (pokemod->GetSpeciesByID(species) == UINT_MAX)
+ if (pokemod->GetPokemonByID(species) == UINT_MAX)
{
pokemod->ValidationMsg("Invalid species");
isValid = false;
@@ -80,11 +79,6 @@ bool PokeGen::PokeMod::MapTrainerPokemon::Validate()
}
}
}
- if (pokemod->GetNatureByID(nature) == UINT_MAX)
- {
- pokemod->ValidationMsg("Invalid nature");
- isValid = false;
- }
else if (GetItemCount())
{
pokemod->ValidationMsg("Too many held items");
@@ -105,8 +99,7 @@ void PokeGen::PokeMod::MapTrainerPokemon::ImportIni(Ini& ini, const unsigned _id
unsigned j;
items.clear();
ini.GetValue("species", species);
- ini.GetValue("level", level);
- ini.GetValue("nature", nature);
+ ini.GetValue("level", level, 1);
ini.GetValue("numItems", i, 0);
for (unsigned k = 0; k < i; ++k)
{
@@ -122,7 +115,6 @@ void PokeGen::PokeMod::MapTrainerPokemon::ExportIni(QFile& fout, const QString&
exMapTrainerPokemon.AddField("id", id);
exMapTrainerPokemon.AddField("species", species);
exMapTrainerPokemon.AddField("level", level);
- exMapTrainerPokemon.AddField("nature", nature);
exMapTrainerPokemon.AddField("numItems", GetItemCount());
for (unsigned i = 0; i < GetItemCount(); ++i)
exMapTrainerPokemon.AddField(QString("item-%1").arg(i), items[i]);
@@ -131,7 +123,7 @@ void PokeGen::PokeMod::MapTrainerPokemon::ExportIni(QFile& fout, const QString&
bool PokeGen::PokeMod::MapTrainerPokemon::SetSpecies(const unsigned s)
{
- if (pokemod->GetSpeciesByID(s) != UINT_MAX)
+ if (pokemod->GetPokemonByID(s) != UINT_MAX)
species = s;
return (species == s);
}
@@ -143,13 +135,6 @@ bool PokeGen::PokeMod::MapTrainerPokemon::SetLevel(const unsigned l)
return (level == l);
}
-bool PokeGen::PokeMod::MapTrainerPokemon::SetNature(const unsigned n)
-{
- if (pokemod->GetNatureByID(n) != UINT_MAX)
- nature = n;
- return (nature == n);
-}
-
unsigned PokeGen::PokeMod::MapTrainerPokemon::GetSpecies() const
{
return species;
@@ -160,11 +145,6 @@ unsigned PokeGen::PokeMod::MapTrainerPokemon::GetLevel() const
return level;
}
-unsigned PokeGen::PokeMod::MapTrainerPokemon::GetNature() const
-{
- return nature;
-}
-
unsigned PokeGen::PokeMod::MapTrainerPokemon::GetItem(const unsigned i) const
{
if (i < GetItemCount())