Browse Source

PlayerCombatStats modified skills

lakebane-dex-penalty
FatBoy-DOTC 7 days ago
parent
commit
f18cf5c8a6
  1. 2
      src/engine/objects/CharacterSkill.java
  2. 39
      src/engine/objects/PlayerCombatStats.java

2
src/engine/objects/CharacterSkill.java

@ -68,7 +68,7 @@ public class CharacterSkill extends AbstractGameObject { @@ -68,7 +68,7 @@ public class CharacterSkill extends AbstractGameObject {
165, 166, 166, 167, 167, //185 to 189
168}; //190
private static final float[] baseSkillValues = {
static final float[] baseSkillValues = {
0.0f, 0.0f, 0.2f, 0.4f, 0.6f, //0 to 4
0.8f, 1.0f, 1.1666666f, 1.3333334f, 1.5f, //5 to 9
1.6666667f, 1.8333334f, 2.0f, 2.2f, 2.4f, //10 to 14

39
src/engine/objects/PlayerCombatStats.java

@ -121,9 +121,13 @@ public class PlayerCombatStats { @@ -121,9 +121,13 @@ public class PlayerCombatStats {
float skillLevel = 0;
float masteryLevel = 0;
if(this.owner.skills.containsKey(skill))
if(this.owner.skills.containsKey(skill)) {
skillLevel = this.owner.skills.get(skill).getModifiedAmount();
float newCalc = calculateModifiedSkill(skill, this.owner);
if(newCalc != skillLevel){
int i = 0;
}
}
if(this.owner.skills.containsKey(mastery))
masteryLevel = this.owner.skills.get(mastery).getModifiedAmount();
@ -595,13 +599,30 @@ public class PlayerCombatStats { @@ -595,13 +599,30 @@ public class PlayerCombatStats {
float spiModPercentage = (spiMod / totalMod);
//calculate stat weight
float weight = 0;
weight += pc.statStrCurrent * strModPercentage;
weight += pc.statDexCurrent * dexModPercentage;
weight += pc.statConCurrent * conModPercentage;
weight += pc.statIntCurrent * intModPercentage;
weight += pc.statSpiCurrent * spiModPercentage;
float modifiedSkill = (75 + 3*pc.statIntCurrent + 2 * weight) / 20;
weight += pc.statStrBase * strModPercentage;
weight += pc.statDexBase * dexModPercentage;
weight += pc.statConBase * conModPercentage;
weight += pc.statIntBase * intModPercentage;
weight += pc.statSpiBase * spiModPercentage;
Enum.SourceType sourceType = Enum.SourceType.GetSourceType(skillBase.getNameNoSpace());
float base = 7f;
base += CharacterSkill.baseSkillValues[(int) weight];
float bonus = 0f;
if (CharacterSkill.GetOwner(skill).getBonuses() != null) {
//Get bonuses from runes
bonus = CharacterSkill.GetOwner(skill).getBonuses().getSkillBonus(skillBase.sourceType);
}
if (CharacterSkill.GetOwner(skill).getBonuses() != null) {
//add bonuses from effects/items and runes
base += bonus + CharacterSkill.GetOwner(skill).getBonuses().getFloat(Enum.ModType.Skill, sourceType);
}
float modAmount = skill.getBaseAmount();
if (CharacterSkill.GetOwner(skill).getBonuses() != null) {
//Multiply any percent bonuses
modAmount *= (1 + CharacterSkill.GetOwner(skill).getBonuses().getFloatPercentAll(Enum.ModType.Skill, sourceType));
}
float modifiedSkill = modAmount;
return modifiedSkill;
}

Loading…
Cancel
Save