Browse Source

Integer division fix. Class cleanup.

master
MagicBot 2 years ago
parent
commit
48d66a0d42
  1. 21
      src/engine/objects/Mob.java

21
src/engine/objects/Mob.java

@ -500,6 +500,11 @@ public class Mob extends AbstractIntelligenceAgent {
mobWithoutID.level = (short) level; mobWithoutID.level = (short) level;
// NPC in a Building derives position from slot
if (mobWithoutID.building != null)
mobWithoutID.bindLoc = Vector3fImmutable.ZERO;
Mob mob; Mob mob;
try { try {
@ -1592,8 +1597,8 @@ public class Mob extends AbstractIntelligenceAgent {
max = this.mobBase.getMaxDmg(); max = this.mobBase.getMaxDmg();
} else { } else {
if (mainHand) this.rangeHandOne = weapon.getItemBase().getRange() * (1 + (baseStrength / 600)); if (mainHand) this.rangeHandOne = weapon.getItemBase().getRange() * (1 + (baseStrength / 600.0f));
else this.rangeHandTwo = weapon.getItemBase().getRange() * (1 + (baseStrength / 600)); else this.rangeHandTwo = weapon.getItemBase().getRange() * (1 + (baseStrength / 600.0f));
skillPercentage = getModifiedAmount(this.skills.get(wb.getSkillRequired())); skillPercentage = getModifiedAmount(this.skills.get(wb.getSkillRequired()));
masteryPercentage = getModifiedAmount(this.skills.get(wb.getMastery())); masteryPercentage = getModifiedAmount(this.skills.get(wb.getMastery()));
@ -1609,8 +1614,8 @@ public class Mob extends AbstractIntelligenceAgent {
// calculate atr // calculate atr
float atr = this.mobBase.getAttackRating(); float atr = this.mobBase.getAttackRating();
if (this.statStrCurrent > this.statDexCurrent) atr += statStrCurrent / 2; if (this.statStrCurrent > this.statDexCurrent) atr += statStrCurrent * .5;
else atr += statDexCurrent / 2; else atr += statDexCurrent * .5;
// add in any bonuses to atr // add in any bonuses to atr
@ -1755,7 +1760,7 @@ public class Mob extends AbstractIntelligenceAgent {
} }
mobPowers = new HashMap<>(); mobPowers = new HashMap<>();
if (PowersManager.AllMobPowers.containsKey(this.getMobBaseID()) == true) if (PowersManager.AllMobPowers.containsKey(this.getMobBaseID()))
mobPowers = PowersManager.AllMobPowers.get(this.getMobBaseID()); mobPowers = PowersManager.AllMobPowers.get(this.getMobBaseID());
if (this.equip == null) { if (this.equip == null) {
@ -1848,7 +1853,8 @@ public class Mob extends AbstractIntelligenceAgent {
public void handleDirectAggro(AbstractCharacter ac) { public void handleDirectAggro(AbstractCharacter ac) {
if (ac.getObjectType().equals(GameObjectType.PlayerCharacter) == false) return; if (!ac.getObjectType().equals(GameObjectType.PlayerCharacter))
return;
PlayerCharacter player = (PlayerCharacter) ac; PlayerCharacter player = (PlayerCharacter) ac;
@ -1857,7 +1863,8 @@ public class Mob extends AbstractIntelligenceAgent {
return; return;
} }
if (player.getObjectUUID() == this.getCombatTarget().getObjectUUID()) return; if (player.getObjectUUID() == this.getCombatTarget().getObjectUUID())
return;
if (this.getCombatTarget().getObjectType() == GameObjectType.PlayerCharacter) if (this.getCombatTarget().getObjectType() == GameObjectType.PlayerCharacter)
if (ac.getHateValue() > ((PlayerCharacter) this.getCombatTarget()).getHateValue()) if (ac.getHateValue() > ((PlayerCharacter) this.getCombatTarget()).getHateValue())

Loading…
Cancel
Save