Browse Source

no move buff while flying

lakebane-strongholds
FatBoy-DOTC 4 months ago
parent
commit
5be9033c40
  1. 13
      src/engine/gameManager/PowersManager.java
  2. 8
      src/engine/objects/AbstractCharacter.java
  3. 5
      src/engine/objects/PlayerCharacter.java

13
src/engine/gameManager/PowersManager.java

@ -292,9 +292,16 @@ 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()) { for(ActionsBase ab : pb.getActions()){
if (ab.stackType.equalsIgnoreCase("MoveBuff")) { for(AbstractEffectModifier mod1 : ab.getPowerAction().getEffectsBase().getModifiers()){
return true; if(mod1.modType.equals(ModType.Speed) && mod1.getPercentMod() > 0){
return false;
}
}
for(AbstractEffectModifier mod2 : ab.getPowerAction().getEffectsBase2().getModifiers()){
if(mod2.modType.equals(ModType.Speed) && mod2.getPercentMod() > 0){
return false;
}
} }
} }
} }

8
src/engine/objects/AbstractCharacter.java

@ -500,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()) if (bonus != null && !bonus.getBool(ModType.NoMod, SourceType.Fly) && bonus.getBool(ModType.Fly, SourceType.None) && flyer.isAlive())
canFly = true; canFly = true;
for(Effect eff : flyer.effects.values()){
for(AbstractEffectModifier mod : eff.getEffectModifiers()){
if(mod.modType.equals(ModType.Speed) && mod.getPercentMod() > 0){
return false;
}
}
}
if(bonus != null && bonus.getFloat(ModType.Speed,SourceType.BUFF) > 0){ if(bonus != null && bonus.getFloat(ModType.Speed,SourceType.BUFF) > 0){
return false; return false;
} }

5
src/engine/objects/PlayerCharacter.java

@ -4828,13 +4828,10 @@ public class PlayerCharacter extends AbstractCharacter {
} }
if(this.isFlying()){ if(this.isFlying()){
if(this.getBonuses() != null){ if (!AbstractCharacter.CanFly(this)) {
float speedMod = this.getBonuses().getFloatPercentPositive(ModType.Speed,SourceType.None);
if(speedMod > 0) {
GroundPlayer(this); GroundPlayer(this);
} }
} }
}
} catch (Exception e) { } catch (Exception e) {
Logger.error(e); Logger.error(e);

Loading…
Cancel
Save