Search in sources :

Example 41 with Mob

use of com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob in project shattered-pixel-dungeon-gdx by 00-Evan.

the class Annoying method proc.

@Override
public int proc(Weapon weapon, Char attacker, Char defender, int damage) {
    if (Random.Int(20) == 0) {
        for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) {
            mob.beckon(attacker.pos);
        }
        attacker.sprite.centerEmitter().start(Speck.factory(Speck.SCREAM), 0.3f, 3);
        Sample.INSTANCE.play(Assets.SND_MIMIC);
        Invisibility.dispel();
        GLog.n(Messages.get(this, "msg_" + (Random.Int(5) + 1)));
    }
    return damage;
}
Also used : Mob(com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob)

Example 42 with Mob

use of com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob in project shattered-pixel-dungeon-gdx by 00-Evan.

the class ScrollOfPsionicBlast method empoweredRead.

@Override
public void empoweredRead() {
    GameScene.flash(0xFFFFFF);
    Sample.INSTANCE.play(Assets.SND_BLAST);
    Invisibility.dispel();
    for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) {
        if (Dungeon.level.heroFOV[mob.pos]) {
            mob.damage(mob.HT, this);
        }
    }
    setKnown();
    readAnimation();
}
Also used : Mob(com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob)

Example 43 with Mob

use of com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob in project shattered-pixel-dungeon-gdx by 00-Evan.

the class ScrollOfTerror method doRead.

@Override
public void doRead() {
    new Flare(5, 32).color(0xFF0000, true).show(curUser.sprite, 2f);
    Sample.INSTANCE.play(Assets.SND_READ);
    Invisibility.dispel();
    int count = 0;
    Mob affected = null;
    for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) {
        if (Dungeon.level.heroFOV[mob.pos]) {
            Buff.affect(mob, Terror.class, Terror.DURATION).object = curUser.id();
            if (mob.buff(Terror.class) != null) {
                count++;
                affected = mob;
            }
        }
    }
    switch(count) {
        case 0:
            GLog.i(Messages.get(this, "none"));
            break;
        case 1:
            GLog.i(Messages.get(this, "one", affected.name));
            break;
        default:
            GLog.i(Messages.get(this, "many"));
    }
    setKnown();
    readAnimation();
}
Also used : Mob(com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob) Flare(com.shatteredpixel.shatteredpixeldungeon.effects.Flare) Terror(com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror)

Example 44 with Mob

use of com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob in project shattered-pixel-dungeon-gdx by 00-Evan.

the class Dirk method damageRoll.

@Override
public int damageRoll(Char owner) {
    if (owner instanceof Hero) {
        Hero hero = (Hero) owner;
        Char enemy = hero.enemy();
        if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero)) {
            // deals 67% toward max to max on surprise, instead of min to max.
            int diff = max() - min();
            int damage = imbue.damageFactor(Random.NormalIntRange(min() + Math.round(diff * 0.67f), max()));
            int exStr = hero.STR() - STRReq();
            if (exStr > 0) {
                damage += Random.IntRange(0, exStr);
            }
            return damage;
        }
    }
    return super.damageRoll(owner);
}
Also used : Mob(com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob) Char(com.shatteredpixel.shatteredpixeldungeon.actors.Char) Hero(com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero)

Example 45 with Mob

use of com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob in project shattered-pixel-dungeon-gdx by 00-Evan.

the class ThrowingKnife method damageRoll.

@Override
public int damageRoll(Char owner) {
    if (owner instanceof Hero) {
        Hero hero = (Hero) owner;
        if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero)) {
            // deals 75% toward max to max on surprise, instead of min to max.
            int diff = max() - min();
            int damage = imbue.damageFactor(Random.NormalIntRange(min() + Math.round(diff * 0.75f), max()));
            damage = Math.round(damage * RingOfSharpshooting.damageMultiplier(hero));
            int exStr = hero.STR() - STRReq();
            if (exStr > 0 && hero.heroClass == HeroClass.HUNTRESS) {
                damage += Random.IntRange(0, exStr);
            }
            return damage;
        }
    }
    return super.damageRoll(owner);
}
Also used : Mob(com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob) Hero(com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero)

Aggregations

Mob (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob)49 Char (com.shatteredpixel.shatteredpixeldungeon.actors.Char)13 Heap (com.shatteredpixel.shatteredpixeldungeon.items.Heap)11 Hero (com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero)9 Item (com.shatteredpixel.shatteredpixeldungeon.items.Item)7 ArrayList (java.util.ArrayList)6 Plant (com.shatteredpixel.shatteredpixeldungeon.plants.Plant)4 Blob (com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob)3 Mimic (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mimic)3 Trap (com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap)3 CustomTiledVisual (com.shatteredpixel.shatteredpixeldungeon.tiles.CustomTiledVisual)3 Point (com.watabou.utils.Point)3 Awareness (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Awareness)2 Buff (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff)2 Burning (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning)2 MindVision (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MindVision)2 Terror (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror)2 King (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.King)2 Statue (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Statue)2 Flare (com.shatteredpixel.shatteredpixeldungeon.effects.Flare)2