v0.9.2: fixed two crash bugs caused by new talents

This commit is contained in:
Evan Debenham 2021-02-14 11:44:14 -05:00
parent 58ce8c5275
commit df0528721e
2 changed files with 7 additions and 5 deletions

View File

@ -304,11 +304,11 @@ public abstract class Wand extends Item {
public int buffedLvl() {
int lvl = super.buffedLvl();
if (charger.target.buff(Talent.EmpoweringScrollsTracker.class) != null){
lvl += Dungeon.hero.pointsInTalent(Talent.EMPOWERING_SCROLLS);
}
if (charger != null && charger.target != null) {
if (charger.target.buff(Talent.EmpoweringScrollsTracker.class) != null){
lvl += Dungeon.hero.pointsInTalent(Talent.EMPOWERING_SCROLLS);
}
WandOfMagicMissile.MagicCharge buff = charger.target.buff(WandOfMagicMissile.MagicCharge.class);
if (buff != null && buff.level() > lvl){
return buff.level();

View File

@ -351,7 +351,9 @@ abstract public class Weapon extends KindOfWeapon {
float multi = 1f;
if (attacker instanceof Hero && ((Hero) attacker).hasTalent(Talent.ENRAGED_CATALYST)){
Berserk rage = attacker.buff(Berserk.class);
multi += 0.2f*rage.rageAmount()*((Hero) attacker).pointsInTalent(Talent.ENRAGED_CATALYST);
if (rage != null) {
multi += 0.2f * rage.rageAmount() * ((Hero) attacker).pointsInTalent(Talent.ENRAGED_CATALYST);
}
}
return multi;
}