Browse Source

PlayerCombatStats object

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

12
src/engine/objects/PlayerCharacter.java

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

24
src/engine/objects/PlayerCombatStats.java

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

Loading…
Cancel
Save