new application of zerg multiplier
This commit is contained in:
@@ -1187,13 +1187,13 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
||||
|
||||
public final float modifyHealth(float value, final AbstractCharacter attacker, final boolean fromCost) {
|
||||
|
||||
if(attacker != null && attacker.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
||||
value *= ((PlayerCharacter)attacker).ZergMultiplier;
|
||||
} // Health modifications are modified by the ZergMechanic
|
||||
//if(attacker != null && attacker.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
||||
// value *= ((PlayerCharacter)attacker).ZergMultiplier;
|
||||
//} // Health modifications are modified by the ZergMechanic
|
||||
|
||||
if(attacker != null && attacker.getObjectType().equals(GameObjectType.Mob) && ((Mob)attacker).getOwner() != null){
|
||||
value *= ((Mob)attacker).getOwner().ZergMultiplier;
|
||||
}// Health modifications from pets are modified by the owner's ZergMechanic
|
||||
//if(attacker != null && attacker.getObjectType().equals(GameObjectType.Mob) && ((Mob)attacker).getOwner() != null){
|
||||
// value *= ((Mob)attacker).getOwner().ZergMultiplier;
|
||||
//}// Health modifications from pets are modified by the owner's ZergMechanic
|
||||
|
||||
try {
|
||||
|
||||
@@ -1262,13 +1262,13 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
||||
final boolean fromCost
|
||||
) {
|
||||
|
||||
if(attacker != null && attacker.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
||||
value *= ((PlayerCharacter)attacker).ZergMultiplier;
|
||||
} // Health modifications are modified by the ZergMechanic
|
||||
//if(attacker != null && attacker.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
||||
// value *= ((PlayerCharacter)attacker).ZergMultiplier;
|
||||
//} // Health modifications are modified by the ZergMechanic
|
||||
|
||||
if(attacker != null && attacker.getObjectType().equals(GameObjectType.Mob) && ((Mob)attacker).getOwner() != null){
|
||||
value *= ((Mob)attacker).getOwner().ZergMultiplier;
|
||||
}// Health modifications from pets are modified by the owner's ZergMechanic
|
||||
//if(attacker != null && attacker.getObjectType().equals(GameObjectType.Mob) && ((Mob)attacker).getOwner() != null){
|
||||
// value *= ((Mob)attacker).getOwner().ZergMultiplier;
|
||||
//}// Health modifications from pets are modified by the owner's ZergMechanic
|
||||
|
||||
if (!this.isAlive()) {
|
||||
return 0f;
|
||||
@@ -1309,13 +1309,13 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
||||
final boolean fromCost
|
||||
) {
|
||||
|
||||
if(attacker != null && attacker.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
||||
value *= ((PlayerCharacter)attacker).ZergMultiplier;
|
||||
} // Health modifications are modified by the ZergMechanic
|
||||
//if(attacker != null && attacker.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
||||
// value *= ((PlayerCharacter)attacker).ZergMultiplier;
|
||||
//} // Health modifications are modified by the ZergMechanic
|
||||
|
||||
if(attacker != null && attacker.getObjectType().equals(GameObjectType.Mob) && ((Mob)attacker).getOwner() != null){
|
||||
value *= ((Mob)attacker).getOwner().ZergMultiplier;
|
||||
}// Health modifications from pets are modified by the owner's ZergMechanic
|
||||
//if(attacker != null && attacker.getObjectType().equals(GameObjectType.Mob) && ((Mob)attacker).getOwner() != null){
|
||||
// value *= ((Mob)attacker).getOwner().ZergMultiplier;
|
||||
//}// Health modifications from pets are modified by the owner's ZergMechanic
|
||||
|
||||
if (!this.isAlive()) {
|
||||
return 0f;
|
||||
|
||||
@@ -134,7 +134,7 @@ public abstract class AbstractIntelligenceAgent extends AbstractCharacter {
|
||||
float ret = MobAIThread.AI_BASE_AGGRO_RANGE;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1127,7 +1127,7 @@ public class CharacterSkill extends AbstractGameObject {
|
||||
|
||||
if (CharacterSkill.GetOwner(this).getBonuses() != null) {
|
||||
//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);
|
||||
|
||||
+15
-15
@@ -1177,11 +1177,11 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
|
||||
// apply dex penalty for armor
|
||||
// modify percent amounts. DO THIS LAST!
|
||||
strVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Strength));
|
||||
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Dexterity));
|
||||
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Constitution));
|
||||
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Intelligence));
|
||||
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Spirit));
|
||||
strVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Strength, null));
|
||||
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Dexterity, null));
|
||||
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Constitution, null));
|
||||
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Intelligence, null));
|
||||
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Spirit, null));
|
||||
} else {
|
||||
// apply dex penalty for armor
|
||||
}
|
||||
@@ -1200,7 +1200,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
float bonus = 1;
|
||||
if (this.bonuses != null)
|
||||
// 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)
|
||||
switch (this.mobBase.getLoadID()) {
|
||||
@@ -1568,9 +1568,9 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
|
||||
//apply effects percent modifiers. DO THIS LAST!
|
||||
|
||||
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, SourceType.None));
|
||||
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, SourceType.None));
|
||||
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.None));
|
||||
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, SourceType.None, null));
|
||||
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, SourceType.None, null));
|
||||
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.None, null));
|
||||
}
|
||||
|
||||
// Set max health, mana and stamina
|
||||
@@ -1853,9 +1853,9 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
int max = (int)this.mobBase.getDamageMax();
|
||||
int atr = this.mobBase.getAtr();
|
||||
if(this.bonuses != null){
|
||||
min *= 1 + this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
|
||||
max *= 1 + this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
|
||||
atr *= 1 + this.bonuses.getFloatPercentAll(ModType.OCV,SourceType.None);
|
||||
min *= 1 + this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None, null);
|
||||
max *= 1 + this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None, null);
|
||||
atr *= 1 + this.bonuses.getFloatPercentAll(ModType.OCV,SourceType.None, null);
|
||||
atr += this.bonuses.getFloat(ModType.OCV,SourceType.None);
|
||||
}
|
||||
this.minDamageHandOne = min;
|
||||
@@ -1873,9 +1873,9 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
int max = (int)this.mobBase.getDamageMax();
|
||||
int atr = this.mobBase.getAtr();
|
||||
if(this.bonuses != null){
|
||||
min *= 1 + this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
|
||||
max *= 1 + this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
|
||||
atr *= 1 + this.bonuses.getFloatPercentAll(ModType.OCV,SourceType.None);
|
||||
min *= 1 + this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None, null);
|
||||
max *= 1 + this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None, null);
|
||||
atr *= 1 + this.bonuses.getFloatPercentAll(ModType.OCV,SourceType.None, null);
|
||||
atr += this.bonuses.getFloat(ModType.OCV,SourceType.None);
|
||||
}
|
||||
this.minDamageHandTwo = min;
|
||||
|
||||
@@ -340,7 +340,7 @@ public class PlayerBonuses {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public float getFloatPercentAll(ModType modType, SourceType sourceType) {
|
||||
public float getFloatPercentAll(ModType modType, SourceType sourceType, PlayerCharacter pc) {
|
||||
float amount = 0;
|
||||
for (AbstractEffectModifier mod : this.bonusFloats.keySet()) {
|
||||
|
||||
@@ -357,6 +357,11 @@ public class PlayerBonuses {
|
||||
amount += this.bonusFloats.get(mod);
|
||||
}
|
||||
|
||||
if(pc != null) {
|
||||
if (modType.equals(ModType.PowerDamageModifier) || modType.equals(ModType.MeleeDamageModifier)) {
|
||||
amount -= 1.0f - pc.ZergMultiplier;
|
||||
}
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,6 @@ import engine.util.MiscUtils;
|
||||
import org.joda.time.DateTime;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
@@ -3718,11 +3717,11 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
dexVal *= this.dexPenalty;
|
||||
|
||||
// modify percent amounts. DO THIS LAST!
|
||||
strVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Strength));
|
||||
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Dexterity));
|
||||
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Constitution));
|
||||
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Intelligence));
|
||||
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Spirit));
|
||||
strVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Strength, null));
|
||||
dexVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Dexterity, null));
|
||||
conVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Constitution, null));
|
||||
intVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Intelligence, null));
|
||||
spiVal *= (1 + this.bonuses.getFloatPercentAll(ModType.Attr, SourceType.Spirit, null));
|
||||
|
||||
} else
|
||||
// apply dex penalty for armor
|
||||
@@ -4183,7 +4182,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
this.rangeHandTwo = weapon.getItemBase().getRange() * (1 + (this.statStrBase / 600));
|
||||
|
||||
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)
|
||||
this.rangeHandOne *= range_bonus;
|
||||
@@ -4350,11 +4349,11 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
float percentMinDamage = 1;
|
||||
float percentMaxDamage = 1;
|
||||
|
||||
percentMinDamage += this.bonuses.getFloatPercentAll(ModType.MinDamage, SourceType.None);
|
||||
percentMinDamage += this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
|
||||
percentMinDamage += this.bonuses.getFloatPercentAll(ModType.MinDamage, SourceType.None, null);
|
||||
percentMinDamage += this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None, null);
|
||||
|
||||
percentMaxDamage += this.bonuses.getFloatPercentAll(ModType.MaxDamage, SourceType.None);
|
||||
percentMaxDamage += this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None);
|
||||
percentMaxDamage += this.bonuses.getFloatPercentAll(ModType.MaxDamage, SourceType.None, null);
|
||||
percentMaxDamage += this.bonuses.getFloatPercentAll(ModType.MeleeDamageModifier, SourceType.None, null);
|
||||
|
||||
minDamage *= percentMinDamage;
|
||||
maxDamage *= percentMaxDamage;
|
||||
@@ -4674,9 +4673,9 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
m += this.bonuses.getFloat(ModType.ManaFull, SourceType.None);
|
||||
s += this.bonuses.getFloat(ModType.StaminaFull, SourceType.None);
|
||||
|
||||
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, SourceType.None));
|
||||
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, SourceType.None));
|
||||
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.None));
|
||||
h *= (1 + this.bonuses.getFloatPercentAll(ModType.HealthFull, SourceType.None, null));
|
||||
m *= (1 + this.bonuses.getFloatPercentAll(ModType.ManaFull, SourceType.None, null));
|
||||
s *= (1 + this.bonuses.getFloatPercentAll(ModType.StaminaFull, SourceType.None, null));
|
||||
|
||||
}
|
||||
|
||||
@@ -4758,7 +4757,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
divisr = 16;
|
||||
float blockChance = ((passiveSkill.getModifiedAmount() + blockBonusFromShield) / divisr);
|
||||
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;
|
||||
|
||||
case "Parry":
|
||||
@@ -4782,7 +4781,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
float parryChance =((passiveSkill.getModifiedAmount() + parryBonus) / 4);
|
||||
|
||||
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;
|
||||
|
||||
@@ -4798,7 +4797,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
float dodgeChance = ((passiveSkill.getModifiedAmount()) / divisor);
|
||||
|
||||
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;
|
||||
default:
|
||||
|
||||
@@ -1,21 +1,16 @@
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.math.Vector2f;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.powers.EffectsBase;
|
||||
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class PlayerCombatStats {
|
||||
|
||||
@@ -453,6 +448,9 @@ public class PlayerCombatStats {
|
||||
}
|
||||
atr = (float) Math.round(atr);
|
||||
|
||||
if(atr < 0)
|
||||
atr = 0;
|
||||
|
||||
if(mainHand){
|
||||
this.atrHandOne = atr;
|
||||
}else{
|
||||
@@ -521,7 +519,7 @@ public class PlayerCombatStats {
|
||||
);
|
||||
if(this.owner.bonuses != null){
|
||||
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){
|
||||
@@ -599,7 +597,7 @@ public class PlayerCombatStats {
|
||||
|
||||
if(this.owner.bonuses != null){
|
||||
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){
|
||||
@@ -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
|
||||
speed *= 1 + stanceValue; // apply stance bonus
|
||||
speed *= bonusValues; // apply alac bonuses without stance mod
|
||||
@@ -724,7 +722,7 @@ public class PlayerCombatStats {
|
||||
range = weapon.getItemBase().getRange();
|
||||
}
|
||||
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){
|
||||
this.rangeHandOne = range;
|
||||
@@ -868,6 +866,9 @@ public class PlayerCombatStats {
|
||||
}
|
||||
defense = Math.round(defense);
|
||||
|
||||
if(defense < 0)
|
||||
defense = 0;
|
||||
|
||||
this.defense = (int) defense;
|
||||
} // PERFECT DO NOT TOUCH
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ public class Resists {
|
||||
PlayerBonuses bonus = target.getBonuses();
|
||||
|
||||
//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)
|
||||
return damage;
|
||||
|
||||
@@ -152,7 +152,7 @@ public class Resists {
|
||||
if (forts == null || !isValidDamageCapType(forts, type, exclusive))
|
||||
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
|
||||
float aadc = 1 + adjustedDamage;
|
||||
return capFire * aadc;
|
||||
|
||||
Reference in New Issue
Block a user