v0.6.2: venom no longer extends poison
This commit is contained in:
+17
-5
@@ -21,17 +21,21 @@
|
|||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||||
import com.watabou.utils.Bundle;
|
import com.watabou.utils.Bundle;
|
||||||
|
|
||||||
public class Venom extends Poison implements Hero.Doom {
|
public class Venom extends Buff implements Hero.Doom {
|
||||||
|
|
||||||
private int damage = 1;
|
private int damage = 1;
|
||||||
|
protected float left;
|
||||||
|
|
||||||
private static final String DAMAGE = "damage";
|
private static final String DAMAGE = "damage";
|
||||||
|
private static final String LEFT = "left";
|
||||||
|
|
||||||
{
|
{
|
||||||
type = buffType.NEGATIVE;
|
type = buffType.NEGATIVE;
|
||||||
@@ -41,17 +45,18 @@ public class Venom extends Poison implements Hero.Doom {
|
|||||||
public void storeInBundle( Bundle bundle ) {
|
public void storeInBundle( Bundle bundle ) {
|
||||||
super.storeInBundle( bundle );
|
super.storeInBundle( bundle );
|
||||||
bundle.put( DAMAGE, damage );
|
bundle.put( DAMAGE, damage );
|
||||||
|
bundle.put( LEFT, left );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void restoreFromBundle( Bundle bundle ) {
|
public void restoreFromBundle( Bundle bundle ) {
|
||||||
super.restoreFromBundle( bundle );
|
super.restoreFromBundle( bundle );
|
||||||
damage = bundle.getInt( DAMAGE );
|
damage = bundle.getInt( DAMAGE );
|
||||||
|
left = bundle.getFloat( LEFT );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void set(float duration, int damage) {
|
public void set(float duration, int damage) {
|
||||||
set(duration);
|
this.left = Math.max(duration, left);
|
||||||
if (this.damage < damage) this.damage = damage;
|
if (this.damage < damage) this.damage = damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,8 +82,7 @@ public class Venom extends Poison implements Hero.Doom {
|
|||||||
if (damage < ((Dungeon.depth+1)/2)+1)
|
if (damage < ((Dungeon.depth+1)/2)+1)
|
||||||
damage++;
|
damage++;
|
||||||
|
|
||||||
//want it to act after the cloud of venom it came from.
|
spend( TICK );
|
||||||
spend( TICK+0.1f );
|
|
||||||
if ((left -= TICK) <= 0) {
|
if ((left -= TICK) <= 0) {
|
||||||
detach();
|
detach();
|
||||||
}
|
}
|
||||||
@@ -89,4 +93,12 @@ public class Venom extends Poison implements Hero.Doom {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDeath() {
|
||||||
|
Badges.validateDeathFromPoison();
|
||||||
|
|
||||||
|
Dungeon.fail( getClass() );
|
||||||
|
GLog.n( Messages.get(this, "ondeath") );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user