v2.1.3: cleaned up logic for checking the degradation debuff slightly

This commit is contained in:
Evan Debenham
2023-06-22 12:38:09 -04:00
parent ac475ffe03
commit 1ec5434c11
3 changed files with 3 additions and 21 deletions

View File

@@ -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
//note that not all item properties should care about buffs/debuffs! (e.g. str requirement)
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());
} else {
return level();

View File

@@ -388,16 +388,6 @@ public class Armor extends EquipableItem {
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
public Item upgrade() {
return upgrade( false );

View File

@@ -257,16 +257,6 @@ abstract public class Weapon extends KindOfWeapon {
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
public Item upgrade() {
return upgrade(false);