v0.8.1: Improved buff fading VFX & applied it to a few new ones
Also buffed alternate sources of bless: - holy dart bless duration up to 30 turns from 20. - Holy furor bless duration up to 120 turns from 100.
This commit is contained in:
parent
7fdb4f534e
commit
13ecf57edf
|
@ -41,8 +41,8 @@ public class Adrenaline extends FlavourBuff {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tintIcon(Image icon) {
|
public float iconFadePercent() {
|
||||||
greyIcon(icon, 5f, cooldown());
|
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class AdrenalineSurge extends Buff {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String desc() {
|
public String desc() {
|
||||||
return Messages.get(this, "desc", boost, dispTurns(cooldown()+1));
|
return Messages.get(this, "desc", boost, dispTurns(visualcooldown()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String BOOST = "boost";
|
private static final String BOOST = "boost";
|
||||||
|
|
|
@ -84,7 +84,7 @@ public class ArcaneArmor extends Buff {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String desc() {
|
public String desc() {
|
||||||
return Messages.get(this, "desc", level, dispTurns(cooldown()+1));
|
return Messages.get(this, "desc", level, dispTurns(visualcooldown()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String LEVEL = "level";
|
private static final String LEVEL = "level";
|
||||||
|
|
|
@ -29,9 +29,10 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||||
import com.watabou.noosa.Image;
|
import com.watabou.noosa.Image;
|
||||||
import com.watabou.utils.Bundle;
|
import com.watabou.utils.Bundle;
|
||||||
|
|
||||||
//TODO this may be very powerful, consider balancing
|
|
||||||
public class ArtifactRecharge extends Buff {
|
public class ArtifactRecharge extends Buff {
|
||||||
|
|
||||||
|
public static final float DURATION = 30f;
|
||||||
|
|
||||||
{
|
{
|
||||||
type = buffType.POSITIVE;
|
type = buffType.POSITIVE;
|
||||||
}
|
}
|
||||||
|
@ -80,6 +81,11 @@ public class ArtifactRecharge extends Buff {
|
||||||
icon.hardlight(0, 1f, 0);
|
icon.hardlight(0, 1f, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float iconFadePercent() {
|
||||||
|
return Math.max(0, (DURATION - left) / DURATION);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return Messages.get(this, "name");
|
return Messages.get(this, "name");
|
||||||
|
|
|
@ -77,7 +77,7 @@ public class Barkskin extends Buff {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String desc() {
|
public String desc() {
|
||||||
return Messages.get(this, "desc", level, dispTurns(cooldown()+1));
|
return Messages.get(this, "desc", level, dispTurns(visualcooldown()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String LEVEL = "level";
|
private static final String LEVEL = "level";
|
||||||
|
|
|
@ -40,8 +40,8 @@ public class Bless extends FlavourBuff {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tintIcon(Image icon) {
|
public float iconFadePercent() {
|
||||||
greyIcon(icon, 5f, cooldown());
|
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -54,8 +54,8 @@ public class BlobImmunity extends FlavourBuff {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tintIcon(Image icon) {
|
public float iconFadePercent() {
|
||||||
greyIcon(icon, 5f, cooldown());
|
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -90,10 +90,17 @@ public class Buff extends Actor {
|
||||||
return BuffIndicator.NONE;
|
return BuffIndicator.NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//some buffs may want to tint the base texture color of their icon
|
||||||
public void tintIcon( Image icon ){
|
public void tintIcon( Image icon ){
|
||||||
//do nothing by default
|
//do nothing by default
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//percent (0-1) to fade out out the buff icon, usually if buff is expiring
|
||||||
|
public float iconFadePercent(){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//visual effect usually attached to the sprite of the character the buff is attacked to
|
||||||
public void fx(boolean on) {
|
public void fx(boolean on) {
|
||||||
//do nothing by default
|
//do nothing by default
|
||||||
}
|
}
|
||||||
|
@ -111,6 +118,11 @@ public class Buff extends Actor {
|
||||||
return new DecimalFormat("#.##").format(input);
|
return new DecimalFormat("#.##").format(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//buffs act after the hero, so it is often useful to use cooldown+1 when display buff time remaining
|
||||||
|
public float visualcooldown(){
|
||||||
|
return cooldown()+1f;
|
||||||
|
}
|
||||||
|
|
||||||
//creates a fresh instance of the buff and attaches that, this allows duplication.
|
//creates a fresh instance of the buff and attaches that, this allows duplication.
|
||||||
public static<T extends Buff> T append( Char target, Class<T> buffClass ) {
|
public static<T extends Buff> T append( Char target, Class<T> buffClass ) {
|
||||||
T buff = Reflection.newInstance(buffClass);
|
T buff = Reflection.newInstance(buffClass);
|
||||||
|
|
|
@ -147,6 +147,7 @@ public class Burning extends Buff implements Hero.Doom {
|
||||||
|
|
||||||
spend( TICK );
|
spend( TICK );
|
||||||
left -= TICK;
|
left -= TICK;
|
||||||
|
BuffIndicator.refreshHero();
|
||||||
|
|
||||||
if (left <= 0 ||
|
if (left <= 0 ||
|
||||||
(Dungeon.level.water[target.pos] && !target.flying)) {
|
(Dungeon.level.water[target.pos] && !target.flying)) {
|
||||||
|
@ -170,6 +171,11 @@ public class Burning extends Buff implements Hero.Doom {
|
||||||
return BuffIndicator.FIRE;
|
return BuffIndicator.FIRE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float iconFadePercent() {
|
||||||
|
return Math.max(0, (DURATION - left) / DURATION);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fx(boolean on) {
|
public void fx(boolean on) {
|
||||||
if (on) target.sprite.add(CharSprite.State.BURNING);
|
if (on) target.sprite.add(CharSprite.State.BURNING);
|
||||||
|
|
|
@ -62,6 +62,6 @@ public class Drowsy extends Buff {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String desc() {
|
public String desc() {
|
||||||
return Messages.get(this, "desc", dispTurns(cooldown()+1));
|
return Messages.get(this, "desc", dispTurns(visualcooldown()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,8 +49,8 @@ public class EarthImbue extends FlavourBuff {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tintIcon(Image icon) {
|
public float iconFadePercent() {
|
||||||
greyIcon(icon, 5f, cooldown());
|
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -93,8 +93,8 @@ public class FireImbue extends Buff {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tintIcon(Image icon) {
|
public float iconFadePercent() {
|
||||||
FlavourBuff.greyIcon(icon, 5f, left);
|
return Math.max(0, (DURATION - left+1) / DURATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -42,7 +42,6 @@ public class FlavourBuff extends Buff {
|
||||||
|
|
||||||
//flavour buffs can all just rely on cooldown()
|
//flavour buffs can all just rely on cooldown()
|
||||||
protected String dispTurns() {
|
protected String dispTurns() {
|
||||||
//add one turn as buffs act last, we want them to end at 1 visually, even if they end at 0 internally.
|
return dispTurns(visualcooldown());
|
||||||
return dispTurns(cooldown()+1f);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,8 +47,8 @@ public class FrostImbue extends FlavourBuff {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tintIcon(Image icon) {
|
public float iconFadePercent() {
|
||||||
greyIcon(icon, 5f, cooldown());
|
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -39,9 +39,8 @@ public class Haste extends FlavourBuff {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tintIcon(Image icon) {
|
public float iconFadePercent() {
|
||||||
icon.tint(1, 1, 0, 0.5f);
|
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
|
||||||
if (cooldown() < 5f) greyIcon(icon, 5f, cooldown());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -68,8 +68,8 @@ public class Invisibility extends FlavourBuff {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tintIcon(Image icon) {
|
public float iconFadePercent() {
|
||||||
greyIcon(icon, 5f, cooldown());
|
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -60,8 +60,8 @@ public class Levitation extends FlavourBuff {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tintIcon(Image icon) {
|
public float iconFadePercent() {
|
||||||
greyIcon(icon, 5f, cooldown());
|
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -67,8 +67,8 @@ public class Light extends FlavourBuff {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tintIcon(Image icon) {
|
public float iconFadePercent() {
|
||||||
greyIcon(icon, 20f, cooldown());
|
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -44,8 +44,8 @@ public class MagicalSight extends FlavourBuff {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tintIcon(Image icon) {
|
public float iconFadePercent() {
|
||||||
greyIcon(icon, 5f, cooldown());
|
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -44,8 +44,8 @@ public class MindVision extends FlavourBuff {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tintIcon(Image icon) {
|
public float iconFadePercent() {
|
||||||
greyIcon(icon, 5f, cooldown());
|
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -27,6 +27,8 @@ import com.watabou.noosa.Image;
|
||||||
|
|
||||||
public class Recharging extends FlavourBuff {
|
public class Recharging extends FlavourBuff {
|
||||||
|
|
||||||
|
public static final float DURATION = 30f;
|
||||||
|
|
||||||
{
|
{
|
||||||
type = buffType.POSITIVE;
|
type = buffType.POSITIVE;
|
||||||
}
|
}
|
||||||
|
@ -37,8 +39,8 @@ public class Recharging extends FlavourBuff {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tintIcon(Image icon) {
|
public float iconFadePercent() {
|
||||||
FlavourBuff.greyIcon(icon, 5f, cooldown());
|
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -100,8 +100,8 @@ public class Shadows extends Invisibility {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tintIcon(Image icon) {
|
public float iconFadePercent() {
|
||||||
icon.resetColor();
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -27,6 +27,8 @@ import com.watabou.noosa.Image;
|
||||||
|
|
||||||
public class Stamina extends FlavourBuff {
|
public class Stamina extends FlavourBuff {
|
||||||
|
|
||||||
|
public static final float DURATION = 100f;
|
||||||
|
|
||||||
{
|
{
|
||||||
type = buffType.POSITIVE;
|
type = buffType.POSITIVE;
|
||||||
}
|
}
|
||||||
|
@ -37,9 +39,8 @@ public class Stamina extends FlavourBuff {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tintIcon(Image icon) {
|
public float iconFadePercent() {
|
||||||
icon.tint(1, 1, 0, 0.5f);
|
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
|
||||||
if (cooldown() < 5f) greyIcon(icon, 5f, cooldown());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -80,8 +80,8 @@ public class ToxicImbue extends Buff {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tintIcon(Image icon) {
|
public float iconFadePercent() {
|
||||||
FlavourBuff.greyIcon(icon, 5f, left);
|
return Math.max(0, (DURATION - left) / DURATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1341,7 +1341,7 @@ public class Hero extends Char {
|
||||||
defenseSkill++;
|
defenseSkill++;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Buff.prolong(this, Bless.class, 30f);
|
Buff.prolong(this, Bless.class, Bless.DURATION);
|
||||||
this.exp = 0;
|
this.exp = 0;
|
||||||
|
|
||||||
GLog.newLine();
|
GLog.newLine();
|
||||||
|
|
|
@ -78,7 +78,7 @@ public class RogueArmor extends ClassArmor {
|
||||||
mob.sprite.emitter().burst( Speck.factory( Speck.LIGHT ), 4 );
|
mob.sprite.emitter().burst( Speck.factory( Speck.LIGHT ), 4 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Buff.affect(curUser, Invisibility.class, 10f);
|
Buff.affect(curUser, Invisibility.class, Invisibility.DURATION/2f);
|
||||||
|
|
||||||
CellEmitter.get( curUser.pos ).burst( Speck.factory( Speck.WOOL ), 10 );
|
CellEmitter.get( curUser.pos ).burst( Speck.factory( Speck.WOOL ), 10 );
|
||||||
ScrollOfTeleportation.appear( curUser, target );
|
ScrollOfTeleportation.appear( curUser, target );
|
||||||
|
|
|
@ -81,15 +81,13 @@ public class ElixirOfAquaticRejuvenation extends Elixir {
|
||||||
target.HP += healAmt;
|
target.HP += healAmt;
|
||||||
left -= healAmt;
|
left -= healAmt;
|
||||||
target.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 );
|
target.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 );
|
||||||
|
BuffIndicator.refreshHero();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (left <= 0){
|
if (left <= 0){
|
||||||
detach();
|
detach();
|
||||||
} else {
|
} else {
|
||||||
spend(TICK);
|
spend(TICK);
|
||||||
if (left <= target.HT/4f){
|
|
||||||
BuffIndicator.refreshHero();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -101,7 +99,13 @@ public class ElixirOfAquaticRejuvenation extends Elixir {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tintIcon(Image icon) {
|
public void tintIcon(Image icon) {
|
||||||
FlavourBuff.greyIcon(icon, target.HT/4f, left);
|
icon.hardlight(0, 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float iconFadePercent() {
|
||||||
|
float max = Math.round(target.HT * 1.5f);
|
||||||
|
return Math.max(0, (max - left) / max);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class PotionOfHolyFuror extends ExoticPotion {
|
||||||
@Override
|
@Override
|
||||||
public void apply( Hero hero ) {
|
public void apply( Hero hero ) {
|
||||||
setKnown();
|
setKnown();
|
||||||
Buff.prolong(hero, Bless.class, 100f);
|
Buff.prolong(hero, Bless.class, Bless.DURATION*4f);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class PotionOfStamina extends ExoticPotion {
|
||||||
public void apply(Hero hero) {
|
public void apply(Hero hero) {
|
||||||
setKnown();
|
setKnown();
|
||||||
|
|
||||||
Buff.affect(hero, Stamina.class, 100f);
|
Buff.affect(hero, Stamina.class, Stamina.DURATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,8 +35,6 @@ import com.watabou.noosa.audio.Sample;
|
||||||
|
|
||||||
public class ScrollOfRecharging extends Scroll {
|
public class ScrollOfRecharging extends Scroll {
|
||||||
|
|
||||||
public static final float BUFF_DURATION = 30f;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
initials = 6;
|
initials = 6;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +42,7 @@ public class ScrollOfRecharging extends Scroll {
|
||||||
@Override
|
@Override
|
||||||
public void doRead() {
|
public void doRead() {
|
||||||
|
|
||||||
Buff.affect(curUser, Recharging.class, BUFF_DURATION);
|
Buff.affect(curUser, Recharging.class, Recharging.DURATION);
|
||||||
charge(curUser);
|
charge(curUser);
|
||||||
|
|
||||||
Sample.INSTANCE.play( Assets.SND_READ );
|
Sample.INSTANCE.play( Assets.SND_READ );
|
||||||
|
@ -60,7 +58,7 @@ public class ScrollOfRecharging extends Scroll {
|
||||||
@Override
|
@Override
|
||||||
public void empoweredRead() {
|
public void empoweredRead() {
|
||||||
doRead();
|
doRead();
|
||||||
Buff.append(curUser, Recharging.class, BUFF_DURATION/3f);
|
Buff.append(curUser, Recharging.class, Recharging.DURATION/3f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void charge( Char user ) {
|
public static void charge( Char user ) {
|
||||||
|
|
|
@ -264,7 +264,7 @@ public class CursedWand {
|
||||||
//shock and recharge
|
//shock and recharge
|
||||||
case 3:
|
case 3:
|
||||||
new ShockingTrap().set( user.pos ).activate();
|
new ShockingTrap().set( user.pos ).activate();
|
||||||
Buff.prolong(user, Recharging.class, 20f);
|
Buff.prolong(user, Recharging.class, Recharging.DURATION);
|
||||||
ScrollOfRecharging.charge(user);
|
ScrollOfRecharging.charge(user);
|
||||||
SpellSprite.show(user, SpellSprite.CHARGE);
|
SpellSprite.show(user, SpellSprite.CHARGE);
|
||||||
afterZap.call();
|
afterZap.call();
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class HolyDart extends TippedDart {
|
||||||
@Override
|
@Override
|
||||||
public int proc(Char attacker, Char defender, int damage) {
|
public int proc(Char attacker, Char defender, int damage) {
|
||||||
|
|
||||||
Buff.affect(defender, Bless.class, 20f);
|
Buff.affect(defender, Bless.class, Bless.DURATION);
|
||||||
|
|
||||||
if (attacker.alignment == defender.alignment){
|
if (attacker.alignment == defender.alignment){
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -46,7 +46,7 @@ public class Blindweed extends Plant {
|
||||||
|
|
||||||
if (ch != null) {
|
if (ch != null) {
|
||||||
if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN){
|
if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN){
|
||||||
Buff.affect(ch, Invisibility.class, 10f);
|
Buff.affect(ch, Invisibility.class, Invisibility.DURATION/2f);
|
||||||
} else {
|
} else {
|
||||||
int len = Random.Int(5, 10);
|
int len = Random.Int(5, 10);
|
||||||
Buff.prolong(ch, Blindness.class, len);
|
Buff.prolong(ch, Blindness.class, len);
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class Dreamfoil extends Plant {
|
||||||
PotionOfHealing.cure(ch);
|
PotionOfHealing.cure(ch);
|
||||||
|
|
||||||
if (((Hero) ch).subClass == HeroSubClass.WARDEN){
|
if (((Hero) ch).subClass == HeroSubClass.WARDEN){
|
||||||
Buff.affect(ch, BlobImmunity.class, 10f);
|
Buff.affect(ch, BlobImmunity.class, BlobImmunity.DURATION/2f);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,8 +126,8 @@ public class Earthroot extends Plant {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tintIcon(Image icon) {
|
public float iconFadePercent() {
|
||||||
FlavourBuff.greyIcon(icon, target.HT/4f, level);
|
return Math.max(0, (target.HT - level) / target.HT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class Firebloom extends Plant {
|
||||||
public void activate( Char ch ) {
|
public void activate( Char ch ) {
|
||||||
|
|
||||||
if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN){
|
if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN){
|
||||||
Buff.affect(ch, FireImbue.class).set(15f);
|
Buff.affect(ch, FireImbue.class).set( FireImbue.DURATION*0.3f );
|
||||||
}
|
}
|
||||||
|
|
||||||
GameScene.add( Blob.seed( pos, 2, Fire.class ) );
|
GameScene.add( Blob.seed( pos, 2, Fire.class ) );
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class Icecap extends Plant {
|
||||||
public void activate( Char ch ) {
|
public void activate( Char ch ) {
|
||||||
|
|
||||||
if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN){
|
if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN){
|
||||||
Buff.affect(ch, FrostImbue.class, 15f);
|
Buff.affect(ch, FrostImbue.class, FrostImbue.DURATION*0.3f);
|
||||||
}
|
}
|
||||||
|
|
||||||
PathFinder.buildDistanceMap( pos, BArray.not( Dungeon.level.losBlocking, null ), 1 );
|
PathFinder.buildDistanceMap( pos, BArray.not( Dungeon.level.losBlocking, null ), 1 );
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class Sorrowmoss extends Plant {
|
||||||
@Override
|
@Override
|
||||||
public void activate( Char ch ) {
|
public void activate( Char ch ) {
|
||||||
if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN){
|
if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN){
|
||||||
Buff.affect(ch, ToxicImbue.class).set(15f);
|
Buff.affect(ch, ToxicImbue.class).set(ToxicImbue.DURATION*0.3f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ch != null) {
|
if (ch != null) {
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class Starflower extends Plant {
|
||||||
if (ch != null) {
|
if (ch != null) {
|
||||||
Buff.prolong(ch, Bless.class, Bless.DURATION);
|
Buff.prolong(ch, Bless.class, Bless.DURATION);
|
||||||
if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN){
|
if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN){
|
||||||
Buff.prolong(ch, Recharging.class, Bless.DURATION);
|
Buff.prolong(ch, Recharging.class, Recharging.DURATION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class Stormvine extends Plant {
|
||||||
|
|
||||||
if (ch != null) {
|
if (ch != null) {
|
||||||
if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN){
|
if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN){
|
||||||
Buff.affect(ch, Levitation.class, 10f);
|
Buff.affect(ch, Levitation.class, Levitation.DURATION/2f);
|
||||||
} else {
|
} else {
|
||||||
Buff.affect(ch, Vertigo.class, Vertigo.DURATION);
|
Buff.affect(ch, Vertigo.class, Vertigo.DURATION);
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,8 +125,8 @@ public class Sungrass extends Plant {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tintIcon(Image icon) {
|
public float iconFadePercent() {
|
||||||
FlavourBuff.greyIcon(icon, target.HT/4f, level);
|
return Math.max(0, (target.HT - level) / target.HT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -80,8 +80,8 @@ public class Swiftthistle extends Plant {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tintIcon(Image icon) {
|
public float iconFadePercent() {
|
||||||
FlavourBuff.greyIcon(icon, 5f, left);
|
return Math.max(0, (6f - left) / 6f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reset(){
|
public void reset(){
|
||||||
|
|
|
@ -197,6 +197,7 @@ public class BuffIndicator extends Component {
|
||||||
private Buff buff;
|
private Buff buff;
|
||||||
|
|
||||||
public Image icon;
|
public Image icon;
|
||||||
|
public Image grey;
|
||||||
|
|
||||||
public BuffIcon( Buff buff ){
|
public BuffIcon( Buff buff ){
|
||||||
super();
|
super();
|
||||||
|
@ -205,18 +206,24 @@ public class BuffIndicator extends Component {
|
||||||
icon = new Image( texture );
|
icon = new Image( texture );
|
||||||
icon.frame( film.get( buff.icon() ) );
|
icon.frame( film.get( buff.icon() ) );
|
||||||
add( icon );
|
add( icon );
|
||||||
|
|
||||||
|
grey = new Image( TextureCache.createSolid(0xCC808080));
|
||||||
|
add( grey );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateIcon(){
|
public void updateIcon(){
|
||||||
icon.frame( film.get( buff.icon() ) );
|
icon.frame( film.get( buff.icon() ) );
|
||||||
buff.tintIcon(icon);
|
buff.tintIcon(icon);
|
||||||
|
//logic here rounds down to the nearest pixel
|
||||||
|
float zoom = (camera() != null) ? camera().zoom : 1;
|
||||||
|
grey.scale.set( icon.width(), (float)Math.floor(zoom*icon.height()*buff.iconFadePercent())/zoom);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void layout() {
|
protected void layout() {
|
||||||
super.layout();
|
super.layout();
|
||||||
icon.x = this.x+1;
|
grey.x = icon.x = this.x+1;
|
||||||
icon.y = this.y+2;
|
grey.y = icon.y = this.y+2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue
Block a user