v0.7.3: adjustments to vampiric, chilling, and affection
This commit is contained in:
parent
4ea4d1ddf0
commit
401c79815c
|
@ -42,7 +42,7 @@ public class Affection extends Glyph {
|
||||||
|
|
||||||
if (Random.Int( level / 2 + 10 ) >= 9) {
|
if (Random.Int( level / 2 + 10 ) >= 9) {
|
||||||
|
|
||||||
int duration = Random.IntRange( 6, 12 );
|
int duration = Random.IntRange( 8, 12 );
|
||||||
|
|
||||||
Buff.affect( attacker, Charm.class, duration ).object = defender.id();
|
Buff.affect( attacker, Charm.class, duration ).object = defender.id();
|
||||||
attacker.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 5 );
|
attacker.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 5 );
|
||||||
|
|
|
@ -43,7 +43,14 @@ public class Chilling extends Weapon.Enchantment {
|
||||||
|
|
||||||
if (Random.Int( level + 3 ) >= 2) {
|
if (Random.Int( level + 3 ) >= 2) {
|
||||||
|
|
||||||
Buff.affect( defender, Chill.class, 3f );
|
//adds 3 turns of chill per proc, with a cap of 6 turns
|
||||||
|
float durationToAdd = 3f;
|
||||||
|
Chill existing = defender.buff(Chill.class);
|
||||||
|
if (existing != null){
|
||||||
|
durationToAdd = Math.min(durationToAdd, 6f-existing.cooldown());
|
||||||
|
}
|
||||||
|
|
||||||
|
Buff.affect( defender, Chill.class, durationToAdd );
|
||||||
Splash.at( defender.sprite.center(), 0xFFB2D6FF, 5);
|
Splash.at( defender.sprite.center(), 0xFFB2D6FF, 5);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
|
||||||
|
import com.watabou.utils.Random;
|
||||||
|
|
||||||
public class Vampiric extends Weapon.Enchantment {
|
public class Vampiric extends Weapon.Enchantment {
|
||||||
|
|
||||||
|
@ -35,11 +36,14 @@ public class Vampiric extends Weapon.Enchantment {
|
||||||
@Override
|
@Override
|
||||||
public int proc( Weapon weapon, Char attacker, Char defender, int damage ) {
|
public int proc( Weapon weapon, Char attacker, Char defender, int damage ) {
|
||||||
|
|
||||||
//heals for 2.5-15% of damage dealt, based on missing HP
|
//chance to heal scales from 5%-30% based on missing HP
|
||||||
float missingPercent = (attacker.HT - attacker.HP) / (float)attacker.HT;
|
float missingPercent = (attacker.HT - attacker.HP) / (float)attacker.HT;
|
||||||
float healPercent = .025f + (missingPercent * 0.125f);
|
float healChance = 0.05f + .25f*missingPercent;
|
||||||
int healAmt = Math.round(healPercent * damage);
|
|
||||||
healAmt = Math.min( healAmt, attacker.HT - attacker.HP );
|
if (Random.Float() < healChance){
|
||||||
|
|
||||||
|
//heals for 50% of damage dealt
|
||||||
|
int healAmt = Math.round(damage * 0.5f);
|
||||||
|
|
||||||
if (healAmt > 0 && attacker.isAlive()) {
|
if (healAmt > 0 && attacker.isAlive()) {
|
||||||
|
|
||||||
|
@ -48,6 +52,7 @@ public class Vampiric extends Weapon.Enchantment {
|
||||||
attacker.sprite.showStatus( CharSprite.POSITIVE, Integer.toString( healAmt ) );
|
attacker.sprite.showStatus( CharSprite.POSITIVE, Integer.toString( healAmt ) );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user