cleaned up formatting:
- removed trailing whitespace - changed all leading whitespace to tabs - removed IDE created author comments
This commit is contained in:
@@ -31,14 +31,14 @@ public class Amok extends FlavourBuff {
|
||||
return BuffIndicator.AMOK;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detach() {
|
||||
super.detach();
|
||||
if (target instanceof Mob)
|
||||
((Mob)target).aggro( null );
|
||||
}
|
||||
@Override
|
||||
public void detach() {
|
||||
super.detach();
|
||||
if (target instanceof Mob)
|
||||
((Mob)target).aggro( null );
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Amok";
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class Bleeding extends Buff {
|
||||
|
||||
target.damage( level, this );
|
||||
if (target.sprite.visible) {
|
||||
Splash.at( target.sprite.center(), -PointF.PI / 2, PointF.PI / 6,
|
||||
Splash.at( target.sprite.center(), -PointF.PI / 2, PointF.PI / 6,
|
||||
target.sprite.blood(), Math.min( 10 * level / target.HT, 10 ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -3,9 +3,6 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||
|
||||
/**
|
||||
* Created by debenhame on 27/04/2015.
|
||||
*/
|
||||
public class Bless extends FlavourBuff {
|
||||
|
||||
{
|
||||
|
||||
@@ -37,9 +37,9 @@ public class Buff extends Actor {
|
||||
public enum buffType {POSITIVE, NEGATIVE, NEUTRAL, SILENT};
|
||||
public buffType type = buffType.SILENT;
|
||||
|
||||
public HashSet<Class<?>> resistances = new HashSet<Class<?>>();
|
||||
public HashSet<Class<?>> resistances = new HashSet<Class<?>>();
|
||||
|
||||
public HashSet<Class<?>> immunities = new HashSet<Class<?>>();
|
||||
public HashSet<Class<?>> immunities = new HashSet<Class<?>>();
|
||||
|
||||
public boolean attachTo( Char target ) {
|
||||
|
||||
@@ -50,11 +50,11 @@ public class Buff extends Actor {
|
||||
this.target = target;
|
||||
target.add( this );
|
||||
|
||||
if (target.buffs().contains(this)){
|
||||
if (target.buffs().contains(this)){
|
||||
if (target.sprite != null) fx( true );
|
||||
return true;
|
||||
} else
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
public void detach() {
|
||||
|
||||
@@ -89,7 +89,7 @@ public class Burning extends Buff implements Hero.Doom {
|
||||
} else if (item instanceof MysteryMeat) {
|
||||
|
||||
item = item.detach( hero.belongings.backpack );
|
||||
ChargrilledMeat steak = new ChargrilledMeat();
|
||||
ChargrilledMeat steak = new ChargrilledMeat();
|
||||
if (!steak.collect( hero.belongings.backpack )) {
|
||||
Dungeon.level.drop( steak, hero.pos ).sprite.drop();
|
||||
}
|
||||
|
||||
@@ -15,9 +15,6 @@ import com.watabou.utils.Random;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
/**
|
||||
* Created by debenhame on 23/04/2015.
|
||||
*/
|
||||
public class Chill extends FlavourBuff {
|
||||
|
||||
private static final String TXT_FREEZES = "%s freezes!";
|
||||
|
||||
@@ -3,9 +3,6 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||
|
||||
/**
|
||||
* Created by Evan on 14/05/2015.
|
||||
*/
|
||||
public class Corruption extends Buff {
|
||||
|
||||
{
|
||||
|
||||
@@ -23,43 +23,43 @@ import com.watabou.utils.Random;
|
||||
|
||||
public class Drowsy extends Buff {
|
||||
|
||||
{
|
||||
type = buffType.NEUTRAL;
|
||||
}
|
||||
{
|
||||
type = buffType.NEUTRAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int icon() {
|
||||
return BuffIndicator.DROWSY;
|
||||
}
|
||||
@Override
|
||||
public int icon() {
|
||||
return BuffIndicator.DROWSY;
|
||||
}
|
||||
|
||||
public boolean attachTo( Char target ) {
|
||||
if (!target.immunities().contains(Sleep.class) && super.attachTo(target)) {
|
||||
if (cooldown() == 0)
|
||||
spend(Random.Int(3, 6));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public boolean attachTo( Char target ) {
|
||||
if (!target.immunities().contains(Sleep.class) && super.attachTo(target)) {
|
||||
if (cooldown() == 0)
|
||||
spend(Random.Int(3, 6));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean act(){
|
||||
Buff.affect(target, MagicalSleep.class);
|
||||
@Override
|
||||
public boolean act(){
|
||||
Buff.affect(target, MagicalSleep.class);
|
||||
|
||||
detach();
|
||||
return true;
|
||||
}
|
||||
detach();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Drowsy";
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Drowsy";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return "A magical force is making it difficult to stay awake.\n" +
|
||||
"\n" +
|
||||
"The hero can resist drowsiness by taking damage or by being at full health.\n" +
|
||||
"\n" +
|
||||
"After " + dispTurns(cooldown()+1) + ", the target will fall into a deep magical sleep.";
|
||||
}
|
||||
@Override
|
||||
public String desc() {
|
||||
return "A magical force is making it difficult to stay awake.\n" +
|
||||
"\n" +
|
||||
"The hero can resist drowsiness by taking damage or by being at full health.\n" +
|
||||
"\n" +
|
||||
"After " + dispTurns(cooldown()+1) + ", the target will fall into a deep magical sleep.";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,40 +8,37 @@ import com.watabou.utils.Bundle;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* Created by debenhame on 19/11/2014.
|
||||
*/
|
||||
public class EarthImbue extends FlavourBuff {
|
||||
|
||||
public static final float DURATION = 30f;
|
||||
public static final float DURATION = 30f;
|
||||
|
||||
public void proc(Char enemy){
|
||||
Buff.affect(enemy, Roots.class, 2);
|
||||
CellEmitter.bottom(enemy.pos).start(EarthParticle.FACTORY, 0.05f, 8);
|
||||
}
|
||||
public void proc(Char enemy){
|
||||
Buff.affect(enemy, Roots.class, 2);
|
||||
CellEmitter.bottom(enemy.pos).start(EarthParticle.FACTORY, 0.05f, 8);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int icon() {
|
||||
return BuffIndicator.ROOTS;
|
||||
}
|
||||
@Override
|
||||
public int icon() {
|
||||
return BuffIndicator.ROOTS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Imbued with Earth";
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Imbued with Earth";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return "You are inbued with the power of earth!\n" +
|
||||
"\n" +
|
||||
"All physical attacks will command roots to lock the enemy in place while the effect lasts.\n" +
|
||||
"\n" +
|
||||
"You are imbued for " + dispTurns() + ".";
|
||||
}
|
||||
@Override
|
||||
public String desc() {
|
||||
return "You are inbued with the power of earth!\n" +
|
||||
"\n" +
|
||||
"All physical attacks will command roots to lock the enemy in place while the effect lasts.\n" +
|
||||
"\n" +
|
||||
"You are imbued for " + dispTurns() + ".";
|
||||
}
|
||||
|
||||
{
|
||||
immunities.add( Paralysis.class );
|
||||
immunities.add( Roots.class );
|
||||
immunities.add( Slow.class );
|
||||
}
|
||||
{
|
||||
immunities.add( Paralysis.class );
|
||||
immunities.add( Roots.class );
|
||||
immunities.add( Slow.class );
|
||||
}
|
||||
}
|
||||
@@ -11,77 +11,74 @@ import com.watabou.utils.Random;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* Created by debenhame on 19/11/2014.
|
||||
*/
|
||||
public class FireImbue extends Buff {
|
||||
|
||||
public static final float DURATION = 30f;
|
||||
public static final float DURATION = 30f;
|
||||
|
||||
protected float left;
|
||||
protected float left;
|
||||
|
||||
private static final String LEFT = "left";
|
||||
private static final String LEFT = "left";
|
||||
|
||||
@Override
|
||||
public void storeInBundle( Bundle bundle ) {
|
||||
super.storeInBundle( bundle );
|
||||
bundle.put( LEFT, left );
|
||||
@Override
|
||||
public void storeInBundle( Bundle bundle ) {
|
||||
super.storeInBundle( bundle );
|
||||
bundle.put( LEFT, left );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreFromBundle( Bundle bundle ) {
|
||||
super.restoreFromBundle( bundle );
|
||||
left = bundle.getFloat( LEFT );
|
||||
}
|
||||
@Override
|
||||
public void restoreFromBundle( Bundle bundle ) {
|
||||
super.restoreFromBundle( bundle );
|
||||
left = bundle.getFloat( LEFT );
|
||||
}
|
||||
|
||||
public void set( float duration ) {
|
||||
this.left = duration;
|
||||
};
|
||||
public void set( float duration ) {
|
||||
this.left = duration;
|
||||
};
|
||||
|
||||
@Override
|
||||
public boolean act() {
|
||||
if (Dungeon.level.map[target.pos] == Terrain.GRASS) {
|
||||
Dungeon.level.set(target.pos, Terrain.EMBERS);
|
||||
GameScene.updateMap(target.pos);
|
||||
}
|
||||
@Override
|
||||
public boolean act() {
|
||||
if (Dungeon.level.map[target.pos] == Terrain.GRASS) {
|
||||
Dungeon.level.set(target.pos, Terrain.EMBERS);
|
||||
GameScene.updateMap(target.pos);
|
||||
}
|
||||
|
||||
spend(TICK);
|
||||
left -= TICK;
|
||||
if (left <= 0)
|
||||
detach();
|
||||
spend(TICK);
|
||||
left -= TICK;
|
||||
if (left <= 0)
|
||||
detach();
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void proc(Char enemy){
|
||||
if (Random.Int(2) == 0)
|
||||
Buff.affect( enemy, Burning.class ).reignite( enemy );
|
||||
public void proc(Char enemy){
|
||||
if (Random.Int(2) == 0)
|
||||
Buff.affect( enemy, Burning.class ).reignite( enemy );
|
||||
|
||||
enemy.sprite.emitter().burst( FlameParticle.FACTORY, 2 );
|
||||
}
|
||||
enemy.sprite.emitter().burst( FlameParticle.FACTORY, 2 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int icon() {
|
||||
return BuffIndicator.FIRE;
|
||||
}
|
||||
@Override
|
||||
public int icon() {
|
||||
return BuffIndicator.FIRE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Imbued with Fire";
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Imbued with Fire";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return "You are imbued with the power of fire!\n" +
|
||||
"\n" +
|
||||
"All physical attacks will have a chance to light enemies ablaze. " +
|
||||
"Additionally, you are completely immune to the effects of fire.\n" +
|
||||
"\n" +
|
||||
"You are imbued for " + dispTurns(left) + ".";
|
||||
}
|
||||
@Override
|
||||
public String desc() {
|
||||
return "You are imbued with the power of fire!\n" +
|
||||
"\n" +
|
||||
"All physical attacks will have a chance to light enemies ablaze. " +
|
||||
"Additionally, you are completely immune to the effects of fire.\n" +
|
||||
"\n" +
|
||||
"You are imbued for " + dispTurns(left) + ".";
|
||||
}
|
||||
|
||||
{
|
||||
immunities.add( Burning.class );
|
||||
}
|
||||
{
|
||||
immunities.add( Burning.class );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class Frost extends FlavourBuff {
|
||||
} else if (item instanceof MysteryMeat) {
|
||||
|
||||
item = item.detach( hero.belongings.backpack );
|
||||
FrozenCarpaccio carpaccio = new FrozenCarpaccio();
|
||||
FrozenCarpaccio carpaccio = new FrozenCarpaccio();
|
||||
if (!carpaccio.collect( hero.belongings.backpack )) {
|
||||
Dungeon.level.drop( carpaccio, target.pos ).sprite.drop();
|
||||
}
|
||||
|
||||
@@ -39,10 +39,10 @@ public class GasesImmunity extends FlavourBuff {
|
||||
}
|
||||
|
||||
{
|
||||
immunities.add( ParalyticGas.class );
|
||||
immunities.add( ToxicGas.class );
|
||||
immunities.add( ConfusionGas.class );
|
||||
immunities.add( StenchGas.class );
|
||||
immunities.add( ParalyticGas.class );
|
||||
immunities.add( ToxicGas.class );
|
||||
immunities.add( ConfusionGas.class );
|
||||
immunities.add( StenchGas.class );
|
||||
immunities.add( VenomGas.class );
|
||||
}
|
||||
|
||||
|
||||
@@ -44,8 +44,8 @@ public class Invisibility extends FlavourBuff {
|
||||
|
||||
@Override
|
||||
public void detach() {
|
||||
if (target.invisible > 0)
|
||||
target.invisible--;
|
||||
if (target.invisible > 0)
|
||||
target.invisible--;
|
||||
super.detach();
|
||||
}
|
||||
|
||||
@@ -80,15 +80,15 @@ public class Invisibility extends FlavourBuff {
|
||||
if (buff != null) {
|
||||
buff.detach();
|
||||
}
|
||||
CloakOfShadows.cloakStealth cloakBuff = Dungeon.hero.buff( CloakOfShadows.cloakStealth.class );
|
||||
if (cloakBuff != null) {
|
||||
cloakBuff.act();
|
||||
cloakBuff.detach();
|
||||
}
|
||||
//this isn't a form of invisibilty, but it is meant to dispel at the same time as it.
|
||||
TimekeepersHourglass.timeFreeze timeFreeze = Dungeon.hero.buff( TimekeepersHourglass.timeFreeze.class );
|
||||
if (timeFreeze != null) {
|
||||
timeFreeze.detach();
|
||||
}
|
||||
CloakOfShadows.cloakStealth cloakBuff = Dungeon.hero.buff( CloakOfShadows.cloakStealth.class );
|
||||
if (cloakBuff != null) {
|
||||
cloakBuff.act();
|
||||
cloakBuff.detach();
|
||||
}
|
||||
//this isn't a form of invisibilty, but it is meant to dispel at the same time as it.
|
||||
TimekeepersHourglass.timeFreeze timeFreeze = Dungeon.hero.buff( TimekeepersHourglass.timeFreeze.class );
|
||||
if (timeFreeze != null) {
|
||||
timeFreeze.detach();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,6 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||
|
||||
/**
|
||||
* Created by Evan on 04/04/2015.
|
||||
*/
|
||||
public class LockedFloor extends Buff {
|
||||
//this buff is purely meant as a visual indicator that the gameplay implications of a level seal are in effect.
|
||||
|
||||
|
||||
@@ -25,70 +25,70 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
|
||||
public class MagicalSleep extends Buff {
|
||||
|
||||
private static final float STEP = 1f;
|
||||
public static final float SWS = 1.5f;
|
||||
private static final float STEP = 1f;
|
||||
public static final float SWS = 1.5f;
|
||||
|
||||
@Override
|
||||
public boolean attachTo( Char target ) {
|
||||
if (super.attachTo( target ) && !target.immunities().contains(Sleep.class)) {
|
||||
@Override
|
||||
public boolean attachTo( Char target ) {
|
||||
if (super.attachTo( target ) && !target.immunities().contains(Sleep.class)) {
|
||||
|
||||
if (target instanceof Hero)
|
||||
if (target.HP == target.HT) {
|
||||
GLog.i("You are too healthy, and resist the urge to sleep.");
|
||||
detach();
|
||||
return true;
|
||||
} else {
|
||||
GLog.i("You fall into a deep magical sleep.");
|
||||
}
|
||||
else if (target instanceof Mob)
|
||||
((Mob)target).state = ((Mob)target).SLEEPING;
|
||||
if (target instanceof Hero)
|
||||
if (target.HP == target.HT) {
|
||||
GLog.i("You are too healthy, and resist the urge to sleep.");
|
||||
detach();
|
||||
return true;
|
||||
} else {
|
||||
GLog.i("You fall into a deep magical sleep.");
|
||||
}
|
||||
else if (target instanceof Mob)
|
||||
((Mob)target).state = ((Mob)target).SLEEPING;
|
||||
|
||||
target.paralysed = true;
|
||||
target.paralysed = true;
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean act(){
|
||||
if (target instanceof Hero) {
|
||||
target.HP = Math.min(target.HP+1, target.HT);
|
||||
((Hero) target).restoreHealth = true;
|
||||
if (target.HP == target.HT) {
|
||||
GLog.p("You wake up feeling refreshed and healthy.");
|
||||
detach();
|
||||
}
|
||||
}
|
||||
spend( STEP );
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean act(){
|
||||
if (target instanceof Hero) {
|
||||
target.HP = Math.min(target.HP+1, target.HT);
|
||||
((Hero) target).restoreHealth = true;
|
||||
if (target.HP == target.HT) {
|
||||
GLog.p("You wake up feeling refreshed and healthy.");
|
||||
detach();
|
||||
}
|
||||
}
|
||||
spend( STEP );
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detach() {
|
||||
target.paralysed = false;
|
||||
if (target instanceof Hero)
|
||||
((Hero) target).restoreHealth = false;
|
||||
super.detach();
|
||||
}
|
||||
@Override
|
||||
public void detach() {
|
||||
target.paralysed = false;
|
||||
if (target instanceof Hero)
|
||||
((Hero) target).restoreHealth = false;
|
||||
super.detach();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int icon() {
|
||||
return BuffIndicator.MAGIC_SLEEP;
|
||||
}
|
||||
@Override
|
||||
public int icon() {
|
||||
return BuffIndicator.MAGIC_SLEEP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Magical Sleep";
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Magical Sleep";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return "This character has fallen into a deep magical sleep which they will not wake from naturally.\n" +
|
||||
"\n" +
|
||||
"Magical sleep is similar to regular sleep, except that only damage will cause the target to wake up. \n" +
|
||||
"\n" +
|
||||
"For the hero, magical sleep has some restorative properties, allowing them to rapidly heal while resting.";
|
||||
}
|
||||
@Override
|
||||
public String desc() {
|
||||
return "This character has fallen into a deep magical sleep which they will not wake from naturally.\n" +
|
||||
"\n" +
|
||||
"Magical sleep is similar to regular sleep, except that only damage will cause the target to wake up. \n" +
|
||||
"\n" +
|
||||
"For the hero, magical sleep has some restorative properties, allowing them to rapidly heal while resting.";
|
||||
}
|
||||
}
|
||||
@@ -55,10 +55,10 @@ public class Ooze extends Buff {
|
||||
@Override
|
||||
public boolean act() {
|
||||
if (target.isAlive()) {
|
||||
if (Dungeon.depth > 4)
|
||||
target.damage( Dungeon.depth/5, this );
|
||||
else if (Random.Int(2) == 0)
|
||||
target.damage( 1, this );
|
||||
if (Dungeon.depth > 4)
|
||||
target.damage( Dungeon.depth/5, this );
|
||||
else if (Random.Int(2) == 0)
|
||||
target.damage( 1, this );
|
||||
if (!target.isAlive() && target == Dungeon.hero) {
|
||||
Dungeon.fail( ResultDescriptions.OOZE );
|
||||
GLog.n( TXT_HERO_KILLED, toString() );
|
||||
|
||||
@@ -9,9 +9,6 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
|
||||
/**
|
||||
* Created by debenhame on 06/02/2015.
|
||||
*/
|
||||
public class PinCushion extends Buff {
|
||||
|
||||
private ArrayList<MissileWeapon> items = new ArrayList<MissileWeapon>();
|
||||
|
||||
@@ -31,7 +31,7 @@ public class Regeneration extends Buff {
|
||||
|
||||
|
||||
|
||||
if (target.HP < target.HT && !((Hero)target).isStarving()) {
|
||||
if (target.HP < target.HT && !((Hero)target).isStarving()) {
|
||||
target.HP += 1;
|
||||
}
|
||||
|
||||
@@ -42,8 +42,8 @@ public class Regeneration extends Buff {
|
||||
spend( REGENERATION_DELAY * 1.5f );
|
||||
else
|
||||
spend( REGENERATION_DELAY - regenBuff.level()*0.9f );
|
||||
else
|
||||
spend( REGENERATION_DELAY );
|
||||
else
|
||||
spend( REGENERATION_DELAY );
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
@@ -8,69 +8,66 @@ import com.watabou.utils.Bundle;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* Created by debenhame on 19/11/2014.
|
||||
*/
|
||||
public class ToxicImbue extends Buff {
|
||||
|
||||
public static final float DURATION = 30f;
|
||||
public static final float DURATION = 30f;
|
||||
|
||||
protected float left;
|
||||
protected float left;
|
||||
|
||||
private static final String LEFT = "left";
|
||||
private static final String LEFT = "left";
|
||||
|
||||
@Override
|
||||
public void storeInBundle( Bundle bundle ) {
|
||||
super.storeInBundle( bundle );
|
||||
bundle.put( LEFT, left );
|
||||
@Override
|
||||
public void storeInBundle( Bundle bundle ) {
|
||||
super.storeInBundle( bundle );
|
||||
bundle.put( LEFT, left );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreFromBundle( Bundle bundle ) {
|
||||
super.restoreFromBundle( bundle );
|
||||
left = bundle.getFloat( LEFT );
|
||||
}
|
||||
@Override
|
||||
public void restoreFromBundle( Bundle bundle ) {
|
||||
super.restoreFromBundle( bundle );
|
||||
left = bundle.getFloat( LEFT );
|
||||
}
|
||||
|
||||
public void set( float duration ) {
|
||||
this.left = duration;
|
||||
};
|
||||
public void set( float duration ) {
|
||||
this.left = duration;
|
||||
};
|
||||
|
||||
|
||||
@Override
|
||||
public boolean act() {
|
||||
GameScene.add(Blob.seed(target.pos, 50, ToxicGas.class));
|
||||
@Override
|
||||
public boolean act() {
|
||||
GameScene.add(Blob.seed(target.pos, 50, ToxicGas.class));
|
||||
|
||||
spend(TICK);
|
||||
left -= TICK;
|
||||
if (left <= 0)
|
||||
detach();
|
||||
spend(TICK);
|
||||
left -= TICK;
|
||||
if (left <= 0)
|
||||
detach();
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int icon() {
|
||||
return BuffIndicator.IMMUNITY;
|
||||
}
|
||||
@Override
|
||||
public int icon() {
|
||||
return BuffIndicator.IMMUNITY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Imbued with Toxicity";
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Imbued with Toxicity";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return "You are imbued with poisonous energy!\n" +
|
||||
"\n" +
|
||||
"As you move around toxic gas will constantly billow forth from you, damaging your enemies. " +
|
||||
"You are immune to toxic gas and poison for the duration of the effect.\n" +
|
||||
"\n" +
|
||||
"You are imbued for " + dispTurns(left) + ".";
|
||||
}
|
||||
@Override
|
||||
public String desc() {
|
||||
return "You are imbued with poisonous energy!\n" +
|
||||
"\n" +
|
||||
"As you move around toxic gas will constantly billow forth from you, damaging your enemies. " +
|
||||
"You are immune to toxic gas and poison for the duration of the effect.\n" +
|
||||
"\n" +
|
||||
"You are imbued for " + dispTurns(left) + ".";
|
||||
}
|
||||
|
||||
{
|
||||
immunities.add( ToxicGas.class );
|
||||
immunities.add( Poison.class );
|
||||
}
|
||||
{
|
||||
immunities.add( ToxicGas.class );
|
||||
immunities.add( Poison.class );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,73 +5,70 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||
import com.watabou.utils.Bundle;
|
||||
|
||||
/**
|
||||
* Created by Evan on 12/04/2015.
|
||||
*/
|
||||
public class Venom extends Poison implements Hero.Doom {
|
||||
|
||||
private int damage = 1;
|
||||
private int damage = 1;
|
||||
|
||||
private static final String DAMAGE = "damage";
|
||||
private static final String DAMAGE = "damage";
|
||||
|
||||
{
|
||||
type = buffType.NEGATIVE;
|
||||
}
|
||||
{
|
||||
type = buffType.NEGATIVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void storeInBundle( Bundle bundle ) {
|
||||
super.storeInBundle( bundle );
|
||||
bundle.put( DAMAGE, damage );
|
||||
@Override
|
||||
public void storeInBundle( Bundle bundle ) {
|
||||
super.storeInBundle( bundle );
|
||||
bundle.put( DAMAGE, damage );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreFromBundle( Bundle bundle ) {
|
||||
super.restoreFromBundle( bundle );
|
||||
damage = bundle.getInt( DAMAGE );
|
||||
}
|
||||
@Override
|
||||
public void restoreFromBundle( Bundle bundle ) {
|
||||
super.restoreFromBundle( bundle );
|
||||
damage = bundle.getInt( DAMAGE );
|
||||
}
|
||||
|
||||
public void set(float duration, int damage) {
|
||||
set(duration);
|
||||
this.damage = damage;
|
||||
}
|
||||
public void set(float duration, int damage) {
|
||||
set(duration);
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int icon() {
|
||||
return BuffIndicator.POISON;
|
||||
}
|
||||
@Override
|
||||
public int icon() {
|
||||
return BuffIndicator.POISON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Venomed";
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Venomed";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return "Venom is a extremely caustic and dangerous poison.\n" +
|
||||
"\n" +
|
||||
"Unlike poison, whose damage lowers over time, venom does increasing damage the longer it stays on a target.\n" +
|
||||
"\n" +
|
||||
"This venom will last for " + dispTurns(left) + ", and is currently dealing " + damage + " damage.";
|
||||
}
|
||||
@Override
|
||||
public String desc() {
|
||||
return "Venom is a extremely caustic and dangerous poison.\n" +
|
||||
"\n" +
|
||||
"Unlike poison, whose damage lowers over time, venom does increasing damage the longer it stays on a target.\n" +
|
||||
"\n" +
|
||||
"This venom will last for " + dispTurns(left) + ", and is currently dealing " + damage + " damage.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean act() {
|
||||
if (target.isAlive()) {
|
||||
target.damage(damage, this);
|
||||
if (damage < ((Dungeon.depth+1)/2)+1)
|
||||
damage++;
|
||||
@Override
|
||||
public boolean act() {
|
||||
if (target.isAlive()) {
|
||||
target.damage(damage, this);
|
||||
if (damage < ((Dungeon.depth+1)/2)+1)
|
||||
damage++;
|
||||
|
||||
//want it to act after the cloud of venom it came from.
|
||||
spend( TICK+0.1f );
|
||||
if ((left -= TICK) <= 0) {
|
||||
detach();
|
||||
}
|
||||
} else {
|
||||
detach();
|
||||
}
|
||||
//want it to act after the cloud of venom it came from.
|
||||
spend( TICK+0.1f );
|
||||
if ((left -= TICK) <= 0) {
|
||||
detach();
|
||||
}
|
||||
} else {
|
||||
detach();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,34 +22,34 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||
|
||||
public class Vertigo extends FlavourBuff {
|
||||
|
||||
public static final float DURATION = 10f;
|
||||
public static final float DURATION = 10f;
|
||||
|
||||
{
|
||||
type = buffType.NEGATIVE;
|
||||
}
|
||||
{
|
||||
type = buffType.NEGATIVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int icon() {
|
||||
return BuffIndicator.VERTIGO;
|
||||
}
|
||||
@Override
|
||||
public int icon() {
|
||||
return BuffIndicator.VERTIGO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Vertigo";
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Vertigo";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return "Walking in a straight line can be difficult when the whole world is spinning.\n" +
|
||||
"\n" +
|
||||
"While under the effects of vertigo, characters who attempt to move will go in a random direction, " +
|
||||
"instead of the one they intended to go in. \n" +
|
||||
"\n" +
|
||||
"This Vertigo effect with last for " + dispTurns() + ".";
|
||||
}
|
||||
@Override
|
||||
public String desc() {
|
||||
return "Walking in a straight line can be difficult when the whole world is spinning.\n" +
|
||||
"\n" +
|
||||
"While under the effects of vertigo, characters who attempt to move will go in a random direction, " +
|
||||
"instead of the one they intended to go in. \n" +
|
||||
"\n" +
|
||||
"This Vertigo effect with last for " + dispTurns() + ".";
|
||||
}
|
||||
|
||||
public static float duration( Char ch ) {
|
||||
Resistance r = ch.buff( Resistance.class );
|
||||
return r != null ? r.durationFactor() * DURATION : DURATION;
|
||||
}
|
||||
public static float duration( Char ch ) {
|
||||
Resistance r = ch.buff( Resistance.class );
|
||||
return r != null ? r.durationFactor() * DURATION : DURATION;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user