Search in sources :

Example 1 with Fire

use of com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire in project shattered-pixel-dungeon-gdx by 00-Evan.

the class Potion method splash.

protected void splash(int cell) {
    Fire fire = (Fire) Dungeon.level.blobs.get(Fire.class);
    if (fire != null)
        fire.clear(cell);
    final int color = ItemSprite.pick(image, 8, 10);
    Char ch = Actor.findChar(cell);
    if (ch != null) {
        Buff.detach(ch, Burning.class);
        Buff.detach(ch, Ooze.class);
        Splash.at(ch.sprite.center(), color, 5);
    } else {
        Splash.at(cell, color, 5);
    }
}
Also used : Char(com.shatteredpixel.shatteredpixeldungeon.actors.Char) Fire(com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire)

Example 2 with Fire

use of com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire in project shattered-pixel-dungeon-gdx by 00-Evan.

the class Icecap method activate.

@Override
public void activate() {
    PathFinder.buildDistanceMap(pos, BArray.not(Dungeon.level.losBlocking, null), 1);
    Fire fire = (Fire) Dungeon.level.blobs.get(Fire.class);
    for (int i = 0; i < PathFinder.distance.length; i++) {
        if (PathFinder.distance[i] < Integer.MAX_VALUE) {
            Freezing.affect(i, fire);
        }
    }
}
Also used : Fire(com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire)

Example 3 with Fire

use of com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire in project shattered-pixel-dungeon-gdx by 00-Evan.

the class CursedWand method veryRareEffect.

private static void veryRareEffect(final Wand wand, final Hero user, final Ballistica bolt) {
    switch(Random.Int(4)) {
        // great forest fire!
        case 0:
            for (int i = 0; i < Dungeon.level.length(); i++) {
                int c = Dungeon.level.map[i];
                if (c == Terrain.EMPTY || c == Terrain.EMBERS || c == Terrain.EMPTY_DECO || c == Terrain.GRASS || c == Terrain.HIGH_GRASS) {
                    GameScene.add(Blob.seed(i, 15, Regrowth.class));
                }
            }
            do {
                GameScene.add(Blob.seed(Dungeon.level.randomDestination(), 10, Fire.class));
            } while (Random.Int(5) != 0);
            new Flare(8, 32).color(0xFFFF66, true).show(user.sprite, 2f);
            Sample.INSTANCE.play(Assets.SND_TELEPORT);
            GLog.p(Messages.get(CursedWand.class, "grass"));
            GLog.w(Messages.get(CursedWand.class, "fire"));
            wand.wandUsed();
            break;
        // superpowered mimic
        case 1:
            cursedFX(user, bolt, new Callback() {

                public void call() {
                    Mimic mimic = Mimic.spawnAt(bolt.collisionPos, new ArrayList<Item>());
                    if (mimic != null) {
                        mimic.adjustStats(Dungeon.depth + 10);
                        mimic.HP = mimic.HT;
                        Item reward;
                        do {
                            reward = Generator.random(Random.oneOf(Generator.Category.WEAPON, Generator.Category.ARMOR, Generator.Category.RING, Generator.Category.WAND));
                        } while (reward.level() < 1);
                        Sample.INSTANCE.play(Assets.SND_MIMIC, 1, 1, 0.5f);
                        mimic.items.clear();
                        mimic.items.add(reward);
                    } else {
                        GLog.i(Messages.get(CursedWand.class, "nothing"));
                    }
                    wand.wandUsed();
                }
            });
            break;
        // crashes the game, yes, really.
        case 2:
            try {
                Dungeon.saveAll();
                if (Messages.lang() != Languages.ENGLISH) {
                    // Don't bother doing this joke to none-english speakers, I doubt it would translate.
                    GLog.i(Messages.get(CursedWand.class, "nothing"));
                    wand.wandUsed();
                } else {
                    GameScene.show(new WndOptions("CURSED WAND ERROR", "this application will now self-destruct", "abort", "retry", "fail") {

                        @Override
                        protected void onSelect(int index) {
                            Game.instance.finish();
                        }

                        @Override
                        public void onBackPressed() {
                        // do nothing
                        }
                    });
                }
            } catch (IOException e) {
                ShatteredPixelDungeon.reportException(e);
                // oookay maybe don't kill the game if the save failed.
                GLog.i(Messages.get(CursedWand.class, "nothing"));
                wand.wandUsed();
            }
            break;
        // random transmogrification
        case 3:
            wand.wandUsed();
            wand.detach(user.belongings.backpack);
            Item result;
            do {
                result = Generator.random(Random.oneOf(Generator.Category.WEAPON, Generator.Category.ARMOR, Generator.Category.RING, Generator.Category.ARTIFACT));
            } while (result.cursed);
            if (result.isUpgradable())
                result.upgrade();
            result.cursed = result.cursedKnown = true;
            GLog.w(Messages.get(CursedWand.class, "transmogrify"));
            Dungeon.level.drop(result, user.pos).sprite.drop();
            wand.wandUsed();
            break;
    }
}
Also used : WndOptions(com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions) Item(com.shatteredpixel.shatteredpixeldungeon.items.Item) Flare(com.shatteredpixel.shatteredpixeldungeon.effects.Flare) Callback(com.watabou.utils.Callback) Mimic(com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mimic) Fire(com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire) ArrayList(java.util.ArrayList) Regrowth(com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Regrowth) IOException(java.io.IOException)

Aggregations

Fire (com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire)3 Char (com.shatteredpixel.shatteredpixeldungeon.actors.Char)1 Regrowth (com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Regrowth)1 Mimic (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mimic)1 Flare (com.shatteredpixel.shatteredpixeldungeon.effects.Flare)1 Item (com.shatteredpixel.shatteredpixeldungeon.items.Item)1 WndOptions (com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions)1 Callback (com.watabou.utils.Callback)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1