summaryrefslogtreecommitdiffstats
path: root/pokemod/Move.h
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2007-09-21 15:36:22 +0000
committerBen Boeckel <MathStuf@gmail.com>2007-09-21 15:36:22 +0000
commit5b55d13ead7e352ee1feaae72009e8abf5bd071a (patch)
tree6c2838312dd7f42769280e24e8abc16b53c165cb /pokemod/Move.h
parente94d9893b8753e72adb92b2c5eb203830ddf641c (diff)
downloadsigen-5b55d13ead7e352ee1feaae72009e8abf5bd071a.tar.gz
sigen-5b55d13ead7e352ee1feaae72009e8abf5bd071a.tar.xz
sigen-5b55d13ead7e352ee1feaae72009e8abf5bd071a.zip
[FIX] Neural Network methods complete
[FIX] Wrapped Node up into the layer [FIX] Wrapped NatureEffect into Nature [FIX] Getting around to fixing up the design of the PokéMod stuff [FIX] Creating new subclasses now returns pointer to new subclass [FIX] Simplified interfaces [FIX] Minor style issues [FIX] Renamed CoinItem to CoinListObject [FIX] Renamed MapTrainerTeam to MapTrainerPokemon [FIX] Renamed MapWildPokemon to MapWildListPokemon [FIX] Moved global enums to relevant classes [FIX] Removed general logging features [DEL] pokemod/Debug.{h, cpp} [DEL] pokemod/Path.{h, cpp} [FIX] Using QFile rather than custom Path class for checking for files [FIX] Set* methods now return a bool to let the caller know if anything actually changed (if it can fail, otherwise it is void) [ADD] Compliation without errors is required for pokemod from now on before commits git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@24 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Move.h')
-rw-r--r--pokemod/Move.h235
1 files changed, 125 insertions, 110 deletions
diff --git a/pokemod/Move.h b/pokemod/Move.h
index cf3223a9..8c131731 100644
--- a/pokemod/Move.h
+++ b/pokemod/Move.h
@@ -1,110 +1,125 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/Move.h
-// Purpose: Define a move that Pokémon can learn
-// Author: Ben Boeckel
-// Modified by: Ben Boeckel
-// Created: Sat May 26 2007 08:57:13
-// 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_MOVE__
-#define __POKEMOD_MOVE__
-
-#include <QFile>
-#include <QList>
-#include <QMap>
-#include <QString>
-#include "Object.h"
-#include "MoveEffect.h"
-
-namespace PokeGen
-{
- namespace PokeMod
- {
- class Move : public Object
- {
- public:
- Move(const Pokemod *par, const unsigned _id);
- Move(const Pokemod *par, Ini &ini, const unsigned _id = UINT_MAX);
- ~Move();
-
- void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
- void ExportIni(QFile &fout) const;
-
- void SetName(const QString &n);
- void SetAccuracy(const Frac &a);
- void SetAccuracy(const unsigned n, const unsigned d);
- void SetAccuracyNum(const unsigned n);
- void SetAccuracyDenom(const unsigned d);
- void SetType(const unsigned t);
- void SetType(const QString &t);
- void SetSpecial(const bool s);
- void SetPowerPoints(const unsigned p);
- void SetTarget(const unsigned t);
- void SetTarget(const QString &t);
- void SetNumTargets(const unsigned n);
- void SetTargetChoice(const unsigned t);
- void SetTargetChoice(const QString &t);
- void SetIgnoreAccuracy(const bool i);
- void SetIgnoreFlinch(const bool i);
- void SetSound(const bool s);
- void SetDescription(const QString &d);
-
- QString GetName() const;
- Frac GetAccuracy() const;
- unsigned GetAccuracyNum() const;
- unsigned GetAccuracyDenom() const;
- unsigned GetType() const;
- QString GetTypeString() const;
- bool GetSpecial() const;
- unsigned GetPowerPoints() const;
- unsigned GetTarget() const;
- QString GetTargetString() const;
- unsigned GetNumTargets() const;
- unsigned GetTargetChoice() const;
- QString GetTargetChoiceString() const;
- bool GetIgnoreAccuracy() const;
- bool GetIgnoreFlinch() const;
- bool GetSound() const;
- QString GetDescription() const;
-
- const MoveEffect *GetMoveEffect(unsigned _id) const;
- unsigned GetMoveEffectCount() const;
- void NewMoveEffect(Ini *const ini = NULL);
- void DeleteMoveEffect(unsigned _id);
- private:
- void Validate();
-
- QString name;
- Frac accuracy;
- unsigned power;
- unsigned type;
- bool special;
- unsigned powerPoints;
- unsigned target;
- unsigned numTargets;
- int targetChoice;
- bool ignoreAccuracy;
- bool ignoreFlinch;
- bool sound;
- QString description;
-
- QList<MoveEffect> effects;
- };
- }
-}
-
-#endif
+/////////////////////////////////////////////////////////////////////////////
+// Name: pokemod/Move.h
+// Purpose: Define a move that Pokémon can learn
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Sat May 26 2007 08:57:13
+// 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_MOVE__
+#define __POKEMOD_MOVE__
+
+#include <QFile>
+#include <QList>
+#include <QMap>
+#include <QString>
+#include "Object.h"
+#include "MoveEffect.h"
+
+namespace PokeGen
+{
+ namespace PokeMod
+ {
+ class Move : public Object
+ {
+ public:
+ enum Target
+ {
+ T_Player = 0,
+ T_Enemy = 1,
+ T_Both = 2,
+ T_Random = 3,
+ T_End = 4
+ };
+ static const char* TargetStr[T_End];
+
+ enum Choice
+ {
+ C_Player = 0,
+ C_Enemy = 1,
+ C_Random = 2,
+ C_End = 3
+ };
+ static const char* ChoiceStr[C_End];
+
+ Move(const Pokemod* par, const unsigned _id);
+ Move(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 SetAccuracy(const unsigned n, const unsigned d);
+ bool SetAccuracyNum(const unsigned n);
+ bool SetAccuracyDenom(const unsigned d);
+ bool SetType(const unsigned t);
+ void SetSpecial(const bool s);
+ bool SetPowerPoints(const unsigned p);
+ bool SetTarget(const unsigned t);
+ bool SetNumTargets(const unsigned n);
+ bool SetTargetChoice(const unsigned t);
+ void SetIgnoreAccuracy(const bool i);
+ void SetIgnoreFlinch(const bool i);
+ void SetSound(const bool s);
+ void SetDescription(const QString& d);
+
+ QString GetName() const;
+ Frac GetAccuracy() const;
+ unsigned GetAccuracyNum() const;
+ unsigned GetAccuracyDenom() const;
+ unsigned GetType() const;
+ bool GetSpecial() const;
+ unsigned GetPowerPoints() const;
+ unsigned GetTarget() const;
+ unsigned GetNumTargets() const;
+ unsigned GetTargetChoice() const;
+ bool GetIgnoreAccuracy() const;
+ bool GetIgnoreFlinch() const;
+ bool GetSound() const;
+ QString GetDescription() const;
+
+ const MoveEffect* GetEffect(unsigned i) const;
+ unsigned GetEffectByID(unsigned _id) const;
+ unsigned GetEffectCount() const;
+ const MoveEffect* NewEffect(Ini* const ini = NULL);
+ bool DeleteEffect(unsigned i);
+ private:
+ bool Validate();
+
+ QString name;
+ Frac accuracy;
+ unsigned power;
+ unsigned type;
+ bool special;
+ unsigned powerPoints;
+ unsigned target;
+ unsigned numTargets;
+ unsigned targetChoice;
+ bool ignoreAccuracy;
+ bool ignoreFlinch;
+ bool sound;
+ QString description;
+
+ QList<MoveEffect> effects;
+ };
+
+ const char* Move::TargetStr[Move::T_End] = {"Player", "Enemy", "Both", "Random"};
+ const char* Move::ChoiceStr[Move::C_End] = {"Player", "Enemy", "Random"};
+ }
+}
+
+#endif