|
|
@ -3844,51 +3844,59 @@ public class PlayerCharacter extends AbstractCharacter { |
|
|
|
this.atrHandTwo = 1; |
|
|
|
this.atrHandTwo = 1; |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
Item equippedRight = this.charItemManager.getItemFromEquipped(ItemSlotType.RHELD.ordinal()); |
|
|
|
for(int i = 1; i < 3; i++){ |
|
|
|
int weaponSkill1 = this.skills.get("Unarmed Combat").getTotalSkillPercet(); |
|
|
|
float atr = 0; |
|
|
|
int weaponMastery1 = this.skills.get("Unarmed Combat Mastery").getTotalSkillPercet(); |
|
|
|
int primaryStat; |
|
|
|
float atr1 = 0; |
|
|
|
Item weapon = this.charItemManager.getEquipped(i); |
|
|
|
int primaryStat1; |
|
|
|
ItemBase weaponBase = null; |
|
|
|
if(equippedRight != null && equippedRight.getItemBase().isStrBased()){ |
|
|
|
String skill = "Unarmed Combat"; |
|
|
|
primaryStat1 = this.statStrCurrent; |
|
|
|
String mastery = "Unarmed Combat Mastery"; |
|
|
|
}else{ |
|
|
|
|
|
|
|
primaryStat1 = this.statDexCurrent; |
|
|
|
if(weapon != null) { |
|
|
|
} |
|
|
|
weaponBase = weapon.getItemBase(); |
|
|
|
atr1 = (primaryStat1 * 0.5f) + (weaponSkill1 * 4) + (weaponMastery1 * 3); |
|
|
|
skill = weaponBase.getSkillRequired(); |
|
|
|
if (this.bonuses != null) { |
|
|
|
mastery = weaponBase.getMastery(); |
|
|
|
atr1 += this.bonuses.getFloat(ModType.OCV, SourceType.None); |
|
|
|
} |
|
|
|
float pos_Bonus = (1 + this.bonuses.getFloatPercentPositive(ModType.OCV, SourceType.None)); |
|
|
|
int skillPercentage = this.skills.containsKey(skill) && this.skills.get(skill) != null |
|
|
|
atr1 *= pos_Bonus; |
|
|
|
? this.skills.get(skill).getTotalSkillPercet() |
|
|
|
float neg_Bonus = this.bonuses.getFloatPercentNegative(ModType.OCV, SourceType.None); |
|
|
|
: 1; |
|
|
|
atr1 *= (1 + neg_Bonus); |
|
|
|
int masteryPercentage = this.skills.containsKey(mastery) && this.skills.get(mastery) != null |
|
|
|
} |
|
|
|
? this.skills.get(mastery).getTotalSkillPercet() |
|
|
|
atr1 = (atr1 < 1) ? 1 : atr1; |
|
|
|
: 1; |
|
|
|
this.atrHandOne = (short) (atr1 + 0.5f); |
|
|
|
|
|
|
|
|
|
|
|
// Determine the primary stat based on the weapon base
|
|
|
|
|
|
|
|
if (weaponBase != null && weaponBase.isStrBased()) { |
|
|
|
|
|
|
|
primaryStat = this.statStrCurrent; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
primaryStat = this.statDexCurrent; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Item equippedLeft = this.charItemManager.getItemFromEquipped(ItemSlotType.LHELD.ordinal()); |
|
|
|
// Calculate ATR based on primary stat, skill, and mastery
|
|
|
|
int weaponSkill2 = this.skills.get("Unarmed Combat").getTotalSkillPercet(); |
|
|
|
atr = (primaryStat * 0.5f) + (skillPercentage * 4) + (masteryPercentage * 3); |
|
|
|
int weaponMastery2 = this.skills.get("Unarmed Combat Mastery").getTotalSkillPercet(); |
|
|
|
|
|
|
|
float atr2 = 0; |
|
|
|
|
|
|
|
int primaryStat2; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (equippedLeft != null && equippedLeft.getItemBase().isStrBased()) { |
|
|
|
// Add any bonuses to ATR
|
|
|
|
primaryStat2 = this.statStrCurrent; |
|
|
|
if (this.bonuses != null) { |
|
|
|
} else { |
|
|
|
atr += this.bonuses.getFloat(ModType.OCV, SourceType.None); |
|
|
|
primaryStat2 = this.statDexCurrent; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
atr2 = (primaryStat2 * 0.5f) + (weaponSkill2 * 4) + (weaponMastery2 * 3); |
|
|
|
// Apply positive bonus multipliers
|
|
|
|
|
|
|
|
float pos_Bonus = (1 + this.bonuses.getFloatPercentPositive(ModType.OCV, SourceType.None)); |
|
|
|
|
|
|
|
atr *= pos_Bonus; |
|
|
|
|
|
|
|
|
|
|
|
if (this.bonuses != null) { |
|
|
|
// Apply negative bonus multipliers
|
|
|
|
atr2 += this.bonuses.getFloat(ModType.OCV, SourceType.None); |
|
|
|
float neg_Bonus = this.bonuses.getFloatPercentNegative(ModType.OCV, SourceType.None); |
|
|
|
float pos_Bonus = (1 + this.bonuses.getFloatPercentPositive(ModType.OCV, SourceType.None)); |
|
|
|
atr *= (1 + neg_Bonus); |
|
|
|
atr2 *= pos_Bonus; |
|
|
|
} |
|
|
|
float neg_Bonus = this.bonuses.getFloatPercentNegative(ModType.OCV, SourceType.None); |
|
|
|
|
|
|
|
atr2 *= (1 + neg_Bonus); |
|
|
|
atr -= 2;//no idea why, need for sync
|
|
|
|
} |
|
|
|
// Ensure ATR is at least 1
|
|
|
|
|
|
|
|
atr = (atr < 1) ? 1 : atr; |
|
|
|
|
|
|
|
|
|
|
|
atr2 = (atr2 < 1) ? 1 : atr2; |
|
|
|
// Set atrHandOne
|
|
|
|
this.atrHandTwo = (short) (atr2 + 0.5f); |
|
|
|
if(i == 1) |
|
|
|
|
|
|
|
this.atrHandOne = (short) atr; |
|
|
|
|
|
|
|
else if(i == 2) |
|
|
|
|
|
|
|
this.atrHandTwo = (short) atr; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
public void calculateDamage(){ |
|
|
|
public void calculateDamage(){ |
|
|
|
if(this.charItemManager == null){ |
|
|
|
if(this.charItemManager == null){ |
|
|
@ -3902,15 +3910,26 @@ public class PlayerCharacter extends AbstractCharacter { |
|
|
|
this.calculateMaxDamage(); |
|
|
|
this.calculateMaxDamage(); |
|
|
|
} |
|
|
|
} |
|
|
|
public void calculateMinDamage(){ |
|
|
|
public void calculateMinDamage(){ |
|
|
|
int baseDMG1 = 1; |
|
|
|
int baseDMG1 = 2; |
|
|
|
int baseDMG2 = 1; |
|
|
|
int baseDMG2 = 2; |
|
|
|
int weaponSkill1 = this.skills.get("Unarmed Combat").getTotalSkillPercet(); |
|
|
|
int weaponSkill1 = this.skills.containsKey("Unarmed Combat") && this.skills.get("Unarmed Combat") != null |
|
|
|
int weaponSkill2 = this.skills.get("Unarmed Combat").getTotalSkillPercet(); |
|
|
|
? this.skills.get("Unarmed Combat").getTotalSkillPercet() |
|
|
|
int weaponMastery1 = this.skills.get("Unarmed Combat Mastery").getTotalSkillPercet(); |
|
|
|
: 0; |
|
|
|
int weaponMastery2 = this.skills.get("Unarmed Combat Mastery").getTotalSkillPercet(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Item equippedRight = this.charItemManager.getItemFromEquipped(ItemSlotType.RHELD.ordinal()); |
|
|
|
int weaponSkill2 = this.skills.containsKey("Unarmed Combat") && this.skills.get("Unarmed Combat") != null |
|
|
|
Item equippedLeft = this.charItemManager.getItemFromEquipped(ItemSlotType.LHELD.ordinal()); |
|
|
|
? this.skills.get("Unarmed Combat").getTotalSkillPercet() |
|
|
|
|
|
|
|
: 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int weaponMastery1 = this.skills.containsKey("Unarmed Combat Mastery") && this.skills.get("Unarmed Combat Mastery") != null |
|
|
|
|
|
|
|
? this.skills.get("Unarmed Combat Mastery").getTotalSkillPercet() |
|
|
|
|
|
|
|
: 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int weaponMastery2 = this.skills.containsKey("Unarmed Combat Mastery") && this.skills.get("Unarmed Combat Mastery") != null |
|
|
|
|
|
|
|
? this.skills.get("Unarmed Combat Mastery").getTotalSkillPercet() |
|
|
|
|
|
|
|
: 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Item equippedRight = this.charItemManager.getEquipped(1); |
|
|
|
|
|
|
|
Item equippedLeft = this.charItemManager.getEquipped(2); |
|
|
|
|
|
|
|
|
|
|
|
int primary1 = this.statDexCurrent; |
|
|
|
int primary1 = this.statDexCurrent; |
|
|
|
int secondary1 = this.statStrCurrent; |
|
|
|
int secondary1 = this.statStrCurrent; |
|
|
@ -3919,8 +3938,15 @@ public class PlayerCharacter extends AbstractCharacter { |
|
|
|
|
|
|
|
|
|
|
|
if(equippedRight != null){ |
|
|
|
if(equippedRight != null){ |
|
|
|
baseDMG1 = equippedRight.getItemBase().getMinDamage(); |
|
|
|
baseDMG1 = equippedRight.getItemBase().getMinDamage(); |
|
|
|
weaponSkill1 = this.skills.get(equippedRight.getItemBase().getSkillRequired()).getTotalSkillPercet(); |
|
|
|
weaponSkill1 = this.skills.containsKey(equippedRight.getItemBase().getSkillRequired()) |
|
|
|
weaponMastery1 = this.skills.get(equippedRight.getItemBase().getMastery()).getTotalSkillPercet(); |
|
|
|
&& this.skills.get(equippedRight.getItemBase().getSkillRequired()) != null |
|
|
|
|
|
|
|
? this.skills.get(equippedRight.getItemBase().getSkillRequired()).getTotalSkillPercet() |
|
|
|
|
|
|
|
: 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
weaponMastery1 = this.skills.containsKey(equippedRight.getItemBase().getMastery()) |
|
|
|
|
|
|
|
&& this.skills.get(equippedRight.getItemBase().getMastery()) != null |
|
|
|
|
|
|
|
? this.skills.get(equippedRight.getItemBase().getMastery()).getTotalSkillPercet() |
|
|
|
|
|
|
|
: 0; |
|
|
|
if(equippedRight.getItemBase().isStrBased()) { |
|
|
|
if(equippedRight.getItemBase().isStrBased()) { |
|
|
|
primary1 = this.statStrCurrent; |
|
|
|
primary1 = this.statStrCurrent; |
|
|
|
secondary1 = this.statDexCurrent; |
|
|
|
secondary1 = this.statDexCurrent; |
|
|
@ -3928,8 +3954,15 @@ public class PlayerCharacter extends AbstractCharacter { |
|
|
|
} |
|
|
|
} |
|
|
|
if(equippedLeft != null){ |
|
|
|
if(equippedLeft != null){ |
|
|
|
baseDMG2 = equippedLeft.getItemBase().getMinDamage(); |
|
|
|
baseDMG2 = equippedLeft.getItemBase().getMinDamage(); |
|
|
|
weaponSkill2 = this.skills.get(equippedLeft.getItemBase().getSkillRequired()).getTotalSkillPercet(); |
|
|
|
weaponSkill2 = this.skills.containsKey(equippedLeft.getItemBase().getSkillRequired()) |
|
|
|
weaponMastery2 = this.skills.get(equippedLeft.getItemBase().getMastery()).getTotalSkillPercet(); |
|
|
|
&& this.skills.get(equippedLeft.getItemBase().getSkillRequired()) != null |
|
|
|
|
|
|
|
? this.skills.get(equippedLeft.getItemBase().getSkillRequired()).getTotalSkillPercet() |
|
|
|
|
|
|
|
: 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
weaponMastery2 = this.skills.containsKey(equippedLeft.getItemBase().getMastery()) |
|
|
|
|
|
|
|
&& this.skills.get(equippedLeft.getItemBase().getMastery()) != null |
|
|
|
|
|
|
|
? this.skills.get(equippedLeft.getItemBase().getMastery()).getTotalSkillPercet() |
|
|
|
|
|
|
|
: 0; |
|
|
|
if(equippedLeft.getItemBase().isStrBased()) { |
|
|
|
if(equippedLeft.getItemBase().isStrBased()) { |
|
|
|
primary2 = this.statStrCurrent; |
|
|
|
primary2 = this.statStrCurrent; |
|
|
|
secondary2 = this.statDexCurrent; |
|
|
|
secondary2 = this.statDexCurrent; |
|
|
@ -3952,12 +3985,23 @@ public class PlayerCharacter extends AbstractCharacter { |
|
|
|
this.minDamageHandTwo = min2; |
|
|
|
this.minDamageHandTwo = min2; |
|
|
|
} |
|
|
|
} |
|
|
|
public void calculateMaxDamage() { |
|
|
|
public void calculateMaxDamage() { |
|
|
|
int baseDMG1 = 1; |
|
|
|
int baseDMG1 = 8; |
|
|
|
int baseDMG2 = 1; |
|
|
|
int baseDMG2 = 8; |
|
|
|
int weaponSkill1 = this.skills.get("Unarmed Combat").getTotalSkillPercet(); |
|
|
|
int weaponSkill1 = this.skills.containsKey("Unarmed Combat") && this.skills.get("Unarmed Combat") != null |
|
|
|
int weaponSkill2 = this.skills.get("Unarmed Combat").getTotalSkillPercet(); |
|
|
|
? this.skills.get("Unarmed Combat").getTotalSkillPercet() |
|
|
|
int weaponMastery1 = this.skills.get("Unarmed Combat Mastery").getTotalSkillPercet(); |
|
|
|
: 0; |
|
|
|
int weaponMastery2 = this.skills.get("Unarmed Combat Mastery").getTotalSkillPercet(); |
|
|
|
|
|
|
|
|
|
|
|
int weaponSkill2 = this.skills.containsKey("Unarmed Combat") && this.skills.get("Unarmed Combat") != null |
|
|
|
|
|
|
|
? this.skills.get("Unarmed Combat").getTotalSkillPercet() |
|
|
|
|
|
|
|
: 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int weaponMastery1 = this.skills.containsKey("Unarmed Combat Mastery") && this.skills.get("Unarmed Combat Mastery") != null |
|
|
|
|
|
|
|
? this.skills.get("Unarmed Combat Mastery").getTotalSkillPercet() |
|
|
|
|
|
|
|
: 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int weaponMastery2 = this.skills.containsKey("Unarmed Combat Mastery") && this.skills.get("Unarmed Combat Mastery") != null |
|
|
|
|
|
|
|
? this.skills.get("Unarmed Combat Mastery").getTotalSkillPercet() |
|
|
|
|
|
|
|
: 0; |
|
|
|
|
|
|
|
|
|
|
|
Item equippedRight = this.charItemManager.getItemFromEquipped(ItemSlotType.RHELD.ordinal()); |
|
|
|
Item equippedRight = this.charItemManager.getItemFromEquipped(ItemSlotType.RHELD.ordinal()); |
|
|
|
Item equippedLeft = this.charItemManager.getItemFromEquipped(ItemSlotType.LHELD.ordinal()); |
|
|
|
Item equippedLeft = this.charItemManager.getItemFromEquipped(ItemSlotType.LHELD.ordinal()); |
|
|
@ -3969,8 +4013,15 @@ public class PlayerCharacter extends AbstractCharacter { |
|
|
|
|
|
|
|
|
|
|
|
if (equippedRight != null) { |
|
|
|
if (equippedRight != null) { |
|
|
|
baseDMG1 = equippedRight.getItemBase().getMaxDamage(); |
|
|
|
baseDMG1 = equippedRight.getItemBase().getMaxDamage(); |
|
|
|
weaponSkill1 = this.skills.get(equippedRight.getItemBase().getSkillRequired()).getTotalSkillPercet(); |
|
|
|
weaponSkill1 = this.skills.containsKey(equippedRight.getItemBase().getSkillRequired()) |
|
|
|
weaponMastery1 = this.skills.get(equippedRight.getItemBase().getMastery()).getTotalSkillPercet(); |
|
|
|
&& this.skills.get(equippedRight.getItemBase().getSkillRequired()) != null |
|
|
|
|
|
|
|
? this.skills.get(equippedRight.getItemBase().getSkillRequired()).getTotalSkillPercet() |
|
|
|
|
|
|
|
: 1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
weaponMastery1 = this.skills.containsKey(equippedRight.getItemBase().getMastery()) |
|
|
|
|
|
|
|
&& this.skills.get(equippedRight.getItemBase().getMastery()) != null |
|
|
|
|
|
|
|
? this.skills.get(equippedRight.getItemBase().getMastery()).getTotalSkillPercet() |
|
|
|
|
|
|
|
: 1; |
|
|
|
if (equippedRight.getItemBase().isStrBased()) { |
|
|
|
if (equippedRight.getItemBase().isStrBased()) { |
|
|
|
primary1 = this.statStrCurrent; |
|
|
|
primary1 = this.statStrCurrent; |
|
|
|
secondary1 = this.statDexCurrent; |
|
|
|
secondary1 = this.statDexCurrent; |
|
|
@ -3979,8 +4030,15 @@ public class PlayerCharacter extends AbstractCharacter { |
|
|
|
|
|
|
|
|
|
|
|
if (equippedLeft != null) { |
|
|
|
if (equippedLeft != null) { |
|
|
|
baseDMG2 = equippedLeft.getItemBase().getMaxDamage(); |
|
|
|
baseDMG2 = equippedLeft.getItemBase().getMaxDamage(); |
|
|
|
weaponSkill2 = this.skills.get(equippedLeft.getItemBase().getSkillRequired()).getTotalSkillPercet(); |
|
|
|
weaponSkill2 = this.skills.containsKey(equippedLeft.getItemBase().getSkillRequired()) |
|
|
|
weaponMastery2 = this.skills.get(equippedLeft.getItemBase().getMastery()).getTotalSkillPercet(); |
|
|
|
&& this.skills.get(equippedLeft.getItemBase().getSkillRequired()) != null |
|
|
|
|
|
|
|
? this.skills.get(equippedLeft.getItemBase().getSkillRequired()).getTotalSkillPercet() |
|
|
|
|
|
|
|
: 1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
weaponMastery2 = this.skills.containsKey(equippedLeft.getItemBase().getMastery()) |
|
|
|
|
|
|
|
&& this.skills.get(equippedLeft.getItemBase().getMastery()) != null |
|
|
|
|
|
|
|
? this.skills.get(equippedLeft.getItemBase().getMastery()).getTotalSkillPercet() |
|
|
|
|
|
|
|
: 1; |
|
|
|
if (equippedLeft.getItemBase().isStrBased()) { |
|
|
|
if (equippedLeft.getItemBase().isStrBased()) { |
|
|
|
primary2 = this.statStrCurrent; |
|
|
|
primary2 = this.statStrCurrent; |
|
|
|
secondary2 = this.statDexCurrent; |
|
|
|
secondary2 = this.statDexCurrent; |
|
|
@ -4296,15 +4354,15 @@ public class PlayerCharacter extends AbstractCharacter { |
|
|
|
// set damages
|
|
|
|
// set damages
|
|
|
|
if (mainHand) { |
|
|
|
if (mainHand) { |
|
|
|
this.minDamageHandOne = (int) minDamage; |
|
|
|
this.minDamageHandOne = (int) minDamage; |
|
|
|
this.maxDamageHandOne = (int) maxDamage; |
|
|
|
this.maxDamageHandOne = (int) maxDamage + 1; |
|
|
|
this.speedHandOne = speed; |
|
|
|
this.speedHandOne = speed; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.minDamageHandTwo = (int) minDamage; |
|
|
|
this.minDamageHandTwo = (int) minDamage; |
|
|
|
this.maxDamageHandTwo = (int) maxDamage; |
|
|
|
this.maxDamageHandTwo = (int) maxDamage + 1; |
|
|
|
this.speedHandTwo = speed; |
|
|
|
this.speedHandTwo = speed; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//this.calculateATR();
|
|
|
|
this.calculateATR(); |
|
|
|
//this.calculateDamage();
|
|
|
|
//this.calculateDamage();
|
|
|
|
//this.calculateSpeed();
|
|
|
|
//this.calculateSpeed();
|
|
|
|
} |
|
|
|
} |
|
|
|