v0.7.0: consistency pass on buff types

This commit is contained in:
Evan Debenham 2018-07-20 21:01:56 -04:00
parent f38fe77ff4
commit ab1b9f23d6
56 changed files with 140 additions and 12 deletions

View File

@ -450,16 +450,17 @@ public abstract class Char extends Actor {
buffs.add( buff );
Actor.add( buff );
if (sprite != null)
if (sprite != null && buff.announced)
switch(buff.type){
case POSITIVE:
sprite.showStatus(CharSprite.POSITIVE, buff.toString()); break;
sprite.showStatus(CharSprite.POSITIVE, buff.toString());
break;
case NEGATIVE:
sprite.showStatus(CharSprite.NEGATIVE, buff.toString());break;
case NEUTRAL:
sprite.showStatus(CharSprite.NEUTRAL, buff.toString()); break;
case SILENT: default:
break; //show nothing
sprite.showStatus(CharSprite.NEGATIVE, buff.toString());
break;
case NEUTRAL: default:
sprite.showStatus(CharSprite.NEUTRAL, buff.toString());
break;
}
}

View File

@ -27,6 +27,10 @@ import com.watabou.noosa.Image;
public class Adrenaline extends FlavourBuff {
{
type = buffType.POSITIVE;
}
public static final float DURATION = 10f;
@Override

View File

@ -27,6 +27,10 @@ import com.watabou.utils.Bundle;
public class AdrenalineSurge extends Buff {
{
type = buffType.POSITIVE;
}
private int boost;
private static final float INTERVAL = TICK * 500f;

View File

@ -29,6 +29,7 @@ public class Amok extends FlavourBuff {
{
type = buffType.NEGATIVE;
announced = true;
}
@Override

View File

@ -25,6 +25,10 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
public class Awareness extends FlavourBuff {
{
type = buffType.POSITIVE;
}
public static final float DURATION = 2f;

View File

@ -26,6 +26,10 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Bundle;
public class Barkskin extends Buff {
{
type = buffType.POSITIVE;
}
private int level = 0;
private int interval = 1;

View File

@ -29,7 +29,9 @@ import com.watabou.utils.Bundle;
public class Barrier extends ShieldBuff {
//TODO icon and description for phase 2
{
type = buffType.POSITIVE;
}
@Override
public boolean act() {

View File

@ -34,6 +34,7 @@ public class Bleeding extends Buff {
{
type = buffType.NEGATIVE;
announced = true;
}
protected int level;

View File

@ -31,6 +31,7 @@ public class Bless extends FlavourBuff {
{
type = buffType.POSITIVE;
announced = true;
}
@Override

View File

@ -29,6 +29,7 @@ public class Blindness extends FlavourBuff {
{
type = buffType.NEGATIVE;
announced = true;
}
@Override

View File

@ -39,6 +39,10 @@ import com.watabou.noosa.Image;
public class BlobImmunity extends FlavourBuff {
{
type = buffType.POSITIVE;
}
public static final float DURATION = 20f;
@Override

View File

@ -39,10 +39,12 @@ public class Buff extends Actor {
}
//determines how the buff is announced when it is shown.
//buffs that work behind the scenes, or have other visual indicators can usually be silent.
//FIXME should extend this to more buffs, want silent positive and silent negative?
public enum buffType {POSITIVE, NEGATIVE, NEUTRAL, SILENT};
public buffType type = buffType.SILENT;
public enum buffType {POSITIVE, NEGATIVE, NEUTRAL};
public buffType type = buffType.NEUTRAL;
//whether or not the buff announces its name
public boolean announced = false;
protected HashSet<Class> resistances = new HashSet<>();

View File

@ -61,6 +61,7 @@ public class Burning extends Buff implements Hero.Doom {
{
type = buffType.NEGATIVE;
announced = true;
}
@Override

View File

@ -33,6 +33,7 @@ public class Charm extends FlavourBuff {
{
type = buffType.NEGATIVE;
announced = true;
}
@Override

View File

@ -32,6 +32,7 @@ public class Chill extends FlavourBuff {
{
type = buffType.NEGATIVE;
announced = true;
}
@Override

View File

@ -39,6 +39,7 @@ public class Corrosion extends Buff implements Hero.Doom {
{
type = buffType.NEGATIVE;
announced = true;
}
@Override

View File

@ -30,6 +30,7 @@ public class Corruption extends Buff {
{
type = buffType.NEGATIVE;
announced = true;
}
private float buildToDamage = 0f;

View File

@ -30,6 +30,7 @@ public class Cripple extends FlavourBuff {
{
type = buffType.NEGATIVE;
announced = true;
}
@Override

View File

@ -29,6 +29,7 @@ public class Doom extends Buff {
{
type = buffType.NEGATIVE;
announced = true;
}
@Override

View File

@ -30,6 +30,7 @@ public class Drowsy extends Buff {
{
type = buffType.NEUTRAL;
announced = true;
}
@Override

View File

@ -29,6 +29,10 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.noosa.Image;
public class EarthImbue extends FlavourBuff {
{
type = buffType.POSITIVE;
}
public static final float DURATION = 30f;

View File

@ -33,6 +33,10 @@ import com.watabou.utils.Bundle;
import com.watabou.utils.Random;
public class FireImbue extends Buff {
{
type = buffType.POSITIVE;
}
public static final float DURATION = 30f;

View File

@ -45,6 +45,7 @@ public class Frost extends FlavourBuff {
{
type = buffType.NEGATIVE;
announced = true;
}
@Override

View File

@ -30,6 +30,7 @@ public class Fury extends Buff {
{
type = buffType.POSITIVE;
announced = true;
}
@Override

View File

@ -27,6 +27,10 @@ import com.watabou.noosa.Image;
public class Haste extends FlavourBuff {
{
type = buffType.POSITIVE;
}
public static final float DURATION = 20f;
@Override

View File

@ -37,6 +37,8 @@ public class Healing extends Buff {
//unlike other buffs, this one acts after the hero and takes priority against other effects
//healing is much more useful if you get some of it off before taking damage
actPriority = HERO_PRIO - 1;
type = buffType.POSITIVE;
}
@Override

View File

@ -39,6 +39,7 @@ public class Invisibility extends FlavourBuff {
{
type = buffType.POSITIVE;
announced = true;
}
@Override

View File

@ -29,6 +29,10 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.noosa.Image;
public class Levitation extends FlavourBuff {
{
type = buffType.POSITIVE;
}
public static final float DURATION = 20f;

View File

@ -29,6 +29,10 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.noosa.Image;
public class Light extends FlavourBuff {
{
type = buffType.POSITIVE;
}
public static final float DURATION = 300f;
public static final int DISTANCE = 6;

View File

@ -35,6 +35,7 @@ public class MagicalSight extends FlavourBuff {
{
type = buffType.POSITIVE;
announced = true;
}
@Override

View File

@ -35,6 +35,7 @@ public class MindVision extends FlavourBuff {
{
type = buffType.POSITIVE;
announced = true;
}
@Override

View File

@ -28,6 +28,10 @@ import com.watabou.utils.Bundle;
public class Momentum extends Buff {
{
type = buffType.POSITIVE;
}
private int stacks = 0;
private int turnsSinceMove = 0;

View File

@ -31,6 +31,7 @@ public class Ooze extends Buff {
{
type = buffType.NEGATIVE;
announced = true;
}
@Override

View File

@ -36,6 +36,7 @@ public class Paralysis extends FlavourBuff {
{
type = buffType.NEGATIVE;
announced = true;
}
@Override
@ -102,6 +103,10 @@ public class Paralysis extends FlavourBuff {
public static class ParalysisResist extends Buff {
{
type = buffType.POSITIVE;
}
private int damage;
@Override

View File

@ -41,6 +41,7 @@ public class Poison extends Buff implements Hero.Doom {
{
type = buffType.NEGATIVE;
announced = true;
}
@Override

View File

@ -26,6 +26,10 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.noosa.Image;
public class Recharging extends FlavourBuff {
{
type = buffType.POSITIVE;
}
@Override
public int icon() {

View File

@ -29,6 +29,7 @@ public class Roots extends FlavourBuff {
{
type = buffType.NEGATIVE;
announced = true;
}
@Override

View File

@ -37,7 +37,7 @@ public class Shadows extends Invisibility {
private static final String LEFT = "left";
{
type = buffType.SILENT;
announced = false;
}
@Override

View File

@ -28,6 +28,7 @@ public class Slow extends FlavourBuff {
{
type = buffType.NEGATIVE;
announced = true;
}
public static final float DURATION = 10f;

View File

@ -31,6 +31,7 @@ public class SoulMark extends FlavourBuff {
{
type = buffType.NEGATIVE;
announced = true;
}
@Override

View File

@ -27,6 +27,10 @@ import com.watabou.noosa.Image;
public class Stamina extends FlavourBuff {
{
type = buffType.POSITIVE;
}
@Override
public int icon() {
return BuffIndicator.MOMENTUM;

View File

@ -33,6 +33,7 @@ public class Terror extends FlavourBuff {
{
type = buffType.NEGATIVE;
announced = true;
}
@Override

View File

@ -30,6 +30,10 @@ import com.watabou.noosa.Image;
import com.watabou.utils.Bundle;
public class ToxicImbue extends Buff {
{
type = buffType.POSITIVE;
}
public static final float DURATION = 30f;

View File

@ -30,6 +30,7 @@ public class Vertigo extends FlavourBuff {
{
type = buffType.NEGATIVE;
announced = true;
}
@Override

View File

@ -30,6 +30,7 @@ public class Weakness extends FlavourBuff {
{
type = buffType.NEGATIVE;
announced = true;
}
@Override

View File

@ -208,6 +208,10 @@ public class MirrorImage extends NPC {
public static class MirrorInvis extends Invisibility {
{
announced = false;
}
@Override
public int icon() {
return BuffIndicator.NONE;

View File

@ -45,6 +45,10 @@ public class Brimstone extends Armor.Glyph {
}
public static class BrimstoneShield extends ShieldBuff {
{
type = buffType.POSITIVE;
}
@Override
public boolean act() {

View File

@ -46,6 +46,11 @@ public class Camouflage extends Armor.Glyph {
}
public static class Camo extends Invisibility {
{
announced = false;
}
private int pos;
private int left;

View File

@ -72,6 +72,10 @@ public class Viscosity extends Glyph {
public static class DeferedDamage extends Buff {
{
type = buffType.NEGATIVE;
}
protected int damage = 0;
private static final String DAMAGE = "damage";

View File

@ -200,6 +200,11 @@ public class CloakOfShadows extends Artifact {
}
public class cloakStealth extends ArtifactBuff{
{
type = buffType.POSITIVE;
}
int turnsToCost = 0;
@Override

View File

@ -222,6 +222,10 @@ public class TimekeepersHourglass extends Artifact {
}
public class timeStasis extends ArtifactBuff {
{
type = buffType.POSITIVE;
}
@Override
public boolean attachTo(Char target) {
@ -269,6 +273,10 @@ public class TimekeepersHourglass extends Artifact {
}
public class timeFreeze extends ArtifactBuff {
{
type = buffType.POSITIVE;
}
float partialTime = 1f;

View File

@ -67,6 +67,7 @@ public class StoneOfAggression extends Runestone {
{
type = buffType.NEGATIVE;
announced = true;
}
@Override

View File

@ -67,6 +67,7 @@ public class StoneOfAvoidance extends Runestone {
{
type = buffType.NEGATIVE;
announced = true;
}
@Override

View File

@ -74,6 +74,7 @@ public class Earthroot extends Plant {
{
type = buffType.POSITIVE;
announced = true;
}
@Override

View File

@ -75,6 +75,7 @@ public class Sungrass extends Plant {
{
type = buffType.POSITIVE;
announced = true;
}
@Override

View File

@ -61,6 +61,7 @@ public class Swiftthistle extends Plant {
{
type = buffType.POSITIVE;
announced = true;
}
@Override