new application of zerg multiplier
This commit is contained in:
@@ -26,7 +26,6 @@ import engine.powers.effectmodifiers.WeaponProcEffectModifier;
|
|||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ThreadLocalRandom;
|
import java.util.concurrent.ThreadLocalRandom;
|
||||||
|
|
||||||
@@ -506,8 +505,8 @@ public enum CombatManager {
|
|||||||
if (weapon != null && weapon.getBonusPercent(ModType.WeaponSpeed, SourceType.None) != 0f) //add weapon speed bonus
|
if (weapon != null && weapon.getBonusPercent(ModType.WeaponSpeed, SourceType.None) != 0f) //add weapon speed bonus
|
||||||
wepSpeed *= (1 + weapon.getBonus(ModType.WeaponSpeed, SourceType.None));
|
wepSpeed *= (1 + weapon.getBonus(ModType.WeaponSpeed, SourceType.None));
|
||||||
|
|
||||||
if (abstractCharacter.getBonuses() != null && abstractCharacter.getBonuses().getFloatPercentAll(ModType.AttackDelay, SourceType.None) != 0f) //add effects speed bonus
|
if (abstractCharacter.getBonuses() != null && abstractCharacter.getBonuses().getFloatPercentAll(ModType.AttackDelay, SourceType.None, null) != 0f) //add effects speed bonus
|
||||||
wepSpeed *= (1 + abstractCharacter.getBonuses().getFloatPercentAll(ModType.AttackDelay, SourceType.None));
|
wepSpeed *= (1 + abstractCharacter.getBonuses().getFloatPercentAll(ModType.AttackDelay, SourceType.None, null));
|
||||||
|
|
||||||
if (wepSpeed < 10)
|
if (wepSpeed < 10)
|
||||||
wepSpeed = 10; //Old was 10, but it can be reached lower with legit buffs,effects.
|
wepSpeed = 10; //Old was 10, but it can be reached lower with legit buffs,effects.
|
||||||
@@ -596,9 +595,9 @@ public enum CombatManager {
|
|||||||
//Dont think we need to do this anymore.
|
//Dont think we need to do this anymore.
|
||||||
|
|
||||||
if (tarIsRat)
|
if (tarIsRat)
|
||||||
if (ac.getBonuses().getFloatPercentAll(ModType.Slay, SourceType.Rat) != 0) { //strip away current % dmg buffs then add with rat %
|
if (ac.getBonuses().getFloatPercentAll(ModType.Slay, SourceType.Rat, null) != 0) { //strip away current % dmg buffs then add with rat %
|
||||||
|
|
||||||
float percent = 1 + ac.getBonuses().getFloatPercentAll(ModType.Slay, SourceType.Rat);
|
float percent = 1 + ac.getBonuses().getFloatPercentAll(ModType.Slay, SourceType.Rat, null);
|
||||||
|
|
||||||
minDamage *= percent;
|
minDamage *= percent;
|
||||||
maxDamage *= percent;
|
maxDamage *= percent;
|
||||||
@@ -1119,9 +1118,9 @@ public enum CombatManager {
|
|||||||
if (eff.getPower() != null && (eff.getPower().getToken() == 429506943 || eff.getPower().getToken() == 429408639 || eff.getPower().getToken() == 429513599 || eff.getPower().getToken() == 429415295))
|
if (eff.getPower() != null && (eff.getPower().getToken() == 429506943 || eff.getPower().getToken() == 429408639 || eff.getPower().getToken() == 429513599 || eff.getPower().getToken() == 429415295))
|
||||||
swingAnimation = 0;
|
swingAnimation = 0;
|
||||||
|
|
||||||
if(source != null && source.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
// if(source != null && source.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
||||||
damage *= ((PlayerCharacter)source).ZergMultiplier;
|
// damage *= ((PlayerCharacter)source).ZergMultiplier;
|
||||||
} // Health modifications are modified by the ZergMechanic
|
//} // Health modifications are modified by the ZergMechanic
|
||||||
|
|
||||||
TargetedActionMsg cmm = new TargetedActionMsg(source, target, damage, swingAnimation);
|
TargetedActionMsg cmm = new TargetedActionMsg(source, target, damage, swingAnimation);
|
||||||
DispatchMessage.sendToAllInRange(target, cmm);
|
DispatchMessage.sendToAllInRange(target, cmm);
|
||||||
@@ -1284,7 +1283,7 @@ public enum CombatManager {
|
|||||||
return 0f;
|
return 0f;
|
||||||
|
|
||||||
if (bonus != null)
|
if (bonus != null)
|
||||||
rangeMod += bonus.getFloatPercentAll(ModType.WeaponRange, SourceType.None);
|
rangeMod += bonus.getFloatPercentAll(ModType.WeaponRange, SourceType.None, null);
|
||||||
|
|
||||||
return weapon.getRange() * rangeMod;
|
return weapon.getRange() * rangeMod;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -564,7 +564,7 @@ public enum PowersManager {
|
|||||||
cost = 0;
|
cost = 0;
|
||||||
|
|
||||||
if (bonus != null)
|
if (bonus != null)
|
||||||
cost *= (1 + bonus.getFloatPercentAll(ModType.PowerCost, SourceType.None));
|
cost *= (1 + bonus.getFloatPercentAll(ModType.PowerCost, SourceType.None, null));
|
||||||
|
|
||||||
if (playerCharacter.getAltitude() > 0)
|
if (playerCharacter.getAltitude() > 0)
|
||||||
cost *= 1.5f;
|
cost *= 1.5f;
|
||||||
|
|||||||
@@ -1437,7 +1437,7 @@ public class MobAI {
|
|||||||
if (mob.isSit() && mob.getTimeStamp("HEALTHRECOVERED") < System.currentTimeMillis() + 3000)
|
if (mob.isSit() && mob.getTimeStamp("HEALTHRECOVERED") < System.currentTimeMillis() + 3000)
|
||||||
if (mob.getHealth() < mob.getHealthMax()) {
|
if (mob.getHealth() < mob.getHealthMax()) {
|
||||||
|
|
||||||
float recoveredHealth = mob.getHealthMax() * ((1 + mob.getBonuses().getFloatPercentAll(Enum.ModType.HealthRecoverRate, Enum.SourceType.None)) * 0.01f);
|
float recoveredHealth = mob.getHealthMax() * ((1 + mob.getBonuses().getFloatPercentAll(Enum.ModType.HealthRecoverRate, Enum.SourceType.None, null)) * 0.01f);
|
||||||
mob.setHealth(mob.getHealth() + recoveredHealth);
|
mob.setHealth(mob.getHealth() + recoveredHealth);
|
||||||
mob.getTimestamps().put("HEALTHRECOVERED", System.currentTimeMillis());
|
mob.getTimestamps().put("HEALTHRECOVERED", System.currentTimeMillis());
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import org.pmw.tinylog.Logger;
|
|||||||
import java.util.concurrent.ThreadLocalRandom;
|
import java.util.concurrent.ThreadLocalRandom;
|
||||||
|
|
||||||
import static engine.math.FastMath.sqr;
|
import static engine.math.FastMath.sqr;
|
||||||
import static java.lang.Math.pow;
|
|
||||||
|
|
||||||
public class CombatUtilities {
|
public class CombatUtilities {
|
||||||
|
|
||||||
@@ -152,7 +151,7 @@ public class CombatUtilities {
|
|||||||
int atr = agent.mobBase.getAtr();
|
int atr = agent.mobBase.getAtr();
|
||||||
if(agent.getBonuses() != null){
|
if(agent.getBonuses() != null){
|
||||||
atr += agent.getBonuses().getFloat(ModType.OCV,SourceType.None);
|
atr += agent.getBonuses().getFloat(ModType.OCV,SourceType.None);
|
||||||
atr *= 1 + agent.getBonuses().getFloatPercentAll(ModType.OCV,SourceType.None);
|
atr *= 1 + agent.getBonuses().getFloatPercentAll(ModType.OCV,SourceType.None, null);
|
||||||
}
|
}
|
||||||
switch (target.getObjectType()) {
|
switch (target.getObjectType()) {
|
||||||
case PlayerCharacter:
|
case PlayerCharacter:
|
||||||
@@ -358,7 +357,7 @@ public class CombatUtilities {
|
|||||||
float damage;
|
float damage;
|
||||||
float min = 40;
|
float min = 40;
|
||||||
float max = 60;
|
float max = 60;
|
||||||
float dmgMultiplier = 1 + agent.getBonuses().getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
|
float dmgMultiplier = 1 + agent.getBonuses().getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None, null);
|
||||||
double minDmg = getMinDmg(agent);
|
double minDmg = getMinDmg(agent);
|
||||||
double maxDmg = getMaxDmg(agent);
|
double maxDmg = getMaxDmg(agent);
|
||||||
dmgMultiplier += agent.getLevel() * 0.1f;
|
dmgMultiplier += agent.getLevel() * 0.1f;
|
||||||
@@ -372,7 +371,7 @@ public class CombatUtilities {
|
|||||||
ItemBase weapon = agent.getEquip().get(1).getItemBase();
|
ItemBase weapon = agent.getEquip().get(1).getItemBase();
|
||||||
AbstractWorldObject target = agent.getCombatTarget();
|
AbstractWorldObject target = agent.getCombatTarget();
|
||||||
|
|
||||||
float dmgMultiplier = 1 + agent.getBonuses().getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
|
float dmgMultiplier = 1 + agent.getBonuses().getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None, null);
|
||||||
|
|
||||||
double minDmg = weapon.getMinDamage();
|
double minDmg = weapon.getMinDamage();
|
||||||
double maxDmg = weapon.getMaxDamage();
|
double maxDmg = weapon.getMaxDamage();
|
||||||
@@ -396,7 +395,7 @@ public class CombatUtilities {
|
|||||||
//handle r8 mob damage
|
//handle r8 mob damage
|
||||||
DamageType dt = DamageType.Crush;
|
DamageType dt = DamageType.Crush;
|
||||||
AbstractWorldObject target = agent.getCombatTarget();
|
AbstractWorldObject target = agent.getCombatTarget();
|
||||||
float dmgMultiplier = 1 + agent.getBonuses().getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
|
float dmgMultiplier = 1 + agent.getBonuses().getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None, null);
|
||||||
double min = agent.getMinDamageHandOne();
|
double min = agent.getMinDamageHandOne();
|
||||||
double max = agent.getMaxDamageHandOne();
|
double max = agent.getMaxDamageHandOne();
|
||||||
if (agent.getEquip().get(1) != null) {
|
if (agent.getEquip().get(1) != null) {
|
||||||
|
|||||||
@@ -1187,13 +1187,13 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
|
|
||||||
public final float modifyHealth(float value, final AbstractCharacter attacker, final boolean fromCost) {
|
public final float modifyHealth(float value, final AbstractCharacter attacker, final boolean fromCost) {
|
||||||
|
|
||||||
if(attacker != null && attacker.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
//if(attacker != null && attacker.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
||||||
value *= ((PlayerCharacter)attacker).ZergMultiplier;
|
// value *= ((PlayerCharacter)attacker).ZergMultiplier;
|
||||||
} // Health modifications are modified by the ZergMechanic
|
//} // Health modifications are modified by the ZergMechanic
|
||||||
|
|
||||||
if(attacker != null && attacker.getObjectType().equals(GameObjectType.Mob) && ((Mob)attacker).getOwner() != null){
|
//if(attacker != null && attacker.getObjectType().equals(GameObjectType.Mob) && ((Mob)attacker).getOwner() != null){
|
||||||
value *= ((Mob)attacker).getOwner().ZergMultiplier;
|
// value *= ((Mob)attacker).getOwner().ZergMultiplier;
|
||||||
}// Health modifications from pets are modified by the owner's ZergMechanic
|
//}// Health modifications from pets are modified by the owner's ZergMechanic
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -1262,13 +1262,13 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
final boolean fromCost
|
final boolean fromCost
|
||||||
) {
|
) {
|
||||||
|
|
||||||
if(attacker != null && attacker.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
//if(attacker != null && attacker.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
||||||
value *= ((PlayerCharacter)attacker).ZergMultiplier;
|
// value *= ((PlayerCharacter)attacker).ZergMultiplier;
|
||||||
} // Health modifications are modified by the ZergMechanic
|
//} // Health modifications are modified by the ZergMechanic
|
||||||
|
|
||||||
if(attacker != null && attacker.getObjectType().equals(GameObjectType.Mob) && ((Mob)attacker).getOwner() != null){
|
//if(attacker != null && attacker.getObjectType().equals(GameObjectType.Mob) && ((Mob)attacker).getOwner() != null){
|
||||||
value *= ((Mob)attacker).getOwner().ZergMultiplier;
|
// value *= ((Mob)attacker).getOwner().ZergMultiplier;
|
||||||
}// Health modifications from pets are modified by the owner's ZergMechanic
|
//}// Health modifications from pets are modified by the owner's ZergMechanic
|
||||||
|
|
||||||
if (!this.isAlive()) {
|
if (!this.isAlive()) {
|
||||||
return 0f;
|
return 0f;
|
||||||
@@ -1309,13 +1309,13 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
final boolean fromCost
|
final boolean fromCost
|
||||||
) {
|
) {
|
||||||
|
|
||||||
if(attacker != null && attacker.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
//if(attacker != null && attacker.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
||||||
value *= ((PlayerCharacter)attacker).ZergMultiplier;
|
// value *= ((PlayerCharacter)attacker).ZergMultiplier;
|
||||||
} // Health modifications are modified by the ZergMechanic
|
//} // Health modifications are modified by the ZergMechanic
|
||||||
|
|
||||||
if(attacker != null && attacker.getObjectType().equals(GameObjectType.Mob) && ((Mob)attacker).getOwner() != null){
|
//if(attacker != null && attacker.getObjectType().equals(GameObjectType.Mob) && ((Mob)attacker).getOwner() != null){
|
||||||
value *= ((Mob)attacker).getOwner().ZergMultiplier;
|
// value *= ((Mob)attacker).getOwner().ZergMultiplier;
|
||||||
}// Health modifications from pets are modified by the owner's ZergMechanic
|
//}// Health modifications from pets are modified by the owner's ZergMechanic
|
||||||
|
|
||||||
if (!this.isAlive()) {
|
if (!this.isAlive()) {
|
||||||
return 0f;
|
return 0f;
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ public abstract class AbstractIntelligenceAgent extends AbstractCharacter {
|
|||||||
float ret = MobAIThread.AI_BASE_AGGRO_RANGE;
|
float ret = MobAIThread.AI_BASE_AGGRO_RANGE;
|
||||||
|
|
||||||
if (this.bonuses != null)
|
if (this.bonuses != null)
|
||||||
ret *= (1 + this.bonuses.getFloatPercentAll(ModType.ScanRange, SourceType.None));
|
ret *= (1 + this.bonuses.getFloatPercentAll(ModType.ScanRange, SourceType.None, null));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1127,7 +1127,7 @@ public class CharacterSkill extends AbstractGameObject {
|
|||||||
|
|
||||||
if (CharacterSkill.GetOwner(this).getBonuses() != null) {
|
if (CharacterSkill.GetOwner(this).getBonuses() != null) {
|
||||||
//Multiply any percent bonuses
|
//Multiply any percent bonuses
|
||||||
modAmount *= (1 + CharacterSkill.GetOwner(this).getBonuses().getFloatPercentAll(ModType.Skill, sourceType));
|
modAmount *= (1 + CharacterSkill.GetOwner(this).getBonuses().getFloatPercentAll(ModType.Skill, sourceType, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.modifiedAmount = (int) (modAmount);
|
this.modifiedAmount = (int) (modAmount);
|
||||||
|
|||||||
+15
-15
@@ -1177,11 +1177,11 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
|
|
||||||
// apply dex penalty for armor
|
// apply dex penalty for armor
|
||||||
// modify percent amounts. DO THIS LAST!
|
// modify percent amounts. DO THIS LAST!
|
||||||
strVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Strength));
|
strVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Strength, null));
|
||||||
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Dexterity));
|
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Dexterity, null));
|
||||||
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Constitution));
|
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Constitution, null));
|
||||||
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Intelligence));
|
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Intelligence, null));
|
||||||
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Spirit));
|
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Spirit, null));
|
||||||
} else {
|
} else {
|
||||||
// apply dex penalty for armor
|
// apply dex penalty for armor
|
||||||
}
|
}
|
||||||
@@ -1200,7 +1200,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
float bonus = 1;
|
float bonus = 1;
|
||||||
if (this.bonuses != null)
|
if (this.bonuses != null)
|
||||||
// get rune and effect bonuses
|
// get rune and effect bonuses
|
||||||
bonus *= (1 + this.bonuses.getFloatPercentAll(ModType.Speed, SourceType.None));
|
bonus *= (1 + this.bonuses.getFloatPercentAll(ModType.Speed, SourceType.None, null));
|
||||||
|
|
||||||
if (this.isPlayerGuard)
|
if (this.isPlayerGuard)
|
||||||
switch (this.mobBase.getLoadID()) {
|
switch (this.mobBase.getLoadID()) {
|
||||||
@@ -1568,9 +1568,9 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
|
|
||||||
//apply effects percent modifiers. DO THIS LAST!
|
//apply effects percent modifiers. DO THIS LAST!
|
||||||
|
|
||||||
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, SourceType.None));
|
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, SourceType.None, null));
|
||||||
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, SourceType.None));
|
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, SourceType.None, null));
|
||||||
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.None));
|
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.None, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set max health, mana and stamina
|
// Set max health, mana and stamina
|
||||||
@@ -1853,9 +1853,9 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
int max = (int)this.mobBase.getDamageMax();
|
int max = (int)this.mobBase.getDamageMax();
|
||||||
int atr = this.mobBase.getAtr();
|
int atr = this.mobBase.getAtr();
|
||||||
if(this.bonuses != null){
|
if(this.bonuses != null){
|
||||||
min *= 1 + this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
|
min *= 1 + this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None, null);
|
||||||
max *= 1 + this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
|
max *= 1 + this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None, null);
|
||||||
atr *= 1 + this.bonuses.getFloatPercentAll(ModType.OCV,SourceType.None);
|
atr *= 1 + this.bonuses.getFloatPercentAll(ModType.OCV,SourceType.None, null);
|
||||||
atr += this.bonuses.getFloat(ModType.OCV,SourceType.None);
|
atr += this.bonuses.getFloat(ModType.OCV,SourceType.None);
|
||||||
}
|
}
|
||||||
this.minDamageHandOne = min;
|
this.minDamageHandOne = min;
|
||||||
@@ -1873,9 +1873,9 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
int max = (int)this.mobBase.getDamageMax();
|
int max = (int)this.mobBase.getDamageMax();
|
||||||
int atr = this.mobBase.getAtr();
|
int atr = this.mobBase.getAtr();
|
||||||
if(this.bonuses != null){
|
if(this.bonuses != null){
|
||||||
min *= 1 + this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
|
min *= 1 + this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None, null);
|
||||||
max *= 1 + this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
|
max *= 1 + this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None, null);
|
||||||
atr *= 1 + this.bonuses.getFloatPercentAll(ModType.OCV,SourceType.None);
|
atr *= 1 + this.bonuses.getFloatPercentAll(ModType.OCV,SourceType.None, null);
|
||||||
atr += this.bonuses.getFloat(ModType.OCV,SourceType.None);
|
atr += this.bonuses.getFloat(ModType.OCV,SourceType.None);
|
||||||
}
|
}
|
||||||
this.minDamageHandTwo = min;
|
this.minDamageHandTwo = min;
|
||||||
|
|||||||
@@ -340,7 +340,7 @@ public class PlayerBonuses {
|
|||||||
return amount;
|
return amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getFloatPercentAll(ModType modType, SourceType sourceType) {
|
public float getFloatPercentAll(ModType modType, SourceType sourceType, PlayerCharacter pc) {
|
||||||
float amount = 0;
|
float amount = 0;
|
||||||
for (AbstractEffectModifier mod : this.bonusFloats.keySet()) {
|
for (AbstractEffectModifier mod : this.bonusFloats.keySet()) {
|
||||||
|
|
||||||
@@ -357,6 +357,11 @@ public class PlayerBonuses {
|
|||||||
amount += this.bonusFloats.get(mod);
|
amount += this.bonusFloats.get(mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(pc != null) {
|
||||||
|
if (modType.equals(ModType.PowerDamageModifier) || modType.equals(ModType.MeleeDamageModifier)) {
|
||||||
|
amount -= 1.0f - pc.ZergMultiplier;
|
||||||
|
}
|
||||||
|
}
|
||||||
return amount;
|
return amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ import engine.util.MiscUtils;
|
|||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@@ -3718,11 +3717,11 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
dexVal *= this.dexPenalty;
|
dexVal *= this.dexPenalty;
|
||||||
|
|
||||||
// modify percent amounts. DO THIS LAST!
|
// modify percent amounts. DO THIS LAST!
|
||||||
strVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Strength));
|
strVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Strength, null));
|
||||||
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Dexterity));
|
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Dexterity, null));
|
||||||
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Constitution));
|
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Constitution, null));
|
||||||
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Intelligence));
|
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Intelligence, null));
|
||||||
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Spirit));
|
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Spirit, null));
|
||||||
|
|
||||||
} else
|
} else
|
||||||
// apply dex penalty for armor
|
// apply dex penalty for armor
|
||||||
@@ -4183,7 +4182,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
this.rangeHandTwo = weapon.getItemBase().getRange() * (1 + (this.statStrBase / 600));
|
this.rangeHandTwo = weapon.getItemBase().getRange() * (1 + (this.statStrBase / 600));
|
||||||
|
|
||||||
if (this.bonuses != null) {
|
if (this.bonuses != null) {
|
||||||
float range_bonus = 1 + this.bonuses.getFloatPercentAll(ModType.WeaponRange, SourceType.None);
|
float range_bonus = 1 + this.bonuses.getFloatPercentAll(ModType.WeaponRange, SourceType.None, null);
|
||||||
|
|
||||||
if (mainHand)
|
if (mainHand)
|
||||||
this.rangeHandOne *= range_bonus;
|
this.rangeHandOne *= range_bonus;
|
||||||
@@ -4350,11 +4349,11 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
float percentMinDamage = 1;
|
float percentMinDamage = 1;
|
||||||
float percentMaxDamage = 1;
|
float percentMaxDamage = 1;
|
||||||
|
|
||||||
percentMinDamage += this.bonuses.getFloatPercentAll(ModType.MinDamage, SourceType.None);
|
percentMinDamage += this.bonuses.getFloatPercentAll(ModType.MinDamage, SourceType.None, null);
|
||||||
percentMinDamage += this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
|
percentMinDamage += this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None, null);
|
||||||
|
|
||||||
percentMaxDamage += this.bonuses.getFloatPercentAll(ModType.MaxDamage, SourceType.None);
|
percentMaxDamage += this.bonuses.getFloatPercentAll(ModType.MaxDamage, SourceType.None, null);
|
||||||
percentMaxDamage += this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
|
percentMaxDamage += this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None, null);
|
||||||
|
|
||||||
minDamage *= percentMinDamage;
|
minDamage *= percentMinDamage;
|
||||||
maxDamage *= percentMaxDamage;
|
maxDamage *= percentMaxDamage;
|
||||||
@@ -4674,9 +4673,9 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
m += this.bonuses.getFloat(ModType.ManaFull, SourceType.None);
|
m += this.bonuses.getFloat(ModType.ManaFull, SourceType.None);
|
||||||
s += this.bonuses.getFloat(ModType.StaminaFull, SourceType.None);
|
s += this.bonuses.getFloat(ModType.StaminaFull, SourceType.None);
|
||||||
|
|
||||||
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, SourceType.None));
|
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, SourceType.None, null));
|
||||||
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, SourceType.None));
|
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, SourceType.None, null));
|
||||||
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.None));
|
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.None, null));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4758,7 +4757,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
divisr = 16;
|
divisr = 16;
|
||||||
float blockChance = ((passiveSkill.getModifiedAmount() + blockBonusFromShield) / divisr);
|
float blockChance = ((passiveSkill.getModifiedAmount() + blockBonusFromShield) / divisr);
|
||||||
if(this.bonuses != null)
|
if(this.bonuses != null)
|
||||||
blockChance *= 1 + this.bonuses.getFloatPercentAll(ModType.Block, SourceType.None);
|
blockChance *= 1 + this.bonuses.getFloatPercentAll(ModType.Block, SourceType.None, null);
|
||||||
return blockChance;
|
return blockChance;
|
||||||
|
|
||||||
case "Parry":
|
case "Parry":
|
||||||
@@ -4782,7 +4781,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
float parryChance =((passiveSkill.getModifiedAmount() + parryBonus) / 4);
|
float parryChance =((passiveSkill.getModifiedAmount() + parryBonus) / 4);
|
||||||
|
|
||||||
if(this.bonuses != null)
|
if(this.bonuses != null)
|
||||||
parryChance *= 1 + this.bonuses.getFloatPercentAll(ModType.Parry, SourceType.None);
|
parryChance *= 1 + this.bonuses.getFloatPercentAll(ModType.Parry, SourceType.None, null);
|
||||||
|
|
||||||
return parryChance;
|
return parryChance;
|
||||||
|
|
||||||
@@ -4798,7 +4797,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
float dodgeChance = ((passiveSkill.getModifiedAmount()) / divisor);
|
float dodgeChance = ((passiveSkill.getModifiedAmount()) / divisor);
|
||||||
|
|
||||||
if(this.bonuses != null)
|
if(this.bonuses != null)
|
||||||
dodgeChance *= 1 + this.bonuses.getFloatPercentAll(ModType.Dodge, SourceType.None);
|
dodgeChance *= 1 + this.bonuses.getFloatPercentAll(ModType.Dodge, SourceType.None, null);
|
||||||
|
|
||||||
return dodgeChance;
|
return dodgeChance;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -1,21 +1,16 @@
|
|||||||
package engine.objects;
|
package engine.objects;
|
||||||
|
|
||||||
import engine.Enum;
|
import engine.Enum;
|
||||||
import engine.gameManager.ChatManager;
|
|
||||||
import engine.math.Vector2f;
|
import engine.math.Vector2f;
|
||||||
import engine.math.Vector3fImmutable;
|
import engine.math.Vector3fImmutable;
|
||||||
import engine.powers.EffectsBase;
|
import engine.powers.EffectsBase;
|
||||||
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
||||||
import engine.server.MBServerStatics;
|
|
||||||
import org.pmw.tinylog.Logger;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
|
|
||||||
public class PlayerCombatStats {
|
public class PlayerCombatStats {
|
||||||
|
|
||||||
@@ -453,6 +448,9 @@ public class PlayerCombatStats {
|
|||||||
}
|
}
|
||||||
atr = (float) Math.round(atr);
|
atr = (float) Math.round(atr);
|
||||||
|
|
||||||
|
if(atr < 0)
|
||||||
|
atr = 0;
|
||||||
|
|
||||||
if(mainHand){
|
if(mainHand){
|
||||||
this.atrHandOne = atr;
|
this.atrHandOne = atr;
|
||||||
}else{
|
}else{
|
||||||
@@ -521,7 +519,7 @@ public class PlayerCombatStats {
|
|||||||
);
|
);
|
||||||
if(this.owner.bonuses != null){
|
if(this.owner.bonuses != null){
|
||||||
minDMG += this.owner.bonuses.getFloat(Enum.ModType.MinDamage, Enum.SourceType.None);
|
minDMG += this.owner.bonuses.getFloat(Enum.ModType.MinDamage, Enum.SourceType.None);
|
||||||
minDMG *= 1 + this.owner.bonuses.getFloatPercentAll(Enum.ModType.MeleeDamageModifier, Enum.SourceType.None);
|
minDMG *= 1 + this.owner.bonuses.getFloatPercentAll(Enum.ModType.MeleeDamageModifier, Enum.SourceType.None, this.owner);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.owner.charItemManager != null){
|
if(this.owner.charItemManager != null){
|
||||||
@@ -599,7 +597,7 @@ public class PlayerCombatStats {
|
|||||||
|
|
||||||
if(this.owner.bonuses != null){
|
if(this.owner.bonuses != null){
|
||||||
maxDMG += this.owner.bonuses.getFloat(Enum.ModType.MaxDamage, Enum.SourceType.None);
|
maxDMG += this.owner.bonuses.getFloat(Enum.ModType.MaxDamage, Enum.SourceType.None);
|
||||||
maxDMG *= 1 + this.owner.bonuses.getFloatPercentAll(Enum.ModType.MeleeDamageModifier, Enum.SourceType.None);
|
maxDMG *= 1 + this.owner.bonuses.getFloatPercentAll(Enum.ModType.MeleeDamageModifier, Enum.SourceType.None, this.owner);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.owner.charItemManager != null){
|
if(this.owner.charItemManager != null){
|
||||||
@@ -688,7 +686,7 @@ public class PlayerCombatStats {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float bonusValues = 1 + this.owner.bonuses.getFloatPercentAll(Enum.ModType.AttackDelay,Enum.SourceType.None);//1.0f;
|
float bonusValues = 1 + this.owner.bonuses.getFloatPercentAll(Enum.ModType.AttackDelay,Enum.SourceType.None, null);//1.0f;
|
||||||
bonusValues -= stanceValue + delayExtra; // take away stance modifier from alac bonus values
|
bonusValues -= stanceValue + delayExtra; // take away stance modifier from alac bonus values
|
||||||
speed *= 1 + stanceValue; // apply stance bonus
|
speed *= 1 + stanceValue; // apply stance bonus
|
||||||
speed *= bonusValues; // apply alac bonuses without stance mod
|
speed *= bonusValues; // apply alac bonuses without stance mod
|
||||||
@@ -724,7 +722,7 @@ public class PlayerCombatStats {
|
|||||||
range = weapon.getItemBase().getRange();
|
range = weapon.getItemBase().getRange();
|
||||||
}
|
}
|
||||||
if(owner.bonuses != null){
|
if(owner.bonuses != null){
|
||||||
range *= 1 + this.owner.bonuses.getFloatPercentAll(Enum.ModType.WeaponRange, Enum.SourceType.None);
|
range *= 1 + this.owner.bonuses.getFloatPercentAll(Enum.ModType.WeaponRange, Enum.SourceType.None, null);
|
||||||
}
|
}
|
||||||
if(mainHand){
|
if(mainHand){
|
||||||
this.rangeHandOne = range;
|
this.rangeHandOne = range;
|
||||||
@@ -868,6 +866,9 @@ public class PlayerCombatStats {
|
|||||||
}
|
}
|
||||||
defense = Math.round(defense);
|
defense = Math.round(defense);
|
||||||
|
|
||||||
|
if(defense < 0)
|
||||||
|
defense = 0;
|
||||||
|
|
||||||
this.defense = (int) defense;
|
this.defense = (int) defense;
|
||||||
} // PERFECT DO NOT TOUCH
|
} // PERFECT DO NOT TOUCH
|
||||||
|
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ public class Resists {
|
|||||||
PlayerBonuses bonus = target.getBonuses();
|
PlayerBonuses bonus = target.getBonuses();
|
||||||
|
|
||||||
//see if there is a fortitude
|
//see if there is a fortitude
|
||||||
float damageCap = bonus.getFloatPercentAll(ModType.DamageCap, SourceType.None);
|
float damageCap = bonus.getFloatPercentAll(ModType.DamageCap, SourceType.None, null);
|
||||||
if (damageCap == 0f || type == DamageType.Healing)
|
if (damageCap == 0f || type == DamageType.Healing)
|
||||||
return damage;
|
return damage;
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ public class Resists {
|
|||||||
if (forts == null || !isValidDamageCapType(forts, type, exclusive))
|
if (forts == null || !isValidDamageCapType(forts, type, exclusive))
|
||||||
return damage;
|
return damage;
|
||||||
|
|
||||||
float adjustedDamage = bonus.getFloatPercentAll(ModType.AdjustAboveDmgCap, SourceType.None);
|
float adjustedDamage = bonus.getFloatPercentAll(ModType.AdjustAboveDmgCap, SourceType.None, null);
|
||||||
//Adjust damage down and return new amount
|
//Adjust damage down and return new amount
|
||||||
float aadc = 1 + adjustedDamage;
|
float aadc = 1 + adjustedDamage;
|
||||||
return capFire * aadc;
|
return capFire * aadc;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
package engine.powers.effectmodifiers;
|
package engine.powers.effectmodifiers;
|
||||||
|
|
||||||
|
import engine.Enum;
|
||||||
import engine.Enum.DamageType;
|
import engine.Enum.DamageType;
|
||||||
import engine.Enum.GameObjectType;
|
import engine.Enum.GameObjectType;
|
||||||
import engine.Enum.ModType;
|
import engine.Enum.ModType;
|
||||||
@@ -126,8 +127,8 @@ public class HealthEffectModifier extends AbstractEffectModifier {
|
|||||||
min = HealthEffectModifier.getMinDamage(min, intt, spi, focus);
|
min = HealthEffectModifier.getMinDamage(min, intt, spi, focus);
|
||||||
max = HealthEffectModifier.getMaxDamage(max, intt, spi, focus);
|
max = HealthEffectModifier.getMaxDamage(max, intt, spi, focus);
|
||||||
|
|
||||||
min *= pc.ZergMultiplier;
|
//min *= pc.ZergMultiplier;
|
||||||
max *= pc.ZergMultiplier;
|
//max *= pc.ZergMultiplier;
|
||||||
|
|
||||||
//debug for spell damage and atr
|
//debug for spell damage and atr
|
||||||
if (pc.getDebug(16)) {
|
if (pc.getDebug(16)) {
|
||||||
@@ -169,8 +170,13 @@ public class HealthEffectModifier extends AbstractEffectModifier {
|
|||||||
PlayerBonuses bonus = source.getBonuses();
|
PlayerBonuses bonus = source.getBonuses();
|
||||||
|
|
||||||
// Apply any power effect modifiers (such as stances)
|
// Apply any power effect modifiers (such as stances)
|
||||||
if (bonus != null)
|
if (bonus != null){
|
||||||
modAmount *= (1 + (bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None)));
|
if(source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)){
|
||||||
|
modAmount *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None, (PlayerCharacter) source));
|
||||||
|
}else{
|
||||||
|
modAmount *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None, null));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (modAmount == 0f)
|
if (modAmount == 0f)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -129,8 +129,14 @@ public class ManaEffectModifier extends AbstractEffectModifier {
|
|||||||
PlayerBonuses bonus = source.getBonuses();
|
PlayerBonuses bonus = source.getBonuses();
|
||||||
|
|
||||||
// Apply any power effect modifiers (such as stances)
|
// Apply any power effect modifiers (such as stances)
|
||||||
if (bonus != null)
|
if (bonus != null){
|
||||||
modAmount *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None));
|
if(source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)){
|
||||||
|
modAmount *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None, (PlayerCharacter) source));
|
||||||
|
}else{
|
||||||
|
modAmount *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None, null));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (modAmount == 0f)
|
if (modAmount == 0f)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -125,8 +125,13 @@ public class StaminaEffectModifier extends AbstractEffectModifier {
|
|||||||
PlayerBonuses bonus = source.getBonuses();
|
PlayerBonuses bonus = source.getBonuses();
|
||||||
|
|
||||||
// Apply any power effect modifiers (such as stances)
|
// Apply any power effect modifiers (such as stances)
|
||||||
if (bonus != null)
|
if (bonus != null){
|
||||||
modAmount *= (1 + (bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None)));
|
if(source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)){
|
||||||
|
modAmount *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None, (PlayerCharacter) source));
|
||||||
|
}else{
|
||||||
|
modAmount *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None, null));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (modAmount == 0f)
|
if (modAmount == 0f)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -217,8 +217,13 @@ public class TransferStatPowerAction extends AbstractPowerAction {
|
|||||||
|
|
||||||
// Apply any power effect modifiers (such as stances)
|
// Apply any power effect modifiers (such as stances)
|
||||||
PlayerBonuses bonus = source.getBonuses();
|
PlayerBonuses bonus = source.getBonuses();
|
||||||
if (bonus != null)
|
if (bonus != null){
|
||||||
damage *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None));
|
if(source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)){
|
||||||
|
damage *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None, (PlayerCharacter) source));
|
||||||
|
}else{
|
||||||
|
damage *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None, null));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//get amount to transfer
|
//get amount to transfer
|
||||||
fromAmount = damage;
|
fromAmount = damage;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public enum KeyCloneAudit {
|
|||||||
|
|
||||||
public static boolean auditChatMsg(PlayerCharacter pc, String message) {
|
public static boolean auditChatMsg(PlayerCharacter pc, String message) {
|
||||||
|
|
||||||
if(message.contains(String.valueOf(pc.selectedUUID))) {
|
if(pc.selectedUUID != 0 && message.contains(String.valueOf(pc.selectedUUID))) {
|
||||||
//targeting software detected
|
//targeting software detected
|
||||||
|
|
||||||
Group g = GroupManager.getGroup(pc);
|
Group g = GroupManager.getGroup(pc);
|
||||||
|
|||||||
Reference in New Issue
Block a user