use of com.watabou.pixeldungeon.items.scrolls.ScrollOfWipeOut in project pixel-dungeon by watabou.
the class SacrificialFire method sacrifice.
public static void sacrifice(Char ch) {
Wound.hit(ch);
SacrificialFire fire = (SacrificialFire) Dungeon.level.blobs.get(SacrificialFire.class);
if (fire != null) {
int exp = 0;
if (ch instanceof Mob) {
exp = ((Mob) ch).exp() * Random.IntRange(1, 3);
} else if (ch instanceof Hero) {
exp = ((Hero) ch).maxExp();
}
if (exp > 0) {
int volume = fire.volume - exp;
if (volume > 0) {
fire.seed(fire.pos, volume);
GLog.w(TXT_WORTHY);
} else {
fire.seed(fire.pos, 0);
Journal.remove(Feature.SACRIFICIAL_FIRE);
GLog.w(TXT_REWARD);
GameScene.effect(new Flare(7, 32).color(0x66FFFF, true).show(ch.sprite.parent, DungeonTilemap.tileCenterToWorld(fire.pos), 2f));
Dungeon.level.drop(new ScrollOfWipeOut(), fire.pos).sprite.drop();
}
} else {
GLog.w(TXT_UNWORTHY);
}
}
}
Aggregations