diff options
Diffstat (limited to 'pokemod/ItemEffect.cpp')
| -rw-r--r-- | pokemod/ItemEffect.cpp | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/pokemod/ItemEffect.cpp b/pokemod/ItemEffect.cpp index 47ff017f..bcfb863f 100644 --- a/pokemod/ItemEffect.cpp +++ b/pokemod/ItemEffect.cpp @@ -35,7 +35,7 @@ const QStringList ItemEffect::BallTypeStr = QStringList() << "Regular" << "Maste const QStringList ItemEffect::BerryTypeStr = QStringList() << "HP Cure" << "Status Cure"; ItemEffect::ItemEffect(const Pokemod& par, const unsigned _id) : - Object(par, _id), + Object("ItemEffect", par, _id), overworld(false), battle(false), held(false), @@ -48,13 +48,13 @@ ItemEffect::ItemEffect(const Pokemod& par, const unsigned _id) : } ItemEffect::ItemEffect(const Pokemod& par, const ItemEffect& e, const unsigned _id) : - Object(par, _id) + Object("ItemEffect", par, _id) { *this = e; } ItemEffect::ItemEffect(const Pokemod& par, const QString& fname, const unsigned _id) : - Object(par, _id) + Object("ItemEffect", par, _id) { load(fname, _id); } @@ -357,7 +357,7 @@ void ItemEffect::setOverworld(const bool o) throw(Exception) case E_Acorn: case E_Evolution: if (!o) - throw(Exception("ItemEffect", "overworld mismatch")); + throw(Exception(className, "overworld mismatch")); break; case E_Flinch: case E_First: @@ -370,7 +370,7 @@ void ItemEffect::setOverworld(const bool o) throw(Exception) case E_Ball: case E_Berry: if (o) - throw(Exception("ItemEffect", "overworld mismatch")); + throw(Exception(className, "overworld mismatch")); break; } overworld = o; @@ -389,7 +389,7 @@ void ItemEffect::setHeld(const bool h) void ItemEffect::setEffect(const unsigned e) throw(Exception) { if (E_End <= e) - throw(BoundsException("ItemEffect", "effect out-of-bounds")); + throw(BoundsException(className, "effect out-of-bounds")); switch (e) { case E_Revive: @@ -410,7 +410,7 @@ void ItemEffect::setEffect(const unsigned e) throw(Exception) case E_Acorn: case E_Evolution: if (!overworld) - throw(Exception("ItemEffect", "overworld mismatch")); + throw(Exception(className, "overworld mismatch")); break; case E_Flinch: case E_First: @@ -423,7 +423,7 @@ void ItemEffect::setEffect(const unsigned e) throw(Exception) case E_Ball: case E_Berry: if (overworld) - throw(Exception("ItemEffect", "overworld mismatch")); + throw(Exception(className, "overworld mismatch")); break; } effect = e; @@ -440,23 +440,23 @@ void ItemEffect::setVal1(const int v1) throw(Exception) case E_HPCure: case E_Revive: if ((val4 != R_Absolute) || !val1) - throw(BoundsException("ItemEffect", "val1")); + throw(BoundsException(className, "val1")); break; case E_LevelBoost: case E_ShieldBattle: case E_PPBoost: case E_Repel: if (!val1) - throw(BoundsException("ItemEffect", "val1")); + throw(BoundsException(className, "val1")); break; case E_StatBoost: case E_Acorn: if ((val1 < 0) || (65536 <= val1)) - throw(BoundsException("ItemEffect", "val1")); + throw(BoundsException(className, "val1")); break; case E_ModifyStatBattle: if ((val1 < -6) || (6 < val1)) - throw(BoundsException("ItemEffect", "val1")); + throw(BoundsException(className, "val1")); break; case E_Fish: case E_Coin: @@ -467,11 +467,11 @@ void ItemEffect::setVal1(const int v1) throw(Exception) { case B_Regular: if (256 <= (unsigned)val1) - throw(BoundsException("ItemEffect", "val1")); + throw(BoundsException(className, "val1")); break; case B_Level: if (pokemod.getRules().getMaxLevel() < (unsigned)val1) - throw(BoundsException("ItemEffect", "val1")); + throw(BoundsException(className, "val1")); break; case B_Master: case B_Love: @@ -484,11 +484,11 @@ void ItemEffect::setVal1(const int v1) throw(Exception) case B_Weight: break; default: - throw(BoundsException("ItemEffect", "val1")); + throw(BoundsException(className, "val1")); } break; default: - throw(UnusedException("ItemEffect", "val1")); + throw(UnusedException(className, "val1")); break; } val1 = v1; @@ -501,66 +501,66 @@ void ItemEffect::setVal2(const unsigned v2) throw(Exception) case E_HPCure: case E_Revive: if (R_End <= val2) - throw(BoundsException("ItemEffect", "val2")); + throw(BoundsException(className, "val2")); break; case E_CureStatus: if (STS_End <= val2) - throw(BoundsException("ItemEffect", "val2")); + throw(BoundsException(className, "val2")); break; case E_StatBoost: if ((val2 <= 0) || (65536 <= val2)) - throw(BoundsException("ItemEffect", "val2")); + throw(BoundsException(className, "val2")); break; case E_ModifyStatBattle: if (ST_End_Battle <= val2) - throw(BoundsException("ItemEffect", "val2")); + throw(BoundsException(className, "val2")); break; case E_ShieldBattle: if (SP_End <= val2) - throw(BoundsException("ItemEffect", "val2")); + throw(BoundsException(className, "val2")); break; case E_TypeBoost: if (pokemod.getTypeIndex(val2) == UINT_MAX) - throw(BoundsException("ItemEffect", "val2")); + throw(BoundsException(className, "val2")); break; case E_PPRestore: if (A_End <= val2) - throw(BoundsException("ItemEffect", "val2")); + throw(BoundsException(className, "val2")); break; case E_Repel: if (RP_End <= val2) - throw(BoundsException("ItemEffect", "val2")); + throw(BoundsException(className, "val2")); break; case E_Escape: if (ES_End <= val2) - throw(BoundsException("ItemEffect", "val2")); + throw(BoundsException(className, "val2")); break; case E_TM: case E_HM: if (pokemod.getMoveIndex(val2) == UINT_MAX) - throw(BoundsException("ItemEffect", "val2")); + throw(BoundsException(className, "val2")); break; case E_Ball: if (B_End <= val2) - throw(BoundsException("ItemEffect", "val2")); + throw(BoundsException(className, "val2")); break; case E_Scope: break; case E_Berry: if (B2_End <= val2) - throw(BoundsException("ItemEffect", "val2")); + throw(BoundsException(className, "val2")); break; case E_Coin: case E_CoinCase: if (val2 <= 0) - throw(BoundsException("ItemEffect", "val2")); + throw(BoundsException(className, "val2")); break; case E_Acorn: if (pokemod.getItemIndex(val2) == UINT_MAX) - throw(BoundsException("ItemEffect", "val2")); + throw(BoundsException(className, "val2")); break; default: - throw(UnusedException("ItemEffect", "val2")); + throw(UnusedException(className, "val2")); break; } val2 = v2; @@ -572,7 +572,7 @@ void ItemEffect::setVal3(const unsigned v3) throw(Exception) { case E_StatBoost: if ((pokemod.getRules().getSpecialSplit() ? ST_End_GSC : ST_End_RBY) <= val3) - throw(BoundsException("ItemEffect", "val3")); + throw(BoundsException(className, "val3")); break; case E_Ball: switch (val2) @@ -583,25 +583,25 @@ void ItemEffect::setVal3(const unsigned v3) throw(Exception) break; case B_Area: if (MapWildList::End <= val3) - throw(BoundsException("ItemEffect", "val3")); + throw(BoundsException(className, "val3")); break; case B_Time: if (pokemod.getTimeIndex(val3) == UINT_MAX) - throw(BoundsException("ItemEffect", "val3")); + throw(BoundsException(className, "val3")); break; case B_Stat: if ((pokemod.getRules().getSpecialSplit() ? ST_End_GSC : ST_End_RBY) <= val3) - throw(BoundsException("ItemEffect", "val3")); + throw(BoundsException(className, "val3")); break; case B_Type: if (pokemod.getTypeIndex(val3) == UINT_MAX) - throw(BoundsException("ItemEffect", "val3")); + throw(BoundsException(className, "val3")); break; case B_Regular: case B_Master: case B_Love: case B_Battle: - throw(UnusedException("ItemEffect", "val3")); + throw(UnusedException(className, "val3")); break; } break; @@ -610,19 +610,19 @@ void ItemEffect::setVal3(const unsigned v3) throw(Exception) { case B2_HPCure: if (REL_End <= val3) - throw(BoundsException("ItemEffect", "val3")); + throw(BoundsException(className, "val3")); break; case B2_StatusCure: if (STS_End <= val3) - throw(BoundsException("ItemEffect", "val3")); + throw(BoundsException(className, "val3")); break; default: - throw(UnusedException("ItemEffect", "val3")); + throw(UnusedException(className, "val3")); break; } break; default: - throw(UnusedException("ItemEffect", "val3")); + throw(UnusedException(className, "val3")); break; } val3 = v3; @@ -648,14 +648,14 @@ void ItemEffect::setVal4(const unsigned n, const unsigned d) throw(Exception) case E_CoinCase: case E_Acorn: case E_Evolution: - throw(UnusedException("ItemEffect", "val4")); + throw(UnusedException(className, "val4")); case E_Ball: if (val2 == B_Master) - throw(UnusedException("ItemEffect", "val4")); + throw(UnusedException(className, "val4")); break; case E_Berry: if (val2 != B2_HPCure) - throw(UnusedException("ItemEffect", "val4")); + throw(UnusedException(className, "val4")); break; } val4.set(n, d); @@ -681,14 +681,14 @@ void ItemEffect::setVal4Num(const unsigned n) throw(Exception) case E_CoinCase: case E_Acorn: case E_Evolution: - throw(UnusedException("ItemEffect", "val4")); + throw(UnusedException(className, "val4")); case E_Ball: if (val2 == B_Master) - throw(UnusedException("ItemEffect", "val4")); + throw(UnusedException(className, "val4")); break; case E_Berry: if (val2 != B2_HPCure) - throw(UnusedException("ItemEffect", "val4")); + throw(UnusedException(className, "val4")); break; } val4.setNum(n); @@ -714,14 +714,14 @@ void ItemEffect::setVal4Denom(const unsigned d) throw(Exception) case E_CoinCase: case E_Acorn: case E_Evolution: - throw(UnusedException("ItemEffect", "val4")); + throw(UnusedException(className, "val4")); case E_Ball: if (val2 == B_Master) - throw(UnusedException("ItemEffect", "val4")); + throw(UnusedException(className, "val4")); break; case E_Berry: if (val2 != B2_HPCure) - throw(UnusedException("ItemEffect", "val4")); + throw(UnusedException(className, "val4")); break; } val4.setDenom(d); |
