use of com.watabou.pixeldungeon.actors.mobs.Boss in project pixel-dungeon-remix by NYRDS.
the class ChaosStaff method onZap.
@Override
protected void onZap(int cell) {
ChaosCommon.doChaosMark(cell, 10 + level() * 10 + charge);
charge = 0;
if (Math.random() < 0.1f) {
Char ch = Actor.findChar(cell);
if (ch instanceof Mob) {
Mob mob = (Mob) ch;
if ((mob instanceof Boss) || (mob instanceof NPC)) {
return;
}
switch(Random.Int(0, 4)) {
case 0:
mob.die(getCurUser());
break;
case 1:
Mob.makePet(mob, getCurUser());
break;
case 2:
int nextCell = Dungeon.level.getEmptyCellNextTo(cell);
if (Dungeon.level.cellValid(nextCell)) {
try {
Mob newMob = mob.getClass().newInstance();
Dungeon.level.spawnMob(newMob);
} catch (Exception e) {
throw new TrackedRuntimeException(e);
}
}
break;
case 3:
WandOfTeleportation.teleport(mob);
break;
case 4:
PotionOfHealing.heal(ch, 1);
break;
}
}
}
}
use of com.watabou.pixeldungeon.actors.mobs.Boss in project pixel-dungeon-remix by NYRDS.
the class WandOfTeleportation method onZap.
@Override
protected void onZap(int cell) {
Char ch = Actor.findChar(cell);
if (ch == getCurUser()) {
setKnown();
ScrollOfTeleportation.teleportHero(getCurUser());
} else if (ch != null && !(ch instanceof Boss) && ch.isMovable()) {
teleport(ch);
} else {
GLog.i(Game.getVar(R.string.WandOfTeleportation_Info2));
}
}
use of com.watabou.pixeldungeon.actors.mobs.Boss in project pixel-dungeon-remix by NYRDS.
the class SacrificialSword method applySpecial.
public void applySpecial(Hero hero, Char tgt) {
if (tgt instanceof Boss) {
return;
}
if (tgt instanceof NPC) {
return;
}
if (!(tgt instanceof Mob)) {
return;
}
Mob mob = (Mob) tgt;
double conversionChance = baseChance(hero) + -mob.defenseSkill(hero) * 0.01 * mob.speed() - tgt.hp() * 0.01;
double roll = Math.random();
if (roll < conversionChance) {
Mob.makePet(mob, hero);
}
}
use of com.watabou.pixeldungeon.actors.mobs.Boss 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.mobs.Boss in project pixel-dungeon-remix by NYRDS.
the class ScrollOfDomination method doRead.
@Override
protected void doRead() {
SpellSprite.show(getCurUser(), SpellSprite.DOMINATION);
Sample.INSTANCE.play(Assets.SND_DOMINANCE);
Invisibility.dispel(getCurUser());
ArrayList<Mob> mobsInSight = new ArrayList<>();
for (Mob mob : Dungeon.level.getCopyOfMobsArray()) {
if (Dungeon.level.fieldOfView[mob.getPos()] && !(mob instanceof Boss) && !mob.isPet() && !(mob instanceof NPC)) {
mobsInSight.add(mob);
}
}
while (!mobsInSight.isEmpty()) {
Mob pet = Random.element(mobsInSight);
if (pet.canBePet()) {
Mob.makePet(pet, getCurUser());
new Flare(3, 32).show(pet.getSprite(), 2f);
break;
}
mobsInSight.remove(pet);
}
Dungeon.observe();
setKnown();
getCurUser().spendAndNext(TIME_TO_READ);
}
Aggregations