|
|
|
@ -106,7 +106,7 @@ public class Boat extends Collider {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Amount of health boat currently has, between 0 and 100
|
|
|
|
* Amount of health boat currently has, between 0 and 100
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private int health;
|
|
|
|
private double health;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Constructs a boat object with a given sourceID, name, country/team abbreviation, and polars table.
|
|
|
|
* Constructs a boat object with a given sourceID, name, country/team abbreviation, and polars table.
|
|
|
|
@ -441,11 +441,11 @@ public class Boat extends Collider {
|
|
|
|
isColliding = colliding;
|
|
|
|
isColliding = colliding;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int getHealth() {
|
|
|
|
public double getHealth() {
|
|
|
|
return health;
|
|
|
|
return health;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setHealth(int health) {
|
|
|
|
public void setHealth(double health) {
|
|
|
|
this.health = health;
|
|
|
|
this.health = health;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -453,7 +453,7 @@ public class Boat extends Collider {
|
|
|
|
* Add a given amount of HP to boat health
|
|
|
|
* Add a given amount of HP to boat health
|
|
|
|
* @param delta amount of HP to add
|
|
|
|
* @param delta amount of HP to add
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public void updateHealth(int delta) {
|
|
|
|
public void updateHealth(double delta) {
|
|
|
|
health += delta;
|
|
|
|
health += delta;
|
|
|
|
if(health < 0) health = 0;
|
|
|
|
if(health < 0) health = 0;
|
|
|
|
else if(health > 100) health = 100;
|
|
|
|
else if(health > 100) health = 100;
|
|
|
|
|