本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CapeOfThorns类的典型用法代码示例。如果您正苦于以下问题:Java CapeOfThorns类的具体用法?Java CapeOfThorns怎么用?Java CapeOfThorns使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CapeOfThorns类属于com.shatteredpixel.shatteredpixeldungeon.items.artifacts包,在下文中一共展示了CapeOfThorns类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: defenseProc
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CapeOfThorns; //导入依赖的package包/类
@Override
public int defenseProc( Char enemy, int damage ) {
CapeOfThorns.Thorns thorns = buff( CapeOfThorns.Thorns.class );
if (thorns != null) {
damage = thorns.proc(damage, enemy);
}
Earthroot.Armor armor = buff( Earthroot.Armor.class );
if (armor != null) {
damage = armor.absorb( damage );
}
Sungrass.Health health = buff( Sungrass.Health.class );
if (health != null) {
health.absorb( damage );
}
if (belongings.armor != null) {
damage = belongings.armor.proc( enemy, this, damage );
}
return damage;
}
示例2: damage
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CapeOfThorns; //导入依赖的package包/类
@Override
public void damage( int dmg, Object src ) {
if (buff(TimekeepersHourglass.timeStasis.class) != null)
return;
if (!(src instanceof Hunger || src instanceof Viscosity.DeferedDamage) && damageInterrupt) {
interrupt();
resting = false;
}
if (this.buff(Drowsy.class) != null){
Buff.detach(this, Drowsy.class);
GLog.w( Messages.get(this, "pain_resist") );
}
CapeOfThorns.Thorns thorns = buff( CapeOfThorns.Thorns.class );
if (thorns != null) {
dmg = thorns.proc(dmg, (src instanceof Char ? (Char)src : null), this);
}
dmg = (int)Math.ceil(dmg * RingOfTenacity.damageMultiplier( this ));
//TODO improve this when I have proper damage source logic
if (belongings.armor != null && belongings.armor.hasGlyph(AntiMagic.class)
&& RingOfElements.FULL.contains(src.getClass())){
dmg -= Random.NormalIntRange(belongings.armor.DRMin(), belongings.armor.DRMax())/3;
}
if (subClass == HeroSubClass.BERSERKER && berserk == null){
berserk = Buff.affect(this, Berserk.class);
}
super.damage( dmg, src );
}