diff --git a/Cargo.lock b/Cargo.lock index b4bfc16740..4d66c7cb35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5776,6 +5776,7 @@ dependencies = [ "ordered-float 2.5.1", "rand 0.8.3", "rayon", + "ron", "roots", "serde", "serde_repr", diff --git a/common/Cargo.toml b/common/Cargo.toml index aaee090b99..345267acbe 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -19,6 +19,7 @@ common-base = { package = "veloren-common-base", path = "base" } # Serde serde = { version = "1.0.110", features = ["derive", "rc"] } +ron = { version = "0.6", default-features = false } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] approx = "0.4.0" diff --git a/common/src/bin/csv_export/main.rs b/common/src/bin/csv_export/main.rs index 8ed25823cf..f8a025851f 100644 --- a/common/src/bin/csv_export/main.rs +++ b/common/src/bin/csv_export/main.rs @@ -36,6 +36,10 @@ fn armor_stats() -> Result<(), Box> { "Quality", "Protection", "Poise Resilience", + "Max Energy", + "Energy Recovery", + "Crit Power", + "Stealth", "Description", ])?; @@ -57,6 +61,10 @@ fn armor_stats() -> Result<(), Box> { Protection::Invincible => "Invincible".to_string(), Protection::Normal(value) => value.to_string(), }; + let max_energy = armor.get_energy_max().to_string(); + let energy_recovery = armor.get_energy_recovery().to_string(); + let crit_power = armor.get_crit_power().to_string(); + let stealth = armor.get_stealth().to_string(); wtr.write_record(&[ item.item_definition_id(), @@ -65,6 +73,10 @@ fn armor_stats() -> Result<(), Box> { &format!("{:?}", item.quality()), &protection, &poise_resilience, + &max_energy, + &energy_recovery, + &crit_power, + &stealth, item.description(), ])?; }, @@ -139,19 +151,19 @@ fn weapon_stats() -> Result<(), Box> { fn get_tool_kind(kind: &ToolKind) -> String { match kind { - ToolKind::Sword | ToolKind::SwordSimple => "Sword".to_string(), - ToolKind::Axe | ToolKind::AxeSimple => "Axe".to_string(), - ToolKind::Hammer | ToolKind::HammerSimple => "Hammer".to_string(), - ToolKind::Bow | ToolKind::BowSimple => "Bow".to_string(), + ToolKind::Sword => "Sword".to_string(), + ToolKind::Axe => "Axe".to_string(), + ToolKind::Hammer => "Hammer".to_string(), + ToolKind::Bow => "Bow".to_string(), ToolKind::Dagger => "Dagger".to_string(), - ToolKind::Staff | ToolKind::StaffSimple => "Staff".to_string(), + ToolKind::Staff => "Staff".to_string(), ToolKind::Sceptre => "Sceptre".to_string(), ToolKind::Shield => "Shield".to_string(), ToolKind::Spear => "Spear".to_string(), ToolKind::Debug => "Debug".to_string(), ToolKind::Farming => "Farming".to_string(), ToolKind::Pick => "Pick".to_string(), - ToolKind::Unique(_) => "Unique".to_string(), + ToolKind::Natural => "Natural".to_string(), ToolKind::Empty => "Empty".to_string(), } } diff --git a/common/src/bin/csv_import/main.rs b/common/src/bin/csv_import/main.rs index 7755dd2ed6..f05d3fbc9c 100644 --- a/common/src/bin/csv_import/main.rs +++ b/common/src/bin/csv_import/main.rs @@ -112,9 +112,61 @@ fn armor_stats() -> Result<(), Box> { Protection::Normal(0.0) }; + let max_energy = + if let Some(max_energy_raw) = record.get(headers["Max Energy"]) { + max_energy_raw.parse().unwrap() + } else { + eprintln!( + "Could not unwrap max energy value for {:?}", + item.item_definition_id() + ); + 0 + }; + + let energy_recovery = if let Some(energy_recovery_raw) = + record.get(headers["Energy Recovery"]) + { + energy_recovery_raw.parse().unwrap() + } else { + eprintln!( + "Could not unwrap energy recovery value for {:?}", + item.item_definition_id() + ); + 0.0 + }; + + let crit_power = + if let Some(crit_power_raw) = record.get(headers["Crit Power"]) { + crit_power_raw.parse().unwrap() + } else { + eprintln!( + "Could not unwrap crit power value for {:?}", + item.item_definition_id() + ); + 0.0 + }; + + let stealth = if let Some(stealth_raw) = record.get(headers["Stealth"]) + { + stealth_raw.parse().unwrap() + } else { + eprintln!( + "Could not unwrap stealth value for {:?}", + item.item_definition_id() + ); + 0.0 + }; + let kind = armor.kind.clone(); - let armor = - comp::item::armor::Armor::new(kind, protection, poise_resilience); + let armor_stats = comp::item::armor::Stats::new( + protection, + poise_resilience, + max_energy, + energy_recovery, + crit_power, + stealth, + ); + let armor = comp::item::armor::Armor::new(kind, armor_stats); let quality = if let Some(quality_raw) = record.get(headers["Quality"]) { match quality_raw {