|
|
|
@ -22,8 +22,8 @@ import engine.net.client.msg.PerformActionMsg;
@@ -22,8 +22,8 @@ import engine.net.client.msg.PerformActionMsg;
|
|
|
|
|
import engine.net.client.msg.PowerProjectileMsg; |
|
|
|
|
import engine.objects.*; |
|
|
|
|
import engine.powers.ActionsBase; |
|
|
|
|
import engine.powers.MobPowerEntry; |
|
|
|
|
import engine.powers.PowersBase; |
|
|
|
|
import engine.powers.RunePowerEntry; |
|
|
|
|
import engine.server.MBServerStatics; |
|
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
|
|
|
|
|
@ -323,7 +323,7 @@ public class MobAI {
@@ -323,7 +323,7 @@ public class MobAI {
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (PowersManager.getPowersForMobile(mob).isEmpty()) |
|
|
|
|
if (PowersManager.getPowersForRune(mob.getMobBaseID()).isEmpty()) |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
if (!mob.canSee((PlayerCharacter) mob.getCombatTarget())) { |
|
|
|
@ -348,8 +348,8 @@ public class MobAI {
@@ -348,8 +348,8 @@ public class MobAI {
|
|
|
|
|
// and casts it on the current target (or itself). Validation
|
|
|
|
|
// (including empty lists) is done previously within canCast();
|
|
|
|
|
|
|
|
|
|
ArrayList<MobPowerEntry> powerEntries; |
|
|
|
|
ArrayList<MobPowerEntry> purgeEntries; |
|
|
|
|
ArrayList<RunePowerEntry> powerEntries; |
|
|
|
|
ArrayList<RunePowerEntry> purgeEntries; |
|
|
|
|
AbstractCharacter target = (AbstractCharacter) mob.getCombatTarget(); |
|
|
|
|
|
|
|
|
|
if (mob.behaviourType.callsForHelp) |
|
|
|
@ -357,22 +357,22 @@ public class MobAI {
@@ -357,22 +357,22 @@ public class MobAI {
|
|
|
|
|
|
|
|
|
|
// Generate a list of tokens from the mob powers for this mobile.
|
|
|
|
|
|
|
|
|
|
powerEntries = new ArrayList<>(PowersManager.getPowersForMobile(mob)); |
|
|
|
|
powerEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.getMobBaseID())); |
|
|
|
|
purgeEntries = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
// If player has this effect on them currently then remove
|
|
|
|
|
// this token from our list.
|
|
|
|
|
|
|
|
|
|
for (MobPowerEntry mobPowerEntry : powerEntries) { |
|
|
|
|
for (RunePowerEntry runePowerEntry : powerEntries) { |
|
|
|
|
|
|
|
|
|
PowersBase powerBase = PowersManager.getPowerByToken(mobPowerEntry.token); |
|
|
|
|
PowersBase powerBase = PowersManager.getPowerByToken(runePowerEntry.token); |
|
|
|
|
|
|
|
|
|
for (ActionsBase actionBase : powerBase.getActions()) { |
|
|
|
|
|
|
|
|
|
String stackType = actionBase.stackType; |
|
|
|
|
|
|
|
|
|
if (target.getEffects() != null && target.getEffects().containsKey(stackType)) |
|
|
|
|
purgeEntries.add(mobPowerEntry); |
|
|
|
|
purgeEntries.add(runePowerEntry); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -431,37 +431,32 @@ public class MobAI {
@@ -431,37 +431,32 @@ public class MobAI {
|
|
|
|
|
// and casts it on the current target (or itself). Validation
|
|
|
|
|
// (including empty lists) is done previously within canCast();
|
|
|
|
|
|
|
|
|
|
ArrayList<MobPowerEntry> powerEntries; |
|
|
|
|
ArrayList<MobPowerEntry> purgeEntries; |
|
|
|
|
ArrayList<RunePowerEntry> powerEntries; |
|
|
|
|
ArrayList<RunePowerEntry> purgeEntries; |
|
|
|
|
AbstractCharacter target = (AbstractCharacter) mob.getCombatTarget(); |
|
|
|
|
|
|
|
|
|
if (mob.behaviourType.callsForHelp) |
|
|
|
|
MobCallForHelp(mob); |
|
|
|
|
|
|
|
|
|
// Generate a list of tokens from the mob powers for this mobile.
|
|
|
|
|
|
|
|
|
|
powerEntries = PowersManager.getPowersForMobile(mob); |
|
|
|
|
purgeEntries = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
// If player has this effect on them currently then remove
|
|
|
|
|
// this token from our list.
|
|
|
|
|
|
|
|
|
|
powerEntries = new ArrayList<>(PowersManager.getPowersForMobile(mob)); |
|
|
|
|
powerEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.getMobBaseID())); |
|
|
|
|
purgeEntries = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
// If player has this effect on them currently then remove
|
|
|
|
|
// this token from our list.
|
|
|
|
|
|
|
|
|
|
for (MobPowerEntry mobPowerEntry : powerEntries) { |
|
|
|
|
for (RunePowerEntry runePowerEntry : powerEntries) { |
|
|
|
|
|
|
|
|
|
PowersBase powerBase = PowersManager.getPowerByToken(mobPowerEntry.token); |
|
|
|
|
PowersBase powerBase = PowersManager.getPowerByToken(runePowerEntry.token); |
|
|
|
|
|
|
|
|
|
for (ActionsBase actionBase : powerBase.getActions()) { |
|
|
|
|
|
|
|
|
|
String stackType = actionBase.stackType; |
|
|
|
|
|
|
|
|
|
if (target.getEffects() != null && target.getEffects().containsKey(stackType)) |
|
|
|
|
purgeEntries.add(mobPowerEntry); |
|
|
|
|
purgeEntries.add(runePowerEntry); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|