mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-07 16:49:12 +00:00
Add proper mob health deduction when they are damaged.
This commit is contained in:
@@ -116,8 +116,11 @@ public abstract class Mob extends Entity {
|
|||||||
*/
|
*/
|
||||||
public void damage(int damage, int type, boolean secondary) {
|
public void damage(int damage, int type, boolean secondary) {
|
||||||
Skill hitpoints = skillSet.getSkill(Skill.HITPOINTS);
|
Skill hitpoints = skillSet.getSkill(Skill.HITPOINTS);
|
||||||
blockSet.add(SynchronizationBlock.createHitUpdateBlock(damage, type, hitpoints.getCurrentLevel(),
|
int current = hitpoints.getCurrentLevel() - damage, maximum = hitpoints.getMaximumLevel();
|
||||||
hitpoints.getMaximumLevel(), secondary));
|
current = current < 0 ? 0 : current;
|
||||||
|
|
||||||
|
blockSet.add(SynchronizationBlock.createHitUpdateBlock(damage, type, current, maximum, secondary));
|
||||||
|
skillSet.setSkill(Skill.HITPOINTS, new Skill(hitpoints.getExperience(), current, maximum));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user