Search in sources :

Example 1 with Momentum

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

the class Hero method defenseSkill.

@Override
public int defenseSkill(Char enemy) {
    float multiplier = 1f * RingOfEvasion.evasionMultiplier(this);
    if (paralysed > 0) {
        multiplier /= 2;
    }
    int aEnc = belongings.armor != null ? belongings.armor.STRReq() - STR() : 10 - STR();
    if (aEnc > 0) {
        multiplier /= Math.pow(1.5, aEnc);
    }
    int bonus = 0;
    if (belongings.armor != null && belongings.armor.hasGlyph(Swiftness.class))
        bonus += 5 + belongings.armor.level() * 1.5f;
    Momentum momentum = buff(Momentum.class);
    if (momentum != null) {
        bonus += momentum.evasionBonus(Math.max(0, -aEnc));
    }
    return Math.round((defenseSkill * multiplier) + bonus);
}
Also used : Swiftness(com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Swiftness) Momentum(com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Momentum)

Example 2 with Momentum

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

the class Hero method speed.

@Override
public float speed() {
    float speed = super.speed();
    speed *= RingOfHaste.speedMultiplier(this);
    Armor armor = belongings.armor;
    if (armor != null) {
        if (armor.hasGlyph(Swiftness.class)) {
            speed *= (1.1f + 0.01f * belongings.armor.level());
        } else if (armor.hasGlyph(Flow.class) && Dungeon.level.water[pos]) {
            speed *= (1.5f + 0.05f * belongings.armor.level());
        }
    }
    int aEnc = armor != null ? armor.STRReq() - STR() : 0;
    if (aEnc > 0)
        speed /= Math.pow(1.2, aEnc);
    Momentum momentum = buff(Momentum.class);
    if (momentum != null) {
        ((HeroSprite) sprite).sprint(1f + 0.05f * momentum.stacks());
        speed *= momentum.speedMultiplier();
    }
    return speed;
}
Also used : Armor(com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor) Momentum(com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Momentum) HeroSprite(com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite)

Aggregations

Momentum (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Momentum)2 Armor (com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor)1 Swiftness (com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Swiftness)1 HeroSprite (com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite)1