use of com.watabou.pixeldungeon.actors.hero.Hero in project pixel-dungeon-remix by NYRDS.
the class Chasm method heroLand.
public static void heroLand() {
Hero hero = Dungeon.hero;
hero.getSprite().setVisible(true);
hero.getSprite().alpha(1f);
hero.getSprite().burst(hero.getSprite().blood(), 10);
Camera.main.shake(4, 0.2f);
Buff.prolong(hero, Cripple.class, Cripple.DURATION);
hero.damage(Random.IntRange(hero.ht() / 3, hero.ht() / 2), new Hero.Doom() {
@Override
public void onDeath() {
Badges.validateDeathFromFalling();
Dungeon.fail(Utils.format(ResultDescriptions.FALL, Dungeon.depth));
GLog.n(Game.getVar(R.string.Chasm_Info));
}
});
InterlevelScene.mode = InterlevelScene.Mode.CONTINUE;
}
use of com.watabou.pixeldungeon.actors.hero.Hero in project pixel-dungeon-remix by NYRDS.
the class WndPriest method doHeal.
private void doHeal(HealerNPC priest, Collection<? extends Char> patients, int healingCost) {
hide();
Dungeon.gold(Dungeon.gold() - healingCost);
for (Char patient : patients) {
PotionOfHealing.heal(patient, 1.0f);
if (patient instanceof Hero) {
patient.buff(Hunger.class).satisfy(Hunger.STARVING);
}
if (patient instanceof Mob) {
if (((Mob) patient).getMobClassName().equals("Brute")) {
Badges.validateGnollUnlocked();
}
}
}
priest.say(Game.getVar(R.string.HealerNPC_Message2));
}
use of com.watabou.pixeldungeon.actors.hero.Hero in project pixel-dungeon-remix by NYRDS.
the class Necrotism method act.
@Override
public boolean act() {
if (target.isAlive()) {
target.getSprite().burst(0x6935a5, 3);
int damage;
if (target instanceof Boss) {
damage = (target.hp() / 200);
} else {
damage = (target.hp() / Math.max(3, (21 - iteration)));
}
target.damage(Math.max(1, damage * iteration), this);
spend(TICK);
int cell = target.getPos();
for (int n : Level.NEIGHBOURS16) {
int p = n + cell;
Char ch = Actor.findChar(p);
if (Dungeon.level.cellValid(p) && ch != null && !(ch instanceof Hero) && !(ch instanceof NPC)) {
if (Random.Int(1) == 0 && !ch.hasBuff(Necrotism.class)) {
Buff.affect(ch, Necrotism.class).set(duration, iteration + 1);
}
}
}
if ((left -= TICK) <= 0) {
detach();
}
} else {
detach();
}
return true;
}
use of com.watabou.pixeldungeon.actors.hero.Hero in project pixel-dungeon-remix by NYRDS.
the class MirrorImage method sprite.
@Override
public CharSprite sprite() {
if (lookDesc.length > 0) {
return new HeroSpriteDef(lookDesc);
} else {
// handle old saves
if (Dungeon.hero != null) {
lookDesc = Dungeon.hero.getHeroSprite().getLayersDesc();
} else {
// dirty hack here
Hero hero = new Hero();
lookDesc = new HeroSpriteDef(hero).getLayersDesc();
}
return sprite();
}
}
use of com.watabou.pixeldungeon.actors.hero.Hero in project pixel-dungeon-remix by NYRDS.
the class Dungeon method challengeAllMobs.
public static void challengeAllMobs(Char ch, String sound) {
if (Dungeon.level == null) {
return;
}
for (Mob mob : Dungeon.level.mobs) {
mob.beckon(ch.getPos());
}
for (Heap heap : Dungeon.level.allHeaps()) {
if (heap.type == Heap.Type.MIMIC) {
Mimic m = Mimic.spawnAt(heap.pos, heap.items);
if (m != null) {
m.beckon(ch.getPos());
heap.destroy();
}
}
}
ch.getSprite().centerEmitter().start(Speck.factory(Speck.SCREAM), 0.3f, 3);
Sample.INSTANCE.play(sound);
if (ch instanceof Hero) {
Invisibility.dispel((Hero) ch);
}
}
Aggregations