Search in sources :

Example 1 with Flare

use of com.watabou.pixeldungeon.effects.Flare in project pixel-dungeon by watabou.

the class ScrollOfRemoveCurse method doRead.

@Override
protected void doRead() {
    new Flare(6, 32).show(curUser.sprite, 2f);
    Sample.INSTANCE.play(Assets.SND_READ);
    Invisibility.dispel();
    boolean procced = uncurse(curUser, curUser.belongings.backpack.items.toArray(new Item[0]));
    procced = uncurse(curUser, curUser.belongings.weapon, curUser.belongings.armor, curUser.belongings.ring1, curUser.belongings.ring2) || procced;
    Weakness.detach(curUser, Weakness.class);
    if (procced) {
        GLog.p(TXT_PROCCED);
    } else {
        GLog.i(TXT_NOT_PROCCED);
    }
    setKnown();
    readAnimation();
}
Also used : Item(com.watabou.pixeldungeon.items.Item) Flare(com.watabou.pixeldungeon.effects.Flare)

Example 2 with Flare

use of com.watabou.pixeldungeon.effects.Flare in project pixel-dungeon by watabou.

the class GameScene method create.

@Override
public void create() {
    Music.INSTANCE.play(Assets.TUNE, true);
    Music.INSTANCE.volume(1f);
    PixelDungeon.lastClass(Dungeon.hero.heroClass.ordinal());
    super.create();
    Camera.main.zoom(defaultZoom + PixelDungeon.zoom());
    scene = this;
    terrain = new Group();
    add(terrain);
    water = new SkinnedBlock(Level.WIDTH * DungeonTilemap.SIZE, Level.HEIGHT * DungeonTilemap.SIZE, Dungeon.level.waterTex());
    terrain.add(water);
    ripples = new Group();
    terrain.add(ripples);
    tiles = new DungeonTilemap();
    terrain.add(tiles);
    Dungeon.level.addVisuals(this);
    plants = new Group();
    add(plants);
    int size = Dungeon.level.plants.size();
    for (int i = 0; i < size; i++) {
        addPlantSprite(Dungeon.level.plants.valueAt(i));
    }
    heaps = new Group();
    add(heaps);
    size = Dungeon.level.heaps.size();
    for (int i = 0; i < size; i++) {
        addHeapSprite(Dungeon.level.heaps.valueAt(i));
    }
    emitters = new Group();
    effects = new Group();
    emoicons = new Group();
    mobs = new Group();
    add(mobs);
    for (Mob mob : Dungeon.level.mobs) {
        addMobSprite(mob);
        if (Statistics.amuletObtained) {
            mob.beckon(Dungeon.hero.pos);
        }
    }
    add(emitters);
    add(effects);
    gases = new Group();
    add(gases);
    for (Blob blob : Dungeon.level.blobs.values()) {
        blob.emitter = null;
        addBlobSprite(blob);
    }
    fog = new FogOfWar(Level.WIDTH, Level.HEIGHT);
    fog.updateVisibility(Dungeon.visible, Dungeon.level.visited, Dungeon.level.mapped);
    add(fog);
    brightness(PixelDungeon.brightness());
    spells = new Group();
    add(spells);
    statuses = new Group();
    add(statuses);
    add(emoicons);
    hero = new HeroSprite();
    hero.place(Dungeon.hero.pos);
    hero.updateArmor();
    mobs.add(hero);
    add(new HealthIndicator());
    add(cellSelector = new CellSelector(tiles));
    StatusPane sb = new StatusPane();
    sb.camera = uiCamera;
    sb.setSize(uiCamera.width, 0);
    add(sb);
    toolbar = new Toolbar();
    toolbar.camera = uiCamera;
    toolbar.setRect(0, uiCamera.height - toolbar.height(), uiCamera.width, toolbar.height());
    add(toolbar);
    AttackIndicator attack = new AttackIndicator();
    attack.camera = uiCamera;
    attack.setPos(uiCamera.width - attack.width(), toolbar.top() - attack.height());
    add(attack);
    log = new GameLog();
    log.camera = uiCamera;
    log.setRect(0, toolbar.top(), attack.left(), 0);
    add(log);
    busy = new BusyIndicator();
    busy.camera = uiCamera;
    busy.x = 1;
    busy.y = sb.bottom() + 1;
    add(busy);
    switch(InterlevelScene.mode) {
        case RESURRECT:
            WandOfBlink.appear(Dungeon.hero, Dungeon.level.entrance);
            new Flare(8, 32).color(0xFFFF66, true).show(hero, 2f);
            break;
        case RETURN:
            WandOfBlink.appear(Dungeon.hero, Dungeon.hero.pos);
            break;
        case FALL:
            Chasm.heroLand();
            break;
        case DESCEND:
            switch(Dungeon.depth) {
                case 1:
                    WndStory.showChapter(WndStory.ID_SEWERS);
                    break;
                case 6:
                    WndStory.showChapter(WndStory.ID_PRISON);
                    break;
                case 11:
                    WndStory.showChapter(WndStory.ID_CAVES);
                    break;
                case 16:
                    WndStory.showChapter(WndStory.ID_METROPOLIS);
                    break;
                case 22:
                    WndStory.showChapter(WndStory.ID_HALLS);
                    break;
            }
            if (Dungeon.hero.isAlive() && Dungeon.depth != 22) {
                Badges.validateNoKilling();
            }
            break;
        default:
    }
    ArrayList<Item> dropped = Dungeon.droppedItems.get(Dungeon.depth);
    if (dropped != null) {
        for (Item item : dropped) {
            int pos = Dungeon.level.randomRespawnCell();
            if (item instanceof Potion) {
                ((Potion) item).shatter(pos);
            } else if (item instanceof Plant.Seed) {
                Dungeon.level.plant((Plant.Seed) item, pos);
            } else {
                Dungeon.level.drop(item, pos);
            }
        }
        Dungeon.droppedItems.remove(Dungeon.depth);
    }
    Camera.main.target = hero;
    if (InterlevelScene.mode != InterlevelScene.Mode.NONE) {
        if (Dungeon.depth < Statistics.deepestFloor) {
            GLog.h(TXT_WELCOME_BACK, Dungeon.depth);
        } else {
            GLog.h(TXT_WELCOME, Dungeon.depth);
            Sample.INSTANCE.play(Assets.SND_DESCEND);
        }
        switch(Dungeon.level.feeling) {
            case CHASM:
                GLog.w(TXT_CHASM);
                break;
            case WATER:
                GLog.w(TXT_WATER);
                break;
            case GRASS:
                GLog.w(TXT_GRASS);
                break;
            default:
        }
        if (Dungeon.level instanceof RegularLevel && ((RegularLevel) Dungeon.level).secretDoors > Random.IntRange(3, 4)) {
            GLog.w(TXT_SECRETS);
        }
        if (Dungeon.nightMode && !Dungeon.bossLevel()) {
            GLog.w(TXT_NIGHT_MODE);
        }
        InterlevelScene.mode = InterlevelScene.Mode.NONE;
        fadeIn();
    }
}
Also used : Group(com.watabou.noosa.Group) Mob(com.watabou.pixeldungeon.actors.mobs.Mob) FogOfWar(com.watabou.pixeldungeon.FogOfWar) Blob(com.watabou.pixeldungeon.actors.blobs.Blob) StatusPane(com.watabou.pixeldungeon.ui.StatusPane) Flare(com.watabou.pixeldungeon.effects.Flare) Potion(com.watabou.pixeldungeon.items.potions.Potion) AttackIndicator(com.watabou.pixeldungeon.ui.AttackIndicator) DungeonTilemap(com.watabou.pixeldungeon.DungeonTilemap) Item(com.watabou.pixeldungeon.items.Item) Plant(com.watabou.pixeldungeon.plants.Plant) HealthIndicator(com.watabou.pixeldungeon.ui.HealthIndicator) BusyIndicator(com.watabou.pixeldungeon.ui.BusyIndicator) SkinnedBlock(com.watabou.noosa.SkinnedBlock) HeroSprite(com.watabou.pixeldungeon.sprites.HeroSprite) GameLog(com.watabou.pixeldungeon.ui.GameLog) Toolbar(com.watabou.pixeldungeon.ui.Toolbar) RegularLevel(com.watabou.pixeldungeon.levels.RegularLevel)

Example 3 with Flare

use of com.watabou.pixeldungeon.effects.Flare in project pixel-dungeon by watabou.

the class Hero method die.

@Override
public void die(Object cause) {
    curAction = null;
    DewVial.autoDrink(this);
    if (isAlive()) {
        new Flare(8, 32).color(0xFFFF66, true).show(sprite, 2f);
        return;
    }
    Actor.fixTime();
    super.die(cause);
    Ankh ankh = (Ankh) belongings.getItem(Ankh.class);
    if (ankh == null) {
        reallyDie(cause);
    } else {
        Dungeon.deleteGame(Dungeon.hero.heroClass, false);
        GameScene.show(new WndResurrect(ankh, cause));
    }
}
Also used : WndResurrect(com.watabou.pixeldungeon.windows.WndResurrect) Flare(com.watabou.pixeldungeon.effects.Flare) Ankh(com.watabou.pixeldungeon.items.Ankh)

Example 4 with Flare

use of com.watabou.pixeldungeon.effects.Flare 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);
        }
    }
}
Also used : Mob(com.watabou.pixeldungeon.actors.mobs.Mob) Flare(com.watabou.pixeldungeon.effects.Flare) Hero(com.watabou.pixeldungeon.actors.hero.Hero) ScrollOfWipeOut(com.watabou.pixeldungeon.items.scrolls.ScrollOfWipeOut)

Example 5 with Flare

use of com.watabou.pixeldungeon.effects.Flare in project pixel-dungeon by watabou.

the class AboutScene method create.

@Override
public void create() {
    super.create();
    BitmapTextMultiline text = createMultiline(TXT, 8);
    text.maxWidth = Math.min(Camera.main.width, 120);
    text.measure();
    add(text);
    text.x = align((Camera.main.width - text.width()) / 2);
    text.y = align((Camera.main.height - text.height()) / 2);
    BitmapTextMultiline link = createMultiline(LNK, 8);
    link.maxWidth = Math.min(Camera.main.width, 120);
    link.measure();
    link.hardlight(Window.TITLE_COLOR);
    add(link);
    link.x = text.x;
    link.y = text.y + text.height();
    TouchArea hotArea = new TouchArea(link) {

        @Override
        protected void onClick(Touch touch) {
            Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://" + LNK));
            Game.instance.startActivity(intent);
        }
    };
    add(hotArea);
    Image wata = Icons.WATA.get();
    wata.x = align((Camera.main.width - wata.width) / 2);
    wata.y = text.y - wata.height - 8;
    add(wata);
    new Flare(7, 64).color(0x112233, true).show(wata, 0).angularSpeed = +20;
    Archs archs = new Archs();
    archs.setSize(Camera.main.width, Camera.main.height);
    addToBack(archs);
    ExitButton btnExit = new ExitButton();
    btnExit.setPos(Camera.main.width - btnExit.width(), 0);
    add(btnExit);
    fadeIn();
}
Also used : Flare(com.watabou.pixeldungeon.effects.Flare) TouchArea(com.watabou.noosa.TouchArea) Archs(com.watabou.pixeldungeon.ui.Archs) ExitButton(com.watabou.pixeldungeon.ui.ExitButton) Intent(android.content.Intent) Touch(com.watabou.input.Touchscreen.Touch) Image(com.watabou.noosa.Image) BitmapTextMultiline(com.watabou.noosa.BitmapTextMultiline)

Aggregations

Flare (com.watabou.pixeldungeon.effects.Flare)8 Mob (com.watabou.pixeldungeon.actors.mobs.Mob)3 BitmapTextMultiline (com.watabou.noosa.BitmapTextMultiline)2 Image (com.watabou.noosa.Image)2 Item (com.watabou.pixeldungeon.items.Item)2 Intent (android.content.Intent)1 Touch (com.watabou.input.Touchscreen.Touch)1 Group (com.watabou.noosa.Group)1 SkinnedBlock (com.watabou.noosa.SkinnedBlock)1 TouchArea (com.watabou.noosa.TouchArea)1 DungeonTilemap (com.watabou.pixeldungeon.DungeonTilemap)1 FogOfWar (com.watabou.pixeldungeon.FogOfWar)1 Actor (com.watabou.pixeldungeon.actors.Actor)1 Char (com.watabou.pixeldungeon.actors.Char)1 Blob (com.watabou.pixeldungeon.actors.blobs.Blob)1 Hero (com.watabou.pixeldungeon.actors.hero.Hero)1 Ankh (com.watabou.pixeldungeon.items.Ankh)1 Potion (com.watabou.pixeldungeon.items.potions.Potion)1 ScrollOfWipeOut (com.watabou.pixeldungeon.items.scrolls.ScrollOfWipeOut)1 RegularLevel (com.watabou.pixeldungeon.levels.RegularLevel)1