changed the combat rating equation to a simpler one, which results in a more accurate weapon ranting.

This commit is contained in:
roidujeu 2022-01-10 14:59:20 +05:30
parent a6877d3a60
commit 773bf9d9fd

View File

@ -10,7 +10,7 @@ use crate::{
}, },
slot::EquipSlot, slot::EquipSlot,
}, },
skillset::SkillGroupKind, skills::SkillGroupKind,
Alignment, Body, CharacterState, Combo, Energy, Health, HealthChange, Inventory, Ori, Alignment, Body, CharacterState, Combo, Energy, Health, HealthChange, Inventory, Ori,
Player, Poise, PoiseChange, SkillSet, Stats, Player, Poise, PoiseChange, SkillSet, Stats,
}, },
@ -979,11 +979,16 @@ pub fn weapon_rating<T: ItemDesc>(item: &T, msm: &MaterialStatManifest) -> f32 {
// TODO: Look into changing the 0.5 to reflect armor later maybe? // TODO: Look into changing the 0.5 to reflect armor later maybe?
// Since it is only for weapon though, it probably makes sense to leave // Since it is only for weapon though, it probably makes sense to leave
// independent for now // independent for now
let damage_rating = stats.power * stats.speed * (1.0 + stats.crit_chance * 0.5); // let damage_rating = stats.power * stats.speed * (1.0 + stats.crit_chance * 0.5);
let effect_rating = stats.effect_power * stats.speed;
(damage_rating * DAMAGE_WEIGHT + effect_rating * EFFECT_WEIGHT) let damage_rating = (stats.power + stats.speed + stats.crit_chance + stats.range + stats.effect_power
/ (DAMAGE_WEIGHT + EFFECT_WEIGHT) + (stats.equip_time_secs * 0.5)) / (DAMAGE_WEIGHT + EFFECT_WEIGHT);
// let effect_rating = stats.effect_power * stats.speed;
/* (damage_rating * DAMAGE_WEIGHT + effect_rating * EFFECT_WEIGHT)
/ (DAMAGE_WEIGHT + EFFECT_WEIGHT) */
damage_rating
} else { } else {
0.0 0.0
} }