v0.9.3: fully fixed quickslot visual issues
This commit is contained in:
parent
53f01fcc6a
commit
636e58e490
|
@ -39,7 +39,7 @@ public class Degrade extends FlavourBuff {
|
||||||
@Override
|
@Override
|
||||||
public boolean attachTo(Char target) {
|
public boolean attachTo(Char target) {
|
||||||
if (super.attachTo(target)){
|
if (super.attachTo(target)){
|
||||||
Item.updateQuickslot();
|
Item.updateQuickslot(false);
|
||||||
if (target instanceof Hero) ((Hero) target).updateHT(false);
|
if (target instanceof Hero) ((Hero) target).updateHT(false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ public class Degrade extends FlavourBuff {
|
||||||
public void detach() {
|
public void detach() {
|
||||||
super.detach();
|
super.detach();
|
||||||
if (target instanceof Hero) ((Hero) target).updateHT(false);
|
if (target instanceof Hero) ((Hero) target).updateHT(false);
|
||||||
Item.updateQuickslot();
|
Item.updateQuickslot(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//called in Item.buffedLevel()
|
//called in Item.buffedLevel()
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class ScrollEmpower extends FlavourBuff {
|
||||||
@Override
|
@Override
|
||||||
public void detach() {
|
public void detach() {
|
||||||
super.detach();
|
super.detach();
|
||||||
Item.updateQuickslot();
|
Item.updateQuickslot(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -473,7 +473,11 @@ public class Item implements Bundlable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void updateQuickslot() {
|
public static void updateQuickslot() {
|
||||||
QuickSlotButton.refresh();
|
updateQuickslot(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void updateQuickslot(boolean full) {
|
||||||
|
QuickSlotButton.refresh(full);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String QUANTITY = "quantity";
|
private static final String QUANTITY = "quantity";
|
||||||
|
|
|
@ -168,7 +168,7 @@ public class Waterskin extends Item {
|
||||||
GLog.p( Messages.get(this, "full") );
|
GLog.p( Messages.get(this, "full") );
|
||||||
}
|
}
|
||||||
|
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void fill() {
|
public void fill() {
|
||||||
|
|
|
@ -207,7 +207,7 @@ abstract public class ClassArmor extends Armor {
|
||||||
LockedFloor lock = target.buff(LockedFloor.class);
|
LockedFloor lock = target.buff(LockedFloor.class);
|
||||||
if (lock == null || lock.regenOn()) {
|
if (lock == null || lock.regenOn()) {
|
||||||
charge += 100 / 500f; //500 turns to full charge
|
charge += 100 / 500f; //500 turns to full charge
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
if (charge > 100) {
|
if (charge > 100) {
|
||||||
charge = 100;
|
charge = 100;
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,7 +96,7 @@ public class AlchemistsToolkit extends Artifact {
|
||||||
if (partialCharge >= 1){
|
if (partialCharge >= 1){
|
||||||
partialCharge--;
|
partialCharge--;
|
||||||
charge++;
|
charge++;
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,7 @@ public class AlchemistsToolkit extends Artifact {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ public class AlchemistsToolkit extends Artifact {
|
||||||
partialCharge = 0;
|
partialCharge = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
partialCharge = 0;
|
partialCharge = 0;
|
||||||
|
|
|
@ -53,7 +53,7 @@ public class CapeOfThorns extends Artifact {
|
||||||
public void charge(Hero target, float amount) {
|
public void charge(Hero target, float amount) {
|
||||||
if (cooldown == 0) {
|
if (cooldown == 0) {
|
||||||
charge += Math.round(4*amount);
|
charge += Math.round(4*amount);
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
}
|
}
|
||||||
if (charge >= chargeCap){
|
if (charge >= chargeCap){
|
||||||
target.buff(Thorns.class).proc(0, null, null);
|
target.buff(Thorns.class).proc(0, null, null);
|
||||||
|
@ -83,7 +83,7 @@ public class CapeOfThorns extends Artifact {
|
||||||
if (cooldown == 0) {
|
if (cooldown == 0) {
|
||||||
GLog.w( Messages.get(this, "inert") );
|
GLog.w( Messages.get(this, "inert") );
|
||||||
}
|
}
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
}
|
}
|
||||||
spend(TICK);
|
spend(TICK);
|
||||||
return true;
|
return true;
|
||||||
|
@ -116,7 +116,7 @@ public class CapeOfThorns extends Artifact {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -169,14 +169,14 @@ public class CloakOfShadows extends Artifact {
|
||||||
if (partialCharge >= 1){
|
if (partialCharge >= 1){
|
||||||
partialCharge--;
|
partialCharge--;
|
||||||
charge++;
|
charge++;
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void overCharge(int amount){
|
public void overCharge(int amount){
|
||||||
charge = Math.min(charge+amount, chargeCap+amount);
|
charge = Math.min(charge+amount, chargeCap+amount);
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -239,7 +239,7 @@ public class CloakOfShadows extends Artifact {
|
||||||
if (cooldown > 0)
|
if (cooldown > 0)
|
||||||
cooldown --;
|
cooldown --;
|
||||||
|
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
|
|
||||||
spend( TICK );
|
spend( TICK );
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ public class CloakOfShadows extends Artifact {
|
||||||
}
|
}
|
||||||
turnsToCost = 4;
|
turnsToCost = 4;
|
||||||
}
|
}
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
spend( TICK );
|
spend( TICK );
|
||||||
|
@ -334,7 +334,7 @@ public class CloakOfShadows extends Artifact {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dispel(){
|
public void dispel(){
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
detach();
|
detach();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -360,7 +360,7 @@ public class CloakOfShadows extends Artifact {
|
||||||
|
|
||||||
if (target.invisible > 0) target.invisible--;
|
if (target.invisible > 0) target.invisible--;
|
||||||
|
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
super.detach();
|
super.detach();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -174,7 +174,7 @@ public class DriedRose extends Artifact {
|
||||||
Talent.onArtifactUsed(hero);
|
Talent.onArtifactUsed(hero);
|
||||||
charge = 0;
|
charge = 0;
|
||||||
partialCharge = 0;
|
partialCharge = 0;
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
|
|
||||||
} else
|
} else
|
||||||
GLog.i( Messages.get(this, "no_space") );
|
GLog.i( Messages.get(this, "no_space") );
|
||||||
|
@ -282,12 +282,12 @@ public class DriedRose extends Artifact {
|
||||||
partialCharge = 0;
|
partialCharge = 0;
|
||||||
GLog.p(Messages.get(DriedRose.class, "charged"));
|
GLog.p(Messages.get(DriedRose.class, "charged"));
|
||||||
}
|
}
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int heal = Math.round((1 + level()/3f)*amount);
|
int heal = Math.round((1 + level()/3f)*amount);
|
||||||
ghost.HP = Math.min( ghost.HT, ghost.HP + heal);
|
ghost.HP = Math.min( ghost.HT, ghost.HP + heal);
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -376,7 +376,7 @@ public class DriedRose extends Artifact {
|
||||||
LockedFloor lock = target.buff(LockedFloor.class);
|
LockedFloor lock = target.buff(LockedFloor.class);
|
||||||
if (ghost.HP < ghost.HT && (lock == null || lock.regenOn())) {
|
if (ghost.HP < ghost.HT && (lock == null || lock.regenOn())) {
|
||||||
partialCharge += (ghost.HT / 1000f) * RingOfEnergy.artifactChargeMultiplier(target);
|
partialCharge += (ghost.HT / 1000f) * RingOfEnergy.artifactChargeMultiplier(target);
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
|
|
||||||
if (partialCharge > 1) {
|
if (partialCharge > 1) {
|
||||||
ghost.HP++;
|
ghost.HP++;
|
||||||
|
@ -421,7 +421,7 @@ public class DriedRose extends Artifact {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -667,7 +667,7 @@ public class DriedRose extends Artifact {
|
||||||
super.damage( dmg, src );
|
super.damage( dmg, src );
|
||||||
|
|
||||||
//for the rose status indicator
|
//for the rose status indicator
|
||||||
Item.updateQuickslot();
|
Item.updateQuickslot(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -171,7 +171,7 @@ public class EtherealChains extends Artifact {
|
||||||
} else {
|
} else {
|
||||||
charge -= chargeUse;
|
charge -= chargeUse;
|
||||||
Talent.onArtifactUsed(hero);
|
Talent.onArtifactUsed(hero);
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
hero.busy();
|
hero.busy();
|
||||||
|
@ -228,7 +228,7 @@ public class EtherealChains extends Artifact {
|
||||||
} else {
|
} else {
|
||||||
charge -= chargeUse;
|
charge -= chargeUse;
|
||||||
Talent.onArtifactUsed(hero);
|
Talent.onArtifactUsed(hero);
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
hero.busy();
|
hero.busy();
|
||||||
|
@ -261,7 +261,7 @@ public class EtherealChains extends Artifact {
|
||||||
if (partialCharge >= 1){
|
if (partialCharge >= 1){
|
||||||
partialCharge--;
|
partialCharge--;
|
||||||
charge++;
|
charge++;
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -300,7 +300,7 @@ public class EtherealChains extends Artifact {
|
||||||
charge ++;
|
charge ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
|
|
||||||
spend( TICK );
|
spend( TICK );
|
||||||
|
|
||||||
|
|
|
@ -122,12 +122,13 @@ public class HornOfPlenty extends Artifact {
|
||||||
|
|
||||||
Badges.validateFoodEaten();
|
Badges.validateFoodEaten();
|
||||||
|
|
||||||
|
int oldImage = image;
|
||||||
if (charge >= 15) image = ItemSpriteSheet.ARTIFACT_HORN4;
|
if (charge >= 15) image = ItemSpriteSheet.ARTIFACT_HORN4;
|
||||||
else if (charge >= 10) image = ItemSpriteSheet.ARTIFACT_HORN3;
|
else if (charge >= 10) image = ItemSpriteSheet.ARTIFACT_HORN3;
|
||||||
else if (charge >= 5) image = ItemSpriteSheet.ARTIFACT_HORN2;
|
else if (charge >= 5) image = ItemSpriteSheet.ARTIFACT_HORN2;
|
||||||
else image = ItemSpriteSheet.ARTIFACT_HORN1;
|
else image = ItemSpriteSheet.ARTIFACT_HORN1;
|
||||||
|
|
||||||
updateQuickslot();
|
updateQuickslot( image != oldImage );
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (action.equals(AC_STORE)){
|
} else if (action.equals(AC_STORE)){
|
||||||
|
@ -155,11 +156,13 @@ public class HornOfPlenty extends Artifact {
|
||||||
partialCharge = 0;
|
partialCharge = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int oldImage = image;
|
||||||
if (charge >= 15) image = ItemSpriteSheet.ARTIFACT_HORN4;
|
if (charge >= 15) image = ItemSpriteSheet.ARTIFACT_HORN4;
|
||||||
else if (charge >= 10) image = ItemSpriteSheet.ARTIFACT_HORN3;
|
else if (charge >= 10) image = ItemSpriteSheet.ARTIFACT_HORN3;
|
||||||
else if (charge >= 5) image = ItemSpriteSheet.ARTIFACT_HORN2;
|
else if (charge >= 5) image = ItemSpriteSheet.ARTIFACT_HORN2;
|
||||||
|
else image = ItemSpriteSheet.ARTIFACT_HORN1;
|
||||||
|
|
||||||
updateQuickslot();
|
updateQuickslot( image != oldImage );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -250,17 +253,18 @@ public class HornOfPlenty extends Artifact {
|
||||||
charge++;
|
charge++;
|
||||||
partialCharge -= Hunger.STARVING/10;
|
partialCharge -= Hunger.STARVING/10;
|
||||||
|
|
||||||
|
int oldImage = image;
|
||||||
if (charge >= 15) image = ItemSpriteSheet.ARTIFACT_HORN4;
|
if (charge >= 15) image = ItemSpriteSheet.ARTIFACT_HORN4;
|
||||||
else if (charge >= 10) image = ItemSpriteSheet.ARTIFACT_HORN3;
|
else if (charge >= 10) image = ItemSpriteSheet.ARTIFACT_HORN3;
|
||||||
else if (charge >= 5) image = ItemSpriteSheet.ARTIFACT_HORN2;
|
else if (charge >= 5) image = ItemSpriteSheet.ARTIFACT_HORN2;
|
||||||
else image = ItemSpriteSheet.ARTIFACT_HORN1;
|
else image = ItemSpriteSheet.ARTIFACT_HORN1;
|
||||||
|
|
||||||
|
updateQuickslot( image != oldImage );
|
||||||
|
|
||||||
if (charge == chargeCap){
|
if (charge == chargeCap){
|
||||||
GLog.p( Messages.get(HornOfPlenty.class, "full") );
|
GLog.p( Messages.get(HornOfPlenty.class, "full") );
|
||||||
partialCharge = 0;
|
partialCharge = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateQuickslot();
|
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
partialCharge = 0;
|
partialCharge = 0;
|
||||||
|
|
|
@ -201,7 +201,7 @@ public class LloydsBeacon extends Artifact {
|
||||||
|
|
||||||
Invisibility.dispel();
|
Invisibility.dispel();
|
||||||
charge -= Dungeon.depth > 20 ? 2 : 1;
|
charge -= Dungeon.depth > 20 ? 2 : 1;
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
|
|
||||||
if (Actor.findChar(target) == curUser){
|
if (Actor.findChar(target) == curUser){
|
||||||
ScrollOfTeleportation.teleportHero(curUser);
|
ScrollOfTeleportation.teleportHero(curUser);
|
||||||
|
@ -330,7 +330,7 @@ public class LloydsBeacon extends Artifact {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
spend( TICK );
|
spend( TICK );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class MasterThievesArmband extends Artifact {
|
||||||
@Override
|
@Override
|
||||||
public void charge(Hero target, float amount) {
|
public void charge(Hero target, float amount) {
|
||||||
charge += Math.round(10*amount);
|
charge += Math.round(10*amount);
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -93,7 +93,7 @@ public class SandalsOfNature extends Artifact {
|
||||||
Camera.main.shake(1, 0.4f);
|
Camera.main.shake(1, 0.4f);
|
||||||
charge = 0;
|
charge = 0;
|
||||||
Talent.onArtifactUsed(Dungeon.hero);
|
Talent.onArtifactUsed(Dungeon.hero);
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -185,7 +185,7 @@ public class SandalsOfNature extends Artifact {
|
||||||
charge++;
|
charge++;
|
||||||
partialCharge--;
|
partialCharge--;
|
||||||
}
|
}
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,7 +197,7 @@ public class TalismanOfForesight extends Artifact {
|
||||||
upgrade();
|
upgrade();
|
||||||
GLog.p( Messages.get(TalismanOfForesight.class, "levelup") );
|
GLog.p( Messages.get(TalismanOfForesight.class, "levelup") );
|
||||||
}
|
}
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
|
|
||||||
//5 charge at 2 tiles, up to 30 charge at 25 tiles
|
//5 charge at 2 tiles, up to 30 charge at 25 tiles
|
||||||
charge -= 3 + dist*1.08f;
|
charge -= 3 + dist*1.08f;
|
||||||
|
@ -211,7 +211,7 @@ public class TalismanOfForesight extends Artifact {
|
||||||
partialCharge--;
|
partialCharge--;
|
||||||
}
|
}
|
||||||
Talent.onArtifactUsed(Dungeon.hero);
|
Talent.onArtifactUsed(Dungeon.hero);
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
Dungeon.observe();
|
Dungeon.observe();
|
||||||
Dungeon.hero.checkVisibleMobs();
|
Dungeon.hero.checkVisibleMobs();
|
||||||
GameScene.updateFog();
|
GameScene.updateFog();
|
||||||
|
@ -311,7 +311,7 @@ public class TalismanOfForesight extends Artifact {
|
||||||
if (partialCharge > 1 && charge < chargeCap) {
|
if (partialCharge > 1 && charge < chargeCap) {
|
||||||
partialCharge--;
|
partialCharge--;
|
||||||
charge++;
|
charge++;
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
} else if (charge >= chargeCap) {
|
} else if (charge >= chargeCap) {
|
||||||
partialCharge = 0;
|
partialCharge = 0;
|
||||||
GLog.p( Messages.get(TalismanOfForesight.class, "full_charge") );
|
GLog.p( Messages.get(TalismanOfForesight.class, "full_charge") );
|
||||||
|
|
|
@ -150,7 +150,7 @@ public class TimekeepersHourglass extends Artifact {
|
||||||
if (partialCharge >= 1){
|
if (partialCharge >= 1){
|
||||||
partialCharge--;
|
partialCharge--;
|
||||||
charge++;
|
charge++;
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -234,7 +234,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 );
|
||||||
|
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
|
|
||||||
spend( TICK );
|
spend( TICK );
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ public class TimekeepersHourglass extends Artifact {
|
||||||
|
|
||||||
target.invisible++;
|
target.invisible++;
|
||||||
|
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
|
|
||||||
Dungeon.observe();
|
Dungeon.observe();
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ public class TimekeepersHourglass extends Artifact {
|
||||||
charge --;
|
charge --;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
|
|
||||||
if (charge < 0){
|
if (charge < 0){
|
||||||
charge = 0;
|
charge = 0;
|
||||||
|
@ -341,7 +341,7 @@ public class TimekeepersHourglass extends Artifact {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void detach(){
|
public void detach(){
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
super.detach();
|
super.detach();
|
||||||
activeBuff = null;
|
activeBuff = null;
|
||||||
triggerPresses();
|
triggerPresses();
|
||||||
|
|
|
@ -168,7 +168,7 @@ public class UnstableSpellbook extends Artifact {
|
||||||
scroll.doRead();
|
scroll.doRead();
|
||||||
Talent.onArtifactUsed(Dungeon.hero);
|
Talent.onArtifactUsed(Dungeon.hero);
|
||||||
}
|
}
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (action.equals( AC_ADD )) {
|
} else if (action.equals( AC_ADD )) {
|
||||||
|
@ -222,7 +222,7 @@ public class UnstableSpellbook extends Artifact {
|
||||||
if (partialCharge >= 1){
|
if (partialCharge >= 1){
|
||||||
partialCharge--;
|
partialCharge--;
|
||||||
charge++;
|
charge++;
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -297,7 +297,7 @@ public class UnstableSpellbook extends Artifact {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
|
|
||||||
spend( TICK );
|
spend( TICK );
|
||||||
|
|
||||||
|
|
|
@ -334,7 +334,7 @@ public class Potion extends Item {
|
||||||
if (!anonymous) {
|
if (!anonymous) {
|
||||||
if (!isKnown()) {
|
if (!isKnown()) {
|
||||||
handler.know(this);
|
handler.know(this);
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
Potion p = Dungeon.hero.belongings.getItem(getClass());
|
Potion p = Dungeon.hero.belongings.getItem(getClass());
|
||||||
if (p != null) p.setAction();
|
if (p != null) p.setAction();
|
||||||
if (ExoticPotion.regToExo.get(getClass()) != null) {
|
if (ExoticPotion.regToExo.get(getClass()) != null) {
|
||||||
|
|
|
@ -98,7 +98,7 @@ public class ExoticPotion extends Potion {
|
||||||
public void setKnown() {
|
public void setKnown() {
|
||||||
if (!isKnown()) {
|
if (!isKnown()) {
|
||||||
handler.know(exoToReg.get(this.getClass()));
|
handler.know(exoToReg.get(this.getClass()));
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
Potion p = Dungeon.hero.belongings.getItem(getClass());
|
Potion p = Dungeon.hero.belongings.getItem(getClass());
|
||||||
if (p != null) p.setAction();
|
if (p != null) p.setAction();
|
||||||
p = Dungeon.hero.belongings.getItem(exoToReg.get(this.getClass()));
|
p = Dungeon.hero.belongings.getItem(exoToReg.get(this.getClass()));
|
||||||
|
|
|
@ -162,7 +162,7 @@ public class Pickaxe extends Weapon {
|
||||||
protected boolean act() {
|
protected boolean act() {
|
||||||
if (!defender.isAlive()){
|
if (!defender.isAlive()){
|
||||||
bloodStained = true;
|
bloodStained = true;
|
||||||
updateQuickslot();
|
updateQuickslot(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Actor.remove(this);
|
Actor.remove(this);
|
||||||
|
|
|
@ -160,7 +160,7 @@ public abstract class Wand extends Item {
|
||||||
if (overcharge) curCharges = Math.min(maxCharges+(int)amt, curCharges+1);
|
if (overcharge) curCharges = Math.min(maxCharges+(int)amt, curCharges+1);
|
||||||
else curCharges = Math.min(maxCharges, curCharges+1);
|
else curCharges = Math.min(maxCharges, curCharges+1);
|
||||||
partialCharge--;
|
partialCharge--;
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -581,7 +581,7 @@ public abstract class Wand extends Item {
|
||||||
while (partialCharge >= 1 && curCharges < maxCharges) {
|
while (partialCharge >= 1 && curCharges < maxCharges) {
|
||||||
partialCharge--;
|
partialCharge--;
|
||||||
curCharges++;
|
curCharges++;
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (curCharges == maxCharges){
|
if (curCharges == maxCharges){
|
||||||
|
@ -623,7 +623,7 @@ public abstract class Wand extends Item {
|
||||||
partialCharge--;
|
partialCharge--;
|
||||||
}
|
}
|
||||||
curCharges = Math.min(curCharges, maxCharges);
|
curCharges = Math.min(curCharges, maxCharges);
|
||||||
updateQuickslot();
|
updateQuickslot(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ public class WandOfMagicMissile extends DamageWand {
|
||||||
@Override
|
@Override
|
||||||
public void detach() {
|
public void detach() {
|
||||||
super.detach();
|
super.detach();
|
||||||
QuickSlotButton.refresh();
|
QuickSlotButton.refresh(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int level(){
|
public int level(){
|
||||||
|
|
|
@ -183,11 +183,7 @@ public class QuickSlotButton extends Button implements WndBag.Listener {
|
||||||
public void onSelect( Item item ) {
|
public void onSelect( Item item ) {
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
Dungeon.quickslot.setSlot( slotNum , item );
|
Dungeon.quickslot.setSlot( slotNum , item );
|
||||||
for (int i = 0; i < instance.length; i++) {
|
refresh(false);
|
||||||
if (instance[i] != null) {
|
|
||||||
instance[i].item(select(i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -261,9 +257,17 @@ public class QuickSlotButton extends Button implements WndBag.Listener {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void refresh() {
|
public static void refresh() {
|
||||||
|
refresh(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void refresh( boolean full ) {
|
||||||
for (int i = 0; i < instance.length; i++) {
|
for (int i = 0; i < instance.length; i++) {
|
||||||
if (instance[i] != null) {
|
if (instance[i] != null) {
|
||||||
instance[i].slot.updateText();
|
if (full) {
|
||||||
|
instance[i].item(select(i));
|
||||||
|
} else {
|
||||||
|
instance[i].slot.updateText();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user