Search in sources :

Example 1 with Chill

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

the class Freezing method evolve.

@Override
protected void evolve() {
    boolean[] water = Dungeon.level.water;
    int cell;
    Fire fire = (Fire) Dungeon.level.blobs.get(Fire.class);
    for (int i = area.left - 1; i <= area.right; i++) {
        for (int j = area.top - 1; j <= area.bottom; j++) {
            cell = i + j * Dungeon.level.width();
            if (cur[cell] > 0) {
                if (fire != null && fire.volume > 0 && fire.cur[cell] > 0) {
                    fire.clear(cell);
                    off[cell] = cur[cell] = 0;
                    continue;
                }
                Char ch = Actor.findChar(cell);
                if (ch != null && !ch.isImmune(this.getClass())) {
                    if (ch.buff(Frost.class) != null) {
                        Buff.affect(ch, Frost.class, 2f);
                    } else {
                        Buff.affect(ch, Chill.class, water[cell] ? 5f : 3f);
                        Chill chill = ch.buff(Chill.class);
                        if (chill != null && chill.cooldown() >= 10f) {
                            Buff.affect(ch, Frost.class, 5f);
                        }
                    }
                }
                Heap heap = Dungeon.level.heaps.get(cell);
                if (heap != null)
                    heap.freeze();
                off[cell] = cur[cell] - 1;
                volume += off[cell];
            } else {
                off[cell] = 0;
            }
        }
    }
}
Also used : Chill(com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Chill) Char(com.shatteredpixel.shatteredpixeldungeon.actors.Char) Frost(com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Frost) Heap(com.shatteredpixel.shatteredpixeldungeon.items.Heap)

Example 2 with Chill

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

the class WandOfFrost method onZap.

@Override
protected void onZap(Ballistica bolt) {
    Heap heap = Dungeon.level.heaps.get(bolt.collisionPos);
    if (heap != null) {
        heap.freeze();
    }
    Char ch = Actor.findChar(bolt.collisionPos);
    if (ch != null) {
        int damage = damageRoll();
        if (ch.buff(Frost.class) != null) {
            // do nothing, can't affect a frozen target
            return;
        }
        if (ch.buff(Chill.class) != null) {
            // 7.5% less damage per turn of chill remaining
            float chill = ch.buff(Chill.class).cooldown();
            damage = (int) Math.round(damage * Math.pow(0.9f, chill));
        } else {
            ch.sprite.burst(0xFF99CCFF, level() / 2 + 2);
        }
        processSoulMark(ch, chargesPerCast());
        ch.damage(damage, this);
        if (ch.isAlive()) {
            if (Dungeon.level.water[ch.pos])
                Buff.prolong(ch, Chill.class, 4 + level());
            else
                Buff.prolong(ch, Chill.class, 2 + level());
        }
    } else {
        Dungeon.level.press(bolt.collisionPos, null, true);
    }
}
Also used : Chill(com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Chill) Char(com.shatteredpixel.shatteredpixeldungeon.actors.Char) Frost(com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Frost) Heap(com.shatteredpixel.shatteredpixeldungeon.items.Heap)

Aggregations

Char (com.shatteredpixel.shatteredpixeldungeon.actors.Char)2 Chill (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Chill)2 Frost (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Frost)2 Heap (com.shatteredpixel.shatteredpixeldungeon.items.Heap)2