v0.9.2: improved the buff fading behaviour for combo
This commit is contained in:
parent
54a85767de
commit
ee4381420b
|
@ -54,6 +54,7 @@ public class Combo extends Buff implements ActionIndicator.Action {
|
||||||
|
|
||||||
private int count = 0;
|
private int count = 0;
|
||||||
private float comboTime = 0f;
|
private float comboTime = 0f;
|
||||||
|
private float initialComboTime = 5f;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int icon() {
|
public int icon() {
|
||||||
|
@ -72,7 +73,7 @@ public class Combo extends Buff implements ActionIndicator.Action {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float iconFadePercent() {
|
public float iconFadePercent() {
|
||||||
return Math.max(0, (5 - comboTime)/5f);
|
return Math.max(0, (initialComboTime - comboTime)/ initialComboTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -90,6 +91,8 @@ public class Combo extends Buff implements ActionIndicator.Action {
|
||||||
comboTime = Math.max(comboTime, 10*((Hero)target).pointsInTalent(Talent.CLEAVE));
|
comboTime = Math.max(comboTime, 10*((Hero)target).pointsInTalent(Talent.CLEAVE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
initialComboTime = comboTime;
|
||||||
|
|
||||||
if ((getHighestMove() != null)) {
|
if ((getHighestMove() != null)) {
|
||||||
|
|
||||||
ActionIndicator.setAction( this );
|
ActionIndicator.setAction( this );
|
||||||
|
@ -126,6 +129,7 @@ public class Combo extends Buff implements ActionIndicator.Action {
|
||||||
|
|
||||||
private static final String COUNT = "count";
|
private static final String COUNT = "count";
|
||||||
private static final String TIME = "combotime";
|
private static final String TIME = "combotime";
|
||||||
|
private static final String INITIAL_TIME = "initialComboTime";
|
||||||
|
|
||||||
private static final String CLOBBER_USED = "clobber_used";
|
private static final String CLOBBER_USED = "clobber_used";
|
||||||
private static final String PARRY_USED = "parry_used";
|
private static final String PARRY_USED = "parry_used";
|
||||||
|
@ -135,6 +139,7 @@ public class Combo extends Buff implements ActionIndicator.Action {
|
||||||
super.storeInBundle(bundle);
|
super.storeInBundle(bundle);
|
||||||
bundle.put(COUNT, count);
|
bundle.put(COUNT, count);
|
||||||
bundle.put(TIME, comboTime);
|
bundle.put(TIME, comboTime);
|
||||||
|
bundle.put(INITIAL_TIME, initialComboTime);
|
||||||
|
|
||||||
bundle.put(CLOBBER_USED, clobberUsed);
|
bundle.put(CLOBBER_USED, clobberUsed);
|
||||||
bundle.put(PARRY_USED, parryUsed);
|
bundle.put(PARRY_USED, parryUsed);
|
||||||
|
@ -146,6 +151,10 @@ public class Combo extends Buff implements ActionIndicator.Action {
|
||||||
count = bundle.getInt( COUNT );
|
count = bundle.getInt( COUNT );
|
||||||
comboTime = bundle.getFloat( TIME );
|
comboTime = bundle.getFloat( TIME );
|
||||||
|
|
||||||
|
//pre-0.9.2
|
||||||
|
if (bundle.contains(INITIAL_TIME)) initialComboTime = bundle.getFloat( INITIAL_TIME );
|
||||||
|
else initialComboTime = 5;
|
||||||
|
|
||||||
clobberUsed = bundle.getBoolean(CLOBBER_USED);
|
clobberUsed = bundle.getBoolean(CLOBBER_USED);
|
||||||
parryUsed = bundle.getBoolean(PARRY_USED);
|
parryUsed = bundle.getBoolean(PARRY_USED);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user