v0.7.0: polish pass on potions/scrolls/seeds/stones
This commit is contained in:
parent
0aa38b4470
commit
07ba48e8e0
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.3 KiB |
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 ) {
|
||||
|
|
|
@ -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 );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ public class Sungrass extends Plant {
|
|||
|
||||
@Override
|
||||
public int icon() {
|
||||
return BuffIndicator.HEALING;
|
||||
return BuffIndicator.HERB_HEALING;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue
Block a user