Browse Source

combat bug fix

lakebane-master
FatBoy-DOTC 10 months ago
parent
commit
4eff71f288
  1. 10
      src/engine/gameManager/CombatManager.java
  2. 29
      src/engine/gameManager/ZergManager.java
  3. 2
      src/engine/objects/CharacterItemManager.java
  4. 9
      src/engine/powers/effectmodifiers/HealthEffectModifier.java
  5. 9
      src/engine/powers/effectmodifiers/ManaEffectModifier.java
  6. 9
      src/engine/powers/effectmodifiers/StaminaEffectModifier.java
  7. 6
      src/engine/powers/poweractions/TransferStatPowerAction.java

10
src/engine/gameManager/CombatManager.java

@ -811,9 +811,9 @@ public enum CombatManager { @@ -811,9 +811,9 @@ public enum CombatManager {
damage = calculateDamage(ac, tarAc, minDamage, maxDamage, damageType, resists);
if(ac.getObjectType().equals(GameObjectType.PlayerCharacter) && target.getObjectType().equals(GameObjectType.PlayerCharacter)){
damage *= ZergManager.getReducedZergMultiplier((PlayerCharacter)ac,(PlayerCharacter)target);
}
//if(ac.getObjectType().equals(GameObjectType.PlayerCharacter) && target.getObjectType().equals(GameObjectType.PlayerCharacter)){
// damage *= ZergManager.getReducedZergMultiplier((PlayerCharacter)ac,(PlayerCharacter)target);
//}
float d = 0f;
errorTrack = 12;
@ -842,7 +842,9 @@ public enum CombatManager { @@ -842,7 +842,9 @@ public enum CombatManager {
}
mobTarget.handleDirectAggro(ac);
}
if(ac.getObjectType().equals(GameObjectType.PlayerCharacter) && tarAc.getObjectType().equals(GameObjectType.PlayerCharacter) && tarAc.equals(ac) == false){
damage *= ZergManager.getReducedZergMultiplier(ac,tarAc);
}
if (tarAc.getHealth() > 0)
d = tarAc.modifyHealth(-damage, ac, false);
subTrack = 5;

29
src/engine/gameManager/ZergManager.java

@ -1,9 +1,7 @@ @@ -1,9 +1,7 @@
package engine.gameManager;
import engine.objects.Bane;
import engine.objects.Guild;
import engine.objects.Mine;
import engine.objects.PlayerCharacter;
import engine.Enum;
import engine.objects.*;
public class ZergManager {
public static float getMultiplier5Man(int count, PlayerCharacter pc){
@ -232,7 +230,13 @@ public class ZergManager { @@ -232,7 +230,13 @@ public class ZergManager {
return multiplier;
}
public static float getReducedZergMultiplier(PlayerCharacter source, PlayerCharacter target){
public static float getReducedZergMultiplier(AbstractCharacter sourceABS, AbstractCharacter targetABS){
if(sourceABS.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) == false || targetABS.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) == false)
return 1.0f;
PlayerCharacter source = (PlayerCharacter) sourceABS;
PlayerCharacter target = (PlayerCharacter) targetABS;
if(source.ZergMultiplier == 0.0f) {
if(Mine.getMine(source.mineAppliedID) != null && Mine.getMine(source.mineAppliedID)._playerMemory.contains(source.getObjectUUID()) == false ){
source.ZergMultiplier = 1.0f;
@ -246,19 +250,24 @@ public class ZergManager { @@ -246,19 +250,24 @@ public class ZergManager {
if(source.ZergMultiplier == target.ZergMultiplier){
return 1.0f;
}
float returnMultiplier = 1.0f;
if(source.ZergMultiplier > 0 && target.ZergMultiplier > 0){
if(source.ZergMultiplier > target.ZergMultiplier) {
return 1 + (target.ZergMultiplier - source.ZergMultiplier);
returnMultiplier = 1 + (target.ZergMultiplier - source.ZergMultiplier);
} else{
return 1.0f;
returnMultiplier = 1.0f;
}
}else if(source.ZergMultiplier < 0 && target.ZergMultiplier > 0){
return source.ZergMultiplier;
returnMultiplier = source.ZergMultiplier;
} else if(source.ZergMultiplier < 0 && target.ZergMultiplier < 0){
return source.ZergMultiplier;
returnMultiplier = source.ZergMultiplier;
} else if(source.ZergMultiplier > 0 && target.ZergMultiplier < 0){
return source.ZergMultiplier;
returnMultiplier = source.ZergMultiplier;
}
if(returnMultiplier == 0.0f)
return 1.0f;
else{
return returnMultiplier;
}
}
}

2
src/engine/objects/CharacterItemManager.java

@ -1211,7 +1211,7 @@ public class CharacterItemManager { @@ -1211,7 +1211,7 @@ public class CharacterItemManager {
//i.clearEffects();
for (String name : i.getEffects().keySet()) {
Effect eff = i.getEffects().get(name);
if (eff.getDuration() < 2000)
if (!eff.isStatic())
i.endEffect(name);
}
}

9
src/engine/powers/effectmodifiers/HealthEffectModifier.java

@ -177,9 +177,9 @@ public class HealthEffectModifier extends AbstractEffectModifier { @@ -177,9 +177,9 @@ public class HealthEffectModifier extends AbstractEffectModifier {
if (!ac.isAlive())
return;
if(ac.getObjectType().equals(GameObjectType.PlayerCharacter) && ac.combatTarget.getObjectType().equals(GameObjectType.PlayerCharacter)){
modAmount *= ZergManager.getReducedZergMultiplier((PlayerCharacter)ac,(PlayerCharacter)ac.combatTarget);
}
//if(ac.getObjectType().equals(GameObjectType.PlayerCharacter) && ac.combatTarget.getObjectType().equals(GameObjectType.PlayerCharacter)){
// modAmount *= ZergManager.getReducedZergMultiplier((PlayerCharacter)ac,(PlayerCharacter)ac.combatTarget);
//}
int powerID = 0, effectID = 0;
String powerName = "";
@ -318,6 +318,9 @@ public class HealthEffectModifier extends AbstractEffectModifier { @@ -318,6 +318,9 @@ public class HealthEffectModifier extends AbstractEffectModifier {
AbstractCharacter ac = (AbstractCharacter) awo;
if (ac.isSit())
damage *= 2.5f; // increase damage if sitting
if(ac.getObjectType().equals(GameObjectType.PlayerCharacter) && source.equals(ac) == false && ZergManager.getReducedZergMultiplier(source,ac) != 0.0f){
damage *= ZergManager.getReducedZergMultiplier(source,ac);
}
}
return damage;

9
src/engine/powers/effectmodifiers/ManaEffectModifier.java

@ -158,9 +158,9 @@ public class ManaEffectModifier extends AbstractEffectModifier { @@ -158,9 +158,9 @@ public class ManaEffectModifier extends AbstractEffectModifier {
skipImmune = true;
}
}
if(ac.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && ac.combatTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)){
modAmount *= ZergManager.getReducedZergMultiplier((PlayerCharacter)ac,(PlayerCharacter)ac.combatTarget);
}
//if(ac.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && ac.combatTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)){
// modAmount *= ZergManager.getReducedZergMultiplier((PlayerCharacter)ac,(PlayerCharacter)ac.combatTarget);
//}
PlayerBonuses bonus = ac.getBonuses();
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Heal) >= trains) {
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);
@ -207,6 +207,9 @@ public class ManaEffectModifier extends AbstractEffectModifier { @@ -207,6 +207,9 @@ public class ManaEffectModifier extends AbstractEffectModifier {
AbstractCharacter ac = (AbstractCharacter) awo;
if (ac.isSit())
damage *= 2.5f; // increase damage if sitting
if(ac.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && source.equals(ac) == false && ZergManager.getReducedZergMultiplier(source,ac) != 0.0f){
damage *= ZergManager.getReducedZergMultiplier(source,ac);
}
}
return damage;

9
src/engine/powers/effectmodifiers/StaminaEffectModifier.java

@ -154,9 +154,9 @@ public class StaminaEffectModifier extends AbstractEffectModifier { @@ -154,9 +154,9 @@ public class StaminaEffectModifier extends AbstractEffectModifier {
skipImmune = true;
}
}
if(ac.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && ac.combatTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)){
modAmount *= ZergManager.getReducedZergMultiplier((PlayerCharacter)ac,(PlayerCharacter)ac.combatTarget);
}
//if(ac.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && ac.combatTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)){
// modAmount *= ZergManager.getReducedZergMultiplier((PlayerCharacter)ac,(PlayerCharacter)ac.combatTarget);
//}
PlayerBonuses bonus = ac.getBonuses();
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Heal) >= trains) {
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);
@ -205,6 +205,9 @@ public class StaminaEffectModifier extends AbstractEffectModifier { @@ -205,6 +205,9 @@ public class StaminaEffectModifier extends AbstractEffectModifier {
AbstractCharacter ac = (AbstractCharacter) awo;
if (ac.isSit())
damage *= 2.5f; // increase damage if sitting
if(ac.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && source.equals(ac) == false && ZergManager.getReducedZergMultiplier(source,ac) != 0.0f){
damage *= ZergManager.getReducedZergMultiplier(source,ac);
}
}
return damage;

6
src/engine/powers/poweractions/TransferStatPowerAction.java

@ -214,9 +214,9 @@ public class TransferStatPowerAction extends AbstractPowerAction { @@ -214,9 +214,9 @@ public class TransferStatPowerAction extends AbstractPowerAction {
// put it back between min and max
damage += min;
if(source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && source.combatTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)){
damage *= ZergManager.getReducedZergMultiplier((PlayerCharacter)source,(PlayerCharacter)source.combatTarget);
}
//if(source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && source.combatTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)){
// damage *= ZergManager.getReducedZergMultiplier((PlayerCharacter)source,(PlayerCharacter)source.combatTarget);
//}
}
// Apply any power effect modifiers (such as stances)

Loading…
Cancel
Save