use of com.watabou.pixeldungeon.actors.buffs.FlavourBuff in project pixel-dungeon-remix by NYRDS.
the class ScrollOfCurse method doRead.
@SuppressWarnings("unchecked")
@Override
protected void doRead() {
Invisibility.dispel(getCurUser());
if (getCurUser() instanceof Hero) {
Hero hero = getCurUser();
hero.getSprite().emitter().burst(ShadowParticle.CURSE, 6);
Sample.INSTANCE.play(Assets.SND_CURSED);
Class<? extends FlavourBuff> buffClass = (Class<? extends FlavourBuff>) Random.oneOf(badBuffs);
Buff.prolong(hero, buffClass, 10);
if (getCurUser().belongings.armor != null) {
getCurUser().belongings.armor.cursed = true;
}
if (getCurUser().belongings.weapon != null) {
getCurUser().belongings.weapon.cursed = true;
}
if (getCurUser().belongings.ring1 != null) {
getCurUser().belongings.ring1.cursed = true;
}
if (getCurUser().belongings.ring2 != null) {
getCurUser().belongings.ring2.cursed = true;
}
}
setKnown();
getCurUser().spendAndNext(TIME_TO_READ);
}
Aggregations