Browse Source

correct use of proper stat for ATR calculation

lakebane
FatBoy-DOTC 4 days ago
parent
commit
01a88c85a6
  1. 39
      src/engine/objects/PlayerCharacter.java

39
src/engine/objects/PlayerCharacter.java

@ -3844,7 +3844,7 @@ public class PlayerCharacter extends AbstractCharacter {
// make sure weapon exists // make sure weapon exists
boolean noWeapon = false; boolean noWeapon = false;
ItemBase wb = null; ItemBase weaponBase = null;
if (weapon == null) if (weapon == null)
noWeapon = true; noWeapon = true;
else { else {
@ -3855,7 +3855,7 @@ public class PlayerCharacter extends AbstractCharacter {
defaultAtrAndDamage(mainHand); defaultAtrAndDamage(mainHand);
return; return;
} else } else
wb = ib; weaponBase = ib;
} }
float skillPercentage, masteryPercentage; float skillPercentage, masteryPercentage;
float mastDam; float mastDam;
@ -3905,16 +3905,16 @@ public class PlayerCharacter extends AbstractCharacter {
this.rangeHandTwo *= range_bonus; this.rangeHandTwo *= range_bonus;
} }
skillPercentage = getModifiedAmount(this.skills.get(wb.getSkillRequired())); skillPercentage = getModifiedAmount(this.skills.get(weaponBase.getSkillRequired()));
masteryPercentage = getModifiedAmount(this.skills.get(wb.getMastery())); masteryPercentage = getModifiedAmount(this.skills.get(weaponBase.getMastery()));
if (masteryPercentage == 0f) if (masteryPercentage == 0f)
mastDam = 0f; mastDam = 0f;
// mastDam = CharacterSkill.getQuickMastery(this, wb.getMastery()); // mastDam = CharacterSkill.getQuickMastery(this, weaponBase.getMastery());
else else
mastDam = masteryPercentage; mastDam = masteryPercentage;
min = (float) wb.getMinDamage(); min = (float) weaponBase.getMinDamage();
max = (float) wb.getMaxDamage(); max = (float) weaponBase.getMaxDamage();
strBased = wb.isStrBased(); strBased = weaponBase.isStrBased();
} }
@ -3926,13 +3926,16 @@ public class PlayerCharacter extends AbstractCharacter {
this.atrHandTwo = (short) 0; this.atrHandTwo = (short) 0;
else { else {
// calculate atr // calculate atr
//(Primary Stat / 2) + (Weapon Skill * 4) + (Weapon Mastery * 3) + (ATR Enchantments) * 1.stance modifier
float atr = 0; float atr = 0;
atr += (int) skillPercentage * 4f; //<-round down skill% - int primaryStat;
atr += (int) masteryPercentage * 3f; if(weaponBase != null && !weaponBase.isStrBased()){
if (this.statStrCurrent > this.statDexCurrent) primaryStat = this.statDexCurrent;
atr += statStrCurrent / 2; }else{
else primaryStat = this.statStrCurrent;
atr += statDexCurrent / 2; }
atr = (primaryStat * 0.5f) + (skillPercentage * 4) + (masteryPercentage * 3);
// add in any bonuses to atr // add in any bonuses to atr
if (this.bonuses != null) { if (this.bonuses != null) {
@ -3943,10 +3946,6 @@ public class PlayerCharacter extends AbstractCharacter {
float pos_Bonus = (1 + this.bonuses.getFloatPercentPositive(ModType.OCV, SourceType.None)); float pos_Bonus = (1 + this.bonuses.getFloatPercentPositive(ModType.OCV, SourceType.None));
atr *= pos_Bonus; atr *= pos_Bonus;
// next precise
//runes will have their own bonuses.
// atr *= (1 + ((float) this.bonuses.getShort("rune.Attack") / 100));
//and negative percent modifiers //and negative percent modifiers
float neg_Bonus = this.bonuses.getFloatPercentNegative(ModType.OCV, SourceType.None); float neg_Bonus = this.bonuses.getFloatPercentNegative(ModType.OCV, SourceType.None);
@ -3963,8 +3962,8 @@ public class PlayerCharacter extends AbstractCharacter {
} }
//calculate speed //calculate speed
if (wb != null) if (weaponBase != null)
speed = wb.getSpeed(); speed = weaponBase.getSpeed();
else else
speed = 20f; //unarmed attack speed speed = 20f; //unarmed attack speed
if (weapon != null) if (weapon != null)

Loading…
Cancel
Save