summaryrefslogtreecommitdiffstats
path: root/pokemod/PokemonMove.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2007-06-01 02:54:29 +0000
committerBen Boeckel <MathStuf@gmail.com>2007-06-01 02:54:29 +0000
commitf71140fae5218ee9839ffcd4ec83abfded5124f4 (patch)
tree9af8f2174728cedb93580411223bc59fd9a86d0a /pokemod/PokemonMove.cpp
parent9e28e6ecd358a9801ad25914d3e8cca7b6d7f4f7 (diff)
downloadsigen-f71140fae5218ee9839ffcd4ec83abfded5124f4.tar.gz
sigen-f71140fae5218ee9839ffcd4ec83abfded5124f4.tar.xz
sigen-f71140fae5218ee9839ffcd4ec83abfded5124f4.zip
Added Map and Tile, added Hat class, and fixed up some other minor things
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@17 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/PokemonMove.cpp')
-rw-r--r--pokemod/PokemonMove.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/pokemod/PokemonMove.cpp b/pokemod/PokemonMove.cpp
index 848fc116..a211139c 100644
--- a/pokemod/PokemonMove.cpp
+++ b/pokemod/PokemonMove.cpp
@@ -28,7 +28,7 @@ extern PokeGen::PokeMod::Pokemod curPokeMod;
PokeGen::PokeMod::PokemonMove::PokemonMove(const unsigned _id)
{
LogCtor("PokemonMove", _id);
- move = -1;
+ move = UINT_MAX;
level = 0;
wild = 0;
id = _id;
@@ -49,19 +49,18 @@ PokeGen::PokeMod::PokemonMove::~PokemonMove()
void PokeGen::PokeMod::PokemonMove::Validate()
{
- isValid = true;
LogValidateStart("PokemonMove", id, GetMoveString());
if (!curPokeMod.GetMove(move))
{
LogVarNotValid("PokemonMove", id, "move");
isValid = false;
}
- if (curPokeMod.GetMaxLevel() <= level)
+ if (level < curPokeMod.GetMaxLevel())
{
LogVarNotValid("PokemonMove", id, "level", GetMoveString());
isValid = false;
}
- if (curPokeMod.GetMaxLevel() <= wild)
+ if (wild < curPokeMod.GetMaxLevel())
{
LogVarNotValid("PokemonMove", id, "wild", GetMoveString());
isValid = false;
@@ -72,7 +71,6 @@ void PokeGen::PokeMod::PokemonMove::Validate()
#ifdef PG_DEBUG_WINDOW
void PokeGen::PokeMod::PokemonMove::Validate(const wxListBox &output)
{
- isValid = true;
LogValidateStart("PokemonMove", id, GetMoveString());
if (!curPokeMod.GetMove(move))
{
@@ -80,13 +78,13 @@ void PokeGen::PokeMod::PokemonMove::Validate(const wxListBox &output)
output.Append(ConsoleLogVarNotValid("PokemonMove", id, "move"));
isValid = false;
}
- if (curPokeMod.GetMaxLevel() <= level)
+ if (level < curPokeMod.GetMaxLevel())
{
LogVarNotValid("PokemonMove", id, "level", GetMoveString());
output.Append(ConsoleLogVarNotValid("PokemonMove", id, "level", GetMoveString()));
isValid = false;
}
- if (curPokeMod.GetMaxLevel() <= wild)
+ if (wild < curPokeMod.GetMaxLevel())
{
LogVarNotValid("PokemonMove", id, "wild", GetMoveString());
output.Append(ConsoleLogVarNotValid("PokemonMove", id, "wild", GetMoveString()));
@@ -108,7 +106,7 @@ void PokeGen::PokeMod::PokemonMove::ImportIni(Ini &ini, const unsigned _id)
}
else
id = _id;
- ini.GetValue("move", move, -1);
+ ini.GetValue("move", move);
ini.GetValue("level", level, 0);
ini.GetValue("wild", wild, 0);
LogImportOver("PokemonMove", id);
@@ -127,10 +125,11 @@ void PokeGen::PokeMod::PokemonMove::ExportIni(std::ofstream &fout, const String
LogExportOver("PokemonMove", id);
}
-void PokeGen::PokeMod::PokemonMove::SetMove(const int m)
+void PokeGen::PokeMod::PokemonMove::SetMove(const unsigned m)
{
LogSetVar("PokemonMove", id, "move", m);
- move = m;
+ if (curPokeMod.GetMove(m))
+ move = m;
}
void PokeGen::PokeMod::PokemonMove::SetMove(const String &m)
@@ -143,16 +142,18 @@ void PokeGen::PokeMod::PokemonMove::SetMove(const String &m)
void PokeGen::PokeMod::PokemonMove::SetLevel(const unsigned l)
{
LogSetVar("PokemonMove", id, "level", l, GetMoveString());
- level = l;
+ if (l < curPokeMod.GetMaxLevel())
+ level = l;
}
void PokeGen::PokeMod::PokemonMove::SetWild(const unsigned w)
{
LogSetVar("PokemonMove", id, "wild", w, GetMoveString());
- wild = w;
+ if (w < curPokeMod.GetMaxLevel())
+ wild = w;
}
-int PokeGen::PokeMod::PokemonMove::GetMove() const
+unsigned PokeGen::PokeMod::PokemonMove::GetMove() const
{
LogFetchVar("PokemonMove", id, "move", move);
return move;