diff options
Diffstat (limited to 'pokemod/AbilityEffect.cpp')
-rw-r--r-- | pokemod/AbilityEffect.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/pokemod/AbilityEffect.cpp b/pokemod/AbilityEffect.cpp index 5df6545f..0f132cc4 100644 --- a/pokemod/AbilityEffect.cpp +++ b/pokemod/AbilityEffect.cpp @@ -22,17 +22,17 @@ #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"}; +const char* PokeMod::AbilityEffect::EffectStr[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* PokeMod::AbilityEffect::TriggerStr[PokeMod::AbilityEffect::T_End] = {"Anything", "Contact", "Weather", "Damage", "Type", "HP Boundary", "Stat Change", "Status"}; +const char* PokeMod::AbilityEffect::InteractStr[PokeMod::AbilityEffect::I_End] = {"Trade", "Shadow", "Block"}; +const char* PokeMod::AbilityEffect::PowerAccStr[PokeMod::AbilityEffect::PA_End] = {"Boost Power", "Boost Accuracy"}; +const char* PokeMod::AbilityEffect::ItemStr[PokeMod::AbilityEffect::IT_End] = {"Stat Modifier", "Type Booster", "Flinch", "Go First"}; +const char* PokeMod::AbilityEffect::CauseStr[PokeMod::AbilityEffect::C_End] = {"Prevent", "Inflict"}; +const char* PokeMod::AbilityEffect::BoostStr[PokeMod::AbilityEffect::B_End] = {"Boost", "Hinder"}; +const char* PokeMod::AbilityEffect::SideStr[PokeMod::AbilityEffect::S_End] = {"Above", "Below"}; -PokeGen::PokeMod::AbilityEffect::AbilityEffect(const Pokemod& par, const unsigned _id) : +PokeMod::AbilityEffect::AbilityEffect(const Pokemod& par, const unsigned _id) : Object(par, _id), chance(1, 1), effect(UINT_MAX), @@ -45,19 +45,19 @@ PokeGen::PokeMod::AbilityEffect::AbilityEffect(const Pokemod& par, const unsigne { } -PokeGen::PokeMod::AbilityEffect::AbilityEffect(const Pokemod& par, const AbilityEffect& e, const unsigned _id) : +PokeMod::AbilityEffect::AbilityEffect(const Pokemod& par, const AbilityEffect& e, const unsigned _id) : Object(par, _id) { *this = e; } -PokeGen::PokeMod::AbilityEffect::AbilityEffect(const Pokemod& par, const QString& fname, const unsigned _id) : +PokeMod::AbilityEffect::AbilityEffect(const Pokemod& par, const QString& fname, const unsigned _id) : Object(par, _id) { load(fname, _id); } -bool PokeGen::PokeMod::AbilityEffect::validate() const +bool PokeMod::AbilityEffect::validate() const { bool valid = true; pokemod.validationMsg(QString("------Effect with id %1---").arg(id), Pokemod::V_Msg); @@ -197,7 +197,7 @@ bool PokeGen::PokeMod::AbilityEffect::validate() const return valid; } -void PokeGen::PokeMod::AbilityEffect::load(const QString& fname, const unsigned _id) throw(Exception) +void PokeMod::AbilityEffect::load(const QString& fname, const unsigned _id) throw(Exception) { Ini ini(fname); if (_id == UINT_MAX) @@ -220,7 +220,7 @@ void PokeGen::PokeMod::AbilityEffect::load(const QString& fname, const unsigned tval2.set(i, j); } -void PokeGen::PokeMod::AbilityEffect::save(const QString& ability) const throw(Exception) +void PokeMod::AbilityEffect::save(const QString& ability) const throw(Exception) { Ini ini; ini.addField("id", id); @@ -237,22 +237,22 @@ void PokeGen::PokeMod::AbilityEffect::save(const QString& ability) const throw(E ini.save(QString("%1/ability/%2/effect/%3.pini").arg(pokemod.getPath()).arg(ability).arg(id)); } -void PokeGen::PokeMod::AbilityEffect::setChance(const unsigned n, const unsigned d) throw(Exception) +void PokeMod::AbilityEffect::setChance(const unsigned n, const unsigned d) throw(Exception) { chance.set(n, d); } -void PokeGen::PokeMod::AbilityEffect::setChanceNum(const unsigned n) throw(Exception) +void PokeMod::AbilityEffect::setChanceNum(const unsigned n) throw(Exception) { chance.setNum(n); } -void PokeGen::PokeMod::AbilityEffect::setChanceDenom(const unsigned d) throw(Exception) +void PokeMod::AbilityEffect::setChanceDenom(const unsigned d) throw(Exception) { chance.setDenom(d); } -void PokeGen::PokeMod::AbilityEffect::setEffect(const unsigned e) throw(BoundsException) +void PokeMod::AbilityEffect::setEffect(const unsigned e) throw(BoundsException) { if (E_End <= e) throw(BoundsException("AbilityEffect", "effect")); @@ -262,7 +262,7 @@ void PokeGen::PokeMod::AbilityEffect::setEffect(const unsigned e) throw(BoundsEx val3 = INT_MAX; } -void PokeGen::PokeMod::AbilityEffect::setVal1(const unsigned v1) throw(Exception) +void PokeMod::AbilityEffect::setVal1(const unsigned v1) throw(Exception) { switch (effect) { @@ -301,7 +301,7 @@ void PokeGen::PokeMod::AbilityEffect::setVal1(const unsigned v1) throw(Exception val1 = v1; } -void PokeGen::PokeMod::AbilityEffect::setVal2(const unsigned v2) throw(Exception) +void PokeMod::AbilityEffect::setVal2(const unsigned v2) throw(Exception) { switch (effect) { @@ -329,7 +329,7 @@ void PokeGen::PokeMod::AbilityEffect::setVal2(const unsigned v2) throw(Exception val2 = v2; } -void PokeGen::PokeMod::AbilityEffect::setVal3(const int v3) throw(Exception) +void PokeMod::AbilityEffect::setVal3(const int v3) throw(Exception) { switch (effect) { @@ -355,7 +355,7 @@ void PokeGen::PokeMod::AbilityEffect::setVal3(const int v3) throw(Exception) val3 = v3; } -void PokeGen::PokeMod::AbilityEffect::setTrigger(const unsigned t) throw(BoundsException) +void PokeMod::AbilityEffect::setTrigger(const unsigned t) throw(BoundsException) { if (T_End <= t) throw(BoundsException("AbilityEffect", "trigger")); @@ -364,7 +364,7 @@ void PokeGen::PokeMod::AbilityEffect::setTrigger(const unsigned t) throw(BoundsE tval2.set(1, 1); } -void PokeGen::PokeMod::AbilityEffect::setTval1(const unsigned tv1) throw(Exception) +void PokeMod::AbilityEffect::setTval1(const unsigned tv1) throw(Exception) { switch (trigger) { @@ -395,88 +395,88 @@ void PokeGen::PokeMod::AbilityEffect::setTval1(const unsigned tv1) throw(Excepti tval1 = tv1; } -void PokeGen::PokeMod::AbilityEffect::setTval2(const unsigned n, const unsigned d) throw(Exception) +void PokeMod::AbilityEffect::setTval2(const unsigned n, const unsigned d) throw(Exception) { if (trigger != T_HPBoundary) throw(UnusedException("AbilityEffect", "tval2")); tval2.set(n, d); } -void PokeGen::PokeMod::AbilityEffect::setTval2Num(const unsigned n) throw(Exception) +void PokeMod::AbilityEffect::setTval2Num(const unsigned n) throw(Exception) { if (trigger != T_HPBoundary) throw(UnusedException("AbilityEffect", "tval2")); tval2.setNum(n); } -void PokeGen::PokeMod::AbilityEffect::setTval2Denom(const unsigned d) throw(Exception) +void PokeMod::AbilityEffect::setTval2Denom(const unsigned d) throw(Exception) { if (trigger != T_HPBoundary) throw(UnusedException("AbilityEffect", "tval2")); tval2.setDenom(d); } -PokeGen::Frac PokeGen::PokeMod::AbilityEffect::getChance() const +Frac PokeMod::AbilityEffect::getChance() const { return chance; } -unsigned PokeGen::PokeMod::AbilityEffect::getChanceNum() const +unsigned PokeMod::AbilityEffect::getChanceNum() const { return chance.getNum(); } -unsigned PokeGen::PokeMod::AbilityEffect::getChanceDenom() const +unsigned PokeMod::AbilityEffect::getChanceDenom() const { return chance.getDenom(); } -unsigned PokeGen::PokeMod::AbilityEffect::getEffect() const +unsigned PokeMod::AbilityEffect::getEffect() const { return effect; } -unsigned PokeGen::PokeMod::AbilityEffect::getVal1() const +unsigned PokeMod::AbilityEffect::getVal1() const { return val1; } -unsigned PokeGen::PokeMod::AbilityEffect::getVal2() const +unsigned PokeMod::AbilityEffect::getVal2() const { return val2; } -int PokeGen::PokeMod::AbilityEffect::getVal3() const +int PokeMod::AbilityEffect::getVal3() const { return val3; } -unsigned PokeGen::PokeMod::AbilityEffect::getTrigger() const +unsigned PokeMod::AbilityEffect::getTrigger() const { return trigger; } -unsigned PokeGen::PokeMod::AbilityEffect::getTval1() const +unsigned PokeMod::AbilityEffect::getTval1() const { return tval1; } -PokeGen::Frac PokeGen::PokeMod::AbilityEffect::getTval2() const +Frac PokeMod::AbilityEffect::getTval2() const { return tval2; } -unsigned PokeGen::PokeMod::AbilityEffect::getTval2Num() const +unsigned PokeMod::AbilityEffect::getTval2Num() const { return tval2.getNum(); } -unsigned PokeGen::PokeMod::AbilityEffect::getTval2Denom() const +unsigned PokeMod::AbilityEffect::getTval2Denom() const { return tval2.getDenom(); } -PokeGen::PokeMod::AbilityEffect& PokeGen::PokeMod::AbilityEffect::operator=(const AbilityEffect& rhs) +PokeMod::AbilityEffect& PokeMod::AbilityEffect::operator=(const AbilityEffect& rhs) { if (this == &rhs) return *this; |