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);
}
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;
}
Aggregations