v0.4.0: fixed some bugs and adjusted lucky enchant

This commit is contained in:
Evan Debenham
2016-06-07 16:48:15 -04:00
committed by Evan Debenham
parent 5a30d89647
commit f20130de0f
3 changed files with 9 additions and 5 deletions
@@ -20,6 +20,7 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
@@ -35,10 +36,14 @@ public class Lucky extends Weapon.Enchantment {
int level = Math.max( 0, weapon.level() );
if (Random.Int(100) < (50 + level)){
return weapon.max() - defender.dr()/2;
int exStr = 0;
if (attacker == Dungeon.hero) exStr = Math.max(0, Dungeon.hero.STR() - weapon.STRReq());
damage = weapon.max() + exStr - Random.IntRange(0, defender.dr());
} else {
return weapon.min() - defender.dr()/2;
damage = weapon.min() - Random.IntRange(0, defender.dr());
}
return Math.max(0, damage);
}
@Override