PlayerCombatStats min/max rounding final
This commit is contained in:
@@ -113,7 +113,7 @@ public class PlayerCombatStats {
|
|||||||
|
|
||||||
public void calculateMin(boolean mainHand) {
|
public void calculateMin(boolean mainHand) {
|
||||||
Item weapon;
|
Item weapon;
|
||||||
double baseDMG = 1;
|
float baseDMG = 1;
|
||||||
int primaryStat = this.owner.statDexCurrent;
|
int primaryStat = this.owner.statDexCurrent;
|
||||||
int secondaryStat = this.owner.statStrCurrent;
|
int secondaryStat = this.owner.statStrCurrent;
|
||||||
double weaponSkill = 5;
|
double weaponSkill = 5;
|
||||||
@@ -139,11 +139,11 @@ public class PlayerCombatStats {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.owner.skills.containsKey(skill)) {
|
if (this.owner.skills.containsKey(skill)) {
|
||||||
weaponSkill = this.owner.skills.get(skill).getModifiedAmount();
|
weaponSkill = this.owner.skills.get(skill).getTotalSkillPercet();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.owner.skills.containsKey(mastery)) {
|
if (this.owner.skills.containsKey(mastery)) {
|
||||||
weaponMastery = this.owner.skills.get(mastery).getModifiedAmount();
|
weaponMastery = this.owner.skills.get(mastery).getTotalSkillPercet();
|
||||||
}
|
}
|
||||||
|
|
||||||
double minDMG = baseDMG * (
|
double minDMG = baseDMG * (
|
||||||
@@ -155,14 +155,15 @@ 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int roundedMin = (int)Math.round(minDMG);
|
||||||
|
|
||||||
if (mainHand) {
|
if (mainHand) {
|
||||||
this.minDamageHandOne = (int) minDMG;
|
this.minDamageHandOne = roundedMin;
|
||||||
} else {
|
} else {
|
||||||
this.minDamageHandTwo = (int) minDMG;
|
this.minDamageHandTwo = roundedMin;
|
||||||
if(this.owner.charItemManager.getEquipped(1) == null && this.owner.charItemManager.getEquipped(2) != null){
|
if(this.owner.charItemManager.getEquipped(1) == null && this.owner.charItemManager.getEquipped(2) != null){
|
||||||
this.minDamageHandOne = 0;
|
this.minDamageHandOne = 0;
|
||||||
}
|
}
|
||||||
@@ -219,10 +220,12 @@ public class PlayerCombatStats {
|
|||||||
maxDMG *= 1 + this.owner.bonuses.getFloatPercentAll(Enum.ModType.MeleeDamageModifier, Enum.SourceType.None);
|
maxDMG *= 1 + this.owner.bonuses.getFloatPercentAll(Enum.ModType.MeleeDamageModifier, Enum.SourceType.None);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int roundedMax = (int)Math.round(maxDMG);
|
||||||
|
|
||||||
if(mainHand){
|
if(mainHand){
|
||||||
this.maxDamageHandOne = (int) maxDMG;
|
this.maxDamageHandOne = roundedMax;
|
||||||
}else{
|
}else{
|
||||||
this.maxDamageHandTwo = (int) maxDMG;
|
this.maxDamageHandTwo = roundedMax;
|
||||||
if(this.owner.charItemManager.getEquipped(1) == null && this.owner.charItemManager.getEquipped(2) != null){
|
if(this.owner.charItemManager.getEquipped(1) == null && this.owner.charItemManager.getEquipped(2) != null){
|
||||||
this.maxDamageHandOne = 0;
|
this.maxDamageHandOne = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user