Browse Source

refactored out dependency

combat-2
MagicBot 7 months ago
parent
commit
0b4873a522
  1. 2
      src/engine/mbEnums.java
  2. 2
      src/engine/mobileAI/utilities/MovementUtilities.java
  3. 17
      src/engine/objects/MobBase.java

2
src/engine/mbEnums.java

@ -121,7 +121,7 @@ public class mbEnums { @@ -121,7 +121,7 @@ public class mbEnums {
}
public enum MobFlagType implements EnumBitSetHelper<MobFlagType> {
public enum MobFlagType {
AGGRESSIVE,
CANROAM,
CALLSFORHELP,

2
src/engine/mobileAI/utilities/MovementUtilities.java

@ -166,7 +166,7 @@ public class MovementUtilities { @@ -166,7 +166,7 @@ public class MovementUtilities {
public static boolean canMove(Mob agent) {
if (agent.getMobBase() != null && mbEnums.MobFlagType.SENTINEL.elementOf(agent.getMobBase().getFlags()))
if (agent.getMobBase() != null && agent.getMobBase().getFlags().contains(mbEnums.MobFlagType.SENTINEL))
return false;
return (agent.isAlive() && !agent.getBonuses().getBool(ModType.Stunned, SourceType.None) && !agent.getBonuses().getBool(ModType.CannotMove, SourceType.None));

17
src/engine/objects/MobBase.java

@ -9,7 +9,6 @@ @@ -9,7 +9,6 @@
package engine.objects;
import ch.claude_martin.enumbitset.EnumBitSet;
import engine.gameManager.DbManager;
import engine.gameManager.LootManager;
import engine.loot.BootySetEntry;
@ -39,7 +38,7 @@ public class MobBase extends AbstractGameObject { @@ -39,7 +38,7 @@ public class MobBase extends AbstractGameObject {
private float damageMin;
private float damageMax;
private float hitBoxRadius;
private EnumBitSet<mbEnums.MobFlagType> flags;
private EnumSet<mbEnums.MobFlagType> flags;
private int mask;
private int goldMod;
private int seeInvis;
@ -77,7 +76,7 @@ public class MobBase extends AbstractGameObject { @@ -77,7 +76,7 @@ public class MobBase extends AbstractGameObject {
this.fsm = mbEnums.MobBehaviourType.valueOf(rs.getString("fsm"));
this.flags = EnumBitSet.asEnumBitSet(rs.getLong("flags"), mbEnums.MobFlagType.class);
this.flags = mbEnums.fromLong(rs.getLong("flags"), mbEnums.MobFlagType.class);
this.notEnemy = mbEnums.fromLong(rs.getLong("notEnemy"), mbEnums.MonsterType.class);
this.enemy = mbEnums.fromLong(rs.getLong("enemy"), mbEnums.MonsterType.class);
@ -89,19 +88,19 @@ public class MobBase extends AbstractGameObject { @@ -89,19 +88,19 @@ public class MobBase extends AbstractGameObject {
if (this.getObjectUUID() == 12021 || this.getObjectUUID() == 12022)
this.isNecroPet = true;
if (mbEnums.MobFlagType.HUMANOID.elementOf(this.flags))
if (this.flags.contains(mbEnums.MobFlagType.HUMANOID))
this.mask += MBServerStatics.MASK_HUMANOID;
if (mbEnums.MobFlagType.UNDEAD.elementOf(this.flags))
if (this.flags.contains(mbEnums.MobFlagType.UNDEAD))
this.mask += MBServerStatics.MASK_UNDEAD;
if (mbEnums.MobFlagType.BEAST.elementOf(this.flags))
if (this.flags.contains(mbEnums.MobFlagType.BEAST))
this.mask += MBServerStatics.MASK_BEAST;
if (mbEnums.MobFlagType.DRAGON.elementOf(this.flags))
if (this.flags.contains(mbEnums.MobFlagType.DRAGON))
this.mask += MBServerStatics.MASK_DRAGON;
if (mbEnums.MobFlagType.RAT.elementOf(this.flags))
if (this.flags.contains(mbEnums.MobFlagType.RAT))
this.mask += MBServerStatics.MASK_RAT;
this.mobBaseStats = DbManager.MobBaseQueries.LOAD_STATS(this.loadID);
@ -204,7 +203,7 @@ public class MobBase extends AbstractGameObject { @@ -204,7 +203,7 @@ public class MobBase extends AbstractGameObject {
return this.defenseRating;
}
public EnumBitSet<mbEnums.MobFlagType> getFlags() {
public EnumSet<mbEnums.MobFlagType> getFlags() {
return this.flags;
}

Loading…
Cancel
Save