use of com.nyrds.pixeldungeon.items.chaos.IChaosItem in project pixel-dungeon-remix by NYRDS.
the class Hero method attackProc.
@Override
public int attackProc(@NonNull Char enemy, int damage) {
KindOfWeapon wep = rangedWeapon != null ? rangedWeapon : belongings.weapon;
if (wep != null) {
wep.proc(this, enemy, damage);
switch(subClass) {
case GLADIATOR:
if (wep instanceof MeleeWeapon) {
damage += Buff.affect(this, Combo.class).hit(enemy, damage);
}
break;
case BATTLEMAGE:
if (wep instanceof Wand) {
Wand wand = (Wand) wep;
if (wand.curCharges() < wand.maxCharges() && damage > 0) {
wand.curCharges(wand.curCharges() + 1);
QuickSlot.refresh();
ScrollOfRecharging.charge(this);
}
damage += wand.curCharges();
}
break;
case SNIPER:
if (rangedWeapon != null) {
Buff.prolong(enemy, SnipersMark.class, attackDelay() * 1.1f);
}
break;
case SHAMAN:
if (wep instanceof Wand) {
Wand wand = (Wand) wep;
if (wand.affectTarget()) {
if (Random.Int(4) == 0) {
wand.zap(enemy.getPos());
}
}
}
break;
default:
}
}
for (Item item : belongings) {
if (item instanceof IChaosItem && item.isEquipped(this)) {
((IChaosItem) item).ownerDoesDamage(this, damage);
}
}
return damage;
}
use of com.nyrds.pixeldungeon.items.chaos.IChaosItem in project pixel-dungeon-remix by NYRDS.
the class Hero method damage.
@Override
public void damage(int dmg, Object src) {
restoreHealth = false;
super.damage(dmg, src);
checkIfFurious();
interrupt();
if (belongings.armor instanceof SpiderArmor) {
// Armor proc
if (Random.Int(100) < 50) {
GameScene.add(Blob.seed(getPos(), Random.Int(5, 7), Web.class));
}
}
for (Item item : belongings) {
if (item instanceof IChaosItem && item.isEquipped(this)) {
if (!(src instanceof Hunger)) {
((IChaosItem) item).ownerTakesDamage(dmg);
}
}
}
}
Aggregations