summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Changelog48
-rw-r--r--DISCLAIMER40
-rw-r--r--ai/Layer.cpp333
-rw-r--r--ai/Layer.h137
-rw-r--r--ai/Net.cpp290
-rw-r--r--ai/Net.h80
-rwxr-xr-xai/TODO1
-rw-r--r--ai/ai.pro8
-rw-r--r--audio/audio.c34
-rw-r--r--audio/audio.h29
-rw-r--r--audio/audio.pro8
-rwxr-xr-xaudio/build4
-rw-r--r--audio/control.c56
-rw-r--r--audio/control.h9
-rw-r--r--audio/samples.c3
-rw-r--r--audio/samples.h12
-rw-r--r--audio/stream.c20
-rw-r--r--audio/stream.h3
-rw-r--r--battle/Arena.cpp (renamed from pokemod/Ref.cpp)27
-rw-r--r--battle/Arena.h86
-rw-r--r--battle/Bot.h50
-rw-r--r--battle/Ghost.cpp98
-rw-r--r--battle/Ghost.h76
-rw-r--r--battle/GhostBot.h50
-rw-r--r--battle/Pokemon.h102
-rw-r--r--battle/Team.cpp77
-rw-r--r--battle/Team.h (renamed from pokemod/PokemonNature.h)49
-rw-r--r--general/Flag.cpp (renamed from pokemod/Flag.cpp)38
-rw-r--r--general/Flag.h82
-rw-r--r--general/Frac.cpp (renamed from pokemod/Frac.cpp)50
-rw-r--r--general/Frac.h89
-rw-r--r--general/FracMatrix.h89
-rw-r--r--general/Hat.h (renamed from Hat.h)2
-rw-r--r--[-rwxr-xr-x]general/Ini.cpp (renamed from Ini.cpp)2
-rw-r--r--[-rwxr-xr-x]general/Ini.h (renamed from Ini.h)2
-rw-r--r--general/Matrix.h213
-rw-r--r--general/Point.cpp (renamed from pokemod/Point.cpp)8
-rw-r--r--general/Point.h71
-rw-r--r--general/Ref.cpp47
-rw-r--r--general/Ref.h108
-rw-r--r--general/general.pro8
-rw-r--r--pokegen.cbp329
-rw-r--r--pokegen.depend2196
-rw-r--r--pokegen.layout265
-rwxr-xr-xpokegen.pro21
-rw-r--r--pokemod/Ability.cpp9
-rw-r--r--pokemod/Ability.h2
-rw-r--r--pokemod/AbilityEffect.cpp48
-rw-r--r--pokemod/AbilityEffect.h13
-rw-r--r--pokemod/Badge.cpp4
-rw-r--r--pokemod/Badge.h6
-rw-r--r--pokemod/CoinList.cpp7
-rw-r--r--pokemod/CoinListObject.cpp8
-rw-r--r--pokemod/CoinListObject.h2
-rw-r--r--pokemod/Dialog.cpp23
-rw-r--r--pokemod/Dialog.h6
-rw-r--r--pokemod/EggGroup.cpp2
-rw-r--r--pokemod/EggGroup.h2
-rw-r--r--pokemod/Flag.h67
-rw-r--r--pokemod/Frac.h73
-rw-r--r--pokemod/Item.cpp7
-rw-r--r--pokemod/ItemEffect.cpp594
-rw-r--r--pokemod/ItemEffect.h57
-rw-r--r--pokemod/Map.cpp30
-rw-r--r--pokemod/Map.h4
-rw-r--r--pokemod/MapEffect.cpp11
-rw-r--r--pokemod/MapEffect.h7
-rw-r--r--pokemod/MapTrainer.cpp15
-rw-r--r--pokemod/MapTrainer.h4
-rw-r--r--pokemod/MapTrainerPokemon.cpp28
-rw-r--r--pokemod/MapTrainerPokemon.h5
-rw-r--r--pokemod/MapWarp.cpp10
-rw-r--r--pokemod/MapWarp.h6
-rw-r--r--pokemod/MapWildList.cpp11
-rw-r--r--pokemod/MapWildList.h4
-rw-r--r--pokemod/MapWildListPokemon.cpp6
-rw-r--r--pokemod/MapWildListPokemon.h8
-rw-r--r--pokemod/Matrix.h274
-rw-r--r--pokemod/Move.cpp14
-rw-r--r--pokemod/Move.h3
-rw-r--r--pokemod/MoveEffect.cpp5
-rw-r--r--pokemod/MoveEffect.h27
-rw-r--r--pokemod/Nature.cpp26
-rw-r--r--pokemod/Nature.h9
-rw-r--r--pokemod/Object.h2
-rw-r--r--pokemod/Point.h74
-rw-r--r--pokemod/Pokemod.cpp301
-rw-r--r--pokemod/Pokemod.h29
-rw-r--r--pokemod/PokemonEvolution.cpp143
-rw-r--r--pokemod/PokemonNature.cpp95
-rw-r--r--pokemod/Ref.h124
-rw-r--r--pokemod/Species.cpp (renamed from pokemod/Pokemon.cpp)428
-rw-r--r--pokemod/Species.h (renamed from pokemod/Pokemon.h)60
-rw-r--r--pokemod/SpeciesAbility.cpp (renamed from pokemod/PokemonAbility.cpp)34
-rw-r--r--pokemod/SpeciesAbility.h (renamed from pokemod/PokemonAbility.h)18
-rw-r--r--pokemod/SpeciesEvolution.cpp258
-rw-r--r--pokemod/SpeciesEvolution.h (renamed from pokemod/PokemonEvolution.h)50
-rw-r--r--pokemod/SpeciesItem.cpp (renamed from pokemod/PokemonItem.cpp)34
-rw-r--r--pokemod/SpeciesItem.h (renamed from pokemod/PokemonItem.h)18
-rw-r--r--pokemod/SpeciesMove.cpp (renamed from pokemod/PokemonMove.cpp)40
-rw-r--r--pokemod/SpeciesMove.h (renamed from pokemod/PokemonMove.h)16
-rw-r--r--pokemod/Status.cpp259
-rw-r--r--pokemod/Status.h85
-rw-r--r--pokemod/StatusEffect.cpp141
-rw-r--r--pokemod/StatusEffect.h70
-rw-r--r--pokemod/TODO15
-rw-r--r--pokemod/Tile.cpp9
-rw-r--r--pokemod/Tile.h7
-rw-r--r--pokemod/Type.cpp4
-rw-r--r--pokemod/Type.h2
-rw-r--r--pokemod/pokemod.pro8
-rw-r--r--pokemod/pokemod_inc.h11
112 files changed, 2777 insertions, 6345 deletions
diff --git a/Changelog b/Changelog
index a510742b..49782357 100644
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,52 @@
-----------------
+Rev: 27
+Date: 22 October 2007
+User: MathStuf
+-----------------
+[FIX] Redoing rev25
+
+-----------------
+Rev: 26
+Date: 22 October 2007
+User: MathStuf
+-----------------
+[FIX] Something messed up in last commit, fixing with this one
+
+-----------------
+Rev: 25
+Date: 22 October 2007
+User: MathStuf
+-----------------
+[ADD] DISCLAIMER
+[FIX] PokemonEvolution styles
+[ADD] Relative enumeration
+[DEL] pokemod/Status.{h, cpp}
+[DEL] pokemod/StatusEffect.{h, cpp}
+[FIX] Status effects will be added as needed instead of customized
+[FIX] Completed ItemEffects
+[FIX] Factored out Natures to be global
+[DEL] pokemod/PokemonNature.{h, cpp}
+[DEL] ai/Net.{h, cpp}
+[DEL] ai/Layer/{h, cpp}
+[ADD] battle/Arena.{h, cpp}
+[ADD] battle/Team.{h, cpp}
+[ADD] battle/Human.{h, cpp}
+[ADD] battle/Bot.{h, cpp}
+[ADD] battle/GhostBot.{h, cpp}
+[ADD] battle/Pokemon.{h, cpp}
+[ADD] battle/Ghost.{h, cpp}
+[FIX] Fixed some scope errors in pokemod
+[ADD] audio/audio.pro
+[ADD] audio/Audio.{h, cpp}
+[ADD] audio/AudioLibrary.{h, cpp}
+[ADD] audio/AudioSystem.{h, cpp}
+[ADD] audio/Music.{h, cpp}
+[ADD] audio/SoundEffect.{h, cpp}
+[DEL] old audio system (was in C)
+[FIX] Optimized some routines in pokemod
+[FIX] Moved global classes (Ini, Frac, Matrix, FracMatrix, Point, Flag) to general
+
+-----------------
Rev: 24
Date: 21 September 2007
User: MathStuf
diff --git a/DISCLAIMER b/DISCLAIMER
new file mode 100644
index 00000000..618de7ff
--- /dev/null
+++ b/DISCLAIMER
@@ -0,0 +1,40 @@
+DISCLAIMER
+----------
+This project is not endorsed or funded by Nintendo. No code is used from the
+ROMs of any Pokémon games. Research from many sources (listed below) have been
+used as a basis for this project. The Pokémon franchise is a copyright of
+Nintendo, Creatures, Inc., and GameFreak, Inc. in 1995, 1996, 1998 through
+today. This project was inspired by my desire to make my own Pokémon games
+without being constrained to the limits of the Game Boy. I felt that after the
+second generation of the game, the storyline of the game became more of a
+highlight rather than the strategy portion. I set out to make a program that
+would be able to do everything that the games released by Nintendo could do
+while also giving the power to customize the game beyond what I could think of
+to those who play it.
+
+Sources
+-------
+Bulbapedia (http://bulbapedia.bulbagarden.net/wiki/Main_Page)
+Hexagonal Research (http://hexagonal.pkmn.co.uk/)
+Legendary Pokémon (http://www.legendarypokemon.net/index.php)
+Metalloid Research (http://www.angelfire.com/pa4/jman/home1.html)
+Gengar & Haunter's Pokémon Dungeon (http://www.pokemondungeon.com/pokedex.htm)
+PokéFAQs (http://www.geocities.com/thelegendarydogs/index-main.htm)
+Serebii.net (http://www.serebii.net/index2.shtml)
+Smogon.com (http://www.smogon.com/)
+The Ultimate Pokémon Center (http://www.upokecenter.com/)
+
+and last, but not least, the actual games themselves.
+Pokémon Red
+Pokémon Blue
+Pokémon Yellow
+Pokémon Gold
+Pokémon Silver
+Pokémon Crystal
+Pokémon Ruby
+Pokémon Sapphire
+Pokémon Emerald
+Pokémon Fire Red
+Pokémon Leaf Green
+Pokémon Diamond
+Pokémon Pearl
diff --git a/ai/Layer.cpp b/ai/Layer.cpp
deleted file mode 100644
index 5afee91a..00000000
--- a/ai/Layer.cpp
+++ /dev/null
@@ -1,333 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name: ai/Layer.cpp
-// Purpose: A layer of a NeuralNet
-// Author: Ben Boeckel
-// Modified by: Ben Boeckel
-// Created: Thu May 5 15:55:21 2007
-// Copyright: ©2007 Nerdy Productions
-// Licence:
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program. If not, see <http://www.gnu.org/licenses/>.
-/////////////////////////////////////////////////////////////////////////////
-
-#include "Layer.h"
-
-PokeGen::NeuralNetwork::Layer::Layer(const unsigned num) :
- parent(NULL),
- child(NULL)
-{
- for (unsigned i = 0; i < num; ++i)
- AddNode();
-}
-
-void PokeGen::NeuralNetwork::Layer::SaveData(Ini& nnData, const unsigned i) const
-{
- nnData.AddField("numBias", bias.size());
- for (int j = 0; j < bias.size(); ++j)
- nnData.AddField(QString("layer%1-bias%2").arg(i).arg(j), bias[i]);
- nnData.AddField("numNodes", GetNumNodes());
- for (unsigned j = 0; j < GetNumNodes(); ++j)
- {
- nnData.AddField(QString("layer%1-node%2-input").arg(i).arg(j), nodes[j].input);
- nnData.AddField(QString("layer%1-node%2-output").arg(i).arg(j), nodes[j].output);
- nnData.AddField(QString("layer%1-node%2-momentum").arg(i).arg(j), nodes[j].momentum);
- nnData.AddField(QString("layer%1-node%2-momentumFactor").arg(i).arg(j), nodes[j].momentumFactor);
- nnData.AddField(QString("layer%1-node%2-learnRate").arg(i).arg(j), nodes[j].learnRate);
- nnData.AddField(QString("layer%1-node%2-function").arg(i).arg(j), nodes[j].function);
- for (int k = 0; k < nodes[j].weights.size(); ++k)
- {
- nnData.AddField(QString("layer%1-node%2-weight%3").arg(i).arg(j).arg(k), nodes[j].weights[k]);
- nnData.AddField(QString("layer%1-node%2-weightChange%3").arg(i).arg(j).arg(k), nodes[j].weightChanges[k]);
- }
- }
-}
-
-void PokeGen::NeuralNetwork::Layer::SetParent(Layer* par)
-{
- parent = par;
-}
-
-void PokeGen::NeuralNetwork::Layer::SetChild(Layer* cld)
-{
- child = cld;
- if (child)
- RandomizeWeights();
-}
-
-void PokeGen::NeuralNetwork::Layer::AddNode()
-{
- nodes.append(Node(child ? child->GetNumNodes() : 0));
- if (parent)
- parent->RandomizeWeights();
-}
-
-bool PokeGen::NeuralNetwork::Layer::DeleteNode(const unsigned n)
-{
- if (n < GetNumNodes())
- {
- nodes.removeAt(n);
- if (parent)
- parent->RandomizeWeights();
- return true;
- }
- return false;
-}
-
-unsigned PokeGen::NeuralNetwork::Layer::GetNumNodes() const
-{
- return nodes.size();
-}
-
-bool PokeGen::NeuralNetwork::Layer::RandomizeWeights()
-{
- if (child)
- {
- bias.clear();
- for (unsigned i = 0; i < child->GetNumNodes(); ++i)
- bias.append((abs(std::rand()) % 201) / 100.0);
- for (unsigned i = 0; i < GetNumNodes(); ++i)
- {
- nodes[i].weights.clear();
- nodes[i].weightChanges.clear();
- for (unsigned j = 0; j < child->GetNumNodes(); ++j)
- {
- nodes[i].weights.append((abs(std::rand()) % 201) / 100.0);
- nodes[i].weightChanges.append(0);
- }
- }
- return true;
- }
- return false;
-}
-
-bool PokeGen::NeuralNetwork::Layer::CalculateErrors()
-{
- if (parent)
- {
- for (unsigned i = 0; i < GetNumNodes(); ++i)
- {
- if (child)
- {
- nodes[i].error = 0;
- for (unsigned j = 0; j < child->GetNumNodes(); ++j)
- nodes[i].error += child->GetError(j) * nodes[i].weights[j];
- }
- else
- nodes[i].error = nodes[i].desired - nodes[i].output;
- switch (nodes[i].function)
- {
- case Step:
- nodes[i].error *= .01;
- break;
- case SymmetricSigmoid:
- nodes[i].error *= 2;
- case Sigmoid:
- nodes[i].error *= nodes[i].output * (1 - nodes[i].output);
- break;
- case InverseTangent:
- nodes[i].error *= 1 / (1 + (nodes[i].output * nodes[i].output));
- break;
- case HyperbolicTangent:
- nodes[i].error *= 1 - tanh(nodes[i].output) * tanh(nodes[i].output);
- break;
- case Radial:
- nodes[i].error *= 2 * nodes[i].output * exp(nodes[i].output * nodes[i].output);
- }
- }
- return true;
- }
- return false;
-}
-
-bool PokeGen::NeuralNetwork::Layer::AdjustWeights()
-{
- if (child)
- {
- double delta;
- for (unsigned i = 0; i < GetNumNodes(); ++i)
- {
- for (unsigned j = 0; j < child->GetNumNodes(); ++j)
- {
- delta = nodes[i].learnRate * child->GetError(j) * nodes[i].output;
- nodes[i].weights[j] += delta + nodes[i].momentum * nodes[i].weightChanges[j] + nodes[i].momentumFactor * nodes[i].weightChanges[j];
- nodes[i].weightChanges[j] = delta;
- }
- }
- for (unsigned i = 0; i < child->GetNumNodes(); ++i)
- bias[i] += child->GetLearnRate(i) * child->GetError(i) * bias[i];
- return true;
- }
- return false;
-}
-
-bool PokeGen::NeuralNetwork::Layer::CalculateValues()
-{
- if (parent)
- {
- for (unsigned i = 0; i < GetNumNodes(); ++i)
- {
- double val = 0;
- for (unsigned j = 0; j < parent->GetNumNodes(); ++j)
- val += parent->GetOutput(j) * parent->GetWeight(j, i);
- val += parent->GetBias(i);
- switch (nodes[i].function)
- {
- case Identity:
- nodes[i].output = val;
- break;
- case Step:
- nodes[i].output = (val <= 0) ? 0 : 1;
- break;
- case Sigmoid:
- nodes[i].output = 1.0 / (1 + exp(val));
- break;
- case SymmetricSigmoid:
- nodes[i].output = 2.0 / (1 + exp(val)) - 1;
- break;
- case InverseTangent:
- nodes[i].output = atan(val);
- break;
- case HyperbolicTangent:
- nodes[i].output = tanh(val);
- break;
- case Radial:
- nodes[i].output = exp(val * val);
- }
- }
- return true;
- }
- return false;
-}
-
-bool PokeGen::NeuralNetwork::Layer::SetInput(const unsigned n, const double i)
-{
- if (n < GetNumNodes())
- {
- nodes[n].input = i;
- return true;
- }
- return false;
-}
-
-bool PokeGen::NeuralNetwork::Layer::SetDesired(const unsigned n, const double o)
-{
- if (n < GetNumNodes())
- {
- nodes[n].desired = o;
- return true;
- }
- return false;
-}
-
-bool PokeGen::NeuralNetwork::Layer::SetMomentum(const unsigned n, const double m)
-{
- if (n < GetNumNodes())
- {
- nodes[n].momentum = m;
- return true;
- }
- return false;
-}
-
-bool PokeGen::NeuralNetwork::Layer::SetMomentumFactor(const unsigned n, const double m)
-{
- if (n < GetNumNodes())
- {
- nodes[n].momentumFactor = m;
- return true;
- }
- return false;
-}
-
-bool PokeGen::NeuralNetwork::Layer::SetLearnRate(const unsigned n, const double l)
-{
- if (n < GetNumNodes())
- {
- nodes[n].learnRate = l;
- return true;
- }
- return false;
-}
-
-bool PokeGen::NeuralNetwork::Layer::SetFunction(const unsigned n, const unsigned f)
-{
- if ((n < GetNumNodes()) && (f < FunctionEnd))
- {
- nodes[n].function = f;
- return true;
- }
- return false;
-}
-
-double PokeGen::NeuralNetwork::Layer::GetOutput(const unsigned n) const
-{
- if (n < GetNumNodes())
- return nodes[n].output;
- return 0;
-}
-
-double PokeGen::NeuralNetwork::Layer::GetDesired(const unsigned n) const
-{
- if (n < GetNumNodes())
- return nodes[n].desired;
- return 0;
-}
-
-double PokeGen::NeuralNetwork::Layer::GetError(const unsigned n) const
-{
- if (n < GetNumNodes())
- return nodes[n].error;
- return 0;
-}
-
-double PokeGen::NeuralNetwork::Layer::GetMomentum(const unsigned n) const
-{
- if (n < GetNumNodes())
- return nodes[n].momentum;
- return 0;
-}
-
-double PokeGen::NeuralNetwork::Layer::GetMomentumFactor(const unsigned n) const
-{
- if (n < GetNumNodes())
- return nodes[n].momentumFactor;
- return 0;
-}
-
-double PokeGen::NeuralNetwork::Layer::GetLearnRate(const unsigned n) const
-{
- if (n < GetNumNodes())
- return nodes[n].learnRate;
- return 0;
-}
-
-unsigned PokeGen::NeuralNetwork::Layer::GetFunction(const unsigned n) const
-{
- if (n < GetNumNodes())
- return nodes[n].function;
- return FunctionEnd;
-}
-
-double PokeGen::NeuralNetwork::Layer::GetWeight(const unsigned n, const unsigned i) const
-{
- if (n < GetNumNodes())
- return nodes[n].weights[i];
- return 0;
-}
-
-double PokeGen::NeuralNetwork::Layer::GetBias(const unsigned n) const
-{
- if (n < child->GetNumNodes())
- return bias[n];
- return 0;
-}
diff --git a/ai/Layer.h b/ai/Layer.h
deleted file mode 100644
index 4342747c..00000000
--- a/ai/Layer.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name: ai/Layer.h
-// Purpose: A layer of a NeuralNet
-// Author: Ben Boeckel
-// Modified by: Ben Boeckel
-// Created: Sun Apr 15 16:56:23 2007
-// Copyright: ©2007 Nerdy Productions
-// Licence:
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program. If not, see <http://www.gnu.org/licenses/>.
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef __NEURAL_LAYER__
-#define __NEURAL_LAYER__
-
-#include <QFile>
-#include <QList>
-#include <QString>
-#include <QTextStream>
-#include <QVector>
-#include <cstdlib>
-#include <cmath>
-#include "../Ini.h"
-
-namespace PokeGen
-{
- namespace NeuralNetwork
- {
- class Node;
-
- class Layer
- {
- public:
- Layer(const unsigned num);
-
- void SaveData(Ini& nnData, const unsigned i) const;
-
- unsigned GetNumNodes() const;
-
- double GetOutput(const unsigned n) const;
- double GetDesired(const unsigned n) const;
- double GetError(const unsigned n) const;
- double GetMomentum(const unsigned n) const;
- double GetMomentumFactor(const unsigned n) const;
- double GetLearnRate(const unsigned n) const;
- unsigned GetFunction(const unsigned n) const;
- double GetWeight(const unsigned n, const unsigned i) const;
-
- double GetBias(const unsigned n) const;
-
- enum Function
- {
- Identity,
- Step,
- Sigmoid,
- SymmetricSigmoid,
- InverseTangent,
- HyperbolicTangent,
- Radial,
- FunctionEnd
- };
- static const QString FunctionStr[FunctionEnd];
- private:
- void SetParent(Layer* par);
- void SetChild(Layer* cld);
-
- void AddNode();
- bool DeleteNode(const unsigned n);
-
- bool RandomizeWeights();
- bool CalculateErrors();
- bool AdjustWeights();
- bool CalculateValues();
-
- bool SetInput(const unsigned n, const double i);
- bool SetDesired(const unsigned n, const double o);
- bool SetMomentum(const unsigned n, const double m);
- bool SetMomentumFactor(const unsigned n, const double m);
- bool SetLearnRate(const unsigned n, const double l);
- bool SetFunction(const unsigned n, const unsigned f);
-
- Layer* parent;
- Layer* child;
-
- class Node
- {
- private:
- Node(const unsigned cn) :
- input(0),
- output(0),
- desired(0),
- error(0),
- momentum(0),
- momentumFactor(0),
- learnRate(0),
- function(Sigmoid),
- weights(cn),
- weightChanges(cn)
- {
- }
-
- double input;
- double output;
- double desired;
- double error;
- double momentum;
- double momentumFactor;
- double learnRate;
- unsigned function;
- QVector<double> weights;
- QVector<double> weightChanges;
-
- friend class Layer;
- };
-
- QList<Node> nodes;
-
- QList<double> bias;
-
- friend class Net;
- };
-
- const QString Layer::FunctionStr[FunctionEnd] = {"Identity", "Step", "Sigmoid", "Symmetric Sigmoid", "Inverse Tangent ", "Hyperbolic Tangent", "Radial"};
- }
-}
-
-#endif
diff --git a/ai/Net.cpp b/ai/Net.cpp
deleted file mode 100644
index cd72fd6b..00000000
--- a/ai/Net.cpp
+++ /dev/null
@@ -1,290 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name: ai/Net.cpp
-// Purpose: An artificial neural network class
-// Author: Ben Boeckel
-// Modified by: Ben Boeckel
-// Created: Fri May 4 19:56:27 2007
-// Copyright: ©2007 Nerdy Productions
-// Licence:
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program. If not, see <http://www.gnu.org/licenses/>.
-/////////////////////////////////////////////////////////////////////////////
-
-#include "Net.h"
-
-PokeGen::NeuralNetwork::Net::Net(const QList<unsigned>& nodes)
-{
- for (int i = 0; i < nodes.size(); ++i)
- AddLayer(i, nodes[i]);
-}
-
-void PokeGen::NeuralNetwork::Net::SaveData(const QString& fname) const
-{
- Ini nnData("NeuralNet");
- nnData.AddField("numLayers", GetNumLayers());
- for (unsigned i = 0; i < GetNumLayers(); ++i)
- layers[i].SaveData(nnData, i);
- nnData.Export(fname);
-}
-
-PokeGen::NeuralNetwork::Net* PokeGen::NeuralNetwork::Net::LoadData(const QString& fname)
-{
- Ini t;
-
-
- Net* temp = new Net;
- QFile fin(fname);
- fin.open(QIODevice::ReadOnly | QIODevice::Text);
- if (fin.isOpen())
- {
- char next;
- while (fin.getChar(&next))
- {
- if (next == '-')
- {
- bool ok;
- unsigned i = QString(fin.readLine()).toUInt(&ok);
- if (ok)
- {
- temp->AddLayer(temp->GetNumLayers(), i);
- for (unsigned j = 0; (j < i) && fin.getChar(&next); ++j)
- {
- if (next == '+')
- {
- if (!temp->layers[temp->GetNumLayers() - 1].AddNode(fin.readLine()))
- {
- delete temp;
- return NULL;
- }
- }
- else
- {
- delete temp;
- return NULL;
- }
- }
- }
- }
- else
- {
- delete temp;
- return NULL;
- }
- }
- }
- else
- {
- delete temp;
- return NULL;
- }
- return temp;
-}
-
-void PokeGen::NeuralNetwork::Net::AddLayer(const unsigned place, const unsigned numNodes)
-{
- AddLayer(place, Layer(numNodes));
-}
-
-void PokeGen::NeuralNetwork::Net::AddLayer(const unsigned place, const Layer& layer)
-{
- if (place <= GetNumLayers())
- {
- layers.insert(place, layer);
- if (place)
- {
- layers[place - 1].SetChild(&layers[place]);
- layers[place].SetParent(&layers[place - 1]);
- }
- if ((place + 1) < GetNumLayers())
- {
- layers[place].SetChild(&layers[place + 1]);
- layers[place + 1].SetParent(&layers[place]);
- }
- }
-}
-
-bool PokeGen::NeuralNetwork::Net::DeleteLayer(const unsigned place)
-{
- if (place < GetNumLayers())
- {
- if (place)
- layers[place - 1].SetChild(layers[place].child);
- if ((place + 1) < GetNumLayers())
- layers[place + 1].SetParent(layers[place].parent);
- layers.removeAt(place);
- return true;
- }
- return false;
-}
-
-void PokeGen::NeuralNetwork::Net::FeedForward()
-{
- for (QList<Layer>::Iterator i = layers.begin(); i != layers.end(); ++i)
- i->CalculateValues();
-}
-
-void PokeGen::NeuralNetwork::Net::BackPropagate()
-{
- if (GetNumLayers())
- {
- QMutableListIterator<Layer> i(layers);
- for (i.toBack(); i.hasPrevious();)
- i.previous().CalculateErrors();
- if (1 < GetNumLayers())
- {
- for (i.toBack(), i.previous(); i.hasPrevious();)
- i.previous().AdjustWeights();
- }
- }
-}
-
-double PokeGen::NeuralNetwork::Net::CalculateError()
-{
- if (GetNumLayers())
- {
- double error = 0;
- for (unsigned i = 0; i < layers[GetNumLayers() - 1].GetNumNodes(); ++i)
- error += pow(layers[GetNumLayers() - 1].GetOutput(i) - layers[GetNumLayers() - 1].GetDesired(i), 2);
- return (error / layers[GetNumLayers() - 1].GetNumNodes());
- }
- return 0;
-}
-
-unsigned PokeGen::NeuralNetwork::Net::GetChoice() const
-{
- if (GetNumLayers())
- {
- double max = -DBL_MAX;
- unsigned choice = 0;
- for (unsigned i = 0; i < layers[GetNumLayers() - 1].GetNumNodes(); ++i)
- {
- if (max < GetOutput(i))
- {
- max = GetOutput(i);
- choice = i;
- }
- }
- return choice;
- }
- return UINT_MAX;
-}
-
-unsigned PokeGen::NeuralNetwork::Net::GetNumLayers() const
-{
- return layers.size();
-}
-
-unsigned PokeGen::NeuralNetwork::Net::GetNumNodes(const unsigned layer) const
-{
- if (layer < GetNumLayers())
- return layers[layer].GetNumNodes();
- return 0;
-}
-
-bool PokeGen::NeuralNetwork::Net::SetInput(const unsigned n, const double i)
-{
- if (GetNumLayers())
- return layers[0].SetInput(n, i);
- return false;
-}
-
-bool PokeGen::NeuralNetwork::Net::SetDesired(const unsigned n, const double o)
-{
- if (GetNumLayers())
- return layers[GetNumLayers() - 1].SetDesired(n, o);
- return false;
-}
-
-bool PokeGen::NeuralNetwork::Net::SetMomentum(const unsigned layer, const unsigned n, const double m)
-{
- if (layer < GetNumLayers())
- return layers[layer].SetMomentum(n, m);
- return false;
-}
-
-bool PokeGen::NeuralNetwork::Net::SetMomentumFactor(const unsigned layer, const unsigned n, const double m)
-{
- if (layer < GetNumLayers())
- return layers[layer].SetMomentumFactor(n, m);
- return false;
-}
-
-bool PokeGen::NeuralNetwork::Net::SetLearnRate(const unsigned layer, const unsigned n, const double l)
-{
- if (layer < GetNumLayers())
- return layers[layer].SetLearnRate(n, l);
- return false;
-}
-
-bool PokeGen::NeuralNetwork::Net::SetFunction(const unsigned layer, const unsigned n, const unsigned f)
-{
- if (layer < GetNumLayers())
- return layers[layer].SetFunction(n, f);
- return false;
-}
-
-double PokeGen::NeuralNetwork::Net::GetOutput(const unsigned n) const
-{
- if (GetNumLayers())
- return layers[GetNumLayers() - 1].GetOutput(n);
- return 0;
-}
-
-double PokeGen::NeuralNetwork::Net::GetError(const unsigned layer, const unsigned n) const
-{
- if (layer < GetNumLayers())
- return layers[layer].GetError(n);
- return 0;
-}
-
-double PokeGen::NeuralNetwork::Net::GetMomentum(const unsigned layer, const unsigned n) const
-{
- if (layer < GetNumLayers())
- return layers[layer].GetMomentum(n);
- return 0;
-}
-
-double PokeGen::NeuralNetwork::Net::GetMomentumFactor(const unsigned layer, const unsigned n) const
-{
- if (layer < GetNumLayers())
- return layers[layer].GetMomentumFactor(n);
- return 0;
-}
-
-double PokeGen::NeuralNetwork::Net::GetLearnRate(const unsigned layer, const unsigned n) const
-{
- if (layer < GetNumLayers())
- return layers[layer].GetLearnRate(n);
- return 0;
-}
-
-unsigned PokeGen::NeuralNetwork::Net::GetFunction(const unsigned layer, const unsigned n) const
-{
- if (layer < GetNumLayers())
- return layers[layer].GetFunction(n);
- return 0;
-}
-
-double PokeGen::NeuralNetwork::Net::GetWeight(const unsigned layer, const unsigned n, const unsigned i) const
-{
- if (layer < GetNumLayers())
- return layers[layer].GetWeight(n, i);
- return 0;
-}
-
-double PokeGen::NeuralNetwork::Net::GetBias(const unsigned layer, const unsigned n) const
-{
- if (layer < GetNumLayers())
- return layers[layer].GetBias(n);
- return 0;
-}
diff --git a/ai/Net.h b/ai/Net.h
deleted file mode 100644
index 8697ff8e..00000000
--- a/ai/Net.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name: ai/Net.h
-// Purpose: An artificial neural network class
-// Author: Ben Boeckel
-// Modified by: Ben Boeckel
-// Created: Sun Apr 15 16:56:23 2007
-// Copyright: ©2007 Nerdy Productions
-// Licence:
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program. If not, see <http://www.gnu.org/licenses/>.
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef __NEURAL_NET__
-#define __NEURAL_NET__
-
-#include <QFile>
-#include <QList>
-#include <QMutableListIterator>
-#include <float.h>
-#include "../Ini.h"
-#include "Layer.h"
-
-namespace PokeGen
-{
- namespace NeuralNetwork
- {
- class Net
- {
- public:
- Net(const QList<unsigned>& nodes = QList<unsigned>());
-
- void SaveData(const QString& fname) const;
- static Net* LoadData(const QString& fname);
-
- void AddLayer(const unsigned place, const unsigned numNodes);
- bool DeleteLayer(const unsigned place);
-
- void FeedForward();
- void BackPropagate();
- double CalculateError();
- unsigned GetChoice() const;
-
- unsigned GetNumLayers() const;
- unsigned GetNumNodes(const unsigned layer) const;
-
- bool SetInput(const unsigned n, const double i);
- bool SetDesired(const unsigned n, const double o);
- bool SetMomentum(const unsigned layer, const unsigned n, const double m);
- bool SetMomentumFactor(const unsigned layer, const unsigned n, const double m);
- bool SetLearnRate(const unsigned layer, const unsigned n, const double l);
- bool SetFunction(const unsigned layer, const unsigned n, const unsigned f);
-
- double GetOutput(const unsigned n) const;
- double GetError(const unsigned layer, const unsigned n) const;
- double GetMomentum(const unsigned layer, const unsigned n) const;
- double GetMomentumFactor(const unsigned layer, const unsigned n) const;
- double GetLearnRate(const unsigned layer, const unsigned n) const;
- unsigned GetFunction(const unsigned layer, const unsigned n) const;
- double GetWeight(const unsigned layer, const unsigned n, const unsigned i) const;
-
- double GetBias(const unsigned layer, const unsigned n) const;
- private:
- void AddLayer(const unsigned place, const Layer& layer);
-
- QList<Layer> layers;
- };
- }
-}
-
-#endif
diff --git a/ai/TODO b/ai/TODO
deleted file mode 100755
index 582ccf76..00000000
--- a/ai/TODO
+++ /dev/null
@@ -1 +0,0 @@
--Genetic Algorithm?
diff --git a/ai/ai.pro b/ai/ai.pro
deleted file mode 100644
index 7576f1ba..00000000
--- a/ai/ai.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-TEMPLATE = lib
-
-DESTDIR = ../../obj
-
-CONFIG += warn_on debug
-
-SOURCES += *.cpp
-HEADERS += *.h
diff --git a/audio/audio.c b/audio/audio.c
deleted file mode 100644
index 05a59eef..00000000
--- a/audio/audio.c
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "main.h"
-
-QUEUE_ENTRY voices[MAX_VOICES];
-
-int init(void) {
- SDL_AudioSpec format;
-
- sample_id=0;
-
- //initialize SDL for Audio and Events
- if (SDL_Init(SDL_INIT_AUDIO) < 0 ) {
- fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError());
- return -1;
- }
- atexit(SDL_Quit);
-
-
- //set up the audio format
- format.freq=44100;
- format.format=AUDIO_S16;
- format.channels=2;
- format.samples=512;
- format.callback=stream_audio;
- format.userdata = NULL;
-
- //open the audio device
- if(SDL_OpenAudio(&format,NULL)<0) {
- fprintf(stderr,"Unable to open audio: %s\n",SDL_GetError());
- return -1;
- }
-
- return 0;
-
-}
diff --git a/audio/audio.h b/audio/audio.h
deleted file mode 100644
index 82bc878f..00000000
--- a/audio/audio.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <errno.h>
-
-#include "SDL.h"
-#include "SDL_audio.h"
-#include "math.h"
-
-#include "samples.h"
-#include "control.h"
-#include "stream.h"
-
-#define VERSION_STRING "Early Alpha"
-
-#define MAX_VOICES 25
-
-
-typedef struct {
- unsigned long play_position;
- int isplaying;
- SAMPLE *voice;
-} QUEUE_ENTRY;
-
-extern QUEUE_ENTRY voices[MAX_VOICES];
-
-//performs all the sound initialization
-extern int init(void);
-
diff --git a/audio/audio.pro b/audio/audio.pro
new file mode 100644
index 00000000..0e365d92
--- /dev/null
+++ b/audio/audio.pro
@@ -0,0 +1,8 @@
+OBJECTS_DIR = ../../obj
+DESTDIR = ../../lib
+VERSION = 0.0.1
+TEMPLATE = lib
+CONFIG += qt warn_on
+
+HEADERS += *.h
+SOURCES += *.cpp
diff --git a/audio/build b/audio/build
deleted file mode 100755
index 5f5b7d14..00000000
--- a/audio/build
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-gcc -Wall -c `sdl-config --cflags` main.c control.c samples.c stream.c
-ar rcs libaudio.a control.o main.o samples.o stream.o
diff --git a/audio/control.c b/audio/control.c
deleted file mode 100644
index 72662611..00000000
--- a/audio/control.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-one line to give the program's name and an idea of what it does.
-Copyright (C) 2007 Peter Fernandes
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-
-#include "main.h"
-
-int play_sample(SAMPLE *sample) {
- int i=0;
-
- //find an empty sound slot to play the sound
- //(find one that's empty, or that has finished playing)
- for(;i<MAX_VOICES && voices[i].isplaying;i++);
-
- if(i==MAX_VOICES) {
- fprintf(stderr,"Error playing sound: Too many sounds playing\n");
- return -1;
- }
-
- SDL_LockAudio();
- voices[i].voice=sample; //put the sample we want to play in the slot (starts playing)
- voices[i].play_position=0; //used to keep track of how much of the sample has been buffered
- voices[i].isplaying=1;
- SDL_UnlockAudio();
- return 0;
-}
-
-
-int stop_sample(SAMPLE *sample) {
- int i=0;
-
- for(;i<MAX_VOICES;i++) {
- if(voices[i].voice && (voices[i].voice->id==sample->id)) //if the sound is playing, set the flag to stop it
- voices[i].isplaying=0;
- }
-
- if(i==MAX_VOICES)
- return -1;
-
-
- return 0;
-}
diff --git a/audio/control.h b/audio/control.h
deleted file mode 100644
index a350624c..00000000
--- a/audio/control.h
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-//inserts sample into the play queue and starts playing immediatly
-//returns < 0 on error
-extern int play_sample(SAMPLE *sample);
-
-//searches play queue for sample with the same ID as the one provided and stops it
-//safe to call even if sample is not playing
-extern int stop_sample(SAMPLE *sample);
diff --git a/audio/samples.c b/audio/samples.c
deleted file mode 100644
index 717e4766..00000000
--- a/audio/samples.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "main.h"
-
-int sample_id;
diff --git a/audio/samples.h b/audio/samples.h
deleted file mode 100644
index 30e21169..00000000
--- a/audio/samples.h
+++ /dev/null
@@ -1,12 +0,0 @@
-
-extern int sample_id;
-
-//a structure for a sample containing the sound data structure and a unique ID number for the sound
-//This struct should be considered private
-typedef struct {
- int id; //used in stream queue
- unsigned char *data;
- unsigned long len;
- char name[30];
- unsigned short key; //current key_binding (default loaded from set file)
-} SAMPLE;
diff --git a/audio/stream.c b/audio/stream.c
deleted file mode 100644
index c68d8919..00000000
--- a/audio/stream.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "main.h"
-
-void stream_audio(void *unused, Uint8 *stream, int len) {
- int i=0;
- unsigned long size;
-
- for(;i<MAX_VOICES;i++) {
- if(voices[i].isplaying) {
- if(voices[i].play_position>=voices[i].voice->len)
- voices[i].isplaying=0;
-
- size=(voices[i].voice->len)-(voices[i].play_position); //amount left of the sample to play
- if(size>len) size=len; //clip to the audio buffer size
-
- //mix each playing voice into the audio stream len bytes at a time
- SDL_MixAudio(stream,&voices[i].voice->data[voices[i].play_position],size,SDL_MIX_MAXVOLUME);
- voices[i].play_position+=size;
- }
- }
-}
diff --git a/audio/stream.h b/audio/stream.h
deleted file mode 100644
index e228113a..00000000
--- a/audio/stream.h
+++ /dev/null
@@ -1,3 +0,0 @@
-
-extern void stream_audio(void *unused, Uint8 *stream, int len);
-
diff --git a/pokemod/Ref.cpp b/battle/Arena.cpp
index 235c2a74..cebadd26 100644
--- a/pokemod/Ref.cpp
+++ b/battle/Arena.cpp
@@ -1,10 +1,10 @@
/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/Ref.h
-// Purpose: Define searching functions
+// Name: ai/AlphaBeta.cpp
+// Purpose: Alpha-Beta pruning MiniMax tree
// Author: Ben Boeckel
// Modified by: Ben Boeckel
-// Created: Thu Feb 15 10:21:05 2007
-// Copyright: ©2007 Nerdy Productions
+// Created: Tue Oct 16 2007 09:09:44
+// Copyright: ©2007 Ben Boeckel and Nerdy Productions
// Licence:
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -20,15 +20,20 @@
// with this program. If not, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////////////////
-#include "Ref.h"
+#include "Arena.h"
-unsigned PokeGen::PokeMod::FindIn(const unsigned end, const QString& str, const char* array[])
+long PokeGen::Arena::AlphaBeta(AIProfile ai, Arena arena, const unsigned depth, const long alpha, const long beta)
{
- unsigned i = 0;
- for (; i < end; ++i)
+ long val;
+ if (!depth)
+ return ai.eval(Arena);
+ while (CanSimulate())
{
- if (str == array[i])
- break;
+ val = -AlphaBeta(Arena.Simulate(), depth - 1, -beta, -alpha);
+ if (beta <= val)
+ return beta;
+ if (alpha < val)
+ alpha = val;
}
- return i;
+ return alpha;
}
diff --git a/battle/Arena.h b/battle/Arena.h
new file mode 100644
index 00000000..b14496bd
--- /dev/null
+++ b/battle/Arena.h
@@ -0,0 +1,86 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: battle/Arena.h
+// Purpose: Class to handle the battle environment
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Tue Oct 16 2007 09:21:30
+// Copyright: ©2007 Ben Boeckel and Nerdy Productions
+// Licence:
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. If not, see <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __BATTLE_ARENA__
+#define __BATTLE_ARENA__
+
+#include <QString>
+#include "Pokemon.h"
+#include "Team.h"
+#include "../gnereal/Ref.h"
+#include "pokemod/Ability.h"
+#include "pokemod/Item.h"
+#include "pokemod/MapTrainer.h"
+#include "pokemod/Move.h"
+#include "pokemod/Nature.h"
+#include "pokemod/Pokemon.h"
+#include "pokemod/Type.h"
+
+namespace PokeGen
+{
+ namespace Battle
+ {
+ class Arena
+ {
+ public:
+ typedef struct
+ {
+ unsigned action;
+ union
+ {
+ Pokemon pokemon;
+ unsigned value;
+ };
+ }Action;
+
+ enum
+ {
+ A_Fight = 0,
+ A_Switch = 1,
+ A_Item = 2,
+ A_Run = 3,
+ A_End_Choices = 4,
+ A_Ability = 4,
+ A_HeldItem = 5,
+ A_End_All = 6
+ };
+
+ Arena(Team& p, Team& e);
+
+ bool Play();
+
+ unsigned CheckWeather() const;
+ private:
+ void AskForActions();
+ void ParseActions(const Action action1, const Action action2);
+
+ long PokeGen::AlphaBeta(AIProfile ai, Arena arena, const unsigned depth, const long alpha = LONG_MIN, const long beta = LONG_MAX);
+
+ Team player;
+ Team opponent;
+
+ unsigned weather;
+ };
+ }
+}
+
+#endif
diff --git a/battle/Bot.h b/battle/Bot.h
new file mode 100644
index 00000000..04eb1f2d
--- /dev/null
+++ b/battle/Bot.h
@@ -0,0 +1,50 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: battle/Bot.h
+// Purpose: AI interface to the Team class
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Tue Oct 16 2007 11:44:16
+// Copyright: ©2007 Ben Boeckel and Nerdy Productions
+// Licence:
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. If not, see <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __POKEGEN_BOT__
+#define __POKEGEN_BOT__
+
+#include <QList>
+#include <QMap>
+#include "../general/Ini.h"
+#include "AIProfile.h"
+#include "Arena.h"
+#include "GhostBot.h"
+#include "Team.h"
+#include "../pokemod/MapTrainer.h"
+
+namespace PokeGen
+{
+ class Bot : Team
+ {
+ public:
+ Bot(PokeMod::Pokemod* par, PokeMod::MapTrainer trainer);
+
+ void InformOfAction(Arena::Action action);
+ Arena::Action RequestAction(Arena arena);
+ private:
+ GhostBot simulator;
+ AIProfile ai;
+ };
+}
+
+#endif
diff --git a/battle/Ghost.cpp b/battle/Ghost.cpp
new file mode 100644
index 00000000..cf3e6dd5
--- /dev/null
+++ b/battle/Ghost.cpp
@@ -0,0 +1,98 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: battle/Ghost.cpp
+// Purpose: Ghost used by the AI for simulations
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Tue Oct 16 2007 19:29:30
+// Copyright: ©2007 Ben Boeckel and Nerdy Productions
+// Licence:
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. If not, see <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#include "Ghost.h"
+
+Ghost(const PokeMod::Pokemod* par, const unsigned s, const unsigned l, const unsigned t) :
+ Pokemon(par, s, l),
+ teamSize(t),
+ unknownMoves(par->GetMaxMoves())
+{
+ for (unsigned i = 0; i < PokeMod::ST_End_GSC; ++i)
+ {
+ dv[i] = 0;
+ statExp[i] = 0;
+ minStats[i] = GetStat(i);
+ dv[i] = pokemod->GetMaxDV();
+ statExp[i] = 65535;
+ maxStats[i] = GetStat(i);
+ }
+ Species* pkmn = pokemod->GetSpeciesByID(s);
+ if (pkmn->GetNumAbilities() == 1)
+ FeedAbility(pkmn->GetAbility(0));
+}
+
+void FeedAttack(const unsigned actualDamage, const unsigned stat, const unsigned otherLevel, const unsigned power, const bool isAttacker)
+{
+
+}
+
+void FeedItem(const unsigned i)
+{
+ items.append(i);
+}
+
+void FeedMove(const unsigned m)
+{
+ if (!moves.contains(m))
+ {
+ moves.insert(m);
+ --unknownMoves;
+ moveChances[m] = UINT_MAX;
+ for (QMutableMapIterator<unsigned, unsigned> i(moveChances); i.hasNext(); i.next())
+ {
+ if (i.value() != UINT_MAX)
+ {
+ i.value() *= unknownMoves;
+ i.value() /= (unknownMoves + 1);
+ if (!i.value())
+ moveChances.erase(i);
+ }
+ }
+ for (QListIterator<MoveCombo> i(moveCombos); i.hasNext(); i.next())
+ {
+ if (i.prereqs.intersect(moves).size() && !moves.contains(i.move))
+ moves[i.move] *= i.chance;
+ }
+ }
+}
+
+void FeedMoveChance(const unsigned m, const unsigned weight)
+{
+ moveChances[m] = weight;
+}
+
+void FeedAbility(const unsigned a)
+{
+ ability = a;
+}
+
+void UpdateHP()
+{
+ curHP = hpPercent * maxStats[PokeMod::ST_HP];
+}
+
+void SetHP(const Frac p)
+{
+ hpPercent = p;
+ UpdateHP();
+}
diff --git a/battle/Ghost.h b/battle/Ghost.h
new file mode 100644
index 00000000..32a7d951
--- /dev/null
+++ b/battle/Ghost.h
@@ -0,0 +1,76 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: battle/Ghost.h
+// Purpose: Ghost used by the AI for simulations
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Tue Oct 16 2007 11:52:23
+// Copyright: ©2007 Ben Boeckel and Nerdy Productions
+// Licence:
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. If not, see <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __POKEGEN_GHOST__
+#define __POKEGEN_GHOST__
+
+#include <QList>
+#include <QMap>
+#include <QSet>
+#include "../general/Ini.h"
+#include "../pokemod/Frac.h"
+#include "Arena.h"
+#include "Team.h"
+
+namespace PokeGen
+{
+ namespace Battle
+ {
+ class Ghost : Pokemon
+ {
+ public:
+ Ghost(const PokeMod::Pokemod* par, const unsigned s, const unsigned l);
+
+ void FeedAttack(const unsigned actualDamage, const unsigned stat, const unsigned otherLevel, const unsigned power, const bool isAttacker);
+ void FeedItem(const unsigned i);
+ void FeedMove(const unsigned m);
+ void FeedMoveChance(const unsigned m, const unsigned weight);
+ void FeedMoveCombo(const MoveCombo m);
+ void FeedAbility(const unsigned a);
+
+ void UpdateHP();
+ void SetHP(const Frac p);
+ private:
+ struct MoveCombo
+ {
+ public:
+ MoveCombo(const QSet<unsigned> p, const unsigned m, const unsigned c) :
+ prereqs(p),
+ move(m),
+ chance(c)
+ {
+ }
+ QSet<unsigned> prereqs;
+ unsigned move;
+ const unsigned chance;
+ };
+
+ unsigned minStats[PokeMod::ST_End_GSC];
+ unsigned maxStats[PokeMod::ST_End_GSC];
+ QMap<unsigned, unsigned> moveChances;
+ QList<MoveCombo> moveCombos;
+ unsigned unknownMoves;
+ };
+ }
+}
+
+#endif
diff --git a/battle/GhostBot.h b/battle/GhostBot.h
new file mode 100644
index 00000000..e2628755
--- /dev/null
+++ b/battle/GhostBot.h
@@ -0,0 +1,50 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: pokegen/GhostBot.h
+// Purpose: Ghost player used by the AI for simulations
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Tue Oct 16 2007 11:52:23
+// Copyright: ©2007 Ben Boeckel and Nerdy Productions
+// Licence:
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. If not, see <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __POKEGEN_GHOSTBOT__
+#define __POKEGEN_GHOSTBOT__
+
+#include <QList>
+#include <QMap>
+#include "../Ini.h"
+#include "AIProfile.h"
+#include "Arena.h"
+#include "Ghost.h"
+#include "Team.h"
+
+namespace PokeGen
+{
+ class GhostBot : Team
+ {
+ public:
+ Ghost(const PokeMod::Pokemod* par, const QString aiFile, Bot host, const unsigned s, const unsigned l);
+
+ void FeedAttack(const unsigned stat, const unsigned otherLevel, const unsigned power, const bool isAttacker);
+ void FeedItem(const unsigned i);
+ void FeedMove(const unsigned m);
+ void FeedAbility(const unsigned a);
+ private:
+ AIProfile ai;
+ };
+}
+
+#endif
diff --git a/battle/Pokemon.h b/battle/Pokemon.h
new file mode 100644
index 00000000..a5b03de1
--- /dev/null
+++ b/battle/Pokemon.h
@@ -0,0 +1,102 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: pokegen/Pokemon.h
+// Purpose: Data relevant to a Pokemon in the game
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Tue Oct 16 2007 09:21:30
+// Copyright: ©2007 Ben Boeckel and Nerdy Productions
+// Licence:
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. If not, see <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __POKEGEN_POKEMON__
+#define __POKEGEN_POKEMON__
+
+#include <QList>
+#include <QSet>
+#include <QString>
+#include "../general/Frac.h"
+#include "../general/Ini.h"
+#include "../general/Ref.h"
+#include "../pokemod/Ability.h"
+#include "../pokemod/Item.h"
+#include "../pokemod/Nature.h"
+#include "../pokemod/Pokemod.h"
+#include "../pokemod/Species.h"
+
+namespace PokeGen
+{
+ namespace Battle
+ {
+ class Pokemon
+ {
+ public:
+ Pokemon(const PokeMod::Pokemod* par, Ini ini);
+ Pokemon(const PokeMod::Pokemod* par, const unsigned s, const unsigned l);
+
+ unsigned GetStat(const unsigned s) const;
+ unsigned GetLevel() const;
+
+ unsigned GetNumMoves() const;
+ bool SimulateMove(const unsigned m) const;
+ bool UseMove(const unsigned m);
+ bool UnlearnMove(const unsigned m);
+
+ bool SetStatus(const unsigned s);
+
+ bool UseItemOn(const unsigned i);
+
+ unsigned GetNumHeldItems() const;
+ unsigned GetHeldItem(const unsigned h);
+ bool GiveItem(const unsigned i);
+ bool TakeItem(const unsigned i);
+ bool SimulateTakeItem(const unsigned i) const;
+
+ bool CanFight() const;
+
+ void OutOfBattle();
+ protected:
+ typedef struct
+ {
+ Frac statMultipliers[PokeMod::ST_End_Battle];
+ bool isConfused;
+ bool isAttracted;
+ QList<bool> diabled;
+ unsigned substituteHP;
+ Frac toxicMultiplier;
+ }BattleSettings;
+
+ void GrowLevel();
+
+ unsigned species;
+ QString name;
+ QSet<unsigned> moves;
+ QList<unsigned> heldItems;
+ QList<Frac> powerPoints;
+ unsigned dv[PokeMod::ST_End_GSC];
+ unsigned statExp[PokeMod::ST_End_GSC];
+ unsigned curHP;
+ unsigned experience;
+ unsigned nature;
+ unsigned ability;
+ unsigned status;
+
+ BattleSettings battleSettings;
+
+ PokeMod::Pokemod* pokemod;
+ };
+ }
+}
+
+#endif
diff --git a/battle/Team.cpp b/battle/Team.cpp
new file mode 100644
index 00000000..b840db40
--- /dev/null
+++ b/battle/Team.cpp
@@ -0,0 +1,77 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: battle/Team.cpp
+// Purpose: Base class which is used to interface with the arena
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Tue Oct 16 2007 19:22:20
+// Copyright: ©2007 Ben Boeckel and Nerdy Productions
+// Licence:
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. If not, see <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#include "Team.h"
+
+PokeGen::Battle::Team::Team(PokeMod::Pokemod* par) :
+ active(0),
+ parent(par)
+{
+}
+
+void PokeGen::Battle::Team::AddItem(const unsigned i, const unsigned amt)
+{
+ if (amt)
+ items[i] = amt;
+}
+
+void PokeGen::Battle::Team::UseItem(const unsigned i)
+{
+ if (items.contains(i) && (items[i] != UINT_MAX))
+ {
+ --items[i];
+ if (!items[i])
+ items.remove(i);
+ }
+}
+
+void PokeGen::Battle::Team::AddPokemon(Pokemon& p)
+{
+ pokemon.append(&p);
+}
+
+void PokeGen::Battle::Team::SwapPokemon(const unsigned a, const unsigned b)
+{
+ if ((a < pokemon.size()) && (b < pokemon.size()))
+ {
+ Pokemon* temp = pokemon[a];
+ pokemon[a] = pokemon[b];
+ pokemon[b] = temp;
+ }
+}
+
+bool PokeGen::Battle::Team::SetActivePokemon(const unsigned a)
+{
+ if ((a < pokemon.size()) && pokemon[a]->CanFight())
+ active = a;
+}
+
+unsigned PokeGen::Battle::Team::CanFight() const
+{
+ unsigned alive = 0;
+ for (unsigned i = 0; (i < pokemon.size()) && !alive; ++i)
+ {
+ if (pokemon[i]->CanFight())
+ ++alive;
+ }
+ return alive;
+}
diff --git a/pokemod/PokemonNature.h b/battle/Team.h
index d56dc208..2c1d1fb2 100644
--- a/pokemod/PokemonNature.h
+++ b/battle/Team.h
@@ -1,9 +1,9 @@
/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/PokemonNature.h
-// Purpose: Define an nature that a Pokémon can have
+// Name: battle/Team.h
+// Purpose: Base class which is used to interface with the arena
// Author: Ben Boeckel
// Modified by: Ben Boeckel
-// Created: Tue Mar 20 18:39:17 2007
+// Created: Tue Oct 16 2007 09:21:30
// Copyright: ©2007 Ben Boeckel and Nerdy Productions
// Licence:
// This program is free software: you can redistribute it and/or modify
@@ -20,37 +20,40 @@
// with this program. If not, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////////////////
-#ifndef __POKEMOD_POKEMONNATURE__
-#define __POKEMOD_POKEMONNATURE__
+#ifndef __BATTLE_TEAM__
+#define __BATTLE_TEAM__
-#include <QFile>
-#include <QString>
-#include "Object.h"
-#include "Pokemod.h"
+#include <QList>
+#include <QMap>
+#include "Arena.h"
+#include "Pokemon.h"
namespace PokeGen
{
- namespace PokeMod
+ namespace Battle
{
- class PokemonNature : public Object
+ class Team
{
public:
- PokemonNature(const Pokemod* par, const unsigned _id);
- PokemonNature(const Pokemod* par, Ini& ini, const unsigned _id = UINT_MAX);
+ Team(PokeMod::Pokemod* par);
- void ImportIni(Ini& ini, const unsigned _id = UINT_MAX);
- void ExportIni(QFile& fout, const QString& pokemon) const;
+ void AddItem(const unsigned i, const unsigned amt);
+ void UseItem(const unsigned i);
- bool SetNature(const unsigned n);
- bool SetWeight(const unsigned w);
+ void AddPokemon(Pokemon& p);
+ void SwapPokemon(const unsigned a, const unsigned b);
+ bool SetActivePokemon(const unsigned a);
- unsigned GetNature() const;
- unsigned GetWeight() const;
- private:
- bool Validate();
+ unsigned CanFight() const;
- unsigned nature;
- unsigned weight;
+ virtual void InformOfAction(Arena::Action action);
+ virtual Arena::Action RequestAction(Arena arena);
+ protected:
+ QList<Pokemon*> pokemon;
+ QMap<unsigned, unsigned> items;
+ unsigned active;
+
+ PokeMod::Pokemod* parent;
};
}
}
diff --git a/pokemod/Flag.cpp b/general/Flag.cpp
index f21e0f11..8ac75ba2 100644
--- a/pokemod/Flag.cpp
+++ b/general/Flag.cpp
@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/Flag.cpp
+// Name: general/Flag.cpp
// Purpose: A class that handles flags
// Author: Ben Boeckel
// Modified by: Ben Boeckel
@@ -22,13 +22,9 @@
#include "Flag.h"
-PokeGen::PokeMod::Flag::Flag(const unsigned f, const unsigned s) :
- flag(f),
- status(0)
-{
-}
+const char* PokeGen::Flag::ValueStr[PokeGen::Flag::End] = {"Off", "On", "Ignore"};
-void PokeGen::PokeMod::Flag::ImportIni(Ini& ini)
+void PokeGen::Flag::ImportIni(Ini& ini)
{
unsigned i;
ini.GetValue("flag", flag, 0);
@@ -36,36 +32,10 @@ void PokeGen::PokeMod::Flag::ImportIni(Ini& ini)
status = (i ? ((i > Off) ? On : Ignore) : Off);
}
-void PokeGen::PokeMod::Flag::ExportIni(QFile& fout, const QString& val) const
+void PokeGen::Flag::ExportIni(QFile& fout, const QString& val) const
{
Ini exFlag(val);
exFlag.AddField("flag", flag);
exFlag.AddField("status", status);
exFlag.Export(fout);
}
-
-void PokeGen::PokeMod::Flag::Set(const unsigned f, const unsigned s)
-{
- SetFlag(f);
- SetStatus(s);
-}
-
-void PokeGen::PokeMod::Flag::SetFlag(const unsigned f)
-{
- flag = f;
-}
-
-void PokeGen::PokeMod::Flag::SetStatus(const unsigned s)
-{
- status = (s ? ((s > Off) ? On : Ignore) : Off);
-}
-
-unsigned PokeGen::PokeMod::Flag::GetFlag() const
-{
- return flag;
-}
-
-unsigned PokeGen::PokeMod::Flag::GetStatus() const
-{
- return status;
-}
diff --git a/general/Flag.h b/general/Flag.h
new file mode 100644
index 00000000..4b066b42
--- /dev/null
+++ b/general/Flag.h
@@ -0,0 +1,82 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: general/Flag.h
+// Purpose: A class that handles flags
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Tue Mar 20 19:22 2007
+// Copyright: ©2007 Nerdy Productions
+// Licence:
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. If not, see <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __FLAG__
+#define __FLAG__
+
+#include <QFile>
+#include <QString>
+#include "Ini.h"
+#include "Ref.h"
+
+namespace PokeGen
+{
+ class Flag
+ {
+ public:
+ enum
+ {
+ Off,
+ On,
+ Ignore,
+ End
+ };
+ static const char* ValueStr[End];
+
+ Flag(const unsigned f = 0, const unsigned s = 0) :
+ flag(f),
+ status((s ? ((s > Off) ? On : Ignore) : Off))
+ {
+ }
+
+ void ImportIni(Ini& ini);
+ void ExportIni(QFile& fout, const QString& val) const;
+
+ void Set(const unsigned f, const unsigned s)
+ {
+ SetFlag(f);
+ SetStatus(s);
+ }
+ void SetFlag(const unsigned f)
+ {
+ flag = f;
+ }
+ void SetStatus(const unsigned s)
+ {
+ status = (s ? ((s > Off) ? On : Ignore) : Off);
+ }
+
+ unsigned GetFlag() const
+ {
+ return flag;
+ }
+ unsigned GetStatus() const
+ {
+ return status;
+ }
+ private:
+ unsigned flag;
+ unsigned status;
+ };
+}
+
+#endif
diff --git a/pokemod/Frac.cpp b/general/Frac.cpp
index 2cc3e18c..44871b47 100644
--- a/pokemod/Frac.cpp
+++ b/general/Frac.cpp
@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/Frac.cpp
+// Name: general/Frac.cpp
// Purpose: A class to make handling fractions easier
// Author: Ben Boeckel
// Modified by: Ben Boeckel
@@ -22,26 +22,14 @@
#include "Frac.h"
-PokeGen::PokeMod::Frac::Frac(const unsigned t) :
- num(1),
- denom(1),
- type((t < End) ? t : Proper)
-{
-}
-
-PokeGen::PokeMod::Frac::Frac(const unsigned n, const unsigned d, const unsigned t)
-{
- Set(n, d, t);
-}
-
-void PokeGen::PokeMod::Frac::ImportIni(Ini& ini)
+void PokeGen::Frac::ImportIni(Ini& ini)
{
ini.GetValue("type", type, Proper);
ini.GetValue("num", num, 1);
ini.GetValue("denom", denom, 1);
}
-void PokeGen::PokeMod::Frac::ExportIni(QFile& fout, const QString& val)
+void PokeGen::Frac::ExportIni(QFile& fout, const QString& val)
{
Reduce();
Ini exFrac(val);
@@ -51,7 +39,7 @@ void PokeGen::PokeMod::Frac::ExportIni(QFile& fout, const QString& val)
exFrac.Export(fout);
}
-bool PokeGen::PokeMod::Frac::Set(const unsigned n, const unsigned d)
+bool PokeGen::Frac::Set(const unsigned n, const unsigned d)
{
if ((type == Improper) || ((n <= d) && (type == Proper)) || ((d <= n) && (type == Over1)))
{
@@ -61,7 +49,7 @@ bool PokeGen::PokeMod::Frac::Set(const unsigned n, const unsigned d)
return ((num == n) && (denom == d));
}
-bool PokeGen::PokeMod::Frac::Set(const unsigned n, const unsigned d, const unsigned t)
+bool PokeGen::Frac::Set(const unsigned n, const unsigned d, const unsigned t)
{
unsigned save_t = type;
if (SetType(t))
@@ -73,7 +61,7 @@ bool PokeGen::PokeMod::Frac::Set(const unsigned n, const unsigned d, const unsig
return false;
}
-bool PokeGen::PokeMod::Frac::SetNum(const unsigned n)
+bool PokeGen::Frac::SetNum(const unsigned n)
{
if ((type == Improper) || ((n <= denom) && (type == Proper)) || ((denom <= n) && (type == Over1)))
{
@@ -83,7 +71,7 @@ bool PokeGen::PokeMod::Frac::SetNum(const unsigned n)
return false;
}
-bool PokeGen::PokeMod::Frac::SetDenom(const unsigned d)
+bool PokeGen::Frac::SetDenom(const unsigned d)
{
if (d && ((type == Improper) || ((num <= d) && (type == Proper)) || ((d <= num) && (type == Over1))))
{
@@ -93,7 +81,7 @@ bool PokeGen::PokeMod::Frac::SetDenom(const unsigned d)
return false;
}
-bool PokeGen::PokeMod::Frac::SetType(const unsigned t)
+bool PokeGen::Frac::SetType(const unsigned t)
{
if (t < End)
{
@@ -103,22 +91,7 @@ bool PokeGen::PokeMod::Frac::SetType(const unsigned t)
return (type == t);
}
-unsigned PokeGen::PokeMod::Frac::GetNum() const
-{
- return num;
-}
-
-unsigned PokeGen::PokeMod::Frac::GetDenom() const
-{
- return denom;
-}
-
-unsigned PokeGen::PokeMod::Frac::GetType() const
-{
- return type;
-}
-
-void PokeGen::PokeMod::Frac::Reduce()
+void PokeGen::Frac::Reduce()
{
int i = num;
int j = denom;
@@ -132,8 +105,3 @@ void PokeGen::PokeMod::Frac::Reduce()
num /= i;
denom /= i;
}
-
-PokeGen::PokeMod::Frac::operator float() const
-{
- return (num / denom);
-}
diff --git a/general/Frac.h b/general/Frac.h
new file mode 100644
index 00000000..a9db49fb
--- /dev/null
+++ b/general/Frac.h
@@ -0,0 +1,89 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: general/Frac.h
+// Purpose: A class to make handling fractions easier
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Sun Mar 18 15:25:16 2007
+// Copyright: ©2007 Nerdy Productions
+// Licence:
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. If not, see <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __FRAC__
+#define __FRAC__
+
+#include <QFile>
+#include <QString>
+#include "Ini.h"
+
+namespace PokeGen
+{
+ class Frac
+ {
+ public:
+ enum
+ {
+ Proper = 0,
+ Improper = 1,
+ Over1 = 2,
+ End = 3
+ };
+
+ Frac(const unsigned t = Proper) :
+ num(1),
+ denom(1),
+ type((t < End) ? t : 0)
+ {
+ }
+ Frac(const unsigned n, const unsigned d, const unsigned t = Proper)
+ {
+ Set(n, d, t);
+ }
+
+ void ImportIni(Ini& ini);
+ void ExportIni(QFile& fout, const QString& val);
+
+ bool Set(const unsigned n, const unsigned d);
+ bool Set(const unsigned n, const unsigned d, const unsigned t);
+ bool SetNum(const unsigned n);
+ bool SetDenom(const unsigned d);
+ bool SetType(const unsigned t);
+
+ unsigned GetNum() const
+ {
+ return num;
+ }
+ unsigned GetDenom() const
+ {
+ return denom;
+ }
+ unsigned GetType() const
+ {
+ return type;
+ }
+
+ void Reduce();
+
+ operator float() const
+ {
+ return (num / denom);
+ }
+ private:
+ unsigned num;
+ unsigned denom;
+ unsigned type;
+ };
+}
+
+#endif
diff --git a/general/FracMatrix.h b/general/FracMatrix.h
new file mode 100644
index 00000000..6a33552f
--- /dev/null
+++ b/general/FracMatrix.h
@@ -0,0 +1,89 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: general/FracMatrix.h
+// Purpose: A 2D vector class
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Fri Oct 19 12:52:16 2007
+// Copyright: ©2007 Nerdy Productions
+// Licence:
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. If not, see <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __FRAC_MATRIX__
+#define __FRAC_MATRIX__
+
+#include "Frac.h"
+#include "Matrix.h"
+
+namespace PokeGen
+{
+ class FracMatrix : public MatrixBase<Frac>
+ {
+ public:
+ FracMatrix() :
+ MatrixBase<Frac>()
+ {
+ }
+ FracMatrix(const unsigned w, const unsigned h, const Frac &d = Frac()) :
+ MatrixBase<Frac>(w, h, d)
+ {
+ }
+ FracMatrix(Ini& ini)
+ {
+ ImportIni(ini);
+ }
+
+ void ImportIni(Ini& ini)
+ {
+ ini.GetValue("width", MatrixBase<Frac>::width, 0);
+ ini.GetValue("height", MatrixBase<Frac>::height, 0);
+ if (!(MatrixBase<Frac>::width && MatrixBase<Frac>::height))
+ return;
+ MatrixBase<Frac>::matrix.resize(MatrixBase<Frac>::width);
+ MatrixBase<Frac>::matrix.fill(QVector<Frac>(MatrixBase<Frac>::height, Frac(1, 1)));
+ for (unsigned i = 0; i < MatrixBase<Frac>::width; ++i)
+ {
+ for (unsigned j = 0; j < MatrixBase<Frac>::height; ++j)
+ {
+ unsigned k;
+ unsigned l;
+ bool m;
+ ini.GetValue(QString("Element-%1-%2-n").arg(i).arg(j), k, 0);
+ ini.GetValue(QString("Element-%1-%2-d").arg(i).arg(j), l, 0);
+ ini.GetValue(QString("Element-%1-%2-t").arg(i).arg(j), m, 0);
+ MatrixBase<Frac>::matrix[i][j].Set(k, l, m);
+ }
+ }
+ }
+ void ExportIni(QFile& fout, const QString& val) const
+ {
+ // Declare the elements
+ Ini exMatrix(val);
+ exMatrix.AddField("height", MatrixBase<Frac>::height);
+ exMatrix.AddField("width", MatrixBase<Frac>::width);
+ for (unsigned i = 0; i < MatrixBase<Frac>::width; ++i)
+ {
+ for (unsigned j = 0; j < MatrixBase<Frac>::height; ++j)
+ {
+ exMatrix.AddField(QString("Element-%1-%2-t").arg(i).arg(j), MatrixBase<Frac>::matrix[i][j].GetType());
+ exMatrix.AddField(QString("Element-%1-%2-n").arg(i).arg(j), MatrixBase<Frac>::matrix[i][j].GetNum());
+ exMatrix.AddField(QString("Element-%1-%2-d").arg(i).arg(j), MatrixBase<Frac>::matrix[i][j].GetDenom());
+ }
+ }
+ exMatrix.Export(fout);
+ }
+ };
+}
+
+#endif
diff --git a/Hat.h b/general/Hat.h
index 78915c99..255ffb5d 100644
--- a/Hat.h
+++ b/general/Hat.h
@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
-// Name: Hat.h
+// Name: general/Hat.h
// Purpose: Class for easy random containers
// Author: Ben Boeckel
// Modified by: Ben Boeckel
diff --git a/Ini.cpp b/general/Ini.cpp
index 503fa525..61de9836 100755..100644
--- a/Ini.cpp
+++ b/general/Ini.cpp
@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
-// Name: Ini.cpp
+// Name: general/Ini.cpp
// Purpose: Define sections for data files
// Author: Ben Boeckel
// Modified by: Ben Boeckel
diff --git a/Ini.h b/general/Ini.h
index ed6dc94c..42fa9f2f 100755..100644
--- a/Ini.h
+++ b/general/Ini.h
@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
-// Name: Ini.h
+// Name: general/Ini.h
// Purpose: Define sections for data files
// Author: Ben Boeckel
// Modified by: Ben Boeckel
diff --git a/general/Matrix.h b/general/Matrix.h
new file mode 100644
index 00000000..d4a696b2
--- /dev/null
+++ b/general/Matrix.h
@@ -0,0 +1,213 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: general/Matrix.h
+// Purpose: A 2D vector class
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Sun Apr 8 12:51:20 2007
+// Copyright: ©2007 Nerdy Productions
+// Licence:
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. If not, see <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __MATRIX__
+#define __MATRIX__
+
+#include <QFile>
+#include <QVector>
+#include "Ini.h"
+#include "Point.h"
+
+namespace PokeGen
+{
+ template<class T> class MatrixBase
+ {
+ public:
+ MatrixBase() :
+ width(0),
+ height(0)
+ {
+ }
+ MatrixBase(const unsigned w, const unsigned h, const T& d = T()) :
+ width(w),
+ height(h),
+ matrix(w, QVector<T>(h, d))
+ {
+ }
+
+ void AddRow(const T& d = T())
+ {
+ for (typename QVector< QVector<T> >::Iterator i = matrix.begin(); i != matrix.end(); ++i)
+ i->append(d);
+ ++height;
+ }
+ void AddCol(const T& d = T())
+ {
+ matrix.append(QVector<T>(height, d));
+ ++width;
+ }
+ bool InsertRow(const unsigned pos, const T& d = T())
+ {
+ if (height < pos)
+ return false;
+ for (typename QVector< QVector<T> >::Iterator i = matrix.begin(); i != matrix.end(); ++i)
+ i->insert(i->begin() + pos, d);
+ ++height;
+ return true;
+ }
+ bool InsertCol(const unsigned pos, const T& d = T())
+ {
+ if (width < pos)
+ return false;
+ matrix.insert(matrix.begin() + pos, QVector<T>(height, d));
+ ++width;
+ return true;
+ }
+ bool DeleteRow(const unsigned pos)
+ {
+ if (height <= pos)
+ return false;
+ for (typename QVector< QVector<T> >::Iterator i = matrix.begin(); i != matrix.end(); ++i)
+ i->erase(i->begin() + pos);
+ --height;
+ return true;
+ }
+ bool DeleteCol(const unsigned pos)
+ {
+ if (width <= pos)
+ return false;
+ matrix.erase(matrix.begin() + pos);
+ --width;
+ return true;
+ }
+ void Clear()
+ {
+ matrix.clear();
+ }
+
+ bool Set(const unsigned row, const unsigned col, const T& s)
+ {
+ if ((width <= col) || (height <= col))
+ return false;
+ (matrix.begin() + col)->assign(row, s);
+ return true;
+ }
+ void Resize(const unsigned w, const unsigned h, const T& d = T())
+ {
+ Clear();
+ width = w;
+ height = h;
+ matrix = QVector< QVector<T> >(w, QVector<T>(h, d));
+ }
+
+ T& Get(const unsigned row, const unsigned col) const
+ {
+ if ((width <= col) || (height <= col))
+ return T();
+ return matrix[col][row];
+ }
+ const QVector<T> GetRow(const unsigned row) const
+ {
+ QVector<T> r;
+ for (typename QVector< QVector<T> >::Iterator i = matrix.begin(); i != matrix.end(); ++i)
+ r.append(i->at(row));
+ return r;
+ }
+ const QVector<T> GetCol(const unsigned col) const
+ {
+ return matrix[col];
+ }
+ unsigned GetHeight() const
+ {
+ return height;
+ }
+ unsigned GetWidth() const
+ {
+ return width;
+ }
+ Point GetSize() const
+ {
+ return Point(width, height);
+ }
+
+ T& operator()(const Point& p)
+ {
+ return matrix.value[p.GetX()][p.GetY()];
+ }
+ const T& operator()(const Point& p) const
+ {
+ return matrix.value[p.GetX()][p.GetY()];
+ }
+ T& operator()(const unsigned col, const unsigned row)
+ {
+ return matrix[col][row];
+ }
+ const T& operator()(const unsigned col, const unsigned row) const
+ {
+ return matrix[col][row];
+ }
+ protected:
+ unsigned width;
+ unsigned height;
+ QVector< QVector<T> > matrix;
+ };
+
+ template<class T> class Matrix : public MatrixBase<T>
+ {
+ public:
+ Matrix() :
+ MatrixBase<T>()
+ {
+ }
+ Matrix(const unsigned w, const unsigned h, const T& d = T()) :
+ MatrixBase<T>(w, h, d)
+ {
+ }
+ Matrix(Ini& ini)
+ {
+ ImportIni(ini);
+ }
+
+ void ImportIni(Ini& ini)
+ {
+ ini.GetValue("width", MatrixBase<T>::width, 0);
+ ini.GetValue("height", MatrixBase<T>::height, 0);
+ if (!(MatrixBase<T>::width && MatrixBase<T>::height))
+ return;
+ MatrixBase<T>::matrix.resize(MatrixBase<T>::width, QVector<T>(MatrixBase<T>::height, 0));
+ for (unsigned i = 0; i < MatrixBase<T>::width; ++i)
+ {
+ for (unsigned j = 0; j < MatrixBase<T>::height; ++j)
+ {
+ int k;
+ ini.GetValue(QString("Element-%1-%2").arg(i).arg(j), k, 0);
+ MatrixBase<T>::matrix[i][j] = k;
+ }
+ }
+ }
+ void ExportIni(QFile& fout, const QString& val) const
+ {
+ // Declare the elements
+ Ini exMatrix(val);
+ exMatrix.AddField("height", MatrixBase<T>::height);
+ exMatrix.AddField("width", MatrixBase<T>::width);
+ for (int i = 0; i < MatrixBase<T>::width; ++i)
+ {
+ for (unsigned j = 0; j < MatrixBase<T>::height; ++j)
+ exMatrix.AddField(QString("Element-%1-%2").arg(i).arg(j), MatrixBase<T>::matrix[i][j]);
+ }
+ }
+ };
+}
+
+#endif
diff --git a/pokemod/Point.cpp b/general/Point.cpp
index 6a01380f..19eeee18 100644
--- a/pokemod/Point.cpp
+++ b/general/Point.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/Point.cpp
-// Purpose: Define a coordinate point for use in a PokéMod
+// Name: general/Point.cpp
+// Purpose: Define a coordinate point
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Sun Apr 8 13:46:11 2007
@@ -22,13 +22,13 @@
#include "Point.h"
-void PokeGen::PokeMod::Point::ImportIni(Ini& ini)
+void PokeGen::Point::ImportIni(Ini& ini)
{
ini.GetValue("x", x, 0);
ini.GetValue("y", y, 0);
}
-void PokeGen::PokeMod::Point::ExportIni(QFile& fout, const QString& val) const
+void PokeGen::Point::ExportIni(QFile& fout, const QString& val) const
{
Ini exPoint(val);
exPoint.AddField("x", x);
diff --git a/general/Point.h b/general/Point.h
new file mode 100644
index 00000000..93fed968
--- /dev/null
+++ b/general/Point.h
@@ -0,0 +1,71 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: general/Point.h
+// Purpose: Define a coordinate point
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Sun Apr 8 12:53:15 2007
+// Copyright: ©2007 Nerdy Productions
+// Licence:
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. If not, see <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __POINT__
+#define __POINT__
+
+#include <QFile>
+#include "Ini.h"
+
+namespace PokeGen
+{
+ class Point
+ {
+ public:
+ inline Point(const unsigned _x = 0, const unsigned _y = 0) :
+ x(_x),
+ y(_y)
+ {
+ }
+
+ void ImportIni(Ini& ini);
+ void ExportIni(QFile& fout, const QString& val) const;
+
+ inline void Set(const unsigned _x, const unsigned _y)
+ {
+ x = _x;
+ y = _y;
+ }
+ inline void SetX(const unsigned _x)
+ {
+ x = _x;
+ }
+ inline void SetY(const unsigned _y)
+ {
+ y = _y;
+ }
+
+ inline unsigned GetX() const
+ {
+ return x;
+ }
+ inline unsigned GetY() const
+ {
+ return y;
+ }
+ private:
+ unsigned x;
+ unsigned y;
+ };
+}
+
+#endif
diff --git a/general/Ref.cpp b/general/Ref.cpp
new file mode 100644
index 00000000..b11b528f
--- /dev/null
+++ b/general/Ref.cpp
@@ -0,0 +1,47 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: general/Ref.h
+// Purpose: Define references used globally
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Thu Feb 15 10:21:05 2007
+// Copyright: ©2007 Nerdy Productions
+// Licence:
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. If not, see <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#include "Ref.h"
+
+unsigned PokeGen::FindIn(const unsigned end, const QString& str, const char* array[])
+{
+ unsigned i = 0;
+ for (; i < end; ++i)
+ {
+ if (str == array[i])
+ break;
+ }
+ return i;
+}
+
+const char* PokeGen::StatRBYStr[PokeGen::ST_End_Battle] = {"HP", "Attack", "Defense", "Speed", "Special", "Special", "Accuracy", "Evasion"};
+const char* PokeGen::StatGSCStr[PokeGen::ST_End_Battle] = {"HP", "Attack", "Defense", "Speed", "Special Attack", "Special Defense", "Accuracy", "Evasion"};
+
+const char* PokeGen::BattleMemberStr[PokeGen::BM_End] = {"Player", "Enemy"};
+
+const char* PokeGen::WeatherStr[PokeGen::W_End_All] = {"Ice", "Rain", "Sun", "Sand", "All"};
+
+const char* PokeGen::DirectionStr[PokeGen::D_End_None] = {"Up", "Down", "Left", "Right", "None"};
+
+const char* PokeGen::RelativeStr[PokeGen::REL_End] = {"Less", "Less or Equal", "Equal", "Greater or Equal", "Greater", "Not Equal"};
+
+const char* PokeGen::StatusStr[PokeGen::STS_End] = {"Freeze", "Paralyze", "Sleep", "Poison", "Toxic Poison", "Burn", "Any"};
diff --git a/general/Ref.h b/general/Ref.h
new file mode 100644
index 00000000..4209d00c
--- /dev/null
+++ b/general/Ref.h
@@ -0,0 +1,108 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: general/Ref.h
+// Purpose: Define references used globally
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Thu Feb 15 8:42:45 2007
+// Copyright: ©2007 Nerdy Productions
+// Licence:
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. If not, see <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __REF__
+#define __REF__
+
+#include <QString>
+
+namespace PokeGen
+{
+ unsigned FindIn(const unsigned end, const QString& str, const char* array[]);
+
+ enum EnumStat
+ {
+ ST_HP = 0,
+ ST_Attack = 1,
+ ST_Defense = 2,
+ ST_Speed = 3,
+ ST_Special = 4,
+ ST_End_RBY = 5,
+ ST_SpecialAttack = 4,
+ ST_SpecialDefense = 5,
+ ST_End_GSC = 6,
+ ST_Accuracy = 6,
+ ST_Evasion = 7,
+ ST_End_Battle = 8,
+ };
+ extern const char* StatRBYStr[ST_End_Battle];
+ extern const char* StatGSCStr[ST_End_Battle];
+
+ enum EnumBattleMember
+ {
+ BM_Player = 0,
+ BM_Enemy = 1,
+ BM_End = 2
+ };
+ extern const char* BattleMemberStr[BM_End];
+
+ enum EnumWeather
+ {
+ W_Ice = 0,
+ W_Rain = 1,
+ W_Sun = 2,
+ W_Sand = 3,
+ W_End_Real = 4,
+ W_All = 4,
+ W_End_All = 5
+ };
+ extern const char* WeatherStr[W_End_All];
+
+ enum EnumDirection
+ {
+ D_Up = 0,
+ D_Down = 1,
+ D_Left = 2,
+ D_Right = 3,
+ D_End = 4,
+ D_None = 4,
+ D_End_None = 5
+ };
+ extern const char* DirectionStr[D_End_None];
+
+ enum EnumRelative
+ {
+ REL_Less = 0,
+ REL_LessOrEqual = 1,
+ REL_Equal = 2,
+ REL_GreaterOrEqual = 3,
+ REL_Greater = 4,
+ REL_NotEqual = 5,
+ REL_End = 6
+ };
+ extern const char* RelativeStr[REL_End];
+
+ enum EnumStatus
+ {
+ STS_Freeze = 0,
+ STS_Paralyze = 1,
+ STS_Sleep = 2,
+ STS_Poison = 3,
+ STS_ToxicPoison = 4,
+ STS_Burn = 5,
+ STS_Any = 6,
+ STS_End = 7
+ };
+ extern const char* StatusStr[STS_End];
+}
+
+#endif
diff --git a/general/general.pro b/general/general.pro
new file mode 100644
index 00000000..3fe8b64a
--- /dev/null
+++ b/general/general.pro
@@ -0,0 +1,8 @@
+OBJECTS_DIR = ../../obj/pokemod
+DESTDIR = ../../lib
+VERSION = 1.0.0
+TEMPLATE = lib
+CONFIG += qt warn_on dll
+
+SOURCES += *.cpp
+HEADERS += *.h
diff --git a/pokegen.cbp b/pokegen.cbp
deleted file mode 100644
index 10d8766e..00000000
--- a/pokegen.cbp
+++ /dev/null
@@ -1,329 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<CodeBlocks_project_file>
- <FileVersion major="1" minor="6" />
- <Project>
- <Option title="pokegen" />
- <Option pch_mode="2" />
- <Option compiler="gcc" />
- <Build>
- <Target title="pokemod">
- <Option output="../bin/libpokemod" prefix_auto="0" extension_auto="1" />
- <Option object_output="../obj/" />
- <Option type="3" />
- <Option compiler="gcc" />
- <Compiler>
- <Add option="-O3" />
- <Add option="-Wall" />
- <Add option="-pg" />
- </Compiler>
- <Linker>
- <Add option="-pg" />
- </Linker>
- </Target>
- <Target title="ai">
- <Option output="../lib/libai" prefix_auto="1" extension_auto="1" />
- <Option object_output="../obj/" />
- <Option type="3" />
- <Option compiler="gcc" />
- <Option createDefFile="1" />
- <Option createStaticLib="1" />
- <Compiler>
- <Add option="-Wall" />
- <Add option="-pg" />
- </Compiler>
- <Linker>
- <Add option="-pg" />
- </Linker>
- </Target>
- </Build>
- <Compiler>
- <Add option="-O3" />
- <Add option="-Wall" />
- <Add option="-g" />
- </Compiler>
- <Linker>
- <Add option="-pg -lgmon" />
- </Linker>
- <Unit filename="Changelog">
- <Option target="&lt;{~None~}&gt;" />
- </Unit>
- <Unit filename="Hat.h">
- <Option target="&lt;{~None~}&gt;" />
- </Unit>
- <Unit filename="Ini.cpp" />
- <Unit filename="Ini.h" />
- <Unit filename="STANDARDS">
- <Option target="&lt;{~None~}&gt;" />
- </Unit>
- <Unit filename="ai/Layer.cpp">
- <Option target="ai" />
- </Unit>
- <Unit filename="ai/Layer.h">
- <Option target="ai" />
- </Unit>
- <Unit filename="ai/Net.cpp">
- <Option target="ai" />
- </Unit>
- <Unit filename="ai/Net.h">
- <Option target="ai" />
- </Unit>
- <Unit filename="ai/ai.pro">
- <Option target="ai" />
- </Unit>
- <Unit filename="pokegen.pro" />
- <Unit filename="pokemod/Ability.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Ability.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/AbilityEffect.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/AbilityEffect.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Author.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Author.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Badge.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Badge.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/CoinList.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/CoinList.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/CoinListObject.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/CoinListObject.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Dialog.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Dialog.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/EggGroup.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/EggGroup.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Flag.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Flag.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Frac.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Frac.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Item.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Item.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/ItemEffect.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/ItemEffect.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/ItemType.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/ItemType.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Map.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Map.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/MapEffect.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/MapEffect.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/MapTrainer.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/MapTrainer.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/MapTrainerPokemon.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/MapTrainerPokemon.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/MapWarp.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/MapWarp.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/MapWildList.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/MapWildList.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/MapWildListPokemon.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/MapWildListPokemon.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Matrix.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Move.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Move.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/MoveEffect.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/MoveEffect.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Nature.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Nature.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Object.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Point.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Point.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Pokemod.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Pokemod.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Pokemon.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Pokemon.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/PokemonAbility.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/PokemonAbility.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/PokemonEvolution.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/PokemonEvolution.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/PokemonItem.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/PokemonItem.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/PokemonMove.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/PokemonMove.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/PokemonNature.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/PokemonNature.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Ref.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Ref.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Status.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Status.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/StatusEffect.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/StatusEffect.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Store.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Store.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/TODO">
- <Option target="&lt;{~None~}&gt;" />
- </Unit>
- <Unit filename="pokemod/Tile.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Tile.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Time.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Time.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Type.cpp">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/Type.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/pokemod.pro">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemod/pokemod_inc.h">
- <Option target="pokemod" />
- </Unit>
- <Unit filename="pokemodr/PokeModr.cpp">
- <Option target="&lt;{~None~}&gt;" />
- </Unit>
- <Unit filename="pokemodr/PokeModrDebug.h">
- <Option target="&lt;{~None~}&gt;" />
- </Unit>
- <Extensions>
- <envvars />
- <code_completion />
- <debugger />
- </Extensions>
- </Project>
-</CodeBlocks_project_file>
diff --git a/pokegen.depend b/pokegen.depend
deleted file mode 100644
index cab00cdc..00000000
--- a/pokegen.depend
+++ /dev/null
@@ -1,2196 +0,0 @@
-# depslib dependency file v1.0
-1180843850 source:h:\ben\programming\pc\pokegen\src\pokemod\flag.cpp
- "Flag.h"
-
-1180801004
-
-1180848044 h:\ben\programming\pc\pokegen\src\pokemod\flag.h
- "Debug.h"
- "Ini.h"
- "Ref.h"
-
-1180848064 h:\ben\programming\pc\pokegen\src\pokemod\debug.h
- <ctime>
- <fstream>
- <cstdio>
- "String.h"
-
-1180717448 h:\ben\programming\pc\pokegen\src\pokemod\string.h
- <cstdarg>
- <string>
- <sstream>
- <iostream>
-
-1180848048 h:\ben\programming\pc\pokegen\src\pokemod\frac.h
- "Debug.h"
- "Ini.h"
-
-1180899300 h:\ben\programming\pc\pokegen\src\pokemod\ini.h
- <map>
- <fstream>
- "String.h"
-
-1182101840 h:\ben\programming\pc\pokegen\src\pokemod\ref.h
- <vector>
- "String.h"
-
-1180847176 source:h:\ben\programming\pc\pokegen\src\pokemod\ini.cpp
- "Ini.h"
-
-1180847420 source:h:\ben\programming\pc\pokegen\src\pokemod\object.cpp
- "Object.h"
-
-1180980116 h:\ben\programming\pc\pokegen\src\pokemod\object.h
- <wx/listbox.h>
- <fstream>
- "Debug.h"
- "Ini.h"
-
-1180847452 source:h:\ben\programming\pc\pokegen\src\pokemod\path.cpp
- "Path.h"
-
-1180847932 h:\ben\programming\pc\pokegen\src\pokemod\path.h
- <string>
- <fstream>
- "String.h"
-
-1180847462 source:h:\ben\programming\pc\pokegen\src\pokemod\point.cpp
- "Point.h"
-
-1180901382 h:\ben\programming\pc\pokegen\src\pokemod\point.h
- "Debug.h"
- "Ini.h"
-
-1180847696 source:h:\ben\programming\pc\pokegen\src\pokemod\string.cpp
- "String.h"
-
-1180843688 source:h:\ben\programming\pc\pokegen\src\pokemod\debug.cpp
- "Debug.h"
-
-1180889888 source:h:\ben\programming\pc\pokegen\src\pokemod\ref.cpp
- "Ref.h"
-
-1180847608 source:h:\ben\programming\pc\pokegen\src\pokemod\type.cpp
- "Type.h"
-
-1180184954 h:\ben\programming\pc\pokegen\src\pokemod\type.h
- "Object.h"
- "String.h"
-
-1180847616 source:h:\ben\programming\pc\pokegen\src\pokemod\time.cpp
- "Time.h"
-
-1180184978 h:\ben\programming\pc\pokegen\src\pokemod\time.h
- "Object.h"
- "String.h"
-
-1180843820 source:h:\ben\programming\pc\pokegen\src\pokemod\egggroup.cpp
- "EggGroup.h"
-
-1180980336 h"
-
-1180848052 h:\ben\programming\pc\pokegen\src\pokemod\egggroup.h
- "Object.h"
- "String.h"
-
-1180843074 source:h:\ben\programming\pc\pokegen\src\pokemod\author.cpp
- "Author.h"
-
-1180848088 h:\ben\programming\pc\pokegen\src\pokemod\author.h
- "Object.h"
- "String.h"
-
-1180843064 source:h:\ben\programming\pc\pokegen\src\pokemod\badge.cpp
- "Badge.h"
-
-1180966996 h:\ben\programming\pc\pokegen\src\pokemod\badge.h
- "Object.h"
- "String.h"
- "Ref.h"
- "Path.h"
- "Frac.h"
- "Pokemod.h"
-
-1180981206 "
-
-1180981772 h:\ben\programming\pc\pokegen\src\pokemod\pokemod.h
- <vector>
- <map>
- <sstream>
- <string>
- "pokemod_inc.h"
- "Object.h"
- "Ref.h"
- "Ability.h"
- "Author.h"
- "Badge.h"
- "CoinList.h"
- "Dialog.h"
- "EggGroup.h"
- "Ini.h"
- "Item.h"
- "ItemStorage.h"
- "Map.h"
- "Move.h"
- "Nature.h"
- "Point.h"
- "Pokemon.h"
- "Status.h"
- "Store.h"
- "String.h"
- "Tile.h"
- "Time.h"
- "Type.h"
-
-1180848102 h:\ben\programming\pc\pokegen\src\pokemod\pokemod_inc.h
- "Pokemod.h"
-
-1180980186 h:\ben\programming\pc\pokegen\src\pokemod\ability.h
- <vector>
- "Object.h"
- "String.h"
- "AbilityEffect.h"
-
-1180801281 fect.h"
-
-1180966976 h:\ben\programming\pc\pokegen\src\pokemod\abilityeffect.h
- "Object.h"
- "String.h"
- "Pokemod.h"
- "Ability.h"
- "Frac.h"
- "Type.h"
- "Ref.h"
-
-1180967010 h:\ben\programming\pc\pokegen\src\pokemod\coinlist.h
- <vector>
- <map>
- "Object.h"
- "String.h"
- "Pokemod.h"
- "CoinItem.h"
-
-1180967002 h:\ben\programming\pc\pokegen\src\pokemod\coinitem.h
- "Object.h"
- "String.h"
- "Pokemod.h"
-
-1180967034 h:\ben\programming\pc\pokegen\src\pokemod\item.h
- <vector>
- <map>
- "Object.h"
- "String.h"
- "Pokemod.h"
- "ItemEffect.h"
-
-1180980726 t.h"
-
-1180967040 h:\ben\programming\pc\pokegen\src\pokemod\itemeffect.h
- "Object.h"
- "String.h"
- "Pokemod.h"
-
-1180848028 h:\ben\programming\pc\pokegen\src\pokemod\itemstorage.h
- "Object.h"
- "String.h"
-
-1180980782 h:\ben\programming\pc\pokegen\src\pokemod\nature.h
- <vector>
- "Object.h"
- "String.h"
- "NatureEffect.h"
-
-1180981258 ect.h"
-
-1180967194 h:\ben\programming\pc\pokegen\src\pokemod\natureeffect.h
- "Object.h"
- "String.h"
- "Frac.h"
- "Pokemod.h"
-
-1180980726 h:\ben\programming\pc\pokegen\src\pokemod\move.h
- <vector>
- <map>
- "Object.h"
- "String.h"
- "MoveEffect.h"
-
-1180847958 h:\ben\programming\pc\pokegen\src\pokemod\moveeffect.h
- "Object.h"
- "String.h"
- "Pokemod.h"
- "Frac.h"
-
-1180967644 h:\ben\programming\pc\pokegen\src\pokemod\store.h
- <vector>
- <map>
- "Object.h"
- "String.h"
- "Pokemod.h"
-
-1180744584 source:h:\ben\programming\pc\pokegen\src\pokemod\dialog.cpp
- "Dialog.h"
-
-1180967018 h:\ben\programming\pc\pokegen\src\pokemod\dialog.h
- "Object.h"
- "String.h"
- "Pokemod.h"
-
-1180843936 source:h:\ben\programming\pc\pokegen\src\pokemod\frac.cpp
- "Frac.h"
-
-1180844756 source:h:\ben\programming\pc\pokegen\src\pokemod\itemstorage.cpp
- "ItemStorage.h"
-
-1180844756 ge.h"
-
-1180744584 source:h:\ben\programming\pc\pokegen\src\pokemod\natureeffect.cpp
- "NatureEffect.h"
-
-1180744584 source:h:\ben\programming\pc\pokegen\src\pokemod\pokemonability.cpp
- "PokemonAbility.h"
-
-1180744584 ility.h"
-
-1180967266 h:\ben\programming\pc\pokegen\src\pokemod\pokemonability.h
- "Object.h"
- "String.h"
- "Pokemod.h"
-
-1180744586 source:h:\ben\programming\pc\pokegen\src\pokemod\pokemonitem.cpp
- "PokemonItem.h"
-
-1180744586 em.h"
-
-1180967574 h:\ben\programming\pc\pokegen\src\pokemod\pokemonitem.h
- "Object.h"
- "String.h"
- "Pokemod.h"
-
-1180744586 source:h:\ben\programming\pc\pokegen\src\pokemod\pokemonmove.cpp
- "PokemonMove.h"
-
-1180744586 ve.h"
-
-1180981336 h:\ben\programming\pc\pokegen\src\pokemod\pokemonmove.h
- "Object.h"
- "String.h"
- "Pokemod.h"
-
-1180744586 source:h:\ben\programming\pc\pokegen\src\pokemod\pokemonnature.cpp
- "PokemonNature.h"
-
-1180967238 ture.h"
-
-1180981302 h:\ben\programming\pc\pokegen\src\pokemod\pokemonnature.h
- "Object.h"
- "String.h"
- "Pokemod.h"
-
-1180744586 source:h:\ben\programming\pc\pokegen\src\pokemod\store.cpp
- "Store.h"
-
-1180717534 source:f:\pokegen\src\pokemod\pokemon.cpp
- "Pokemon.h"
-
-1180967238 f:\pokegen\src\pokemod\pokemon.h
- <vector>
- <map>
- "Object.h"
- "String.h"
- "Frac.h"
- "Path.h"
- "Pokemod.h"
- "PokemonAbility.h"
- "PokemonEvolution.h"
- "PokemonItem.h"
- "PokemonMove.h"
- "PokemonNature.h"
-
-1180980116 f:\pokegen\src\pokemod\object.h
- <wx/listbox.h>
- <fstream>
- "Debug.h"
- "Ini.h"
-
-1180848064 f:\pokegen\src\pokemod\debug.h
- <ctime>
- <fstream>
- <cstdio>
- "String.h"
-
-1180717448 f:\pokegen\src\pokemod\string.h
- <cstdarg>
- <string>
- <sstream>
- <iostream>
-
-1180899300 f:\pokegen\src\pokemod\ini.h
- <map>
- <fstream>
- "String.h"
-
-1180848048 f:\pokegen\src\pokemod\frac.h
- "Debug.h"
- "Ini.h"
-
-1180847932 f:\pokegen\src\pokemod\path.h
- <string>
- <fstream>
- "String.h"
-
-1180981350 f:\pokegen\src\pokemod\pokemod.h
- <vector>
- <map>
- <sstream>
- <string>
- "pokemod_inc.h"
- "Object.h"
- "Ref.h"
- "Ability.h"
- "Author.h"
- "Badge.h"
- "CoinList.h"
- "Dialog.h"
- "EggGroup.h"
- "Ini.h"
- "Item.h"
- "ItemStorage.h"
- "Map.h"
- "Move.h"
- "Nature.h"
- "Point.h"
- "Pokemon.h"
- "Status.h"
- "Store.h"
- "String.h"
- "Tile.h"
- "Time.h"
- "Type.h"
-
-1180848102 f:\pokegen\src\pokemod\pokemod_inc.h
- "Pokemod.h"
-
-1180890016 f:\pokegen\src\pokemod\ref.h
- <vector>
- "String.h"
-
-1180980186 f:\pokegen\src\pokemod\ability.h
- <vector>
- "Object.h"
- "String.h"
- "AbilityEffect.h"
-
-1180966976 f:\pokegen\src\pokemod\abilityeffect.h
- "Object.h"
- "String.h"
- "Pokemod.h"
- "Ability.h"
- "Frac.h"
- "Type.h"
- "Ref.h"
-
-1180184954 f:\pokegen\src\pokemod\type.h
- "Object.h"
- "String.h"
-
-1180848088 f:\pokegen\src\pokemod\author.h
- "Object.h"
- "String.h"
-
-1180966996 f:\pokegen\src\pokemod\badge.h
- "Object.h"
- "String.h"
- "Ref.h"
- "Path.h"
- "Frac.h"
- "Pokemod.h"
-
-1180967010 f:\pokegen\src\pokemod\coinlist.h
- <vector>
- <map>
- "Object.h"
- "String.h"
- "Pokemod.h"
- "CoinItem.h"
-
-1180967002 f:\pokegen\src\pokemod\coinitem.h
- "Object.h"
- "String.h"
- "Pokemod.h"
-
-1180967018 f:\pokegen\src\pokemod\dialog.h
- "Object.h"
- "String.h"
- "Pokemod.h"
-
-1180848052 f:\pokegen\src\pokemod\egggroup.h
- "Object.h"
- "String.h"
-
-1180967034 f:\pokegen\src\pokemod\item.h
- <vector>
- <map>
- "Object.h"
- "String.h"
- "Pokemod.h"
- "ItemEffect.h"
-
-1180967040 f:\pokegen\src\pokemod\itemeffect.h
- "Object.h"
- "String.h"
- "Pokemod.h"
-
-1180848028 f:\pokegen\src\pokemod\itemstorage.h
- "Object.h"
- "String.h"
-
-1180980726 f:\pokegen\src\pokemod\move.h
- <vector>
- <map>
- "Object.h"
- "String.h"
- "MoveEffect.h"
-
-1180847958 f:\pokegen\src\pokemod\moveeffect.h
- "Object.h"
- "String.h"
- "Pokemod.h"
- "Frac.h"
-
-1180980782 f:\pokegen\src\pokemod\nature.h
- <vector>
- "Object.h"
- "String.h"
- "NatureEffect.h"
-
-1180967194 f:\pokegen\src\pokemod\natureeffect.h
- "Object.h"
- "String.h"
- "Frac.h"
- "Pokemod.h"
-
-1180967644 f:\pokegen\src\pokemod\store.h
- <vector>
- <map>
- "Object.h"
- "String.h"
- "Pokemod.h"
-
-1180184978 f:\pokegen\src\pokemod\time.h
- "Object.h"
- "String.h"
-
-1180967266 f:\pokegen\src\pokemod\pokemonability.h
- "Object.h"
- "String.h"
- "Pokemod.h"
-
-1180967542 f:\pokegen\src\pokemod\pokemonevolution.h
- "Object.h"
- "String.h"
- "Pokemod.h"
-
-1180967574 f:\pokegen\src\pokemod\pokemonitem.h
- "Object.h"
- "String.h"
- "Pokemod.h"
-
-1180981336 f:\pokegen\src\pokemod\pokemonmove.h
- "Object.h"
- "String.h"
- "Pokemod.h"
-
-1180981302 f:\pokegen\src\pokemod\pokemonnature.h
- "Object.h"
- "String.h"
- "Pokemod.h"
-
-1180844557 source:h:\ben\programming\pc\pokegen\src\pokemod\ability.cpp
- "Ability.h"
-
-1180967050 h:\ben\programming\pc\pokegen\src\pokemod\map.h
- <vector>
- <map>
- "Object.h"
- "String.h"
- "Matrix.h"
- "MapEffect.h"
- "MapTrainer.h"
- "MapWarp.h"
- "MapWildList.h"
-
-1180967050 st.h"
-
-1180914776 h:\ben\programming\pc\pokegen\src\pokemod\matrix.h
- <vector>
- "Point.h"
- "Frac.h"
- "Ini.h"
-
-1182102201 h:\ben\programming\pc\pokegen\src\pokemod\mapeffect.h
- "Object.h"
- "String.h"
- "Flag.h"
- "Point.h"
- "Path.h"
- "Dialog.h"
-
-1180967066 h:\ben\programming\pc\pokegen\src\pokemod\maptrainer.h
- <vector>
- <map>
- "Object.h"
- "String.h"
- "Flag.h"
- "Point.h"
- "Path.h"
- "Dialog.h"
- "MapTrainerTeam.h"
-
-1180967066 rTeam.h"
-
-1180967072 h:\ben\programming\pc\pokegen\src\pokemod\maptrainerteam.h
- "Object.h"
- "String.h"
- "Pokemod.h"
- "Pokemon.h"
- "Item.h"
-
-1180967238 h:\ben\programming\pc\pokegen\src\pokemod\pokemon.h
- <vector>
- <map>
- "Object.h"
- "String.h"
- "Frac.h"
- "Path.h"
- "Pokemod.h"
- "PokemonAbility.h"
- "PokemonEvolution.h"
- "PokemonItem.h"
- "PokemonMove.h"
- "PokemonNature.h"
-
-1180967542 h:\ben\programming\pc\pokegen\src\pokemod\pokemonevolution.h
- "Object.h"
- "String.h"
- "Pokemod.h"
-
-1180967080 h:\ben\programming\pc\pokegen\src\pokemod\mapwarp.h
- "Object.h"
- "String.h"
- "Flag.h"
- "Point.h"
- "Map.h"
- "Dialog.h"
-
-1180966964 h:\ben\programming\pc\pokegen\src\pokemod\mapwildlist.h
- <vector>
- "Object.h"
- "String.h"
- "Pokemod.h"
- "MapWildPokemon.h"
-
-1180966964 kemon.h"
-
-1180980678 h:\ben\programming\pc\pokegen\src\pokemod\mapwildpokemon.h
- "Object.h"
- "String.h"
- "Pokemod.h"
- "Pokemon.h"
-
-1180981258 h:\ben\programming\pc\pokegen\src\pokemod\status.h
- <vector>
- <map>
- "Object.h"
- "String.h"
- "Pokemod.h"
- "StatusEffect.h"
-
-1180981206 h:\ben\programming\pc\pokegen\src\pokemod\tile.h
- "Object.h"
- "String.h"
- "Pokemod.h"
-
-1180801004 h:\ben\programming\pc\pokegen\src\pokemod\statuseffect.h
- "Object.h"
- "String.h"
- "Pokemod.h"
- "Status.h"
- "Ref.h"
-
-1180801281 source:h:\ben\programming\pc\pokegen\src\pokemod\abilityeffect.cpp
- "AbilityEffect.h"
-
-1180980310 source:h:\ben\programming\pc\pokegen\src\pokemod\coinitem.cpp
- "CoinItem.h"
-
-1180980336 source:h:\ben\programming\pc\pokegen\src\pokemod\coinlist.cpp
- "CoinList.h"
-
-1180844604 source:h:\ben\programming\pc\pokegen\src\pokemod\item.cpp
- "Item.h"
-
-1180744584 source:h:\ben\programming\pc\pokegen\src\pokemod\maptrainerteam.cpp
- "MapTrainerTeam.h"
-
-1180918072 source:h:\ben\programming\pc\pokegen\src\pokemod\mapwildlist.cpp
- "MapWildList.h"
-
-1180744584 source:h:\ben\programming\pc\pokegen\src\pokemod\mapwildpokemon.cpp
- "MapWildPokemon.h"
-
-1180890178 source:h:\ben\programming\pc\pokegen\src\pokemod\nature.cpp
- "Nature.h"
-
-1180916341 source:h:\ben\programming\pc\pokegen\src\pokemod\pokemod.cpp
- "Pokemod.h"
-
-1180886988 source:h:\ben\programming\pc\pokegen\src\pokemod\pokemon.cpp
- "Pokemon.h"
-
-1180744586 source:h:\ben\programming\pc\pokegen\src\pokemod\pokemonevolution.cpp
- "PokemonEvolution.h"
-
-1180744586 olution.h"
-
-1180890334 source:h:\ben\programming\pc\pokegen\src\pokemod\status.cpp
- "Status.h"
-
-1180847656 source:h:\ben\programming\pc\pokegen\src\pokemod\tile.cpp
- "Tile.h"
-
-1182100473 source:h:\ben\programming\pc\pokegen\src\pokemod\map.cpp
- "Map.h"
-
-1180980900 source:f:\pokegen\src\pokemod\pokemod.cpp
- "Pokemod.h"
-
-1180967050 f:\pokegen\src\pokemod\map.h
- <vector>
- <map>
- "Object.h"
- "String.h"
- "Matrix.h"
- "MapEffect.h"
- "MapTrainer.h"
- "MapWarp.h"
- "MapWildList.h"
-
-1180914776 f:\pokegen\src\pokemod\matrix.h
- <vector>
- "Point.h"
- "Frac.h"
- "Ini.h"
-
-1180901382 f:\pokegen\src\pokemod\point.h
- "Debug.h"
- "Ini.h"
-
-1180967056 f:\pokegen\src\pokemod\mapeffect.h
- "Object.h"
- "String.h"
- "Flag.h"
- "Point.h"
- "Path.h"
- "Dialog.h"
-
-1180848044 f:\pokegen\src\pokemod\flag.h
- "Debug.h"
- "Ini.h"
- "Ref.h"
-
-1180967066 f:\pokegen\src\pokemod\maptrainer.h
- <vector>
- <map>
- "Object.h"
- "String.h"
- "Flag.h"
- "Point.h"
- "Path.h"
- "Dialog.h"
- "MapTrainerTeam.h"
-
-1180967072 f:\pokegen\src\pokemod\maptrainerteam.h
- "Object.h"
- "String.h"
- "Pokemod.h"
- "Pokemon.h"
- "Item.h"
-
-1180967080 f:\pokegen\src\pokemod\mapwarp.h
- "Object.h"
- "String.h"
- "Flag.h"
- "Point.h"
- "Map.h"
- "Dialog.h"
-
-1180966964 f:\pokegen\src\pokemod\mapwildlist.h
- <vector>
- "Object.h"
- "String.h"
- "Pokemod.h"
- "MapWildPokemon.h"
-
-1180980678 f:\pokegen\src\pokemod\mapwildpokemon.h
- "Object.h"
- "String.h"
- "Pokemod.h"
- "Pokemon.h"
-
-1180981258 f:\pokegen\src\pokemod\status.h
- <vector>
- <map>
- "Object.h"
- "String.h"
- "Pokemod.h"
- "StatusEffect.h"
-
-1180801004 f:\pokegen\src\pokemod\statuseffect.h
- "Object.h"
- "String.h"
- "Pokemod.h"
- "Status.h"
- "Ref.h"
-
-1180981206 f:\pokegen\src\pokemod\tile.h
- "Object.h"
- "String.h"
- "Pokemod.h"
-
-1183489905 source:/home/Ben/pokegen/src/pokemod/Ability.cpp
- "Ability.h"
-
-1183490004 /home/Ben/pokegen/src/pokemod/Ability.h
- <QFile>
- <QList>
- <QString>
- "Object.h"
- "AbilityEffect.h"
-
-1183428349 /home/Ben/pokegen/src/pokemod/Object.h
- <fstream>
- "Debug.h"
- "Ini.h"
-
-1183493996 /home/Ben/pokegen/src/pokemod/Debug.h
- <QDate>
- <QFile>
- <QString>
- <QTextStream>
- <QTime>
- <iostream>
- "pokemod_def.h"
-
-1183319804 /home/Ben/pokegen/src/pokemod/String.h
- <cstdarg>
- <string>
- <sstream>
- <iostream>
-
-1183488089 /home/Ben/pokegen/src/pokemod/Ini.h
- <QFile>
- <QMap>
- <QString>
- <QTextStream>
-
-1183490001 /home/Ben/pokegen/src/pokemod/AbilityEffect.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Ability.h"
- "Frac.h"
- "Type.h"
- "Ref.h"
-
-1183490415 /home/Ben/pokegen/src/pokemod/Pokemod.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- <QTextStream>
- "pokemod_inc.h"
- "Object.h"
- "Frac.h"
- "Ini.h"
- "Path.h"
- "Point.h"
- "Ref.h"
- "Ability.h"
- "Author.h"
- "Badge.h"
- "CoinList.h"
- "Dialog.h"
- "EggGroup.h"
- "Item.h"
- "ItemStorage.h"
- "Map.h"
- "Move.h"
- "Nature.h"
- "Pokemon.h"
- "Status.h"
- "Store.h"
- "Tile.h"
- "Time.h"
- "Type.h"
-
-1183493403 /home/Ben/pokegen/src/pokemod/pokemod_inc.h
- "pokemod_def.h"
- "Object.h"
- "Pokemod.h"
-
-1183523132 /home/Ben/pokegen/src/pokemod/Frac.h
- <QFile>
- <QString>
- "Debug.h"
- "Ini.h"
- "Ref.h"
-
-1183494533 /home/Ben/pokegen/src/pokemod/Path.h
- <QFile>
- <QString>
- "pokemod_def.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/Point.h
- <QFile>
- "Debug.h"
- "Ini.h"
-
-1183523159 /home/Ben/pokegen/src/pokemod/Ref.h
- <QString>
-
-1183490008 /home/Ben/pokegen/src/pokemod/Author.h
- <QFile>
- <QRegExp>
- <QString>
- "Object.h"
-
-1183490037 /home/Ben/pokegen/src/pokemod/Badge.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Frac.h"
- "Ref.h"
- "Path.h"
-
-1183490091 /home/Ben/pokegen/src/pokemod/CoinList.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "Pokemod.h"
- "CoinItem.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/CoinItem.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1183490119 /home/Ben/pokegen/src/pokemod/Dialog.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Path.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/EggGroup.h
- <QFile>
- <QString>
- "Object.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/Item.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "Pokemod.h"
- "ItemEffect.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/ItemEffect.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1183490176 /home/Ben/pokegen/src/pokemod/ItemStorage.h
- <QFile>
- <QString>
- "Object.h"
-
-1183490200 /home/Ben/pokegen/src/pokemod/Map.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "Matrix.h"
- "MapEffect.h"
- "MapTrainer.h"
- "MapWarp.h"
- "MapWildList.h"
-
-1183523260 /home/Ben/pokegen/src/pokemod/Matrix.h
- <QFile>
- <QVector>
- "Debug.h"
- "Ini.h"
- "Frac.h"
- "Point.h"
-
-1183490224 /home/Ben/pokegen/src/pokemod/MapEffect.h
- <QFile>
- <QString>
- "Object.h"
- "Flag.h"
- "Path.h"
- "Point.h"
- "Dialog.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/Flag.h
- <QFile>
- <QString>
- "Debug.h"
- "Ini.h"
- "Ref.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/MapTrainer.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "Flag.h"
- "Path.h"
- "Point.h"
- "Dialog.h"
- "MapTrainerTeam.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/MapTrainerTeam.h
- <QFile>
- <QList>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Item.h"
- "Pokemon.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/Pokemon.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "Frac.h"
- "Path.h"
- "Pokemod.h"
- "PokemonAbility.h"
- "PokemonEvolution.h"
- "PokemonItem.h"
- "PokemonMove.h"
- "PokemonNature.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/PokemonAbility.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/PokemonEvolution.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/PokemonItem.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/PokemonMove.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/PokemonNature.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1183490304 /home/Ben/pokegen/src/pokemod/MapWarp.h
- <QFile>
- <QString>
- "Object.h"
- "Flag.h"
- "Point.h"
- "Dialog.h"
- "Map.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/MapWildList.h
- <QFile>
- <QList>
- <QString>
- "Object.h"
- "Pokemod.h"
- "MapWildPokemon.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/MapWildPokemon.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Pokemon.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/Move.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "MoveEffect.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/MoveEffect.h
- <QFile>
- <QString>
- "Object.h"
- "Frac.h"
- "Pokemod.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/Nature.h
- <QFile>
- <QString>
- "Object.h"
- "Frac.h"
- "Ref.h"
-
-1183085670 /home/Ben/pokegen/src/pokemod/NatureEffect.h
- "Object.h"
- "String.h"
- "Frac.h"
- "Pokemod.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/Status.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "Pokemod.h"
- "StatusEffect.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/StatusEffect.h
- <QFile>
- <QString>
- "Object.h"
- "Ref.h"
- "Pokemod.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/Store.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1183515363 /home/Ben/pokegen/src/pokemod/Tile.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1183490540 /home/Ben/pokegen/src/pokemod/Time.h
- <QFile>
- <QString>
- "Object.h"
-
-1183490537 /home/Ben/pokegen/src/pokemod/Type.h
- <QFile>
- <QString>
- "Object.h"
- "Frac.h"
-
-1183489459 source:/home/Ben/pokegen/src/pokemod/AbilityEffect.cpp
- "AbilityEffect.h"
-
-1183489460 source:/home/Ben/pokegen/src/pokemod/Author.cpp
- "Author.h"
-
-1183489457 source:/home/Ben/pokegen/src/pokemod/Badge.cpp
- "Badge.h"
-
-1183489460 source:/home/Ben/pokegen/src/pokemod/CoinItem.cpp
- "CoinItem.h"
-
-1183489904 source:/home/Ben/pokegen/src/pokemod/CoinList.cpp
- "CoinList.h"
-
-1183494378 source:/home/Ben/pokegen/src/pokemod/Debug.cpp
- "Debug.h"
-
-1183489457 source:/home/Ben/pokegen/src/pokemod/Dialog.cpp
- "Dialog.h"
-
-1183489457 source:/home/Ben/pokegen/src/pokemod/EggGroup.cpp
- "EggGroup.h"
-
-1183523202 source:/home/Ben/pokegen/src/pokemod/Frac.cpp
- "Frac.h"
-
-1183488353 source:/home/Ben/pokegen/src/pokemod/Ini.cpp
- "Ini.h"
-
-1183085682 source:/home/Ben/pokegen/src/pokemod/Object.cpp
- "Object.h"
-
-1183145100 source:/home/Ben/pokegen/src/pokemod/Path.cpp
- "Path.h"
-
-1183444079 source:/home/Ben/pokegen/src/pokemod/Ref.cpp
- "Ref.h"
-
-1183319790 source:/home/Ben/pokegen/src/pokemod/String.cpp
- "String.h"
-
-1183489459 source:/home/Ben/pokegen/src/pokemod/Type.cpp
- "Type.h"
-
-1183489457 source:/home/Ben/pokegen/src/pokemod/Flag.cpp
- "Flag.h"
-
-1183489904 source:/home/Ben/pokegen/src/pokemod/Item.cpp
- "Item.h"
-
-1183269494 /home/Ben/pokegen/src/pokemod/DebugWindow.h
- <fstream>
- <wx/notebook.h>
- <wx/dialog.h>
- <wx/button.h>
- <wx/panel.h>
- <wx/listbox.h>
- <wx/filedlg.h>
- "pokemod_inc.h"
-
-1183269088 source:/home/Ben/pokegen/src/pokemod/DebugWindow.cpp
- "DebugWindow.h"
- "wx/wxprec.h"
- "wx/wx.h"
-
-1183138748 source:/home/Ben/pokegen/src/pokemod/MapWarp.cpp
- "MapWarp.h"
-
-1183137953 source:/home/Ben/pokegen/src/pokemod/Pokemod.cpp
- "Pokemod.h"
-
-1183138506 source:/home/Ben/pokegen/src/pokemod/Tile.cpp
- "Tile.h"
-
-1183493393 /home/Ben/pokegen/src/pokemod/pokemod_def.h
-
-1185321873 source:/home/Ben/pokegen/src/ai/Layer.cpp
- "Layer.h"
-
-1185321526 /home/Ben/pokegen/src/ai/Layer.h
- <QFile>
- <QList>
- <QString>
- <QTextStream>
- <QVector>
- <cstdlib>
- <cmath>
- "enum/Function.h"
-
-1185321016 /home/Ben/pokegen/src/ai/enum/Function.h
- "../../EnumClass.h"
-
-1185320108 /home/Ben/pokegen/src/EnumClass.h
-
-1185319436 source:/home/Ben/pokegen/src/ai/Net.cpp
- "Net.h"
-
-1185321931 /home/Ben/pokegen/src/ai/Net.h
- <QFile>
- <QList>
- <QMutableListIterator>
- <float.h>
- "Layer.h"
-
-1189834120 source:/mnt/ben/Programming/PC/pokegen/src/Ini.cpp
- "Ini.h"
-
-1189834058 /mnt/ben/Programming/PC/pokegen/src/Ini.h
- <QFile>
- <QMap>
- <QString>
- <QTextStream>
-
-1189882628 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/Ability.cpp
- "Ability.h"
-
-1189874508 /mnt/ben/Programming/PC/pokegen/src/pokemod/Ability.h
- <QFile>
- <QList>
- <QString>
- "Object.h"
- "AbilityEffect.h"
-
-1189878236 /mnt/ben/Programming/PC/pokegen/src/pokemod/Object.h
- <fstream>
- "../Ini.h"
-
-1189226268 /mnt/ben/Programming/PC/pokegen/src/pokemod/Debug.h
- <QDate>
- <QFile>
- <QString>
- <QTextStream>
- <QTime>
- <iostream>
- "pokemod_def.h"
-
-1184874902 /mnt/ben/Programming/PC/pokegen/src/pokemod/pokemod_def.h
-
-1190174753 /mnt/ben/Programming/PC/pokegen/src/pokemod/AbilityEffect.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Ability.h"
- "Frac.h"
- "Type.h"
- "Ref.h"
-
-1189882620 /mnt/ben/Programming/PC/pokegen/src/pokemod/Pokemod.h
- <QFile>
- <QIODevice>
- <QList>
- <QMap>
- <QString>
- <QStringList>
- "pokemod_inc.h"
- "Object.h"
- "Frac.h"
- "Path.h"
- "Ref.h"
- "Ability.h"
- "Author.h"
- "Badge.h"
- "CoinList.h"
- "Dialog.h"
- "EggGroup.h"
- "Item.h"
- "ItemType.h"
- "Map.h"
- "Move.h"
- "Nature.h"
- "Pokemon.h"
- "Status.h"
- "Store.h"
- "Tile.h"
- "Time.h"
- "Type.h"
-
-1189796216 /mnt/ben/Programming/PC/pokegen/src/pokemod/pokemod_inc.h
- "pokemod_def.h"
- "Object.h"
- "Pokemod.h"
-
-1189877746 /mnt/ben/Programming/PC/pokegen/src/pokemod/Frac.h
- <QFile>
- <QString>
- "../Ini.h"
- "Ref.h"
-
-1190174604 /mnt/ben/Programming/PC/pokegen/src/pokemod/Ref.h
- <QString>
-
-1189794084 /mnt/ben/Programming/PC/pokegen/src/pokemod/Path.h
- <QFile>
- <QString>
- "pokemod_def.h"
-
-1189877790 /mnt/ben/Programming/PC/pokegen/src/pokemod/Point.h
- <QFile>
- "../Ini.h"
-
-1189225814 /mnt/ben/Programming/PC/pokegen/src/pokemod/Author.h
- <QFile>
- <QRegExp>
- <QString>
- "Object.h"
-
-1190174684 /mnt/ben/Programming/PC/pokegen/src/pokemod/Badge.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Frac.h"
- "Ref.h"
- "Path.h"
-
-1189227024 /mnt/ben/Programming/PC/pokegen/src/pokemod/CoinList.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "Pokemod.h"
- "CoinListItem.h"
-
-1189225803 /mnt/ben/Programming/PC/pokegen/src/pokemod/CoinItem.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1190174234 /mnt/ben/Programming/PC/pokegen/src/pokemod/Dialog.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Path.h"
- "Item.h"
- "ItemEffect.h"
- "Map.h"
- "MapEffect.h"
- "MapTrainer.h"
- "MapWarp.h"
- "Move.h"
- "Pokemon.h"
-
-1189225754 /mnt/ben/Programming/PC/pokegen/src/pokemod/EggGroup.h
- <QFile>
- <QString>
- "Object.h"
-
-1189225734 /mnt/ben/Programming/PC/pokegen/src/pokemod/Item.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "Pokemod.h"
- "ItemEffect.h"
-
-1190174719 /mnt/ben/Programming/PC/pokegen/src/pokemod/ItemEffect.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1188784704 /mnt/ben/Programming/PC/pokegen/src/pokemod/ItemStorage.h
- <QFile>
- <QString>
- "Object.h"
-
-1189876096 /mnt/ben/Programming/PC/pokegen/src/pokemod/Map.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "Matrix.h"
- "MapEffect.h"
- "MapTrainer.h"
- "MapWarp.h"
- "MapWildList.h"
-
-1189877868 /mnt/ben/Programming/PC/pokegen/src/pokemod/Matrix.h
- <QFile>
- <QVector>
- "../Ini.h"
- "Frac.h"
- "Point.h"
-
-1189875026 /mnt/ben/Programming/PC/pokegen/src/pokemod/MapEffect.h
- <QFile>
- <QString>
- "Object.h"
- "Flag.h"
- "Path.h"
- "Point.h"
- "Dialog.h"
-
-1189877880 /mnt/ben/Programming/PC/pokegen/src/pokemod/Flag.h
- <QFile>
- <QString>
- "../Ini.h"
- "Ref.h"
-
-1189747168 /mnt/ben/Programming/PC/pokegen/src/pokemod/MapTrainer.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "Flag.h"
- "Path.h"
- "Point.h"
- "Dialog.h"
- "MapTrainerPokemon.h"
-
-1189225626 /mnt/ben/Programming/PC/pokegen/src/pokemod/MapTrainerTeam.h
- <QFile>
- <QList>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Item.h"
- "Pokemon.h"
-
-1189876152 /mnt/ben/Programming/PC/pokegen/src/pokemod/Pokemon.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "Frac.h"
- "Path.h"
- "Pokemod.h"
- "PokemonAbility.h"
- "PokemonEvolution.h"
- "PokemonItem.h"
- "PokemonMove.h"
- "PokemonNature.h"
-
-1189225018 /mnt/ben/Programming/PC/pokegen/src/pokemod/PokemonAbility.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1189876980 /mnt/ben/Programming/PC/pokegen/src/pokemod/PokemonEvolution.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1189225002 /mnt/ben/Programming/PC/pokegen/src/pokemod/PokemonItem.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1189224994 /mnt/ben/Programming/PC/pokegen/src/pokemod/PokemonMove.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1189224986 /mnt/ben/Programming/PC/pokegen/src/pokemod/PokemonNature.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1189875464 /mnt/ben/Programming/PC/pokegen/src/pokemod/MapWarp.h
- <QFile>
- <QString>
- "Object.h"
- "Flag.h"
- "Point.h"
- "Dialog.h"
- "Map.h"
-
-1190174131 /mnt/ben/Programming/PC/pokegen/src/pokemod/MapWildList.h
- <QFile>
- <QList>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Item.h"
- "ItemEffect.h"
- "MapWildListPokemon.h"
-
-1189225581 /mnt/ben/Programming/PC/pokegen/src/pokemod/MapWildPokemon.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Pokemon.h"
-
-1189876290 /mnt/ben/Programming/PC/pokegen/src/pokemod/Move.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "MoveEffect.h"
-
-1190174653 /mnt/ben/Programming/PC/pokegen/src/pokemod/MoveEffect.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Frac.h"
- "Ref.h"
-
-1189794030 /mnt/ben/Programming/PC/pokegen/src/pokemod/Nature.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Frac.h"
- "Ref.h"
-
-1189843606 /mnt/ben/Programming/PC/pokegen/src/pokemod/Status.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "Pokemod.h"
- "StatusEffect.h"
-
-1189843886 /mnt/ben/Programming/PC/pokegen/src/pokemod/StatusEffect.h
- <QFile>
- <QString>
- "Object.h"
- "Ref.h"
- "Pokemod.h"
-
-1189844318 /mnt/ben/Programming/PC/pokegen/src/pokemod/Store.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1189875342 /mnt/ben/Programming/PC/pokegen/src/pokemod/Tile.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1189844730 /mnt/ben/Programming/PC/pokegen/src/pokemod/Time.h
- <QFile>
- <QString>
- "Object.h"
-
-1189844806 /mnt/ben/Programming/PC/pokegen/src/pokemod/Type.h
- <QFile>
- <QString>
- "Object.h"
- "Frac.h"
-
-1189875523 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/AbilityEffect.cpp
- "AbilityEffect.h"
-
-1189225818 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/Author.cpp
- "Author.h"
-
-1189797560 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/Badge.cpp
- "Badge.h"
-
-1189225806 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/CoinItem.cpp
- "CoinItem.h"
-
-1189876319 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/CoinList.cpp
- "CoinList.h"
-
-1189225764 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/Debug.cpp
- "Debug.h"
-
-1189875783 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/Dialog.cpp
- "Dialog.h"
-
-1189225756 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/EggGroup.cpp
- "EggGroup.h"
-
-1189794721 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/Flag.cpp
- "Flag.h"
-
-1189798098 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/Frac.cpp
- "Frac.h"
-
-1189226864 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/Item.cpp
- "Item.h"
-
-1189787936 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/ItemEffect.cpp
- "ItemEffect.h"
-
-1189225718 /mnt/ben/Programming/PC/pokegen/src/pokemod/ItemType.h
- <QFile>
- <QString>
- "Object.h"
-
-1189795420 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/ItemType.cpp
- "ItemType.h"
-
-1189876208 /mnt/ben/Programming/PC/pokegen/src/pokemod/CoinListItem.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1189887992 /mnt/ben/Programming/PC/pokegen/src/pokemod/MapTrainerPokemon.h
- <QFile>
- <QList>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Item.h"
- "Pokemon.h"
-
-1189227300 /mnt/ben/Programming/PC/pokegen/src/pokemod/MapWildListPokemon.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Pokemon.h"
-
-1189876374 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/CoinListItem.cpp
- "CoinListItem.h"
-
-1189876402 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/Map.cpp
- "Map.h"
-
-1189875869 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/MapEffect.cpp
- "MapEffect.h"
-
-1189794776 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/MapTrainer.cpp
- "MapTrainer.h"
-
-1189795463 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/MapTrainerPokemon.cpp
- "MapTrainerPokemon.h"
-
-1189875892 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/MapWarp.cpp
- "MapWarp.h"
-
-1189875915 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/MapWildList.cpp
- "MapWildList.h"
-
-1189795450 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/MapWildListPokemon.cpp
- "MapWildListPokemon.h"
-
-1189876447 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/Move.cpp
- "Move.h"
-
-1189793626 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/MoveEffect.cpp
- "MoveEffect.h"
-
-1189796818 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/Nature.cpp
- "Nature.h"
-
-1189794224 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/Path.cpp
- "Path.h"
-
-1189794210 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/Point.cpp
- "Point.h"
-
-1189844707 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/Pokemod.cpp
- "Pokemod.h"
-
-1189876497 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/Pokemon.cpp
- "Pokemon.h"
-
-1189842895 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/PokemonAbility.cpp
- "PokemonAbility.h"
-
-1189842960 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/PokemonEvolution.cpp
- "PokemonEvolution.h"
-
-1189843044 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/PokemonItem.cpp
- "PokemonItem.h"
-
-1189843147 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/PokemonMove.cpp
- "PokemonMove.h"
-
-1189843230 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/PokemonNature.cpp
- "PokemonNature.h"
-
-1189843252 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/Ref.cpp
- "Ref.h"
-
-1189843672 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/Status.cpp
- "Status.h"
-
-1189844320 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/Store.cpp
- "Store.h"
-
-1189844649 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/Tile.cpp
- "Tile.h"
-
-1189844783 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/Time.cpp
- "Time.h"
-
-1189844860 source:/mnt/ben/Programming/PC/pokegen/src/pokemod/Type.cpp
- "Type.h"
-
-1189834120 source:/mnt/storage/programming/pc/pokegen/src/Ini.cpp
- "Ini.h"
-
-1189834058 /mnt/storage/programming/pc/pokegen/src/Ini.h
- <QFile>
- <QMap>
- <QString>
- <QTextStream>
-
-1190340160 source:/mnt/storage/programming/pc/pokegen/src/pokemod/Ability.cpp
- "Ability.h"
-
-1190340154 /mnt/storage/programming/pc/pokegen/src/pokemod/Ability.h
- <QFile>
- <QList>
- <QString>
- "Object.h"
- "AbilityEffect.h"
-
-1190340708 /mnt/storage/programming/pc/pokegen/src/pokemod/Object.h
- <fstream>
- "../Ini.h"
-
-1190347849 /mnt/storage/programming/pc/pokegen/src/pokemod/AbilityEffect.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Ability.h"
- "Frac.h"
- "Type.h"
- "Ref.h"
-
-1190350562 /mnt/storage/programming/pc/pokegen/src/pokemod/Pokemod.h
- <QFile>
- <QIODevice>
- <QList>
- <QMap>
- <QString>
- <QStringList>
- "pokemod_inc.h"
- "Object.h"
- "Frac.h"
- "Ref.h"
- "Ability.h"
- "Author.h"
- "Badge.h"
- "CoinList.h"
- "Dialog.h"
- "EggGroup.h"
- "Item.h"
- "ItemType.h"
- "Map.h"
- "Move.h"
- "Nature.h"
- "Pokemon.h"
- "Status.h"
- "Store.h"
- "Tile.h"
- "Time.h"
- "Type.h"
-
-1190312081 /mnt/storage/programming/pc/pokegen/src/pokemod/pokemod_inc.h
- "pokemod_def.h"
- "Object.h"
- "Pokemod.h"
-
-1184874902 /mnt/storage/programming/pc/pokegen/src/pokemod/pokemod_def.h
-
-1190338992 /mnt/storage/programming/pc/pokegen/src/pokemod/Frac.h
- <QFile>
- <QString>
- "../Ini.h"
- "Ref.h"
-
-1190174604 /mnt/storage/programming/pc/pokegen/src/pokemod/Ref.h
- <QString>
-
-1189794084 /mnt/storage/programming/pc/pokegen/src/pokemod/Path.h
- <QFile>
- <QString>
- "pokemod_def.h"
-
-1190340192 /mnt/storage/programming/pc/pokegen/src/pokemod/Author.h
- <QFile>
- <QRegExp>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1190340209 /mnt/storage/programming/pc/pokegen/src/pokemod/Badge.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Frac.h"
- "Ref.h"
-
-1190340265 /mnt/storage/programming/pc/pokegen/src/pokemod/CoinList.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "Pokemod.h"
- "CoinListObject.h"
- "Item.h"
- "ItemEffect.h"
-
-1189876208 /mnt/storage/programming/pc/pokegen/src/pokemod/CoinListItem.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1190340857 /mnt/storage/programming/pc/pokegen/src/pokemod/Dialog.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Item.h"
- "ItemEffect.h"
- "Map.h"
- "MapEffect.h"
- "MapTrainer.h"
- "MapWarp.h"
- "Move.h"
- "Pokemon.h"
-
-1190340959 /mnt/storage/programming/pc/pokegen/src/pokemod/Item.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "Pokemod.h"
- "ItemEffect.h"
-
-1190347891 /mnt/storage/programming/pc/pokegen/src/pokemod/ItemEffect.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1190350240 /mnt/storage/programming/pc/pokegen/src/pokemod/Map.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "Matrix.h"
- "MapEffect.h"
- "MapTrainer.h"
- "MapWarp.h"
- "MapWildList.h"
-
-1189877868 /mnt/storage/programming/pc/pokegen/src/pokemod/Matrix.h
- <QFile>
- <QVector>
- "../Ini.h"
- "Frac.h"
- "Point.h"
-
-1189877790 /mnt/storage/programming/pc/pokegen/src/pokemod/Point.h
- <QFile>
- "../Ini.h"
-
-1190348008 /mnt/storage/programming/pc/pokegen/src/pokemod/MapEffect.h
- <QFile>
- <QString>
- "Object.h"
- "Flag.h"
- "Point.h"
- "Dialog.h"
-
-1190340326 /mnt/storage/programming/pc/pokegen/src/pokemod/Flag.h
- <QFile>
- <QString>
- "../Ini.h"
- "Ref.h"
-
-1190348299 /mnt/storage/programming/pc/pokegen/src/pokemod/MapTrainer.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "Flag.h"
- "Point.h"
- "Dialog.h"
- "MapTrainerPokemon.h"
-
-1190340509 /mnt/storage/programming/pc/pokegen/src/pokemod/MapTrainerPokemon.h
- <QFile>
- <QList>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Item.h"
- "Pokemon.h"
-
-1190350930 /mnt/storage/programming/pc/pokegen/src/pokemod/Pokemon.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "Frac.h"
- "Pokemod.h"
- "PokemonAbility.h"
- "PokemonEvolution.h"
- "PokemonItem.h"
- "PokemonMove.h"
- "PokemonNature.h"
-
-1190340624 /mnt/storage/programming/pc/pokegen/src/pokemod/PokemonAbility.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1190340636 /mnt/storage/programming/pc/pokegen/src/pokemod/PokemonEvolution.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1190340641 /mnt/storage/programming/pc/pokegen/src/pokemod/PokemonItem.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1190340645 /mnt/storage/programming/pc/pokegen/src/pokemod/PokemonMove.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1190340651 /mnt/storage/programming/pc/pokegen/src/pokemod/PokemonNature.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1190348504 /mnt/storage/programming/pc/pokegen/src/pokemod/MapWarp.h
- <QFile>
- <QString>
- "Object.h"
- "Flag.h"
- "Point.h"
- "Dialog.h"
- "Map.h"
-
-1190340558 /mnt/storage/programming/pc/pokegen/src/pokemod/MapWildList.h
- <QFile>
- <QList>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Item.h"
- "ItemEffect.h"
- "MapWildListPokemon.h"
-
-1190348669 /mnt/storage/programming/pc/pokegen/src/pokemod/MapWildListPokemon.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Pokemon.h"
-
-1190350311 /mnt/storage/programming/pc/pokegen/src/pokemod/Move.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "MoveEffect.h"
-
-1190340591 /mnt/storage/programming/pc/pokegen/src/pokemod/MoveEffect.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Frac.h"
- "Ref.h"
-
-1190340875 /mnt/storage/programming/pc/pokegen/src/pokemod/EggGroup.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1190341297 /mnt/storage/programming/pc/pokegen/src/pokemod/ItemType.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1190348925 /mnt/storage/programming/pc/pokegen/src/pokemod/Nature.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Frac.h"
- "Ref.h"
-
-1190351304 /mnt/storage/programming/pc/pokegen/src/pokemod/Status.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "Pokemod.h"
- "StatusEffect.h"
-
-1190340658 /mnt/storage/programming/pc/pokegen/src/pokemod/StatusEffect.h
- <QFile>
- <QString>
- "Object.h"
- "Ref.h"
- "Pokemod.h"
-
-1190351413 /mnt/storage/programming/pc/pokegen/src/pokemod/Store.h
- <QFile>
- <QList>
- <QMap>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1190351564 /mnt/storage/programming/pc/pokegen/src/pokemod/Tile.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1190351740 /mnt/storage/programming/pc/pokegen/src/pokemod/Time.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1190351849 /mnt/storage/programming/pc/pokegen/src/pokemod/Type.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
- "Frac.h"
-
-1189794224 source:/mnt/storage/programming/pc/pokegen/src/pokemod/Path.cpp
- "Path.h"
-
-1189843252 source:/mnt/storage/programming/pc/pokegen/src/pokemod/Ref.cpp
- "Ref.h"
-
-1190349184 source:/mnt/storage/programming/pc/pokegen/src/pokemod/AbilityEffect.cpp
- "AbilityEffect.h"
-
-1190340198 source:/mnt/storage/programming/pc/pokegen/src/pokemod/Author.cpp
- "Author.h"
-
-1190383448 source:/mnt/storage/programming/pc/pokegen/src/pokemod/Badge.cpp
- "Badge.h"
-
-1190340822 /mnt/storage/programming/pc/pokegen/src/pokemod/CoinListObject.h
- <QFile>
- <QString>
- "Object.h"
- "Pokemod.h"
-
-1190340739 source:/mnt/storage/programming/pc/pokegen/src/pokemod/CoinList.cpp
- "CoinList.h"
-
-1190349303 source:/mnt/storage/programming/pc/pokegen/src/pokemod/CoinListObject.cpp
- "CoinListObject.h"
-
-1190340290 source:/mnt/storage/programming/pc/pokegen/src/pokemod/Dialog.cpp
- "Dialog.h"
-
-1190340307 source:/mnt/storage/programming/pc/pokegen/src/pokemod/EggGroup.cpp
- "EggGroup.h"
-
-1190340320 source:/mnt/storage/programming/pc/pokegen/src/pokemod/Flag.cpp
- "Flag.h"
-
-1190349359 source:/mnt/storage/programming/pc/pokegen/src/pokemod/Frac.cpp
- "Frac.h"
-
-1190340960 source:/mnt/storage/programming/pc/pokegen/src/pokemod/Item.cpp
- "Item.h"
-
-1190349431 source:/mnt/storage/programming/pc/pokegen/src/pokemod/ItemEffect.cpp
- "ItemEffect.h"
-
-1190349426 source:/mnt/storage/programming/pc/pokegen/src/pokemod/ItemType.cpp
- "ItemType.h"
-
-1190350229 source:/mnt/storage/programming/pc/pokegen/src/pokemod/Map.cpp
- "Map.h"
-
-1190384264 source:/mnt/storage/programming/pc/pokegen/src/pokemod/MapEffect.cpp
- "MapEffect.h"
-
-1190384293 source:/mnt/storage/programming/pc/pokegen/src/pokemod/MapTrainer.cpp
- "MapTrainer.h"
-
-1190349628 source:/mnt/storage/programming/pc/pokegen/src/pokemod/MapTrainerPokemon.cpp
- "MapTrainerPokemon.h"
-
-1190349685 source:/mnt/storage/programming/pc/pokegen/src/pokemod/MapWarp.cpp
- "MapWarp.h"
-
-1190349772 source:/mnt/storage/programming/pc/pokegen/src/pokemod/MapWildList.cpp
- "MapWildList.h"
-
-1190348658 source:/mnt/storage/programming/pc/pokegen/src/pokemod/MapWildListPokemon.cpp
- "MapWildListPokemon.h"
-
-1190350336 source:/mnt/storage/programming/pc/pokegen/src/pokemod/Move.cpp
- "Move.h"
-
-1190349912 source:/mnt/storage/programming/pc/pokegen/src/pokemod/MoveEffect.cpp
- "MoveEffect.h"
-
-1190348978 source:/mnt/storage/programming/pc/pokegen/src/pokemod/Nature.cpp
- "Nature.h"
-
-1189886658 source:/mnt/storage/programming/pc/pokegen/src/pokemod/Point.cpp
- "Point.h"
-
-1190383338 source:/mnt/storage/programming/pc/pokegen/src/pokemod/Pokemod.cpp
- "Pokemod.h"
-
-1190351001 source:/mnt/storage/programming/pc/pokegen/src/pokemod/PokemonAbility.cpp
- "PokemonAbility.h"
-
-1190383600 source:/mnt/storage/programming/pc/pokegen/src/pokemod/Pokemon.cpp
- "Pokemon.h"
-
-1190351068 source:/mnt/storage/programming/pc/pokegen/src/pokemod/PokemonEvolution.cpp
- "PokemonEvolution.h"
-
-1190351119 source:/mnt/storage/programming/pc/pokegen/src/pokemod/PokemonItem.cpp
- "PokemonItem.h"
-
-1190351155 source:/mnt/storage/programming/pc/pokegen/src/pokemod/PokemonMove.cpp
- "PokemonMove.h"
-
-1190351196 source:/mnt/storage/programming/pc/pokegen/src/pokemod/PokemonNature.cpp
- "PokemonNature.h"
-
-1190351251 source:/mnt/storage/programming/pc/pokegen/src/pokemod/Status.cpp
- "Status.h"
-
-1190351396 source:/mnt/storage/programming/pc/pokegen/src/pokemod/StatusEffect.cpp
- "StatusEffect.h"
-
-1190351415 source:/mnt/storage/programming/pc/pokegen/src/pokemod/Store.cpp
- "Store.h"
-
-1190384310 source:/mnt/storage/programming/pc/pokegen/src/pokemod/Tile.cpp
- "Tile.h"
-
-1190351726 source:/mnt/storage/programming/pc/pokegen/src/pokemod/Time.cpp
- "Time.h"
-
-1190351835 source:/mnt/storage/programming/pc/pokegen/src/pokemod/Type.cpp
- "Type.h"
-
diff --git a/pokegen.layout b/pokegen.layout
deleted file mode 100644
index 0b512cf5..00000000
--- a/pokegen.layout
+++ /dev/null
@@ -1,265 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<CodeBlocks_layout_file>
- <ActiveTarget name="pokemod" />
- <File name="Changelog" open="1" top="1" tabpos="1">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="Hat.h" open="0" top="0" tabpos="4">
- <Cursor position="2010" topLine="11" />
- </File>
- <File name="ai/Layer.cpp" open="0" top="0" tabpos="4">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="ai/Layer.h" open="0" top="0" tabpos="3">
- <Cursor position="2659" topLine="25" />
- </File>
- <File name="ai/Net.cpp" open="0" top="0" tabpos="6">
- <Cursor position="1611" topLine="21" />
- </File>
- <File name="ai/Net.h" open="0" top="0" tabpos="5">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="ai/ai.pro" open="0" top="0" tabpos="0">
- <Cursor position="94" topLine="0" />
- </File>
- <File name="pokemod/Ability.cpp" open="0" top="0" tabpos="2">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Ability.h" open="0" top="0" tabpos="3">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/AbilityEffect.cpp" open="0" top="0" tabpos="5">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/AbilityEffect.h" open="0" top="0" tabpos="15">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Author.cpp" open="0" top="0" tabpos="4">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Author.h" open="0" top="0" tabpos="5">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Badge.cpp" open="0" top="0" tabpos="4">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Badge.h" open="0" top="0" tabpos="7">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/CoinList.cpp" open="0" top="0" tabpos="4">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/CoinList.h" open="0" top="0" tabpos="7">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/CoinListObject.cpp" open="0" top="0" tabpos="6">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/CoinListObject.h" open="0" top="0" tabpos="12">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Dialog.cpp" open="0" top="0" tabpos="10">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Dialog.h" open="0" top="0" tabpos="13">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/EggGroup.cpp" open="0" top="0" tabpos="8">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/EggGroup.h" open="0" top="0" tabpos="15">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Flag.cpp" open="0" top="0" tabpos="16">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Flag.h" open="0" top="0" tabpos="17">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Frac.cpp" open="0" top="0" tabpos="18">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Frac.h" open="0" top="0" tabpos="19">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Item.cpp" open="0" top="0" tabpos="21">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Item.h" open="0" top="0" tabpos="31">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/ItemEffect.cpp" open="0" top="0" tabpos="7">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/ItemEffect.h" open="0" top="0" tabpos="23">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/ItemType.cpp" open="0" top="0" tabpos="3">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/ItemType.h" open="0" top="0" tabpos="25">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Map.cpp" open="0" top="0" tabpos="9">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Map.h" open="0" top="0" tabpos="27">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/MapEffect.cpp" open="0" top="0" tabpos="4">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/MapEffect.h" open="0" top="0" tabpos="29">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/MapTrainer.cpp" open="0" top="0" tabpos="5">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/MapTrainer.h" open="0" top="0" tabpos="32">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/MapTrainerPokemon.cpp" open="0" top="0" tabpos="12">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/MapTrainerPokemon.h" open="0" top="0" tabpos="34">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/MapWarp.cpp" open="0" top="0" tabpos="13">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/MapWarp.h" open="0" top="0" tabpos="36">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/MapWildList.cpp" open="0" top="0" tabpos="14">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/MapWildList.h" open="0" top="0" tabpos="38">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/MapWildListPokemon.cpp" open="0" top="0" tabpos="15">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/MapWildListPokemon.h" open="0" top="0" tabpos="40">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Matrix.h" open="0" top="0" tabpos="41">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Move.cpp" open="0" top="0" tabpos="16">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Move.h" open="0" top="0" tabpos="43">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/MoveEffect.cpp" open="0" top="0" tabpos="17">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/MoveEffect.h" open="0" top="0" tabpos="45">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Nature.cpp" open="0" top="0" tabpos="18">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Nature.h" open="0" top="0" tabpos="47">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Object.h" open="0" top="0" tabpos="4">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Point.cpp" open="0" top="0" tabpos="20">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Point.h" open="0" top="0" tabpos="60">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Pokemod.cpp" open="0" top="0" tabpos="3">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Pokemod.h" open="0" top="0" tabpos="3">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Pokemon.cpp" open="0" top="0" tabpos="6">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Pokemon.h" open="0" top="0" tabpos="62">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/PokemonAbility.cpp" open="0" top="0" tabpos="23">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/PokemonAbility.h" open="0" top="0" tabpos="64">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/PokemonEvolution.cpp" open="0" top="0" tabpos="24">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/PokemonEvolution.h" open="0" top="0" tabpos="4">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/PokemonItem.cpp" open="0" top="0" tabpos="25">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/PokemonItem.h" open="0" top="0" tabpos="68">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/PokemonMove.cpp" open="0" top="0" tabpos="26">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/PokemonMove.h" open="0" top="0" tabpos="70">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/PokemonNature.cpp" open="0" top="0" tabpos="27">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/PokemonNature.h" open="0" top="0" tabpos="72">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Ref.cpp" open="0" top="0" tabpos="10">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Ref.h" open="0" top="0" tabpos="3">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Status.cpp" open="0" top="0" tabpos="28">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Status.h" open="0" top="0" tabpos="74">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/StatusEffect.cpp" open="0" top="0" tabpos="29">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/StatusEffect.h" open="0" top="0" tabpos="76">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Store.cpp" open="0" top="0" tabpos="30">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Store.h" open="0" top="0" tabpos="78">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/TODO" open="1" top="0" tabpos="2">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Tile.cpp" open="0" top="0" tabpos="7">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Tile.h" open="0" top="0" tabpos="54">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Time.cpp" open="0" top="0" tabpos="53">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Time.h" open="0" top="0" tabpos="52">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Type.cpp" open="0" top="0" tabpos="51">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/Type.h" open="0" top="0" tabpos="22">
- <Cursor position="0" topLine="0" />
- </File>
- <File name="pokemod/pokemod.pro" open="0" top="0" tabpos="6">
- <Cursor position="0" topLine="0" />
- </File>
-</CodeBlocks_layout_file>
diff --git a/pokegen.pro b/pokegen.pro
index 6ae536c9..7197514f 100755
--- a/pokegen.pro
+++ b/pokegen.pro
@@ -1,8 +1,21 @@
OBJECTS_DIR = ../obj
+DESTDIR = ../bin
+VERSION = 0.0.1
+TEMPLATE = subdirs
+CONFIG += ordered qt warn_on
-CONFIG += qt warn_on
+SUBDIRS = audio \
+ battle \
+ pokemod \
+ pokemodr
-SOURCES += *.cpp
-HEADERS += *.h
+distsrc.target = distsrc
+distsrc.commands = tar -c . | bzip2 --best -c > ../releases/pokegen-$${VERSION}.tar.bz2
-SUBDIRS = ai audio pokemod pokemodr
+rpm.target = rpm
+rpm.commands = rpmbuild -bt ../releases/pokegen-$${VERSION}.tar.bz2 \
+ cp /usr/src/redhat/RPMS/x86_64/pokegen-$${VERSION}.$${ARCH}.rpm ../pkg/
+rpm.depends = distsrc
+
+QMAKE_EXTRA_UNIX_TARGETS += distsrc \
+ rpm
diff --git a/pokemod/Ability.cpp b/pokemod/Ability.cpp
index 042a81e0..de32f4b3 100644
--- a/pokemod/Ability.cpp
+++ b/pokemod/Ability.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
// Name: pokemod/Ability.cpp
-// Purpose: Define an ability that Pokémon can possess to add extra
+// Purpose: Define an ability that species can possess to add extra
// dynamics to the battle system
// Author: Ben Boeckel
// Modified by: Ben Boeckel
@@ -125,11 +125,8 @@ unsigned PokeGen::PokeMod::Ability::GetEffectCount() const
const PokeGen::PokeMod::AbilityEffect* PokeGen::PokeMod::Ability::NewEffect(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetEffectCount(); ++i)
- {
- if (GetEffectByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetEffectCount()) && (GetEffectByID(i) != UINT_MAX); ++i)
+ ;
AbilityEffect newEffect(pokemod, i);
if (ini)
newEffect.ImportIni(*ini);
diff --git a/pokemod/Ability.h b/pokemod/Ability.h
index 361c8ec7..64b7510b 100644
--- a/pokemod/Ability.h
+++ b/pokemod/Ability.h
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
// Name: pokemod/Ability.h
-// Purpose: Define an ability that Pokémon can possess to add extra
+// Purpose: Define an ability that species can possess to add extra
// dynamics to the battle system
// Author: Ben Boeckel
// Modified by: Ben Boeckel
diff --git a/pokemod/AbilityEffect.cpp b/pokemod/AbilityEffect.cpp
index 695778ba..fa32ce1b 100644
--- a/pokemod/AbilityEffect.cpp
+++ b/pokemod/AbilityEffect.cpp
@@ -22,6 +22,16 @@
#include "AbilityEffect.h"
+const char* PokeGen::PokeMod::AbilityEffect::EffectStr[PokeGen::PokeMod::AbilityEffect::E_End] = {"Damage to HP", "Prevent Damage", "Auto Heal", "Deal Damage", "Wilds", "Stat", "Status", "Ability", "Accuracy/Power Trade", "Bullseye", "Item Effect", "Type", "Fast Hatch", "Weather"};
+const char* PokeGen::PokeMod::AbilityEffect::TriggerStr[PokeGen::PokeMod::AbilityEffect::T_End] = {"Anything", "Contact", "Weather", "Damage", "Type", "HP Boundary", "Stat Change", "Status"};
+const char* PokeGen::PokeMod::AbilityEffect::InteractStr[PokeGen::PokeMod::AbilityEffect::I_End] = {"Trade", "Shadow", "Block"};
+const char* PokeGen::PokeMod::AbilityEffect::PowerAccStr[PokeGen::PokeMod::AbilityEffect::PA_End] = {"Boost Power", "Boost Accuracy"};
+const char* PokeGen::PokeMod::AbilityEffect::ItemStr[PokeGen::PokeMod::AbilityEffect::IT_End] = {"Stat Modifier", "Type Booster", "Flinch", "Go First"};
+const char* PokeGen::PokeMod::AbilityEffect::CauseStr[PokeGen::PokeMod::AbilityEffect::C_End] = {"Prevent", "Inflict"};
+const char* PokeGen::PokeMod::AbilityEffect::BoostStr[PokeGen::PokeMod::AbilityEffect::B_End] = {"Boost", "Hinder"};
+const char* PokeGen::PokeMod::AbilityEffect::SideStr[PokeGen::PokeMod::AbilityEffect::S_End] = {"Above", "Below"};
+
+
PokeGen::PokeMod::AbilityEffect::AbilityEffect(const Pokemod* par, const unsigned _id) :
Object(_id, par),
chance(1, 1),
@@ -45,12 +55,7 @@ bool PokeGen::PokeMod::AbilityEffect::Validate()
{
pokemod->ValidationMsg(QString("------Effect with id %1---").arg(id), Pokemod::V_Msg);
chance.Reduce();
- if (E_End <= effect)
- {
- pokemod->ValidationMsg(QString("AbilityEffect with id %1 has invalid effect").arg(id));
- isValid = false;
- }
- else
+ if (effect < E_End)
{
bool ok = true;
switch (effect)
@@ -60,7 +65,7 @@ bool PokeGen::PokeMod::AbilityEffect::Validate()
ok = false;
break;
case E_Status:
- if (pokemod->GetStatusByID(val1) == UINT_MAX)
+ if (STS_End <= val1)
ok = false;
break;
case E_Ability:
@@ -85,7 +90,7 @@ bool PokeGen::PokeMod::AbilityEffect::Validate()
}
if (!ok)
{
- pokemod->ValidationMsg(QString("AbilityEffect with id %1 has an invalid value1").arg(id));
+ pokemod->ValidationMsg("Invalid value1");
isValid = false;
ok = true;
}
@@ -110,7 +115,7 @@ bool PokeGen::PokeMod::AbilityEffect::Validate()
}
if (!ok)
{
- pokemod->ValidationMsg(QString("AbilityEffect with id %1 has an invalid value2").arg(id));
+ pokemod->ValidationMsg("Invalid value2");
isValid = false;
ok = true;
}
@@ -133,17 +138,17 @@ bool PokeGen::PokeMod::AbilityEffect::Validate()
}
if (!ok)
{
- pokemod->ValidationMsg(QString("AbilityEffect with id %1 has an invalid value3").arg(id));
+ pokemod->ValidationMsg("Invalid value3");
isValid = false;
ok = true;
}
}
- if (T_End <= trigger)
+ else
{
- pokemod->ValidationMsg(QString("AbilityEffect with id %1 has an invalid trigger").arg(id));
+ pokemod->ValidationMsg("Invalid effect");
isValid = false;
}
- else
+ if (trigger < T_End)
{
bool ok = true;
switch (trigger)
@@ -165,16 +170,21 @@ bool PokeGen::PokeMod::AbilityEffect::Validate()
ok = false;
break;
case T_Status:
- if (pokemod->GetStatusByID(tval1) == UINT_MAX)
+ if (STS_End <= tval1)
ok = false;
}
if (!ok)
{
- pokemod->ValidationMsg(QString("AbilityEffect with id %1 has an invalid trigger value1").arg(id));
+ pokemod->ValidationMsg("Invalid trigger value1");
isValid = false;
}
tval2.Reduce();
}
+ else
+ {
+ pokemod->ValidationMsg("Invalid trigger");
+ isValid = false;
+ }
return isValid;
}
@@ -253,7 +263,7 @@ bool PokeGen::PokeMod::AbilityEffect::SetVal1(const unsigned v1)
val1 = v1;
break;
case E_Status:
- if (pokemod->GetStatusByID(v1) != UINT_MAX)
+ if (v1 < STS_End)
val1 = v1;
break;
case E_Ability:
@@ -360,7 +370,7 @@ bool PokeGen::PokeMod::AbilityEffect::SetTval1(const unsigned tv1)
tval1 = tv1;
break;
case T_Status:
- if (pokemod->GetStatusByID(tv1) != UINT_MAX)
+ if (tv1 < STS_End)
tval1 = tv1;
break;
}
@@ -397,7 +407,7 @@ bool PokeGen::PokeMod::AbilityEffect::SetTval2Denom(const unsigned d)
return false;
}
-PokeGen::PokeMod::Frac PokeGen::PokeMod::AbilityEffect::GetChance() const
+PokeGen::Frac PokeGen::PokeMod::AbilityEffect::GetChance() const
{
return chance;
}
@@ -442,7 +452,7 @@ unsigned PokeGen::PokeMod::AbilityEffect::GetTval1() const
return tval1;
}
-PokeGen::PokeMod::Frac PokeGen::PokeMod::AbilityEffect::GetTval2() const
+PokeGen::Frac PokeGen::PokeMod::AbilityEffect::GetTval2() const
{
return tval2;
}
diff --git a/pokemod/AbilityEffect.h b/pokemod/AbilityEffect.h
index 52bc74bb..55053570 100644
--- a/pokemod/AbilityEffect.h
+++ b/pokemod/AbilityEffect.h
@@ -25,12 +25,12 @@
#include <QFile>
#include <QString>
+#include "../general/Frac.h"
+#include "../general/Ref.h"
#include "Object.h"
#include "Pokemod.h"
#include "Ability.h"
-#include "Frac.h"
#include "Type.h"
-#include "Ref.h"
namespace PokeGen
{
@@ -167,15 +167,6 @@ namespace PokeGen
unsigned tval1;
Frac tval2;
};
-
- const char* AbilityEffect::EffectStr[AbilityEffect::E_End] = {"Damage to HP", "Prevent Damage", "Auto Heal", "Deal Damage", "Wilds", "Stat", "Status", "Ability", "Accuracy/Power Trade", "Bullseye", "Item Effect", "Type", "Fast Hatch", "Weather"};
- const char* AbilityEffect::TriggerStr[AbilityEffect::T_End] = {"Anything", "Contact", "Weather", "Damage", "Type", "HP Boundary", "Stat Change", "Status"};
- const char* AbilityEffect::InteractStr[AbilityEffect::I_End] = {"Trade", "Shadow", "Block"};
- const char* AbilityEffect::PowerAccStr[AbilityEffect::PA_End] = {"Boost Power", "Boost Accuracy"};
- const char* AbilityEffect::ItemStr[AbilityEffect::IT_End] = {"Stat Modifier", "Type Booster", "Flinch", "Go First"};
- const char* AbilityEffect::CauseStr[AbilityEffect::C_End] = {"Prevent", "Inflict"};
- const char* AbilityEffect::BoostStr[AbilityEffect::B_End] = {"Boost", "Hinder"};
- const char* AbilityEffect::SideStr[AbilityEffect::S_End] = {"Above", "Below"};
}
}
diff --git a/pokemod/Badge.cpp b/pokemod/Badge.cpp
index 0e614eae..c764ff42 100644
--- a/pokemod/Badge.cpp
+++ b/pokemod/Badge.cpp
@@ -23,6 +23,8 @@
#include "Badge.h"
+const char* PokeGen::PokeMod::Badge::HMStr[PokeGen::PokeMod::Badge::End] = {"Cut", "Fly", "Surf", "Strength", "Flash", "Whirlpool", "Waterfall", "Dive", "Headbutt", "Rock Smash", "Defog", "Rock Climb"};
+
PokeGen::PokeMod::Badge::Badge(const Pokemod* par, const unsigned _id) :
Object(_id, par),
name(""),
@@ -168,7 +170,7 @@ unsigned PokeGen::PokeMod::Badge::GetObey() const
return obey;
}
-PokeGen::PokeMod::Frac PokeGen::PokeMod::Badge::GetStat(const unsigned s) const
+PokeGen::Frac PokeGen::PokeMod::Badge::GetStat(const unsigned s) const
{
if (s < (pokemod->IsSpecialSplit() ? ST_End_GSC : ST_End_RBY))
return stats[s];
diff --git a/pokemod/Badge.h b/pokemod/Badge.h
index 396e1916..1a443c2f 100644
--- a/pokemod/Badge.h
+++ b/pokemod/Badge.h
@@ -26,10 +26,10 @@
#include <QFile>
#include <QString>
+#include "../general/Frac.h"
+#include "../general/Ref.h"
#include "Object.h"
#include "Pokemod.h"
-#include "Frac.h"
-#include "Ref.h"
namespace PokeGen
{
@@ -85,8 +85,6 @@ namespace PokeGen
Frac stats[ST_End_GSC];
bool hm[End];
};
-
- const char* Badge::HMStr[Badge::End] = {"Cut", "Fly", "Surf", "Strength", "Flash", "Whirlpool", "Waterfall", "Dive", "Headbutt", "Rock Smash", "Defog", "Rock Climb"};
}
}
diff --git a/pokemod/CoinList.cpp b/pokemod/CoinList.cpp
index f54dcf6a..3e4b9292 100644
--- a/pokemod/CoinList.cpp
+++ b/pokemod/CoinList.cpp
@@ -190,11 +190,8 @@ unsigned PokeGen::PokeMod::CoinList::GetItemCount() const
const PokeGen::PokeMod::CoinListObject* PokeGen::PokeMod::CoinList::NewItem(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetItemCount(); ++i)
- {
- if (GetItemByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetItemCount()) && (GetItemByID(i) != UINT_MAX); ++i)
+ ;
CoinListObject newItem(pokemod, i);
if (ini)
newItem.ImportIni(*ini);
diff --git a/pokemod/CoinListObject.cpp b/pokemod/CoinListObject.cpp
index 1a59c40a..d3a45d7b 100644
--- a/pokemod/CoinListObject.cpp
+++ b/pokemod/CoinListObject.cpp
@@ -22,6 +22,8 @@
#include "CoinListObject.h"
+const char* PokeGen::PokeMod::CoinListObject::TypeStr[PokeGen::PokeMod::CoinListObject::End] = {"Item", "Pokémon"};
+
PokeGen::PokeMod::CoinListObject::CoinListObject(const Pokemod* par, const unsigned _id) :
Object(_id, par),
type(Item),
@@ -50,9 +52,9 @@ bool PokeGen::PokeMod::CoinListObject::Validate()
}
else if (type == Pokemon)
{
- if (pokemod->GetPokemonByID(object) == UINT_MAX)
+ if (pokemod->GetSpeciesByID(object) == UINT_MAX)
{
- pokemod->ValidationMsg("Invalid Pokémon");
+ pokemod->ValidationMsg("Invalid Species");
isValid = false;
}
}
@@ -104,7 +106,7 @@ bool PokeGen::PokeMod::CoinListObject::SetType(const unsigned t)
bool PokeGen::PokeMod::CoinListObject::SetObject(const unsigned o)
{
- if (((type == Item) && (pokemod->GetItemByID(o) != UINT_MAX)) || ((type == Pokemon) && (pokemod->GetPokemonByID(o) != UINT_MAX)))
+ if (((type == Item) && (pokemod->GetItemByID(o) != UINT_MAX)) || ((type == Pokemon) && (pokemod->GetSpeciesByID(o) != UINT_MAX)))
object = o;
return (object == o);
}
diff --git a/pokemod/CoinListObject.h b/pokemod/CoinListObject.h
index 48942207..88043b51 100644
--- a/pokemod/CoinListObject.h
+++ b/pokemod/CoinListObject.h
@@ -66,8 +66,6 @@ namespace PokeGen
unsigned amount;
unsigned cost;
};
-
- const char* CoinListObject::TypeStr[CoinListObject::End] = {"Item", "Pokémon"};
}
}
diff --git a/pokemod/Dialog.cpp b/pokemod/Dialog.cpp
index 4d13515f..3c146d06 100644
--- a/pokemod/Dialog.cpp
+++ b/pokemod/Dialog.cpp
@@ -22,6 +22,10 @@
#include "Dialog.h"
+const char* PokeGen::PokeMod::Dialog::CommandStr[PokeGen::PokeMod::Dialog::End] = {"Flip Flag", "Set Flag", "Unset Flag", "Randomize Flag", "Test Flag", "Dialog", "Yes/No", "Item Shop", "Give Item", "Take Item", "Check Item", "Coin List", "Teach Move", "Delete Move", "Give Pokemon", "Take Pokemon", "Show Pokemon", "View Pokemon", "Give Money", "Take Money", "Move Effect", "Turn Effect", "Check Direction", "Check Roster", "Check Levels", "Check Species", "Check Held Items", "Check Money", "Trade", "Daycare", "Battle", "Badge", "Warp", "Name", "Music", "Sound Effect", "Timer", "Map Sign", "Wild Scope", "Safari", "Heal Party", "Refresh", "Clear", "Pause", "New Line", "Exit", "Menu"};
+const char* PokeGen::PokeMod::Dialog::CommandAbbrStr[PokeGen::PokeMod::Dialog::End] = {"FF", "SF", "UF", "RF", "TF", "D", "YN", "ItS", "GIt", "TIt", "CIt", "CL", "TMv", "DMv", "GPk", "TPk", "SPk", "VPk", "G$", "T$", "MvEf", "TEf", "CD", "CR", "CLv", "CS", "CHIt", "C$", "T", "Dc", "Bat", "Bdg", "W", "N", "Ms", "SFX", "Tmr", "MS", "WS", "S", "HP", "R", "C", "P", "NL", "X", "M"};
+const unsigned PokeGen::PokeMod::Dialog::CommandNumArgs[PokeGen::PokeMod::Dialog::Menu] = {1, 1, 1, 1, 3, 2, 2, 1, 4, 4, 4, 1, 5, 3, 7, 4, 1, 4, 1, 4, 6, 3, 6, 5, 5, 4, 4, 5, 6, 1, 2, 1, 2, 1, 2, 1, 3, 1, 1, 3, 0, 0, 0, 0, 0, 0};
+
PokeGen::PokeMod::Dialog::Dialog(const Pokemod* par, const unsigned _id) :
Object(_id, par),
dialog("")
@@ -242,7 +246,7 @@ bool PokeGen::PokeMod::Dialog::Validate()
invError = 1;
break;
case 2:
- if (!okU || (pokemod->GetPokemonByID(tempU) ==UINT_MAX))
+ if (!okU || (pokemod->GetSpeciesByID(tempU) ==UINT_MAX))
invError = 2;
break;
case 3:
@@ -281,7 +285,7 @@ bool PokeGen::PokeMod::Dialog::Validate()
invError = 1;
break;
case 2:
- if (!okU || (pokemod->GetPokemonByID(tempU) == UINT_MAX))
+ if (!okU || (pokemod->GetSpeciesByID(tempU) == UINT_MAX))
invError = 2;
break;
case 3:
@@ -293,7 +297,7 @@ bool PokeGen::PokeMod::Dialog::Validate()
case ShowPokemon:
if (numArgs == 1)
{
- if (!okU || (pokemod->GetPokemonByID(tempU) == UINT_MAX))
+ if (!okU || (pokemod->GetSpeciesByID(tempU) == UINT_MAX))
invError = 1;
}
break;
@@ -443,7 +447,7 @@ bool PokeGen::PokeMod::Dialog::Validate()
break;
case 2:
case 3:
- if (!okU || (pokemod->GetPokemonByID(tempU) == UINT_MAX))
+ if (!okU || (pokemod->GetSpeciesByID(tempU) == UINT_MAX))
invError = numArgs;
case 4:
if (!okUL)
@@ -512,12 +516,23 @@ bool PokeGen::PokeMod::Dialog::Validate()
}
break;
case Music:
+ if (numArgs == 1)
+ {
+ if (!QFile(pokemod->GetPath() + "music/" + arg).exists())
+ invError = 1;
+ }
+ break;
case SoundEffect:
if (numArgs == 1)
{
if (!QFile(pokemod->GetPath() + "sound/" + arg).exists())
invError = 1;
}
+ else if (numArgs == 2)
+ {
+ if (!okU)
+ invError = 2;
+ }
break;
case Timer:
switch (numArgs)
diff --git a/pokemod/Dialog.h b/pokemod/Dialog.h
index 26ff811d..5e27078c 100644
--- a/pokemod/Dialog.h
+++ b/pokemod/Dialog.h
@@ -34,7 +34,7 @@
#include "MapTrainer.h"
#include "MapWarp.h"
#include "Move.h"
-#include "Pokemon.h"
+#include "Species.h"
namespace PokeGen
{
@@ -115,10 +115,6 @@ namespace PokeGen
QString dialog;
};
-
- const char* Dialog::CommandStr[Dialog::End] = {"Flip Flag", "Set Flag", "Unset Flag", "Randomize Flag", "Test Flag", "Dialog", "Yes/No", "Item Shop", "Give Item", "Take Item", "Check Item", "Coin List", "Teach Move", "Delete Move", "Give Pokemon", "Take Pokemon", "Show Pokemon", "View Pokemon", "Give Money", "Take Money", "Move Effect", "Turn Effect", "Check Direction", "Check Roster", "Check Levels", "Check Species", "Check Held Items", "Check Money", "Trade", "Daycare", "Battle", "Badge", "Warp", "Name", "Music", "Sound Effect", "Timer", "Map Sign", "Wild Scope", "Safari", "Heal Party", "Refresh", "Clear", "Pause", "New Line", "Exit", "Menu"};
- const char* Dialog::CommandAbbrStr[Dialog::End] = {"FF", "SF", "UF", "RF", "TF", "D", "YN", "ItS", "GIt", "TIt", "CIt", "CL", "TMv", "DMv", "GPk", "TPk", "SPk", "VPk", "G$", "T$", "MvEf", "TEf", "CD", "CR", "CLv", "CS", "CHIt", "C$", "T", "Dc", "Bat", "Bdg", "W", "N", "Ms", "SFX", "Tmr", "MS", "WS", "S", "HP", "R", "C", "P", "NL", "X", "M"};
- const unsigned Dialog::CommandNumArgs[Dialog::Menu] = {1, 1, 1, 1, 3, 2, 2, 1, 4, 4, 4, 1, 5, 3, 7, 4, 1, 4, 1, 4, 6, 3, 6, 5, 5, 4, 4, 5, 6, 1, 2, 1, 2, 1, 1, 1, 3, 1, 1, 3, 0, 0, 0, 0, 0, 0};
}
}
diff --git a/pokemod/EggGroup.cpp b/pokemod/EggGroup.cpp
index 1b92f36f..21fa9774 100644
--- a/pokemod/EggGroup.cpp
+++ b/pokemod/EggGroup.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
// Name: pokemod/EggGroup.cpp
-// Purpose: Define a type for a Pokémon
+// Purpose: Define a breeding gourp
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Mar 20 18:05:05 2007
diff --git a/pokemod/EggGroup.h b/pokemod/EggGroup.h
index 46cbfd10..30af0d7f 100644
--- a/pokemod/EggGroup.h
+++ b/pokemod/EggGroup.h
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
// Name: pokemod/EggGroup.h
-// Purpose: Define an egg group a Pokémon can belong to
+// Purpose: Define a breeding group
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Mar 20 18:05:05 2007
diff --git a/pokemod/Flag.h b/pokemod/Flag.h
deleted file mode 100644
index f6cddce6..00000000
--- a/pokemod/Flag.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/Flag.h
-// Purpose: A class that handles flags
-// Author: Ben Boeckel
-// Modified by: Ben Boeckel
-// Created: Tue Mar 20 19:22 2007
-// Copyright: ©2007 Nerdy Productions
-// Licence:
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program. If not, see <http://www.gnu.org/licenses/>.
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef __POKEMOD_FLAG__
-#define __POKEMOD_FLAG__
-
-#include <QFile>
-#include <QString>
-#include "../Ini.h"
-#include "Ref.h"
-
-namespace PokeGen
-{
- namespace PokeMod
- {
- class Flag
- {
- public:
- enum
- {
- Off,
- On,
- Ignore,
- End
- };
- const static QString ValueStr[End];
-
- Flag(const unsigned f = 0, const unsigned s = 0);
-
- void ImportIni(Ini& ini);
- void ExportIni(QFile& fout, const QString& val) const;
-
- void Set(const unsigned f, const unsigned s);
- void SetFlag(const unsigned f);
- void SetStatus(const unsigned s);
-
- unsigned GetFlag() const;
- unsigned GetStatus() const;
- private:
- unsigned flag;
- unsigned status;
- };
-
- const QString Flag::ValueStr[Flag::End] = {"Off", "On", "Ignore"};
- }
-}
-
-#endif
diff --git a/pokemod/Frac.h b/pokemod/Frac.h
deleted file mode 100644
index 959d8b32..00000000
--- a/pokemod/Frac.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/Frac.h
-// Purpose: A class to make handling fractions easier
-// Author: Ben Boeckel
-// Modified by: Ben Boeckel
-// Created: Sun Mar 18 15:25:16 2007
-// Copyright: ©2007 Nerdy Productions
-// Licence:
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program. If not, see <http://www.gnu.org/licenses/>.
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef __POKEMOD_FRAC__
-#define __POKEMOD_FRAC__
-
-#include <QFile>
-#include <QString>
-#include "../Ini.h"
-#include "Ref.h"
-
-namespace PokeGen
-{
- namespace PokeMod
- {
- class Frac
- {
- public:
- enum
- {
- Proper = 0,
- Improper = 1,
- Over1 = 2,
- End = 3
- };
-
- Frac(const unsigned i = Proper);
- Frac(const unsigned n, const unsigned d, const unsigned i = Proper);
-
- void ImportIni(Ini& ini);
- void ExportIni(QFile& fout, const QString& val);
-
- bool Set(const unsigned n, const unsigned d);
- bool Set(const unsigned n, const unsigned d, const unsigned t);
- bool SetNum(const unsigned n);
- bool SetDenom(const unsigned d);
- bool SetType(const unsigned t);
-
- unsigned GetNum() const;
- unsigned GetDenom() const;
- unsigned GetType() const;
-
- void Reduce();
-
- operator float() const;
- private:
- unsigned num;
- unsigned denom;
- unsigned type;
- };
- }
-}
-
-#endif
diff --git a/pokemod/Item.cpp b/pokemod/Item.cpp
index b0892600..47d0f401 100644
--- a/pokemod/Item.cpp
+++ b/pokemod/Item.cpp
@@ -185,11 +185,8 @@ unsigned PokeGen::PokeMod::Item::GetEffectCount() const
const PokeGen::PokeMod::ItemEffect* PokeGen::PokeMod::Item::NewEffect(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetEffectCount(); ++i)
- {
- if (GetEffectByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetEffectCount()) && (GetEffectByID(i) != UINT_MAX); ++i)
+ ;
ItemEffect newEffect(pokemod, i);
if (ini)
newEffect.ImportIni(*ini);
diff --git a/pokemod/ItemEffect.cpp b/pokemod/ItemEffect.cpp
index dcbfc737..83b30dc9 100644
--- a/pokemod/ItemEffect.cpp
+++ b/pokemod/ItemEffect.cpp
@@ -22,17 +22,25 @@
#include "ItemEffect.h"
+const char* PokeGen::PokeMod::ItemEffect::EffectStr[PokeGen::PokeMod::ItemEffect::E_End] = {"HP Cure", "Revive", "Cure Status", "Level Boost", "Stat Boost", "Flinch", "Go First", "Keep Alive", "Modify Stat (Battle Only)", "Shield (Battle Only)", "Run (Battle Only)", "PP Boost", "Type Boost", "PP Restore", "Experience Share", "Fishing Rod", "Repel", "Escape", "TM", "HM", "Map", "Ball", "Itemfinder", "Bike", "Scope", "Coin", "Coin Case", "Berry", "Acorn"};
+const char* PokeGen::PokeMod::ItemEffect::RelativeStr[PokeGen::PokeMod::ItemEffect::R_End] = {"Absolute", "Relative"};
+const char* PokeGen::PokeMod::ItemEffect::EscapeStr[PokeGen::PokeMod::ItemEffect::ES_End] = {"Anywhere", "Dungeon"};
+const char* PokeGen::PokeMod::ItemEffect::RepelStr[PokeGen::PokeMod::ItemEffect::RP_End] = {"First", "Max", "All"};
+const char* PokeGen::PokeMod::ItemEffect::AmountStr[PokeGen::PokeMod::ItemEffect::A_End] = {"All", "One"};
+const char* PokeGen::PokeMod::ItemEffect::SpecialPhysicalStr[PokeGen::PokeMod::ItemEffect::SP_End] = {"Special", "Physical"};
+const char* PokeGen::PokeMod::ItemEffect::BallTypeStr[PokeGen::PokeMod::ItemEffect::B_End] = {"Regular", "Master", "Level", "Love", "Area", "Time", "Battle", "Friend", "Stat", "Type", "Weight"};
+const char* PokeGen::PokeMod::ItemEffect::BerryTypeStr[PokeGen::PokeMod::ItemEffect::B2_End] = {"HP Cure", "Status Cure"};
+
PokeGen::PokeMod::ItemEffect::ItemEffect(const Pokemod* par, const unsigned _id) :
Object(_id, par),
overworld(false),
battle(false),
held(false),
effect(UINT_MAX),
- val1(UINT_MAX),
+ val1(INT_MIN),
val2(UINT_MAX),
- val3(1, 1),
- val4(UINT_MAX),
- val5(UINT_MAX)
+ val3(UINT_MAX),
+ val4(1, 1)
{
}
@@ -45,7 +53,238 @@ PokeGen::PokeMod::ItemEffect::ItemEffect(const Pokemod* par, Ini& ini, const uns
bool PokeGen::PokeMod::ItemEffect::Validate()
{
pokemod->ValidationMsg(QString("------Effect with id %1---").arg(id), Pokemod::V_Msg);
- // TODO (Ben#1#): Item Effect validation
+ switch (effect)
+ {
+ case E_Revive:
+ case E_LevelBoost:
+ case E_StatBoost:
+ case E_PPBoost:
+ case E_Fish:
+ case E_Repel:
+ case E_Escape:
+ case E_TM:
+ case E_HM:
+ case E_Map:
+ case E_Itemfinder:
+ case E_Bike:
+ case E_Scope:
+ case E_Coin:
+ case E_CoinCase:
+ case E_Acorn:
+ case E_Evolution:
+ if (!overworld)
+ {
+ isValid = false;
+ pokemod->ValidationMsg("Effect only works in the overworld");
+ }
+ break;
+ case E_Flinch:
+ case E_First:
+ case E_KeepAlive:
+ case E_ModifyStatBattle:
+ case E_ShieldBattle:
+ case E_RunBattle:
+ case E_TypeBoost:
+ case E_ExpShare:
+ case E_Ball:
+ case E_Berry:
+ if (overworld)
+ {
+ isValid = false;
+ pokemod->ValidationMsg("Effect cannot work in the overworld");
+ }
+ break;
+ }
+ if (effect < E_End)
+ {
+ bool ok = true;
+ switch (effect)
+ {
+ case E_HPCure:
+ case E_Revive:
+ if ((val4 != R_Absolute) || !val1)
+ ok = false;;
+ break;
+ case E_LevelBoost:
+ case E_ShieldBattle:
+ case E_PPBoost:
+ case E_Repel:
+ if (!val1)
+ ok = false;
+ break;
+ case E_StatBoost:
+ case E_Acorn:
+ if ((val1 < 0) || (65536 <= val1))
+ ok = false;
+ break;
+ case E_ModifyStatBattle:
+ if ((val1 < -6) || (6 < val1))
+ ok = false;
+ break;
+ case E_Ball:
+ switch (val2)
+ {
+ case B_Regular:
+ if (256 <= (unsigned)val1)
+ ok = false;
+ break;
+ case B_Level:
+ if (pokemod->GetMaxLevel() < (unsigned)val1)
+ ok = false;
+ break;
+ case B_Master:
+ case B_Love:
+ case B_Area:
+ case B_Time:
+ case B_Battle:
+ case B_Friend:
+ case B_Stat:
+ case B_Type:
+ case B_Weight:
+ break;
+ default:
+ ok = false;
+ break;
+
+ }
+ break;
+ }
+ if (!ok)
+ {
+ pokemod->ValidationMsg("Invalid val1");
+ isValid = false;
+ ok = true;
+ }
+ switch (effect)
+ {
+ case E_HPCure:
+ case E_Revive:
+ if (R_End <= val2)
+ ok = false;
+ break;
+ case E_CureStatus:
+ if (STS_End <= val2)
+ ok = false;
+ break;
+ case E_StatBoost:
+ if ((val2 <= 0) || (65536 <= val2))
+ ok = false;
+ break;
+ case E_ModifyStatBattle:
+ if (ST_End_Battle <= val2)
+ ok = false;
+ break;
+ case E_ShieldBattle:
+ if (SP_End <= val2)
+ ok = false;
+ break;
+ case E_TypeBoost:
+ if (pokemod->GetTypeByID(val2) == UINT_MAX)
+ ok = false;
+ break;
+ case E_PPRestore:
+ if (A_End <= val2)
+ ok = false;
+ break;
+ case E_Repel:
+ if (RP_End <= val2)
+ ok = false;
+ break;
+ case E_Escape:
+ if (ES_End <= val2)
+ ok = false;
+ break;
+ case E_TM:
+ case E_HM:
+ if (pokemod->GetMoveByID(val2) == UINT_MAX)
+ ok = false;
+ break;
+ case E_Ball:
+ if (B_End <= val2)
+ ok = false;
+ break;
+ case E_Berry:
+ if (B2_End <= val2)
+ ok = false;
+ break;
+ case E_Coin:
+ case E_CoinCase:
+ if (val2 <= 0)
+ ok = false;
+ break;
+ case E_Acorn:
+ if (pokemod->GetItemByID(val2) == UINT_MAX)
+ ok = false;
+ break;
+ }
+ if (!ok)
+ {
+ pokemod->ValidationMsg("Invalid val2");
+ isValid = false;
+ ok = true;
+ }
+ switch (effect)
+ {
+ case E_StatBoost:
+ if ((pokemod->IsSpecialSplit() ? ST_End_GSC : ST_End_RBY) <= val3)
+ ok = false;
+ break;
+ case E_Ball:
+ switch (val2)
+ {
+ case B_Regular:
+ case B_Master:
+ case B_Level:
+ case B_Love:
+ case B_Battle:
+ case B_Friend:
+ case B_Weight:
+ break;
+ case B_Area:
+ if (MapWildList::End <= val3)
+ ok = false;
+ break;
+ case B_Time:
+ if (pokemod->GetTimeByID(val3) == UINT_MAX)
+ ok = false;
+ break;
+ case B_Stat:
+ if ((pokemod->IsSpecialSplit() ? ST_End_GSC : ST_End_RBY) <= val3)
+ ok = false;
+ break;
+ case B_Type:
+ if (pokemod->GetTypeByID(val3) == UINT_MAX)
+ ok = false;
+ break;
+ }
+ break;
+ case E_Berry:
+ switch (val2)
+ {
+ case B2_HPCure:
+ if (REL_End <= val3)
+ ok = false;
+ break;
+ case B2_StatusCure:
+ if (STS_End <= val3)
+ ok = false;
+ break;
+ default:
+ ok = false;
+ }
+ break;
+ }
+ if (!ok)
+ {
+ pokemod->ValidationMsg("Invalid val3");
+ isValid = false;
+ }
+ }
+ else
+ {
+ pokemod->ValidationMsg("Invalid effect");
+ isValid = false;
+ }
return isValid;
}
@@ -63,11 +302,10 @@ void PokeGen::PokeMod::ItemEffect::ImportIni(Ini& ini, const unsigned _id)
ini.GetValue("effect", effect);
ini.GetValue("val1", val1);
ini.GetValue("val2", val2);
- ini.GetValue("val3-n", i, 1);
- ini.GetValue("val3-n", j, 1);
- val3.Set(i, j);
- ini.GetValue("val4", val4);
- ini.GetValue("val5", val5);
+ ini.GetValue("val3", val3);
+ ini.GetValue("val4-n", i, 1);
+ ini.GetValue("val4-n", j, 1);
+ val4.Set(i, j);
}
void PokeGen::PokeMod::ItemEffect::ExportIni(QFile& fout, const QString& item) const
@@ -80,16 +318,50 @@ void PokeGen::PokeMod::ItemEffect::ExportIni(QFile& fout, const QString& item) c
exItemEffect.AddField("effect", effect);
exItemEffect.AddField("val1", val1);
exItemEffect.AddField("val2", val2);
- exItemEffect.AddField("val3-n", val3.GetNum());
- exItemEffect.AddField("val3-d", val3.GetDenom());
- exItemEffect.AddField("val4", val4);
- exItemEffect.AddField("val5", val5);
+ exItemEffect.AddField("val3", val3);
+ exItemEffect.AddField("val4-n", val4.GetNum());
+ exItemEffect.AddField("val4-d", val4.GetDenom());
exItemEffect.Export(fout);
}
-void PokeGen::PokeMod::ItemEffect::SetOverworld(const bool o)
+bool PokeGen::PokeMod::ItemEffect::SetOverworld(const bool o)
{
+ switch (effect)
+ {
+ case E_Revive:
+ case E_LevelBoost:
+ case E_StatBoost:
+ case E_PPBoost:
+ case E_Fish:
+ case E_Repel:
+ case E_Escape:
+ case E_TM:
+ case E_HM:
+ case E_Map:
+ case E_Itemfinder:
+ case E_Bike:
+ case E_Scope:
+ case E_Coin:
+ case E_CoinCase:
+ case E_Acorn:
+ case E_Evolution:
+ if (!o)
+ return false;
+ case E_Flinch:
+ case E_First:
+ case E_KeepAlive:
+ case E_ModifyStatBattle:
+ case E_ShieldBattle:
+ case E_RunBattle:
+ case E_TypeBoost:
+ case E_ExpShare:
+ case E_Ball:
+ case E_Berry:
+ if (o)
+ return false;
+ }
overworld = o;
+ return true;
}
void PokeGen::PokeMod::ItemEffect::SetBattle(const bool b)
@@ -106,12 +378,45 @@ bool PokeGen::PokeMod::ItemEffect::SetEffect(const unsigned e)
{
if (e < E_End)
{
+ switch (e)
+ {
+ case E_Revive:
+ case E_LevelBoost:
+ case E_StatBoost:
+ case E_PPBoost:
+ case E_Fish:
+ case E_Repel:
+ case E_Escape:
+ case E_TM:
+ case E_HM:
+ case E_Map:
+ case E_Itemfinder:
+ case E_Bike:
+ case E_Scope:
+ case E_Coin:
+ case E_CoinCase:
+ case E_Acorn:
+ case E_Evolution:
+ if (!overworld)
+ return false;
+ case E_Flinch:
+ case E_First:
+ case E_KeepAlive:
+ case E_ModifyStatBattle:
+ case E_ShieldBattle:
+ case E_RunBattle:
+ case E_TypeBoost:
+ case E_ExpShare:
+ case E_Ball:
+ case E_Berry:
+ if (overworld)
+ return false;
+ }
effect = e;
- val1 = INT_MAX;
- val2 = INT_MAX;
- val3.Set(1, 1, (e == E_Ball) || (e == E_TypeBoost) || (e == E_PPBoost));
- val4 = UINT_MAX;
- val5 = UINT_MAX;
+ val1 = INT_MIN;
+ val2 = UINT_MAX;
+ val3 = UINT_MAX;
+ val4.Set(1, 1, ((e == E_TypeBoost) || (e == E_PPBoost)) ? Frac::Over1 : Frac::Proper);
}
return (effect == e);
}
@@ -122,12 +427,9 @@ bool PokeGen::PokeMod::ItemEffect::SetVal1(const int v1)
{
case E_HPCure:
case E_Revive:
- if (val4 == R_Absolute)
- {
- if (v1)
- val1 = v1;
- break;
- }
+ if ((val4 == R_Absolute) && v1)
+ val1 = v1;
+ break;
case E_LevelBoost:
case E_ShieldBattle:
case E_PPBoost:
@@ -150,7 +452,7 @@ bool PokeGen::PokeMod::ItemEffect::SetVal1(const int v1)
val1 = v1;
break;
case E_Ball:
- switch (val4)
+ switch (val2)
{
case B_Regular:
if ((unsigned)v1 < 256)
@@ -167,65 +469,132 @@ bool PokeGen::PokeMod::ItemEffect::SetVal1(const int v1)
break;
}
break;
- case E_Berry:
- // TODO (Ben#1#): Berry Effect val1
- // Depends on val4
- break;
}
return (val1 == v1);
}
-bool PokeGen::PokeMod::ItemEffect::SetVal2(const int v2)
+bool PokeGen::PokeMod::ItemEffect::SetVal2(const unsigned v2)
{
switch (effect)
{
+ case E_HPCure:
+ case E_Revive:
+ if (v2 < R_End)
+ val2 = v2;
+ break;
+ case E_CureStatus:
+ if (v2 < STS_End)
+ val2 = v2;
+ break;
case E_StatBoost:
if ((0 < v2) && (v2 < 65536))
val2 = v2;
break;
+ case E_ModifyStatBattle:
+ if (v2 < ST_End_Battle)
+ val2 = v2;
+ break;
+ case E_ShieldBattle:
+ if (v2 < SP_End)
+ val2 = v2;
+ break;
+ case E_TypeBoost:
+ if (pokemod->GetTypeByID(v2) != UINT_MAX)
+ val2 = v2;
+ break;
+ case E_PPRestore:
+ if (v2 < A_End)
+ val2 = v2;
+ break;
+ case E_Repel:
+ if (v2 < RP_End)
+ val2 = v2;
+ break;
+ case E_Escape:
+ if (v2 < ES_End)
+ val2 = v2;
+ break;
+ case E_TM:
+ case E_HM:
+ if (pokemod->GetMoveByID(v2) != UINT_MAX)
+ val2 = v2;
+ break;
case E_Ball:
- // TODO (Ben#1#): Ball Effect val2
- // Depends on val4
+ if (v2 < B_End)
+ {
+ val2 = v2;
+ val4.SetType(Frac::Improper);
+ }
+ break;
+ case E_Berry:
+ if (v2 < B2_End)
+ val2 = v2;
break;
case E_Coin:
case E_CoinCase:
if (0 < v2)
val2 = v2;
break;
+ case E_Acorn:
+ if (pokemod->GetItemByID(v2) != UINT_MAX)
+ val2 = v2;
+ break;
}
return (val2 == v2);
}
-bool PokeGen::PokeMod::ItemEffect::SetVal3(const unsigned n, const unsigned d)
+bool PokeGen::PokeMod::ItemEffect::SetVal3(const unsigned v3)
{
switch (effect)
{
- case E_HPCure:
- case E_Revive:
- case E_Flinch:
- case E_First:
- case E_KeepAlive:
- case E_ShieldBattle:
- case E_RunBattle:
- case E_PPBoost:
- case E_TypeBoost:
- case E_PPRestore:
- case E_ExpShare:
- case E_Repel:
- return val3.Set(n, d);
+ case E_StatBoost:
+ if (v3 < (pokemod->IsSpecialSplit() ? ST_End_GSC : ST_End_RBY))
+ val3 = v3;
+ break;
case E_Ball:
- // TODO (Ben#1#): Ball Effect val3
- // Depends on val4
+ switch (val2)
+ {
+ case B_Level:
+ case B_Friend:
+ case B_Weight:
+ val3 = v3;
+ break;
+ case B_Area:
+ if (v3 < MapWildList::End)
+ val3 = v3;
+ break;
+ case B_Time:
+ if (pokemod->GetTimeByID(v3) != UINT_MAX)
+ val3 = v3;
+ break;
+ case B_Stat:
+ if (v3 < (pokemod->IsSpecialSplit() ? ST_End_GSC : ST_End_RBY))
+ val3 = v3;
+ break;
+ case B_Type:
+ if (pokemod->GetTypeByID(v3) != UINT_MAX)
+ val3 = v3;
+ break;
+ }
break;
case E_Berry:
- // TODO (Ben#1#): Berry Effect val3
- // Depends on val4
+ switch (val2)
+ {
+ case B2_HPCure:
+ if (v3 < REL_End)
+ val3 = v3;
+ break;
+ case B2_StatusCure:
+ if (v3 < STS_End)
+ val3 = v3;
+ break;
+ }
break;
}
- return false;
+ return (val3 == v3);
}
-bool PokeGen::PokeMod::ItemEffect::SetVal3Num(const unsigned n)
+bool PokeGen::PokeMod::ItemEffect::SetVal4(const unsigned n, const unsigned d)
{
switch (effect)
{
@@ -241,20 +610,18 @@ bool PokeGen::PokeMod::ItemEffect::SetVal3Num(const unsigned n)
case E_PPRestore:
case E_ExpShare:
case E_Repel:
- return val3.SetNum(n);
+ return val4.Set(n, d);
case E_Ball:
- // TODO (Ben#1#): Ball Effect val3
- // Depends on val4
- break;
+ if (val2 != B_Master)
+ return val4.Set(n, d);
case E_Berry:
- // TODO (Ben#1#): Berry Effect val3
- // Depends on val4
- break;
+ if (val2 == B2_HPCure)
+ return val4.Set(n, d);
}
return false;
}
-bool PokeGen::PokeMod::ItemEffect::SetVal3Denom(const unsigned d)
+bool PokeGen::PokeMod::ItemEffect::SetVal4Num(const unsigned n)
{
switch (effect)
{
@@ -270,85 +637,42 @@ bool PokeGen::PokeMod::ItemEffect::SetVal3Denom(const unsigned d)
case E_PPRestore:
case E_ExpShare:
case E_Repel:
- return val3.SetDenom(d);
+ return val4.SetNum(n);
case E_Ball:
- // TODO (Ben#1#): Ball Effect val3
- // Depends on val4
- break;
+ if (val2 != B_Master)
+ return val4.SetNum(n);
case E_Berry:
- // TODO (Ben#1#): Berry Effect val3
- // Depends on val4
- break;
+ if (val2 == B2_HPCure)
+ return val4.SetNum(n);
}
- return true;
+ return false;
}
-bool PokeGen::PokeMod::ItemEffect::SetVal4(const unsigned v4)
+bool PokeGen::PokeMod::ItemEffect::SetVal4Denom(const unsigned d)
{
switch (effect)
{
case E_HPCure:
case E_Revive:
- if (v4 < R_End)
- val4 = v4;
- break;
- case E_CureStatus:
- if (pokemod->GetStatusByID(v4) != UINT_MAX)
- val4 = v4;
- break;
- case E_StatBoost:
- case E_ModifyStatBattle:
- // Stat
- break;
+ case E_Flinch:
+ case E_First:
+ case E_KeepAlive:
case E_ShieldBattle:
- // Special/Physical
- break;
+ case E_RunBattle:
+ case E_PPBoost:
case E_TypeBoost:
- if (pokemod->GetType(v4))
- val4 = v4;
- break;
case E_PPRestore:
- // All/One
- break;
+ case E_ExpShare:
case E_Repel:
- // First/Max/All
- break;
- case E_Escape:
- // Anywhere/Dungeon
- break;
- case E_TM:
- case E_HM:
- if (pokemod->GetMove(v4))
- val4 = v4;
- break;
+ return val4.SetDenom(d);
case E_Ball:
- // BallType
- break;
+ if (val2 != B_Master)
+ return val4.SetDenom(d);
case E_Berry:
- // BerryType
- break;
- case E_Acorn:
- if (pokemod->GetItem(v4))
- val4 = v4;
- break;
+ if (val2 == B2_HPCure)
+ return val4.SetDenom(d);
}
- return (val4 == v4);
-}
-
-bool PokeGen::PokeMod::ItemEffect::SetVal5(const unsigned v5)
-{
- switch (effect)
- {
- case E_Ball:
- // TODO (Ben#1#): Ball Effect val5
- // Depends on val4
- break;
- case E_Berry:
- // TODO (Ben#1#): Berry Effect val5
- // Depends on val4
- break;
- }
- return (val5 == v5);
+ return true;
}
bool PokeGen::PokeMod::ItemEffect::GetOverworld() const
@@ -371,38 +695,32 @@ unsigned PokeGen::PokeMod::ItemEffect::GetEffect() const
return effect;
}
-// TODO (Ben#1#): Values fetching
int PokeGen::PokeMod::ItemEffect::GetVal1() const
{
return val1;
}
-int PokeGen::PokeMod::ItemEffect::GetVal2() const
+unsigned PokeGen::PokeMod::ItemEffect::GetVal2() const
{
return val2;
}
-PokeGen::PokeMod::Frac PokeGen::PokeMod::ItemEffect::GetVal3() const
+unsigned PokeGen::PokeMod::ItemEffect::GetVal3() const
{
return val3;
}
-unsigned PokeGen::PokeMod::ItemEffect::GetVal3Num() const
-{
- return val3.GetNum();
-}
-
-unsigned PokeGen::PokeMod::ItemEffect::GetVal3Denom() const
+PokeGen::Frac PokeGen::PokeMod::ItemEffect::GetVal4() const
{
- return val3.GetDenom();
+ return val4;
}
-unsigned PokeGen::PokeMod::ItemEffect::GetVal4() const
+unsigned PokeGen::PokeMod::ItemEffect::GetVal4Num() const
{
- return val4;
+ return val4.GetNum();
}
-unsigned PokeGen::PokeMod::ItemEffect::GetVal5() const
+unsigned PokeGen::PokeMod::ItemEffect::GetVal4Denom() const
{
- return val5;
+ return val4.GetDenom();
}
diff --git a/pokemod/ItemEffect.h b/pokemod/ItemEffect.h
index e65b498a..88851d70 100644
--- a/pokemod/ItemEffect.h
+++ b/pokemod/ItemEffect.h
@@ -27,6 +27,7 @@
#include <QString>
#include "Object.h"
#include "Pokemod.h"
+#include "MapWildList.h"
namespace PokeGen
{
@@ -66,7 +67,8 @@ namespace PokeGen
E_CoinCase = 26,
E_Berry = 27,
E_Acorn = 28,
- E_End = 29
+ E_Evolution = 29,
+ E_End = 30
};
static const char* EffectStr[E_End];
@@ -103,7 +105,14 @@ namespace PokeGen
};
static const char* AmountStr[A_End];
- // TODO (Ben#1#): More BallType(?)
+ enum SpecialPhysical
+ {
+ SP_Special = 0,
+ SP_Physical = 1,
+ SP_End = 2
+ };
+ static const char* SpecialPhysicalStr[SP_End];
+
enum BallType
{
B_Regular = 0,
@@ -115,11 +124,12 @@ namespace PokeGen
B_Battle = 6,
B_Friend = 7,
B_Stat = 8,
- B_End = 9
+ B_Type = 9,
+ B_Weight = 10,
+ B_End = 11
};
static const char* BallTypeStr[B_End];
- // TODO (Ben#1#): More BerryType(?)
enum BerryType
{
B2_HPCure = 0,
@@ -134,29 +144,27 @@ namespace PokeGen
void ImportIni(Ini& ini, const unsigned _id = UINT_MAX);
void ExportIni(QFile& fout, const QString& item) const;
- void SetOverworld(const bool o);
+ bool SetOverworld(const bool o);
void SetBattle(const bool b);
void SetHeld(const bool h);
bool SetEffect(const unsigned e);
bool SetVal1(const int v1);
- bool SetVal2(const int v2);
- bool SetVal3(const unsigned n, const unsigned d);
- bool SetVal3Num(const unsigned n);
- bool SetVal3Denom(const unsigned d);
- bool SetVal4(const unsigned v4);
- bool SetVal5(const unsigned v5);
+ bool SetVal2(const unsigned v2);
+ bool SetVal3(const unsigned v3);
+ bool SetVal4(const unsigned n, const unsigned d);
+ bool SetVal4Num(const unsigned n);
+ bool SetVal4Denom(const unsigned d);
bool GetOverworld() const;
bool GetBattle() const;
bool GetHeld() const;
unsigned GetEffect() const;
int GetVal1() const;
- int GetVal2() const;
- Frac GetVal3() const;
- unsigned GetVal3Num() const;
- unsigned GetVal3Denom() const;
- unsigned GetVal4() const;
- unsigned GetVal5() const;
+ unsigned GetVal2() const;
+ unsigned GetVal3() const;
+ Frac GetVal4() const;
+ unsigned GetVal4Num() const;
+ unsigned GetVal4Denom() const;
private:
bool Validate();
@@ -165,19 +173,10 @@ namespace PokeGen
bool held;
unsigned effect;
int val1;
- int val2;
- Frac val3;
- unsigned val4;
- unsigned val5;
+ unsigned val2;
+ unsigned val3;
+ Frac val4;
};
-
- const char* ItemEffect::EffectStr[ItemEffect::E_End] = {"HP Cure", "Revive", "Cure Status", "Level Boost", "Stat Boost", "Flinch", "Go First", "Keep Alive", "Modify Stat (Battle Only)", "Shield (Battle Only)", "Run (Battle Only)", "PP Boost", "Type Boost", "PP Restore", "Experience Share", "Fishing Rod", "Repel", "Escape", "TM", "HM", "Map", "Ball", "Itemfinder", "Bike", "Scope", "Coin", "Coin Case", "Berry", "Acorn"};
- const char* ItemEffect::RelativeStr[ItemEffect::R_End] = {"Absolute", "Relative"};
- const char* ItemEffect::EscapeStr[ItemEffect::ES_End] = {"Anywhere", "Dungeon"};
- const char* ItemEffect::RepelStr[ItemEffect::RP_End] = {"First", "Max", "All"};
- const char* ItemEffect::AmountStr[ItemEffect::A_End] = {"All", "One"};
- const char* ItemEffect::BallTypeStr[ItemEffect::B_End] = {"Regular", "Master", "Level", "Love", "Area", "Time", "Battle", "Friend", "Stat"};
- const char* ItemEffect::BerryTypeStr[ItemEffect::B2_End] = {"HP Cure", "Status Cure"};
}
}
diff --git a/pokemod/Map.cpp b/pokemod/Map.cpp
index d3c23879..1b1ac145 100644
--- a/pokemod/Map.cpp
+++ b/pokemod/Map.cpp
@@ -22,6 +22,8 @@
#include "Map.h"
+const char* PokeGen::PokeMod::Map::TypeStr[PokeGen::PokeMod::Map::End] = {"Outdoor", "Dungeon", "Building"};
+
PokeGen::PokeMod::Map::Map(const Pokemod* par, const unsigned _id) :
Object(_id, par),
name(""),
@@ -374,11 +376,8 @@ unsigned PokeGen::PokeMod::Map::GetEffectCount() const
const PokeGen::PokeMod::MapEffect* PokeGen::PokeMod::Map::NewEffect(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetEffectCount(); ++i)
- {
- if (GetEffectByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetEffectCount()) && (GetEffectByID(i) != UINT_MAX); ++i)
+ ;
MapEffect newEffect(pokemod, i);
if (ini)
newEffect.ImportIni(*ini);
@@ -421,11 +420,8 @@ unsigned PokeGen::PokeMod::Map::GetTrainerCount() const
const PokeGen::PokeMod::MapTrainer* PokeGen::PokeMod::Map::NewTrainer(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetTrainerCount(); ++i)
- {
- if (GetTrainerByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetTrainerCount()) && (GetTrainerByID(i) != UINT_MAX); ++i)
+ ;
MapTrainer newTrainer(pokemod, i);
if (ini)
newTrainer.ImportIni(*ini);
@@ -468,11 +464,8 @@ unsigned PokeGen::PokeMod::Map::GetWarpCount() const
const PokeGen::PokeMod::MapWarp* PokeGen::PokeMod::Map::NewWarp(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetWarpCount(); ++i)
- {
- if (GetWarpByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetWarpCount()) && (GetWarpByID(i) != UINT_MAX); ++i)
+ ;
MapWarp newWarp(pokemod, i);
if (ini)
newWarp.ImportIni(*ini);
@@ -515,11 +508,8 @@ unsigned PokeGen::PokeMod::Map::GetWildListCount() const
const PokeGen::PokeMod::MapWildList* PokeGen::PokeMod::Map::NewWildList(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetWildListCount(); ++i)
- {
- if (GetWildListByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetWildListCount()) && (GetWildListByID(i) != UINT_MAX); ++i)
+ ;
MapWildList newWildList(pokemod, i);
if (ini)
newWildList.ImportIni(*ini);
diff --git a/pokemod/Map.h b/pokemod/Map.h
index 15faa2d8..86a09fb6 100644
--- a/pokemod/Map.h
+++ b/pokemod/Map.h
@@ -27,8 +27,8 @@
#include <QList>
#include <QMap>
#include <QString>
+#include "../general/Matrix.h"
#include "Object.h"
-#include "Matrix.h"
#include "MapEffect.h"
#include "MapTrainer.h"
#include "MapWarp.h"
@@ -112,8 +112,6 @@ namespace PokeGen
QList<MapWarp> warps;
QList<MapWildList> wildLists;
};
-
- const char* Map::TypeStr[Map::End] = {"Outdoor", "Dungeon", "Building"};
}
}
diff --git a/pokemod/MapEffect.cpp b/pokemod/MapEffect.cpp
index 5d212f54..14b50d8d 100644
--- a/pokemod/MapEffect.cpp
+++ b/pokemod/MapEffect.cpp
@@ -22,6 +22,9 @@
#include "MapEffect.h"
+const char* PokeGen::PokeMod::MapEffect::MapEffectStr[PokeGen::PokeMod::MapEffect::E_End] = {"Item", "PC", "Strength Block", "Button", "Rock Smash", "Slot Machine", "Card Flip Game"};
+const char* PokeGen::PokeMod::MapEffect::PCTypeStr[PokeGen::PokeMod::MapEffect::PC_End] = {"Item", "Pokémon", "PokéDex", "Hall of Fame", "All"};
+
PokeGen::PokeMod::MapEffect::MapEffect(const Pokemod* par, const unsigned _id) :
Object(_id, par),
name(""),
@@ -91,7 +94,7 @@ bool PokeGen::PokeMod::MapEffect::Validate()
pokemod->ValidationMsg("Invalid effect");
isValid = false;
}
- if (DIR_End <= direction)
+ if (D_End_None <= direction)
{
pokemod->ValidationMsg("Invalid driection");
isValid = false;
@@ -248,7 +251,7 @@ bool PokeGen::PokeMod::MapEffect::SetVal2(const unsigned v2)
bool PokeGen::PokeMod::MapEffect::SetDirection(const unsigned d)
{
- if (d < DIR_End_None)
+ if (d < D_End_None)
direction = d;
return (direction == d);
}
@@ -275,7 +278,7 @@ QString PokeGen::PokeMod::MapEffect::GetName() const
return name;
}
-PokeGen::PokeMod::Point PokeGen::PokeMod::MapEffect::GetCoordinate() const
+PokeGen::Point PokeGen::PokeMod::MapEffect::GetCoordinate() const
{
return coordinate;
}
@@ -290,7 +293,7 @@ unsigned PokeGen::PokeMod::MapEffect::GetCoordinateY() const
return coordinate.GetY();
}
-PokeGen::PokeMod::Flag PokeGen::PokeMod::MapEffect::GetExistFlag() const
+PokeGen::Flag PokeGen::PokeMod::MapEffect::GetExistFlag() const
{
return existFlag;
}
diff --git a/pokemod/MapEffect.h b/pokemod/MapEffect.h
index b1a83a9e..1b23828d 100644
--- a/pokemod/MapEffect.h
+++ b/pokemod/MapEffect.h
@@ -26,8 +26,8 @@
#include <QFile>
#include <QString>
#include "Object.h"
-#include "Flag.h"
-#include "Point.h"
+#include "../general/Flag.h"
+#include "../general/Point.h"
#include "Dialog.h"
namespace PokeGen
@@ -113,9 +113,6 @@ namespace PokeGen
bool canMove;
unsigned dialog;
};
-
- const char* MapEffectStr[MapEffect::E_End] = {"Item", "PC", "Strength Block", "Button", "Rock Smash", "Slot Machine", "Card Flip Game"};
- const char* PCTypeStr[MapEffect::PC_End] = {"Item", "Pokémon", "PokéDex", "Hall of Fame", "All"};
}
}
diff --git a/pokemod/MapTrainer.cpp b/pokemod/MapTrainer.cpp
index 66b3b99b..cd08037b 100644
--- a/pokemod/MapTrainer.cpp
+++ b/pokemod/MapTrainer.cpp
@@ -58,7 +58,7 @@ bool PokeGen::PokeMod::MapTrainer::Validate()
pokemod->ValidationMsg("Skin could't be found");
isValid = false;
}
- if (DIR_End_None <= direction)
+ if (D_End_None <= direction)
{
pokemod->ValidationMsg("Invalid direction");
isValid = false;
@@ -209,7 +209,7 @@ void PokeGen::PokeMod::MapTrainer::SetSight(const unsigned s)
bool PokeGen::PokeMod::MapTrainer::SetDirection(const unsigned d)
{
- if (d < DIR_End_None)
+ if (d < D_End_None)
direction = d;
return (direction == d);
}
@@ -285,7 +285,7 @@ QString PokeGen::PokeMod::MapTrainer::GetName() const
return name;
}
-PokeGen::PokeMod::Point PokeGen::PokeMod::MapTrainer::GetCoordinate() const
+PokeGen::Point PokeGen::PokeMod::MapTrainer::GetCoordinate() const
{
return coordinate;
}
@@ -325,7 +325,7 @@ QString PokeGen::PokeMod::MapTrainer::GetAI() const
return ai;
}
-PokeGen::PokeMod::Flag PokeGen::PokeMod::MapTrainer::GetAppearFlag() const
+PokeGen::Flag PokeGen::PokeMod::MapTrainer::GetAppearFlag() const
{
return appearFlag;
}
@@ -385,11 +385,8 @@ unsigned PokeGen::PokeMod::MapTrainer::GetPokemonCount() const
const PokeGen::PokeMod::MapTrainerPokemon* PokeGen::PokeMod::MapTrainer::NewPokemon(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetPokemonCount(); ++i)
- {
- if (GetPokemonByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetPokemonCount()) && (GetPokemonByID(i) != UINT_MAX); ++i)
+ ;
MapTrainerPokemon newPokemon(pokemod, i);
if (ini)
newPokemon.ImportIni(*ini);
diff --git a/pokemod/MapTrainer.h b/pokemod/MapTrainer.h
index 26011e6c..43fcb927 100644
--- a/pokemod/MapTrainer.h
+++ b/pokemod/MapTrainer.h
@@ -27,9 +27,9 @@
#include <QList>
#include <QMap>
#include <QString>
+#include "../general/Flag.h"
+#include "../general/Point.h"
#include "Object.h"
-#include "Flag.h"
-#include "Point.h"
#include "Dialog.h"
#include "MapTrainerPokemon.h"
diff --git a/pokemod/MapTrainerPokemon.cpp b/pokemod/MapTrainerPokemon.cpp
index 1acb6dcd..6ba80bb8 100644
--- a/pokemod/MapTrainerPokemon.cpp
+++ b/pokemod/MapTrainerPokemon.cpp
@@ -25,7 +25,8 @@
PokeGen::PokeMod::MapTrainerPokemon::MapTrainerPokemon(const Pokemod* par, const unsigned _id) :
Object(_id, par),
species(UINT_MAX),
- level(1)
+ level(UINT_MAX),
+ nature(UINT_MAX)
{
}
@@ -38,7 +39,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->GetPokemonByID(species) == UINT_MAX)
+ if (pokemod->GetSpeciesByID(species) == UINT_MAX)
{
pokemod->ValidationMsg("Invalid species");
isValid = false;
@@ -79,6 +80,11 @@ 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");
@@ -99,7 +105,8 @@ void PokeGen::PokeMod::MapTrainerPokemon::ImportIni(Ini& ini, const unsigned _id
unsigned j;
items.clear();
ini.GetValue("species", species);
- ini.GetValue("level", level, 1);
+ ini.GetValue("level", level);
+ ini.GetValue("nature", nature);
ini.GetValue("numItems", i, 0);
for (unsigned k = 0; k < i; ++k)
{
@@ -115,6 +122,7 @@ 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]);
@@ -123,7 +131,7 @@ void PokeGen::PokeMod::MapTrainerPokemon::ExportIni(QFile& fout, const QString&
bool PokeGen::PokeMod::MapTrainerPokemon::SetSpecies(const unsigned s)
{
- if (pokemod->GetPokemonByID(s) != UINT_MAX)
+ if (pokemod->GetSpeciesByID(s) != UINT_MAX)
species = s;
return (species == s);
}
@@ -135,6 +143,13 @@ 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;
@@ -145,6 +160,11 @@ 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())
diff --git a/pokemod/MapTrainerPokemon.h b/pokemod/MapTrainerPokemon.h
index 33b7355d..0f480439 100644
--- a/pokemod/MapTrainerPokemon.h
+++ b/pokemod/MapTrainerPokemon.h
@@ -29,7 +29,7 @@
#include "Object.h"
#include "Pokemod.h"
#include "Item.h"
-#include "Pokemon.h"
+#include "Species.h"
namespace PokeGen
{
@@ -46,9 +46,11 @@ namespace PokeGen
bool SetSpecies(const unsigned s);
bool SetLevel(const unsigned l);
+ bool SetNature(const unsigned n);
unsigned GetSpecies() const;
unsigned GetLevel() const;
+ unsigned GetNature() const;
unsigned GetItem(const unsigned i) const;
unsigned GetItemByID(const unsigned _id) const;
@@ -60,6 +62,7 @@ namespace PokeGen
unsigned species;
unsigned level;
+ unsigned nature;
QList<unsigned> items;
};
}
diff --git a/pokemod/MapWarp.cpp b/pokemod/MapWarp.cpp
index 9864ea19..36252201 100644
--- a/pokemod/MapWarp.cpp
+++ b/pokemod/MapWarp.cpp
@@ -22,6 +22,8 @@
#include "MapWarp.h"
+const char* PokeGen::PokeMod::MapWarp::TypeStr[PokeGen::PokeMod::MapWarp::End] = {"Door/Stair", "Warp Pad", "Hole", "Boundary"};
+
PokeGen::PokeMod::MapWarp::MapWarp(const Pokemod* par, const unsigned _id) :
Object(_id, par),
name(""),
@@ -61,7 +63,7 @@ bool PokeGen::PokeMod::MapWarp::Validate()
pokemod->ValidationMsg("No access from any direction");
isValid = false;
}
- if (DIR_End_None <= directionOut)
+ if (D_End_None <= directionOut)
{
pokemod->ValidationMsg("Invalid direction out");
isValid = false;
@@ -186,7 +188,7 @@ void PokeGen::PokeMod::MapWarp::SetFromRight(const bool f)
bool PokeGen::PokeMod::MapWarp::SetDirectionOut(const unsigned d)
{
- if (d < DIR_End)
+ if (d < D_End)
directionOut = d;
return (directionOut == d);
}
@@ -265,7 +267,7 @@ QString PokeGen::PokeMod::MapWarp::GetName() const
return name;
}
-PokeGen::PokeMod::Point PokeGen::PokeMod::MapWarp::GetCoordinate() const
+PokeGen::Point PokeGen::PokeMod::MapWarp::GetCoordinate() const
{
return coordinate;
}
@@ -335,7 +337,7 @@ unsigned PokeGen::PokeMod::MapWarp::GetToWarp() const
return toWarp;
}
-PokeGen::PokeMod::Flag PokeGen::PokeMod::MapWarp::GetWorkingFlag() const
+PokeGen::Flag PokeGen::PokeMod::MapWarp::GetWorkingFlag() const
{
return workingFlag;
}
diff --git a/pokemod/MapWarp.h b/pokemod/MapWarp.h
index 39239b15..773b0be8 100644
--- a/pokemod/MapWarp.h
+++ b/pokemod/MapWarp.h
@@ -25,9 +25,9 @@
#include <QFile>
#include <QString>
+#include "../general/Flag.h"
+#include "../general/Point.h"
#include "Object.h"
-#include "Flag.h"
-#include "Point.h"
#include "Dialog.h"
#include "Map.h"
@@ -112,8 +112,6 @@ namespace PokeGen
Flag workingFlag;
unsigned dialog;
};
-
- const char* MapWarp::TypeStr[MapWarp::End] = {"Door/Stair", "Warp Pad", "Hole", "Boundary"};
}
}
diff --git a/pokemod/MapWildList.cpp b/pokemod/MapWildList.cpp
index 4b846246..681dd56f 100644
--- a/pokemod/MapWildList.cpp
+++ b/pokemod/MapWildList.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
// Name: pokemod/MapWildList.cpp
-// Purpose: Define a list of Pokémon that can be found on the map
+// Purpose: Define a list of species that can be found on the map
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Mar 20 19:18:23 2007
@@ -22,6 +22,8 @@
#include "MapWildList.h"
+const char* PokeGen::PokeMod::MapWildList::ControlStr[PokeGen::PokeMod::MapWildList::End] = {"Grass", "Surfing", "Fishing", "Dive", "Headbutt", "Rock Smash"};
+
PokeGen::PokeMod::MapWildList::MapWildList(const Pokemod* par, const unsigned _id) :
Object(_id, par),
control(UINT_MAX),
@@ -268,11 +270,8 @@ unsigned PokeGen::PokeMod::MapWildList::GetPokemonCount() const
const PokeGen::PokeMod::MapWildListPokemon* PokeGen::PokeMod::MapWildList::NewPokemon(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetPokemonCount(); ++i)
- {
- if (GetPokemonByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetPokemonCount()) && (GetPokemonByID(i) != UINT_MAX); ++i)
+ ;
MapWildListPokemon newPokemon(pokemod, i);
if (ini)
newPokemon.ImportIni(*ini);
diff --git a/pokemod/MapWildList.h b/pokemod/MapWildList.h
index e95d15a4..676805b0 100644
--- a/pokemod/MapWildList.h
+++ b/pokemod/MapWildList.h
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
// Name: pokemod/MapWildList.h
-// Purpose: Define a list of Pokémon that can be found on the map
+// Purpose: Define a list of species that can be found on the map
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Mar 20 19:18:23 2007
@@ -82,8 +82,6 @@ namespace PokeGen
QList<MapWildListPokemon> pokemon;
};
-
- const char* ControlStr[MapWildList::End] = {"Grass", "Surfing", "Fishing", "Dive", "Headbutt", "Rock Smash"};
}
}
diff --git a/pokemod/MapWildListPokemon.cpp b/pokemod/MapWildListPokemon.cpp
index 896dcdf4..92dc3112 100644
--- a/pokemod/MapWildListPokemon.cpp
+++ b/pokemod/MapWildListPokemon.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
// Name: pokemod/MapWildListPokemon.cpp
-// Purpose: Define a Pokémon that can be found in the wild
+// Purpose: Define a species that can be found in the wild
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Mar 20 18:50:59 2007
@@ -39,7 +39,7 @@ PokeGen::PokeMod::MapWildListPokemon::MapWildListPokemon(const Pokemod* par, Ini
bool PokeGen::PokeMod::MapWildListPokemon::Validate()
{
pokemod->ValidationMsg(QString("---------Pokémon with id %1---").arg(id), Pokemod::V_Msg);
- if (pokemod->GetPokemonByID(species) == UINT_MAX)
+ if (pokemod->GetSpeciesByID(species) == UINT_MAX)
{
pokemod->ValidationMsg("Invalid species");
isValid = false;
@@ -80,7 +80,7 @@ void PokeGen::PokeMod::MapWildListPokemon::ExportIni(QFile& fout, const QString&
bool PokeGen::PokeMod::MapWildListPokemon::SetSpecies(const unsigned s)
{
- if (pokemod->GetPokemonByID(s) != UINT_MAX)
+ if (pokemod->GetSpeciesByID(s) != UINT_MAX)
{
species = s;
return true;
diff --git a/pokemod/MapWildListPokemon.h b/pokemod/MapWildListPokemon.h
index 4233c982..55b10d7c 100644
--- a/pokemod/MapWildListPokemon.h
+++ b/pokemod/MapWildListPokemon.h
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
// Name: pokemod/MapWildListPokemon.h
-// Purpose: Define a Pokémon that can be found in the wild
+// Purpose: Define a species that can be found in the wild
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Mar 20 18:50:59 2007
@@ -20,14 +20,14 @@
// with this program. If not, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////////////////
-#ifndef __POKEMOD_MAPWILDLISTPOKEMON__
-#define __POKEMOD_MAPWILDLISTPOKEMON__
+#ifndef __POKEMOD_MAPWILDLISTSPECIES__
+#define __POKEMOD_MAPWILDLISTSPECIES__
#include <QFile>
#include <QString>
#include "Object.h"
#include "Pokemod.h"
-#include "Pokemon.h"
+#include "Species.h"
namespace PokeGen
{
diff --git a/pokemod/Matrix.h b/pokemod/Matrix.h
deleted file mode 100644
index df7e807e..00000000
--- a/pokemod/Matrix.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/Matrix.h
-// Purpose: A 2D vector class
-// Author: Ben Boeckel
-// Modified by: Ben Boeckel
-// Created: Sun Apr 8 12:51:20 2007
-// Copyright: ©2007 Nerdy Productions
-// Licence:
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program. If not, see <http://www.gnu.org/licenses/>.
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef __POKEMOD_MATRIX__
-#define __POKEMOD_MATRIX__
-
-#include <QFile>
-#include <QVector>
-#include "../Ini.h"
-#include "Frac.h"
-#include "Point.h"
-
-namespace PokeGen
-{
- namespace PokeMod
- {
- template<class T> class MatrixBase
- {
- public:
- MatrixBase() :
- width(0),
- height(0)
- {
- }
- MatrixBase(const unsigned w, const unsigned h, const T& d = T()) :
- width(w),
- height(h),
- matrix(w, QVector<T>(h, d))
- {
- }
-
- void AddRow(const T& d = T())
- {
- for (typename QVector< QVector<T> >::Iterator i = matrix.begin(); i != matrix.end(); ++i)
- i->append(d);
- ++height;
- }
- void AddCol(const T& d = T())
- {
- matrix.append(QVector<T>(height, d));
- ++width;
- }
- bool InsertRow(const unsigned pos, const T& d = T())
- {
- if (height < pos)
- return false;
- for (typename QVector< QVector<T> >::Iterator i = matrix.begin(); i != matrix.end(); ++i)
- i->insert(i->begin() + pos, d);
- ++height;
- return true;
- }
- bool InsertCol(const unsigned pos, const T& d = T())
- {
- if (width < pos)
- return false;
- matrix.insert(matrix.begin() + pos, QVector<T>(height, d));
- ++width;
- return true;
- }
- bool DeleteRow(const unsigned pos)
- {
- if (height <= pos)
- return false;
- for (typename QVector< QVector<T> >::Iterator i = matrix.begin(); i != matrix.end(); ++i)
- i->erase(i->begin() + pos);
- --height;
- return true;
- }
- bool DeleteCol(const unsigned pos)
- {
- if (width <= pos)
- return false;
- matrix.erase(matrix.begin() + pos);
- --width;
- return true;
- }
- void Clear()
- {
- matrix.clear();
- }
-
- bool Set(const unsigned row, const unsigned col, const T& s)
- {
- if ((width <= col) || (height <= col))
- return false;
- (matrix.begin() + col)->assign(row, s);
- return true;
- }
- void Resize(const unsigned w, const unsigned h, const T& d = T())
- {
- Clear();
- width = w;
- height = h;
- matrix = QVector< QVector<T> >(w, QVector<T>(h, d));
- }
-
- T& Get(const unsigned row, const unsigned col) const
- {
- if ((width <= col) || (height <= col))
- return T();
- return matrix[col][row];
- }
- const QVector<T> GetRow(const unsigned row) const
- {
- QVector<T> r;
- for (typename QVector< QVector<T> >::Iterator i = matrix.begin(); i != matrix.end(); ++i)
- r.append(i->at(row));
- return r;
- }
- const QVector<T> GetCol(const unsigned col) const
- {
- return matrix[col];
- }
- unsigned GetHeight() const
- {
- return height;
- }
- unsigned GetWidth() const
- {
- return width;
- }
- Point GetSize() const
- {
- return Point(width, height);
- }
-
- T& operator()(const Point& p)
- {
- return matrix.value[p.GetX()][p.GetY()];
- }
- const T& operator()(const Point& p) const
- {
- return matrix.value[p.GetX()][p.GetY()];
- }
- T& operator()(const unsigned col, const unsigned row)
- {
- return matrix[col][row];
- }
- const T& operator()(const unsigned col, const unsigned row) const
- {
- return matrix[col][row];
- }
- protected:
- unsigned width;
- unsigned height;
- QVector< QVector<T> > matrix;
- };
-
- template<class T> class Matrix : public MatrixBase<T>
- {
- public:
- Matrix() :
- MatrixBase<T>()
- {
- }
- Matrix(const unsigned w, const unsigned h, const T& d = T()) :
- MatrixBase<T>(w, h, d)
- {
- }
- Matrix(Ini& ini)
- {
- ImportIni(ini);
- }
-
- void ImportIni(Ini& ini)
- {
- ini.GetValue("width", MatrixBase<T>::width, 0);
- ini.GetValue("height", MatrixBase<T>::height, 0);
- if (!(MatrixBase<T>::width && MatrixBase<T>::height))
- return;
- MatrixBase<T>::matrix.resize(MatrixBase<T>::width, QVector<T>(MatrixBase<T>::height, 0));
- for (unsigned i = 0; i < MatrixBase<T>::width; ++i)
- {
- for (unsigned j = 0; j < MatrixBase<T>::height; ++j)
- {
- int k;
- ini.GetValue(QString("Element-%1-%2").arg(i).arg(j), k, 0);
- MatrixBase<T>::matrix[i][j] = k;
- }
- }
- }
- void ExportIni(QFile& fout, const QString& val) const
- {
- // Declare the elements
- Ini exMatrix(val);
- exMatrix.AddField("height", MatrixBase<T>::height);
- exMatrix.AddField("width", MatrixBase<T>::width);
- for (int i = 0; i < MatrixBase<T>::width; ++i)
- {
- for (unsigned j = 0; j < MatrixBase<T>::height; ++j)
- exMatrix.AddField(QString("Element-%1-%2").arg(i).arg(j), MatrixBase<T>::matrix[i][j]);
- }
- }
- };
-
- class MatrixFrac : public MatrixBase<Frac>
- {
- public:
- MatrixFrac() :
- MatrixBase<Frac>()
- {
- }
- MatrixFrac(const unsigned w, const unsigned h, const Frac &d = Frac()) :
- MatrixBase<Frac>(w, h, d)
- {
- }
- MatrixFrac(Ini& ini)
- {
- ImportIni(ini);
- }
-
- void ImportIni(Ini& ini)
- {
- ini.GetValue("width", MatrixBase<Frac>::width, 0);
- ini.GetValue("height", MatrixBase<Frac>::height, 0);
- if (!(MatrixBase<Frac>::width && MatrixBase<Frac>::height))
- return;
- MatrixBase<Frac>::matrix.resize(MatrixBase<Frac>::width);
- MatrixBase<Frac>::matrix.fill(QVector<Frac>(MatrixBase<Frac>::height, Frac(1, 1)));
- for (unsigned i = 0; i < MatrixBase<Frac>::width; ++i)
- {
- for (unsigned j = 0; j < MatrixBase<Frac>::height; ++j)
- {
- unsigned k;
- unsigned l;
- bool m;
- ini.GetValue(QString("Element-%1-%2-n").arg(i).arg(j), k, 0);
- ini.GetValue(QString("Element-%1-%2-d").arg(i).arg(j), l, 0);
- ini.GetValue(QString("Element-%1-%2-t").arg(i).arg(j), m, 0);
- MatrixBase<Frac>::matrix[i][j].Set(k, l, m);
- }
- }
- }
- void ExportIni(QFile& fout, const QString& val) const
- {
- // Declare the elements
- Ini exMatrix(val);
- exMatrix.AddField("height", MatrixBase<Frac>::height);
- exMatrix.AddField("width", MatrixBase<Frac>::width);
- for (unsigned i = 0; i < MatrixBase<Frac>::width; ++i)
- {
- for (unsigned j = 0; j < MatrixBase<Frac>::height; ++j)
- {
- exMatrix.AddField(QString("Element-%1-%2-t").arg(i).arg(j), MatrixBase<Frac>::matrix[i][j].GetType());
- exMatrix.AddField(QString("Element-%1-%2-n").arg(i).arg(j), MatrixBase<Frac>::matrix[i][j].GetNum());
- exMatrix.AddField(QString("Element-%1-%2-d").arg(i).arg(j), MatrixBase<Frac>::matrix[i][j].GetDenom());
- }
- }
- exMatrix.Export(fout);
- }
- };
- }
-}
-
-#endif
diff --git a/pokemod/Move.cpp b/pokemod/Move.cpp
index f38a62b3..68749cac 100644
--- a/pokemod/Move.cpp
+++ b/pokemod/Move.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
// Name: pokemod/Move.cpp
-// Purpose: Define a move that Pokémon can learn
+// Purpose: Define a move that species can learn
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Sat May 26 2007 22:51:21
@@ -22,6 +22,9 @@
#include "Move.h"
+const char* PokeGen::PokeMod::Move::TargetStr[PokeGen::PokeMod::Move::T_End] = {"Player", "Enemy", "Both", "Random"};
+const char* PokeGen::PokeMod::Move::ChoiceStr[PokeGen::PokeMod::Move::C_End] = {"Player", "Enemy", "Random"};
+
PokeGen::PokeMod::Move::Move(const Pokemod* par, const unsigned _id) :
Object(_id, par),
name(""),
@@ -232,7 +235,7 @@ QString PokeGen::PokeMod::Move::GetName() const
return name;
}
-PokeGen::PokeMod::Frac PokeGen::PokeMod::Move::GetAccuracy() const
+PokeGen::Frac PokeGen::PokeMod::Move::GetAccuracy() const
{
return accuracy;
}
@@ -322,11 +325,8 @@ unsigned PokeGen::PokeMod::Move::GetEffectCount() const
const PokeGen::PokeMod::MoveEffect* PokeGen::PokeMod::Move::NewEffect(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetEffectCount(); ++i)
- {
- if (!GetEffect(i))
- break;
- }
+ for (; (i < GetEffectCount()) && (GetEffectByID(i) != UINT_MAX); ++i)
+ ;
MoveEffect newEffect(pokemod, i);
if (ini)
newEffect.ImportIni(*ini);
diff --git a/pokemod/Move.h b/pokemod/Move.h
index 8c131731..ef429c23 100644
--- a/pokemod/Move.h
+++ b/pokemod/Move.h
@@ -116,9 +116,6 @@ namespace PokeGen
QList<MoveEffect> effects;
};
-
- const char* Move::TargetStr[Move::T_End] = {"Player", "Enemy", "Both", "Random"};
- const char* Move::ChoiceStr[Move::C_End] = {"Player", "Enemy", "Random"};
}
}
diff --git a/pokemod/MoveEffect.cpp b/pokemod/MoveEffect.cpp
index 4ceedbb8..7a8a5aca 100644
--- a/pokemod/MoveEffect.cpp
+++ b/pokemod/MoveEffect.cpp
@@ -22,6 +22,8 @@
#include "MoveEffect.h"
+const char* PokeGen::PokeMod::MoveEffect::EffectStr[PokeGen::PokeMod::MoveEffect::E_End] = {};
+
PokeGen::PokeMod::MoveEffect::MoveEffect(const Pokemod* par, const unsigned _id) :
Object(_id, par),
chance(1, 1),
@@ -98,7 +100,6 @@ bool PokeGen::PokeMod::MoveEffect::SetEffect(const unsigned e)
return (effect == e);
}
-// TODO (Ben#1#): Effect code
bool PokeGen::PokeMod::MoveEffect::SetVal1(const int v1)
{
val1 = v1;
@@ -111,7 +112,7 @@ bool PokeGen::PokeMod::MoveEffect::SetVal2(const unsigned v2)
return (val2 == v2);
}
-PokeGen::PokeMod::Frac PokeGen::PokeMod::MoveEffect::GetChance() const
+PokeGen::Frac PokeGen::PokeMod::MoveEffect::GetChance() const
{
return chance;
}
diff --git a/pokemod/MoveEffect.h b/pokemod/MoveEffect.h
index 4f3a64f4..f52e333b 100644
--- a/pokemod/MoveEffect.h
+++ b/pokemod/MoveEffect.h
@@ -25,10 +25,10 @@
#include <QFile>
#include <QString>
+#include "../general/Frac.h"
+#include "../general/Ref.h"
#include "Object.h"
#include "Pokemod.h"
-#include "Frac.h"
-#include "Ref.h"
namespace PokeGen
{
@@ -41,6 +41,7 @@ namespace PokeGen
{
E_End
};
+ // TODO (Ben#1#): Move Effects
static const char* EffectStr[E_End];
MoveEffect(const Pokemod* par, const unsigned _id);
@@ -49,30 +50,34 @@ namespace PokeGen
void ImportIni(Ini& ini, const unsigned _id = UINT_MAX);
void ExportIni(QFile& fout, const QString& move) const;
- bool SetChance(const Frac& c);
bool SetChance(const unsigned n, const unsigned d);
bool SetChanceNum(const unsigned n);
bool SetChanceDenom(const unsigned d);
bool SetEffect(const unsigned e);
- bool SetVal1(const int v1);
- bool SetVal2(const unsigned v2);
+ bool SetVal1(const unsigned v1);
+ bool SetVal2(const int v2);
+ bool SetVal3(const unsigned n, const unsigned d);
+ bool SetVal3Num(const unsigned n);
+ bool SetVal3Denom(const unsigned d);
Frac GetChance() const;
unsigned GetChanceNum() const;
unsigned GetChanceDenom() const;
unsigned GetEffect() const;
- int GetVal1() const;
- unsigned GetVal2() const;
+ unsigned GetVal1() const;
+ int GetVal2() const;
+ Frac GetVal3() const;
+ unsigned GetVal3Num() const;
+ unsigned GetVal3Denom() const;
private:
bool Validate();
Frac chance;
unsigned effect;
- int val1;
- unsigned val2;
+ unsigned val1;
+ int val2;
+ Frac val3
};
-
- const char* MoveEffect::EffectStr[MoveEffect::E_End] = {};
}
}
diff --git a/pokemod/Nature.cpp b/pokemod/Nature.cpp
index 816d005d..ac028170 100644
--- a/pokemod/Nature.cpp
+++ b/pokemod/Nature.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
// Name: pokemod/Nature.cpp
-// Purpose: Define a nature that Pokémon can possess
+// Purpose: Define a nature that species can possess
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Sun Mar 18 22:58:48 2007
@@ -24,7 +24,8 @@
PokeGen::PokeMod::Nature::Nature(const Pokemod* par, const unsigned _id) :
Object(_id, par),
- name("")
+ name(""),
+ weight(1)
{
for (unsigned i = 0; i < ST_End_GSC; ++i)
stats[i].Set(1, 1, true);
@@ -44,6 +45,11 @@ bool PokeGen::PokeMod::Nature::Validate()
pokemod->ValidationMsg("Name is not defined");
isValid = false;
}
+ if (!weight)
+ {
+ pokemod->ValidationMsg("Weight is not valid");
+ isValid = false;
+ }
return isValid;
}
@@ -62,6 +68,7 @@ void PokeGen::PokeMod::Nature::ImportIni(Ini& ini, const unsigned _id)
ini.GetValue(QString("stat-%1-n").arg(k), j, 1);
stats[k].Set(1, 1, true);
}
+ ini.GetValue("weight", weight);
}
void PokeGen::PokeMod::Nature::ExportIni(QFile& fout) const
@@ -73,6 +80,7 @@ void PokeGen::PokeMod::Nature::ExportIni(QFile& fout) const
exNature.AddField(QString("stat-%1-n").arg(i), stats[i].GetNum());
exNature.AddField(QString("stat-%1-d").arg(i), stats[i].GetNum());
}
+ exNature.AddField("weight", weight);
exNature.Export(fout);
}
@@ -102,12 +110,19 @@ bool PokeGen::PokeMod::Nature::SetStatDenom(const unsigned s, const unsigned d)
return false;
}
+bool PokeGen::PokeMod::Nature::SetWeight(const unsigned w)
+{
+ if (w)
+ weight = w;
+ return (weight == w);
+}
+
QString PokeGen::PokeMod::Nature::GetName() const
{
return name;
}
-PokeGen::PokeMod::Frac PokeGen::PokeMod::Nature::GetStat(const unsigned s) const
+PokeGen::Frac PokeGen::PokeMod::Nature::GetStat(const unsigned s) const
{
if (s < (pokemod->IsSpecialSplit() ? ST_End_GSC : ST_End_RBY))
return stats[s];
@@ -123,3 +138,8 @@ unsigned PokeGen::PokeMod::Nature::GetStatDenom(const unsigned s) const
{
return GetStat(s).GetDenom();
}
+
+unsigned PokeGen::PokeMod::Nature::GetWeight() const
+{
+ return weight;
+}
diff --git a/pokemod/Nature.h b/pokemod/Nature.h
index 5e6f0937..e18535e4 100644
--- a/pokemod/Nature.h
+++ b/pokemod/Nature.h
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
// Name: pokemod/Nature.h
-// Purpose: Define a nature that Pokémon can possess
+// Purpose: Define a nature that species can possess
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Sun Mar 18 22:58:48 2007
@@ -25,10 +25,10 @@
#include <QFile>
#include <QString>
+#include "../general/Frac.h"
+#include "../general/Ref.h"
#include "Object.h"
#include "Pokemod.h"
-#include "Frac.h"
-#include "Ref.h"
namespace PokeGen
{
@@ -47,16 +47,19 @@ namespace PokeGen
bool SetStat(const unsigned s, const unsigned n, const unsigned d);
bool SetStatNum(const unsigned s, const unsigned n);
bool SetStatDenom(const unsigned s, const unsigned d);
+ bool SetWeight(const unsigned w);
QString GetName() const;
Frac GetStat(const unsigned s) const;
unsigned GetStatNum(const unsigned s) const;
unsigned GetStatDenom(const unsigned s) const;
+ unsigned GetWeight() const;
private:
bool Validate();
QString name;
Frac stats[ST_End_GSC];
+ unsigned weight;
};
}
}
diff --git a/pokemod/Object.h b/pokemod/Object.h
index 6887b0cd..707401d1 100644
--- a/pokemod/Object.h
+++ b/pokemod/Object.h
@@ -24,7 +24,7 @@
#define __POKEMOD_OBJECT__
#include <fstream>
-#include "../Ini.h"
+#include "../general/Ini.h"
namespace PokeGen
{
diff --git a/pokemod/Point.h b/pokemod/Point.h
deleted file mode 100644
index 93a395bc..00000000
--- a/pokemod/Point.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/Point.h
-// Purpose: Define a coordinate point for use in a PokéMod
-// Author: Ben Boeckel
-// Modified by: Ben Boeckel
-// Created: Sun Apr 8 12:53:15 2007
-// Copyright: ©2007 Nerdy Productions
-// Licence:
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program. If not, see <http://www.gnu.org/licenses/>.
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef __POKEMOD_POINT__
-#define __POKEMOD_POINT__
-
-#include <QFile>
-#include "../Ini.h"
-
-namespace PokeGen
-{
- namespace PokeMod
- {
- class Point
- {
- public:
- inline Point(const unsigned _x = 0, const unsigned _y = 0) :
- x(_x),
- y(_y)
- {
- }
-
- void ImportIni(Ini& ini);
- void ExportIni(QFile& fout, const QString& val) const;
-
- inline void Set(const unsigned _x, const unsigned _y)
- {
- x = _x;
- y = _y;
- }
- inline void SetX(const unsigned _x)
- {
- x = _x;
- }
- inline void SetY(const unsigned _y)
- {
- y = _y;
- }
-
- inline unsigned GetX() const
- {
- return x;
- }
- inline unsigned GetY() const
- {
- return y;
- }
- private:
- unsigned x;
- unsigned y;
- };
- }
-}
-
-#endif
diff --git a/pokemod/Pokemod.cpp b/pokemod/Pokemod.cpp
index e3eebda7..f2cbb059 100644
--- a/pokemod/Pokemod.cpp
+++ b/pokemod/Pokemod.cpp
@@ -82,7 +82,7 @@ bool PokeGen::PokeMod::Pokemod::Validate()
}
if (description == "")
ValidationMsg("Description is not defined", V_Warn);
- if (genderAllowed && breedingAllowed && !GetPokemon(eggSpecies))
+ if (genderAllowed && breedingAllowed && !GetSpecies(eggSpecies))
{
ValidationMsg("Invalid egg species");
isValid = false;
@@ -144,7 +144,7 @@ bool PokeGen::PokeMod::Pokemod::Validate()
ValidationMsg("Invalid starting map");
isValid = false;
}
- if (DIR_End <= startDirection)
+ if (D_End <= startDirection)
{
ValidationMsg("Invalid starting direction");
isValid = false;
@@ -550,9 +550,9 @@ bool PokeGen::PokeMod::Pokemod::Validate()
isValid = false;
}
}
- if (GetPokemonCount())
+ if (GetSpeciesCount())
{
- for (QList<Pokemon>::Iterator i = pokemon.begin(); i != pokemon.end(); ++i)
+ for (QList<Species>::Iterator i = species.begin(); i != species.end(); ++i)
{
if (!i->IsValid())
isValid = false;
@@ -583,36 +583,6 @@ bool PokeGen::PokeMod::Pokemod::Validate()
ValidationMsg("There are no Pokémon");
isValid = false;
}
- if (GetStatusCount())
- {
- for (QList<Status>::Iterator i = statuses.begin(); i != statuses.end(); ++i)
- {
- if (!i->IsValid())
- isValid = false;
- ++idChecker[i->GetId()];
- ++nameChecker[i->GetName()];
- }
- for (QMap<unsigned, unsigned>::ConstIterator i = idChecker.begin(); i != idChecker.end(); ++i)
- {
- if (1 < i.value())
- {
- ValidationMsg(QString("There are %1 Statuses with id %2").arg(i.value()).arg(i.key()));
- isValid = false;
- }
- }
- for (QMap<QString, unsigned>::ConstIterator i = nameChecker.begin(); i != nameChecker.end(); ++i)
- {
- if (1 < i.value())
- {
- ValidationMsg(QString("There are %1 Statuses with the name \"%2\"").arg(i.value()).arg(i.key()));
- isValid = false;
- }
- }
- idChecker.clear();
- nameChecker.clear();
- }
- else
- ValidationMsg("There are no statuses", V_Warn);
if (GetStoreCount())
{
for (QList<Store>::Iterator i = stores.begin(); i != stores.end(); ++i)
@@ -837,10 +807,8 @@ void PokeGen::PokeMod::Pokemod::ImportIni(const QString& f)
NewMove(&curSection);
else if (curSection.GetName() == "nature")
NewNature(&curSection);
- else if (curSection.GetName() == "pokemon")
- NewPokemon(&curSection);
- else if (curSection.GetName() == "status")
- NewStatus(&curSection);
+ else if (curSection.GetName() == "species")
+ NewSpecies(&curSection);
else if (curSection.GetName() == "store")
NewStore(&curSection);
else if (curSection.GetName() == "tile")
@@ -943,57 +911,39 @@ void PokeGen::PokeMod::Pokemod::ImportIni(const QString& f)
}
sections.erase(i);
}
- else if (s[0] == "pokemonAbility")
- {
- for (unsigned j = 0; j < GetPokemonCount(); ++j)
- {
- if (pokemon[j].GetName() == s[1])
- pokemon[j].NewAbility(&*i);
- }
- sections.erase(i);
- }
- else if (s[0] == "pokemonEvolution")
+ else if (s[0] == "speciesAbility")
{
- for (unsigned j = 0; j < GetPokemonCount(); ++j)
+ for (unsigned j = 0; j < GetSpeciesCount(); ++j)
{
- if (pokemon[j].GetName() == s[1])
- pokemon[j].NewEvolution(&*i);
+ if (species[j].GetName() == s[1])
+ species[j].NewAbility(&*i);
}
sections.erase(i);
}
- else if (s[0] == "pokemonItem")
+ else if (s[0] == "speciesEvolution")
{
- for (unsigned j = 0; j < GetPokemonCount(); ++j)
+ for (unsigned j = 0; j < GetSpeciesCount(); ++j)
{
- if (pokemon[j].GetName() == s[1])
- pokemon[j].NewItem(&*i);
+ if (species[j].GetName() == s[1])
+ species[j].NewEvolution(&*i);
}
sections.erase(i);
}
- else if (s[0] == "pokemonMove")
+ else if (s[0] == "speciesItem")
{
- for (unsigned j = 0; j < GetPokemonCount(); ++j)
+ for (unsigned j = 0; j < GetSpeciesCount(); ++j)
{
- if (pokemon[j].GetName() == s[1])
- pokemon[j].NewMove(&*i);
+ if (species[j].GetName() == s[1])
+ species[j].NewItem(&*i);
}
sections.erase(i);
}
- else if (s[0] == "pokemonNature")
+ else if (s[0] == "speciesMove")
{
- for (unsigned j = 0; j < GetPokemonCount(); ++j)
+ for (unsigned j = 0; j < GetSpeciesCount(); ++j)
{
- if (pokemon[j].GetName() == s[1])
- pokemon[j].NewNature(&*i);
- }
- sections.erase(i);
- }
- else if (s[0] == "statusEffect")
- {
- for (unsigned j = 0; j < GetStatusCount(); ++j)
- {
- if (statuses[j].GetName() == s[1])
- statuses[j].NewEffect(&*i);
+ if (species[j].GetName() == s[1])
+ species[j].NewMove(&*i);
}
sections.erase(i);
}
@@ -1006,7 +956,7 @@ void PokeGen::PokeMod::Pokemod::ImportIni(const QString& f)
u = s[1].toUInt(&ok);
if (ok)
{
- if (s[0] == "mapTrainerPokemon")
+ if (s[0] == "mapTrainerSpecies")
{
for (unsigned j = 0; j < GetMapCount(); ++j)
{
@@ -1111,9 +1061,7 @@ void PokeGen::PokeMod::Pokemod::ExportIni(const QString& f)
i->ExportIni(fout);
for (QList<Nature>::ConstIterator i = natures.begin(); i != natures.end(); ++i)
i->ExportIni(fout);
- for (QList<Pokemon>::ConstIterator i = pokemon.begin(); i != pokemon.end(); ++i)
- i->ExportIni(fout);
- for (QList<Status>::ConstIterator i = statuses.begin(); i != statuses.end(); ++i)
+ for (QList<Species>::ConstIterator i = species.begin(); i != species.end(); ++i)
i->ExportIni(fout);
for (QList<Store>::ConstIterator i = stores.begin(); i != stores.end(); ++i)
i->ExportIni(fout);
@@ -1161,7 +1109,7 @@ bool PokeGen::PokeMod::Pokemod::SetIsBreedingAllowed(const bool b)
bool PokeGen::PokeMod::Pokemod::SetEggSpecies(const unsigned e)
{
- if (breedingAllowed && (GetPokemonByID(e) != UINT_MAX))
+ if (breedingAllowed && (GetSpeciesByID(e) != UINT_MAX))
eggSpecies = e;
return (eggSpecies == e);
}
@@ -1356,7 +1304,7 @@ bool PokeGen::PokeMod::Pokemod::SetStartCoordinateY(const unsigned y)
bool PokeGen::PokeMod::Pokemod::SetStartDirection(const unsigned s)
{
- if (s < DIR_End)
+ if (s < D_End)
startDirection = s;
return (startDirection == s);
}
@@ -1580,7 +1528,7 @@ unsigned PokeGen::PokeMod::Pokemod::GetMaxEVPerStat() const
return maxEVPerStat;
}
-PokeGen::PokeMod::Frac PokeGen::PokeMod::Pokemod::GetPokerusChance() const
+PokeGen::Frac PokeGen::PokeMod::Pokemod::GetPokerusChance() const
{
return pokerusChance;
}
@@ -1605,7 +1553,7 @@ unsigned PokeGen::PokeMod::Pokemod::GetStartMoney() const
return startMoney;
}
-PokeGen::PokeMod::Point PokeGen::PokeMod::Pokemod::GetStartCoordinate() const
+PokeGen::Point PokeGen::PokeMod::Pokemod::GetStartCoordinate() const
{
return startCoordinate;
}
@@ -1698,7 +1646,7 @@ bool PokeGen::PokeMod::Pokemod::SetTypeChartDenom(const unsigned att, const unsi
return false;
}
-PokeGen::PokeMod::Frac PokeGen::PokeMod::Pokemod::GetTypeChart(const unsigned att, const unsigned def) const
+PokeGen::Frac PokeGen::PokeMod::Pokemod::GetTypeChart(const unsigned att, const unsigned def) const
{
unsigned col = UINT_MAX;
unsigned row = UINT_MAX;
@@ -1749,11 +1697,8 @@ unsigned PokeGen::PokeMod::Pokemod::GetAbilityCount() const
const PokeGen::PokeMod::Ability* PokeGen::PokeMod::Pokemod::NewAbility(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetAbilityCount(); ++i)
- {
- if (GetAbilityByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetAbilityCount()) && (GetAbilityByID(i) != UINT_MAX); ++i)
+ ;
Ability newAbility(this, i);
if (ini)
newAbility.ImportIni(*ini);
@@ -1796,11 +1741,8 @@ unsigned PokeGen::PokeMod::Pokemod::GetAuthorCount() const
const PokeGen::PokeMod::Author* PokeGen::PokeMod::Pokemod::NewAuthor(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetAuthorCount(); ++i)
- {
- if (GetAuthorByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetAuthorCount()) && (GetAuthorByID(i) != UINT_MAX); ++i)
+ ;
Author newAuthor(this, i);
if (ini)
newAuthor.ImportIni(*ini);
@@ -1843,11 +1785,8 @@ unsigned PokeGen::PokeMod::Pokemod::GetBadgeCount() const
const PokeGen::PokeMod::Badge* PokeGen::PokeMod::Pokemod::NewBadge(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetBadgeCount(); ++i)
- {
- if (GetBadgeByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetBadgeCount()) && (GetBadgeByID(i) != UINT_MAX); ++i)
+ ;
Badge newBadge(this, i);
if (ini)
newBadge.ImportIni(*ini);
@@ -1892,11 +1831,8 @@ unsigned PokeGen::PokeMod::Pokemod::GetCoinListCount() const
const PokeGen::PokeMod::CoinList* PokeGen::PokeMod::Pokemod::NewCoinList(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetCoinListCount(); ++i)
- {
- if (GetCoinListByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetCoinListCount()) && (GetCoinListByID(i) != UINT_MAX); ++i)
+ ;
CoinList newCoinList(this, i);
if (ini)
newCoinList.ImportIni(*ini);
@@ -1939,11 +1875,8 @@ unsigned PokeGen::PokeMod::Pokemod::GetDialogCount() const
const PokeGen::PokeMod::Dialog* PokeGen::PokeMod::Pokemod::NewDialog(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetDialogCount(); ++i)
- {
- if (GetDialogByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetDialogCount()) && (GetDialogByID(i) != UINT_MAX); ++i)
+ ;
Dialog newDialog(this, i);
if (ini)
newDialog.ImportIni(*ini);
@@ -1986,11 +1919,8 @@ unsigned PokeGen::PokeMod::Pokemod::GetEggGroupCount() const
const PokeGen::PokeMod::EggGroup* PokeGen::PokeMod::Pokemod::NewEggGroup(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetEggGroupCount(); ++i)
- {
- if (GetEggGroupByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetEggGroupCount()) && (GetEggGroupByID(i) != UINT_MAX); ++i)
+ ;
EggGroup newEggGroup(this, i);
if (ini)
newEggGroup.ImportIni(*ini);
@@ -2033,11 +1963,8 @@ unsigned PokeGen::PokeMod::Pokemod::GetItemCount() const
const PokeGen::PokeMod::Item* PokeGen::PokeMod::Pokemod::NewItem(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetItemCount(); ++i)
- {
- if (GetItemByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetItemCount()) && (GetItemByID(i) != UINT_MAX); ++i)
+ ;
Item newItem(this, i);
if (ini)
newItem.ImportIni(*ini);
@@ -2080,11 +2007,8 @@ unsigned PokeGen::PokeMod::Pokemod::GetItemTypeCount() const
const PokeGen::PokeMod::ItemType* PokeGen::PokeMod::Pokemod::NewItemType(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetItemTypeCount(); ++i)
- {
- if (GetItemTypeByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetItemTypeCount()) && (GetItemTypeByID(i) != UINT_MAX); ++i)
+ ;
ItemType newItemType(this, i);
if (ini)
newItemType.ImportIni(*ini);
@@ -2127,11 +2051,8 @@ unsigned PokeGen::PokeMod::Pokemod::GetMapCount() const
const PokeGen::PokeMod::Map* PokeGen::PokeMod::Pokemod::NewMap(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetMapCount(); ++i)
- {
- if (GetMapByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetMapCount()) && (GetMapByID(i) != UINT_MAX); ++i)
+ ;
Map newMap(this, i);
if (ini)
newMap.ImportIni(*ini);
@@ -2174,11 +2095,8 @@ unsigned PokeGen::PokeMod::Pokemod::GetMoveCount() const
const PokeGen::PokeMod::Move* PokeGen::PokeMod::Pokemod::NewMove(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetMoveCount(); ++i)
- {
- if (GetMoveByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetMoveCount()) && (GetMoveByID(i) != UINT_MAX); ++i)
+ ;
Move newMove(this, i);
if (ini)
newMove.ImportIni(*ini);
@@ -2221,11 +2139,8 @@ unsigned PokeGen::PokeMod::Pokemod::GetNatureCount() const
const PokeGen::PokeMod::Nature* PokeGen::PokeMod::Pokemod::NewNature(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetNatureCount(); ++i)
- {
- if (GetNatureByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetNatureCount()) && (GetNatureByID(i) != UINT_MAX); ++i)
+ ;
Nature newNature(this, i);
if (ini)
newNature.ImportIni(*ini);
@@ -2243,95 +2158,45 @@ bool PokeGen::PokeMod::Pokemod::DeleteNature(const unsigned i)
return false;
}
-const PokeGen::PokeMod::Pokemon* PokeGen::PokeMod::Pokemod::GetPokemon(const unsigned i) const
-{
- if (i < GetPokemonCount())
- return &pokemon[i];
- return NULL;
-}
-
-unsigned PokeGen::PokeMod::Pokemod::GetPokemonByID(const unsigned _id) const
-{
- for (unsigned i = 0; i < GetPokemonCount(); ++i)
- {
- if (pokemon[i].GetId() == _id)
- return i;
- }
- return UINT_MAX;
-}
-
-unsigned PokeGen::PokeMod::Pokemod::GetPokemonCount() const
-{
- return pokemon.size();
-}
-
-const PokeGen::PokeMod::Pokemon* PokeGen::PokeMod::Pokemod::NewPokemon(Ini* const ini)
-{
- unsigned i = 0;
- for (; i < GetPokemonCount(); ++i)
- {
- if (!GetPokemon(i) == UINT_MAX)
- break;
- }
- Pokemon newPokemon(this, i);
- if (ini)
- newPokemon.ImportIni(*ini);
- pokemon.append(newPokemon);
- return &pokemon[GetPokemonCount() - 1];
-}
-
-bool PokeGen::PokeMod::Pokemod::DeletePokemon(const unsigned i)
-{
- if (i < GetPokemonCount())
- {
- pokemon.erase(pokemon.begin() + i);
- return true;
- }
- return false;
-}
-
-const PokeGen::PokeMod::Status* PokeGen::PokeMod::Pokemod::GetStatus(const unsigned i) const
+const PokeGen::PokeMod::Species* PokeGen::PokeMod::Pokemod::GetSpecies(const unsigned i) const
{
- if (i < GetStatusCount())
- return &statuses[i];
+ if (i < GetSpeciesCount())
+ return &species[i];
return NULL;
}
-unsigned PokeGen::PokeMod::Pokemod::GetStatusByID(const unsigned _id) const
+unsigned PokeGen::PokeMod::Pokemod::GetSpeciesByID(const unsigned _id) const
{
- for (unsigned i = 0; i < GetStatusCount(); ++i)
+ for (unsigned i = 0; i < GetSpeciesCount(); ++i)
{
- if (statuses[i].GetId() == _id)
+ if (species[i].GetId() == _id)
return i;
}
return UINT_MAX;
}
-unsigned PokeGen::PokeMod::Pokemod::GetStatusCount() const
+unsigned PokeGen::PokeMod::Pokemod::GetSpeciesCount() const
{
- return statuses.size();
+ return species.size();
}
-const PokeGen::PokeMod::Status* PokeGen::PokeMod::Pokemod::NewStatus(Ini* const ini)
+const PokeGen::PokeMod::Species* PokeGen::PokeMod::Pokemod::NewSpecies(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetStatusCount(); ++i)
- {
- if (GetStatusByID(i) == UINT_MAX)
- break;
- }
- Status newStatus(this, i);
+ for (; (i < GetSpeciesCount()) && (GetSpeciesByID(i) != UINT_MAX); ++i)
+ ;
+ Species newSpecies(this, i);
if (ini)
- newStatus.ImportIni(*ini);
- statuses.append(newStatus);
- return &statuses[GetStatusCount() - 1];
+ newSpecies.ImportIni(*ini);
+ species.append(newSpecies);
+ return &species[GetSpeciesCount() - 1];
}
-bool PokeGen::PokeMod::Pokemod::DeleteStatus(const unsigned i)
+bool PokeGen::PokeMod::Pokemod::DeleteSpecies(const unsigned i)
{
- if (i < GetStatusCount())
+ if (i < GetSpeciesCount())
{
- statuses.erase(statuses.begin() + i);
+ species.erase(species.begin() + i);
return true;
}
return false;
@@ -2362,11 +2227,8 @@ unsigned PokeGen::PokeMod::Pokemod::GetStoreCount() const
const PokeGen::PokeMod::Store* PokeGen::PokeMod::Pokemod::NewStore(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetStoreCount(); ++i)
- {
- if (GetStoreByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetStoreCount()) && (GetStoreByID(i) != UINT_MAX); ++i)
+ ;
Store newStore(this, i);
if (ini)
newStore.ImportIni(*ini);
@@ -2409,11 +2271,8 @@ unsigned PokeGen::PokeMod::Pokemod::GetTileCount() const
const PokeGen::PokeMod::Tile* PokeGen::PokeMod::Pokemod::NewTile(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetTileCount(); ++i)
- {
- if (GetTileByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetTileCount()) && (GetTileByID(i) != UINT_MAX); ++i)
+ ;
Tile newTile(this, i);
if (ini)
newTile.ImportIni(*ini);
@@ -2456,11 +2315,8 @@ unsigned PokeGen::PokeMod::Pokemod::GetTimeCount() const
const PokeGen::PokeMod::Time* PokeGen::PokeMod::Pokemod::NewTime(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetTimeCount(); ++i)
- {
- if (GetTimeByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetTimeCount()) && (GetTimeByID(i) != UINT_MAX); ++i)
+ ;
Time newTime(this, i);
if (ini)
newTime.ImportIni(*ini);
@@ -2503,11 +2359,8 @@ unsigned PokeGen::PokeMod::Pokemod::GetTypeCount() const
const PokeGen::PokeMod::Type* PokeGen::PokeMod::Pokemod::NewType(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetTypeCount(); ++i)
- {
- if (GetTypeByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetTypeCount()) && (GetTypeByID(i) != UINT_MAX); ++i)
+ ;
Type newType(this, i);
if (ini)
newType.ImportIni(*ini);
diff --git a/pokemod/Pokemod.h b/pokemod/Pokemod.h
index 58664960..ed70c218 100644
--- a/pokemod/Pokemod.h
+++ b/pokemod/Pokemod.h
@@ -32,10 +32,11 @@
#include <QMap>
#include <QString>
#include <QStringList>
+#include "../general/Frac.h"
+#include "../general/FracMatrix.h"
+#include "../general/Ref.h"
#include "pokemod_inc.h"
#include "Object.h"
-#include "Frac.h"
-#include "Ref.h"
#include "Ability.h"
#include "Author.h"
#include "Badge.h"
@@ -47,8 +48,7 @@
#include "Map.h"
#include "Move.h"
#include "Nature.h"
-#include "Pokemon.h"
-#include "Status.h"
+#include "Species.h"
#include "Store.h"
#include "Tile.h"
#include "Time.h"
@@ -245,17 +245,11 @@ namespace PokeGen
const Nature* NewNature(Ini* const ini = NULL);
bool DeleteNature(const unsigned i);
- const Pokemon* GetPokemon(const unsigned i) const;
- unsigned GetPokemonByID(const unsigned i) const;
- unsigned GetPokemonCount() const;
- const Pokemon* NewPokemon(Ini* const ini = NULL);
- bool DeletePokemon(const unsigned i);
-
- const Status* GetStatus(const unsigned i) const;
- unsigned GetStatusByID(const unsigned i) const;
- unsigned GetStatusCount() const;
- const Status* NewStatus(Ini* const ini = NULL);
- bool DeleteStatus(const unsigned i);
+ const Species* GetSpecies(const unsigned i) const;
+ unsigned GetSpeciesByID(const unsigned i) const;
+ unsigned GetSpeciesCount() const;
+ const Species* NewSpecies(Ini* const ini = NULL);
+ bool DeleteSpecies(const unsigned i);
const Store* GetStore(const unsigned i) const;
unsigned GetStoreByID(const unsigned i) const;
@@ -324,7 +318,7 @@ namespace PokeGen
unsigned struggleMove;
unsigned confuseMove;
- MatrixFrac typeChart;
+ FracMatrix typeChart;
QList<Ability> abilities;
QList<Author> authors;
@@ -337,8 +331,7 @@ namespace PokeGen
QList<Map> maps;
QList<Move> moves;
QList<Nature> natures;
- QList<Pokemon> pokemon;
- QList<Status> statuses;
+ QList<Species> species;
QList<Store> stores;
QList<Tile> tiles;
QList<Time> times;
diff --git a/pokemod/PokemonEvolution.cpp b/pokemod/PokemonEvolution.cpp
deleted file mode 100644
index 89abc22b..00000000
--- a/pokemod/PokemonEvolution.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/PokemonEvolution.cpp
-// Purpose: Define an evolution that a Pokémon can go through
-// Author: Ben Boeckel
-// Modified by: Ben Boeckel
-// Created: Tue Mar 20 18:45:29 2007
-// Copyright: ©2007 Ben Boeckel and Nerdy Productions
-// Licence:
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program. If not, see <http://www.gnu.org/licenses/>.
-/////////////////////////////////////////////////////////////////////////////
-
-#include "PokemonEvolution.h"
-
-PokeGen::PokeMod::PokemonEvolution::PokemonEvolution(const Pokemod* par, const unsigned _id) :
- Object(_id, par),
- species(UINT_MAX),
- style(UINT_MAX),
- val1(UINT_MAX),
- val2(UINT_MAX),
- level(0)
-{
-}
-
-PokeGen::PokeMod::PokemonEvolution::PokemonEvolution(const Pokemod* par, Ini& ini, const unsigned _id) :
- Object(_id, par)
-{
- ImportIni(ini, _id);
-}
-
-bool PokeGen::PokeMod::PokemonEvolution::Validate()
-{
- pokemod->ValidationMsg(QString("------Evolution with id %1---").arg(id), Pokemod::V_Msg);
- if (pokemod->GetPokemonByID(species) == UINT_MAX)
- {
- pokemod->ValidationMsg("Invalid species");
- isValid = false;
- }
- if (End <= style)
- {
- pokemod->ValidationMsg("Invalid style");
- isValid = false;
- }
- if (pokemod->GetMaxLevel() <= level)
- {
- pokemod->ValidationMsg("Invalid level");
- isValid = false;
- }
- return isValid;
-}
-
-void PokeGen::PokeMod::PokemonEvolution::ImportIni(Ini& ini, const unsigned _id)
-{
- if (_id == UINT_MAX)
- ini.GetValue("id", id);
- else
- id = _id;
- ini.GetValue("species", species);
- ini.GetValue("style", style);
- ini.GetValue("val1", val1);
- ini.GetValue("val2", val2);
- ini.GetValue("level", level, 0);
-}
-
-void PokeGen::PokeMod::PokemonEvolution::ExportIni(QFile& fout, const QString& pokemon) const
-{
- Ini exPokemonEvolution("pokemonEvolution " + pokemon);
- exPokemonEvolution.AddField("id", id);
- exPokemonEvolution.AddField("species", species);
- exPokemonEvolution.AddField("style", style);
- exPokemonEvolution.AddField("val1", val1);
- exPokemonEvolution.AddField("val2", val2);
- exPokemonEvolution.AddField("level", level);
- exPokemonEvolution.Export(fout);
-}
-
-bool PokeGen::PokeMod::PokemonEvolution::SetSpecies(const unsigned s)
-{
- if (pokemod->GetPokemonByID(s) != UINT_MAX)
- species = s;
- return (species == s);
-}
-
-bool PokeGen::PokeMod::PokemonEvolution::SetStyle(const unsigned s)
-{
- if (s < End)
- style = s;
- return (style == s);
-}
-
-bool PokeGen::PokeMod::PokemonEvolution::SetVal1(const unsigned v1)
-{
- // TODO (Ben#1#): Val1 of PokemonEvolution
- return (val1 == v1);
-}
-
-bool PokeGen::PokeMod::PokemonEvolution::SetVal2(const unsigned v2)
-{
- // TODO (Ben#1#): Val2 of PokemonEvolution
- return (val2 == v2);
-}
-
-bool PokeGen::PokeMod::PokemonEvolution::SetLevel(const unsigned l)
-{
- if (l <= pokemod->GetMaxLevel())
- level = l;
- return (level == l);
-}
-
-unsigned PokeGen::PokeMod::PokemonEvolution::GetSpecies() const
-{
- return species;
-}
-
-unsigned PokeGen::PokeMod::PokemonEvolution::GetStyle() const
-{
- return style;
-}
-
-unsigned PokeGen::PokeMod::PokemonEvolution::GetVal1() const
-{
- return val1;
-}
-
-unsigned PokeGen::PokeMod::PokemonEvolution::GetVal2() const
-{
- return val2;
-}
-
-unsigned PokeGen::PokeMod::PokemonEvolution::GetLevel() const
-{
- return level;
-}
diff --git a/pokemod/PokemonNature.cpp b/pokemod/PokemonNature.cpp
deleted file mode 100644
index b970e5de..00000000
--- a/pokemod/PokemonNature.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/PokemonNature.cpp
-// Purpose: Define an nature that a Pokémon can have
-// Author: Ben Boeckel
-// Modified by: Ben Boeckel
-// Created: Tue Mar 20 18:39:17 2007
-// Copyright: ©2007 Ben Boeckel and Nerdy Productions
-// Licence:
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program. If not, see <http://www.gnu.org/licenses/>.
-/////////////////////////////////////////////////////////////////////////////
-
-#include "PokemonNature.h"
-
-PokeGen::PokeMod::PokemonNature::PokemonNature(const Pokemod* par, const unsigned _id) :
- Object(_id, par),
- nature(UINT_MAX),
- weight(1)
-{
-}
-
-PokeGen::PokeMod::PokemonNature::PokemonNature(const Pokemod* par, Ini& ini, const unsigned _id) :
- Object(_id, par)
-{
- ImportIni(ini, _id);
-}
-
-bool PokeGen::PokeMod::PokemonNature::Validate()
-{
- pokemod->ValidationMsg(QString("------Nature with id %1---").arg(id), Pokemod::V_Msg);
- if (pokemod->GetNatureByID(nature) == UINT_MAX)
- {
- pokemod->ValidationMsg("Invalid nature");
- isValid = false;
- }
- if (!weight)
- {
- pokemod->ValidationMsg("Invalid weight");
- isValid = false;
- }
- return isValid;
-}
-
-void PokeGen::PokeMod::PokemonNature::ImportIni(Ini& ini, const unsigned _id)
-{
- if (_id == UINT_MAX)
- ini.GetValue("id", id);
- else
- id = _id;
- ini.GetValue("nature", nature);
- ini.GetValue("weight", weight, 1);
-}
-
-void PokeGen::PokeMod::PokemonNature::ExportIni(QFile& fout, const QString& pokemon) const
-{
- Ini exPokemonNature("pokemonNature " + pokemon);
- exPokemonNature.AddField("id", id);
- exPokemonNature.AddField("nature", nature);
- exPokemonNature.AddField("weight", weight);
- exPokemonNature.Export(fout);
-}
-
-bool PokeGen::PokeMod::PokemonNature::SetNature(const unsigned n)
-{
- if (pokemod->GetNatureByID(n) != UINT_MAX)
- nature = n;
- return (nature == n);
-}
-
-bool PokeGen::PokeMod::PokemonNature::SetWeight(const unsigned w)
-{
- if (w)
- weight = w;
- return (weight == w);
-}
-
-unsigned PokeGen::PokeMod::PokemonNature::GetNature() const
-{
- return nature;
-}
-
-unsigned PokeGen::PokeMod::PokemonNature::GetWeight() const
-{
- return weight;
-}
diff --git a/pokemod/Ref.h b/pokemod/Ref.h
deleted file mode 100644
index 8bb0fc3e..00000000
--- a/pokemod/Ref.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/Ref.h
-// Purpose: Define references for Objects
-// Author: Ben Boeckel
-// Modified by: Ben Boeckel
-// Created: Thu Feb 15 8:42:45 2007
-// Copyright: ©2007 Nerdy Productions
-// Licence:
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program. If not, see <http://www.gnu.org/licenses/>.
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef __POKEMOD_REF__
-#define __POKEMOD_REF__
-
-#include <QString>
-
-namespace PokeGen
-{
- namespace PokeMod
- {
- unsigned FindIn(const unsigned end, const QString& str, const char* array[]);
-
- enum EnumStat
- {
- ST_HP = 0,
- ST_Attack = 1,
- ST_Defense = 2,
- ST_Speed = 3,
- ST_Special = 4,
- ST_End_RBY = 5,
- ST_SpecialAttack = 4,
- ST_SpecialDefense = 5,
- ST_End_GSC = 6,
- ST_Accuracy = 6,
- ST_Evasion = 7,
- ST_End_Battle = 8,
- };
- const char* StatRBYStr[ST_End_Battle] = {"HP", "Attack", "Defense", "Speed", "Special", "Special", "Accuracy", "Evasion"};
- const char* StatGSCStr[ST_End_Battle] = {"HP", "Attack", "Defense", "Speed", "Special Attack", "Special Defense", "Accuracy", "Evasion"};
-
- enum EnumBattleMember
- {
- BM_Player = 0,
- BM_Enemy = 1,
- BM_End = 2
- };
- const char* BattleMemberStr[BM_End] = {"Player", "Enemy"};
-
-// enum EnumStatus
-// {
-// STS_Freeze = 0,
-// STS_Paralyze = 1,
-// STS_Sleep = 2,
-// STS_Poison = 3,
-// STS_ToxicPoison = 4,
-// STS_Burn = 5,
-// STS_EndShow = 6,
-// STS_ANY_SHOW = 6,
-// STS_End_SHOW_ANY = 7,
-// STS_CONFUSED = 6,
-// STS_End_CNF = 7,
-// STS_ANY = 7,
-// STS_End_ANY = 8,
-// };
-// const char* StatusShowStr[STS_End_SHOW_ANY] = {"Freeze", "Paralyze", "Sleep", "Poison", "Toxic Poison", "Burn", "Any"};
-// const char* StatusStr[STS_End_ANY] = {"Freeze", "Paralyze", "Sleep", "Poison", "Toxic Poison", "Burn", "Confuse", "Any"};
-// const char* StatusAbbrStr[STS_End_SHOW] = {"FRZ", "PRZ", "SLP", "PSN", "PSN", "BRN"};
-//
- enum EnumWeather
- {
- W_Ice = 0,
- W_Rain = 1,
- W_Sun = 2,
- W_Sand = 3,
- W_End_Real = 4,
- W_All = 4,
- W_End_All = 5
- };
- const char* WeatherStr[W_End_All] = {"Ice", "Rain", "Sun", "Sand", "All"};
-
- enum EnumStatVersion
- {
- STV_RBY = 0,
- STV_GSC = 1,
- STV_End = 2
- };
-
- enum EnumContestType
- {
- COTY_Coolness = 0,
- COTY_Beauty = 1,
- COTY_Cuteness = 2,
- COTY_Smartness = 3,
- COTY_Toughness = 4,
- COTY_End = 5
- };
- const char* ContestTypeStr[COTY_End] = {"Coolness", "Beauty", "Cuteness", "Smartness", "Toughness"};
-
- enum EnumDirection
- {
- DIR_Up = 0,
- DIR_Down = 1,
- DIR_Left = 2,
- DIR_Right = 3,
- DIR_End = 4,
- DIR_None = 4,
- DIR_End_None = 5
- };
- const char* DirectionStr[DIR_End_None] = {"Up", "Down", "Left", "Right", "None"};
- }
-}
-
-#endif
diff --git a/pokemod/Pokemon.cpp b/pokemod/Species.cpp
index c9be3cea..4d1cc8df 100644
--- a/pokemod/Pokemon.cpp
+++ b/pokemod/Species.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/Pokemon.cpp
-// Purpose: Define a Pokemon
+// Name: pokemod/Species.cpp
+// Purpose: Define a species
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Fri June 1 2007 12:10:40
@@ -13,16 +13,18 @@
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTPokemon or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTSpecies or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program. If not, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////////////////
-#include "Pokemon.h"
+#include "Species.h"
-PokeGen::PokeMod::Pokemon::Pokemon(const Pokemod* par, const unsigned _id) :
+const char* PokeGen::PokeMod::Species::StyleStr[PokeGen::PokeMod::Species::End] = {"Fluctuating", "Fading", "Slow", "Normal", "Fast", "Erratic"};
+
+PokeGen::PokeMod::Species::Species(const Pokemod* par, const unsigned _id) :
Object(_id, par),
name(""),
growth(UINT_MAX),
@@ -47,15 +49,15 @@ PokeGen::PokeMod::Pokemon::Pokemon(const Pokemod* par, const unsigned _id) :
}
}
-PokeGen::PokeMod::Pokemon::Pokemon(const Pokemod* par, Ini& ini, const unsigned _id) :
+PokeGen::PokeMod::Species::Species(const Pokemod* par, Ini& ini, const unsigned _id) :
Object(_id, par)
{
ImportIni(ini, _id);
}
-bool PokeGen::PokeMod::Pokemon::Validate()
+bool PokeGen::PokeMod::Species::Validate()
{
- pokemod->ValidationMsg(QString("---Pokémon \"%1\" with id %2---").arg(name).arg(id), Pokemod::V_Msg);
+ pokemod->ValidationMsg(QString("---Species \"%1\" with id %2---").arg(name).arg(id), Pokemod::V_Msg);
if (name == "")
{
pokemod->ValidationMsg("Name is not defined");
@@ -74,47 +76,47 @@ bool PokeGen::PokeMod::Pokemon::Validate()
pokemod->ValidationMsg("Invalid growth style");
isValid = false;
}
- if (pokemod->GetPokemonCount() <= pokedexNumber)
+ if (pokemod->GetSpeciesCount() <= pokedexNumber)
{
pokemod->ValidationMsg("Invalid PokéDex number");
isValid = false;
}
if (!weight)
- pokemod->ValidationMsg("Pokémon weighs nothing", Pokemod::V_Warn);
+ pokemod->ValidationMsg("Species weighs nothing", Pokemod::V_Warn);
if (12 <= heightInches)
{
pokemod->ValidationMsg("Invalid height inches");
isValid = false;
}
- if (!QFile(pokemod->GetPath() + "images/pokemon/front/" + (pokemod->IsGenderAllowed() ? "male/" : "") + name + ".png").exists())
+ if (!QFile(pokemod->GetPath() + "pokemon/" + name + "/front" + (pokemod->IsGenderAllowed() ? "-male" : "") + ".png").exists())
{
pokemod->ValidationMsg(QString("Cannot find the front%1 image").arg(pokemod->IsGenderAllowed() ? " male" : ""));
isValid = false;
}
- if (!QFile(pokemod->GetPath() + "images/pokemon/back/" + (pokemod->IsGenderAllowed() ? "male/" : "") + name + ".png").exists())
+ if (!QFile(pokemod->GetPath() + "pokemon/" + name + "/back" + (pokemod->IsGenderAllowed() ? "-male" : "") + ".png").exists())
{
pokemod->ValidationMsg(QString("Cannot find the back%1 image").arg(pokemod->IsGenderAllowed() ? " male" : ""));
isValid = false;
}
if (pokemod->IsGenderAllowed())
{
- if (!QFile(pokemod->GetPath() + "images/pokemon/front/female/" + name + ".png").exists())
+ if (!QFile(pokemod->GetPath() + "pokemon/" + name + "/front-female.png").exists())
{
pokemod->ValidationMsg("Cannot find the front female image");
isValid = false;
}
- if (!QFile(pokemod->GetPath() + "images/pokemon/back/female/" + name + ".png").exists())
+ if (!QFile(pokemod->GetPath() + "pokemon/" + name + "/front-female.png").exists())
{
pokemod->ValidationMsg("Cannot find the back female image");
isValid = false;
}
}
- if (!QFile(pokemod->GetPath() + "images/pokemon/list/" + name + ".png").exists())
+ if (!QFile(pokemod->GetPath() + "pokemon/" + name + "/list.png").exists())
{
pokemod->ValidationMsg("Cannot find the list sprite");
isValid = false;
}
- if (pokemod->GetPokemonByID(eggSpecies) == UINT_MAX)
+ if (pokemod->GetSpeciesByID(eggSpecies) == UINT_MAX)
pokemod->ValidationMsg("Invalid egg species", Pokemod::V_Warn);
else if (!eggSteps)
{
@@ -157,7 +159,7 @@ bool PokeGen::PokeMod::Pokemon::Validate()
{
if (GetAbilityCount())
{
- for (QList<PokemonAbility>::Iterator i = abilities.begin(); i != abilities.end(); ++i)
+ for (QList<SpeciesAbility>::Iterator i = abilities.begin(); i != abilities.end(); ++i)
{
if (!i->IsValid())
isValid = false;
@@ -188,7 +190,7 @@ bool PokeGen::PokeMod::Pokemon::Validate()
}
if (GetEvolutionCount())
{
- for (QList<PokemonEvolution>::Iterator i = evolutions.begin(); i != evolutions.end(); ++i)
+ for (QList<SpeciesEvolution>::Iterator i = evolutions.begin(); i != evolutions.end(); ++i)
{
if (!i->IsValid())
isValid = false;
@@ -220,7 +222,7 @@ bool PokeGen::PokeMod::Pokemon::Validate()
{
if (GetItemCount())
{
- for (QList<PokemonItem>::Iterator i = items.begin(); i != items.end(); ++i)
+ for (QList<SpeciesItem>::Iterator i = items.begin(); i != items.end(); ++i)
{
if (!i->IsValid())
isValid = false;
@@ -251,7 +253,7 @@ bool PokeGen::PokeMod::Pokemon::Validate()
}
if (GetMoveCount())
{
- for (QList<PokemonMove>::Iterator i = moves.begin(); i != moves.end(); ++i)
+ for (QList<SpeciesMove>::Iterator i = moves.begin(); i != moves.end(); ++i)
{
if (!i->IsValid())
isValid = false;
@@ -282,46 +284,10 @@ bool PokeGen::PokeMod::Pokemon::Validate()
pokemod->ValidationMsg("There are no moves");
isValid = false;
}
- if (pokemod->IsNatureAllowed())
- {
- if (GetNatureCount())
- {
- for (QList<PokemonNature>::Iterator i = natures.begin(); i != natures.end(); ++i)
- {
- if (!i->IsValid())
- isValid = false;
- ++idChecker[i->GetId()];
- ++nameChecker[i->GetNature()];
- }
- for (QMap<unsigned, unsigned>::ConstIterator i = idChecker.begin(); i != idChecker.end(); ++i)
- {
- if (1 < i.value())
- {
- pokemod->ValidationMsg(QString("There are %1 natures with id %2").arg(i.value()).arg(i.key()));
- isValid = false;
- }
- }
- for (QMap<unsigned, unsigned>::ConstIterator i = nameChecker.begin(); i != nameChecker.end(); ++i)
- {
- if (1 < i.value())
- {
- pokemod->ValidationMsg(QString("There are %1 natures with the nature %2").arg(i.value()).arg(i.key()));
- isValid = false;
- }
- }
- idChecker.clear();
- nameChecker.clear();
- }
- else
- {
- pokemod->ValidationMsg("There are no natures");
- isValid = false;
- }
- }
return isValid;
}
-void PokeGen::PokeMod::Pokemon::ImportIni(Ini& ini, const unsigned _id)
+void PokeGen::PokeMod::Species::ImportIni(Ini& ini, const unsigned _id)
{
if (_id == UINT_MAX)
ini.GetValue("id", id);
@@ -373,61 +339,58 @@ void PokeGen::PokeMod::Pokemon::ImportIni(Ini& ini, const unsigned _id)
evolutions.clear();
items.clear();
moves.clear();
- natures.clear();
}
-void PokeGen::PokeMod::Pokemon::ExportIni(QFile& fout) const
+void PokeGen::PokeMod::Species::ExportIni(QFile& fout) const
{
- Ini exPokemon("Pokemon");
- exPokemon.AddField("id", id);
- exPokemon.AddField("name", name);
- exPokemon.AddField("numTypes", GetTypeCount());
+ Ini exSpecies("species");
+ exSpecies.AddField("id", id);
+ exSpecies.AddField("name", name);
+ exSpecies.AddField("numTypes", GetTypeCount());
for (unsigned i = 0; i < GetTypeCount(); ++i)
- exPokemon.AddField(QString("types-%1").arg(i), types[i]);
+ exSpecies.AddField(QString("types-%1").arg(i), types[i]);
for (unsigned i = 0; i < ST_End_GSC; ++i)
- exPokemon.AddField(QString("baseStats-%1").arg(i), baseStats[i]);
+ exSpecies.AddField(QString("baseStats-%1").arg(i), baseStats[i]);
for (unsigned i = 0; i < ST_End_GSC; ++i)
- exPokemon.AddField(QString("effortValues-%1").arg(i), effortValues[i]);
- exPokemon.AddField("growth", growth);
- exPokemon.AddField("experienceValue", experienceValue);
- exPokemon.AddField("catchValue", catchValue);
- exPokemon.AddField("runChance-n", runChance.GetNum());
- exPokemon.AddField("runChance-d", runChance.GetDenom());
- exPokemon.AddField("itemChance-n", itemChance.GetNum());
- exPokemon.AddField("itemChance-d", itemChance.GetDenom());
- exPokemon.AddField("pokedexNumber", pokedexNumber);
- exPokemon.AddField("weight", weight);
- exPokemon.AddField("heightFeet", heightFeet);
- exPokemon.AddField("heightInches", heightInches);
- exPokemon.AddField("pokedexEntry", pokedexEntry);
- exPokemon.AddField("genderFactor-n", genderFactor.GetNum());
- exPokemon.AddField("genderFactor-d", genderFactor.GetDenom());
- exPokemon.AddField("numTypes", GetTypeCount());
+ exSpecies.AddField(QString("effortValues-%1").arg(i), effortValues[i]);
+ exSpecies.AddField("growth", growth);
+ exSpecies.AddField("experienceValue", experienceValue);
+ exSpecies.AddField("catchValue", catchValue);
+ exSpecies.AddField("runChance-n", runChance.GetNum());
+ exSpecies.AddField("runChance-d", runChance.GetDenom());
+ exSpecies.AddField("itemChance-n", itemChance.GetNum());
+ exSpecies.AddField("itemChance-d", itemChance.GetDenom());
+ exSpecies.AddField("pokedexNumber", pokedexNumber);
+ exSpecies.AddField("weight", weight);
+ exSpecies.AddField("heightFeet", heightFeet);
+ exSpecies.AddField("heightInches", heightInches);
+ exSpecies.AddField("pokedexEntry", pokedexEntry);
+ exSpecies.AddField("genderFactor-n", genderFactor.GetNum());
+ exSpecies.AddField("genderFactor-d", genderFactor.GetDenom());
+ exSpecies.AddField("numTypes", GetTypeCount());
for (unsigned i = 0; i < GetEggGroupCount(); ++i)
- exPokemon.AddField(QString("eggGroups-%1").arg(i), eggGroups[i]);
- exPokemon.AddField("eggSpecies", eggSpecies);
- exPokemon.AddField("eggSteps", eggSteps);
- exPokemon.AddField("isDitto", isDitto);
- exPokemon.AddField("nidoranGroup", nidoranGroup);
- exPokemon.Export(fout);
- for (QList<PokemonAbility>::ConstIterator i = abilities.begin(); i != abilities.end(); ++i)
+ exSpecies.AddField(QString("eggGroups-%1").arg(i), eggGroups[i]);
+ exSpecies.AddField("eggSpecies", eggSpecies);
+ exSpecies.AddField("eggSteps", eggSteps);
+ exSpecies.AddField("isDitto", isDitto);
+ exSpecies.AddField("nidoranGroup", nidoranGroup);
+ exSpecies.Export(fout);
+ for (QList<SpeciesAbility>::ConstIterator i = abilities.begin(); i != abilities.end(); ++i)
i->ExportIni(fout, name);
- for (QList<PokemonEvolution>::ConstIterator i = evolutions.begin(); i != evolutions.end(); ++i)
+ for (QList<SpeciesEvolution>::ConstIterator i = evolutions.begin(); i != evolutions.end(); ++i)
i->ExportIni(fout, name);
- for (QList<PokemonItem>::ConstIterator i = items.begin(); i != items.end(); ++i)
+ for (QList<SpeciesItem>::ConstIterator i = items.begin(); i != items.end(); ++i)
i->ExportIni(fout, name);
- for (QList<PokemonMove>::ConstIterator i = moves.begin(); i != moves.end(); ++i)
- i->ExportIni(fout, name);
- for (QList<PokemonNature>::ConstIterator i = natures.begin(); i != natures.end(); ++i)
+ for (QList<SpeciesMove>::ConstIterator i = moves.begin(); i != moves.end(); ++i)
i->ExportIni(fout, name);
}
-void PokeGen::PokeMod::Pokemon::SetName(const QString& n)
+void PokeGen::PokeMod::Species::SetName(const QString& n)
{
name = n;
}
-bool PokeGen::PokeMod::Pokemon::SetBaseStat(const unsigned s, const unsigned b)
+bool PokeGen::PokeMod::Species::SetBaseStat(const unsigned s, const unsigned b)
{
if ((s < ST_End_RBY) || ((s == ST_SpecialDefense) && pokemod->IsSpecialSplit()))
{
@@ -437,7 +400,7 @@ bool PokeGen::PokeMod::Pokemon::SetBaseStat(const unsigned s, const unsigned b)
return false;
}
-bool PokeGen::PokeMod::Pokemon::SetEffortValue(const unsigned s, const unsigned e)
+bool PokeGen::PokeMod::Species::SetEffortValue(const unsigned s, const unsigned e)
{
if ((s < ST_End_RBY) || ((s == ST_SpecialDefense) && pokemod->IsSpecialSplit()))
{
@@ -447,297 +410,297 @@ bool PokeGen::PokeMod::Pokemon::SetEffortValue(const unsigned s, const unsigned
return false;
}
-bool PokeGen::PokeMod::Pokemon::SetGrowth(const unsigned g)
+bool PokeGen::PokeMod::Species::SetGrowth(const unsigned g)
{
if (g < End)
growth = g;
return (growth == g);
}
-void PokeGen::PokeMod::Pokemon::SetExperienceValue(const unsigned e)
+void PokeGen::PokeMod::Species::SetExperienceValue(const unsigned e)
{
experienceValue = e;
}
-void PokeGen::PokeMod::Pokemon::SetCatchValue(const unsigned char c)
+void PokeGen::PokeMod::Species::SetCatchValue(const unsigned char c)
{
catchValue = c;
}
-bool PokeGen::PokeMod::Pokemon::SetRunChance(const unsigned n, const unsigned d)
+bool PokeGen::PokeMod::Species::SetRunChance(const unsigned n, const unsigned d)
{
return runChance.Set(n, d);
}
-bool PokeGen::PokeMod::Pokemon::SetRunChanceNumerator(const unsigned n)
+bool PokeGen::PokeMod::Species::SetRunChanceNumerator(const unsigned n)
{
return runChance.SetNum(n);
}
-bool PokeGen::PokeMod::Pokemon::SetRunChanceDenominator(const unsigned d)
+bool PokeGen::PokeMod::Species::SetRunChanceDenominator(const unsigned d)
{
return runChance.SetDenom(d);
}
-bool PokeGen::PokeMod::Pokemon::SetItemChance(const unsigned n, const unsigned d)
+bool PokeGen::PokeMod::Species::SetItemChance(const unsigned n, const unsigned d)
{
return itemChance.Set(n, d);
}
-bool PokeGen::PokeMod::Pokemon::SetItemChanceNumerator(const unsigned n)
+bool PokeGen::PokeMod::Species::SetItemChanceNumerator(const unsigned n)
{
return itemChance.SetNum(n);
}
-bool PokeGen::PokeMod::Pokemon::SetItemChanceDenominator(const unsigned d)
+bool PokeGen::PokeMod::Species::SetItemChanceDenominator(const unsigned d)
{
return itemChance.SetDenom(d);
}
-void PokeGen::PokeMod::Pokemon::SetPokedexNumber(const unsigned p)
+void PokeGen::PokeMod::Species::SetPokedexNumber(const unsigned p)
{
pokedexNumber = p;
}
-void PokeGen::PokeMod::Pokemon::SetWeight(const unsigned w)
+void PokeGen::PokeMod::Species::SetWeight(const unsigned w)
{
weight = w;
}
-void PokeGen::PokeMod::Pokemon::SetHeightFeet(const unsigned f)
+void PokeGen::PokeMod::Species::SetHeightFeet(const unsigned f)
{
heightFeet = f;
}
-bool PokeGen::PokeMod::Pokemon::SetHeightInches(const unsigned char i)
+bool PokeGen::PokeMod::Species::SetHeightInches(const unsigned char i)
{
if (i < 12)
heightInches = i;
return (heightInches == i);
}
-void PokeGen::PokeMod::Pokemon::SetPokedexEntry(const QString& p)
+void PokeGen::PokeMod::Species::SetPokedexEntry(const QString& p)
{
pokedexEntry = p;
}
-bool PokeGen::PokeMod::Pokemon::SetFrontMaleSprite(const QString& f)
+bool PokeGen::PokeMod::Species::SetFrontMaleSprite(const QString& f)
{
- QFile file(pokemod->GetPath() + "images/pokemon/front/" + (pokemod->IsGenderAllowed() ? "male/" : "") + name + ".png");
+ QFile file(pokemod->GetPath() + "pokemon/" + name + "/front" + (pokemod->IsGenderAllowed() ? "-male" : "") + ".png");
if (file.exists() && !file.remove())
return false;
- return QFile::copy(f, pokemod->GetPath() + "images/pokemon/front/" + (pokemod->IsGenderAllowed() ? "male/" : "") + name + ".png");
+ return QFile::copy(f, pokemod->GetPath() + "pokemon/" + name + "/front" + (pokemod->IsGenderAllowed() ? "-male" : "") + ".png");
}
-bool PokeGen::PokeMod::Pokemon::SetBackMaleSprite(const QString& b)
+bool PokeGen::PokeMod::Species::SetBackMaleSprite(const QString& b)
{
- QFile file(pokemod->GetPath() + "images/pokemon/back/" + (pokemod->IsGenderAllowed() ? "male/" : "") + name + ".png");
+ QFile file(pokemod->GetPath() + "pokemon/" + name + "/back" + (pokemod->IsGenderAllowed() ? "-male" : "") + ".png");
if (file.exists() && !file.remove())
return false;
- return QFile::copy(b, pokemod->GetPath() + "images/pokemon/back/" + (pokemod->IsGenderAllowed() ? "male/" : "") + name + ".png");
+ return QFile::copy(b, pokemod->GetPath() + "pokemon/" + name + "/back" + (pokemod->IsGenderAllowed() ? "-male" : "") + ".png");
}
-bool PokeGen::PokeMod::Pokemon::SetFrontFemaleSprite(const QString& f)
+bool PokeGen::PokeMod::Species::SetFrontFemaleSprite(const QString& f)
{
if (pokemod->IsGenderAllowed())
{
- QFile file(pokemod->GetPath() + "images/pokemon/front/female/" + name + ".png");
+ QFile file(pokemod->GetPath() + "pokemon/" + name + "/front-female.png");
if (file.exists() && !file.remove())
return false;
- return QFile::copy(f, pokemod->GetPath() + "images/pokemon/front/female/" + name + ".png");
+ return QFile::copy(f, pokemod->GetPath() + "pokemon/" + name + "/front-female.png");
}
return false;
}
-bool PokeGen::PokeMod::Pokemon::SetBackFemaleSprite(const QString& b)
+bool PokeGen::PokeMod::Species::SetBackFemaleSprite(const QString& b)
{
if (pokemod->IsGenderAllowed())
{
- QFile file(pokemod->GetPath() + "images/pokemon/back/female/" + name + ".png");
+ QFile file(pokemod->GetPath() + "pokemon/" + name + "/back-female.png");
if (file.exists() && !file.remove())
return false;
- return QFile::copy(b, pokemod->GetPath() + "images/pokemon/back/female/" + name + ".png");
+ return QFile::copy(b, pokemod->GetPath() + "pokemon/" + name + "/back-female.png");
}
return false;
}
-bool PokeGen::PokeMod::Pokemon::SetListSprite(const QString& l)
+bool PokeGen::PokeMod::Species::SetListSprite(const QString& l)
{
- QFile file(pokemod->GetPath() + "images/pokemon/list/" + name + ".png");
+ QFile file(pokemod->GetPath() + "pokemon/" + name + "/list.png");
if (file.exists() && !file.remove())
return false;
- return QFile::copy(l, pokemod->GetPath() + "images/pokemon/list/" + name + ".png");
+ return QFile::copy(l, pokemod->GetPath() + "pokemon/" + name + "/list.png");
}
-bool PokeGen::PokeMod::Pokemon::SetGenderFactor(const unsigned n, const unsigned d)
+bool PokeGen::PokeMod::Species::SetGenderFactor(const unsigned n, const unsigned d)
{
return genderFactor.Set(n, d);
}
-bool PokeGen::PokeMod::Pokemon::SetGenderFactorNumerator(const unsigned n)
+bool PokeGen::PokeMod::Species::SetGenderFactorNumerator(const unsigned n)
{
return genderFactor.SetNum(n);
}
-bool PokeGen::PokeMod::Pokemon::SetGenderFactorDenominator(const unsigned d)
+bool PokeGen::PokeMod::Species::SetGenderFactorDenominator(const unsigned d)
{
return genderFactor.SetDenom(d);
}
-bool PokeGen::PokeMod::Pokemon::SetEggSpecies(const unsigned e)
+bool PokeGen::PokeMod::Species::SetEggSpecies(const unsigned e)
{
- if (pokemod->GetPokemon(e))
+ if (pokemod->GetSpecies(e))
eggSpecies = e;
return (eggSpecies == e);
}
-void PokeGen::PokeMod::Pokemon::SetEggSteps(const unsigned e)
+void PokeGen::PokeMod::Species::SetEggSteps(const unsigned e)
{
eggSteps = e;
}
-void PokeGen::PokeMod::Pokemon::SetIsDitto(const bool i)
+void PokeGen::PokeMod::Species::SetIsDitto(const bool i)
{
isDitto = i;
}
-void PokeGen::PokeMod::Pokemon::SetNidoranGroup(const unsigned n)
+void PokeGen::PokeMod::Species::SetNidoranGroup(const unsigned n)
{
nidoranGroup = n;
}
-QString PokeGen::PokeMod::Pokemon::GetName() const
+QString PokeGen::PokeMod::Species::GetName() const
{
return name;
}
-unsigned PokeGen::PokeMod::Pokemon::GetBaseStat(const unsigned s) const
+unsigned PokeGen::PokeMod::Species::GetBaseStat(const unsigned s) const
{
if ((s < ST_End_RBY) || ((s == ST_SpecialDefense) && pokemod->IsSpecialSplit()))
return baseStats[s];
return 0;
}
-unsigned PokeGen::PokeMod::Pokemon::GetEffortValue(const unsigned s) const
+unsigned PokeGen::PokeMod::Species::GetEffortValue(const unsigned s) const
{
if ((s < ST_End_RBY) || ((s == ST_SpecialDefense) && pokemod->IsSpecialSplit()))
return effortValues[s];
return 0;
}
-unsigned PokeGen::PokeMod::Pokemon::GetGrowth() const
+unsigned PokeGen::PokeMod::Species::GetGrowth() const
{
return growth;
}
-unsigned PokeGen::PokeMod::Pokemon::GetExperienceValue() const
+unsigned PokeGen::PokeMod::Species::GetExperienceValue() const
{
return experienceValue;
}
-unsigned char PokeGen::PokeMod::Pokemon::GetCatchValue() const
+unsigned char PokeGen::PokeMod::Species::GetCatchValue() const
{
return catchValue;
}
-PokeGen::PokeMod::Frac PokeGen::PokeMod::Pokemon::GetRunChance() const
+PokeGen::Frac PokeGen::PokeMod::Species::GetRunChance() const
{
return runChance;
}
-unsigned PokeGen::PokeMod::Pokemon::GetRunChanceNumerator() const
+unsigned PokeGen::PokeMod::Species::GetRunChanceNumerator() const
{
return runChance.GetNum();
}
-unsigned PokeGen::PokeMod::Pokemon::GetRunChanceDenominator() const
+unsigned PokeGen::PokeMod::Species::GetRunChanceDenominator() const
{
return runChance.GetDenom();
}
-PokeGen::PokeMod::Frac PokeGen::PokeMod::Pokemon::GetItemChance() const
+PokeGen::Frac PokeGen::PokeMod::Species::GetItemChance() const
{
return itemChance;
}
-unsigned PokeGen::PokeMod::Pokemon::GetItemChanceNumerator() const
+unsigned PokeGen::PokeMod::Species::GetItemChanceNumerator() const
{
return itemChance.GetNum();
}
-unsigned PokeGen::PokeMod::Pokemon::GetItemChanceDenominator() const
+unsigned PokeGen::PokeMod::Species::GetItemChanceDenominator() const
{
return itemChance.GetDenom();
}
-unsigned PokeGen::PokeMod::Pokemon::GetPokedexNumber() const
+unsigned PokeGen::PokeMod::Species::GetPokedexNumber() const
{
return pokedexNumber;
}
-unsigned PokeGen::PokeMod::Pokemon::GetWeight() const
+unsigned PokeGen::PokeMod::Species::GetWeight() const
{
return weight;
}
-unsigned PokeGen::PokeMod::Pokemon::GetHeightFeet() const
+unsigned PokeGen::PokeMod::Species::GetHeightFeet() const
{
return heightFeet;
}
-unsigned PokeGen::PokeMod::Pokemon::GetHeightInches() const
+unsigned PokeGen::PokeMod::Species::GetHeightInches() const
{
return heightInches;
}
-QString PokeGen::PokeMod::Pokemon::GetPokedexEntry() const
+QString PokeGen::PokeMod::Species::GetPokedexEntry() const
{
return pokedexEntry;
}
-PokeGen::PokeMod::Frac PokeGen::PokeMod::Pokemon::GetGenderFactor() const
+PokeGen::Frac PokeGen::PokeMod::Species::GetGenderFactor() const
{
return genderFactor;
}
-unsigned PokeGen::PokeMod::Pokemon::GetGenderFactorNumerator() const
+unsigned PokeGen::PokeMod::Species::GetGenderFactorNumerator() const
{
return genderFactor.GetNum();
}
-unsigned PokeGen::PokeMod::Pokemon::GetGenderFactorDenominator() const
+unsigned PokeGen::PokeMod::Species::GetGenderFactorDenominator() const
{
return genderFactor.GetDenom();
}
-unsigned PokeGen::PokeMod::Pokemon::GetEggSpecies() const
+unsigned PokeGen::PokeMod::Species::GetEggSpecies() const
{
return eggSpecies;
}
-unsigned PokeGen::PokeMod::Pokemon::GetEggSteps() const
+unsigned PokeGen::PokeMod::Species::GetEggSteps() const
{
return eggSteps;
}
-bool PokeGen::PokeMod::Pokemon::GetIsDitto() const
+bool PokeGen::PokeMod::Species::GetIsDitto() const
{
return isDitto;
}
-unsigned PokeGen::PokeMod::Pokemon::GetNidoranGroup() const
+unsigned PokeGen::PokeMod::Species::GetNidoranGroup() const
{
return nidoranGroup;
}
-unsigned PokeGen::PokeMod::Pokemon::GetType(const unsigned i) const
+unsigned PokeGen::PokeMod::Species::GetType(const unsigned i) const
{
if (i < GetTypeCount())
return types[i];
return UINT_MAX;
}
-unsigned PokeGen::PokeMod::Pokemon::GetTypeByID(const unsigned _id) const
+unsigned PokeGen::PokeMod::Species::GetTypeByID(const unsigned _id) const
{
for (unsigned i = 0; i < GetTypeCount(); ++i)
{
@@ -747,14 +710,14 @@ unsigned PokeGen::PokeMod::Pokemon::GetTypeByID(const unsigned _id) const
return UINT_MAX;
}
-unsigned PokeGen::PokeMod::Pokemon::GetTypeCount() const
+unsigned PokeGen::PokeMod::Species::GetTypeCount() const
{
return types.size();
}
-bool PokeGen::PokeMod::Pokemon::NewType(const unsigned i)
+bool PokeGen::PokeMod::Species::NewType(const unsigned i)
{
- if (pokemod->GetTypeByID(i) != UINT_MAX)
+ if (pokemod->GetTypeByID(i) == UINT_MAX)
{
types.append(i);
return true;
@@ -762,7 +725,7 @@ bool PokeGen::PokeMod::Pokemon::NewType(const unsigned i)
return false;
}
-bool PokeGen::PokeMod::Pokemon::DeleteType(const unsigned i)
+bool PokeGen::PokeMod::Species::DeleteType(const unsigned i)
{
if (i < GetTypeCount())
{
@@ -772,28 +735,28 @@ bool PokeGen::PokeMod::Pokemon::DeleteType(const unsigned i)
return false;
}
-unsigned PokeGen::PokeMod::Pokemon::GetEggGroup(const unsigned i) const
+unsigned PokeGen::PokeMod::Species::GetEggGroup(const unsigned i) const
{
if (i < GetEggGroupCount())
return eggGroups[i];
return UINT_MAX;
}
-unsigned PokeGen::PokeMod::Pokemon::GetEggGroupByID(const unsigned i) const
+unsigned PokeGen::PokeMod::Species::GetEggGroupByID(const unsigned i) const
{
if (i < GetEggGroupCount() <= i)
return eggGroups[i];
return UINT_MAX;
}
-unsigned PokeGen::PokeMod::Pokemon::GetEggGroupCount() const
+unsigned PokeGen::PokeMod::Species::GetEggGroupCount() const
{
return eggGroups.size();
}
-bool PokeGen::PokeMod::Pokemon::NewEggGroup(const unsigned i)
+bool PokeGen::PokeMod::Species::NewEggGroup(const unsigned i)
{
- if (pokemod->GetEggGroup(i))
+ if (pokemod->GetEggGroupByID(i) == UINT_MAX)
{
eggGroups.append(i);
return true;
@@ -801,7 +764,7 @@ bool PokeGen::PokeMod::Pokemon::NewEggGroup(const unsigned i)
return false;
}
-bool PokeGen::PokeMod::Pokemon::DeleteEggGroup(const unsigned i)
+bool PokeGen::PokeMod::Species::DeleteEggGroup(const unsigned i)
{
if (i < GetEggGroupCount())
{
@@ -811,14 +774,14 @@ bool PokeGen::PokeMod::Pokemon::DeleteEggGroup(const unsigned i)
return false;
}
-const PokeGen::PokeMod::PokemonAbility* PokeGen::PokeMod::Pokemon::GetAbility(const unsigned i) const
+const PokeGen::PokeMod::SpeciesAbility* PokeGen::PokeMod::Species::GetAbility(const unsigned i) const
{
if (i < GetAbilityCount())
return &abilities[i];
return NULL;
}
-unsigned PokeGen::PokeMod::Pokemon::GetAbilityByID(const unsigned _id) const
+unsigned PokeGen::PokeMod::Species::GetAbilityByID(const unsigned _id) const
{
for (unsigned i = 0; i < GetAbilityCount(); ++i)
{
@@ -828,27 +791,24 @@ unsigned PokeGen::PokeMod::Pokemon::GetAbilityByID(const unsigned _id) const
return UINT_MAX;
}
-unsigned PokeGen::PokeMod::Pokemon::GetAbilityCount() const
+unsigned PokeGen::PokeMod::Species::GetAbilityCount() const
{
return abilities.size();
}
-const PokeGen::PokeMod::PokemonAbility* PokeGen::PokeMod::Pokemon::NewAbility(Ini* const ini)
+const PokeGen::PokeMod::SpeciesAbility* PokeGen::PokeMod::Species::NewAbility(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetAbilityCount(); ++i)
- {
- if (GetAbilityByID(i) == UINT_MAX)
- break;
- }
- PokemonAbility newAbility(pokemod, i);
+ for (; (i < GetAbilityCount()) && (GetAbilityByID(i) != UINT_MAX); ++i)
+ ;
+ SpeciesAbility newAbility(pokemod, i);
if (ini)
newAbility.ImportIni(*ini);
abilities.append(newAbility);
return &abilities[GetAbilityCount() - 1];
}
-bool PokeGen::PokeMod::Pokemon::DeleteAbility(const unsigned i)
+bool PokeGen::PokeMod::Species::DeleteAbility(const unsigned i)
{
if (i < GetAbilityCount())
{
@@ -858,14 +818,14 @@ bool PokeGen::PokeMod::Pokemon::DeleteAbility(const unsigned i)
return false;
}
-const PokeGen::PokeMod::PokemonEvolution* PokeGen::PokeMod::Pokemon::GetEvolution(const unsigned i) const
+const PokeGen::PokeMod::SpeciesEvolution* PokeGen::PokeMod::Species::GetEvolution(const unsigned i) const
{
if (i < GetEvolutionCount())
return &evolutions[i];
return NULL;
}
-unsigned PokeGen::PokeMod::Pokemon::GetEvolutionByID(const unsigned _id) const
+unsigned PokeGen::PokeMod::Species::GetEvolutionByID(const unsigned _id) const
{
for (unsigned i = 0; i < GetEvolutionCount(); ++i)
{
@@ -875,27 +835,24 @@ unsigned PokeGen::PokeMod::Pokemon::GetEvolutionByID(const unsigned _id) const
return UINT_MAX;
}
-unsigned PokeGen::PokeMod::Pokemon::GetEvolutionCount() const
+unsigned PokeGen::PokeMod::Species::GetEvolutionCount() const
{
return evolutions.size();
}
-const PokeGen::PokeMod::PokemonEvolution* PokeGen::PokeMod::Pokemon::NewEvolution(Ini* const ini)
+const PokeGen::PokeMod::SpeciesEvolution* PokeGen::PokeMod::Species::NewEvolution(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetEvolutionCount(); ++i)
- {
- if (GetEvolutionByID(i) == UINT_MAX)
- break;
- }
- PokemonEvolution newEvolution(pokemod, i);
+ for (; (i < GetItemCount()) && (GetItemByID(i) != UINT_MAX); ++i)
+ ;
+ SpeciesEvolution newEvolution(pokemod, i);
if (ini)
newEvolution.ImportIni(*ini);
evolutions.append(newEvolution);
return &evolutions[GetEvolutionCount() - 1];
}
-bool PokeGen::PokeMod::Pokemon::DeleteEvolution(const unsigned i)
+bool PokeGen::PokeMod::Species::DeleteEvolution(const unsigned i)
{
if (i < GetEvolutionCount())
{
@@ -905,14 +862,14 @@ bool PokeGen::PokeMod::Pokemon::DeleteEvolution(const unsigned i)
return false;
}
-const PokeGen::PokeMod::PokemonItem* PokeGen::PokeMod::Pokemon::GetItem(const unsigned i) const
+const PokeGen::PokeMod::SpeciesItem* PokeGen::PokeMod::Species::GetItem(const unsigned i) const
{
if (i < GetItemCount())
return &items[i];
return NULL;
}
-unsigned PokeGen::PokeMod::Pokemon::GetItemByID(const unsigned _id) const
+unsigned PokeGen::PokeMod::Species::GetItemByID(const unsigned _id) const
{
for (unsigned i = 0; i < GetItemCount(); ++i)
{
@@ -922,27 +879,24 @@ unsigned PokeGen::PokeMod::Pokemon::GetItemByID(const unsigned _id) const
return UINT_MAX;
}
-unsigned PokeGen::PokeMod::Pokemon::GetItemCount() const
+unsigned PokeGen::PokeMod::Species::GetItemCount() const
{
return items.size();
}
-const PokeGen::PokeMod::PokemonItem* PokeGen::PokeMod::Pokemon::NewItem(Ini* const ini)
+const PokeGen::PokeMod::SpeciesItem* PokeGen::PokeMod::Species::NewItem(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetItemCount(); ++i)
- {
- if (GetItemByID(i) == UINT_MAX)
- break;
- }
- PokemonItem newItem(pokemod, i);
+ for (; (i < GetItemCount()) && (GetItemByID(i) != UINT_MAX); ++i)
+ ;
+ SpeciesItem newItem(pokemod, i);
if (ini)
newItem.ImportIni(*ini);
items.append(newItem);
return &items[GetItemCount() - 1];
}
-bool PokeGen::PokeMod::Pokemon::DeleteItem(const unsigned i)
+bool PokeGen::PokeMod::Species::DeleteItem(const unsigned i)
{
if (i < GetItemCount())
{
@@ -952,14 +906,14 @@ bool PokeGen::PokeMod::Pokemon::DeleteItem(const unsigned i)
return false;
}
-const PokeGen::PokeMod::PokemonMove* PokeGen::PokeMod::Pokemon::GetMove(const unsigned i) const
+const PokeGen::PokeMod::SpeciesMove* PokeGen::PokeMod::Species::GetMove(const unsigned i) const
{
if (i < GetMoveCount())
return &moves[i];
return NULL;
}
-unsigned PokeGen::PokeMod::Pokemon::GetMoveByID(const unsigned _id) const
+unsigned PokeGen::PokeMod::Species::GetMoveByID(const unsigned _id) const
{
for (unsigned i = 0; i < GetMoveCount(); ++i)
{
@@ -969,27 +923,24 @@ unsigned PokeGen::PokeMod::Pokemon::GetMoveByID(const unsigned _id) const
return UINT_MAX;
}
-unsigned PokeGen::PokeMod::Pokemon::GetMoveCount() const
+unsigned PokeGen::PokeMod::Species::GetMoveCount() const
{
return moves.size();
}
-const PokeGen::PokeMod::PokemonMove* PokeGen::PokeMod::Pokemon::NewMove(Ini* const ini)
+const PokeGen::PokeMod::SpeciesMove* PokeGen::PokeMod::Species::NewMove(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetMoveCount(); ++i)
- {
- if (GetMoveByID(i) == UINT_MAX)
- break;
- }
- PokemonMove newPokemonMove(pokemod, i);
+ for (; (i < GetMoveCount()) && (GetMoveByID(i) != UINT_MAX); ++i)
+ ;
+ SpeciesMove newSpeciesMove(pokemod, i);
if (ini)
- newPokemonMove.ImportIni(*ini);
- moves.append(newPokemonMove);
+ newSpeciesMove.ImportIni(*ini);
+ moves.append(newSpeciesMove);
return &moves[GetMoveCount() - 1];
}
-bool PokeGen::PokeMod::Pokemon::DeleteMove(const unsigned i)
+bool PokeGen::PokeMod::Species::DeleteMove(const unsigned i)
{
if (i < GetMoveCount())
{
@@ -998,50 +949,3 @@ bool PokeGen::PokeMod::Pokemon::DeleteMove(const unsigned i)
}
return false;
}
-
-const PokeGen::PokeMod::PokemonNature* PokeGen::PokeMod::Pokemon::GetNature(const unsigned i) const
-{
- if (i < GetNatureCount())
- return &natures[i];
- return NULL;
-}
-
-unsigned PokeGen::PokeMod::Pokemon::GetNatureByID(const unsigned _id) const
-{
- for (unsigned i = 0; i < GetNatureCount(); ++i)
- {
- if (natures[i].GetId() == _id)
- return i;
- }
- return UINT_MAX;
-}
-
-unsigned PokeGen::PokeMod::Pokemon::GetNatureCount() const
-{
- return natures.size();
-}
-
-const PokeGen::PokeMod::PokemonNature* PokeGen::PokeMod::Pokemon::NewNature(Ini* const ini)
-{
- unsigned i = 0;
- for (; i < GetNatureCount(); ++i)
- {
- if (GetNatureByID(i) == UINT_MAX)
- break;
- }
- PokemonNature newNature(pokemod, i);
- if (ini)
- newNature.ImportIni(*ini);
- natures.append(newNature);
- return &natures[GetNatureCount() - 1];
-}
-
-bool PokeGen::PokeMod::Pokemon::DeleteNature(const unsigned i)
-{
- if (i < GetNatureCount())
- {
- natures.erase(natures.begin() + i);
- return true;
- }
- return false;
-}
diff --git a/pokemod/Pokemon.h b/pokemod/Species.h
index a9cc04b0..55fa69d9 100644
--- a/pokemod/Pokemon.h
+++ b/pokemod/Species.h
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/Pokemon.h
-// Purpose: Define a Pokemon
+// Name: pokemod/Species.h
+// Purpose: Define a species
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Wed Feb 28 21:41:10 2007
@@ -13,34 +13,33 @@
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTPokemon or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTSpecies or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program. If not, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////////////////
-#ifndef __POKEMOD_POKEMON__
-#define __POKEMOD_POKEMON__
+#ifndef __POKEMOD_SPECIES__
+#define __POKEMOD_SPECIES__
#include <QFile>
#include <QList>
#include <QMap>
#include <QString>
+#include "../general/Frac.h"
#include "Object.h"
-#include "Frac.h"
#include "Pokemod.h"
-#include "PokemonAbility.h"
-#include "PokemonEvolution.h"
-#include "PokemonItem.h"
-#include "PokemonMove.h"
-#include "PokemonNature.h"
+#include "SpeciesAbility.h"
+#include "SpeciesEvolution.h"
+#include "SpeciesItem.h"
+#include "SpeciesMove.h"
namespace PokeGen
{
namespace PokeMod
{
- class Pokemon : public Object
+ class Species : public Object
{
public:
enum
@@ -55,8 +54,8 @@ namespace PokeGen
};
static const char* StyleStr[End];
- Pokemon(const Pokemod* par, const unsigned _id);
- Pokemon(const Pokemod* par, Ini& ini, const unsigned _id = UINT_MAX);
+ Species(const Pokemod* par, const unsigned _id);
+ Species(const Pokemod* par, Ini& ini, const unsigned _id = UINT_MAX);
void ImportIni(Ini& ini, const unsigned _id = UINT_MAX);
void ExportIni(QFile& fout) const;
@@ -133,35 +132,29 @@ namespace PokeGen
bool NewEggGroup(const unsigned i);
bool DeleteEggGroup(const unsigned i);
- const PokemonAbility* GetAbility(const unsigned i) const;
+ const SpeciesAbility* GetAbility(const unsigned i) const;
unsigned GetAbilityByID(const unsigned _id) const;
unsigned GetAbilityCount() const;
- const PokemonAbility* NewAbility(Ini* const ini = NULL);
+ const SpeciesAbility* NewAbility(Ini* const ini = NULL);
bool DeleteAbility(const unsigned i);
- const PokemonEvolution* GetEvolution(const unsigned i) const;
+ const SpeciesEvolution* GetEvolution(const unsigned i) const;
unsigned GetEvolutionByID(const unsigned _id) const;
unsigned GetEvolutionCount() const;
- const PokemonEvolution* NewEvolution(Ini* const ini = NULL);
+ const SpeciesEvolution* NewEvolution(Ini* const ini = NULL);
bool DeleteEvolution(const unsigned i);
- const PokemonItem* GetItem(const unsigned i) const;
+ const SpeciesItem* GetItem(const unsigned i) const;
unsigned GetItemByID(const unsigned _id) const;
unsigned GetItemCount() const;
- const PokemonItem* NewItem(Ini* const ini = NULL);
+ const SpeciesItem* NewItem(Ini* const ini = NULL);
bool DeleteItem(const unsigned i);
- const PokemonMove* GetMove(const unsigned i) const;
+ const SpeciesMove* GetMove(const unsigned i) const;
unsigned GetMoveByID(const unsigned _id) const;
unsigned GetMoveCount() const;
- const PokemonMove* NewMove(Ini* const ini = NULL);
+ const SpeciesMove* NewMove(Ini* const ini = NULL);
bool DeleteMove(const unsigned i);
-
- const PokemonNature* GetNature(const unsigned i) const;
- unsigned GetNatureByID(const unsigned _id) const;
- unsigned GetNatureCount() const;
- const PokemonNature* NewNature(Ini* const ini = NULL);
- bool DeleteNature(const unsigned i);
private:
bool Validate();
@@ -187,14 +180,11 @@ namespace PokeGen
QList<unsigned> types;
QList<unsigned> eggGroups;
- QList<PokemonAbility> abilities;
- QList<PokemonEvolution> evolutions;
- QList<PokemonItem> items;
- QList<PokemonMove> moves;
- QList<PokemonNature> natures;
+ QList<SpeciesAbility> abilities;
+ QList<SpeciesEvolution> evolutions;
+ QList<SpeciesItem> items;
+ QList<SpeciesMove> moves;
};
-
- const char* Pokemon::StyleStr[Pokemon::End] = {"Fluctuating", "Fading", "Slow", "Normal", "Fast", "Erratic"};
}
}
diff --git a/pokemod/PokemonAbility.cpp b/pokemod/SpeciesAbility.cpp
index a6ff8730..07a97a1b 100644
--- a/pokemod/PokemonAbility.cpp
+++ b/pokemod/SpeciesAbility.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/PokemonAbility.cpp
-// Purpose: Define an ability that a Pokémon can have
+// Name: pokemod/SpeciesAbility.cpp
+// Purpose: Define an ability that a species can have
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Mar 20 18:39:17 2007
@@ -20,22 +20,22 @@
// with this program. If not, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////////////////
-#include "PokemonAbility.h"
+#include "SpeciesAbility.h"
-PokeGen::PokeMod::PokemonAbility::PokemonAbility(const Pokemod* par, const unsigned _id) :
+PokeGen::PokeMod::SpeciesAbility::SpeciesAbility(const Pokemod* par, const unsigned _id) :
Object(_id, par),
ability(UINT_MAX),
weight(1)
{
}
-PokeGen::PokeMod::PokemonAbility::PokemonAbility(const Pokemod* par, Ini& ini, const unsigned _id) :
+PokeGen::PokeMod::SpeciesAbility::SpeciesAbility(const Pokemod* par, Ini& ini, const unsigned _id) :
Object(_id, par)
{
ImportIni(ini, _id);
}
-bool PokeGen::PokeMod::PokemonAbility::Validate()
+bool PokeGen::PokeMod::SpeciesAbility::Validate()
{
pokemod->ValidationMsg(QString("------Ability with id %1---").arg(id), Pokemod::V_Msg);
if (pokemod->GetAbilityByID(ability) == UINT_MAX)
@@ -51,7 +51,7 @@ bool PokeGen::PokeMod::PokemonAbility::Validate()
return isValid;
}
-void PokeGen::PokeMod::PokemonAbility::ImportIni(Ini& ini, const unsigned _id)
+void PokeGen::PokeMod::SpeciesAbility::ImportIni(Ini& ini, const unsigned _id)
{
if (_id == UINT_MAX)
ini.GetValue("id", id);
@@ -61,35 +61,35 @@ void PokeGen::PokeMod::PokemonAbility::ImportIni(Ini& ini, const unsigned _id)
ini.GetValue("weight", weight, 1);
}
-void PokeGen::PokeMod::PokemonAbility::ExportIni(QFile& fout, const QString& pokemon) const
+void PokeGen::PokeMod::SpeciesAbility::ExportIni(QFile& fout, const QString& species) const
{
- Ini exPokemonAbility("pokemonAbility " + pokemon);
- exPokemonAbility.AddField("id", id);
- exPokemonAbility.AddField("ability", ability);
- exPokemonAbility.AddField("weight", weight);
- exPokemonAbility.Export(fout);
+ Ini exSpeciesAbility("speciesAbility " + species);
+ exSpeciesAbility.AddField("id", id);
+ exSpeciesAbility.AddField("ability", ability);
+ exSpeciesAbility.AddField("weight", weight);
+ exSpeciesAbility.Export(fout);
}
-bool PokeGen::PokeMod::PokemonAbility::SetAbility(const unsigned a)
+bool PokeGen::PokeMod::SpeciesAbility::SetAbility(const unsigned a)
{
if (pokemod->GetAbilityByID(a) != UINT_MAX)
ability = a;
return (ability == a);
}
-bool PokeGen::PokeMod::PokemonAbility::SetWeight(const unsigned w)
+bool PokeGen::PokeMod::SpeciesAbility::SetWeight(const unsigned w)
{
if (w)
weight = w;
return (weight == w);
}
-unsigned PokeGen::PokeMod::PokemonAbility::GetAbility() const
+unsigned PokeGen::PokeMod::SpeciesAbility::GetAbility() const
{
return ability;
}
-unsigned PokeGen::PokeMod::PokemonAbility::GetWeight() const
+unsigned PokeGen::PokeMod::SpeciesAbility::GetWeight() const
{
return weight;
}
diff --git a/pokemod/PokemonAbility.h b/pokemod/SpeciesAbility.h
index ffc2c23d..420fa7cb 100644
--- a/pokemod/PokemonAbility.h
+++ b/pokemod/SpeciesAbility.h
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/PokemonAbility.h
-// Purpose: Define an ability that a Pokémon can have
+// Name: pokemod/SpeciesAbility.h
+// Purpose: Define an ability that a species can have
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Mar 20 18:39:17 2007
@@ -11,7 +11,7 @@
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
-// This program is distributed in the hope that it will be useful,
+// This program is distributPokemoned in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
@@ -20,8 +20,8 @@
// with this program. If not, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////////////////
-#ifndef __POKEMOD_POKEMONABILITY__
-#define __POKEMOD_POKEMONABILITY__
+#ifndef __POKEMOD_SPECIESABILITY__
+#define __POKEMOD_SPECIESABILITY__
#include <QFile>
#include <QString>
@@ -32,14 +32,14 @@ namespace PokeGen
{
namespace PokeMod
{
- class PokemonAbility : public Object
+ class SpeciesAbility : public Object
{
public:
- PokemonAbility(const Pokemod* par, const unsigned _id);
- PokemonAbility(const Pokemod* par, Ini& ini, const unsigned _id = UINT_MAX);
+ SpeciesAbility(const Pokemod* par, const unsigned _id);
+ SpeciesAbility(const Pokemod* par, Ini& ini, const unsigned _id = UINT_MAX);
void ImportIni(Ini& ini, const unsigned _id = UINT_MAX);
- void ExportIni(QFile& fout, const QString& pokemon) const;
+ void ExportIni(QFile& fout, const QString& species) const;
bool SetAbility(const unsigned a);
bool SetWeight(const unsigned w);
diff --git a/pokemod/SpeciesEvolution.cpp b/pokemod/SpeciesEvolution.cpp
new file mode 100644
index 00000000..cb001b0a
--- /dev/null
+++ b/pokemod/SpeciesEvolution.cpp
@@ -0,0 +1,258 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: pokemod/SpeciesEvolution.cpp
+// Purpose: Define an evolution that a species can go through
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Tue Mar 20 18:45:29 2007
+// Copyright: ©2007 Ben Boeckel and Nerdy Productions
+// Licence:
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. If not, see <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#include "SpeciesEvolution.h"
+
+const char* PokeGen::PokeMod::SpeciesEvolution::StyleStr[PokeGen::PokeMod::SpeciesEvolution::S_End] = {"Level", "Happiness", "Stat", "Item", "Trade", "TradeItem", "Personality", "Spare Slot"};
+const char* PokeGen::PokeMod::SpeciesEvolution::GiveHoldStr[PokeGen::PokeMod::SpeciesEvolution::G_End] = {"Give", "Hold"};
+
+PokeGen::PokeMod::SpeciesEvolution::SpeciesEvolution(const Pokemod* par, const unsigned _id) :
+ Object(_id, par),
+ species(UINT_MAX),
+ style(UINT_MAX),
+ val1(UINT_MAX),
+ val2(UINT_MAX),
+ val3(UINT_MAX),
+ level(0)
+{
+}
+
+PokeGen::PokeMod::SpeciesEvolution::SpeciesEvolution(const Pokemod* par, Ini& ini, const unsigned _id) :
+ Object(_id, par)
+{
+ ImportIni(ini, _id);
+}
+
+bool PokeGen::PokeMod::SpeciesEvolution::Validate()
+{
+ pokemod->ValidationMsg(QString("------Evolution with id %1---").arg(id), Pokemod::V_Msg);
+ if (pokemod->GetSpeciesByID(species) == UINT_MAX)
+ {
+ pokemod->ValidationMsg("Invalid species");
+ isValid = false;
+ }
+ if (style < S_End)
+ {
+ bool ok = true;
+ switch (style)
+ {
+ case S_Stat:
+ case S_Personality:
+ if (REL_End <= val1)
+ ok = false;
+ break;
+ case S_Item:
+ case S_TradeItem:
+ ok = false;
+ if (const Item* it = pokemod->GetItem(pokemod->GetItemByID(val1)))
+ {
+ for (unsigned i = 0; i < it->GetEffectCount(); ++i)
+ {
+ if (it->GetEffect(i)->GetEffect() == ItemEffect::E_Evolution)
+ {
+ ok = true;
+ break;
+ }
+ }
+ }
+ break;
+ }
+ if (!ok)
+ {
+ pokemod->ValidationMsg("Invalid val1");
+ isValid = false;
+ ok = true;
+ }
+ switch (style)
+ {
+ case S_Item:
+ if ((G_End <= val2) || ((val2 == G_Hold) && !pokemod->GetHoldItems()))
+ ok = false;
+ break;
+ }
+ if (!ok)
+ {
+ pokemod->ValidationMsg("Invalid val2");
+ isValid = false;
+ ok = true;
+ }
+ switch (style)
+ {
+ case S_Stat:
+ if ((pokemod->IsSpecialSplit() ? ST_End_GSC : ST_End_RBY) <= val1)
+ ok = false;
+ break;
+ }
+ if (!ok)
+ {
+ pokemod->ValidationMsg("Invalid val3");
+ isValid = false;
+ }
+ }
+ else
+ {
+ pokemod->ValidationMsg("Invalid style");
+ isValid = false;
+ }
+ if (pokemod->GetMaxLevel() <= level)
+ {
+ pokemod->ValidationMsg("Invalid level");
+ isValid = false;
+ }
+ return isValid;
+}
+
+void PokeGen::PokeMod::SpeciesEvolution::ImportIni(Ini& ini, const unsigned _id)
+{
+ if (_id == UINT_MAX)
+ ini.GetValue("id", id);
+ else
+ id = _id;
+ ini.GetValue("species", species);
+ ini.GetValue("style", style);
+ ini.GetValue("val1", val1);
+ ini.GetValue("val2", val2);
+ ini.GetValue("val3", val3);
+ ini.GetValue("level", level, 0);
+}
+
+void PokeGen::PokeMod::SpeciesEvolution::ExportIni(QFile& fout, const QString& species) const
+{
+ Ini exSpeciesEvolution("speciesEvolution " + species);
+ exSpeciesEvolution.AddField("id", id);
+ exSpeciesEvolution.AddField("species", species);
+ exSpeciesEvolution.AddField("style", style);
+ exSpeciesEvolution.AddField("val1", val1);
+ exSpeciesEvolution.AddField("val2", val2);
+ exSpeciesEvolution.AddField("val3", val3);
+ exSpeciesEvolution.AddField("level", level);
+ exSpeciesEvolution.Export(fout);
+}
+
+bool PokeGen::PokeMod::SpeciesEvolution::SetSpecies(const unsigned s)
+{
+ if (pokemod->GetSpeciesByID(s) != UINT_MAX)
+ species = s;
+ return (species == s);
+}
+
+bool PokeGen::PokeMod::SpeciesEvolution::SetStyle(const unsigned s)
+{
+ if (s < S_End)
+ style = s;
+ return (style == s);
+}
+
+bool PokeGen::PokeMod::SpeciesEvolution::SetVal1(const unsigned v1)
+{
+ switch (style)
+ {
+ case S_Happiness:
+ val1 = v1;
+ break;
+ case S_Stat:
+ case S_Personality:
+ if (v1 < REL_End)
+ val1 = v1;
+ break;
+ case S_Item:
+ case S_TradeItem:
+ if (const Item* it = pokemod->GetItem(pokemod->GetItemByID(val1)))
+ {
+ for (unsigned i = 0; i < it->GetEffectCount(); ++i)
+ {
+ if (it->GetEffect(i)->GetEffect() == ItemEffect::E_Evolution)
+ {
+ val1 = v1;
+ break;
+ }
+ }
+ }
+ break;
+ }
+ return (val1 == v1);
+}
+
+bool PokeGen::PokeMod::SpeciesEvolution::SetVal2(const unsigned v2)
+{
+ switch (style)
+ {
+ case S_Stat:
+ case S_Personality:
+ val2 = v2;
+ break;
+ case S_Item:
+ if ((v2 == G_Give) || ((v2 == G_Hold) && pokemod->GetHoldItems()))
+ val2 = v2;
+ break;
+ }
+ return (val2 == v2);
+}
+
+bool PokeGen::PokeMod::SpeciesEvolution::SetVal3(const unsigned v3)
+{
+ switch (style)
+ {
+ case S_Stat:
+ if (v3 < (pokemod->IsSpecialSplit() ? ST_End_GSC : ST_End_RBY))
+ val3 = v3;
+ break;
+ }
+ return (val3 == v3);
+}
+
+bool PokeGen::PokeMod::SpeciesEvolution::SetLevel(const unsigned l)
+{
+ if (l <= pokemod->GetMaxLevel())
+ level = l;
+ return (level == l);
+}
+
+unsigned PokeGen::PokeMod::SpeciesEvolution::GetSpecies() const
+{
+ return species;
+}
+
+unsigned PokeGen::PokeMod::SpeciesEvolution::GetStyle() const
+{
+ return style;
+}
+
+unsigned PokeGen::PokeMod::SpeciesEvolution::GetVal1() const
+{
+ return val1;
+}
+
+unsigned PokeGen::PokeMod::SpeciesEvolution::GetVal2() const
+{
+ return val2;
+}
+
+unsigned PokeGen::PokeMod::SpeciesEvolution::GetVal3() const
+{
+ return val3;
+}
+
+unsigned PokeGen::PokeMod::SpeciesEvolution::GetLevel() const
+{
+ return level;
+}
diff --git a/pokemod/PokemonEvolution.h b/pokemod/SpeciesEvolution.h
index 51bf91ea..0c13849d 100644
--- a/pokemod/PokemonEvolution.h
+++ b/pokemod/SpeciesEvolution.h
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/PokemonEvolution.h
-// Purpose: Define an evolution that a Pokémon can go through
+// Name: pokemod/SpeciesEvolution.h
+// Purpose: Define an evolution that a species can go through
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Mar 20 18:45:29 2007
@@ -20,8 +20,8 @@
// with this program. If not, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////////////////
-#ifndef __POKEMOD_POKEMONEVOLUTION__
-#define __POKEMOD_POKEMONEVOLUTION__
+#ifndef __POKEMOD_SPECIESEVOLUTION__
+#define __POKEMOD_SPECIESEVOLUTION__
#include <QFile>
#include <QString>
@@ -32,40 +32,49 @@ namespace PokeGen
{
namespace PokeMod
{
- class PokemonEvolution : public Object
+ class SpeciesEvolution : public Object
{
public:
- // TODO (Ben#1#): Evolution Styles
- enum
+ enum Style
{
- Happiness = 0,
- Trade = 1,
- Stat = 2,
- Item = 3,
- // = ,
- // = ,
- // = ,
- // = ,
- End = 5
+ S_Level = 0,
+ S_Happiness = 1,
+ S_Stat = 2,
+ S_Item = 3,
+ S_Trade = 4,
+ S_TradeItem = 5,
+ S_Personality = 6,
+ S_SpareSlot = 7,
+ S_End = 8
};
- static const char* StyleStr[End];
+ static const char* StyleStr[S_End];
- PokemonEvolution(const Pokemod* par, const unsigned _id);
- PokemonEvolution(const Pokemod* par, Ini& ini, const unsigned _id = UINT_MAX);
+ enum GiveHold
+ {
+ G_Give = 0,
+ G_Hold = 1,
+ G_End = 2
+ };
+ static const char* GiveHoldStr[G_End];
+
+ SpeciesEvolution(const Pokemod* par, const unsigned _id);
+ SpeciesEvolution(const Pokemod* par, Ini& ini, const unsigned _id = UINT_MAX);
void ImportIni(Ini& ini, const unsigned _id = UINT_MAX);
- void ExportIni(QFile& fout, const QString& pokemon) const;
+ void ExportIni(QFile& fout, const QString& species) const;
bool SetSpecies(const unsigned s);
bool SetStyle(const unsigned s);
bool SetVal1(const unsigned v1);
bool SetVal2(const unsigned v2);
+ bool SetVal3(const unsigned v3);
bool SetLevel(const unsigned l);
unsigned GetSpecies() const;
unsigned GetStyle() const;
unsigned GetVal1() const;
unsigned GetVal2() const;
+ unsigned GetVal3() const;
unsigned GetLevel() const;
private:
bool Validate();
@@ -74,6 +83,7 @@ namespace PokeGen
unsigned style;
unsigned val1;
unsigned val2;
+ unsigned val3;
unsigned level;
};
}
diff --git a/pokemod/PokemonItem.cpp b/pokemod/SpeciesItem.cpp
index aa7e5ea2..93b857be 100644
--- a/pokemod/PokemonItem.cpp
+++ b/pokemod/SpeciesItem.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/PokemonItem.cpp
-// Purpose: Define an item that a Pokémon can be found with in the wild
+// Name: pokemod/SpeciesItem.cpp
+// Purpose: Define an item that a species can be found with in the wild
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Mar 20 18:40:28 2007
@@ -20,22 +20,22 @@
// with this program. If not, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////////////////
-#include "PokemonItem.h"
+#include "SpeciesItem.h"
-PokeGen::PokeMod::PokemonItem::PokemonItem(const Pokemod* par, const unsigned _id) :
+PokeGen::PokeMod::SpeciesItem::SpeciesItem(const Pokemod* par, const unsigned _id) :
Object(_id, par),
item(UINT_MAX),
weight(1)
{
}
-PokeGen::PokeMod::PokemonItem::PokemonItem(const Pokemod* par, Ini& ini, const unsigned _id) :
+PokeGen::PokeMod::SpeciesItem::SpeciesItem(const Pokemod* par, Ini& ini, const unsigned _id) :
Object(_id, par)
{
ImportIni(ini, _id);
}
-bool PokeGen::PokeMod::PokemonItem::Validate()
+bool PokeGen::PokeMod::SpeciesItem::Validate()
{
pokemod->ValidationMsg(QString("------Item with id %1---").arg(id), Pokemod::V_Msg);
if (pokemod->GetItemByID(item) == UINT_MAX)
@@ -51,7 +51,7 @@ bool PokeGen::PokeMod::PokemonItem::Validate()
return isValid;
}
-void PokeGen::PokeMod::PokemonItem::ImportIni(Ini& ini, const unsigned _id)
+void PokeGen::PokeMod::SpeciesItem::ImportIni(Ini& ini, const unsigned _id)
{
if (_id == UINT_MAX)
ini.GetValue("id", id);
@@ -61,35 +61,35 @@ void PokeGen::PokeMod::PokemonItem::ImportIni(Ini& ini, const unsigned _id)
ini.GetValue("weight", weight, 1);
}
-void PokeGen::PokeMod::PokemonItem::ExportIni(QFile& fout, const QString& pokemon) const
+void PokeGen::PokeMod::SpeciesItem::ExportIni(QFile& fout, const QString& species) const
{
- Ini exPokemonItem("pokemonItem " + pokemon);
- exPokemonItem.AddField("id", id);
- exPokemonItem.AddField("item", item);
- exPokemonItem.AddField("weight", weight);
- exPokemonItem.Export(fout);
+ Ini exSpeciesItem("speciesItem " + species);
+ exSpeciesItem.AddField("id", id);
+ exSpeciesItem.AddField("item", item);
+ exSpeciesItem.AddField("weight", weight);
+ exSpeciesItem.Export(fout);
}
-bool PokeGen::PokeMod::PokemonItem::SetItem(const unsigned i)
+bool PokeGen::PokeMod::SpeciesItem::SetItem(const unsigned i)
{
if (pokemod->GetItemByID(i) != UINT_MAX)
item = i;
return (item == i);
}
-bool PokeGen::PokeMod::PokemonItem::SetWeight(const unsigned w)
+bool PokeGen::PokeMod::SpeciesItem::SetWeight(const unsigned w)
{
if (w)
weight = w;
return (weight == w);
}
-unsigned PokeGen::PokeMod::PokemonItem::GetItem() const
+unsigned PokeGen::PokeMod::SpeciesItem::GetItem() const
{
return item;
}
-unsigned PokeGen::PokeMod::PokemonItem::GetWeight() const
+unsigned PokeGen::PokeMod::SpeciesItem::GetWeight() const
{
return weight;
}
diff --git a/pokemod/PokemonItem.h b/pokemod/SpeciesItem.h
index aef451e6..a935bdbc 100644
--- a/pokemod/PokemonItem.h
+++ b/pokemod/SpeciesItem.h
@@ -1,9 +1,9 @@
/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/PokemonItem.h
-// Purpose: Define an item that a Pokémon can be found with in the wild
+// Name: pokemod/SpeciesItem.h
+// Purpose: Define an item that a species can be found with in the wild
// Author: Ben Boeckel
// Modified by: Ben Boeckel
-// Created: Tue Mar 20 18:40:28 2007
+// Created: Tue Mar 20 18:40:28 2007Pokémon
// Copyright: ©2007 Ben Boeckel and Nerdy Productions
// Licence:
// This program is free software: you can redistribute it and/or modify
@@ -20,8 +20,8 @@
// with this program. If not, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////////////////
-#ifndef __POKEMOD_POKEMONITEM__
-#define __POKEMOD_POKEMONITEM__
+#ifndef __POKEMOD_SPECIESITEM__
+#define __POKEMOD_SPECIESITEM__
#include <QFile>
#include <QString>
@@ -32,14 +32,14 @@ namespace PokeGen
{
namespace PokeMod
{
- class PokemonItem : public Object
+ class SpeciesItem : public Object
{
public:
- PokemonItem(const Pokemod* par, const unsigned _id);
- PokemonItem(const Pokemod* par, Ini& ini, const unsigned _id = UINT_MAX);
+ SpeciesItem(const Pokemod* par, const unsigned _id);
+ SpeciesItem(const Pokemod* par, Ini& ini, const unsigned _id = UINT_MAX);
void ImportIni(Ini& ini, const unsigned _id = UINT_MAX);
- void ExportIni(QFile& fout, const QString& pokemon) const;
+ void ExportIni(QFile& fout, const QString& species) const;
bool SetItem(const unsigned i);
bool SetWeight(const unsigned w);
diff --git a/pokemod/PokemonMove.cpp b/pokemod/SpeciesMove.cpp
index 26302dba..da078c5c 100644
--- a/pokemod/PokemonMove.cpp
+++ b/pokemod/SpeciesMove.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/PokemonMove.cpp
-// Purpose: Define a move that a Pokémon can learn
+// Name: pokemod/SpeciesMove.cpp
+// Purpose: Define a move that a species can learn
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Mar 20 18:45:29 2007
@@ -20,9 +20,9 @@
// with this program. If not, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////////////////
-#include "PokemonMove.h"
+#include "SpeciesMove.h"
-PokeGen::PokeMod::PokemonMove::PokemonMove(const Pokemod* par, const unsigned _id) :
+PokeGen::PokeMod::SpeciesMove::SpeciesMove(const Pokemod* par, const unsigned _id) :
Object(_id, par),
move(UINT_MAX),
level(0),
@@ -30,13 +30,13 @@ PokeGen::PokeMod::PokemonMove::PokemonMove(const Pokemod* par, const unsigned _i
{
}
-PokeGen::PokeMod::PokemonMove::PokemonMove(const Pokemod* par, Ini& ini, const unsigned _id) :
+PokeGen::PokeMod::SpeciesMove::SpeciesMove(const Pokemod* par, Ini& ini, const unsigned _id) :
Object(_id, par)
{
ImportIni(ini, _id);
}
-bool PokeGen::PokeMod::PokemonMove::Validate()
+bool PokeGen::PokeMod::SpeciesMove::Validate()
{
pokemod->ValidationMsg(QString("------Move with id %1---").arg(id), Pokemod::V_Msg);
if (pokemod->GetMoveByID(move) == UINT_MAX)
@@ -57,7 +57,7 @@ bool PokeGen::PokeMod::PokemonMove::Validate()
return isValid;
}
-void PokeGen::PokeMod::PokemonMove::ImportIni(Ini& ini, const unsigned _id)
+void PokeGen::PokeMod::SpeciesMove::ImportIni(Ini& ini, const unsigned _id)
{
if (_id == UINT_MAX)
ini.GetValue("id", id);
@@ -68,48 +68,48 @@ void PokeGen::PokeMod::PokemonMove::ImportIni(Ini& ini, const unsigned _id)
ini.GetValue("wild", wild, 0);
}
-void PokeGen::PokeMod::PokemonMove::ExportIni(QFile& fout, const QString& pokemon) const
+void PokeGen::PokeMod::SpeciesMove::ExportIni(QFile& fout, const QString& species) const
{
- Ini exPokemonMove("pokemonMove " + pokemon);
- exPokemonMove.AddField("id", id);
- exPokemonMove.AddField("move", move);
- exPokemonMove.AddField("level", level);
- exPokemonMove.AddField("wild", wild);
- exPokemonMove.Export(fout);
+ Ini exSpeciesMove("speciesMove " + species);
+ exSpeciesMove.AddField("id", id);
+ exSpeciesMove.AddField("move", move);
+ exSpeciesMove.AddField("level", level);
+ exSpeciesMove.AddField("wild", wild);
+ exSpeciesMove.Export(fout);
}
-bool PokeGen::PokeMod::PokemonMove::SetMove(const unsigned m)
+bool PokeGen::PokeMod::SpeciesMove::SetMove(const unsigned m)
{
if (pokemod->GetMoveByID(m) != UINT_MAX)
move = m;
return (move == m);
}
-bool PokeGen::PokeMod::PokemonMove::SetLevel(const unsigned l)
+bool PokeGen::PokeMod::SpeciesMove::SetLevel(const unsigned l)
{
if (l < pokemod->GetMaxLevel())
level = l;
return (level == l);
}
-bool PokeGen::PokeMod::PokemonMove::SetWild(const unsigned w)
+bool PokeGen::PokeMod::SpeciesMove::SetWild(const unsigned w)
{
if (w < pokemod->GetMaxLevel())
wild = w;
return (wild == w);
}
-unsigned PokeGen::PokeMod::PokemonMove::GetMove() const
+unsigned PokeGen::PokeMod::SpeciesMove::GetMove() const
{
return move;
}
-unsigned PokeGen::PokeMod::PokemonMove::GetLevel() const
+unsigned PokeGen::PokeMod::SpeciesMove::GetLevel() const
{
return level;
}
-unsigned PokeGen::PokeMod::PokemonMove::GetWild() const
+unsigned PokeGen::PokeMod::SpeciesMove::GetWild() const
{
return wild;
}
diff --git a/pokemod/PokemonMove.h b/pokemod/SpeciesMove.h
index f14159b8..09df019c 100644
--- a/pokemod/PokemonMove.h
+++ b/pokemod/SpeciesMove.h
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/PokemonMove.h
-// Purpose: Define a move that a Pokémon can learn
+// Name: pokemod/SpeciesMove.h
+// Purpose: Define a move that a species can learn
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Mar 20 18:45:29 2007
@@ -20,8 +20,8 @@
// with this program. If not, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////////////////
-#ifndef __POKEMOD_POKEMONMOVE__
-#define __POKEMOD_POKEMONMOVE__
+#ifndef __POKEMOD_SPECIESMOVE__
+#define __POKEMOD_SPECIESMOVE__
#include <QFile>
#include <QString>
@@ -32,14 +32,14 @@ namespace PokeGen
{
namespace PokeMod
{
- class PokemonMove : public Object
+ class SpeciesMove : public Object
{
public:
- PokemonMove(const Pokemod* par, const unsigned _id);
- PokemonMove(const Pokemod* par, Ini& ini, const unsigned _id = UINT_MAX);
+ SpeciesMove(const Pokemod* par, const unsigned _id);
+ SpeciesMove(const Pokemod* par, Ini& ini, const unsigned _id = UINT_MAX);
void ImportIni(Ini& ini, const unsigned _id = UINT_MAX);
- void ExportIni(QFile& fout, const QString& pokemon) const;
+ void ExportIni(QFile& fout, const QString& species) const;
bool SetMove(const unsigned m);
bool SetLevel(const unsigned l);
diff --git a/pokemod/Status.cpp b/pokemod/Status.cpp
deleted file mode 100644
index 7ea407e8..00000000
--- a/pokemod/Status.cpp
+++ /dev/null
@@ -1,259 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/Status.cpp
-// Purpose: Define an Status that Pokémon can possess to add extra
-// dynamics to the battle system
-// Author: Ben Boeckel
-// Modified by: Ben Boeckel
-// Created: Sat June 2 2007 12:00:45
-// Copyright: ©2007 Nerdy Productions
-// Licence:
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTStatus or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program. If not, see <http://www.gnu.org/licenses/>.
-/////////////////////////////////////////////////////////////////////////////
-
-#include "Status.h"
-
-PokeGen::PokeMod::Status::Status(const Pokemod* par, const unsigned _id) :
- Object(_id, par),
- name(""),
- abbreviation(""),
- verb(""),
- afterSwitch(UINT_MAX),
- afterBattle(UINT_MAX),
- maxTurns(0),
- catchBonus(0)
-{
-}
-
-PokeGen::PokeMod::Status::Status(const Pokemod* par, Ini& ini, const unsigned _id) :
- Object(_id, par)
-{
- ImportIni(ini, _id);
-}
-
-bool PokeGen::PokeMod::Status::Validate()
-{
- pokemod->ValidationMsg(QString("---Status \"%1\" with id %2---").arg(name).arg(id), Pokemod::V_Msg);
- if (name == "")
- {
- pokemod->ValidationMsg("Name is not defined");
- isValid = false;
- }
- else if ((name == "Clear") || (name == "Any"))
- {
- pokemod->ValidationMsg("Invalid name");
- isValid = false;
- }
- if (abbreviation == "")
- pokemod->ValidationMsg("Abbreviation is not defined");
- else if (4 <= abbreviation.length())
- {
- pokemod->ValidationMsg("Abbreviation too long");
- isValid = false;
- }
- if (verb == "")
- pokemod->ValidationMsg("Verb is not defined", Pokemod::V_Warn);
- if (afterSwitch == UINT_MAX)
- pokemod->ValidationMsg("After switch status is not defined", Pokemod::V_Warn);
- else if (pokemod->GetStatusByID(afterSwitch) == UINT_MAX)
- {
- pokemod->ValidationMsg("Invalid after switch status");
- isValid = false;
- }
- if (afterBattle == UINT_MAX)
- pokemod->ValidationMsg("After battle status is not defined", Pokemod::V_Warn);
- else if (pokemod->GetStatusByID(afterBattle) == UINT_MAX)
- {
- pokemod->ValidationMsg("Invalid after battle abbreviation");
- isValid = false;
- }
- if (GetEffectCount())
- {
- QMap<unsigned, unsigned> idChecker;
- for (QList<StatusEffect>::Iterator i = effects.begin(); i != effects.end(); ++i)
- {
- if (!i->IsValid())
- isValid = false;
- ++idChecker[i->GetId()];
- }
- for (QMap<unsigned, unsigned>::ConstIterator i = idChecker.begin(); i != idChecker.end(); ++i)
- {
- if (1 < i.value())
- {
- pokemod->ValidationMsg(QString("There are %1 effects with id %2").arg(i.value()).arg(i.key()));
- isValid = false;
- }
- }
- }
- else
- {
- pokemod->ValidationMsg("There are no effects");
- isValid = false;
- }
- return isValid;
-}
-
-void PokeGen::PokeMod::Status::ImportIni(Ini& ini, const unsigned _id)
-{
- if (_id == UINT_MAX)
- ini.GetValue("id", id);
- else
- id = _id;
- ini.GetValue("name", name);
- ini.GetValue("abbreviation", abbreviation);
- ini.GetValue("verb", verb);
- ini.GetValue("afterSwitch", afterSwitch);
- ini.GetValue("afterBattle", afterBattle);
- ini.GetValue("maxTurns", maxTurns, 0);
- ini.GetValue("catchBonus", catchBonus, 0);
- effects.clear();
-}
-
-void PokeGen::PokeMod::Status::ExportIni(QFile& fout) const
-{
- Ini exStatus("Status");
- exStatus.AddField("id", id);
- exStatus.AddField("name", name);
- exStatus.AddField("abbreviation", abbreviation);
- exStatus.AddField("verb", verb);
- exStatus.AddField("afterSwitch", afterSwitch);
- exStatus.AddField("afterBattle", afterBattle);
- exStatus.AddField("maxTurns", maxTurns);
- exStatus.AddField("catchBonus", catchBonus);
- exStatus.Export(fout);
- for (QList<StatusEffect>::ConstIterator i = effects.begin(); i != effects.end(); ++i)
- i->ExportIni(fout, name);
-}
-
-void PokeGen::PokeMod::Status::SetName(const QString& n)
-{
- name = n;
-}
-
-bool PokeGen::PokeMod::Status::SetAbbreviation(const QString& a)
-{
- if (a.length() < 4)
- abbreviation = a;
- return (abbreviation == a);
-}
-
-void PokeGen::PokeMod::Status::SetVerb(const QString& v)
-{
- verb = v;
-}
-
-bool PokeGen::PokeMod::Status::SetAfterSwitch(const unsigned a)
-{
- if ((a == UINT_MAX) || (pokemod->GetStatusByID(a) != UINT_MAX))
- afterSwitch = a;
- return (afterSwitch == a);
-}
-
-bool PokeGen::PokeMod::Status::SetAfterBattle(const unsigned a)
-{
- if ((a == UINT_MAX) || (pokemod->GetStatusByID(a) != UINT_MAX))
- afterBattle = a;
- return (afterBattle == a);
-}
-
-void PokeGen::PokeMod::Status::SetMaxTurns(const unsigned m)
-{
- maxTurns = m;
-}
-
-void PokeGen::PokeMod::Status::SetCatchBonus(const unsigned c)
-{
- catchBonus = c;
-}
-
-QString PokeGen::PokeMod::Status::GetName() const
-{
- return name;
-}
-
-QString PokeGen::PokeMod::Status::GetAbbreviation() const
-{
- return abbreviation;
-}
-
-QString PokeGen::PokeMod::Status::GetVerb() const
-{
- return verb;
-}
-
-unsigned PokeGen::PokeMod::Status::GetAfterSwitch() const
-{
- return afterSwitch;
-}
-
-unsigned PokeGen::PokeMod::Status::GetAfterBattle() const
-{
- return afterBattle;
-}
-
-unsigned PokeGen::PokeMod::Status::GetMaxTurns() const
-{
- return maxTurns;
-}
-
-unsigned PokeGen::PokeMod::Status::GetCatchBonus() const
-{
- return catchBonus;
-}
-
-const PokeGen::PokeMod::StatusEffect* PokeGen::PokeMod::Status::GetEffect(const unsigned i) const
-{
- if (i < GetEffectCount())
- return &effects[i];
- return NULL;
-}
-
-unsigned PokeGen::PokeMod::Status::GetEffectByID(const unsigned _id) const
-{
- for (unsigned i = 0; i < GetEffectCount(); ++i)
- {
- if (effects[i].GetId() == _id)
- return i;
- }
- return UINT_MAX;
-}
-
-unsigned PokeGen::PokeMod::Status::GetEffectCount() const
-{
- return effects.size();
-}
-
-const PokeGen::PokeMod::StatusEffect* PokeGen::PokeMod::Status::NewEffect(Ini* const ini)
-{
- unsigned i = 0;
- for (; i < GetEffectCount(); ++i)
- {
- if (GetEffectByID(i) != UINT_MAX)
- break;
- }
- StatusEffect newEffect(pokemod, i);
- if (ini)
- newEffect.ImportIni(*ini);
- effects.append(newEffect);
- return &effects[GetEffectCount() - 1];
-}
-
-bool PokeGen::PokeMod::Status::DeleteEffect(const unsigned i)
-{
- if (i < GetEffectCount())
- {
- effects.erase(effects.begin() + i);
- return true;
- }
- return false;
-}
diff --git a/pokemod/Status.h b/pokemod/Status.h
deleted file mode 100644
index 9e559ad3..00000000
--- a/pokemod/Status.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/Status.h
-// Purpose: Define an Status that Pokémon can possess to add extra
-// dynamics to the battle system
-// Author: Ben Boeckel
-// Modified by: Ben Boeckel
-// Created: Sat June 2 12:00:26
-// Copyright: ©2007 Nerdy Productions
-// Licence:
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTStatus or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program. If not, see <http://www.gnu.org/licenses/>.
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef __POKEMOD_STATUS__
-#define __POKEMOD_STATUS__
-
-#include <QFile>
-#include <QList>
-#include <QMap>
-#include <QString>
-#include "Object.h"
-#include "Pokemod.h"
-#include "StatusEffect.h"
-
-namespace PokeGen
-{
- namespace PokeMod
- {
- class Status : public Object
- {
- public:
- Status(const Pokemod* par, const unsigned _id);
- Status(const Pokemod* par, Ini& ini, const unsigned _id = UINT_MAX);
-
- void ImportIni(Ini& ini, const unsigned _id = UINT_MAX);
- void ExportIni(QFile& fout) const;
-
- void SetName(const QString& n);
- bool SetAbbreviation(const QString& a);
- void SetVerb(const QString& v);
- bool SetAfterSwitch(const unsigned a);
- bool SetAfterBattle(const unsigned a);
- void SetMaxTurns(const unsigned m);
- void SetCatchBonus(const unsigned c);
-
- QString GetName() const;
- QString GetAbbreviation() const;
- QString GetVerb() const;
- unsigned GetAfterSwitch() const;
- unsigned GetAfterBattle() const;
- unsigned GetMaxTurns() const;
- unsigned GetCatchBonus() const;
-
- const StatusEffect* GetEffect(const unsigned i) const;
- unsigned GetEffectByID(const unsigned _id) const;
- unsigned GetEffectCount() const;
- const StatusEffect* NewEffect(Ini* const ini = NULL);
- bool DeleteEffect(const unsigned i);
- private:
- bool Validate();
-
- QString name;
- QString abbreviation;
- QString verb;
- unsigned afterSwitch;
- unsigned afterBattle;
- unsigned maxTurns;
- unsigned catchBonus;
-
- QList<StatusEffect> effects;
- };
- }
-}
-
-#endif
diff --git a/pokemod/StatusEffect.cpp b/pokemod/StatusEffect.cpp
deleted file mode 100644
index 53585882..00000000
--- a/pokemod/StatusEffect.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/StatusEffect.cpp
-// Purpose: Define an effect of a status
-// Author: Ben Boeckel
-// Modified by: Ben Boeckel
-// Created: Sat June 2 2007 12:16:48
-// Copyright: ©2007 Ben Boeckel and Nerdy Productions
-// Licence:
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTStatus or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program. If not, see <http://www.gnu.org/licenses/>.
-/////////////////////////////////////////////////////////////////////////////
-
-#include "StatusEffect.h"
-
-PokeGen::PokeMod::StatusEffect::StatusEffect(const Pokemod* par, const unsigned _id) :
- Object(_id, par),
- effect(UINT_MAX),
- val1(UINT_MAX),
- val2(UINT_MAX)
-{
-}
-
-PokeGen::PokeMod::StatusEffect::StatusEffect(const Pokemod* par, Ini& ini, const unsigned _id) :
- Object(_id, par)
-{
- ImportIni(ini, _id);
-}
-
-bool PokeGen::PokeMod::StatusEffect::Validate()
-{
- pokemod->ValidationMsg(QString("------Effect with id %1---").arg(id), Pokemod::V_Msg);
- if (effect < E_End)
- {
- bool ok = true;
- switch (effect)
- {
- //case :
- if (1)
- ok = false;
- break;
- }
- if (!ok)
- {
- pokemod->ValidationMsg("Invalid val1");
- isValid = false;
- ok = true;
- }
- switch (effect)
- {
- //case :
- if (1)
- ok = false;
- break;
- }
- if (!ok)
- {
- pokemod->ValidationMsg("Invalid val1");
- isValid = false;
- }
- }
- else
- {
- pokemod->ValidationMsg("Invalid effect");
- isValid = false;
- }
- // TODO (Ben#1#): Status Effect Validation
- return isValid;
-}
-
-void PokeGen::PokeMod::StatusEffect::ImportIni(Ini& ini, const unsigned _id)
-{
- if (_id == UINT_MAX)
- ini.GetValue("id", id);
- else
- id = _id;
- ini.GetValue("effect", effect);
- ini.GetValue("val1", val1);
- ini.GetValue("val2", val2);
-}
-
-void PokeGen::PokeMod::StatusEffect::ExportIni(QFile& fout, const QString& status) const
-{
- Ini exStatusEffect("statusEffect " + status);
- exStatusEffect.AddField("id", id);
- exStatusEffect.AddField("effect", effect);
- exStatusEffect.AddField("val1", val1);
- exStatusEffect.AddField("val2", val2);
- exStatusEffect.Export(fout);
-}
-
-bool PokeGen::PokeMod::StatusEffect::SetEffect(const unsigned e)
-{
- if (e < E_End)
- {
- effect = e;
- val1 = UINT_MAX;
- val2 = UINT_MAX;
- }
- return (effect == e);
-}
-
-bool PokeGen::PokeMod::StatusEffect::SetVal1(const unsigned v1)
-{
- switch (effect)
- {
- }
- return (val1 == v1);
-}
-
-bool PokeGen::PokeMod::StatusEffect::SetVal2(const unsigned v2)
-{
- switch (effect)
- {
- }
- return (val2 == v2);
-}
-
-unsigned PokeGen::PokeMod::StatusEffect::GetEffect() const
-{
- return effect;
-}
-
-unsigned PokeGen::PokeMod::StatusEffect::GetVal1() const
-{
- return val1;
-}
-
-unsigned PokeGen::PokeMod::StatusEffect::GetVal2() const
-{
- return val2;
-}
diff --git a/pokemod/StatusEffect.h b/pokemod/StatusEffect.h
deleted file mode 100644
index 753b8605..00000000
--- a/pokemod/StatusEffect.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/StatusEffect.h
-// Purpose: Define an effect of a status
-// Author: Ben Boeckel
-// Modified by: Ben Boeckel
-// Created: Sat June 2 2007 12:15:34
-// Copyright: ©2007 Ben Boeckel and Nerdy Productions
-// Licence:
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTStatus or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program. If not, see <http://www.gnu.org/licenses/>.
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef __POKEMOD_STATUSEFFECT__
-#define __POKEMOD_STATUSEFFECT__
-
-#include <QFile>
-#include <QString>
-#include "Object.h"
-#include "Ref.h"
-#include "Pokemod.h"
-
-namespace PokeGen
-{
- namespace PokeMod
- {
- class StatusEffect : public Object
- {
- public:
- enum Effect
- {
- E_End
- };
- static const char* EffectStr[E_End];
-
- StatusEffect(const Pokemod* par, const unsigned _id);
- StatusEffect(const Pokemod* par, Ini& ini, const unsigned _id = UINT_MAX);
-
- void ImportIni(Ini& ini, const unsigned _id = UINT_MAX);
- void ExportIni(QFile& fout, const QString& status) const;
-
- bool SetEffect(const unsigned e);
- bool SetVal1(const unsigned v1);
- bool SetVal2(const unsigned v2);
-
- unsigned GetEffect() const;
- unsigned GetVal1() const;
- unsigned GetVal2() const;
- private:
- bool Validate();
-
- unsigned effect;
- unsigned val1;
- unsigned val2;
- };
-
- const char* StatusEffect::EffectStr[StatusEffect::E_End] = {};
- }
-}
-
-#endif
diff --git a/pokemod/TODO b/pokemod/TODO
index 3db75efd..de88b16e 100644
--- a/pokemod/TODO
+++ b/pokemod/TODO
@@ -2,29 +2,16 @@
Urgent
=================
-----------
-References
-----------
-MoveEffects ME MoveEffect
-StatusEffect SE StatusEffect
-
---------------
Effect Switches
---------------
-ItemEffect
MoveEffect
-StatusEffect
------------------
PokéMod comparison
------------------
Figure out what makes 2 PokéMods incompatable
----------
-Importing
----------
-Make importing return a ptr to the object
-
-------
General
-------
@@ -37,8 +24,6 @@ Showstopper
----------
Validation
----------
-StatusEffect
-ItemEffect
MoveEffect
=================
diff --git a/pokemod/Tile.cpp b/pokemod/Tile.cpp
index 6068f7d1..28b9ee84 100644
--- a/pokemod/Tile.cpp
+++ b/pokemod/Tile.cpp
@@ -22,6 +22,9 @@
#include "Tile.h"
+const char* PokeGen::PokeMod::Tile::WaterStr[PokeGen::PokeMod::Tile::W_End] = {"None", "Normal", "Dive", "Waterfall", "Whirlpool"};
+const char* PokeGen::PokeMod::Tile::ForceStr[PokeGen::PokeMod::Tile::F_End] = {"None", "Slip", "Stop", "Force", "Push"};
+
PokeGen::PokeMod::Tile::Tile(const Pokemod* par, const unsigned _id) :
Object(_id, par),
name(""),
@@ -93,7 +96,7 @@ bool PokeGen::PokeMod::Tile::Validate()
}
if (forceType < F_End)
{
- if (((forceType == F_Slip) || (forceType == F_Force) || (forceType == F_Push)) && (DIR_End <= forceDirection))
+ if (((forceType == F_Slip) || (forceType == F_Force) || (forceType == F_Push)) && (D_End <= forceDirection))
{
pokemod->ValidationMsg("Invalid force direction");
isValid = false;
@@ -267,7 +270,7 @@ bool PokeGen::PokeMod::Tile::SetForceType(const unsigned f)
bool PokeGen::PokeMod::Tile::SetForceDirection(const unsigned f)
{
- if (f < DIR_End)
+ if (f < D_End)
forceDirection = f;
return (forceDirection == f);
}
@@ -307,7 +310,7 @@ bool PokeGen::PokeMod::Tile::GetIsWild() const
return isWild;
}
-PokeGen::PokeMod::Frac PokeGen::PokeMod::Tile::GetWildChance() const
+PokeGen::Frac PokeGen::PokeMod::Tile::GetWildChance() const
{
return wildChance;
}
diff --git a/pokemod/Tile.h b/pokemod/Tile.h
index e5373fbe..91db541c 100644
--- a/pokemod/Tile.h
+++ b/pokemod/Tile.h
@@ -44,7 +44,7 @@ namespace PokeGen
W_Whirlpool = 4,
W_End = 5
};
- const char* WaterStr[W_End];
+ static const char* WaterStr[W_End];
enum Force
{
@@ -55,7 +55,7 @@ namespace PokeGen
F_Push = 4,
F_End = 5
};
- const char* ForceStr[F_End];
+ static const char* ForceStr[F_End];
Tile(const Pokemod* par, const unsigned _id);
Tile(const Pokemod* par, Ini& ini, const unsigned _id = UINT_MAX);
@@ -120,9 +120,6 @@ namespace PokeGen
unsigned forceType;
unsigned forceDirection;
};
-
- const char* WaterStr[Tile::W_End] = {"None", "Normal", "Dive", "Waterfall", "Whirlpool"};
- const char* ForceStr[Tile::F_End] = {"None", "Slip", "Stop", "Force", "Push"};
}
}
diff --git a/pokemod/Type.cpp b/pokemod/Type.cpp
index f655dd2d..225bf5f7 100644
--- a/pokemod/Type.cpp
+++ b/pokemod/Type.cpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
// Name: pokemod/Type.cpp
-// Purpose: Define a type for a Pokémon
+// Purpose: Define a type for a species
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Mar 20 18:05:05 2007
@@ -95,7 +95,7 @@ QString PokeGen::PokeMod::Type::GetName() const
return name;
}
-PokeGen::PokeMod::Frac PokeGen::PokeMod::Type::GetStab() const
+PokeGen::Frac PokeGen::PokeMod::Type::GetStab() const
{
return stab;
}
diff --git a/pokemod/Type.h b/pokemod/Type.h
index 4390df21..cc0d9fe3 100644
--- a/pokemod/Type.h
+++ b/pokemod/Type.h
@@ -25,9 +25,9 @@
#include <QFile>
#include <QString>
+#include "../general/Frac.h"
#include "Object.h"
#include "Pokemod.h"
-#include "Frac.h"
namespace PokeGen
{
diff --git a/pokemod/pokemod.pro b/pokemod/pokemod.pro
index 076e606e..a6b89891 100644
--- a/pokemod/pokemod.pro
+++ b/pokemod/pokemod.pro
@@ -1,8 +1,10 @@
-TEMPLATE = lib
-
OBJECTS_DIR = ../../obj/pokemod
+DESTDIR = ../../lib
+VERSION = 0.1.0
+TEMPLATE = lib
+LIBS += -L../../lib -lgeneral
-CONFIG += qt warn_on
+CONFIG += qt warn_on dll
SOURCES += *.cpp
HEADERS += *.h
diff --git a/pokemod/pokemod_inc.h b/pokemod/pokemod_inc.h
index 092de0e7..eee4b19c 100644
--- a/pokemod/pokemod_inc.h
+++ b/pokemod/pokemod_inc.h
@@ -51,12 +51,11 @@ namespace PokeGen
class MoveEffect;
class Nature;
class Pokemod;
- class Pokemon;
- class PokemonAbility;
- class PokemonEvolution;
- class PokemonItem;
- class PokemonMove;
- class PokemonNature;
+ class Species;
+ class SpeciesAbility;
+ class SpeciesEvolution;
+ class SpeciesItem;
+ class SpeciesMove;
class Status;
class StatusEffect;
class Store;