v2.1.0: fixed consistency errors between hold fast and patient strike
This commit is contained in:
@@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class HoldFast extends Buff {
|
||||
@@ -71,5 +72,17 @@ public class HoldFast extends Buff {
|
||||
return Messages.get(this, "desc", 2*Dungeon.hero.pointsInTalent(Talent.HOLD_FAST));
|
||||
}
|
||||
|
||||
private static final String POS = "pos";
|
||||
|
||||
@Override
|
||||
public void storeInBundle(Bundle bundle) {
|
||||
super.storeInBundle(bundle);
|
||||
bundle.put(POS, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreFromBundle(Bundle bundle) {
|
||||
super.restoreFromBundle(bundle);
|
||||
pos = bundle.getInt(POS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1257,7 +1257,7 @@ public class Hero extends Char {
|
||||
Buff.affect(this, HoldFast.class).pos = pos;
|
||||
}
|
||||
if (hasTalent(Talent.PATIENT_STRIKE)){
|
||||
Buff.prolong(this, Talent.PatientStrikeTracker.class, cooldown());
|
||||
Buff.affect(Dungeon.hero, Talent.PatientStrikeTracker.class).pos = Dungeon.hero.pos;
|
||||
}
|
||||
if (!fullRest) {
|
||||
if (sprite != null) {
|
||||
|
||||
@@ -231,12 +231,31 @@ public enum Talent {
|
||||
public float iconFadePercent() { return Math.max(0, visualcooldown() / 20); }
|
||||
};
|
||||
public static class SpiritBladesTracker extends FlavourBuff{};
|
||||
public static class PatientStrikeTracker extends FlavourBuff {
|
||||
public static class PatientStrikeTracker extends Buff {
|
||||
public int pos;
|
||||
{ type = Buff.buffType.POSITIVE; }
|
||||
public int icon() { return BuffIndicator.TIME; }
|
||||
public void tintIcon(Image icon) { icon.hardlight(0.5f, 0f, 1f); }
|
||||
public String iconTextDisplay() { return ""; }
|
||||
public float iconFadePercent() { return 0; }
|
||||
@Override
|
||||
public boolean act() {
|
||||
if (pos != target.pos) {
|
||||
detach();
|
||||
} else {
|
||||
spend(TICK);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
private static final String POS = "pos";
|
||||
@Override
|
||||
public void storeInBundle(Bundle bundle) {
|
||||
super.storeInBundle(bundle);
|
||||
bundle.put(POS, pos);
|
||||
}
|
||||
@Override
|
||||
public void restoreFromBundle(Bundle bundle) {
|
||||
super.restoreFromBundle(bundle);
|
||||
pos = bundle.getInt(POS);
|
||||
}
|
||||
};
|
||||
public static class AggressiveBarrierCooldown extends FlavourBuff{
|
||||
public int icon() { return BuffIndicator.TIME; }
|
||||
|
||||
@@ -260,7 +260,7 @@ public class Toolbar extends Component {
|
||||
Buff.affect(Dungeon.hero, HoldFast.class).pos = Dungeon.hero.pos;
|
||||
}
|
||||
if (Dungeon.hero.hasTalent(Talent.PATIENT_STRIKE)){
|
||||
Buff.prolong(Dungeon.hero, Talent.PatientStrikeTracker.class, Dungeon.hero.cooldown());
|
||||
Buff.affect(Dungeon.hero, Talent.PatientStrikeTracker.class).pos = Dungeon.hero.pos;
|
||||
}
|
||||
Dungeon.hero.next();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user