Browse Source

Zerg multiplier reduction method

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

4
src/engine/gameManager/CombatManager.java

@ -811,8 +811,8 @@ public enum CombatManager { @@ -811,8 +811,8 @@ public enum CombatManager {
damage = calculateDamage(ac, tarAc, minDamage, maxDamage, damageType, resists);
if(ac.getObjectType().equals(GameObjectType.PlayerCharacter)){
damage *= ((PlayerCharacter)ac).ZergMultiplier;
if(ac.getObjectType().equals(GameObjectType.PlayerCharacter) && target.getObjectType().equals(GameObjectType.PlayerCharacter)){
damage *= ZergManager.getReducedZergMultiplier((PlayerCharacter)ac,(PlayerCharacter)target);
}
float d = 0f;

24
src/engine/gameManager/ZergManager.java

@ -41,7 +41,6 @@ public class ZergManager { @@ -41,7 +41,6 @@ public class ZergManager {
else
return multiplier;
}
public static float getMultiplier10Man(int count, PlayerCharacter pc){
float multiplier = 1.0f;
if(count <=4)
@ -99,7 +98,6 @@ public class ZergManager { @@ -99,7 +98,6 @@ public class ZergManager {
else
return multiplier;
}
public static float getMultiplier20Man(int count, PlayerCharacter pc){
float multiplier = 1.0f;
if(count < 10){
@ -177,7 +175,6 @@ public class ZergManager { @@ -177,7 +175,6 @@ public class ZergManager {
else
return multiplier;
}
public static int getBaneCapSize(Guild defender){
int treesInNation = defender.getNation().getSubGuildList().size() + 1;
int capSize;
@ -233,4 +230,25 @@ public class ZergManager { @@ -233,4 +230,25 @@ public class ZergManager {
else
return multiplier;
}
public static float getReducedZergMultiplier(PlayerCharacter source, PlayerCharacter target){
if(source.ZergMultiplier == 0.0f)
source.ZergMultiplier = 1.0f;
if(target.ZergMultiplier == 0.0f)
target.ZergMultiplier = 1.0f;
if(source.ZergMultiplier > 0 && target.ZergMultiplier > 0){
if(source.ZergMultiplier > target.ZergMultiplier) {
return 1 + (target.ZergMultiplier - source.ZergMultiplier);
} else{
return 1.0f;
}
}else if(source.ZergMultiplier < 0 && target.ZergMultiplier > 0){
return source.ZergMultiplier;
} else if(source.ZergMultiplier < 0 && target.ZergMultiplier < 0){
return source.ZergMultiplier;
} else if(source.ZergMultiplier > 0 && target.ZergMultiplier < 0){
return source.ZergMultiplier;
}
return 1.0f;
}
}

18
src/engine/objects/Mine.java

@ -107,16 +107,16 @@ public class Mine extends AbstractGameObject { @@ -107,16 +107,16 @@ public class Mine extends AbstractGameObject {
this.production = Resource.valueOf(rs.getString("mine_resource"));
this.lastClaimer = null;
int capRoll = ThreadLocalRandom.current().nextInt(0,101);
if(capRoll >= 0 && capRoll <= 33){
//int capRoll = ThreadLocalRandom.current().nextInt(0,101);
//if(capRoll >= 0 && capRoll <= 33){
this.capSize = 5;
}
if(capRoll >= 34 && capRoll <= 66){
this.capSize = 10;
}
if(capRoll >= 67 && capRoll <= 100){
this.capSize = 20;
}
//}
//if(capRoll >= 34 && capRoll <= 66){
// this.capSize = 10;
//}
//if(capRoll >= 67 && capRoll <= 100){
// this.capSize = 20;
//}
Building mineTower = BuildingManager.getBuilding(this.buildingID);
mineTower.setMaxHitPoints(5000 * this.capSize);
mineTower.setCurrentHitPoints((float)5000 * this.capSize);

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

@ -14,6 +14,7 @@ import engine.Enum.GameObjectType; @@ -14,6 +14,7 @@ import engine.Enum.GameObjectType;
import engine.Enum.ModType;
import engine.Enum.SourceType;
import engine.gameManager.ChatManager;
import engine.gameManager.ZergManager;
import engine.jobs.AbstractEffectJob;
import engine.jobs.DamageOverTimeJob;
import engine.net.AbstractNetMsg;
@ -176,8 +177,8 @@ public class HealthEffectModifier extends AbstractEffectModifier { @@ -176,8 +177,8 @@ public class HealthEffectModifier extends AbstractEffectModifier {
if (!ac.isAlive())
return;
if(source.getObjectType().equals(GameObjectType.PlayerCharacter)){
modAmount *= ((PlayerCharacter)source).ZergMultiplier;
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;

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

@ -14,6 +14,7 @@ import engine.Enum.DamageType; @@ -14,6 +14,7 @@ import engine.Enum.DamageType;
import engine.Enum.ModType;
import engine.Enum.SourceType;
import engine.gameManager.ChatManager;
import engine.gameManager.ZergManager;
import engine.jobs.AbstractEffectJob;
import engine.jobs.DamageOverTimeJob;
import engine.net.DispatchMessage;
@ -157,8 +158,8 @@ public class ManaEffectModifier extends AbstractEffectModifier { @@ -157,8 +158,8 @@ public class ManaEffectModifier extends AbstractEffectModifier {
skipImmune = true;
}
}
if(source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)){
modAmount *= ((PlayerCharacter)source).ZergMultiplier;
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) {

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

@ -14,6 +14,7 @@ import engine.Enum.DamageType; @@ -14,6 +14,7 @@ import engine.Enum.DamageType;
import engine.Enum.ModType;
import engine.Enum.SourceType;
import engine.gameManager.ChatManager;
import engine.gameManager.ZergManager;
import engine.jobs.AbstractEffectJob;
import engine.jobs.DamageOverTimeJob;
import engine.net.DispatchMessage;
@ -153,8 +154,8 @@ public class StaminaEffectModifier extends AbstractEffectModifier { @@ -153,8 +154,8 @@ public class StaminaEffectModifier extends AbstractEffectModifier {
skipImmune = true;
}
}
if(source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)){
modAmount *= ((PlayerCharacter)source).ZergMultiplier;
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) {

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

@ -14,6 +14,7 @@ import engine.Enum.DamageType; @@ -14,6 +14,7 @@ import engine.Enum.DamageType;
import engine.Enum.ModType;
import engine.Enum.SourceType;
import engine.gameManager.ChatManager;
import engine.gameManager.ZergManager;
import engine.math.Vector3fImmutable;
import engine.net.AbstractNetMsg;
import engine.net.DispatchMessage;
@ -213,7 +214,9 @@ public class TransferStatPowerAction extends AbstractPowerAction { @@ -213,7 +214,9 @@ public class TransferStatPowerAction extends AbstractPowerAction {
// put it back between min and max
damage += min;
damage *= ((PlayerCharacter) source).ZergMultiplier;
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