Browse Source

PlayerCombatStats atr

lakebane-dex-penalty
FatBoy-DOTC 1 week ago
parent
commit
b33f41200e
  1. 66
      src/engine/objects/PlayerCombatStats.java

66
src/engine/objects/PlayerCombatStats.java

@ -51,6 +51,7 @@ public class PlayerCombatStats {
public void calculateATR(boolean mainHand) { public void calculateATR(boolean mainHand) {
Item weapon; Item weapon;
float atr; float atr;
if(mainHand) { if(mainHand) {
weapon = this.owner.charItemManager.getEquipped(1); weapon = this.owner.charItemManager.getEquipped(1);
}else { }else {
@ -59,16 +60,16 @@ public class PlayerCombatStats {
String skill = "Unarmed Combat"; String skill = "Unarmed Combat";
String mastery = "Unarmed Combat Mastery"; String mastery = "Unarmed Combat Mastery";
int primary = this.owner.statDexCurrent; int primaryStat = this.owner.statDexCurrent;
if(weapon != null) { if(weapon != null) {
skill= weapon.getItemBase().getSkillRequired(); skill= weapon.getItemBase().getSkillRequired();
mastery = weapon.getItemBase().getMastery(); mastery = weapon.getItemBase().getMastery();
if(weapon.getItemBase().isStrBased()) if(weapon.getItemBase().isStrBased())
primary = this.owner.statStrCurrent; primaryStat = this.owner.statStrCurrent;
} }
float skillLevel = 5; float skillLevel = 0;
float masteryLevel = 5; float masteryLevel = 0;
if(this.owner.skills.containsKey(skill)) if(this.owner.skills.containsKey(skill))
skillLevel = this.owner.skills.get(skill).getTotalSkillPercet(); skillLevel = this.owner.skills.get(skill).getTotalSkillPercet();
@ -76,34 +77,61 @@ public class PlayerCombatStats {
if(this.owner.skills.containsKey(mastery)) if(this.owner.skills.containsKey(mastery))
masteryLevel = this.owner.skills.get(mastery).getTotalSkillPercet(); masteryLevel = this.owner.skills.get(mastery).getTotalSkillPercet();
float masteryCalc = masteryLevel * 3;
float primaryCalc = primary * 0.5f;
float skillCalc = skillLevel * 4;
float atrEnchants = 0;
float stanceValue = 0.0f; float stanceValue = 0.0f;
float atrEnchants = 0;
for(String effID : this.owner.effects.keySet()){ for(String effID : this.owner.effects.keySet()) {
if(effID.contains("Stance")){ if (effID.contains("Stance")) {
for(AbstractEffectModifier mod : this.owner.effects.get(effID).getEffectModifiers()){ for (AbstractEffectModifier mod : this.owner.effects.get(effID).getEffectModifiers()) {
if(mod.modType.equals(Enum.ModType.OCV)){ if (mod.modType.equals(Enum.ModType.OCV)) {
float percent = mod.getPercentMod(); float percent = mod.getPercentMod();
int trains = this.owner.effects.get(effID).getTrains(); int trains = this.owner.effects.get(effID).getTrains();
float modValue = percent + (trains * mod.getRamp()); float modValue = percent + (trains * mod.getRamp());
stanceValue += modValue * 0.01f; stanceValue += modValue * 0.01f;
} }
} }
} else {
for (AbstractEffectModifier mod : this.owner.effects.get(effID).getEffectModifiers()) {
if (mod.modType.equals(Enum.ModType.OCV)) {
float value = mod.getMinMod();
int trains = this.owner.effects.get(effID).getTrains();
float modValue = value + (trains * mod.getRamp());
atrEnchants += modValue;
}
}
} }
} }
if(this.owner.bonuses != null){ float prefixValues = 0.0f;
atrEnchants = this.owner.bonuses.getFloat(Enum.ModType.OCV, Enum.SourceType.None); if(weapon != null){
if(this.owner.charItemManager.getEquipped(1) != null){
for(Effect eff : this.owner.charItemManager.getEquipped(1).effects.values()){
for(AbstractEffectModifier mod : eff.getEffectModifiers()){
if(mod.modType.equals(Enum.ModType.OCV)){
prefixValues += mod.minMod * (mod.getRamp() * eff.getTrains());
}
}
}
}
} }
if(this.owner.charItemManager.getEquipped(2) != null){
for(Effect eff : this.owner.charItemManager.getEquipped(2).effects.values()){
for(AbstractEffectModifier mod : eff.getEffectModifiers()){
if(mod.modType.equals(Enum.ModType.OCV)){
prefixValues += mod.minMod * (mod.getRamp() * eff.getTrains());
}
}
}
}
float preciseRune = 1.0f;
for(CharacterRune rune : this.owner.runes){
if(rune.getRuneBase().getName().equals("Precise"))
preciseRune += 0.05f;
}
atr = primaryCalc + skillCalc + masteryCalc + atrEnchants; atr = (((primaryStat / 2) + (skillLevel * 4 + masteryLevel * 3) + prefixValues) * preciseRune + atrEnchants) * (1.0f + stanceValue);
atr *= 1 + (this.owner.bonuses.getFloatPercentAll(Enum.ModType.OCV, Enum.SourceType.None) - stanceValue);
atr *= 1 + stanceValue;
atr = (float) Math.ceil(atr);
if(mainHand){ if(mainHand){
this.atrHandOne = atr; this.atrHandOne = atr;

Loading…
Cancel
Save