Fixed incorrect getters for base attributes in CreatureObject and added some setters

This commit is contained in:
Mads Boddum
2016-05-09 18:07:29 +02:00
parent 2669568eaf
commit dad8760e53
@@ -719,11 +719,11 @@ public class CreatureObject extends TangibleObject {
}
public int getMaxAction() {
return attributes.get(2);
return maxAttributes.get(2);
}
public int getBaseAction() {
return attributes.get(2);
return baseAttributes.get(2);
}
public void addAbility(String abilityName){
@@ -739,6 +739,13 @@ public class CreatureObject extends TangibleObject {
public Set<String> getAbilityNames() { return abilities.keySet(); };
public void setBaseHealth(int baseHealth) {
synchronized(baseAttributes) {
baseAttributes.set(0, baseHealth);
baseAttributes.sendDeltaMessage(this);
}
}
public void setHealth(int health) {
synchronized(attributes) {
attributes.set(0, health);
@@ -753,6 +760,13 @@ public class CreatureObject extends TangibleObject {
}
}
public void setBaseAction(int baseAction) {
synchronized(baseAttributes) {
baseAttributes.set(2, baseAction);
baseAttributes.sendDeltaMessage(this);
}
}
public void setAction(int action) {
synchronized(attributes) {
attributes.set(2, action);