diff --git a/core/src/main/assets/buffs.png b/core/src/main/assets/buffs.png index 9534c1829..ab506f60f 100644 Binary files a/core/src/main/assets/buffs.png and b/core/src/main/assets/buffs.png differ diff --git a/core/src/main/assets/large_buffs.png b/core/src/main/assets/large_buffs.png index 37a4eceb5..a9d7177ad 100644 Binary files a/core/src/main/assets/large_buffs.png and b/core/src/main/assets/large_buffs.png differ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Healing.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Healing.java index 254b49afe..b81996517 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Healing.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Healing.java @@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; +import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.watabou.utils.Bundle; import com.watabou.utils.GameMath; @@ -44,15 +45,9 @@ public class Healing extends Buff { @Override public boolean act(){ - int healingThisTick = Math.round(healingLeft * percentHealPerTick) + flatHealPerTick; + target.HP = Math.min(target.HT, target.HP + healingThisTick()); - healingThisTick = (int)GameMath.gate(1, healingThisTick, healingLeft); - - target.HP = Math.min(target.HT, target.HP + healingThisTick); - - target.sprite.showStatus(CharSprite.POSITIVE, Messages.get(this, "value", healingThisTick)); - - healingLeft -= healingThisTick; + healingLeft -= healingThisTick(); if (healingLeft <= 0){ detach(); @@ -63,6 +58,12 @@ public class Healing extends Buff { return true; } + private int healingThisTick(){ + return (int)GameMath.gate(1, + Math.round(healingLeft * percentHealPerTick) + flatHealPerTick, + healingLeft); + } + public void setHeal(int amount, float percentPerTick, int flatPerTick){ healingLeft = amount; percentHealPerTick = percentPerTick; @@ -98,4 +99,19 @@ public class Healing extends Buff { percentHealPerTick = bundle.getFloat(PERCENT); flatHealPerTick = bundle.getInt(FLAT); } + + @Override + public int icon() { + return BuffIndicator.HEALING; + } + + @Override + public String toString() { + return Messages.get(this, "name"); + } + + @Override + public String desc() { + return Messages.get(this, "desc", healingThisTick(), healingLeft); + } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHealing.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHealing.java index 46c3fc801..4fb1f519c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHealing.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHealing.java @@ -46,7 +46,7 @@ public class PotionOfHealing extends Potion { //starts out healing 30 hp, equalizes with hero health total at level 11 Buff.affect( hero, Healing.class ).setHeal((int)(0.8f*hero.HT + 14), 0.25f, 0); cure( hero ); - GLog.p( Messages.get(this, "heal") ); //TODO make the healing buff more visible + GLog.p( Messages.get(this, "heal") ); } public static void cure( Char ch ) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfAffection.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfAffection.java index f2d5c992c..2f390384f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfAffection.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfAffection.java @@ -41,11 +41,11 @@ public class StoneOfAffection extends Runestone { @Override protected void activate(int cell) { - CellEmitter.center(cell).start( Speck.factory( Speck.HEART ), 0.2f, 5 ); - Sample.INSTANCE.play( Assets.SND_CHARMS ); - for (int i : PathFinder.NEIGHBOURS9){ + CellEmitter.center(cell + i).start( Speck.factory( Speck.HEART ), 0.2f, 5 ); + + Char ch = Actor.findChar( cell + i ); if (ch != null && ch.alignment == Char.Alignment.ENEMY){ @@ -53,6 +53,8 @@ public class StoneOfAffection extends Runestone { } } + Sample.INSTANCE.play( Assets.SND_CHARMS ); + } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfClairvoyance.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfClairvoyance.java index 672465edb..f3f650a71 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfClairvoyance.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfClairvoyance.java @@ -118,7 +118,7 @@ public class StoneOfClairvoyance extends Runestone { Sample.INSTANCE.play( Assets.SND_SECRET ); } - Sample.INSTANCE.play( Assets.SND_READ ); + Sample.INSTANCE.play( Assets.SND_TELEPORT ); GameScene.updateFog(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sungrass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sungrass.java index 1659f7e53..2b29a4b3e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sungrass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sungrass.java @@ -117,7 +117,7 @@ public class Sungrass extends Plant { @Override public int icon() { - return BuffIndicator.HEALING; + return BuffIndicator.HERB_HEALING; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java index 1d8a63c23..4c9b2f9c6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java @@ -43,7 +43,8 @@ public class BuffIndicator extends Component { //transparent icon public static final int NONE = 63; - //TODO consider creating an enum to store both index, and tint. Saves making separate images for color differences. + //FIXME this is becoming a mess, should do a big cleaning pass on all of these + //and think about tinting options public static final int MIND_VISION = 0; public static final int LEVITATION = 1; public static final int FIRE = 2; @@ -63,7 +64,7 @@ public class BuffIndicator extends Component { public static final int BLINDNESS = 16; public static final int COMBO = 17; public static final int FURY = 18; - public static final int HEALING = 19; + public static final int HERB_HEALING= 19; public static final int ARMOR = 20; public static final int HEART = 21; public static final int LIGHT = 22; @@ -88,6 +89,7 @@ public class BuffIndicator extends Component { public static final int MOMENTUM = 41; public static final int PREPARATION = 42; public static final int WELL_FED = 43; + public static final int HEALING = 44; public static final int SIZE = 7; diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties index 96135d775..45c9b9f27 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties @@ -154,7 +154,8 @@ actors.buffs.blobimmunity.desc=Some strange force is encasing you in a thin prot actors.buffs.haste.name=Haste actors.buffs.haste.desc=Energy courses through your muscles, allowing you to run at incredible speeds!\n\nWhile under the effects of haste you will run at 3x speed, but will perform all other actions at normal speed.\n\nTurns of haste remaining: %s. -actors.buffs.healing.value=%+dHP +actors.buffs.healing.name=Healing +actors.buffs.healing.desc=A magical remedy is causing wounds to close and flesh to knit.\n\nEvery turn health will steadily regenerate until the healing effect expires. The amount of healing may fade over time.\n\nNext heal: %d.\n\nHealing remaining: %d. actors.buffs.hunger.hungry=Hungry actors.buffs.hunger.starving=Starving diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties index d00a11a6b..9feff2eba 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties @@ -986,7 +986,7 @@ items.stones.stoneofaugmentation$wndaugment.none=Remove Augmentation items.stones.stoneofaugmentation$wndaugment.cancel=Never mind items.stones.stoneofaffection.name=stone of affection -items.stones.stoneofaffection.desc=When this stone is thrown on an enemy, they will be temporarily charmed, and will attempt to target your allies instead of you. +items.stones.stoneofaffection.desc=When this stone is thrown on or next to an enemy they will be temporarily charmed, and will attempt to target your allies instead of you. items.stones.stoneofblast.name=stone of blast items.stones.stoneofblast.desc=This runestone will instantly explode at the location it is thrown to. Just like a bomb, the explosion will deal damage to anything nearby.