Browse Source

cast while flying

lakebane-strongholds
FatBoy-DOTC 4 months ago
parent
commit
1a1c552964
  1. 37
      src/engine/gameManager/PowersManager.java

37
src/engine/gameManager/PowersManager.java

@ -292,22 +292,27 @@ public enum PowersManager {
//check for movement buffs while flying //check for movement buffs while flying
if(playerCharacter.isFlying()) { if(playerCharacter.isFlying()) {
for(ActionsBase ab : pb.getActions()){ boolean whileFlying = true;
for(AbstractEffectModifier mod1 : ab.getPowerAction().getEffectsBase().getModifiers()){ switch(pb.token){
if(mod1.modType.equals(ModType.Speed) && mod1.getPercentMod() > 0){ case 429005674:
ChatManager.chatSystemInfo(playerCharacter, "You Cannot Fly While Having A MovementBuff"); case 429505739:
//refund stamina case 431054700:
float amount = playerCharacter.getStamina() + pb.cost; case 428005600:
playerCharacter.setStamina(amount, playerCharacter); case 431610080:
case 427935608:
// Update all surrounding clients. case 427857146:
TargetedActionMsg cmm = new TargetedActionMsg(playerCharacter); case 427988218:
DispatchMessage.dispatchMsgToInterestArea(playerCharacter, cmm, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); case 431854842:
return true; case 421074170:
} case 429611355:
case 428955899:
case 1794395699:
case 429428796:
case 1514898036:
whileFlying = false;
break;
} }
for(AbstractEffectModifier mod2 : ab.getPowerAction().getEffectsBase2().getModifiers()){ if(!whileFlying) {
if(mod2.modType.equals(ModType.Speed) && mod2.getPercentMod() > 0){
ChatManager.chatSystemInfo(playerCharacter, "You Cannot Fly While Having A MovementBuff"); ChatManager.chatSystemInfo(playerCharacter, "You Cannot Fly While Having A MovementBuff");
//refund stamina //refund stamina
float amount = playerCharacter.getStamina() + pb.cost; float amount = playerCharacter.getStamina() + pb.cost;
@ -319,8 +324,6 @@ public enum PowersManager {
return true; return true;
} }
} }
}
}
if (playerCharacter.getLastPower() != null) if (playerCharacter.getLastPower() != null)
return true; return true;

Loading…
Cancel
Save