diff --git a/src/perks/lib.rs b/src/perks/lib.rs index 5907a9f0..ac8175a6 100644 --- a/src/perks/lib.rs +++ b/src/perks/lib.rs @@ -405,3 +405,11 @@ pub struct ModifierResponseSummary { pub drmr: Option, pub statbump: Option>, } + +#[derive(Debug, Copy, Clone, PartialEq, Serialize)] +pub struct DamageProfile { + pub impact_dmg: f64, + pub explosion_dmg: f64, + pub crit_mult: f64, + pub damage_delay: f64, +} diff --git a/src/perks/year_1_perks.rs b/src/perks/year_1_perks.rs index a2d01060..6882f0f7 100644 --- a/src/perks/year_1_perks.rs +++ b/src/perks/year_1_perks.rs @@ -845,8 +845,8 @@ pub fn year_1_perks() { let lightweight_body = _input.calc_data.curr_firing_data.damage; let lightweight_crit = _input.calc_data.curr_firing_data.crit_mult; - let precision_body = p_data.0; - let precision_crit = p_data.2; + let precision_body = p_data.impact_dmg; + let precision_crit = p_data.crit_mult; DamageModifierResponse { impact_dmg_scale: precision_body / lightweight_body, explosive_dmg_scale: precision_body / lightweight_body, diff --git a/src/weapons/dps_calc.rs b/src/weapons/dps_calc.rs index 634b6c72..4b7fecec 100644 --- a/src/weapons/dps_calc.rs +++ b/src/weapons/dps_calc.rs @@ -121,10 +121,10 @@ pub fn complex_dps_calc(_weapon: Weapon, _enemy: Enemy, _pl_dmg_mult: f64) -> Dp let ammo_type = weapon.ammo_type; let tmp_dmg_prof = weapon.get_damage_profile(true); - let impact_dmg = tmp_dmg_prof.0; - let explosion_dmg = tmp_dmg_prof.1; - let crit_mult = tmp_dmg_prof.2; - // let damage_delay = tmp_dmg_prof.3; + let impact_dmg = tmp_dmg_prof.impact_dmg; + let explosion_dmg = tmp_dmg_prof.explosion_dmg; + let crit_mult = tmp_dmg_prof.crit_mult; + // let damage_delay = tmp_dmg_prof.damage_delay; let base_mag = weapon.calc_ammo_sizes(None, None, false).mag_size; let maximum_shots = if base_mag * 5 < 15 { 15 } else { base_mag * 5 }; diff --git a/src/weapons/stat_calc.rs b/src/weapons/stat_calc.rs index fdf96f10..8b04b57c 100644 --- a/src/weapons/stat_calc.rs +++ b/src/weapons/stat_calc.rs @@ -8,7 +8,7 @@ use crate::{ get_handling_modifier, get_magazine_modifier, get_range_modifier, get_reload_modifier, get_reserve_modifier, get_velocity_modifier, lib::{ - CalculationInput, DamageModifierResponse, FiringModifierResponse, + CalculationInput, DamageModifierResponse, DamageProfile, FiringModifierResponse, HandlingModifierResponse, InventoryModifierResponse, MagazineModifierResponse, RangeModifierResponse, ReloadModifierResponse, }, @@ -320,9 +320,9 @@ impl Weapon { pve_damage_modifiers = DamageModifierResponse::default(); }; let tmp_dmg_prof = self.get_damage_profile(_pvp); - let impact_dmg = tmp_dmg_prof.0; - let explosion_dmg = tmp_dmg_prof.1; - let crit_mult = tmp_dmg_prof.2; + let impact_dmg = tmp_dmg_prof.impact_dmg; + let explosion_dmg = tmp_dmg_prof.explosion_dmg; + let crit_mult = tmp_dmg_prof.crit_mult; let fd = self.firing_data; let extra_charge_delay = if self.weapon_type == WeaponType::FUSIONRIFLE { @@ -368,7 +368,7 @@ impl Weapon { } impl Weapon { - pub fn get_damage_profile(&self, _pvp: bool) -> (f64, f64, f64, f64) { + pub fn get_damage_profile(&self, _pvp: bool) -> DamageProfile { let mut impact = if _pvp { self.firing_data.damage } else { @@ -392,7 +392,12 @@ impl Weapon { } delay = epr.delyed; } - (impact, explosion, crit, delay) + DamageProfile { + impact_dmg: impact, + explosion_dmg: explosion, + crit_mult: crit, + damage_delay: delay, + } } } diff --git a/src/weapons/ttk_calc.rs b/src/weapons/ttk_calc.rs index 5af59010..83fcc871 100644 --- a/src/weapons/ttk_calc.rs +++ b/src/weapons/ttk_calc.rs @@ -48,10 +48,10 @@ pub fn calc_ttk(_weapon: &Weapon, _overshield: f64) -> Vec { let mut persistent_data: HashMap = HashMap::new(); let tmp_dmg_prof = _weapon.get_damage_profile(true); - let impact_dmg = tmp_dmg_prof.0; - let explosion_dmg = tmp_dmg_prof.1; - let mut crit_mult = tmp_dmg_prof.2; - // let damage_delay = tmp_dmg_prof.3; + let impact_dmg = tmp_dmg_prof.impact_dmg; + let explosion_dmg = tmp_dmg_prof.explosion_dmg; + let mut crit_mult = tmp_dmg_prof.crit_mult; + // let damage_delay = tmp_dmg_prof.damage_delay; if _weapon.weapon_type == WeaponType::SHOTGUN && _weapon.firing_data.burst_size == 12 { crit_mult = 1.0; // shawty has no crits } @@ -218,8 +218,8 @@ pub fn calc_ttk(_weapon: &Weapon, _overshield: f64) -> Vec { /////////////////////////////// let tmp_dmg_prof = _weapon.get_damage_profile(true); - let impact_dmg = tmp_dmg_prof.0; - let explosion_dmg = tmp_dmg_prof.1; + let impact_dmg = tmp_dmg_prof.impact_dmg; + let explosion_dmg = tmp_dmg_prof.explosion_dmg; let body_damage = (impact_dmg * dmg_mods.impact_dmg_scale) + (explosion_dmg * dmg_mods.explosive_dmg_scale);