Advertisement
Guest User

PotionOfInvisibility.java

a guest
Oct 6th, 2013
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.70 KB | None | 0 0
  1. package com.watabou.pixeldungeon.items.potions;
  2.  
  3. import com.watabou.noosa.Group;
  4. import com.watabou.noosa.audio.Sample;
  5. import com.watabou.noosa.tweeners.AlphaTweener;
  6. import com.watabou.pixeldungeon.actors.Char;
  7. import com.watabou.pixeldungeon.actors.buffs.Buff;
  8. import com.watabou.pixeldungeon.actors.buffs.Invisibility;
  9. import com.watabou.pixeldungeon.actors.hero.Hero;
  10. import com.watabou.pixeldungeon.sprites.CharSprite;
  11. import com.watabou.pixeldungeon.utils.GLog;
  12.  
  13. public class PotionOfInvisibility extends Potion
  14. {
  15.   private static final float ALPHA = 0.4F;
  16.  
  17.   public PotionOfInvisibility()
  18.   {
  19.     this.name = "Potion of Invisibility";
  20.   }
  21.  
  22.   public static void melt(Char paramChar)
  23.   {
  24.     if (paramChar.sprite.parent != null)
  25.     {
  26.       paramChar.sprite.parent.add(new AlphaTweener(paramChar.sprite, 0.4F, 0.4F));
  27.       return;
  28.     }
  29.     paramChar.sprite.alpha(0.4F);
  30.   }
  31.  
  32.   protected void apply(Hero paramHero)
  33.   {
  34.     setKnown();
  35.     Buff.affect(paramHero, Invisibility.class, 15.0F);
  36.     GLog.i("You see your hands turn invisible!", new Object[0]);
  37.     Sample.INSTANCE.play("snd_meld.mp3");
  38.   }
  39.  
  40.   public String desc()
  41.   {
  42.     return "Drinking this potion will render you temporarily invisible. While invisible, enemies will be unable to see you. Attacking an enemy, as well as using a wand or a scroll before enemy's eyes, will dispel the effect.";
  43.   }
  44.  
  45.   public int price()
  46.   {
  47.     if (isKnown())
  48.       return 40 * this.quantity;
  49.     return super.price();
  50.   }
  51. }
  52.  
  53. /* Location:           C:\Users\Hermans\Desktop\Pixel Dungeon Decompilation\classes-dex2jar.jar
  54.  * Qualified Name:     com.watabou.pixeldungeon.items.potions.PotionOfInvisibility
  55.  * JD-Core Version:    0.6.2
  56.  */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement