summaryrefslogtreecommitdiffstats
path: root/pokemod/MoveEffect.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokemod/MoveEffect.cpp')
-rw-r--r--pokemod/MoveEffect.cpp28
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;
}