Browse Source

mobs no longer always hit, mob powers now send power message in chat window

master
FatBoy-DOTC 2 years ago
parent
commit
e79a907f3b
  1. 24
      src/engine/ai/utilities/CombatUtilities.java

24
src/engine/ai/utilities/CombatUtilities.java

@ -18,9 +18,11 @@ import engine.gameManager.CombatManager;
import engine.gameManager.PowersManager; import engine.gameManager.PowersManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.client.msg.PerformActionMsg;
import engine.net.client.msg.TargetedActionMsg; import engine.net.client.msg.TargetedActionMsg;
import engine.objects.*; import engine.objects.*;
import engine.powers.ActionsBase; import engine.powers.ActionsBase;
import engine.powers.PowersBase;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -274,14 +276,23 @@ public class CombatUtilities {
int passiveAnim = CombatManager.getSwingAnimation(wb, null,mainHand); int passiveAnim = CombatManager.getSwingAnimation(wb, null,mainHand);
if(canSwing(agent)) { if(canSwing(agent)) {
if(triggerDefense(agent,target)) if(triggerDefense(agent,target)) {
swingIsMiss(agent, target, passiveAnim); swingIsMiss(agent, target, passiveAnim);
else if(triggerDodge(agent,target)) return;
}
else if(triggerDodge(agent,target)) {
swingIsDodge(agent, target, passiveAnim); swingIsDodge(agent, target, passiveAnim);
else if(triggerParry(agent,target)) return;
}
else if (triggerParry(agent, target)){
swingIsParry(agent, target, passiveAnim); swingIsParry(agent, target, passiveAnim);
else if(triggerBlock(agent,target))
return;
}
else if(triggerBlock(agent,target)) {
swingIsBlock(agent, target, passiveAnim); swingIsBlock(agent, target, passiveAnim);
return;
}
else else
//check for a cast here? //check for a cast here?
@ -333,8 +344,11 @@ public class CombatUtilities {
powerRank = 40; powerRank = 40;
break; break;
} }
System.out.println(agent.getMobBase().getFirstName() + " is casting: " + PowersManager.getPowerByToken(powerToken).skillName); //System.out.println(agent.getMobBase().getFirstName() + " is casting: " + PowersManager.getPowerByToken(powerToken).skillName);
PowersManager.applyPower(agent,target,target.getLoc(),powerToken,powerRank, false); PowersManager.applyPower(agent,target,target.getLoc(),powerToken,powerRank, false);
PerformActionMsg msg = new PerformActionMsg();
PowersManager.sendPowerMsg((PlayerCharacter)target,0,msg);
//return;
} }
} }
return; return;

Loading…
Cancel
Save