v0.9.3: fixed blocking enchant and barkskin only applying to the hero

(barkskin is currently only applied to the hero but there's no reason it can't be more generic)
This commit is contained in:
Evan Debenham 2021-04-10 21:19:09 -04:00
parent f78f0e24f4
commit 3429381d2a
2 changed files with 8 additions and 6 deletions

View File

@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Electricity;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Adrenaline;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ArcaneArmor;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barkskin;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bleeding;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bless;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
@ -75,6 +76,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfFireblast;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfFrost;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfLightning;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Blazing;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Blocking;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Grim;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Shocking;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon;
@ -288,6 +290,12 @@ public abstract class Char extends Actor {
} else if (hit( this, enemy, false )) {
int dr = enemy.drRoll();
Barkskin bark = buff(Barkskin.class);
if (bark != null) dr += Random.NormalIntRange( 0 , bark.level() );
Blocking.BlockBuff block = buff(Blocking.BlockBuff.class);
if (block != null) dr += block.blockingRoll();
if (this instanceof Hero){
Hero h = (Hero)this;

View File

@ -97,7 +97,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMappi
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfLivingEarth;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Blocking;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Flail;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon;
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
@ -475,11 +474,6 @@ public class Hero extends Char {
}
if (wepDr > 0) dr += wepDr;
}
Barkskin bark = buff(Barkskin.class);
if (bark != null) dr += Random.NormalIntRange( 0 , bark.level() );
Blocking.BlockBuff block = buff(Blocking.BlockBuff.class);
if (block != null) dr += block.blockingRoll();
if (buff(HoldFast.class) != null){
dr += Random.NormalIntRange(0, 2*pointsInTalent(Talent.HOLD_FAST));