v0.7.3: balance adjustments to new enchants:

- increased the rate that corrupting enchant scales with upgrades
- kinetic now loses preserved damage more quickly
This commit is contained in:
Evan Debenham 2019-05-20 20:53:08 -04:00
parent f0c02d13fd
commit 12d7b91991
2 changed files with 54 additions and 7 deletions

View File

@ -48,11 +48,11 @@ public class Corrupting extends Weapon.Enchantment {
int level = Math.max( 0, weapon.level() ); int level = Math.max( 0, weapon.level() );
// lvl 0 - 10% // lvl 0 - 10%
// lvl 1 ~ 12% // lvl 1 ~ 13%
// lvl 2 ~ 14% // lvl 2 ~ 16%
if (damage >= defender.HP if (damage >= defender.HP
&& !defender.isImmune(Corruption.class) && !defender.isImmune(Corruption.class)
&& Random.Int( level + 40 ) >= 36){ && Random.Int( level + 30 ) >= 27){
Mob enemy = (Mob) defender; Mob enemy = (Mob) defender;
Hero hero = (attacker instanceof Hero) ? (Hero) attacker : Dungeon.hero; Hero hero = (attacker instanceof Hero) ? (Hero) attacker : Dungeon.hero;

View File

@ -28,6 +28,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.noosa.Image;
import com.watabou.utils.Bundle;
public class Kinetic extends Weapon.Enchantment { public class Kinetic extends Weapon.Enchantment {
@ -45,7 +47,7 @@ public class Kinetic extends Weapon.Enchantment {
if (damage > defender.HP){ if (damage > defender.HP){
int extraDamage = damage - defender.HP; int extraDamage = damage - defender.HP;
Buff.affect(attacker, ConservedDamage.class, extraDamage*10); Buff.affect(attacker, ConservedDamage.class).setBonus(extraDamage);
} }
return damage + conservedDamage; return damage + conservedDamage;
@ -56,13 +58,44 @@ public class Kinetic extends Weapon.Enchantment {
return YELLOW; return YELLOW;
} }
public static class ConservedDamage extends FlavourBuff { public static class ConservedDamage extends Buff {
@Override @Override
public int icon() { public int icon() {
return BuffIndicator.WEAPON; return BuffIndicator.WEAPON;
} }
@Override
public void tintIcon(Image icon) {
if (preservedDamage >= 10){
icon.hardlight(1f, 0f, 0f);
} else if (preservedDamage >= 5) {
icon.hardlight(1f, 1f - (preservedDamage - 5f)*.2f, 0f);
} else {
icon.hardlight(1f, 1f, 1f - preservedDamage*.2f);
}
}
private float preservedDamage;
public void setBonus(int bonus){
preservedDamage = bonus;
}
public int damageBonus(){
return (int)Math.ceil(preservedDamage);
}
@Override
public boolean act() {
preservedDamage -= Math.max(preservedDamage*.025f, 0.1f);
if (preservedDamage <= 0) detach();
else if (preservedDamage <= 10) BuffIndicator.refreshHero();
spend(TICK);
return true;
}
@Override @Override
public String toString() { public String toString() {
return Messages.get(this, "name"); return Messages.get(this, "name");
@ -73,9 +106,23 @@ public class Kinetic extends Weapon.Enchantment {
return Messages.get(this, "desc", damageBonus()); return Messages.get(this, "desc", damageBonus());
} }
public int damageBonus(){ private static final String PRESERVED_DAMAGE = "preserve_damage";
return (int)Math.ceil(cooldown()/10f);
@Override
public void storeInBundle(Bundle bundle) {
super.storeInBundle(bundle);
bundle.put(PRESERVED_DAMAGE, preservedDamage);
} }
@Override
public void restoreFromBundle(Bundle bundle) {
super.restoreFromBundle(bundle);
if (bundle.contains(PRESERVED_DAMAGE)){
preservedDamage = bundle.getFloat(PRESERVED_DAMAGE);
} else {
preservedDamage = cooldown()/10;
spend(cooldown());
}
}
} }
} }