|
|
@ -176,14 +176,31 @@ public enum PowersManager { |
|
|
|
PowersBase pb = PowersManager.powersBaseByToken.get(msg.getPowerUsedID()); |
|
|
|
PowersBase pb = PowersManager.powersBaseByToken.get(msg.getPowerUsedID()); |
|
|
|
PlayerCharacter caster = origin.getPlayerCharacter(); |
|
|
|
PlayerCharacter caster = origin.getPlayerCharacter(); |
|
|
|
PlayerCharacter target = PlayerCharacter.getFromCache(msg.getTargetID()); |
|
|
|
PlayerCharacter target = PlayerCharacter.getFromCache(msg.getTargetID()); |
|
|
|
if (pb != null && pb.isHarmful == false) { |
|
|
|
if (pb != null && pb.enforceLore()) { |
|
|
|
//if (caster.guild.equals(Guild.getErrantGuild()))
|
|
|
|
//if (caster.guild.equals(Guild.getErrantGuild()))
|
|
|
|
// return;
|
|
|
|
// return;
|
|
|
|
|
|
|
|
|
|
|
|
if (target != null && caster.guild.getGuildType().equals(target.guild.getGuildType()) == false && target.getObjectType().equals(GameObjectType.Building) == false) |
|
|
|
if (target != null && caster.guild.getGuildType().equals(target.guild.getGuildType()) == false && target.getObjectType().equals(GameObjectType.Building) == false) { |
|
|
|
|
|
|
|
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(msg.getPowerUsedID()); |
|
|
|
|
|
|
|
Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), recyclePowerMsg); |
|
|
|
|
|
|
|
DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Send Fail to cast message
|
|
|
|
|
|
|
|
PlayerCharacter pc = SessionManager |
|
|
|
|
|
|
|
.getPlayerCharacter(origin); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (pc != null) { |
|
|
|
|
|
|
|
sendPowerMsg(pc, 2, msg); |
|
|
|
|
|
|
|
if (pc.isCasting()) { |
|
|
|
|
|
|
|
pc.update(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pc.setIsCasting(false); |
|
|
|
|
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (usePowerA(msg, origin, sendCastToSelf)) { |
|
|
|
if (usePowerA(msg, origin, sendCastToSelf)) { |
|
|
|
// Cast failed for some reason, reset timer
|
|
|
|
// Cast failed for some reason, reset timer
|
|
|
|