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);
}
}
}
}
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();
}
}
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);
}
}
}
}
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);
}
}
}
}
}
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);
}
}
Aggregations