diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java index 42725e27e..d19248d9d 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java @@ -47,19 +47,23 @@ public class Hunger extends Buff implements Hero.Doom { private static final String TXT_DEATH = "You starved to death..."; private float level; + private float partialDamage; - private static final String LEVEL = "level"; + private static final String LEVEL = "level"; + private static final String PARTIALDAMAGE = "partialDamage"; @Override public void storeInBundle( Bundle bundle ) { super.storeInBundle(bundle); bundle.put( LEVEL, level ); + bundle.put( PARTIALDAMAGE, partialDamage ); } @Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle( bundle ); level = bundle.getFloat( LEVEL ); + partialDamage = bundle.getFloat(PARTIALDAMAGE); } @Override @@ -76,11 +80,13 @@ public class Hunger extends Buff implements Hero.Doom { if (isStarving()) { - if (Random.Float() < 0.3f && (target.HP > 1 || target.paralysed == 0)) { - - hero.damage( 1, this ); + partialDamage += target.HT/100f; + if (partialDamage > 1){ + target.damage( (int)partialDamage, this); + partialDamage -= (int)partialDamage; } + } else { float newLevel = level + STEP;