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

Taking bashing, lethal & agg damage

parent 9f6d73ee
No related branches found
No related tags found
No related merge requests found
......@@ -61,4 +61,53 @@ public class Health {
}
sort();
}
/**
* Take bashing damage
*/
public void bashingDamage(int damage) {
if(bashing + damage > numberOfHealth.get()) {
bashing = numberOfHealth.get();
lethalDamage(bashing + damage - numberOfHealth.get());
} else {
bashing += damage;
}
}
/**
* Take lethal damage
*/
public void lethalDamage(int damage) {
if(lethal + damage > numberOfHealth.get()) {
lethal = numberOfHealth.get();
aggDamage(lethal + damage - numberOfHealth.get());
} else {
lethal += damage;
}
if(bashing < lethal) {
bashing = lethal;
}
}
/**
* Take agg damage
*/
public void aggDamage(int damage) {
if(agg + damage > numberOfHealth.get()) {
agg = numberOfHealth.get();
death(agg + damage - numberOfHealth.get());
} else {
agg += damage;
}
if(lethal < agg) {
lethal = agg;
}
}
/**
* When agg damage == health
*/
public void death(int damage) {
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment