use of com.watabou.pixeldungeon.effects.Flare in project pixel-dungeon-remix by NYRDS.
the class ScrollOfDomination method doRead.
@Override
protected void doRead() {
SpellSprite.show(getCurUser(), SpellSprite.DOMINATION);
Sample.INSTANCE.play(Assets.SND_DOMINANCE);
Invisibility.dispel(getCurUser());
ArrayList<Mob> mobsInSight = new ArrayList<>();
for (Mob mob : Dungeon.level.getCopyOfMobsArray()) {
if (Dungeon.level.fieldOfView[mob.getPos()] && !(mob instanceof Boss) && !mob.isPet() && !(mob instanceof NPC)) {
mobsInSight.add(mob);
}
}
while (!mobsInSight.isEmpty()) {
Mob pet = Random.element(mobsInSight);
if (pet.canBePet()) {
Mob.makePet(pet, getCurUser());
new Flare(3, 32).show(pet.getSprite(), 2f);
break;
}
mobsInSight.remove(pet);
}
Dungeon.observe();
setKnown();
getCurUser().spendAndNext(TIME_TO_READ);
}
use of com.watabou.pixeldungeon.effects.Flare in project pixel-dungeon-remix by NYRDS.
the class Hero method die.
@Override
public void die(Object cause) {
clearActions();
DewVial.autoDrink(this);
if (isAlive()) {
new Flare(8, 32).color(0xFFFF66, true).show(getSprite(), 2f);
return;
}
Actor.fixTime();
super.die(cause);
Ankh ankh = belongings.getItem(Ankh.class);
if (ankh == null) {
if (this.subClass == HeroSubClass.LICH && this.getSoulPoints() == this.getSoulPointsMax()) {
this.setSoulPoints(0);
Dungeon.deleteGame(false);
GameScene.show(new WndResurrect(null, cause));
} else {
reallyDie(cause);
}
} else {
Dungeon.deleteGame(false);
while (belongings.removeItem(ankh)) {
}
GameScene.show(new WndResurrect(ankh, cause));
}
}
use of com.watabou.pixeldungeon.effects.Flare in project pixel-dungeon-remix by NYRDS.
the class Rat method canAttack.
@Override
protected boolean canAttack(Char enemy) {
if (enemy.hasBuff(RatSkull.RatterAura.class)) {
setState(FLEEING);
if (!hasBuff(Terror.class)) {
new Flare(5, 32).color(0xFF0000, true).show(getSprite(), 2f);
Terror terror = Buff.affect(this, Terror.class, Terror.DURATION);
terror.source = enemy;
return false;
}
}
return super.canAttack(enemy);
}
Aggregations