Search in sources :

Example 61 with Char

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

the class ParalyticGas method evolve.

@Override
protected void evolve() {
    super.evolve();
    Char ch;
    int cell;
    for (int i = area.left; i < area.right; i++) {
        for (int j = area.top; j < area.bottom; j++) {
            cell = i + j * Dungeon.level.width();
            if (cur[cell] > 0 && (ch = Actor.findChar(cell)) != null) {
                if (!ch.isImmune(this.getClass()))
                    Buff.prolong(ch, Paralysis.class, Paralysis.DURATION);
            }
        }
    }
}
Also used : Char(com.shatteredpixel.shatteredpixeldungeon.actors.Char) Paralysis(com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis)

Example 62 with Char

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

the class Regrowth method evolve.

@Override
protected void evolve() {
    super.evolve();
    if (volume > 0) {
        int cell;
        for (int i = area.left; i < area.right; i++) {
            for (int j = area.top; j < area.bottom; j++) {
                cell = i + j * Dungeon.level.width();
                if (off[cell] > 0) {
                    int c = Dungeon.level.map[cell];
                    int c1 = c;
                    if (c == Terrain.EMPTY || c == Terrain.EMBERS || c == Terrain.EMPTY_DECO) {
                        c1 = (cur[cell] > 9 && Actor.findChar(cell) == null) ? Terrain.HIGH_GRASS : Terrain.GRASS;
                    } else if (c == Terrain.GRASS && cur[cell] > 9 && Dungeon.level.plants.get(cell) == null && Actor.findChar(cell) == null) {
                        c1 = Terrain.HIGH_GRASS;
                    }
                    if (c1 != c) {
                        Level.set(cell, c1);
                        GameScene.updateMap(cell);
                    }
                    Char ch = Actor.findChar(cell);
                    if (ch != null && !ch.isImmune(this.getClass()) && off[cell] > 1) {
                        Buff.prolong(ch, Roots.class, TICK);
                    }
                }
            }
        }
        Dungeon.observe();
    }
}
Also used : Char(com.shatteredpixel.shatteredpixeldungeon.actors.Char)

Example 63 with Char

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

the class StenchGas method evolve.

@Override
protected void evolve() {
    super.evolve();
    Char ch;
    int cell;
    for (int i = area.left; i < area.right; i++) {
        for (int j = area.top; j < area.bottom; j++) {
            cell = i + j * Dungeon.level.width();
            if (cur[cell] > 0 && (ch = Actor.findChar(cell)) != null) {
                if (!ch.isImmune(this.getClass()))
                    Buff.prolong(ch, Paralysis.class, Paralysis.DURATION / 5);
            }
        }
    }
}
Also used : Char(com.shatteredpixel.shatteredpixeldungeon.actors.Char) Paralysis(com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis)

Example 64 with Char

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

the class Web method evolve.

@Override
protected void evolve() {
    int cell;
    for (int i = area.left; i < area.right; i++) {
        for (int j = area.top; j < area.bottom; j++) {
            cell = i + j * Dungeon.level.width();
            off[cell] = cur[cell] > 0 ? cur[cell] - 1 : 0;
            if (off[cell] > 0) {
                volume += off[cell];
                Char ch = Actor.findChar(cell);
                if (ch != null && !ch.isImmune(this.getClass())) {
                    Buff.prolong(ch, Roots.class, TICK);
                }
            }
        }
    }
}
Also used : Char(com.shatteredpixel.shatteredpixeldungeon.actors.Char)

Example 65 with Char

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

the class DM300 method move.

@Override
public void move(int step) {
    super.move(step);
    if (Dungeon.level.map[step] == Terrain.INACTIVE_TRAP && HP < HT) {
        HP += Random.Int(1, HT - HP);
        sprite.emitter().burst(ElmoParticle.FACTORY, 5);
        if (Dungeon.level.heroFOV[step] && Dungeon.hero.isAlive()) {
            GLog.n(Messages.get(this, "repair"));
        }
    }
    int[] cells = { step - 1, step + 1, step - Dungeon.level.width(), step + Dungeon.level.width(), step - 1 - Dungeon.level.width(), step - 1 + Dungeon.level.width(), step + 1 - Dungeon.level.width(), step + 1 + Dungeon.level.width() };
    int cell = cells[Random.Int(cells.length)];
    if (Dungeon.level.heroFOV[cell]) {
        CellEmitter.get(cell).start(Speck.factory(Speck.ROCK), 0.07f, 10);
        Camera.main.shake(3, 0.7f);
        Sample.INSTANCE.play(Assets.SND_ROCKS);
        if (Dungeon.level.water[cell]) {
            GameScene.ripple(cell);
        } else if (Dungeon.level.map[cell] == Terrain.EMPTY) {
            Level.set(cell, Terrain.EMPTY_DECO);
            GameScene.updateMap(cell);
        }
    }
    Char ch = Actor.findChar(cell);
    if (ch != null && ch != this) {
        Buff.prolong(ch, Paralysis.class, 2);
    }
}
Also used : Char(com.shatteredpixel.shatteredpixeldungeon.actors.Char)

Aggregations

Char (com.shatteredpixel.shatteredpixeldungeon.actors.Char)65 Mob (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob)13 Heap (com.shatteredpixel.shatteredpixeldungeon.items.Heap)13 Hero (com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero)8 Callback (com.watabou.utils.Callback)8 Item (com.shatteredpixel.shatteredpixeldungeon.items.Item)7 Ballistica (com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica)5 ArrayList (java.util.ArrayList)4 Actor (com.shatteredpixel.shatteredpixeldungeon.actors.Actor)3 Fire (com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire)3 Buff (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff)3 Burning (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning)3 Frost (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Frost)3 Bleeding (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bleeding)2 Chill (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Chill)2 Paralysis (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis)2 Lightning (com.shatteredpixel.shatteredpixeldungeon.effects.Lightning)2 Blob (com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob)1 CorrosiveGas (com.shatteredpixel.shatteredpixeldungeon.actors.blobs.CorrosiveGas)1 Regrowth (com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Regrowth)1