v2.1.3: cleaned up logic for checking the degradation debuff slightly
This commit is contained in:
@@ -356,7 +356,9 @@ public class Item implements Bundlable {
|
|||||||
//returns the level of the item, after it may have been modified by temporary boosts/reductions
|
//returns the level of the item, after it may have been modified by temporary boosts/reductions
|
||||||
//note that not all item properties should care about buffs/debuffs! (e.g. str requirement)
|
//note that not all item properties should care about buffs/debuffs! (e.g. str requirement)
|
||||||
public int buffedLvl(){
|
public int buffedLvl(){
|
||||||
if (Dungeon.hero.buff( Degrade.class ) != null) {
|
//only the hero can be affected by Degradation
|
||||||
|
if (Dungeon.hero.buff( Degrade.class ) != null
|
||||||
|
&& (isEquipped( Dungeon.hero ) || Dungeon.hero.belongings.contains( this ))) {
|
||||||
return Degrade.reduceLevel(level());
|
return Degrade.reduceLevel(level());
|
||||||
} else {
|
} else {
|
||||||
return level();
|
return level();
|
||||||
|
|||||||
@@ -388,16 +388,6 @@ public class Armor extends EquipableItem {
|
|||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
|
|
||||||
//other things can equip these, for now we assume only the hero can be affected by levelling debuffs
|
|
||||||
@Override
|
|
||||||
public int buffedLvl() {
|
|
||||||
if (isEquipped( Dungeon.hero ) || Dungeon.hero.belongings.contains( this )){
|
|
||||||
return super.buffedLvl();
|
|
||||||
} else {
|
|
||||||
return level();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item upgrade() {
|
public Item upgrade() {
|
||||||
return upgrade( false );
|
return upgrade( false );
|
||||||
|
|||||||
@@ -257,16 +257,6 @@ abstract public class Weapon extends KindOfWeapon {
|
|||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
|
|
||||||
//overrides as other things can equip these
|
|
||||||
@Override
|
|
||||||
public int buffedLvl() {
|
|
||||||
if (isEquipped( Dungeon.hero ) || Dungeon.hero.belongings.contains( this )){
|
|
||||||
return super.buffedLvl();
|
|
||||||
} else {
|
|
||||||
return level();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item upgrade() {
|
public Item upgrade() {
|
||||||
return upgrade(false);
|
return upgrade(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user