Commit 5317a4f0 authored by Thomas Dupriez's avatar Thomas Dupriez
Browse files

Action.HIT added to an entity when it's hit

parent 6b8db97a
......@@ -140,6 +140,9 @@ public class Being extends Entity {
* @return true if this is dead. false otherwise.
*/
public boolean takeDamage(int damage){
if(damage>0) {
addAction(Action.HIT);
}
HP=Math.min(maxHP, Math.max(HP-damage, 0));
if (HP==0){
Event event = new ToServerDeathEvent(this.getID());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment