v0.9.1: cleaned up shield buff code a bit
This commit is contained in:
parent
fea825d2ee
commit
157b2cab44
|
@ -34,7 +34,19 @@ public class Barrier extends ShieldBuff {
|
||||||
}
|
}
|
||||||
|
|
||||||
float partialLostShield;
|
float partialLostShield;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void incShield(int amt) {
|
||||||
|
super.incShield(amt);
|
||||||
|
partialLostShield = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setShield(int shield) {
|
||||||
|
super.setShield(shield);
|
||||||
|
if (shielding() == shield) partialLostShield = 0;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean act() {
|
public boolean act() {
|
||||||
|
|
||||||
|
|
|
@ -49,41 +49,26 @@ public abstract class ShieldBuff extends Buff {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setShield( int shield ) {
|
public void setShield( int shield ) {
|
||||||
setShield(shield, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setShield( int shield, float delay ) {
|
|
||||||
if (this.shielding <= shield) this.shielding = shield;
|
if (this.shielding <= shield) this.shielding = shield;
|
||||||
if (target != null) target.needsShieldUpdate = true;
|
if (target != null) target.needsShieldUpdate = true;
|
||||||
spend(delay);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void incShield(){
|
public void incShield(){
|
||||||
incShield(1);
|
incShield(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void incShield( int amt ){
|
|
||||||
incShield(amt, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void incShield( int amt, float delay ){
|
public void incShield( int amt ){
|
||||||
shielding += amt;
|
shielding += amt;
|
||||||
if (target != null) target.needsShieldUpdate = true;
|
if (target != null) target.needsShieldUpdate = true;
|
||||||
spend(delay);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void decShield(){
|
public void decShield(){
|
||||||
decShield(1);
|
decShield(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void decShield( int amt ){
|
|
||||||
decShield(amt, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void decShield( int amt, float delay ){
|
public void decShield( int amt ){
|
||||||
shielding -= amt;
|
shielding -= amt;
|
||||||
if (target != null) target.needsShieldUpdate = true;
|
if (target != null) target.needsShieldUpdate = true;
|
||||||
spend(delay);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//returns the amount of damage leftover
|
//returns the amount of damage leftover
|
||||||
|
|
Loading…
Reference in New Issue
Block a user