use of com.nyrds.android.util.TrackedRuntimeException in project pixel-dungeon-remix by NYRDS.
the class SpiderExploding method attackProc.
@Override
public int attackProc(@NonNull Char enemy, int damage) {
try {
Plant plant = (Plant) PLantClasses[getKind()].newInstance();
plant.pos = enemy.getPos();
plant.effect(enemy.getPos(), enemy);
die(this);
} catch (Exception e) {
throw new TrackedRuntimeException(e);
}
return damage;
}
use of com.nyrds.android.util.TrackedRuntimeException in project pixel-dungeon-remix by NYRDS.
the class WndSaveSlotSelect method onSelect.
protected void onSelect(int index) {
final InterstitialPoint returnTo = this;
if (saving) {
try {
Dungeon.save();
slot = slotNameFromIndexAndMod(index);
SaveUtils.copySaveToSlot(slot, Dungeon.heroClass);
} catch (Exception e) {
throw new TrackedRuntimeException(e);
}
}
Game.softPaused = true;
slot = getSlotToLoad(index);
if (PixelDungeon.donated() < 1) {
Ads.displaySaveAndLoadAd(returnTo);
} else {
returnToWork(true);
}
}
use of com.nyrds.android.util.TrackedRuntimeException in project pixel-dungeon-remix by NYRDS.
the class Bundle method put.
public void put(String key, String[] array) {
try {
JSONArray jsonArray = new JSONArray();
for (int i = 0; i < array.length; i++) {
jsonArray.put(i, array[i]);
}
data.put(key, jsonArray);
} catch (JSONException e) {
throw new TrackedRuntimeException("key:" + key, e);
}
}
use of com.nyrds.android.util.TrackedRuntimeException in project pixel-dungeon-remix by NYRDS.
the class Bundle method put.
public void put(String key, Bundlable object) {
if (object != null && !object.dontPack()) {
try {
Bundle bundle = new Bundle();
bundle.put(CLASS_NAME, object.getClass().getName());
object.storeInBundle(bundle);
BundleHelper.Pack(object, bundle);
data.put(key, bundle.data);
} catch (JSONException e) {
throw new TrackedRuntimeException("key:" + key, e);
}
}
}
use of com.nyrds.android.util.TrackedRuntimeException in project pixel-dungeon-remix by NYRDS.
the class PredesignedLevel method createMobs.
@Override
protected void createMobs() {
try {
if (mLevelDesc.has("mobs")) {
JSONArray mobsDesc = mLevelDesc.getJSONArray("mobs");
for (int i = 0; i < mobsDesc.length(); ++i) {
JSONObject mobDesc = mobsDesc.optJSONObject(i);
int x = mobDesc.getInt("x");
int y = mobDesc.getInt("y");
if (Actor.findChar(cell(x, y)) != null) {
continue;
}
if (cellValid(x, y)) {
String kind = mobDesc.getString("kind");
Mob mob = MobFactory.mobByName(kind);
mob.fromJson(mobDesc);
mob.setPos(cell(x, y));
spawnMob(mob);
}
}
}
} catch (JSONException e) {
throw new TrackedRuntimeException("bad mob description", e);
} catch (Exception e) {
throw new TrackedRuntimeException(e);
}
}
Aggregations