summaryrefslogtreecommitdiffstats
path: root/pokemod/Pokemon.h
blob: d8360e6a419a0fddee78fb71ce59a04d7eb891f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
/////////////////////////////////////////////////////////////////////////////
// Name:        pokemod/Pokemon.h
// Purpose:     Define a Pokemon
// Author:      Ben Boeckel
// Modified by: Ben Boeckel
// Created:     Wed Feb 28 21:41:10 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 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
//    MERCHANTPokemon 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.
/////////////////////////////////////////////////////////////////////////////

#ifndef __POKEMOD_POKEMON__
#define __POKEMOD_POKEMON__

#include <vector>
#include <map>
#include "Object.h"
#include "String.h"
#include "Frac.h"
#include "Path.h"
#include "Pokemod.h"
#include "PokemonAbility.h"
#include "PokemonEvolution.h"
#include "PokemonItem.h"
#include "PokemonMove.h"
#include "PokemonNature.h"

namespace PokeGen
{
   namespace PokeMod
   {
      class Pokemon : public Object
      {
         public:
            Pokemon(const Pokemod *par, const unsigned _id);
            Pokemon(const Pokemod *par, Ini &ini, const unsigned _id = UINT_MAX);
            ~Pokemon();

            void ImportIni(Ini &ini, const unsigned _id = UINT_MAX);
            void ExportIni(std::ofstream &fout) const;

            void SetName(const String &n);
            void SetBaseStat(const unsigned s, const unsigned b);
            void SetEffortValue(const unsigned s, const unsigned e);
            void SetGrowth(const unsigned g);
            void SetGrowth(const String &g);
            void SetExperienceValue(const unsigned e);
            void SetCatchValue(const unsigned char c);
            void SetRunChance(const Frac &r);
            void SetRunChance(const unsigned n, const unsigned d);
            void SetRunChanceNumerator(const unsigned n);
            void SetRunChanceDenominator(const unsigned d);
            void SetItemChance(const Frac &i);
            void SetItemChance(const unsigned n, const unsigned d);
            void SetItemChanceNumerator(const unsigned n);
            void SetItemChanceDenominator(const unsigned d);
            void SetPokedexNumber(const unsigned p);
            void SetWeight(const unsigned w);
            void SetHeightFeet(const unsigned f);
            void SetHeightInches(const unsigned char i);
            void SetPokedexEntry(const String &p);
            void SetFrontMaleSprite(Path &f);
            void SetBackMaleSprite(Path &b);
            void SetFrontFemaleSprite(Path &f);
            void SetBackFemaleSprite(Path &b);
            void SetListSprite(Path &l);
            void SetGenderFactor(const Frac &g);
            void SetGenderFactor(const unsigned n, const unsigned d);
            void SetGenderFactorNumerator(const unsigned n);
            void SetGenderFactorDenominator(const unsigned d);
            void SetEggSpecies(const unsigned e);
            void SetEggSpecies(const String &e);
            void SetEggSteps(const unsigned e);
            void SetIsDitto(const bool i);
            void SetNidoranGroup(const unsigned n);

            String GetName() const;
            unsigned GetBaseStat(const unsigned s) const;
            unsigned GetEffortValue(const unsigned s) const;
            unsigned GetGrowth() const;
            String GetGrowthString() const;
            unsigned GetExperienceValue() const;
            unsigned char GetCatchValue() const;
            Frac GetRunChance() const;
            unsigned GetRunChanceNumerator() const;
            unsigned GetRunChanceDenominator() const;
            Frac GetItemChance() const;
            unsigned GetItemChanceNumerator() const;
            unsigned GetItemChanceDenominator() const;
            unsigned GetPokedexNumber() const;
            unsigned GetWeight() const;
            unsigned GetHeightFeet() const;
            unsigned GetHeightInches() const;
            String GetPokedexEntry() const;
            bool GetFrontMaleSprite() const;
            bool GetBackMaleSprite() const;
            bool GetFrontFemaleSprite() const;
            bool GetBackFemaleSprite() const;
            bool GetListSprite() const;
            Frac GetGenderFactor() const;
            unsigned GetGenderFactorNumerator() const;
            unsigned GetGenderFactorDenominator() const;
            unsigned GetEggSpecies() const;
            String GetEggSpeciesString() const;
            unsigned GetEggSteps() const;
            bool GetIsDitto() const;
            unsigned GetNidoranGroup() const;

            unsigned GetType(const unsigned i) const;
            bool HasType(const unsigned _id) const;
            bool HasType(const String &n) const;
            unsigned GetTypeCount() const;
            void NewType(const unsigned i);
            void NewType(const String &n);
            void DeleteType(const unsigned i);
            void DeleteType(const String &n);
            void DeleteTypeByID(const unsigned _id);

            unsigned GetEggGroup(const unsigned i) const;
            bool InEggGroup(const unsigned _id) const;
            bool InEggGroup(const String &n) const;
            unsigned GetEggGroupCount() const;
            void NewEggGroup(const unsigned i);
            void NewEggGroup(const String &n);
            void DeleteEggGroup(const unsigned i);
            void DeleteEggGroup(const String &n);
            void DeleteEggGroupByID(const unsigned _id);

            const PokemonAbility *GetPokemonAbility(const unsigned _id) const;
            const PokemonAbility *GetPokemonAbility(const String &n) const;
            unsigned GetPokemonAbilityCount() const;
            void NewPokemonAbility(Ini *const ini = NULL);
            void DeletePokemonAbility(const unsigned _id);
            void DeletePokemonAbility(const String &n);

            const PokemonEvolution *GetPokemonEvolution(const unsigned _id) const;
            unsigned GetPokemonEvolutionCount() const;
            void NewPokemonEvolution(Ini *const ini = NULL);
            void DeletePokemonEvolution(const unsigned _id);

            const PokemonItem *GetPokemonItem(const unsigned _id) const;
            const PokemonItem *GetPokemonItem(const String &n) const;
            unsigned GetPokemonItemCount() const;
            void NewPokemonItem(Ini *const ini = NULL);
            void DeletePokemonItem(const unsigned _id);
            void DeletePokemonItem(const String &n);

            const PokemonMove *GetPokemonMove(const unsigned _id) const;
            const PokemonMove *GetPokemonMove(const String &n) const;
            unsigned GetPokemonMoveCount() const;
            void NewPokemonMove(Ini *const ini = NULL);
            void DeletePokemonMove(const unsigned _id);
            void DeletePokemonMove(const String &n);

            const PokemonNature *GetPokemonNature(const unsigned _id) const;
            const PokemonNature *GetPokemonNature(const String &n) const;
            unsigned GetPokemonNatureCount() const;
            void NewPokemonNature(Ini *const ini = NULL);
            void DeletePokemonNature(const unsigned _id);
            void DeletePokemonNature(const String &n);
         private:
            void Validate();

            String name;
            bool baseStats[STH_END_GSC];
            bool effortValues[STH_END_GSC];
            unsigned growth;
            unsigned experienceValue;
            unsigned char catchValue;
            Frac runChance;
            Frac itemChance;
            unsigned pokedexNumber;
            unsigned weight;
            unsigned heightFeet;
            unsigned heightInches;
            String pokedexEntry;
            Frac genderFactor;
            unsigned eggSpecies;
            unsigned eggSteps;
            bool isDitto;
            unsigned nidoranGroup;

            std::vector<unsigned> types;
            std::vector<unsigned> eggGroups;

            std::vector<PokemonAbility> abilities;
            std::vector<PokemonEvolution> evolutions;
            std::vector<PokemonItem> items;
            std::vector<PokemonMove> moves;
            std::vector<PokemonNature> natures;
      };
   }
}

#endif