diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-04-17 23:34:36 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-04-17 23:34:36 +0000 |
| commit | 6679f5cffa9d35a23b76605ddfbf3257f882b6ee (patch) | |
| tree | c8e41854a60b64e8569939bca6b827807175ef9a /pokemod/MoveEffect.cpp | |
| parent | 05980e883719b1c8ebde1bd2fcbf4f8c16df7ad6 (diff) | |
| download | sigen-6679f5cffa9d35a23b76605ddfbf3257f882b6ee.tar.gz sigen-6679f5cffa9d35a23b76605ddfbf3257f882b6ee.tar.xz sigen-6679f5cffa9d35a23b76605ddfbf3257f882b6ee.zip | |
[FIX] Frac -> Fraction
[FIX] ImageCache and Ini removed
[FIX] Fraction/Point widgets moved to pokemodr
[FIX] Copy ctors made for pokemod classes
[FIX] Ctors in pokemod fixed
[FIX] Copyright headers fixed in pokemodr
[FIX] PokeModr updated to new API and fixed in some places
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@99 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/MoveEffect.cpp')
| -rw-r--r-- | pokemod/MoveEffect.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/pokemod/MoveEffect.cpp b/pokemod/MoveEffect.cpp index 7b656803..e267337b 100644 --- a/pokemod/MoveEffect.cpp +++ b/pokemod/MoveEffect.cpp @@ -23,6 +23,12 @@ const QStringList MoveEffect::EffectStr = QStringList() << "Damage" << "Status" << "Confuse" << "Stat" << "StealHP" << "Counter" << "Selfdestruct" << "Need Status" << "Mirror" << "GetMoney" << "Never Miss" << "Steal Types" << "Clear Effects" << "Wait And Return" << "Self Confuse" << "Force Switch" << "Hit Multiple" << "Hit Multiple Turns" << "Flinch" << "One Hit K.O." << "Recoil" << "Recover" << "Rest" << "Sheild" << "Substitute" << "Recharge" << "Rage" << "Mimic" << "Random Move" << "Seed" << "Disable" << "Cut HM" << "Fly HM" << "Surf HM" << "Strength HM" << "Flash HM" << "Rock Smash HM" << "Rock Climb HM" << "Whirlpool HM" << "Waterfall HM" << "Share HP HM " << "Escape HM"; +MoveEffect::MoveEffect(const MoveEffect& effect) : + Object("MoveEffect", effect.pokemod(), effect.id()) +{ + *this = effect; +} + MoveEffect::MoveEffect(const Pokemod* pokemod, const int id) : Object("MoveEffect", pokemod, id), m_chance(1, 1), @@ -34,13 +40,13 @@ MoveEffect::MoveEffect(const Pokemod* pokemod, const int id) : { } -MoveEffect::MoveEffect(const Pokemod* pokemod, const MoveEffect& effect, const int id) : +MoveEffect::MoveEffect(const MoveEffect& effect, const Pokemod* pokemod, const int id) : Object("MoveEffect", pokemod, id) { *this = effect; } -MoveEffect::MoveEffect(const Pokemod* pokemod, const QDomElement& xml, const int id) : +MoveEffect::MoveEffect(const QDomElement& xml, const Pokemod* pokemod, const int id) : Object("MoveEffect", pokemod, id) { load(xml, id); @@ -57,27 +63,27 @@ bool MoveEffect::validate() const void MoveEffect::load(const QDomElement& xml, int id) { LOAD_ID(); - LOAD(Frac, chance); + LOAD(Fraction, chance); LOAD(int, effect); LOAD(int, value1); LOAD(int, value2); LOAD(int, value3); - LOAD(Frac, value4); + LOAD(Fraction, value4); } QDomElement MoveEffect::save() const { SAVE_CREATE(); - SAVE(Frac, chance); + SAVE(Fraction, chance); SAVE(int, effect); SAVE(int, value1); SAVE(int, value2); SAVE(int, value3); - SAVE(Frac, value4); + SAVE(Fraction, value4); return xml; } -void MoveEffect::setChance(const Frac& chance) throw(Exception) +void MoveEffect::setChance(const Fraction& chance) throw(Exception) { m_chance = chance; } @@ -90,7 +96,7 @@ void MoveEffect::setEffect(const int effect) throw(BoundsException) m_value1 = INT_MAX; m_value2 = INT_MAX; m_value3 = 0; - m_value4.set(1, 1);//, ((effect == E_StealHP) || (effect == E_Counter) || (effect == E_Selfdestruct) || (effect == E_Mirror) || (effect == E_GetMoney) || (effect == E_WaitAndReturn) || (effect == E_Recoil)) ? Frac::Improper : Frac::Proper); + m_value4.set(1, 1);//, ((effect == E_StealHP) || (effect == E_Counter) || (effect == E_Selfdestruct) || (effect == E_Mirror) || (effect == E_GetMoney) || (effect == E_WaitAndReturn) || (effect == E_Recoil)) ? Fraction::Improper : Fraction::Proper); } void MoveEffect::setValue1(const int value1) throw(Exception) @@ -152,12 +158,12 @@ void MoveEffect::setValue3(const int value3) m_value3 = value3; } -void MoveEffect::setValue4(const Frac& value4) throw(Exception) +void MoveEffect::setValue4(const Fraction& value4) throw(Exception) { m_value4 = value4; } -Frac MoveEffect::chance() const +Fraction MoveEffect::chance() const { return m_chance; } @@ -182,7 +188,7 @@ int MoveEffect::value3() const return m_value3; } -Frac MoveEffect::value4() const +Fraction MoveEffect::value4() const { return m_value4; } |
