Browse Source

PlayerCombatStats object

lakebane-dex-penalty
FatBoy-DOTC 1 week ago
parent
commit
4ff22d1d20
  1. 6
      src/engine/objects/PlayerCharacter.java
  2. 24
      src/engine/objects/PlayerCombatStats.java

6
src/engine/objects/PlayerCharacter.java

@ -5108,13 +5108,13 @@ public class PlayerCharacter extends AbstractCharacter { @@ -5108,13 +5108,13 @@ public class PlayerCharacter extends AbstractCharacter {
}
if(this.combatStats == null){
if(this.isAlive() && this.isActive && this.enteredWorld) {
if (this.combatStats == null) {
this.combatStats = new PlayerCombatStats(this);
}
PlayerCombatStats cStats = this.combatStats;
cStats.update();
}
} catch (Exception e) {
Logger.error(e);
} finally {

24
src/engine/objects/PlayerCombatStats.java

@ -112,7 +112,7 @@ public class PlayerCombatStats { @@ -112,7 +112,7 @@ public class PlayerCombatStats {
public void calculateMin(boolean mainHand) {
Item weapon;
double baseDMG = 6;
double baseDMG = 1;
int primaryStat = this.owner.statDexCurrent;
int secondaryStat = this.owner.statStrCurrent;
double weaponSkill = 0;
@ -128,7 +128,7 @@ public class PlayerCombatStats { @@ -128,7 +128,7 @@ public class PlayerCombatStats {
String mastery = "Unarmed Combat Mastery";
if (weapon != null) {
baseDMG = weapon.getItemBase().getMaxDamage();
baseDMG = weapon.getItemBase().getMinDamage();
skill = weapon.getItemBase().getSkillRequired();
mastery = weapon.getItemBase().getMastery();
if (weapon.getItemBase().isStrBased()) {
@ -229,14 +229,14 @@ public class PlayerCombatStats { @@ -229,14 +229,14 @@ public class PlayerCombatStats {
speed = weapon.getItemBase().getSpeed();
for(Effect eff : weapon.effects.values()){
for(AbstractEffectModifier mod : eff.getEffectModifiers()){
if(mod.modType.equals(Enum.ModType.WeaponProc)){
if(mod.modType.equals(Enum.ModType.WeaponSpeed)){
speed *= 1 + (mod.getPercentMod() * 0.01f);
}
}
}
}
float stanceValue = 1.0f;
float stanceValue = 0.0f;
for(String effID : this.owner.effects.keySet()){
if(effID.contains("STC")){
for(AbstractEffectModifier mod : this.owner.effects.get(effID).getEffectModifiers()){
@ -247,14 +247,14 @@ public class PlayerCombatStats { @@ -247,14 +247,14 @@ public class PlayerCombatStats {
}
}
float bonusValues = 1.0f;
if(this.owner.bonuses != null){
for(AbstractEffectModifier mod : this.owner.bonuses.bonusFloats.keySet()){
if(mod.modType.equals(Enum.ModType.AttackDelay)){
bonusValues += mod.getPercentMod() * 0.01f; // calculate all alac bonuses
}
}
}
float bonusValues = 1 + this.owner.bonuses.getFloatPercentAll(Enum.ModType.AttackDelay,Enum.SourceType.None);//1.0f;
//if(this.owner.bonuses != null){
// for(AbstractEffectModifier mod : this.owner.bonuses.bonusFloats.keySet()){
// if(mod.modType.equals(Enum.ModType.AttackDelay)){
// bonusValues += mod.getPercentMod() * 0.01f; // calculate all alac bonuses
// }
// }
//}
bonusValues -= stanceValue; // take away stance modifier from alac bonus values
speed *= 1 + stanceValue; // apply stance bonus

Loading…
Cancel
Save