v0.2.3f: corrected quickslot refresh logic across items
This commit is contained in:
parent
6a0776afcc
commit
9d90a24a95
src/com/shatteredpixel/shatteredpixeldungeon/items
|
@ -21,7 +21,6 @@ import java.util.ArrayList;
|
|||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
|
@ -109,7 +108,7 @@ public class DewVial extends Item {
|
|||
Sample.INSTANCE.play( Assets.SND_DRINK );
|
||||
hero.sprite.operate( hero.pos );
|
||||
|
||||
QuickSlotButton.refresh();
|
||||
updateQuickslot();
|
||||
|
||||
|
||||
} else {
|
||||
|
@ -123,7 +122,7 @@ public class DewVial extends Item {
|
|||
}
|
||||
}
|
||||
|
||||
public void empty() {volume = 0; QuickSlotButton.refresh();}
|
||||
public void empty() {volume = 0; updateQuickslot();}
|
||||
|
||||
@Override
|
||||
public boolean isUpgradable() {
|
||||
|
@ -148,15 +147,15 @@ public class DewVial extends Item {
|
|||
GLog.p( TXT_FULL );
|
||||
}
|
||||
|
||||
QuickSlotButton.refresh();
|
||||
updateQuickslot();
|
||||
}
|
||||
|
||||
public void fill() {
|
||||
volume = MAX_VOLUME;
|
||||
QuickSlotButton.refresh();
|
||||
updateQuickslot();
|
||||
}
|
||||
|
||||
//removed as people need a bigger distinction to realize the dew vial doesn't revive.
|
||||
//removed as people need a bigger distinction to realize the dew vial doesn't revive.
|
||||
/*
|
||||
private static final Glowing WHITE = new Glowing( 0xFFFFCC );
|
||||
|
||||
|
|
|
@ -180,7 +180,7 @@ public class Item implements Bundlable {
|
|||
|
||||
items.add( this );
|
||||
Dungeon.quickslot.replaceSimilar(this);
|
||||
QuickSlotButton.refresh();
|
||||
updateQuickslot();
|
||||
Collections.sort( items, itemComparator );
|
||||
return true;
|
||||
|
||||
|
@ -235,9 +235,9 @@ public class Item implements Bundlable {
|
|||
|
||||
public final Item detachAll( Bag container ) {
|
||||
Dungeon.quickslot.clearItem( this );
|
||||
QuickSlotButton.refresh();
|
||||
updateQuickslot();
|
||||
|
||||
for (Item item : container.items) {
|
||||
for (Item item : container.items) {
|
||||
if (item == this) {
|
||||
container.items.remove(this);
|
||||
item.onDetach();
|
||||
|
@ -399,7 +399,7 @@ public class Item implements Bundlable {
|
|||
|
||||
public void updateQuickslot() {
|
||||
if (Dungeon.quickslot.contains( this )) {
|
||||
QuickSlotButton.refresh();
|
||||
updateQuickslot();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.ArrayList;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
|
@ -60,8 +59,8 @@ public class KindOfWeapon extends EquipableItem {
|
|||
|
||||
hero.belongings.weapon = this;
|
||||
activate( hero );
|
||||
|
||||
QuickSlotButton.refresh();
|
||||
|
||||
updateQuickslot();
|
||||
|
||||
cursedKnown = true;
|
||||
if (cursed) {
|
||||
|
|
|
@ -4,7 +4,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
|
@ -60,7 +59,7 @@ public class CapeOfThorns extends Artifact {
|
|||
BuffIndicator.refreshHero();
|
||||
GLog.w("Your Cape becomes inert again.");
|
||||
}
|
||||
QuickSlotButton.refresh();
|
||||
updateQuickslot();
|
||||
}
|
||||
spend(TICK);
|
||||
return true;
|
||||
|
@ -92,7 +91,7 @@ public class CapeOfThorns extends Artifact {
|
|||
}
|
||||
|
||||
}
|
||||
QuickSlotButton.refresh();
|
||||
updateQuickslot();
|
||||
return damage;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.noosa.tweeners.AlphaTweener;
|
||||
|
@ -185,7 +184,7 @@ public class CloakOfShadows extends Artifact {
|
|||
if (cooldown > 0)
|
||||
cooldown --;
|
||||
|
||||
QuickSlotButton.refresh();
|
||||
updateQuickslot();
|
||||
|
||||
spend( TICK );
|
||||
|
||||
|
@ -227,7 +226,7 @@ public class CloakOfShadows extends Artifact {
|
|||
GLog.p("Your Cloak Grows Stronger!");
|
||||
}
|
||||
|
||||
QuickSlotButton.refresh();
|
||||
updateQuickslot();
|
||||
|
||||
spend( TICK );
|
||||
|
||||
|
@ -247,7 +246,7 @@ public class CloakOfShadows extends Artifact {
|
|||
cooldown = 10 - (level / 3);
|
||||
|
||||
|
||||
QuickSlotButton.refresh();
|
||||
updateQuickslot();
|
||||
super.detach();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.GhostSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndQuest;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
|
@ -106,6 +105,8 @@ public class DriedRose extends Artifact {
|
|||
|
||||
spawned = true;
|
||||
charge = 0;
|
||||
updateQuickslot();
|
||||
|
||||
} else
|
||||
GLog.i("There is no free space near you.");
|
||||
}
|
||||
|
@ -211,7 +212,7 @@ public class DriedRose extends Artifact {
|
|||
|
||||
}
|
||||
|
||||
QuickSlotButton.refresh();
|
||||
updateQuickslot();
|
||||
|
||||
spend( TICK );
|
||||
|
||||
|
|
|
@ -175,6 +175,8 @@ public class HornOfPlenty extends Artifact {
|
|||
GLog.p("Your horn is full of food!");
|
||||
partialCharge = 0;
|
||||
}
|
||||
|
||||
updateQuickslot();
|
||||
}
|
||||
} else
|
||||
partialCharge = 0;
|
||||
|
|
|
@ -74,6 +74,7 @@ public class SandalsOfNature extends Artifact {
|
|||
CellEmitter.bottom(hero.pos).start(EarthParticle.FACTORY, 0.05f, 8);
|
||||
Camera.main.shake(1, 0.4f);
|
||||
charge = 0;
|
||||
updateQuickslot();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -177,6 +178,7 @@ public class SandalsOfNature extends Artifact {
|
|||
if (charge < target.HT){
|
||||
//gain 1+(1*level)% of the difference between current charge and max HP.
|
||||
charge+= (Math.round( (target.HT-charge) * (.01+ level*0.01) ));
|
||||
updateQuickslot();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
|
@ -202,7 +201,7 @@ public class TimekeepersHourglass extends Artifact {
|
|||
} else if (cursed && Random.Int(10) == 0)
|
||||
((Hero) target).spend( TICK );
|
||||
|
||||
QuickSlotButton.refresh();
|
||||
updateQuickslot();
|
||||
|
||||
spend( TICK );
|
||||
|
||||
|
@ -226,7 +225,7 @@ public class TimekeepersHourglass extends Artifact {
|
|||
|
||||
target.invisible++;
|
||||
|
||||
QuickSlotButton.refresh();
|
||||
updateQuickslot();
|
||||
|
||||
Dungeon.observe();
|
||||
|
||||
|
@ -263,7 +262,7 @@ public class TimekeepersHourglass extends Artifact {
|
|||
charge --;
|
||||
}
|
||||
|
||||
QuickSlotButton.refresh();
|
||||
updateQuickslot();
|
||||
|
||||
if (charge <= 0){
|
||||
detach();
|
||||
|
@ -302,7 +301,7 @@ public class TimekeepersHourglass extends Artifact {
|
|||
GameScene.freezeEmitters = false;
|
||||
|
||||
charge = 0;
|
||||
QuickSlotButton.refresh();
|
||||
updateQuickslot();
|
||||
super.detach();
|
||||
activeBuff = null;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMappi
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRemoveCurse;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
|
@ -197,7 +196,7 @@ public class UnstableSpellbook extends Artifact {
|
|||
}
|
||||
}
|
||||
|
||||
QuickSlotButton.refresh();
|
||||
updateQuickslot();
|
||||
|
||||
spend( TICK );
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user