pets stats calculate properly & pet buffs no longer nerf pet
This commit is contained in:
@@ -660,6 +660,17 @@ public class MobileFSM {
|
|||||||
if (MovementUtilities.canMove(mob) && mob.BehaviourType.canRoam)
|
if (MovementUtilities.canMove(mob) && mob.BehaviourType.canRoam)
|
||||||
CheckMobMovement(mob);
|
CheckMobMovement(mob);
|
||||||
CheckForAttack(mob);
|
CheckForAttack(mob);
|
||||||
|
//recover health
|
||||||
|
if(mob.getTimestamps().containsKey("HEALTHRECOVERED") == false){
|
||||||
|
mob.getTimestamps().put("HEALTHRECOVERED", System.currentTimeMillis());
|
||||||
|
}
|
||||||
|
if(mob.isSit() && mob.getTimeStamp("HEALTHRECOVERED") < System.currentTimeMillis() + 3000){
|
||||||
|
if(mob.getHealth() < mob.getHealthMax()) {
|
||||||
|
float recoveredHealth = mob.getHealthMax() * ((1 + mob.getBonuses().getFloatPercentAll(Enum.ModType.HealthRecoverRate, Enum.SourceType.None))* 0.01f);
|
||||||
|
mob.setHealth(mob.getHealth() + recoveredHealth);
|
||||||
|
mob.getTimestamps().put("HEALTHRECOVERED",System.currentTimeMillis());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void HamletGuardLogic(Mob mob) {
|
private static void HamletGuardLogic(Mob mob) {
|
||||||
|
|||||||
@@ -1489,6 +1489,9 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
float s;
|
float s;
|
||||||
|
|
||||||
h = this.mobBase.getHealthMax();
|
h = this.mobBase.getHealthMax();
|
||||||
|
if(this.isPet()){
|
||||||
|
h = this.level * 0.5f * 120;
|
||||||
|
}
|
||||||
m = this.statSpiCurrent;
|
m = this.statSpiCurrent;
|
||||||
s = this.statConCurrent;
|
s = this.statConCurrent;
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package engine.powers.poweractions;
|
package engine.powers.poweractions;
|
||||||
|
|
||||||
|
import com.sun.prism.impl.ps.BaseShaderContext;
|
||||||
import engine.Enum.GameObjectType;
|
import engine.Enum.GameObjectType;
|
||||||
import engine.Enum.ModType;
|
import engine.Enum.ModType;
|
||||||
import engine.Enum.SourceType;
|
import engine.Enum.SourceType;
|
||||||
@@ -140,10 +141,17 @@ public class ApplyEffectPowerAction extends AbstractPowerAction {
|
|||||||
((Mob) awo).setCombatTarget(source);
|
((Mob) awo).setCombatTarget(source);
|
||||||
ChatSystemMsg msg = ChatManager.CombatInfo(source, awo);
|
ChatSystemMsg msg = ChatManager.CombatInfo(source, awo);
|
||||||
DispatchMessage.sendToAllInRange(source, msg);
|
DispatchMessage.sendToAllInRange(source, msg);
|
||||||
|
((Mob)awo).refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (awo != null && awo.getObjectType() == GameObjectType.Mob) {
|
||||||
|
if(((Mob)awo).isPet()) {
|
||||||
|
((Mob) awo).recalculateStats();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.effect.startEffect(source, awo, trains, eff);
|
this.effect.startEffect(source, awo, trains, eff);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void _applyEffectForItem(Item item, int trains) {
|
protected void _applyEffectForItem(Item item, int trains) {
|
||||||
|
|||||||
@@ -158,6 +158,11 @@ public class CreateMobPowerAction extends AbstractPowerAction {
|
|||||||
if(pet.isSiege() == false) {
|
if(pet.isSiege() == false) {
|
||||||
MovementManager.translocate(pet, owner.getLoc(), owner.region);
|
MovementManager.translocate(pet, owner.getLoc(), owner.region);
|
||||||
}
|
}
|
||||||
|
pet.recalculateStats();
|
||||||
|
if(pet.isPet()){
|
||||||
|
pet.healthMax = pet.level * 0.5f * 120;
|
||||||
|
}
|
||||||
|
pet.setHealth(pet.healthMax);
|
||||||
PetMsg pm = new PetMsg(5, pet);
|
PetMsg pm = new PetMsg(5, pet);
|
||||||
Dispatch dispatch = Dispatch.borrow(owner, pm);
|
Dispatch dispatch = Dispatch.borrow(owner, pm);
|
||||||
DispatchMessage.dispatchMsgDispatch(dispatch, engine.Enum.DispatchChannel.SECONDARY);
|
DispatchMessage.dispatchMsgDispatch(dispatch, engine.Enum.DispatchChannel.SECONDARY);
|
||||||
|
|||||||
Reference in New Issue
Block a user