@Override public int price() { return 6 * tier * quantity * (level() + 1); }
@Override public int price() { return 6 * tier * quantity * (level() + 1); }
protected float durabilityPerUse(){ float usages = baseUses * (float)(Math.pow(3, level())); if (Dungeon.hero.heroClass == HeroClass.HUNTRESS) usages *= 1.5f; if (holster) usages *= MagicalHolster.HOLSTER_DURABILITY_FACTOR; usages *= RingOfSharpshooting.durabilityMultiplier( Dungeon.hero ); //at 100 uses, items just last forever. if (usages >= 100f) return 0; //add a tiny amount to account for rounding error for calculations like 1/3 return (MAX_DURABILITY/usages) + 0.001f; }
protected float durabilityPerUse(){ float usages = baseUses * (float)(Math.pow(3, level())); if (Dungeon.hero.heroClass == HeroClass.HUNTRESS) usages *= 1.5f; if (holster) usages *= MagicalHolster.HOLSTER_DURABILITY_FACTOR; usages *= RingOfSharpshooting.durabilityMultiplier( Dungeon.hero ); //at 100 uses, items just last forever. if (usages >= 100f) return 0; //add a tiny amount to account for rounding error for calculations like 1/3 return (MAX_DURABILITY/usages) + 0.001f; }
@Override public int min() { return Math.max(0, min( level() + RingOfSharpshooting.levelDamageBonus(Dungeon.hero) )); }
@Override public int max() { return Math.max(0, max( level() + RingOfSharpshooting.levelDamageBonus(Dungeon.hero) )); }
@Override public int min() { return Math.max(0, min( level() + RingOfSharpshooting.levelDamageBonus(Dungeon.hero) )); }
@Override public int max() { return Math.max(0, max( level() + RingOfSharpshooting.levelDamageBonus(Dungeon.hero) )); }
parent.durability -= parent.durabilityPerUse(); if (parent.durability > 0 && parent.durability <= parent.durabilityPerUse()){ if (level() <= 0)GLog.w(Messages.get(this, "about_to_break")); else GLog.n(Messages.get(this, "about_to_break")); durability -= durabilityPerUse(); if (durability > 0 && durability <= durabilityPerUse()){ if (level() <= 0)GLog.w(Messages.get(this, "about_to_break")); else GLog.n(Messages.get(this, "about_to_break"));
parent.durability -= parent.durabilityPerUse(); if (parent.durability > 0 && parent.durability <= parent.durabilityPerUse()){ if (level() <= 0)GLog.w(Messages.get(this, "about_to_break")); else GLog.n(Messages.get(this, "about_to_break")); durability -= durabilityPerUse(); if (durability > 0 && durability <= durabilityPerUse()){ if (level() <= 0)GLog.w(Messages.get(this, "about_to_break")); else GLog.n(Messages.get(this, "about_to_break"));