v0.2.3: reduced the severity of curses on Horn of Plenty and Chalice of Blood
This commit is contained in:
parent
eb22583e86
commit
803bd132ae
|
@ -22,6 +22,8 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ResultDescriptions;
|
import com.shatteredpixel.shatteredpixeldungeon.ResultDescriptions;
|
||||||
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.HeroClass;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HornOfPlenty;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
|
||||||
|
@ -108,6 +110,11 @@ public class Hunger extends Buff implements Hero.Doom {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void satisfy( float energy ) {
|
public void satisfy( float energy ) {
|
||||||
|
Artifact.ArtifactBuff buff = target.buff( HornOfPlenty.hornRecharge.class );
|
||||||
|
if (buff != null && buff.isCursed()){
|
||||||
|
energy = Math.round(energy*0.67f);
|
||||||
|
GLog.n("The cursed horn steals some of the food energy as you eat.");
|
||||||
|
}
|
||||||
level -= energy;
|
level -= energy;
|
||||||
if (level < 0) {
|
if (level < 0) {
|
||||||
level = 0;
|
level = 0;
|
||||||
|
|
|
@ -29,13 +29,18 @@ public class Regeneration extends Buff {
|
||||||
public boolean act() {
|
public boolean act() {
|
||||||
if (target.isAlive()) {
|
if (target.isAlive()) {
|
||||||
|
|
||||||
ChaliceOfBlood.chaliceRegen regenBuff = Dungeon.hero.buff( ChaliceOfBlood.chaliceRegen.class);
|
|
||||||
|
|
||||||
if (target.HP < target.HT && !((Hero)target).isStarving() && !(regenBuff != null && regenBuff.isCursed())) {
|
|
||||||
|
if (target.HP < target.HT && !((Hero)target).isStarving()) {
|
||||||
target.HP += 1;
|
target.HP += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ChaliceOfBlood.chaliceRegen regenBuff = Dungeon.hero.buff( ChaliceOfBlood.chaliceRegen.class);
|
||||||
|
|
||||||
if (regenBuff != null)
|
if (regenBuff != null)
|
||||||
|
if (regenBuff.isCursed())
|
||||||
|
spend( REGENERATION_DELAY * 1.5f );
|
||||||
|
else
|
||||||
spend( Math.max(REGENERATION_DELAY - regenBuff.level(), 0.5f) );
|
spend( Math.max(REGENERATION_DELAY - regenBuff.level(), 0.5f) );
|
||||||
else
|
else
|
||||||
spend( REGENERATION_DELAY );
|
spend( REGENERATION_DELAY );
|
||||||
|
|
|
@ -25,8 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HornOfPlenty;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||||
|
@ -102,18 +100,6 @@ public class Food extends Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean doPickUp( Hero hero ){
|
|
||||||
Artifact.ArtifactBuff buff = hero.buff( HornOfPlenty.hornRecharge.class );
|
|
||||||
if (buff != null && buff.isCursed()){
|
|
||||||
GLog.n("Your cursed horn greedily devours the food!");
|
|
||||||
Sample.INSTANCE.play( Assets.SND_EAT );
|
|
||||||
hero.spendAndNext( TIME_TO_PICK_UP );
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return super.doPickUp( hero );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String info() {
|
public String info() {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue
Block a user