Search in sources :

Example 1 with CharSprite

use of com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite in project shattered-pixel-dungeon-gdx by 00-Evan.

the class ShockingDart method proc.

@Override
public int proc(Char attacker, Char defender, int damage) {
    defender.damage(Random.NormalIntRange(8, 12), this);
    CharSprite s = defender.sprite;
    ArrayList<Lightning.Arc> arcs = new ArrayList<>();
    arcs.add(new Lightning.Arc(new PointF(s.x, s.y + s.height / 2), new PointF(s.x + s.width, s.y + s.height / 2)));
    arcs.add(new Lightning.Arc(new PointF(s.x + s.width / 2, s.y), new PointF(s.x + s.width / 2, s.y + s.height)));
    defender.sprite.parent.add(new Lightning(arcs, null));
    return super.proc(attacker, defender, damage);
}
Also used : Lightning(com.shatteredpixel.shatteredpixeldungeon.effects.Lightning) PointF(com.watabou.utils.PointF) ArrayList(java.util.ArrayList) CharSprite(com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite)

Example 2 with CharSprite

use of com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite in project shattered-pixel-dungeon-gdx by 00-Evan.

the class MirrorImage method sprite.

@Override
public CharSprite sprite() {
    CharSprite s = super.sprite();
    ((MirrorSprite) s).updateArmor(tier);
    return s;
}
Also used : MirrorSprite(com.shatteredpixel.shatteredpixeldungeon.sprites.MirrorSprite) CharSprite(com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite)

Example 3 with CharSprite

use of com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite in project shattered-pixel-dungeon-gdx by 00-Evan.

the class CharHealthIndicator method update.

@Override
public void update() {
    super.update();
    if (target != null && target.isAlive() && target.sprite.visible) {
        CharSprite sprite = target.sprite;
        width = sprite.width() * (4 / 6f);
        x = sprite.x + sprite.width() / 6f;
        y = sprite.y - 2;
        level(target);
        visible = target.HP < target.HT;
    } else {
        visible = false;
    }
}
Also used : CharSprite(com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite)

Example 4 with CharSprite

use of com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite in project shattered-pixel-dungeon-gdx by 00-Evan.

the class GameScene method addMobSprite.

private void addMobSprite(Mob mob) {
    CharSprite sprite = mob.sprite();
    sprite.visible = Dungeon.level.heroFOV[mob.pos];
    mobs.add(sprite);
    sprite.link(mob);
}
Also used : CharSprite(com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite)

Example 5 with CharSprite

use of com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite in project shattered-pixel-dungeon-gdx by 00-Evan.

the class TargetHealthIndicator method update.

@Override
public void update() {
    super.update();
    if (target != null && target.isAlive() && target.sprite.visible) {
        CharSprite sprite = target.sprite;
        width = sprite.width;
        x = sprite.x;
        y = sprite.y - 3;
        level(target);
        visible = true;
    } else {
        visible = false;
    }
}
Also used : CharSprite(com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite)

Aggregations

CharSprite (com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite)6 Lightning (com.shatteredpixel.shatteredpixeldungeon.effects.Lightning)1 MirrorSprite (com.shatteredpixel.shatteredpixeldungeon.sprites.MirrorSprite)1 PointF (com.watabou.utils.PointF)1 ArrayList (java.util.ArrayList)1