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