v2.0.0: fixed some upgrade effects not working with twin upgrades
This commit is contained in:
+12
-5
@@ -245,18 +245,25 @@ public class MeleeWeapon extends Weapon {
|
|||||||
return STRReq(tier, lvl);
|
return STRReq(tier, lvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean evaluatingTwinUpgrades = false;
|
||||||
@Override
|
@Override
|
||||||
public int buffedLvl() {
|
public int buffedLvl() {
|
||||||
if (isEquipped(Dungeon.hero) && Dungeon.hero.hasTalent(Talent.TWIN_UPGRADES)){
|
if (!evaluatingTwinUpgrades && isEquipped(Dungeon.hero) && Dungeon.hero.hasTalent(Talent.TWIN_UPGRADES)){
|
||||||
KindOfWeapon other = null;
|
KindOfWeapon other = null;
|
||||||
if (Dungeon.hero.belongings.weapon() != this) other = Dungeon.hero.belongings.weapon();
|
if (Dungeon.hero.belongings.weapon() != this) other = Dungeon.hero.belongings.weapon();
|
||||||
if (Dungeon.hero.belongings.secondWep() != this) other = Dungeon.hero.belongings.secondWep();
|
if (Dungeon.hero.belongings.secondWep() != this) other = Dungeon.hero.belongings.secondWep();
|
||||||
|
|
||||||
|
if (other instanceof MeleeWeapon) {
|
||||||
|
evaluatingTwinUpgrades = true;
|
||||||
|
int otherLevel = other.buffedLvl();
|
||||||
|
evaluatingTwinUpgrades = false;
|
||||||
|
|
||||||
//weaker weapon needs to be 2/1/0 tiers lower, based on talent level
|
//weaker weapon needs to be 2/1/0 tiers lower, based on talent level
|
||||||
if (other instanceof MeleeWeapon
|
if ((tier + (3 - Dungeon.hero.pointsInTalent(Talent.TWIN_UPGRADES))) <= ((MeleeWeapon) other).tier
|
||||||
&& (tier+(3-Dungeon.hero.pointsInTalent(Talent.TWIN_UPGRADES))) <= ((MeleeWeapon) other).tier
|
&& otherLevel > super.buffedLvl()) {
|
||||||
&& other.level() > super.buffedLvl()){
|
return otherLevel;
|
||||||
return other.level();
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return super.buffedLvl();
|
return super.buffedLvl();
|
||||||
|
|||||||
Reference in New Issue
Block a user