v0.8.0: refactored how rings deal with degraded debuff.
Degraded no longer affects missile durability from sharpshooting Degraded no longer affects str gained from might
This commit is contained in:
parent
15879eafc8
commit
fbb62337fe
|
@ -630,7 +630,7 @@ public abstract class Mob extends Char {
|
|||
}
|
||||
|
||||
//ring of wealth logic
|
||||
if (Ring.getBonus(Dungeon.hero, RingOfWealth.Wealth.class) > 0) {
|
||||
if (Ring.getBuffedBonus(Dungeon.hero, RingOfWealth.Wealth.class) > 0) {
|
||||
int rolls = 1;
|
||||
if (properties.contains(Property.BOSS)) rolls = 15;
|
||||
else if (properties.contains(Property.MINIBOSS)) rolls = 5;
|
||||
|
|
|
@ -310,7 +310,23 @@ public class Ring extends KindofMisc {
|
|||
return bonus;
|
||||
}
|
||||
|
||||
public static int getBuffedBonus(Char target, Class<?extends RingBuff> type){
|
||||
int bonus = 0;
|
||||
for (RingBuff buff : target.buffs(type)) {
|
||||
bonus += buff.buffedLvl();
|
||||
}
|
||||
return bonus;
|
||||
}
|
||||
|
||||
public int soloBonus(){
|
||||
if (cursed){
|
||||
return Math.min( 0, Ring.this.level()-2 );
|
||||
} else {
|
||||
return Ring.this.level()+1;
|
||||
}
|
||||
}
|
||||
|
||||
public int soloBuffedBonus(){
|
||||
if (cursed){
|
||||
return Math.min( 0, Ring.this.buffedLvl()-2 );
|
||||
} else {
|
||||
|
@ -332,5 +348,9 @@ public class Ring extends KindofMisc {
|
|||
return Ring.this.soloBonus();
|
||||
}
|
||||
|
||||
public int buffedLvl(){
|
||||
return Ring.this.soloBuffedBonus();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public class RingOfAccuracy extends Ring {
|
|||
}
|
||||
|
||||
public static float accuracyMultiplier( Char target ){
|
||||
return (float)Math.pow(1.3f, getBonus(target, Accuracy.class));
|
||||
return (float)Math.pow(1.3f, getBuffedBonus(target, Accuracy.class));
|
||||
}
|
||||
|
||||
public class Accuracy extends RingBuff {
|
||||
|
|
|
@ -114,11 +114,11 @@ public class RingOfElements extends Ring {
|
|||
}
|
||||
|
||||
public static float resist( Char target, Class effect ){
|
||||
if (getBonus(target, Resistance.class) == 0) return 1f;
|
||||
if (getBuffedBonus(target, Resistance.class) == 0) return 1f;
|
||||
|
||||
for (Class c : RESISTS){
|
||||
if (c.isAssignableFrom(effect)){
|
||||
return (float)Math.pow(0.80, getBonus(target, Resistance.class));
|
||||
return (float)Math.pow(0.80, getBuffedBonus(target, Resistance.class));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ public class RingOfEnergy extends Ring {
|
|||
}
|
||||
|
||||
public static float wandChargeMultiplier( Char target ){
|
||||
return (float)Math.pow(1.30, getBonus(target, Energy.class));
|
||||
return (float)Math.pow(1.30, getBuffedBonus(target, Energy.class));
|
||||
}
|
||||
|
||||
public class Energy extends RingBuff {
|
||||
|
|
|
@ -42,7 +42,7 @@ public class RingOfEvasion extends Ring {
|
|||
}
|
||||
|
||||
public static float evasionMultiplier( Char target ){
|
||||
return (float) Math.pow( 1.15, getBonus(target, Evasion.class));
|
||||
return (float) Math.pow( 1.15, getBuffedBonus(target, Evasion.class));
|
||||
}
|
||||
|
||||
public class Evasion extends RingBuff {
|
||||
|
|
|
@ -35,7 +35,7 @@ public class RingOfForce extends Ring {
|
|||
}
|
||||
|
||||
public static int armedDamageBonus( Char ch ){
|
||||
return getBonus( ch, Force.class);
|
||||
return getBuffedBonus( ch, Force.class);
|
||||
}
|
||||
|
||||
|
||||
|
@ -52,7 +52,7 @@ public class RingOfForce extends Ring {
|
|||
|
||||
public static int damageRoll( Hero hero ){
|
||||
if (hero.buff(Force.class) != null) {
|
||||
int level = getBonus(hero, Force.class);
|
||||
int level = getBuffedBonus(hero, Force.class);
|
||||
float tier = tier(hero.STR());
|
||||
return Random.NormalIntRange(min(level, tier), max(level, tier));
|
||||
} else {
|
||||
|
|
|
@ -42,7 +42,7 @@ public class RingOfFuror extends Ring {
|
|||
}
|
||||
|
||||
public static float attackDelayMultiplier(Char target ){
|
||||
return 1f / (float)Math.pow(1.105, getBonus(target, Furor.class));
|
||||
return 1f / (float)Math.pow(1.105, getBuffedBonus(target, Furor.class));
|
||||
}
|
||||
|
||||
public class Furor extends RingBuff {
|
||||
|
|
|
@ -42,7 +42,7 @@ public class RingOfHaste extends Ring {
|
|||
}
|
||||
|
||||
public static float speedMultiplier( Char target ){
|
||||
return (float)Math.pow(1.2, getBonus(target, Haste.class));
|
||||
return (float)Math.pow(1.2, getBuffedBonus(target, Haste.class));
|
||||
}
|
||||
|
||||
public class Haste extends RingBuff {
|
||||
|
|
|
@ -88,7 +88,7 @@ public class RingOfMight extends Ring {
|
|||
}
|
||||
|
||||
public static float HTMultiplier( Char target ){
|
||||
return (float)Math.pow(1.035, getBonus(target, Might.class));
|
||||
return (float)Math.pow(1.035, getBuffedBonus(target, Might.class));
|
||||
}
|
||||
|
||||
public class Might extends RingBuff {
|
||||
|
|
|
@ -42,7 +42,7 @@ public class RingOfSharpshooting extends Ring {
|
|||
}
|
||||
|
||||
public static int levelDamageBonus( Char target ){
|
||||
return getBonus(target, RingOfSharpshooting.Aim.class);
|
||||
return getBuffedBonus(target, RingOfSharpshooting.Aim.class);
|
||||
}
|
||||
|
||||
public static float durabilityMultiplier( Char target ){
|
||||
|
|
|
@ -43,7 +43,7 @@ public class RingOfTenacity extends Ring {
|
|||
|
||||
public static float damageMultiplier( Char t ){
|
||||
//(HT - HP)/HT = heroes current % missing health.
|
||||
return (float)Math.pow(0.85, getBonus( t, Tenacity.class)*((float)(t.HT - t.HP)/t.HT));
|
||||
return (float)Math.pow(0.85, getBuffedBonus( t, Tenacity.class)*((float)(t.HT - t.HP)/t.HT));
|
||||
}
|
||||
|
||||
public class Tenacity extends RingBuff {
|
||||
|
|
|
@ -80,11 +80,11 @@ public class RingOfWealth extends Ring {
|
|||
}
|
||||
|
||||
public static float dropChanceMultiplier( Char target ){
|
||||
return (float)Math.pow(1.2, getBonus(target, Wealth.class));
|
||||
return (float)Math.pow(1.2, getBuffedBonus(target, Wealth.class));
|
||||
}
|
||||
|
||||
public static ArrayList<Item> tryForBonusDrop(Char target, int tries ){
|
||||
if (getBonus(target, Wealth.class) <= 0) return null;
|
||||
if (getBuffedBonus(target, Wealth.class) <= 0) return null;
|
||||
|
||||
HashSet<Wealth> buffs = target.buffs(Wealth.class);
|
||||
float triesToDrop = Float.MIN_VALUE;
|
||||
|
@ -234,7 +234,7 @@ public class RingOfWealth extends Ring {
|
|||
}
|
||||
|
||||
private static float dropProgression( Char target, int tries ){
|
||||
return tries * (float)Math.pow(1.2f, getBonus(target, Wealth.class) );
|
||||
return tries * (float)Math.pow(1.2f, getBuffedBonus(target, Wealth.class) );
|
||||
}
|
||||
|
||||
public class Wealth extends RingBuff {
|
||||
|
|
Loading…
Reference in New Issue
Block a user