use of com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff in project shattered-pixel-dungeon-gdx by 00-Evan.
the class Electricity method evolve.
@Override
protected void evolve() {
water = Dungeon.level.water;
int cell;
// spread first..
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) {
spreadFromCell(cell, cur[cell]);
}
}
}
// ..then decrement/shock
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) {
Char ch = Actor.findChar(cell);
if (ch != null && !ch.isImmune(this.getClass())) {
Buff.prolong(ch, Paralysis.class, 1f);
if (cur[cell] % 2 == 1) {
ch.damage(Math.round(Random.Float(2 + Dungeon.depth / 5f)), this);
}
}
Heap h = Dungeon.level.heaps.get(cell);
if (h != null) {
Item toShock = h.peek();
if (toShock instanceof Wand) {
((Wand) toShock).gainCharge(0.333f);
} else if (toShock instanceof MagesStaff) {
((MagesStaff) toShock).gainCharge(0.333f);
}
}
off[cell] = cur[cell] - 1;
volume += off[cell];
} else {
off[cell] = 0;
}
}
}
}
Aggregations