Added handedness to weapon tooltips.

This commit is contained in:
Sam 2021-02-12 19:57:52 -05:00
parent 8f0cca074d
commit 12545dd372
2 changed files with 10 additions and 4 deletions

View File

@ -20,7 +20,6 @@
secondary: "common.abilities.hammer.charged",
skills: [
(Some(Hammer(UnlockLeap)), "common.abilities.hammer.leap"),
(Some(Staff(UnlockShockwave)), "common.abilities.staff.fireshockwave"), // test, remove later
],
),
Bow: (

View File

@ -1,6 +1,6 @@
use common::comp::item::{
armor::{Armor, ArmorKind, Protection},
tool::{Tool, ToolKind},
tool::{Hands, Tool, ToolKind},
ItemDesc, ItemKind,
};
use std::{borrow::Cow, fmt::Write};
@ -118,13 +118,19 @@ fn tool_desc(tool: &Tool, desc: &str) -> String {
let power = tool.base_power();
//let poise_strength = tool.base_poise_strength();
let speed = tool.base_speed();
let hands = match tool.hands {
Hands::OneHand => "One",
Hands::TwoHand => "Two",
};
if !desc.is_empty() {
format!(
"{}\n\nDPS: {:0.1}\n\nPower: {:0.1}\n\nSpeed: {:0.1}\n\n{}\n\n<Right-Click to use>",
"{}-Handed {}\n\nDPS: {:0.1}\n\nPower: {:0.1}\n\nSpeed: {:0.1}\n\n{}\n\n<Right-Click \
to use>",
// add back when ready for poise
//"{}\n\nDPS: {:0.1}\n\nPower: {:0.1}\n\nPoise Strength: {:0.1}\n\nSpeed: \
// {:0.1}\n\n{}\n\n<Right-Click to use>",
hands,
kind,
speed * power * 10.0, // Damage per second
power * 10.0,
@ -134,10 +140,11 @@ fn tool_desc(tool: &Tool, desc: &str) -> String {
)
} else {
format!(
"{}\n\nDPS: {:0.1}\n\nPower: {:0.1}\n\nSpeed: {:0.1}\n\n<Right-Click to use>",
"{}-Handed {}\n\nDPS: {:0.1}\n\nPower: {:0.1}\n\nSpeed: {:0.1}\n\n<Right-Click to use>",
// add back when ready for poise
//"{}\n\nDPS: {:0.1}\n\nPower: {:0.1}\n\nPoise Strength: {:0.1}\n\nSpeed: \
// {:0.1}\n\n<Right-Click to use>",
hands,
kind,
speed * power * 10.0, // Damage per second
power * 10.0,