本文整理匯總了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 );
}