use of com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire in project shattered-pixel-dungeon-gdx by 00-Evan.
the class Potion method splash.
protected void splash(int cell) {
Fire fire = (Fire) Dungeon.level.blobs.get(Fire.class);
if (fire != null)
fire.clear(cell);
final int color = ItemSprite.pick(image, 8, 10);
Char ch = Actor.findChar(cell);
if (ch != null) {
Buff.detach(ch, Burning.class);
Buff.detach(ch, Ooze.class);
Splash.at(ch.sprite.center(), color, 5);
} else {
Splash.at(cell, color, 5);
}
}
use of com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire in project shattered-pixel-dungeon-gdx by 00-Evan.
the class Icecap method activate.
@Override
public void activate() {
PathFinder.buildDistanceMap(pos, BArray.not(Dungeon.level.losBlocking, null), 1);
Fire fire = (Fire) Dungeon.level.blobs.get(Fire.class);
for (int i = 0; i < PathFinder.distance.length; i++) {
if (PathFinder.distance[i] < Integer.MAX_VALUE) {
Freezing.affect(i, fire);
}
}
}
use of com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire in project shattered-pixel-dungeon-gdx by 00-Evan.
the class CursedWand method veryRareEffect.
private static void veryRareEffect(final Wand wand, final Hero user, final Ballistica bolt) {
switch(Random.Int(4)) {
// great forest fire!
case 0:
for (int i = 0; i < Dungeon.level.length(); i++) {
int c = Dungeon.level.map[i];
if (c == Terrain.EMPTY || c == Terrain.EMBERS || c == Terrain.EMPTY_DECO || c == Terrain.GRASS || c == Terrain.HIGH_GRASS) {
GameScene.add(Blob.seed(i, 15, Regrowth.class));
}
}
do {
GameScene.add(Blob.seed(Dungeon.level.randomDestination(), 10, Fire.class));
} while (Random.Int(5) != 0);
new Flare(8, 32).color(0xFFFF66, true).show(user.sprite, 2f);
Sample.INSTANCE.play(Assets.SND_TELEPORT);
GLog.p(Messages.get(CursedWand.class, "grass"));
GLog.w(Messages.get(CursedWand.class, "fire"));
wand.wandUsed();
break;
// superpowered mimic
case 1:
cursedFX(user, bolt, new Callback() {
public void call() {
Mimic mimic = Mimic.spawnAt(bolt.collisionPos, new ArrayList<Item>());
if (mimic != null) {
mimic.adjustStats(Dungeon.depth + 10);
mimic.HP = mimic.HT;
Item reward;
do {
reward = Generator.random(Random.oneOf(Generator.Category.WEAPON, Generator.Category.ARMOR, Generator.Category.RING, Generator.Category.WAND));
} while (reward.level() < 1);
Sample.INSTANCE.play(Assets.SND_MIMIC, 1, 1, 0.5f);
mimic.items.clear();
mimic.items.add(reward);
} else {
GLog.i(Messages.get(CursedWand.class, "nothing"));
}
wand.wandUsed();
}
});
break;
// crashes the game, yes, really.
case 2:
try {
Dungeon.saveAll();
if (Messages.lang() != Languages.ENGLISH) {
// Don't bother doing this joke to none-english speakers, I doubt it would translate.
GLog.i(Messages.get(CursedWand.class, "nothing"));
wand.wandUsed();
} else {
GameScene.show(new WndOptions("CURSED WAND ERROR", "this application will now self-destruct", "abort", "retry", "fail") {
@Override
protected void onSelect(int index) {
Game.instance.finish();
}
@Override
public void onBackPressed() {
// do nothing
}
});
}
} catch (IOException e) {
ShatteredPixelDungeon.reportException(e);
// oookay maybe don't kill the game if the save failed.
GLog.i(Messages.get(CursedWand.class, "nothing"));
wand.wandUsed();
}
break;
// random transmogrification
case 3:
wand.wandUsed();
wand.detach(user.belongings.backpack);
Item result;
do {
result = Generator.random(Random.oneOf(Generator.Category.WEAPON, Generator.Category.ARMOR, Generator.Category.RING, Generator.Category.ARTIFACT));
} while (result.cursed);
if (result.isUpgradable())
result.upgrade();
result.cursed = result.cursedKnown = true;
GLog.w(Messages.get(CursedWand.class, "transmogrify"));
Dungeon.level.drop(result, user.pos).sprite.drop();
wand.wandUsed();
break;
}
}
Aggregations