use of com.watabou.pixeldungeon.effects.Flare in project pixel-dungeon-remix by NYRDS.
the class ScrollOfTerror method doRead.
@Override
protected void doRead() {
new Flare(5, 32).color(0xFF0000, true).show(getCurUser().getSprite(), 2f);
Sample.INSTANCE.play(Assets.SND_READ);
Invisibility.dispel(getCurUser());
int count = 0;
Mob affected = null;
for (Mob mob : Dungeon.level.getCopyOfMobsArray()) {
if (Dungeon.level.fieldOfView[mob.getPos()]) {
Terror terror = Buff.affect(mob, Terror.class, Terror.DURATION);
terror.source = getCurUser();
count++;
affected = mob;
}
}
switch(count) {
case 0:
GLog.i(Game.getVar(R.string.ScrollOfTerror_Info1));
break;
case 1:
GLog.i(Utils.format(Game.getVar(R.string.ScrollOfTerror_Info2), affected.getName()));
break;
default:
GLog.i(Game.getVar(R.string.ScrollOfTerror_Info3));
}
setKnown();
getCurUser().spendAndNext(TIME_TO_READ);
}
use of com.watabou.pixeldungeon.effects.Flare in project pixel-dungeon-remix by NYRDS.
the class GnollArmor method doSpecial.
@Override
public void doSpecial() {
SpellSprite.show(getCurUser(), SpellSprite.DOMINATION);
Sample.INSTANCE.play(Assets.SND_DOMINANCE);
int mobsDominated = 0;
for (Mob mob : Dungeon.level.getCopyOfMobsArray()) {
if (Dungeon.level.fieldOfView[mob.getPos()]) {
if (mob.canBePet()) {
Mob.makePet(mob, getCurUser());
new Flare(3, 32).show(mob.getSprite(), 2f);
}
if (mobsDominated > getCurUser().lvl() / 10) {
break;
}
}
}
getCurUser().spend(Actor.TICK);
}
use of com.watabou.pixeldungeon.effects.Flare in project pixel-dungeon-remix by NYRDS.
the class King method summon.
private void summon() {
lastPedestal = targetPedestal;
getSprite().centerEmitter().start(Speck.factory(Speck.SCREAM), 0.4f, 2);
Sample.INSTANCE.play(Assets.SND_CHALLENGE);
int undeadsToSummon = maxArmySize() - Undead.count;
Level level = Dungeon.level;
for (int i = 0; i < undeadsToSummon; i++) {
int pos = level.getEmptyCellNextTo(lastPedestal);
if (level.cellValid(pos)) {
Mob servant = new Undead();
servant.setPos(pos);
level.spawnMob(servant, 0);
WandOfBlink.appear(servant, pos);
new Flare(3, 32).color(0x000000, false).show(servant.getSprite(), 2f);
Actor.addDelayed(new Pushing(servant, lastPedestal, servant.getPos()), -1);
}
}
yell(Game.getVar(R.string.King_Info2));
}
use of com.watabou.pixeldungeon.effects.Flare in project pixel-dungeon by watabou.
the class King method summon.
private void summon() {
nextPedestal = !nextPedestal;
sprite.centerEmitter().start(Speck.factory(Speck.SCREAM), 0.4f, 2);
Sample.INSTANCE.play(Assets.SND_CHALLENGE);
boolean[] passable = Level.passable.clone();
for (Actor actor : Actor.all()) {
if (actor instanceof Char) {
passable[((Char) actor).pos] = false;
}
}
int undeadsToSummon = maxArmySize() - Undead.count;
PathFinder.buildDistanceMap(pos, passable, undeadsToSummon);
PathFinder.distance[pos] = Integer.MAX_VALUE;
int dist = 1;
undeadLabel: for (int i = 0; i < undeadsToSummon; i++) {
do {
for (int j = 0; j < Level.LENGTH; j++) {
if (PathFinder.distance[j] == dist) {
Undead undead = new Undead();
undead.pos = j;
GameScene.add(undead);
WandOfBlink.appear(undead, j);
new Flare(3, 32).color(0x000000, false).show(undead.sprite, 2f);
PathFinder.distance[j] = Integer.MAX_VALUE;
continue undeadLabel;
}
}
dist++;
} while (dist < undeadsToSummon);
}
yell("Arise, slaves!");
}
use of com.watabou.pixeldungeon.effects.Flare in project pixel-dungeon by watabou.
the class ScrollOfTerror method doRead.
@Override
protected void doRead() {
new Flare(5, 32).color(0xFF0000, true).show(curUser.sprite, 2f);
Sample.INSTANCE.play(Assets.SND_READ);
Invisibility.dispel();
int count = 0;
Mob affected = null;
for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) {
if (Level.fieldOfView[mob.pos]) {
Buff.affect(mob, Terror.class, Terror.DURATION).object = curUser.id();
count++;
affected = mob;
}
}
switch(count) {
case 0:
GLog.i("The scroll emits a brilliant flash of red light");
break;
case 1:
GLog.i("The scroll emits a brilliant flash of red light and the " + affected.name + " flees!");
break;
default:
GLog.i("The scroll emits a brilliant flash of red light and the monsters flee!");
}
setKnown();
readAnimation();
}
Aggregations