PlayerCombatStats defense formula
This commit is contained in:
@@ -496,8 +496,7 @@ public class PlayerCombatStats {
|
|||||||
}
|
}
|
||||||
for(String armorUsed : armorsUsed){
|
for(String armorUsed : armorsUsed){
|
||||||
if(this.owner.skills.containsKey(armorUsed)) {
|
if(this.owner.skills.containsKey(armorUsed)) {
|
||||||
armorSkill += this.owner.skills.get(armorUsed).getSkillPercentFromAttributes();
|
armorSkill += calculateModifiedSkill(armorUsed,this.owner);
|
||||||
armorSkill += this.owner.skills.get(armorUsed).getSkillPercentFromTrains();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(armorsUsed.size() > 0)
|
if(armorsUsed.size() > 0)
|
||||||
@@ -505,7 +504,7 @@ public class PlayerCombatStats {
|
|||||||
|
|
||||||
float blockSkill = 0.0f;
|
float blockSkill = 0.0f;
|
||||||
if(this.owner.skills.containsKey("Block"))
|
if(this.owner.skills.containsKey("Block"))
|
||||||
blockSkill = this.owner.skills.get("Block").getModifiedAmount();
|
blockSkill = calculateModifiedSkill("Block",this.owner);
|
||||||
|
|
||||||
float shieldDefense = 0.0f;
|
float shieldDefense = 0.0f;
|
||||||
if(this.owner.charItemManager.getEquipped(2) != null && this.owner.charItemManager.getEquipped(2).getItemBase().isShield()){
|
if(this.owner.charItemManager.getEquipped(2) != null && this.owner.charItemManager.getEquipped(2).getItemBase().isShield()){
|
||||||
@@ -574,6 +573,10 @@ public class PlayerCombatStats {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(this.owner.charItemManager.getEquipped(2) == null)
|
||||||
|
blockSkill = 0;
|
||||||
|
else if(this.owner.charItemManager != null && this.owner.charItemManager.getEquipped(2) != null && !this.owner.charItemManager.getEquipped(2).getItemBase().isShield())
|
||||||
|
blockSkill = 0;
|
||||||
|
|
||||||
float defense = (1 + armorSkill/ 50) * armorDefense;
|
float defense = (1 + armorSkill/ 50) * armorDefense;
|
||||||
defense += (1 + blockSkill / 100) * shieldDefense;
|
defense += (1 + blockSkill / 100) * shieldDefense;
|
||||||
@@ -583,8 +586,8 @@ public class PlayerCombatStats {
|
|||||||
defense *= luckyRune;
|
defense *= luckyRune;
|
||||||
defense += flatBonuses;
|
defense += flatBonuses;
|
||||||
defense *= stanceMod;
|
defense *= stanceMod;
|
||||||
|
defense = (int)defense;
|
||||||
this.defense = Math.round(defense);
|
this.defense = (int)defense;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float calculateModifiedSkill(String skillName, PlayerCharacter pc) {
|
public static float calculateModifiedSkill(String skillName, PlayerCharacter pc) {
|
||||||
@@ -661,7 +664,7 @@ public class PlayerCombatStats {
|
|||||||
modAmount *= (1 + pc.getBonuses().getFloatPercentAll(Enum.ModType.Skill, sourceType));
|
modAmount *= (1 + pc.getBonuses().getFloatPercentAll(Enum.ModType.Skill, sourceType));
|
||||||
}
|
}
|
||||||
|
|
||||||
float modifiedAmount = (int) (modAmount);
|
float modifiedAmount = Math.round(modAmount);
|
||||||
|
|
||||||
return modifiedAmount;
|
return modifiedAmount;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user