v0.8.1: new shading and fading vfx added to many buffs

Also several buff durations have changed, to improve consistency:
Blindness:
- Bandit: 5 from 2-5
- Bright Fist attack: 5 from 4
- Retribution: 10 from 6-10
- Blindweed: 10 from 5-10
Cripple:
- Bandit: 5 from 3-8
- Blindweed: 10 from 5-10
Chill:
- breaking frost in water: 5 from 4
Charm:
- Succubus: 5 from 3-4
- Affection: 10 from 8-12
- Friendly curse defender: 5 from 3-5
- Friendly curse attacker: 10 from 13-15
Frost:
- Freezing: 10 from 5-7.5 (icecap / snap freeze)
- Freezing+water: 30 from 25-37.5
- Anti-Entropy: 10 from 2.5-5
- Cursed Wand: 10 from 15-25
- Frost blob: 10 from 5
- Frost Battlemage proc: 10 from 5-10
Others:
- Drowsy: 5 from 3-6
This commit is contained in:
Evan Debenham
2020-05-07 17:15:23 -04:00
parent 05b70dce87
commit e943055564
71 changed files with 279 additions and 86 deletions

View File

@@ -73,8 +73,8 @@ public class Freezing extends Blob {
} else {
Buff.affect(ch, Chill.class, Dungeon.level.water[cell] ? 5f : 3f);
Chill chill = ch.buff(Chill.class);
if (chill != null && chill.cooldown() >= 10f){
Buff.affect(ch, Frost.class, 5f);
if (chill != null && chill.cooldown() >= Chill.DURATION){
Buff.affect(ch, Frost.class, Frost.DURATION);
}
}
}
@@ -100,9 +100,9 @@ public class Freezing extends Blob {
Char ch = Actor.findChar( cell );
if (ch != null) {
if (Dungeon.level.water[ch.pos]){
Buff.prolong(ch, Frost.class, Frost.duration(ch) * Random.Float(5f, 7.5f));
Buff.prolong(ch, Frost.class, Frost.DURATION * 3);
} else {
Buff.prolong(ch, Frost.class, Frost.duration(ch) * Random.Float(1.0f, 1.5f));
Buff.prolong(ch, Frost.class, Frost.DURATION);
}
}

View File

@@ -65,7 +65,7 @@ public class Web extends Blob {
//affects characters as they step on it. See Level.OccupyCell and Level.PressCell
public static void affectChar( Char ch ){
Buff.prolong( ch, Roots.class, 5f );
Buff.prolong( ch, Roots.class, Roots.DURATION );
}
@Override

View File

@@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.noosa.Image;
@@ -74,7 +75,16 @@ public class ArcaneArmor extends Buff {
@Override
public void tintIcon(Image icon) {
icon.tint(0.5f, 0, 1, 0.5f);
icon.hardlight(1f, 0.5f, 2f);
}
@Override
public float iconFadePercent() {
if (target instanceof Hero){
float max = ((Hero) target).lvl/2 + 5;
return (max-level)/max;
}
return 0;
}
@Override

View File

@@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Bundle;
@@ -69,7 +70,16 @@ public class Barkskin extends Buff {
public int icon() {
return BuffIndicator.BARKSKIN;
}
@Override
public float iconFadePercent() {
if (target instanceof Hero){
float max = ((Hero) target).lvl + 5;
return (max-level)/max;
}
return 0;
}
@Override
public String toString() {
return Messages.get(this, "name");

View File

@@ -59,7 +59,7 @@ public class Barrier extends ShieldBuff {
@Override
public void tintIcon(Image icon) {
icon.tint(0, 0.5f, 1, 0.5f);
icon.hardlight(0.5f, 1f, 2f);
}
@Override

View File

@@ -27,6 +27,8 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
public class Blindness extends FlavourBuff {
public static final float DURATION = 10f;
{
type = buffType.NEGATIVE;
announced = true;
@@ -42,7 +44,12 @@ public class Blindness extends FlavourBuff {
public int icon() {
return BuffIndicator.BLINDNESS;
}
@Override
public float iconFadePercent() {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
}
@Override
public String toString() {
return Messages.get(this, "name");

View File

@@ -31,6 +31,8 @@ public class Charm extends FlavourBuff {
private static final String OBJECT = "object";
public static final float DURATION = 10f;
{
type = buffType.NEGATIVE;
announced = true;
@@ -52,6 +54,11 @@ public class Charm extends FlavourBuff {
public int icon() {
return BuffIndicator.HEART;
}
@Override
public float iconFadePercent() {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
}
@Override
public String toString() {

View File

@@ -30,6 +30,8 @@ import java.text.DecimalFormat;
public class Chill extends FlavourBuff {
public static final float DURATION = 10f;
{
type = buffType.NEGATIVE;
announced = true;
@@ -58,6 +60,11 @@ public class Chill extends FlavourBuff {
return BuffIndicator.FROST;
}
@Override
public float iconFadePercent() {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
}
@Override
public void fx(boolean on) {
if (on) target.sprite.add(CharSprite.State.CHILLED);

View File

@@ -37,6 +37,11 @@ public class Cripple extends FlavourBuff {
public int icon() {
return BuffIndicator.CRIPPLE;
}
@Override
public float iconFadePercent() {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
}
@Override
public String toString() {

View File

@@ -68,7 +68,12 @@ public class Degrade extends FlavourBuff {
public int icon() {
return BuffIndicator.DEGRADE;
}
@Override
public float iconFadePercent() {
return (DURATION - visualcooldown())/DURATION;
}
@Override
public String toString() {
return Messages.get(this, "name");

View File

@@ -28,6 +28,8 @@ import com.watabou.utils.Random;
public class Drowsy extends Buff {
public static final float DURATION = 5f;
{
type = buffType.NEUTRAL;
announced = true;
@@ -38,10 +40,16 @@ public class Drowsy extends Buff {
return BuffIndicator.DROWSY;
}
public boolean attachTo( Char target ) {
@Override
public float iconFadePercent() {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
}
public boolean attachTo(Char target ) {
if (!target.isImmune(Sleep.class) && super.attachTo(target)) {
if (cooldown() == 0)
spend(Random.Int(3, 6));
if (cooldown() == 0) {
spend(DURATION);
}
return true;
}
return false;

View File

@@ -25,7 +25,9 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
public class Foresight extends FlavourBuff {
public static final float DURATION = 600f;
{
type = buffType.POSITIVE;
announced = true;
@@ -35,6 +37,11 @@ public class Foresight extends FlavourBuff {
public int icon() {
return BuffIndicator.FORESIGHT;
}
@Override
public float iconFadePercent() {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
}
@Override
public String toString() {

View File

@@ -34,13 +34,14 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.Image;
import com.watabou.utils.Random;
import java.util.ArrayList;
public class Frost extends FlavourBuff {
private static final float DURATION = 5f;
public static final float DURATION = 10f;
{
type = buffType.NEGATIVE;
@@ -105,7 +106,7 @@ public class Frost extends FlavourBuff {
if (target.paralysed > 0)
target.paralysed--;
if (Dungeon.level.water[target.pos])
Buff.prolong(target, Chill.class, 4f);
Buff.prolong(target, Chill.class, Chill.DURATION/2f);
}
@Override
@@ -113,6 +114,16 @@ public class Frost extends FlavourBuff {
return BuffIndicator.FROST;
}
@Override
public void tintIcon(Image icon) {
icon.hardlight(0f, 0.75f, 1f);
}
@Override
public float iconFadePercent() {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
}
@Override
public void fx(boolean on) {
if (on) target.sprite.add(CharSprite.State.FROZEN);
@@ -129,7 +140,4 @@ public class Frost extends FlavourBuff {
return Messages.get(this, "desc", dispTurns());
}
public static float duration( Char ch ) {
return DURATION;
}
}

View File

@@ -37,6 +37,11 @@ public class Hex extends FlavourBuff {
public int icon() {
return BuffIndicator.HEX;
}
@Override
public float iconFadePercent() {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
}
@Override
public String toString() {

View File

@@ -27,6 +27,8 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.noosa.Image;
public class MagicImmune extends FlavourBuff {
public static final float DURATION = 20f;
{
type = buffType.POSITIVE;
@@ -48,6 +50,11 @@ public class MagicImmune extends FlavourBuff {
public void tintIcon(Image icon) {
icon.hardlight(0, 1, 0);
}
@Override
public float iconFadePercent() {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
}
@Override
public String toString() {

View File

@@ -43,6 +43,11 @@ public class MagicalSight extends FlavourBuff {
return BuffIndicator.MIND_VISION;
}
@Override
public void tintIcon(Image icon) {
icon.hardlight(1f, 1.67f, 1f);
}
@Override
public float iconFadePercent() {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);

View File

@@ -30,6 +30,8 @@ import com.watabou.utils.Random;
public class Ooze extends Buff {
public static final float DURATION = 20f;
{
type = buffType.NEGATIVE;
announced = true;
@@ -59,6 +61,11 @@ public class Ooze extends Buff {
public int icon() {
return BuffIndicator.OOZE;
}
@Override
public float iconFadePercent() {
return Math.max(0, (DURATION - left) / DURATION);
}
@Override
public String toString() {

View File

@@ -75,6 +75,11 @@ public class Paralysis extends FlavourBuff {
return BuffIndicator.PARALYSIS;
}
@Override
public float iconFadePercent() {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
}
@Override
public void fx(boolean on) {
if (on) target.sprite.add(CharSprite.State.PARALYSED);
@@ -96,9 +101,6 @@ public class Paralysis extends FlavourBuff {
return Messages.get(this, "desc", dispTurns());
}
public static float duration( Char ch ) {
return DURATION;
}
public static class ParalysisResist extends Buff {

View File

@@ -112,9 +112,14 @@ public class PrismaticGuard extends Buff {
@Override
public void tintIcon(Image icon) {
icon.tint(0.5f, 0.5f, 1, 0.5f);
icon.hardlight(1f, 1f, 2f);
}
@Override
public float iconFadePercent() {
return 1f - HP/(float)maxHP();
}
@Override
public String toString() {
return Messages.get(this, "name");

View File

@@ -27,6 +27,8 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
public class Roots extends FlavourBuff {
public static final float DURATION = 5f;
{
type = buffType.NEGATIVE;
announced = true;
@@ -52,6 +54,11 @@ public class Roots extends FlavourBuff {
public int icon() {
return BuffIndicator.ROOTS;
}
@Override
public float iconFadePercent() {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
}
@Override
public String toString() {

View File

@@ -37,6 +37,11 @@ public class Slow extends FlavourBuff {
public int icon() {
return BuffIndicator.SLOW;
}
@Override
public float iconFadePercent() {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
}
@Override
public String toString() {

View File

@@ -40,6 +40,12 @@ public class SnipersMark extends FlavourBuff implements ActionIndicator.Action {
public int object = 0;
private static final String OBJECT = "object";
public static final float DURATION = 2f;
{
type = buffType.POSITIVE;
}
@Override
public boolean attachTo(Char target) {
@@ -70,6 +76,11 @@ public class SnipersMark extends FlavourBuff implements ActionIndicator.Action {
public int icon() {
return BuffIndicator.MARK;
}
@Override
public float iconFadePercent() {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
}
@Override
public String toString() {

View File

@@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.noosa.Image;
public class SoulMark extends FlavourBuff {
@@ -39,6 +40,16 @@ public class SoulMark extends FlavourBuff {
return BuffIndicator.CORRUPT;
}
@Override
public void tintIcon(Image icon) {
icon.hardlight(0.5f, 0.5f, 0.5f);
}
@Override
public float iconFadePercent() {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
}
@Override
public void fx(boolean on) {
if (on) target.sprite.add(CharSprite.State.MARKED);

View File

@@ -31,6 +31,8 @@ public class Terror extends FlavourBuff {
private static final String OBJECT = "object";
public static final float DURATION = 20f;
{
type = buffType.NEGATIVE;
announced = true;
@@ -53,6 +55,11 @@ public class Terror extends FlavourBuff {
return BuffIndicator.TERROR;
}
@Override
public float iconFadePercent() {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
}
@Override
public String toString() {
return Messages.get(this, "name");

View File

@@ -38,6 +38,11 @@ public class Vertigo extends FlavourBuff {
return BuffIndicator.VERTIGO;
}
@Override
public float iconFadePercent() {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
}
@Override
public String toString() {
return Messages.get(this, "name");

View File

@@ -37,6 +37,11 @@ public class Vulnerable extends FlavourBuff {
public int icon() {
return BuffIndicator.VULNERABLE;
}
@Override
public float iconFadePercent() {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
}
@Override
public String toString() {

View File

@@ -37,6 +37,11 @@ public class Weakness extends FlavourBuff {
public int icon() {
return BuffIndicator.WEAKNESS;
}
@Override
public float iconFadePercent() {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
}
@Override
public String toString() {

View File

@@ -26,7 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Bundle;
public class WellFed extends Buff {
{
type = buffType.POSITIVE;
announced = true;
@@ -58,6 +58,11 @@ public class WellFed extends Buff {
public int icon() {
return BuffIndicator.WELL_FED;
}
@Override
public float iconFadePercent() {
return Math.max(0, (Hunger.STARVING - left) / Hunger.STARVING);
}
@Override
public String toString() {

View File

@@ -991,7 +991,7 @@ public class Hero extends Char {
@Override
protected boolean act() {
if (enemy.isAlive()) {
Buff.prolong(Hero.this, SnipersMark.class, 2f).object = enemy.id();
Buff.prolong(Hero.this, SnipersMark.class, SnipersMark.DURATION).object = enemy.id();
}
Actor.remove(this);
return true;

View File

@@ -40,14 +40,14 @@ public class Acidic extends Scorpio {
}
@Override
public int attackProc(Char enemy, int damage) {
Buff.affect(enemy, Ooze.class).set( 20f );
Buff.affect(enemy, Ooze.class).set( Ooze.DURATION );
return super.attackProc(enemy, damage);
}
@Override
public int defenseProc( Char enemy, int damage ) {
if (Dungeon.level.adjacent(pos, enemy.pos)){
Buff.affect(enemy, Ooze.class).set( 20f );
Buff.affect(enemy, Ooze.class).set( Ooze.DURATION );
}
return super.defenseProc( enemy, damage );
}

View File

@@ -46,9 +46,9 @@ public class Bandit extends Thief {
protected boolean steal( Hero hero ) {
if (super.steal( hero )) {
Buff.prolong( hero, Blindness.class, Random.Int( 2, 5 ) );
Buff.prolong( hero, Blindness.class, Blindness.DURATION/2f );
Buff.affect( hero, Poison.class ).set(Random.Int(5, 7) );
Buff.prolong( hero, Cripple.class, Random.Int( 3, 8 ) );
Buff.prolong( hero, Cripple.class, Cripple.DURATION/2f );
Dungeon.observe();
return true;

View File

@@ -41,7 +41,7 @@ public class CausticSlime extends Slime {
@Override
public int attackProc( Char enemy, int damage ) {
if (Random.Int( 2 ) == 0) {
Buff.affect( enemy, Ooze.class ).set( 20f );
Buff.affect( enemy, Ooze.class ).set( Ooze.DURATION );
enemy.sprite.burst( 0x000000, 5 );
}

View File

@@ -287,7 +287,7 @@ public abstract class Elemental extends Mob {
@Override
protected void rangedProc( Char enemy ) {
Buff.affect( enemy, Blindness.class, 5f );
Buff.affect( enemy, Blindness.class, Blindness.DURATION/2f );
if (enemy == Dungeon.hero) {
GameScene.flash(0xFFFFFF);
}

View File

@@ -61,7 +61,7 @@ public class FetidRat extends Rat {
public int attackProc( Char enemy, int damage ) {
damage = super.attackProc( enemy, damage );
if (Random.Int(3) == 0) {
Buff.affect(enemy, Ooze.class).set( 20f );
Buff.affect(enemy, Ooze.class).set( Ooze.DURATION );
}
return damage;

View File

@@ -137,7 +137,7 @@ public class Goo extends Mob {
public int attackProc( Char enemy, int damage ) {
damage = super.attackProc( enemy, damage );
if (Random.Int( 3 ) == 0) {
Buff.affect( enemy, Ooze.class ).set( 20f );
Buff.affect( enemy, Ooze.class ).set( Ooze.DURATION );
enemy.sprite.burst( 0x000000, 5 );
}

View File

@@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.food.Food;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.MonkSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.noosa.Image;
import com.watabou.utils.Bundle;
import com.watabou.utils.Random;
@@ -147,7 +148,12 @@ public class Monk extends Mob {
public int icon() {
return BuffIndicator.MIND_VISION;
}
@Override
public void tintIcon(Image icon) {
icon.hardlight(0.25f, 1.5f, 1f);
}
@Override
public String toString() {
return Messages.get(this, "name");

View File

@@ -86,8 +86,8 @@ public class Succubus extends Mob {
sprite.emitter().burst( Speck.factory( Speck.HEALING ), 2 );
Sample.INSTANCE.play( Assets.SND_CHARMS );
} else if (Random.Int( 3 ) == 0) {
//attack will reduce by 5 turns, so effectively 3-4 turns
Buff.affect( enemy, Charm.class, Random.IntRange( 3, 4 ) + 5 ).object = id();
//attack will reduce by 5 turns, so effectively DURATION-5 turns
Buff.affect( enemy, Charm.class, Charm.DURATION ).object = id();
enemy.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 5 );
Sample.INSTANCE.play( Assets.SND_CHARMS );
}

View File

@@ -246,7 +246,7 @@ public class Yog extends Mob {
damage = super.attackProc( enemy, damage );
if (Random.Int( 3 ) == 0) {
Buff.affect( enemy, Ooze.class ).set( 20f );
Buff.affect( enemy, Ooze.class ).set( Ooze.DURATION );
enemy.sprite.burst( 0xFF000000, 5 );
}

View File

@@ -378,7 +378,7 @@ public abstract class YogFist extends Mob {
damage = super.attackProc( enemy, damage );
if (Random.Int( 2 ) == 0) {
Buff.affect( enemy, Ooze.class ).set( 20f );
Buff.affect( enemy, Ooze.class ).set( Ooze.DURATION );
enemy.sprite.burst( 0xFF000000, 5 );
}
@@ -448,7 +448,7 @@ public abstract class YogFist extends Mob {
if (hit( this, enemy, true )) {
enemy.damage( Random.NormalIntRange(12, 24), new LightBeam() );
Buff.prolong( enemy, Blindness.class, 4f );
Buff.prolong( enemy, Blindness.class, Blindness.DURATION/2f );
if (!enemy.isAlive() && enemy == Dungeon.hero) {
Dungeon.fail( getClass() );
@@ -468,7 +468,7 @@ public abstract class YogFist extends Mob {
super.damage(dmg, src);
if (isAlive() && beforeHP > HT/2 && HP < HT/2){
HP = HT/2;
Buff.prolong( Dungeon.hero, Blindness.class, 15f );
Buff.prolong( Dungeon.hero, Blindness.class, Blindness.DURATION*1.5f );
int i;
do {
i = Random.Int(Dungeon.level.length());
@@ -481,7 +481,7 @@ public abstract class YogFist extends Mob {
GameScene.flash(0xFFFFFF);
GLog.w( Messages.get( this, "teleport" ));
} else if (!isAlive()){
Buff.prolong( Dungeon.hero, Blindness.class, 30f );
Buff.prolong( Dungeon.hero, Blindness.class, Blindness.DURATION*3f );
GameScene.flash(0xFFFFFF);
}
}

View File

@@ -52,7 +52,7 @@ public class MageArmor extends ClassArmor {
if (Dungeon.level.heroFOV[mob.pos]
&& mob.alignment != Char.Alignment.ALLY) {
Buff.affect( mob, Burning.class ).reignite( mob );
Buff.prolong( mob, Roots.class, 5 );
Buff.prolong( mob, Roots.class, Roots.DURATION );
mob.damage(Random.NormalIntRange(4, 16 + Dungeon.depth), new Burning());
}
}

View File

@@ -73,7 +73,7 @@ public class RogueArmor extends ClassArmor {
for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) {
if (Dungeon.level.adjacent(mob.pos, curUser.pos) && mob.alignment != Char.Alignment.ALLY) {
Buff.prolong( mob, Blindness.class, 5 );
Buff.prolong( mob, Blindness.class, Blindness.DURATION/2f );
if (mob.state == mob.HUNTING) mob.state = mob.WANDERING;
mob.sprite.emitter().burst( Speck.factory( Speck.LIGHT ), 4 );
}

View File

@@ -45,7 +45,7 @@ public class AntiEntropy extends Glyph {
if (Random.Int( 8 ) == 0) {
if (Dungeon.level.adjacent( attacker.pos, defender.pos )) {
Buff.prolong(attacker, Frost.class, Frost.duration(attacker) * Random.Float(0.5f, 1f));
Buff.prolong(attacker, Frost.class, Frost.DURATION);
CellEmitter.get(attacker.pos).start(SnowParticle.FACTORY, 0.2f, 6);
}

View File

@@ -43,7 +43,7 @@ public class Corrosion extends Armor.Glyph {
for (int i : PathFinder.NEIGHBOURS9){
Splash.at(pos+i, 0x000000, 5);
if (Actor.findChar(pos+i) != null)
Buff.affect(Actor.findChar(pos+i), Ooze.class).set( 20f );
Buff.affect(Actor.findChar(pos+i), Ooze.class).set( Ooze.DURATION );
}
}

View File

@@ -44,10 +44,8 @@ public class Affection extends Glyph {
// lvl 1 ~ 19%
// lvl 2 ~ 23%
if (Random.Int( level + 20 ) >= 17) {
int duration = Random.IntRange( 8, 12 );
Buff.affect( attacker, Charm.class, duration ).object = defender.id();
Buff.affect( attacker, Charm.class, Charm.DURATION ).object = defender.id();
attacker.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 5 );
}

View File

@@ -220,6 +220,11 @@ public class CloakOfShadows extends Artifact {
return BuffIndicator.INVISIBLE;
}
@Override
public float iconFadePercent() {
return (5f - turnsToCost) / 5f;
}
@Override
public boolean attachTo( Char target ) {
if (super.attachTo( target )) {

View File

@@ -85,7 +85,7 @@ public class SandalsOfNature extends Artifact {
if (!isEquipped( hero )) GLog.i( Messages.get(Artifact.class, "need_to_equip") );
else if (charge == 0) GLog.i( Messages.get(this, "no_charge") );
else {
Buff.prolong(hero, Roots.class, 5);
Buff.prolong(hero, Roots.class, Roots.DURATION);
Buff.affect(hero, Earthroot.Armor.class).level(charge);
CellEmitter.bottom(hero.pos).start(EarthParticle.FACTORY, 0.05f, 8);
Camera.main.shake(1, 0.4f);

View File

@@ -60,7 +60,7 @@ public class MysteryMeat extends Food {
break;
case 1:
GLog.w( Messages.get(MysteryMeat.class, "legs") );
Buff.prolong( hero, Roots.class, Paralysis.DURATION );
Buff.prolong( hero, Roots.class, Roots.DURATION*2f );
break;
case 2:
GLog.w( Messages.get(MysteryMeat.class, "not_well") );

View File

@@ -57,7 +57,7 @@ public class CausticBrew extends Brew {
Char ch = Actor.findChar(i);
if (ch != null){
Buff.affect(ch, Ooze.class).set( 20f );
Buff.affect(ch, Ooze.class).set( Ooze.DURATION );
}
}
}

View File

@@ -98,7 +98,7 @@ public class ElixirOfAquaticRejuvenation extends Elixir {
@Override
public void tintIcon(Image icon) {
icon.hardlight(0, 1, 1);
icon.hardlight(0, 0.75f, 0.75f);
}
@Override

View File

@@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.Image;
import com.watabou.utils.Bundle;
public class ElixirOfMight extends Elixir {
@@ -112,6 +113,16 @@ public class ElixirOfMight extends Elixir {
public int icon() {
return BuffIndicator.HEALING;
}
@Override
public void tintIcon(Image icon) {
icon.hardlight(1f, 0.5f, 0f);
}
@Override
public float iconFadePercent() {
return (5f - left) / 5f;
}
@Override
public String toString() {

View File

@@ -57,7 +57,7 @@ public class PotionOfSnapFreeze extends ExoticPotion {
Char ch = Actor.findChar( cell + offset);
if (ch != null){
Buff.affect(ch, Roots.class, 10f);
Buff.affect(ch, Roots.class, Roots.DURATION*2f);
}
}

View File

@@ -54,13 +54,13 @@ public class ScrollOfRetribution extends Scroll {
//deals 10%HT, plus 0-90%HP based on scaling
mob.damage(Math.round(mob.HT/10f + (mob.HP * power * 0.225f)), this);
if (mob.isAlive()) {
Buff.prolong(mob, Blindness.class, Math.round(6 + power));
Buff.prolong(mob, Blindness.class, Blindness.DURATION);
}
}
}
Buff.prolong(curUser, Weakness.class, Weakness.DURATION);
Buff.prolong(curUser, Blindness.class, Math.round(6 + power));
Buff.prolong(curUser, Blindness.class, Blindness.DURATION);
Dungeon.observe();
setKnown();

View File

@@ -51,7 +51,7 @@ public class ScrollOfTerror extends Scroll {
Mob affected = null;
for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
if (mob.alignment != Char.Alignment.ALLY && Dungeon.level.heroFOV[mob.pos]) {
Buff.affect( mob, Terror.class, 20f ).object = curUser.id();
Buff.affect( mob, Terror.class, Terror.DURATION ).object = curUser.id();
if (mob.buff(Terror.class) != null){
count++;

View File

@@ -45,7 +45,7 @@ public class ScrollOfAffection extends ExoticScroll {
for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
if (Dungeon.level.heroFOV[mob.pos]) {
Buff.affect( mob, Charm.class, 20f ).object = curUser.id();
Buff.affect( mob, Charm.class, Charm.DURATION*2f ).object = curUser.id();
mob.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 5 );
}
}

View File

@@ -37,7 +37,7 @@ public class ScrollOfAntiMagic extends ExoticScroll {
Invisibility.dispel();
Buff.affect( curUser, MagicImmune.class, 20f );
Buff.affect( curUser, MagicImmune.class, MagicImmune.DURATION );
new Flare( 5, 32 ).color( 0xFF0000, true ).show( curUser.sprite, 2f );
setKnown();

View File

@@ -42,8 +42,8 @@ public class ScrollOfConfusion extends ExoticScroll {
public void doRead() {
for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
if (mob.alignment != Char.Alignment.ALLY && Dungeon.level.heroFOV[mob.pos]) {
Buff.prolong(mob, Vertigo.class, 10f);
Buff.prolong(mob, Blindness.class, 10f);
Buff.prolong(mob, Vertigo.class, Vertigo.DURATION);
Buff.prolong(mob, Blindness.class, Blindness.DURATION);
}
}

View File

@@ -40,7 +40,7 @@ public class ScrollOfForesight extends ExoticScroll {
Sample.INSTANCE.play( Assets.SND_READ );
Invisibility.dispel();
Buff.affect(curUser, Foresight.class, 600f);
Buff.affect(curUser, Foresight.class, Foresight.DURATION);
setKnown();

View File

@@ -53,15 +53,15 @@ public class ScrollOfPsionicBlast extends ExoticScroll {
targets ++;
mob.damage(Math.round(mob.HT/2f + mob.HP/2f), this);
if (mob.isAlive()) {
Buff.prolong(mob, Blindness.class, 10);
Buff.prolong(mob, Blindness.class, Blindness.DURATION);
}
}
}
curUser.damage(Math.max(0, Math.round(curUser.HT*(0.5f * (float)Math.pow(0.9, targets)))), this);
if (curUser.isAlive()) {
Buff.prolong(curUser, Blindness.class, 10);
Buff.prolong(curUser, Weakness.class, 100);
Buff.prolong(curUser, Blindness.class, Blindness.DURATION);
Buff.prolong(curUser, Weakness.class, Weakness.DURATION*5f);
Dungeon.observe();
readAnimation();
} else {

View File

@@ -49,7 +49,7 @@ public class StoneOfAffection extends Runestone {
Char ch = Actor.findChar( cell + i );
if (ch != null && ch.alignment == Char.Alignment.ENEMY){
Buff.prolong(ch, Charm.class, 10f).object = curUser.id();
Buff.prolong(ch, Charm.class, Charm.DURATION).object = curUser.id();
}
}

View File

@@ -112,12 +112,12 @@ public class CursedWand {
case 0:
if (target != null)
Buff.affect(target, Burning.class).reignite(target);
Buff.affect(user, Frost.class, Frost.duration(user) * Random.Float(3f, 5f));
Buff.affect(user, Frost.class, Frost.DURATION);
break;
case 1:
Buff.affect(user, Burning.class).reignite(user);
if (target != null)
Buff.affect(target, Frost.class, Frost.duration(target) * Random.Float(3f, 5f));
Buff.affect(target, Frost.class, Frost.DURATION);
break;
}
afterZap.call();

View File

@@ -87,7 +87,7 @@ public class WandOfCorrosion extends Wand {
// lvl 2 - 60%
if (Random.Int( buffedLvl() + 3 ) >= 2) {
Buff.affect( defender, Ooze.class ).set( 20f );
Buff.affect( defender, Ooze.class ).set( Ooze.DURATION );
CellEmitter.center(defender.pos).burst( CorrosionParticle.SPLASH, 5 );
}

View File

@@ -104,12 +104,12 @@ public class WandOfFrost extends DamageWand {
@Override
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
Chill chill = defender.buff(Chill.class);
if (chill != null && Random.IntRange(2, 10) <= chill.cooldown()){
if (chill != null && Random.IntRange(2, (int)Chill.DURATION) <= chill.cooldown()){
//need to delay this through an actor so that the freezing isn't broken by taking damage from the staff hit.
new FlavourBuff(){
{actPriority = VFX_PRIO;}
public boolean act() {
Buff.affect(target, Frost.class, Frost.duration(target) * Random.Float(1f, 2f));
Buff.affect(target, Frost.class, Frost.DURATION);
return super.act();
}
}.attachTo(defender);

View File

@@ -249,6 +249,11 @@ public class WandOfLivingEarth extends DamageWand {
return BuffIndicator.ARMOR;
}
@Override
public float iconFadePercent() {
return Math.max(0, (armorToGuardian() - armor) / armorToGuardian());
}
@Override
public String toString() {
return Messages.get(this, "name");

View File

@@ -104,7 +104,7 @@ public class WandOfTransfusion extends Wand {
//charms living enemies
if (!ch.properties().contains(Char.Property.UNDEAD)) {
Buff.affect(ch, Charm.class, 5).object = curUser.id();
Buff.affect(ch, Charm.class, Charm.DURATION/2f).object = curUser.id();
ch.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 3 + buffedLvl()/2 );
//harms the undead

View File

@@ -38,13 +38,11 @@ public class Friendly extends Weapon.Enchantment {
if (Random.Int(10) == 0){
int base = Random.IntRange(3, 5);
Buff.affect( attacker, Charm.class, base + 10 ).object = defender.id();
Buff.affect( attacker, Charm.class, Charm.DURATION ).object = defender.id();
attacker.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 5 );
//5 turns will be reduced by the attack, so effectively lasts for base turns
Buff.affect( defender, Charm.class, base + 5 ).object = attacker.id();
//5 turns will be reduced by the attack, so effectively lasts for Charm.DURATION-5 turns
Buff.affect( defender, Charm.class, Charm.DURATION ).object = attacker.id();
defender.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 5 );
}

View File

@@ -70,7 +70,12 @@ public class Blocking extends Weapon.Enchantment {
@Override
public void tintIcon(Image icon) {
icon.tint(0, 0.5f, 1, 0.5f);
icon.hardlight(0.5f, 1f, 2f);
}
@Override
public float iconFadePercent() {
return Math.max(0, (5f - visualcooldown()) / 5f);
}
@Override

View File

@@ -36,7 +36,7 @@ public class BlindingDart extends TippedDart {
@Override
public int proc(Char attacker, Char defender, int damage) {
Buff.affect(defender, Blindness.class, 10f);
Buff.affect(defender, Blindness.class, Blindness.DURATION);
return super.proc(attacker, defender, damage);
}

View File

@@ -37,7 +37,7 @@ public class ChillingDart extends TippedDart {
public int proc(Char attacker, Char defender, int damage) {
if (Dungeon.level.water[defender.pos]){
Buff.prolong(defender, Chill.class, 10f);
Buff.prolong(defender, Chill.class, Chill.DURATION);
} else {
Buff.prolong(defender, Chill.class, 6f);
}

View File

@@ -61,8 +61,8 @@ public class FlashingTrap extends Trap {
if (c != null) {
int damage = Math.max( 0, (4 + Dungeon.depth) - c.drRoll() );
Buff.affect( c, Bleeding.class ).set( damage );
Buff.prolong( c, Blindness.class, 10f );
Buff.prolong( c, Cripple.class, 20f );
Buff.prolong( c, Blindness.class, Blindness.DURATION );
Buff.prolong( c, Cripple.class, Cripple.DURATION*2f );
if (c instanceof Mob) {
if (((Mob)c).state == ((Mob)c).HUNTING) ((Mob)c).state = ((Mob)c).WANDERING;

View File

@@ -44,7 +44,7 @@ public class OozeTrap extends Trap {
Splash.at( pos + i, 0x000000, 5);
Char ch = Actor.findChar( pos + i );
if (ch != null && !ch.flying){
Buff.affect(ch, Ooze.class).set( 20f );
Buff.affect(ch, Ooze.class).set( Ooze.DURATION );
}
}
}

View File

@@ -48,9 +48,8 @@ public class Blindweed extends Plant {
if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN){
Buff.affect(ch, Invisibility.class, Invisibility.DURATION/2f);
} else {
int len = Random.Int(5, 10);
Buff.prolong(ch, Blindness.class, len);
Buff.prolong(ch, Cripple.class, len);
Buff.prolong(ch, Blindness.class, Blindness.DURATION);
Buff.prolong(ch, Cripple.class, Cripple.DURATION);
if (ch instanceof Mob) {
if (((Mob) ch).state == ((Mob) ch).HUNTING) ((Mob) ch).state = ((Mob) ch).WANDERING;
((Mob) ch).beckon(Dungeon.level.randomDestination( ch ));