mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Yeeted from code files.
This commit is contained in:
parent
2000ba587e
commit
a4046872b2
@ -2,7 +2,7 @@ pub mod armor;
|
||||
pub mod tool;
|
||||
|
||||
// Reexports
|
||||
pub use tool::{Hands, Tool, ToolKind};
|
||||
pub use tool::{Hands, Tool, ToolKind, UniqueKind};
|
||||
|
||||
use crate::{
|
||||
assets::{self, Asset, Error},
|
||||
|
@ -16,17 +16,17 @@ use std::time::Duration;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum ToolKind {
|
||||
Sword(String),
|
||||
Axe(String),
|
||||
Hammer(String),
|
||||
Bow(String),
|
||||
Dagger(String),
|
||||
Staff(String),
|
||||
Sceptre(String),
|
||||
Shield(String),
|
||||
NpcWeapon(String),
|
||||
Debug(String),
|
||||
Farming(String),
|
||||
Sword,
|
||||
Axe,
|
||||
Hammer,
|
||||
Bow,
|
||||
Dagger,
|
||||
Staff,
|
||||
Sceptre,
|
||||
Shield,
|
||||
Unique(UniqueKind),
|
||||
Debug,
|
||||
Farming,
|
||||
/// This is an placeholder item, it is used by non-humanoid npcs to attack
|
||||
Empty,
|
||||
}
|
||||
@ -34,17 +34,17 @@ pub enum ToolKind {
|
||||
impl ToolKind {
|
||||
pub fn hands(&self) -> Hands {
|
||||
match self {
|
||||
ToolKind::Sword(_) => Hands::TwoHand,
|
||||
ToolKind::Axe(_) => Hands::TwoHand,
|
||||
ToolKind::Hammer(_) => Hands::TwoHand,
|
||||
ToolKind::Bow(_) => Hands::TwoHand,
|
||||
ToolKind::Dagger(_) => Hands::OneHand,
|
||||
ToolKind::Staff(_) => Hands::TwoHand,
|
||||
ToolKind::Sceptre(_) => Hands::TwoHand,
|
||||
ToolKind::Shield(_) => Hands::OneHand,
|
||||
ToolKind::NpcWeapon(_) => Hands::TwoHand,
|
||||
ToolKind::Debug(_) => Hands::TwoHand,
|
||||
ToolKind::Farming(_) => Hands::TwoHand,
|
||||
ToolKind::Sword => Hands::TwoHand,
|
||||
ToolKind::Axe => Hands::TwoHand,
|
||||
ToolKind::Hammer => Hands::TwoHand,
|
||||
ToolKind::Bow => Hands::TwoHand,
|
||||
ToolKind::Dagger => Hands::OneHand,
|
||||
ToolKind::Staff => Hands::TwoHand,
|
||||
ToolKind::Sceptre => Hands::TwoHand,
|
||||
ToolKind::Shield => Hands::OneHand,
|
||||
ToolKind::Unique(_) => Hands::TwoHand,
|
||||
ToolKind::Debug => Hands::TwoHand,
|
||||
ToolKind::Farming => Hands::TwoHand,
|
||||
ToolKind::Empty => Hands::OneHand,
|
||||
}
|
||||
}
|
||||
@ -90,8 +90,9 @@ impl Tool {
|
||||
use CharacterAbility::*;
|
||||
use ToolKind::*;
|
||||
|
||||
use UniqueKind::*;
|
||||
match &self.kind {
|
||||
Sword(_) => vec![
|
||||
Sword => vec![
|
||||
ComboMelee {
|
||||
stage_data: vec![
|
||||
combo_melee::Stage {
|
||||
@ -173,7 +174,7 @@ impl Tool {
|
||||
num_spins: 3,
|
||||
},
|
||||
],
|
||||
Axe(_) => vec![
|
||||
Axe => vec![
|
||||
BasicMelee {
|
||||
energy_cost: 0,
|
||||
buildup_duration: Duration::from_millis(600),
|
||||
@ -212,7 +213,7 @@ impl Tool {
|
||||
vertical_leap_strength: 8.0,
|
||||
},
|
||||
],
|
||||
Hammer(_) => vec![
|
||||
Hammer => vec![
|
||||
BasicMelee {
|
||||
energy_cost: 0,
|
||||
buildup_duration: Duration::from_millis(600),
|
||||
@ -250,7 +251,7 @@ impl Tool {
|
||||
vertical_leap_strength: 8.0,
|
||||
},
|
||||
],
|
||||
Farming(_) => vec![BasicMelee {
|
||||
Farming => vec![BasicMelee {
|
||||
energy_cost: 1,
|
||||
buildup_duration: Duration::from_millis(600),
|
||||
swing_duration: Duration::from_millis(100),
|
||||
@ -260,7 +261,7 @@ impl Tool {
|
||||
range: 3.5,
|
||||
max_angle: 20.0,
|
||||
}],
|
||||
Bow(_) => vec![
|
||||
Bow => vec![
|
||||
BasicRanged {
|
||||
energy_cost: 0,
|
||||
buildup_duration: Duration::from_millis(100),
|
||||
@ -353,7 +354,7 @@ impl Tool {
|
||||
reps_remaining: 5,
|
||||
},
|
||||
],
|
||||
Dagger(_) => vec![BasicMelee {
|
||||
Dagger => vec![BasicMelee {
|
||||
energy_cost: 0,
|
||||
buildup_duration: Duration::from_millis(100),
|
||||
swing_duration: Duration::from_millis(100),
|
||||
@ -363,7 +364,7 @@ impl Tool {
|
||||
range: 3.5,
|
||||
max_angle: 20.0,
|
||||
}],
|
||||
Sceptre(_) => vec![
|
||||
Sceptre => vec![
|
||||
BasicBeam {
|
||||
buildup_duration: Duration::from_millis(250),
|
||||
recover_duration: Duration::from_millis(250),
|
||||
@ -442,7 +443,7 @@ impl Tool {
|
||||
projectile_speed: 40.0,
|
||||
},
|
||||
],
|
||||
Staff(_) => vec![
|
||||
Staff => vec![
|
||||
BasicRanged {
|
||||
energy_cost: 0,
|
||||
buildup_duration: Duration::from_millis(500),
|
||||
@ -517,7 +518,7 @@ impl Tool {
|
||||
move_efficiency: 0.1,
|
||||
},
|
||||
],
|
||||
Shield(_) => vec![
|
||||
Shield => vec![
|
||||
BasicMelee {
|
||||
energy_cost: 0,
|
||||
buildup_duration: Duration::from_millis(100),
|
||||
@ -530,59 +531,43 @@ impl Tool {
|
||||
},
|
||||
BasicBlock,
|
||||
],
|
||||
NpcWeapon(kind) => {
|
||||
if kind == "StoneGolemsFist" {
|
||||
vec![
|
||||
BasicMelee {
|
||||
energy_cost: 0,
|
||||
buildup_duration: Duration::from_millis(400),
|
||||
swing_duration: Duration::from_millis(100),
|
||||
recover_duration: Duration::from_millis(250),
|
||||
knockback: 25.0,
|
||||
base_damage: 200,
|
||||
range: 5.0,
|
||||
max_angle: 120.0,
|
||||
},
|
||||
Shockwave {
|
||||
energy_cost: 0,
|
||||
buildup_duration: Duration::from_millis(500),
|
||||
swing_duration: Duration::from_millis(200),
|
||||
recover_duration: Duration::from_millis(800),
|
||||
damage: 500,
|
||||
knockback: Knockback::TowardsUp(40.0),
|
||||
shockwave_angle: 90.0,
|
||||
shockwave_vertical_angle: 15.0,
|
||||
shockwave_speed: 20.0,
|
||||
shockwave_duration: Duration::from_millis(2000),
|
||||
requires_ground: true,
|
||||
move_efficiency: 0.05,
|
||||
},
|
||||
]
|
||||
} else if kind == "BeastClaws" {
|
||||
vec![BasicMelee {
|
||||
energy_cost: 0,
|
||||
buildup_duration: Duration::from_millis(250),
|
||||
swing_duration: Duration::from_millis(250),
|
||||
recover_duration: Duration::from_millis(250),
|
||||
knockback: 25.0,
|
||||
base_damage: 200,
|
||||
range: 5.0,
|
||||
max_angle: 120.0,
|
||||
}]
|
||||
} else {
|
||||
vec![BasicMelee {
|
||||
energy_cost: 0,
|
||||
buildup_duration: Duration::from_millis(100),
|
||||
swing_duration: Duration::from_millis(100),
|
||||
recover_duration: Duration::from_millis(200),
|
||||
base_damage: 10,
|
||||
knockback: 0.0,
|
||||
range: 1.0,
|
||||
max_angle: 30.0,
|
||||
}]
|
||||
}
|
||||
},
|
||||
Debug(_) => vec![
|
||||
Unique(StoneGolemFist) => vec![
|
||||
BasicMelee {
|
||||
energy_cost: 0,
|
||||
buildup_duration: Duration::from_millis(400),
|
||||
swing_duration: Duration::from_millis(100),
|
||||
recover_duration: Duration::from_millis(250),
|
||||
knockback: 25.0,
|
||||
base_damage: 200,
|
||||
range: 5.0,
|
||||
max_angle: 120.0,
|
||||
},
|
||||
Shockwave {
|
||||
energy_cost: 0,
|
||||
buildup_duration: Duration::from_millis(500),
|
||||
swing_duration: Duration::from_millis(200),
|
||||
recover_duration: Duration::from_millis(800),
|
||||
damage: 500,
|
||||
knockback: Knockback::TowardsUp(40.0),
|
||||
shockwave_angle: 90.0,
|
||||
shockwave_vertical_angle: 15.0,
|
||||
shockwave_speed: 20.0,
|
||||
shockwave_duration: Duration::from_millis(2000),
|
||||
requires_ground: true,
|
||||
move_efficiency: 0.05,
|
||||
},
|
||||
],
|
||||
Unique(BeastClaws) => vec![BasicMelee {
|
||||
energy_cost: 0,
|
||||
buildup_duration: Duration::from_millis(250),
|
||||
swing_duration: Duration::from_millis(250),
|
||||
recover_duration: Duration::from_millis(250),
|
||||
knockback: 25.0,
|
||||
base_damage: 200,
|
||||
range: 5.0,
|
||||
max_angle: 120.0,
|
||||
}],
|
||||
Debug => vec![
|
||||
CharacterAbility::Boost {
|
||||
movement_duration: Duration::from_millis(50),
|
||||
only_up: false,
|
||||
@ -624,3 +609,9 @@ impl Tool {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum UniqueKind {
|
||||
StoneGolemFist,
|
||||
BeastClaws,
|
||||
}
|
||||
|
@ -4,7 +4,10 @@ use crate::{
|
||||
agent::Activity,
|
||||
group,
|
||||
group::Invite,
|
||||
item::{tool::ToolKind, ItemKind},
|
||||
item::{
|
||||
tool::{ToolKind, UniqueKind},
|
||||
ItemKind,
|
||||
},
|
||||
Agent, Alignment, Body, CharacterState, ControlAction, ControlEvent, Controller, Energy,
|
||||
GroupManip, Health, LightEmitter, Loadout, MountState, Ori, PhysicsState, Pos, Scale,
|
||||
UnresolvedChatMsg, Vel,
|
||||
@ -317,14 +320,13 @@ impl<'a> System<'a> for Sys {
|
||||
None
|
||||
}
|
||||
}) {
|
||||
Some(ToolKind::Bow(_)) => Tactic::RangedPowerup,
|
||||
Some(ToolKind::Staff(_)) => Tactic::Staff,
|
||||
Some(ToolKind::Hammer(_)) => Tactic::Hammer,
|
||||
Some(ToolKind::Sword(_)) => Tactic::Sword,
|
||||
Some(ToolKind::Axe(_)) => Tactic::Axe,
|
||||
Some(ToolKind::NpcWeapon(kind)) => match kind.as_str() {
|
||||
"StoneGolemsFist" => Tactic::StoneGolemBoss,
|
||||
_ => Tactic::Melee,
|
||||
Some(ToolKind::Bow) => Tactic::RangedPowerup,
|
||||
Some(ToolKind::Staff) => Tactic::Staff,
|
||||
Some(ToolKind::Hammer) => Tactic::Hammer,
|
||||
Some(ToolKind::Sword) => Tactic::Sword,
|
||||
Some(ToolKind::Axe) => Tactic::Axe,
|
||||
Some(ToolKind::Unique(UniqueKind::StoneGolemFist)) => {
|
||||
Tactic::StoneGolemBoss
|
||||
},
|
||||
_ => Tactic::Melee,
|
||||
};
|
||||
|
@ -72,22 +72,22 @@ fn weapon_stats() -> Result<(), Box<dyn Error>> {
|
||||
|
||||
fn get_tool_kind(kind: &ToolKind) -> String {
|
||||
match kind {
|
||||
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(_) => "Staff".to_string(),
|
||||
ToolKind::Sceptre(_) => "Sceptre".to_string(),
|
||||
ToolKind::Shield(_) => "Shield".to_string(),
|
||||
ToolKind::Debug(_) => "Debug".to_string(),
|
||||
ToolKind::Farming(_) => "Farming".to_string(),
|
||||
ToolKind::NpcWeapon(_) => "NpcWeapon".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 => "Staff".to_string(),
|
||||
ToolKind::Sceptre => "Sceptre".to_string(),
|
||||
ToolKind::Shield => "Shield".to_string(),
|
||||
ToolKind::Debug => "Debug".to_string(),
|
||||
ToolKind::Farming => "Farming".to_string(),
|
||||
ToolKind::Unique(_) => "Unique".to_string(),
|
||||
ToolKind::Empty => "Empty".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
fn get_tool_kind_kind(kind: &ToolKind) -> String {
|
||||
/*fn get_tool_kind_kind(kind: &ToolKind) -> String {
|
||||
match kind {
|
||||
ToolKind::Sword(x) => x.clone(),
|
||||
ToolKind::Axe(x) => x.clone(),
|
||||
@ -102,7 +102,7 @@ fn get_tool_kind_kind(kind: &ToolKind) -> String {
|
||||
ToolKind::NpcWeapon(x) => x.clone(),
|
||||
ToolKind::Empty => "".to_string(),
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
fn get_armor_kind(kind: &ArmorKind) -> String {
|
||||
match kind {
|
||||
@ -146,7 +146,7 @@ fn all_items() -> Result<(), Box<dyn Error>> {
|
||||
let kind = match item.kind() {
|
||||
ItemKind::Armor(armor) => get_armor_kind_kind(&armor.kind),
|
||||
ItemKind::Lantern(lantern) => lantern.kind.clone(),
|
||||
ItemKind::Tool(tool) => get_tool_kind_kind(&tool.kind),
|
||||
//ItemKind::Tool(tool) => get_tool_kind_kind(&tool.kind),
|
||||
_ => "".to_owned(),
|
||||
};
|
||||
|
||||
|
@ -56,7 +56,7 @@ impl Animation for AlphaAnimation {
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.1);
|
||||
next.torso.orientation = Quaternion::rotation_z(0.0);
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
Some(ToolKind::Sword) => {
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
|
||||
@ -87,7 +87,7 @@ impl Animation for AlphaAnimation {
|
||||
movement1 * -0.9 + (movement2 * 1.75).sin() * 2.5 + movement3 * -0.5,
|
||||
);
|
||||
},
|
||||
Some(ToolKind::Hammer(_)) => {
|
||||
Some(ToolKind::Hammer) => {
|
||||
next.hand_l.position = Vec3::new(-12.0, 0.0, 10.0);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(0.0) * Quaternion::rotation_z(-2.0);
|
||||
@ -138,7 +138,7 @@ impl Animation for AlphaAnimation {
|
||||
* Quaternion::rotation_y(slowersmooth * 0.35 - 0.3)
|
||||
* Quaternion::rotation_z(1.4 + slowersmooth * 0.2);
|
||||
},
|
||||
Some(ToolKind::Debug(_)) => {
|
||||
Some(ToolKind::Debug) => {
|
||||
next.hand_l.position = Vec3::new(-7.0, 4.0, 3.0);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(1.27);
|
||||
next.main.position = Vec3::new(-5.0, 5.0, 23.0);
|
||||
|
@ -54,7 +54,7 @@ impl Animation for BeamAnimation {
|
||||
* Quaternion::rotation_z(0.0);
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
|
||||
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
|
||||
next.control.position = Vec3::new(
|
||||
s_a.stc.0 + (movement1 * 26.0) * (1.0 - movement3),
|
||||
s_a.stc.1 + (movement1 + (movement2 * 8.0).sin() * 2.0) * (1.0 - movement3),
|
||||
|
@ -78,7 +78,7 @@ impl Animation for ChargeAnimation {
|
||||
next.lower_torso.orientation = Quaternion::rotation_z(stop * -0.7 + tilt * 4.0);
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
|
||||
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
|
||||
next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(s_a.sthl.3);
|
||||
|
||||
@ -98,7 +98,7 @@ impl Animation for ChargeAnimation {
|
||||
* Quaternion::rotation_y(s_a.stc.4)
|
||||
* Quaternion::rotation_z(s_a.stc.5 + stop * 0.2);
|
||||
},
|
||||
Some(ToolKind::Bow(_)) => {
|
||||
Some(ToolKind::Bow) => {
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
next.hand_l.position = Vec3::new(s_a.bhl.0, s_a.bhl.1, s_a.bhl.2);
|
||||
|
@ -69,7 +69,7 @@ impl Animation for DashAnimation {
|
||||
|
||||
match active_tool_kind {
|
||||
//TODO: Inventory
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
Some(ToolKind::Sword) => {
|
||||
next.head.position =
|
||||
Vec3::new(0.0, 0.0 + s_a.head.0, s_a.head.1 + movement2.min(1.0) * 1.0);
|
||||
next.head.orientation = Quaternion::rotation_x(0.0)
|
||||
|
@ -33,19 +33,19 @@ impl Animation for EquipAnimation {
|
||||
next.control.position = Vec3::new(equip_slowa * -1.5, 0.0, equip_slow * 1.5);
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
Some(ToolKind::Sword) => {
|
||||
next.hand_l.position = Vec3::new(-18.0, -8.0, -1.0);
|
||||
next.hand_r.position = Vec3::new(-16.0, -7.5, -4.0);
|
||||
},
|
||||
Some(ToolKind::Axe(_)) => {
|
||||
Some(ToolKind::Axe) => {
|
||||
next.hand_l.position = Vec3::new(-7.0, -5.0, 17.0);
|
||||
next.hand_r.position = Vec3::new(-5.0, -4.5, 14.0);
|
||||
},
|
||||
Some(ToolKind::Hammer(_)) => {
|
||||
Some(ToolKind::Hammer) => {
|
||||
next.hand_l.position = Vec3::new(-15.0, -7.0, 3.0);
|
||||
next.hand_r.position = Vec3::new(-13.0, -6.5, 0.0);
|
||||
},
|
||||
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
|
||||
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
|
||||
next.hand_l.position = Vec3::new(4.0, -6.0, 0.0);
|
||||
next.hand_r.position = Vec3::new(6.0, -6.0, 6.0);
|
||||
next.hand_l.orientation =
|
||||
@ -53,7 +53,7 @@ impl Animation for EquipAnimation {
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_y(2.2) * Quaternion::rotation_z(-1.57);
|
||||
},
|
||||
Some(ToolKind::Bow(_)) => {
|
||||
Some(ToolKind::Bow) => {
|
||||
next.hand_l.position = Vec3::new(-3.0, -5.0, 9.0);
|
||||
next.hand_r.position = Vec3::new(-1.75, -4.5, 7.0);
|
||||
},
|
||||
|
@ -90,19 +90,19 @@ impl Animation for IdleAnimation {
|
||||
Quaternion::rotation_z(0.0 + slow * 0.2) * Quaternion::rotation_x(0.0);
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Bow(_)) => {
|
||||
Some(ToolKind::Bow) => {
|
||||
next.main.position = Vec3::new(-2.0, -5.0, -6.0);
|
||||
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
|
||||
},
|
||||
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
|
||||
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
|
||||
next.main.position = Vec3::new(-6.0, -5.0, -12.0);
|
||||
next.main.orientation = Quaternion::rotation_y(0.6) * Quaternion::rotation_z(1.57);
|
||||
},
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
Some(ToolKind::Sword) => {
|
||||
next.main.position = Vec3::new(-10.0, -8.0, 12.0);
|
||||
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
|
||||
},
|
||||
Some(ToolKind::Hammer(_)) => {
|
||||
Some(ToolKind::Hammer) => {
|
||||
next.main.position = Vec3::new(-10.0, -8.0, 12.0);
|
||||
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
|
||||
},
|
||||
|
@ -60,19 +60,19 @@ impl Animation for JumpAnimation {
|
||||
next.second.scale = Vec3::one() * 0.0;
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Bow(_)) => {
|
||||
Some(ToolKind::Bow) => {
|
||||
next.main.position = Vec3::new(-2.0, -5.0, -6.0);
|
||||
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
|
||||
},
|
||||
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
|
||||
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
|
||||
next.main.position = Vec3::new(-6.0, -5.0, -12.0);
|
||||
next.main.orientation = Quaternion::rotation_y(0.6) * Quaternion::rotation_z(1.57);
|
||||
},
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
Some(ToolKind::Sword) => {
|
||||
next.main.position = Vec3::new(-10.0, -8.0, 12.0);
|
||||
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
|
||||
},
|
||||
Some(ToolKind::Hammer(_)) => {
|
||||
Some(ToolKind::Hammer) => {
|
||||
next.main.position = Vec3::new(-10.0, -8.0, 12.0);
|
||||
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
|
||||
},
|
||||
|
@ -38,7 +38,7 @@ impl Animation for LeapAnimation {
|
||||
_ => (0.0, 0.0, 0.0, 0.0),
|
||||
};
|
||||
|
||||
if let Some(ToolKind::Hammer(_)) = active_tool_kind {
|
||||
if let Some(ToolKind::Hammer) = active_tool_kind {
|
||||
next.hand_l.position = Vec3::new(s_a.hhl.0, s_a.hhl.1, s_a.hhl.2);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(s_a.hhl.3);
|
||||
next.hand_r.position = Vec3::new(s_a.hhr.0, s_a.hhr.1, s_a.hhr.2);
|
||||
|
@ -298,22 +298,22 @@ impl Animation for RunAnimation {
|
||||
* Quaternion::rotation_z(0.0);
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Bow(_)) => {
|
||||
Some(ToolKind::Bow) => {
|
||||
next.main.position = Vec3::new(-2.0, -5.0, -6.0);
|
||||
next.main.orientation =
|
||||
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
|
||||
},
|
||||
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
|
||||
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
|
||||
next.main.position = Vec3::new(-6.0, -5.0, -12.0);
|
||||
next.main.orientation =
|
||||
Quaternion::rotation_y(0.6) * Quaternion::rotation_z(1.57);
|
||||
},
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
Some(ToolKind::Sword) => {
|
||||
next.main.position = Vec3::new(-10.0, -8.0, 12.0);
|
||||
next.main.orientation =
|
||||
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
|
||||
},
|
||||
Some(ToolKind::Hammer(_)) => {
|
||||
Some(ToolKind::Hammer) => {
|
||||
next.main.position = Vec3::new(-10.0, -8.0, 12.0);
|
||||
next.main.orientation =
|
||||
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
|
||||
|
@ -317,7 +317,7 @@ impl Animation for ShootAnimation {
|
||||
next.lower_torso.orientation = next.upper_torso.orientation * -0.08;
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
|
||||
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
|
||||
next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(s_a.sthl.3);
|
||||
|
||||
@ -337,7 +337,7 @@ impl Animation for ShootAnimation {
|
||||
* Quaternion::rotation_y(s_a.stc.4)
|
||||
* Quaternion::rotation_z(s_a.stc.5 + exp * 1.5);
|
||||
},
|
||||
Some(ToolKind::Bow(_)) => {
|
||||
Some(ToolKind::Bow) => {
|
||||
next.hand_l.position = Vec3::new(
|
||||
s_a.bhl.0 - exp * 2.0,
|
||||
s_a.bhl.1 - exp * 4.0,
|
||||
|
@ -51,7 +51,7 @@ impl Animation for SpinAnimation {
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
|
||||
if let Some(ToolKind::Sword(_)) = active_tool_kind {
|
||||
if let Some(ToolKind::Sword) = active_tool_kind {
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
|
||||
@ -92,8 +92,7 @@ impl Animation for SpinAnimation {
|
||||
next.torso.orientation = Quaternion::rotation_z(movement2 * 6.28);
|
||||
}
|
||||
|
||||
if let Some(ToolKind::Axe(_) | ToolKind::Hammer(_) | ToolKind::Dagger(_)) = active_tool_kind
|
||||
{
|
||||
if let Some(ToolKind::Axe | ToolKind::Hammer | ToolKind::Dagger) = active_tool_kind {
|
||||
next.hand_l.position = Vec3::new(-0.75, -1.0, -2.5);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(1.27);
|
||||
next.hand_r.position = Vec3::new(0.75, -1.5, -5.5);
|
||||
|
@ -62,7 +62,7 @@ impl Animation for SpinMeleeAnimation {
|
||||
let quick = (anim_time as f32 * lab as f32 * 8.0).sin();
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
Some(ToolKind::Sword) => {
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
|
||||
@ -85,7 +85,7 @@ impl Animation for SpinMeleeAnimation {
|
||||
next.head.orientation = Quaternion::rotation_x(-0.15 + movement3 * 0.15);
|
||||
next.lower_torso.orientation = Quaternion::rotation_x(0.2);
|
||||
},
|
||||
Some(ToolKind::Axe(_)) => {
|
||||
Some(ToolKind::Axe) => {
|
||||
next.hand_l.position = Vec3::new(-0.5, 0.0, 4.0);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_y(PI);
|
||||
|
@ -2,7 +2,7 @@ use super::{
|
||||
super::{vek::*, Animation},
|
||||
BipedLargeSkeleton, SkeletonAttr,
|
||||
};
|
||||
use common::comp::item::ToolKind;
|
||||
use common::comp::item::{ToolKind, UniqueKind};
|
||||
use std::{f32::consts::PI, ops::Mul};
|
||||
|
||||
pub struct WieldAnimation;
|
||||
@ -208,7 +208,7 @@ impl Animation for WieldAnimation {
|
||||
* Quaternion::rotation_z(test * 0.02);
|
||||
}
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
Some(ToolKind::Sword) => {
|
||||
next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
|
||||
@ -222,7 +222,7 @@ impl Animation for WieldAnimation {
|
||||
next.control.orientation = Quaternion::rotation_x(u_slow * 0.15)
|
||||
* Quaternion::rotation_z(u_slowalt * 0.08);
|
||||
},
|
||||
Some(ToolKind::Bow(_)) => {
|
||||
Some(ToolKind::Bow) => {
|
||||
next.hand_l.position = Vec3::new(s_a.bhl.0, s_a.bhl.1, s_a.bhl.2);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(s_a.bhl.3)
|
||||
* Quaternion::rotation_y(s_a.bhl.4)
|
||||
@ -243,7 +243,7 @@ impl Animation for WieldAnimation {
|
||||
* Quaternion::rotation_y(s_a.bc.4)
|
||||
* Quaternion::rotation_z(s_a.bc.5 + u_slowalt * 0.1);
|
||||
},
|
||||
Some(ToolKind::Hammer(_)) => {
|
||||
Some(ToolKind::Hammer) => {
|
||||
next.hand_l.position = Vec3::new(s_a.hhl.0, s_a.hhl.1, s_a.hhl.2);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(s_a.hhl.3)
|
||||
* Quaternion::rotation_y(s_a.hhl.4)
|
||||
@ -262,7 +262,7 @@ impl Animation for WieldAnimation {
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_y(0.0);
|
||||
},
|
||||
Some(ToolKind::Staff(_)) => {
|
||||
Some(ToolKind::Staff) => {
|
||||
next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(s_a.sthl.3) * Quaternion::rotation_y(s_a.sthl.4);
|
||||
@ -283,7 +283,7 @@ impl Animation for WieldAnimation {
|
||||
* Quaternion::rotation_y(0.15)
|
||||
* Quaternion::rotation_z(u_slowalt * 0.08);
|
||||
},
|
||||
Some(ToolKind::NpcWeapon(_)) => {
|
||||
Some(ToolKind::Unique(UniqueKind::BeastClaws)) => {
|
||||
next.shoulder_l.position =
|
||||
Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
|
||||
|
@ -65,7 +65,7 @@ impl Animation for AlphaAnimation {
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.1) * s_a.scaler;
|
||||
next.torso.orientation = Quaternion::rotation_z(0.0);
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
Some(ToolKind::Sword) => {
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
|
||||
@ -96,13 +96,13 @@ impl Animation for AlphaAnimation {
|
||||
movement1 * -0.9 + (movement2 * 1.75).sin() * 2.5 + movement3 * -0.5,
|
||||
);
|
||||
},
|
||||
Some(ToolKind::Dagger(_)) => {
|
||||
Some(ToolKind::Dagger) => {
|
||||
next.control_l.position = Vec3::new(-10.0 + push * 5.0, 6.0 + push * 5.0, 2.0);
|
||||
next.control_l.orientation = Quaternion::rotation_x(-1.4 + slow * 0.4)
|
||||
* Quaternion::rotation_y(slow * -1.3)
|
||||
* Quaternion::rotation_z(1.4 + slow * -0.5);
|
||||
},
|
||||
Some(ToolKind::Axe(_)) => {
|
||||
Some(ToolKind::Axe) => {
|
||||
next.head.position = Vec3::new(0.0, 0.0 + s_a.head.0, s_a.head.1);
|
||||
next.head.orientation = Quaternion::rotation_z(0.1 + axe * 0.2)
|
||||
* Quaternion::rotation_x(0.0)
|
||||
@ -129,7 +129,7 @@ impl Animation for AlphaAnimation {
|
||||
* Quaternion::rotation_z(PI * 0.4);
|
||||
next.lantern.orientation = Quaternion::rotation_x(0.4);
|
||||
},
|
||||
Some(ToolKind::Hammer(_)) => {
|
||||
Some(ToolKind::Hammer) => {
|
||||
next.hand_l.position = Vec3::new(-12.0, 0.0, 0.0);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(-0.0) * Quaternion::rotation_y(0.0);
|
||||
@ -187,7 +187,7 @@ impl Animation for AlphaAnimation {
|
||||
* Quaternion::rotation_y(slowersmooth * 0.35 - 0.3)
|
||||
* Quaternion::rotation_z(1.4 + slowersmooth * 0.2);
|
||||
},
|
||||
Some(ToolKind::Debug(_)) => {
|
||||
Some(ToolKind::Debug) => {
|
||||
next.hand_l.position = Vec3::new(-7.0, 4.0, 3.0);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(1.27);
|
||||
next.main.position = Vec3::new(-5.0, 5.0, 23.0);
|
||||
|
@ -54,7 +54,7 @@ impl Animation for BeamAnimation {
|
||||
* Quaternion::rotation_z(0.0);
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
|
||||
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
|
||||
next.control.position = Vec3::new(
|
||||
s_a.stc.0 + (movement1 * 16.0) * (1.0 - movement3),
|
||||
s_a.stc.1 + (movement1 + (movement2 * 8.0).sin() * 2.0) * (1.0 - movement3),
|
||||
|
@ -85,7 +85,7 @@ impl Animation for ChargeAnimation {
|
||||
next.shorts.orientation = Quaternion::rotation_z(stop * -0.7 + tilt * 4.0);
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
|
||||
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
|
||||
next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(s_a.sthl.3);
|
||||
|
||||
@ -105,7 +105,7 @@ impl Animation for ChargeAnimation {
|
||||
* Quaternion::rotation_y(s_a.stc.4)
|
||||
* Quaternion::rotation_z(s_a.stc.5 + stop * 0.2);
|
||||
},
|
||||
Some(ToolKind::Bow(_)) => {
|
||||
Some(ToolKind::Bow) => {
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
next.hand_l.position = Vec3::new(s_a.bhl.0, s_a.bhl.1, s_a.bhl.2);
|
||||
|
@ -49,7 +49,7 @@ impl Animation for ChargeswingAnimation {
|
||||
Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powf(4.0), 0.0),
|
||||
_ => (0.0, 0.0, 0.0, 0.0),
|
||||
};
|
||||
if let Some(ToolKind::Hammer(_)) = active_tool_kind {
|
||||
if let Some(ToolKind::Hammer) = active_tool_kind {
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
next.hand_l.position = Vec3::new(
|
||||
|
@ -68,7 +68,7 @@ impl Animation for DashAnimation {
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
Some(ToolKind::Sword) => {
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
|
||||
|
@ -32,23 +32,23 @@ impl Animation for EquipAnimation {
|
||||
next.control.position = Vec3::new(equip_slowa * -1.5, 0.0, equip_slow * 1.5);
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
Some(ToolKind::Sword) => {
|
||||
next.hand_l.position = Vec3::new(-8.0, -5.0, 17.0);
|
||||
next.hand_r.position = Vec3::new(-6.0, -4.5, 14.0);
|
||||
},
|
||||
Some(ToolKind::Axe(_)) => {
|
||||
Some(ToolKind::Axe) => {
|
||||
next.hand_l.position = Vec3::new(-7.0, -5.0, 17.0);
|
||||
next.hand_r.position = Vec3::new(-5.0, -4.5, 14.0);
|
||||
},
|
||||
Some(ToolKind::Hammer(_)) => {
|
||||
Some(ToolKind::Hammer) => {
|
||||
next.hand_l.position = Vec3::new(-5.0, -5.0, 13.0);
|
||||
next.hand_r.position = Vec3::new(-3.0, -4.5, 10.0);
|
||||
},
|
||||
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
|
||||
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
|
||||
next.hand_l.position = Vec3::new(-3.0, -5.0, 8.0);
|
||||
next.hand_r.position = Vec3::new(-1.75, -4.5, 5.0);
|
||||
},
|
||||
Some(ToolKind::Bow(_)) => {
|
||||
Some(ToolKind::Bow) => {
|
||||
next.hand_l.position = Vec3::new(-3.0, -5.0, 9.0);
|
||||
next.hand_r.position = Vec3::new(-1.75, -4.5, 7.0);
|
||||
},
|
||||
|
@ -79,17 +79,17 @@ impl Animation for IdleAnimation {
|
||||
next.glider.scale = Vec3::one() * 0.0;
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Dagger(_)) => {
|
||||
Some(ToolKind::Dagger) => {
|
||||
next.main.position = Vec3::new(-4.0, -5.0, 7.0);
|
||||
next.main.orientation =
|
||||
Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(1.5 * PI);
|
||||
},
|
||||
Some(ToolKind::Shield(_)) => {
|
||||
Some(ToolKind::Shield) => {
|
||||
next.main.position = Vec3::new(-0.0, -5.0, 3.0);
|
||||
next.main.orientation =
|
||||
Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(-1.5 * PI);
|
||||
},
|
||||
Some(ToolKind::Bow(_)) => {
|
||||
Some(ToolKind::Bow) => {
|
||||
next.main.position = Vec3::new(0.0, -5.0, 6.0);
|
||||
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
|
||||
},
|
||||
@ -104,12 +104,12 @@ impl Animation for IdleAnimation {
|
||||
}
|
||||
|
||||
match second_tool_kind {
|
||||
Some(ToolKind::Dagger(_)) => {
|
||||
Some(ToolKind::Dagger) => {
|
||||
next.second.position = Vec3::new(4.0, -6.0, 7.0);
|
||||
next.second.orientation =
|
||||
Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(-1.5 * PI);
|
||||
},
|
||||
Some(ToolKind::Shield(_)) => {
|
||||
Some(ToolKind::Shield) => {
|
||||
next.second.position = Vec3::new(0.0, -4.0, 3.0);
|
||||
next.second.orientation =
|
||||
Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(1.5 * PI);
|
||||
|
@ -126,21 +126,21 @@ impl Animation for JumpAnimation {
|
||||
next.glider.scale = Vec3::one() * 0.0;
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Dagger(_)) => {
|
||||
Some(ToolKind::Dagger) => {
|
||||
next.main.position = Vec3::new(-4.0, -5.0, 7.0);
|
||||
next.main.orientation =
|
||||
Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(1.5 * PI);
|
||||
},
|
||||
Some(ToolKind::Shield(_)) => {
|
||||
Some(ToolKind::Shield) => {
|
||||
next.main.position = Vec3::new(-0.0, -5.0, 3.0);
|
||||
next.main.orientation =
|
||||
Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(-1.5 * PI);
|
||||
},
|
||||
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
|
||||
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
|
||||
next.main.position = Vec3::new(2.0, -5.0, -1.0);
|
||||
next.main.orientation = Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(1.57);
|
||||
},
|
||||
Some(ToolKind::Bow(_)) => {
|
||||
Some(ToolKind::Bow) => {
|
||||
next.main.position = Vec3::new(0.0, -5.0, 6.0);
|
||||
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
|
||||
},
|
||||
@ -151,12 +151,12 @@ impl Animation for JumpAnimation {
|
||||
}
|
||||
|
||||
match second_tool_kind {
|
||||
Some(ToolKind::Dagger(_)) => {
|
||||
Some(ToolKind::Dagger) => {
|
||||
next.second.position = Vec3::new(4.0, -6.0, 7.0);
|
||||
next.second.orientation =
|
||||
Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(-1.5 * PI);
|
||||
},
|
||||
Some(ToolKind::Shield(_)) => {
|
||||
Some(ToolKind::Shield) => {
|
||||
next.second.position = Vec3::new(0.0, -4.0, 3.0);
|
||||
next.second.orientation =
|
||||
Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(1.5 * PI);
|
||||
|
@ -39,7 +39,7 @@ impl Animation for LeapAnimation {
|
||||
_ => (0.0, 0.0, 0.0, 0.0),
|
||||
};
|
||||
|
||||
if let Some(ToolKind::Hammer(_)) = active_tool_kind {
|
||||
if let Some(ToolKind::Hammer) = active_tool_kind {
|
||||
next.hand_l.position = Vec3::new(s_a.hhl.0, s_a.hhl.1, s_a.hhl.2);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(s_a.hhl.3);
|
||||
next.hand_r.position = Vec3::new(s_a.hhr.0, s_a.hhr.1, s_a.hhr.2);
|
||||
@ -82,7 +82,7 @@ impl Animation for LeapAnimation {
|
||||
s_a.foot.2 + 5.0 + movement3 * -5.0,
|
||||
);
|
||||
next.foot_r.orientation = Quaternion::rotation_x(0.9 + movement3 * -1.7);
|
||||
} else if let Some(ToolKind::Axe(_)) = active_tool_kind {
|
||||
} else if let Some(ToolKind::Axe) = active_tool_kind {
|
||||
next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(s_a.ahl.3);
|
||||
next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
|
||||
|
@ -42,7 +42,7 @@ impl Animation for RepeaterAnimation {
|
||||
|
||||
fn fire(x: f32) -> f32 { (x * 18.0).sin() }
|
||||
|
||||
if let Some(ToolKind::Bow(_)) = active_tool_kind {
|
||||
if let Some(ToolKind::Bow) = active_tool_kind {
|
||||
next.hand_l.position = Vec3::new(s_a.bhl.0, s_a.bhl.1, s_a.bhl.2);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(s_a.bhl.3);
|
||||
next.hand_r.position = Vec3::new(s_a.bhr.0, s_a.bhr.1, s_a.bhr.2);
|
||||
|
@ -187,21 +187,21 @@ impl Animation for RunAnimation {
|
||||
next.glider.scale = Vec3::one() * 0.0;
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Dagger(_)) => {
|
||||
Some(ToolKind::Dagger) => {
|
||||
next.main.position = Vec3::new(-4.0, -5.0, 7.0);
|
||||
next.main.orientation =
|
||||
Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(1.5 * PI);
|
||||
},
|
||||
Some(ToolKind::Shield(_)) => {
|
||||
Some(ToolKind::Shield) => {
|
||||
next.main.position = Vec3::new(-0.0, -5.0, 3.0);
|
||||
next.main.orientation =
|
||||
Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(-1.5 * PI);
|
||||
},
|
||||
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
|
||||
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
|
||||
next.main.position = Vec3::new(2.0, -5.0, -1.0);
|
||||
next.main.orientation = Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(1.57);
|
||||
},
|
||||
Some(ToolKind::Bow(_)) => {
|
||||
Some(ToolKind::Bow) => {
|
||||
next.main.position = Vec3::new(0.0, -5.0, 6.0);
|
||||
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
|
||||
},
|
||||
@ -213,12 +213,12 @@ impl Animation for RunAnimation {
|
||||
}
|
||||
|
||||
match second_tool_kind {
|
||||
Some(ToolKind::Dagger(_)) => {
|
||||
Some(ToolKind::Dagger) => {
|
||||
next.second.position = Vec3::new(4.0, -6.0, 7.0);
|
||||
next.second.orientation =
|
||||
Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(-1.5 * PI);
|
||||
},
|
||||
Some(ToolKind::Shield(_)) => {
|
||||
Some(ToolKind::Shield) => {
|
||||
next.second.position = Vec3::new(0.0, -4.0, 3.0);
|
||||
next.second.orientation =
|
||||
Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(1.5 * PI);
|
||||
|
@ -55,7 +55,7 @@ impl Animation for ShootAnimation {
|
||||
next.shorts.orientation = next.chest.orientation * -0.08;
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
|
||||
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
|
||||
next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(s_a.sthl.3);
|
||||
|
||||
@ -72,7 +72,7 @@ impl Animation for ShootAnimation {
|
||||
* Quaternion::rotation_y(s_a.stc.4)
|
||||
* Quaternion::rotation_z(s_a.stc.5 + exp * 1.5);
|
||||
},
|
||||
Some(ToolKind::Bow(_)) => {
|
||||
Some(ToolKind::Bow) => {
|
||||
next.hand_l.position = Vec3::new(
|
||||
s_a.bhl.0 - exp * 2.0,
|
||||
s_a.bhl.1 - exp * 4.0,
|
||||
|
@ -54,7 +54,7 @@ impl Animation for SpinAnimation {
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
|
||||
if let Some(ToolKind::Sword(_)) = active_tool_kind {
|
||||
if let Some(ToolKind::Sword) = active_tool_kind {
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
|
||||
@ -98,8 +98,7 @@ impl Animation for SpinAnimation {
|
||||
next.torso.orientation = Quaternion::rotation_z(movement2 * 6.28);
|
||||
}
|
||||
|
||||
if let Some(ToolKind::Axe(_) | ToolKind::Hammer(_) | ToolKind::Dagger(_)) = active_tool_kind
|
||||
{
|
||||
if let Some(ToolKind::Axe | ToolKind::Hammer | ToolKind::Dagger) = active_tool_kind {
|
||||
next.hand_l.position = Vec3::new(-0.75, -1.0, -2.5);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(1.27);
|
||||
next.hand_r.position = Vec3::new(0.75, -1.5, -5.5);
|
||||
|
@ -62,7 +62,7 @@ impl Animation for SpinMeleeAnimation {
|
||||
let quick = (anim_time as f32 * lab as f32 * 8.0).sin();
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
Some(ToolKind::Sword) => {
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
|
||||
@ -90,7 +90,7 @@ impl Animation for SpinMeleeAnimation {
|
||||
next.belt.orientation = Quaternion::rotation_x(0.1);
|
||||
next.shorts.orientation = Quaternion::rotation_x(0.2);
|
||||
},
|
||||
Some(ToolKind::Axe(_)) => {
|
||||
Some(ToolKind::Axe) => {
|
||||
next.hand_l.position = Vec3::new(-0.5, 0.0, 4.0);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_y(PI);
|
||||
|
@ -96,21 +96,21 @@ impl Animation for StandAnimation {
|
||||
next.glider.scale = Vec3::one() * 0.0;
|
||||
next.hold.position = Vec3::new(0.4, -0.3, -5.8);
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Dagger(_)) => {
|
||||
Some(ToolKind::Dagger) => {
|
||||
next.main.position = Vec3::new(-4.0, -5.0, 7.0);
|
||||
next.main.orientation =
|
||||
Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(1.5 * PI);
|
||||
},
|
||||
Some(ToolKind::Shield(_)) => {
|
||||
Some(ToolKind::Shield) => {
|
||||
next.main.position = Vec3::new(-0.0, -5.0, 3.0);
|
||||
next.main.orientation =
|
||||
Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(-1.5 * PI);
|
||||
},
|
||||
Some(ToolKind::Bow(_)) => {
|
||||
Some(ToolKind::Bow) => {
|
||||
next.main.position = Vec3::new(0.0, -5.0, 6.0);
|
||||
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
|
||||
},
|
||||
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
|
||||
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
|
||||
next.main.position = Vec3::new(2.0, -5.0, -1.0);
|
||||
next.main.orientation = Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(1.57);
|
||||
},
|
||||
@ -121,12 +121,12 @@ impl Animation for StandAnimation {
|
||||
}
|
||||
|
||||
match second_tool_kind {
|
||||
Some(ToolKind::Dagger(_)) => {
|
||||
Some(ToolKind::Dagger) => {
|
||||
next.second.position = Vec3::new(4.0, -6.0, 7.0);
|
||||
next.second.orientation =
|
||||
Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(-1.5 * PI);
|
||||
},
|
||||
Some(ToolKind::Shield(_)) => {
|
||||
Some(ToolKind::Shield) => {
|
||||
next.second.position = Vec3::new(0.0, -4.0, 3.0);
|
||||
next.second.orientation =
|
||||
Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(1.5 * PI);
|
||||
|
@ -168,21 +168,21 @@ impl Animation for SwimAnimation {
|
||||
next.glider.scale = Vec3::one() * 0.0;
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Dagger(_)) => {
|
||||
Some(ToolKind::Dagger) => {
|
||||
next.main.position = Vec3::new(-4.0, -5.0, 7.0);
|
||||
next.main.orientation =
|
||||
Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(1.5 * PI);
|
||||
},
|
||||
Some(ToolKind::Shield(_)) => {
|
||||
Some(ToolKind::Shield) => {
|
||||
next.main.position = Vec3::new(-0.0, -5.0, 3.0);
|
||||
next.main.orientation =
|
||||
Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(-1.5 * PI);
|
||||
},
|
||||
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
|
||||
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
|
||||
next.main.position = Vec3::new(2.0, -5.0, -1.0);
|
||||
next.main.orientation = Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(1.57);
|
||||
},
|
||||
Some(ToolKind::Bow(_)) => {
|
||||
Some(ToolKind::Bow) => {
|
||||
next.main.position = Vec3::new(0.0, -5.0, 6.0);
|
||||
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
|
||||
},
|
||||
@ -193,12 +193,12 @@ impl Animation for SwimAnimation {
|
||||
}
|
||||
|
||||
match second_tool_kind {
|
||||
Some(ToolKind::Dagger(_)) => {
|
||||
Some(ToolKind::Dagger) => {
|
||||
next.second.position = Vec3::new(4.0, -6.0, 7.0);
|
||||
next.second.orientation =
|
||||
Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(-1.5 * PI);
|
||||
},
|
||||
Some(ToolKind::Shield(_)) => {
|
||||
Some(ToolKind::Shield) => {
|
||||
next.second.position = Vec3::new(0.0, -4.0, 3.0);
|
||||
next.second.orientation =
|
||||
Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(1.5 * PI);
|
||||
|
@ -124,7 +124,7 @@ impl Animation for SwimWieldAnimation {
|
||||
next.shorts.orientation = Quaternion::rotation_z(0.3);
|
||||
}
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
Some(ToolKind::Sword) => {
|
||||
next.hand_l.position = Vec3::new(-0.75, -1.0, -2.5);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(1.47) * Quaternion::rotation_y(-0.2);
|
||||
@ -143,7 +143,7 @@ impl Animation for SwimWieldAnimation {
|
||||
* Quaternion::rotation_y(0.0)
|
||||
* Quaternion::rotation_z(u_slowalt * 0.08);
|
||||
},
|
||||
Some(ToolKind::Dagger(_)) => {
|
||||
Some(ToolKind::Dagger) => {
|
||||
let hand_scale = 1.12;
|
||||
|
||||
next.control.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
@ -174,7 +174,7 @@ impl Animation for SwimWieldAnimation {
|
||||
|
||||
next.control_r.position = Vec3::new(7.0, 0.0, 0.0);
|
||||
},
|
||||
Some(ToolKind::Axe(_)) => {
|
||||
Some(ToolKind::Axe) => {
|
||||
if velocity < 0.5 {
|
||||
next.head.position =
|
||||
Vec3::new(0.0, -3.5 + s_a.head.0, s_a.head.1 + u_slow * 0.1);
|
||||
@ -216,7 +216,7 @@ impl Animation for SwimWieldAnimation {
|
||||
|
||||
next.control.position = Vec3::new(-3.0, 11.0, 3.0);
|
||||
},
|
||||
Some(ToolKind::Hammer(_)) => {
|
||||
Some(ToolKind::Hammer) => {
|
||||
next.hand_l.position = Vec3::new(-12.0, 0.0, 0.0);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(-0.0) * Quaternion::rotation_y(0.0);
|
||||
@ -234,7 +234,7 @@ impl Animation for SwimWieldAnimation {
|
||||
* Quaternion::rotation_y(0.0)
|
||||
* Quaternion::rotation_z(u_slowalt * 0.08);
|
||||
},
|
||||
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
|
||||
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
|
||||
next.hand_l.position = Vec3::new(1.5, 0.5, -4.0);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(1.47) * Quaternion::rotation_y(-0.3);
|
||||
@ -254,7 +254,7 @@ impl Animation for SwimWieldAnimation {
|
||||
* Quaternion::rotation_y(-0.2)
|
||||
* Quaternion::rotation_z(u_slowalt * 0.1);
|
||||
},
|
||||
Some(ToolKind::Shield(_)) => {
|
||||
Some(ToolKind::Shield) => {
|
||||
let hand_scale = 1.12;
|
||||
|
||||
next.control.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
@ -285,7 +285,7 @@ impl Animation for SwimWieldAnimation {
|
||||
|
||||
next.control_r.position = Vec3::new(7.0, 0.0, 0.0);
|
||||
},
|
||||
Some(ToolKind::Bow(_)) => {
|
||||
Some(ToolKind::Bow) => {
|
||||
next.hand_l.position = Vec3::new(2.0, 1.5, 0.0);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(1.20)
|
||||
* Quaternion::rotation_y(-0.6)
|
||||
@ -311,7 +311,7 @@ impl Animation for SwimWieldAnimation {
|
||||
next.control.orientation =
|
||||
Quaternion::rotation_x(u_slow * 0.2) * Quaternion::rotation_z(u_slowalt * 0.1);
|
||||
},
|
||||
Some(ToolKind::Debug(_)) => {
|
||||
Some(ToolKind::Debug) => {
|
||||
next.hand_l.position = Vec3::new(-7.0, 4.0, 3.0);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(1.27)
|
||||
* Quaternion::rotation_y(0.0)
|
||||
|
@ -183,7 +183,7 @@ impl Animation for WieldAnimation {
|
||||
next.shorts.position = Vec3::new(0.0, s_a.shorts.0, s_a.shorts.1);
|
||||
}
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
Some(ToolKind::Sword) => {
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
|
||||
@ -198,7 +198,7 @@ impl Animation for WieldAnimation {
|
||||
next.control.orientation = Quaternion::rotation_x(s_a.sc.3 + u_slow * 0.15)
|
||||
* Quaternion::rotation_z(u_slowalt * 0.08);
|
||||
},
|
||||
Some(ToolKind::Dagger(_)) => {
|
||||
Some(ToolKind::Dagger) => {
|
||||
next.control.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
|
||||
next.hand_l.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
@ -225,7 +225,7 @@ impl Animation for WieldAnimation {
|
||||
|
||||
next.control_r.position = Vec3::new(7.0, 0.0, 0.0);
|
||||
},
|
||||
Some(ToolKind::Axe(_)) => {
|
||||
Some(ToolKind::Axe) => {
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
|
||||
@ -258,7 +258,7 @@ impl Animation for WieldAnimation {
|
||||
* Quaternion::rotation_y(s_a.ac.4)
|
||||
* Quaternion::rotation_z(s_a.ac.5);
|
||||
},
|
||||
Some(ToolKind::Hammer(_)) => {
|
||||
Some(ToolKind::Hammer) => {
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
next.hand_l.position = Vec3::new(s_a.hhl.0, s_a.hhl.1, s_a.hhl.2);
|
||||
@ -277,7 +277,7 @@ impl Animation for WieldAnimation {
|
||||
* Quaternion::rotation_y(s_a.hc.4 + speed * -0.04)
|
||||
* Quaternion::rotation_z(s_a.hc.5 + u_slowalt * 0.07);
|
||||
},
|
||||
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
|
||||
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
|
||||
if speed > 0.5 && velocity.z == 0.0 {
|
||||
next.hand_r.position = Vec3::new(
|
||||
4.0 + s_a.hand.0 + foothoril * 1.3,
|
||||
@ -304,7 +304,7 @@ impl Animation for WieldAnimation {
|
||||
* Quaternion::rotation_y(s_a.stc.4)
|
||||
* Quaternion::rotation_z(s_a.stc.5 + u_slowalt * 0.1);
|
||||
},
|
||||
Some(ToolKind::Shield(_)) => {
|
||||
Some(ToolKind::Shield) => {
|
||||
next.control.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
|
||||
next.hand_l.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
@ -323,7 +323,7 @@ impl Animation for WieldAnimation {
|
||||
|
||||
next.control_r.position = Vec3::new(7.0, 0.0, 0.0);
|
||||
},
|
||||
Some(ToolKind::Bow(_)) => {
|
||||
Some(ToolKind::Bow) => {
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
next.hand_l.position = Vec3::new(s_a.bhl.0, s_a.bhl.1, s_a.bhl.2);
|
||||
@ -340,13 +340,13 @@ impl Animation for WieldAnimation {
|
||||
* Quaternion::rotation_y(s_a.bc.4)
|
||||
* Quaternion::rotation_z(s_a.bc.5 + u_slowalt * 0.1);
|
||||
},
|
||||
Some(ToolKind::Debug(_)) => {
|
||||
Some(ToolKind::Debug) => {
|
||||
next.hand_l.position = Vec3::new(-7.0, 4.0, 3.0);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(1.27);
|
||||
next.main.position = Vec3::new(-5.0, 5.0, 23.0);
|
||||
next.main.orientation = Quaternion::rotation_x(PI);
|
||||
},
|
||||
Some(ToolKind::Farming(_)) => {
|
||||
Some(ToolKind::Farming) => {
|
||||
if speed < 0.5 {
|
||||
next.head.orientation = Quaternion::rotation_z(head_look.x)
|
||||
* Quaternion::rotation_x(-0.2 + head_look.y.abs());
|
||||
|
@ -78,12 +78,12 @@ impl State {
|
||||
use common::comp::item::{tool::ToolKind, ItemKind};
|
||||
if let ItemKind::Tool(kind) = kind {
|
||||
match &kind.kind {
|
||||
ToolKind::Staff(_) => true,
|
||||
ToolKind::Debug(_) => true,
|
||||
ToolKind::Sword(_) => true,
|
||||
ToolKind::Hammer(_) => true,
|
||||
ToolKind::Axe(_) => true,
|
||||
ToolKind::Bow(_) => true,
|
||||
ToolKind::Staff => true,
|
||||
ToolKind::Debug => true,
|
||||
ToolKind::Sword => true,
|
||||
ToolKind::Hammer => true,
|
||||
ToolKind::Axe => true,
|
||||
ToolKind::Bow => true,
|
||||
_ => false,
|
||||
}
|
||||
} else {
|
||||
|
@ -526,28 +526,28 @@ impl<'a> Widget for Skillbar<'a> {
|
||||
.map(|i| i.item.kind())
|
||||
.and_then(|kind| match kind {
|
||||
ItemKind::Tool(Tool { kind, .. }) => match kind {
|
||||
ToolKind::Hammer(_) => Some((
|
||||
ToolKind::Hammer => Some((
|
||||
"Smash of Doom",
|
||||
"\nAn AOE attack with knockback. \nLeaps to position of \
|
||||
cursor.",
|
||||
)),
|
||||
ToolKind::Axe(_) => {
|
||||
ToolKind::Axe => {
|
||||
Some(("Spin Leap", "\nA slashing running spin leap."))
|
||||
},
|
||||
ToolKind::Staff(_) => Some((
|
||||
ToolKind::Staff => Some((
|
||||
"Firebomb",
|
||||
"\nWhirls a big fireball into the air. \nExplodes the ground \
|
||||
and does\na big amount of damage",
|
||||
)),
|
||||
ToolKind::Sword(_) => Some((
|
||||
ToolKind::Sword => Some((
|
||||
"Whirlwind",
|
||||
"\nMove forward while spinning with \n your sword.",
|
||||
)),
|
||||
ToolKind::Bow(_) => Some((
|
||||
ToolKind::Bow => Some((
|
||||
"Burst",
|
||||
"\nLaunches a burst of arrows at the top \nof a running leap.",
|
||||
)),
|
||||
ToolKind::Debug(_) => Some((
|
||||
ToolKind::Debug => Some((
|
||||
"Possessing Arrow",
|
||||
"\nShoots a poisonous arrow.\nLets you control your target.",
|
||||
)),
|
||||
@ -623,15 +623,15 @@ impl<'a> Widget for Skillbar<'a> {
|
||||
Button::image(
|
||||
match self.loadout.active_item.as_ref().map(|i| i.item.kind()) {
|
||||
Some(ItemKind::Tool(Tool { kind, .. })) => match kind {
|
||||
ToolKind::Sword(_) => self.imgs.twohsword_m1,
|
||||
ToolKind::Dagger(_) => self.imgs.onehdagger_m1,
|
||||
ToolKind::Shield(_) => self.imgs.onehshield_m1,
|
||||
ToolKind::Hammer(_) => self.imgs.twohhammer_m1,
|
||||
ToolKind::Axe(_) => self.imgs.twohaxe_m1,
|
||||
ToolKind::Bow(_) => self.imgs.bow_m1,
|
||||
ToolKind::Sceptre(_) => self.imgs.heal_0,
|
||||
ToolKind::Staff(_) => self.imgs.fireball,
|
||||
ToolKind::Debug(_) => self.imgs.flyingrod_m1,
|
||||
ToolKind::Sword => self.imgs.twohsword_m1,
|
||||
ToolKind::Dagger => self.imgs.onehdagger_m1,
|
||||
ToolKind::Shield => self.imgs.onehshield_m1,
|
||||
ToolKind::Hammer => self.imgs.twohhammer_m1,
|
||||
ToolKind::Axe => self.imgs.twohaxe_m1,
|
||||
ToolKind::Bow => self.imgs.bow_m1,
|
||||
ToolKind::Sceptre => self.imgs.heal_0,
|
||||
ToolKind::Staff => self.imgs.fireball,
|
||||
ToolKind::Debug => self.imgs.flyingrod_m1,
|
||||
_ => self.imgs.nothing,
|
||||
},
|
||||
_ => self.imgs.nothing,
|
||||
@ -670,36 +670,36 @@ impl<'a> Widget for Skillbar<'a> {
|
||||
.middle_of(state.ids.m2_slot)
|
||||
.set(state.ids.m2_slot_bg, ui);
|
||||
Button::image(match tool_kind {
|
||||
Some(ToolKind::Sword(_)) => self.imgs.twohsword_m2,
|
||||
Some(ToolKind::Dagger(_)) => self.imgs.onehdagger_m2,
|
||||
Some(ToolKind::Shield(_)) => self.imgs.onehshield_m2,
|
||||
Some(ToolKind::Hammer(_)) => self.imgs.hammergolf,
|
||||
Some(ToolKind::Axe(_)) => self.imgs.axespin,
|
||||
Some(ToolKind::Bow(_)) => self.imgs.bow_m2,
|
||||
Some(ToolKind::Sceptre(_)) => self.imgs.heal_bomb,
|
||||
Some(ToolKind::Staff(_)) => self.imgs.flamethrower,
|
||||
Some(ToolKind::Debug(_)) => self.imgs.flyingrod_m2,
|
||||
Some(ToolKind::Sword) => self.imgs.twohsword_m2,
|
||||
Some(ToolKind::Dagger) => self.imgs.onehdagger_m2,
|
||||
Some(ToolKind::Shield) => self.imgs.onehshield_m2,
|
||||
Some(ToolKind::Hammer) => self.imgs.hammergolf,
|
||||
Some(ToolKind::Axe) => self.imgs.axespin,
|
||||
Some(ToolKind::Bow) => self.imgs.bow_m2,
|
||||
Some(ToolKind::Sceptre) => self.imgs.heal_bomb,
|
||||
Some(ToolKind::Staff) => self.imgs.flamethrower,
|
||||
Some(ToolKind::Debug) => self.imgs.flyingrod_m2,
|
||||
_ => self.imgs.nothing,
|
||||
})
|
||||
.w_h(36.0, 36.0)
|
||||
.middle_of(state.ids.m2_slot_bg)
|
||||
.image_color(match tool_kind {
|
||||
// TODO Automate this to grey out unavailable M2 skills
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
Some(ToolKind::Sword) => {
|
||||
if self.energy.current() as f64 >= 200.0 {
|
||||
Color::Rgba(1.0, 1.0, 1.0, 1.0)
|
||||
} else {
|
||||
Color::Rgba(0.3, 0.3, 0.3, 0.8)
|
||||
}
|
||||
},
|
||||
Some(ToolKind::Sceptre(_)) => {
|
||||
Some(ToolKind::Sceptre) => {
|
||||
if self.energy.current() as f64 >= 400.0 {
|
||||
Color::Rgba(1.0, 1.0, 1.0, 1.0)
|
||||
} else {
|
||||
Color::Rgba(0.3, 0.3, 0.3, 0.8)
|
||||
}
|
||||
},
|
||||
Some(ToolKind::Axe(_)) => {
|
||||
Some(ToolKind::Axe) => {
|
||||
if self.energy.current() as f64 >= 100.0 {
|
||||
Color::Rgba(1.0, 1.0, 1.0, 1.0)
|
||||
} else {
|
||||
|
@ -112,12 +112,12 @@ impl<'a> SlotKey<HotbarSource<'a>, HotbarImageSource<'a>> for HotbarSlot {
|
||||
.and_then(|kind| {
|
||||
match kind {
|
||||
ItemKind::Tool(Tool { kind, .. }) => match kind {
|
||||
ToolKind::Staff(_) => Some(HotbarImage::FireAoe),
|
||||
ToolKind::Hammer(_) => Some(HotbarImage::HammerLeap),
|
||||
ToolKind::Axe(_) => Some(HotbarImage::AxeLeapSlash),
|
||||
ToolKind::Bow(_) => Some(HotbarImage::BowJumpBurst),
|
||||
ToolKind::Debug(_) => Some(HotbarImage::SnakeArrow),
|
||||
ToolKind::Sword(_) => Some(HotbarImage::SwordWhirlwind),
|
||||
ToolKind::Staff => Some(HotbarImage::FireAoe),
|
||||
ToolKind::Hammer => Some(HotbarImage::HammerLeap),
|
||||
ToolKind::Axe => Some(HotbarImage::AxeLeapSlash),
|
||||
ToolKind::Bow => Some(HotbarImage::BowJumpBurst),
|
||||
ToolKind::Debug => Some(HotbarImage::SnakeArrow),
|
||||
ToolKind::Sword => Some(HotbarImage::SwordWhirlwind),
|
||||
_ => None,
|
||||
},
|
||||
_ => None,
|
||||
|
@ -84,17 +84,17 @@ fn armor_desc(armor: &Armor, desc: &str) -> String {
|
||||
fn tool_desc(tool: &Tool, desc: &str) -> String {
|
||||
// TODO: localization
|
||||
let kind = match tool.kind {
|
||||
ToolKind::Sword(_) => "Sword",
|
||||
ToolKind::Axe(_) => "Axe",
|
||||
ToolKind::Hammer(_) => "Hammer",
|
||||
ToolKind::Bow(_) => "Bow",
|
||||
ToolKind::Dagger(_) => "Dagger",
|
||||
ToolKind::Staff(_) => "Staff",
|
||||
ToolKind::Sceptre(_) => "Sceptre",
|
||||
ToolKind::Shield(_) => "Shield",
|
||||
ToolKind::NpcWeapon(_) => "Npc Weapon",
|
||||
ToolKind::Debug(_) => "Debug",
|
||||
ToolKind::Farming(_) => "Farming Tool",
|
||||
ToolKind::Sword => "Sword",
|
||||
ToolKind::Axe => "Axe",
|
||||
ToolKind::Hammer => "Hammer",
|
||||
ToolKind::Bow => "Bow",
|
||||
ToolKind::Dagger => "Dagger",
|
||||
ToolKind::Staff => "Staff",
|
||||
ToolKind::Sceptre => "Sceptre",
|
||||
ToolKind::Shield => "Shield",
|
||||
ToolKind::Unique(_) => "Unique",
|
||||
ToolKind::Debug => "Debug",
|
||||
ToolKind::Farming => "Farming Tool",
|
||||
ToolKind::Empty => "Empty",
|
||||
};
|
||||
let power = tool.base_power();
|
||||
|
@ -1024,7 +1024,7 @@ impl FigureMgr {
|
||||
},
|
||||
CharacterState::LeapMelee(s) => {
|
||||
let stage_progress = match active_tool_kind {
|
||||
Some(ToolKind::Axe(_) | ToolKind::Hammer(_)) => {
|
||||
Some(ToolKind::Axe | ToolKind::Hammer) => {
|
||||
let stage_time = s.timer.as_secs_f64();
|
||||
match s.stage_section {
|
||||
StageSection::Buildup => {
|
||||
@ -1064,7 +1064,7 @@ impl FigureMgr {
|
||||
},
|
||||
CharacterState::SpinMelee(s) => {
|
||||
let stage_progress = match active_tool_kind {
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
Some(ToolKind::Sword) => {
|
||||
let stage_time = s.timer.as_secs_f64();
|
||||
match s.stage_section {
|
||||
StageSection::Buildup => {
|
||||
@ -2439,7 +2439,7 @@ impl FigureMgr {
|
||||
},
|
||||
CharacterState::SpinMelee(s) => {
|
||||
let stage_progress = match active_tool_kind {
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
Some(ToolKind::Sword) => {
|
||||
let stage_time = s.timer.as_secs_f64();
|
||||
match s.stage_section {
|
||||
StageSection::Buildup => {
|
||||
@ -2475,7 +2475,7 @@ impl FigureMgr {
|
||||
},
|
||||
CharacterState::LeapMelee(s) => {
|
||||
let stage_progress = match active_tool_kind {
|
||||
Some(ToolKind::Axe(_) | ToolKind::Hammer(_)) => {
|
||||
Some(ToolKind::Axe | ToolKind::Hammer) => {
|
||||
let stage_time = s.timer.as_secs_f64();
|
||||
match s.stage_section {
|
||||
StageSection::Buildup => {
|
||||
|
Loading…
Reference in New Issue
Block a user