Browse Source

pets stats calculate properly & pet buffs no longer nerf pet

master
FatBoy-DOTC 1 year ago
parent
commit
bd48198a51
  1. 11
      src/engine/ai/MobileFSM.java
  2. 3
      src/engine/objects/Mob.java
  3. 8
      src/engine/powers/poweractions/ApplyEffectPowerAction.java
  4. 5
      src/engine/powers/poweractions/CreateMobPowerAction.java

11
src/engine/ai/MobileFSM.java

@ -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) {

3
src/engine/objects/Mob.java

@ -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;

8
src/engine/powers/poweractions/ApplyEffectPowerAction.java

@ -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) {

5
src/engine/powers/poweractions/CreateMobPowerAction.java

@ -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);

Loading…
Cancel
Save