Search in sources :

Example 36 with Hero

use of com.watabou.pixeldungeon.actors.hero.Hero in project pixel-dungeon-remix by NYRDS.

the class Chasm method heroLand.

public static void heroLand() {
    Hero hero = Dungeon.hero;
    hero.getSprite().setVisible(true);
    hero.getSprite().alpha(1f);
    hero.getSprite().burst(hero.getSprite().blood(), 10);
    Camera.main.shake(4, 0.2f);
    Buff.prolong(hero, Cripple.class, Cripple.DURATION);
    hero.damage(Random.IntRange(hero.ht() / 3, hero.ht() / 2), new Hero.Doom() {

        @Override
        public void onDeath() {
            Badges.validateDeathFromFalling();
            Dungeon.fail(Utils.format(ResultDescriptions.FALL, Dungeon.depth));
            GLog.n(Game.getVar(R.string.Chasm_Info));
        }
    });
    InterlevelScene.mode = InterlevelScene.Mode.CONTINUE;
}
Also used : Hero(com.watabou.pixeldungeon.actors.hero.Hero)

Example 37 with Hero

use of com.watabou.pixeldungeon.actors.hero.Hero in project pixel-dungeon-remix by NYRDS.

the class WndPriest method doHeal.

private void doHeal(HealerNPC priest, Collection<? extends Char> patients, int healingCost) {
    hide();
    Dungeon.gold(Dungeon.gold() - healingCost);
    for (Char patient : patients) {
        PotionOfHealing.heal(patient, 1.0f);
        if (patient instanceof Hero) {
            patient.buff(Hunger.class).satisfy(Hunger.STARVING);
        }
        if (patient instanceof Mob) {
            if (((Mob) patient).getMobClassName().equals("Brute")) {
                Badges.validateGnollUnlocked();
            }
        }
    }
    priest.say(Game.getVar(R.string.HealerNPC_Message2));
}
Also used : Mob(com.watabou.pixeldungeon.actors.mobs.Mob) Hunger(com.watabou.pixeldungeon.actors.buffs.Hunger) Char(com.watabou.pixeldungeon.actors.Char) Hero(com.watabou.pixeldungeon.actors.hero.Hero)

Example 38 with Hero

use of com.watabou.pixeldungeon.actors.hero.Hero in project pixel-dungeon-remix by NYRDS.

the class Necrotism method act.

@Override
public boolean act() {
    if (target.isAlive()) {
        target.getSprite().burst(0x6935a5, 3);
        int damage;
        if (target instanceof Boss) {
            damage = (target.hp() / 200);
        } else {
            damage = (target.hp() / Math.max(3, (21 - iteration)));
        }
        target.damage(Math.max(1, damage * iteration), this);
        spend(TICK);
        int cell = target.getPos();
        for (int n : Level.NEIGHBOURS16) {
            int p = n + cell;
            Char ch = Actor.findChar(p);
            if (Dungeon.level.cellValid(p) && ch != null && !(ch instanceof Hero) && !(ch instanceof NPC)) {
                if (Random.Int(1) == 0 && !ch.hasBuff(Necrotism.class)) {
                    Buff.affect(ch, Necrotism.class).set(duration, iteration + 1);
                }
            }
        }
        if ((left -= TICK) <= 0) {
            detach();
        }
    } else {
        detach();
    }
    return true;
}
Also used : NPC(com.watabou.pixeldungeon.actors.mobs.npcs.NPC) Boss(com.watabou.pixeldungeon.actors.mobs.Boss) Char(com.watabou.pixeldungeon.actors.Char) Hero(com.watabou.pixeldungeon.actors.hero.Hero)

Example 39 with Hero

use of com.watabou.pixeldungeon.actors.hero.Hero in project pixel-dungeon-remix by NYRDS.

the class MirrorImage method sprite.

@Override
public CharSprite sprite() {
    if (lookDesc.length > 0) {
        return new HeroSpriteDef(lookDesc);
    } else {
        // handle old saves
        if (Dungeon.hero != null) {
            lookDesc = Dungeon.hero.getHeroSprite().getLayersDesc();
        } else {
            // dirty hack here
            Hero hero = new Hero();
            lookDesc = new HeroSpriteDef(hero).getLayersDesc();
        }
        return sprite();
    }
}
Also used : Hero(com.watabou.pixeldungeon.actors.hero.Hero) HeroSpriteDef(com.watabou.pixeldungeon.sprites.HeroSpriteDef)

Example 40 with Hero

use of com.watabou.pixeldungeon.actors.hero.Hero in project pixel-dungeon-remix by NYRDS.

the class Dungeon method challengeAllMobs.

public static void challengeAllMobs(Char ch, String sound) {
    if (Dungeon.level == null) {
        return;
    }
    for (Mob mob : Dungeon.level.mobs) {
        mob.beckon(ch.getPos());
    }
    for (Heap heap : Dungeon.level.allHeaps()) {
        if (heap.type == Heap.Type.MIMIC) {
            Mimic m = Mimic.spawnAt(heap.pos, heap.items);
            if (m != null) {
                m.beckon(ch.getPos());
                heap.destroy();
            }
        }
    }
    ch.getSprite().centerEmitter().start(Speck.factory(Speck.SCREAM), 0.3f, 3);
    Sample.INSTANCE.play(sound);
    if (ch instanceof Hero) {
        Invisibility.dispel((Hero) ch);
    }
}
Also used : Mob(com.watabou.pixeldungeon.actors.mobs.Mob) Mimic(com.watabou.pixeldungeon.actors.mobs.Mimic) Hero(com.watabou.pixeldungeon.actors.hero.Hero) Heap(com.watabou.pixeldungeon.items.Heap)

Aggregations

Hero (com.watabou.pixeldungeon.actors.hero.Hero)44 Mob (com.watabou.pixeldungeon.actors.mobs.Mob)8 Item (com.watabou.pixeldungeon.items.Item)8 Char (com.watabou.pixeldungeon.actors.Char)6 Gold (com.watabou.pixeldungeon.items.Gold)5 EquipableItem (com.watabou.pixeldungeon.items.EquipableItem)4 BlackSkull (com.nyrds.pixeldungeon.items.necropolis.BlackSkull)2 Fire (com.watabou.pixeldungeon.actors.blobs.Fire)2 Barkskin (com.watabou.pixeldungeon.actors.buffs.Barkskin)2 Shadows (com.watabou.pixeldungeon.actors.buffs.Shadows)2 Thief (com.watabou.pixeldungeon.actors.mobs.Thief)2 Dewdrop (com.watabou.pixeldungeon.items.Dewdrop)2 KindOfWeapon (com.watabou.pixeldungeon.items.KindOfWeapon)2 MysteryMeat (com.watabou.pixeldungeon.items.food.MysteryMeat)2 Herbalism (com.watabou.pixeldungeon.items.rings.RingOfHerbalism.Herbalism)2 RingOfSatiety (com.watabou.pixeldungeon.items.rings.RingOfSatiety)2 Knuckles (com.watabou.pixeldungeon.items.weapon.melee.Knuckles)2 Level (com.watabou.pixeldungeon.levels.Level)2 SuppressLint (android.annotation.SuppressLint)1 TrackedRuntimeException (com.nyrds.android.util.TrackedRuntimeException)1