Browse Source

no movement buffs while flying, cannot fly if you have a movement buff applied

lakebane-strongholds
FatBoy-DOTC 4 months ago
parent
commit
56f3dfce92
  1. 12
      src/engine/gameManager/PowersManager.java
  2. 9
      src/engine/objects/AbstractCharacter.java

12
src/engine/gameManager/PowersManager.java

@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
package engine.gameManager;
import com.sun.corba.se.spi.orbutil.fsm.ActionBase;
import engine.Enum.*;
import engine.InterestManagement.HeightMap;
import engine.InterestManagement.WorldGrid;
@ -27,6 +28,7 @@ import engine.net.client.ClientConnection; @@ -27,6 +28,7 @@ import engine.net.client.ClientConnection;
import engine.net.client.msg.*;
import engine.objects.*;
import engine.powers.*;
import engine.powers.effectmodifiers.AbstractEffectModifier;
import engine.powers.poweractions.AbstractPowerAction;
import engine.powers.poweractions.TrackPowerAction;
import engine.server.MBServerStatics;
@ -276,6 +278,7 @@ public enum PowersManager { @@ -276,6 +278,7 @@ public enum PowersManager {
// get power
PowersBase pb = PowersManager.powersBaseByToken.get(msg.getPowerUsedID());
if (pb == null) {
ChatManager.chatSayInfo(playerCharacter,
"This power is not implemented yet.");
@ -287,6 +290,15 @@ public enum PowersManager { @@ -287,6 +290,15 @@ public enum PowersManager {
// return false;
}
//check for movement buffs while flying
if(playerCharacter.isFlying()) {
for (ActionsBase ab : pb.getActions()) {
if (ab.stackType.equalsIgnoreCase("MoveBuff")) {
PlayerCharacter.GroundPlayer(playerCharacter);
}
}
}
if (playerCharacter.getLastPower() != null)
return true;

9
src/engine/objects/AbstractCharacter.java

@ -31,6 +31,7 @@ import engine.net.ByteBufferWriter; @@ -31,6 +31,7 @@ import engine.net.ByteBufferWriter;
import engine.net.DispatchMessage;
import engine.net.client.msg.UpdateStateMsg;
import engine.powers.EffectsBase;
import engine.powers.effectmodifiers.AbstractEffectModifier;
import engine.server.MBServerStatics;
import org.pmw.tinylog.Logger;
@ -499,6 +500,14 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -499,6 +500,14 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
if (bonus != null && !bonus.getBool(ModType.NoMod, SourceType.Fly) && bonus.getBool(ModType.Fly, SourceType.None) && flyer.isAlive())
canFly = true;
for(Effect eff : flyer.effects.values()){
for(AbstractEffectModifier mod : eff.getEffectModifiers()){
if(mod.modType.equals(ModType.Speed)){
canFly = false;
}
}
}
return canFly;
}

Loading…
Cancel
Save