v0.9.2: fixed various errors with momentum
This commit is contained in:
parent
3c75ca0406
commit
dd8ec8033c
|
@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||||
import com.watabou.noosa.Image;
|
import com.watabou.noosa.Image;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
import com.watabou.utils.Bundle;
|
import com.watabou.utils.Bundle;
|
||||||
|
import com.watabou.utils.GameMath;
|
||||||
|
|
||||||
public class Momentum extends Buff implements ActionIndicator.Action {
|
public class Momentum extends Buff implements ActionIndicator.Action {
|
||||||
|
|
||||||
|
@ -63,7 +64,7 @@ public class Momentum extends Buff implements ActionIndicator.Action {
|
||||||
freerunTurns--;
|
freerunTurns--;
|
||||||
}
|
}
|
||||||
} else if (!movedLastTurn){
|
} else if (!movedLastTurn){
|
||||||
momentumStacks = Math.min(momentumStacks -1, Math.round(momentumStacks * 0.667f));
|
momentumStacks = (int)GameMath.gate(0, momentumStacks-1, Math.round(momentumStacks * 0.667f));
|
||||||
if (momentumStacks <= 0) {
|
if (momentumStacks <= 0) {
|
||||||
ActionIndicator.clearAction(this);
|
ActionIndicator.clearAction(this);
|
||||||
if (freerunCooldown <= 0) detach();
|
if (freerunCooldown <= 0) detach();
|
||||||
|
@ -78,7 +79,7 @@ public class Momentum extends Buff implements ActionIndicator.Action {
|
||||||
public void gainStack(){
|
public void gainStack(){
|
||||||
movedLastTurn = true;
|
movedLastTurn = true;
|
||||||
if (freerunCooldown <= 0){
|
if (freerunCooldown <= 0){
|
||||||
postpone(target.cooldown());
|
postpone(target.cooldown()+(1/target.speed()));
|
||||||
momentumStacks = Math.min(momentumStacks + 1, 10);
|
momentumStacks = Math.min(momentumStacks + 1, 10);
|
||||||
ActionIndicator.setAction(this);
|
ActionIndicator.setAction(this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user