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