v0.6.1: balance changes for dew drops and dew vial
This commit is contained in:
parent
d24f52f361
commit
69981aab33
|
@ -22,9 +22,8 @@
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.items;
|
package com.shatteredpixel.shatteredpixeldungeon.items;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||||
|
@ -37,7 +36,7 @@ import java.util.ArrayList;
|
||||||
|
|
||||||
public class DewVial extends Item {
|
public class DewVial extends Item {
|
||||||
|
|
||||||
private static final int MAX_VOLUME = 10;
|
private static final int MAX_VOLUME = 20;
|
||||||
|
|
||||||
private static final String AC_DRINK = "DRINK";
|
private static final String AC_DRINK = "DRINK";
|
||||||
|
|
||||||
|
@ -86,21 +85,25 @@ public class DewVial extends Item {
|
||||||
if (action.equals( AC_DRINK )) {
|
if (action.equals( AC_DRINK )) {
|
||||||
|
|
||||||
if (volume > 0) {
|
if (volume > 0) {
|
||||||
|
|
||||||
int value = 1 + (Dungeon.depth - 1) / 5;
|
//20 drops for a full heal normally, 15 for the warden
|
||||||
if (hero.heroClass == HeroClass.HUNTRESS) {
|
float dropHealPercent = hero.subClass == HeroSubClass.WARDEN ? 0.0667f : 0.05f;
|
||||||
value++;
|
float missingHealthPercent = 1f - (hero.HP / (float)hero.HT);
|
||||||
}
|
|
||||||
value *= volume;
|
//trimming off 0.01 drops helps with floating point errors
|
||||||
value = (int)Math.max(volume*volume*.01*hero.HT, value);
|
int dropsNeeded = (int)Math.ceil((missingHealthPercent / dropHealPercent) - 0.01f);
|
||||||
int effect = Math.min( hero.HT - hero.HP, value );
|
dropsNeeded = Math.min(dropsNeeded, volume);
|
||||||
|
|
||||||
|
int heal = Math.round( hero.HT * dropHealPercent * dropsNeeded );
|
||||||
|
|
||||||
|
int effect = Math.min( hero.HT - hero.HP, heal );
|
||||||
if (effect > 0) {
|
if (effect > 0) {
|
||||||
hero.HP += effect;
|
hero.HP += effect;
|
||||||
hero.sprite.emitter().burst( Speck.factory( Speck.HEALING ), volume > 5 ? 2 : 1 );
|
hero.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 + dropsNeeded/5 );
|
||||||
hero.sprite.showStatus( CharSprite.POSITIVE, Messages.get(this, "value", effect) );
|
hero.sprite.showStatus( CharSprite.POSITIVE, Messages.get(this, "value", effect) );
|
||||||
}
|
}
|
||||||
|
|
||||||
volume = 0;
|
volume -= dropsNeeded;
|
||||||
|
|
||||||
hero.spend( TIME_TO_DRINK );
|
hero.spend( TIME_TO_DRINK );
|
||||||
hero.busy();
|
hero.busy();
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.items;
|
package com.shatteredpixel.shatteredpixeldungeon.items;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||||
|
@ -45,14 +44,17 @@ public class Dewdrop extends Item {
|
||||||
|
|
||||||
DewVial vial = hero.belongings.getItem( DewVial.class );
|
DewVial vial = hero.belongings.getItem( DewVial.class );
|
||||||
|
|
||||||
if (hero.HP < hero.HT || vial == null || vial.isFull()) {
|
if (vial != null && !vial.isFull()){
|
||||||
|
|
||||||
int value = 1 + (Dungeon.depth - 1) / 5;
|
vial.collectDew( this );
|
||||||
if (hero.subClass == HeroSubClass.WARDEN) {
|
|
||||||
value+=2;
|
|
||||||
}
|
|
||||||
|
|
||||||
int effect = Math.min( hero.HT - hero.HP, value * quantity );
|
} else {
|
||||||
|
|
||||||
|
//20 drops for a full heal normally, 15 for the warden
|
||||||
|
float healthPercent = hero.subClass == HeroSubClass.WARDEN ? 0.0667f : 0.05f;
|
||||||
|
int heal = Math.round( hero.HT * healthPercent * quantity );
|
||||||
|
|
||||||
|
int effect = Math.min( hero.HT - hero.HP, heal );
|
||||||
if (effect > 0) {
|
if (effect > 0) {
|
||||||
hero.HP += effect;
|
hero.HP += effect;
|
||||||
hero.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 );
|
hero.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 );
|
||||||
|
@ -62,10 +64,6 @@ public class Dewdrop extends Item {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
vial.collectDew( this );
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Sample.INSTANCE.play( Assets.SND_DEWDROP );
|
Sample.INSTANCE.play( Assets.SND_DEWDROP );
|
||||||
|
|
Loading…
Reference in New Issue
Block a user