v3.1.1: adjusted changed hearty meal threshold to work at exactly 1/3 HP
This commit is contained in:
@@ -578,8 +578,8 @@ public enum Talent {
|
|||||||
|
|
||||||
public static void onFoodEaten( Hero hero, float foodVal, Item foodSource ){
|
public static void onFoodEaten( Hero hero, float foodVal, Item foodSource ){
|
||||||
if (hero.hasTalent(HEARTY_MEAL)){
|
if (hero.hasTalent(HEARTY_MEAL)){
|
||||||
//4/6 HP healed, when hero is below 33% health
|
//4/6 HP healed, when hero is below 33% health (with a little rounding up)
|
||||||
if (hero.HP/(float)hero.HT <= 0.333f) {
|
if (hero.HP/(float)hero.HT < 0.334f) {
|
||||||
int healing = 2 + 2 * hero.pointsInTalent(HEARTY_MEAL);
|
int healing = 2 + 2 * hero.pointsInTalent(HEARTY_MEAL);
|
||||||
hero.HP = Math.min(hero.HP + healing, hero.HT);
|
hero.HP = Math.min(hero.HP + healing, hero.HT);
|
||||||
hero.sprite.showStatusWithIcon(CharSprite.POSITIVE, Integer.toString(healing), FloatingText.HEALING);
|
hero.sprite.showStatusWithIcon(CharSprite.POSITIVE, Integer.toString(healing), FloatingText.HEALING);
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ public class StatusPane extends Component {
|
|||||||
|
|
||||||
if (!Dungeon.hero.isAlive()) {
|
if (!Dungeon.hero.isAlive()) {
|
||||||
avatar.tint(0x000000, 0.5f);
|
avatar.tint(0x000000, 0.5f);
|
||||||
} else if ((health/(float)max) <= 0.333f) {
|
} else if ((health/(float)max) < 0.334f) {
|
||||||
warning += Game.elapsed * 5f *(0.4f - (health/(float)max));
|
warning += Game.elapsed * 5f *(0.4f - (health/(float)max));
|
||||||
warning %= 1f;
|
warning %= 1f;
|
||||||
avatar.tint(ColorMath.interpolate(warning, warningColors), 0.5f );
|
avatar.tint(ColorMath.interpolate(warning, warningColors), 0.5f );
|
||||||
|
|||||||
Reference in New Issue
Block a user