diff --git a/AndorsTrail/res/raw/itemlist_omicronrg9.json b/AndorsTrail/res/raw/itemlist_omicronrg9.json index 684276f6e..7752b1543 100644 --- a/AndorsTrail/res/raw/itemlist_omicronrg9.json +++ b/AndorsTrail/res/raw/itemlist_omicronrg9.json @@ -79,9 +79,11 @@ "category":"food", "description":"Even fly larvae have died eating this.", "useEffect":{ + + "increaseCurrentHP":{ - "min":-10, - "max":-15 + "min":-15, + "max":-10 }, "conditionsSource":[ { diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/resource/parsers/ResourceParserUtils.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/resource/parsers/ResourceParserUtils.java index 60f987ea3..8456c7578 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/resource/parsers/ResourceParserUtils.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/resource/parsers/ResourceParserUtils.java @@ -47,10 +47,18 @@ public final class ResourceParserUtils { public static ConstRange parseConstRange(JSONObject o) throws JSONException { if (o == null) return null; - return new ConstRange( + ConstRange ret = new ConstRange( o.getInt(JsonFieldNames.Range.max), o.optInt(JsonFieldNames.Range.min) ); + + if (AndorsTrailApplication.DEVELOPMENT_VALIDATEDATA) { + if (ret.current > ret.max) { + L.log("WARNING: Detected range where max value is lower than current value"); + } + } + + return ret; } public static final ConstRange always = one; diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/util/ConstRange.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/util/ConstRange.java index 9af344337..72d97eb85 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/util/ConstRange.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/util/ConstRange.java @@ -25,6 +25,7 @@ public final class ConstRange { } public String toMinMaxAbsString() { if (isMax()) return Integer.toString(Math.abs(max)); + else if (current < 0) return Math.abs(max) + "-" + Math.abs(current); else return Math.abs(current) + "-" + Math.abs(max); } public boolean isMax() { return max == current; }