Skip to content
Snippets Groups Projects
Commit 0e6d69e9 authored by keyno10's avatar keyno10
Browse files

Resovled damage spill when max health reduced

parent f30bff8d
No related branches found
No related tags found
No related merge requests found
......@@ -56,10 +56,22 @@ public class Health {
* Remove Health boxes
*/
public void loseMaxHealth(int[] boxes) {
//Remove given health boxes
for(int box:boxes) {
healthBoxes.remove(Integer.valueOf(box));
}
sort();
//If new health levels lower than current damage, resolve
if(bashing > numberOfHealth.get()) {
bashingDamage(0);
}
if(lethal > numberOfHealth.get()) {
lethalDamage(0);
}
if(agg > numberOfHealth.get()) {
aggDamage(0);
}
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment