summaryrefslogtreecommitdiffstats
path: root/pokemod/ItemEffect.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-04-19 18:12:17 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-04-19 18:12:17 +0000
commitfe31331e2807634ae659e372358bac5781de9130 (patch)
tree6b208974e3f141e9b22152526e2d42e967bfd4ec /pokemod/ItemEffect.cpp
parent6679f5cffa9d35a23b76605ddfbf3257f882b6ee (diff)
[FIX] IndexException is more explicit
[FIX] Added SizeException for image validation [FIX] QPixmaps are now verified [FIX] Classes now use error and warning rather than throwing [FIX] Deleted Object.cpp git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@100 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/ItemEffect.cpp')
-rw-r--r--pokemod/ItemEffect.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/pokemod/ItemEffect.cpp b/pokemod/ItemEffect.cpp
index 9d223475..0a4927c1 100644
--- a/pokemod/ItemEffect.cpp
+++ b/pokemod/ItemEffect.cpp
@@ -432,23 +432,23 @@ void ItemEffect::setValue1(const int value1) throw(Exception)
case E_HPCure:
case E_Revive:
if ((m_value4 != R_Absolute) || !value1)
- throw(BoundsException(className(), "value1"));
+ error<BoundsException>("value1");
break;
case E_LevelBoost:
case E_ShieldBattle:
case E_PPBoost:
case E_Repel:
if (!value1)
- throw(BoundsException(className(), "value1"));
+ error<BoundsException>("value1");
break;
case E_StatBoost:
case E_Acorn:
if ((value1 < 0) || (65536 <= value1))
- throw(BoundsException(className(), "value1"));
+ error<BoundsException>("value1");
break;
case E_ModifyStatBattle:
if ((value1 < -12) || (12 < value1))
- throw(BoundsException(className(), "value1"));
+ error<BoundsException>("value1");
break;
case E_Fish:
case E_Coin:
@@ -459,11 +459,11 @@ void ItemEffect::setValue1(const int value1) throw(Exception)
{
case B_Regular:
if (256 <= value1)
- throw(BoundsException(className(), "value1"));
+ error<BoundsException>("value1");
break;
case B_Level:
if (pokemod()->rules()->maxLevel() < value1)
- throw(BoundsException(className(), "value1"));
+ error<BoundsException>("value1");
break;
case B_Master:
case B_Love:
@@ -476,11 +476,11 @@ void ItemEffect::setValue1(const int value1) throw(Exception)
case B_Weight:
break;
default:
- throw(BoundsException(className(), "value1"));
+ error<BoundsException>("value1");
}
break;
default:
- throw(UnusedException(className(), "value1"));
+ error<UnusedException>("value1");
break;
}
m_value1 = value1;
@@ -493,66 +493,66 @@ void ItemEffect::setValue2(const int value2) throw(Exception)
case E_HPCure:
case E_Revive:
if (R_End <= value2)
- throw(BoundsException(className(), "value2"));
+ error<BoundsException>("value2");
break;
case E_CureStatus:
if (Pokemod::STS_End <= value2)
- throw(BoundsException(className(), "value2"));
+ error<BoundsException>("value2");
break;
case E_StatBoost:
if ((value2 <= 0) || (65536 <= value2))
- throw(BoundsException(className(), "value2"));
+ error<BoundsException>("value2");
break;
case E_ModifyStatBattle:
if (Pokemod::ST_End_Battle <= value2)
- throw(BoundsException(className(), "value2"));
+ error<BoundsException>("value2");
break;
case E_ShieldBattle:
if (SP_End <= value2)
- throw(BoundsException(className(), "value2"));
+ error<BoundsException>("value2");
break;
case E_TypeBoost:
if (pokemod()->typeIndex(value2) == INT_MAX)
- throw(BoundsException(className(), "value2"));
+ error<BoundsException>("value2");
break;
case E_PPRestore:
if (A_End <= value2)
- throw(BoundsException(className(), "value2"));
+ error<BoundsException>("value2");
break;
case E_Repel:
if (RP_End <= value2)
- throw(BoundsException(className(), "value2"));
+ error<BoundsException>("value2");
break;
case E_Escape:
if (ES_End <= value2)
- throw(BoundsException(className(), "value2"));
+ error<BoundsException>("value2");
break;
case E_TM:
case E_HM:
if (pokemod()->moveIndex(value2) == INT_MAX)
- throw(BoundsException(className(), "value2"));
+ error<BoundsException>("value2");
break;
case E_Ball:
if (B_End <= value2)
- throw(BoundsException(className(), "value2"));
+ error<BoundsException>("value2");
break;
case E_Scope:
break;
case E_Berry:
if (B2_End <= value2)
- throw(BoundsException(className(), "value2"));
+ error<BoundsException>("value2");
break;
case E_Coin:
case E_CoinCase:
if (value2 <= 0)
- throw(BoundsException(className(), "value2"));
+ error<BoundsException>("value2");
break;
case E_Acorn:
if (pokemod()->itemIndex(value2) == INT_MAX)
- throw(BoundsException(className(), "value2"));
+ error<BoundsException>("value2");
break;
default:
- throw(UnusedException(className(), "value2"));
+ error<UnusedException>("value2");
break;
}
m_value2 = value2;
@@ -564,7 +564,7 @@ void ItemEffect::setValue3(const int value3) throw(Exception)
{
case E_StatBoost:
if ((pokemod()->rules()->specialSplit() ? Pokemod::ST_End_GSC : Pokemod::ST_End_RBY) <= value3)
- throw(BoundsException(className(), "value3"));
+ error<BoundsException>("value3");
break;
case E_Ball:
switch (m_value2)
@@ -575,25 +575,25 @@ void ItemEffect::setValue3(const int value3) throw(Exception)
break;
case B_Area:
if (MapWildList::End <= value3)
- throw(BoundsException(className(), "value3"));
+ error<BoundsException>("value3");
break;
case B_Time:
if (pokemod()->timeIndex(value3) == INT_MAX)
- throw(BoundsException(className(), "value3"));
+ error<BoundsException>("value3");
break;
case B_Stat:
if ((pokemod()->rules()->specialSplit() ? Pokemod::ST_End_GSC : Pokemod::ST_End_RBY) <= value3)
- throw(BoundsException(className(), "value3"));
+ error<BoundsException>("value3");
break;
case B_Type:
if (pokemod()->typeIndex(value3) == INT_MAX)
- throw(BoundsException(className(), "value3"));
+ error<BoundsException>("value3");
break;
case B_Regular:
case B_Master:
case B_Love:
case B_Battle:
- throw(UnusedException(className(), "value3"));
+ error<UnusedException>("value3");
break;
}
break;
@@ -602,19 +602,19 @@ void ItemEffect::setValue3(const int value3) throw(Exception)
{
case B2_HPCure:
if (Pokemod::REL_End <= value3)
- throw(BoundsException(className(), "value3"));
+ error<BoundsException>("value3");
break;
case B2_StatusCure:
if (Pokemod::STS_End <= value3)
- throw(BoundsException(className(), "value3"));
+ error<BoundsException>("value3");
break;
default:
- throw(UnusedException(className(), "value3"));
+ error<UnusedException>("value3");
break;
}
break;
default:
- throw(UnusedException(className(), "value3"));
+ error<UnusedException>("value3");
break;
}
m_value3 = value3;
@@ -640,14 +640,14 @@ void ItemEffect::setValue4(const Fraction& value4) throw(Exception)
case E_CoinCase:
case E_Acorn:
case E_Evolution:
- throw(UnusedException(className(), "value4"));
+ error<UnusedException>("value4");
case E_Ball:
if (m_value2 == B_Master)
- throw(UnusedException(className(), "value4"));
+ error<UnusedException>("value4");
break;
case E_Berry:
if (m_value2 != B2_HPCure)
- throw(UnusedException(className(), "value4"));
+ error<UnusedException>("value4");
break;
}
m_value4 = value4;