Browse Source

Separate pet and siege behaviour types.

mobile-class-refactor
MagicBot 1 year ago
parent
commit
22e4cc07c0
  1. 3
      src/engine/Enum.java
  2. 12
      src/engine/mobileAI/MobAI.java
  3. 4
      src/engine/objects/Mob.java

3
src/engine/Enum.java

@ -2846,7 +2846,8 @@ public class Enum {
SpellAggroGrouperWimpy(Spell, true, false, true, false, false), SpellAggroGrouperWimpy(Spell, true, false, true, false, false),
//Independent Types //Independent Types
SimpleStandingGuard(null, false, false, false, false, false), SimpleStandingGuard(null, false, false, false, false, false),
Pet1(null, false, false, true, false, false), Pet(null, false, false, true, false, false),
Siege(null, false, false, true, false, false),
Simple(null, false, false, true, false, false), Simple(null, false, false, true, false, false),
Helpee(null, false, true, true, false, true), Helpee(null, false, true, true, false, true),
HelpeeWimpy(null, true, false, true, false, false), HelpeeWimpy(null, true, false, true, false, false),

12
src/engine/mobileAI/MobAI.java

@ -625,7 +625,7 @@ public class MobAI {
//check to send mob home for player guards to prevent exploit of dragging guards away and then teleporting //check to send mob home for player guards to prevent exploit of dragging guards away and then teleporting
if (mob.BehaviourType.equals(Enum.MobBehaviourType.Pet1) == false) if (mob.BehaviourType.equals(Enum.MobBehaviourType.Pet) == false)
CheckToSendMobHome(mob); CheckToSendMobHome(mob);
return; return;
@ -646,7 +646,7 @@ public class MobAI {
return; return;
} }
if (mob.BehaviourType.equals(Enum.MobBehaviourType.Pet1) == false) if (mob.BehaviourType.equals(Enum.MobBehaviourType.Pet) == false)
CheckToSendMobHome(mob); CheckToSendMobHome(mob);
if (mob.getCombatTarget() != null) { if (mob.getCombatTarget() != null) {
@ -683,7 +683,7 @@ public class MobAI {
case GuardWallArcher: case GuardWallArcher:
GuardWallArcherLogic(mob); GuardWallArcherLogic(mob);
break; break;
case Pet1: case Pet:
PetLogic(mob); PetLogic(mob);
break; break;
case HamletGuard: case HamletGuard:
@ -784,7 +784,7 @@ public class MobAI {
switch (mob.BehaviourType) { switch (mob.BehaviourType) {
case Pet1: case Pet:
if (mob.getOwner() == null) if (mob.getOwner() == null)
return; return;
@ -894,7 +894,7 @@ public class MobAI {
return; return;
if (mob.getCombatTarget().getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && MovementUtilities.inRangeDropAggro(mob, (PlayerCharacter) mob.getCombatTarget()) == false && if (mob.getCombatTarget().getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && MovementUtilities.inRangeDropAggro(mob, (PlayerCharacter) mob.getCombatTarget()) == false &&
mob.BehaviourType.equals(Enum.MobBehaviourType.Pet1) == false) { mob.BehaviourType.equals(Enum.MobBehaviourType.Pet) == false) {
mob.setCombatTarget(null); mob.setCombatTarget(null);
return; return;
@ -1014,7 +1014,7 @@ public class MobAI {
if ((aggroMob.agentType.equals(Enum.AIAgentType.GUARD))) if ((aggroMob.agentType.equals(Enum.AIAgentType.GUARD)))
continue; continue;
if(aggroMob.BehaviourType.equals(Enum.MobBehaviourType.Pet1)) if (aggroMob.BehaviourType.equals(Enum.MobBehaviourType.Pet))
continue; continue;
if (mob.getLoc().distanceSquared2D(aggroMob.getLoc()) > sqr(50)) if (mob.getLoc().distanceSquared2D(aggroMob.getLoc()) > sqr(50))

4
src/engine/objects/Mob.java

@ -164,7 +164,7 @@ public class Mob extends AbstractIntelligenceAgent {
this.parentZone = parent; this.parentZone = parent;
this.parentZoneID = (parent != null) ? parent.getObjectUUID() : 0; this.parentZoneID = (parent != null) ? parent.getObjectUUID() : 0;
this.ownerUID = owner.getObjectUUID(); this.ownerUID = owner.getObjectUUID();
this.BehaviourType = Enum.MobBehaviourType.Pet1; this.BehaviourType = Enum.MobBehaviourType.Pet;
clearStatic(); clearStatic();
} }
@ -811,7 +811,7 @@ public class Mob extends AbstractIntelligenceAgent {
owner.getSiegeMinionMap().put(mob, slot); owner.getSiegeMinionMap().put(mob, slot);
mob.setNpcOwner(owner); mob.setNpcOwner(owner);
mob.BehaviourType = MobBehaviourType.Pet1; mob.BehaviourType = MobBehaviourType.Pet;
mob.BehaviourType.canRoam = false; mob.BehaviourType.canRoam = false;
return mob; return mob;
} }

Loading…
Cancel
Save